@authhero/kysely-adapter 10.58.0 → 10.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -284,7 +284,7 @@ let ar = (t) => crypto.getRandomValues(new Uint8Array(t)), rr = (t, e, n) => {
284
284
  if (u += t[c[d] & a] || "", u.length >= o) return u;
285
285
  }
286
286
  };
287
- }, or = (t, e = 21) => rr(t, e | 0, ar), Y = (t = 21) => {
287
+ }, or = (t, e = 21) => rr(t, e | 0, ar), U = (t = 21) => {
288
288
  let e = "", n = crypto.getRandomValues(new Uint8Array(t |= 0));
289
289
  for (; t--; )
290
290
  e += nr[n[t] & 63];
@@ -339,7 +339,7 @@ function Xn(t) {
339
339
  function sr(t) {
340
340
  return async (e) => {
341
341
  const n = {
342
- id: e.id || Y(),
342
+ id: e.id || U(),
343
343
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
344
344
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
345
345
  ...e
@@ -407,7 +407,7 @@ const mr = 1024;
407
407
  function hr(t) {
408
408
  return async (e, n) => {
409
409
  var o, u, c, d, h, p, l, y, f, N, x;
410
- const a = (o = n.user_agent) == null ? void 0 : o.slice(0, mr), r = n.log_id || Y();
410
+ const a = (o = n.user_agent) == null ? void 0 : o.slice(0, mr), r = n.log_id || U();
411
411
  return await t.insertInto("logs").values({
412
412
  ...n,
413
413
  log_id: r,
@@ -606,7 +606,7 @@ function br(t) {
606
606
  }
607
607
  function Tr(t) {
608
608
  return async (e, n) => {
609
- const a = n.id || crypto.randomUUID(), r = n.is_current ?? !0, o = {
609
+ const a = n.id || U(), r = n.is_current ?? !0, o = {
610
610
  id: a,
611
611
  ...n,
612
612
  is_current: r,
@@ -1028,7 +1028,7 @@ function Zr(t) {
1028
1028
  }
1029
1029
  function eo(t) {
1030
1030
  return async (e, n) => {
1031
- const a = (/* @__PURE__ */ new Date()).toISOString(), r = Y(), { scope: o, authorization_details_types: u, ...c } = n, d = {
1031
+ const a = (/* @__PURE__ */ new Date()).toISOString(), r = U(), { scope: o, authorization_details_types: u, ...c } = n, d = {
1032
1032
  id: r,
1033
1033
  tenant_id: e,
1034
1034
  ...c,
@@ -1083,12 +1083,12 @@ function no(t) {
1083
1083
  if (u) {
1084
1084
  const f = u.trim(), N = f.split(/\s+/), x = N.length === 1 ? N[0] : void 0, E = x ? x.match(/^(-)?([a-zA-Z_][a-zA-Z0-9_]*):"?([^"]*)"?$/) : null, z = E ? E[3] : "", oe = /^(>=|>|<=|<)/.test(z || "");
1085
1085
  if (E && !oe && z) {
1086
- const U = !!E[1], we = E[2], { ref: Ct } = t.dynamic, Ne = Ct(`client_grants.${we}`);
1086
+ const Q = !!E[1], we = E[2], { ref: Ct } = t.dynamic, Ne = Ct(`client_grants.${we}`);
1087
1087
  if (we === "allow_any_organization") {
1088
1088
  const rt = z === "true" ? 1 : 0;
1089
- U ? d = d.where(Ne, "!=", rt) : d = d.where(Ne, "=", rt);
1089
+ Q ? d = d.where(Ne, "!=", rt) : d = d.where(Ne, "=", rt);
1090
1090
  } else
1091
- U ? d = d.where(Ne, "!=", z) : d = d.where(Ne, "=", z);
1091
+ Q ? d = d.where(Ne, "!=", z) : d = d.where(Ne, "=", z);
1092
1092
  } else
1093
1093
  d = J(t, d, f, []);
1094
1094
  }
@@ -1272,7 +1272,7 @@ function lo(t) {
1272
1272
  function _o(t) {
1273
1273
  return async (e, n) => {
1274
1274
  const a = {
1275
- custom_domain_id: Y(),
1275
+ custom_domain_id: U(),
1276
1276
  status: "pending",
1277
1277
  primary: !1,
1278
1278
  ...n
@@ -1365,7 +1365,7 @@ function wo(t) {
1365
1365
  }
1366
1366
  function No(t) {
1367
1367
  return async (e, n) => {
1368
- var u, c, d, h, p, l, y, f, N, x, E, z, oe, U, we, Ct, Ne, rt;
1368
+ var u, c, d, h, p, l, y, f, N, x, E, z, oe, Q, we, Ct, Ne, rt;
1369
1369
  const { colors: a, font: r, ...o } = n;
1370
1370
  try {
1371
1371
  await t.insertInto("branding").values({
@@ -1384,7 +1384,7 @@ function No(t) {
1384
1384
  colors_primary: a == null ? void 0 : a.primary,
1385
1385
  colors_page_background_type: (E = (x = n.colors) == null ? void 0 : x.page_background) == null ? void 0 : E.type,
1386
1386
  colors_page_background_start: (oe = (z = n.colors) == null ? void 0 : z.page_background) == null ? void 0 : oe.start,
1387
- colors_page_background_end: (we = (U = n.colors) == null ? void 0 : U.page_background) == null ? void 0 : we.end,
1387
+ colors_page_background_end: (we = (Q = n.colors) == null ? void 0 : Q.page_background) == null ? void 0 : we.end,
1388
1388
  colors_page_background_angle_dev: (Ne = (Ct = n.colors) == null ? void 0 : Ct.page_background) == null ? void 0 : Ne.angle_deg,
1389
1389
  font_url: (rt = n.font) == null ? void 0 : rt.url
1390
1390
  }).where("tenant_id", "=", e).execute();
@@ -1478,7 +1478,7 @@ function So(t) {
1478
1478
  function ko(t) {
1479
1479
  return async (e, n) => {
1480
1480
  const a = {
1481
- themeId: Y(),
1481
+ themeId: U(),
1482
1482
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
1483
1483
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
1484
1484
  ...n
@@ -1553,7 +1553,7 @@ function Do(t) {
1553
1553
  return async (e, n) => {
1554
1554
  var r;
1555
1555
  const a = {
1556
- id: Y(),
1556
+ id: U(),
1557
1557
  ...n,
1558
1558
  authorization_url: (r = n.authorization_url) == null ? void 0 : r.slice(0, 1024),
1559
1559
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -1790,7 +1790,7 @@ function Ho(t) {
1790
1790
  function Xo(t) {
1791
1791
  return async (e, n) => {
1792
1792
  const a = Tt.parse({
1793
- id: Y(),
1793
+ id: U(),
1794
1794
  ...n,
1795
1795
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
1796
1796
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
@@ -1952,8 +1952,8 @@ function ii(t) {
1952
1952
  if (u) {
1953
1953
  const y = u.trim(), f = y.split(/\s+/), N = f.length === 1 ? f[0] : void 0, x = N ? N.match(/^(-)?(name|identifier):(.*)$/) : null, E = x ? x[3] : "", z = /^(>=|>|<=|<)/.test(E || "");
1954
1954
  if (x && !z) {
1955
- const oe = !!x[1], U = x[2] === "name" ? "resource_servers.name" : "resource_servers.identifier";
1956
- c = oe ? c.where(U, "not like", `%${E}%`) : c.where(U, "like", `%${E}%`);
1955
+ const oe = !!x[1], Q = x[2] === "name" ? "resource_servers.name" : "resource_servers.identifier";
1956
+ c = oe ? c.where(Q, "not like", `%${E}%`) : c.where(Q, "like", `%${E}%`);
1957
1957
  } else
1958
1958
  c = J(t, c, y, [
1959
1959
  "resource_servers.name",
@@ -1967,9 +1967,9 @@ function ii(t) {
1967
1967
  options: E,
1968
1968
  skip_consent_for_verifiable_first_party_clients: z,
1969
1969
  allow_offline_access: oe,
1970
- ...U
1970
+ ...Q
1971
1971
  } = f, we = {
1972
- ...U,
1972
+ ...Q,
1973
1973
  scopes: x ? JSON.parse(x) : [],
1974
1974
  options: E ? JSON.parse(E) : {},
1975
1975
  skip_consent_for_verifiable_first_party_clients: !!z,
@@ -2034,7 +2034,7 @@ function ci(t) {
2034
2034
  }
2035
2035
  function di(t) {
2036
2036
  return async (e, n) => {
2037
- const a = (/* @__PURE__ */ new Date()).toISOString(), r = Y(), o = {
2037
+ const a = (/* @__PURE__ */ new Date()).toISOString(), r = U(), o = {
2038
2038
  id: r,
2039
2039
  ...n,
2040
2040
  tenant_id: e,
@@ -2428,7 +2428,7 @@ function zi(t) {
2428
2428
  function Ri(t) {
2429
2429
  return async (e, n) => {
2430
2430
  const a = {
2431
- id: Y(),
2431
+ id: U(),
2432
2432
  tenant_id: e,
2433
2433
  user_id: n.user_id,
2434
2434
  organization_id: n.organization_id,
@@ -2702,7 +2702,7 @@ function Gi(t) {
2702
2702
  function Ot(t) {
2703
2703
  return typeof t > "u" || t === void 0;
2704
2704
  }
2705
- function G(t) {
2705
+ function Y(t) {
2706
2706
  return typeof t == "string";
2707
2707
  }
2708
2708
  function gn(t) {
@@ -2797,7 +2797,7 @@ function Hi(t) {
2797
2797
  return Jt(t) && "expressionType" in t && q(t);
2798
2798
  }
2799
2799
  function Xi(t) {
2800
- return Jt(t) && "expression" in t && G(t.alias) && q(t);
2800
+ return Jt(t) && "expression" in t && Y(t.alias) && q(t);
2801
2801
  }
2802
2802
  const H = s({
2803
2803
  is(t) {
@@ -2966,7 +2966,7 @@ const H = s({
2966
2966
  }
2967
2967
  });
2968
2968
  function In(t) {
2969
- return G(t) && ra.includes(t);
2969
+ return Y(t) && ra.includes(t);
2970
2970
  }
2971
2971
  const yn = s({
2972
2972
  is(t) {
@@ -3007,7 +3007,7 @@ const yn = s({
3007
3007
  }
3008
3008
  });
3009
3009
  function ia(t) {
3010
- return Jt(t) && q(t) && G(t.dynamicReference);
3010
+ return Jt(t) && q(t) && Y(t.dynamicReference);
3011
3011
  }
3012
3012
  const Zt = s({
3013
3013
  is(t) {
@@ -3132,7 +3132,7 @@ const St = s({
3132
3132
  }
3133
3133
  });
3134
3134
  function ss(t) {
3135
- return G(t) ? fe(t) : t.toOperationNode();
3135
+ return Y(t) ? fe(t) : t.toOperationNode();
3136
3136
  }
3137
3137
  function _t(t) {
3138
3138
  return me(t) ? t.map((e) => L(e)) : [L(t)];
@@ -3277,7 +3277,7 @@ function da(t) {
3277
3277
  return na(t) || ta(t);
3278
3278
  }
3279
3279
  function tn(t) {
3280
- if (G(t) && rs.includes(t))
3280
+ if (Y(t) && rs.includes(t))
3281
3281
  return Ie.create(t);
3282
3282
  if (q(t))
3283
3283
  return t.toOperationNode();
@@ -3644,13 +3644,13 @@ function la(t) {
3644
3644
  return Ee(t) ? la(t(Wt())) : me(t) ? t.map((e) => zn(e)) : [zn(t)];
3645
3645
  }
3646
3646
  function zn(t) {
3647
- return G(t) ? ct.create(cs(t)) : ia(t) ? ct.create(t.toOperationNode()) : ct.create(va(t));
3647
+ return Y(t) ? ct.create(cs(t)) : ia(t) ? ct.create(t.toOperationNode()) : ct.create(va(t));
3648
3648
  }
3649
3649
  function _a(t) {
3650
3650
  return t ? Array.isArray(t) ? t.map(Rn) : [Rn(t)] : [ct.createSelectAll()];
3651
3651
  }
3652
3652
  function Rn(t) {
3653
- if (G(t))
3653
+ if (Y(t))
3654
3654
  return ct.createSelectAllFromTable(W(t));
3655
3655
  throw new Error(`invalid value selectAll expression: ${JSON.stringify(t)}`);
3656
3656
  }
@@ -6009,13 +6009,13 @@ function eu() {
6009
6009
  jsonAgg(n) {
6010
6010
  return new Le({
6011
6011
  aggregateFunctionNode: ue.create("json_agg", [
6012
- G(n) ? W(n) : n.toOperationNode()
6012
+ Y(n) ? W(n) : n.toOperationNode()
6013
6013
  ])
6014
6014
  });
6015
6015
  },
6016
6016
  toJson(n) {
6017
6017
  return new O(Bn.create("to_json", [
6018
- G(n) ? W(n) : n.toOperationNode()
6018
+ Y(n) ? W(n) : n.toOperationNode()
6019
6019
  ]));
6020
6020
  }
6021
6021
  });
@@ -6095,34 +6095,34 @@ class Na {
6095
6095
  }
6096
6096
  }
6097
6097
  He = new WeakMap();
6098
- var Q;
6098
+ var V;
6099
6099
  class ru {
6100
6100
  constructor(e) {
6101
- C(this, Q);
6102
- b(this, Q, s(e));
6101
+ C(this, V);
6102
+ b(this, V, s(e));
6103
6103
  }
6104
6104
  when(...e) {
6105
6105
  return new Na({
6106
- ...i(this, Q),
6107
- node: re.cloneWithWhen(i(this, Q).node, Bt.create(K(e)))
6106
+ ...i(this, V),
6107
+ node: re.cloneWithWhen(i(this, V).node, Bt.create(K(e)))
6108
6108
  });
6109
6109
  }
6110
6110
  else(e) {
6111
6111
  return new ou({
6112
- ...i(this, Q),
6113
- node: re.cloneWith(i(this, Q).node, {
6112
+ ...i(this, V),
6113
+ node: re.cloneWith(i(this, V).node, {
6114
6114
  else: Nn(e) ? vn(e) : D(e)
6115
6115
  })
6116
6116
  });
6117
6117
  }
6118
6118
  end() {
6119
- return new O(re.cloneWith(i(this, Q).node, { isStatement: !1 }));
6119
+ return new O(re.cloneWith(i(this, V).node, { isStatement: !1 }));
6120
6120
  }
6121
6121
  endCase() {
6122
- return new O(re.cloneWith(i(this, Q).node, { isStatement: !0 }));
6122
+ return new O(re.cloneWith(i(this, V).node, { isStatement: !0 }));
6123
6123
  }
6124
6124
  }
6125
- Q = new WeakMap();
6125
+ V = new WeakMap();
6126
6126
  var Xe;
6127
6127
  class ou {
6128
6128
  constructor(e) {
@@ -6149,12 +6149,12 @@ const Wn = s({
6149
6149
  });
6150
6150
  }
6151
6151
  });
6152
- var V, yt, dn;
6152
+ var G, yt, dn;
6153
6153
  class cn {
6154
6154
  constructor(e) {
6155
6155
  C(this, yt);
6156
- C(this, V);
6157
- b(this, V, e);
6156
+ C(this, G);
6157
+ b(this, G, e);
6158
6158
  }
6159
6159
  /**
6160
6160
  * Access an element of a JSON array in a specific location.
@@ -6279,8 +6279,8 @@ class cn {
6279
6279
  return w(this, yt, dn).call(this, "Member", e);
6280
6280
  }
6281
6281
  }
6282
- V = new WeakMap(), yt = new WeakSet(), dn = function(e, n) {
6283
- return St.is(i(this, V)) ? new $t(St.cloneWithTraversal(i(this, V), ut.is(i(this, V).traversal) ? ut.cloneWithLeg(i(this, V).traversal, Wn.create(e, n)) : ua.cloneWithValue(i(this, V).traversal, pe.createImmediate(n)))) : new $t(ut.cloneWithLeg(i(this, V), Wn.create(e, n)));
6282
+ G = new WeakMap(), yt = new WeakSet(), dn = function(e, n) {
6283
+ return St.is(i(this, G)) ? new $t(St.cloneWithTraversal(i(this, G), ut.is(i(this, G).traversal) ? ut.cloneWithLeg(i(this, G).traversal, Wn.create(e, n)) : ua.cloneWithValue(i(this, G).traversal, pe.createImmediate(n)))) : new $t(ut.cloneWithLeg(i(this, G), Wn.create(e, n)));
6284
6284
  };
6285
6285
  var Se;
6286
6286
  const Mt = class Mt extends cn {
@@ -6534,7 +6534,7 @@ function mu(t) {
6534
6534
  return me(t) ? t.map((e) => Pt(e)) : [Pt(t)];
6535
6535
  }
6536
6536
  function Pt(t) {
6537
- return G(t) ? hu(t) : va(t);
6537
+ return Y(t) ? hu(t) : va(t);
6538
6538
  }
6539
6539
  function hu(t) {
6540
6540
  const e = " as ";
@@ -9060,7 +9060,7 @@ async function Oh(t) {
9060
9060
  }
9061
9061
  for (const r of a)
9062
9062
  await t.insertInto("password_history").values({
9063
- id: Y(),
9063
+ id: U(),
9064
9064
  user_id: r.user_id,
9065
9065
  tenant_id: r.tenant_id,
9066
9066
  password: r.password,
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/markusahlstrand/authhero"
13
13
  },
14
- "version": "10.58.0",
14
+ "version": "10.59.0",
15
15
  "files": [
16
16
  "dist"
17
17
  ],