@authhero/kysely-adapter 10.27.0 → 10.28.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.
@@ -3,9 +3,9 @@ var ue = (t) => {
3
3
  throw TypeError(t);
4
4
  };
5
5
  var Ke = (t, e, a) => e in t ? Ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
6
- var M = (t, e, a) => Ke(t, typeof e != "symbol" ? e + "" : e, a), U = (t, e, a) => e.has(t) || ue("Cannot " + a);
7
- var c = (t, e, a) => (U(t, e, "read from private field"), a ? a.call(t) : e.get(t)), y = (t, e, a) => e.has(t) ? ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), F = (t, e, a, n) => (U(t, e, "write to private field"), n ? n.call(t, a) : e.set(t, a), a), u = (t, e, a) => (U(t, e, "access private method"), a);
8
- import { parseUserId as Z, codeSchema as Re, connectionSchema as Ue, loginSessionSchema as Be, promptSettingSchema as Qe, formSchema as K } from "@authhero/adapter-interfaces";
6
+ var M = (t, e, a) => Ke(t, typeof e != "symbol" ? e + "" : e, a), B = (t, e, a) => e.has(t) || ue("Cannot " + a);
7
+ var c = (t, e, a) => (B(t, e, "read from private field"), a ? a.call(t) : e.get(t)), y = (t, e, a) => e.has(t) ? ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), F = (t, e, a, n) => (B(t, e, "write to private field"), n ? n.call(t, a) : e.set(t, a), a), u = (t, e, a) => (B(t, e, "access private method"), a);
8
+ import { parseUserId as Z, codeSchema as Re, connectionSchema as Be, loginSessionSchema as Ue, promptSettingSchema as Qe, formSchema as K } from "@authhero/adapter-interfaces";
9
9
  import "@hono/zod-openapi";
