budibase/packages/backend-core/src/index.ts

68 lines
1.5 KiB
TypeScript
Raw Normal View History

2022-05-03 23:58:19 +02:00
import errors from "./errors"
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"
import * as migrations from "./migrations"
2022-05-05 09:32:14 +02:00
import * as users from "./users"
import * as roles from "./security/roles"
import * as accounts from "./cloud/accounts"
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"
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"
import * as dbConstants from "./db/constants"
2022-07-18 22:11:52 +02:00
import * as logging from "./logging"
import pino from "./pino"
import * as middleware from "./middleware"
import plugins from "./plugin"
import encryption from "./security/encryption"
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,
...dbConstants,
2022-05-05 09:32:14 +02:00
redis,
objectStore,
utils,
users,
cache,
auth,
constants,
...constants,
migrations,
2022-05-05 09:32:14 +02:00
env,
accounts,
tenancy,
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,
installation,
2022-06-09 13:33:10 +02:00
errors,
logging,
roles,
plugins,
...pino,
2022-06-09 13:33:10 +02:00
...errorClasses,
middleware,
encryption,
}
2022-06-09 13:33:10 +02:00
export = core