@authhero/kysely-adapter 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  var xt = Object.defineProperty;
2
2
  var bt = (n, e, t) => e in n ? xt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var Ue = (n, e, t) => bt(n, typeof e != "symbol" ? e + "" : e, t);
4
- var de = class extends Error {
4
+ var je = class extends Error {
5
5
  constructor(e = 500, t) {
6
6
  super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
7
7
  Ue(this, "res");
@@ -30,7 +30,7 @@ function Tt(n) {
30
30
  try {
31
31
  await n.insertInto("users").values(a).execute();
32
32
  } catch (o) {
33
- throw o.code === "SQLITE_CONSTRAINT_UNIQUE" || o.message.includes("AlreadyExists") ? new de(409, { message: "User already exists" }) : (console.log(o.message), new de(500, { message: `${o.code}, ${o.message}` }));
33
+ throw o.code === "SQLITE_CONSTRAINT_UNIQUE" || o.message.includes("AlreadyExists") ? new je(409, { message: "User already exists" }) : (console.log(o.message), new je(500, { message: `${o.code}, ${o.message}` }));
34
34
  }
35
35
  return {
36
36
  ...a,
@@ -75,13 +75,13 @@ function Zt(n) {
75
75
  param: Object.assign(Object.assign({}, (k = (h = this._def.openapi) === null || h === void 0 ? void 0 : h.metadata) === null || k === void 0 ? void 0 : k.param), z)
76
76
  } : void 0), ie = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(se).length > 0 ? { _internal: se } : void 0), Object.keys(re).length > 0 ? { metadata: re } : void 0) }));
77
77
  if (St(this, "ZodObject")) {
78
- const Se = this.extend;
79
- ie.extend = function(...Ze) {
80
- var Q, H, J, je, Fe, Me;
81
- const Le = Se.apply(this, Ze);
78
+ const Oe = this.extend;
79
+ ie.extend = function(...Se) {
80
+ var Q, H, J, Ze, Fe, Me;
81
+ const Le = Oe.apply(this, Se);
82
82
  return Le._def.openapi = {
83
83
  _internal: {
84
- extendedFrom: !((H = (Q = this._def.openapi) === null || Q === void 0 ? void 0 : Q._internal) === null || H === void 0) && H.refId ? { refId: (je = (J = this._def.openapi) === null || J === void 0 ? void 0 : J._internal) === null || je === void 0 ? void 0 : je.refId, schema: this } : (Fe = this._def.openapi) === null || Fe === void 0 ? void 0 : Fe._internal.extendedFrom
84
+ extendedFrom: !((H = (Q = this._def.openapi) === null || Q === void 0 ? void 0 : Q._internal) === null || H === void 0) && H.refId ? { refId: (Ze = (J = this._def.openapi) === null || J === void 0 ? void 0 : J._internal) === null || Ze === void 0 ? void 0 : Ze.refId, schema: this } : (Fe = this._def.openapi) === null || Fe === void 0 ? void 0 : Fe._internal.extendedFrom
85
85
  },
86
86
  metadata: (Me = Le._def.openapi) === null || Me === void 0 ? void 0 : Me.metadata
87
87
  }, Le;
@@ -415,7 +415,7 @@ class b {
415
415
  }
416
416
  const f = Object.freeze({
417
417
  status: "aborted"
418
- }), Ce = (n) => ({ status: "dirty", value: n }), T = (n) => ({ status: "valid", value: n }), Be = (n) => n.status === "aborted", Ke = (n) => n.status === "dirty", ue = (n) => n.status === "valid", le = (n) => typeof Promise < "u" && n instanceof Promise;
418
+ }), Ce = (n) => ({ status: "dirty", value: n }), T = (n) => ({ status: "valid", value: n }), Be = (n) => n.status === "aborted", Ke = (n) => n.status === "dirty", de = (n) => n.status === "valid", ue = (n) => typeof Promise < "u" && n instanceof Promise;
419
419
  function Ne(n, e, t, s) {
420
420
  if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
421
421
  return e.get(n);
@@ -438,7 +438,7 @@ class N {
438
438
  }
439
439
  }
440
440
  const et = (n, e) => {
441
- if (ue(e))
441
+ if (de(e))
442
442
  return { success: !0, data: e.value };
443
443
  if (!n.common.issues.length)
444
444
  throw new Error("Validation failed but no issues detected.");
@@ -499,7 +499,7 @@ class v {
499
499
  }
500
500
  _parseSync(e) {
501
501
  const t = this._parse(e);
502
- if (le(t))
502
+ if (ue(t))
503
503
  throw new Error("Synchronous parse encountered promise.");
504
504
  return t;
505
505
  }
@@ -547,7 +547,7 @@ class v {
547
547
  parent: null,
548
548
  data: e,
549
549
  parsedType: R(e)
550
- }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (le(r) ? r : Promise.resolve(r));
550
+ }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (ue(r) ? r : Promise.resolve(r));
551
551
  return et(s, a);
552
552
  }
