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

65 lines
1.4 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"
import logging from "./logging"
import pino from "./pino"
import * as middleware from "./middleware"
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,
...pino,
2022-06-09 13:33:10 +02:00
...errorClasses,
middleware,
}
2022-06-09 13:33:10 +02:00
export = core