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

69 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 permissions from "./security/permissions"
import * as accounts from "./cloud/accounts"
import * as installation from "./installation"
2022-05-05 09:32:14 +02:00
import env from "./environment"
import * as tenancy from "./tenancy"
import * as featureFlags from "./featureFlags"
import * as sessions from "./security/sessions"
import * as deprovisioning from "./context/deprovision"
import * as auth from "./auth"
import * as constants from "./constants"
2022-07-18 22:11:52 +02:00
import * as logging from "./logging"
import * as pino from "./pino"
import * as middleware from "./middleware"
import * as plugins from "./plugin"
import * as encryption from "./security/encryption"
import * as queue from "./queue"
import * as db from "./db"
import * as context from "./context"
import * as cache from "./cache"
import * as objectStore from "./objectStore"
import * as redis from "./redis"
import * as utils from "./utils"
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,
...constants,
2022-05-05 09:32:14 +02:00
redis,
2022-10-10 09:21:17 +02:00
locks: redis.redlock,
2022-05-05 09:32:14 +02:00
objectStore,
utils,
users,
cache,
auth,
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,
queue,
permissions,
}
2022-06-09 13:33:10 +02:00
export = core