@productcraft/auth 0.5.2 → 0.7.1

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.
package/dist/index.d.ts CHANGED
@@ -29,6 +29,12 @@ type PlatformUserStatsResponseDto = {
29
29
  * Generated by Kubb (https://kubb.dev/).
30
30
  * Do not edit manually.
31
31
  */
32
+ declare const appResponseDtoEnvironmentEnum: {
33
+ readonly production: "production";
34
+ readonly staging: "staging";
35
+ readonly development: "development";
36
+ };
37
+ type AppResponseDtoEnvironmentEnumKey = (typeof appResponseDtoEnvironmentEnum)[keyof typeof appResponseDtoEnvironmentEnum];
32
38
  declare const appResponseDtoStatusEnum: {
33
39
  readonly active: "active";
34
40
  readonly suspended: "suspended";
@@ -36,6 +42,11 @@ declare const appResponseDtoStatusEnum: {
36
42
  };
37
43
  type AppResponseDtoStatusEnumKey = (typeof appResponseDtoStatusEnum)[keyof typeof appResponseDtoStatusEnum];
38
44
  type AppResponseDto = {
45
+ /**
46
+ * @description Days of `audit_log` history kept for this app. A nightly job deletes rows older than this. 30-3650.
47
+ * @type number
48
+ */
49
+ audit_retention_days: number;
39
50
  /**
40
51
  * @type string, date-time
41
52
  */
@@ -49,6 +60,11 @@ type AppResponseDto = {
49
60
  * @type string
50
61
  */
51
62
  display_name: string;
63
+ /**
64
+ * @description Which environment this app IS. One app is one environment — there is no switch; a staging app is a separate app created via `POST /v1/apps/:appId/clone`. Set at create time and never changed afterwards. Every app that predates this field is `production`.
65
+ * @type string
66
+ */
67
+ environment: AppResponseDtoEnvironmentEnumKey;
52
68
  /**
53
69
  * @type string
54
70
  */
@@ -69,6 +85,11 @@ type AppResponseDto = {
69
85
  * @type string, date-time
70
86
  */
71
87
  updated_at: string;
88
+ /**
89
+ * @description Days of outbound-webhook delivery-attempt history kept for this app. 7-365.
90
+ * @type number
91
+ */
92
+ webhook_attempt_retention_days: number;
72
93
  /**
73
94
  * @description Owning workspace UUID.
74
95
  * @type string
@@ -144,6 +165,11 @@ type AuditLogEntryDto = {
144
165
  * @type string
145
166
  */
146
167
  actor_id: string | null;
168
+ /**
169
+ * @description Who acted: `end_user`, `platform_user`, `api_key`, `system`, or an agent type.
170
+ * @type string
171
+ */
172
+ actor_type: string;
147
173
  /**
148
174
  * @description App this audit row belongs to.
149
175
  * @type string
@@ -155,25 +181,35 @@ type AuditLogEntryDto = {
155
181
  */
156
182
  created_at: string;
157
183
  /**
158
- * @description Free-form structured detail object captured at log time.
184
+ * @description Audit row UUID.
185
+ * @type string
186
+ */
187
+ id: string;
188
+ /**
189
+ * @description Client IP recorded at log time, when known.
190
+ * @type string
191
+ */
192
+ ip: string | null;
193
+ /**
194
+ * @description Free-form structured detail object captured at log time (e.g. `{ \"from\": \"bcrypt\", \"to\": \"argon2id\" }` on `auth.password.upgraded`). This is the `metadata` key on the wire.
159
195
  * @type object
160
196
  */
161
- details: object | null;
197
+ metadata: object | null;
162
198
  /**
163
- * @description Audit row UUID.
199
+ * @description Resource type touched (e.g. `app_membership`, `role`, `account`).
164
200
  * @type string
165
201
  */
166
- id: string;
202
+ resource: string | null;
167
203
  /**
168
204
  * @description Resource id touched.
169
205
  * @type string
170
206
  */
171
207
  resource_id: string | null;
172
208
  /**
173
- * @description Resource type touched (e.g. `app_membership`, `role`).
174
- * @type string
209
+ * @description Tenant the action concerns, when it concerns one (e.g. `tenant.api_key.*` rows). `null` on app-level rows and on rows written before the column existed.
210
+ * @type string, uuid
175
211
  */
176
- resource_type: string | null;
212
+ tenant_id: string | null;
177
213
  };
178
214
 
179
215
  /**
@@ -196,31 +232,53 @@ type AuditLogListResponseDto = {
196
232
  * Generated by Kubb (https://kubb.dev/).
197
233
  * Do not edit manually.
198
234
  */
199
- type M2MRotateSecretResponseDto = {
235
+ type M2MScopeEntryDto = {
200
236
  /**
201
237
  * @type string
202
238
  */
203
- client_id: string;
239
+ action: string;
204
240
  /**
205
- * @description New plaintext client secret. Returned exactly once.
206
241
  * @type string
207
242
  */
208
- client_secret: string;
243
+ resource: string;
209
244
  };
210
245
 
211
246
  /**
212
247
  * Generated by Kubb (https://kubb.dev/).
213
248
  * Do not edit manually.
214
249
  */
215
- type M2MScopeEntryDto = {
250
+ type SetScopesDto = {
251
+ /**
252
+ * @description Permission strings in resource.action format to assign as scopes
253
+ * @type array
254
+ */
255
+ permissions: string[];
256
+ };
257
+
258
+ /**
259
+ * Generated by Kubb (https://kubb.dev/).
260
+ * Do not edit manually.
261
+ */
262
+
263
+ /**
264
+ * @description Scopes updated. Returns the scopes the credential now holds.
265
+ */
266
+ type M2MControllerSetScopes200 = M2MScopeEntryDto[];
267
+
268
+ /**
269
+ * Generated by Kubb (https://kubb.dev/).
270
+ * Do not edit manually.
271
+ */
272
+ type M2MRotateSecretResponseDto = {
216
273
  /**
217
274
  * @type string
218
275
  */
219
- action: string;
276
+ client_id: string;
220
277
  /**
278
+ * @description New plaintext client secret. Returned exactly once.
221
279
  * @type string
222
280
  */
223
- resource: string;
281
+ client_secret: string;
224
282
  };
225
283
 
226
284
  /**
@@ -351,6 +409,11 @@ type CreateApiKeyResponseDto = {
351
409
  * @type string, date-time
352
410
  */
353
411
  created_at: string;
412
+ /**
413
+ * @description When this key stops authenticating. `null` means it never expires.
414
+ * @type string, date-time
415
+ */
416
+ expires_at: string | null;
354
417
  /**
355
418
  * @description API key row UUID.
356
419
  * @type string
@@ -382,11 +445,22 @@ type CreateApiKeyResponseDto = {
382
445
  * Generated by Kubb (https://kubb.dev/).
383
446
  * Do not edit manually.
384
447
  */
448
+ declare const apiKeySummaryDtoStatusEnum: {
449
+ readonly active: "active";
450
+ readonly expired: "expired";
451
+ readonly revoked: "revoked";
452
+ };
453
+ type ApiKeySummaryDtoStatusEnumKey = (typeof apiKeySummaryDtoStatusEnum)[keyof typeof apiKeySummaryDtoStatusEnum];
385
454
  type ApiKeySummaryDto = {
386
455
  /**
387
456
  * @type string, date-time
388
457
  */
389
458
  created_at: string;
459
+ /**
460
+ * @description `null` = never expires.
461
+ * @type string, date-time
462
+ */
463
+ expires_at: string | null;
390
464
  /**
391
465
  * @type string
392
466
  */
@@ -408,6 +482,25 @@ type ApiKeySummaryDto = {
408
482
  * @type array
409
483
  */
410
484
  permissions: string[];
485
+ /**
486
+ * @type string, date-time
487
+ */
488
+ revoked_at: string | null;
489
+ /**
490
+ * @description PlatformUser id of the revoker.
491
+ * @type string
492
+ */
493
+ revoked_by: string | null;
494
+ /**
495
+ * @description Id of the key this one replaced, if it was minted by a rotation.
496
+ * @type string
497
+ */
498
+ rotated_from: string | null;
499
+ /**
500
+ * @description Lifecycle state at the time of the request. `active` keys authenticate; `expired` and `revoked` ones do not. Revoked wins over expired.
501
+ * @type string
502
+ */
503
+ status: ApiKeySummaryDtoStatusEnumKey;
411
504
  };
412
505
 
413
506
  /**
@@ -514,6 +607,51 @@ type AppPermissionCatalogEntryDto = {
514
607
 
515
608
  type RoleControllerListPermissions200 = AppPermissionCatalogEntryDto[];
516
609
 
610
+ /**
611
+ * Generated by Kubb (https://kubb.dev/).
612
+ * Do not edit manually.
613
+ */
614
+ type RolePermissionEntryDto = {
615
+ /**
616
+ * @type string
617
+ */
618
+ action: string;
619
+ /**
620
+ * @type string
621
+ */
622
+ description: string | null;
623
+ /**
624
+ * @type string
625
+ */
626
+ id: string;
627
+ /**
628
+ * @type string
629
+ */
630
+ resource: string;
631
+ };
632
+
633
+ /**
634
+ * Generated by Kubb (https://kubb.dev/).
635
+ * Do not edit manually.
636
+ */
637
+ type SetPermissionsDto = {
638
+ /**
639
+ * @description Array of permission strings in resource.action format
640
+ * @type array
641
+ */
642
+ permissions: string[];
643
+ };
644
+
645
+ /**
646
+ * Generated by Kubb (https://kubb.dev/).
647
+ * Do not edit manually.
648
+ */
649
+
650
+ /**
651
+ * @description Permissions updated. Returns the set the role now holds — the write is caller-narrowed, so the resulting set is what the caller needs to see.
652
+ */
653
+ type RoleControllerSetPermissions200 = RolePermissionEntryDto[];
654
+
517
655
  /**
518
656
  * Generated by Kubb (https://kubb.dev/).
519
657
  * Do not edit manually.
@@ -600,6 +738,23 @@ type RoleListResponseDto = {
600
738
  pagination: PaginationDto;
601
739
  };
602
740
 
741
+ /**
742
+ * Generated by Kubb (https://kubb.dev/).
743
+ * Do not edit manually.
744
+ */
745
+ type EndUserRoleAssignmentResponseDto = {
746
+ /**
747
+ * @description Role name now bound to the app membership.
748
+ * @type string
749
+ */
750
+ role_name: string;
751
+ /**
752
+ * @description Account UUID of the end-user whose role changed.
753
+ * @type string
754
+ */
755
+ user_id: string;
756
+ };
757
+
603
758
  /**
604
759
  * Generated by Kubb (https://kubb.dev/).
605
760
  * Do not edit manually.
@@ -615,6 +770,11 @@ type EndUserSummaryDto = {
615
770
  * @type number
616
771
  */
617
772
  active_session_count: number;
773
+ /**
774
+ * @description How this person can sign in: `password` when a credential exists, plus each linked OAuth provider (`google`, `apple`, …). Empty means neither — an admin-created account that has not been sent a password reset cannot get in at all, and that is a real state rather than missing data.
775
+ * @type array
776
+ */
777
+ auth_providers: string[];
618
778
  /**
619
779
  * @type string, date-time
620
780
  */
@@ -631,6 +791,11 @@ type EndUserSummaryDto = {
631
791
  * @type string, date-time
632
792
  */
633
793
  email_verified_at: string | null;
794
+ /**
795
+ * @description Failed sign-ins in the last 30 days. Flagged at 3.
796
+ * @type number
797
+ */
798
+ failed_signins: number;
634
799
  /**
635
800
  * @type string
636
801
  */
@@ -639,10 +804,20 @@ type EndUserSummaryDto = {
639
804
  * @type string, date-time
640
805
  */
641
806
  joined_at: string | null;
807
+ /**
808
+ * @description Most recent audit-log entry with this user as the actor. Null means we have never recorded them doing anything — which is a different fact from \"no session\", and the one that tells you whether they ever got in.
809
+ * @type string, date-time
810
+ */
811
+ last_activity_at: string | null;
642
812
  /**
643
813
  * @type string, date-time
644
814
  */
645
815
  last_used_at: string | null;
816
+ /**
817
+ * @description Enabled auth factors (TOTP, email OTP).
818
+ * @type number
819
+ */
820
+ mfa_factor_count: number;
646
821
  /**
647
822
  * @type string
648
823
  */
@@ -651,10 +826,20 @@ type EndUserSummaryDto = {
651
826
  * @type string
652
827
  */
653
828
  status: EndUserSummaryDtoStatusEnumKey;
829
+ /**
830
+ * @description Set while a live session is locked out of step-up verification.
831
+ * @type string, date-time
832
+ */
833
+ step_up_locked_until: string | null;
654
834
  /**
655
835
  * @type string
656
836
  */
657
837
  username: string;
838
+ /**
839
+ * @description Verified email contacts, primary or not. Distinct from `emailVerifiedAt`, which is the primary contact only — the `unverified` filter accepts any verified email, so a renderer branching on `emailVerifiedAt` would disagree with it.
840
+ * @type number
841
+ */
842
+ verified_email_count: number;
658
843
  };
659
844
 
660
845
  /**
@@ -796,13 +981,28 @@ type EndUserInviteListResponseDto = {
796
981
  * Generated by Kubb (https://kubb.dev/).
797
982
  * Do not edit manually.
798
983
  */
984
+ declare const authConfigResponseDtoMfaEnum: {
985
+ readonly optional: "optional";
986
+ readonly required: "required";
987
+ };
988
+ type AuthConfigResponseDtoMfaEnumKey = (typeof authConfigResponseDtoMfaEnum)[keyof typeof authConfigResponseDtoMfaEnum];
799
989
  declare const authConfigResponseDtoOauthLinkPolicyEnum: {
800
990
  readonly auto: "auto";
801
991
  readonly confirm: "confirm";
802
992
  readonly reject: "reject";
803
993
  };
804
994
  type AuthConfigResponseDtoOauthLinkPolicyEnumKey = (typeof authConfigResponseDtoOauthLinkPolicyEnum)[keyof typeof authConfigResponseDtoOauthLinkPolicyEnum];
995
+ declare const authConfigResponseDtoPasswordBreachCheckEnum: {
996
+ readonly off: "off";
997
+ readonly warn: "warn";
998
+ readonly block: "block";
999
+ };
1000
+ type AuthConfigResponseDtoPasswordBreachCheckEnumKey = (typeof authConfigResponseDtoPasswordBreachCheckEnum)[keyof typeof authConfigResponseDtoPasswordBreachCheckEnum];
805
1001
  type AuthConfigResponseDto = {
1002
+ /**
1003
+ * @type number
1004
+ */
1005
+ access_token_minutes: number;
806
1006
  /**
807
1007
  * @type array
808
1008
  */
@@ -818,11 +1018,23 @@ type AuthConfigResponseDto = {
818
1018
  /**
819
1019
  * @type number
820
1020
  */
821
- max_sessions: number;
1021
+ max_sessions: number | null;
1022
+ /**
1023
+ * @type string
1024
+ */
1025
+ mfa: AuthConfigResponseDtoMfaEnumKey;
1026
+ /**
1027
+ * @type number
1028
+ */
1029
+ mfa_grace_days: number;
822
1030
  /**
823
1031
  * @type string
824
1032
  */
825
1033
  oauth_link_policy: AuthConfigResponseDtoOauthLinkPolicyEnumKey;
1034
+ /**
1035
+ * @type string
1036
+ */
1037
+ password_breach_check: AuthConfigResponseDtoPasswordBreachCheckEnumKey;
826
1038
  /**
827
1039
  * @type number
828
1040
  */
@@ -866,21 +1078,37 @@ type AuthConfigResponseDto = {
866
1078
  * Do not edit manually.
867
1079
  */
868
1080
  type UpdateAppDto = {
1081
+ /**
1082
+ * @description Days of `audit_log` history kept for this app. A nightly job deletes rows older than this. Minimum 30 days so an incident review always has a month to look at; maximum 3650 (10 years).
1083
+ * @minLength 30
1084
+ * @maxLength 3650
1085
+ * @default 365
1086
+ * @type number | undefined
1087
+ */
1088
+ audit_retention_days?: number;
869
1089
  /**
870
1090
  * @description New display name
871
1091
  * @type string | undefined
872
1092
  */
873
1093
  display_name?: string;
874
1094
  /**
875
- * @description Arbitrary metadata attached to the app
1095
+ * @description Your own key/value data for this app. It replaces the stored metadata, and keys are kept exactly as you send them. The `auth` key holds the app\'s sign-in settings, which you change with `PATCH /v1/apps/{appId}/auth-config` (it checks every value): leave `auth` out and it is kept as it is, or send it back unchanged. A different `auth` value is refused with 400 `AUTH_SETTINGS_IN_METADATA`.
876
1096
  * @type object | undefined
877
1097
  */
878
1098
  metadata?: object;
879
1099
  /**
880
- * @description Rename the app\'s slug. The old slug remains resolvable for 30 days as a JWKS-URL alias so existing customer-side verifiers don\'t break instantly. Same shape as the create-slug: lowercase alphanumeric + hyphens, 3–48 chars.
1100
+ * @description Rename the app\'s slug. The old slug remains resolvable for 30 days as a JWKS-URL alias so existing customer-side verifiers don\'t break instantly. Same shape as the create-slug: lowercase alphanumeric + hyphens, 3–48 chars, not shaped like a UUID.
881
1101
  * @type string | undefined
882
1102
  */
883
1103
  slug?: string;
1104
+ /**
1105
+ * @description Days of outbound-webhook delivery-attempt history kept for this app. Attempts are a debugging aid rather than a compliance record, hence the shorter floor.
1106
+ * @minLength 7
1107
+ * @maxLength 365
1108
+ * @default 30
1109
+ * @type number | undefined
1110
+ */
1111
+ webhook_attempt_retention_days?: number;
884
1112
  };
885
1113
 
886
1114
  /**
@@ -905,13 +1133,31 @@ type UpdateAppStatusDto = {
905
1133
  * Generated by Kubb (https://kubb.dev/).
906
1134
  * Do not edit manually.
907
1135
  */
1136
+ declare const updateAuthConfigDtoMfaEnum: {
1137
+ readonly optional: "optional";
1138
+ readonly required: "required";
1139
+ };
1140
+ type UpdateAuthConfigDtoMfaEnumKey = (typeof updateAuthConfigDtoMfaEnum)[keyof typeof updateAuthConfigDtoMfaEnum];
908
1141
  declare const updateAuthConfigDtoOauthLinkPolicyEnum: {
909
1142
  readonly auto: "auto";
910
1143
  readonly confirm: "confirm";
911
1144
  readonly reject: "reject";
912
1145
  };
913
1146
  type UpdateAuthConfigDtoOauthLinkPolicyEnumKey = (typeof updateAuthConfigDtoOauthLinkPolicyEnum)[keyof typeof updateAuthConfigDtoOauthLinkPolicyEnum];
1147
+ declare const updateAuthConfigDtoPasswordBreachCheckEnum: {
1148
+ readonly off: "off";
1149
+ readonly warn: "warn";
1150
+ readonly block: "block";
1151
+ };
1152
+ type UpdateAuthConfigDtoPasswordBreachCheckEnumKey = (typeof updateAuthConfigDtoPasswordBreachCheckEnum)[keyof typeof updateAuthConfigDtoPasswordBreachCheckEnum];
914
1153
  type UpdateAuthConfigDto = {
1154
+ /**
1155
+ * @description EndUser access-token lifetime in minutes (5-60, default 60). Independent of `session_duration_minutes`: the session and its refresh token can live for days while the access token expires in minutes. An access token is never issued for longer than the session it belongs to has left. M2M (client-credentials) tokens are unaffected and keep their fixed one-hour lifetime.
1156
+ * @minLength 5
1157
+ * @maxLength 60
1158
+ * @type number | undefined
1159
+ */
1160
+ access_token_minutes?: number;
915
1161
  /**
916
1162
  * @description Allowed origins for the `return_to` parameter on the OAuth web redirect callback. Exact origin match (scheme + host + port); no paths, no wildcards. Empty array disables the web redirect flow for this app. Prevents the callback from acting as an open-redirect.
917
1163
  * @type array | undefined
@@ -923,24 +1169,41 @@ type UpdateAuthConfigDto = {
923
1169
  */
924
1170
  enforce_app_permissions?: boolean;
925
1171
  /**
926
- * @description Failed-login attempts before the EndUser account is locked.
1172
+ * @description Consecutive failed signin attempts before an EndUser is locked out for 15 minutes. Applies to the signin lockout counters only; the separate short-burst limiter (5 attempts per identifier per minute) is fixed and not configurable.
927
1173
  * @minLength 1
928
1174
  * @maxLength 100
929
1175
  * @type number | undefined
930
1176
  */
931
1177
  max_failed_login_attempts?: number;
932
1178
  /**
933
- * @description Maximum concurrent sessions per EndUser. Oldest is evicted on overflow.
1179
+ * @description Maximum concurrent sessions per EndUser. When a signin would take the account past this number, the OLDEST session — the one created longest ago, not the one used longest ago — is revoked (audited as `auth.session.evicted`). Omit or send null for unlimited.
934
1180
  * @minLength 1
935
1181
  * @maxLength 50
1182
+ * @type number
1183
+ */
1184
+ max_sessions?: number | null;
1185
+ /**
1186
+ * @description Whether every EndUser must hold an MFA factor. `optional` (default) leaves MFA per-user opt-in. `required` refuses to mint a session for a user with no enabled factor: sign-in answers `{ mfa_enrollment_required: true, mfa_token, expires_at }` and the user enrols via POST /{app_slug}/v1/auth/mfa/enroll. IMPORTANT: turning this on does NOT terminate sessions that are already live — existing users keep their session until it expires or is revoked and only meet the requirement on their next sign-in. Revoke sessions explicitly if the policy has to bite immediately.
1187
+ * @type string | undefined
1188
+ */
1189
+ mfa?: UpdateAuthConfigDtoMfaEnumKey;
1190
+ /**
1191
+ * @description Grace window in days, measured from ACCOUNT CREATION, during which `mfa: required` still mints ordinary tokens. The sign-in response then also carries `mfa_enrollment_due_at` so a client can prompt rather than block. 0 (default) means no grace. Note the anchor: an app that turns the policy on with existing users will find every account older than the window is already past it.
1192
+ * @minLength 0
1193
+ * @maxLength 365
936
1194
  * @type number | undefined
937
1195
  */
938
- max_sessions?: number;
1196
+ mfa_grace_days?: number;
939
1197
  /**
940
1198
  * @description How to handle a federated sign-in (Apple, Google, …) that lands on a verified email already belonging to an account in this app. `confirm` (default) refuses to auto-link and surfaces `link_required` so the user signs in with their original method. `auto` silently links when the provider claims the email is verified AND the email is not a private relay. `reject` refuses outright. Private-relay emails never auto-link regardless.
941
1199
  * @type string | undefined
942
1200
  */
943
1201
  oauth_link_policy?: UpdateAuthConfigDtoOauthLinkPolicyEnumKey;
1202
+ /**
1203
+ * @description Whether passwords are checked against a public breach corpus (HIBP Pwned Passwords, k-anonymity range API) before being accepted. `block` (default) rejects a breached password with 400 `PASSWORD_BREACHED`. `warn` accepts it and returns `password_warnings: [\"breached\"]` alongside the tokens. `off` disables the lookup entirely, so no outbound call is made. The lookup always fails open — a timeout or an unreachable corpus never blocks a signup. Only the first five characters of the password\'s SHA-1 ever leave the service.
1204
+ * @type string | undefined
1205
+ */
1206
+ password_breach_check?: UpdateAuthConfigDtoPasswordBreachCheckEnumKey;
944
1207
  /**
945
1208
  * @description Minimum password length (NIST minimum is 8).
946
1209
  * @minLength 8
@@ -1118,18 +1381,6 @@ type AssignRoleDto = {
1118
1381
  role: string;
1119
1382
  };
1120
1383
 
1121
- /**
1122
- * Generated by Kubb (https://kubb.dev/).
1123
- * Do not edit manually.
1124
- */
1125
- type SetPermissionsDto = {
1126
- /**
1127
- * @description Array of permission strings in resource.action format
1128
- * @type array
1129
- */
1130
- permissions: string[];
1131
- };
1132
-
1133
1384
  /**
1134
1385
  * Generated by Kubb (https://kubb.dev/).
1135
1386
  * Do not edit manually.
@@ -1155,7 +1406,18 @@ type CreatePermissionDto = {
1155
1406
  * Generated by Kubb (https://kubb.dev/).
1156
1407
  * Do not edit manually.
1157
1408
  */
1409
+ declare const createApiKeyDtoExpiresInDaysEnum: {
1410
+ readonly "30": 30;
1411
+ readonly "90": 90;
1412
+ readonly "365": 365;
1413
+ };
1414
+ type CreateApiKeyDtoExpiresInDaysEnumKey = (typeof createApiKeyDtoExpiresInDaysEnum)[keyof typeof createApiKeyDtoExpiresInDaysEnum];
1158
1415
  type CreateApiKeyDto = {
1416
+ /**
1417
+ * @description Lifetime of the key in days. Omit or send `null` for a key that never expires — the historical behaviour and still the default.
1418
+ * @type number
1419
+ */
1420
+ expires_in_days?: CreateApiKeyDtoExpiresInDaysEnumKey | null;
1159
1421
  /**
1160
1422
  * @description Human-readable label for this key (shown in the API keys list).
1161
1423
  * @minLength 1
@@ -1194,23 +1456,18 @@ type UpdateM2MClientDto = {
1194
1456
  is_active?: boolean;
1195
1457
  };
1196
1458
 
1197
- /**
1198
- * Generated by Kubb (https://kubb.dev/).
1199
- * Do not edit manually.
1200
- */
1201
- type SetScopesDto = {
1202
- /**
1203
- * @description Permission strings in resource.action format to assign as scopes
1204
- * @type array
1205
- */
1206
- permissions: string[];
1207
- };
1208
-
1209
1459
  /**
1210
1460
  * Generated by Kubb (https://kubb.dev/).
1211
1461
  * Do not edit manually.
1212
1462
  */
1213
1463
 
1464
+ declare const endUserInviteControllerListQueryParamsStatusEnum: {
1465
+ readonly pending: "pending";
1466
+ readonly revoked: "revoked";
1467
+ readonly expired: "expired";
1468
+ readonly used: "used";
1469
+ };
1470
+ type EndUserInviteControllerListQueryParamsStatusEnumKey = (typeof endUserInviteControllerListQueryParamsStatusEnum)[keyof typeof endUserInviteControllerListQueryParamsStatusEnum];
1214
1471
  type EndUserInviteControllerListQueryParams = {
1215
1472
  /**
1216
1473
  * @type string | undefined
@@ -1220,6 +1477,11 @@ type EndUserInviteControllerListQueryParams = {
1220
1477
  * @type string | undefined
1221
1478
  */
1222
1479
  cursor?: string;
1480
+ /**
1481
+ * @description Derived lifecycle state. `revoked` = explicitly revoked; `expired` = past `expires_at`; `used` = `use_count` has reached `max_uses`; `pending` = still redeemable. Evaluated with the same precedence the accept-invite path rejects in, so the filter and redemption always agree.
1482
+ * @type string | undefined
1483
+ */
1484
+ status?: EndUserInviteControllerListQueryParamsStatusEnumKey;
1223
1485
  };
1224
1486
 
1225
1487
  /**
@@ -1243,6 +1505,29 @@ type AppControllerListMembersQueryParams = {
1243
1505
  * Do not edit manually.
1244
1506
  */
1245
1507
 
1508
+ declare const endUserControllerListEndUsersQueryParamsSignalEnum: {
1509
+ readonly unverified: "unverified";
1510
+ readonly failing_signin: "failing_signin";
1511
+ readonly no_mfa: "no_mfa";
1512
+ readonly locked: "locked";
1513
+ readonly never_active: "never_active";
1514
+ };
1515
+ type EndUserControllerListEndUsersQueryParamsSignalEnumKey = (typeof endUserControllerListEndUsersQueryParamsSignalEnum)[keyof typeof endUserControllerListEndUsersQueryParamsSignalEnum];
1516
+ declare const endUserControllerListEndUsersQueryParamsSortEnum: {
1517
+ readonly created: "created";
1518
+ readonly joined: "joined";
1519
+ readonly user: "user";
1520
+ readonly status: "status";
1521
+ readonly role: "role";
1522
+ readonly sessions: "sessions";
1523
+ readonly last_activity: "last_activity";
1524
+ };
1525
+ type EndUserControllerListEndUsersQueryParamsSortEnumKey = (typeof endUserControllerListEndUsersQueryParamsSortEnum)[keyof typeof endUserControllerListEndUsersQueryParamsSortEnum];
1526
+ declare const endUserControllerListEndUsersQueryParamsOrderEnum: {
1527
+ readonly asc: "asc";
1528
+ readonly desc: "desc";
1529
+ };
1530
+ type EndUserControllerListEndUsersQueryParamsOrderEnumKey = (typeof endUserControllerListEndUsersQueryParamsOrderEnum)[keyof typeof endUserControllerListEndUsersQueryParamsOrderEnum];
1246
1531
  type EndUserControllerListEndUsersQueryParams = {
1247
1532
  /**
1248
1533
  * @type string | undefined
@@ -1260,6 +1545,25 @@ type EndUserControllerListEndUsersQueryParams = {
1260
1545
  * @type string | undefined
1261
1546
  */
1262
1547
  search?: string;
1548
+ /**
1549
+ * @description Narrow to accounts carrying one risk signal. Each is a fact already recorded: `unverified` (no verified email contact), `failing_signin` (>= 3 failed sign-ins in 30d), `no_mfa` (no enabled auth factor), `locked` (a live session locked out of step-up), `never_active` (no audit-log entry at all).
1550
+ * @type string | undefined
1551
+ */
1552
+ signal?: EndUserControllerListEndUsersQueryParamsSignalEnumKey;
1553
+ /**
1554
+ * @description Narrow to accounts that can sign in with this provider. `password` matches accounts with a password credential; any other value matches a linked OAuth identity.
1555
+ * @type string | undefined
1556
+ */
1557
+ provider?: string;
1558
+ /**
1559
+ * @description Order the list. Nulls sort last in BOTH directions.
1560
+ * @type string | undefined
1561
+ */
1562
+ sort?: EndUserControllerListEndUsersQueryParamsSortEnumKey;
1563
+ /**
1564
+ * @type string | undefined
1565
+ */
1566
+ order?: EndUserControllerListEndUsersQueryParamsOrderEnumKey;
1263
1567
  };
1264
1568
 
1265
1569
  /**
@@ -1284,6 +1588,16 @@ type AppAuditControllerGetAuditLogsQueryParams = {
1284
1588
  * @type string | undefined
1285
1589
  */
1286
1590
  actor_id?: string;
1591
+ /**
1592
+ * @description Inclusive lower bound on `created_at`. ISO-8601 date (`2026-05-01`, midnight UTC) or date-time (`2026-05-01T09:00:00Z`). Composes with `action` / `actor_id` / `until` and with the cursor.
1593
+ * @type string | undefined, date-time
1594
+ */
1595
+ since?: string;
1596
+ /**
1597
+ * @description Inclusive upper bound on `created_at`. Same formats as `since`. Note a bare date resolves to midnight UTC, so `until=2026-05-01` excludes that day\'s later entries.
1598
+ * @type string | undefined, date-time
1599
+ */
1600
+ until?: string;
1287
1601
  };
1288
1602
 
1289
1603
  /**
@@ -1316,6 +1630,11 @@ type RoleControllerListRolesQueryParams = {
1316
1630
  * @type string | undefined
1317
1631
  */
1318
1632
  cursor?: string;
1633
+ /**
1634
+ * @description Case-insensitive substring match on the role name. Composes with the cursor.
1635
+ * @type string | undefined
1636
+ */
1637
+ search?: string;
1319
1638
  };
1320
1639
 
1321
1640
  declare class AppScope {
@@ -1353,7 +1672,7 @@ declare class AppScope {
1353
1672
  get: (userId: string) => Promise<EndUserSummaryDto>;
1354
1673
  update: (userId: string, data: UpdateEndUserDto) => Promise<EndUserSummaryDto>;
1355
1674
  delete: (userId: string) => Promise<any>;
1356
- updateRole: (userId: string, data: UpdateEndUserRoleDto) => Promise<any>;
1675
+ updateRole: (userId: string, data: UpdateEndUserRoleDto) => Promise<EndUserRoleAssignmentResponseDto>;
1357
1676
  updateStatus: (userId: string, data: UpdateEndUserStatusDto) => Promise<EndUserSummaryDto>;
1358
1677
  /** Spec bug: appId missing in spec params (see callDirect). */
1359
1678
  revokeAllSessions: (userId: string) => Promise<void>;
@@ -1368,7 +1687,7 @@ declare class AppScope {
1368
1687
  /** Spec bug: appId missing in spec params (see callDirect). */
1369
1688
  delete: (roleName: string) => Promise<void>;
1370
1689
  assign: (data: AssignRoleDto) => Promise<AppMembershipResponseDto>;
1371
- setPermissions: (roleName: string, data: SetPermissionsDto) => Promise<any>;
1690
+ setPermissions: (roleName: string, data: SetPermissionsDto) => Promise<RoleControllerSetPermissions200>;
1372
1691
  listPermissions: () => Promise<RoleControllerListPermissions200>;
1373
1692
  };
1374
1693
  readonly permissions: {
@@ -1385,10 +1704,10 @@ declare class AppScope {
1385
1704
  list: (params?: Partial<M2MControllerListClientsQueryParams>) => Promise<M2MClientListResponseDto>;
1386
1705
  create: (data: CreateM2MClientDto) => Promise<M2MClientCreateResponseDto>;
1387
1706
  get: (clientId: string) => Promise<M2MClientDetailResponseDto>;
1388
- update: (clientId: string, data: UpdateM2MClientDto) => Promise<any>;
1707
+ update: (clientId: string, data: UpdateM2MClientDto) => Promise<M2MClientDetailResponseDto>;
1389
1708
  delete: (clientId: string) => Promise<any>;
1390
1709
  rotateSecret: (clientId: string) => Promise<M2MRotateSecretResponseDto>;
1391
- setScopes: (clientId: string, data: SetScopesDto) => Promise<any>;
1710
+ setScopes: (clientId: string, data: SetScopesDto) => Promise<M2MControllerSetScopes200>;
1392
1711
  };
1393
1712
  readonly auditLogs: {
1394
1713
  list: (params?: Partial<AppAuditControllerGetAuditLogsQueryParams>) => Promise<AuditLogListResponseDto>;
@@ -1513,7 +1832,7 @@ type VerifyPrincipalDto = {
1513
1832
 
1514
1833
  type VerifyResponseDto = {
1515
1834
  /**
1516
- * @description Failure code on `valid: false` — e.g. `TOKEN_INVALID`, `TOKEN_EXPIRED`, `TOKEN_REVOKED`, `ACCOUNT_SUSPENDED`.
1835
+ * @description Failure code on `valid: false`. `TOKEN_INVALID` — signature / issuer / audience / app mismatch, an `end_user` token with no `sid` claim, or an `end_user` token whose account row no longer exists. `TOKEN_EXPIRED` — the token\'s own `exp` has passed. `TOKEN_REVOKED` — the backing session was revoked (sign-out, password change, admin revoke) or its row no longer exists because the end user was deleted. `SESSION_EXPIRED` — the session row is past `expires_at`; the access token outlived the session that minted it. `ACCOUNT_SUSPENDED` — the account exists but its status is not `active`.
1517
1836
  * @type string | undefined
1518
1837
  */
1519
1838
  error?: string;
@@ -1522,7 +1841,7 @@ type VerifyResponseDto = {
1522
1841
  */
1523
1842
  principal?: VerifyPrincipalDto;
1524
1843
  /**
1525
- * @description True iff the signature, issuer, audience, and session are all valid.
1844
+ * @description True iff the signature, issuer, audience AND the backing session are all valid. For `end_user` tokens the session must exist, be unrevoked and be unexpired, and the account row must still exist and be active — a deleted end user is never `valid: true`, even inside the access token\'s own `exp` window.
1526
1845
  * @type boolean
1527
1846
  */
1528
1847
  valid: boolean;
@@ -1532,70 +1851,159 @@ type VerifyResponseDto = {
1532
1851
  * Generated by Kubb (https://kubb.dev/).
1533
1852
  * Do not edit manually.
1534
1853
  */
1535
- type ConsumerMfaChallengeFactorDto = {
1854
+ type IdpMfaEnrollmentRequiredResponseDto = {
1536
1855
  /**
1537
- * @type string
1856
+ * @type string, date-time
1538
1857
  */
1539
- id: string;
1858
+ expires_at: string;
1540
1859
  /**
1541
- * @type string
1860
+ * @type boolean
1542
1861
  */
1543
- label: string | null;
1862
+ mfa_enrollment_required: boolean;
1544
1863
  /**
1545
- * @description Factor type — currently `totp`; widens as new factor types ship.
1864
+ * @description Single-use enrolment token. Not an access token: no session has been created. Complete via `POST /{app_slug}/v1/auth/mfa/enroll` then `/auth/mfa/enroll/verify`.
1546
1865
  * @type string
1547
1866
  */
1548
- type: string;
1867
+ mfa_token: string;
1549
1868
  };
1550
1869
 
1551
1870
  /**
1552
1871
  * Generated by Kubb (https://kubb.dev/).
1553
1872
  * Do not edit manually.
1554
1873
  */
1555
-
1556
- type ConsumerMfaChallengeResponseDto = {
1874
+ type IdpNativeUserHintDto = {
1557
1875
  /**
1558
- * @description When the challenge expires (ISO 8601, UTC).
1559
- * @type string, date-time
1876
+ * @type string | undefined
1560
1877
  */
1561
- expires_at: string;
1878
+ email?: string;
1562
1879
  /**
1563
- * @description Factors the user can satisfy this challenge with (any-of).
1564
- * @type array
1880
+ * @type string | undefined
1565
1881
  */
1566
- factors: ConsumerMfaChallengeFactorDto[];
1882
+ name?: string;
1883
+ };
1884
+
1885
+ /**
1886
+ * Generated by Kubb (https://kubb.dev/).
1887
+ * Do not edit manually.
1888
+ */
1889
+
1890
+ type IdpNativeSigninDto = {
1567
1891
  /**
1568
- * @description Always `true` on this response. Distinguishes it from the normal token response shape.
1569
- * @type boolean
1892
+ * @description Provider-issued ID token (JWT). For Apple, the value returned by `ASAuthorizationAppleIDCredential.identityToken` after UTF-8 decoding the data.
1893
+ * @minLength 16
1894
+ * @maxLength 8192
1895
+ * @type string
1570
1896
  */
1571
- mfa_required: boolean;
1897
+ id_token: string;
1572
1898
  /**
1573
- * @description Single-use challenge id. Pass back as `mfa_token` on `/auth/mfa/verify` or `/auth/mfa/recover` to complete the sign-in. 5-minute TTL.
1899
+ * @description Raw nonce the client generated and SHA-256-hashed into the authorize request. Backend recomputes the hash and compares to the token\'s `nonce` claim. Must be at least 32 bytes of entropy (base64url-encoded ~43 chars).
1900
+ * @minLength 16
1901
+ * @maxLength 256
1574
1902
  * @type string
1575
1903
  */
1576
- mfa_token: string;
1904
+ nonce: string;
1905
+ /**
1906
+ * @description Apple-specific first-signin payload: { name, email }. Persist for display only — the verified JWT is the source of truth.
1907
+ */
1908
+ user?: IdpNativeUserHintDto;
1577
1909
  };
1578
1910
 
1579
1911
  /**
1580
1912
  * Generated by Kubb (https://kubb.dev/).
1581
1913
  * Do not edit manually.
1582
1914
  */
1583
- type ConsumerSigninDto = {
1915
+ declare const idpTokenResponseDtoTokenTypeEnum: {
1916
+ readonly Bearer: "Bearer";
1917
+ };
1918
+ type IdpTokenResponseDtoTokenTypeEnumKey = (typeof idpTokenResponseDtoTokenTypeEnum)[keyof typeof idpTokenResponseDtoTokenTypeEnum];
1919
+ type IdpTokenResponseDto = {
1584
1920
  /**
1585
- * @description Username or verified primary email — either accepted. Secondary or unverified emails do not authenticate.
1586
1921
  * @type string
1587
1922
  */
1588
- identifier: string;
1923
+ access_token: string;
1924
+ /**
1925
+ * @description Lifetime of the access token in seconds.
1926
+ * @type number
1927
+ */
1928
+ expires_in: number;
1929
+ /**
1930
+ * @description Present only when the app runs `mfa: \"required\"`, the user holds no enabled factor, and the account is still inside `mfa_grace_days` of its creation. Tokens ARE issued; this is the deadline after which federated sign-in starts returning `mfa_enrollment_required` instead.
1931
+ * @type string | undefined, date-time
1932
+ */
1933
+ mfa_enrollment_due_at?: string;
1589
1934
  /**
1590
- * @description EndUser password.
1935
+ * @type string
1936
+ */
1937
+ refresh_token: string;
1938
+ /**
1939
+ * @type string
1940
+ */
1941
+ token_type: IdpTokenResponseDtoTokenTypeEnumKey;
1942
+ };
1943
+
1944
+ /**
1945
+ * Generated by Kubb (https://kubb.dev/).
1946
+ * Do not edit manually.
1947
+ */
1948
+
1949
+ declare const consumerIdpControllerNativeSignInPathParamsProviderEnum: {
1950
+ readonly apple: "apple";
1951
+ readonly google: "google";
1952
+ readonly github: "github";
1953
+ };
1954
+ type ConsumerIdpControllerNativeSignInPathParamsProviderEnumKey = (typeof consumerIdpControllerNativeSignInPathParamsProviderEnum)[keyof typeof consumerIdpControllerNativeSignInPathParamsProviderEnum];
1955
+ /**
1956
+ * @description Either a token pair or, when the app runs `auth_config.mfa: \"required\"` and the account holds no enabled factor, an enrolment demand (`mfa_enrollment_required: true`) with no session behind it. Branch on `mfa_enrollment_required`.
1957
+ */
1958
+ type ConsumerIdpControllerNativeSignIn200 = IdpTokenResponseDto | IdpMfaEnrollmentRequiredResponseDto;
1959
+
1960
+ /**
1961
+ * Generated by Kubb (https://kubb.dev/).
1962
+ * Do not edit manually.
1963
+ */
1964
+ type ConsumerAcceptInviteDto = {
1965
+ /**
1966
+ * @description Invite code from the invitation email (`inv_…`).
1967
+ * @type string
1968
+ */
1969
+ code: string;
1970
+ /**
1971
+ * @description Optional display name shown back to the user.
1972
+ * @type string | undefined
1973
+ */
1974
+ display_name?: string;
1975
+ /**
1976
+ * @description Password the accepter sets for their new account.
1591
1977
  * @type string
1592
1978
  */
1593
1979
  password: string;
1594
1980
  /**
1595
- * @description Optional tenant UUID. When set, the issued JWT carries `tid` + `trole` claims and the user must already be a member of that tenant — non-membership returns 403.
1981
+ * @description Optional username override. Defaults to a derivation of the invite email local-part.
1596
1982
  * @type string | undefined
1597
1983
  */
1598
- tenant_id?: string;
1984
+ username?: string;
1985
+ };
1986
+
1987
+ /**
1988
+ * Generated by Kubb (https://kubb.dev/).
1989
+ * Do not edit manually.
1990
+ */
1991
+ type ConsumerMfaEnrollmentRequiredResponseDto = {
1992
+ /**
1993
+ * @description When the enrolment token expires (ISO 8601, UTC).
1994
+ * @type string, date-time
1995
+ */
1996
+ expires_at: string;
1997
+ /**
1998
+ * @description Always `true` on this response. Distinguishes it from both the normal token response and the `mfa_required` challenge response.
1999
+ * @type boolean
2000
+ */
2001
+ mfa_enrollment_required: boolean;
2002
+ /**
2003
+ * @description Single-use enrolment token. Pass back as `mfa_token` on `/auth/mfa/enroll` and `/auth/mfa/enroll/verify`. It is NOT an access token: it cannot call `/me/*`, cannot be refreshed, and is refused by `/auth/mfa/verify`, `/auth/mfa/send-code` and `/auth/mfa/recover`. No session exists yet. 10-minute TTL.
2004
+ * @type string
2005
+ */
2006
+ mfa_token: string;
1599
2007
  };
1600
2008
 
1601
2009
  /**
@@ -1613,6 +2021,16 @@ type ConsumerTokenResponseDto = {
1613
2021
  * @type number
1614
2022
  */
1615
2023
  expires_in: number;
2024
+ /**
2025
+ * @description Present only when the app runs `mfa: \"required\"`, the user holds no enabled factor, and the account is still inside `mfa_grace_days` of its creation. The session IS minted; this is the deadline after which sign-in will start returning `mfa_enrollment_required` instead, so a client can prompt rather than block. Absent in every other case.
2026
+ * @type string | undefined, date-time
2027
+ */
2028
+ mfa_enrollment_due_at?: string;
2029
+ /**
2030
+ * @description Non-fatal notes about the password that was just set. Present only on `signup` and `accept-invite`, and only when the app runs `password_breach_check: \"warn\"` and the password was found in a public breach corpus — the value is then `[\"breached\"]` and the session is minted anyway, so the client can prompt the user to change it. The key is ABSENT (not an empty array) when there is nothing to report; do not branch on its length without checking that it exists. Apps on the default `block` never see it — a breached password is refused with 400 `PASSWORD_BREACHED`.
2031
+ * @type array | undefined
2032
+ */
2033
+ password_warnings?: string[];
1616
2034
  /**
1617
2035
  * @description Long-lived opaque-ish JWT used to mint a new access token via /auth/refresh. Rotated on use.
1618
2036
  * @type string
@@ -1630,9 +2048,94 @@ type ConsumerTokenResponseDto = {
1630
2048
  */
1631
2049
 
1632
2050
  /**
1633
- * @description Either a normal token response or an MFA challenge — distinguish by `mfa_required`.
2051
+ * @description Account created from the invite. A session was minted unless `mfa_enrollment_required` is present — branch on that flag.
2052
+ */
2053
+ type ConsumerAuthControllerAcceptInvite201 = ConsumerTokenResponseDto | ConsumerMfaEnrollmentRequiredResponseDto;
2054
+
2055
+ /**
2056
+ * Generated by Kubb (https://kubb.dev/).
2057
+ * Do not edit manually.
2058
+ */
2059
+ type ConsumerMfaChallengeFactorDto = {
2060
+ /**
2061
+ * @description Email factors only: masked address codes are delivered to (e.g. `a***a@e***e.com`). Null / absent for other factor types.
2062
+ * @type string
2063
+ */
2064
+ email_masked?: string | null;
2065
+ /**
2066
+ * @type string
2067
+ */
2068
+ id: string;
2069
+ /**
2070
+ * @type string
2071
+ */
2072
+ label: string | null;
2073
+ /**
2074
+ * @description Factor type — `totp`, `email` or `webauthn`; widens as new factor types ship. For `email`, request delivery via `POST /auth/mfa/send-code` before verifying. For `webauthn`, request assertion options via `POST /auth/mfa/webauthn/options`.
2075
+ * @type string
2076
+ */
2077
+ type: string;
2078
+ };
2079
+
2080
+ /**
2081
+ * Generated by Kubb (https://kubb.dev/).
2082
+ * Do not edit manually.
2083
+ */
2084
+
2085
+ type ConsumerMfaChallengeResponseDto = {
2086
+ /**
2087
+ * @description When the challenge expires (ISO 8601, UTC).
2088
+ * @type string, date-time
2089
+ */
2090
+ expires_at: string;
2091
+ /**
2092
+ * @description Factors the user can satisfy this challenge with (any-of).
2093
+ * @type array
2094
+ */
2095
+ factors: ConsumerMfaChallengeFactorDto[];
2096
+ /**
2097
+ * @description Always `true` on this response. Distinguishes it from the normal token response shape.
2098
+ * @type boolean
2099
+ */
2100
+ mfa_required: boolean;
2101
+ /**
2102
+ * @description Single-use challenge id. Pass back as `mfa_token` on `/auth/mfa/verify` or `/auth/mfa/recover` to complete the sign-in. 5-minute TTL.
2103
+ * @type string
2104
+ */
2105
+ mfa_token: string;
2106
+ };
2107
+
2108
+ /**
2109
+ * Generated by Kubb (https://kubb.dev/).
2110
+ * Do not edit manually.
1634
2111
  */
1635
- type ConsumerAuthControllerSignin200 = ConsumerTokenResponseDto | ConsumerMfaChallengeResponseDto;
2112
+ type ConsumerSigninDto = {
2113
+ /**
2114
+ * @description Username or verified primary email — either accepted. Secondary or unverified emails do not authenticate.
2115
+ * @type string
2116
+ */
2117
+ identifier: string;
2118
+ /**
2119
+ * @description EndUser password.
2120
+ * @type string
2121
+ */
2122
+ password: string;
2123
+ /**
2124
+ * @description Optional tenant UUID. When set, the issued JWT carries `tid` + `trole` claims and the user must already be a member of that tenant — non-membership returns 403.
2125
+ * @type string | undefined
2126
+ */
2127
+ tenant_id?: string;
2128
+ };
2129
+
2130
+ /**
2131
+ * Generated by Kubb (https://kubb.dev/).
2132
+ * Do not edit manually.
2133
+ */
2134
+
2135
+ /**
2136
+ * @description A normal token response, an MFA challenge, or an MFA enrolment demand — distinguish by `mfa_required` / `mfa_enrollment_required`. Neither flag present means a session was minted.
2137
+ */
2138
+ type ConsumerAuthControllerSignin200 = ConsumerTokenResponseDto | ConsumerMfaChallengeResponseDto | ConsumerMfaEnrollmentRequiredResponseDto;
1636
2139
 
1637
2140
  /**
1638
2141
  * Generated by Kubb (https://kubb.dev/).
@@ -1650,12 +2153,12 @@ type ConsumerSignupDto = {
1650
2153
  */
1651
2154
  email: string;
1652
2155
  /**
1653
- * @description Password. Must satisfy the app-configured policy (default: 8+ chars).
2156
+ * @description Password. Must satisfy the app-configured policy (default: 12+ chars, at least one uppercase letter and one digit), must not be on the common-password deny-list, and — unless the app sets `password_breach_check` to `off` or `warn` — must not appear in the public breach corpus.
1654
2157
  * @type string
1655
2158
  */
1656
2159
  password: string;
1657
2160
  /**
1658
- * @description Unique username inside the app. 3+ chars.
2161
+ * @description Unique username inside the app. 3-32 characters: letters, numbers, dot, underscore, hyphen. No \"@\" — a username shaped like an email address would sit in front of that address at sign-in.
1659
2162
  * @type string
1660
2163
  */
1661
2164
  username: string;
@@ -1702,6 +2205,18 @@ type ConsumerRequestPasswordResetDto = {
1702
2205
  phone?: string;
1703
2206
  };
1704
2207
 
2208
+ /**
2209
+ * Generated by Kubb (https://kubb.dev/).
2210
+ * Do not edit manually.
2211
+ */
2212
+ type ConsumerSendPasswordResetEmailDto = {
2213
+ /**
2214
+ * @description Email contact value to send the password-reset code to.
2215
+ * @type string
2216
+ */
2217
+ email: string;
2218
+ };
2219
+
1705
2220
  /**
1706
2221
  * Generated by Kubb (https://kubb.dev/).
1707
2222
  * Do not edit manually.
@@ -1760,33 +2275,6 @@ type ConsumerVerifyDto = {
1760
2275
  code: string;
1761
2276
  };
1762
2277
 
1763
- /**
1764
- * Generated by Kubb (https://kubb.dev/).
1765
- * Do not edit manually.
1766
- */
1767
- type ConsumerAcceptInviteDto = {
1768
- /**
1769
- * @description Invite code from the invitation email (`inv_…`).
1770
- * @type string
1771
- */
1772
- code: string;
1773
- /**
1774
- * @description Optional display name shown back to the user.
1775
- * @type string | undefined
1776
- */
1777
- display_name?: string;
1778
- /**
1779
- * @description Password the accepter sets for their new account.
1780
- * @type string
1781
- */
1782
- password: string;
1783
- /**
1784
- * @description Optional username override. Defaults to a derivation of the invite email local-part.
1785
- * @type string | undefined
1786
- */
1787
- username?: string;
1788
- };
1789
-
1790
2278
  /**
1791
2279
  * Generated by Kubb (https://kubb.dev/).
1792
2280
  * Do not edit manually.
@@ -1860,6 +2348,14 @@ type UpdateMeDto = {
1860
2348
  * @type string | undefined
1861
2349
  */
1862
2350
  display_name?: string;
2351
+ /**
2352
+ * @description New username. Unique per app, case-insensitive. 3-32 chars: letters, numbers, dot, underscore, hyphen. Omit to leave unchanged — cannot be cleared. 409 `USERNAME_TAKEN` when another account in the app holds it.
2353
+ * @minLength 3
2354
+ * @maxLength 32
2355
+ * @pattern ^[a-zA-Z0-9._-]+$
2356
+ * @type string | undefined
2357
+ */
2358
+ username?: string;
1863
2359
  };
1864
2360
 
1865
2361
  /**
@@ -1962,82 +2458,261 @@ type ClientCredentialsDto = {
1962
2458
  * Generated by Kubb (https://kubb.dev/).
1963
2459
  * Do not edit manually.
1964
2460
  */
1965
- type IdpNativeUserHintDto = {
1966
- /**
1967
- * @type string | undefined
1968
- */
1969
- email?: string;
2461
+ type ConsumerPasskeyOptionsDto = {
1970
2462
  /**
1971
- * @type string | undefined
2463
+ * @description Optional tenant to activate on the session the ceremony will mint, same semantics as `tenant_id` on `/auth/signin`.
2464
+ * @type string | undefined, uuid
1972
2465
  */
1973
- name?: string;
2466
+ tenant_id?: string;
1974
2467
  };
1975
2468
 
1976
2469
  /**
1977
2470
  * Generated by Kubb (https://kubb.dev/).
1978
2471
  * Do not edit manually.
1979
2472
  */
1980
-
1981
- type IdpNativeSigninDto = {
2473
+ type PublicFactorDto = {
2474
+ /**
2475
+ * @type string, date-time
2476
+ */
2477
+ created_at: string;
2478
+ /**
2479
+ * @type boolean
2480
+ */
2481
+ enabled: boolean;
2482
+ /**
2483
+ * @type string, date-time
2484
+ */
2485
+ enabled_at: string | null;
1982
2486
  /**
1983
- * @description Provider-issued ID token (JWT). For Apple, the value returned by `ASAuthorizationAppleIDCredential.identityToken` after UTF-8 decoding the data.
1984
- * @minLength 16
1985
- * @maxLength 8192
1986
2487
  * @type string
1987
2488
  */
1988
- id_token: string;
2489
+ id: string;
1989
2490
  /**
1990
- * @description Raw nonce the client generated and SHA-256-hashed into the authorize request. Backend recomputes the hash and compares to the token\'s `nonce` claim. Must be at least 32 bytes of entropy (base64url-encoded ~43 chars).
1991
- * @minLength 16
1992
- * @maxLength 256
1993
2491
  * @type string
1994
2492
  */
1995
- nonce: string;
2493
+ label: string | null;
1996
2494
  /**
1997
- * @description Apple-specific first-signin payload: { name, email }. Persist for display only — the verified JWT is the source of truth.
2495
+ * @description Factor type — `totp` (authenticator app), `email` (single-use code delivered to a verified email contact), or `webauthn` (a passkey). Further factor types will extend this list without a breaking change to the response shape.
2496
+ * @type string
1998
2497
  */
1999
- user?: IdpNativeUserHintDto;
2498
+ type: string;
2000
2499
  };
2001
2500
 
2002
2501
  /**
2003
2502
  * Generated by Kubb (https://kubb.dev/).
2004
2503
  * Do not edit manually.
2005
2504
  */
2006
- declare const idpTokenResponseDtoTokenTypeEnum: {
2007
- readonly Bearer: "Bearer";
2008
- };
2009
- type IdpTokenResponseDtoTokenTypeEnumKey = (typeof idpTokenResponseDtoTokenTypeEnum)[keyof typeof idpTokenResponseDtoTokenTypeEnum];
2010
- type IdpTokenResponseDto = {
2505
+
2506
+ type ConfirmEnrollmentResponseDto = {
2011
2507
  /**
2012
- * @type string
2508
+ * @type object
2013
2509
  */
2014
- access_token: string;
2510
+ factor: PublicFactorDto;
2015
2511
  /**
2016
- * @description Lifetime of the access token in seconds.
2017
- * @type number
2512
+ * @description Single-use recovery codes for this account. Shown once — store them now.
2513
+ * @type array
2018
2514
  */
2019
- expires_in: number;
2515
+ recovery_codes: string[];
2516
+ };
2517
+
2518
+ /**
2519
+ * Generated by Kubb (https://kubb.dev/).
2520
+ * Do not edit manually.
2521
+ */
2522
+ type StepUpResponseDto = {
2020
2523
  /**
2021
- * @type string
2524
+ * @type array
2022
2525
  */
2023
- refresh_token: string;
2526
+ amr: string[];
2024
2527
  /**
2025
- * @type string
2528
+ * @type string, date-time
2026
2529
  */
2027
- token_type: IdpTokenResponseDtoTokenTypeEnumKey;
2530
+ mfa_at: string;
2028
2531
  };
2029
2532
 
2030
2533
  /**
2031
- * Generated by Kubb (https://kubb.dev/).
2032
- * Do not edit manually.
2534
+ * Passkey (WebAuthn) helpers — the encoding layer and the browser bridge.
2535
+ *
2536
+ * WebAuthn speaks ArrayBuffer; the Auth API speaks JSON. Every buffer
2537
+ * crossing the wire is **base64url** (`-` `_`, no `=` padding), and
2538
+ * getting the alphabet or the padding wrong produces a signature
2539
+ * failure rather than a parse error. These four functions are a
2540
+ * straight port of section 2 of the passkeys guide, exported for
2541
+ * customers who want the pieces; `consumer(slug).passkeys.*` composes
2542
+ * them into one call per ceremony.
2543
+ *
2544
+ * Nothing in this module touches `navigator`, `window` or any other
2545
+ * browser global at import time — the package must load cleanly in a
2546
+ * Node process (BFFs verify tokens with it). Browser globals are read
2547
+ * lazily, inside the functions that need them.
2548
+ *
2549
+ * Wire shape: snake_case everywhere EXCEPT the members of
2550
+ * `credential.response` (`clientDataJSON`, `attestationObject`,
2551
+ * `authenticatorData`, `signature`, `userHandle`). Those names are
2552
+ * fixed by the WebAuthn spec and travel verbatim — they are not ours
2553
+ * to rename.
2554
+ */
2555
+ /** ArrayBuffer / typed array → base64url string (no `+`, `/` or `=`). */
2556
+ declare function toB64u(buf: ArrayBuffer | ArrayBufferView): string;
2557
+ /** base64url string → bytes. Tolerates missing padding. */
2558
+ declare function fromB64u(s: string): Uint8Array;
2559
+ /**
2560
+ * The `public_key` object Auth returns from an options call, with
2561
+ * every buffer base64url-encoded. Mirrors
2562
+ * `PublicKeyCredentialCreationOptions` / `PublicKeyCredentialRequestOptions`
2563
+ * from the WebAuthn spec, minus the ArrayBuffers.
2564
+ */
2565
+ interface PasskeyPublicKeyOptions {
2566
+ challenge: string;
2567
+ user?: {
2568
+ id: string;
2569
+ [k: string]: unknown;
2570
+ };
2571
+ excludeCredentials?: Array<{
2572
+ id: string;
2573
+ [k: string]: unknown;
2574
+ }>;
2575
+ allowCredentials?: Array<{
2576
+ id: string;
2577
+ [k: string]: unknown;
2578
+ }>;
2579
+ [k: string]: unknown;
2580
+ }
2581
+ /**
2582
+ * Auth returns `public_key` with every buffer base64url-encoded;
2583
+ * `navigator.credentials` wants real ArrayBuffers. Decodes
2584
+ * `challenge`, `user.id`, and the `id` of every entry in
2585
+ * `excludeCredentials` / `allowCredentials`; everything else passes
2586
+ * through with its value untouched.
2587
+ *
2588
+ * Accepts the member names either as the WebAuthn spec writes them
2589
+ * (`rpId`, `pubKeyCredParams`) or as the Auth wire convention
2590
+ * decamelizes them (`rp_id`, `pub_key_cred_params`) and always emits
2591
+ * the spec's camelCase, which is the only shape the browser accepts.
2033
2592
  */
2034
-
2035
- declare const consumerIdpControllerNativeSignInPathParamsProviderEnum: {
2036
- readonly apple: "apple";
2037
- readonly google: "google";
2038
- readonly github: "github";
2039
- };
2040
- type ConsumerIdpControllerNativeSignInPathParamsProviderEnumKey = (typeof consumerIdpControllerNativeSignInPathParamsProviderEnum)[keyof typeof consumerIdpControllerNativeSignInPathParamsProviderEnum];
2593
+ /**
2594
+ * Decoded options are typed loosely ON PURPOSE. The exact browser types
2595
+ * (`PublicKeyCredentialCreationOptions` / `PublicKeyCredentialRequestOptions`)
2596
+ * live in lib.dom, which this package does not depend on so that it keeps
2597
+ * loading in Node. An `any` here is what lets a lib.dom customer write
2598
+ * `navigator.credentials.create({ publicKey: decodeOptions(pk) })` with no
2599
+ * cast — a structural return type could never satisfy the DOM's required
2600
+ * members without depending on them.
2601
+ */
2602
+ type PasskeyDecodedOptions = any;
2603
+ declare function decodeOptions(publicKey: PasskeyPublicKeyOptions | Record<string, unknown>): PasskeyDecodedOptions;
2604
+ /**
2605
+ * Structural shape of a `PublicKeyCredential` — the DOM type without
2606
+ * needing the DOM lib. A real `PublicKeyCredential` (from
2607
+ * `navigator.credentials.create()` / `.get()`) satisfies it.
2608
+ */
2609
+ interface PasskeyCredentialLike {
2610
+ id: string;
2611
+ response: {
2612
+ clientDataJSON: ArrayBuffer;
2613
+ attestationObject?: ArrayBuffer;
2614
+ authenticatorData?: ArrayBuffer;
2615
+ signature?: ArrayBuffer;
2616
+ userHandle?: ArrayBuffer | null;
2617
+ };
2618
+ }
2619
+ /**
2620
+ * The `credential` object every verify endpoint accepts. `response`
2621
+ * members keep their WebAuthn names verbatim.
2622
+ */
2623
+ interface EncodedPasskeyCredential {
2624
+ id: string;
2625
+ response: {
2626
+ clientDataJSON: string;
2627
+ attestationObject?: string;
2628
+ authenticatorData?: string;
2629
+ signature?: string;
2630
+ userHandle?: string;
2631
+ };
2632
+ }
2633
+ /**
2634
+ * …and the reverse, for the credential you send back. Only the
2635
+ * members present on the response are emitted: an attestation
2636
+ * (enrol) carries `attestationObject`; an assertion (sign-in /
2637
+ * step-up) carries `authenticatorData` + `signature` (+ `userHandle`
2638
+ * when the authenticator supplies one).
2639
+ */
2640
+ declare function encodeCredential(cred: PasskeyCredentialLike): EncodedPasskeyCredential;
2641
+ /**
2642
+ * Minimal view of `navigator.credentials`, typed structurally so the
2643
+ * package compiles without the DOM lib and so tests can inject a
2644
+ * stand-in.
2645
+ */
2646
+ interface PasskeyCredentialsContainer {
2647
+ create(options?: {
2648
+ publicKey?: unknown;
2649
+ signal?: AbortSignal;
2650
+ }): Promise<unknown>;
2651
+ get(options?: {
2652
+ publicKey?: unknown;
2653
+ mediation?: PasskeyMediation;
2654
+ signal?: AbortSignal;
2655
+ }): Promise<unknown>;
2656
+ }
2657
+ /** `CredentialMediationRequirement` from the Credential Management spec. */
2658
+ type PasskeyMediation = "silent" | "optional" | "conditional" | "required";
2659
+ type PasskeyErrorCode =
2660
+ /** No WebAuthn in this environment — see {@link isPasskeySupported}. */
2661
+ "unsupported"
2662
+ /** The user dismissed the prompt, or no passkey matched (`NotAllowedError`). */
2663
+ | "cancelled"
2664
+ /** The prompt ran out of time — the options' `timeout` or your `signal` fired (`TimeoutError`). */
2665
+ | "timeout"
2666
+ /** The authenticator refused (e.g. credential already registered — `InvalidStateError`). */
2667
+ | "invalid_state"
2668
+ /** The page origin does not match the app's `rp_id` (`SecurityError`). */
2669
+ | "security"
2670
+ /** The browser returned no credential without throwing. */
2671
+ | "no_credential"
2672
+ /** Any other `navigator.credentials` failure; `cause` carries the original. */
2673
+ | "unknown";
2674
+ /**
2675
+ * Thrown by the ceremony helpers when the *browser* side fails. HTTP
2676
+ * failures from Auth keep surfacing as `AuthHttpError` so a caller can
2677
+ * tell "the user cancelled" from "the server said 401".
2678
+ */
2679
+ declare class PasskeyError extends Error {
2680
+ readonly code: PasskeyErrorCode;
2681
+ readonly cause?: unknown;
2682
+ constructor(code: PasskeyErrorCode, message: string, cause?: unknown);
2683
+ }
2684
+ /**
2685
+ * `true` when this environment can run a passkey ceremony: a
2686
+ * `window` with `PublicKeyCredential`, `navigator.credentials.create`
2687
+ * / `.get`, and a secure context (https, or http on localhost).
2688
+ * Always `false` in Node — use it to hide the button rather than
2689
+ * showing one that throws. Never throws itself.
2690
+ */
2691
+ declare function isPasskeySupported(): boolean;
2692
+ interface PasskeyBrowserOptions {
2693
+ /** Abort the browser prompt (e.g. on route change). */
2694
+ signal?: AbortSignal;
2695
+ /**
2696
+ * Override `navigator.credentials` — for tests, or non-browser
2697
+ * runtimes that expose a compatible container. Defaults to the
2698
+ * global one, read at call time.
2699
+ */
2700
+ credentials?: PasskeyCredentialsContainer;
2701
+ }
2702
+ /**
2703
+ * `navigator.credentials.create()` with base64url handled: takes the
2704
+ * `public_key` from an Auth enrolment response, returns the encoded
2705
+ * `credential` to POST back. Throws {@link PasskeyError}.
2706
+ */
2707
+ declare function createPasskeyCredential(publicKey: PasskeyPublicKeyOptions | Record<string, unknown>, opts?: PasskeyBrowserOptions): Promise<EncodedPasskeyCredential>;
2708
+ /**
2709
+ * `navigator.credentials.get()` with base64url handled: takes the
2710
+ * `public_key` from an Auth options response, returns the encoded
2711
+ * `credential` to POST back. Throws {@link PasskeyError}.
2712
+ */
2713
+ declare function getPasskeyCredential(publicKey: PasskeyPublicKeyOptions | Record<string, unknown>, opts?: PasskeyBrowserOptions & {
2714
+ mediation?: PasskeyMediation;
2715
+ }): Promise<EncodedPasskeyCredential>;
2041
2716
 
2042
2717
  /**
2043
2718
  * In-process JWKS cache for a single app's `/.well-known/jwks.json`.
@@ -2241,12 +2916,40 @@ declare class ConsumerScope {
2241
2916
  refresh: (data: ConsumerRefreshDto) => Promise<ConsumerTokenResponseDto>;
2242
2917
  logout: (data: ConsumerLogoutDto) => Promise<any>;
2243
2918
  /**
2244
- * PAK-required: caller must instantiate `Auth` with
2919
+ * Mint a 6-digit password-reset code. **Sends no email.** Returns
2920
+ * `{ code, expires_at }` for delivery via your own channel — or
2921
+ * `{}` when the contact doesn't match a verified account (uniform
2922
+ * shape — no account enumeration).
2923
+ *
2924
+ * If you want Mail to deliver the code for you, call
2925
+ * {@link sendPasswordResetEmail} instead. Calling this one and
2926
+ * discarding the `code` means the user never hears anything.
2927
+ *
2928
+ * PAK-required with `auth.user.password-reset.create`: caller must
2929
+ * instantiate `Auth` with
2245
2930
  * `auth: { type: "apiKey", key: "pcft_live_..." }`. The
2246
2931
  * kubb-generated `headers.authorization` slot is a stub — the
2247
2932
  * HTTP client's auth middleware overrides whatever's passed.
2248
2933
  */
2249
2934
  requestReset: (data: ConsumerRequestPasswordResetDto) => Promise<ConsumerCodeIssueResponseDto>;
2935
+ /**
2936
+ * Mint + dispatch a password-reset email via Mail in one call.
2937
+ * Returns `{ expires_at }` on success; the plaintext code is NOT
2938
+ * returned. Returns `{}` when the contact is missing or unverified
2939
+ * (same enumeration defence as {@link requestReset}).
2940
+ *
2941
+ * This is the counterpart to {@link sendVerificationEmail} for the
2942
+ * reset slot, and the method you want for a plain "forgot
2943
+ * password" flow — {@link requestReset} only mints, it does not
2944
+ * email.
2945
+ *
2946
+ * PAK-required with `auth.user.password-reset.send-email` —
2947
+ * distinct permission from the bare mint so customers can enable
2948
+ * mint without enabling outbound Mail traffic. Surfaces typed 412
2949
+ * precondition errors (e.g. `ENVOI_NOT_ENABLED`,
2950
+ * `ENVOI_TEMPLATE_NOT_CONFIGURED`) rather than failing silently.
2951
+ */
2952
+ sendPasswordResetEmail: (data: ConsumerSendPasswordResetEmailDto) => Promise<ConsumerCodeDispatchResponseDto>;
2250
2953
  resetPassword: (data: ConsumerResetPasswordDto) => Promise<any>;
2251
2954
  /**
2252
2955
  * Mint a 6-digit contact-verification code bound to the email or
@@ -2290,7 +2993,7 @@ declare class ConsumerScope {
2290
2993
  * provisions the EndUser. Public — the caller is unauthenticated
2291
2994
  * until the invite is accepted.
2292
2995
  */
2293
- acceptInvite: (data: ConsumerAcceptInviteDto) => Promise<ConsumerTokenResponseDto>;
2996
+ acceptInvite: (data: ConsumerAcceptInviteDto) => Promise<ConsumerAuthControllerAcceptInvite201>;
2294
2997
  /**
2295
2998
  * Sign in / sign up with a provider ID token (native flow).
2296
2999
  *
@@ -2326,7 +3029,7 @@ declare class ConsumerScope {
2326
3029
  id_token: IdpNativeSigninDto["id_token"];
2327
3030
  nonce: IdpNativeSigninDto["nonce"];
2328
3031
  user?: IdpNativeSigninDto["user"];
2329
- }) => Promise<IdpTokenResponseDto>;
3032
+ }) => Promise<ConsumerIdpControllerNativeSignIn200>;
2330
3033
  };
2331
3034
  readonly me: {
2332
3035
  getProfile: () => Promise<unknown>;
@@ -2348,6 +3051,82 @@ declare class ConsumerScope {
2348
3051
  authorize: (data: AuthorizeBody) => Promise<AuthorizeResponseDto>;
2349
3052
  authorizeBatch: (data: AuthorizeBatchBody) => Promise<AuthorizeBatchResponseDto>;
2350
3053
  };
3054
+ readonly passkeys: {
3055
+ /**
3056
+ * Enrol a passkey as an MFA factor for the signed-in end-user.
3057
+ * Requires the scope to carry the user's access token
3058
+ * (`new Auth({ auth: { type: "bearer", token } })`).
3059
+ *
3060
+ * `POST /me/mfa/factors { type: "webauthn" }` →
3061
+ * `navigator.credentials.create()` →
3062
+ * `POST /me/mfa/factors/:id/verify { credential }`.
3063
+ *
3064
+ * Resolves with the now-enabled factor and the user's recovery
3065
+ * codes — show those once, they are not retrievable later. The
3066
+ * factor stays disabled until the verify call succeeds, so an
3067
+ * abandoned prompt leaves nothing usable behind.
3068
+ */
3069
+ enroll: (opts?: PasskeyBrowserOptions & {
3070
+ label?: string;
3071
+ }) => Promise<ConfirmEnrollmentResponseDto>;
3072
+ /**
3073
+ * Passwordless sign-in with a discoverable passkey. No password,
3074
+ * no email address: the authenticator finds its own passkey for
3075
+ * the app's rp_id.
3076
+ *
3077
+ * `POST /auth/passkey/options {}` → `navigator.credentials.get()`
3078
+ * → `POST /auth/passkey/verify { credential }`.
3079
+ *
3080
+ * Resolves with the session (`access_token`, `refresh_token`,
3081
+ * …; `amr: ["webauthn"]`). Rejects with `PasskeyError`
3082
+ * (`code: "cancelled"`) when the user dismisses the prompt or no
3083
+ * passkey matches, and with `AuthHttpError` 401 for a forged,
3084
+ * unknown, replayed or expired assertion — the server answers
3085
+ * those uniformly on purpose.
3086
+ *
3087
+ * The options call deliberately takes no identifier (it would be
3088
+ * an account-existence oracle); `tenant_id` is the only
3089
+ * accepted body member and only matters for multi-tenant apps.
3090
+ * Pass `mediation: "conditional"` for autofill-style UI.
3091
+ */
3092
+ signIn: (opts?: PasskeyBrowserOptions & {
3093
+ mediation?: PasskeyMediation;
3094
+ tenant_id?: ConsumerPasskeyOptionsDto["tenant_id"];
3095
+ }) => Promise<ConsumerTokenResponseDto>;
3096
+ /**
3097
+ * Satisfy the MFA step of a password sign-in with a passkey.
3098
+ * Call it when `auth.signin()` answered
3099
+ * `{ mfa_required: true, mfa_token, factors }` and `factors`
3100
+ * contains a `webauthn` entry.
3101
+ *
3102
+ * `POST /auth/mfa/webauthn/options { mfa_token }` →
3103
+ * `navigator.credentials.get()` →
3104
+ * `POST /auth/mfa/verify { mfa_token, credential }`.
3105
+ *
3106
+ * Resolves with the session (`amr: ["pwd", "webauthn"]`, fresh
3107
+ * `mfa_at`). Possession of the `mfa_token` — a correct password
3108
+ * — is the authority for the options call.
3109
+ */
3110
+ completeMfaChallenge: (args: PasskeyBrowserOptions & {
3111
+ mfa_token: string;
3112
+ mediation?: PasskeyMediation;
3113
+ }) => Promise<ConsumerTokenResponseDto>;
3114
+ /**
3115
+ * Re-confirm the signed-in user's identity inside a live session
3116
+ * (before a sensitive action). Requires the scope to carry the
3117
+ * user's access token.
3118
+ *
3119
+ * `POST /me/mfa/step-up/webauthn/options` →
3120
+ * `navigator.credentials.get()` →
3121
+ * `POST /me/mfa/step-up { credential }`.
3122
+ *
3123
+ * Resolves with `{ amr, mfa_at }`. A passkey assertion is never
3124
+ * tried as a recovery code, so a failed step-up never burns one.
3125
+ */
3126
+ stepUp: (opts?: PasskeyBrowserOptions & {
3127
+ mediation?: PasskeyMediation;
3128
+ }) => Promise<StepUpResponseDto>;
3129
+ };
2351
3130
  readonly oauth: {
2352
3131
  clientCredentials: (data: ClientCredentialsDto) => Promise<OAuthTokenResponseDto>;
2353
3132
  };
@@ -2357,6 +3136,12 @@ declare class ConsumerScope {
2357
3136
  * Generated by Kubb (https://kubb.dev/).
2358
3137
  * Do not edit manually.
2359
3138
  */
3139
+ declare const createAppDtoEnvironmentEnum: {
3140
+ readonly production: "production";
3141
+ readonly staging: "staging";
3142
+ readonly development: "development";
3143
+ };
3144
+ type CreateAppDtoEnvironmentEnumKey = (typeof createAppDtoEnvironmentEnum)[keyof typeof createAppDtoEnvironmentEnum];
2360
3145
  type CreateAppDto = {
2361
3146
  /**
2362
3147
  * @description Display name shown in the console.
@@ -2365,6 +3150,12 @@ type CreateAppDto = {
2365
3150
  * @type string
2366
3151
  */
2367
3152
  display_name: string;
3153
+ /**
3154
+ * @description Which environment this app is. Omit for `production` — the historical behaviour and the value every existing app has. Cannot be changed later; clone the app instead.
3155
+ * @default "production"
3156
+ * @type string | undefined
3157
+ */
3158
+ environment?: CreateAppDtoEnvironmentEnumKey;
2368
3159
  /**
2369
3160
  * @description URL-friendly app slug (lowercase letters, digits, hyphens).
2370
3161
  * @minLength 3
@@ -2386,17 +3177,20 @@ type CreateAppDto = {
2386
3177
 
2387
3178
  type AppControllerListMyAppsQueryParams = {
2388
3179
  /**
3180
+ * @description Limit the result to this one workspace (UUID). The caller must be a member; an id the caller does not belong to returns nothing. Omit to cover every workspace the caller belongs to.
2389
3181
  * @type string | undefined
2390
3182
  */
2391
- limit?: string;
3183
+ workspace_id?: string;
2392
3184
  /**
3185
+ * @description Page size (default 20, max 100).
2393
3186
  * @type string | undefined
2394
3187
  */
2395
- cursor?: string;
3188
+ limit?: string;
2396
3189
  /**
3190
+ * @description Opaque `next_cursor` from the previous page.
2397
3191
  * @type string | undefined
2398
3192
  */
2399
- workspace_id?: string;
3193
+ cursor?: string;
2400
3194
  };
2401
3195
 
2402
3196
  /**
@@ -2406,6 +3200,7 @@ type AppControllerListMyAppsQueryParams = {
2406
3200
 
2407
3201
  type StatsControllerGetMyStatsQueryParams = {
2408
3202
  /**
3203
+ * @description Limit the result to this one workspace (UUID). The caller must be a member; an id the caller does not belong to returns nothing. Omit to cover every workspace the caller belongs to.
2409
3204
  * @type string | undefined
2410
3205
  */
2411
3206
  workspace_id?: string;
@@ -2467,6 +3262,25 @@ declare class JwksFetchError extends JwtVerifyError {
2467
3262
  });
2468
3263
  }
2469
3264
 
3265
+ /**
3266
+ * Generated by Kubb (https://kubb.dev/).
3267
+ * Do not edit manually.
3268
+ */
3269
+ type WebauthnCredentialDto = {
3270
+ /**
3271
+ * @description base64url credential id (`PublicKeyCredential.id`).
3272
+ * @type string
3273
+ */
3274
+ id: string;
3275
+ /**
3276
+ * @description The `response` member, with `clientDataJSON` + `attestationObject` (registration) or `clientDataJSON` + `authenticatorData` + `signature` + `userHandle` (assertion), each base64url-encoded.
3277
+ * @type object
3278
+ */
3279
+ response: {
3280
+ [key: string]: any;
3281
+ };
3282
+ };
3283
+
2470
3284
  interface AuthConfig extends PCClientConfig {
2471
3285
  /** Per-app JWKS cache lifetime in ms. Default 10 minutes. */
2472
3286
  jwksTtlMs?: number;
@@ -2505,4 +3319,4 @@ declare class Auth {
2505
3319
  };
2506
3320
  }
2507
3321
 
2508
- export { AUTH_LEGACY_ISSUER, AppScope, type AssignRoleDto, Auth, type AuthClaims, type AuthConfig, AuthHttpError, type AuthorizeBatchBody, type AuthorizeBody, type ClientCredentialsDto, type ConsumerAcceptInviteDto, type ConsumerLogoutDto, type ConsumerRefreshDto, type ConsumerRequestPasswordResetDto, type ConsumerResetPasswordDto, ConsumerScope, type ConsumerSigninDto, type ConsumerSignupDto, type ConsumerTokenResponseDto, type CreateApiKeyDto, type CreateAppDto, type CreateEndUserInviteDto, type CreateM2MClientDto, type CreatePermissionDto, type CreateRoleDto, type EndUserInviteResponseDto, type IdpNativeSigninDto, type IdpNativeUserHintDto, type IdpTokenResponseDto, JwksCache, JwksFetchError, JwksKeyNotFoundError, JwtAudienceMismatchError, JwtExpiredError, JwtInvalidError, JwtIssuerMismatchError, JwtNotYetValidError, JwtVerifyError, type SetPermissionsDto, type SetScopesDto, type UpdateAppDto, type UpdateAppStatusDto, type UpdateAuthConfigDto, type UpdateEndUserDto, type UpdateEndUserRoleDto, type UpdateEndUserStatusDto, type UpdateM2MClientDto, type UpdateMeDto, type UpdateRoleDto, type VerifyBody, type VerifyOptions, verifyAuthToken };
3322
+ export { AUTH_LEGACY_ISSUER, AppScope, type AssignRoleDto, Auth, type AuthClaims, type AuthConfig, AuthHttpError, type AuthorizeBatchBody, type AuthorizeBody, type ClientCredentialsDto, type ConfirmEnrollmentResponseDto, type ConsumerAcceptInviteDto, type ConsumerLogoutDto, type ConsumerRefreshDto, type ConsumerRequestPasswordResetDto, type ConsumerResetPasswordDto, ConsumerScope, type ConsumerSigninDto, type ConsumerSignupDto, type ConsumerTokenResponseDto, type CreateApiKeyDto, type CreateAppDto, type CreateEndUserInviteDto, type CreateM2MClientDto, type CreatePermissionDto, type CreateRoleDto, type EncodedPasskeyCredential, type EndUserInviteResponseDto, type IdpNativeSigninDto, type IdpNativeUserHintDto, type IdpTokenResponseDto, JwksCache, JwksFetchError, JwksKeyNotFoundError, JwtAudienceMismatchError, JwtExpiredError, JwtInvalidError, JwtIssuerMismatchError, JwtNotYetValidError, JwtVerifyError, type PasskeyBrowserOptions, type PasskeyCredentialLike, type PasskeyCredentialsContainer, type PasskeyDecodedOptions, PasskeyError, type PasskeyErrorCode, type PasskeyMediation, type PasskeyPublicKeyOptions, type PublicFactorDto, type SetPermissionsDto, type SetScopesDto, type StepUpResponseDto, type UpdateAppDto, type UpdateAppStatusDto, type UpdateAuthConfigDto, type UpdateEndUserDto, type UpdateEndUserRoleDto, type UpdateEndUserStatusDto, type UpdateM2MClientDto, type UpdateMeDto, type UpdateRoleDto, type VerifyBody, type VerifyOptions, type WebauthnCredentialDto, createPasskeyCredential, decodeOptions, encodeCredential, fromB64u, getPasskeyCredential, isPasskeySupported, toB64u, verifyAuthToken };