@authhero/multi-tenancy 14.19.0 → 14.20.0

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,30 +1,30 @@
1
- var x = Object.defineProperty;
2
- var ee = (e, t, n) => t in e ? x(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var E = (e, t, n) => ee(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { Hono as te } from "hono";
5
- import { MANAGEMENT_API_SCOPES as ne, MANAGEMENT_API_AUDIENCE as J, fetchAll as q, auth0QuerySchema as re, tenantSchema as D, tenantInsertSchema as U, deepMergePatch as ae, connectionSchema as se, connectionOptionsSchema as oe, init as ie } from "authhero";
6
- import { OpenAPIHono as ce, createRoute as M, z as S } from "@hono/zod-openapi";
7
- function le(e) {
1
+ var ee = Object.defineProperty;
2
+ var te = (e, t, n) => t in e ? ee(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var E = (e, t, n) => te(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { Hono as ne } from "hono";
5
+ import { MANAGEMENT_API_SCOPES as re, MANAGEMENT_API_AUDIENCE as J, fetchAll as D, auth0QuerySchema as ae, tenantSchema as q, tenantInsertSchema as U, deepMergePatch as se, connectionSchema as oe, connectionOptionsSchema as ie, init as ce } from "authhero";
6
+ import { OpenAPIHono as le, createRoute as M, z as I } from "@hono/zod-openapi";
7
+ function ue(e) {
8
8
  const { controlPlaneTenantId: t, requireOrganizationMatch: n = !0 } = e;
9
9
  return {
10
10
  async onTenantAccessValidation(r, a) {
11
11
  if (a === t)
12
12
  return !0;
13
13
  if (n) {
14
- const o = r.var.org_name, s = r.var.organization_id, i = o || s;
14
+ const s = r.var.org_name, c = r.var.organization_id, i = s || c;
15
15
  return i ? i.toLowerCase() === a.toLowerCase() : !1;
16
16
  }
17
17
  return !0;
18
18
  }
19
19
  };
20
20
  }
21
- function ue(e, t, n, r) {
21
+ function de(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 de(e) {
27
+ function fe(e) {
28
28
  return {
29
29
  async resolveDataAdapters(t) {
30
30
  try {
@@ -39,7 +39,7 @@ function de(e) {
39
39
  }
40
40
  };
41
41
  }
42
- function fe(e) {
42
+ function me(e) {
43
43
  return `urn:authhero:tenant:${e.toLowerCase()}`;
44
44
  }
45
45
  function X(e) {
@@ -47,51 +47,51 @@ function X(e) {
47
47
  async beforeCreate(t, n) {
48
48
  return !n.audience && n.id ? {
49
49
  ...n,
50
- audience: fe(n.id)
50
+ audience: me(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 me(t, n, r), a != null && a.onProvision && await a.onProvision(n.id);
55
+ r && t.ctx && await ge(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;
59
59
  if (r)
60
60
  try {
61
- const s = (await t.adapters.organizations.list(
61
+ const c = (await t.adapters.organizations.list(
62
62
  r.controlPlaneTenantId
63
63
  )).organizations.find((i) => i.name === n);
64
- s && await t.adapters.organizations.remove(
64
+ c && await t.adapters.organizations.remove(
65
65
  r.controlPlaneTenantId,
66
- s.id
66
+ c.id
67
67
  );
68
- } catch (o) {
68
+ } catch (s) {
69
69
  console.warn(
70
70
  `Failed to remove organization for tenant ${n}:`,
71
- o
71
+ s
72
72
  );
73
73
  }
74
74
  if (a != null && a.onDeprovision)
75
75
  try {
76
76
  await a.onDeprovision(n);
77
- } catch (o) {
77
+ } catch (s) {
78
78
  console.warn(
79
79
  `Failed to deprovision database for tenant ${n}:`,
80
- o
80
+ s
81
81
  );
82
82
  }
83
83
  }
84
84
  };
85
85
  }
86
- async function me(e, t, n) {
86
+ async function ge(e, t, n) {
87
87
  const {
88
88
  controlPlaneTenantId: r,
89
89
  defaultPermissions: a,
90
- defaultRoles: o,
91
- issuer: s,
90
+ defaultRoles: s,
91
+ issuer: c,
92
92
  adminRoleName: i = "Tenant Admin",
93
93
  adminRoleDescription: u = "Full access to all tenant management operations",
94
- addCreatorToOrganization: c = !0
94
+ addCreatorToOrganization: o = !0
95
95
  } = n, l = await e.adapters.organizations.create(
96
96
  r,
97
97
  {
@@ -100,14 +100,14 @@ async function me(e, t, n) {
100
100
  }
101
101
  );
102
102
  let g;
103
- if (s && (g = await we(
103
+ if (c && (g = await pe(
104
104
  e,
105
105
  r,
106
106
  i,
107
107
  u
108
- )), c && e.ctx) {
108
+ )), o && e.ctx) {
109
109
  const d = e.ctx.var.user;
110
- if (d != null && d.sub && !await ge(
110
+ if (d != null && d.sub && !await we(
111
111
  e,
112
112
  r,
113
113
  d.sub
@@ -130,13 +130,13 @@ async function me(e, t, n) {
130
130
  );
131
131
  }
132
132
  }
133
- o && o.length > 0 && console.log(
134
- `Would assign roles ${o.join(", ")} to organization ${l.id}`
133
+ s && s.length > 0 && console.log(
134
+ `Would assign roles ${s.join(", ")} to organization ${l.id}`
135
135
  ), a && a.length > 0 && console.log(
136
136
  `Would grant permissions ${a.join(", ")} to organization ${l.id}`
137
137
  );
138
138
  }
139
- async function ge(e, t, n) {
139
+ async function we(e, t, n) {
140
140
  const r = await e.adapters.userRoles.list(
141
141
  t,
142
142
  n,
@@ -155,26 +155,26 @@ async function ge(e, t, n) {
155
155
  return !0;
156
156
  return !1;
157
157
  }
158
- async function we(e, t, n, r) {
159
- const o = (await e.adapters.roles.list(t, {})).roles.find((c) => c.name === n);
160
- if (o)
161
- return o.id;
162
- const s = await e.adapters.roles.create(t, {
158
+ async function pe(e, t, n, r) {
159
+ const s = (await e.adapters.roles.list(t, {})).roles.find((o) => o.name === n);
160
+ if (s)
161
+ return s.id;
162
+ const c = await e.adapters.roles.create(t, {
163
163
  name: n,
164
164
  description: r
165
- }), i = J, u = ne.map((c) => ({
166
- role_id: s.id,
165
+ }), i = J, u = re.map((o) => ({
166
+ role_id: c.id,
167
167
  resource_server_identifier: i,
168
- permission_name: c.value
168
+ permission_name: o.value
169
169
  }));
170
170
  return await e.adapters.rolePermissions.assign(
171
171
  t,
172
- s.id,
172
+ c.id,
173
173
  u
174
- ), s.id;
174
+ ), c.id;
175
175
  }
176
176
  function G(e, t, n = () => !0) {
177
- const { controlPlaneTenantId: r, getChildTenantIds: a, getAdapters: o } = e, s = /* @__PURE__ */ new Map();
177
+ const { controlPlaneTenantId: r, getChildTenantIds: a, getAdapters: s } = e, c = /* @__PURE__ */ new Map();
178
178
  async function i(l, g, d) {
179
179
  return (await t(l).list(g, {
180
180
  q: `name:${d}`,
@@ -182,11 +182,11 @@ function G(e, t, n = () => !0) {
182
182
  }))[0] ?? null;
183
183
  }
184
184
  async function u(l) {
185
- const g = await a(), d = t(await o(r));
185
+ const g = await a(), d = t(await s(r));
186
186
  await Promise.all(
187
187
  g.map(async (f) => {
188
188
  try {
189
- const m = await o(f), w = t(m), y = {
189
+ const m = await s(f), w = t(m), y = {
190
190
  ...d.transform(l),
191
191
  is_system: !0
192
192
  }, _ = await i(m, f, l.name), b = _ ? w.getId(_) : void 0;
@@ -204,12 +204,12 @@ function G(e, t, n = () => !0) {
204
204
  })
205
205
  );
206
206
  }
207
- async function c(l) {
207
+ async function o(l) {
208
208
  const g = await a();
209
209
  await Promise.all(
210
210
  g.map(async (d) => {
211
211
  try {
212
- const f = await o(d), m = t(f), w = await i(f, d, l), C = w ? m.getId(w) : void 0;
212
+ const f = await s(d), m = t(f), w = await i(f, d, l), C = w ? m.getId(w) : void 0;
213
213
  w && C && await m.remove(d, C);
214
214
  } catch (f) {
215
215
  console.error(
@@ -230,22 +230,22 @@ function G(e, t, n = () => !0) {
230
230
  beforeDelete: async (l, g) => {
231
231
  if (l.tenantId !== r) return;
232
232
  const f = await t(l.adapters).get(l.tenantId, g);
233
- f && n(f) && s.set(g, f);
233
+ f && n(f) && c.set(g, f);
234
234
  },
235
235
  afterDelete: async (l, g) => {
236
236
  if (l.tenantId !== r) return;
237
- const d = s.get(g);
238
- d && (s.delete(g), await c(d.name));
237
+ const d = c.get(g);
238
+ d && (c.delete(g), await o(d.name));
239
239
  }
240
240
  };
241
241
  }
242
242
  function L(e, t, n = () => !0) {
243
- const { controlPlaneTenantId: r, getControlPlaneAdapters: a, getAdapters: o } = e;
243
+ const { controlPlaneTenantId: r, getControlPlaneAdapters: a, getAdapters: s } = e;
244
244
  return {
245
- async afterCreate(s, i) {
245
+ async afterCreate(c, i) {
246
246
  if (i.id !== r)
247
247
  try {
248
- const u = await a(), c = await o(i.id), l = t(u), g = t(c), d = await q(
248
+ const u = await a(), o = await s(i.id), l = t(u), g = t(o), d = await D(
249
249
  (f) => l.listPaginated(r, f),
250
250
  l.listKey,
251
251
  { cursorField: "id", pageSize: 100 }
@@ -275,7 +275,7 @@ function L(e, t, n = () => !0) {
275
275
  }
276
276
  };
277
277
  }
278
- const H = (e) => ({
278
+ const W = (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 H = (e) => ({
293
293
  token_lifetime: t.token_lifetime,
294
294
  token_lifetime_for_web: t.token_lifetime_for_web
295
295
  })
296
- }), W = (e) => ({
296
+ }), H = (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),
@@ -312,26 +312,26 @@ function K(e) {
312
312
  var t;
313
313
  return ((t = e.metadata) == null ? void 0 : t.sync) !== !1;
314
314
  }
315
- function pe(e) {
316
- const { sync: t = {}, filters: n = {} } = e, r = t.resourceServers ?? !0, a = t.roles ?? !0, o = (m) => K(m) ? n.resourceServers ? n.resourceServers(m) : !0 : !1, s = (m) => K(m) ? n.roles ? n.roles(m) : !0 : !1, i = r ? G(
317
- e,
318
- H,
319
- o
320
- ) : void 0, u = a ? G(e, W, s) : void 0, c = r ? L(
315
+ function he(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, c = (m) => K(m) ? n.roles ? n.roles(m) : !0 : !1, i = r ? G(
321
317
  e,
322
- H,
323
- o
324
- ) : void 0, l = a ? L(
318
+ W,
319
+ s
320
+ ) : void 0, u = a ? G(e, H, c) : void 0, o = r ? L(
325
321
  e,
326
322
  W,
327
323
  s
324
+ ) : void 0, l = a ? L(
325
+ e,
326
+ H,
327
+ c
328
328
  ) : void 0, g = a ? {
329
329
  async afterCreate(m, w) {
330
330
  var C;
331
331
  if (w.id !== e.controlPlaneTenantId) {
332
332
  await ((C = l == null ? void 0 : l.afterCreate) == null ? void 0 : C.call(l, m, w));
333
333
  try {
334
- const y = await e.getControlPlaneAdapters(), _ = await e.getAdapters(w.id), b = await q(
334
+ const y = await e.getControlPlaneAdapters(), _ = await e.getAdapters(w.id), b = await D(
335
335
  (p) => y.roles.list(
336
336
  e.controlPlaneTenantId,
337
337
  p
@@ -369,10 +369,10 @@ function pe(e) {
369
369
  h.length > 0 && await _.rolePermissions.assign(
370
370
  w.id,
371
371
  T,
372
- h.map(($) => ({
372
+ h.map((z) => ({
373
373
  role_id: T,
374
- resource_server_identifier: $.resource_server_identifier,
375
- permission_name: $.permission_name
374
+ resource_server_identifier: z.resource_server_identifier,
375
+ permission_name: z.permission_name
376
376
  }))
377
377
  );
378
378
  } catch (h) {
@@ -405,7 +405,7 @@ function pe(e) {
405
405
  tenantHooks: {
406
406
  async afterCreate(m, w) {
407
407
  const C = [
408
- c == null ? void 0 : c.afterCreate,
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
411
  for (const _ of C)
@@ -452,14 +452,14 @@ var A = class extends Error {
452
452
  }
453
453
  };
454
454
  function N(e, t) {
455
- const n = new ce();
455
+ const n = new le();
456
456
  return n.openapi(
457
457
  M({
458
458
  tags: ["tenants"],
459
459
  method: "get",
460
460
  path: "/",
461
461
  request: {
462
- query: re
462
+ query: ae
463
463
  },
464
464
  security: [
465
465
  {
@@ -470,11 +470,11 @@ function N(e, t) {
470
470
  200: {
471
471
  content: {
472
472
  "application/json": {
473
- schema: S.object({
474
- tenants: S.array(D),
475
- start: S.number().optional(),
476
- limit: S.number().optional(),
477
- length: S.number().optional()
473
+ schema: I.object({
474
+ tenants: I.array(q),
475
+ start: I.number().optional(),
476
+ limit: I.number().optional(),
477
+ length: I.number().optional()
478
478
  })
479
479
  }
480
480
  },
@@ -484,27 +484,27 @@ function N(e, t) {
484
484
  }),
485
485
  async (r) => {
486
486
  var m, w, C, y, _, b;
487
- const a = r.req.valid("query"), { page: o, per_page: s, include_totals: i, q: u } = a, c = r.var.user, l = (c == null ? void 0 : c.permissions) || [];
487
+ const a = r.req.valid("query"), { page: s, per_page: c, include_totals: i, q: u } = a, o = r.var.user, l = (o == null ? void 0 : o.permissions) || [];
488
488
  if (l.includes("auth:read") || l.includes("admin:organizations")) {
489
489
  const P = await r.env.data.tenants.list({
490
- page: o,
491
- per_page: s,
490
+ page: s,
491
+ per_page: c,
492
492
  include_totals: i,
493
493
  q: u
494
494
  });
495
495
  return i ? r.json({
496
496
  tenants: P.tenants,
497
497
  start: ((m = P.totals) == null ? void 0 : m.start) ?? 0,
498
- limit: ((w = P.totals) == null ? void 0 : w.limit) ?? s,
498
+ limit: ((w = P.totals) == null ? void 0 : w.limit) ?? c,
499
499
  length: P.tenants.length
500
500
  }) : r.json({ tenants: P.tenants });
501
501
  }
502
502
  const d = ((C = e.accessControl) == null ? void 0 : C.controlPlaneTenantId) ?? ((y = r.env.data.multiTenancyConfig) == null ? void 0 : y.controlPlaneTenantId);
503
- if (d && (c != null && c.sub)) {
504
- const p = (await q(
503
+ if (d && (o != null && o.sub)) {
504
+ const p = (await D(
505
505
  (R) => r.env.data.userOrganizations.listUserOrganizations(
506
506
  d,
507
- c.sub,
507
+ o.sub,
508
508
  R
509
509
  ),
510
510
  "organizations"
@@ -513,40 +513,40 @@ function N(e, t) {
513
513
  return i ? r.json({
514
514
  tenants: [],
515
515
  start: 0,
516
- limit: s ?? 50,
516
+ limit: c ?? 50,
517
517
  length: 0
518
518
  }) : r.json({ tenants: [] });
519
- const T = p.length, h = o ?? 0, $ = s ?? 50, F = h * $, j = p.slice(F, F + $);
519
+ const T = p.length, h = s ?? 0, z = c ?? 50, F = h * z, j = p.slice(F, F + z);
520
520
  if (j.length === 0)
521
521
  return i ? r.json({
522
522
  tenants: [],
523
523
  start: F,
524
- limit: $,
524
+ limit: z,
525
525
  length: T
526
526
  }) : r.json({ tenants: [] });
527
- const I = j.map((R) => `id:${R}`).join(" OR "), v = u ? `(${I}) AND (${u})` : I, z = await r.env.data.tenants.list({
527
+ const S = j.map((R) => `id:${R}`).join(" OR "), v = u ? `(${S}) AND (${u})` : S, $ = await r.env.data.tenants.list({
528
528
  q: v,
529
- per_page: $,
529
+ per_page: z,
530
530
  include_totals: !1
531
531
  // We calculate totals from accessibleTenantIds
532
532
  });
533
533
  return i ? r.json({
534
- tenants: z.tenants,
534
+ tenants: $.tenants,
535
535
  start: F,
536
- limit: $,
536
+ limit: z,
537
537
  length: T
538
- }) : r.json({ tenants: z.tenants });
538
+ }) : r.json({ tenants: $.tenants });
539
539
  }
540
540
  const f = await r.env.data.tenants.list({
541
- page: o,
542
- per_page: s,
541
+ page: s,
542
+ per_page: c,
543
543
  include_totals: i,
544
544
  q: u
545
545
  });
546
546
  return i ? r.json({
547
547
  tenants: f.tenants,
548
548
  start: ((_ = f.totals) == null ? void 0 : _.start) ?? 0,
549
- limit: ((b = f.totals) == null ? void 0 : b.limit) ?? s,
549
+ limit: ((b = f.totals) == null ? void 0 : b.limit) ?? c,
550
550
  length: f.tenants.length
551
551
  }) : r.json({ tenants: f.tenants });
552
552
  }
@@ -573,7 +573,7 @@ function N(e, t) {
573
573
  201: {
574
574
  content: {
575
575
  "application/json": {
576
- schema: D
576
+ schema: q
577
577
  }
578
578
  },
579
579
  description: "Tenant created"
@@ -587,20 +587,20 @@ function N(e, t) {
587
587
  }
588
588
  }),
589
589
  async (r) => {
590
- var u, c;
590
+ var u, o;
591
591
  const a = r.var.user;
592
592
  if (!(a != null && a.sub))
593
593
  throw new A(401, {
594
594
  message: "Authentication required to create tenants"
595
595
  });
596
- let o = r.req.valid("json");
597
- const s = {
596
+ let s = r.req.valid("json");
597
+ const c = {
598
598
  adapters: r.env.data,
599
599
  ctx: r
600
600
  };
601
- (u = t.tenants) != null && u.beforeCreate && (o = await t.tenants.beforeCreate(s, o));
602
- const i = await r.env.data.tenants.create(o);
603
- return (c = t.tenants) != null && c.afterCreate && await t.tenants.afterCreate(s, i), r.json(i, 201);
601
+ (u = t.tenants) != null && u.beforeCreate && (s = await t.tenants.beforeCreate(c, s));
602
+ const i = await r.env.data.tenants.create(s);
603
+ return (o = t.tenants) != null && o.afterCreate && await t.tenants.afterCreate(c, i), r.json(i, 201);
604
604
  }
605
605
  ), n.openapi(
606
606
  M({
@@ -608,8 +608,8 @@ function N(e, t) {
608
608
  method: "delete",
609
609
  path: "/{id}",
610
610
  request: {
611
- params: S.object({
612
- id: S.string()
611
+ params: I.object({
612
+ id: I.string()
613
613
  })
614
614
  },
615
615
  security: [
@@ -630,21 +630,21 @@ function N(e, t) {
630
630
  }
631
631
  }),
632
632
  async (r) => {
633
- var u, c, l, g;
634
- const { id: a } = r.req.valid("param"), o = ((u = e.accessControl) == null ? void 0 : u.controlPlaneTenantId) ?? ((c = r.env.data.multiTenancyConfig) == null ? void 0 : c.controlPlaneTenantId);
635
- if (o) {
633
+ var u, o, l, g;
634
+ const { id: a } = r.req.valid("param"), s = ((u = e.accessControl) == null ? void 0 : u.controlPlaneTenantId) ?? ((o = r.env.data.multiTenancyConfig) == null ? void 0 : o.controlPlaneTenantId);
635
+ if (s) {
636
636
  const d = r.var.user;
637
637
  if (!(d != null && d.sub))
638
638
  throw new A(401, {
639
639
  message: "Authentication required"
640
640
  });
641
- if (a === o)
641
+ if (a === s)
642
642
  throw new A(403, {
643
643
  message: "Cannot delete the control plane"
644
644
  });
645
- if (!(await q(
645
+ if (!(await D(
646
646
  (w) => r.env.data.userOrganizations.listUserOrganizations(
647
- o,
647
+ s,
648
648
  d.sub,
649
649
  w
650
650
  ),
@@ -670,8 +670,8 @@ function N(e, t) {
670
670
  method: "get",
671
671
  path: "/settings",
672
672
  request: {
673
- headers: S.object({
674
- "tenant-id": S.string().optional()
673
+ headers: I.object({
674
+ "tenant-id": I.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: D
686
+ schema: q
687
687
  }
688
688
  },
689
689
  description: "Current tenant settings"
@@ -704,13 +704,13 @@ function N(e, t) {
704
704
  method: "patch",
705
705
  path: "/settings",
706
706
  request: {
707
- headers: S.object({
708
- "tenant-id": S.string().optional()
707
+ headers: I.object({
708
+ "tenant-id": I.string().optional()
709
709
  }),
710
710
  body: {
711
711
  content: {
712
712
  "application/json": {
713
- schema: S.object(U.shape).partial()
713
+ schema: I.object(U.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: D
727
+ schema: q
728
728
  }
729
729
  },
730
730
  description: "Updated tenant settings"
@@ -732,23 +732,23 @@ function N(e, t) {
732
732
  }
733
733
  }),
734
734
  async (r) => {
735
- const a = r.req.valid("json"), { id: o, ...s } = a, i = await r.env.data.tenants.get(r.var.tenant_id);
735
+ const a = r.req.valid("json"), { id: s, ...c } = a, i = await r.env.data.tenants.get(r.var.tenant_id);
736
736
  if (!i)
737
737
  throw new A(404, {
738
738
  message: "Tenant not found"
739
739
  });
740
- const u = ae(i, s);
740
+ const u = se(i, c);
741
741
  await r.env.data.tenants.update(r.var.tenant_id, u);
742
- const c = await r.env.data.tenants.get(r.var.tenant_id);
743
- if (!c)
742
+ const o = await r.env.data.tenants.get(r.var.tenant_id);
743
+ if (!o)
744
744
  throw new A(500, {
745
745
  message: "Failed to retrieve updated tenant"
746
746
  });
747
- return r.json(c);
747
+ return r.json(o);
748
748
  }
749
749
  ), n;
750
750
  }
751
- function he(e) {
751
+ function ye(e) {
752
752
  const t = [
753
753
  {
754
754
  pattern: /\/api\/v2\/resource-servers\/([^/]+)$/,
@@ -764,7 +764,7 @@ function he(e) {
764
764
  }
765
765
  return null;
766
766
  }
767
- async function ye(e, t, n) {
767
+ async function ve(e, t, n) {
768
768
  try {
769
769
  switch (n.type) {
770
770
  case "resource_server": {
@@ -786,26 +786,26 @@ async function ye(e, t, n) {
786
786
  return !1;
787
787
  }
788
788
  }
789
- function ve(e) {
789
+ function _e(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 _e() {
796
+ function Ce() {
797
797
  return async (e, t) => {
798
798
  if (!["PATCH", "PUT", "DELETE"].includes(e.req.method))
799
799
  return t();
800
- const n = he(e.req.path);
800
+ const n = ye(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 ye(e.env.data, r, n))
806
+ if (await ve(e.env.data, r, n))
807
807
  throw new A(403, {
808
- message: `This ${ve(n.type)} is a system resource and cannot be modified. Make changes in the control plane instead.`
808
+ message: `This ${_e(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
  };
@@ -816,11 +816,11 @@ function k(e, t) {
816
816
  );
817
817
  if (!(n != null && n.options))
818
818
  return e;
819
- const r = se.passthrough().parse({
819
+ const r = oe.passthrough().parse({
820
820
  ...n,
821
821
  ...e
822
822
  });
823
- return r.options = oe.passthrough().parse({
823
+ return r.options = ie.passthrough().parse({
824
824
  ...n.options || {},
825
825
  ...e.options
826
826
  }), r;
@@ -829,7 +829,7 @@ function O(e, t) {
829
829
  const n = [...t || [], ...e || []];
830
830
  return [...new Set(n)];
831
831
  }
832
- function Ce(e, t) {
832
+ function Te(e, t) {
833
833
  if (!(t != null && t.length))
834
834
  return e || [];
835
835
  if (!(e != null && e.length))
@@ -844,7 +844,7 @@ function Ce(e, t) {
844
844
  function Q(e, t) {
845
845
  return t ? {
846
846
  ...e,
847
- scopes: Ce(
847
+ scopes: Te(
848
848
  e.scopes,
849
849
  t.scopes
850
850
  )
@@ -868,7 +868,64 @@ function V(e, t) {
868
868
  )
869
869
  } : e;
870
870
  }
871
- function Te(e, t) {
871
+ function Y(e, t) {
872
+ return {
873
+ ...e.resourceServers,
874
+ get: async (n, r) => {
875
+ const a = await e.resourceServers.get(
876
+ n,
877
+ r
878
+ );
879
+ if (!a || !t || n === t || !a.is_system)
880
+ return a;
881
+ const s = await e.resourceServers.get(
882
+ t,
883
+ r
884
+ );
885
+ return Q(
886
+ a,
887
+ s
888
+ );
889
+ },
890
+ list: async (n, r) => {
891
+ const a = await e.resourceServers.list(n, r);
892
+ if (!t || n === t)
893
+ return a;
894
+ const s = t, c = a.resource_servers.filter(
895
+ (o) => !!(o.is_system && o.id)
896
+ ).map((o) => o.id);
897
+ if (c.length === 0)
898
+ return a;
899
+ const i = /* @__PURE__ */ new Map();
900
+ await Promise.all(
901
+ c.map(async (o) => {
902
+ const l = await e.resourceServers.get(s, o);
903
+ l && i.set(o, l);
904
+ })
905
+ );
906
+ const u = a.resource_servers.map(
907
+ (o) => o.is_system && o.id ? Q(
908
+ o,
909
+ i.get(o.id) ?? null
910
+ ) : o
911
+ );
912
+ return {
913
+ ...a,
914
+ resource_servers: u
915
+ };
916
+ }
917
+ };
918
+ }
919
+ function be(e, t) {
920
+ return {
921
+ ...e,
922
+ resourceServers: Y(
923
+ e,
924
+ t.controlPlaneTenantId
925
+ )
926
+ };
927
+ }
928
+ function Pe(e, t) {
872
929
  const { controlPlaneTenantId: n, controlPlaneClientId: r } = t;
873
930
  return {
874
931
  ...e,
@@ -879,46 +936,46 @@ function Te(e, t) {
879
936
  },
880
937
  connections: {
881
938
  ...e.connections,
882
- get: async (a, o) => {
883
- const s = await e.connections.get(
939
+ get: async (a, s) => {
940
+ const c = await e.connections.get(
884
941
  a,
885
- o
942
+ s
886
943
  );
887
- if (!s || !n || a === n)
888
- return s;
944
+ if (!c || !n || a === n)
945
+ return c;
889
946
  const i = await e.connections.list(n);
890
947
  return k(
891
- s,
948
+ c,
892
949
  i.connections || []
893
950
  );
894
951
  },
895
- list: async (a, o) => {
896
- const s = await e.connections.list(a, o);
952
+ list: async (a, s) => {
953
+ const c = await e.connections.list(a, s);
897
954
  if (!n || a === n)
898
- return s;
899
- const i = await e.connections.list(n), u = s.connections.map(
900
- (c) => k(
901
- c,
955
+ return c;
956
+ const i = await e.connections.list(n), u = c.connections.map(
957
+ (o) => k(
958
+ o,
902
959
  i.connections || []
903
960
  )
904
961
  );
905
962
  return {
906
- ...s,
963
+ ...c,
907
964
  connections: u
908
965
  };
909
966
  }
910
967
  },
911
968
  clientConnections: {
912
969
  ...e.clientConnections,
913
- listByClient: async (a, o) => {
914
- let s = await e.clientConnections.listByClient(
970
+ listByClient: async (a, s) => {
971
+ let c = await e.clientConnections.listByClient(
915
972
  a,
916
- o
973
+ s
917
974
  );
918
- if (s.length === 0 && (s = (await e.connections.list(a)).connections || []), !n || a === n)
919
- return s;
975
+ if (c.length === 0 && (c = (await e.connections.list(a)).connections || []), !n || a === n)
976
+ return c;
920
977
  const i = await e.connections.list(n);
921
- return s.map(
978
+ return c.map(
922
979
  (u) => k(
923
980
  u,
924
981
  i.connections || []
@@ -928,107 +985,72 @@ function Te(e, t) {
928
985
  },
929
986
  clients: {
930
987
  ...e.clients,
931
- get: async (a, o) => {
932
- const s = await e.clients.get(a, o);
933
- if (!s)
988
+ get: async (a, s) => {
989
+ const c = await e.clients.get(a, s);
990
+ if (!c)
934
991
  return null;
935
- if (!n || !r || a === n && o === r)
936
- return s;
992
+ if (!n || !r || a === n && s === r)
993
+ return c;
937
994
  const i = await e.clients.get(
938
995
  n,
939
996
  r
940
997
  );
941
- return V(s, i);
998
+ return V(c, i);
942
999
  },
943
1000
  getByClientId: async (a) => {
944
- const o = await e.clients.getByClientId(a);
945
- if (!o)
1001
+ const s = await e.clients.getByClientId(a);
1002
+ if (!s)
946
1003
  return null;
947
- if (!n || !r || o.tenant_id === n && o.client_id === r)
948
- return o;
949
- const s = await e.clients.get(
1004
+ if (!n || !r || s.tenant_id === n && s.client_id === r)
1005
+ return s;
1006
+ const c = await e.clients.get(
950
1007
  n,
951
1008
  r
952
1009
  );
953
1010
  return {
954
- ...V(o, s),
955
- tenant_id: o.tenant_id
1011
+ ...V(s, c),
1012
+ tenant_id: s.tenant_id
956
1013
  };
957
1014
  }
958
1015
  },
959
1016
  emailProviders: {
960
1017
  ...e.emailProviders,
961
1018
  get: async (a) => {
962
- const o = await e.emailProviders.get(a);
963
- return o || (!n || a === n ? null : e.emailProviders.get(n));
1019
+ const s = await e.emailProviders.get(a);
1020
+ return s || (!n || a === n ? null : e.emailProviders.get(n));
964
1021
  }
965
1022
  },
966
- resourceServers: {
967
- ...e.resourceServers,
968
- get: async (a, o) => {
969
- const s = await e.resourceServers.get(
970
- a,
971
- o
972
- );
973
- if (!s || !n || a === n)
974
- return s;
975
- const u = (await e.resourceServers.list(
976
- n,
977
- { q: `identifier:${s.identifier}`, per_page: 1 }
978
- )).resource_servers[0] ?? null;
979
- return Q(
980
- s,
981
- u
982
- );
983
- },
984
- list: async (a, o) => {
985
- const s = await e.resourceServers.list(
986
- a,
987
- o
988
- );
989
- if (!n || a === n)
990
- return s;
991
- const i = await e.resourceServers.list(n), u = new Map(
992
- i.resource_servers.map((l) => [l.identifier, l])
993
- ), c = s.resource_servers.map(
994
- (l) => Q(
995
- l,
996
- u.get(l.identifier) ?? null
997
- )
998
- );
999
- return {
1000
- ...s,
1001
- resource_servers: c
1002
- };
1003
- }
1004
- }
1023
+ resourceServers: Y(
1024
+ e,
1025
+ n
1026
+ )
1005
1027
  // Note: Additional adapters can be extended here for runtime fallback:
1006
1028
  // - promptSettings: Fall back to control plane prompts
1007
1029
  // - branding: Fall back to control plane branding/themes
1008
1030
  };
1009
1031
  }
1010
- function Y(e, t) {
1011
- return Te(e, t);
1032
+ function Z(e, t) {
1033
+ return Pe(e, t);
1012
1034
  }
1013
- function be(e) {
1035
+ function Ae(e) {
1014
1036
  return async (t, n) => {
1015
1037
  const r = t.var.user;
1016
1038
  return (r == null ? void 0 : r.tenant_id) === e && r.org_name && t.set("tenant_id", r.org_name), n();
1017
1039
  };
1018
1040
  }
1019
- function Pe(e) {
1041
+ function Se(e) {
1020
1042
  return async (t, n) => {
1021
1043
  if (!e.accessControl)
1022
1044
  return n();
1023
- const { controlPlaneTenantId: r } = e.accessControl, a = t.var.org_name, o = t.var.organization_id, s = a || o;
1045
+ const { controlPlaneTenantId: r } = e.accessControl, a = t.var.org_name, s = t.var.organization_id, c = a || s;
1024
1046
  let i = t.var.tenant_id;
1025
1047
  const u = t.var.user, l = (u != null && u.aud ? Array.isArray(u.aud) ? u.aud : [u.aud] : []).includes(J);
1026
- if (!i && s && l && (t.set("tenant_id", s), i = s), !i)
1048
+ if (!i && c && l && (t.set("tenant_id", c), i = c), !i)
1027
1049
  throw new A(400, {
1028
1050
  message: "Tenant ID not found in request"
1029
1051
  });
1030
- if (!ue(
1031
- o,
1052
+ if (!de(
1053
+ s,
1032
1054
  i,
1033
1055
  r,
1034
1056
  a
@@ -1039,32 +1061,32 @@ function Pe(e) {
1039
1061
  return n();
1040
1062
  };
1041
1063
  }
1042
- function Ae(e) {
1064
+ function Ie(e) {
1043
1065
  return async (t, n) => {
1044
1066
  if (!e.subdomainRouting)
1045
1067
  return n();
1046
1068
  const {
1047
1069
  baseDomain: r,
1048
1070
  reservedSubdomains: a = [],
1049
- resolveSubdomain: o
1050
- } = e.subdomainRouting, s = t.req.header("x-forwarded-host") || t.req.header("host") || "";
1071
+ resolveSubdomain: s
1072
+ } = e.subdomainRouting, c = t.req.header("x-forwarded-host") || t.req.header("host") || "";
1051
1073
  let i = null;
1052
- if (s.endsWith(r)) {
1053
- const c = s.slice(0, -(r.length + 1));
1054
- c && !c.includes(".") && (i = c);
1074
+ if (c.endsWith(r)) {
1075
+ const o = c.slice(0, -(r.length + 1));
1076
+ o && !o.includes(".") && (i = o);
1055
1077
  }
1056
1078
  if (i && a.includes(i) && (i = null), !i)
1057
1079
  return e.accessControl && t.set("tenant_id", e.accessControl.controlPlaneTenantId), n();
1058
1080
  let u = null;
1059
- if (o)
1060
- u = await o(i);
1081
+ if (s)
1082
+ u = await s(i);
1061
1083
  else if (e.subdomainRouting.useOrganizations !== !1 && e.accessControl)
1062
1084
  try {
1063
- const c = await t.env.data.organizations.get(
1085
+ const o = await t.env.data.organizations.get(
1064
1086
  e.accessControl.controlPlaneTenantId,
1065
1087
  i
1066
1088
  );
1067
- c && (u = c.id);
1089
+ o && (u = o.id);
1068
1090
  } catch {
1069
1091
  }
1070
1092
  if (!u)
@@ -1074,7 +1096,7 @@ function Ae(e) {
1074
1096
  return t.set("tenant_id", u), n();
1075
1097
  };
1076
1098
  }
1077
- function Ie(e) {
1099
+ function Re(e) {
1078
1100
  return async (t, n) => {
1079
1101
  if (!e.databaseIsolation)
1080
1102
  return n();
@@ -1097,14 +1119,14 @@ function Ie(e) {
1097
1119
  return n();
1098
1120
  };
1099
1121
  }
1100
- function Z(e) {
1101
- const t = Ae(e), n = Pe(e), r = Ie(e);
1102
- return async (a, o) => (await t(a, async () => {
1122
+ function x(e) {
1123
+ const t = Ie(e), n = Se(e), r = Re(e);
1124
+ return async (a, s) => (await t(a, async () => {
1103
1125
  }), await n(a, async () => {
1104
1126
  }), await r(a, async () => {
1105
- }), o());
1127
+ }), s());
1106
1128
  }
1107
- function je(e) {
1129
+ function De(e) {
1108
1130
  const {
1109
1131
  dataAdapter: t,
1110
1132
  controlPlane: n,
@@ -1112,32 +1134,34 @@ function je(e) {
1112
1134
  tenantId: r = "control_plane",
1113
1135
  clientId: a
1114
1136
  } = {},
1115
- sync: o = { resourceServers: !0, roles: !0 },
1116
- defaultPermissions: s = ["tenant:admin"],
1137
+ sync: s = { resourceServers: !0, roles: !0 },
1138
+ defaultPermissions: c = ["tenant:admin"],
1117
1139
  requireOrganizationMatch: i = !1,
1118
1140
  managementApiExtensions: u = [],
1119
- entityHooks: c,
1141
+ entityHooks: o,
1120
1142
  getChildTenantIds: l,
1121
1143
  getAdapters: g,
1122
1144
  ...d
1123
1145
  } = e;
1124
1146
  let f = t, m = t;
1125
- n && (f = Y(t, {
1147
+ n && (f = Z(t, {
1126
1148
  controlPlaneTenantId: r,
1127
1149
  controlPlaneClientId: a
1128
1150
  }), m = {
1129
- ...t,
1151
+ ...be(t, {
1152
+ controlPlaneTenantId: r
1153
+ }),
1130
1154
  multiTenancyConfig: {
1131
1155
  controlPlaneTenantId: r,
1132
1156
  controlPlaneClientId: a
1133
1157
  }
1134
1158
  });
1135
- const w = o !== !1, C = w ? {
1136
- resourceServers: o.resourceServers ?? !0,
1137
- roles: o.roles ?? !0
1159
+ const w = s !== !1, C = w ? {
1160
+ resourceServers: s.resourceServers ?? !0,
1161
+ roles: s.roles ?? !0
1138
1162
  } : { resourceServers: !1, roles: !1 }, b = {
1139
1163
  controlPlaneTenantId: r,
1140
- getChildTenantIds: l ?? (async () => (await q(
1164
+ getChildTenantIds: l ?? (async () => (await D(
1141
1165
  (v) => f.tenants.list(v),
1142
1166
  "tenants",
1143
1167
  { cursorField: "id", pageSize: 100 }
@@ -1145,43 +1169,43 @@ function je(e) {
1145
1169
  getAdapters: g ?? (async () => f),
1146
1170
  getControlPlaneAdapters: async () => f,
1147
1171
  sync: C
1148
- }, { entityHooks: P, tenantHooks: p } = pe(b), T = {
1172
+ }, { entityHooks: P, tenantHooks: p } = he(b), T = {
1149
1173
  resourceServers: [
1150
1174
  P.resourceServers,
1151
- ...(c == null ? void 0 : c.resourceServers) ?? []
1175
+ ...(o == null ? void 0 : o.resourceServers) ?? []
1152
1176
  ],
1153
- roles: [P.roles, ...(c == null ? void 0 : c.roles) ?? []],
1154
- connections: (c == null ? void 0 : c.connections) ?? [],
1155
- tenants: (c == null ? void 0 : c.tenants) ?? [],
1156
- rolePermissions: (c == null ? void 0 : c.rolePermissions) ?? []
1177
+ roles: [P.roles, ...(o == null ? void 0 : o.roles) ?? []],
1178
+ connections: (o == null ? void 0 : o.connections) ?? [],
1179
+ tenants: (o == null ? void 0 : o.tenants) ?? [],
1180
+ rolePermissions: (o == null ? void 0 : o.rolePermissions) ?? []
1157
1181
  }, h = X({
1158
1182
  accessControl: {
1159
1183
  controlPlaneTenantId: r,
1160
1184
  requireOrganizationMatch: i,
1161
- defaultPermissions: s
1185
+ defaultPermissions: c
1162
1186
  }
1163
1187
  }), F = N(
1164
1188
  {
1165
1189
  accessControl: {
1166
1190
  controlPlaneTenantId: r,
1167
1191
  requireOrganizationMatch: i,
1168
- defaultPermissions: s
1192
+ defaultPermissions: c
1169
1193
  }
1170
1194
  },
1171
1195
  { tenants: {
1172
- async beforeCreate(I, v) {
1173
- return h.beforeCreate && (v = await h.beforeCreate(I, v)), p.beforeCreate && (v = await p.beforeCreate(I, v)), v;
1196
+ async beforeCreate(S, v) {
1197
+ return h.beforeCreate && (v = await h.beforeCreate(S, v)), p.beforeCreate && (v = await p.beforeCreate(S, v)), v;
1174
1198
  },
1175
- async afterCreate(I, v) {
1176
- var z, R;
1177
- await ((z = h.afterCreate) == null ? void 0 : z.call(h, I, v)), await ((R = p.afterCreate) == null ? void 0 : R.call(p, I, v));
1199
+ async afterCreate(S, v) {
1200
+ var $, R;
1201
+ await (($ = h.afterCreate) == null ? void 0 : $.call(h, S, v)), await ((R = p.afterCreate) == null ? void 0 : R.call(p, S, v));
1178
1202
  },
1179
- async beforeDelete(I, v) {
1180
- var z, R;
1181
- await ((z = h.beforeDelete) == null ? void 0 : z.call(h, I, v)), await ((R = p.beforeDelete) == null ? void 0 : R.call(p, I, v));
1203
+ async beforeDelete(S, v) {
1204
+ var $, R;
1205
+ await (($ = h.beforeDelete) == null ? void 0 : $.call(h, S, v)), await ((R = p.beforeDelete) == null ? void 0 : R.call(p, S, v));
1182
1206
  }
1183
1207
  } }
1184
- ), { app: j } = ie({
1208
+ ), { app: j } = ce({
1185
1209
  dataAdapter: f,
1186
1210
  managementDataAdapter: m,
1187
1211
  ...d,
@@ -1193,15 +1217,15 @@ function je(e) {
1193
1217
  });
1194
1218
  return j.use(
1195
1219
  "/api/v2/*",
1196
- be(r)
1197
- ), w && j.use("/api/v2/*", _e()), { app: j, controlPlaneTenantId: r };
1220
+ Ae(r)
1221
+ ), w && j.use("/api/v2/*", Ce()), { app: j, controlPlaneTenantId: r };
1198
1222
  }
1199
- function Me(e) {
1223
+ function qe(e) {
1200
1224
  const t = B(e);
1201
1225
  return {
1202
1226
  name: "multi-tenancy",
1203
1227
  // Apply multi-tenancy middleware for subdomain routing, database resolution, etc.
1204
- middleware: Z(e),
1228
+ middleware: x(e),
1205
1229
  // Provide lifecycle hooks
1206
1230
  hooks: t,
1207
1231
  // Mount tenant management routes
@@ -1222,22 +1246,22 @@ function Me(e) {
1222
1246
  };
1223
1247
  }
1224
1248
  function B(e) {
1225
- const t = e.accessControl ? le(e.accessControl) : {}, n = e.databaseIsolation ? de(e.databaseIsolation) : {}, r = X(e);
1249
+ const t = e.accessControl ? ue(e.accessControl) : {}, n = e.databaseIsolation ? fe(e.databaseIsolation) : {}, r = X(e);
1226
1250
  return {
1227
1251
  ...t,
1228
1252
  ...n,
1229
1253
  tenants: r
1230
1254
  };
1231
1255
  }
1232
- function Se(e) {
1233
- const t = new te(), n = B(e);
1256
+ function ze(e) {
1257
+ const t = new ne(), n = B(e);
1234
1258
  return t.route("/tenants", N(e, n)), t;
1235
1259
  }
1236
- function qe(e) {
1260
+ function Oe(e) {
1237
1261
  return {
1238
1262
  hooks: B(e),
1239
- middleware: Z(e),
1240
- app: Se(e),
1263
+ middleware: x(e),
1264
+ app: ze(e),
1241
1265
  config: e,
1242
1266
  /**
1243
1267
  * Wraps data adapters with runtime fallback from the control plane.
@@ -1249,7 +1273,7 @@ function qe(e) {
1249
1273
  */
1250
1274
  wrapAdapters: (t, n) => {
1251
1275
  var r;
1252
- return Y(t, {
1276
+ return Z(t, {
1253
1277
  controlPlaneTenantId: (r = e.accessControl) == null ? void 0 : r.controlPlaneTenantId,
1254
1278
  controlPlaneClientId: n == null ? void 0 : n.controlPlaneClientId
1255
1279
  });
@@ -1257,23 +1281,24 @@ function qe(e) {
1257
1281
  };
1258
1282
  }
1259
1283
  export {
1260
- le as createAccessControlHooks,
1261
- Pe as createAccessControlMiddleware,
1262
- be as createControlPlaneTenantMiddleware,
1263
- de as createDatabaseHooks,
1264
- Ie as createDatabaseMiddleware,
1265
- Se as createMultiTenancy,
1284
+ ue as createAccessControlHooks,
1285
+ Se as createAccessControlMiddleware,
1286
+ Ae as createControlPlaneTenantMiddleware,
1287
+ fe as createDatabaseHooks,
1288
+ Re as createDatabaseMiddleware,
1289
+ ze as createMultiTenancy,
1266
1290
  B as createMultiTenancyHooks,
1267
- Z as createMultiTenancyMiddleware,
1268
- Me as createMultiTenancyPlugin,
1269
- _e as createProtectSyncedMiddleware,
1291
+ x as createMultiTenancyMiddleware,
1292
+ qe as createMultiTenancyPlugin,
1293
+ Ce as createProtectSyncedMiddleware,
1270
1294
  X as createProvisioningHooks,
1271
- Te as createRuntimeFallbackAdapter,
1272
- Ae as createSubdomainMiddleware,
1273
- pe as createSyncHooks,
1295
+ Pe as createRuntimeFallbackAdapter,
1296
+ Ie as createSubdomainMiddleware,
1297
+ he as createSyncHooks,
1274
1298
  N as createTenantsOpenAPIRouter,
1275
- je as initMultiTenant,
1276
- qe as setupMultiTenancy,
1277
- ue as validateTenantAccess,
1278
- Y as withRuntimeFallback
1299
+ De as initMultiTenant,
1300
+ Oe as setupMultiTenancy,
1301
+ de as validateTenantAccess,
1302
+ Z as withRuntimeFallback,
1303
+ be as withSystemResourceServerInheritance
1279
1304
  };