@authhero/multi-tenancy 14.20.1 → 14.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- var te = Object.defineProperty;
2
- var ne = (e, t, n) => t in e ? te(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var O = (e, t, n) => ne(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { Hono as re } from "hono";
5
- import { MANAGEMENT_API_SCOPES as ae, MANAGEMENT_API_AUDIENCE as X, fetchAll as D, auth0QuerySchema as se, tenantSchema as q, tenantInsertSchema as U, deepMergePatch as oe, connectionSchema as ie, connectionOptionsSchema as ce, init as le } from "authhero";
6
- import { OpenAPIHono as ue, createRoute as M, z as I } from "@hono/zod-openapi";
7
- function de(e) {
1
+ var ne = Object.defineProperty;
2
+ var re = (e, t, n) => t in e ? ne(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var E = (e, t, n) => re(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { Hono as ae } from "hono";
5
+ import { MANAGEMENT_API_SCOPES as se, MANAGEMENT_API_AUDIENCE as Y, fetchAll as D, auth0QuerySchema as oe, tenantSchema as O, tenantInsertSchema as G, deepMergePatch as ie, connectionSchema as ce, connectionOptionsSchema as le, init as ue } from "authhero";
6
+ import { OpenAPIHono as de, createRoute as k, z as A } from "@hono/zod-openapi";
7
+ function fe(e) {
8
8
  const { controlPlaneTenantId: t, requireOrganizationMatch: n = !0 } = e;
9
9
  return {
10
10
  async onTenantAccessValidation(r, a) {
@@ -18,13 +18,13 @@ function de(e) {
18
18
  }
19
19
  };
20
20
  }
21
- function fe(e, t, n, r) {
21
+ function me(e, t, n, r) {
22
22
  if (t === n)
23
23
  return !0;
24
24
  const a = r || e;
25
25
  return a ? a.toLowerCase() === t.toLowerCase() : !1;
26
26
  }
27
- function me(e) {
27
+ function ge(e) {
28
28
  return {
29
29
  async resolveDataAdapters(t) {
30
30
  try {
@@ -39,20 +39,20 @@ function me(e) {
39
39
  }
40
40
  };
41
41
  }
42
- function ge(e) {
42
+ function we(e) {
43
43
  return `urn:authhero:tenant:${e.toLowerCase()}`;
44
44
  }
45
- function Y(e) {
45
+ function Z(e) {
46
46
  return {
47
47
  async beforeCreate(t, n) {
48
48
  return !n.audience && n.id ? {
49
49
  ...n,
50
- audience: ge(n.id)
50
+ audience: we(n.id)
51
51
  } : n;
52
52
  },
53
53
  async afterCreate(t, n) {
54
54
  const { accessControl: r, databaseIsolation: a } = e;
55
- r && t.ctx && await we(t, n, r), a != null && a.onProvision && await a.onProvision(n.id);
55
+ r && t.ctx && await he(t, n, r), a != null && a.onProvision && await a.onProvision(n.id);
56
56
  },
57
57
  async beforeDelete(t, n) {
58
58
  const { accessControl: r, databaseIsolation: a } = e;
@@ -83,7 +83,7 @@ function Y(e) {
83
83
  }
84
84
  };
85
85
  }
86
- async function we(e, t, n) {
86
+ async function he(e, t, n) {
87
87
  const {
88
88
  controlPlaneTenantId: r,
89
89
  defaultPermissions: a,
@@ -100,14 +100,14 @@ async function we(e, t, n) {
100
100
  }
101
101
  );
102
102
  let g;
103
- if (i && (g = await pe(
103
+ if (i && (g = await ye(
104
104
  e,
105
105
  r,
106
106
  c,
107
107
  u
108
108
  )), o && e.ctx) {
109
109
  const d = e.ctx.var.user;
110
- if (d != null && d.sub && !await he(
110
+ if (d != null && d.sub && !await pe(
111
111
  e,
112
112
  r,
113
113
  d.sub
@@ -123,10 +123,10 @@ async function we(e, t, n) {
123
123
  l.id
124
124
  // organizationId
125
125
  );
126
- } catch (m) {
126
+ } catch (f) {
127
127
  console.warn(
128
128
  `Failed to add creator ${d.sub} to organization ${l.id}:`,
129
- m
129
+ f
130
130
  );
131
131
  }
132
132
  }
@@ -136,7 +136,7 @@ async function we(e, t, n) {
136
136
  `Would grant permissions ${a.join(", ")} to organization ${l.id}`
137
137
  );
138
138
  }
139
- async function he(e, t, n) {
139
+ async function pe(e, t, n) {
140
140
  const r = await e.adapters.userRoles.list(
141
141
  t,
142
142
  n,
@@ -155,14 +155,14 @@ async function he(e, t, n) {
155
155
  return !0;
156
156
  return !1;
157
157
  }
158
- async function pe(e, t, n, r) {
158
+ async function ye(e, t, n, r) {
159
159
  const s = (await e.adapters.roles.list(t, {})).roles.find((o) => o.name === n);
160
160
  if (s)
161
161
  return s.id;
162
162
  const i = await e.adapters.roles.create(t, {
163
163
  name: n,
164
164
  description: r
165
- }), c = X, u = ae.map((o) => ({
165
+ }), c = Y, u = se.map((o) => ({
166
166
  role_id: i.id,
167
167
  resource_server_identifier: c,
168
168
  permission_name: o.value
@@ -173,7 +173,7 @@ async function pe(e, t, n, r) {
173
173
  u
174
174
  ), i.id;
175
175
  }
176
- function G(e, t, n = () => !0) {
176
+ function H(e, t, n = () => !0) {
177
177
  const { controlPlaneTenantId: r, getChildTenantIds: a, getAdapters: s } = e, i = /* @__PURE__ */ new Map();
178
178
  async function c(l, g, d) {
179
179
  return (await t(l).list(g, {
@@ -184,21 +184,21 @@ function G(e, t, n = () => !0) {
184
184
  async function u(l) {
185
185
  const g = await a(), d = t(await s(r));
186
186
  await Promise.all(
187
- g.map(async (f) => {
187
+ g.map(async (m) => {
188
188
  try {
189
- const m = await s(f), w = t(m), y = {
189
+ const f = await s(m), w = t(f), y = {
190
190
  ...d.transform(l),
191
191
  is_system: !0
192
- }, _ = await c(m, f, l.name), b = _ ? w.getId(_) : void 0;
192
+ }, _ = await c(f, m, l.name), b = _ ? w.getId(_) : void 0;
193
193
  if (_ && b) {
194
- const P = w.preserveOnUpdate ? w.preserveOnUpdate(_, y) : y;
195
- await w.update(f, b, P);
194
+ const I = w.preserveOnUpdate ? w.preserveOnUpdate(_, y) : y;
195
+ await w.update(m, b, I);
196
196
  } else
197
- await w.create(f, y);
198
- } catch (m) {
197
+ await w.create(m, y);
198
+ } catch (f) {
199
199
  console.error(
200
- `Failed to sync ${d.listKey} "${l.name}" to tenant "${f}":`,
201
- m
200
+ `Failed to sync ${d.listKey} "${l.name}" to tenant "${m}":`,
201
+ f
202
202
  );
203
203
  }
204
204
  })
@@ -209,12 +209,12 @@ function G(e, t, n = () => !0) {
209
209
  await Promise.all(
210
210
  g.map(async (d) => {
211
211
  try {
212
- const f = await s(d), m = t(f), w = await c(f, d, l), C = w ? m.getId(w) : void 0;
213
- w && C && await m.remove(d, C);
214
- } catch (f) {
212
+ const m = await s(d), f = t(m), w = await c(m, d, l), T = w ? f.getId(w) : void 0;
213
+ w && T && await f.remove(d, T);
214
+ } catch (m) {
215
215
  console.error(
216
216
  `Failed to delete entity "${l}" from tenant "${d}":`,
217
- f
217
+ m
218
218
  );
219
219
  }
220
220
  })
@@ -229,8 +229,8 @@ function G(e, t, n = () => !0) {
229
229
  },
230
230
  beforeDelete: async (l, g) => {
231
231
  if (l.tenantId !== r) return;
232
- const f = await t(l.adapters).get(l.tenantId, g);
233
- f && n(f) && i.set(g, f);
232
+ const m = await t(l.adapters).get(l.tenantId, g);
233
+ m && n(m) && i.set(g, m);
234
234
  },
235
235
  afterDelete: async (l, g) => {
236
236
  if (l.tenantId !== r) return;
@@ -239,29 +239,29 @@ function G(e, t, n = () => !0) {
239
239
  }
240
240
  };
241
241
  }
242
- function H(e, t, n = () => !0) {
242
+ function W(e, t, n = () => !0) {
243
243
  const { controlPlaneTenantId: r, getControlPlaneAdapters: a, getAdapters: s } = e;
244
244
  return {
245
245
  async afterCreate(i, c) {
246
246
  if (c.id !== r)
247
247
  try {
248
248
  const u = await a(), o = await s(c.id), l = t(u), g = t(o), d = await D(
249
- (f) => l.listPaginated(r, f),
249
+ (m) => l.listPaginated(r, m),
250
250
  l.listKey,
251
251
  { cursorField: "id", pageSize: 100 }
252
252
  );
253
253
  await Promise.all(
254
- d.filter((f) => n(f)).map(async (f) => {
254
+ d.filter((m) => n(m)).map(async (m) => {
255
255
  try {
256
- const m = l.transform(f);
256
+ const f = l.transform(m);
257
257
  await g.create(c.id, {
258
- ...m,
258
+ ...f,
259
259
  is_system: !0
260
260
  });
261
- } catch (m) {
261
+ } catch (f) {
262
262
  console.error(
263
263
  `Failed to sync entity to new tenant "${c.id}":`,
264
- m
264
+ f
265
265
  );
266
266
  }
267
267
  })
@@ -275,7 +275,7 @@ function H(e, t, n = () => !0) {
275
275
  }
276
276
  };
277
277
  }
278
- const W = (e) => ({
278
+ const L = (e) => ({
279
279
  list: async (t, n) => (await e.resourceServers.list(t, n)).resource_servers,
280
280
  listPaginated: (t, n) => e.resourceServers.list(t, n),
281
281
  get: (t, n) => e.resourceServers.get(t, n),
@@ -293,7 +293,7 @@ const W = (e) => ({
293
293
  token_lifetime: t.token_lifetime,
294
294
  token_lifetime_for_web: t.token_lifetime_for_web
295
295
  })
296
- }), L = (e) => ({
296
+ }), K = (e) => ({
297
297
  list: async (t, n) => (await e.roles.list(t, n)).roles,
298
298
  listPaginated: (t, n) => e.roles.list(t, n),
299
299
  get: (t, n) => e.roles.get(t, n),
@@ -308,28 +308,28 @@ const W = (e) => ({
308
308
  description: t.description
309
309
  })
310
310
  });
311
- function K(e) {
311
+ function Q(e) {
312
312
  var t;
313
313
  return ((t = e.metadata) == null ? void 0 : t.sync) !== !1;
314
314
  }
315
- function ye(e) {
316
- const { sync: t = {}, filters: n = {} } = e, r = t.resourceServers ?? !0, a = t.roles ?? !0, s = (m) => K(m) ? n.resourceServers ? n.resourceServers(m) : !0 : !1, i = (m) => K(m) ? n.roles ? n.roles(m) : !0 : !1, c = r ? G(
315
+ function ve(e) {
316
+ const { sync: t = {}, filters: n = {} } = e, r = t.resourceServers ?? !0, a = t.roles ?? !0, s = (f) => Q(f) ? n.resourceServers ? n.resourceServers(f) : !0 : !1, i = (f) => Q(f) ? n.roles ? n.roles(f) : !0 : !1, c = r ? H(
317
317
  e,
318
- W,
318
+ L,
319
319
  s
320
- ) : void 0, u = a ? G(e, L, i) : void 0, o = r ? H(
320
+ ) : void 0, u = a ? H(e, K, i) : void 0, o = r ? W(
321
321
  e,
322
- W,
322
+ L,
323
323
  s
324
- ) : void 0, l = a ? H(
324
+ ) : void 0, l = a ? W(
325
325
  e,
326
- L,
326
+ K,
327
327
  i
328
328
  ) : void 0, g = a ? {
329
- async afterCreate(m, w) {
330
- var C;
329
+ async afterCreate(f, w) {
330
+ var T;
331
331
  if (w.id !== e.controlPlaneTenantId) {
332
- await ((C = l == null ? void 0 : l.afterCreate) == null ? void 0 : C.call(l, m, w));
332
+ await ((T = l == null ? void 0 : l.afterCreate) == null ? void 0 : T.call(l, f, w));
333
333
  try {
334
334
  const y = await e.getControlPlaneAdapters(), _ = await e.getAdapters(w.id), b = await D(
335
335
  (h) => y.roles.list(
@@ -338,28 +338,28 @@ function ye(e) {
338
338
  ),
339
339
  "roles",
340
340
  { cursorField: "id", pageSize: 100 }
341
- ), P = /* @__PURE__ */ new Map();
341
+ ), I = /* @__PURE__ */ new Map();
342
342
  for (const h of b.filter(
343
- (T) => {
343
+ (C) => {
344
344
  var p;
345
- return ((p = n.roles) == null ? void 0 : p.call(n, T)) ?? !0;
345
+ return ((p = n.roles) == null ? void 0 : p.call(n, C)) ?? !0;
346
346
  }
347
347
  )) {
348
- const T = await d(
348
+ const C = await d(
349
349
  _,
350
350
  w.id,
351
351
  h.name
352
352
  );
353
- T && P.set(h.name, T.id);
353
+ C && I.set(h.name, C.id);
354
354
  }
355
355
  for (const h of b.filter(
356
- (T) => {
356
+ (C) => {
357
357
  var p;
358
- return ((p = n.roles) == null ? void 0 : p.call(n, T)) ?? !0;
358
+ return ((p = n.roles) == null ? void 0 : p.call(n, C)) ?? !0;
359
359
  }
360
360
  )) {
361
- const T = P.get(h.name);
362
- if (T)
361
+ const C = I.get(h.name);
362
+ if (C)
363
363
  try {
364
364
  const p = await y.rolePermissions.list(
365
365
  e.controlPlaneTenantId,
@@ -368,11 +368,11 @@ function ye(e) {
368
368
  );
369
369
  p.length > 0 && await _.rolePermissions.assign(
370
370
  w.id,
371
- T,
372
- p.map((z) => ({
373
- role_id: T,
374
- resource_server_identifier: z.resource_server_identifier,
375
- permission_name: z.permission_name
371
+ C,
372
+ p.map((F) => ({
373
+ role_id: C,
374
+ resource_server_identifier: F.resource_server_identifier,
375
+ permission_name: F.permission_name
376
376
  }))
377
377
  );
378
378
  } catch (p) {
@@ -391,9 +391,9 @@ function ye(e) {
391
391
  }
392
392
  }
393
393
  } : void 0;
394
- async function d(m, w, C) {
395
- return (await m.roles.list(w, {
396
- q: `name:${C}`,
394
+ async function d(f, w, T) {
395
+ return (await f.roles.list(w, {
396
+ q: `name:${T}`,
397
397
  per_page: 1
398
398
  })).roles[0] ?? null;
399
399
  }
@@ -403,15 +403,15 @@ function ye(e) {
403
403
  roles: u
404
404
  },
405
405
  tenantHooks: {
406
- async afterCreate(m, w) {
407
- const C = [
406
+ async afterCreate(f, w) {
407
+ const T = [
408
408
  o == null ? void 0 : o.afterCreate,
409
409
  (g == null ? void 0 : g.afterCreate) ?? (l == null ? void 0 : l.afterCreate)
410
410
  ], y = [];
411
- for (const _ of C)
411
+ for (const _ of T)
412
412
  if (_)
413
413
  try {
414
- await _(m, w);
414
+ await _(f, w);
415
415
  } catch (b) {
416
416
  y.push(b instanceof Error ? b : new Error(String(b)));
417
417
  }
@@ -425,7 +425,7 @@ function ye(e) {
425
425
  }
426
426
  };
427
427
  }
428
- var A = class extends Error {
428
+ var P = class extends Error {
429
429
  /**
430
430
  * Creates an instance of `HTTPException`.
431
431
  * @param status - HTTP status code for the exception. Defaults to 500.
@@ -433,8 +433,8 @@ var A = class extends Error {
433
433
  */
434
434
  constructor(t = 500, n) {
435
435
  super(n == null ? void 0 : n.message, { cause: n == null ? void 0 : n.cause });
436
- O(this, "res");
437
- O(this, "status");
436
+ E(this, "res");
437
+ E(this, "status");
438
438
  this.res = n == null ? void 0 : n.res, this.status = t;
439
439
  }
440
440
  /**
@@ -452,29 +452,29 @@ var A = class extends Error {
452
452
  }
453
453
  };
454
454
  function N(e, t) {
455
- const n = new ue();
455
+ const n = new de();
456
456
  return n.openapi(
457
- M({
457
+ k({
458
458
  tags: ["tenants"],
459
459
  method: "get",
460
460
  path: "/",
461
461
  request: {
462
- query: se
462
+ query: oe
463
463
  },
464
464
  security: [
465
465
  {
466
- Bearer: []
466
+ Bearer: ["read:tenants", "auth:read"]
467
467
  }
468
468
  ],
469
469
  responses: {
470
470
  200: {
471
471
  content: {
472
472
  "application/json": {
473
- schema: I.object({
474
- tenants: I.array(q),
475
- start: I.number().optional(),
476
- limit: I.number().optional(),
477
- length: I.number().optional()
473
+ schema: A.object({
474
+ tenants: A.array(O),
475
+ start: A.number().optional(),
476
+ limit: A.number().optional(),
477
+ length: A.number().optional()
478
478
  })
479
479
  }
480
480
  },
@@ -483,59 +483,59 @@ function N(e, t) {
483
483
  }
484
484
  }),
485
485
  async (r) => {
486
- var m, w, C, y, _, b;
486
+ var w, T, y, _, b, I;
487
487
  const a = r.req.valid("query"), { page: s, per_page: i, include_totals: c, q: u } = a, o = r.var.user, l = (o == null ? void 0 : o.permissions) || [];
488
- if (l.includes("auth:read") || l.includes("admin:organizations")) {
489
- const P = await r.env.data.tenants.list({
488
+ if (!!!((o == null ? void 0 : o.org_id) ?? r.var.organization_id) && (l.includes("auth:read") || l.includes("admin:organizations"))) {
489
+ const h = await r.env.data.tenants.list({
490
490
  page: s,
491
491
  per_page: i,
492
492
  include_totals: c,
493
493
  q: u
494
494
  });
495
495
  return c ? r.json({
496
- tenants: P.tenants,
497
- start: ((m = P.totals) == null ? void 0 : m.start) ?? 0,
498
- limit: ((w = P.totals) == null ? void 0 : w.limit) ?? i,
499
- length: P.tenants.length
500
- }) : r.json({ tenants: P.tenants });
496
+ tenants: h.tenants,
497
+ start: ((w = h.totals) == null ? void 0 : w.start) ?? 0,
498
+ limit: ((T = h.totals) == null ? void 0 : T.limit) ?? i,
499
+ length: h.tenants.length
500
+ }) : r.json({ tenants: h.tenants });
501
501
  }
502
- const d = ((C = e.accessControl) == null ? void 0 : C.controlPlaneTenantId) ?? ((y = r.env.data.multiTenancyConfig) == null ? void 0 : y.controlPlaneTenantId);
503
- if (d && (o != null && o.sub)) {
504
- const h = (await D(
505
- (R) => r.env.data.userOrganizations.listUserOrganizations(
506
- d,
502
+ const m = ((y = e.accessControl) == null ? void 0 : y.controlPlaneTenantId) ?? ((_ = r.env.data.multiTenancyConfig) == null ? void 0 : _.controlPlaneTenantId);
503
+ if (m && (o != null && o.sub)) {
504
+ const C = (await D(
505
+ (M) => r.env.data.userOrganizations.listUserOrganizations(
506
+ m,
507
507
  o.sub,
508
- R
508
+ M
509
509
  ),
510
510
  "organizations"
511
- )).map((R) => R.name);
512
- if (h.length === 0)
511
+ )).map((M) => M.name);
512
+ if (C.length === 0)
513
513
  return c ? r.json({
514
514
  tenants: [],
515
515
  start: 0,
516
516
  limit: i ?? 50,
517
517
  length: 0
518
518
  }) : r.json({ tenants: [] });
519
- const T = h.length, p = s ?? 0, z = i ?? 50, j = p * z, F = h.slice(j, j + z);
520
- if (F.length === 0)
519
+ const p = C.length, F = s ?? 0, $ = i ?? 50, R = F * $, S = C.slice(R, R + $);
520
+ if (S.length === 0)
521
521
  return c ? r.json({
522
522
  tenants: [],
523
- start: j,
524
- limit: z,
525
- length: T
523
+ start: R,
524
+ limit: $,
525
+ length: p
526
526
  }) : r.json({ tenants: [] });
527
- const S = F.map((R) => `id:${R}`).join(" OR "), v = u ? `(${S}) AND (${u})` : S, $ = await r.env.data.tenants.list({
528
- q: v,
529
- per_page: z,
527
+ const v = S.map((M) => `id:${M}`).join(" OR "), j = u ? `(${v}) AND (${u})` : v, z = await r.env.data.tenants.list({
528
+ q: j,
529
+ per_page: $,
530
530
  include_totals: !1
531
531
  // We calculate totals from accessibleTenantIds
532
532
  });
533
533
  return c ? r.json({
534
- tenants: $.tenants,
535
- start: j,
536
- limit: z,
537
- length: T
538
- }) : r.json({ tenants: $.tenants });
534
+ tenants: z.tenants,
535
+ start: R,
536
+ limit: $,
537
+ length: p
538
+ }) : r.json({ tenants: z.tenants });
539
539
  }
540
540
  const f = await r.env.data.tenants.list({
541
541
  page: s,
@@ -545,13 +545,13 @@ function N(e, t) {
545
545
  });
546
546
  return c ? r.json({
547
547
  tenants: f.tenants,
548
- start: ((_ = f.totals) == null ? void 0 : _.start) ?? 0,
549
- limit: ((b = f.totals) == null ? void 0 : b.limit) ?? i,
548
+ start: ((b = f.totals) == null ? void 0 : b.start) ?? 0,
549
+ limit: ((I = f.totals) == null ? void 0 : I.limit) ?? i,
550
550
  length: f.tenants.length
551
551
  }) : r.json({ tenants: f.tenants });
552
552
  }
553
553
  ), n.openapi(
554
- M({
554
+ k({
555
555
  tags: ["tenants"],
556
556
  method: "post",
557
557
  path: "/",
@@ -559,7 +559,7 @@ function N(e, t) {
559
559
  body: {
560
560
  content: {
561
561
  "application/json": {
562
- schema: U
562
+ schema: G
563
563
  }
564
564
  }
565
565
  }
@@ -573,7 +573,7 @@ function N(e, t) {
573
573
  201: {
574
574
  content: {
575
575
  "application/json": {
576
- schema: q
576
+ schema: O
577
577
  }
578
578
  },
579
579
  description: "Tenant created"
@@ -590,7 +590,7 @@ function N(e, t) {
590
590
  var u, o;
591
591
  const a = r.var.user;
592
592
  if (!(a != null && a.sub))
593
- throw new A(401, {
593
+ throw new P(401, {
594
594
  message: "Authentication required to create tenants"
595
595
  });
596
596
  let s = r.req.valid("json");
@@ -603,13 +603,13 @@ function N(e, t) {
603
603
  return (o = t.tenants) != null && o.afterCreate && await t.tenants.afterCreate(i, c), r.json(c, 201);
604
604
  }
605
605
  ), n.openapi(
606
- M({
606
+ k({
607
607
  tags: ["tenants"],
608
608
  method: "delete",
609
609
  path: "/{id}",
610
610
  request: {
611
- params: I.object({
612
- id: I.string()
611
+ params: A.object({
612
+ id: A.string()
613
613
  })
614
614
  },
615
615
  security: [
@@ -635,11 +635,11 @@ function N(e, t) {
635
635
  if (s) {
636
636
  const d = r.var.user;
637
637
  if (!(d != null && d.sub))
638
- throw new A(401, {
638
+ throw new P(401, {
639
639
  message: "Authentication required"
640
640
  });
641
641
  if (a === s)
642
- throw new A(403, {
642
+ throw new P(403, {
643
643
  message: "Cannot delete the control plane"
644
644
  });
645
645
  if (!(await D(
@@ -650,12 +650,12 @@ function N(e, t) {
650
650
  ),
651
651
  "organizations"
652
652
  )).some((w) => w.name === a))
653
- throw new A(403, {
653
+ throw new P(403, {
654
654
  message: "Access denied to this tenant"
655
655
  });
656
656
  }
657
657
  if (!await r.env.data.tenants.get(a))
658
- throw new A(404, {
658
+ throw new P(404, {
659
659
  message: "Tenant not found"
660
660
  });
661
661
  const c = {
@@ -665,13 +665,13 @@ function N(e, t) {
665
665
  return (l = t.tenants) != null && l.beforeDelete && await t.tenants.beforeDelete(c, a), await r.env.data.tenants.remove(a), (g = t.tenants) != null && g.afterDelete && await t.tenants.afterDelete(c, a), r.body(null, 204);
666
666
  }
667
667
  ), n.openapi(
668
- M({
668
+ k({
669
669
  tags: ["tenants", "settings"],
670
670
  method: "get",
671
671
  path: "/settings",
672
672
  request: {
673
- headers: I.object({
674
- "tenant-id": I.string().optional()
673
+ headers: A.object({
674
+ "tenant-id": A.string().optional()
675
675
  })
676
676
  },
677
677
  security: [
@@ -683,7 +683,7 @@ function N(e, t) {
683
683
  200: {
684
684
  content: {
685
685
  "application/json": {
686
- schema: q
686
+ schema: O
687
687
  }
688
688
  },
689
689
  description: "Current tenant settings"
@@ -693,24 +693,24 @@ function N(e, t) {
693
693
  async (r) => {
694
694
  const a = await r.env.data.tenants.get(r.var.tenant_id);
695
695
  if (!a)
696
- throw new A(404, {
696
+ throw new P(404, {
697
697
  message: "Tenant not found"
698
698
  });
699
699
  return r.json(a);
700
700
  }
701
701
  ), n.openapi(
702
- M({
702
+ k({
703
703
  tags: ["tenants", "settings"],
704
704
  method: "patch",
705
705
  path: "/settings",
706
706
  request: {
707
- headers: I.object({
708
- "tenant-id": I.string().optional()
707
+ headers: A.object({
708
+ "tenant-id": A.string().optional()
709
709
  }),
710
710
  body: {
711
711
  content: {
712
712
  "application/json": {
713
- schema: I.object(U.shape).partial()
713
+ schema: A.object(G.shape).partial()
714
714
  }
715
715
  }
716
716
  }
@@ -724,7 +724,7 @@ function N(e, t) {
724
724
  200: {
725
725
  content: {
726
726
  "application/json": {
727
- schema: q
727
+ schema: O
728
728
  }
729
729
  },
730
730
  description: "Updated tenant settings"
@@ -734,21 +734,21 @@ function N(e, t) {
734
734
  async (r) => {
735
735
  const a = r.req.valid("json"), { id: s, ...i } = a, c = await r.env.data.tenants.get(r.var.tenant_id);
736
736
  if (!c)
737
- throw new A(404, {
737
+ throw new P(404, {
738
738
  message: "Tenant not found"
739
739
  });
740
- const u = oe(c, i);
740
+ const u = ie(c, i);
741
741
  await r.env.data.tenants.update(r.var.tenant_id, u);
742
742
  const o = await r.env.data.tenants.get(r.var.tenant_id);
743
743
  if (!o)
744
- throw new A(500, {
744
+ throw new P(500, {
745
745
  message: "Failed to retrieve updated tenant"
746
746
  });
747
747
  return r.json(o);
748
748
  }
749
749
  ), n;
750
750
  }
751
- function ve(e) {
751
+ function _e(e) {
752
752
  const t = [
753
753
  {
754
754
  pattern: /\/api\/v2\/resource-servers\/([^/]+)$/,
@@ -764,7 +764,7 @@ function ve(e) {
764
764
  }
765
765
  return null;
766
766
  }
767
- async function _e(e, t, n) {
767
+ async function Ce(e, t, n) {
768
768
  try {
769
769
  switch (n.type) {
770
770
  case "resource_server": {
@@ -786,50 +786,50 @@ async function _e(e, t, n) {
786
786
  return !1;
787
787
  }
788
788
  }
789
- function Ce(e) {
789
+ function Te(e) {
790
790
  return {
791
791
  resource_server: "resource server",
792
792
  role: "role",
793
793
  connection: "connection"
794
794
  }[e];
795
795
  }
796
- function Te() {
796
+ function be() {
797
797
  return async (e, t) => {
798
798
  if (!["PATCH", "PUT", "DELETE"].includes(e.req.method))
799
799
  return t();
800
- const n = ve(e.req.path);
800
+ const n = _e(e.req.path);
801
801
  if (!n)
802
802
  return t();
803
803
  const r = e.var.tenant_id || e.req.header("x-tenant-id") || e.req.header("tenant-id");
804
804
  if (!r)
805
805
  return t();
806
- if (await _e(e.env.data, r, n))
807
- throw new A(403, {
808
- message: `This ${Ce(n.type)} is a system resource and cannot be modified. Make changes in the control plane instead.`
806
+ if (await Ce(e.env.data, r, n))
807
+ throw new P(403, {
808
+ message: `This ${Te(n.type)} is a system resource and cannot be modified. Make changes in the control plane instead.`
809
809
  });
810
810
  return t();
811
811
  };
812
812
  }
813
- function E(e, t) {
813
+ function B(e, t) {
814
814
  const n = t.find(
815
815
  (a) => a.strategy === e.strategy
816
816
  );
817
817
  if (!(n != null && n.options))
818
818
  return e;
819
- const r = ie.passthrough().parse({
819
+ const r = ce.passthrough().parse({
820
820
  ...n,
821
821
  ...e
822
822
  });
823
- return r.options = ce.passthrough().parse({
823
+ return r.options = le.passthrough().parse({
824
824
  ...n.options || {},
825
825
  ...e.options
826
826
  }), r;
827
827
  }
828
- function k(e, t) {
828
+ function q(e, t) {
829
829
  const n = [...t || [], ...e || []];
830
830
  return [...new Set(n)];
831
831
  }
832
- function be(e, t) {
832
+ function Pe(e, t) {
833
833
  if (!(t != null && t.length))
834
834
  return e || [];
835
835
  if (!(e != null && e.length))
@@ -841,34 +841,34 @@ function be(e, t) {
841
841
  n.set(r.value, r);
842
842
  return Array.from(n.values());
843
843
  }
844
- function Q(e, t) {
844
+ function V(e, t) {
845
845
  return t ? {
846
846
  ...e,
847
- scopes: be(
847
+ scopes: Pe(
848
848
  e.scopes,
849
849
  t.scopes
850
850
  )
851
851
  } : e;
852
852
  }
853
- function V(e, t) {
853
+ function J(e, t) {
854
854
  return t ? {
855
855
  ...e,
856
- callbacks: k(e.callbacks, t.callbacks),
857
- web_origins: k(
856
+ callbacks: q(e.callbacks, t.callbacks),
857
+ web_origins: q(
858
858
  e.web_origins,
859
859
  t.web_origins
860
860
  ),
861
- allowed_logout_urls: k(
861
+ allowed_logout_urls: q(
862
862
  e.allowed_logout_urls,
863
863
  t.allowed_logout_urls
864
864
  ),
865
- allowed_origins: k(
865
+ allowed_origins: q(
866
866
  e.allowed_origins,
867
867
  t.allowed_origins
868
868
  )
869
869
  } : e;
870
870
  }
871
- function Z(e, t) {
871
+ function x(e, t) {
872
872
  return {
873
873
  ...e.resourceServers,
874
874
  get: async (n, r) => {
@@ -882,7 +882,7 @@ function Z(e, t) {
882
882
  t,
883
883
  r
884
884
  );
885
- return Q(
885
+ return V(
886
886
  a,
887
887
  s
888
888
  );
@@ -904,7 +904,7 @@ function Z(e, t) {
904
904
  })
905
905
  );
906
906
  const u = a.resource_servers.map(
907
- (o) => o.is_system && o.id ? Q(
907
+ (o) => o.is_system && o.id ? V(
908
908
  o,
909
909
  c.get(o.id) ?? null
910
910
  ) : o
@@ -916,10 +916,10 @@ function Z(e, t) {
916
916
  }
917
917
  };
918
918
  }
919
- function Pe(e, t) {
919
+ function Se(e, t) {
920
920
  return {
921
921
  ...e,
922
- resourceServers: Z(
922
+ resourceServers: x(
923
923
  e,
924
924
  t.controlPlaneTenantId
925
925
  )
@@ -944,7 +944,7 @@ function Ae(e, t) {
944
944
  if (!i || !n || a === n)
945
945
  return i;
946
946
  const c = await e.connections.list(n);
947
- return E(
947
+ return B(
948
948
  i,
949
949
  c.connections || []
950
950
  );
@@ -954,7 +954,7 @@ function Ae(e, t) {
954
954
  if (!n || a === n)
955
955
  return i;
956
956
  const c = await e.connections.list(n), u = i.connections.map(
957
- (o) => E(
957
+ (o) => B(
958
958
  o,
959
959
  c.connections || []
960
960
  )
@@ -976,7 +976,7 @@ function Ae(e, t) {
976
976
  return i;
977
977
  const c = await e.connections.list(n);
978
978
  return i.map(
979
- (u) => E(
979
+ (u) => B(
980
980
  u,
981
981
  c.connections || []
982
982
  )
@@ -995,7 +995,7 @@ function Ae(e, t) {
995
995
  n,
996
996
  r
997
997
  );
998
- return V(i, c);
998
+ return J(i, c);
999
999
  },
1000
1000
  getByClientId: async (a) => {
1001
1001
  const s = await e.clients.getByClientId(a);
@@ -1008,7 +1008,7 @@ function Ae(e, t) {
1008
1008
  r
1009
1009
  );
1010
1010
  return {
1011
- ...V(s, i),
1011
+ ...J(s, i),
1012
1012
  tenant_id: s.tenant_id
1013
1013
  };
1014
1014
  }
@@ -1020,22 +1020,22 @@ function Ae(e, t) {
1020
1020
  return s || (!n || a === n ? null : e.emailProviders.get(n));
1021
1021
  }
1022
1022
  },
1023
- resourceServers: Z(
1023
+ resourceServers: x(
1024
1024
  e,
1025
1025
  n
1026
1026
  ),
1027
- hooks: Se(e, n)
1027
+ hooks: Ie(e, n)
1028
1028
  // Note: Additional adapters can be extended here for runtime fallback:
1029
1029
  // - promptSettings: Fall back to control plane prompts
1030
1030
  // - branding: Fall back to control plane branding/themes
1031
1031
  };
1032
1032
  }
1033
- function J(e) {
1033
+ function X(e) {
1034
1034
  if (!e || typeof e != "object") return !1;
1035
1035
  const t = e.metadata;
1036
1036
  return !t || typeof t != "object" ? !1 : t.inheritable === !0;
1037
1037
  }
1038
- function Se(e, t) {
1038
+ function Ie(e, t) {
1039
1039
  return {
1040
1040
  ...e.hooks,
1041
1041
  list: async (n, r) => {
@@ -1046,13 +1046,11 @@ function Se(e, t) {
1046
1046
  t,
1047
1047
  r
1048
1048
  )).hooks || []).filter(
1049
- J
1049
+ X
1050
1050
  );
1051
1051
  if (i.length === 0)
1052
1052
  return a;
1053
- const c = new Set(
1054
- (a.hooks || []).map((o) => o.hook_id)
1055
- ), u = i.filter((o) => !c.has(o.hook_id));
1053
+ const c = new Set((a.hooks || []).map((o) => o.hook_id)), u = i.filter((o) => !c.has(o.hook_id));
1056
1054
  return {
1057
1055
  ...a,
1058
1056
  hooks: [...a.hooks || [], ...u],
@@ -1067,43 +1065,43 @@ function Se(e, t) {
1067
1065
  t,
1068
1066
  r
1069
1067
  );
1070
- return s && J(s) ? s : null;
1068
+ return s && X(s) ? s : null;
1071
1069
  }
1072
1070
  };
1073
1071
  }
1074
- function x(e, t) {
1072
+ function ee(e, t) {
1075
1073
  return Ae(e, t);
1076
1074
  }
1077
- function Ie(e) {
1075
+ function Re(e) {
1078
1076
  return async (t, n) => {
1079
1077
  const r = t.var.user;
1080
1078
  return (r == null ? void 0 : r.tenant_id) === e && r.org_name && t.set("tenant_id", r.org_name), n();
1081
1079
  };
1082
1080
  }
1083
- function Re(e) {
1081
+ function ze(e) {
1084
1082
  return async (t, n) => {
1085
1083
  if (!e.accessControl)
1086
1084
  return n();
1087
1085
  const { controlPlaneTenantId: r } = e.accessControl, a = t.var.org_name, s = t.var.organization_id, i = a || s;
1088
1086
  let c = t.var.tenant_id;
1089
- const u = t.var.user, l = (u != null && u.aud ? Array.isArray(u.aud) ? u.aud : [u.aud] : []).includes(X);
1087
+ const u = t.var.user, l = (u != null && u.aud ? Array.isArray(u.aud) ? u.aud : [u.aud] : []).includes(Y);
1090
1088
  if (!c && i && l && (t.set("tenant_id", i), c = i), !c)
1091
- throw new A(400, {
1089
+ throw new P(400, {
1092
1090
  message: "Tenant ID not found in request"
1093
1091
  });
1094
- if (!fe(
1092
+ if (!me(
1095
1093
  s,
1096
1094
  c,
1097
1095
  r,
1098
1096
  a
1099
1097
  ))
1100
- throw new A(403, {
1098
+ throw new P(403, {
1101
1099
  message: `Access denied to tenant ${c}`
1102
1100
  });
1103
1101
  return n();
1104
1102
  };
1105
1103
  }
1106
- function ze(e) {
1104
+ function $e(e) {
1107
1105
  return async (t, n) => {
1108
1106
  if (!e.subdomainRouting)
1109
1107
  return n();
@@ -1132,19 +1130,19 @@ function ze(e) {
1132
1130
  } catch {
1133
1131
  }
1134
1132
  if (!u)
1135
- throw new A(404, {
1133
+ throw new P(404, {
1136
1134
  message: `Tenant not found for subdomain: ${c}`
1137
1135
  });
1138
1136
  return t.set("tenant_id", u), n();
1139
1137
  };
1140
1138
  }
1141
- function $e(e) {
1139
+ function je(e) {
1142
1140
  return async (t, n) => {
1143
1141
  if (!e.databaseIsolation)
1144
1142
  return n();
1145
1143
  const r = t.var.tenant_id;
1146
1144
  if (!r)
1147
- throw new A(400, {
1145
+ throw new P(400, {
1148
1146
  message: "Tenant ID not found in request"
1149
1147
  });
1150
1148
  try {
@@ -1154,21 +1152,21 @@ function $e(e) {
1154
1152
  throw console.error(
1155
1153
  `Failed to resolve database for tenant ${r}:`,
1156
1154
  a
1157
- ), new A(500, {
1155
+ ), new P(500, {
1158
1156
  message: "Failed to resolve tenant database"
1159
1157
  });
1160
1158
  }
1161
1159
  return n();
1162
1160
  };
1163
1161
  }
1164
- function ee(e) {
1165
- const t = ze(e), n = Re(e), r = $e(e);
1162
+ function te(e) {
1163
+ const t = $e(e), n = ze(e), r = je(e);
1166
1164
  return async (a, s) => (await t(a, async () => {
1167
1165
  }), await n(a, async () => {
1168
1166
  }), await r(a, async () => {
1169
1167
  }), s());
1170
1168
  }
1171
- function ke(e) {
1169
+ function qe(e) {
1172
1170
  const {
1173
1171
  dataAdapter: t,
1174
1172
  controlPlane: n,
@@ -1185,12 +1183,12 @@ function ke(e) {
1185
1183
  getAdapters: g,
1186
1184
  ...d
1187
1185
  } = e;
1188
- let f = t, m = t;
1189
- n && (f = x(t, {
1186
+ let m = t, f = t;
1187
+ n && (m = ee(t, {
1190
1188
  controlPlaneTenantId: r,
1191
1189
  controlPlaneClientId: a
1192
- }), m = {
1193
- ...Pe(t, {
1190
+ }), f = {
1191
+ ...Se(t, {
1194
1192
  controlPlaneTenantId: r
1195
1193
  }),
1196
1194
  multiTenancyConfig: {
@@ -1198,35 +1196,35 @@ function ke(e) {
1198
1196
  controlPlaneClientId: a
1199
1197
  }
1200
1198
  });
1201
- const w = s !== !1, C = w ? {
1199
+ const w = s !== !1, T = w ? {
1202
1200
  resourceServers: s.resourceServers ?? !0,
1203
1201
  roles: s.roles ?? !0
1204
1202
  } : { resourceServers: !1, roles: !1 }, b = {
1205
1203
  controlPlaneTenantId: r,
1206
1204
  getChildTenantIds: l ?? (async () => (await D(
1207
- (v) => f.tenants.list(v),
1205
+ (v) => m.tenants.list(v),
1208
1206
  "tenants",
1209
1207
  { cursorField: "id", pageSize: 100 }
1210
1208
  )).filter((v) => v.id !== r).map((v) => v.id)),
1211
- getAdapters: g ?? (async () => f),
1212
- getControlPlaneAdapters: async () => f,
1213
- sync: C
1214
- }, { entityHooks: P, tenantHooks: h } = ye(b), T = {
1209
+ getAdapters: g ?? (async () => m),
1210
+ getControlPlaneAdapters: async () => m,
1211
+ sync: T
1212
+ }, { entityHooks: I, tenantHooks: h } = ve(b), C = {
1215
1213
  resourceServers: [
1216
- P.resourceServers,
1214
+ I.resourceServers,
1217
1215
  ...(o == null ? void 0 : o.resourceServers) ?? []
1218
1216
  ],
1219
- roles: [P.roles, ...(o == null ? void 0 : o.roles) ?? []],
1217
+ roles: [I.roles, ...(o == null ? void 0 : o.roles) ?? []],
1220
1218
  connections: (o == null ? void 0 : o.connections) ?? [],
1221
1219
  tenants: (o == null ? void 0 : o.tenants) ?? [],
1222
1220
  rolePermissions: (o == null ? void 0 : o.rolePermissions) ?? []
1223
- }, p = Y({
1221
+ }, p = Z({
1224
1222
  accessControl: {
1225
1223
  controlPlaneTenantId: r,
1226
1224
  requireOrganizationMatch: c,
1227
1225
  defaultPermissions: i
1228
1226
  }
1229
- }), j = N(
1227
+ }), $ = N(
1230
1228
  {
1231
1229
  accessControl: {
1232
1230
  controlPlaneTenantId: r,
@@ -1239,35 +1237,35 @@ function ke(e) {
1239
1237
  return p.beforeCreate && (v = await p.beforeCreate(S, v)), h.beforeCreate && (v = await h.beforeCreate(S, v)), v;
1240
1238
  },
1241
1239
  async afterCreate(S, v) {
1242
- var $, R;
1243
- await (($ = p.afterCreate) == null ? void 0 : $.call(p, S, v)), await ((R = h.afterCreate) == null ? void 0 : R.call(h, S, v));
1240
+ var j, z;
1241
+ await ((j = p.afterCreate) == null ? void 0 : j.call(p, S, v)), await ((z = h.afterCreate) == null ? void 0 : z.call(h, S, v));
1244
1242
  },
1245
1243
  async beforeDelete(S, v) {
1246
- var $, R;
1247
- await (($ = p.beforeDelete) == null ? void 0 : $.call(p, S, v)), await ((R = h.beforeDelete) == null ? void 0 : R.call(h, S, v));
1244
+ var j, z;
1245
+ await ((j = p.beforeDelete) == null ? void 0 : j.call(p, S, v)), await ((z = h.beforeDelete) == null ? void 0 : z.call(h, S, v));
1248
1246
  }
1249
1247
  } }
1250
- ), { app: F } = le({
1251
- dataAdapter: f,
1252
- managementDataAdapter: m,
1248
+ ), { app: R } = ue({
1249
+ dataAdapter: m,
1250
+ managementDataAdapter: f,
1253
1251
  ...d,
1254
- entityHooks: T,
1252
+ entityHooks: C,
1255
1253
  managementApiExtensions: [
1256
1254
  ...u,
1257
- { path: "/tenants", router: j }
1255
+ { path: "/tenants", router: $ }
1258
1256
  ]
1259
1257
  });
1260
- return F.use(
1258
+ return R.use(
1261
1259
  "/api/v2/*",
1262
- Ie(r)
1263
- ), w && F.use("/api/v2/*", Te()), { app: F, controlPlaneTenantId: r };
1260
+ Re(r)
1261
+ ), w && R.use("/api/v2/*", be()), { app: R, controlPlaneTenantId: r };
1264
1262
  }
1265
- function Oe(e) {
1266
- const t = B(e);
1263
+ function Ee(e) {
1264
+ const t = U(e);
1267
1265
  return {
1268
1266
  name: "multi-tenancy",
1269
1267
  // Apply multi-tenancy middleware for subdomain routing, database resolution, etc.
1270
- middleware: ee(e),
1268
+ middleware: te(e),
1271
1269
  // Provide lifecycle hooks
1272
1270
  hooks: t,
1273
1271
  // Mount tenant management routes
@@ -1287,23 +1285,23 @@ function Oe(e) {
1287
1285
  }
1288
1286
  };
1289
1287
  }
1290
- function B(e) {
1291
- const t = e.accessControl ? de(e.accessControl) : {}, n = e.databaseIsolation ? me(e.databaseIsolation) : {}, r = Y(e);
1288
+ function U(e) {
1289
+ const t = e.accessControl ? fe(e.accessControl) : {}, n = e.databaseIsolation ? ge(e.databaseIsolation) : {}, r = Z(e);
1292
1290
  return {
1293
1291
  ...t,
1294
1292
  ...n,
1295
1293
  tenants: r
1296
1294
  };
1297
1295
  }
1298
- function je(e) {
1299
- const t = new re(), n = B(e);
1296
+ function Fe(e) {
1297
+ const t = new ae(), n = U(e);
1300
1298
  return t.route("/tenants", N(e, n)), t;
1301
1299
  }
1302
- function Ee(e) {
1300
+ function Be(e) {
1303
1301
  return {
1304
- hooks: B(e),
1305
- middleware: ee(e),
1306
- app: je(e),
1302
+ hooks: U(e),
1303
+ middleware: te(e),
1304
+ app: Fe(e),
1307
1305
  config: e,
1308
1306
  /**
1309
1307
  * Wraps data adapters with runtime fallback from the control plane.
@@ -1315,7 +1313,7 @@ function Ee(e) {
1315
1313
  */
1316
1314
  wrapAdapters: (t, n) => {
1317
1315
  var r;
1318
- return x(t, {
1316
+ return ee(t, {
1319
1317
  controlPlaneTenantId: (r = e.accessControl) == null ? void 0 : r.controlPlaneTenantId,
1320
1318
  controlPlaneClientId: n == null ? void 0 : n.controlPlaneClientId
1321
1319
  });
@@ -1323,24 +1321,24 @@ function Ee(e) {
1323
1321
  };
1324
1322
  }
1325
1323
  export {
1326
- de as createAccessControlHooks,
1327
- Re as createAccessControlMiddleware,
1328
- Ie as createControlPlaneTenantMiddleware,
1329
- me as createDatabaseHooks,
1330
- $e as createDatabaseMiddleware,
1331
- je as createMultiTenancy,
1332
- B as createMultiTenancyHooks,
1333
- ee as createMultiTenancyMiddleware,
1334
- Oe as createMultiTenancyPlugin,
1335
- Te as createProtectSyncedMiddleware,
1336
- Y as createProvisioningHooks,
1324
+ fe as createAccessControlHooks,
1325
+ ze as createAccessControlMiddleware,
1326
+ Re as createControlPlaneTenantMiddleware,
1327
+ ge as createDatabaseHooks,
1328
+ je as createDatabaseMiddleware,
1329
+ Fe as createMultiTenancy,
1330
+ U as createMultiTenancyHooks,
1331
+ te as createMultiTenancyMiddleware,
1332
+ Ee as createMultiTenancyPlugin,
1333
+ be as createProtectSyncedMiddleware,
1334
+ Z as createProvisioningHooks,
1337
1335
  Ae as createRuntimeFallbackAdapter,
1338
- ze as createSubdomainMiddleware,
1339
- ye as createSyncHooks,
1336
+ $e as createSubdomainMiddleware,
1337
+ ve as createSyncHooks,
1340
1338
  N as createTenantsOpenAPIRouter,
1341
- ke as initMultiTenant,
1342
- Ee as setupMultiTenancy,
1343
- fe as validateTenantAccess,
1344
- x as withRuntimeFallback,
1345
- Pe as withSystemResourceServerInheritance
1339
+ qe as initMultiTenant,
1340
+ Be as setupMultiTenancy,
1341
+ me as validateTenantAccess,
1342
+ ee as withRuntimeFallback,
1343
+ Se as withSystemResourceServerInheritance
1346
1344
  };