2022-05-03 23:58:19 +02:00
|
|
|
import errors from "./errors"
|
2022-08-11 14:50:05 +02:00
|
|
|
|
2022-06-09 13:33:10 +02:00
|
|
|
const errorClasses = errors.errors
|
2022-05-03 18:13:13 +02:00
|
|
|
import * as events from "./events"
|
2022-05-04 12:22:50 +02:00
|
|
|
import * as migrations from "./migrations"
|
2022-05-05 09:32:14 +02:00
|
|
|
import * as users from "./users"
|
2022-07-25 20:45:50 +02:00
|
|
|
import * as roles from "./security/roles"
|
2022-05-26 11:13:26 +02:00
|
|
|
import * as accounts from "./cloud/accounts"
|
2022-05-28 22:38:22 +02:00
|
|
|
import * as installation from "./installation"
|
2022-05-05 09:32:14 +02:00
|
|
|
import env from "./environment"
|
|
|
|
import tenancy from "./tenancy"
|
|
|
|
import featureFlags from "./featureFlags"
|
2022-08-05 18:13:03 +02:00
|
|
|
import * as sessions from "./security/sessions"
|
2022-05-05 09:32:14 +02:00
|
|
|
import deprovisioning from "./context/deprovision"
|
2022-06-09 13:33:10 +02:00
|
|
|
import auth from "./auth"
|
|
|
|
import constants from "./constants"
|
2022-06-13 11:51:29 +02:00
|
|
|
import * as dbConstants from "./db/constants"
|
2022-07-04 16:44:47 +02:00
|
|
|
import logging from "./logging"
|
2022-08-04 21:23:45 +02:00
|
|
|
import pino from "./pino"
|
2022-05-05 09:32:14 +02:00
|
|
|
|
2022-06-09 13:33:10 +02:00
|
|
|
// mimic the outer package exports
|
|
|
|
import * as db from "./pkg/db"
|
|
|
|
import * as objectStore from "./pkg/objectStore"
|
|
|
|
import * as utils from "./pkg/utils"
|
|
|
|
import redis from "./pkg/redis"
|
|
|
|
import cache from "./pkg/cache"
|
|
|
|
import context from "./pkg/context"
|
2021-04-07 12:33:16 +02:00
|
|
|
|
2022-06-09 13:33:10 +02:00
|
|
|
const init = (opts: any = {}) => {
|
|
|
|
db.init(opts.db)
|
|
|
|
}
|
|
|
|
|
|
|
|
const core = {
|
|
|
|
init,
|
|
|
|
db,
|
2022-06-13 11:51:29 +02:00
|
|
|
...dbConstants,
|
2022-05-05 09:32:14 +02:00
|
|
|
redis,
|
|
|
|
objectStore,
|
|
|
|
utils,
|
|
|
|
users,
|
|
|
|
cache,
|
|
|
|
auth,
|
|
|
|
constants,
|
2022-06-13 11:51:29 +02:00
|
|
|
...constants,
|
2022-05-04 12:22:50 +02:00
|
|
|
migrations,
|
2022-05-05 09:32:14 +02:00
|
|
|
env,
|
|
|
|
accounts,
|
|
|
|
tenancy,
|
2022-05-23 11:29:33 +02:00
|
|
|
context,
|
2022-05-05 09:32:14 +02:00
|
|
|
featureFlags,
|
2022-05-03 18:13:13 +02:00
|
|
|
events,
|
2022-05-05 09:32:14 +02:00
|
|
|
sessions,
|
|
|
|
deprovisioning,
|
2022-05-28 22:38:22 +02:00
|
|
|
installation,
|
2022-06-09 13:33:10 +02:00
|
|
|
errors,
|
2022-07-04 16:44:47 +02:00
|
|
|
logging,
|
2022-07-25 20:45:50 +02:00
|
|
|
roles,
|
2022-08-04 21:23:45 +02:00
|
|
|
...pino,
|
2022-06-09 13:33:10 +02:00
|
|
|
...errorClasses,
|
2021-04-08 12:20:37 +02:00
|
|
|
}
|
2022-06-09 13:33:10 +02:00
|
|
|
|
|
|
|
export = core
|