10
10
  var V = class extends Error {
11
11
  constructor(e = 500, a) {
@@ -730,7 +730,7 @@ function Jt(t) {
730
730
  return {
731
731
  ...a,
732
732
  connections: o.map(
733
- (s) => Ue.parse(
733
+ (s) => Be.parse(
734
734
  f({
735
735
  ...s,
736
736
  options: s.options ? JSON.parse(s.options) : {}
@@ -766,14 +766,14 @@ function Kt(t) {
766
766
  function Rt(t) {
767
767
  return async (e, a) => !!(await t.updateTable("keys").set(a).where("kid", "=", e).execute()).length;
768
768
  }
769
- function Ut(t) {
769
+ function Bt(t) {
770
770
  return {
771
771
  create: Kt(t),
772
772
  list: Et(t),
773
773
  update: Rt(t)
774
774
  };
775
775
  }
776
- function Bt(t) {
776
+ function Ut(t) {
777
777
  return async (e, a) => {
778
778
  const n = {
779
779
  custom_domain_id: S(),
@@ -829,7 +829,7 @@ function Gt(t) {
829
829
  }
830
830
  function Ht(t) {
831
831
  return {
832
- create: Bt(t),
832
+ create: Ut(t),
833
833
  get: Vt(t),
834
834
  getByDomain: Gt(t),
835
835
  list: Qt(t),
@@ -994,15 +994,27 @@ function ia(t) {
994
994
  function la(t) {
995
995
  return async (e, a) => {
996
996
  const n = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.themeId", "=", a).selectAll().executeTakeFirst();
997
- return n ? f(
998
- ge(n, [
997
+ if (!n)
998
+ return null;
999
+ const o = {
1000
+ ...n,
1001
+ borders_show_widget_shadow: !!n.borders_show_widget_shadow,
1002
+ fonts_body_text_bold: !!n.fonts_body_text_bold,
1003
+ fonts_buttons_text_bold: !!n.fonts_buttons_text_bold,
1004
+ fonts_input_labels_bold: !!n.fonts_input_labels_bold,
1005
+ fonts_links_bold: !!n.fonts_links_bold,
1006
+ fonts_subtitle_bold: !!n.fonts_subtitle_bold,
1007
+ fonts_title_bold: !!n.fonts_title_bold
1008
+ };
1009
+ return f(
1010
+ ge(o, [
999
1011
  "widget",
1000
1012
  "colors",
1001
1013
  "borders",
1002
1014
  "fonts",
1003
1015
  "page_background"
1004
1016
  ])
1005
- ) : null;
1017
+ );
1006
1018
  };
1007
1019
  }
1008
1020
  function da(t) {
@@ -1025,7 +1037,7 @@ function ca(t) {
1025
1037
  function ua(t) {
1026
1038
  return async (e, a) => {
1027
1039
  const n = await t.selectFrom("login_sessions").where("login_sessions.id", "=", a).selectAll().executeTakeFirst();
1028
- return n ? Be.parse(
1040
+ return n ? Ue.parse(
1029
1041
  ge(
1030
1042
  f({
1031
1043
  ...n,
@@ -1418,7 +1430,7 @@ const E = g({
1418
1430
  alias: e
1419
1431
  });
1420
1432
  }
1421
- }), B = g({
1433
+ }), U = g({
1422
1434
  is(t) {
1423
1435
  return t.kind === "TableNode";
1424
1436
  },
@@ -2326,7 +2338,7 @@ class Ea extends La {
2326
2338
  const n = super.transformReferences(a);
2327
2339
  return n.table.table.schema ? n : {
2328
2340
  ...n,
2329
- table: B.createWithSchema(c(this, j), n.table.table.identifier.name)
2341
+ table: U.createWithSchema(c(this, j), n.table.table.identifier.name)
2330
2342
  };
2331
2343
  }
2332
2344
  }
@@ -2345,7 +2357,7 @@ j = new WeakMap(), O = new WeakMap(), k = new WeakMap(), p = new WeakSet(), we =
2345
2357
  const n = /* @__PURE__ */ new Set();
2346
2358
  return "with" in a && a.with && u(this, p, Ce).call(this, a.with, n), n;
2347
2359
  }, $ = function(a, n) {
2348
- const o = B.is(a) ? a : za.is(a) && B.is(a.node) ? a.node : null;
2360
+ const o = U.is(a) ? a : za.is(a) && U.is(a.node) ? a.node : null;
2349
2361
  o && u(this, p, G).call(this, o.table, n);
2350
2362
  }, G = function(a, n) {
2351
2363
  const o = a.identifier.name;
@@ -2378,7 +2390,7 @@ class Ra {
2378
2390
  return e.result;
2379
2391
  }
2380
2392
  }
2381
- const Ua = "kysely_migration", fe = "kysely_migration_lock", Ba = !1, Q = "migration_lock", Qa = g({ __noMigrations__: !0 });
2393
+ const Ba = "kysely_migration", fe = "kysely_migration_lock", Ua = !1, Q = "migration_lock", Qa = g({ __noMigrations__: !0 });
2382
2394
  var h, i, A, v, N, D, xe, C, Te, Se, Oe, ke, $e, H, I, X, De, Ie, je, Y, Pe, Me, Fe, Ae, ze, z;
2383
2395
  class be {
2384
2396
  constructor(e) {
@@ -2536,11 +2548,11 @@ h = new WeakMap(), i = new WeakSet(), A = async function(e) {
2536
2548
  }, v = function() {
2537
2549
  return c(this, h).migrationTableSchema;
2538
2550
  }, N = function() {
2539
- return c(this, h).migrationTableName ?? Ua;
2551
+ return c(this, h).migrationTableName ?? Ba;
2540
2552
  }, D = function() {
2541
2553
  return c(this, h).migrationLockTableName ?? fe;
2542
2554
  }, xe = function() {
2543
- return c(this, h).allowUnorderedMigrations ?? Ba;
2555
+ return c(this, h).allowUnorderedMigrations ?? Ua;
2544
2556
  }, C = function() {
2545
2557
  return c(this, i, v) ? new Ka(c(this, i, v)) : new Ra();
2546
2558
  }, Te = async function() {
@@ -2999,19 +3011,19 @@ async function Kn(t) {
2999
3011
  async function Rn(t) {
3000
3012
  await t.schema.dropTable("keys").execute();
3001
3013
  }
3002
- const Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3014
+ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3003
3015
  __proto__: null,
3004
3016
  down: Rn,
3005
3017
  up: Kn
3006
3018
  }, Symbol.toStringTag, { value: "Module" }));
3007
- async function Bn(t) {
3019
+ async function Un(t) {
3008
3020
  }
3009
3021
  async function Qn(t) {
3010
3022
  }
3011
3023
  const qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3012
3024
  __proto__: null,
3013
3025
  down: Qn,
3014
- up: Bn
3026
+ up: Un
3015
3027
  }, Symbol.toStringTag, { value: "Module" }));
3016
3028
  async function Vn(t) {
3017
3029
  }
@@ -3186,12 +3198,12 @@ async function Kr(t) {
3186
3198
  }
3187
3199
  async function Rr(t) {
3188
3200
  }
3189
- const Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3201
+ const Br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3190
3202
  __proto__: null,
3191
3203
  down: Rr,
3192
3204
  up: Kr
3193
3205
  }, Symbol.toStringTag, { value: "Module" }));
3194
- async function Br(t) {
3206
+ async function Ur(t) {
3195
3207
  await t.schema.createTable("authentication_codes").addColumn(
3196
3208
  "tenant_id",
3197
3209
  "varchar(255)",
@@ -3208,7 +3220,7 @@ async function Qr(t) {
3208
3220
  const qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3209
3221
  __proto__: null,
3210
3222
  down: Qr,
3211
- up: Br
3223
+ up: Ur
3212
3224
  }, Symbol.toStringTag, { value: "Module" }));
3213
3225
  async function Vr(t) {
3214
3226
  }
@@ -3412,7 +3424,7 @@ async function Ro(t) {
3412
3424
  "code_type"
3413
3425
  ]).execute();
3414
3426
  }
3415
- async function Uo(t) {
3427
+ async function Bo(t) {
3416
3428
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
3417
3429
  "tenant_id",
3418
3430
  "varchar(255)",
@@ -3425,9 +3437,9 @@ async function Uo(t) {
3425
3437
  (e) => e.onDelete("cascade")
3426
3438
  ).addColumn("code_type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
3427
3439
  }
3428
- const Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3440
+ const Uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3429
3441
  __proto__: null,
3430
- down: Uo,
3442
+ down: Bo,
3431
3443
  up: Ro
3432
3444
  }, Symbol.toStringTag, { value: "Module" }));
3433
3445
  async function Qo(t) {
@@ -3665,7 +3677,7 @@ const Ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3665
3677
  async function Rs(t) {
3666
3678
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
3667
3679
  }
3668
- async function Us(t) {
3680
+ async function Bs(t) {
3669
3681
  await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
3670
3682
  "sessions_user_id_constraint",
3671
3683
  ["user_id", "tenant_id"],
@@ -3684,9 +3696,9 @@ async function Us(t) {
3684
3696
  (e) => e.onDelete("cascade")
3685
3697
  ).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
3686
3698
  }
3687
- const Bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3699
+ const Us = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3688
3700
  __proto__: null,
3689
- down: Us,
3701
+ down: Bs,
3690
3702
  up: Rs
3691
3703
  }, Symbol.toStringTag, { value: "Module" }));
3692
3704
  async function Qs(t) {
@@ -3983,7 +3995,7 @@ async function Ri(t) {
3983
3995
  "borders_button_border_weight",
3984
3996
  "integer",
3985
3997
  (e) => e.notNull()
3986
- ).addColumn("borders_buttons_style", "varchar(24)", (e) => e.notNull()).addColumn("borders_input_border_radius", "integer", (e) => e.notNull()).addColumn("borders_input_border_weight", "integer", (e) => e.notNull()).addColumn("borders_inputs_style", "varchar(24)", (e) => e.notNull()).addColumn("borders_show_widget_shadow", "integer", (e) => e.notNull()).addColumn(
3998
+ ).addColumn("borders_buttons_style", "varchar(24)", (e) => e.notNull()).addColumn("borders_input_border_radius", "integer", (e) => e.notNull()).addColumn("borders_input_border_weight", "integer", (e) => e.notNull()).addColumn("borders_inputs_style", "varchar(24)", (e) => e.notNull()).addColumn("borders_show_widget_shadow", "boolean", (e) => e.notNull()).addColumn(
3987
3999
  "borders_widget_border_weight",
3988
4000
  "integer",
3989
4001
  (e) => e.notNull()
@@ -3991,7 +4003,7 @@ async function Ri(t) {
3991
4003
  "borders_widget_corner_radius",
3992
4004
  "integer",
3993
4005
  (e) => e.notNull()
3994
- ).addColumn("fonts_body_text_bold", "integer", (e) => e.notNull()).addColumn("fonts_body_text_size", "integer", (e) => e.notNull()).addColumn("fonts_buttons_text_bold", "integer", (e) => e.notNull()).addColumn("fonts_buttons_text_size", "integer", (e) => e.notNull()).addColumn("fonts_font_url", "varchar(255)", (e) => e.notNull()).addColumn("fonts_input_labels_bold", "integer", (e) => e.notNull()).addColumn("fonts_input_labels_size", "integer", (e) => e.notNull()).addColumn("fonts_links_bold", "integer", (e) => e.notNull()).addColumn("fonts_links_size", "integer", (e) => e.notNull()).addColumn("fonts_links_style", "varchar(24)", (e) => e.notNull()).addColumn("fonts_reference_text_size", "integer", (e) => e.notNull()).addColumn("fonts_subtitle_bold", "integer", (e) => e.notNull()).addColumn("fonts_subtitle_size", "integer", (e) => e.notNull()).addColumn("fonts_title_bold", "integer", (e) => e.notNull()).addColumn("fonts_title_size", "integer", (e) => e.notNull()).addColumn(
4006
+ ).addColumn("fonts_body_text_bold", "integer", (e) => e.notNull()).addColumn("fonts_body_text_size", "integer", (e) => e.notNull()).addColumn("fonts_buttons_text_bold", "integer", (e) => e.notNull()).addColumn("fonts_buttons_text_size", "integer", (e) => e.notNull()).addColumn("fonts_font_url", "varchar(255)", (e) => e.notNull()).addColumn("fonts_input_labels_bold", "integer", (e) => e.notNull()).addColumn("fonts_input_labels_size", "integer", (e) => e.notNull()).addColumn("fonts_links_bold", "boolean", (e) => e.notNull()).addColumn("fonts_links_size", "integer", (e) => e.notNull()).addColumn("fonts_links_style", "varchar(24)", (e) => e.notNull()).addColumn("fonts_reference_text_size", "integer", (e) => e.notNull()).addColumn("fonts_subtitle_bold", "boolean", (e) => e.notNull()).addColumn("fonts_subtitle_size", "integer", (e) => e.notNull()).addColumn("fonts_title_bold", "boolean", (e) => e.notNull()).addColumn("fonts_title_size", "integer", (e) => e.notNull()).addColumn(
3995
4007
  "page_background_background_color",
3996
4008
  "varchar(24)",
3997
4009
  (e) => e.notNull()
@@ -4013,12 +4025,12 @@ async function Ri(t) {
4013
4025
  (e) => e.notNull()
4014
4026
  ).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("themes_pkey", ["tenant_id", "themeId"]).execute(), await t.schema.createIndex("themes_tenant_id_idx").on("themes").column("tenant_id").execute();
4015
4027
  }
4016
- async function Ui(t) {
4028
+ async function Bi(t) {
4017
4029
  await t.schema.dropTable("themes").execute();
4018
4030
  }
4019
- const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4031
+ const Ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4020
4032
  __proto__: null,
4021
- down: Ui,
4033
+ down: Bi,
4022
4034
  up: Ri
4023
4035
  }, Symbol.toStringTag, { value: "Module" })), Je = {
4024
4036
  m1_init: Wa,
@@ -4037,7 +4049,7 @@ const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4037
4049
  n14_profileDataField: Mn,
4038
4050
  n15_userEmailIndex: zn,
4039
4051
  n16_userLocale: En,
4040
- n17_signingKeys: Un,
4052
+ n17_signingKeys: Bn,
4041
4053
  n18_logsFields: qn,
4042
4054
  n19_connectionsUserinfo: Gn,
4043
4055
  n20_missingFields: Yn,
@@ -4055,7 +4067,7 @@ const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4055
4067
  n32_indexesAndNotNull: Mr,
4056
4068
  n33_vendorIdInUniversalLoginSession: zr,
4057
4069
  n34_auth0ClientInUniversalLoginSession: Er,
4058
- n35_increaseUniversalSessionStateLength: Ur,
4070
+ n35_increaseUniversalSessionStateLength: Br,
4059
4071
  n36_authenticationCodes: qr,
4060
4072
  n37_disableSignUps: Gr,
4061
4073
  n38_otpIpAddress: Yr,
@@ -4073,7 +4085,7 @@ const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4073
4085
  n50_authParamsNonce: Fo,
4074
4086
  n51_connectionid: Lo,
4075
4087
  n52_cert: Ko,
4076
- n53_codes_primary_key: Bo,
4088
+ n53_codes_primary_key: Uo,
4077
4089
  n54_cleanup_tables: Vo,
4078
4090
  n55_logs_index: Ho,
4079
4091
  n56_application_fields: Zo,
@@ -4091,7 +4103,7 @@ const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4091
4103
  n68_login_useragents: Fs,
4092
4104
  n70_refresh_tokens: Ls,
4093
4105
  n71_session_new_fields: Ks,
4094
- n72_session_primary_key: Bs,
4106
+ n72_session_primary_key: Us,
4095
4107
  n73_drop_sessions: Vs,
4096
4108
  n74_custom_domains: Hs,
4097
4109
  n75_organizations: Zs,
@@ -4109,7 +4121,7 @@ const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4109
4121
  n87_code_challenge: Fi,
4110
4122
  n88_add_redirect_uri_to_codes: Li,
4111
4123
  n89_add_nonce_and_state_to_codes: Ki,
4112
- n90_themes: Bi
4124
+ n90_themes: Ui
4113
4125
  };
4114
4126
  async function Gi(t, e = !1) {
4115
4127
  e && console.log("migrating...");
@@ -4147,7 +4159,7 @@ function Xi(t) {
4147
4159
  customDomains: Ht(t),
4148
4160
  forms: Fa(t),
4149
4161
  hooks: oa(t),
4150
- keys: Ut(t),
4162
+ keys: Bt(t),
4151
4163
  loginSessions: fa(t),
4152
4164
  logs: ct(t),
4153
4165
  passwords: vt(t),
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.27.0",
14
+ "version": "10.28.0",
15
15
  "files": [
16
16
  "dist"
17
17
  ],
@@ -38,7 +38,7 @@
38
38
  "typescript": "^5.6.3",
39
39
  "vite": "^5.4.11",
40
40
  "vitest": "^2.1.5",
41
- "@authhero/adapter-interfaces": "0.75.0"
41
+ "@authhero/adapter-interfaces": "0.76.0"
42
42
  },
43
43
  "dependencies": {
44
44
  "kysely": "^0.27.4",
@@ -49,7 +49,7 @@
49
49
  "hono": "^4.6.8",
50
50
  "kysely-bun-sqlite": "^0.3.2",
51
51
  "kysely-planetscale": "^1.5.0",
52
- "@authhero/adapter-interfaces": "0.75.0"
52
+ "@authhero/adapter-interfaces": "0.76.0"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts",