authhero 4.106.0 → 4.107.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3101,6 +3101,10 @@ export declare const clientInsertSchema: z.ZodObject<{
3101
3101
  "iat_dcr"
3102
3102
  ]>>;
3103
3103
  registration_metadata: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>>;
3104
+ user_linking_mode: z.ZodOptional<z.ZodEnum<[
3105
+ "builtin",
3106
+ "off"
3107
+ ]>>;
3104
3108
  }, "strip", z.ZodTypeAny, {
3105
3109
  name: string;
3106
3110
  client_id: string;
@@ -3153,6 +3157,7 @@ export declare const clientInsertSchema: z.ZodObject<{
3153
3157
  owner_user_id?: string | undefined;
3154
3158
  registration_type?: "manual" | "open_dcr" | "iat_dcr" | undefined;
3155
3159
  registration_metadata?: Record<string, any> | undefined;
3160
+ user_linking_mode?: "builtin" | "off" | undefined;
3156
3161
  }, {
3157
3162
  name: string;
3158
3163
  client_id: string;
@@ -3205,6 +3210,7 @@ export declare const clientInsertSchema: z.ZodObject<{
3205
3210
  owner_user_id?: string | undefined;
3206
3211
  registration_type?: "manual" | "open_dcr" | "iat_dcr" | undefined;
3207
3212
  registration_metadata?: Record<string, any> | undefined;
3213
+ user_linking_mode?: "builtin" | "off" | undefined;
3208
3214
  }>;
3209
3215
  export type ClientInsert = z.input<typeof clientInsertSchema>;
3210
3216
  export declare const clientSchema: z.ZodObject<{
@@ -3307,6 +3313,10 @@ export declare const clientSchema: z.ZodObject<{
3307
3313
  "iat_dcr"
3308
3314
  ]>>;
3309
3315
  registration_metadata: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>>;
3316
+ user_linking_mode: z.ZodOptional<z.ZodEnum<[
3317
+ "builtin",
3318
+ "off"
3319
+ ]>>;
3310
3320
  created_at: z.ZodString;
3311
3321
  updated_at: z.ZodString;
3312
3322
  }, "strip", z.ZodTypeAny, {
@@ -3363,6 +3373,7 @@ export declare const clientSchema: z.ZodObject<{
3363
3373
  owner_user_id?: string | undefined;
3364
3374
  registration_type?: "manual" | "open_dcr" | "iat_dcr" | undefined;
3365
3375
  registration_metadata?: Record<string, any> | undefined;
3376
+ user_linking_mode?: "builtin" | "off" | undefined;
3366
3377
  }, {
3367
3378
  created_at: string;
3368
3379
  updated_at: string;
@@ -3417,6 +3428,7 @@ export declare const clientSchema: z.ZodObject<{
3417
3428
  owner_user_id?: string | undefined;
3418
3429
  registration_type?: "manual" | "open_dcr" | "iat_dcr" | undefined;
3419
3430
  registration_metadata?: Record<string, any> | undefined;
3431
+ user_linking_mode?: "builtin" | "off" | undefined;
3420
3432
  }>;
3421
3433
  export type Client = z.infer<typeof clientSchema>;
3422
3434
  export declare const clientGrantInsertSchema: z.ZodObject<{
@@ -42344,17 +42356,20 @@ export declare function isWidgetComponent(component: FormNodeComponent): compone
42344
42356
  export declare function isFieldComponent(component: FormNodeComponent): component is FieldComponent$1;
42345
42357
  export declare const hookTemplateId: z.ZodEnum<[
42346
42358
  "ensure-username",
42347
- "set-preferred-username"
42359
+ "set-preferred-username",
42360
+ "account-linking"
42348
42361
  ]>;
42349
42362
  export type HookTemplateId = z.infer<typeof hookTemplateId>;
42350
42363
  /**
42351
42364
  * Registry of available hook templates.
42352
- * Maps template IDs to their metadata and allowed triggers.
42365
+ * Maps template IDs to their metadata and allowed triggers. Some templates
42366
+ * (e.g. `account-linking`) can bind to more than one trigger; in that case
42367
+ * `trigger_ids` lists every trigger the template supports.
42353
42368
  */
42354
42369
  export declare const hookTemplates: Record<HookTemplateId, {
42355
42370
  name: string;
42356
42371
  description: string;
42357
- trigger_id: string;
42372
+ trigger_ids: string[];
42358
42373
  }>;
42359
42374
  export declare const hookInsertSchema: z.ZodUnion<[
42360
42375
  z.ZodObject<{
@@ -42362,6 +42377,7 @@ export declare const hookInsertSchema: z.ZodUnion<[
42362
42377
  "pre-user-registration",
42363
42378
  "post-user-registration",
42364
42379
  "post-user-login",
42380
+ "post-user-update",
42365
42381
  "validate-registration-username",
42366
42382
  "pre-user-deletion",
42367
42383
  "post-user-deletion"
@@ -42371,17 +42387,31 @@ export declare const hookInsertSchema: z.ZodUnion<[
42371
42387
  synchronous: z.ZodDefault<z.ZodBoolean>;
42372
42388
  priority: z.ZodOptional<z.ZodNumber>;
42373
42389
  hook_id: z.ZodOptional<z.ZodString>;
42390
+ /**
42391
+ * Free-form key/value bag for hook properties. Two well-known keys:
42392
+ *
42393
+ * - `inheritable: true` — when set on a hook on the control-plane tenant,
42394
+ * the multi-tenancy sync surfaces this hook to sub-tenants (Phase 2).
42395
+ * - Template-specific options. Templates read their config here, e.g.
42396
+ * `account-linking` reads `copy_user_metadata: true` to merge secondary
42397
+ * user_metadata into the primary on link.
42398
+ *
42399
+ * Everything else is opaque to the runtime. Persisted as JSON.
42400
+ */
42401
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42374
42402
  }, "strip", z.ZodTypeAny, {
42375
42403
  url: string;
42376
42404
  enabled: boolean;
42377
- trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
42405
+ trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "post-user-update" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
42378
42406
  synchronous: boolean;
42407
+ metadata?: Record<string, unknown> | undefined;
42379
42408
  priority?: number | undefined;
42380
42409
  hook_id?: string | undefined;
42381
42410
  }, {
42382
42411
  url: string;
42383
- trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
42412
+ trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "post-user-update" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
42384
42413
  enabled?: boolean | undefined;
42414
+ metadata?: Record<string, unknown> | undefined;
42385
42415
  synchronous?: boolean | undefined;
42386
42416
  priority?: number | undefined;
42387
42417
  hook_id?: string | undefined;
@@ -42400,17 +42430,31 @@ export declare const hookInsertSchema: z.ZodUnion<[
42400
42430
  synchronous: z.ZodDefault<z.ZodBoolean>;
42401
42431
  priority: z.ZodOptional<z.ZodNumber>;
42402
42432
  hook_id: z.ZodOptional<z.ZodString>;
42433
+ /**
42434
+ * Free-form key/value bag for hook properties. Two well-known keys:
42435
+ *
42436
+ * - `inheritable: true` — when set on a hook on the control-plane tenant,
42437
+ * the multi-tenancy sync surfaces this hook to sub-tenants (Phase 2).
42438
+ * - Template-specific options. Templates read their config here, e.g.
42439
+ * `account-linking` reads `copy_user_metadata: true` to merge secondary
42440
+ * user_metadata into the primary on link.
42441
+ *
42442
+ * Everything else is opaque to the runtime. Persisted as JSON.
42443
+ */
42444
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42403
42445
  }, "strip", z.ZodTypeAny, {
42404
42446
  enabled: boolean;
42405
42447
  trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
42406
42448
  synchronous: boolean;
42407
42449
  form_id: string;
42450
+ metadata?: Record<string, unknown> | undefined;
42408
42451
  priority?: number | undefined;
42409
42452
  hook_id?: string | undefined;
42410
42453
  }, {
42411
42454
  trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
42412
42455
  form_id: string;
42413
42456
  enabled?: boolean | undefined;
42457
+ metadata?: Record<string, unknown> | undefined;
42414
42458
  synchronous?: boolean | undefined;
42415
42459
  priority?: number | undefined;
42416
42460
  hook_id?: string | undefined;
@@ -42418,27 +42462,44 @@ export declare const hookInsertSchema: z.ZodUnion<[
42418
42462
  z.ZodObject<{
42419
42463
  trigger_id: z.ZodEnum<[
42420
42464
  "post-user-login",
42465
+ "post-user-registration",
42466
+ "post-user-update",
42421
42467
  "credentials-exchange"
42422
42468
  ]>;
42423
42469
  template_id: z.ZodEnum<[
42424
42470
  "ensure-username",
42425
- "set-preferred-username"
42471
+ "set-preferred-username",
42472
+ "account-linking"
42426
42473
  ]>;
42427
42474
  enabled: z.ZodDefault<z.ZodBoolean>;
42428
42475
  synchronous: z.ZodDefault<z.ZodBoolean>;
42429
42476
  priority: z.ZodOptional<z.ZodNumber>;
42430
42477
  hook_id: z.ZodOptional<z.ZodString>;
42478
+ /**
42479
+ * Free-form key/value bag for hook properties. Two well-known keys:
42480
+ *
42481
+ * - `inheritable: true` — when set on a hook on the control-plane tenant,
42482
+ * the multi-tenancy sync surfaces this hook to sub-tenants (Phase 2).
42483
+ * - Template-specific options. Templates read their config here, e.g.
42484
+ * `account-linking` reads `copy_user_metadata: true` to merge secondary
42485
+ * user_metadata into the primary on link.
42486
+ *
42487
+ * Everything else is opaque to the runtime. Persisted as JSON.
42488
+ */
42489
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42431
42490
  }, "strip", z.ZodTypeAny, {
42432
42491
  enabled: boolean;
42433
- trigger_id: "post-user-login" | "credentials-exchange";
42492
+ trigger_id: "post-user-registration" | "post-user-login" | "post-user-update" | "credentials-exchange";
42434
42493
  synchronous: boolean;
42435
- template_id: "ensure-username" | "set-preferred-username";
42494
+ template_id: "ensure-username" | "set-preferred-username" | "account-linking";
42495
+ metadata?: Record<string, unknown> | undefined;
42436
42496
  priority?: number | undefined;
42437
42497
  hook_id?: string | undefined;
42438
42498
  }, {
42439
- trigger_id: "post-user-login" | "credentials-exchange";
42440
- template_id: "ensure-username" | "set-preferred-username";
42499
+ trigger_id: "post-user-registration" | "post-user-login" | "post-user-update" | "credentials-exchange";
42500
+ template_id: "ensure-username" | "set-preferred-username" | "account-linking";
42441
42501
  enabled?: boolean | undefined;
42502
+ metadata?: Record<string, unknown> | undefined;
42442
42503
  synchronous?: boolean | undefined;
42443
42504
  priority?: number | undefined;
42444
42505
  hook_id?: string | undefined;
@@ -42455,17 +42516,31 @@ export declare const hookInsertSchema: z.ZodUnion<[
42455
42516
  synchronous: z.ZodDefault<z.ZodBoolean>;
42456
42517
  priority: z.ZodOptional<z.ZodNumber>;
42457
42518
  hook_id: z.ZodOptional<z.ZodString>;
42519
+ /**
42520
+ * Free-form key/value bag for hook properties. Two well-known keys:
42521
+ *
42522
+ * - `inheritable: true` — when set on a hook on the control-plane tenant,
42523
+ * the multi-tenancy sync surfaces this hook to sub-tenants (Phase 2).
42524
+ * - Template-specific options. Templates read their config here, e.g.
42525
+ * `account-linking` reads `copy_user_metadata: true` to merge secondary
42526
+ * user_metadata into the primary on link.
42527
+ *
42528
+ * Everything else is opaque to the runtime. Persisted as JSON.
42529
+ */
42530
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42458
42531
  }, "strip", z.ZodTypeAny, {
42459
42532
  code_id: string;
42460
42533
  enabled: boolean;
42461
42534
  trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "credentials-exchange";
42462
42535
  synchronous: boolean;
42536
+ metadata?: Record<string, unknown> | undefined;
42463
42537
  priority?: number | undefined;
42464
42538
  hook_id?: string | undefined;
42465
42539
  }, {
42466
42540
  code_id: string;
42467
42541
  trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "credentials-exchange";
42468
42542
  enabled?: boolean | undefined;
42543
+ metadata?: Record<string, unknown> | undefined;
42469
42544
  synchronous?: boolean | undefined;
42470
42545
  priority?: number | undefined;
42471
42546
  hook_id?: string | undefined;
@@ -42482,6 +42557,7 @@ export declare const hookSchema: z.ZodUnion<[
42482
42557
  "pre-user-registration",
42483
42558
  "post-user-registration",
42484
42559
  "post-user-login",
42560
+ "post-user-update",
42485
42561
  "validate-registration-username",
42486
42562
  "pre-user-deletion",
42487
42563
  "post-user-deletion"
@@ -42489,22 +42565,36 @@ export declare const hookSchema: z.ZodUnion<[
42489
42565
  enabled: z.ZodDefault<z.ZodBoolean>;
42490
42566
  synchronous: z.ZodDefault<z.ZodBoolean>;
42491
42567
  priority: z.ZodOptional<z.ZodNumber>;
42568
+ /**
42569
+ * Free-form key/value bag for hook properties. Two well-known keys:
42570
+ *
42571
+ * - `inheritable: true` — when set on a hook on the control-plane tenant,
42572
+ * the multi-tenancy sync surfaces this hook to sub-tenants (Phase 2).
42573
+ * - Template-specific options. Templates read their config here, e.g.
42574
+ * `account-linking` reads `copy_user_metadata: true` to merge secondary
42575
+ * user_metadata into the primary on link.
42576
+ *
42577
+ * Everything else is opaque to the runtime. Persisted as JSON.
42578
+ */
42579
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42492
42580
  }, "strip", z.ZodTypeAny, {
42493
42581
  created_at: string;
42494
42582
  updated_at: string;
42495
42583
  url: string;
42496
42584
  enabled: boolean;
42497
- trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
42585
+ trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "post-user-update" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
42498
42586
  synchronous: boolean;
42499
42587
  hook_id: string;
42588
+ metadata?: Record<string, unknown> | undefined;
42500
42589
  priority?: number | undefined;
42501
42590
  }, {
42502
42591
  created_at: string;
42503
42592
  updated_at: string;
42504
42593
  url: string;
42505
- trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
42594
+ trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "post-user-update" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
42506
42595
  hook_id: string;
42507
42596
  enabled?: boolean | undefined;
42597
+ metadata?: Record<string, unknown> | undefined;
42508
42598
  synchronous?: boolean | undefined;
42509
42599
  priority?: number | undefined;
42510
42600
  }>,
@@ -42524,6 +42614,18 @@ export declare const hookSchema: z.ZodUnion<[
42524
42614
  enabled: z.ZodDefault<z.ZodBoolean>;
42525
42615
  synchronous: z.ZodDefault<z.ZodBoolean>;
42526
42616
  priority: z.ZodOptional<z.ZodNumber>;
42617
+ /**
42618
+ * Free-form key/value bag for hook properties. Two well-known keys:
42619
+ *
42620
+ * - `inheritable: true` — when set on a hook on the control-plane tenant,
42621
+ * the multi-tenancy sync surfaces this hook to sub-tenants (Phase 2).
42622
+ * - Template-specific options. Templates read their config here, e.g.
42623
+ * `account-linking` reads `copy_user_metadata: true` to merge secondary
42624
+ * user_metadata into the primary on link.
42625
+ *
42626
+ * Everything else is opaque to the runtime. Persisted as JSON.
42627
+ */
42628
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42527
42629
  }, "strip", z.ZodTypeAny, {
42528
42630
  created_at: string;
42529
42631
  updated_at: string;
@@ -42532,6 +42634,7 @@ export declare const hookSchema: z.ZodUnion<[
42532
42634
  synchronous: boolean;
42533
42635
  hook_id: string;
42534
42636
  form_id: string;
42637
+ metadata?: Record<string, unknown> | undefined;
42535
42638
  priority?: number | undefined;
42536
42639
  }, {
42537
42640
  created_at: string;
@@ -42540,6 +42643,7 @@ export declare const hookSchema: z.ZodUnion<[
42540
42643
  hook_id: string;
42541
42644
  form_id: string;
42542
42645
  enabled?: boolean | undefined;
42646
+ metadata?: Record<string, unknown> | undefined;
42543
42647
  synchronous?: boolean | undefined;
42544
42648
  priority?: number | undefined;
42545
42649
  }>,
@@ -42547,33 +42651,50 @@ export declare const hookSchema: z.ZodUnion<[
42547
42651
  hook_id: z.ZodString;
42548
42652
  template_id: z.ZodEnum<[
42549
42653
  "ensure-username",
42550
- "set-preferred-username"
42654
+ "set-preferred-username",
42655
+ "account-linking"
42551
42656
  ]>;
42552
42657
  created_at: z.ZodString;
42553
42658
  updated_at: z.ZodString;
42554
42659
  trigger_id: z.ZodEnum<[
42555
42660
  "post-user-login",
42661
+ "post-user-registration",
42662
+ "post-user-update",
42556
42663
  "credentials-exchange"
42557
42664
  ]>;
42558
42665
  enabled: z.ZodDefault<z.ZodBoolean>;
42559
42666
  synchronous: z.ZodDefault<z.ZodBoolean>;
42560
42667
  priority: z.ZodOptional<z.ZodNumber>;
42668
+ /**
42669
+ * Free-form key/value bag for hook properties. Two well-known keys:
42670
+ *
42671
+ * - `inheritable: true` — when set on a hook on the control-plane tenant,
42672
+ * the multi-tenancy sync surfaces this hook to sub-tenants (Phase 2).
42673
+ * - Template-specific options. Templates read their config here, e.g.
42674
+ * `account-linking` reads `copy_user_metadata: true` to merge secondary
42675
+ * user_metadata into the primary on link.
42676
+ *
42677
+ * Everything else is opaque to the runtime. Persisted as JSON.
42678
+ */
42679
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42561
42680
  }, "strip", z.ZodTypeAny, {
42562
42681
  created_at: string;
42563
42682
  updated_at: string;
42564
42683
  enabled: boolean;
42565
- trigger_id: "post-user-login" | "credentials-exchange";
42684
+ trigger_id: "post-user-registration" | "post-user-login" | "post-user-update" | "credentials-exchange";
42566
42685
  synchronous: boolean;
42567
42686
  hook_id: string;
42568
- template_id: "ensure-username" | "set-preferred-username";
42687
+ template_id: "ensure-username" | "set-preferred-username" | "account-linking";
42688
+ metadata?: Record<string, unknown> | undefined;
42569
42689
  priority?: number | undefined;
42570
42690
  }, {
42571
42691
  created_at: string;
42572
42692
  updated_at: string;
42573
- trigger_id: "post-user-login" | "credentials-exchange";
42693
+ trigger_id: "post-user-registration" | "post-user-login" | "post-user-update" | "credentials-exchange";
42574
42694
  hook_id: string;
42575
- template_id: "ensure-username" | "set-preferred-username";
42695
+ template_id: "ensure-username" | "set-preferred-username" | "account-linking";
42576
42696
  enabled?: boolean | undefined;
42697
+ metadata?: Record<string, unknown> | undefined;
42577
42698
  synchronous?: boolean | undefined;
42578
42699
  priority?: number | undefined;
42579
42700
  }>,
@@ -42591,6 +42712,18 @@ export declare const hookSchema: z.ZodUnion<[
42591
42712
  enabled: z.ZodDefault<z.ZodBoolean>;
42592
42713
  synchronous: z.ZodDefault<z.ZodBoolean>;
42593
42714
  priority: z.ZodOptional<z.ZodNumber>;
42715
+ /**
42716
+ * Free-form key/value bag for hook properties. Two well-known keys:
42717
+ *
42718
+ * - `inheritable: true` — when set on a hook on the control-plane tenant,
42719
+ * the multi-tenancy sync surfaces this hook to sub-tenants (Phase 2).
42720
+ * - Template-specific options. Templates read their config here, e.g.
42721
+ * `account-linking` reads `copy_user_metadata: true` to merge secondary
42722
+ * user_metadata into the primary on link.
42723
+ *
42724
+ * Everything else is opaque to the runtime. Persisted as JSON.
42725
+ */
42726
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42594
42727
  }, "strip", z.ZodTypeAny, {
42595
42728
  created_at: string;
42596
42729
  updated_at: string;
@@ -42599,6 +42732,7 @@ export declare const hookSchema: z.ZodUnion<[
42599
42732
  trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "credentials-exchange";
42600
42733
  synchronous: boolean;
42601
42734
  hook_id: string;
42735
+ metadata?: Record<string, unknown> | undefined;
42602
42736
  priority?: number | undefined;
42603
42737
  }, {
42604
42738
  created_at: string;
@@ -42607,6 +42741,7 @@ export declare const hookSchema: z.ZodUnion<[
42607
42741
  trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "credentials-exchange";
42608
42742
  hook_id: string;
42609
42743
  enabled?: boolean | undefined;
42744
+ metadata?: Record<string, unknown> | undefined;
42610
42745
  synchronous?: boolean | undefined;
42611
42746
  priority?: number | undefined;
42612
42747
  }>
@@ -51206,6 +51341,10 @@ declare const enrichedClientSchema: z.ZodObject<{
51206
51341
  "iat_dcr"
51207
51342
  ]>>;
51208
51343
  registration_metadata: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>>;
51344
+ user_linking_mode: z.ZodOptional<z.ZodEnum<[
51345
+ "builtin",
51346
+ "off"
51347
+ ]>>;
51209
51348
  created_at: z.ZodString;
51210
51349
  updated_at: z.ZodString;
51211
51350
  }, "strip", z.ZodTypeAny, {
@@ -51510,6 +51649,7 @@ declare const enrichedClientSchema: z.ZodObject<{
51510
51649
  owner_user_id?: string | undefined;
51511
51650
  registration_type?: "manual" | "open_dcr" | "iat_dcr" | undefined;
51512
51651
  registration_metadata?: Record<string, any> | undefined;
51652
+ user_linking_mode?: "builtin" | "off" | undefined;
51513
51653
  }, {
51514
51654
  name: string;
51515
51655
  tenant: {
@@ -51812,6 +51952,7 @@ declare const enrichedClientSchema: z.ZodObject<{
51812
51952
  owner_user_id?: string | undefined;
51813
51953
  registration_type?: "manual" | "open_dcr" | "iat_dcr" | undefined;
51814
51954
  registration_metadata?: Record<string, any> | undefined;
51955
+ user_linking_mode?: "builtin" | "off" | undefined;
51815
51956
  }>;
51816
51957
  export type EnrichedClient = z.infer<typeof enrichedClientSchema>;
51817
51958
  /** Context passed to entity hooks */
@@ -52157,6 +52298,26 @@ export interface OutboxConfig {
52157
52298
  /** Max delivery retries before giving up on an event (default: 5) */
52158
52299
  maxRetries?: number;
52159
52300
  }
52301
+ /**
52302
+ * Mode for the built-in email-based user linking path.
52303
+ *
52304
+ * - `"builtin"` — `commitUserHook` runs the email→primary lookup at user
52305
+ * creation and email update, linking by verified email match. Default
52306
+ * for backwards compatibility.
52307
+ * - `"off"` — built-in lookup is skipped. Linking only happens if the
52308
+ * tenant has enabled the `account-linking` template hook for the
52309
+ * relevant trigger (`post-user-registration`, `post-user-update`, or
52310
+ * `post-user-login`).
52311
+ *
52312
+ * The template hook is controlled independently via the management API,
52313
+ * so a tenant on `"builtin"` mode can still enable the template at
52314
+ * `post-user-login` to catch legacy unlinked accounts. Running both at
52315
+ * the same trigger is harmless but redundant — the template no-ops once
52316
+ * the built-in has set `linked_to`.
52317
+ *
52318
+ * A per-client `user_linking_mode` overrides this service-level default.
52319
+ */
52320
+ export type UserLinkingMode = "builtin" | "off";
52160
52321
  export interface AuthHeroConfig {
52161
52322
  dataAdapter: DataAdapters;
52162
52323
  /**
@@ -52343,6 +52504,16 @@ export interface AuthHeroConfig {
52343
52504
  * by a background relay to the logs table (and other destinations).
52344
52505
  */
52345
52506
  outbox?: OutboxConfig;
52507
+ /**
52508
+ * Default mode for the built-in email-based user-linking path.
52509
+ *
52510
+ * Controls whether `linkUsersHook` performs an automatic primary-user
52511
+ * lookup by verified email at user creation and email update. A per-client
52512
+ * `user_linking_mode` setting overrides this default.
52513
+ *
52514
+ * @default "builtin"
52515
+ */
52516
+ userLinkingMode?: UserLinkingMode;
52346
52517
  }
52347
52518
  export type UserInfo = {
52348
52519
  sub: string;
@@ -52402,6 +52573,7 @@ export type Bindings = {
52402
52573
  codeExecutor?: CodeExecutor;
52403
52574
  webhookInvoker?: WebhookInvoker;
52404
52575
  outbox?: OutboxConfig;
52576
+ userLinkingMode?: UserLinkingMode;
52405
52577
  };
52406
52578
  export interface CreateX509CertificateParams {
52407
52579
  name: string;
@@ -53228,8 +53400,27 @@ export interface AccountLinkingOptions {
53228
53400
  * @default true
53229
53401
  */
53230
53402
  requireVerifiedEmail?: boolean;
53403
+ /**
53404
+ * When the link is performed, merge the secondary user's `user_metadata`
53405
+ * into the primary's. Existing keys on the primary are NOT overwritten —
53406
+ * only keys absent from the primary are filled in from the secondary, so
53407
+ * the primary remains the source of truth for any conflicting values.
53408
+ *
53409
+ * `app_metadata` is intentionally never copied to avoid auto-merging into
53410
+ * the admin-only namespace.
53411
+ *
53412
+ * @default false
53413
+ */
53414
+ copyUserMetadata?: boolean;
53231
53415
  }
53232
- declare function accountLinking(options?: AccountLinkingOptions): OnExecutePostLogin;
53416
+ /**
53417
+ * Trigger-agnostic event handler used by all `account-linking` template
53418
+ * dispatch sites. It accepts the same shape as `OnExecutePostLogin` but
53419
+ * ignores the trigger-specific `api` object, which lets the same function
53420
+ * back `post-user-login`, `post-user-registration`, and `post-user-update`.
53421
+ */
53422
+ export type AccountLinkingHandler = (event: HookEvent) => Promise<void>;
53423
+ declare function accountLinking(options?: AccountLinkingOptions): OnExecutePostLogin & AccountLinkingHandler;
53233
53424
  /**
53234
53425
  * Local code executor using `new Function()`.
53235
53426
  * Suitable for local development only — no isolation or sandboxing.
@@ -60814,9 +61005,12 @@ export declare function init(config: AuthHeroConfig): {
60814
61005
  updated_at: string;
60815
61006
  url: string;
60816
61007
  enabled: boolean;
60817
- trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
61008
+ trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "post-user-update" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
60818
61009
  synchronous: boolean;
60819
61010
  hook_id: string;
61011
+ metadata?: {
61012
+ [x: string]: import("hono/utils/types").JSONValue;
61013
+ } | undefined;
60820
61014
  priority?: number | undefined | undefined;
60821
61015
  } | {
60822
61016
  created_at: string;
@@ -60826,15 +61020,21 @@ export declare function init(config: AuthHeroConfig): {
60826
61020
  synchronous: boolean;
60827
61021
  hook_id: string;
60828
61022
  form_id: string;
61023
+ metadata?: {
61024
+ [x: string]: import("hono/utils/types").JSONValue;
61025
+ } | undefined;
60829
61026
  priority?: number | undefined | undefined;
60830
61027
  } | {
60831
61028
  created_at: string;
60832
61029
  updated_at: string;
60833
61030
  enabled: boolean;
60834
- trigger_id: "post-user-login" | "credentials-exchange";
61031
+ trigger_id: "post-user-registration" | "post-user-login" | "post-user-update" | "credentials-exchange";
60835
61032
  synchronous: boolean;
60836
61033
  hook_id: string;
60837
- template_id: "ensure-username" | "set-preferred-username";
61034
+ template_id: "ensure-username" | "set-preferred-username" | "account-linking";
61035
+ metadata?: {
61036
+ [x: string]: import("hono/utils/types").JSONValue;
61037
+ } | undefined;
60838
61038
  priority?: number | undefined | undefined;
60839
61039
  } | {
60840
61040
  created_at: string;
@@ -60844,6 +61044,9 @@ export declare function init(config: AuthHeroConfig): {
60844
61044
  trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "credentials-exchange";
60845
61045
  synchronous: boolean;
60846
61046
  hook_id: string;
61047
+ metadata?: {
61048
+ [x: string]: import("hono/utils/types").JSONValue;
61049
+ } | undefined;
60847
61050
  priority?: number | undefined | undefined;
60848
61051
  })[] | {
60849
61052
  length: number;
@@ -60854,9 +61057,12 @@ export declare function init(config: AuthHeroConfig): {
60854
61057
  updated_at: string;
60855
61058
  url: string;
60856
61059
  enabled: boolean;
60857
- trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
61060
+ trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "post-user-update" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
60858
61061
  synchronous: boolean;
60859
61062
  hook_id: string;
61063
+ metadata?: {
61064
+ [x: string]: import("hono/utils/types").JSONValue;
61065
+ } | undefined;
60860
61066
  priority?: number | undefined | undefined;
60861
61067
  } | {
60862
61068
  created_at: string;
@@ -60866,15 +61072,21 @@ export declare function init(config: AuthHeroConfig): {
60866
61072
  synchronous: boolean;
60867
61073
  hook_id: string;
60868
61074
  form_id: string;
61075
+ metadata?: {
61076
+ [x: string]: import("hono/utils/types").JSONValue;
61077
+ } | undefined;
60869
61078
  priority?: number | undefined | undefined;
60870
61079
  } | {
60871
61080
  created_at: string;
60872
61081
  updated_at: string;
60873
61082
  enabled: boolean;
60874
- trigger_id: "post-user-login" | "credentials-exchange";
61083
+ trigger_id: "post-user-registration" | "post-user-login" | "post-user-update" | "credentials-exchange";
60875
61084
  synchronous: boolean;
60876
61085
  hook_id: string;
60877
- template_id: "ensure-username" | "set-preferred-username";
61086
+ template_id: "ensure-username" | "set-preferred-username" | "account-linking";
61087
+ metadata?: {
61088
+ [x: string]: import("hono/utils/types").JSONValue;
61089
+ } | undefined;
60878
61090
  priority?: number | undefined | undefined;
60879
61091
  } | {
60880
61092
  created_at: string;
@@ -60884,6 +61096,9 @@ export declare function init(config: AuthHeroConfig): {
60884
61096
  trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "credentials-exchange";
60885
61097
  synchronous: boolean;
60886
61098
  hook_id: string;
61099
+ metadata?: {
61100
+ [x: string]: import("hono/utils/types").JSONValue;
61101
+ } | undefined;
60887
61102
  priority?: number | undefined | undefined;
60888
61103
  })[];
60889
61104
  total?: number | undefined;
@@ -60902,8 +61117,9 @@ export declare function init(config: AuthHeroConfig): {
60902
61117
  } & {
60903
61118
  json: {
60904
61119
  url: string;
60905
- trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
61120
+ trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "post-user-update" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
60906
61121
  enabled?: boolean | undefined;
61122
+ metadata?: Record<string, unknown> | undefined;
60907
61123
  synchronous?: boolean | undefined;
60908
61124
  priority?: number | undefined;
60909
61125
  hook_id?: string | undefined;
@@ -60911,13 +61127,15 @@ export declare function init(config: AuthHeroConfig): {
60911
61127
  trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
60912
61128
  form_id: string;
60913
61129
  enabled?: boolean | undefined;
61130
+ metadata?: Record<string, unknown> | undefined;
60914
61131
  synchronous?: boolean | undefined;
60915
61132
  priority?: number | undefined;
60916
61133
  hook_id?: string | undefined;
60917
61134
  } | {
60918
- trigger_id: "post-user-login" | "credentials-exchange";
60919
- template_id: "ensure-username" | "set-preferred-username";
61135
+ trigger_id: "post-user-registration" | "post-user-login" | "post-user-update" | "credentials-exchange";
61136
+ template_id: "ensure-username" | "set-preferred-username" | "account-linking";
60920
61137
  enabled?: boolean | undefined;
61138
+ metadata?: Record<string, unknown> | undefined;
60921
61139
  synchronous?: boolean | undefined;
60922
61140
  priority?: number | undefined;
60923
61141
  hook_id?: string | undefined;
@@ -60925,6 +61143,7 @@ export declare function init(config: AuthHeroConfig): {
60925
61143
  code_id: string;
60926
61144
  trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "credentials-exchange";
60927
61145
  enabled?: boolean | undefined;
61146
+ metadata?: Record<string, unknown> | undefined;
60928
61147
  synchronous?: boolean | undefined;
60929
61148
  priority?: number | undefined;
60930
61149
  hook_id?: string | undefined;
@@ -60935,9 +61154,12 @@ export declare function init(config: AuthHeroConfig): {
60935
61154
  updated_at: string;
60936
61155
  url: string;
60937
61156
  enabled: boolean;
60938
- trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
61157
+ trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "post-user-update" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
60939
61158
  synchronous: boolean;
60940
61159
  hook_id: string;
61160
+ metadata?: {
61161
+ [x: string]: import("hono/utils/types").JSONValue;
61162
+ } | undefined;
60941
61163
  priority?: number | undefined | undefined;
60942
61164
  } | {
60943
61165
  created_at: string;
@@ -60947,15 +61169,21 @@ export declare function init(config: AuthHeroConfig): {
60947
61169
  synchronous: boolean;
60948
61170
  hook_id: string;
60949
61171
  form_id: string;
61172
+ metadata?: {
61173
+ [x: string]: import("hono/utils/types").JSONValue;
61174
+ } | undefined;
60950
61175
  priority?: number | undefined | undefined;
60951
61176
  } | {
60952
61177
  created_at: string;
60953
61178
  updated_at: string;
60954
61179
  enabled: boolean;
60955
- trigger_id: "post-user-login" | "credentials-exchange";
61180
+ trigger_id: "post-user-registration" | "post-user-login" | "post-user-update" | "credentials-exchange";
60956
61181
  synchronous: boolean;
60957
61182
  hook_id: string;
60958
- template_id: "ensure-username" | "set-preferred-username";
61183
+ template_id: "ensure-username" | "set-preferred-username" | "account-linking";
61184
+ metadata?: {
61185
+ [x: string]: import("hono/utils/types").JSONValue;
61186
+ } | undefined;
60959
61187
  priority?: number | undefined | undefined;
60960
61188
  } | {
60961
61189
  created_at: string;
@@ -60965,6 +61193,9 @@ export declare function init(config: AuthHeroConfig): {
60965
61193
  trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "credentials-exchange";
60966
61194
  synchronous: boolean;
60967
61195
  hook_id: string;
61196
+ metadata?: {
61197
+ [x: string]: import("hono/utils/types").JSONValue;
61198
+ } | undefined;
60968
61199
  priority?: number | undefined | undefined;
60969
61200
  };
60970
61201
  outputFormat: "json";
@@ -61005,9 +61236,12 @@ export declare function init(config: AuthHeroConfig): {
61005
61236
  updated_at: string;
61006
61237
  url: string;
61007
61238
  enabled: boolean;
61008
- trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
61239
+ trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "post-user-update" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
61009
61240
  synchronous: boolean;
61010
61241
  hook_id: string;
61242
+ metadata?: {
61243
+ [x: string]: import("hono/utils/types").JSONValue;
61244
+ } | undefined;
61011
61245
  priority?: number | undefined | undefined;
61012
61246
  } | {
61013
61247
  created_at: string;
@@ -61017,15 +61251,21 @@ export declare function init(config: AuthHeroConfig): {
61017
61251
  synchronous: boolean;
61018
61252
  hook_id: string;
61019
61253
  form_id: string;
61254
+ metadata?: {
61255
+ [x: string]: import("hono/utils/types").JSONValue;
61256
+ } | undefined;
61020
61257
  priority?: number | undefined | undefined;
61021
61258
  } | {
61022
61259
  created_at: string;
61023
61260
  updated_at: string;
61024
61261
  enabled: boolean;
61025
- trigger_id: "post-user-login" | "credentials-exchange";
61262
+ trigger_id: "post-user-registration" | "post-user-login" | "post-user-update" | "credentials-exchange";
61026
61263
  synchronous: boolean;
61027
61264
  hook_id: string;
61028
- template_id: "ensure-username" | "set-preferred-username";
61265
+ template_id: "ensure-username" | "set-preferred-username" | "account-linking";
61266
+ metadata?: {
61267
+ [x: string]: import("hono/utils/types").JSONValue;
61268
+ } | undefined;
61029
61269
  priority?: number | undefined | undefined;
61030
61270
  } | {
61031
61271
  created_at: string;
@@ -61035,6 +61275,9 @@ export declare function init(config: AuthHeroConfig): {
61035
61275
  trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "credentials-exchange";
61036
61276
  synchronous: boolean;
61037
61277
  hook_id: string;
61278
+ metadata?: {
61279
+ [x: string]: import("hono/utils/types").JSONValue;
61280
+ } | undefined;
61038
61281
  priority?: number | undefined | undefined;
61039
61282
  };
61040
61283
  outputFormat: "json";
@@ -61071,9 +61314,12 @@ export declare function init(config: AuthHeroConfig): {
61071
61314
  updated_at: string;
61072
61315
  url: string;
61073
61316
  enabled: boolean;
61074
- trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
61317
+ trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "post-user-update" | "validate-registration-username" | "pre-user-deletion" | "post-user-deletion";
61075
61318
  synchronous: boolean;
61076
61319
  hook_id: string;
61320
+ metadata?: {
61321
+ [x: string]: import("hono/utils/types").JSONValue;
61322
+ } | undefined;
61077
61323
  priority?: number | undefined | undefined;
61078
61324
  } | {
61079
61325
  created_at: string;
@@ -61083,15 +61329,21 @@ export declare function init(config: AuthHeroConfig): {
61083
61329
  synchronous: boolean;
61084
61330
  hook_id: string;
61085
61331
  form_id: string;
61332
+ metadata?: {
61333
+ [x: string]: import("hono/utils/types").JSONValue;
61334
+ } | undefined;
61086
61335
  priority?: number | undefined | undefined;
61087
61336
  } | {
61088
61337
  created_at: string;
61089
61338
  updated_at: string;
61090
61339
  enabled: boolean;
61091
- trigger_id: "post-user-login" | "credentials-exchange";
61340
+ trigger_id: "post-user-registration" | "post-user-login" | "post-user-update" | "credentials-exchange";
61092
61341
  synchronous: boolean;
61093
61342
  hook_id: string;
61094
- template_id: "ensure-username" | "set-preferred-username";
61343
+ template_id: "ensure-username" | "set-preferred-username" | "account-linking";
61344
+ metadata?: {
61345
+ [x: string]: import("hono/utils/types").JSONValue;
61346
+ } | undefined;
61095
61347
  priority?: number | undefined | undefined;
61096
61348
  } | {
61097
61349
  created_at: string;
@@ -61101,6 +61353,9 @@ export declare function init(config: AuthHeroConfig): {
61101
61353
  trigger_id: "pre-user-registration" | "post-user-registration" | "post-user-login" | "credentials-exchange";
61102
61354
  synchronous: boolean;
61103
61355
  hook_id: string;
61356
+ metadata?: {
61357
+ [x: string]: import("hono/utils/types").JSONValue;
61358
+ } | undefined;
61104
61359
  priority?: number | undefined | undefined;
61105
61360
  };
61106
61361
  outputFormat: "json";
@@ -61721,6 +61976,7 @@ export declare function init(config: AuthHeroConfig): {
61721
61976
  registration_metadata?: {
61722
61977
  [x: string]: any;
61723
61978
  } | undefined;
61979
+ user_linking_mode?: "builtin" | "off" | undefined | undefined;
61724
61980
  }[] | {
61725
61981
  length: number;
61726
61982
  start: number;
@@ -61809,6 +62065,7 @@ export declare function init(config: AuthHeroConfig): {
61809
62065
  registration_metadata?: {
61810
62066
  [x: string]: any;
61811
62067
  } | undefined;
62068
+ user_linking_mode?: "builtin" | "off" | undefined | undefined;
61812
62069
  }[];
61813
62070
  total?: number | undefined;
61814
62071
  };
@@ -61912,6 +62169,7 @@ export declare function init(config: AuthHeroConfig): {
61912
62169
  registration_metadata?: {
61913
62170
  [x: string]: any;
61914
62171
  } | undefined;
62172
+ user_linking_mode?: "builtin" | "off" | undefined | undefined;
61915
62173
  };
61916
62174
  outputFormat: "json";
61917
62175
  status: 200;
@@ -61998,6 +62256,7 @@ export declare function init(config: AuthHeroConfig): {
61998
62256
  owner_user_id?: string | undefined;
61999
62257
  registration_type?: "manual" | "open_dcr" | "iat_dcr" | undefined;
62000
62258
  registration_metadata?: Record<string, any> | undefined;
62259
+ user_linking_mode?: "builtin" | "off" | undefined;
62001
62260
  };
62002
62261
  };
62003
62262
  output: {
@@ -62084,6 +62343,7 @@ export declare function init(config: AuthHeroConfig): {
62084
62343
  registration_metadata?: {
62085
62344
  [x: string]: any;
62086
62345
  } | undefined;
62346
+ user_linking_mode?: "builtin" | "off" | undefined | undefined;
62087
62347
  };
62088
62348
  outputFormat: "json";
62089
62349
  status: 200;
@@ -62149,6 +62409,7 @@ export declare function init(config: AuthHeroConfig): {
62149
62409
  owner_user_id?: string | undefined;
62150
62410
  registration_type?: "manual" | "open_dcr" | "iat_dcr" | undefined;
62151
62411
  registration_metadata?: Record<string, any> | undefined;
62412
+ user_linking_mode?: "builtin" | "off" | undefined;
62152
62413
  };
62153
62414
  };
62154
62415
  output: {
@@ -62235,6 +62496,7 @@ export declare function init(config: AuthHeroConfig): {
62235
62496
  registration_metadata?: {
62236
62497
  [x: string]: any;
62237
62498
  } | undefined;
62499
+ user_linking_mode?: "builtin" | "off" | undefined;
62238
62500
  };
62239
62501
  outputFormat: "json";
62240
62502
  status: 201;