@authhero/drizzle 0.53.3 → 0.53.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.
@@ -1931,7 +1931,7 @@ function wn(e) {
1931
1931
  };
1932
1932
  }
1933
1933
  //#endregion
1934
- //#region ../../node_modules/.pnpm/hono@4.12.24/node_modules/hono/dist/http-exception.js
1934
+ //#region ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/http-exception.js
1935
1935
  var Tn = class extends Error {
1936
1936
  res;
1937
1937
  status;
@@ -13595,7 +13595,7 @@ var g_ = /* @__PURE__ */ a({
13595
13595
  xor: () => Vh
13596
13596
  });
13597
13597
  //#endregion
13598
- //#region ../../node_modules/.pnpm/@hono+zod-openapi@1.4.0_hono@4.12.24_zod@4.4.3/node_modules/@hono/zod-openapi/dist/index.js
13598
+ //#region ../../node_modules/.pnpm/@hono+zod-openapi@1.4.0_hono@4.12.25_zod@4.4.3/node_modules/@hono/zod-openapi/dist/index.js
13599
13599
  dr(Hc()), rr(g_);
13600
13600
  //#endregion
13601
13601
  //#region ../adapter-interfaces/dist/adapter-interfaces.mjs
@@ -14449,8 +14449,7 @@ var mv = J({
14449
14449
  name: Z("http"),
14450
14450
  http_body: H(),
14451
14451
  http_url: H()
14452
- })]);
14453
- mv.extend({
14452
+ })]), gv = mv.extend({
14454
14453
  custom_domain_id: H(),
14455
14454
  primary: G(),
14456
14455
  status: X([
@@ -14462,21 +14461,26 @@ mv.extend({
14462
14461
  origin_domain_name: H().optional(),
14463
14462
  verification: J({ methods: q(hv) }).optional(),
14464
14463
  tls_policy: H().optional()
14465
- }).extend({ tenant_id: H() }), J({
14464
+ });
14465
+ mv.pick({
14466
+ tls_policy: !0,
14467
+ custom_client_ip_header: !0,
14468
+ domain_metadata: !0
14469
+ }).strict(), gv.extend({ tenant_id: H() }), J({
14466
14470
  certificate: H().regex(/^-----BEGIN CERTIFICATE-----[\s\S]+-----END CERTIFICATE-----\s*$/, "must be PEM-encoded; include the full certificate chain in leaf-first order"),
14467
14471
  private_key: H().regex(/-----BEGIN (RSA |EC |ENCRYPTED )?PRIVATE KEY-----[\s\S]+-----END \1PRIVATE KEY-----\s*$/, "must be a PEM-encoded private key")
14468
14472
  });
14469
- var gv = J({
14473
+ var _v = J({
14470
14474
  id: H(),
14471
14475
  order: W().optional(),
14472
14476
  visible: G().optional().default(!0)
14473
- }), _v = gv.extend({ category: Z("BLOCK").optional() }), vv = _v.extend({
14477
+ }), vv = _v.extend({ category: Z("BLOCK").optional() }), yv = vv.extend({
14474
14478
  type: Z("DIVIDER"),
14475
14479
  config: J({ text: H().optional() }).optional()
14476
- }), yv = _v.extend({
14480
+ }), bv = vv.extend({
14477
14481
  type: Z("HTML"),
14478
14482
  config: J({ content: H().optional() }).optional()
14479
- }), bv = _v.extend({
14483
+ }), xv = vv.extend({
14480
14484
  type: Z("IMAGE"),
14481
14485
  config: J({
14482
14486
  src: H().optional(),
@@ -14484,43 +14488,43 @@ var gv = J({
14484
14488
  width: W().optional(),
14485
14489
  height: W().optional()
14486
14490
  }).optional()
14487
- }), xv = _v.extend({
14491
+ }), Sv = vv.extend({
14488
14492
  type: Z("JUMP_BUTTON"),
14489
14493
  config: J({
14490
14494
  text: H().optional(),
14491
14495
  target_step: H().optional()
14492
14496
  })
14493
- }), Sv = _v.extend({
14497
+ }), Cv = vv.extend({
14494
14498
  type: Z("RESEND_BUTTON"),
14495
14499
  config: J({
14496
14500
  text: H().optional(),
14497
14501
  resend_action: H().optional()
14498
14502
  })
14499
- }), Cv = _v.extend({
14503
+ }), wv = vv.extend({
14500
14504
  type: Z("NEXT_BUTTON"),
14501
14505
  config: J({ text: H().optional() })
14502
- }), wv = _v.extend({
14506
+ }), Tv = vv.extend({
14503
14507
  type: Z("PREVIOUS_BUTTON"),
14504
14508
  config: J({ text: H().optional() })
14505
- }), Tv = _v.extend({
14509
+ }), Ev = vv.extend({
14506
14510
  type: Z("RICH_TEXT"),
14507
14511
  config: J({ content: H().optional() }).optional()
14508
- }), Ev = gv.extend({
14512
+ }), Dv = _v.extend({
14509
14513
  category: Z("WIDGET").optional(),
14510
14514
  label: H().min(1).optional(),
14511
14515
  hint: H().min(1).max(500).optional(),
14512
14516
  required: G().optional(),
14513
14517
  sensitive: G().optional()
14514
- }), Dv = Ev.extend({
14518
+ }), Ov = Dv.extend({
14515
14519
  type: Z("AUTH0_VERIFIABLE_CREDENTIALS"),
14516
14520
  config: J({ credential_type: H().optional() })
14517
- }), Ov = Ev.extend({
14521
+ }), kv = Dv.extend({
14518
14522
  type: Z("GMAPS_ADDRESS"),
14519
14523
  config: J({ api_key: H().optional() })
14520
- }), kv = Ev.extend({
14524
+ }), Av = Dv.extend({
14521
14525
  type: Z("RECAPTCHA"),
14522
14526
  config: J({ site_key: H().optional() })
14523
- }), Av = gv.extend({
14527
+ }), jv = _v.extend({
14524
14528
  category: Z("FIELD").optional(),
14525
14529
  label: H().min(1).optional(),
14526
14530
  hint: H().min(1).max(500).optional(),
@@ -14536,10 +14540,10 @@ var gv = J({
14536
14540
  })).optional(),
14537
14541
  required: G().optional(),
14538
14542
  sensitive: G().optional()
14539
- }), jv = Av.extend({
14543
+ }), Mv = jv.extend({
14540
14544
  type: Z("BOOLEAN"),
14541
14545
  config: J({ default_value: G().optional() }).optional()
14542
- }), Mv = Av.extend({
14546
+ }), Nv = jv.extend({
14543
14547
  type: Z("CARDS"),
14544
14548
  config: J({
14545
14549
  options: q(J({
@@ -14550,7 +14554,7 @@ var gv = J({
14550
14554
  })).optional(),
14551
14555
  multi_select: G().optional()
14552
14556
  }).optional()
14553
- }), Nv = Av.extend({
14557
+ }), Pv = jv.extend({
14554
14558
  type: Z("CHOICE"),
14555
14559
  config: J({
14556
14560
  options: q(J({
@@ -14561,7 +14565,7 @@ var gv = J({
14561
14565
  multiple: G().optional(),
14562
14566
  default_value: zh([H(), q(H())]).optional()
14563
14567
  }).optional()
14564
- }), Pv = Av.extend({
14568
+ }), Fv = jv.extend({
14565
14569
  type: Z("CUSTOM"),
14566
14570
  config: J({
14567
14571
  component: H().optional(),
@@ -14569,7 +14573,7 @@ var gv = J({
14569
14573
  schema: Y(H(), K()).optional(),
14570
14574
  code: H().optional()
14571
14575
  })
14572
- }), Fv = Av.extend({
14576
+ }), Iv = jv.extend({
14573
14577
  type: Z("DATE"),
14574
14578
  config: J({
14575
14579
  format: H().optional(),
@@ -14577,7 +14581,7 @@ var gv = J({
14577
14581
  max: H().optional(),
14578
14582
  default_value: H().optional()
14579
14583
  }).optional()
14580
- }), Iv = Av.extend({
14584
+ }), Lv = jv.extend({
14581
14585
  type: Z("DROPDOWN"),
14582
14586
  config: J({
14583
14587
  options: q(J({
@@ -14589,26 +14593,26 @@ var gv = J({
14589
14593
  multiple: G().optional(),
14590
14594
  default_value: zh([H(), q(H())]).optional()
14591
14595
  }).optional()
14592
- }), Lv = Av.extend({
14596
+ }), Rv = jv.extend({
14593
14597
  type: Z("EMAIL"),
14594
14598
  config: J({
14595
14599
  placeholder: H().optional(),
14596
14600
  default_value: H().optional()
14597
14601
  }).optional()
14598
- }), Rv = Av.extend({
14602
+ }), zv = jv.extend({
14599
14603
  type: Z("FILE"),
14600
14604
  config: J({
14601
14605
  accept: H().optional(),
14602
14606
  max_size: W().optional(),
14603
14607
  multiple: G().optional()
14604
14608
  }).optional()
14605
- }), zv = Av.extend({
14609
+ }), Bv = jv.extend({
14606
14610
  type: Z("LEGAL"),
14607
14611
  config: J({
14608
14612
  text: H(),
14609
14613
  html: G().optional()
14610
14614
  }).optional()
14611
- }), Bv = Av.extend({
14615
+ }), Vv = jv.extend({
14612
14616
  type: Z("NUMBER"),
14613
14617
  config: J({
14614
14618
  placeholder: H().optional(),
@@ -14617,7 +14621,7 @@ var gv = J({
14617
14621
  step: W().optional(),
14618
14622
  default_value: H().optional()
14619
14623
  }).optional()
14620
- }), Vv = Av.extend({
14624
+ }), Hv = jv.extend({
14621
14625
  type: Z("PASSWORD"),
14622
14626
  config: J({
14623
14627
  placeholder: H().optional(),
@@ -14626,13 +14630,13 @@ var gv = J({
14626
14630
  forgot_password_link: H().optional(),
14627
14631
  default_value: H().optional()
14628
14632
  }).optional()
14629
- }), Hv = Av.extend({
14633
+ }), Uv = jv.extend({
14630
14634
  type: Z("PAYMENT"),
14631
14635
  config: J({
14632
14636
  provider: H().optional(),
14633
14637
  currency: H().optional()
14634
14638
  }).optional()
14635
- }), Uv = Av.extend({
14639
+ }), Wv = jv.extend({
14636
14640
  type: Z("SOCIAL"),
14637
14641
  config: J({
14638
14642
  providers: q(H()).optional(),
@@ -14644,7 +14648,7 @@ var gv = J({
14644
14648
  href: H().optional()
14645
14649
  })).optional()
14646
14650
  }).optional()
14647
- }), Wv = Av.extend({
14651
+ }), Gv = jv.extend({
14648
14652
  type: Z("TEL"),
14649
14653
  config: J({
14650
14654
  placeholder: H().optional(),
@@ -14652,7 +14656,7 @@ var gv = J({
14652
14656
  default_value: H().optional(),
14653
14657
  allow_email: G().optional()
14654
14658
  }).optional()
14655
- }), Gv = Av.extend({
14659
+ }), Kv = jv.extend({
14656
14660
  type: Z("TEXT"),
14657
14661
  config: J({
14658
14662
  placeholder: H().optional(),
@@ -14660,40 +14664,39 @@ var gv = J({
14660
14664
  max_length: W().optional(),
14661
14665
  default_value: H().optional()
14662
14666
  }).optional()
14663
- }), Kv = Av.extend({
14667
+ }), qv = jv.extend({
14664
14668
  type: Z("COUNTRY"),
14665
14669
  config: J({
14666
14670
  placeholder: H().optional(),
14667
14671
  default_value: H().optional()
14668
14672
  }).optional()
14669
- }), qv = Av.extend({
14673
+ }), Jv = jv.extend({
14670
14674
  type: Z("URL"),
14671
14675
  config: J({
14672
14676
  placeholder: H().optional(),
14673
14677
  default_value: H().optional()
14674
14678
  }).optional()
14675
- }), Jv = zh([
14679
+ }), Yv = zh([
14676
14680
  Uh("type", [
14677
- vv,
14678
14681
  yv,
14679
14682
  bv,
14680
14683
  xv,
14681
14684
  Sv,
14682
14685
  Cv,
14683
14686
  wv,
14684
- Tv
14687
+ Tv,
14688
+ Ev
14685
14689
  ]),
14686
14690
  Uh("type", [
14687
- Dv,
14688
14691
  Ov,
14689
- kv
14692
+ kv,
14693
+ Av
14690
14694
  ]),
14691
14695
  Uh("type", [
14692
- jv,
14693
14696
  Mv,
14694
14697
  Nv,
14695
- Kv,
14696
14698
  Pv,
14699
+ qv,
14697
14700
  Fv,
14698
14701
  Iv,
14699
14702
  Lv,
@@ -14705,7 +14708,8 @@ var gv = J({
14705
14708
  Uv,
14706
14709
  Wv,
14707
14710
  Gv,
14708
- qv
14711
+ Kv,
14712
+ Jv
14709
14713
  ])
14710
14714
  ]);
14711
14715
  new Set([
@@ -14732,14 +14736,14 @@ new Set([
14732
14736
  visible: G().optional().default(!0),
14733
14737
  customizations: Y(H(), K()).optional()
14734
14738
  });
14735
- var Yv = J({
14739
+ var Xv = J({
14736
14740
  x: W(),
14737
14741
  y: W()
14738
- }), Xv = Uh("type", [
14742
+ }), Zv = Uh("type", [
14739
14743
  J({
14740
14744
  id: H(),
14741
14745
  type: Z("FLOW"),
14742
- coordinates: Yv,
14746
+ coordinates: Xv,
14743
14747
  alias: H().min(1).max(150).optional(),
14744
14748
  config: J({
14745
14749
  flow_id: H().max(30),
@@ -14749,7 +14753,7 @@ var Yv = J({
14749
14753
  J({
14750
14754
  id: H(),
14751
14755
  type: Z("ROUTER"),
14752
- coordinates: Yv,
14756
+ coordinates: Xv,
14753
14757
  alias: H().min(1).max(150),
14754
14758
  config: J({
14755
14759
  rules: q(J({
@@ -14764,14 +14768,14 @@ var Yv = J({
14764
14768
  J({
14765
14769
  id: H(),
14766
14770
  type: Z("STEP"),
14767
- coordinates: Yv,
14771
+ coordinates: Xv,
14768
14772
  alias: H().min(1).max(150).optional(),
14769
14773
  config: J({
14770
- components: q(Jv),
14774
+ components: q(Yv),
14771
14775
  next_node: H().optional()
14772
14776
  })
14773
14777
  })
14774
- ]), Zv = J({
14778
+ ]), Qv = J({
14775
14779
  name: H().openapi({ description: "The name of the form" }),
14776
14780
  messages: J({
14777
14781
  errors: Y(H(), K()).optional(),
@@ -14782,14 +14786,14 @@ var Yv = J({
14782
14786
  default: H().optional()
14783
14787
  }).optional(),
14784
14788
  translations: Y(H(), K()).optional(),
14785
- nodes: q(Xv).optional(),
14789
+ nodes: q(Zv).optional(),
14786
14790
  start: J({
14787
14791
  hidden_fields: q(J({
14788
14792
  key: H(),
14789
14793
  value: H()
14790
14794
  })).optional(),
14791
14795
  next_node: H().optional(),
14792
- coordinates: Yv.optional()
14796
+ coordinates: Xv.optional()
14793
14797
  }).optional(),
14794
14798
  ending: J({
14795
14799
  redirection: J({
@@ -14797,7 +14801,7 @@ var Yv = J({
14797
14801
  target: H().optional()
14798
14802
  }).optional(),
14799
14803
  after_submit: J({ flow_id: H().optional() }).optional(),
14800
- coordinates: Yv.optional(),
14804
+ coordinates: Xv.optional(),
14801
14805
  resume_flow: G().optional()
14802
14806
  }).optional(),
14803
14807
  style: J({ css: H().optional() }).optional(),
@@ -14806,8 +14810,8 @@ var Yv = J({
14806
14810
  sdk_src: H().optional()
14807
14811
  }).optional()
14808
14812
  }).openapi({ description: "Schema for flow-based forms (matches Auth0 Forms structure)" });
14809
- __.extend(Zv.shape).extend({ id: H() });
14810
- var Qv = J({
14813
+ __.extend(Qv.shape).extend({ id: H() });
14814
+ var $v = J({
14811
14815
  id: W().optional(),
14812
14816
  text: H(),
14813
14817
  type: X([
@@ -14816,7 +14820,7 @@ var Qv = J({
14816
14820
  "success",
14817
14821
  "warning"
14818
14822
  ])
14819
- }), $v = J({
14823
+ }), ey = J({
14820
14824
  id: H().optional(),
14821
14825
  text: H(),
14822
14826
  href: H(),
@@ -14828,12 +14832,12 @@ J({
14828
14832
  method: X(["POST", "GET"]),
14829
14833
  title: H().optional(),
14830
14834
  description: H().optional(),
14831
- components: q(Jv),
14832
- messages: q(Qv).optional(),
14833
- links: q($v).optional(),
14835
+ components: q(Yv),
14836
+ messages: q($v).optional(),
14837
+ links: q(ey).optional(),
14834
14838
  footer: H().optional()
14835
14839
  });
14836
- var ey = X([
14840
+ var ty = X([
14837
14841
  "pre-user-registration",
14838
14842
  "post-user-registration",
14839
14843
  "post-user-login",
@@ -14841,28 +14845,28 @@ var ey = X([
14841
14845
  "validate-registration-username",
14842
14846
  "pre-user-deletion",
14843
14847
  "post-user-deletion"
14844
- ]), ty = X([
14848
+ ]), ny = X([
14845
14849
  "pre-user-registration",
14846
14850
  "post-user-registration",
14847
14851
  "post-user-login",
14848
14852
  "validate-registration-username",
14849
14853
  "pre-user-deletion",
14850
14854
  "post-user-deletion"
14851
- ]), ny = X([
14855
+ ]), ry = X([
14852
14856
  "post-user-login",
14853
14857
  "post-user-registration",
14854
14858
  "post-user-update",
14855
14859
  "credentials-exchange"
14856
- ]), ry = X([
14860
+ ]), iy = X([
14857
14861
  "post-user-login",
14858
14862
  "credentials-exchange",
14859
14863
  "pre-user-registration",
14860
14864
  "post-user-registration"
14861
- ]), iy = X([
14865
+ ]), ay = X([
14862
14866
  "ensure-username",
14863
14867
  "set-preferred-username",
14864
14868
  "account-linking"
14865
- ]), ay = {
14869
+ ]), oy = {
14866
14870
  enabled: G().default(!1),
14867
14871
  synchronous: G().default(!1),
14868
14872
  priority: W().optional(),
@@ -14871,50 +14875,50 @@ var ey = X([
14871
14875
  };
14872
14876
  zh([
14873
14877
  J({
14874
- ...ay,
14875
- trigger_id: ey,
14878
+ ...oy,
14879
+ trigger_id: ty,
14876
14880
  url: H()
14877
14881
  }),
14878
14882
  J({
14879
- ...ay,
14880
- trigger_id: ty,
14883
+ ...oy,
14884
+ trigger_id: ny,
14881
14885
  form_id: H()
14882
14886
  }),
14883
14887
  J({
14884
- ...ay,
14885
- trigger_id: ny,
14886
- template_id: iy
14888
+ ...oy,
14889
+ trigger_id: ry,
14890
+ template_id: ay
14887
14891
  }),
14888
14892
  J({
14889
- ...ay,
14890
- trigger_id: ry,
14893
+ ...oy,
14894
+ trigger_id: iy,
14891
14895
  code_id: H()
14892
14896
  })
14893
14897
  ]), zh([
14894
14898
  J({
14895
- ...ay,
14896
- trigger_id: ey
14899
+ ...oy,
14900
+ trigger_id: ty
14897
14901
  }).extend(__.shape).extend({
14898
14902
  hook_id: H(),
14899
14903
  url: H()
14900
14904
  }),
14901
14905
  J({
14902
- ...ay,
14903
- trigger_id: ty
14906
+ ...oy,
14907
+ trigger_id: ny
14904
14908
  }).extend(__.shape).extend({
14905
14909
  hook_id: H(),
14906
14910
  form_id: H()
14907
14911
  }),
14908
14912
  J({
14909
- ...ay,
14910
- trigger_id: ny
14913
+ ...oy,
14914
+ trigger_id: ry
14911
14915
  }).extend(__.shape).extend({
14912
14916
  hook_id: H(),
14913
- template_id: iy
14917
+ template_id: ay
14914
14918
  }),
14915
14919
  J({
14916
- ...ay,
14917
- trigger_id: ry
14920
+ ...oy,
14921
+ trigger_id: iy
14918
14922
  }).extend(__.shape).extend({
14919
14923
  hook_id: H(),
14920
14924
  code_id: H()
@@ -14926,11 +14930,11 @@ zh([
14926
14930
  id: H(),
14927
14931
  tenant_id: H()
14928
14932
  }).extend(__.shape);
14929
- var oy = J({ name: H().optional() }), sy = J({ email: H().optional() }), cy = J({
14933
+ var sy = J({ name: H().optional() }), cy = J({ email: H().optional() }), ly = J({
14930
14934
  id: H().optional(),
14931
14935
  organization_id: H().max(50),
14932
- inviter: oy,
14933
- invitee: sy,
14936
+ inviter: sy,
14937
+ invitee: cy,
14934
14938
  invitation_url: H().url(),
14935
14939
  client_id: H(),
14936
14940
  connection_id: H().optional(),
@@ -14946,7 +14950,7 @@ J({
14946
14950
  created_at: H().datetime(),
14947
14951
  expires_at: H().datetime(),
14948
14952
  ticket_id: H().optional()
14949
- }).extend(cy.omit({ id: !0 }).shape), J({ keys: q(J({
14953
+ }).extend(ly.omit({ id: !0 }).shape), J({ keys: q(J({
14950
14954
  alg: X([
14951
14955
  "RS256",
14952
14956
  "RS384",
@@ -15012,9 +15016,9 @@ J({
15012
15016
  token_endpoint_auth_signing_alg_values_supported: q(H()),
15013
15017
  client_id_metadata_document_supported: G().optional()
15014
15018
  });
15015
- var ly = ng(/* @__PURE__ */ function(e) {
15019
+ var uy = ng(/* @__PURE__ */ function(e) {
15016
15020
  return e.PENDING = "pending", e.AUTHENTICATED = "authenticated", e.AWAITING_EMAIL_VERIFICATION = "awaiting_email_verification", e.AWAITING_MFA = "awaiting_mfa", e.AWAITING_HOOK = "awaiting_hook", e.AWAITING_CONTINUATION = "awaiting_continuation", e.AWAITING_CONSENT = "awaiting_consent", e.COMPLETED = "completed", e.FAILED = "failed", e.EXPIRED = "expired", e;
15017
- }({})), uy = J({
15021
+ }({})), dy = J({
15018
15022
  strategy: H(),
15019
15023
  strategy_type: H()
15020
15024
  });
@@ -15028,12 +15032,12 @@ J({
15028
15032
  useragent: H().optional(),
15029
15033
  session_id: H().optional(),
15030
15034
  authorization_url: H().optional(),
15031
- state: ly.optional().default("pending"),
15035
+ state: uy.optional().default("pending"),
15032
15036
  state_data: H().optional(),
15033
15037
  failure_reason: H().optional(),
15034
15038
  user_id: H().optional(),
15035
15039
  auth_connection: H().optional(),
15036
- auth_strategy: uy.optional(),
15040
+ auth_strategy: dy.optional(),
15037
15041
  authenticated_at: H().optional()
15038
15042
  }).openapi({ description: "This represents a login sesion" }).extend({
15039
15043
  id: H().openapi({ description: "This is is used as the state in the universal login" }),
@@ -15200,17 +15204,17 @@ var $ = {
15200
15204
  WARNING_DURING_LOGIN: "w",
15201
15205
  WARNING_SENDING_NOTIFICATION: "wn",
15202
15206
  WARNING_USER_MANAGEMENT: "wum"
15203
- }, dy = H().refine((e) => Object.values($).includes(e), { message: "Invalid log type" });
15207
+ }, fy = H().refine((e) => Object.values($).includes(e), { message: "Invalid log type" });
15204
15208
  $.ACLS_SUMMARY, $.ACTIONS_EXECUTION_FAILED, $.API_LIMIT, $.API_LIMIT_WARNING, $.APPI, $.CIBA_EXCHANGE_FAILED, $.CIBA_EXCHANGE_SUCCEEDED, $.CIBA_START_FAILED, $.CIBA_START_SUCCEEDED, $.CODE_LINK_SENT, $.CODE_SENT, $.DEPRECATION_NOTICE, $.FAILED_LOGIN, $.FAILED_BY_CONNECTOR, $.FAILED_CHANGE_EMAIL, $.FAILED_BY_CORS, $.FAILED_CROSS_ORIGIN_AUTHENTICATION, $.FAILED_CHANGE_PASSWORD, $.FAILED_POST_CHANGE_PASSWORD_HOOK, $.FAILED_CHANGE_PHONE_NUMBER, $.FAILED_CHANGE_PASSWORD_REQUEST, $.FAILED_CONNECTOR_PROVISIONING, $.FAILED_CHANGE_USERNAME, $.FAILED_DELEGATION, $.FAILED_DEVICE_ACTIVATION, $.FAILED_DEVICE_AUTHORIZATION_REQUEST, $.USER_CANCELED_DEVICE_CONFIRMATION, $.FAILED_USER_DELETION, $.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, $.FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, $.FAILED_EXCHANGE_CUSTOM_TOKEN, $.FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, $.FAILED_FEDERATED_LOGOUT, $.FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN, $.FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, $.FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, $.FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, $.FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, $.FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, $.FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN, $.FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, $.FAILED_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN, $.FAILED_HOOK, $.FAILED_IMPERSONATION, $.FAILED_INVITE_ACCEPT, $.FAILED_LOGOUT, $.FLOWS_EXECUTION_COMPLETED, $.FLOWS_EXECUTION_FAILED, $.FAILED_SENDING_NOTIFICATION, $.FORMS_SUBMISSION_FAILED, $.FORMS_SUBMISSION_SUCCEEDED, $.FAILED_LOGIN_INCORRECT_PASSWORD, $.FAILED_PUSHED_AUTHORIZATION_REQUEST, $.FAILED_POST_USER_REGISTRATION_HOOK, $.FAILED_SIGNUP, $.FAILED_SILENT_AUTH, $.FAILED_LOGIN_INVALID_EMAIL_USERNAME, $.FAILED_USERS_IMPORT, $.FAILED_VERIFICATION_EMAIL, $.FAILED_VERIFICATION_EMAIL_REQUEST, $.EMAIL_VERIFICATION_CONFIRMED, $.EMAIL_VERIFICATION_FAILED, $.MFA_AUTH_FAILED, $.MFA_AUTH_REJECTED, $.MFA_AUTH_SUCCESS, $.MFA_ENROLLMENT_COMPLETE, $.TOO_MANY_MFA_FAILURES, $.MFA_RECOVERY_FAILED, $.MFA_RECOVERY_RATE_LIMIT_EXCEED, $.MFA_RECOVERY_SUCCESS, $.MFA_EMAIL_SENT, $.EMAIL_VERIFICATION_SENT, $.EMAIL_VERIFICATION_SEND_FAILURE, $.PUSH_NOTIFICATION_SENT, $.ERROR_SENDING_MFA_PUSH_NOTIFICATION, $.MFA_SMS_SENT, $.ERROR_SENDING_MFA_SMS, $.MFA_VOICE_CALL_SUCCESS, $.MFA_VOICE_CALL_FAILED, $.SECOND_FACTOR_STARTED, $.MFA_ENROLL_STARTED, $.MFA_ENROLLMENT_FAILED, $.GUARDIAN_TENANT_UPDATE, $.UNENROLL_DEVICE_ACCOUNT, $.UPDATE_DEVICE_ACCOUNT, $.WEBAUTHN_CHALLENGE_FAILED, $.WEBAUTHN_ENROLLMENT_FAILED, $.FAILED_KMS_API_OPERATION, $.SUCCESS_KMS_API_OPERATION, $.KMS_KEY_STATE_CHANGED, $.TOO_MANY_CALLS_TO_DELEGATION, $.BLOCKED_IP_ADDRESS, $.BLOCKED_ACCOUNT_IP, $.BLOCKED_ACCOUNT_EMAIL, $.INFORMATION, $.MFA_REQUIRED, $.MANAGEMENT_API_READ_OPERATION, $.FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, $.SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, $.FAILED_OIDC_BACKCHANNEL_LOGOUT, $.SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT, $.ORGANIZATION_MEMBER_ADDED, $.PASSKEY_CHALLENGE_FAILED, $.PASSKEY_CHALLENGE_STARTED, $.PRE_LOGIN_ASSESSMENT, $.BREACHED_PASSWORD, $.BREACHED_PASSWORD_ON_RESET, $.SUCCESS_RESOURCE_CLEANUP, $.RICH_CONSENTS_ACCESS_ERROR, $.SUCCESS_LOGIN, $.SUCCESS_API_OPERATION, $.FAILED_API_OPERATION, $.SUCCESS_CHANGE_EMAIL, $.SUCCESS_CROSS_ORIGIN_AUTHENTICATION, $.SUCCESS_CHANGE_PASSWORD, $.SUCCESS_CHANGE_PHONE_NUMBER, $.SUCCESS_CHANGE_PASSWORD_REQUEST, $.SUCCESS_CHANGE_USERNAME, $.SUCCESS_CREDENTIAL_VALIDATION, $.SUCCESS_DELEGATION, $.SUCCESS_USER_DELETION, $.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, $.SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, $.SUCCESS_EXCHANGE_CUSTOM_TOKEN, $.SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, $.SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN, $.SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, $.SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, $.SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, $.SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, $.SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN, $.SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN, $.SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN, $.SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, $.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, $.SUCCESS_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN, $.SUCCESS_IMPERSONATION, $.SUCCESSFULLY_ACCEPTED_USER_INVITE, $.BREACHED_PASSWORD_ON_SIGNUP, $.SUCCESS_LOGOUT, $.SUCCESS_HOOK, $.SUCCESS_PASSWORD_MIGRATION, $.SUCCESS_REVOCATION, $.SUCCESS_SIGNUP, $.FAILED_SS_SSO_OPERATION, $.INFORMATION_FROM_SS_SSO_OPERATION, $.SUCCESS_SS_SSO_OPERATION, $.SUCCESS_SILENT_AUTH, $.SUCCESSFUL_SCIM_OPERATION, $.SUCCESSFULLY_IMPORTED_USERS, $.SUCCESS_VERIFICATION_EMAIL, $.SUCCESS_VERIFICATION_EMAIL_REQUEST, $.MAX_AMOUNT_OF_AUTHENTICATORS, $.USER_LOGIN_BLOCK_RELEASED, $.FAILED_UNIVERSAL_LOGOUT, $.SUCCESSFUL_UNIVERSAL_LOGOUT, $.WARNING_DURING_LOGIN, $.WARNING_SENDING_NOTIFICATION, $.WARNING_USER_MANAGEMENT, (() => {
15205
15209
  let e = {};
15206
15210
  for (let [t, n] of Object.entries($)) t.startsWith("SUCCESS_") || t.startsWith("SUCCESSFUL_") || t.startsWith("SUCCESSFULLY_") || t.endsWith("_SUCCEEDED") || t.endsWith("_COMPLETED") ? e[n] = "success" : t.startsWith("FAILED_") || t.startsWith("ERROR_") || t.startsWith("BREACHED_") || t.startsWith("BLOCKED_") || t === "MFA_AUTH_FAILED" || t === "MFA_AUTH_REJECTED" || t === "MFA_RECOVERY_FAILED" || t === "MFA_ENROLLMENT_FAILED" || t === "EMAIL_VERIFICATION_FAILED" || t === "WEBAUTHN_CHALLENGE_FAILED" || t === "WEBAUTHN_ENROLLMENT_FAILED" || t === "PASSKEY_CHALLENGE_FAILED" || t === "FLOWS_EXECUTION_FAILED" || t === "FORMS_SUBMISSION_FAILED" || t === "CIBA_EXCHANGE_FAILED" || t === "CIBA_START_FAILED" || t === "ACTIONS_EXECUTION_FAILED" || t === "RICH_CONSENTS_ACCESS_ERROR" || t === "USER_CANCELED_DEVICE_CONFIRMATION" || t === "TOO_MANY_MFA_FAILURES" || t === "MFA_RECOVERY_RATE_LIMIT_EXCEED" || t === "API_LIMIT" || t === "MAX_AMOUNT_OF_AUTHENTICATORS" ? e[n] = "failure" : t.startsWith("WARNING_") || t === "API_LIMIT_WARNING" || t === "DEPRECATION_NOTICE" || t === "PRE_LOGIN_ASSESSMENT" ? e[n] = "warning" : t === "CODE_SENT" || t === "CODE_LINK_SENT" || t === "MFA_EMAIL_SENT" || t === "MFA_SMS_SENT" || t === "EMAIL_VERIFICATION_SENT" || t === "PUSH_NOTIFICATION_SENT" ? e[n] = "code_sent" : t === "INFORMATION" || t === "INFORMATION_FROM_SS_SSO_OPERATION" || t === "MANAGEMENT_API_READ_OPERATION" || t === "APPI" || t === "ACLS_SUMMARY" || t === "ORGANIZATION_MEMBER_ADDED" ? e[n] = "info" : e[n] = "other";
15207
15211
  return e;
15208
15212
  })();
15209
- var fy = J({
15213
+ var py = J({
15210
15214
  name: H(),
15211
15215
  version: H(),
15212
15216
  env: J({ node: H().optional() }).optional()
15213
- }), py = J({
15217
+ }), my = J({
15214
15218
  country_code: H().length(2),
15215
15219
  city_name: H(),
15216
15220
  latitude: H(),
@@ -15219,7 +15223,7 @@ var fy = J({
15219
15223
  continent_code: H()
15220
15224
  });
15221
15225
  J({
15222
- type: dy,
15226
+ type: fy,
15223
15227
  date: H(),
15224
15228
  description: H().optional(),
15225
15229
  ip: H().optional(),
@@ -15237,63 +15241,63 @@ J({
15237
15241
  strategy: H().optional(),
15238
15242
  strategy_type: H().optional(),
15239
15243
  hostname: H().optional(),
15240
- auth0_client: fy.optional(),
15244
+ auth0_client: py.optional(),
15241
15245
  log_id: H().optional(),
15242
- location_info: py.optional()
15246
+ location_info: my.optional()
15243
15247
  }).extend({ log_id: H() });
15244
- var my = X([
15248
+ var hy = X([
15245
15249
  "http",
15246
15250
  "eventbridge",
15247
15251
  "eventgrid",
15248
15252
  "splunk",
15249
15253
  "datadog",
15250
15254
  "sumo"
15251
- ]), hy = X([
15255
+ ]), gy = X([
15252
15256
  "active",
15253
15257
  "paused",
15254
15258
  "suspended"
15255
- ]), gy = J({
15259
+ ]), _y = J({
15256
15260
  type: H(),
15257
15261
  name: H()
15258
15262
  });
15259
15263
  J({
15260
15264
  name: H(),
15261
- type: my,
15262
- status: hy.optional(),
15265
+ type: hy,
15266
+ status: gy.optional(),
15263
15267
  sink: Y(H(), Eh()),
15264
- filters: q(gy).optional(),
15268
+ filters: q(_y).optional(),
15265
15269
  isPriority: G().optional()
15266
15270
  }).extend({
15267
15271
  id: H(),
15268
- status: hy,
15272
+ status: gy,
15269
15273
  created_at: H().optional(),
15270
15274
  updated_at: H().optional()
15271
15275
  });
15272
- var _y = X([
15276
+ var vy = X([
15273
15277
  "auth0",
15274
15278
  "cognito",
15275
15279
  "okta",
15276
15280
  "oidc"
15277
- ]), vy = J({
15281
+ ]), yy = J({
15278
15282
  domain: H(),
15279
15283
  client_id: H(),
15280
15284
  client_secret: H(),
15281
15285
  audience: H().optional(),
15282
15286
  scope: H().optional()
15283
- }), yy = J({
15287
+ }), by = J({
15284
15288
  id: H().optional(),
15285
15289
  name: H(),
15286
- provider: _y,
15290
+ provider: vy,
15287
15291
  connection: H(),
15288
15292
  enabled: G().default(!0),
15289
- credentials: vy
15293
+ credentials: yy
15290
15294
  });
15291
15295
  J({
15292
15296
  id: H(),
15293
15297
  created_at: H(),
15294
15298
  updated_at: H()
15295
- }).extend(yy.shape);
15296
- var by = J({
15299
+ }).extend(by.shape);
15300
+ var xy = J({
15297
15301
  enabled: G().optional(),
15298
15302
  shields: q(H()).optional(),
15299
15303
  admin_notification_frequency: q(H()).optional(),
@@ -15302,13 +15306,13 @@ var by = J({
15302
15306
  "pre-user-registration": J({ shields: q(H()).optional() }).optional(),
15303
15307
  "pre-change-password": J({ shields: q(H()).optional() }).optional()
15304
15308
  }).optional()
15305
- }), xy = J({
15309
+ }), Sy = J({
15306
15310
  enabled: G().optional(),
15307
15311
  shields: q(H()).optional(),
15308
15312
  allowlist: q(H()).optional(),
15309
15313
  mode: H().optional(),
15310
15314
  max_attempts: W().optional()
15311
- }), Sy = J({
15315
+ }), Cy = J({
15312
15316
  enabled: G().optional(),
15313
15317
  shields: q(H()).optional(),
15314
15318
  allowlist: q(H()).optional(),
@@ -15322,10 +15326,10 @@ var by = J({
15322
15326
  rate: W().optional()
15323
15327
  }).optional()
15324
15328
  }).optional()
15325
- }), Cy = J({
15326
- breached_password_detection: by.optional(),
15327
- brute_force_protection: xy.optional(),
15328
- suspicious_ip_throttling: Sy.optional()
15329
+ }), wy = J({
15330
+ breached_password_detection: xy.optional(),
15331
+ brute_force_protection: Sy.optional(),
15332
+ suspicious_ip_throttling: Cy.optional()
15329
15333
  });
15330
15334
  J({
15331
15335
  id: H().optional(),
@@ -15338,14 +15342,14 @@ J({
15338
15342
  created_at: H(),
15339
15343
  updated_at: H()
15340
15344
  });
15341
- var wy = J({
15345
+ var Ty = J({
15342
15346
  initial_user_agent: H().describe("First user agent of the device from which this user logged in"),
15343
15347
  initial_ip: H().describe("First IP address associated with this session"),
15344
15348
  initial_asn: H().describe("First autonomous system number associated with this session"),
15345
15349
  last_user_agent: H().describe("Last user agent of the device from which this user logged in"),
15346
15350
  last_ip: H().describe("Last IP address from which this user logged in"),
15347
15351
  last_asn: H().describe("Last autonomous system number from which this user logged in")
15348
- }), Ty = J({
15352
+ }), Ey = J({
15349
15353
  id: H(),
15350
15354
  revoked_at: H().optional(),
15351
15355
  used_at: H().optional(),
@@ -15353,7 +15357,7 @@ var wy = J({
15353
15357
  expires_at: H().optional(),
15354
15358
  login_session_id: H(),
15355
15359
  idle_expires_at: H().optional(),
15356
- device: wy.describe("Metadata related to the device used in the session"),
15360
+ device: Ty.describe("Metadata related to the device used in the session"),
15357
15361
  clients: q(H()).describe("List of client details for the session")
15358
15362
  });
15359
15363
  J({
@@ -15361,7 +15365,7 @@ J({
15361
15365
  updated_at: H(),
15362
15366
  authenticated_at: H(),
15363
15367
  last_interaction_at: H()
15364
- }).extend(Ty.shape), J({
15368
+ }).extend(Ey.shape), J({
15365
15369
  kid: H().openapi({ description: "The key id of the signing key" }),
15366
15370
  tenant_id: H().optional().openapi({ description: "The tenant the key belongs to. Omitted means the key is shared / control-plane scoped." }),
15367
15371
  cert: H().openapi({ description: "The public certificate of the signing key" }),
@@ -15378,7 +15382,7 @@ J({
15378
15382
  connection: H().optional().openapi({ description: "The connection identifier associated with the key" }),
15379
15383
  type: X(["jwt_signing", "saml_encryption"]).openapi({ description: "The type of the signing key" })
15380
15384
  });
15381
- var Ey = J({
15385
+ var Dy = J({
15382
15386
  id: H().optional(),
15383
15387
  audience: H().optional(),
15384
15388
  friendly_name: H(),
@@ -15495,7 +15499,7 @@ var Ey = J({
15495
15499
  "shared_planetscale"
15496
15500
  ]).optional(),
15497
15501
  d1_database_id: H().max(64).optional(),
15498
- attack_protection: Cy.optional(),
15502
+ attack_protection: wy.optional(),
15499
15503
  mfa: J({
15500
15504
  policy: X(["never", "always"]).default("never").optional(),
15501
15505
  factors: J({
@@ -15526,7 +15530,7 @@ var Ey = J({
15526
15530
  J({
15527
15531
  created_at: H().nullable().transform((e) => e ?? ""),
15528
15532
  updated_at: H().nullable().transform((e) => e ?? "")
15529
- }).extend(Ey.shape).extend({
15533
+ }).extend(Dy.shape).extend({
15530
15534
  id: H(),
15531
15535
  is_control_plane: G().optional()
15532
15536
  }), J({
@@ -15541,7 +15545,7 @@ J({
15541
15545
  code: H(),
15542
15546
  state: H().optional()
15543
15547
  });
15544
- var Dy = J({
15548
+ var Oy = J({
15545
15549
  button_border_radius: W(),
15546
15550
  button_border_weight: W(),
15547
15551
  buttons_style: X([
@@ -15559,7 +15563,7 @@ var Dy = J({
15559
15563
  show_widget_shadow: G(),
15560
15564
  widget_border_weight: W(),
15561
15565
  widget_corner_radius: W()
15562
- }), Oy = J({
15566
+ }), ky = J({
15563
15567
  base_focus_color: H(),
15564
15568
  base_hover_color: H(),
15565
15569
  body_text: H(),
@@ -15583,20 +15587,20 @@ var Dy = J({
15583
15587
  success: H(),
15584
15588
  widget_background: H(),
15585
15589
  widget_border: H()
15586
- }), ky = J({
15590
+ }), Ay = J({
15587
15591
  bold: G(),
15588
15592
  size: W()
15589
- }), Ay = J({
15590
- body_text: ky,
15591
- buttons_text: ky,
15593
+ }), jy = J({
15594
+ body_text: Ay,
15595
+ buttons_text: Ay,
15592
15596
  font_url: H(),
15593
- input_labels: ky,
15594
- links: ky,
15597
+ input_labels: Ay,
15598
+ links: Ay,
15595
15599
  links_style: X(["normal", "underlined"]),
15596
15600
  reference_text_size: W(),
15597
- subtitle: ky,
15598
- title: ky
15599
- }), jy = J({
15601
+ subtitle: Ay,
15602
+ title: Ay
15603
+ }), My = J({
15600
15604
  background_color: H(),
15601
15605
  background_image_url: H(),
15602
15606
  page_layout: X([
@@ -15609,7 +15613,7 @@ var Dy = J({
15609
15613
  "chip",
15610
15614
  "none"
15611
15615
  ]).optional()
15612
- }), My = J({
15616
+ }), Ny = J({
15613
15617
  header_text_alignment: X([
15614
15618
  "center",
15615
15619
  "left",
@@ -15626,40 +15630,40 @@ var Dy = J({
15626
15630
  social_buttons_layout: X(["bottom", "top"])
15627
15631
  });
15628
15632
  J({
15629
- borders: Dy,
15630
- colors: Oy,
15633
+ borders: Oy,
15634
+ colors: ky,
15631
15635
  displayName: H(),
15632
- fonts: Ay,
15633
- page_background: jy,
15634
- widget: My
15636
+ fonts: jy,
15637
+ page_background: My,
15638
+ widget: Ny
15635
15639
  }).extend({ themeId: H() }), J({
15636
15640
  universal_login_experience: X(["new", "classic"]).default("new"),
15637
15641
  identifier_first: G().default(!0),
15638
15642
  password_first: G().default(!1),
15639
15643
  webauthn_platform_first_factor: G()
15640
15644
  });
15641
- var Ny = J({
15645
+ var Py = J({
15642
15646
  hosts: q(H()).optional(),
15643
15647
  methods: q(H()).optional(),
15644
15648
  path: H().default("/*"),
15645
15649
  headers: Y(H(), H()).optional(),
15646
15650
  query: Y(H(), H()).optional()
15647
- }), Py = J({
15651
+ }), Fy = J({
15648
15652
  type: H(),
15649
15653
  options: Y(H(), Eh()).default({})
15650
- }), Fy = J({
15654
+ }), Iy = J({
15651
15655
  id: H().optional(),
15652
15656
  custom_domain_id: H(),
15653
15657
  priority: W().int().default(100),
15654
- match: Ny,
15655
- handlers: q(Py).min(1)
15658
+ match: Py,
15659
+ handlers: q(Fy).min(1)
15656
15660
  });
15657
- Fy.extend({
15661
+ Iy.extend({
15658
15662
  id: H(),
15659
15663
  tenant_id: H(),
15660
15664
  created_at: H(),
15661
15665
  updated_at: H()
15662
- }), Fy.partial().omit({
15666
+ }), Iy.partial().omit({
15663
15667
  id: !0,
15664
15668
  custom_domain_id: !0
15665
15669
  }), J({
@@ -15699,7 +15703,7 @@ Fy.extend({
15699
15703
  expires_at: H().optional(),
15700
15704
  idle_expires_at: H().optional(),
15701
15705
  last_exchanged_at: H().optional(),
15702
- device: wy,
15706
+ device: Ty,
15703
15707
  resource_servers: q(J({
15704
15708
  audience: H(),
15705
15709
  scopes: H()
@@ -15720,10 +15724,10 @@ Fy.extend({
15720
15724
  name: H(),
15721
15725
  options: J({})
15722
15726
  });
15723
- var Iy = J({
15727
+ var Ly = J({
15724
15728
  value: H(),
15725
15729
  description: H().optional()
15726
- }), Ly = J({
15730
+ }), Ry = J({
15727
15731
  token_dialect: X(["access_token", "access_token_authz"]).optional(),
15728
15732
  enforce_policies: G().optional(),
15729
15733
  allow_skipping_userinfo: G().optional(),
@@ -15736,7 +15740,7 @@ J({
15736
15740
  id: H().optional(),
15737
15741
  name: H(),
15738
15742
  identifier: H(),
15739
- scopes: q(Iy).optional(),
15743
+ scopes: q(Ly).optional(),
15740
15744
  signing_alg: H().optional(),
15741
15745
  signing_secret: H().optional(),
15742
15746
  token_lifetime: W().default(86400),
@@ -15744,7 +15748,7 @@ J({
15744
15748
  skip_consent_for_verifiable_first_party_clients: G().optional(),
15745
15749
  allow_offline_access: G().optional(),
15746
15750
  verificationKey: H().optional(),
15747
- options: Ly.optional(),
15751
+ options: Ry.optional(),
15748
15752
  is_system: G().optional(),
15749
15753
  metadata: Y(H(), K()).optional()
15750
15754
  }).extend({
@@ -15793,18 +15797,18 @@ J({
15793
15797
  created_at: H().optional(),
15794
15798
  updated_at: H().optional()
15795
15799
  });
15796
- var Ry = J({
15800
+ var zy = J({
15797
15801
  logo_url: H().optional().openapi({ description: "URL of the organization's logo" }),
15798
15802
  colors: J({
15799
15803
  primary: H().optional().openapi({ description: "Primary color in hex format (e.g., #FF0000)" }),
15800
15804
  page_background: H().optional().openapi({ description: "Page background color in hex format (e.g., #FFFFFF)" })
15801
15805
  }).optional()
15802
- }).optional(), zy = J({
15806
+ }).optional(), By = J({
15803
15807
  connection_id: H().openapi({ description: "ID of the connection" }),
15804
15808
  assign_membership_on_login: G().default(!1).openapi({ description: "Whether to assign membership to the organization on login" }),
15805
15809
  show_as_button: G().default(!0).openapi({ description: "Whether to show this connection as a button in the login screen" }),
15806
15810
  is_signup_enabled: G().default(!0).openapi({ description: "Whether signup is enabled for this connection" })
15807
- }), By = J({ client_credentials: J({
15811
+ }), Vy = J({ client_credentials: J({
15808
15812
  enforce: G().default(!1).openapi({ description: "Whether to enforce token quota limits" }),
15809
15813
  per_day: W().min(0).default(0).openapi({ description: "Maximum tokens per day (0 = unlimited)" }),
15810
15814
  per_hour: W().min(0).default(0).openapi({ description: "Maximum tokens per hour (0 = unlimited)" })
@@ -15813,10 +15817,10 @@ J({
15813
15817
  id: H().optional(),
15814
15818
  name: H().min(1).regex(/^[a-z0-9_-]+$/, { message: "Organization name must be lowercase and can only contain letters, numbers, hyphens, and underscores" }).openapi({ description: "The name of the organization. Must be lowercase and can only contain letters, numbers, hyphens, and underscores." }),
15815
15819
  display_name: H().optional().openapi({ description: "The display name of the organization" }),
15816
- branding: Ry,
15820
+ branding: zy,
15817
15821
  metadata: Y(H(), K()).default({}).optional().openapi({ description: "Custom metadata for the organization" }),
15818
- enabled_connections: q(zy).default([]).optional().openapi({ description: "List of enabled connections for the organization" }),
15819
- token_quota: By
15822
+ enabled_connections: q(By).default([]).optional().openapi({ description: "List of enabled connections for the organization" }),
15823
+ token_quota: Vy
15820
15824
  }).extend(__.shape).extend({
15821
15825
  id: H(),
15822
15826
  name: H().min(1).openapi({ description: "The name of the organization" })
@@ -15965,22 +15969,22 @@ J({
15965
15969
  "passwordless",
15966
15970
  "enterprise"
15967
15971
  ]);
15968
- var Vy = J({
15972
+ var Hy = J({
15969
15973
  name: H(),
15970
15974
  type: H()
15971
- }), Hy = J({
15975
+ }), Uy = J({
15972
15976
  elapsed: W(),
15973
15977
  rows_read: W().optional(),
15974
15978
  bytes_read: W().optional()
15975
15979
  });
15976
15980
  J({
15977
- meta: q(Vy),
15981
+ meta: q(Hy),
15978
15982
  data: q(Y(H(), K())),
15979
15983
  rows: W(),
15980
15984
  rows_before_limit_at_least: W().optional(),
15981
- statistics: Hy.optional()
15985
+ statistics: Uy.optional()
15982
15986
  });
15983
- var Uy = X(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.signup-password.reset-password.consent.mfa.mfa-push.mfa-otp.mfa-voice.mfa-phone.mfa-webauthn.mfa-email.mfa-recovery-code.status.device-flow.email-verification.email-otp-challenge.organizations.invitation.common.passkeys.captcha.custom-form.login-passwordless.mfa-login-options".split(".")), Wy = Y(H(), Y(H(), H())).openapi({
15987
+ var Wy = X(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.signup-password.reset-password.consent.mfa.mfa-push.mfa-otp.mfa-voice.mfa-phone.mfa-webauthn.mfa-email.mfa-recovery-code.status.device-flow.email-verification.email-otp-challenge.organizations.invitation.common.passkeys.captcha.custom-form.login-passwordless.mfa-login-options".split(".")), Gy = Y(H(), Y(H(), H())).openapi({
15984
15988
  type: "object",
15985
15989
  additionalProperties: {
15986
15990
  type: "object",
@@ -15988,11 +15992,11 @@ var Uy = X(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.signu
15988
15992
  }
15989
15993
  });
15990
15994
  J({
15991
- prompt: Uy,
15995
+ prompt: Wy,
15992
15996
  language: H(),
15993
- custom_text: Wy
15997
+ custom_text: Gy
15994
15998
  });
15995
- var Gy = X([
15999
+ var Ky = X([
15996
16000
  "phone",
15997
16001
  "totp",
15998
16002
  "email",
@@ -16000,9 +16004,9 @@ var Gy = X([
16000
16004
  "webauthn-roaming",
16001
16005
  "webauthn-platform",
16002
16006
  "passkey"
16003
- ]), Ky = J({
16007
+ ]), qy = J({
16004
16008
  user_id: H(),
16005
- type: Gy,
16009
+ type: Ky,
16006
16010
  phone_number: H().optional(),
16007
16011
  totp_secret: H().optional(),
16008
16012
  credential_id: H().optional(),
@@ -16013,7 +16017,7 @@ var Gy = X([
16013
16017
  friendly_name: H().optional(),
16014
16018
  confirmed: G().default(!1)
16015
16019
  });
16016
- function qy(e, t) {
16020
+ function Jy(e, t) {
16017
16021
  e.type === "phone" && !e.phone_number && t.addIssue({
16018
16022
  code: e_.custom,
16019
16023
  message: "phone_number is required when type is 'phone'",
@@ -16036,30 +16040,30 @@ function qy(e, t) {
16036
16040
  path: ["public_key"]
16037
16041
  }));
16038
16042
  }
16039
- Ky.superRefine(qy), Ky.extend({
16043
+ qy.superRefine(Jy), qy.extend({
16040
16044
  id: H(),
16041
16045
  created_at: H(),
16042
16046
  updated_at: H()
16043
- }).superRefine(qy);
16044
- function Jy(e) {
16047
+ }).superRefine(Jy);
16048
+ function Yy(e) {
16045
16049
  return typeof e == "object" && !!e && !Array.isArray(e);
16046
16050
  }
16047
16051
  //#endregion
16048
16052
  //#region src/adapters/clientRegistrationTokens.ts
16049
- function Yy(e) {
16053
+ function Xy(e) {
16050
16054
  if (!e) return;
16051
16055
  let t = JSON.parse(e);
16052
- return Jy(t) ? t : void 0;
16056
+ return Yy(t) ? t : void 0;
16053
16057
  }
16054
- function Xy(e) {
16058
+ function Zy(e) {
16055
16059
  return e == null ? void 0 : new Date(e).toISOString();
16056
16060
  }
16057
- function Zy(e) {
16061
+ function Qy(e) {
16058
16062
  if (!e) return null;
16059
16063
  let t = new Date(e);
16060
16064
  return isNaN(t.getTime()) ? null : t.getTime();
16061
16065
  }
16062
- function Qy(e) {
16066
+ function $y(e) {
16063
16067
  let t = J_.parse(e.type);
16064
16068
  return {
16065
16069
  id: e.id,
@@ -16067,15 +16071,15 @@ function Qy(e) {
16067
16071
  type: t,
16068
16072
  client_id: e.client_id ?? void 0,
16069
16073
  sub: e.sub ?? void 0,
16070
- constraints: Yy(e.constraints),
16074
+ constraints: Xy(e.constraints),
16071
16075
  single_use: !!e.single_use,
16072
- expires_at: Xy(e.expires_at_ts),
16073
- used_at: Xy(e.used_at_ts),
16074
- revoked_at: Xy(e.revoked_at_ts),
16076
+ expires_at: Zy(e.expires_at_ts),
16077
+ used_at: Zy(e.used_at_ts),
16078
+ revoked_at: Zy(e.revoked_at_ts),
16075
16079
  created_at: new Date(e.created_at_ts).toISOString()
16076
16080
  };
16077
16081
  }
16078
- function $y(e) {
16082
+ function eb(e) {
16079
16083
  return {
16080
16084
  async create(t, n) {
16081
16085
  let r = Date.now();
@@ -16088,7 +16092,7 @@ function $y(e) {
16088
16092
  sub: n.sub ?? null,
16089
16093
  constraints: n.constraints ? JSON.stringify(n.constraints) : null,
16090
16094
  single_use: +!!n.single_use,
16091
- expires_at_ts: Zy(n.expires_at),
16095
+ expires_at_ts: Qy(n.expires_at),
16092
16096
  created_at_ts: r
16093
16097
  }), {
16094
16098
  id: n.id,
@@ -16104,23 +16108,23 @@ function $y(e) {
16104
16108
  },
16105
16109
  async get(t, n) {
16106
16110
  let r = await e.select().from(T).where(h(m(T.tenant_id, t), m(T.id, n))).get();
16107
- return r ? Qy(r) : null;
16111
+ return r ? $y(r) : null;
16108
16112
  },
16109
16113
  async getByHash(t, n) {
16110
16114
  let r = await e.select().from(T).where(h(m(T.tenant_id, t), m(T.token_hash, n))).get();
16111
- return r ? Qy(r) : null;
16115
+ return r ? $y(r) : null;
16112
16116
  },
16113
16117
  async listByClient(t, n) {
16114
- return (await e.select().from(T).where(h(m(T.tenant_id, t), m(T.client_id, n))).orderBy(Be(T.created_at_ts))).map(Qy);
16118
+ return (await e.select().from(T).where(h(m(T.tenant_id, t), m(T.client_id, n))).orderBy(Be(T.created_at_ts))).map($y);
16115
16119
  },
16116
16120
  async markUsed(t, n, r) {
16117
- return (await e.update(T).set({ used_at_ts: Zy(r) }).where(h(m(T.tenant_id, t), m(T.id, n), Ie(T.used_at_ts))).returning()).length > 0;
16121
+ return (await e.update(T).set({ used_at_ts: Qy(r) }).where(h(m(T.tenant_id, t), m(T.id, n), Ie(T.used_at_ts))).returning()).length > 0;
16118
16122
  },
16119
16123
  async revoke(t, n, r) {
16120
- return (await e.update(T).set({ revoked_at_ts: Zy(r) }).where(h(m(T.tenant_id, t), m(T.id, n), Ie(T.revoked_at_ts))).returning()).length > 0;
16124
+ return (await e.update(T).set({ revoked_at_ts: Qy(r) }).where(h(m(T.tenant_id, t), m(T.id, n), Ie(T.revoked_at_ts))).returning()).length > 0;
16121
16125
  },
16122
16126
  async revokeByClient(t, n, r) {
16123
- return (await e.update(T).set({ revoked_at_ts: Zy(r) }).where(h(m(T.tenant_id, t), m(T.client_id, n), Ie(T.revoked_at_ts))).returning()).length;
16127
+ return (await e.update(T).set({ revoked_at_ts: Qy(r) }).where(h(m(T.tenant_id, t), m(T.client_id, n), Ie(T.revoked_at_ts))).returning()).length;
16124
16128
  },
16125
16129
  async remove(t, n) {
16126
16130
  return (await e.delete(T).where(h(m(T.tenant_id, t), m(T.id, n))).returning()).length > 0;
@@ -16129,11 +16133,11 @@ function $y(e) {
16129
16133
  }
16130
16134
  //#endregion
16131
16135
  //#region src/adapters/codes.ts
16132
- function eb(e) {
16136
+ function tb(e) {
16133
16137
  let { tenant_id: t, ...n } = e;
16134
16138
  return A(n);
16135
16139
  }
16136
- function tb(e) {
16140
+ function nb(e) {
16137
16141
  return {
16138
16142
  async create(t, n) {
16139
16143
  let r = {
@@ -16142,12 +16146,12 @@ function tb(e) {
16142
16146
  created_at: n.created_at || (/* @__PURE__ */ new Date()).toISOString(),
16143
16147
  expires_at: n.expires_at
16144
16148
  };
16145
- return await e.insert(Vt).values(r), eb(r);
16149
+ return await e.insert(Vt).values(r), tb(r);
16146
16150
  },
16147
16151
  async get(t, n, r) {
16148
16152
  if (!t) throw Error("tenant_id is required");
16149
16153
  let i = await e.select().from(Vt).where(h(m(Vt.tenant_id, t), m(Vt.code_id, n), m(Vt.code_type, r))).get();
16150
- return i ? eb(i) : null;
16154
+ return i ? tb(i) : null;
16151
16155
  },
16152
16156
  async list(t, n) {
16153
16157
  let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o } = n || {}, s = e.select().from(Vt).where(m(Vt.tenant_id, t)).$dynamic();
@@ -16155,7 +16159,7 @@ function tb(e) {
16155
16159
  let e = Vt[o.sort_by];
16156
16160
  e && (s = s.orderBy(o.sort_order === "desc" ? Be(e) : ze(e)));
16157
16161
  }
16158
- let c = (await s.offset(r * i).limit(i)).map(eb);
16162
+ let c = (await s.offset(r * i).limit(i)).map(tb);
16159
16163
  if (!a) return { codes: c };
16160
16164
  let [l] = await e.select({ count: Ve() }).from(Vt).where(m(Vt.tenant_id, t));
16161
16165
  return {
@@ -16178,11 +16182,11 @@ function tb(e) {
16178
16182
  }
16179
16183
  //#endregion
16180
16184
  //#region src/adapters/connections.ts
16181
- function nb() {
16185
+ function rb() {
16182
16186
  let { customAlphabet: e } = (Hn(), s(Ln));
16183
16187
  return `con_${e("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
16184
16188
  }
16185
- function rb(e) {
16189
+ function ib(e) {
16186
16190
  let { tenant_id: t, is_system: n, options: r, metadata: i, ...a } = e;
16187
16191
  return A({
16188
16192
  ...a,
@@ -16191,11 +16195,11 @@ function rb(e) {
16191
16195
  is_system: n ? !0 : void 0
16192
16196
  });
16193
16197
  }
16194
- function ib(e) {
16198
+ function ab(e) {
16195
16199
  return {
16196
16200
  async create(t, n) {
16197
16201
  let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
16198
- id: n.id || nb(),
16202
+ id: n.id || rb(),
16199
16203
  ...n,
16200
16204
  tenant_id: t,
16201
16205
  options: JSON.stringify(n.options || {}),
@@ -16209,11 +16213,11 @@ function ib(e) {
16209
16213
  } catch (e) {
16210
16214
  throw e?.message?.includes("UNIQUE constraint failed") || e?.message?.includes("duplicate key") ? new Tn(409, { message: "Connection already exists" }) : e;
16211
16215
  }
16212
- return rb(i);
16216
+ return ib(i);
16213
16217
  },
16214
16218
  async get(t, n) {
16215
16219
  let r = await e.select().from(Kt).where(h(m(Kt.tenant_id, t), m(Kt.id, n))).get();
16216
- return r ? rb(r) : null;
16220
+ return r ? ib(r) : null;
16217
16221
  },
16218
16222
  async update(t, n, r) {
16219
16223
  let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
@@ -16230,7 +16234,7 @@ function ib(e) {
16230
16234
  let e = Kt[o.sort_by];
16231
16235
  e && (l = l.orderBy(o.sort_order === "desc" ? Be(e) : ze(e)));
16232
16236
  }
16233
- let u = (await l.offset(r * i).limit(i)).map(rb);
16237
+ let u = (await l.offset(r * i).limit(i)).map(ib);
16234
16238
  if (!a) return { connections: u };
16235
16239
  let [d] = await e.select({ count: Ve() }).from(Kt).where(c);
16236
16240
  return {
@@ -16248,7 +16252,7 @@ function ib(e) {
16248
16252
  //#endregion
16249
16253
  //#region src/adapters/customDomains.ts
16250
16254
  Hn();
16251
- function ab(e) {
16255
+ function ob(e) {
16252
16256
  let { tenant_id: t, domain_metadata: n, ...r } = e;
16253
16257
  return A({
16254
16258
  ...r,
@@ -16256,7 +16260,7 @@ function ab(e) {
16256
16260
  domain_metadata: j(n)
16257
16261
  });
16258
16262
  }
16259
- function ob(e) {
16263
+ function sb(e) {
16260
16264
  return {
16261
16265
  async create(t, n) {
16262
16266
  let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
@@ -16274,24 +16278,24 @@ function ob(e) {
16274
16278
  created_at: r,
16275
16279
  updated_at: r
16276
16280
  };
16277
- return await e.insert(qt).values(i), ab({
16281
+ return await e.insert(qt).values(i), ob({
16278
16282
  ...i,
16279
16283
  tenant_id: t
16280
16284
  });
16281
16285
  },
16282
16286
  async get(t, n) {
16283
16287
  let r = await e.select().from(qt).where(h(m(qt.tenant_id, t), m(qt.custom_domain_id, n))).get();
16284
- return r ? ab(r) : null;
16288
+ return r ? ob(r) : null;
16285
16289
  },
16286
16290
  async getByDomain(t) {
16287
16291
  let n = await e.select().from(qt).where(m(qt.domain, t)).get();
16288
16292
  return n ? {
16289
- ...ab(n),
16293
+ ...ob(n),
16290
16294
  tenant_id: n.tenant_id
16291
16295
  } : null;
16292
16296
  },
16293
16297
  async list(t) {
16294
- return (await e.select().from(qt).where(m(qt.tenant_id, t)).all()).map(ab);
16298
+ return (await e.select().from(qt).where(m(qt.tenant_id, t)).all()).map(ob);
16295
16299
  },
16296
16300
  async update(t, n, r) {
16297
16301
  let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
@@ -16304,7 +16308,7 @@ function ob(e) {
16304
16308
  }
16305
16309
  //#endregion
16306
16310
  //#region src/adapters/customText.ts
16307
- function sb(e) {
16311
+ function cb(e) {
16308
16312
  return {
16309
16313
  async get(t, n, r) {
16310
16314
  let i = await e.select().from(mn).where(h(m(mn.tenant_id, t), m(mn.prompt, n), m(mn.language, r))).get();
@@ -16349,7 +16353,7 @@ function sb(e) {
16349
16353
  }
16350
16354
  //#endregion
16351
16355
  //#region src/adapters/emailProviders.ts
16352
- function cb(e) {
16356
+ function lb(e) {
16353
16357
  return {
16354
16358
  async create(t, n) {
16355
16359
  let r = (/* @__PURE__ */ new Date()).toISOString();
@@ -16386,7 +16390,7 @@ function cb(e) {
16386
16390
  }
16387
16391
  //#endregion
16388
16392
  //#region src/adapters/emailTemplates.ts
16389
- function lb(e) {
16393
+ function ub(e) {
16390
16394
  return A({
16391
16395
  template: e.template,
16392
16396
  body: e.body,
@@ -16399,14 +16403,14 @@ function lb(e) {
16399
16403
  urlLifetimeInSeconds: e.url_lifetime_in_seconds ?? void 0
16400
16404
  });
16401
16405
  }
16402
- function ub(e) {
16406
+ function db(e) {
16403
16407
  return {
16404
16408
  async get(t, n) {
16405
16409
  let r = await e.select().from(un).where(h(m(un.tenant_id, t), m(un.template, n))).get();
16406
- return r ? lb(r) : null;
16410
+ return r ? ub(r) : null;
16407
16411
  },
16408
16412
  async list(t) {
16409
- return (await e.select().from(un).where(m(un.tenant_id, t)).all()).map(lb);
16413
+ return (await e.select().from(un).where(m(un.tenant_id, t)).all()).map(ub);
16410
16414
  },
16411
16415
  async create(t, n) {
16412
16416
  let r = (/* @__PURE__ */ new Date()).toISOString();
@@ -16440,7 +16444,7 @@ function ub(e) {
16440
16444
  //#endregion
16441
16445
  //#region src/adapters/flows.ts
16442
16446
  Hn();
16443
- function db(e) {
16447
+ function fb(e) {
16444
16448
  return {
16445
16449
  async create(t, n) {
16446
16450
  let r = (/* @__PURE__ */ new Date()).toISOString(), i = `af_${Vn()}`;
@@ -16502,12 +16506,12 @@ function db(e) {
16502
16506
  //#endregion
16503
16507
  //#region src/adapters/forms.ts
16504
16508
  Hn();
16505
- var fb = [
16509
+ var pb = [
16506
16510
  "nodes",
16507
16511
  "start",
16508
16512
  "ending"
16509
16513
  ];
16510
- function pb(e) {
16514
+ function mb(e) {
16511
16515
  return {
16512
16516
  async create(t, n) {
16513
16517
  let r = (/* @__PURE__ */ new Date()).toISOString(), i = Vn(), a = {
@@ -16521,7 +16525,7 @@ function pb(e) {
16521
16525
  created_at: r,
16522
16526
  updated_at: r
16523
16527
  };
16524
- for (let e of fb) a[e] = JSON.stringify(n[e] || (e === "nodes" ? [] : {}));
16528
+ for (let e of pb) a[e] = JSON.stringify(n[e] || (e === "nodes" ? [] : {}));
16525
16529
  return await e.insert(on).values(a), {
16526
16530
  id: i,
16527
16531
  ...n,
@@ -16533,12 +16537,12 @@ function pb(e) {
16533
16537
  let r = await e.select().from(on).where(h(m(on.tenant_id, t), m(on.id, n))).get();
16534
16538
  if (!r) return null;
16535
16539
  let { tenant_id: i, ...a } = r, o = { ...a };
16536
- for (let e of fb) o[e] = j(a[e]);
16540
+ for (let e of pb) o[e] = j(a[e]);
16537
16541
  return A(o);
16538
16542
  },
16539
16543
  async update(t, n, r) {
16540
16544
  let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
16541
- for (let [e, t] of Object.entries(r)) t !== void 0 && (fb.includes(e) ? i[e] = JSON.stringify(t) : i[e] = t);
16545
+ for (let [e, t] of Object.entries(r)) t !== void 0 && (pb.includes(e) ? i[e] = JSON.stringify(t) : i[e] = t);
16542
16546
  return (await e.update(on).set(i).where(h(m(on.tenant_id, t), m(on.id, n))).returning()).length > 0;
16543
16547
  },
16544
16548
  async list(t, n) {
@@ -16549,7 +16553,7 @@ function pb(e) {
16549
16553
  }
16550
16554
  let c = (await s.offset(r * i).limit(i)).map((e) => {
16551
16555
  let { tenant_id: t, ...n } = e, r = { ...n };
16552
- for (let e of fb) r[e] = j(n[e]);
16556
+ for (let e of pb) r[e] = j(n[e]);
16553
16557
  return A(r);
16554
16558
  });
16555
16559
  if (!a) return { forms: c };
@@ -16568,7 +16572,7 @@ function pb(e) {
16568
16572
  }
16569
16573
  //#endregion
16570
16574
  //#region src/helpers/dates.ts
16571
- function mb(e) {
16575
+ function hb(e) {
16572
16576
  if (e != null) {
16573
16577
  if (typeof e == "number") return new Date(e).toISOString();
16574
16578
  if (typeof e == "string") {
@@ -16578,35 +16582,35 @@ function mb(e) {
16578
16582
  }
16579
16583
  }
16580
16584
  }
16581
- function hb(e, t = (/* @__PURE__ */ new Date(0)).toISOString()) {
16582
- return mb(e) ?? t;
16585
+ function gb(e, t = (/* @__PURE__ */ new Date(0)).toISOString()) {
16586
+ return hb(e) ?? t;
16583
16587
  }
16584
- function gb(e) {
16588
+ function _b(e) {
16585
16589
  if (!e || e === "") return null;
16586
16590
  let t = new Date(e);
16587
16591
  return isNaN(t.getTime()) ? null : t.getTime();
16588
16592
  }
16589
- function _b(e, t, n = []) {
16593
+ function vb(e, t, n = []) {
16590
16594
  let r = {};
16591
16595
  for (let n of t) {
16592
16596
  let t = n.replace(/_ts$/, "");
16593
- r[t] = hb(e[n]);
16597
+ r[t] = gb(e[n]);
16594
16598
  }
16595
16599
  for (let t of n) {
16596
16600
  let n = t.replace(/_ts$/, "");
16597
- r[n] = mb(e[t]);
16601
+ r[n] = hb(e[t]);
16598
16602
  }
16599
16603
  return r;
16600
16604
  }
16601
16605
  //#endregion
16602
16606
  //#region src/adapters/hookCode.ts
16603
16607
  Hn();
16604
- var vb = Bn("0123456789abcdefghijklmnopqrstuvwxyz", 17);
16605
- function yb() {
16606
- return `hc_${vb()}`;
16608
+ var yb = Bn("0123456789abcdefghijklmnopqrstuvwxyz", 17);
16609
+ function bb() {
16610
+ return `hc_${yb()}`;
16607
16611
  }
16608
- function bb(e) {
16609
- let { created_at_ts: t, updated_at_ts: n, secrets: r, ...i } = e, a = _b({
16612
+ function xb(e) {
16613
+ let { created_at_ts: t, updated_at_ts: n, secrets: r, ...i } = e, a = vb({
16610
16614
  created_at_ts: t,
16611
16615
  updated_at_ts: n
16612
16616
  }, ["created_at_ts", "updated_at_ts"]);
@@ -16616,25 +16620,25 @@ function bb(e) {
16616
16620
  secrets: r ? JSON.parse(r) : void 0
16617
16621
  };
16618
16622
  }
16619
- function xb(e) {
16623
+ function Sb(e) {
16620
16624
  return {
16621
16625
  async create(t, n) {
16622
16626
  let r = Date.now(), i = {
16623
- id: yb(),
16627
+ id: bb(),
16624
16628
  tenant_id: t,
16625
16629
  code: n.code,
16626
16630
  secrets: n.secrets ? JSON.stringify(n.secrets) : null,
16627
16631
  created_at_ts: r,
16628
16632
  updated_at_ts: r
16629
16633
  };
16630
- return await e.insert(fn).values(i), bb({
16634
+ return await e.insert(fn).values(i), xb({
16631
16635
  ...i,
16632
16636
  tenant_id: t
16633
16637
  });
16634
16638
  },
16635
16639
  async get(t, n) {
16636
16640
  let r = await e.select().from(fn).where(h(m(fn.tenant_id, t), m(fn.id, n))).get();
16637
- return r ? bb(r) : null;
16641
+ return r ? xb(r) : null;
16638
16642
  },
16639
16643
  async update(t, n, r) {
16640
16644
  let i = { updated_at_ts: Date.now() };
@@ -16647,11 +16651,11 @@ function xb(e) {
16647
16651
  }
16648
16652
  //#endregion
16649
16653
  //#region src/adapters/hooks.ts
16650
- function Sb() {
16654
+ function Cb() {
16651
16655
  let { customAlphabet: e } = (Hn(), s(Ln));
16652
16656
  return `h_${e("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
16653
16657
  }
16654
- function Cb(e) {
16658
+ function wb(e) {
16655
16659
  if (!(typeof e != "string" || !e)) try {
16656
16660
  let t = JSON.parse(e);
16657
16661
  return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
@@ -16659,8 +16663,8 @@ function Cb(e) {
16659
16663
  return;
16660
16664
  }
16661
16665
  }
16662
- function wb(e) {
16663
- let { tenant_id: t, created_at_ts: n, updated_at_ts: r, metadata: i, ...a } = e, o = _b({
16666
+ function Tb(e) {
16667
+ let { tenant_id: t, created_at_ts: n, updated_at_ts: r, metadata: i, ...a } = e, o = vb({
16664
16668
  created_at_ts: n,
16665
16669
  updated_at_ts: r
16666
16670
  }, ["created_at_ts", "updated_at_ts"]);
@@ -16668,15 +16672,15 @@ function wb(e) {
16668
16672
  ...a,
16669
16673
  enabled: !!a.enabled,
16670
16674
  synchronous: !!a.synchronous,
16671
- metadata: Cb(i),
16675
+ metadata: wb(i),
16672
16676
  ...o
16673
16677
  });
16674
16678
  }
16675
- function Tb(e) {
16679
+ function Eb(e) {
16676
16680
  return {
16677
16681
  async create(t, n) {
16678
16682
  let r = Date.now(), i = {
16679
- hook_id: n.hook_id || Sb(),
16683
+ hook_id: n.hook_id || Cb(),
16680
16684
  tenant_id: t,
16681
16685
  trigger_id: n.trigger_id,
16682
16686
  url: n.url,
@@ -16690,14 +16694,14 @@ function Tb(e) {
16690
16694
  created_at_ts: r,
16691
16695
  updated_at_ts: r
16692
16696
  };
16693
- return await e.insert(dn).values(i), wb({
16697
+ return await e.insert(dn).values(i), Tb({
16694
16698
  ...i,
16695
16699
  tenant_id: t
16696
16700
  });
16697
16701
  },
16698
16702
  async get(t, n) {
16699
16703
  let r = await e.select().from(dn).where(h(m(dn.tenant_id, t), m(dn.hook_id, n))).get();
16700
- return r ? wb(r) : null;
16704
+ return r ? Tb(r) : null;
16701
16705
  },
16702
16706
  async update(t, n, r) {
16703
16707
  let i = { updated_at_ts: Date.now() };
@@ -16711,7 +16715,7 @@ function Tb(e) {
16711
16715
  "code_id"
16712
16716
  ]) : void 0, l = c ? h(m(dn.tenant_id, t), c) : m(dn.tenant_id, t), u = e.select().from(dn).where(l).$dynamic(), d = o?.sort_by ? dn[o.sort_by] : void 0;
16713
16717
  u = d ? u.orderBy(o?.sort_order === "desc" ? Be(d) : ze(d)) : u.orderBy(Be(dn.priority), ze(dn.created_at_ts));
16714
- let f = (await u.offset(r * i).limit(i)).map(wb);
16718
+ let f = (await u.offset(r * i).limit(i)).map(Tb);
16715
16719
  if (!a) return { hooks: f };
16716
16720
  let [ee] = await e.select({ count: Ve() }).from(dn).where(l);
16717
16721
  return {
@@ -16728,26 +16732,26 @@ function Tb(e) {
16728
16732
  }
16729
16733
  //#endregion
16730
16734
  //#region src/adapters/invites.ts
16731
- function Eb() {
16735
+ function Db() {
16732
16736
  let { customAlphabet: e } = (Hn(), s(Ln));
16733
16737
  return `inv_${e("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
16734
16738
  }
16735
- var Db = [
16739
+ var Ob = [
16736
16740
  "inviter",
16737
16741
  "invitee",
16738
16742
  "app_metadata",
16739
16743
  "user_metadata",
16740
16744
  "roles"
16741
16745
  ];
16742
- function Ob(e) {
16746
+ function kb(e) {
16743
16747
  let { tenant_id: t, send_invitation_email: n, ...r } = e, i = { ...r };
16744
- for (let e of Db) i[e] = j(r[e], e === "roles" ? [] : {});
16748
+ for (let e of Ob) i[e] = j(r[e], e === "roles" ? [] : {});
16745
16749
  return i.send_invitation_email = !!n, A(i);
16746
16750
  }
16747
- function kb(e) {
16751
+ function Ab(e) {
16748
16752
  return {
16749
16753
  async create(t, n) {
16750
- let r = n.id || Eb(), i = n.ttl_sec || 604800, a = /* @__PURE__ */ new Date(), o = new Date(a.getTime() + i * 1e3).toISOString(), s = {
16754
+ let r = n.id || Db(), i = n.ttl_sec || 604800, a = /* @__PURE__ */ new Date(), o = new Date(a.getTime() + i * 1e3).toISOString(), s = {
16751
16755
  id: r,
16752
16756
  tenant_id: t,
16753
16757
  organization_id: n.organization_id,
@@ -16760,24 +16764,24 @@ function kb(e) {
16760
16764
  created_at: a.toISOString(),
16761
16765
  expires_at: o
16762
16766
  };
16763
- for (let e of Db) n[e] !== void 0 && (s[e] = JSON.stringify(n[e]));
16767
+ for (let e of Ob) n[e] !== void 0 && (s[e] = JSON.stringify(n[e]));
16764
16768
  try {
16765
16769
  await e.insert(Zt).values(s);
16766
16770
  } catch (e) {
16767
16771
  throw e?.message?.includes("UNIQUE constraint failed") || e?.message?.includes("duplicate key") ? new Tn(409, { message: "Invite already exists" }) : e;
16768
16772
  }
16769
- return Ob({
16773
+ return kb({
16770
16774
  ...s,
16771
16775
  tenant_id: t
16772
16776
  });
16773
16777
  },
16774
16778
  async get(t, n) {
16775
16779
  let r = await e.select().from(Zt).where(h(m(Zt.tenant_id, t), m(Zt.id, n))).get();
16776
- return r ? Ob(r) : null;
16780
+ return r ? kb(r) : null;
16777
16781
  },
16778
16782
  async update(t, n, r) {
16779
16783
  let i = {};
16780
- for (let e of Db) r[e] !== void 0 && (i[e] = JSON.stringify(r[e]));
16784
+ for (let e of Ob) r[e] !== void 0 && (i[e] = JSON.stringify(r[e]));
16781
16785
  return r.connection_id !== void 0 && (i.connection_id = r.connection_id), r.ttl_sec !== void 0 && (i.ttl_sec = r.ttl_sec, i.expires_at = new Date(Date.now() + r.ttl_sec * 1e3).toISOString()), (await e.update(Zt).set(i).where(h(m(Zt.tenant_id, t), m(Zt.id, n))).returning()).length > 0;
16782
16786
  },
16783
16787
  async list(t, n) {
@@ -16786,7 +16790,7 @@ function kb(e) {
16786
16790
  let e = Zt[o.sort_by];
16787
16791
  e && (s = s.orderBy(o.sort_order === "desc" ? Be(e) : ze(e)));
16788
16792
  }
16789
- let c = (await s.offset(r * i).limit(i)).map(Ob);
16793
+ let c = (await s.offset(r * i).limit(i)).map(kb);
16790
16794
  if (!a) return { invites: c };
16791
16795
  let [l] = await e.select({ count: Ve() }).from(Zt).where(m(Zt.tenant_id, t));
16792
16796
  return {
@@ -16803,7 +16807,7 @@ function kb(e) {
16803
16807
  }
16804
16808
  //#endregion
16805
16809
  //#region src/adapters/keys.ts
16806
- function Ab(e) {
16810
+ function jb(e) {
16807
16811
  return {
16808
16812
  async create(t) {
16809
16813
  await e.insert(pn).values({
@@ -16837,17 +16841,17 @@ function Ab(e) {
16837
16841
  }
16838
16842
  //#endregion
16839
16843
  //#region src/adapters/loginSessions.ts
16840
- var jb = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", Mb = 32;
16841
- function Nb() {
16844
+ var Mb = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", Nb = 32;
16845
+ function Pb() {
16842
16846
  let e = Date.now(), t = "";
16843
- for (let n = 10; n > 0; n--) t = jb.charAt(e % Mb) + t, e = Math.floor(e / Mb);
16847
+ for (let n = 10; n > 0; n--) t = Mb.charAt(e % Nb) + t, e = Math.floor(e / Nb);
16844
16848
  let n = new Uint8Array(16);
16845
16849
  crypto.getRandomValues(n);
16846
- for (let e = 0; e < 16; e++) t += jb.charAt(n[e] % Mb);
16850
+ for (let e = 0; e < 16; e++) t += Mb.charAt(n[e] % Nb);
16847
16851
  return t;
16848
16852
  }
16849
- function Pb(e) {
16850
- let { tenant_id: t, created_at_ts: n, updated_at_ts: r, expires_at_ts: i, state_data: a, auth_params: o, ...s } = e, c = _b({
16853
+ function Fb(e) {
16854
+ let { tenant_id: t, created_at_ts: n, updated_at_ts: r, expires_at_ts: i, state_data: a, auth_params: o, ...s } = e, c = vb({
16851
16855
  created_at_ts: n,
16852
16856
  updated_at_ts: r,
16853
16857
  expires_at_ts: i
@@ -16864,11 +16868,11 @@ function Pb(e) {
16864
16868
  state_data: j(a)
16865
16869
  });
16866
16870
  }
16867
- function Fb(e) {
16871
+ function Ib(e) {
16868
16872
  return {
16869
16873
  async create(t, n) {
16870
16874
  let r = Date.now(), i = {
16871
- id: Nb(),
16875
+ id: Pb(),
16872
16876
  tenant_id: t,
16873
16877
  session_id: n.session_id,
16874
16878
  csrf_token: n.csrf_token,
@@ -16887,20 +16891,20 @@ function Fb(e) {
16887
16891
  authenticated_at: n.authenticated_at,
16888
16892
  created_at_ts: r,
16889
16893
  updated_at_ts: r,
16890
- expires_at_ts: n.expires_at ? gb(n.expires_at) : r + 1e3 * 60 * 60 * 24
16894
+ expires_at_ts: n.expires_at ? _b(n.expires_at) : r + 1e3 * 60 * 60 * 24
16891
16895
  };
16892
- return await e.insert(C).values(i), Pb({
16896
+ return await e.insert(C).values(i), Fb({
16893
16897
  ...i,
16894
16898
  tenant_id: t
16895
16899
  });
16896
16900
  },
16897
16901
  async get(t, n) {
16898
16902
  let r = t ? h(m(C.tenant_id, t), m(C.id, n)) : m(C.id, n), i = await e.select().from(C).where(r).get();
16899
- return i ? Pb(i) : null;
16903
+ return i ? Fb(i) : null;
16900
16904
  },
16901
16905
  async update(t, n, r) {
16902
16906
  let i = { updated_at_ts: Date.now() };
16903
- if (r.session_id !== void 0 && (i.session_id = r.session_id), r.state !== void 0 && (i.state = r.state), r.state_data !== void 0 && (i.state_data = JSON.stringify(r.state_data)), r.failure_reason !== void 0 && (i.failure_reason = r.failure_reason), r.user_id !== void 0 && (i.user_id = r.user_id), r.auth_connection !== void 0 && (i.auth_connection = r.auth_connection), r.auth_strategy !== void 0 && (i.auth_strategy_strategy = r.auth_strategy?.strategy, i.auth_strategy_strategy_type = r.auth_strategy?.strategy_type), r.authenticated_at !== void 0 && (i.authenticated_at = r.authenticated_at), r.authorization_url !== void 0 && (i.authorization_url = r.authorization_url?.substring(0, 1024)), r.expires_at !== void 0 && (i.expires_at_ts = gb(r.expires_at)), r.authParams !== void 0) {
16907
+ if (r.session_id !== void 0 && (i.session_id = r.session_id), r.state !== void 0 && (i.state = r.state), r.state_data !== void 0 && (i.state_data = JSON.stringify(r.state_data)), r.failure_reason !== void 0 && (i.failure_reason = r.failure_reason), r.user_id !== void 0 && (i.user_id = r.user_id), r.auth_connection !== void 0 && (i.auth_connection = r.auth_connection), r.auth_strategy !== void 0 && (i.auth_strategy_strategy = r.auth_strategy?.strategy, i.auth_strategy_strategy_type = r.auth_strategy?.strategy_type), r.authenticated_at !== void 0 && (i.authenticated_at = r.authenticated_at), r.authorization_url !== void 0 && (i.authorization_url = r.authorization_url?.substring(0, 1024)), r.expires_at !== void 0 && (i.expires_at_ts = _b(r.expires_at)), r.authParams !== void 0) {
16904
16908
  let a = await e.select({ auth_params: C.auth_params }).from(C).where(h(m(C.tenant_id, t), m(C.id, n))).get(), o = a?.auth_params && typeof a.auth_params == "string" && a.auth_params.length > 0 ? JSON.parse(a.auth_params) : {};
16905
16909
  i.auth_params = JSON.stringify({
16906
16910
  ...o,
@@ -16917,7 +16921,7 @@ function Fb(e) {
16917
16921
  //#endregion
16918
16922
  //#region src/adapters/logs.ts
16919
16923
  Hn();
16920
- function Ib(e) {
16924
+ function Lb(e) {
16921
16925
  let { tenant_id: t, isMobile: n, auth0_client: r, details: i, country_code: a, city_name: o, latitude: s, longitude: c, time_zone: l, continent_code: u, scope: d, ...f } = e, ee = {
16922
16926
  ...f,
16923
16927
  isMobile: !!n,
@@ -16934,7 +16938,7 @@ function Ib(e) {
16934
16938
  continent_code: u
16935
16939
  })), A(ee);
16936
16940
  }
16937
- function Lb(e) {
16941
+ function Rb(e) {
16938
16942
  return {
16939
16943
  async create(t, n) {
16940
16944
  let r = {
@@ -16960,7 +16964,7 @@ function Lb(e) {
16960
16964
  hostname: n.hostname,
16961
16965
  session_connection: n.session_connection
16962
16966
  };
16963
- return n.auth0_client && (r.auth0_client = JSON.stringify(n.auth0_client)), n.details && (r.details = JSON.stringify(n.details).substring(0, 8192)), n.location_info && (r.country_code = n.location_info.country_code, r.city_name = n.location_info.city_name, r.latitude = n.location_info.latitude, r.longitude = n.location_info.longitude, r.time_zone = n.location_info.time_zone, r.continent_code = n.location_info.continent_code), await e.insert(D).values(r), Ib({
16967
+ return n.auth0_client && (r.auth0_client = JSON.stringify(n.auth0_client)), n.details && (r.details = JSON.stringify(n.details).substring(0, 8192)), n.location_info && (r.country_code = n.location_info.country_code, r.city_name = n.location_info.city_name, r.latitude = n.location_info.latitude, r.longitude = n.location_info.longitude, r.time_zone = n.location_info.time_zone, r.continent_code = n.location_info.continent_code), await e.insert(D).values(r), Lb({
16964
16968
  ...r,
16965
16969
  tenant_id: t
16966
16970
  });
@@ -16982,7 +16986,7 @@ function Lb(e) {
16982
16986
  let e = D[o.sort_by];
16983
16987
  e && (f = f.orderBy(o.sort_order === "desc" ? Be(e) : ze(e)));
16984
16988
  } else f = f.orderBy(Be(D.date));
16985
- let ee = (await f.offset(r * i).limit(i)).map(Ib);
16989
+ let ee = (await f.offset(r * i).limit(i)).map(Lb);
16986
16990
  if (!a) return { logs: ee };
16987
16991
  let [te] = await e.select({ count: Ve() }).from(D).where(d);
16988
16992
  return {
@@ -16994,37 +16998,37 @@ function Lb(e) {
16994
16998
  },
16995
16999
  async get(t, n) {
16996
17000
  let r = await e.select().from(D).where(h(m(D.tenant_id, t), m(D.log_id, n))).get();
16997
- return r ? Ib(r) : null;
17001
+ return r ? Lb(r) : null;
16998
17002
  }
16999
17003
  };
17000
17004
  }
17001
17005
  //#endregion
17002
17006
  //#region src/adapters/authenticationMethods.ts
17003
- var Rb = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", zb = 32;
17004
- function Bb() {
17007
+ var zb = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", Bb = 32;
17008
+ function Vb() {
17005
17009
  let e = Date.now(), t = "";
17006
- for (let n = 10; n > 0; n--) t = Rb.charAt(e % zb) + t, e = Math.floor(e / zb);
17010
+ for (let n = 10; n > 0; n--) t = zb.charAt(e % Bb) + t, e = Math.floor(e / Bb);
17007
17011
  let n = new Uint8Array(16);
17008
17012
  crypto.getRandomValues(n);
17009
- for (let e = 0; e < 16; e++) t += Rb.charAt(n[e] % zb);
17013
+ for (let e = 0; e < 16; e++) t += zb.charAt(n[e] % Bb);
17010
17014
  return t;
17011
17015
  }
17012
- function Vb(e) {
17016
+ function Hb(e) {
17013
17017
  let { tenant_id: t, created_at_ts: n, updated_at_ts: r, credential_backed_up: i, confirmed: a, transports: o, ...s } = e;
17014
17018
  return A({
17015
17019
  ...s,
17016
17020
  confirmed: !!a,
17017
17021
  credential_backed_up: i == null ? void 0 : !!i,
17018
17022
  transports: j(o),
17019
- created_at: hb(n),
17020
- updated_at: hb(r)
17023
+ created_at: gb(n),
17024
+ updated_at: gb(r)
17021
17025
  });
17022
17026
  }
17023
- function Hb(e) {
17027
+ function Ub(e) {
17024
17028
  return {
17025
17029
  async create(t, n) {
17026
17030
  let r = Date.now(), i = {
17027
- id: n.id || Bb(),
17031
+ id: n.id || Vb(),
17028
17032
  tenant_id: t,
17029
17033
  user_id: n.user_id,
17030
17034
  type: n.type,
@@ -17040,21 +17044,21 @@ function Hb(e) {
17040
17044
  created_at_ts: r,
17041
17045
  updated_at_ts: r
17042
17046
  };
17043
- return await e.insert(hn).values(i), Vb({
17047
+ return await e.insert(hn).values(i), Hb({
17044
17048
  ...i,
17045
17049
  tenant_id: t
17046
17050
  });
17047
17051
  },
17048
17052
  async get(t, n) {
17049
17053
  let r = await e.select().from(hn).where(h(m(hn.tenant_id, t), m(hn.id, n))).get();
17050
- return r ? Vb(r) : null;
17054
+ return r ? Hb(r) : null;
17051
17055
  },
17052
17056
  async getByCredentialId(t, n) {
17053
17057
  let r = await e.select().from(hn).where(h(m(hn.tenant_id, t), m(hn.credential_id, n))).get();
17054
- return r ? Vb(r) : null;
17058
+ return r ? Hb(r) : null;
17055
17059
  },
17056
17060
  async list(t, n) {
17057
- return (await e.select().from(hn).where(h(m(hn.tenant_id, t), m(hn.user_id, n))).all()).map(Vb);
17061
+ return (await e.select().from(hn).where(h(m(hn.tenant_id, t), m(hn.user_id, n))).all()).map(Hb);
17058
17062
  },
17059
17063
  async update(t, n, r) {
17060
17064
  let i = { updated_at_ts: Date.now() };
@@ -17070,11 +17074,11 @@ function Hb(e) {
17070
17074
  }
17071
17075
  //#endregion
17072
17076
  //#region src/adapters/organizations.ts
17073
- function Ub() {
17077
+ function Wb() {
17074
17078
  let { customAlphabet: e } = (Hn(), s(Ln));
17075
17079
  return `org_${e("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
17076
17080
  }
17077
- function Wb(e) {
17081
+ function Gb(e) {
17078
17082
  let { tenant_id: t, branding: n, metadata: r, enabled_connections: i, token_quota: a, ...o } = e;
17079
17083
  return A({
17080
17084
  ...o,
@@ -17084,11 +17088,11 @@ function Wb(e) {
17084
17088
  token_quota: j(a, {})
17085
17089
  });
17086
17090
  }
17087
- function Gb(e) {
17091
+ function Kb(e) {
17088
17092
  return {
17089
17093
  async create(t, n) {
17090
17094
  let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
17091
- id: n.id || Ub(),
17095
+ id: n.id || Wb(),
17092
17096
  tenant_id: t,
17093
17097
  name: n.name,
17094
17098
  display_name: n.display_name,
@@ -17104,14 +17108,14 @@ function Gb(e) {
17104
17108
  } catch (e) {
17105
17109
  throw e?.message?.includes("UNIQUE constraint failed") || e?.message?.includes("AlreadyExists") ? new Tn(409, { message: "Organization already exists" }) : e;
17106
17110
  }
17107
- return Wb({
17111
+ return Gb({
17108
17112
  ...i,
17109
17113
  tenant_id: t
17110
17114
  });
17111
17115
  },
17112
17116
  async get(t, n) {
17113
17117
  let r = await e.select().from(Yt).where(h(m(Yt.tenant_id, t), m(Yt.id, n))).get();
17114
- return r ||= await e.select().from(Yt).where(h(m(Yt.tenant_id, t), m(Yt.name, n))).get(), r ? Wb(r) : null;
17118
+ return r ||= await e.select().from(Yt).where(h(m(Yt.tenant_id, t), m(Yt.name, n))).get(), r ? Gb(r) : null;
17115
17119
  },
17116
17120
  async update(t, n, r) {
17117
17121
  let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
@@ -17123,7 +17127,7 @@ function Gb(e) {
17123
17127
  let e = Yt[o.sort_by];
17124
17128
  e && (c = c.orderBy(o.sort_order === "desc" ? Be(e) : ze(e)));
17125
17129
  }
17126
- let l = (await c.offset(r * i).limit(i)).map(Wb);
17130
+ let l = (await c.offset(r * i).limit(i)).map(Gb);
17127
17131
  if (!a) return { organizations: l };
17128
17132
  let u = [m(Yt.tenant_id, t)];
17129
17133
  s && u.push(Ae(Re(Yt.name, `%${s}%`), Re(Yt.display_name, `%${s}%`)));
@@ -17143,14 +17147,14 @@ function Gb(e) {
17143
17147
  //#endregion
17144
17148
  //#region src/adapters/passwords.ts
17145
17149
  Hn();
17146
- function Kb(e) {
17150
+ function qb(e) {
17147
17151
  let { tenant_id: t, is_current: n, ...r } = e;
17148
17152
  return {
17149
17153
  ...r,
17150
17154
  is_current: !!n
17151
17155
  };
17152
17156
  }
17153
- function qb(e) {
17157
+ function Jb(e) {
17154
17158
  return {
17155
17159
  async create(t, n) {
17156
17160
  let r = (/* @__PURE__ */ new Date()).toISOString(), i = n.id || Vn();
@@ -17165,18 +17169,18 @@ function qb(e) {
17165
17169
  created_at: r,
17166
17170
  updated_at: r
17167
17171
  };
17168
- return await e.insert(zt).values(a), Kb({
17172
+ return await e.insert(zt).values(a), qb({
17169
17173
  ...a,
17170
17174
  tenant_id: t
17171
17175
  });
17172
17176
  },
17173
17177
  async get(t, n) {
17174
17178
  let r = await e.select().from(zt).where(h(m(zt.tenant_id, t), m(zt.user_id, n), m(zt.is_current, 1))).get();
17175
- return r ? Kb(r) : null;
17179
+ return r ? qb(r) : null;
17176
17180
  },
17177
17181
  async list(t, n, r) {
17178
17182
  let i = e.select().from(zt).where(h(m(zt.tenant_id, t), m(zt.user_id, n))).orderBy(Be(zt.created_at)).$dynamic();
17179
- return r && (i = i.limit(r)), (await i).map(Kb);
17183
+ return r && (i = i.limit(r)), (await i).map(qb);
17180
17184
  },
17181
17185
  async update(t, n) {
17182
17186
  let r = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
@@ -17186,7 +17190,7 @@ function qb(e) {
17186
17190
  }
17187
17191
  //#endregion
17188
17192
  //#region src/adapters/promptSettings.ts
17189
- function Jb(e) {
17193
+ function Yb(e) {
17190
17194
  return {
17191
17195
  async get(t) {
17192
17196
  let n = await e.select().from(cn).where(m(cn.tenant_id, t)).get();
@@ -17224,22 +17228,22 @@ function Jb(e) {
17224
17228
  //#endregion
17225
17229
  //#region src/adapters/proxyRoutes.ts
17226
17230
  Hn();
17227
- function Yb(e) {
17231
+ function Xb(e) {
17228
17232
  if (!e) return { path: "/*" };
17229
17233
  try {
17230
- let t = JSON.parse(e), n = Ny.safeParse(t);
17234
+ let t = JSON.parse(e), n = Py.safeParse(t);
17231
17235
  if (n.success) return n.data;
17232
17236
  } catch {}
17233
17237
  return { path: "/*" };
17234
17238
  }
17235
- function Xb(e) {
17239
+ function Zb(e) {
17236
17240
  if (!e) return [];
17237
17241
  try {
17238
17242
  let t = JSON.parse(e);
17239
17243
  if (!Array.isArray(t)) return [];
17240
17244
  let n = [];
17241
17245
  for (let e of t) {
17242
- let t = Py.safeParse(e);
17246
+ let t = Fy.safeParse(e);
17243
17247
  t.success && n.push(t.data);
17244
17248
  }
17245
17249
  return n;
@@ -17247,19 +17251,19 @@ function Xb(e) {
17247
17251
  return [];
17248
17252
  }
17249
17253
  }
17250
- function Zb(e) {
17254
+ function Qb(e) {
17251
17255
  return {
17252
17256
  id: e.id,
17253
17257
  tenant_id: e.tenant_id,
17254
17258
  custom_domain_id: e.custom_domain_id,
17255
17259
  priority: e.priority,
17256
- match: Yb(e.match),
17257
- handlers: Xb(e.handlers),
17260
+ match: Xb(e.match),
17261
+ handlers: Zb(e.handlers),
17258
17262
  created_at: e.created_at,
17259
17263
  updated_at: e.updated_at
17260
17264
  };
17261
17265
  }
17262
- function Qb(e) {
17266
+ function $b(e) {
17263
17267
  return {
17264
17268
  async create(t, n) {
17265
17269
  let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
@@ -17285,14 +17289,14 @@ function Qb(e) {
17285
17289
  },
17286
17290
  async get(t, n) {
17287
17291
  let r = await e.select().from(k).where(h(m(k.tenant_id, t), m(k.id, n))).limit(1);
17288
- return r[0] ? Zb(r[0]) : null;
17292
+ return r[0] ? Qb(r[0]) : null;
17289
17293
  },
17290
17294
  async list(t, n = {}) {
17291
17295
  let r = n.page ?? 0, i = n.per_page ?? 50, a = [m(k.tenant_id, t)];
17292
17296
  n.custom_domain_id && a.push(m(k.custom_domain_id, n.custom_domain_id));
17293
17297
  let o = await e.select().from(k).where(h(...a)).orderBy(ze(k.priority), ze(k.created_at)).offset(r * i).limit(i);
17294
17298
  return {
17295
- proxy_routes: o.map(Zb),
17299
+ proxy_routes: o.map(Qb),
17296
17300
  start: r * i,
17297
17301
  limit: i,
17298
17302
  length: o.length
@@ -17312,8 +17316,8 @@ function Qb(e) {
17312
17316
  //#endregion
17313
17317
  //#region src/adapters/refreshTokens.ts
17314
17318
  Hn();
17315
- function $b(e) {
17316
- let { tenant_id: t, created_at_ts: n, expires_at_ts: r, idle_expires_at_ts: i, last_exchanged_at_ts: a, revoked_at_ts: o, rotated_at_ts: s, device: c, resource_servers: l, rotating: u, ...d } = e, f = _b({
17319
+ function ex(e) {
17320
+ let { tenant_id: t, created_at_ts: n, expires_at_ts: r, idle_expires_at_ts: i, last_exchanged_at_ts: a, revoked_at_ts: o, rotated_at_ts: s, device: c, resource_servers: l, rotating: u, ...d } = e, f = vb({
17317
17321
  created_at_ts: n,
17318
17322
  expires_at_ts: r,
17319
17323
  idle_expires_at_ts: i,
@@ -17335,10 +17339,10 @@ function $b(e) {
17335
17339
  resource_servers: j(l, [])
17336
17340
  });
17337
17341
  }
17338
- function ex(e, t) {
17342
+ function tx(e, t) {
17339
17343
  return Math.max(e ?? 0, t ?? 0);
17340
17344
  }
17341
- function tx(e) {
17345
+ function nx(e) {
17342
17346
  return {
17343
17347
  async create(t, n) {
17344
17348
  let r = Date.now(), i = {
@@ -17354,16 +17358,16 @@ function tx(e) {
17354
17358
  token_hash: n.token_hash ?? null,
17355
17359
  family_id: n.family_id ?? null,
17356
17360
  rotated_to: n.rotated_to ?? null,
17357
- rotated_at_ts: gb(n.rotated_at),
17361
+ rotated_at_ts: _b(n.rotated_at),
17358
17362
  created_at_ts: r,
17359
- expires_at_ts: gb(n.expires_at),
17360
- idle_expires_at_ts: gb(n.idle_expires_at),
17361
- last_exchanged_at_ts: gb(n.last_exchanged_at)
17363
+ expires_at_ts: _b(n.expires_at),
17364
+ idle_expires_at_ts: _b(n.idle_expires_at),
17365
+ last_exchanged_at_ts: _b(n.last_exchanged_at)
17362
17366
  };
17363
17367
  await e.run(p`BEGIN`);
17364
17368
  try {
17365
17369
  await e.insert(S).values(i);
17366
- let n = ex(i.expires_at_ts, i.idle_expires_at_ts);
17370
+ let n = tx(i.expires_at_ts, i.idle_expires_at_ts);
17367
17371
  n > 0 && i.login_id && await e.update(C).set({
17368
17372
  expires_at_ts: n,
17369
17373
  updated_at_ts: r
@@ -17371,23 +17375,23 @@ function tx(e) {
17371
17375
  } catch (t) {
17372
17376
  throw await e.run(p`ROLLBACK`), t;
17373
17377
  }
17374
- return $b({
17378
+ return ex({
17375
17379
  ...i,
17376
17380
  tenant_id: t
17377
17381
  });
17378
17382
  },
17379
17383
  async get(t, n) {
17380
17384
  let r = await e.select().from(S).where(h(m(S.tenant_id, t), m(S.id, n))).get();
17381
- return r ? $b(r) : null;
17385
+ return r ? ex(r) : null;
17382
17386
  },
17383
17387
  async getByLookup(t, n) {
17384
17388
  let r = await e.select().from(S).where(h(m(S.tenant_id, t), m(S.token_lookup, n))).get();
17385
- return r ? $b(r) : null;
17389
+ return r ? ex(r) : null;
17386
17390
  },
17387
17391
  async update(t, n, r, i) {
17388
17392
  let a = {};
17389
- r.device !== void 0 && (a.device = JSON.stringify(r.device)), r.resource_servers !== void 0 && (a.resource_servers = JSON.stringify(r.resource_servers)), r.rotating !== void 0 && (a.rotating = r.rotating), r.token_lookup !== void 0 && (a.token_lookup = r.token_lookup), r.token_hash !== void 0 && (a.token_hash = r.token_hash), r.family_id !== void 0 && (a.family_id = r.family_id), r.rotated_to !== void 0 && (a.rotated_to = r.rotated_to), r.rotated_at !== void 0 && (a.rotated_at_ts = gb(r.rotated_at)), r.expires_at !== void 0 && (a.expires_at_ts = gb(r.expires_at)), r.idle_expires_at !== void 0 && (a.idle_expires_at_ts = gb(r.idle_expires_at)), r.last_exchanged_at !== void 0 && (a.last_exchanged_at_ts = gb(r.last_exchanged_at)), r.revoked_at !== void 0 && (a.revoked_at_ts = gb(r.revoked_at));
17390
- let o = i?.loginSessionBump, s = o ? gb(o.expires_at) : null, c = await e.update(S).set(a).where(h(m(S.tenant_id, t), m(S.id, n))).returning();
17393
+ r.device !== void 0 && (a.device = JSON.stringify(r.device)), r.resource_servers !== void 0 && (a.resource_servers = JSON.stringify(r.resource_servers)), r.rotating !== void 0 && (a.rotating = r.rotating), r.token_lookup !== void 0 && (a.token_lookup = r.token_lookup), r.token_hash !== void 0 && (a.token_hash = r.token_hash), r.family_id !== void 0 && (a.family_id = r.family_id), r.rotated_to !== void 0 && (a.rotated_to = r.rotated_to), r.rotated_at !== void 0 && (a.rotated_at_ts = _b(r.rotated_at)), r.expires_at !== void 0 && (a.expires_at_ts = _b(r.expires_at)), r.idle_expires_at !== void 0 && (a.idle_expires_at_ts = _b(r.idle_expires_at)), r.last_exchanged_at !== void 0 && (a.last_exchanged_at_ts = _b(r.last_exchanged_at)), r.revoked_at !== void 0 && (a.revoked_at_ts = _b(r.revoked_at));
17394
+ let o = i?.loginSessionBump, s = o ? _b(o.expires_at) : null, c = await e.update(S).set(a).where(h(m(S.tenant_id, t), m(S.id, n))).returning();
17391
17395
  return o?.login_id && s && s > 0 && await e.update(C).set({
17392
17396
  expires_at_ts: s,
17393
17397
  updated_at_ts: Date.now()
@@ -17403,7 +17407,7 @@ function tx(e) {
17403
17407
  let e = S[o.sort_by];
17404
17408
  e && (c = c.orderBy(o.sort_order === "desc" ? Be(e) : ze(e)));
17405
17409
  }
17406
- let l = (await c.offset(r * i).limit(i)).map($b);
17410
+ let l = (await c.offset(r * i).limit(i)).map(ex);
17407
17411
  if (!a) return { refresh_tokens: l };
17408
17412
  let [u] = await e.select({ count: Ve() }).from(S).where(m(S.tenant_id, t));
17409
17413
  return {
@@ -17417,24 +17421,24 @@ function tx(e) {
17417
17421
  return (await e.delete(S).where(h(m(S.tenant_id, t), m(S.id, n))).returning()).length > 0;
17418
17422
  },
17419
17423
  async revokeByLoginSession(t, n, r) {
17420
- return (await e.update(S).set({ revoked_at_ts: gb(r) }).where(h(m(S.tenant_id, t), m(S.login_id, n), Ie(S.revoked_at_ts))).returning()).length;
17424
+ return (await e.update(S).set({ revoked_at_ts: _b(r) }).where(h(m(S.tenant_id, t), m(S.login_id, n), Ie(S.revoked_at_ts))).returning()).length;
17421
17425
  },
17422
17426
  async revokeFamily(t, n, r) {
17423
- return (await e.update(S).set({ revoked_at_ts: gb(r) }).where(h(m(S.tenant_id, t), m(S.family_id, n), Ie(S.revoked_at_ts))).returning()).length;
17427
+ return (await e.update(S).set({ revoked_at_ts: _b(r) }).where(h(m(S.tenant_id, t), m(S.family_id, n), Ie(S.revoked_at_ts))).returning()).length;
17424
17428
  }
17425
17429
  };
17426
17430
  }
17427
17431
  //#endregion
17428
17432
  //#region src/adapters/resourceServers.ts
17429
- function nx() {
17433
+ function rx() {
17430
17434
  let { customAlphabet: e } = (Hn(), s(Ln));
17431
17435
  return `api_${e("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
17432
17436
  }
17433
- var rx = [
17437
+ var ix = [
17434
17438
  "skip_consent_for_verifiable_first_party_clients",
17435
17439
  "allow_offline_access",
17436
17440
  "is_system"
17437
- ], ix = new Set([
17441
+ ], ax = new Set([
17438
17442
  "id",
17439
17443
  "tenant_id",
17440
17444
  "identifier",
@@ -17453,17 +17457,17 @@ var rx = [
17453
17457
  "created_at",
17454
17458
  "updated_at"
17455
17459
  ]);
17456
- function ax(e) {
17460
+ function ox(e) {
17457
17461
  let { tenant_id: t, verification_key: n, scopes: r, options: i, metadata: a, ...o } = e, s = { ...o };
17458
17462
  s.scopes = j(r, []), s.options = j(i, {}), s.metadata = j(a), n !== void 0 && (s.verificationKey = n);
17459
- for (let e of rx) o[e] !== void 0 && o[e] !== null && (s[e] = !!o[e]);
17463
+ for (let e of ix) o[e] !== void 0 && o[e] !== null && (s[e] = !!o[e]);
17460
17464
  return A(s);
17461
17465
  }
17462
- function ox(e) {
17466
+ function sx(e) {
17463
17467
  return {
17464
17468
  async create(t, n) {
17465
17469
  let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
17466
- id: n.id || nx(),
17470
+ id: n.id || rx(),
17467
17471
  tenant_id: t,
17468
17472
  identifier: n.identifier,
17469
17473
  name: n.name,
@@ -17478,20 +17482,20 @@ function ox(e) {
17478
17482
  created_at: r,
17479
17483
  updated_at: r
17480
17484
  };
17481
- for (let e of rx) n[e] !== void 0 && (i[e] = +!!n[e]);
17482
- return i.is_system === void 0 && (i.is_system = 0), await e.insert(E).values(i), ax({
17485
+ for (let e of ix) n[e] !== void 0 && (i[e] = +!!n[e]);
17486
+ return i.is_system === void 0 && (i.is_system = 0), await e.insert(E).values(i), ox({
17483
17487
  ...i,
17484
17488
  tenant_id: t
17485
17489
  });
17486
17490
  },
17487
17491
  async get(t, n) {
17488
17492
  let r = await e.select().from(E).where(h(m(E.tenant_id, t), m(E.id, n))).get();
17489
- return r ? ax(r) : null;
17493
+ return r ? ox(r) : null;
17490
17494
  },
17491
17495
  async update(t, n, r) {
17492
17496
  let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
17493
17497
  r.name !== void 0 && (i.name = r.name), r.identifier !== void 0 && (i.identifier = r.identifier), r.signing_alg !== void 0 && (i.signing_alg = r.signing_alg), r.signing_secret !== void 0 && (i.signing_secret = r.signing_secret), r.token_lifetime !== void 0 && (i.token_lifetime = r.token_lifetime), r.token_lifetime_for_web !== void 0 && (i.token_lifetime_for_web = r.token_lifetime_for_web), r.scopes !== void 0 && (i.scopes = JSON.stringify(r.scopes)), r.options !== void 0 && (i.options = p`json_patch(COALESCE(${E.options}, '{}'), ${JSON.stringify(r.options)})`), r.metadata !== void 0 && (i.metadata = JSON.stringify(r.metadata)), r.verificationKey !== void 0 && (i.verification_key = r.verificationKey);
17494
- for (let e of rx) r[e] !== void 0 && (i[e] = +!!r[e]);
17498
+ for (let e of ix) r[e] !== void 0 && (i[e] = +!!r[e]);
17495
17499
  return (await e.update(E).set(i).where(h(m(E.tenant_id, t), m(E.id, n))).returning()).length > 0;
17496
17500
  },
17497
17501
  async list(t, n) {
@@ -17500,18 +17504,18 @@ function ox(e) {
17500
17504
  let e = s.match(/^([^:]+):(.+)$/);
17501
17505
  if (e) {
17502
17506
  let [, t, n] = e, r = t?.startsWith("-"), i = r ? t?.substring(1) : t;
17503
- if (i && ix.has(i) && !r) {
17507
+ if (i && ax.has(i) && !r) {
17504
17508
  let e = E[i];
17505
17509
  u.push(Re(e, `%${n}%`));
17506
17510
  }
17507
17511
  }
17508
17512
  }
17509
17513
  let d = e.select().from(E).where(h(...u)).$dynamic();
17510
- if (o?.sort_by && ix.has(o.sort_by)) {
17514
+ if (o?.sort_by && ax.has(o.sort_by)) {
17511
17515
  let e = E[o.sort_by];
17512
17516
  d = d.orderBy(o.sort_order === "desc" ? Be(e) : ze(e));
17513
17517
  }
17514
- let f = (await d.offset(c * l).limit(l)).map(ax);
17518
+ let f = (await d.offset(c * l).limit(l)).map(ox);
17515
17519
  if (!a) return { resource_servers: f };
17516
17520
  let [ee] = await e.select({ count: Ve() }).from(E).where(h(...u));
17517
17521
  return {
@@ -17528,7 +17532,7 @@ function ox(e) {
17528
17532
  }
17529
17533
  //#endregion
17530
17534
  //#region src/adapters/rolePermissions.ts
17531
- function sx(e) {
17535
+ function cx(e) {
17532
17536
  return {
17533
17537
  async assign(t, n, r) {
17534
17538
  let i = (/* @__PURE__ */ new Date()).toISOString();
@@ -17566,7 +17570,7 @@ function sx(e) {
17566
17570
  }
17567
17571
  //#endregion
17568
17572
  //#region src/adapters/userPermissions.ts
17569
- function cx(e) {
17573
+ function lx(e) {
17570
17574
  return {
17571
17575
  async create(t, n, r, i) {
17572
17576
  try {
@@ -17606,7 +17610,7 @@ function cx(e) {
17606
17610
  //#endregion
17607
17611
  //#region src/adapters/roles.ts
17608
17612
  Hn();
17609
- function lx(e) {
17613
+ function ux(e) {
17610
17614
  let { tenant_id: t, is_system: n, metadata: r, ...i } = e;
17611
17615
  return A({
17612
17616
  ...i,
@@ -17614,7 +17618,7 @@ function lx(e) {
17614
17618
  metadata: j(r)
17615
17619
  });
17616
17620
  }
17617
- function ux(e) {
17621
+ function dx(e) {
17618
17622
  return {
17619
17623
  async create(t, n) {
17620
17624
  let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
@@ -17627,14 +17631,14 @@ function ux(e) {
17627
17631
  created_at: r,
17628
17632
  updated_at: r
17629
17633
  };
17630
- return await e.insert(Qt).values(i), lx({
17634
+ return await e.insert(Qt).values(i), ux({
17631
17635
  ...i,
17632
17636
  tenant_id: t
17633
17637
  });
17634
17638
  },
17635
17639
  async get(t, n) {
17636
17640
  let r = await e.select().from(Qt).where(h(m(Qt.tenant_id, t), m(Qt.id, n))).get();
17637
- return r ? lx(r) : null;
17641
+ return r ? ux(r) : null;
17638
17642
  },
17639
17643
  async update(t, n, r) {
17640
17644
  let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
@@ -17646,7 +17650,7 @@ function ux(e) {
17646
17650
  let e = Qt[o.sort_by];
17647
17651
  e && (u = u.orderBy(o.sort_order === "desc" ? Be(e) : ze(e)));
17648
17652
  }
17649
- let d = (await u.offset(r * i).limit(i)).map(lx);
17653
+ let d = (await u.offset(r * i).limit(i)).map(ux);
17650
17654
  if (!a) return { roles: d };
17651
17655
  let [f] = await e.select({ count: Ve() }).from(Qt).where(l);
17652
17656
  return {
@@ -17664,7 +17668,7 @@ function ux(e) {
17664
17668
  //#endregion
17665
17669
  //#region src/adapters/sessions.ts
17666
17670
  Hn();
17667
- var dx = ["created_at_ts", "updated_at_ts"], fx = [
17671
+ var fx = ["created_at_ts", "updated_at_ts"], px = [
17668
17672
  "expires_at_ts",
17669
17673
  "idle_expires_at_ts",
17670
17674
  "authenticated_at_ts",
@@ -17672,8 +17676,8 @@ var dx = ["created_at_ts", "updated_at_ts"], fx = [
17672
17676
  "used_at_ts",
17673
17677
  "revoked_at_ts"
17674
17678
  ];
17675
- function px(e) {
17676
- let { tenant_id: t, created_at_ts: n, updated_at_ts: r, expires_at_ts: i, idle_expires_at_ts: a, authenticated_at_ts: o, last_interaction_at_ts: s, used_at_ts: c, revoked_at_ts: l, device: u, clients: d, ...f } = e, ee = _b({
17679
+ function mx(e) {
17680
+ let { tenant_id: t, created_at_ts: n, updated_at_ts: r, expires_at_ts: i, idle_expires_at_ts: a, authenticated_at_ts: o, last_interaction_at_ts: s, used_at_ts: c, revoked_at_ts: l, device: u, clients: d, ...f } = e, ee = vb({
17677
17681
  created_at_ts: n,
17678
17682
  updated_at_ts: r,
17679
17683
  expires_at_ts: i,
@@ -17682,7 +17686,7 @@ function px(e) {
17682
17686
  last_interaction_at_ts: s,
17683
17687
  used_at_ts: c,
17684
17688
  revoked_at_ts: l
17685
- }, [...dx], [...fx]);
17689
+ }, [...fx], [...px]);
17686
17690
  return A({
17687
17691
  ...f,
17688
17692
  ...ee,
@@ -17690,7 +17694,7 @@ function px(e) {
17690
17694
  clients: j(d, [])
17691
17695
  });
17692
17696
  }
17693
- function mx(e) {
17697
+ function hx(e) {
17694
17698
  return {
17695
17699
  async create(t, n) {
17696
17700
  let r = Date.now(), i = {
@@ -17702,25 +17706,25 @@ function mx(e) {
17702
17706
  clients: JSON.stringify(n.clients || []),
17703
17707
  created_at_ts: r,
17704
17708
  updated_at_ts: r,
17705
- expires_at_ts: gb(n.expires_at),
17706
- idle_expires_at_ts: gb(n.idle_expires_at),
17707
- authenticated_at_ts: n.authenticated_at ? gb(n.authenticated_at) : r,
17708
- last_interaction_at_ts: n.last_interaction_at ? gb(n.last_interaction_at) : r,
17709
- used_at_ts: gb(n.used_at),
17710
- revoked_at_ts: gb(n.revoked_at)
17709
+ expires_at_ts: _b(n.expires_at),
17710
+ idle_expires_at_ts: _b(n.idle_expires_at),
17711
+ authenticated_at_ts: n.authenticated_at ? _b(n.authenticated_at) : r,
17712
+ last_interaction_at_ts: n.last_interaction_at ? _b(n.last_interaction_at) : r,
17713
+ used_at_ts: _b(n.used_at),
17714
+ revoked_at_ts: _b(n.revoked_at)
17711
17715
  };
17712
- return await e.insert(Bt).values(i), px({
17716
+ return await e.insert(Bt).values(i), mx({
17713
17717
  ...i,
17714
17718
  tenant_id: t
17715
17719
  });
17716
17720
  },
17717
17721
  async get(t, n) {
17718
17722
  let r = await e.select().from(Bt).where(h(m(Bt.tenant_id, t), m(Bt.id, n))).get();
17719
- return r ? px(r) : null;
17723
+ return r ? mx(r) : null;
17720
17724
  },
17721
17725
  async update(t, n, r) {
17722
17726
  let i = { updated_at_ts: Date.now() };
17723
- return r.user_id !== void 0 && (i.user_id = r.user_id), r.login_session_id !== void 0 && (i.login_session_id = r.login_session_id), r.device !== void 0 && (i.device = JSON.stringify(r.device)), r.clients !== void 0 && (i.clients = JSON.stringify(r.clients)), r.expires_at !== void 0 && (i.expires_at_ts = gb(r.expires_at)), r.idle_expires_at !== void 0 && (i.idle_expires_at_ts = gb(r.idle_expires_at)), r.authenticated_at !== void 0 && (i.authenticated_at_ts = gb(r.authenticated_at)), r.last_interaction_at !== void 0 && (i.last_interaction_at_ts = gb(r.last_interaction_at)), r.used_at !== void 0 && (i.used_at_ts = gb(r.used_at)), r.revoked_at !== void 0 && (i.revoked_at_ts = gb(r.revoked_at)), (await e.update(Bt).set(i).where(h(m(Bt.tenant_id, t), m(Bt.id, n))).returning()).length > 0;
17727
+ return r.user_id !== void 0 && (i.user_id = r.user_id), r.login_session_id !== void 0 && (i.login_session_id = r.login_session_id), r.device !== void 0 && (i.device = JSON.stringify(r.device)), r.clients !== void 0 && (i.clients = JSON.stringify(r.clients)), r.expires_at !== void 0 && (i.expires_at_ts = _b(r.expires_at)), r.idle_expires_at !== void 0 && (i.idle_expires_at_ts = _b(r.idle_expires_at)), r.authenticated_at !== void 0 && (i.authenticated_at_ts = _b(r.authenticated_at)), r.last_interaction_at !== void 0 && (i.last_interaction_at_ts = _b(r.last_interaction_at)), r.used_at !== void 0 && (i.used_at_ts = _b(r.used_at)), r.revoked_at !== void 0 && (i.revoked_at_ts = _b(r.revoked_at)), (await e.update(Bt).set(i).where(h(m(Bt.tenant_id, t), m(Bt.id, n))).returning()).length > 0;
17724
17728
  },
17725
17729
  async list(t, n) {
17726
17730
  let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s } = n || {}, c = s ? En(Bt, s, ["user_id"]) : void 0, l = c ? h(m(Bt.tenant_id, t), c) : m(Bt.tenant_id, t), u = e.select().from(Bt).where(l).$dynamic();
@@ -17728,7 +17732,7 @@ function mx(e) {
17728
17732
  let e = Bt[o.sort_by];
17729
17733
  e && (u = u.orderBy(o.sort_order === "desc" ? Be(e) : ze(e)));
17730
17734
  }
17731
- let d = (await u.offset(r * i).limit(i)).map(px);
17735
+ let d = (await u.offset(r * i).limit(i)).map(mx);
17732
17736
  if (!a) return { sessions: d };
17733
17737
  let [f] = await e.select({ count: Ve() }).from(Bt).where(l);
17734
17738
  return {
@@ -17746,7 +17750,7 @@ function mx(e) {
17746
17750
  //#endregion
17747
17751
  //#region src/adapters/tenants.ts
17748
17752
  Hn();
17749
- var hx = [
17753
+ var gx = [
17750
17754
  "session_cookie",
17751
17755
  "enabled_locales",
17752
17756
  "error_page",
@@ -17762,25 +17766,25 @@ var hx = [
17762
17766
  "acr_values_supported",
17763
17767
  "mtls",
17764
17768
  "mfa"
17765
- ], gx = [
17769
+ ], _x = [
17766
17770
  "allow_organization_name_in_authentication_api",
17767
17771
  "customize_mfa_in_postlogin_action",
17768
17772
  "pushed_authorization_requests_supported",
17769
17773
  "authorization_response_iss_parameter_supported"
17770
17774
  ];
17771
- function _x(e) {
17775
+ function vx(e) {
17772
17776
  let t = { ...e };
17773
- for (let e of hx) typeof t[e] == "string" && (t[e] = j(t[e]));
17774
- for (let e of gx) t[e] !== void 0 && t[e] !== null && (t[e] = t[e] === 1);
17777
+ for (let e of gx) typeof t[e] == "string" && (t[e] = j(t[e]));
17778
+ for (let e of _x) t[e] !== void 0 && t[e] !== null && (t[e] = t[e] === 1);
17775
17779
  return A(t);
17776
17780
  }
17777
- function vx(e) {
17781
+ function yx(e) {
17778
17782
  let t = { ...e };
17779
- _n(e, hx, t);
17780
- for (let n of gx) e[n] !== void 0 && (t[n] = +!!e[n]);
17783
+ _n(e, gx, t);
17784
+ for (let n of _x) e[n] !== void 0 && (t[n] = +!!e[n]);
17781
17785
  return yn(t);
17782
17786
  }
17783
- function yx(e) {
17787
+ function bx(e) {
17784
17788
  return {
17785
17789
  async create(t) {
17786
17790
  let n = {
@@ -17788,7 +17792,7 @@ function yx(e) {
17788
17792
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
17789
17793
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
17790
17794
  ...t
17791
- }, r = vx(n);
17795
+ }, r = yx(n);
17792
17796
  try {
17793
17797
  await e.insert(b).values(r);
17794
17798
  } catch (e) {
@@ -17798,7 +17802,7 @@ function yx(e) {
17798
17802
  },
17799
17803
  async get(t) {
17800
17804
  let n = await e.select().from(b).where(m(b.id, t)).get();
17801
- return n ? _x(n) : null;
17805
+ return n ? vx(n) : null;
17802
17806
  },
17803
17807
  async list(t) {
17804
17808
  let { page: n = 0, per_page: r = 50, include_totals: i = !1, sort: a, q: o } = t || {}, s = e.select().from(b).$dynamic();
@@ -17810,7 +17814,7 @@ function yx(e) {
17810
17814
  let e = b[a.sort_by];
17811
17815
  e && (s = s.orderBy(a.sort_order === "desc" ? Be(e) : ze(e)));
17812
17816
  }
17813
- let c = (await s.offset(n * r).limit(r)).map(_x);
17817
+ let c = (await s.offset(n * r).limit(r)).map(vx);
17814
17818
  if (!i) return { tenants: c };
17815
17819
  let [l] = await e.select({ count: Ve() }).from(b);
17816
17820
  return {
@@ -17821,7 +17825,7 @@ function yx(e) {
17821
17825
  };
17822
17826
  },
17823
17827
  async update(t, n) {
17824
- let r = vx({
17828
+ let r = yx({
17825
17829
  ...n,
17826
17830
  id: t,
17827
17831
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
@@ -17836,18 +17840,18 @@ function yx(e) {
17836
17840
  //#endregion
17837
17841
  //#region src/adapters/themes.ts
17838
17842
  Hn();
17839
- var bx = [
17843
+ var xx = [
17840
17844
  "colors",
17841
17845
  "borders",
17842
17846
  "fonts",
17843
17847
  "page_background",
17844
17848
  "widget"
17845
17849
  ];
17846
- function xx(e) {
17847
- let { tenant_id: t, ...n } = e, r = xn(n, bx);
17850
+ function Sx(e) {
17851
+ let { tenant_id: t, ...n } = e, r = xn(n, xx);
17848
17852
  return r.borders && (r.borders.show_widget_shadow = !!r.borders.show_widget_shadow), r.fonts && (r.fonts.links_bold = !!r.fonts.links_bold, r.fonts.subtitle_bold = !!r.fonts.subtitle_bold, r.fonts.title_bold = !!r.fonts.title_bold), A(r);
17849
17853
  }
17850
- function Sx(e) {
17854
+ function Cx(e) {
17851
17855
  return {
17852
17856
  async create(t, n, r) {
17853
17857
  let i = (/* @__PURE__ */ new Date()).toISOString(), a = r || Vn(), o = {
@@ -17857,14 +17861,14 @@ function Sx(e) {
17857
17861
  created_at: i,
17858
17862
  updated_at: i
17859
17863
  };
17860
- return await e.insert(an).values(o), xx({
17864
+ return await e.insert(an).values(o), Sx({
17861
17865
  ...o,
17862
17866
  tenant_id: t
17863
17867
  });
17864
17868
  },
17865
17869
  async get(t, n) {
17866
17870
  let r = await e.select().from(an).where(h(m(an.tenant_id, t), m(an.themeId, n))).get();
17867
- return r ? xx(r) : null;
17871
+ return r ? Sx(r) : null;
17868
17872
  },
17869
17873
  async update(t, n, r) {
17870
17874
  let i = bn(r);
@@ -17877,7 +17881,7 @@ function Sx(e) {
17877
17881
  }
17878
17882
  //#endregion
17879
17883
  //#region src/adapters/universalLoginTemplates.ts
17880
- function Cx(e) {
17884
+ function wx(e) {
17881
17885
  return {
17882
17886
  async get(t) {
17883
17887
  let n = await e.select({ body: rn.body }).from(rn).where(m(rn.tenant_id, t)).get();
@@ -17906,7 +17910,7 @@ function Cx(e) {
17906
17910
  //#endregion
17907
17911
  //#region src/adapters/users.ts
17908
17912
  Hn();
17909
- function wx(e, t) {
17913
+ function Tx(e, t) {
17910
17914
  let n = {
17911
17915
  connection: e.connection,
17912
17916
  provider: e.provider,
@@ -17919,8 +17923,8 @@ function wx(e, t) {
17919
17923
  ...typeof e.profileData == "string" ? j(e.profileData, {}) : {}
17920
17924
  }, n;
17921
17925
  }
17922
- function Tx(e, t = []) {
17923
- let { tenant_id: n, app_metadata: r, user_metadata: i, address: a, email_verified: o, phone_verified: s, is_social: c, linked_to: l, profileData: u, ...d } = e, f = wx(e, !0), ee = t.map((e) => wx(e, !1));
17926
+ function Ex(e, t = []) {
17927
+ let { tenant_id: n, app_metadata: r, user_metadata: i, address: a, email_verified: o, phone_verified: s, is_social: c, linked_to: l, profileData: u, ...d } = e, f = Tx(e, !0), ee = t.map((e) => Tx(e, !1));
17924
17928
  return A({
17925
17929
  ...d,
17926
17930
  email: e.email || "",
@@ -17933,7 +17937,7 @@ function Tx(e, t = []) {
17933
17937
  identities: [f, ...ee]
17934
17938
  });
17935
17939
  }
17936
- function Ex(e) {
17940
+ function Dx(e) {
17937
17941
  let t = async (t, n) => {
17938
17942
  let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
17939
17943
  user_id: n.user_id,
@@ -17992,14 +17996,14 @@ function Ex(e) {
17992
17996
  } catch (e) {
17993
17997
  throw e?.message?.includes("UNIQUE constraint") || e?.message?.includes("AlreadyExists") ? new Tn(409, { message: "User already exists" }) : (console.error("User upsert failed:", e?.code, e?.message), new Tn(500, { message: "Internal server error" }));
17994
17998
  }
17995
- return Tx(i);
17999
+ return Ex(i);
17996
18000
  };
17997
18001
  return {
17998
18002
  create: t,
17999
18003
  rawCreate: t,
18000
18004
  async get(t, n) {
18001
18005
  let r = await e.select().from(x).where(h(m(x.tenant_id, t), m(x.user_id, n))).get();
18002
- return r ? Tx(r, await e.select().from(x).where(h(m(x.tenant_id, t), m(x.linked_to, n))).all()) : null;
18006
+ return r ? Ex(r, await e.select().from(x).where(h(m(x.tenant_id, t), m(x.linked_to, n))).all()) : null;
18003
18007
  },
18004
18008
  async update(t, n, r) {
18005
18009
  let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
@@ -18048,7 +18052,7 @@ function Ex(e) {
18048
18052
  }
18049
18053
  let d = await u.offset(r * i).limit(i), f = d.map((e) => e.user_id), ee = [];
18050
18054
  f.length > 0 && (ee = await e.select().from(x).where(h(m(x.tenant_id, t), Fe(x.linked_to, f))));
18051
- let te = d.map((e) => Tx(e, ee.filter((t) => t.linked_to === e.user_id)));
18055
+ let te = d.map((e) => Ex(e, ee.filter((t) => t.linked_to === e.user_id)));
18052
18056
  if (!a) return { users: te };
18053
18057
  let [ne] = await e.select({ count: Ve() }).from(x).where(l);
18054
18058
  return {
@@ -18077,7 +18081,7 @@ function Ex(e) {
18077
18081
  }
18078
18082
  //#endregion
18079
18083
  //#region src/adapters/userRoles.ts
18080
- function Dx(e) {
18084
+ function Ox(e) {
18081
18085
  return {
18082
18086
  async create(t, n, r, i) {
18083
18087
  try {
@@ -18117,7 +18121,7 @@ function Dx(e) {
18117
18121
  //#endregion
18118
18122
  //#region src/adapters/userOrganizations.ts
18119
18123
  Hn();
18120
- function Ox(e) {
18124
+ function kx(e) {
18121
18125
  return {
18122
18126
  async create(t, n) {
18123
18127
  let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
@@ -18194,19 +18198,19 @@ function Ox(e) {
18194
18198
  }
18195
18199
  //#endregion
18196
18200
  //#region src/adapters/stats.ts
18197
- var kx = ["s"], Ax = ["pwd_leak"];
18198
- function jx(e) {
18201
+ var Ax = ["s"], jx = ["pwd_leak"];
18202
+ function Mx(e) {
18199
18203
  return /^\d{8}$/.test(e) ? `${e.slice(0, 4)}-${e.slice(4, 6)}-${e.slice(6, 8)}` : e;
18200
18204
  }
18201
- function Mx(e) {
18205
+ function Nx(e) {
18202
18206
  return {
18203
18207
  async getDaily(t, n) {
18204
- let r = /* @__PURE__ */ new Date(), i = n?.from ? jx(n.from) : (/* @__PURE__ */ new Date(r.getTime() - 720 * 60 * 60 * 1e3)).toISOString().split("T")[0], a = n?.to ? jx(n.to) : r.toISOString().split("T")[0];
18208
+ let r = /* @__PURE__ */ new Date(), i = n?.from ? Mx(n.from) : (/* @__PURE__ */ new Date(r.getTime() - 720 * 60 * 60 * 1e3)).toISOString().split("T")[0], a = n?.to ? Mx(n.to) : r.toISOString().split("T")[0];
18205
18209
  return (await e.select({
18206
18210
  date: p`substr(${D.date}, 1, 10)`.as("date"),
18207
- logins: p`SUM(CASE WHEN ${D.type} IN (${p.join(kx.map((e) => p`${e}`), p`, `)}) THEN 1 ELSE 0 END)`.as("logins"),
18211
+ logins: p`SUM(CASE WHEN ${D.type} IN (${p.join(Ax.map((e) => p`${e}`), p`, `)}) THEN 1 ELSE 0 END)`.as("logins"),
18208
18212
  signups: p`SUM(CASE WHEN ${D.type} = 'ss' THEN 1 ELSE 0 END)`.as("signups"),
18209
- leaked_passwords: p`SUM(CASE WHEN ${D.type} IN (${p.join(Ax.map((e) => p`${e}`), p`, `)}) THEN 1 ELSE 0 END)`.as("leaked_passwords")
18213
+ leaked_passwords: p`SUM(CASE WHEN ${D.type} IN (${p.join(jx.map((e) => p`${e}`), p`, `)}) THEN 1 ELSE 0 END)`.as("leaked_passwords")
18210
18214
  }).from(D).where(h(m(D.tenant_id, t), Me(D.date, i), Pe(D.date, `${a}T23:59:59.999Z`))).groupBy(p`substr(${D.date}, 1, 10)`).orderBy(p`substr(${D.date}, 1, 10)`).all()).map((e) => ({
18211
18215
  date: e.date,
18212
18216
  logins: Number(e.logins) || 0,
@@ -18217,14 +18221,14 @@ function Mx(e) {
18217
18221
  }));
18218
18222
  },
18219
18223
  async getActiveUsers(t) {
18220
- let n = (/* @__PURE__ */ new Date(Date.now() - 720 * 60 * 60 * 1e3)).toISOString(), [r] = await e.select({ count: p`COUNT(DISTINCT ${D.user_id})`.as("count") }).from(D).where(h(m(D.tenant_id, t), Me(D.date, n), p`${D.type} IN (${p.join(kx.map((e) => p`${e}`), p`, `)})`));
18224
+ let n = (/* @__PURE__ */ new Date(Date.now() - 720 * 60 * 60 * 1e3)).toISOString(), [r] = await e.select({ count: p`COUNT(DISTINCT ${D.user_id})`.as("count") }).from(D).where(h(m(D.tenant_id, t), Me(D.date, n), p`${D.type} IN (${p.join(Ax.map((e) => p`${e}`), p`, `)})`));
18221
18225
  return Number(r?.count) || 0;
18222
18226
  }
18223
18227
  };
18224
18228
  }
18225
18229
  //#endregion
18226
18230
  //#region src/adapters/analytics.ts
18227
- var Nx = {
18231
+ var Px = {
18228
18232
  "active-users": ["s", "seacft"],
18229
18233
  logins: [
18230
18234
  "s",
@@ -18234,7 +18238,7 @@ var Nx = {
18234
18238
  signups: ["ss", "fs"],
18235
18239
  "refresh-tokens": ["seacft", "fertft"],
18236
18240
  sessions: ["slo"]
18237
- }, Px = {
18241
+ }, Fx = {
18238
18242
  "active-users": {
18239
18243
  alias: "active_users",
18240
18244
  type: "UInt64",
@@ -18261,7 +18265,7 @@ var Nx = {
18261
18265
  agg: "count"
18262
18266
  }
18263
18267
  };
18264
- function Fx(e) {
18268
+ function Ix(e) {
18265
18269
  switch (e) {
18266
18270
  case "hour": return p`substr(${D.date}, 1, 13)`;
18267
18271
  case "month": return p`substr(${D.date}, 1, 7)`;
@@ -18270,10 +18274,10 @@ function Fx(e) {
18270
18274
  default: throw Error(`Unsupported interval '${e}' for SQL analytics adapter`);
18271
18275
  }
18272
18276
  }
18273
- function Ix(e) {
18277
+ function Lx(e) {
18274
18278
  return `"${e.replace(/"/g, "\"\"")}"`;
18275
18279
  }
18276
- function Lx(e) {
18280
+ function Rx(e) {
18277
18281
  switch (e) {
18278
18282
  case "connection": return D.connection;
18279
18283
  case "client_id": return D.client_id;
@@ -18282,9 +18286,9 @@ function Lx(e) {
18282
18286
  case "time": throw Error("time dimension handled separately");
18283
18287
  }
18284
18288
  }
18285
- function Rx(e) {
18289
+ function zx(e) {
18286
18290
  return { async query(t, n, r) {
18287
- let i = Date.now(), a = Nx[n], o = Px[n], s = [
18291
+ let i = Date.now(), a = Px[n], o = Fx[n], s = [
18288
18292
  m(D.tenant_id, t),
18289
18293
  Me(D.date, r.from),
18290
18294
  Ne(D.date, r.to),
@@ -18293,13 +18297,13 @@ function Rx(e) {
18293
18297
  r.filters.connection?.length && s.push(Fe(D.connection, r.filters.connection)), r.filters.client_id?.length && s.push(Fe(D.client_id, r.filters.client_id)), r.filters.user_type?.length && s.push(Fe(D.strategy_type, r.filters.user_type)), r.filters.user_id?.length && s.push(Fe(D.user_id, r.filters.user_id));
18294
18298
  let c = {}, l = [], u = [];
18295
18299
  for (let e of r.group_by) if (e === "time") {
18296
- let e = Fx(r.interval);
18300
+ let e = Ix(r.interval);
18297
18301
  c.time = e, l.push(e), u.push({
18298
18302
  name: "time",
18299
18303
  type: r.interval === "hour" ? "DateTime" : "Date"
18300
18304
  });
18301
18305
  } else {
18302
- let t = Lx(e);
18306
+ let t = Rx(e);
18303
18307
  c[e] = t, l.push(t), u.push({
18304
18308
  name: e,
18305
18309
  type: "String"
@@ -18315,9 +18319,9 @@ function Rx(e) {
18315
18319
  if (r.order_by) {
18316
18320
  let e = r.order_by.startsWith("-"), t = e ? r.order_by.slice(1) : r.order_by;
18317
18321
  if (!f.has(t)) throw Error(`Invalid order_by column '${t}' for analytics query`);
18318
- let n = Ix(t);
18322
+ let n = Lx(t);
18319
18323
  d = d.orderBy(p.raw(`${n} ${e ? "DESC" : "ASC"}`));
18320
- } else d = r.group_by[0] === "time" ? d.orderBy(p.raw(`${Ix("time")} ASC`)) : d.orderBy(p.raw(`${Ix(o.alias)} DESC`));
18324
+ } else d = r.group_by[0] === "time" ? d.orderBy(p.raw(`${Lx("time")} ASC`)) : d.orderBy(p.raw(`${Lx(o.alias)} DESC`));
18321
18325
  d = d.limit(r.limit).offset(r.offset);
18322
18326
  let ee = (await d.all()).map((e) => {
18323
18327
  let t = {};
@@ -18339,13 +18343,13 @@ function Rx(e) {
18339
18343
  //#endregion
18340
18344
  //#region src/adapters/outbox.ts
18341
18345
  Hn();
18342
- function zx(e) {
18346
+ function Bx(e) {
18343
18347
  return {
18344
18348
  ...e,
18345
18349
  payload: j(e.payload, {})
18346
18350
  };
18347
18351
  }
18348
- function Bx(e) {
18352
+ function Vx(e) {
18349
18353
  return {
18350
18354
  async create(t, n) {
18351
18355
  let r = Vn(), i = (/* @__PURE__ */ new Date()).toISOString();
@@ -18370,11 +18374,11 @@ function Bx(e) {
18370
18374
  }), r;
18371
18375
  },
18372
18376
  async getByIds(t) {
18373
- return t.length === 0 ? [] : (await e.select().from(O).where(Fe(O.id, t)).all()).map(zx);
18377
+ return t.length === 0 ? [] : (await e.select().from(O).where(Fe(O.id, t)).all()).map(Bx);
18374
18378
  },
18375
18379
  async getUnprocessed(t) {
18376
18380
  let n = (/* @__PURE__ */ new Date()).toISOString();
18377
- return (await e.select().from(O).where(h(Ie(O.processed_at), Ae(Ie(O.next_retry_at), Pe(O.next_retry_at, n)), Ae(Ie(O.claimed_by), Pe(O.claim_expires_at, n)))).orderBy(O.created_at, O.id).limit(t).all()).map(zx);
18381
+ return (await e.select().from(O).where(h(Ie(O.processed_at), Ae(Ie(O.next_retry_at), Pe(O.next_retry_at, n)), Ae(Ie(O.claimed_by), Pe(O.claim_expires_at, n)))).orderBy(O.created_at, O.id).limit(t).all()).map(Bx);
18378
18382
  },
18379
18383
  async claimEvents(t, n, r) {
18380
18384
  if (t.length === 0) return [];
@@ -18444,10 +18448,10 @@ function Bx(e) {
18444
18448
  }
18445
18449
  //#endregion
18446
18450
  //#region src/adapters/cleanup.ts
18447
- var Vx = 10080 * 60 * 1e3;
18448
- function Hx(e) {
18451
+ var Hx = 10080 * 60 * 1e3;
18452
+ function Ux(e) {
18449
18453
  return async (t) => {
18450
- let n = Date.now() - Vx;
18454
+ let n = Date.now() - Hx;
18451
18455
  try {
18452
18456
  let r = [Ae(Ne(S.expires_at_ts, n), Ne(S.idle_expires_at_ts, n))];
18453
18457
  t?.tenant_id && r.push(m(S.tenant_id, t.tenant_id)), await e.delete(S).where(h(...r)), r = [Ae(Ne(Bt.expires_at_ts, n), Ne(Bt.idle_expires_at_ts, n))], t?.tenant_id && r.push(m(Bt.tenant_id, t.tenant_id)), t?.user_id && r.push(m(Bt.user_id, t.user_id)), await e.delete(Bt).where(h(...r)), r = [Ne(C.expires_at_ts, n)], t?.tenant_id && r.push(m(C.tenant_id, t.tenant_id)), await e.delete(C).where(h(...r));
@@ -18458,7 +18462,7 @@ function Hx(e) {
18458
18462
  }
18459
18463
  //#endregion
18460
18464
  //#region src/adapters/index.ts
18461
- function Ux(e, t = { useTransactions: !0 }) {
18465
+ function Wx(e, t = { useTransactions: !0 }) {
18462
18466
  let n = {
18463
18467
  actions: He(),
18464
18468
  actionExecutions: Ue(),
@@ -18467,42 +18471,42 @@ function Ux(e, t = { useTransactions: !0 }) {
18467
18471
  clients: Mn(e),
18468
18472
  clientConnections: Pn(e),
18469
18473
  clientGrants: Wn(e),
18470
- clientRegistrationTokens: $y(e),
18471
- codes: tb(e),
18472
- connections: ib(e),
18473
- customDomains: ob(e),
18474
- customText: sb(e),
18475
- emailProviders: cb(e),
18476
- emailTemplates: ub(e),
18477
- flows: db(e),
18478
- forms: pb(e),
18479
- hookCode: xb(e),
18480
- hooks: Tb(e),
18481
- invites: kb(e),
18482
- keys: Ab(e),
18483
- loginSessions: Fb(e),
18484
- logs: Lb(e),
18485
- authenticationMethods: Hb(e),
18486
- organizations: Gb(e),
18487
- passwords: qb(e),
18488
- promptSettings: Jb(e),
18489
- proxyRoutes: Qb(e),
18490
- refreshTokens: tx(e),
18491
- resourceServers: ox(e),
18492
- rolePermissions: sx(e),
18493
- userPermissions: cx(e),
18494
- roles: ux(e),
18495
- sessions: mx(e),
18496
- sessionCleanup: Hx(e),
18497
- tenants: yx(e),
18498
- themes: Sx(e),
18499
- universalLoginTemplates: Cx(e),
18500
- users: Ex(e),
18501
- userRoles: Dx(e),
18502
- userOrganizations: Ox(e),
18503
- stats: Mx(e),
18504
- analytics: Rx(e),
18505
- outbox: Bx(e),
18474
+ clientRegistrationTokens: eb(e),
18475
+ codes: nb(e),
18476
+ connections: ab(e),
18477
+ customDomains: sb(e),
18478
+ customText: cb(e),
18479
+ emailProviders: lb(e),
18480
+ emailTemplates: db(e),
18481
+ flows: fb(e),
18482
+ forms: mb(e),
18483
+ hookCode: Sb(e),
18484
+ hooks: Eb(e),
18485
+ invites: Ab(e),
18486
+ keys: jb(e),
18487
+ loginSessions: Ib(e),
18488
+ logs: Rb(e),
18489
+ authenticationMethods: Ub(e),
18490
+ organizations: Kb(e),
18491
+ passwords: Jb(e),
18492
+ promptSettings: Yb(e),
18493
+ proxyRoutes: $b(e),
18494
+ refreshTokens: nx(e),
18495
+ resourceServers: sx(e),
18496
+ rolePermissions: cx(e),
18497
+ userPermissions: lx(e),
18498
+ roles: dx(e),
18499
+ sessions: hx(e),
18500
+ sessionCleanup: Ux(e),
18501
+ tenants: bx(e),
18502
+ themes: Cx(e),
18503
+ universalLoginTemplates: wx(e),
18504
+ users: Dx(e),
18505
+ userRoles: Ox(e),
18506
+ userOrganizations: kx(e),
18507
+ stats: Nx(e),
18508
+ analytics: zx(e),
18509
+ outbox: Vx(e),
18506
18510
  async transaction(r) {
18507
18511
  if (t.useTransactions === !1) return r(n);
18508
18512
  await e.run(p`BEGIN`);
@@ -18518,22 +18522,22 @@ function Ux(e, t = { useTransactions: !0 }) {
18518
18522
  }
18519
18523
  //#endregion
18520
18524
  //#region src/adapters/resolveHost.ts
18521
- function Wx(e) {
18525
+ function Gx(e) {
18522
18526
  if (!e) return { path: "/*" };
18523
18527
  try {
18524
- let t = JSON.parse(e), n = Ny.safeParse(t);
18528
+ let t = JSON.parse(e), n = Py.safeParse(t);
18525
18529
  if (n.success) return n.data;
18526
18530
  } catch {}
18527
18531
  return { path: "/*" };
18528
18532
  }
18529
- function Gx(e) {
18533
+ function Kx(e) {
18530
18534
  if (!e) return [];
18531
18535
  try {
18532
18536
  let t = JSON.parse(e);
18533
18537
  if (!Array.isArray(t)) return [];
18534
18538
  let n = [];
18535
18539
  for (let e of t) {
18536
- let t = Py.safeParse(e);
18540
+ let t = Fy.safeParse(e);
18537
18541
  t.success && n.push(t.data);
18538
18542
  }
18539
18543
  return n;
@@ -18541,7 +18545,7 @@ function Gx(e) {
18541
18545
  return [];
18542
18546
  }
18543
18547
  }
18544
- async function Kx(e, t) {
18548
+ async function qx(e, t) {
18545
18549
  let n = t.toLowerCase(), r = (await e.select({
18546
18550
  custom_domain_id: qt.custom_domain_id,
18547
18551
  tenant_id: qt.tenant_id,
@@ -18553,8 +18557,8 @@ async function Kx(e, t) {
18553
18557
  tenant_id: e.tenant_id,
18554
18558
  custom_domain_id: e.custom_domain_id,
18555
18559
  priority: e.priority,
18556
- match: Wx(e.match),
18557
- handlers: Gx(e.handlers),
18560
+ match: Gx(e.match),
18561
+ handlers: Kx(e.handlers),
18558
18562
  created_at: e.created_at,
18559
18563
  updated_at: e.updated_at
18560
18564
  }));
@@ -18567,11 +18571,11 @@ async function Kx(e, t) {
18567
18571
  }
18568
18572
  //#endregion
18569
18573
  //#region src/adapters/proxyData.ts
18570
- function qx(e) {
18574
+ function Jx(e) {
18571
18575
  return {
18572
- proxyRoutes: Qb(e),
18573
- resolveHost: (t) => Kx(e, t)
18576
+ proxyRoutes: $b(e),
18577
+ resolveHost: (t) => qx(e, t)
18574
18578
  };
18575
18579
  }
18576
18580
  //#endregion
18577
- export { qx as createProxyDataAdapter, Qb as createProxyRoutesAdapter, Ux as default, gn as sqlite };
18581
+ export { Jx as createProxyDataAdapter, $b as createProxyRoutesAdapter, Wx as default, gn as sqlite };