553
553
  refine(e, t) {
@@ -589,10 +589,10 @@ class v {
589
589
  return te.create(this, this._def);
590
590
  }
591
591
  or(e) {
592
- return ge.create([this, e], this._def);
592
+ return _e.create([this, e], this._def);
593
593
  }
594
594
  and(e) {
595
- return me.create(this, e, this._def);
595
+ return ge.create(this, e, this._def);
596
596
  }
597
597
  transform(e) {
598
598
  return new A({
@@ -604,7 +604,7 @@ class v {
604
604
  }
605
605
  default(e) {
606
606
  const t = typeof e == "function" ? e : () => e;
607
- return new ke({
607
+ return new we({
608
608
  ...y(this._def),
609
609
  innerType: this,
610
610
  defaultValue: t,
@@ -620,7 +620,7 @@ class v {
620
620
  }
621
621
  catch(e) {
622
622
  const t = typeof e == "function" ? e : () => e;
623
- return new xe({
623
+ return new ke({
624
624
  ...y(this._def),
625
625
  innerType: this,
626
626
  catchValue: t,
@@ -635,10 +635,10 @@ class v {
635
635
  });
636
636
  }
637
637
  pipe(e) {
638
- return Te.create(this, e);
638
+ return be.create(this, e);
639
639
  }
640
640
  readonly() {
641
- return be.create(this);
641
+ return xe.create(this);
642
642
  }
643
643
  isOptional() {
644
644
  return this.safeParse(void 0).success;
@@ -1327,7 +1327,7 @@ F.create = (n) => {
1327
1327
  ...y(n)
1328
1328
  });
1329
1329
  };
1330
- class pe extends v {
1330
+ class le extends v {
1331
1331
  _parse(e) {
1332
1332
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== _.boolean) {
1333
1333
  const t = this._getOrReturnCtx(e);
@@ -1340,7 +1340,7 @@ class pe extends v {
1340
1340
  return T(e.data);
1341
1341
  }
1342
1342
  }
1343
- pe.create = (n) => new pe({
1343
+ le.create = (n) => new le({
1344
1344
  typeName: m.ZodBoolean,
1345
1345
  coerce: (n == null ? void 0 : n.coerce) || !1,
1346
1346
  ...y(n)
@@ -1440,7 +1440,7 @@ Ee.create = (n) => new Ee({
1440
1440
  typeName: m.ZodSymbol,
1441
1441
  ...y(n)
1442
1442
  });
1443
- class he extends v {
1443
+ class pe extends v {
1444
1444
  _parse(e) {
1445
1445
  if (this._getType(e) !== _.undefined) {
1446
1446
  const t = this._getOrReturnCtx(e);
@@ -1453,11 +1453,11 @@ class he extends v {
1453
1453
  return T(e.data);
1454
1454
  }
1455
1455
  }
1456
- he.create = (n) => new he({
1456
+ pe.create = (n) => new pe({
1457
1457
  typeName: m.ZodUndefined,
1458
1458
  ...y(n)
1459
1459
  });
1460
- class _e extends v {
1460
+ class he extends v {
1461
1461
  _parse(e) {
1462
1462
  if (this._getType(e) !== _.null) {
1463
1463
  const t = this._getOrReturnCtx(e);
@@ -1470,7 +1470,7 @@ class _e extends v {
1470
1470
  return T(e.data);
1471
1471
  }
1472
1472
  }
1473
- _e.create = (n) => new _e({
1473
+ he.create = (n) => new he({
1474
1474
  typeName: m.ZodNull,
1475
1475
  ...y(n)
1476
1476
  });
@@ -1905,7 +1905,7 @@ x.lazycreate = (n, e) => new x({
1905
1905
  typeName: m.ZodObject,
1906
1906
  ...y(e)
1907
1907
  });
1908
- class ge extends v {
1908
+ class _e extends v {
1909
1909
  _parse(e) {
1910
1910
  const { ctx: t } = this._processInputParams(e), s = this._def.options;
1911
1911
  function r(a) {
@@ -1973,12 +1973,12 @@ class ge extends v {
1973
1973
  return this._def.options;
1974
1974
  }
1975
1975
  }
1976
- ge.create = (n, e) => new ge({
1976
+ _e.create = (n, e) => new _e({
1977
1977
  options: n,
1978
1978
  typeName: m.ZodUnion,
1979
1979
  ...y(e)
1980
1980
  });
1981
- const P = (n) => n instanceof ye ? P(n.schema) : n instanceof A ? P(n.innerType()) : n instanceof ve ? [n.value] : n instanceof M ? n.options : n instanceof we ? w.objectValues(n.enum) : n instanceof ke ? P(n._def.innerType) : n instanceof he ? [void 0] : n instanceof _e ? [null] : n instanceof C ? [void 0, ...P(n.unwrap())] : n instanceof L ? [null, ...P(n.unwrap())] : n instanceof Qe || n instanceof be ? P(n.unwrap()) : n instanceof xe ? P(n._def.innerType) : [];
1981
+ const P = (n) => n instanceof fe ? P(n.schema) : n instanceof A ? P(n.innerType()) : n instanceof ye ? [n.value] : n instanceof M ? n.options : n instanceof ve ? w.objectValues(n.enum) : n instanceof we ? P(n._def.innerType) : n instanceof pe ? [void 0] : n instanceof he ? [null] : n instanceof C ? [void 0, ...P(n.unwrap())] : n instanceof L ? [null, ...P(n.unwrap())] : n instanceof Qe || n instanceof xe ? P(n.unwrap()) : n instanceof ke ? P(n._def.innerType) : [];
1982
1982
  class De extends v {
1983
1983
  _parse(e) {
1984
1984
  const { ctx: t } = this._processInputParams(e);
@@ -2067,7 +2067,7 @@ function We(n, e) {
2067
2067
  return { valid: !0, data: r };
2068
2068
  } else return t === _.date && s === _.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
2069
2069
  }
2070
- class me extends v {
2070
+ class ge extends v {
2071
2071
  _parse(e) {
2072
2072
  const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
2073
2073
  if (Be(a) || Be(o))
@@ -2099,7 +2099,7 @@ class me extends v {
2099
2099
  }));
2100
2100
  }
2101
2101
  }
2102
- me.create = (n, e, t) => new me({
2102
+ ge.create = (n, e, t) => new ge({
2103
2103
  left: n,
2104
2104
  right: e,
2105
2105
  typeName: m.ZodIntersection,
@@ -2155,7 +2155,7 @@ E.create = (n, e) => {
2155
2155
  ...y(e)
2156
2156
  });
2157
2157
  };
2158
- class fe extends v {
2158
+ class me extends v {
2159
2159
  get keySchema() {
2160
2160
  return this._def.keyType;
2161
2161
  }
@@ -2183,12 +2183,12 @@ class fe extends v {
2183
2183
  return this._def.valueType;
2184
2184
  }
2185
2185
  static create(e, t, s) {
2186
- return t instanceof v ? new fe({
2186
+ return t instanceof v ? new me({
2187
2187
  keyType: e,
2188
2188
  valueType: t,
2189
2189
  typeName: m.ZodRecord,
2190
2190
  ...y(s)
2191
- }) : new fe({
2191
+ }) : new me({
2192
2192
  keyType: j.create(),
2193
2193
  valueType: e,
2194
2194
  typeName: m.ZodRecord,
@@ -2409,7 +2409,7 @@ class G extends v {
2409
2409
  });
2410
2410
  }
2411
2411
  }
2412
- class ye extends v {
2412
+ class fe extends v {
2413
2413
  get schema() {
2414
2414
  return this._def.getter();
2415
2415
  }
@@ -2418,12 +2418,12 @@ class ye extends v {
2418
2418
  return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
2419
2419
  }
2420
2420
  }
2421
- ye.create = (n, e) => new ye({
2421
+ fe.create = (n, e) => new fe({
2422
2422
  getter: n,
2423
2423
  typeName: m.ZodLazy,
2424
2424
  ...y(e)
2425
2425
  });
2426
- class ve extends v {
2426
+ class ye extends v {
2427
2427
  _parse(e) {
2428
2428
  if (e.data !== this._def.value) {
2429
2429
  const t = this._getOrReturnCtx(e);
@@ -2439,7 +2439,7 @@ class ve extends v {
2439
2439
  return this._def.value;
2440
2440
  }
2441
2441
  }
2442
- ve.create = (n, e) => new ve({
2442
+ ye.create = (n, e) => new ye({
2443
2443
  value: n,
2444
2444
  typeName: m.ZodLiteral,
2445
2445
  ...y(e)
@@ -2510,7 +2510,7 @@ class M extends v {
2510
2510
  }
2511
2511
  oe = /* @__PURE__ */ new WeakMap();
2512
2512
  M.create = dt;
2513
- class we extends v {
2513
+ class ve extends v {
2514
2514
  constructor() {
2515
2515
  super(...arguments), ce.set(this, void 0);
2516
2516
  }
@@ -2539,7 +2539,7 @@ class we extends v {
2539
2539
  }
2540
2540
  }
2541
2541
  ce = /* @__PURE__ */ new WeakMap();
2542
- we.create = (n, e) => new we({
2542
+ ve.create = (n, e) => new ve({
2543
2543
  values: n,
2544
2544
  typeName: m.ZodNativeEnum,
2545
2545
  ...y(e)
@@ -2634,14 +2634,14 @@ class A extends v {
2634
2634
  path: s.path,
2635
2635
  parent: s
2636
2636
  });
2637
- if (!ue(o))
2637
+ if (!de(o))
2638
2638
  return o;
2639
2639
  const c = r.transform(o.value, a);
2640
2640
  if (c instanceof Promise)
2641
2641
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2642
2642
  return { status: t.value, value: c };
2643
2643
  } else
2644
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => ue(o) ? Promise.resolve(r.transform(o.value, a)).then((c) => ({ status: t.value, value: c })) : o);
2644
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => de(o) ? Promise.resolve(r.transform(o.value, a)).then((c) => ({ status: t.value, value: c })) : o);
2645
2645
  w.assertNever(r);
2646
2646
  }
2647
2647
  }
@@ -2683,7 +2683,7 @@ L.create = (n, e) => new L({
2683
2683
  typeName: m.ZodNullable,
2684
2684
  ...y(e)
2685
2685
  });
2686
- class ke extends v {
2686
+ class we extends v {
2687
2687
  _parse(e) {
2688
2688
  const { ctx: t } = this._processInputParams(e);
2689
2689
  let s = t.data;
@@ -2697,13 +2697,13 @@ class ke extends v {
2697
2697
  return this._def.innerType;
2698
2698
  }
2699
2699
  }
2700
- ke.create = (n, e) => new ke({
2700
+ we.create = (n, e) => new we({
2701
2701
  innerType: n,
2702
2702
  typeName: m.ZodDefault,
2703
2703
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2704
2704
  ...y(e)
2705
2705
  });
2706
- class xe extends v {
2706
+ class ke extends v {
2707
2707
  _parse(e) {
2708
2708
  const { ctx: t } = this._processInputParams(e), s = {
2709
2709
  ...t,
@@ -2718,7 +2718,7 @@ class xe extends v {
2718
2718
  ...s
2719
2719
  }
2720
2720
  });
2721
- return le(r) ? r.then((a) => ({
2721
+ return ue(r) ? r.then((a) => ({
2722
2722
  status: "valid",
2723
2723
  value: a.status === "valid" ? a.value : this._def.catchValue({
2724
2724
  get error() {
@@ -2740,7 +2740,7 @@ class xe extends v {
2740
2740
  return this._def.innerType;
2741
2741
  }
2742
2742
  }
2743
- xe.create = (n, e) => new xe({
2743
+ ke.create = (n, e) => new ke({
2744
2744
  innerType: n,
2745
2745
  typeName: m.ZodCatch,
2746
2746
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
@@ -2777,7 +2777,7 @@ class Qe extends v {
2777
2777
  return this._def.type;
2778
2778
  }
2779
2779
  }
2780
- class Te extends v {
2780
+ class be extends v {
2781
2781
  _parse(e) {
2782
2782
  const { status: t, ctx: s } = this._processInputParams(e);
2783
2783
  if (s.common.async)
@@ -2810,23 +2810,23 @@ class Te extends v {
2810
2810
  }
2811
2811
  }
2812
2812
  static create(e, t) {
2813
- return new Te({
2813
+ return new be({
2814
2814
  in: e,
2815
2815
  out: t,
2816
2816
  typeName: m.ZodPipeline
2817
2817
  });
2818
2818
  }
2819
2819
  }
2820
- class be extends v {
2820
+ class xe extends v {
2821
2821
  _parse(e) {
2822
- const t = this._def.innerType._parse(e), s = (r) => (ue(r) && (r.value = Object.freeze(r.value)), r);
2823
- return le(t) ? t.then((r) => s(r)) : s(t);
2822
+ const t = this._def.innerType._parse(e), s = (r) => (de(r) && (r.value = Object.freeze(r.value)), r);
2823
+ return ue(t) ? t.then((r) => s(r)) : s(t);
2824
2824
  }
2825
2825
  unwrap() {
2826
2826
  return this._def.innerType;
2827
2827
  }
2828
2828
  }
2829
- be.create = (n, e) => new be({
2829
+ xe.create = (n, e) => new xe({
2830
2830
  innerType: n,
2831
2831
  typeName: m.ZodReadonly,
2832
2832
  ...y(e)
@@ -2849,10 +2849,10 @@ var m;
2849
2849
  })(m || (m = {}));
2850
2850
  const Qt = (n, e = {
2851
2851
  message: `Input not instance of ${n.name}`
2852
- }) => ut((t) => t instanceof n, e), lt = j.create, pt = D.create, Ht = Re.create, Jt = F.create, ht = pe.create, Yt = B.create, Gt = Ee.create, Xt = he.create, en = _e.create, tn = ee.create, nn = V.create, sn = $.create, rn = $e.create, an = I.create, on = x.create, cn = x.strictCreate, dn = ge.create, un = De.create, ln = me.create, pn = E.create, hn = fe.create, _n = Pe.create, gn = K.create, mn = G.create, fn = ye.create, yn = ve.create, vn = M.create, wn = we.create, kn = te.create, tt = A.create, xn = C.create, bn = L.create, Tn = A.createWithPreprocess, On = Te.create, Sn = () => lt().optional(), Zn = () => pt().optional(), jn = () => ht().optional(), In = {
2852
+ }) => ut((t) => t instanceof n, e), lt = j.create, pt = D.create, Ht = Re.create, Jt = F.create, ht = le.create, Yt = B.create, Gt = Ee.create, Xt = pe.create, en = he.create, tn = ee.create, nn = V.create, sn = $.create, rn = $e.create, an = I.create, on = x.create, cn = x.strictCreate, dn = _e.create, un = De.create, ln = ge.create, pn = E.create, hn = me.create, _n = Pe.create, gn = K.create, mn = G.create, fn = fe.create, yn = ye.create, vn = M.create, wn = ve.create, kn = te.create, tt = A.create, xn = C.create, bn = L.create, Tn = A.createWithPreprocess, On = be.create, Sn = () => lt().optional(), Zn = () => pt().optional(), jn = () => ht().optional(), In = {
2853
2853
  string: (n) => j.create({ ...n, coerce: !0 }),
2854
2854
  number: (n) => D.create({ ...n, coerce: !0 }),
2855
- boolean: (n) => pe.create({
2855
+ boolean: (n) => le.create({
2856
2856
  ...n,
2857
2857
  coerce: !0
2858
2858
  }),
@@ -2873,8 +2873,8 @@ var i = /* @__PURE__ */ Object.freeze({
2873
2873
  OK: T,
2874
2874
  isAborted: Be,
2875
2875
  isDirty: Ke,
2876
- isValid: ue,
2877
- isAsync: le,
2876
+ isValid: de,
2877
+ isAsync: ue,
2878
2878
  get util() {
2879
2879
  return w;
2880
2880
  },
@@ -2888,41 +2888,41 @@ var i = /* @__PURE__ */ Object.freeze({
2888
2888
  ZodString: j,
2889
2889
  ZodNumber: D,
2890
2890
  ZodBigInt: F,
2891
- ZodBoolean: pe,
2891
+ ZodBoolean: le,
2892
2892
  ZodDate: B,
2893
2893
  ZodSymbol: Ee,
2894
- ZodUndefined: he,
2895
- ZodNull: _e,
2894
+ ZodUndefined: pe,
2895
+ ZodNull: he,
2896
2896
  ZodAny: ee,
2897
2897
  ZodUnknown: V,
2898
2898
  ZodNever: $,
2899
2899
  ZodVoid: $e,
2900
2900
  ZodArray: I,
2901
2901
  ZodObject: x,
2902
- ZodUnion: ge,
2902
+ ZodUnion: _e,
2903
2903
  ZodDiscriminatedUnion: De,
2904
- ZodIntersection: me,
2904
+ ZodIntersection: ge,
2905
2905
  ZodTuple: E,
2906
- ZodRecord: fe,
2906
+ ZodRecord: me,
2907
2907
  ZodMap: Pe,
2908
2908
  ZodSet: K,
2909
2909
  ZodFunction: G,
2910
- ZodLazy: ye,
2911
- ZodLiteral: ve,
2910
+ ZodLazy: fe,
2911
+ ZodLiteral: ye,
2912
2912
  ZodEnum: M,
2913
- ZodNativeEnum: we,
2913
+ ZodNativeEnum: ve,
2914
2914
  ZodPromise: te,
2915
2915
  ZodEffects: A,
2916
2916
  ZodTransformer: A,
2917
2917
  ZodOptional: C,
2918
2918
  ZodNullable: L,
2919
- ZodDefault: ke,
2920
- ZodCatch: xe,
2919
+ ZodDefault: we,
2920
+ ZodCatch: ke,
2921
2921
  ZodNaN: Re,
2922
2922
  BRAND: Kt,
2923
2923
  ZodBranded: Qe,
2924
- ZodPipeline: Te,
2925
- ZodReadonly: be,
2924
+ ZodPipeline: be,
2925
+ ZodReadonly: xe,
2926
2926
  custom: ut,
2927
2927
  Schema: v,
2928
2928
  ZodSchema: v,
@@ -3561,7 +3561,7 @@ function es(n) {
3561
3561
  };
3562
3562
  }
3563
3563
  const ts = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3564
- let Oe = (n = 21) => {
3564
+ let Te = (n = 21) => {
3565
3565
  let e = "", t = crypto.getRandomValues(new Uint8Array(n));
3566
3566
  for (; n--; )
3567
3567
  e += ts[t[n] & 63];
@@ -3570,7 +3570,7 @@ let Oe = (n = 21) => {
3570
3570
  function ns(n) {
3571
3571
  return async (e) => {
3572
3572
  const t = {
3573
- id: e.id || Oe(),
3573
+ id: e.id || Te(),
3574
3574
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
3575
3575
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
3576
3576
  ...e
@@ -3636,7 +3636,7 @@ function ds(n) {
3636
3636
  return async (e, t) => {
3637
3637
  var r, a;
3638
3638
  const s = {
3639
- id: Oe(),
3639
+ id: Te(),
3640
3640
  ...t,
3641
3641
  user_agent: t.user_agent.slice(0, cs)
3642
3642
  };
@@ -4045,7 +4045,7 @@ function qs(n) {
4045
4045
  function Vs(n) {
4046
4046
  return async (e, t) => {
4047
4047
  const s = {
4048
- id: Oe(),
4048
+ id: Te(),
4049
4049
  ...t,
4050
4050
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4051
4051
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
@@ -4101,10 +4101,10 @@ function Js(n) {
4101
4101
  get: async (e) => {
4102
4102
  const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
4103
4103
  if (!t)
4104
- throw new de(404, { message: "Client not found" });
4104
+ return null;
4105
4105
  const s = await n.selectFrom("tenants").selectAll().where("id", "=", t.tenant_id).executeTakeFirst();
4106
4106
  if (!s)
4107
- throw new de(404, { message: "Tenant not found" });
4107
+ throw new je(404, { message: "Tenant not found" });
4108
4108
  const r = await n.selectFrom("connections").where("tenant_id", "=", t.tenant_id).selectAll().execute(), a = await n.selectFrom("domains").where("tenant_id", "=", t.tenant_id).selectAll().execute();
4109
4109
  return {
4110
4110
  id: t.id,
@@ -4150,7 +4150,7 @@ function tr(n) {
4150
4150
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4151
4151
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
4152
4152
  tenant_id: e,
4153
- id: Oe(),
4153
+ id: Te(),
4154
4154
  ...t
4155
4155
  };
4156
4156
  return await n.insertInto("domains").values(s).execute(), s;
@@ -4207,7 +4207,7 @@ function rr(n) {
4207
4207
  }
4208
4208
  function ir(n) {
4209
4209
  return async (e, t) => {
4210
- var o, c, d, u, h, k, O, U, z, q, se, re, ie, Se, Ze, Q, H, J;
4210
+ var o, c, d, u, h, k, O, U, z, q, se, re, ie, Oe, Se, Q, H, J;
4211
4211
  const { colors: s, font: r, ...a } = t;
4212
4212
  try {
4213
4213
  await n.insertInto("branding").values({
@@ -4226,7 +4226,7 @@ function ir(n) {
4226
4226
  colors_primary: s == null ? void 0 : s.primary,
4227
4227
  colors_page_background_type: (se = (q = t.colors) == null ? void 0 : q.page_background) == null ? void 0 : se.type,
4228
4228
  colors_page_background_start: (ie = (re = t.colors) == null ? void 0 : re.page_background) == null ? void 0 : ie.start,
4229
- colors_page_background_end: (Ze = (Se = t.colors) == null ? void 0 : Se.page_background) == null ? void 0 : Ze.end,
4229
+ colors_page_background_end: (Se = (Oe = t.colors) == null ? void 0 : Oe.page_background) == null ? void 0 : Se.end,
4230
4230
  colors_page_background_angle_dev: (H = (Q = t.colors) == null ? void 0 : Q.page_background) == null ? void 0 : H.angle_deg,
4231
4231
  font_url: (J = t.font) == null ? void 0 : J.url
4232
4232
  }).where("tenant_id", "=", e).execute();
@@ -4243,7 +4243,7 @@ function or(n) {
4243
4243
  return async (e, t) => {
4244
4244
  const s = await n.selectFrom("authentication_codes").where("tenant_id", "=", e).where("code", "=", t).selectAll().executeTakeFirst();
4245
4245
  if (!s)
4246
- throw new de(403, { message: "Code not found or expired" });
4246
+ throw new je(403, { message: "Code not found or expired" });
4247
4247
  const {
4248
4248
  state: r,
4249
4249
  nonce: a,
@@ -4313,7 +4313,7 @@ function pr(n) {
4313
4313
  function hr(n) {
4314
4314
  return async (e, t) => {
4315
4315
  const s = {
4316
- hook_id: Oe(),
4316
+ hook_id: Te(),
4317
4317
  ...t,
4318
4318
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4319
4319
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/markusahlstrand/authhero"
13
13
  },
14
- "version": "0.4.0",
14
+ "version": "0.4.2",
15
15
  "files": [
16
16
  "dist"
17
17
  ],