@authhero/drizzle 0.43.2 → 0.43.4

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.
@@ -230,8 +230,8 @@ function Pr(n) {
230
230
  e.sql += i.sql, e.params.push(...i.params), (t = i.typings) != null && t.length && (e.typings || (e.typings = []), e.typings.push(...i.typings));
231
231
  return e;
232
232
  }
233
- var Gi;
234
- Gi = L;
233
+ var Ji;
234
+ Ji = L;
235
235
  class ve {
236
236
  constructor(e) {
237
237
  y(this, "value");
@@ -241,9 +241,9 @@ class ve {
241
241
  return new de([this]);
242
242
  }
243
243
  }
244
- y(ve, Gi, "StringChunk");
245
- var Ji;
246
- Ji = L;
244
+ y(ve, Ji, "StringChunk");
245
+ var Gi;
246
+ Gi = L;
247
247
  const pt = class pt {
248
248
  constructor(e) {
249
249
  /** @internal */
@@ -385,7 +385,7 @@ const pt = class pt {
385
385
  return e ? this : void 0;
386
386
  }
387
387
  };
388
- y(pt, Ji, "SQL");
388
+ y(pt, Gi, "SQL");
389
389
  let de = pt;
390
390
  var Wi;
391
391
  Wi = L;
@@ -532,7 +532,7 @@ fe.prototype.getSQL = function() {
532
532
  ui.prototype.getSQL = function() {
533
533
  return new de([this]);
534
534
  };
535
- function Gt(n, e) {
535
+ function Jt(n, e) {
536
536
  return {
537
537
  name: typeof n == "string" && n.length > 0 ? n : "",
538
538
  config: typeof n == "object" ? n : e
@@ -770,7 +770,7 @@ class Ro extends (wa = Fe, va = L, wa) {
770
770
  }
771
771
  y(Ro, va, "SQLiteBlobBuffer");
772
772
  function Vr(n, e) {
773
- const { name: t, config: i } = Gt(n, e);
773
+ const { name: t, config: i } = Jt(n, e);
774
774
  return (i == null ? void 0 : i.mode) === "json" ? new Co(t) : (i == null ? void 0 : i.mode) === "bigint" ? new Ao(t) : new Lo(t);
775
775
  }
776
776
  var Na, Sa;
@@ -809,7 +809,7 @@ class zo extends (Ea = Fe, ba = L, Ea) {
809
809
  y(zo, ba, "SQLiteCustomColumn");
810
810
  function Zr(n) {
811
811
  return (e, t) => {
812
- const { name: i, config: a } = Gt(e, t);
812
+ const { name: i, config: a } = Jt(e, t);
813
813
  return new Uo(
814
814
  i,
815
815
  a,
@@ -919,7 +919,7 @@ class $o extends (qa = hn, Ma = L, qa) {
919
919
  }
920
920
  y($o, Ma, "SQLiteBoolean");
921
921
  function w(n, e) {
922
- const { name: t, config: i } = Gt(n, e);
922
+ const { name: t, config: i } = Jt(n, e);
923
923
  return (i == null ? void 0 : i.mode) === "timestamp" || (i == null ? void 0 : i.mode) === "timestamp_ms" ? new Mo(t, i.mode) : (i == null ? void 0 : i.mode) === "boolean" ? new Bo(t, i.mode) : new Fo(t);
924
924
  }
925
925
  var Ba, $a;
@@ -974,8 +974,8 @@ class Ho extends (Qa = Fe, Ka = L, Qa) {
974
974
  }
975
975
  }
976
976
  y(Ho, Ka, "SQLiteNumericNumber");
977
- var Ga, Ja;
978
- class Ko extends (Ja = ze, Ga = L, Ja) {
977
+ var Ja, Ga;
978
+ class Ko extends (Ga = ze, Ja = L, Ga) {
979
979
  constructor(e) {
980
980
  super(e, "bigint", "SQLiteNumericBigInt");
981
981
  }
@@ -987,7 +987,7 @@ class Ko extends (Ja = ze, Ga = L, Ja) {
987
987
  );
988
988
  }
989
989
  }
990
- y(Ko, Ga, "SQLiteNumericBigIntBuilder");
990
+ y(Ko, Ja, "SQLiteNumericBigIntBuilder");
991
991
  var Wa, Xa;
992
992
  class Qo extends (Xa = Fe, Wa = L, Xa) {
993
993
  constructor() {
@@ -1001,29 +1001,29 @@ class Qo extends (Xa = Fe, Wa = L, Xa) {
1001
1001
  }
1002
1002
  y(Qo, Wa, "SQLiteNumericBigInt");
1003
1003
  function Hr(n, e) {
1004
- const { name: t, config: i } = Gt(n, e), a = i == null ? void 0 : i.mode;
1004
+ const { name: t, config: i } = Jt(n, e), a = i == null ? void 0 : i.mode;
1005
1005
  return a === "number" ? new Zo(t) : a === "bigint" ? new Ko(t) : new jo(t);
1006
1006
  }
1007
1007
  var Ya, eo;
1008
- class Go extends (eo = ze, Ya = L, eo) {
1008
+ class Jo extends (eo = ze, Ya = L, eo) {
1009
1009
  constructor(e) {
1010
1010
  super(e, "number", "SQLiteReal");
1011
1011
  }
1012
1012
  /** @internal */
1013
1013
  build(e) {
1014
- return new Jo(e, this.config);
1014
+ return new Go(e, this.config);
1015
1015
  }
1016
1016
  }
1017
- y(Go, Ya, "SQLiteRealBuilder");
1017
+ y(Jo, Ya, "SQLiteRealBuilder");
1018
1018
  var to, no;
1019
- class Jo extends (no = Fe, to = L, no) {
1019
+ class Go extends (no = Fe, to = L, no) {
1020
1020
  getSQLType() {
1021
1021
  return "real";
1022
1022
  }
1023
1023
  }
1024
- y(Jo, to, "SQLiteReal");
1024
+ y(Go, to, "SQLiteReal");
1025
1025
  function Kr(n) {
1026
- return new Go(n ?? "");
1026
+ return new Jo(n ?? "");
1027
1027
  }
1028
1028
  var io, ao;
1029
1029
  class Wo extends (ao = ze, io = L, ao) {
@@ -1079,7 +1079,7 @@ class er extends (_o = Fe, co = L, _o) {
1079
1079
  }
1080
1080
  y(er, co, "SQLiteTextJson");
1081
1081
  function s(n, e = {}) {
1082
- const { name: t, config: i } = Gt(n, e);
1082
+ const { name: t, config: i } = Jt(n, e);
1083
1083
  return i.mode === "json" ? new Yo(t) : new Wo(t, i);
1084
1084
  }
1085
1085
  function Qr() {
@@ -1092,9 +1092,9 @@ function Qr() {
1092
1092
  text: s
1093
1093
  };
1094
1094
  }
1095
- const Gn = Symbol.for("drizzle:SQLiteInlineForeignKeys");
1095
+ const Jn = Symbol.for("drizzle:SQLiteInlineForeignKeys");
1096
1096
  var uo, po, fo, ho, go;
1097
- class Rt extends (go = fe, ho = L, fo = fe.Symbol.Columns, po = Gn, uo = fe.Symbol.ExtraConfigBuilder, go) {
1097
+ class Rt extends (go = fe, ho = L, fo = fe.Symbol.Columns, po = Jn, uo = fe.Symbol.ExtraConfigBuilder, go) {
1098
1098
  constructor() {
1099
1099
  super(...arguments);
1100
1100
  /** @internal */
@@ -1107,20 +1107,20 @@ class Rt extends (go = fe, ho = L, fo = fe.Symbol.Columns, po = Gn, uo = fe.Symb
1107
1107
  }
1108
1108
  y(Rt, ho, "SQLiteTable"), /** @internal */
1109
1109
  y(Rt, "Symbol", Object.assign({}, fe.Symbol, {
1110
- InlineForeignKeys: Gn
1110
+ InlineForeignKeys: Jn
1111
1111
  }));
1112
- function Gr(n, e, t, i, a = n) {
1112
+ function Jr(n, e, t, i, a = n) {
1113
1113
  const r = new Rt(n, i, a), l = typeof e == "function" ? e(Qr()) : e, d = Object.fromEntries(
1114
1114
  Object.entries(l).map(([f, p]) => {
1115
1115
  const v = p;
1116
1116
  v.setName(f);
1117
1117
  const m = v.build(r);
1118
- return r[Gn].push(...v.buildForeignKeys(m, r)), [f, m];
1118
+ return r[Jn].push(...v.buildForeignKeys(m, r)), [f, m];
1119
1119
  })
1120
1120
  ), u = Object.assign(r, d);
1121
1121
  return u[fe.Symbol.Columns] = d, u[fe.Symbol.ExtraConfigColumns] = d, t && (u[Rt.Symbol.ExtraConfigBuilder] = t), u;
1122
1122
  }
1123
- const $ = (n, e, t) => Gr(n, e, t);
1123
+ const $ = (n, e, t) => Jr(n, e, t);
1124
1124
  var mo;
1125
1125
  mo = L;
1126
1126
  class fi {
@@ -1173,11 +1173,11 @@ function ht(n) {
1173
1173
  return new fi(n, !0);
1174
1174
  }
1175
1175
  function Te(...n) {
1176
- return n[0].columns ? new Jn(n[0].columns, n[0].name) : new Jn(n);
1176
+ return n[0].columns ? new Gn(n[0].columns, n[0].name) : new Gn(n);
1177
1177
  }
1178
1178
  var wo;
1179
1179
  wo = L;
1180
- class Jn {
1180
+ class Gn {
1181
1181
  constructor(e, t) {
1182
1182
  /** @internal */
1183
1183
  y(this, "columns");
@@ -1190,7 +1190,7 @@ class Jn {
1190
1190
  return new ir(e, this.columns, this.name);
1191
1191
  }
1192
1192
  }
1193
- y(Jn, wo, "SQLitePrimaryKeyBuilder");
1193
+ y(Gn, wo, "SQLitePrimaryKeyBuilder");
1194
1194
  var No;
1195
1195
  No = L;
1196
1196
  class ir {
@@ -1391,7 +1391,7 @@ const B = $("tenants", {
1391
1391
  D("idx_refresh_tokens_login_id").on(n.login_id),
1392
1392
  D("idx_refresh_tokens_expires_at_ts").on(n.expires_at_ts)
1393
1393
  ]
1394
- ), J = $(
1394
+ ), G = $(
1395
1395
  "login_sessions",
1396
1396
  {
1397
1397
  id: s("id", { length: 21 }).notNull(),
@@ -1460,7 +1460,7 @@ const B = $("tenants", {
1460
1460
  }),
1461
1461
  D("codes_expires_at_index").on(n.expires_at)
1462
1462
  ]
1463
- ), Jr = $("authentication_codes", {
1463
+ ), Gr = $("authentication_codes", {
1464
1464
  tenant_id: s("tenant_id", { length: 191 }).notNull().references(() => B.id, { onDelete: "cascade" }),
1465
1465
  code: s("code", { length: 255 }).primaryKey(),
1466
1466
  client_id: s("client_id", { length: 255 }).notNull(),
@@ -1580,7 +1580,8 @@ const B = $("tenants", {
1580
1580
  connections: s("connections").notNull().default("[]"),
1581
1581
  owner_user_id: s("owner_user_id", { length: 255 }),
1582
1582
  registration_type: s("registration_type", { length: 32 }),
1583
- registration_metadata: s("registration_metadata")
1583
+ registration_metadata: s("registration_metadata"),
1584
+ user_linking_mode: s("user_linking_mode", { length: 16 })
1584
1585
  },
1585
1586
  (n) => [
1586
1587
  Te({
@@ -1589,7 +1590,7 @@ const B = $("tenants", {
1589
1590
  }),
1590
1591
  D("idx_clients_owner_user_id").on(n.tenant_id, n.owner_user_id)
1591
1592
  ]
1592
- ), G = $(
1593
+ ), J = $(
1593
1594
  "client_registration_tokens",
1594
1595
  {
1595
1596
  id: s("id", { length: 255 }).primaryKey(),
@@ -1893,7 +1894,7 @@ const B = $("tenants", {
1893
1894
  }),
1894
1895
  colors_page_background_end: s("colors_page_background_end", { length: 8 }),
1895
1896
  colors_page_background_angle_dev: w("colors_page_background_angle_dev")
1896
- }), nt = $(
1897
+ }), it = $(
1897
1898
  "universal_login_templates",
1898
1899
  {
1899
1900
  tenant_id: s("tenant_id", { length: 191 }).primaryKey().references(() => B.id, { onDelete: "cascade" }),
@@ -2067,7 +2068,7 @@ const B = $("tenants", {
2067
2068
  webauthn_platform_first_factor: w("webauthn_platform_first_factor", {
2068
2069
  mode: "boolean"
2069
2070
  }).notNull().default(!1)
2070
- }), it = $("email_providers", {
2071
+ }), at = $("email_providers", {
2071
2072
  tenant_id: s("tenant_id", { length: 191 }).primaryKey(),
2072
2073
  name: s("name", { length: 255 }).notNull(),
2073
2074
  enabled: w("enabled", { mode: "boolean" }).notNull(),
@@ -2093,8 +2094,10 @@ const B = $("tenants", {
2093
2094
  // only required for form type hooks
2094
2095
  template_id: s("template_id", { length: 64 }),
2095
2096
  // only required for template type hooks
2096
- code_id: s("code_id", { length: 21 })
2097
+ code_id: s("code_id", { length: 21 }),
2097
2098
  // only required for code type hooks
2099
+ metadata: s("metadata")
2100
+ // JSON property bag (inheritable flag, template options)
2098
2101
  },
2099
2102
  (n) => [D("hooks_tenant_id_idx").on(n.tenant_id)]
2100
2103
  ), qe = $(
@@ -2242,27 +2245,27 @@ const B = $("tenants", {
2242
2245
  n.dead_lettered_at
2243
2246
  )
2244
2247
  ]
2245
- ), f_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2248
+ ), h_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2246
2249
  __proto__: null,
2247
- authenticationCodes: Jr,
2250
+ authenticationCodes: Gr,
2248
2251
  authenticationMethods: ue,
2249
2252
  branding: At,
2250
2253
  clientGrants: me,
2251
- clientRegistrationTokens: G,
2254
+ clientRegistrationTokens: J,
2252
2255
  clients: Z,
2253
2256
  codes: re,
2254
2257
  connections: pe,
2255
2258
  customDomains: Oe,
2256
2259
  customText: Ne,
2257
2260
  domains: Yr,
2258
- emailProviders: it,
2261
+ emailProviders: at,
2259
2262
  flows: xe,
2260
2263
  forms: Ee,
2261
2264
  hookCode: qe,
2262
2265
  hooks: we,
2263
2266
  invites: be,
2264
2267
  keys: Be,
2265
- loginSessions: J,
2268
+ loginSessions: G,
2266
2269
  logs: Q,
2267
2270
  organizations: W,
2268
2271
  otps: Wr,
@@ -2277,7 +2280,7 @@ const B = $("tenants", {
2277
2280
  tenants: B,
2278
2281
  themes: Me,
2279
2282
  tickets: Xr,
2280
- universalLoginTemplates: nt,
2283
+ universalLoginTemplates: it,
2281
2284
  userOrganizations: se,
2282
2285
  userPermissions: Le,
2283
2286
  userRoles: Re,
@@ -2930,10 +2933,10 @@ function fs(n) {
2930
2933
  var l, d, u, f, p, v;
2931
2934
  const m = typeof a == "string" ? r : a, S = m ?? {}, { param: T } = S, ee = us(S, ["param"]), ie = Object.assign(Object.assign({}, (l = this._def.openapi) === null || l === void 0 ? void 0 : l._internal), typeof a == "string" ? { refId: a } : void 0), ae = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), ee), !((f = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || f === void 0) && f.param || T ? {
2932
2935
  param: Object.assign(Object.assign({}, (v = (p = this._def.openapi) === null || p === void 0 ? void 0 : p.metadata) === null || v === void 0 ? void 0 : v.param), T)
2933
- } : void 0), Ge = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ie).length > 0 ? { _internal: ie } : void 0), Object.keys(ae).length > 0 ? { metadata: ae } : void 0) }));
2936
+ } : void 0), Je = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ie).length > 0 ? { _internal: ie } : void 0), Object.keys(ae).length > 0 ? { metadata: ae } : void 0) }));
2934
2937
  if (ps(this, "ZodObject")) {
2935
2938
  const ut = this.extend;
2936
- Ge.extend = function(...vn) {
2939
+ Je.extend = function(...vn) {
2937
2940
  var wn, Nn, Sn, bn, En, xn, kn;
2938
2941
  const On = ut.apply(this, vn);
2939
2942
  return On._def.openapi = {
@@ -2944,7 +2947,7 @@ function fs(n) {
2944
2947
  }, On;
2945
2948
  };
2946
2949
  }
2947
- return Ge;
2950
+ return Je;
2948
2951
  }, Tt(n, "optional"), Tt(n, "nullable"), Tt(n, "default"), Tt(n, "transform"), Tt(n, "refine");
2949
2952
  const e = n.ZodObject.prototype.deepPartial;
2950
2953
  n.ZodObject.prototype.deepPartial = function() {
@@ -3011,7 +3014,7 @@ var Xn;
3011
3014
  // second overwrites first
3012
3015
  });
3013
3016
  })(Xn || (Xn = {}));
3014
- const x = H.arrayToEnum([
3017
+ const k = H.arrayToEnum([
3015
3018
  "string",
3016
3019
  "nan",
3017
3020
  "number",
@@ -3035,23 +3038,23 @@ const x = H.arrayToEnum([
3035
3038
  ]), We = (n) => {
3036
3039
  switch (typeof n) {
3037
3040
  case "undefined":
3038
- return x.undefined;
3041
+ return k.undefined;
3039
3042
  case "string":
3040
- return x.string;
3043
+ return k.string;
3041
3044
  case "number":
3042
- return Number.isNaN(n) ? x.nan : x.number;
3045
+ return Number.isNaN(n) ? k.nan : k.number;
3043
3046
  case "boolean":
3044
- return x.boolean;
3047
+ return k.boolean;
3045
3048
  case "function":
3046
- return x.function;
3049
+ return k.function;
3047
3050
  case "bigint":
3048
- return x.bigint;
3051
+ return k.bigint;
3049
3052
  case "symbol":
3050
- return x.symbol;
3053
+ return k.symbol;
3051
3054
  case "object":
3052
- return Array.isArray(n) ? x.array : n === null ? x.null : n.then && typeof n.then == "function" && n.catch && typeof n.catch == "function" ? x.promise : typeof Map < "u" && n instanceof Map ? x.map : typeof Set < "u" && n instanceof Set ? x.set : typeof Date < "u" && n instanceof Date ? x.date : x.object;
3055
+ return Array.isArray(n) ? k.array : n === null ? k.null : n.then && typeof n.then == "function" && n.catch && typeof n.catch == "function" ? k.promise : typeof Map < "u" && n instanceof Map ? k.map : typeof Set < "u" && n instanceof Set ? k.set : typeof Date < "u" && n instanceof Date ? k.date : k.object;
3053
3056
  default:
3054
- return x.unknown;
3057
+ return k.unknown;
3055
3058
  }
3056
3059
  }, N = H.arrayToEnum([
3057
3060
  "invalid_type",
@@ -3139,7 +3142,7 @@ const ln = (n, e) => {
3139
3142
  let t;
3140
3143
  switch (n.code) {
3141
3144
  case N.invalid_type:
3142
- n.received === x.undefined ? t = "Required" : t = `Expected ${n.expected}, received ${n.received}`;
3145
+ n.received === k.undefined ? t = "Required" : t = `Expected ${n.expected}, received ${n.received}`;
3143
3146
  break;
3144
3147
  case N.invalid_literal:
3145
3148
  t = `Invalid literal value, expected ${JSON.stringify(n.expected, H.jsonStringifyReplacer)}`;
@@ -3445,7 +3448,7 @@ class q {
3445
3448
  return this._refinement((i, a) => e(i) ? !0 : (a.addIssue(typeof t == "function" ? t(i, a) : t), !1));
3446
3449
  }
3447
3450
  _refinement(e) {
3448
- return new tt({
3451
+ return new nt({
3449
3452
  schema: this,
3450
3453
  typeName: U.ZodEffects,
3451
3454
  effect: { type: "refinement", refinement: e }
@@ -3483,7 +3486,7 @@ class q {
3483
3486
  return Mt.create(this, e, this._def);
3484
3487
  }
3485
3488
  transform(e) {
3486
- return new tt({
3489
+ return new nt({
3487
3490
  ...M(this._def),
3488
3491
  schema: this,
3489
3492
  typeName: U.ZodEffects,
@@ -3573,11 +3576,11 @@ function Us(n, e) {
3573
3576
  }
3574
3577
  class Ze extends q {
3575
3578
  _parse(e) {
3576
- if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== x.string) {
3579
+ if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== k.string) {
3577
3580
  const r = this._getOrReturnCtx(e);
3578
3581
  return E(r, {
3579
3582
  code: N.invalid_type,
3580
- expected: x.string,
3583
+ expected: k.string,
3581
3584
  received: r.parsedType
3582
3585
  }), R;
3583
3586
  }
@@ -3963,11 +3966,11 @@ class yt extends q {
3963
3966
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
3964
3967
  }
3965
3968
  _parse(e) {
3966
- if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== x.number) {
3969
+ if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== k.number) {
3967
3970
  const r = this._getOrReturnCtx(e);
3968
3971
  return E(r, {
3969
3972
  code: N.invalid_type,
3970
- expected: x.number,
3973
+ expected: k.number,
3971
3974
  received: r.parsedType
3972
3975
  }), R;
3973
3976
  }
@@ -4141,7 +4144,7 @@ class Et extends q {
4141
4144
  } catch {
4142
4145
  return this._getInvalidInput(e);
4143
4146
  }
4144
- if (this._getType(e) !== x.bigint)
4147
+ if (this._getType(e) !== k.bigint)
4145
4148
  return this._getInvalidInput(e);
4146
4149
  let i;
4147
4150
  const a = new ke();
@@ -4169,7 +4172,7 @@ class Et extends q {
4169
4172
  const t = this._getOrReturnCtx(e);
4170
4173
  return E(t, {
4171
4174
  code: N.invalid_type,
4172
- expected: x.bigint,
4175
+ expected: k.bigint,
4173
4176
  received: t.parsedType
4174
4177
  }), R;
4175
4178
  }
@@ -4265,11 +4268,11 @@ Et.create = (n) => new Et({
4265
4268
  });
4266
4269
  class dn extends q {
4267
4270
  _parse(e) {
4268
- if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== x.boolean) {
4271
+ if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== k.boolean) {
4269
4272
  const i = this._getOrReturnCtx(e);
4270
4273
  return E(i, {
4271
4274
  code: N.invalid_type,
4272
- expected: x.boolean,
4275
+ expected: k.boolean,
4273
4276
  received: i.parsedType
4274
4277
  }), R;
4275
4278
  }
@@ -4283,11 +4286,11 @@ dn.create = (n) => new dn({
4283
4286
  });
4284
4287
  class zt extends q {
4285
4288
  _parse(e) {
4286
- if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== x.date) {
4289
+ if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== k.date) {
4287
4290
  const r = this._getOrReturnCtx(e);
4288
4291
  return E(r, {
4289
4292
  code: N.invalid_type,
4290
- expected: x.date,
4293
+ expected: k.date,
4291
4294
  received: r.parsedType
4292
4295
  }), R;
4293
4296
  }
@@ -4361,11 +4364,11 @@ zt.create = (n) => new zt({
4361
4364
  });
4362
4365
  class ti extends q {
4363
4366
  _parse(e) {
4364
- if (this._getType(e) !== x.symbol) {
4367
+ if (this._getType(e) !== k.symbol) {
4365
4368
  const i = this._getOrReturnCtx(e);
4366
4369
  return E(i, {
4367
4370
  code: N.invalid_type,
4368
- expected: x.symbol,
4371
+ expected: k.symbol,
4369
4372
  received: i.parsedType
4370
4373
  }), R;
4371
4374
  }
@@ -4378,11 +4381,11 @@ ti.create = (n) => new ti({
4378
4381
  });
4379
4382
  class cn extends q {
4380
4383
  _parse(e) {
4381
- if (this._getType(e) !== x.undefined) {
4384
+ if (this._getType(e) !== k.undefined) {
4382
4385
  const i = this._getOrReturnCtx(e);
4383
4386
  return E(i, {
4384
4387
  code: N.invalid_type,
4385
- expected: x.undefined,
4388
+ expected: k.undefined,
4386
4389
  received: i.parsedType
4387
4390
  }), R;
4388
4391
  }
@@ -4395,11 +4398,11 @@ cn.create = (n) => new cn({
4395
4398
  });
4396
4399
  class _n extends q {
4397
4400
  _parse(e) {
4398
- if (this._getType(e) !== x.null) {
4401
+ if (this._getType(e) !== k.null) {
4399
4402
  const i = this._getOrReturnCtx(e);
4400
4403
  return E(i, {
4401
4404
  code: N.invalid_type,
4402
- expected: x.null,
4405
+ expected: k.null,
4403
4406
  received: i.parsedType
4404
4407
  }), R;
4405
4408
  }
@@ -4434,27 +4437,27 @@ un.create = (n) => new un({
4434
4437
  typeName: U.ZodUnknown,
4435
4438
  ...M(n)
4436
4439
  });
4437
- class et extends q {
4440
+ class tt extends q {
4438
4441
  _parse(e) {
4439
4442
  const t = this._getOrReturnCtx(e);
4440
4443
  return E(t, {
4441
4444
  code: N.invalid_type,
4442
- expected: x.never,
4445
+ expected: k.never,
4443
4446
  received: t.parsedType
4444
4447
  }), R;
4445
4448
  }
4446
4449
  }
4447
- et.create = (n) => new et({
4450
+ tt.create = (n) => new tt({
4448
4451
  typeName: U.ZodNever,
4449
4452
  ...M(n)
4450
4453
  });
4451
4454
  class ni extends q {
4452
4455
  _parse(e) {
4453
- if (this._getType(e) !== x.undefined) {
4456
+ if (this._getType(e) !== k.undefined) {
4454
4457
  const i = this._getOrReturnCtx(e);
4455
4458
  return E(i, {
4456
4459
  code: N.invalid_type,
4457
- expected: x.void,
4460
+ expected: k.void,
4458
4461
  received: i.parsedType
4459
4462
  }), R;
4460
4463
  }
@@ -4468,10 +4471,10 @@ ni.create = (n) => new ni({
4468
4471
  class $e extends q {
4469
4472
  _parse(e) {
4470
4473
  const { ctx: t, status: i } = this._processInputParams(e), a = this._def;
4471
- if (t.parsedType !== x.array)
4474
+ if (t.parsedType !== k.array)
4472
4475
  return E(t, {
4473
4476
  code: N.invalid_type,
4474
- expected: x.array,
4477
+ expected: k.array,
4475
4478
  received: t.parsedType
4476
4479
  }), R;
4477
4480
  if (a.exactLength !== null) {
@@ -4565,16 +4568,16 @@ class le extends q {
4565
4568
  return this._cached = { shape: e, keys: t }, this._cached;
4566
4569
  }
4567
4570
  _parse(e) {
4568
- if (this._getType(e) !== x.object) {
4571
+ if (this._getType(e) !== k.object) {
4569
4572
  const f = this._getOrReturnCtx(e);
4570
4573
  return E(f, {
4571
4574
  code: N.invalid_type,
4572
- expected: x.object,
4575
+ expected: k.object,
4573
4576
  received: f.parsedType
4574
4577
  }), R;
4575
4578
  }
4576
4579
  const { status: i, ctx: a } = this._processInputParams(e), { shape: r, keys: l } = this._getCached(), d = [];
4577
- if (!(this._def.catchall instanceof et && this._def.unknownKeys === "strip"))
4580
+ if (!(this._def.catchall instanceof tt && this._def.unknownKeys === "strip"))
4578
4581
  for (const f in a.data)
4579
4582
  l.includes(f) || d.push(f);
4580
4583
  const u = [];
@@ -4586,7 +4589,7 @@ class le extends q {
4586
4589
  alwaysSet: f in a.data
4587
4590
  });
4588
4591
  }
4589
- if (this._def.catchall instanceof et) {
4592
+ if (this._def.catchall instanceof tt) {
4590
4593
  const f = this._def.unknownKeys;
4591
4594
  if (f === "passthrough")
4592
4595
  for (const p of d)
@@ -4824,21 +4827,21 @@ class le extends q {
4824
4827
  le.create = (n, e) => new le({
4825
4828
  shape: () => n,
4826
4829
  unknownKeys: "strip",
4827
- catchall: et.create(),
4830
+ catchall: tt.create(),
4828
4831
  typeName: U.ZodObject,
4829
4832
  ...M(e)
4830
4833
  });
4831
4834
  le.strictCreate = (n, e) => new le({
4832
4835
  shape: () => n,
4833
4836
  unknownKeys: "strict",
4834
- catchall: et.create(),
4837
+ catchall: tt.create(),
4835
4838
  typeName: U.ZodObject,
4836
4839
  ...M(e)
4837
4840
  });
4838
4841
  le.lazycreate = (n, e) => new le({
4839
4842
  shape: n,
4840
4843
  unknownKeys: "strip",
4841
- catchall: et.create(),
4844
+ catchall: tt.create(),
4842
4845
  typeName: U.ZodObject,
4843
4846
  ...M(e)
4844
4847
  });
@@ -4915,14 +4918,14 @@ Pt.create = (n, e) => new Pt({
4915
4918
  typeName: U.ZodUnion,
4916
4919
  ...M(e)
4917
4920
  });
4918
- const Je = (n) => n instanceof pn ? Je(n.schema) : n instanceof tt ? Je(n.innerType()) : n instanceof Bt ? [n.value] : n instanceof lt ? n.options : n instanceof $t ? H.objectValues(n.enum) : n instanceof Vt ? Je(n._def.innerType) : n instanceof cn ? [void 0] : n instanceof _n ? [null] : n instanceof He ? [void 0, ...Je(n.unwrap())] : n instanceof dt ? [null, ...Je(n.unwrap())] : n instanceof yi || n instanceof Ht ? Je(n.unwrap()) : n instanceof Zt ? Je(n._def.innerType) : [];
4921
+ const Ge = (n) => n instanceof pn ? Ge(n.schema) : n instanceof nt ? Ge(n.innerType()) : n instanceof Bt ? [n.value] : n instanceof lt ? n.options : n instanceof $t ? H.objectValues(n.enum) : n instanceof Vt ? Ge(n._def.innerType) : n instanceof cn ? [void 0] : n instanceof _n ? [null] : n instanceof He ? [void 0, ...Ge(n.unwrap())] : n instanceof dt ? [null, ...Ge(n.unwrap())] : n instanceof yi || n instanceof Ht ? Ge(n.unwrap()) : n instanceof Zt ? Ge(n._def.innerType) : [];
4919
4922
  class gn extends q {
4920
4923
  _parse(e) {
4921
4924
  const { ctx: t } = this._processInputParams(e);
4922
- if (t.parsedType !== x.object)
4925
+ if (t.parsedType !== k.object)
4923
4926
  return E(t, {
4924
4927
  code: N.invalid_type,
4925
- expected: x.object,
4928
+ expected: k.object,
4926
4929
  received: t.parsedType
4927
4930
  }), R;
4928
4931
  const i = this.discriminator, a = t.data[i], r = this.optionsMap.get(a);
@@ -4960,7 +4963,7 @@ class gn extends q {
4960
4963
  static create(e, t, i) {
4961
4964
  const a = /* @__PURE__ */ new Map();
4962
4965
  for (const r of t) {
4963
- const l = Je(r.shape[e]);
4966
+ const l = Ge(r.shape[e]);
4964
4967
  if (!l.length)
4965
4968
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
4966
4969
  for (const d of l) {
@@ -4982,7 +4985,7 @@ function ii(n, e) {
4982
4985
  const t = We(n), i = We(e);
4983
4986
  if (n === e)
4984
4987
  return { valid: !0, data: n };
4985
- if (t === x.object && i === x.object) {
4988
+ if (t === k.object && i === k.object) {
4986
4989
  const a = H.objectKeys(e), r = H.objectKeys(n).filter((d) => a.indexOf(d) !== -1), l = { ...n, ...e };
4987
4990
  for (const d of r) {
4988
4991
  const u = ii(n[d], e[d]);
@@ -4991,7 +4994,7 @@ function ii(n, e) {
4991
4994
  l[d] = u.data;
4992
4995
  }
4993
4996
  return { valid: !0, data: l };
4994
- } else if (t === x.array && i === x.array) {
4997
+ } else if (t === k.array && i === k.array) {
4995
4998
  if (n.length !== e.length)
4996
4999
  return { valid: !1 };
4997
5000
  const a = [];
@@ -5002,7 +5005,7 @@ function ii(n, e) {
5002
5005
  a.push(u.data);
5003
5006
  }
5004
5007
  return { valid: !0, data: a };
5005
- } else return t === x.date && i === x.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
5008
+ } else return t === k.date && i === k.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
5006
5009
  }
5007
5010
  class Mt extends q {
5008
5011
  _parse(e) {
@@ -5045,10 +5048,10 @@ Mt.create = (n, e, t) => new Mt({
5045
5048
  class st extends q {
5046
5049
  _parse(e) {
5047
5050
  const { status: t, ctx: i } = this._processInputParams(e);
5048
- if (i.parsedType !== x.array)
5051
+ if (i.parsedType !== k.array)
5049
5052
  return E(i, {
5050
5053
  code: N.invalid_type,
5051
- expected: x.array,
5054
+ expected: k.array,
5052
5055
  received: i.parsedType
5053
5056
  }), R;
5054
5057
  if (i.data.length < this._def.items.length)
@@ -5101,10 +5104,10 @@ class qt extends q {
5101
5104
  }
5102
5105
  _parse(e) {
5103
5106
  const { status: t, ctx: i } = this._processInputParams(e);
5104
- if (i.parsedType !== x.object)
5107
+ if (i.parsedType !== k.object)
5105
5108
  return E(i, {
5106
5109
  code: N.invalid_type,
5107
- expected: x.object,
5110
+ expected: k.object,
5108
5111
  received: i.parsedType
5109
5112
  }), R;
5110
5113
  const a = [], r = this._def.keyType, l = this._def.valueType;
@@ -5142,10 +5145,10 @@ class ai extends q {
5142
5145
  }
5143
5146
  _parse(e) {
5144
5147
  const { status: t, ctx: i } = this._processInputParams(e);
5145
- if (i.parsedType !== x.map)
5148
+ if (i.parsedType !== k.map)
5146
5149
  return E(i, {
5147
5150
  code: N.invalid_type,
5148
- expected: x.map,
5151
+ expected: k.map,
5149
5152
  received: i.parsedType
5150
5153
  }), R;
5151
5154
  const a = this._def.keyType, r = this._def.valueType, l = [...i.data.entries()].map(([d, u], f) => ({
@@ -5184,10 +5187,10 @@ ai.create = (n, e, t) => new ai({
5184
5187
  class xt extends q {
5185
5188
  _parse(e) {
5186
5189
  const { status: t, ctx: i } = this._processInputParams(e);
5187
- if (i.parsedType !== x.set)
5190
+ if (i.parsedType !== k.set)
5188
5191
  return E(i, {
5189
5192
  code: N.invalid_type,
5190
- expected: x.set,
5193
+ expected: k.set,
5191
5194
  received: i.parsedType
5192
5195
  }), R;
5193
5196
  const a = this._def;
@@ -5345,7 +5348,7 @@ lt.create = _r;
5345
5348
  class $t extends q {
5346
5349
  _parse(e) {
5347
5350
  const t = H.getValidEnumValues(this._def.values), i = this._getOrReturnCtx(e);
5348
- if (i.parsedType !== x.string && i.parsedType !== x.number) {
5351
+ if (i.parsedType !== k.string && i.parsedType !== k.number) {
5349
5352
  const a = H.objectValues(t);
5350
5353
  return E(i, {
5351
5354
  expected: H.joinValues(a),
@@ -5378,13 +5381,13 @@ class jt extends q {
5378
5381
  }
5379
5382
  _parse(e) {
5380
5383
  const { ctx: t } = this._processInputParams(e);
5381
- if (t.parsedType !== x.promise && t.common.async === !1)
5384
+ if (t.parsedType !== k.promise && t.common.async === !1)
5382
5385
  return E(t, {
5383
5386
  code: N.invalid_type,
5384
- expected: x.promise,
5387
+ expected: k.promise,
5385
5388
  received: t.parsedType
5386
5389
  }), R;
5387
- const i = t.parsedType === x.promise ? t.data : Promise.resolve(t.data);
5390
+ const i = t.parsedType === k.promise ? t.data : Promise.resolve(t.data);
5388
5391
  return De(i.then((a) => this._def.type.parseAsync(a, {
5389
5392
  path: t.path,
5390
5393
  errorMap: t.common.contextualErrorMap
@@ -5396,7 +5399,7 @@ jt.create = (n, e) => new jt({
5396
5399
  typeName: U.ZodPromise,
5397
5400
  ...M(e)
5398
5401
  });
5399
- class tt extends q {
5402
+ class nt extends q {
5400
5403
  innerType() {
5401
5404
  return this._def.schema;
5402
5405
  }
@@ -5476,13 +5479,13 @@ class tt extends q {
5476
5479
  H.assertNever(a);
5477
5480
  }
5478
5481
  }
5479
- tt.create = (n, e, t) => new tt({
5482
+ nt.create = (n, e, t) => new nt({
5480
5483
  schema: n,
5481
5484
  typeName: U.ZodEffects,
5482
5485
  effect: e,
5483
5486
  ...M(t)
5484
5487
  });
5485
- tt.createWithPreprocess = (n, e, t) => new tt({
5488
+ nt.createWithPreprocess = (n, e, t) => new nt({
5486
5489
  schema: e,
5487
5490
  effect: { type: "preprocess", transform: n },
5488
5491
  typeName: U.ZodEffects,
@@ -5490,7 +5493,7 @@ tt.createWithPreprocess = (n, e, t) => new tt({
5490
5493
  });
5491
5494
  class He extends q {
5492
5495
  _parse(e) {
5493
- return this._getType(e) === x.undefined ? De(void 0) : this._def.innerType._parse(e);
5496
+ return this._getType(e) === k.undefined ? De(void 0) : this._def.innerType._parse(e);
5494
5497
  }
5495
5498
  unwrap() {
5496
5499
  return this._def.innerType;
@@ -5503,7 +5506,7 @@ He.create = (n, e) => new He({
5503
5506
  });
5504
5507
  class dt extends q {
5505
5508
  _parse(e) {
5506
- return this._getType(e) === x.null ? De(null) : this._def.innerType._parse(e);
5509
+ return this._getType(e) === k.null ? De(null) : this._def.innerType._parse(e);
5507
5510
  }
5508
5511
  unwrap() {
5509
5512
  return this._def.innerType;
@@ -5518,7 +5521,7 @@ class Vt extends q {
5518
5521
  _parse(e) {
5519
5522
  const { ctx: t } = this._processInputParams(e);
5520
5523
  let i = t.data;
5521
- return t.parsedType === x.undefined && (i = this._def.defaultValue()), this._def.innerType._parse({
5524
+ return t.parsedType === k.undefined && (i = this._def.defaultValue()), this._def.innerType._parse({
5522
5525
  data: i,
5523
5526
  path: t.path,
5524
5527
  parent: t
@@ -5579,11 +5582,11 @@ Zt.create = (n, e) => new Zt({
5579
5582
  });
5580
5583
  class oi extends q {
5581
5584
  _parse(e) {
5582
- if (this._getType(e) !== x.nan) {
5585
+ if (this._getType(e) !== k.nan) {
5583
5586
  const i = this._getOrReturnCtx(e);
5584
5587
  return E(i, {
5585
5588
  code: N.invalid_type,
5586
- expected: x.nan,
5589
+ expected: k.nan,
5587
5590
  received: i.parsedType
5588
5591
  }), R;
5589
5592
  }
@@ -5668,12 +5671,12 @@ var U;
5668
5671
  (function(n) {
5669
5672
  n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
5670
5673
  })(U || (U = {}));
5671
- const o = Ze.create, I = yt.create, h = dn.create, j = Ft.create, at = un.create;
5672
- et.create;
5674
+ const o = Ze.create, I = yt.create, h = dn.create, j = Ft.create, et = un.create;
5675
+ tt.create;
5673
5676
  const b = $e.create, _ = le.create, Pe = Pt.create, kt = gn.create;
5674
5677
  Mt.create;
5675
5678
  st.create;
5676
- const P = qt.create, O = Bt.create, k = lt.create, gt = $t.create;
5679
+ const P = qt.create, O = Bt.create, x = lt.create, gt = $t.create;
5677
5680
  jt.create;
5678
5681
  He.create;
5679
5682
  dt.create;
@@ -5693,7 +5696,7 @@ const Fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5693
5696
  ZodDate: zt,
5694
5697
  ZodDefault: Vt,
5695
5698
  ZodDiscriminatedUnion: gn,
5696
- ZodEffects: tt,
5699
+ ZodEffects: nt,
5697
5700
  ZodEnum: lt,
5698
5701
  ZodError: Ke,
5699
5702
  get ZodFirstPartyTypeKind() {
@@ -5706,13 +5709,13 @@ const Fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5706
5709
  ZodMap: ai,
5707
5710
  ZodNaN: oi,
5708
5711
  ZodNativeEnum: $t,
5709
- ZodNever: et,
5712
+ ZodNever: tt,
5710
5713
  ZodNull: _n,
5711
5714
  ZodNullable: dt,
5712
5715
  ZodNumber: yt,
5713
5716
  ZodObject: le,
5714
5717
  ZodOptional: He,
5715
- ZodParsedType: x,
5718
+ ZodParsedType: k,
5716
5719
  ZodPipeline: mn,
5717
5720
  ZodPromise: jt,
5718
5721
  ZodReadonly: Ht,
@@ -5721,7 +5724,7 @@ const Fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5721
5724
  ZodSet: xt,
5722
5725
  ZodString: Ze,
5723
5726
  ZodSymbol: ti,
5724
- ZodTransformer: tt,
5727
+ ZodTransformer: nt,
5725
5728
  ZodTuple: st,
5726
5729
  ZodType: q,
5727
5730
  ZodUndefined: cn,
@@ -5736,7 +5739,7 @@ const Fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5736
5739
  datetimeRegex: cr,
5737
5740
  defaultErrorMap: ln,
5738
5741
  discriminatedUnion: kt,
5739
- enum: k,
5742
+ enum: x,
5740
5743
  getErrorMap: rr,
5741
5744
  getParsedType: We,
5742
5745
  isAborted: Yn,
@@ -5754,7 +5757,7 @@ const Fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5754
5757
  record: P,
5755
5758
  string: o,
5756
5759
  union: Pe,
5757
- unknown: at,
5760
+ unknown: et,
5758
5761
  get util() {
5759
5762
  return H;
5760
5763
  }
@@ -5781,13 +5784,13 @@ const Ve = _({
5781
5784
  secrets: b(qs).optional()
5782
5785
  });
5783
5786
  ur.partial().extend({
5784
- status: k(["draft", "built"]).optional(),
5787
+ status: x(["draft", "built"]).optional(),
5785
5788
  deployed_at: o().optional()
5786
5789
  });
5787
5790
  ur.extend({
5788
5791
  id: o(),
5789
5792
  tenant_id: o(),
5790
- status: k(["draft", "built"]).default("built"),
5793
+ status: x(["draft", "built"]).default("built"),
5791
5794
  deployed_at: o().optional(),
5792
5795
  // Override secrets to return names only (no values) in responses
5793
5796
  secrets: b(
@@ -5798,13 +5801,13 @@ ur.extend({
5798
5801
  ).optional(),
5799
5802
  ...Ve.shape
5800
5803
  });
5801
- const Bs = k([
5804
+ const Bs = x([
5802
5805
  "user_action",
5803
5806
  "admin_action",
5804
5807
  "system",
5805
5808
  "api"
5806
5809
  ]), $s = _({
5807
- type: k(["user", "admin", "system", "api_key", "client_credentials"]),
5810
+ type: x(["user", "admin", "system", "api_key", "client_credentials"]),
5808
5811
  id: o().optional(),
5809
5812
  email: o().optional(),
5810
5813
  org_id: o().optional(),
@@ -5814,20 +5817,20 @@ const Bs = k([
5814
5817
  }), js = _({
5815
5818
  type: o(),
5816
5819
  id: o(),
5817
- before: P(at()).optional(),
5818
- after: P(at()).optional(),
5819
- diff: P(_({ old: at(), new: at() })).optional()
5820
+ before: P(et()).optional(),
5821
+ after: P(et()).optional(),
5822
+ diff: P(_({ old: et(), new: et() })).optional()
5820
5823
  }), Vs = _({
5821
5824
  method: o(),
5822
5825
  path: o(),
5823
5826
  query: P(o()).optional(),
5824
- body: at().optional(),
5827
+ body: et().optional(),
5825
5828
  ip: o(),
5826
5829
  user_agent: o().optional(),
5827
5830
  correlation_id: o().optional()
5828
5831
  }), Zs = _({
5829
5832
  status_code: I(),
5830
- body: at().optional()
5833
+ body: et().optional()
5831
5834
  }), Hs = _({
5832
5835
  country_code: o(),
5833
5836
  city_name: o(),
@@ -5863,23 +5866,23 @@ const Bs = k([
5863
5866
  Qs.extend({
5864
5867
  id: o()
5865
5868
  });
5866
- k(["AUTH0", "EMAIL", "REDIRECT"]);
5867
- k([
5869
+ x(["AUTH0", "EMAIL", "REDIRECT"]);
5870
+ x([
5868
5871
  "CREATE_USER",
5869
5872
  "GET_USER",
5870
5873
  "UPDATE_USER",
5871
5874
  "SEND_REQUEST",
5872
5875
  "SEND_EMAIL"
5873
5876
  ]);
5874
- k(["VERIFY_EMAIL"]);
5875
- const Gs = _({
5877
+ x(["VERIFY_EMAIL"]);
5878
+ const Js = _({
5876
5879
  require_mx_record: h().optional(),
5877
5880
  block_aliases: h().optional(),
5878
5881
  block_free_emails: h().optional(),
5879
5882
  block_disposable_emails: h().optional(),
5880
5883
  blocklist: b(o()).optional(),
5881
5884
  allowlist: b(o()).optional()
5882
- }), Js = _({
5885
+ }), Gs = _({
5883
5886
  id: o(),
5884
5887
  alias: o().max(100).optional(),
5885
5888
  type: O("AUTH0"),
@@ -5900,9 +5903,9 @@ const Gs = _({
5900
5903
  mask_output: h().optional(),
5901
5904
  params: _({
5902
5905
  email: o(),
5903
- rules: Gs.optional()
5906
+ rules: Js.optional()
5904
5907
  })
5905
- }), Xs = k(["change-email", "account", "custom"]), Ys = _({
5908
+ }), Xs = x(["change-email", "account", "custom"]), Ys = _({
5906
5909
  id: o(),
5907
5910
  alias: o().max(100).optional(),
5908
5911
  type: O("REDIRECT"),
@@ -5918,7 +5921,7 @@ const Gs = _({
5918
5921
  })
5919
5922
  })
5920
5923
  }), el = Pe([
5921
- Js,
5924
+ Gs,
5922
5925
  Ws,
5923
5926
  Ys
5924
5927
  ]), tl = _({
@@ -6094,7 +6097,7 @@ const dl = _({
6094
6097
  client_secret: o().default(() => ll()).optional().openapi({
6095
6098
  description: "Client secret (which you must not make public)."
6096
6099
  }),
6097
- app_type: k([
6100
+ app_type: x([
6098
6101
  "native",
6099
6102
  "spa",
6100
6103
  "regular_web",
@@ -6201,7 +6204,7 @@ const dl = _({
6201
6204
  addons: P(j()).default({}).optional().openapi({
6202
6205
  description: "Addons enabled for this client and their associated configurations."
6203
6206
  }),
6204
- token_endpoint_auth_method: k(["none", "client_secret_post", "client_secret_basic"]).default("client_secret_basic").optional().openapi({
6207
+ token_endpoint_auth_method: x(["none", "client_secret_post", "client_secret_basic"]).default("client_secret_basic").optional().openapi({
6205
6208
  description: "Defines the requested authentication method for the token endpoint. Can be none (public client without a client secret), client_secret_post (client uses HTTP POST parameters), or client_secret_basic (client uses HTTP Basic)."
6206
6209
  }),
6207
6210
  client_metadata: P(o().max(255)).default({}).optional().openapi({
@@ -6220,10 +6223,10 @@ const dl = _({
6220
6223
  default_organization: P(j()).default({}).optional().openapi({
6221
6224
  description: "Defines the default Organization ID and flows"
6222
6225
  }),
6223
- organization_usage: k(["deny", "allow", "require"]).default("deny").optional().openapi({
6226
+ organization_usage: x(["deny", "allow", "require"]).default("deny").optional().openapi({
6224
6227
  description: "Defines how to proceed during an authentication transaction with regards an organization. Can be deny (default), allow or require."
6225
6228
  }),
6226
- organization_require_behavior: k(["no_prompt", "pre_login_prompt", "post_login_prompt"]).default("no_prompt").optional().openapi({
6229
+ organization_require_behavior: x(["no_prompt", "pre_login_prompt", "post_login_prompt"]).default("no_prompt").optional().openapi({
6227
6230
  description: "Defines how to proceed during an authentication transaction when client.organization_usage: 'require'. Can be no_prompt (default), pre_login_prompt or post_login_prompt. post_login_prompt requires oidc_conformant: true."
6228
6231
  }),
6229
6232
  client_authentication_methods: P(j()).default({}).optional().openapi({
@@ -6238,7 +6241,7 @@ const dl = _({
6238
6241
  signed_request_object: P(j()).default({}).optional().openapi({
6239
6242
  description: "JWT-secured Authorization Requests (JAR) settings."
6240
6243
  }),
6241
- compliance_level: k([
6244
+ compliance_level: x([
6242
6245
  "none",
6243
6246
  "fapi1_adv_pkj_par",
6244
6247
  "fapi1_adv_mtls_par",
@@ -6254,11 +6257,14 @@ const dl = _({
6254
6257
  owner_user_id: o().optional().openapi({
6255
6258
  description: "User ID of the consenting user when this client was created via IAT-gated Dynamic Client Registration. NULL for clients created via the Management API or open DCR."
6256
6259
  }),
6257
- registration_type: k(["manual", "open_dcr", "iat_dcr"]).optional().openapi({
6260
+ registration_type: x(["manual", "open_dcr", "iat_dcr"]).optional().openapi({
6258
6261
  description: "Provenance of this client. `manual` = Management API; `open_dcr` = RFC 7591 without IAT; `iat_dcr` = RFC 7591 with an Initial Access Token."
6259
6262
  }),
6260
6263
  registration_metadata: P(j()).default({}).optional().openapi({
6261
6264
  description: "Arbitrary metadata captured at Dynamic Client Registration time that isn't a first-class client field (e.g. integration_type, domain). Also stores `iat_constraints` for clients created via IAT so RFC 7592 PUT can enforce field immutability."
6265
+ }),
6266
+ user_linking_mode: x(["builtin", "off"]).optional().openapi({
6267
+ description: "Per-client override for the built-in email-based user-linking path. `builtin` runs the legacy in-process linking at user creation/email update. `off` disables the legacy path; linking only happens if the tenant has enabled the `account-linking` template hook. When unset, the service-level `userLinkingMode` default applies."
6262
6268
  })
6263
6269
  });
6264
6270
  _({
@@ -6276,7 +6282,7 @@ const cl = _({
6276
6282
  scope: b(o()).optional().openapi({
6277
6283
  description: "Scopes allowed for this client grant."
6278
6284
  }),
6279
- organization_usage: k(["deny", "allow", "require"]).optional().openapi({
6285
+ organization_usage: x(["deny", "allow", "require"]).optional().openapi({
6280
6286
  description: "Defines whether organizations can be used with client credentials exchanges for this grant."
6281
6287
  }),
6282
6288
  allow_any_organization: h().optional().openapi({
@@ -6285,7 +6291,7 @@ const cl = _({
6285
6291
  is_system: h().optional().openapi({
6286
6292
  description: "If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly."
6287
6293
  }),
6288
- subject_type: k(["client", "user"]).optional().openapi({
6294
+ subject_type: x(["client", "user"]).optional().openapi({
6289
6295
  description: "The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement."
6290
6296
  }),
6291
6297
  authorization_details_types: b(o()).optional().openapi({
@@ -6300,13 +6306,13 @@ const cl = _({
6300
6306
  updated_at: o().optional()
6301
6307
  });
6302
6308
  b(_l);
6303
- const fr = k(["iat", "rat"]), ul = _({
6309
+ const fr = x(["iat", "rat"]), ul = _({
6304
6310
  id: o(),
6305
6311
  token_hash: o(),
6306
6312
  type: fr,
6307
6313
  client_id: o().optional(),
6308
6314
  sub: o().optional(),
6309
- constraints: P(at()).optional(),
6315
+ constraints: P(et()).optional(),
6310
6316
  single_use: h().default(!1),
6311
6317
  expires_at: o().optional()
6312
6318
  });
@@ -6469,10 +6475,10 @@ const yn = _({
6469
6475
  coordinates: Ot,
6470
6476
  alias: o().optional(),
6471
6477
  config: _({
6472
- action_type: k(["REDIRECT"]).openapi({
6478
+ action_type: x(["REDIRECT"]).openapi({
6473
6479
  description: "The type of action to perform"
6474
6480
  }),
6475
- target: k(["change-email", "account", "custom"]).openapi({
6481
+ target: x(["change-email", "account", "custom"]).openapi({
6476
6482
  description: "The predefined target to redirect to"
6477
6483
  }),
6478
6484
  custom_url: o().optional().openapi({
@@ -6561,7 +6567,7 @@ _({
6561
6567
  url: o()
6562
6568
  }).optional()
6563
6569
  });
6564
- const Tl = k([
6570
+ const Tl = x([
6565
6571
  "password_reset",
6566
6572
  "email_verification",
6567
6573
  "otp",
@@ -6586,7 +6592,7 @@ const Tl = k([
6586
6592
  code_challenge: o().optional().openapi({
6587
6593
  description: "The code challenge used in PKCE in outbound flows"
6588
6594
  }),
6589
- code_challenge_method: k(["plain", "S256"]).optional().openapi({
6595
+ code_challenge_method: x(["plain", "S256"]).optional().openapi({
6590
6596
  description: "The code challenge method used in PKCE in outbound flows"
6591
6597
  }),
6592
6598
  redirect_uri: o().optional().openapi({
@@ -6630,7 +6636,7 @@ const Il = _({
6630
6636
  twilio_token: o().optional(),
6631
6637
  icon_url: o().optional(),
6632
6638
  // Password policy options for Username-Password-Authentication connections
6633
- passwordPolicy: k(["none", "low", "fair", "good", "excellent"]).optional(),
6639
+ passwordPolicy: x(["none", "low", "fair", "good", "excellent"]).optional(),
6634
6640
  password_complexity_options: _({
6635
6641
  min_length: I().optional()
6636
6642
  }).optional(),
@@ -6658,7 +6664,7 @@ const Il = _({
6658
6664
  active: h().optional()
6659
6665
  }).optional(),
6660
6666
  signup: _({
6661
- status: k(["required", "optional", "disabled"]).optional(),
6667
+ status: x(["required", "optional", "disabled"]).optional(),
6662
6668
  verification: _({
6663
6669
  active: h().optional()
6664
6670
  }).optional()
@@ -6668,14 +6674,14 @@ const Il = _({
6668
6674
  }).optional(),
6669
6675
  unique: h().optional(),
6670
6676
  profile_required: h().optional(),
6671
- verification_method: k(["link", "code"]).optional()
6677
+ verification_method: x(["link", "code"]).optional()
6672
6678
  }).optional(),
6673
6679
  username: _({
6674
6680
  identifier: _({
6675
6681
  active: h().optional()
6676
6682
  }).optional(),
6677
6683
  signup: _({
6678
- status: k(["required", "optional", "disabled"]).optional()
6684
+ status: x(["required", "optional", "disabled"]).optional()
6679
6685
  }).optional(),
6680
6686
  validation: _({
6681
6687
  max_length: I().optional(),
@@ -6692,7 +6698,7 @@ const Il = _({
6692
6698
  active: h().optional()
6693
6699
  }).optional(),
6694
6700
  signup: _({
6695
- status: k(["required", "optional", "disabled"]).optional()
6701
+ status: x(["required", "optional", "disabled"]).optional()
6696
6702
  }).optional()
6697
6703
  }).optional()
6698
6704
  }).optional(),
@@ -6707,7 +6713,7 @@ const Il = _({
6707
6713
  }).optional(),
6708
6714
  // Passkey options for Username-Password-Authentication connections
6709
6715
  passkey_options: _({
6710
- challenge_ui: k(["both", "autofill", "button"]).optional(),
6716
+ challenge_ui: x(["both", "autofill", "button"]).optional(),
6711
6717
  local_enrollment_enabled: h().optional(),
6712
6718
  progressive_enrollment_enabled: h().optional()
6713
6719
  }).optional(),
@@ -6720,7 +6726,7 @@ const Il = _({
6720
6726
  }).optional()
6721
6727
  }).optional(),
6722
6728
  // Controls when root user attributes are updated from external IdP
6723
- set_user_root_attributes: k(["on_each_login", "on_first_login", "never_on_login"]).optional()
6729
+ set_user_root_attributes: x(["on_each_login", "on_first_login", "never_on_login"]).optional()
6724
6730
  }), Cl = _({
6725
6731
  id: o().optional(),
6726
6732
  name: o(),
@@ -6743,10 +6749,10 @@ _({
6743
6749
  const Dl = _({
6744
6750
  domain: o(),
6745
6751
  custom_domain_id: o().optional(),
6746
- type: k(["auth0_managed_certs", "self_managed_certs"]),
6747
- verification_method: k(["txt"]).optional(),
6748
- tls_policy: k(["recommended"]).optional(),
6749
- custom_client_ip_header: k([
6752
+ type: x(["auth0_managed_certs", "self_managed_certs"]),
6753
+ verification_method: x(["txt"]).optional(),
6754
+ tls_policy: x(["recommended"]).optional(),
6755
+ custom_client_ip_header: x([
6750
6756
  "true-client-ip",
6751
6757
  "cf-connecting-ip",
6752
6758
  "x-forwarded-for",
@@ -6769,7 +6775,7 @@ const Dl = _({
6769
6775
  ...Dl.shape,
6770
6776
  custom_domain_id: o(),
6771
6777
  primary: h(),
6772
- status: k(["disabled", "pending", "pending_verification", "ready"]),
6778
+ status: x(["disabled", "pending", "pending_verification", "ready"]),
6773
6779
  origin_domain_name: o().optional(),
6774
6780
  verification: _({
6775
6781
  methods: b(Ll)
@@ -6859,7 +6865,7 @@ const vi = _({
6859
6865
  _({
6860
6866
  id: I().optional(),
6861
6867
  text: o(),
6862
- type: k(["info", "error", "success", "warning"])
6868
+ type: x(["info", "error", "success", "warning"])
6863
6869
  })
6864
6870
  ).optional(),
6865
6871
  required: h().optional(),
@@ -6891,11 +6897,11 @@ const vi = _({
6891
6897
  label: o()
6892
6898
  })
6893
6899
  ).optional(),
6894
- display: k(["radio", "checkbox"]).optional(),
6900
+ display: x(["radio", "checkbox"]).optional(),
6895
6901
  multiple: h().optional(),
6896
6902
  default_value: Pe([o(), b(o())]).optional()
6897
6903
  }).optional()
6898
- }), Gl = Se.extend({
6904
+ }), Jl = Se.extend({
6899
6905
  type: O("CUSTOM"),
6900
6906
  config: _({
6901
6907
  component: o().optional(),
@@ -6903,7 +6909,7 @@ const vi = _({
6903
6909
  schema: P(j()).optional(),
6904
6910
  code: o().optional()
6905
6911
  })
6906
- }), Jl = Se.extend({
6912
+ }), Gl = Se.extend({
6907
6913
  type: O("DATE"),
6908
6914
  config: _({
6909
6915
  format: o().optional(),
@@ -7029,8 +7035,8 @@ const vi = _({
7029
7035
  Kl,
7030
7036
  Ql,
7031
7037
  sd,
7032
- Gl,
7033
7038
  Jl,
7039
+ Gl,
7034
7040
  Wl,
7035
7041
  Xl,
7036
7042
  Yl,
@@ -7142,7 +7148,7 @@ _({
7142
7148
  const md = _({
7143
7149
  id: I().optional(),
7144
7150
  text: o(),
7145
- type: k(["info", "error", "success", "warning"])
7151
+ type: x(["info", "error", "success", "warning"])
7146
7152
  }), yd = _({
7147
7153
  id: o().optional(),
7148
7154
  text: o(),
@@ -7153,7 +7159,7 @@ _({
7153
7159
  /** Screen identifier for CSS targeting (e.g., 'identifier', 'enter-password', 'signup') */
7154
7160
  name: o().optional(),
7155
7161
  action: o(),
7156
- method: k(["POST", "GET"]),
7162
+ method: x(["POST", "GET"]),
7157
7163
  title: o().optional(),
7158
7164
  description: o().optional(),
7159
7165
  components: b(wr),
@@ -7162,37 +7168,53 @@ _({
7162
7168
  /** Footer HTML content displayed at the very bottom of the widget (e.g., terms and conditions) */
7163
7169
  footer: o().optional()
7164
7170
  });
7165
- const Nr = k([
7171
+ const Nr = x([
7166
7172
  "pre-user-registration",
7167
7173
  "post-user-registration",
7168
7174
  "post-user-login",
7175
+ "post-user-update",
7169
7176
  "validate-registration-username",
7170
7177
  "pre-user-deletion",
7171
7178
  "post-user-deletion"
7172
7179
  // Potentially other triggers specific to webhooks in the future
7173
- ]), Sr = k([
7180
+ ]), Sr = x([
7174
7181
  "pre-user-registration",
7175
7182
  "post-user-registration",
7176
7183
  "post-user-login",
7177
7184
  "validate-registration-username",
7178
7185
  "pre-user-deletion",
7179
7186
  "post-user-deletion"
7180
- ]), br = k([
7187
+ ]), br = x([
7181
7188
  "post-user-login",
7189
+ "post-user-registration",
7190
+ "post-user-update",
7182
7191
  "credentials-exchange"
7183
- ]), Er = k([
7192
+ ]), Er = x([
7184
7193
  "post-user-login",
7185
7194
  "credentials-exchange",
7186
7195
  "pre-user-registration",
7187
7196
  "post-user-registration"
7188
- ]), xr = k([
7197
+ ]), xr = x([
7189
7198
  "ensure-username",
7190
- "set-preferred-username"
7199
+ "set-preferred-username",
7200
+ "account-linking"
7191
7201
  ]), _t = {
7192
7202
  enabled: h().default(!1),
7193
7203
  synchronous: h().default(!1),
7194
7204
  priority: I().optional(),
7195
- hook_id: o().optional()
7205
+ hook_id: o().optional(),
7206
+ /**
7207
+ * Free-form key/value bag for hook properties. Two well-known keys:
7208
+ *
7209
+ * - `inheritable: true` — when set on a hook on the control-plane tenant,
7210
+ * the multi-tenancy sync surfaces this hook to sub-tenants (Phase 2).
7211
+ * - Template-specific options. Templates read their config here, e.g.
7212
+ * `account-linking` reads `copy_user_metadata: true` to merge secondary
7213
+ * user_metadata into the primary on link.
7214
+ *
7215
+ * Everything else is opaque to the runtime. Persisted as JSON.
7216
+ */
7217
+ metadata: P(et()).optional()
7196
7218
  }, vd = _({
7197
7219
  ..._t,
7198
7220
  trigger_id: Nr,
@@ -7281,7 +7303,7 @@ _({
7281
7303
  ticket_id: o().optional()
7282
7304
  }).extend(Id.shape);
7283
7305
  const Cd = _({
7284
- alg: k([
7306
+ alg: x([
7285
7307
  "RS256",
7286
7308
  "RS384",
7287
7309
  "RS512",
@@ -7294,11 +7316,11 @@ const Cd = _({
7294
7316
  ]),
7295
7317
  e: o(),
7296
7318
  kid: o(),
7297
- kty: k(["RSA", "EC", "oct"]),
7319
+ kty: x(["RSA", "EC", "oct"]),
7298
7320
  n: o(),
7299
7321
  x5t: o().optional(),
7300
7322
  x5c: b(o()).optional(),
7301
- use: k(["sig", "enc"]).optional()
7323
+ use: x(["sig", "enc"]).optional()
7302
7324
  });
7303
7325
  _({
7304
7326
  keys: b(Cd)
@@ -7584,7 +7606,7 @@ const qd = _({
7584
7606
  id: o().optional(),
7585
7607
  user_id: o(),
7586
7608
  password: o(),
7587
- algorithm: k(["bcrypt", "argon2id"]).default("argon2id"),
7609
+ algorithm: x(["bcrypt", "argon2id"]).default("argon2id"),
7588
7610
  is_current: h().default(!0)
7589
7611
  });
7590
7612
  qd.extend({
@@ -7641,7 +7663,7 @@ _({
7641
7663
  connection: o().optional().openapi({
7642
7664
  description: "The connection identifier associated with the key"
7643
7665
  }),
7644
- type: k(["jwt_signing", "saml_encryption"]).openapi({
7666
+ type: x(["jwt_signing", "saml_encryption"]).openapi({
7645
7667
  description: "The type of the signing key"
7646
7668
  })
7647
7669
  });
@@ -7663,7 +7685,7 @@ const $d = _({
7663
7685
  ephemeral_session_lifetime: I().optional(),
7664
7686
  idle_ephemeral_session_lifetime: I().optional(),
7665
7687
  session_cookie: _({
7666
- mode: k(["persistent", "non-persistent"]).optional()
7688
+ mode: x(["persistent", "non-persistent"]).optional()
7667
7689
  }).optional(),
7668
7690
  // Logout settings
7669
7691
  allowed_logout_urls: b(o()).optional(),
@@ -7755,7 +7777,7 @@ const $d = _({
7755
7777
  }).optional(),
7756
7778
  // Device flow settings
7757
7779
  device_flow: _({
7758
- charset: k(["base20", "digits"]).optional(),
7780
+ charset: x(["base20", "digits"]).optional(),
7759
7781
  mask: o().max(20).optional()
7760
7782
  }).optional(),
7761
7783
  // Default token quota
@@ -7795,7 +7817,7 @@ const $d = _({
7795
7817
  // Guardian MFA Factors configuration (internal storage, exposed via /guardian API)
7796
7818
  mfa: _({
7797
7819
  // MFA policy: "never" = MFA disabled, "always" = MFA required for all logins
7798
- policy: k(["never", "always"]).default("never").optional(),
7820
+ policy: x(["never", "always"]).default("never").optional(),
7799
7821
  // Factor states
7800
7822
  factors: _({
7801
7823
  sms: h().default(!1),
@@ -7809,7 +7831,7 @@ const $d = _({
7809
7831
  }).optional(),
7810
7832
  // SMS provider configuration
7811
7833
  sms_provider: _({
7812
- provider: k(["twilio", "vonage", "aws_sns", "phone_message_hook"]).optional()
7834
+ provider: x(["twilio", "vonage", "aws_sns", "phone_message_hook"]).optional()
7813
7835
  }).optional(),
7814
7836
  // Twilio-specific configuration
7815
7837
  twilio: _({
@@ -7846,10 +7868,10 @@ _({
7846
7868
  const jd = _({
7847
7869
  button_border_radius: I(),
7848
7870
  button_border_weight: I(),
7849
- buttons_style: k(["pill", "rounded", "sharp"]),
7871
+ buttons_style: x(["pill", "rounded", "sharp"]),
7850
7872
  input_border_radius: I(),
7851
7873
  input_border_weight: I(),
7852
- inputs_style: k(["pill", "rounded", "sharp"]),
7874
+ inputs_style: x(["pill", "rounded", "sharp"]),
7853
7875
  show_widget_shadow: h(),
7854
7876
  widget_border_weight: I(),
7855
7877
  widget_corner_radius: I()
@@ -7857,7 +7879,7 @@ const jd = _({
7857
7879
  base_focus_color: o(),
7858
7880
  base_hover_color: o(),
7859
7881
  body_text: o(),
7860
- captcha_widget_theme: k(["auto", "dark", "light"]),
7882
+ captcha_widget_theme: x(["auto", "dark", "light"]),
7861
7883
  error: o(),
7862
7884
  header: o(),
7863
7885
  icons: o(),
@@ -7882,20 +7904,20 @@ const jd = _({
7882
7904
  font_url: o(),
7883
7905
  input_labels: vt,
7884
7906
  links: vt,
7885
- links_style: k(["normal", "underlined"]),
7907
+ links_style: x(["normal", "underlined"]),
7886
7908
  reference_text_size: I(),
7887
7909
  subtitle: vt,
7888
7910
  title: vt
7889
7911
  }), Hd = _({
7890
7912
  background_color: o(),
7891
7913
  background_image_url: o(),
7892
- page_layout: k(["center", "left", "right"])
7914
+ page_layout: x(["center", "left", "right"])
7893
7915
  }), Kd = _({
7894
- header_text_alignment: k(["center", "left", "right"]),
7916
+ header_text_alignment: x(["center", "left", "right"]),
7895
7917
  logo_height: I(),
7896
- logo_position: k(["center", "left", "none", "right"]),
7918
+ logo_position: x(["center", "left", "none", "right"]),
7897
7919
  logo_url: o(),
7898
- social_buttons_layout: k(["bottom", "top"])
7920
+ social_buttons_layout: x(["bottom", "top"])
7899
7921
  }), Qd = _({
7900
7922
  borders: jd,
7901
7923
  colors: Vd,
@@ -7908,7 +7930,7 @@ Qd.extend({
7908
7930
  themeId: o()
7909
7931
  });
7910
7932
  _({
7911
- universal_login_experience: k(["new", "classic"]).default("new"),
7933
+ universal_login_experience: x(["new", "classic"]).default("new"),
7912
7934
  identifier_first: h().default(!0),
7913
7935
  password_first: h().default(!1),
7914
7936
  webauthn_platform_first_factor: h()
@@ -7944,7 +7966,7 @@ _({
7944
7966
  ]),
7945
7967
  settings: _({}).optional()
7946
7968
  });
7947
- const Gd = _({
7969
+ const Jd = _({
7948
7970
  // The actual refresh token value (primary key).
7949
7971
  id: o(),
7950
7972
  // Link to the login session
@@ -7972,7 +7994,7 @@ _({
7972
7994
  // When the token was explicitly revoked (null = still active).
7973
7995
  revoked_at: o().optional(),
7974
7996
  // Spread in the rest of the refresh token properties.
7975
- ...Gd.shape
7997
+ ...Jd.shape
7976
7998
  });
7977
7999
  _({
7978
8000
  to: o(),
@@ -7982,11 +8004,11 @@ _({
7982
8004
  name: o(),
7983
8005
  options: _({})
7984
8006
  });
7985
- const Jd = _({
8007
+ const Gd = _({
7986
8008
  value: o(),
7987
8009
  description: o().optional()
7988
8010
  }), Wd = _({
7989
- token_dialect: k(["access_token", "access_token_authz"]).optional(),
8011
+ token_dialect: x(["access_token", "access_token_authz"]).optional(),
7990
8012
  enforce_policies: h().optional(),
7991
8013
  allow_skipping_userinfo: h().optional(),
7992
8014
  skip_userinfo: h().optional(),
@@ -7999,7 +8021,7 @@ const Jd = _({
7999
8021
  id: o().optional(),
8000
8022
  name: o(),
8001
8023
  identifier: o(),
8002
- scopes: b(Jd).optional(),
8024
+ scopes: b(Gd).optional(),
8003
8025
  signing_alg: o().optional(),
8004
8026
  signing_secret: o().optional(),
8005
8027
  token_lifetime: I().default(86400),
@@ -8163,7 +8185,7 @@ _({
8163
8185
  idle_session_lifetime: I().default(72),
8164
8186
  session_lifetime: I().default(168),
8165
8187
  session_cookie: _({
8166
- mode: k(["persistent", "non-persistent"]).optional()
8188
+ mode: x(["persistent", "non-persistent"]).optional()
8167
8189
  }).optional(),
8168
8190
  // MFA settings
8169
8191
  enable_client_connections: h().optional(),
@@ -8230,7 +8252,7 @@ _({
8230
8252
  // Guardian MFA Factors configuration (internal storage, exposed via /guardian API)
8231
8253
  mfa: _({
8232
8254
  // MFA policy: "never" = MFA disabled, "always" = MFA required for all logins
8233
- policy: k(["never", "always"]).default("never").optional(),
8255
+ policy: x(["never", "always"]).default("never").optional(),
8234
8256
  // Factor states
8235
8257
  factors: _({
8236
8258
  sms: h().default(!1),
@@ -8244,7 +8266,7 @@ _({
8244
8266
  }).optional(),
8245
8267
  // SMS provider configuration
8246
8268
  sms_provider: _({
8247
- provider: k(["twilio", "vonage", "aws_sns", "phone_message_hook"]).optional()
8269
+ provider: x(["twilio", "vonage", "aws_sns", "phone_message_hook"]).optional()
8248
8270
  }).optional(),
8249
8271
  // Twilio-specific configuration
8250
8272
  twilio: _({
@@ -8289,7 +8311,7 @@ I().openapi({
8289
8311
  description: "Number of active users in the last 30 days",
8290
8312
  example: 1234
8291
8313
  });
8292
- const fc = k([
8314
+ const fc = x([
8293
8315
  "login",
8294
8316
  "login-id",
8295
8317
  "login-password",
@@ -8330,7 +8352,7 @@ _({
8330
8352
  language: o(),
8331
8353
  custom_text: hc
8332
8354
  });
8333
- const gc = k([
8355
+ const gc = x([
8334
8356
  "phone",
8335
8357
  "totp",
8336
8358
  "email",
@@ -8417,7 +8439,7 @@ function vc(n) {
8417
8439
  return {
8418
8440
  async create(e, t) {
8419
8441
  const i = Date.now();
8420
- return await n.insert(G).values({
8442
+ return await n.insert(J).values({
8421
8443
  id: t.id,
8422
8444
  tenant_id: e,
8423
8445
  token_hash: t.token_hash,
@@ -8441,63 +8463,63 @@ function vc(n) {
8441
8463
  };
8442
8464
  },
8443
8465
  async get(e, t) {
8444
- const i = await n.select().from(G).where(
8466
+ const i = await n.select().from(J).where(
8445
8467
  g(
8446
- c(G.tenant_id, e),
8447
- c(G.id, t)
8468
+ c(J.tenant_id, e),
8469
+ c(J.id, t)
8448
8470
  )
8449
8471
  ).get();
8450
8472
  return i ? Rn(i) : null;
8451
8473
  },
8452
8474
  async getByHash(e, t) {
8453
- const i = await n.select().from(G).where(
8475
+ const i = await n.select().from(J).where(
8454
8476
  g(
8455
- c(G.tenant_id, e),
8456
- c(G.token_hash, t)
8477
+ c(J.tenant_id, e),
8478
+ c(J.token_hash, t)
8457
8479
  )
8458
8480
  ).get();
8459
8481
  return i ? Rn(i) : null;
8460
8482
  },
8461
8483
  async listByClient(e, t) {
8462
- return (await n.select().from(G).where(
8484
+ return (await n.select().from(J).where(
8463
8485
  g(
8464
- c(G.tenant_id, e),
8465
- c(G.client_id, t)
8486
+ c(J.tenant_id, e),
8487
+ c(J.client_id, t)
8466
8488
  )
8467
- ).orderBy(ce(G.created_at_ts))).map(Rn);
8489
+ ).orderBy(ce(J.created_at_ts))).map(Rn);
8468
8490
  },
8469
8491
  async markUsed(e, t, i) {
8470
- return (await n.update(G).set({ used_at_ts: Xt(i) }).where(
8492
+ return (await n.update(J).set({ used_at_ts: Xt(i) }).where(
8471
8493
  g(
8472
- c(G.tenant_id, e),
8473
- c(G.id, t),
8474
- Ae(G.used_at_ts)
8494
+ c(J.tenant_id, e),
8495
+ c(J.id, t),
8496
+ Ae(J.used_at_ts)
8475
8497
  )
8476
8498
  ).returning()).length > 0;
8477
8499
  },
8478
8500
  async revoke(e, t, i) {
8479
- return (await n.update(G).set({ revoked_at_ts: Xt(i) }).where(
8501
+ return (await n.update(J).set({ revoked_at_ts: Xt(i) }).where(
8480
8502
  g(
8481
- c(G.tenant_id, e),
8482
- c(G.id, t),
8483
- Ae(G.revoked_at_ts)
8503
+ c(J.tenant_id, e),
8504
+ c(J.id, t),
8505
+ Ae(J.revoked_at_ts)
8484
8506
  )
8485
8507
  ).returning()).length > 0;
8486
8508
  },
8487
8509
  async revokeByClient(e, t, i) {
8488
- return (await n.update(G).set({ revoked_at_ts: Xt(i) }).where(
8510
+ return (await n.update(J).set({ revoked_at_ts: Xt(i) }).where(
8489
8511
  g(
8490
- c(G.tenant_id, e),
8491
- c(G.client_id, t),
8492
- Ae(G.revoked_at_ts)
8512
+ c(J.tenant_id, e),
8513
+ c(J.client_id, t),
8514
+ Ae(J.revoked_at_ts)
8493
8515
  )
8494
8516
  ).returning()).length;
8495
8517
  },
8496
8518
  async remove(e, t) {
8497
- return (await n.delete(G).where(
8519
+ return (await n.delete(J).where(
8498
8520
  g(
8499
- c(G.tenant_id, e),
8500
- c(G.id, t)
8521
+ c(J.tenant_id, e),
8522
+ c(J.id, t)
8501
8523
  )
8502
8524
  ).returning()).length > 0;
8503
8525
  }
@@ -8793,7 +8815,7 @@ function xc(n) {
8793
8815
  return {
8794
8816
  async create(e, t) {
8795
8817
  const i = (/* @__PURE__ */ new Date()).toISOString();
8796
- await n.insert(it).values({
8818
+ await n.insert(at).values({
8797
8819
  tenant_id: e,
8798
8820
  name: t.name,
8799
8821
  enabled: t.enabled,
@@ -8805,7 +8827,7 @@ function xc(n) {
8805
8827
  });
8806
8828
  },
8807
8829
  async get(e) {
8808
- const t = await n.select().from(it).where(c(it.tenant_id, e)).get();
8830
+ const t = await n.select().from(at).where(c(at.tenant_id, e)).get();
8809
8831
  if (!t) return null;
8810
8832
  const { tenant_id: i, ...a } = t;
8811
8833
  return K({
@@ -8819,10 +8841,10 @@ function xc(n) {
8819
8841
  const i = {
8820
8842
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
8821
8843
  };
8822
- t.name !== void 0 && (i.name = t.name), t.enabled !== void 0 && (i.enabled = t.enabled), t.default_from_address !== void 0 && (i.default_from_address = t.default_from_address), t.credentials !== void 0 && (i.credentials = JSON.stringify(t.credentials)), t.settings !== void 0 && (i.settings = JSON.stringify(t.settings)), await n.update(it).set(i).where(c(it.tenant_id, e));
8844
+ t.name !== void 0 && (i.name = t.name), t.enabled !== void 0 && (i.enabled = t.enabled), t.default_from_address !== void 0 && (i.default_from_address = t.default_from_address), t.credentials !== void 0 && (i.credentials = JSON.stringify(t.credentials)), t.settings !== void 0 && (i.settings = JSON.stringify(t.settings)), await n.update(at).set(i).where(c(at.tenant_id, e));
8823
8845
  },
8824
8846
  async remove(e) {
8825
- await n.delete(it).where(c(it.tenant_id, e));
8847
+ await n.delete(at).where(c(at.tenant_id, e));
8826
8848
  }
8827
8849
  };
8828
8850
  }
@@ -8994,7 +9016,7 @@ function ne(n) {
8994
9016
  const e = new Date(n);
8995
9017
  return isNaN(e.getTime()) ? null : e.getTime();
8996
9018
  }
8997
- function Jt(n, e, t = []) {
9019
+ function Gt(n, e, t = []) {
8998
9020
  const i = {};
8999
9021
  for (const a of e) {
9000
9022
  const r = a.replace(/_ts$/, "");
@@ -9011,7 +9033,7 @@ function Ac() {
9011
9033
  return `hc_${Tc()}`;
9012
9034
  }
9013
9035
  function Oi(n) {
9014
- const { created_at_ts: e, updated_at_ts: t, secrets: i, ...a } = n, r = Jt({ created_at_ts: e, updated_at_ts: t }, [
9036
+ const { created_at_ts: e, updated_at_ts: t, secrets: i, ...a } = n, r = Gt({ created_at_ts: e, updated_at_ts: t }, [
9015
9037
  "created_at_ts",
9016
9038
  "updated_at_ts"
9017
9039
  ]);
@@ -9053,19 +9075,29 @@ function Cc() {
9053
9075
  const { customAlphabet: n } = require("nanoid");
9054
9076
  return `h_${n("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
9055
9077
  }
9078
+ function Dc(n) {
9079
+ if (!(typeof n != "string" || !n))
9080
+ try {
9081
+ const e = JSON.parse(n);
9082
+ return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
9083
+ } catch {
9084
+ return;
9085
+ }
9086
+ }
9056
9087
  function Fn(n) {
9057
- const { tenant_id: e, created_at_ts: t, updated_at_ts: i, ...a } = n, r = Jt({ created_at_ts: t, updated_at_ts: i }, [
9088
+ const { tenant_id: e, created_at_ts: t, updated_at_ts: i, metadata: a, ...r } = n, l = Gt({ created_at_ts: t, updated_at_ts: i }, [
9058
9089
  "created_at_ts",
9059
9090
  "updated_at_ts"
9060
9091
  ]);
9061
9092
  return K({
9062
- ...a,
9063
- enabled: !!a.enabled,
9064
- synchronous: !!a.synchronous,
9065
- ...r
9093
+ ...r,
9094
+ enabled: !!r.enabled,
9095
+ synchronous: !!r.synchronous,
9096
+ metadata: Dc(a),
9097
+ ...l
9066
9098
  });
9067
9099
  }
9068
- function Dc(n) {
9100
+ function Lc(n) {
9069
9101
  return {
9070
9102
  async create(e, t) {
9071
9103
  const i = Date.now(), r = {
@@ -9079,6 +9111,7 @@ function Dc(n) {
9079
9111
  form_id: t.form_id,
9080
9112
  template_id: t.template_id,
9081
9113
  code_id: t.code_id,
9114
+ metadata: t.metadata ? JSON.stringify(t.metadata) : null,
9082
9115
  created_at_ts: i,
9083
9116
  updated_at_ts: i
9084
9117
  };
@@ -9092,7 +9125,7 @@ function Dc(n) {
9092
9125
  const a = {
9093
9126
  updated_at_ts: Date.now()
9094
9127
  };
9095
- return i.trigger_id !== void 0 && (a.trigger_id = i.trigger_id), i.url !== void 0 && (a.url = i.url), i.enabled !== void 0 && (a.enabled = i.enabled), i.synchronous !== void 0 && (a.synchronous = i.synchronous), i.priority !== void 0 && (a.priority = i.priority), i.form_id !== void 0 && (a.form_id = i.form_id), i.template_id !== void 0 && (a.template_id = i.template_id), i.code_id !== void 0 && (a.code_id = i.code_id), (await n.update(we).set(a).where(g(c(we.tenant_id, e), c(we.hook_id, t))).returning()).length > 0;
9128
+ return i.trigger_id !== void 0 && (a.trigger_id = i.trigger_id), i.url !== void 0 && (a.url = i.url), i.enabled !== void 0 && (a.enabled = i.enabled), i.synchronous !== void 0 && (a.synchronous = i.synchronous), i.priority !== void 0 && (a.priority = i.priority), i.form_id !== void 0 && (a.form_id = i.form_id), i.template_id !== void 0 && (a.template_id = i.template_id), i.code_id !== void 0 && (a.code_id = i.code_id), i.metadata !== void 0 && (a.metadata = i.metadata === null ? null : JSON.stringify(i.metadata)), (await n.update(we).set(a).where(g(c(we.tenant_id, e), c(we.hook_id, t))).returning()).length > 0;
9096
9129
  },
9097
9130
  async list(e, t) {
9098
9131
  const {
@@ -9130,7 +9163,7 @@ function Dc(n) {
9130
9163
  }
9131
9164
  };
9132
9165
  }
9133
- function Lc() {
9166
+ function Rc() {
9134
9167
  const { customAlphabet: n } = require("nanoid");
9135
9168
  return `inv_${n("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
9136
9169
  }
@@ -9147,11 +9180,11 @@ function Pn(n) {
9147
9180
  a[r] = z(i[r], r === "roles" ? [] : {});
9148
9181
  return a.send_invitation_email = !!t, K(a);
9149
9182
  }
9150
- function Rc(n) {
9183
+ function Uc(n) {
9151
9184
  return {
9152
9185
  async create(e, t) {
9153
9186
  var u, f;
9154
- const i = t.id || Lc(), a = t.ttl_sec || 604800, r = /* @__PURE__ */ new Date(), l = new Date(r.getTime() + a * 1e3).toISOString(), d = {
9187
+ const i = t.id || Rc(), a = t.ttl_sec || 604800, r = /* @__PURE__ */ new Date(), l = new Date(r.getTime() + a * 1e3).toISOString(), d = {
9155
9188
  id: i,
9156
9189
  tenant_id: e,
9157
9190
  organization_id: t.organization_id,
@@ -9215,7 +9248,7 @@ function Rc(n) {
9215
9248
  }
9216
9249
  };
9217
9250
  }
9218
- function Uc(n) {
9251
+ function zc(n) {
9219
9252
  return {
9220
9253
  async create(e) {
9221
9254
  await n.insert(Be).values({
@@ -9257,7 +9290,7 @@ function Uc(n) {
9257
9290
  };
9258
9291
  }
9259
9292
  const di = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", Mn = di.length;
9260
- function zc() {
9293
+ function Fc() {
9261
9294
  let t = Date.now(), i = "";
9262
9295
  for (let r = 10; r > 0; r--)
9263
9296
  i = di.charAt(t % Mn) + i, t = Math.floor(t / Mn);
@@ -9276,7 +9309,7 @@ function Ti(n) {
9276
9309
  state_data: r,
9277
9310
  auth_params: l,
9278
9311
  ...d
9279
- } = n, u = Jt(
9312
+ } = n, u = Gt(
9280
9313
  { created_at_ts: t, updated_at_ts: i, expires_at_ts: a },
9281
9314
  ["created_at_ts", "updated_at_ts", "expires_at_ts"]
9282
9315
  ), f = {};
@@ -9290,12 +9323,12 @@ function Ti(n) {
9290
9323
  state_data: z(r)
9291
9324
  });
9292
9325
  }
9293
- function Fc(n) {
9326
+ function Pc(n) {
9294
9327
  return {
9295
9328
  async create(e, t) {
9296
9329
  var l, d;
9297
9330
  const i = Date.now(), r = {
9298
- id: zc(),
9331
+ id: Fc(),
9299
9332
  tenant_id: e,
9300
9333
  session_id: t.session_id,
9301
9334
  csrf_token: t.csrf_token,
@@ -9316,10 +9349,10 @@ function Fc(n) {
9316
9349
  updated_at_ts: i,
9317
9350
  expires_at_ts: t.expires_at ? ne(t.expires_at) : i + 1e3 * 60 * 60 * 24
9318
9351
  };
9319
- return await n.insert(J).values(r), Ti({ ...r, tenant_id: e });
9352
+ return await n.insert(G).values(r), Ti({ ...r, tenant_id: e });
9320
9353
  },
9321
9354
  async get(e, t) {
9322
- const i = e ? g(c(J.tenant_id, e), c(J.id, t)) : c(J.id, t), a = await n.select().from(J).where(i).get();
9355
+ const i = e ? g(c(G.tenant_id, e), c(G.id, t)) : c(G.id, t), a = await n.select().from(G).where(i).get();
9323
9356
  return a ? Ti(a) : null;
9324
9357
  },
9325
9358
  async update(e, t, i) {
@@ -9331,10 +9364,10 @@ function Fc(n) {
9331
9364
  0,
9332
9365
  1024
9333
9366
  )), i.expires_at !== void 0 && (a.expires_at_ts = ne(i.expires_at)), i.authParams !== void 0) {
9334
- const u = await n.select({ auth_params: J.auth_params }).from(J).where(
9367
+ const u = await n.select({ auth_params: G.auth_params }).from(G).where(
9335
9368
  g(
9336
- c(J.tenant_id, e),
9337
- c(J.id, t)
9369
+ c(G.tenant_id, e),
9370
+ c(G.id, t)
9338
9371
  )
9339
9372
  ).get(), f = u != null && u.auth_params && typeof u.auth_params == "string" && u.auth_params.length > 0 ? JSON.parse(u.auth_params) : {};
9340
9373
  a.auth_params = JSON.stringify({
@@ -9342,13 +9375,13 @@ function Fc(n) {
9342
9375
  ...i.authParams
9343
9376
  });
9344
9377
  }
9345
- return await n.update(J).set(a).where(
9346
- g(c(J.tenant_id, e), c(J.id, t))
9378
+ return await n.update(G).set(a).where(
9379
+ g(c(G.tenant_id, e), c(G.id, t))
9347
9380
  ), !0;
9348
9381
  },
9349
9382
  async remove(e, t) {
9350
- return (await n.delete(J).where(
9351
- g(c(J.tenant_id, e), c(J.id, t))
9383
+ return (await n.delete(G).where(
9384
+ g(c(G.tenant_id, e), c(G.id, t))
9352
9385
  ).returning()).length > 0;
9353
9386
  }
9354
9387
  };
@@ -9383,7 +9416,7 @@ function qn(n) {
9383
9416
  continent_code: p
9384
9417
  })), K(S);
9385
9418
  }
9386
- function Pc(n) {
9419
+ function Mc(n) {
9387
9420
  return {
9388
9421
  async create(e, t) {
9389
9422
  var r, l;
@@ -9455,7 +9488,7 @@ function Pc(n) {
9455
9488
  };
9456
9489
  }
9457
9490
  const ci = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", Bn = ci.length;
9458
- function Mc() {
9491
+ function qc() {
9459
9492
  let t = Date.now(), i = "";
9460
9493
  for (let r = 10; r > 0; r--)
9461
9494
  i = ci.charAt(t % Bn) + i, t = Math.floor(t / Bn);
@@ -9484,11 +9517,11 @@ function tn(n) {
9484
9517
  updated_at: si(i)
9485
9518
  });
9486
9519
  }
9487
- function qc(n) {
9520
+ function Bc(n) {
9488
9521
  return {
9489
9522
  async create(e, t) {
9490
9523
  const i = Date.now(), r = {
9491
- id: t.id || Mc(),
9524
+ id: t.id || qc(),
9492
9525
  tenant_id: e,
9493
9526
  user_id: t.user_id,
9494
9527
  type: t.type,
@@ -9559,7 +9592,7 @@ function qc(n) {
9559
9592
  }
9560
9593
  };
9561
9594
  }
9562
- function Bc() {
9595
+ function $c() {
9563
9596
  const { customAlphabet: n } = require("nanoid");
9564
9597
  return `org_${n("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
9565
9598
  }
@@ -9580,12 +9613,12 @@ function $n(n) {
9580
9613
  token_quota: z(r, {})
9581
9614
  });
9582
9615
  }
9583
- function $c(n) {
9616
+ function jc(n) {
9584
9617
  return {
9585
9618
  async create(e, t) {
9586
9619
  var l, d;
9587
9620
  const i = (/* @__PURE__ */ new Date()).toISOString(), r = {
9588
- id: t.id || Bc(),
9621
+ id: t.id || $c(),
9589
9622
  tenant_id: e,
9590
9623
  name: t.name,
9591
9624
  display_name: t.display_name,
@@ -9678,7 +9711,7 @@ function jn(n) {
9678
9711
  is_current: !!t
9679
9712
  };
9680
9713
  }
9681
- function jc(n) {
9714
+ function Vc(n) {
9682
9715
  return {
9683
9716
  async create(e, t) {
9684
9717
  const i = (/* @__PURE__ */ new Date()).toISOString(), a = t.id || Ie();
@@ -9738,7 +9771,7 @@ function jc(n) {
9738
9771
  }
9739
9772
  };
9740
9773
  }
9741
- function Vc(n) {
9774
+ function Zc(n) {
9742
9775
  return {
9743
9776
  async get(e) {
9744
9777
  const t = await n.select().from(It).where(c(It.tenant_id, e)).get();
@@ -9785,7 +9818,7 @@ function Vn(n) {
9785
9818
  resource_servers: u,
9786
9819
  rotating: f,
9787
9820
  ...p
9788
- } = n, v = Jt(
9821
+ } = n, v = Gt(
9789
9822
  {
9790
9823
  created_at_ts: t,
9791
9824
  expires_at_ts: i,
@@ -9809,10 +9842,10 @@ function Vn(n) {
9809
9842
  resource_servers: z(u, [])
9810
9843
  });
9811
9844
  }
9812
- function Zc(n, e) {
9845
+ function Hc(n, e) {
9813
9846
  return Math.max(n ?? 0, e ?? 0);
9814
9847
  }
9815
- function Hc(n) {
9848
+ function Kc(n) {
9816
9849
  return {
9817
9850
  async create(e, t) {
9818
9851
  const i = Date.now(), a = {
@@ -9832,18 +9865,18 @@ function Hc(n) {
9832
9865
  await n.run(A`BEGIN`);
9833
9866
  try {
9834
9867
  await n.insert(X).values(a);
9835
- const r = Zc(
9868
+ const r = Hc(
9836
9869
  a.expires_at_ts,
9837
9870
  a.idle_expires_at_ts
9838
9871
  );
9839
- r > 0 && a.login_id && await n.update(J).set({
9872
+ r > 0 && a.login_id && await n.update(G).set({
9840
9873
  expires_at_ts: r,
9841
9874
  updated_at_ts: i
9842
9875
  }).where(
9843
9876
  g(
9844
- c(J.tenant_id, e),
9845
- c(J.id, a.login_id),
9846
- Xe(J.expires_at_ts, r)
9877
+ c(G.tenant_id, e),
9878
+ c(G.id, a.login_id),
9879
+ Xe(G.expires_at_ts, r)
9847
9880
  )
9848
9881
  ), await n.run(A`COMMIT`);
9849
9882
  } catch (r) {
@@ -9866,14 +9899,14 @@ function Hc(n) {
9866
9899
  c(X.id, t)
9867
9900
  )
9868
9901
  ).returning();
9869
- return l != null && l.login_id && d && d > 0 && await n.update(J).set({
9902
+ return l != null && l.login_id && d && d > 0 && await n.update(G).set({
9870
9903
  expires_at_ts: d,
9871
9904
  updated_at_ts: Date.now()
9872
9905
  }).where(
9873
9906
  g(
9874
- c(J.tenant_id, e),
9875
- c(J.id, l.login_id),
9876
- Xe(J.expires_at_ts, d)
9907
+ c(G.tenant_id, e),
9908
+ c(G.id, l.login_id),
9909
+ Xe(G.expires_at_ts, d)
9877
9910
  )
9878
9911
  ).catch(() => {
9879
9912
  }), u.length > 0;
@@ -9926,7 +9959,7 @@ function Hc(n) {
9926
9959
  }
9927
9960
  };
9928
9961
  }
9929
- function Kc() {
9962
+ function Qc() {
9930
9963
  const { customAlphabet: n } = require("nanoid");
9931
9964
  return `api_${n("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
9932
9965
  }
@@ -9967,11 +10000,11 @@ function Zn(n) {
9967
10000
  l[u] !== void 0 && l[u] !== null && (d[u] = !!l[u]);
9968
10001
  return K(d);
9969
10002
  }
9970
- function Qc(n) {
10003
+ function Jc(n) {
9971
10004
  return {
9972
10005
  async create(e, t) {
9973
10006
  const i = (/* @__PURE__ */ new Date()).toISOString(), r = {
9974
- id: t.id || Kc(),
10007
+ id: t.id || Qc(),
9975
10008
  tenant_id: e,
9976
10009
  identifier: t.identifier,
9977
10010
  name: t.name,
@@ -10027,8 +10060,8 @@ function Qc(n) {
10027
10060
  if (d) {
10028
10061
  const ee = d.match(/^([^:]+):(.+)$/);
10029
10062
  if (ee) {
10030
- const [, ie, ae] = ee, Ge = ie == null ? void 0 : ie.startsWith("-"), ut = Ge ? ie == null ? void 0 : ie.substring(1) : ie;
10031
- if (ut && Ai.has(ut) && !Ge) {
10063
+ const [, ie, ae] = ee, Je = ie == null ? void 0 : ie.startsWith("-"), ut = Je ? ie == null ? void 0 : ie.substring(1) : ie;
10064
+ if (ut && Ai.has(ut) && !Je) {
10032
10065
  const vn = Y[ut];
10033
10066
  p.push(Nt(vn, `%${ae}%`));
10034
10067
  }
@@ -10127,7 +10160,7 @@ function Gc(n) {
10127
10160
  }
10128
10161
  };
10129
10162
  }
10130
- function Jc(n) {
10163
+ function Wc(n) {
10131
10164
  return {
10132
10165
  async create(e, t, i, a) {
10133
10166
  var r, l;
@@ -10195,7 +10228,7 @@ function Hn(n) {
10195
10228
  metadata: z(i)
10196
10229
  });
10197
10230
  }
10198
- function Wc(n) {
10231
+ function Xc(n) {
10199
10232
  return {
10200
10233
  async create(e, t) {
10201
10234
  const i = (/* @__PURE__ */ new Date()).toISOString(), r = {
@@ -10251,7 +10284,7 @@ function Wc(n) {
10251
10284
  }
10252
10285
  };
10253
10286
  }
10254
- const Xc = ["created_at_ts", "updated_at_ts"], Yc = [
10287
+ const Yc = ["created_at_ts", "updated_at_ts"], e_ = [
10255
10288
  "expires_at_ts",
10256
10289
  "idle_expires_at_ts",
10257
10290
  "authenticated_at_ts",
@@ -10273,7 +10306,7 @@ function Kn(n) {
10273
10306
  device: p,
10274
10307
  clients: v,
10275
10308
  ...m
10276
- } = n, S = Jt(
10309
+ } = n, S = Gt(
10277
10310
  {
10278
10311
  created_at_ts: t,
10279
10312
  updated_at_ts: i,
@@ -10284,8 +10317,8 @@ function Kn(n) {
10284
10317
  used_at_ts: u,
10285
10318
  revoked_at_ts: f
10286
10319
  },
10287
- [...Xc],
10288
- [...Yc]
10320
+ [...Yc],
10321
+ [...e_]
10289
10322
  );
10290
10323
  return K({
10291
10324
  ...m,
@@ -10294,7 +10327,7 @@ function Kn(n) {
10294
10327
  clients: z(v, [])
10295
10328
  });
10296
10329
  }
10297
- function e_(n) {
10330
+ function t_(n) {
10298
10331
  return {
10299
10332
  async create(e, t) {
10300
10333
  const i = Date.now(), a = {
@@ -10399,7 +10432,7 @@ function Ci(n) {
10399
10432
  n[t] !== void 0 && (e[t] = n[t] ? 1 : 0);
10400
10433
  return ar(e);
10401
10434
  }
10402
- function t_(n) {
10435
+ function n_(n) {
10403
10436
  return {
10404
10437
  async create(e) {
10405
10438
  var a, r;
@@ -10465,7 +10498,7 @@ function t_(n) {
10465
10498
  }
10466
10499
  };
10467
10500
  }
10468
- const n_ = [
10501
+ const i_ = [
10469
10502
  "colors",
10470
10503
  "borders",
10471
10504
  "fonts",
@@ -10473,10 +10506,10 @@ const n_ = [
10473
10506
  "widget"
10474
10507
  ];
10475
10508
  function Di(n) {
10476
- const { tenant_id: e, ...t } = n, i = or(t, n_);
10509
+ const { tenant_id: e, ...t } = n, i = or(t, i_);
10477
10510
  return i.borders && (i.borders.show_widget_shadow = !!i.borders.show_widget_shadow), i.fonts && (i.fonts.links_bold = !!i.fonts.links_bold, i.fonts.subtitle_bold = !!i.fonts.subtitle_bold, i.fonts.title_bold = !!i.fonts.title_bold), K(i);
10478
10511
  }
10479
- function i_(n) {
10512
+ function a_(n) {
10480
10513
  return {
10481
10514
  async create(e, t, i) {
10482
10515
  const a = (/* @__PURE__ */ new Date()).toISOString(), r = i || Ie(), d = {
@@ -10507,21 +10540,21 @@ function i_(n) {
10507
10540
  }
10508
10541
  };
10509
10542
  }
10510
- function a_(n) {
10543
+ function o_(n) {
10511
10544
  return {
10512
10545
  async get(e) {
10513
- const t = await n.select({ body: nt.body }).from(nt).where(c(nt.tenant_id, e)).get();
10546
+ const t = await n.select({ body: it.body }).from(it).where(c(it.tenant_id, e)).get();
10514
10547
  return t ? { body: t.body } : null;
10515
10548
  },
10516
10549
  async set(e, t) {
10517
10550
  const i = Date.now();
10518
- await n.insert(nt).values({
10551
+ await n.insert(it).values({
10519
10552
  tenant_id: e,
10520
10553
  body: t.body,
10521
10554
  created_at_ts: i,
10522
10555
  updated_at_ts: i
10523
10556
  }).onConflictDoUpdate({
10524
- target: nt.tenant_id,
10557
+ target: it.tenant_id,
10525
10558
  set: {
10526
10559
  body: t.body,
10527
10560
  updated_at_ts: i
@@ -10529,7 +10562,7 @@ function a_(n) {
10529
10562
  });
10530
10563
  },
10531
10564
  async delete(e) {
10532
- await n.delete(nt).where(c(nt.tenant_id, e));
10565
+ await n.delete(it).where(c(it.tenant_id, e));
10533
10566
  }
10534
10567
  };
10535
10568
  }
@@ -10571,7 +10604,7 @@ function Qn(n, e = []) {
10571
10604
  identities: [m, ...S]
10572
10605
  });
10573
10606
  }
10574
- function o_(n) {
10607
+ function r_(n) {
10575
10608
  const e = async (t, i) => {
10576
10609
  var d, u;
10577
10610
  const a = (/* @__PURE__ */ new Date()).toISOString(), r = {
@@ -10716,8 +10749,8 @@ function o_(n) {
10716
10749
  )
10717
10750
  ));
10718
10751
  const ee = m.map((ae) => {
10719
- const Ge = T.filter((ut) => ut.linked_to === ae.user_id);
10720
- return Qn(ae, Ge);
10752
+ const Je = T.filter((ut) => ut.linked_to === ae.user_id);
10753
+ return Qn(ae, Je);
10721
10754
  });
10722
10755
  if (!l)
10723
10756
  return { users: ee };
@@ -10768,7 +10801,7 @@ function o_(n) {
10768
10801
  }
10769
10802
  };
10770
10803
  }
10771
- function r_(n) {
10804
+ function s_(n) {
10772
10805
  return {
10773
10806
  async create(e, t, i, a) {
10774
10807
  var r, l;
@@ -10823,7 +10856,7 @@ function r_(n) {
10823
10856
  }
10824
10857
  };
10825
10858
  }
10826
- function s_(n) {
10859
+ function l_(n) {
10827
10860
  return {
10828
10861
  async create(e, t) {
10829
10862
  var u, f;
@@ -10917,10 +10950,10 @@ function s_(n) {
10917
10950
  metadata: ee,
10918
10951
  enabled_connections: ie,
10919
10952
  token_quota: ae,
10920
- ...Ge
10953
+ ...Je
10921
10954
  } = m;
10922
10955
  return K({
10923
- ...Ge,
10956
+ ...Je,
10924
10957
  branding: z(T, {}),
10925
10958
  metadata: z(ee, {}),
10926
10959
  enabled_connections: z(ie, []),
@@ -10953,8 +10986,8 @@ function s_(n) {
10953
10986
  }
10954
10987
  };
10955
10988
  }
10956
- const Ri = ["s", "seacft", "seccft", "sepft", "sertft", "ssa"], l_ = ["pwd_leak", "signup_pwd_leak", "reset_pwd_leak"];
10957
- function d_(n) {
10989
+ const Ri = ["s", "seacft", "seccft", "sepft", "sertft", "ssa"], d_ = ["pwd_leak", "signup_pwd_leak", "reset_pwd_leak"];
10990
+ function c_(n) {
10958
10991
  return {
10959
10992
  async getDaily(e, t) {
10960
10993
  const i = /* @__PURE__ */ new Date(), a = (t == null ? void 0 : t.from) || new Date(i.getTime() - 30 * 24 * 60 * 60 * 1e3).toISOString().split("T")[0], r = (t == null ? void 0 : t.to) || i.toISOString().split("T")[0];
@@ -10968,7 +11001,7 @@ function d_(n) {
10968
11001
  "signups"
10969
11002
  ),
10970
11003
  leaked_passwords: A`SUM(CASE WHEN ${Q.type} IN (${A.join(
10971
- l_.map((d) => A`${d}`),
11004
+ d_.map((d) => A`${d}`),
10972
11005
  A`, `
10973
11006
  )}) THEN 1 ELSE 0 END)`.as("leaked_passwords")
10974
11007
  }).from(Q).where(
@@ -11011,7 +11044,7 @@ function Ui(n) {
11011
11044
  payload: z(n.payload, {})
11012
11045
  };
11013
11046
  }
11014
- function c_(n) {
11047
+ function __(n) {
11015
11048
  return {
11016
11049
  async create(e, t) {
11017
11050
  const i = Ie(), a = (/* @__PURE__ */ new Date()).toISOString();
@@ -11153,10 +11186,10 @@ function c_(n) {
11153
11186
  }
11154
11187
  };
11155
11188
  }
11156
- const __ = 7 * 24 * 60 * 60 * 1e3;
11157
- function u_(n) {
11189
+ const u_ = 7 * 24 * 60 * 60 * 1e3;
11190
+ function p_(n) {
11158
11191
  return async (e) => {
11159
- const t = Date.now() - __;
11192
+ const t = Date.now() - u_;
11160
11193
  try {
11161
11194
  let i = [
11162
11195
  Ue(
@@ -11169,13 +11202,13 @@ function u_(n) {
11169
11202
  Xe(oe.expires_at_ts, t),
11170
11203
  Xe(oe.idle_expires_at_ts, t)
11171
11204
  )
11172
- ], e != null && e.tenant_id && i.push(c(oe.tenant_id, e.tenant_id)), e != null && e.user_id && i.push(c(oe.user_id, e.user_id)), await n.delete(oe).where(g(...i)), i = [Xe(J.expires_at_ts, t)], e != null && e.tenant_id && i.push(c(J.tenant_id, e.tenant_id)), await n.delete(J).where(g(...i));
11205
+ ], e != null && e.tenant_id && i.push(c(oe.tenant_id, e.tenant_id)), e != null && e.user_id && i.push(c(oe.user_id, e.user_id)), await n.delete(oe).where(g(...i)), i = [Xe(G.expires_at_ts, t)], e != null && e.tenant_id && i.push(c(G.tenant_id, e.tenant_id)), await n.delete(G).where(g(...i));
11173
11206
  } catch (i) {
11174
11207
  console.error("Session cleanup error:", i);
11175
11208
  }
11176
11209
  };
11177
11210
  }
11178
- function h_(n, e = { useTransactions: !0 }) {
11211
+ function g_(n, e = { useTransactions: !0 }) {
11179
11212
  const t = {
11180
11213
  actions: $r(),
11181
11214
  branding: is(n),
@@ -11191,30 +11224,30 @@ function h_(n, e = { useTransactions: !0 }) {
11191
11224
  flows: kc(n),
11192
11225
  forms: Oc(n),
11193
11226
  hookCode: Ic(n),
11194
- hooks: Dc(n),
11195
- invites: Rc(n),
11196
- keys: Uc(n),
11197
- loginSessions: Fc(n),
11198
- logs: Pc(n),
11199
- authenticationMethods: qc(n),
11200
- organizations: $c(n),
11201
- passwords: jc(n),
11202
- promptSettings: Vc(n),
11203
- refreshTokens: Hc(n),
11204
- resourceServers: Qc(n),
11227
+ hooks: Lc(n),
11228
+ invites: Uc(n),
11229
+ keys: zc(n),
11230
+ loginSessions: Pc(n),
11231
+ logs: Mc(n),
11232
+ authenticationMethods: Bc(n),
11233
+ organizations: jc(n),
11234
+ passwords: Vc(n),
11235
+ promptSettings: Zc(n),
11236
+ refreshTokens: Kc(n),
11237
+ resourceServers: Jc(n),
11205
11238
  rolePermissions: Gc(n),
11206
- userPermissions: Jc(n),
11207
- roles: Wc(n),
11208
- sessions: e_(n),
11209
- sessionCleanup: u_(n),
11210
- tenants: t_(n),
11211
- themes: i_(n),
11212
- universalLoginTemplates: a_(n),
11213
- users: o_(n),
11214
- userRoles: r_(n),
11215
- userOrganizations: s_(n),
11216
- stats: d_(n),
11217
- outbox: c_(n),
11239
+ userPermissions: Wc(n),
11240
+ roles: Xc(n),
11241
+ sessions: t_(n),
11242
+ sessionCleanup: p_(n),
11243
+ tenants: n_(n),
11244
+ themes: a_(n),
11245
+ universalLoginTemplates: o_(n),
11246
+ users: r_(n),
11247
+ userRoles: s_(n),
11248
+ userOrganizations: l_(n),
11249
+ stats: c_(n),
11250
+ outbox: __(n),
11218
11251
  async transaction(i) {
11219
11252
  if (e.useTransactions === !1)
11220
11253
  return i(t);
@@ -11230,6 +11263,6 @@ function h_(n, e = { useTransactions: !0 }) {
11230
11263
  return t;
11231
11264
  }
11232
11265
  export {
11233
- h_ as default,
11234
- f_ as sqlite
11266
+ g_ as default,
11267
+ h_ as sqlite
11235
11268
  };