@authhero/kysely-adapter 10.27.0 → 10.29.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) {
@@ -575,7 +575,8 @@ function Ot(t) {
575
575
  const n = {
576
576
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
577
577
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
578
- ...a
578
+ ...a,
579
+ disable_sign_ups: a.disable_sign_ups ?? !1
579
580
  }, o = JSON.stringify(a.allowed_origins), r = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), d = JSON.stringify(a.allowed_logout_urls), l = JSON.stringify(a.allowed_clients);
580
581
  return await t.insertInto("applications").values({
581
582
  ...n,
@@ -730,7 +731,7 @@ function Jt(t) {
730
731
  return {
731
732
  ...a,
732
733
  connections: o.map(
733
- (s) => Ue.parse(
734
+ (s) => Be.parse(
734
735
  f({
735
736
  ...s,
736
737
  options: s.options ? JSON.parse(s.options) : {}
@@ -766,14 +767,14 @@ function Kt(t) {
766
767
  function Rt(t) {
767
768
  return async (e, a) => !!(await t.updateTable("keys").set(a).where("kid", "=", e).execute()).length;
768
769
  }
769
- function Ut(t) {
770
+ function Bt(t) {
770
771
  return {
771
772
  create: Kt(t),
772
773
  list: Et(t),
773
774
  update: Rt(t)
774
775
  };
775
776
  }
776
- function Bt(t) {
777
+ function Ut(t) {
777
778
  return async (e, a) => {
778
779
  const n = {
779
780
  custom_domain_id: S(),
@@ -829,7 +830,7 @@ function Gt(t) {
829
830
  }
830
831
  function Ht(t) {
831
832
  return {
832
- create: Bt(t),
833
+ create: Ut(t),
833
834
  get: Vt(t),
834
835
  getByDomain: Gt(t),
835
836
  list: Qt(t),
@@ -994,15 +995,27 @@ function ia(t) {
994
995
  function la(t) {
995
996
  return async (e, a) => {
996
997
  const n = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.themeId", "=", a).selectAll().executeTakeFirst();
997
- return n ? f(
998
- ge(n, [
998
+ if (!n)
999
+ return null;
1000
+ const o = {
1001
+ ...n,
1002
+ borders_show_widget_shadow: !!n.borders_show_widget_shadow,
1003
+ fonts_body_text_bold: !!n.fonts_body_text_bold,
1004
+ fonts_buttons_text_bold: !!n.fonts_buttons_text_bold,
1005
+ fonts_input_labels_bold: !!n.fonts_input_labels_bold,
1006
+ fonts_links_bold: !!n.fonts_links_bold,
1007
+ fonts_subtitle_bold: !!n.fonts_subtitle_bold,
1008
+ fonts_title_bold: !!n.fonts_title_bold
1009
+ };
1010
+ return f(
1011
+ ge(o, [
999
1012
  "widget",
1000
1013
  "colors",
1001
1014
  "borders",
1002
1015
  "fonts",
1003
1016
  "page_background"
1004
1017
  ])
1005
- ) : null;
1018
+ );
1006
1019
  };
1007
1020
  }
1008
1021
  function da(t) {
@@ -1025,7 +1038,7 @@ function ca(t) {
1025
1038
  function ua(t) {
1026
1039
  return async (e, a) => {
1027
1040
  const n = await t.selectFrom("login_sessions").where("login_sessions.id", "=", a).selectAll().executeTakeFirst();
1028
- return n ? Be.parse(
1041
+ return n ? Ue.parse(
1029
1042
  ge(
1030
1043
  f({
1031
1044
  ...n,
@@ -1418,7 +1431,7 @@ const E = g({
1418
1431
  alias: e
1419
1432
  });
1420
1433
  }
1421
- }), B = g({
1434
+ }), U = g({
1422
1435
  is(t) {
1423
1436
  return t.kind === "TableNode";
1424
1437
  },
@@ -2326,7 +2339,7 @@ class Ea extends La {
2326
2339
  const n = super.transformReferences(a);
2327
2340
  return n.table.table.schema ? n : {
2328
2341
  ...n,
2329
- table: B.createWithSchema(c(this, j), n.table.table.identifier.name)
2342
+ table: U.createWithSchema(c(this, j), n.table.table.identifier.name)
2330
2343
  };
2331
2344
  }
2332
2345
  }
@@ -2345,7 +2358,7 @@ j = new WeakMap(), O = new WeakMap(), k = new WeakMap(), p = new WeakSet(), we =
2345
2358
  const n = /* @__PURE__ */ new Set();
2346
2359
  return "with" in a && a.with && u(this, p, Ce).call(this, a.with, n), n;
2347
2360
  }, $ = function(a, n) {
2348
- const o = B.is(a) ? a : za.is(a) && B.is(a.node) ? a.node : null;
2361
+ const o = U.is(a) ? a : za.is(a) && U.is(a.node) ? a.node : null;
2349
2362
  o && u(this, p, G).call(this, o.table, n);
2350
2363
  }, G = function(a, n) {
2351
2364
  const o = a.identifier.name;
@@ -2378,7 +2391,7 @@ class Ra {
2378
2391
  return e.result;
2379
2392
  }
2380
2393
  }
2381
- const Ua = "kysely_migration", fe = "kysely_migration_lock", Ba = !1, Q = "migration_lock", Qa = g({ __noMigrations__: !0 });
2394
+ const Ba = "kysely_migration", fe = "kysely_migration_lock", Ua = !1, Q = "migration_lock", Qa = g({ __noMigrations__: !0 });
2382
2395
  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
2396
  class be {
2384
2397
  constructor(e) {
@@ -2536,11 +2549,11 @@ h = new WeakMap(), i = new WeakSet(), A = async function(e) {
2536
2549
  }, v = function() {
2537
2550
  return c(this, h).migrationTableSchema;
2538
2551
  }, N = function() {
2539
- return c(this, h).migrationTableName ?? Ua;
2552
+ return c(this, h).migrationTableName ?? Ba;
2540
2553
  }, D = function() {
2541
2554
  return c(this, h).migrationLockTableName ?? fe;
2542
2555
  }, xe = function() {
2543
- return c(this, h).allowUnorderedMigrations ?? Ba;
2556
+ return c(this, h).allowUnorderedMigrations ?? Ua;
2544
2557
  }, C = function() {
2545
2558
  return c(this, i, v) ? new Ka(c(this, i, v)) : new Ra();
2546
2559
  }, Te = async function() {
@@ -2999,19 +3012,19 @@ async function Kn(t) {
2999
3012
  async function Rn(t) {
3000
3013
  await t.schema.dropTable("keys").execute();
3001
3014
  }
3002
- const Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3015
+ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3003
3016
  __proto__: null,
3004
3017
  down: Rn,
3005
3018
  up: Kn
3006
3019
  }, Symbol.toStringTag, { value: "Module" }));
3007
- async function Bn(t) {
3020
+ async function Un(t) {
3008
3021
  }
3009
3022
  async function Qn(t) {
3010
3023
  }
3011
3024
  const qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3012
3025
  __proto__: null,
3013
3026
  down: Qn,
3014
- up: Bn
3027
+ up: Un
3015
3028
  }, Symbol.toStringTag, { value: "Module" }));
3016
3029
  async function Vn(t) {
3017
3030
  }
@@ -3186,12 +3199,12 @@ async function Kr(t) {
3186
3199
  }
3187
3200
  async function Rr(t) {
3188
3201
  }
3189
- const Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3202
+ const Br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3190
3203
  __proto__: null,
3191
3204
  down: Rr,
3192
3205
  up: Kr
3193
3206
  }, Symbol.toStringTag, { value: "Module" }));
3194
- async function Br(t) {
3207
+ async function Ur(t) {
3195
3208
  await t.schema.createTable("authentication_codes").addColumn(
3196
3209
  "tenant_id",
3197
3210
  "varchar(255)",
@@ -3208,7 +3221,7 @@ async function Qr(t) {
3208
3221
  const qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3209
3222
  __proto__: null,
3210
3223
  down: Qr,
3211
- up: Br
3224
+ up: Ur
3212
3225
  }, Symbol.toStringTag, { value: "Module" }));
3213
3226
  async function Vr(t) {
3214
3227
  }
@@ -3412,7 +3425,7 @@ async function Ro(t) {
3412
3425
  "code_type"
3413
3426
  ]).execute();
3414
3427
  }
3415
- async function Uo(t) {
3428
+ async function Bo(t) {
3416
3429
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
3417
3430
  "tenant_id",
3418
3431
  "varchar(255)",
@@ -3425,9 +3438,9 @@ async function Uo(t) {
3425
3438
  (e) => e.onDelete("cascade")
3426
3439
  ).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
3440
  }
3428
- const Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3441
+ const Uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3429
3442
  __proto__: null,
3430
- down: Uo,
3443
+ down: Bo,
3431
3444
  up: Ro
3432
3445
  }, Symbol.toStringTag, { value: "Module" }));
3433
3446
  async function Qo(t) {
@@ -3665,7 +3678,7 @@ const Ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3665
3678
  async function Rs(t) {
3666
3679
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
3667
3680
  }
3668
- async function Us(t) {
3681
+ async function Bs(t) {
3669
3682
  await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
3670
3683
  "sessions_user_id_constraint",
3671
3684
  ["user_id", "tenant_id"],
@@ -3684,9 +3697,9 @@ async function Us(t) {
3684
3697
  (e) => e.onDelete("cascade")
3685
3698
  ).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
3699
  }
3687
- const Bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3700
+ const Us = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3688
3701
  __proto__: null,
3689
- down: Us,
3702
+ down: Bs,
3690
3703
  up: Rs
3691
3704
  }, Symbol.toStringTag, { value: "Module" }));
3692
3705
  async function Qs(t) {
@@ -3983,7 +3996,7 @@ async function Ri(t) {
3983
3996
  "borders_button_border_weight",
3984
3997
  "integer",
3985
3998
  (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(
3999
+ ).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
4000
  "borders_widget_border_weight",
3988
4001
  "integer",
3989
4002
  (e) => e.notNull()
@@ -3991,7 +4004,7 @@ async function Ri(t) {
3991
4004
  "borders_widget_corner_radius",
3992
4005
  "integer",
3993
4006
  (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(
4007
+ ).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
4008
  "page_background_background_color",
3996
4009
  "varchar(24)",
3997
4010
  (e) => e.notNull()
@@ -4013,12 +4026,12 @@ async function Ri(t) {
4013
4026
  (e) => e.notNull()
4014
4027
  ).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
4028
  }
4016
- async function Ui(t) {
4029
+ async function Bi(t) {
4017
4030
  await t.schema.dropTable("themes").execute();
4018
4031
  }
4019
- const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4032
+ const Ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4020
4033
  __proto__: null,
4021
- down: Ui,
4034
+ down: Bi,
4022
4035
  up: Ri
4023
4036
  }, Symbol.toStringTag, { value: "Module" })), Je = {
4024
4037
  m1_init: Wa,
@@ -4037,7 +4050,7 @@ const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4037
4050
  n14_profileDataField: Mn,
4038
4051
  n15_userEmailIndex: zn,
4039
4052
  n16_userLocale: En,
4040
- n17_signingKeys: Un,
4053
+ n17_signingKeys: Bn,
4041
4054
  n18_logsFields: qn,
4042
4055
  n19_connectionsUserinfo: Gn,
4043
4056
  n20_missingFields: Yn,
@@ -4055,7 +4068,7 @@ const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4055
4068
  n32_indexesAndNotNull: Mr,
4056
4069
  n33_vendorIdInUniversalLoginSession: zr,
4057
4070
  n34_auth0ClientInUniversalLoginSession: Er,
4058
- n35_increaseUniversalSessionStateLength: Ur,
4071
+ n35_increaseUniversalSessionStateLength: Br,
4059
4072
  n36_authenticationCodes: qr,
4060
4073
  n37_disableSignUps: Gr,
4061
4074
  n38_otpIpAddress: Yr,
@@ -4073,7 +4086,7 @@ const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4073
4086
  n50_authParamsNonce: Fo,
4074
4087
  n51_connectionid: Lo,
4075
4088
  n52_cert: Ko,
4076
- n53_codes_primary_key: Bo,
4089
+ n53_codes_primary_key: Uo,
4077
4090
  n54_cleanup_tables: Vo,
4078
4091
  n55_logs_index: Ho,
4079
4092
  n56_application_fields: Zo,
@@ -4091,7 +4104,7 @@ const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4091
4104
  n68_login_useragents: Fs,
4092
4105
  n70_refresh_tokens: Ls,
4093
4106
  n71_session_new_fields: Ks,
4094
- n72_session_primary_key: Bs,
4107
+ n72_session_primary_key: Us,
4095
4108
  n73_drop_sessions: Vs,
4096
4109
  n74_custom_domains: Hs,
4097
4110
  n75_organizations: Zs,
@@ -4109,7 +4122,7 @@ const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4109
4122
  n87_code_challenge: Fi,
4110
4123
  n88_add_redirect_uri_to_codes: Li,
4111
4124
  n89_add_nonce_and_state_to_codes: Ki,
4112
- n90_themes: Bi
4125
+ n90_themes: Ui
4113
4126
  };
4114
4127
  async function Gi(t, e = !1) {
4115
4128
  e && console.log("migrating...");
@@ -4147,7 +4160,7 @@ function Xi(t) {
4147
4160
  customDomains: Ht(t),
4148
4161
  forms: Fa(t),
4149
4162
  hooks: oa(t),
4150
- keys: Ut(t),
4163
+ keys: Bt(t),
4151
4164
  loginSessions: fa(t),
4152
4165
  logs: ct(t),
4153
4166
  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.29.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.77.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.77.0"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts",