Refactoring backend-core tenancy to context, splitting out tenancy functionality to its own area.

This commit is contained in:
mike12345567 2022-01-31 17:53:19 +00:00
parent dbc048b365
commit 72534c6ed2
10 changed files with 8 additions and 8 deletions

View File

@ -5,7 +5,7 @@ const {
getAppId, getAppId,
updateAppId, updateAppId,
doInAppContext, doInAppContext,
} = require("./src/tenancy/context") } = require("./src/context")
module.exports = { module.exports = {
getAppDB, getAppDB,

View File

@ -1 +1 @@
module.exports = require("./src/tenancy/deprovision") module.exports = require("./src/context/deprovision")

View File

@ -1,6 +1,6 @@
const { getGlobalUserParams, getAllApps } = require("../db/utils") const { getGlobalUserParams, getAllApps } = require("../db/utils")
const { getDB, getCouch } = require("../db") const { getDB, getCouch } = require("../db")
const { getGlobalDB } = require("./tenancy") const { getGlobalDB } = require("../tenancy")
const { StaticDatabases } = require("../db/constants") const { StaticDatabases } = require("../db/constants")
const TENANT_DOC = StaticDatabases.PLATFORM_INFO.docs.tenants const TENANT_DOC = StaticDatabases.PLATFORM_INFO.docs.tenants

View File

@ -5,7 +5,7 @@ const {
DEFAULT_TENANT_ID, DEFAULT_TENANT_ID,
updateAppId, updateAppId,
} = require("../tenancy") } = require("../tenancy")
const ContextFactory = require("../tenancy/FunctionContext") const ContextFactory = require("../context/FunctionContext")
const { getTenantIDFromAppID } = require("../db/utils") const { getTenantIDFromAppID } = require("../db/utils")
module.exports = () => { module.exports = () => {

View File

@ -1,5 +1,5 @@
const { setTenantId } = require("../tenancy") const { setTenantId } = require("../tenancy")
const ContextFactory = require("../tenancy/FunctionContext") const ContextFactory = require("../context/FunctionContext")
const { buildMatcherRegex, matches } = require("./matchers") const { buildMatcherRegex, matches } = require("./matchers")
module.exports = ( module.exports = (

View File

@ -6,7 +6,7 @@ const {
DocumentTypes, DocumentTypes,
SEPARATOR, SEPARATOR,
} = require("../db/utils") } = require("../db/utils")
const { getAppDB } = require("../tenancy/context") const { getAppDB } = require("../context")
const { getDB } = require("../db") const { getDB } = require("../db")
const BUILTIN_IDS = { const BUILTIN_IDS = {

View File

@ -1,4 +1,4 @@
module.exports = { module.exports = {
...require("./context"), ...require("../context"),
...require("./tenancy"), ...require("./tenancy"),
} }

View File

@ -1,6 +1,6 @@
const { getDB } = require("../db") const { getDB } = require("../db")
const { SEPARATOR, StaticDatabases, DocumentTypes } = require("../db/constants") const { SEPARATOR, StaticDatabases, DocumentTypes } = require("../db/constants")
const { getTenantId, DEFAULT_TENANT_ID, isMultiTenant } = require("./context") const { getTenantId, DEFAULT_TENANT_ID, isMultiTenant } = require("../context")
const env = require("../environment") const env = require("../environment")
const TENANT_DOC = StaticDatabases.PLATFORM_INFO.docs.tenants const TENANT_DOC = StaticDatabases.PLATFORM_INFO.docs.tenants