@authsome/ui-core 1.3.1 → 1.4.2

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
@@ -3,12 +3,99 @@ interface ACSRequest {
3
3
  RelayState: string;
4
4
  SAMLResponse: string;
5
5
  }
6
+ interface AdminAppResponse {
7
+ id: string;
8
+ is_platform: boolean;
9
+ logo?: string;
10
+ name: string;
11
+ publishable_key?: string;
12
+ slug: string;
13
+ }
14
+ interface AdminCatalogProvider {
15
+ id: string;
16
+ name: string;
17
+ }
18
+ interface AdminCatalogResponse {
19
+ providers: AdminCatalogProvider[];
20
+ }
21
+ interface AdminCreateConnectionResponse {
22
+ active: boolean;
23
+ app_id: string;
24
+ domain: string;
25
+ id: string;
26
+ protocol: string;
27
+ provider: string;
28
+ }
29
+ interface AdminDeleteAppRequest {
30
+ AppID: string;
31
+ }
32
+ interface AdminDeleteConnectionResponse {
33
+ status: string;
34
+ }
35
+ interface AdminDeleteProviderResponse {
36
+ status: string;
37
+ }
38
+ interface AdminDeleteServiceAccountRequest {
39
+ ServiceAccountID: string;
40
+ }
6
41
  interface AdminDeleteUserRequest {
7
42
  UserID: string;
8
43
  }
9
44
  interface AdminImpersonateRequest {
10
45
  UserID: string;
11
46
  }
47
+ interface AdminListConnectionsResponse {
48
+ connections: Connection[];
49
+ }
50
+ interface AdminListProvidersResponse {
51
+ providers: AdminProvider[];
52
+ }
53
+ interface AdminPlatformOwnerResponse {
54
+ role_id: string;
55
+ status: string;
56
+ user_id: string;
57
+ }
58
+ interface AdminProvider {
59
+ client_id: string;
60
+ client_secret?: string;
61
+ enabled: boolean;
62
+ has_secret: boolean;
63
+ name: string;
64
+ redirect_url?: string;
65
+ scopes?: string[];
66
+ }
67
+ interface AdminProviderResponse {
68
+ provider: AdminProvider;
69
+ }
70
+ interface AdminRevokePlatformOwnerRequest {
71
+ UserID: string;
72
+ }
73
+ interface AdminServiceAccountAPIKeyResponse {
74
+ created_at: string;
75
+ expires_at?: string;
76
+ id: string;
77
+ key: string;
78
+ key_prefix: string;
79
+ name: string;
80
+ public_key?: string;
81
+ public_key_prefix?: string;
82
+ scopes?: string[];
83
+ }
84
+ interface AdminServiceAccountListResponse {
85
+ next_cursor?: string;
86
+ service_accounts: AdminServiceAccountResponse[];
87
+ total: number;
88
+ }
89
+ interface AdminServiceAccountResponse {
90
+ active: boolean;
91
+ app_id: string;
92
+ created_at: string;
93
+ description?: string;
94
+ id: string;
95
+ name: string;
96
+ scopes?: string[];
97
+ updated_at: string;
98
+ }
12
99
  interface AdminStatsResponse {
13
100
  total_users: number;
14
101
  }
@@ -65,17 +152,37 @@ interface CallbackResponse {
65
152
  session_token: string;
66
153
  user: User;
67
154
  }
155
+ interface CancelSubscriptionRequest {
156
+ SubID: string;
157
+ immediately: boolean;
158
+ }
68
159
  interface ChallengeRequest {
69
160
  code: string;
161
+ mfa_ticket: string;
70
162
  }
71
163
  interface ChallengeResponse {
72
- challenge_passed: boolean;
73
- method: string;
164
+ expires_at: string;
165
+ refresh_token: string;
166
+ session_token: string;
167
+ user: unknown;
168
+ }
169
+ interface ChangePlanRequest {
170
+ SubID: string;
171
+ new_plan_id: string;
74
172
  }
75
173
  interface ClientConfigBranding {
76
174
  app_name?: string;
77
175
  logo_url?: string;
78
176
  }
177
+ interface ClientConfigCaptcha {
178
+ provider?: string;
179
+ required: boolean;
180
+ site_key?: string;
181
+ }
182
+ interface ClientConfigEmailVerification {
183
+ enabled: boolean;
184
+ required: boolean;
185
+ }
79
186
  interface ClientConfigFieldValidation {
80
187
  max?: number;
81
188
  max_len?: number;
@@ -87,19 +194,25 @@ interface ClientConfigFieldValidation {
87
194
  interface ClientConfigMFA {
88
195
  enabled: boolean;
89
196
  methods: string[];
197
+ required: boolean;
90
198
  }
91
199
  interface ClientConfigResponse {
92
200
  app_id: string;
93
201
  branding?: ClientConfigBranding;
202
+ captcha?: ClientConfigCaptcha;
203
+ device_authorization?: ClientConfigToggle;
204
+ email_verification?: ClientConfigEmailVerification;
94
205
  magiclink?: ClientConfigToggle;
95
206
  mfa?: ClientConfigMFA;
96
207
  passkey?: ClientConfigToggle;
97
208
  password?: ClientConfigToggle;
209
+ signup_enabled: boolean;
98
210
  signup_fields?: ClientConfigSignupField[];
99
211
  social?: ClientConfigSocial;
100
212
  sso?: ClientConfigSSO;
101
213
  supported_plugins: string[];
102
214
  version: string;
215
+ waitlist?: ClientConfigToggle;
103
216
  }
104
217
  interface ClientConfigSSO {
105
218
  connections: ClientConfigSSOConnection[];
@@ -151,12 +264,79 @@ interface Config {
151
264
  magic_link_enabled?: boolean;
152
265
  mfa_enabled?: boolean;
153
266
  mfa_methods?: string[];
267
+ mfa_required?: boolean;
154
268
  passkey_enabled?: boolean;
155
269
  password_enabled?: boolean;
270
+ require_email_verification?: boolean;
271
+ signup_enabled?: boolean;
156
272
  social_enabled?: boolean;
157
273
  social_providers?: string[];
158
274
  sso_enabled?: boolean;
159
275
  updated_at: string;
276
+ waitlist_enabled?: boolean;
277
+ }
278
+ interface Connection {
279
+ active: boolean;
280
+ app_id: string;
281
+ client_id?: string;
282
+ created_at: string;
283
+ domain: string;
284
+ id: string;
285
+ issuer?: string;
286
+ metadata_url?: string;
287
+ org_id?: string;
288
+ protocol: string;
289
+ provider: string;
290
+ updated_at: string;
291
+ }
292
+ interface Consent {
293
+ app_id: string;
294
+ created_at: string;
295
+ granted: boolean;
296
+ granted_at: string;
297
+ id: string;
298
+ ip_address: string;
299
+ purpose: string;
300
+ revoked_at?: string;
301
+ updated_at: string;
302
+ user_id: string;
303
+ version: string;
304
+ }
305
+ interface CouponResponse {
306
+ amount?: string;
307
+ app_id: string;
308
+ code: string;
309
+ currency: string;
310
+ id: string;
311
+ max_redemptions: number;
312
+ name: string;
313
+ percentage?: number;
314
+ times_redeemed: number;
315
+ type: string;
316
+ valid_from?: string;
317
+ valid_until?: string;
318
+ }
319
+ interface CreateClientResponse {
320
+ client_id: string;
321
+ client_secret?: string;
322
+ grant_types: string[];
323
+ id: string;
324
+ name: string;
325
+ public: boolean;
326
+ redirect_uris: string[];
327
+ scopes: string[];
328
+ }
329
+ interface CreateCouponRequest {
330
+ amount: number;
331
+ app_id: string;
332
+ code: string;
333
+ currency: string;
334
+ max_redemptions: number;
335
+ name: string;
336
+ percentage: number;
337
+ type: string;
338
+ valid_from?: string;
339
+ valid_until?: string;
160
340
  }
161
341
  interface CreateKeyRequest {
162
342
  app_id: string;
@@ -175,11 +355,23 @@ interface CreateKeyResponse {
175
355
  public_key_prefix: string;
176
356
  scopes?: string[];
177
357
  }
178
- interface CredentialInfo {
179
- created_at: string;
180
- display_name: string;
181
- id: string;
182
- transport: string[];
358
+ interface CreatePlanRequest {
359
+ app_id: string;
360
+ base_amount: number;
361
+ currency: string;
362
+ description: string;
363
+ features?: FeatureInput[];
364
+ is_addon: boolean;
365
+ metadata?: Record<string, unknown>;
366
+ name: string;
367
+ period: string;
368
+ slug: string;
369
+ trial_days: number;
370
+ }
371
+ interface CreateSubscriptionRequest {
372
+ app_id: string;
373
+ plan_id: string;
374
+ tenant_id: string;
183
375
  }
184
376
  interface Definition {
185
377
  category: string;
@@ -207,6 +399,12 @@ interface DeleteAppClientConfigRequest {
207
399
  interface DeleteAppSessionConfigRequest {
208
400
  AppID: string;
209
401
  }
402
+ interface DeleteClientRequest {
403
+ ClientID: string;
404
+ }
405
+ interface DeleteCouponRequest {
406
+ CouponID: string;
407
+ }
210
408
  interface DeleteDeviceRequest {
211
409
  DeviceID: string;
212
410
  }
@@ -248,6 +446,25 @@ interface Device {
248
446
  updated_at: string;
249
447
  user_id: string;
250
448
  }
449
+ interface DeviceAuthRequest {
450
+ client_id: string;
451
+ scope?: string;
452
+ }
453
+ interface DeviceAuthResponse {
454
+ device_code: string;
455
+ expires_in: number;
456
+ interval: number;
457
+ user_code: string;
458
+ verification_uri: string;
459
+ verification_uri_complete?: string;
460
+ }
461
+ interface DeviceCompleteRequest {
462
+ action: string;
463
+ user_code: string;
464
+ }
465
+ interface DeviceCompleteResponse {
466
+ status: string;
467
+ }
251
468
  interface DeviceListResponse {
252
469
  devices: Device[];
253
470
  }
@@ -256,6 +473,27 @@ interface DisableRequest {
256
473
  interface DisableResponse {
257
474
  status: string;
258
475
  }
476
+ interface DiscoveryResponse {
477
+ authorization_endpoint: string;
478
+ code_challenge_methods_supported: string[];
479
+ device_authorization_endpoint: string;
480
+ grant_types_supported: string[];
481
+ id_token_signing_alg_values_supported: string[];
482
+ issuer: string;
483
+ jwks_uri: string;
484
+ response_types_supported: string[];
485
+ revocation_endpoint: string;
486
+ scopes_supported: string[];
487
+ subject_types_supported: string[];
488
+ token_endpoint: string;
489
+ token_endpoint_auth_methods_supported: string[];
490
+ userinfo_endpoint: string;
491
+ }
492
+ interface Email {
493
+ primary: boolean;
494
+ type?: string;
495
+ value: string;
496
+ }
259
497
  interface EnrollRequest {
260
498
  method?: string;
261
499
  phone?: string;
@@ -266,6 +504,14 @@ interface EnrollResponse {
266
504
  otpauth_url: string;
267
505
  secret: string;
268
506
  }
507
+ interface EntitlementResponse {
508
+ allowed: boolean;
509
+ feature: string;
510
+ limit: number;
511
+ reason?: string;
512
+ remaining: number;
513
+ used: number;
514
+ }
269
515
  interface Environment {
270
516
  app_id: string;
271
517
  cloned_from?: string;
@@ -290,13 +536,51 @@ interface EnvironmentSettingsResponse {
290
536
  settings?: Settings;
291
537
  type_defaults?: Settings;
292
538
  }
539
+ interface FeatureInput {
540
+ key: string;
541
+ limit: number;
542
+ name: string;
543
+ period: string;
544
+ soft_limit: boolean;
545
+ type: string;
546
+ }
293
547
  interface ForgotPasswordResponse {
294
548
  status: string;
295
549
  }
550
+ interface GroupRef {
551
+ $ref?: string;
552
+ display?: string;
553
+ value: string;
554
+ }
555
+ interface GroupResource {
556
+ displayName: string;
557
+ externalId?: string;
558
+ id?: string;
559
+ members?: MemberRef[];
560
+ meta?: Meta;
561
+ schemas: string[];
562
+ }
296
563
  interface HealthResponse {
297
564
  error?: string;
298
565
  status: string;
299
566
  }
567
+ interface IntrospectResponse {
568
+ active: boolean;
569
+ app_id?: string;
570
+ env_id?: string;
571
+ expires_at?: string;
572
+ org_id?: string;
573
+ session_id?: string;
574
+ user?: IntrospectUser;
575
+ user_id?: string;
576
+ }
577
+ interface IntrospectUser {
578
+ email: string;
579
+ first_name?: string;
580
+ id: string;
581
+ last_name?: string;
582
+ username?: string;
583
+ }
300
584
  interface Invitation {
301
585
  created_at: string;
302
586
  email: string;
@@ -310,6 +594,16 @@ interface Invitation {
310
594
  interface InvitationListResponse {
311
595
  invitations: Invitation[];
312
596
  }
597
+ interface InvoiceResponse {
598
+ currency: string;
599
+ id: string;
600
+ period_end: string;
601
+ period_start: string;
602
+ status: string;
603
+ subscription_id: string;
604
+ tenant_id: string;
605
+ total: string;
606
+ }
313
607
  interface KeyListItem {
314
608
  created_at: string;
315
609
  expires_at?: string;
@@ -324,16 +618,36 @@ interface KeyListItem {
324
618
  interface ListAuthMethodsResponse {
325
619
  methods: AuthMethod[];
326
620
  }
621
+ interface ListClientsResponse {
622
+ clients: OAuth2Client[];
623
+ }
624
+ interface ListCouponsResponse {
625
+ coupons: CouponResponse[];
626
+ total: number;
627
+ }
327
628
  interface ListDefinitionsResponse {
328
629
  groups: DefinitionGroup[];
329
630
  total: number;
330
631
  }
632
+ interface ListInvoicesResponse {
633
+ invoices: InvoiceResponse[];
634
+ total: number;
635
+ }
331
636
  interface ListKeysResponse {
332
637
  keys: KeyListItem[];
333
638
  total: number;
334
639
  }
640
+ interface ListPlansResponse {
641
+ plans: PlanResponse[];
642
+ total: number;
643
+ }
335
644
  interface ListResponse$1 {
336
- credentials: CredentialInfo[];
645
+ consents: Consent[];
646
+ next_cursor?: string;
647
+ }
648
+ interface ListSubscriptionsResponse {
649
+ subscriptions: Response[];
650
+ total: number;
337
651
  }
338
652
  interface LoginBeginRequest {
339
653
  email?: string;
@@ -354,6 +668,10 @@ interface LoginResponse {
354
668
  login_url: string;
355
669
  state: string;
356
670
  }
671
+ interface MarkInvoicePaidRequest {
672
+ InvoiceID: string;
673
+ payment_ref: string;
674
+ }
357
675
  interface Member {
358
676
  created_at: string;
359
677
  id: string;
@@ -365,6 +683,36 @@ interface Member {
365
683
  interface MemberListResponse {
366
684
  members: Member[];
367
685
  }
686
+ interface MemberRef {
687
+ $ref?: string;
688
+ display?: string;
689
+ value: string;
690
+ }
691
+ interface Meta {
692
+ created?: string;
693
+ lastModified?: string;
694
+ location?: string;
695
+ resourceType: string;
696
+ }
697
+ interface Name {
698
+ familyName: string;
699
+ formatted?: string;
700
+ givenName: string;
701
+ }
702
+ interface OAuth2Client {
703
+ app_id: string;
704
+ client_id: string;
705
+ created_at: string;
706
+ grant_types: string[];
707
+ id: string;
708
+ name: string;
709
+ public: boolean;
710
+ redirect_uris: string[];
711
+ scopes: string[];
712
+ updated_at: string;
713
+ }
714
+ interface Object$1 {
715
+ }
368
716
  interface ObjectFieldDef {
369
717
  display_name: string;
370
718
  help_text?: string;
@@ -399,6 +747,24 @@ interface Permission {
399
747
  interface PermissionListResponse {
400
748
  permissions: Permission[];
401
749
  }
750
+ interface PlanIDRequest {
751
+ PlanID: string;
752
+ }
753
+ interface PlanResponse {
754
+ app_id: string;
755
+ base_amount?: string;
756
+ billing_period?: string;
757
+ currency: string;
758
+ description: string;
759
+ features_count: number;
760
+ id: string;
761
+ is_addon: boolean;
762
+ metadata?: Record<string, unknown>;
763
+ name: string;
764
+ slug: string;
765
+ status: string;
766
+ trial_days: number;
767
+ }
402
768
  interface RecoveryRegenerateRequest {
403
769
  }
404
770
  interface RecoveryRegenerateResponse {
@@ -441,9 +807,25 @@ interface ResolvedSettingResponse {
441
807
  interface ResolvedSettingsResponse {
442
808
  settings: ResolvedSetting[];
443
809
  }
810
+ interface Response {
811
+ app_id: string;
812
+ canceled_at?: string;
813
+ current_period_end: string;
814
+ current_period_start: string;
815
+ id: string;
816
+ plan_id: string;
817
+ status: string;
818
+ tenant_id: string;
819
+ trial_end?: string;
820
+ trial_start?: string;
821
+ }
444
822
  interface RevokeKeyRequest {
445
823
  KeyID: string;
446
824
  }
825
+ interface RevokeRequest {
826
+ token: string;
827
+ token_type_hint?: string;
828
+ }
447
829
  interface RevokeSessionRequest {
448
830
  SessionID: string;
449
831
  }
@@ -528,14 +910,23 @@ interface SlugAvailableResponse {
528
910
  available: boolean;
529
911
  }
530
912
  interface StartRequest {
531
- Provider: string;
913
+ app_id?: string;
914
+ phone: string;
532
915
  }
533
916
  interface StartResponse {
534
- auth_url: string;
917
+ expires_in: number;
918
+ status: string;
535
919
  }
536
920
  interface StatusResponse {
537
921
  status: string;
538
922
  }
923
+ interface SubIDRequest {
924
+ SubID: string;
925
+ }
926
+ interface SwitchOrgResponse {
927
+ org_id?: string;
928
+ session_id: string;
929
+ }
539
930
  interface Team {
540
931
  created_at: string;
541
932
  id: string;
@@ -547,10 +938,21 @@ interface Team {
547
938
  interface TeamListResponse {
548
939
  teams: Team[];
549
940
  }
941
+ interface TokenRequest {
942
+ client_id?: string;
943
+ client_secret?: string;
944
+ code?: string;
945
+ code_verifier?: string;
946
+ device_code?: string;
947
+ grant_type: string;
948
+ redirect_uri?: string;
949
+ }
550
950
  interface TokenResponse {
551
- expires_at: string;
552
- refresh_token: string;
553
- session_token: string;
951
+ access_token: string;
952
+ expires_in: number;
953
+ refresh_token?: string;
954
+ scope?: string;
955
+ token_type: string;
554
956
  }
555
957
  interface TrustDeviceRequest {
556
958
  DeviceID: string;
@@ -578,6 +980,18 @@ interface UnlinkAuthMethodRequest {
578
980
  interface UnlinkAuthMethodResponse {
579
981
  status: string;
580
982
  }
983
+ interface UsageItemResponse {
984
+ feature_key: string;
985
+ feature_name: string;
986
+ feature_type: string;
987
+ limit: number;
988
+ period: string;
989
+ remaining: number;
990
+ used: number;
991
+ }
992
+ interface UsageSummaryResponse {
993
+ usage: UsageItemResponse[];
994
+ }
581
995
  interface User {
582
996
  app_id: string;
583
997
  ban_expires?: string;
@@ -600,6 +1014,24 @@ interface User {
600
1014
  updated_at: string;
601
1015
  username?: string;
602
1016
  }
1017
+ interface UserInfo {
1018
+ email?: string;
1019
+ email_verified?: boolean;
1020
+ name?: string;
1021
+ phone_number?: string;
1022
+ sub: string;
1023
+ }
1024
+ interface UserResource {
1025
+ active: boolean;
1026
+ emails?: Email[];
1027
+ externalId?: string;
1028
+ groups?: GroupRef[];
1029
+ id?: string;
1030
+ meta?: Meta;
1031
+ name: Name;
1032
+ schemas: string[];
1033
+ userName: string;
1034
+ }
603
1035
  interface UserRoleListResponse {
604
1036
  roles: Role[];
605
1037
  }
@@ -621,19 +1053,25 @@ interface VerifyMFAResponse {
621
1053
  }
622
1054
  interface VerifyRequest {
623
1055
  app_id?: string;
624
- token: string;
1056
+ code: string;
1057
+ phone: string;
625
1058
  }
626
1059
  interface VerifyResponse {
627
1060
  expires_at: string;
1061
+ new_user: boolean;
628
1062
  refresh_token: string;
629
1063
  session_token: string;
630
- user: User;
1064
+ user?: User;
631
1065
  }
632
1066
  interface VisibilityCondition {
633
1067
  key: string;
634
1068
  operator?: string;
635
1069
  value: string;
636
1070
  }
1071
+ interface VoidInvoiceRequest {
1072
+ InvoiceID: string;
1073
+ reason: string;
1074
+ }
637
1075
  interface Webhook {
638
1076
  active: boolean;
639
1077
  app_id: string;
@@ -647,17 +1085,40 @@ interface Webhook {
647
1085
  interface WebhookListResponse {
648
1086
  webhooks: Webhook[];
649
1087
  }
1088
+ interface scimGroupPathParam {
1089
+ GroupID: string;
1090
+ }
1091
+ interface scimUserPathParam {
1092
+ UserID: string;
1093
+ }
1094
+ type ScimCreateGroupRequest = Object$1;
1095
+ type ScimReplaceGroupRequest = scimGroupPathParam;
1096
+ type ScimPatchGroupRequest = scimGroupPathParam;
1097
+ type ScimDeleteGroupRequest = scimGroupPathParam;
1098
+ type ScimCreateUserRequest = Object$1;
1099
+ type ScimReplaceUserRequest = scimUserPathParam;
1100
+ type ScimPatchUserRequest = scimUserPathParam;
1101
+ type ScimDeleteUserRequest = scimUserPathParam;
1102
+ type AdminCreateAppRequest = {
1103
+ logo?: string;
1104
+ name: string;
1105
+ slug: string;
1106
+ };
650
1107
  type SetAppClientConfigRequest = {
651
1108
  app_name?: string;
652
1109
  logo_url?: string;
653
1110
  magic_link_enabled?: boolean;
654
1111
  mfa_enabled?: boolean;
655
1112
  mfa_methods?: string[];
1113
+ mfa_required?: boolean;
656
1114
  passkey_enabled?: boolean;
657
1115
  password_enabled?: boolean;
1116
+ require_email_verification?: boolean;
1117
+ signup_enabled?: boolean;
658
1118
  social_enabled?: boolean;
659
1119
  social_providers?: string[];
660
1120
  sso_enabled?: boolean;
1121
+ waitlist_enabled?: boolean;
661
1122
  };
662
1123
  type SetAppSessionConfigRequest = {
663
1124
  bind_to_device?: boolean;
@@ -673,6 +1134,30 @@ type AdminBulkImportUsersRequest = {
673
1134
  app_id?: string;
674
1135
  users: Record<string, unknown>[];
675
1136
  };
1137
+ type CreateOAuth2ClientRequest = {
1138
+ app_id: string;
1139
+ grant_types?: string[];
1140
+ name: string;
1141
+ public?: boolean;
1142
+ redirect_uris: string[];
1143
+ scopes?: string[];
1144
+ };
1145
+ type DeleteOAuth2ClientRequest = DeleteClientRequest;
1146
+ type AdminGrantPlatformOwnerRequest = {
1147
+ email?: string;
1148
+ user_id?: string;
1149
+ };
1150
+ type AdminCreateServiceAccountRequest = {
1151
+ app_id?: string;
1152
+ description?: string;
1153
+ name: string;
1154
+ scopes?: string[];
1155
+ };
1156
+ type AdminCreateServiceAccountAPIKeyRequest = {
1157
+ expires_at?: string;
1158
+ name: string;
1159
+ scopes?: string[];
1160
+ };
676
1161
  type EnforceSettingRequest = {
677
1162
  app_id?: string;
678
1163
  org_id?: string;
@@ -687,14 +1172,70 @@ type SetSettingRequest = {
687
1172
  scope_id?: string;
688
1173
  value: string;
689
1174
  };
1175
+ type SocialAdminUpsertProviderRequest = {
1176
+ client_id: string;
1177
+ client_secret: string;
1178
+ enabled?: boolean;
1179
+ redirect_url?: string;
1180
+ scopes?: string[];
1181
+ };
1182
+ type SsoAdminCreateConnectionRequest = {
1183
+ app_id: string;
1184
+ client_id?: string;
1185
+ client_secret?: string;
1186
+ domain: string;
1187
+ issuer?: string;
1188
+ metadata_url?: string;
1189
+ org_id?: string;
1190
+ protocol: string;
1191
+ provider: string;
1192
+ };
1193
+ type SsoAdminUpdateConnectionRequest = {
1194
+ active?: boolean;
1195
+ client_id?: string;
1196
+ client_secret?: string;
1197
+ domain?: string;
1198
+ issuer?: string;
1199
+ metadata_url?: string;
1200
+ provider?: string;
1201
+ };
1202
+ type AdminCreateUserRequest = {
1203
+ app_id?: string;
1204
+ email: string;
1205
+ first_name?: string;
1206
+ last_name?: string;
1207
+ password: string;
1208
+ username?: string;
1209
+ };
1210
+ type AdminUpdateUserRequest = {
1211
+ email_verified?: boolean;
1212
+ first_name?: string;
1213
+ last_name?: string;
1214
+ username?: string;
1215
+ };
690
1216
  type AdminBanUserRequest = {
691
1217
  expires_at?: string;
692
1218
  reason?: string;
693
1219
  };
1220
+ type CreateBillingPlanRequest = CreatePlanRequest;
1221
+ type ActivateBillingPlanRequest = PlanIDRequest;
1222
+ type ArchiveBillingPlanRequest = PlanIDRequest;
1223
+ type ChangeSubscriptionPlanRequest = ChangePlanRequest;
1224
+ type PauseSubscriptionRequest = SubIDRequest;
1225
+ type ResumeSubscriptionRequest = SubIDRequest;
694
1226
  type ChangePasswordRequest = {
695
1227
  current_password: string;
696
1228
  new_password: string;
697
1229
  };
1230
+ type GrantConsentRequest = {
1231
+ app_id?: string;
1232
+ purpose: string;
1233
+ version?: string;
1234
+ };
1235
+ type RevokeConsentRequest = {
1236
+ app_id?: string;
1237
+ purpose: string;
1238
+ };
698
1239
  type CreateEnvironmentRequest = {
699
1240
  app_id?: string;
700
1241
  color?: string;
@@ -737,6 +1278,9 @@ type ForgotPasswordRequest = {
737
1278
  app_id?: string;
738
1279
  email: string;
739
1280
  };
1281
+ type IntrospectTokenRequest = {
1282
+ token: string;
1283
+ };
740
1284
  type CreateAPIKeyRequest = CreateKeyRequest;
741
1285
  type RevokeAPIKeyRequest = RevokeKeyRequest;
742
1286
  type SendMagicLinkRequest = SendRequest;
@@ -748,6 +1292,9 @@ type UpdateMeRequest = {
748
1292
  username?: string;
749
1293
  };
750
1294
  type DeleteMeRequest = DeleteAccountRequest;
1295
+ type SwitchOrgRequest = {
1296
+ org_id: string;
1297
+ };
751
1298
  type ChallengeMFARequest = ChallengeRequest;
752
1299
  type EnrollMFARequest = EnrollRequest;
753
1300
  type DisableMFARequest = DisableRequest;
@@ -755,6 +1302,10 @@ type RegenerateMFARecoveryCodesRequest = RecoveryRegenerateRequest;
755
1302
  type VerifyRecoveryCodeRequest = RecoveryVerifyRequest;
756
1303
  type SendSMSCodeRequest = SMSSendRequest;
757
1304
  type VerifySMSCodeRequest = SMSVerifyRequest;
1305
+ type Oauth2DeviceAuthorizeRequest = DeviceAuthRequest;
1306
+ type Oauth2DeviceCompleteRequest = DeviceCompleteRequest;
1307
+ type Oauth2RevokeRequest = RevokeRequest;
1308
+ type Oauth2TokenRequest = TokenRequest;
758
1309
  type CreateOrganizationRequest = {
759
1310
  app_id?: string;
760
1311
  logo?: string;
@@ -796,6 +1347,8 @@ type PasskeyLoginFinishRequest = LoginFinishRequest;
796
1347
  type PasskeyRegisterBeginRequest = RegisterBeginRequest;
797
1348
  type PasskeyRegisterFinishRequest = RegisterFinishRequest;
798
1349
  type DeletePasskeyRequest = DeleteRequest;
1350
+ type PhoneAuthStartRequest = StartRequest;
1351
+ type PhoneAuthVerifyRequest = VerifyRequest;
799
1352
  type RefreshRequest = {
800
1353
  refresh_token: string;
801
1354
  };
@@ -828,12 +1381,14 @@ type AuthsomeUnassignRoleRequest = {
828
1381
  };
829
1382
  type SignInRequest = {
830
1383
  app_id?: string;
1384
+ captcha_token?: string;
831
1385
  email?: string;
832
1386
  password: string;
833
1387
  username?: string;
834
1388
  };
835
1389
  type SignUpRequest = {
836
1390
  app_id?: string;
1391
+ captcha_token?: string;
837
1392
  email: string;
838
1393
  first_name?: string;
839
1394
  last_name?: string;
@@ -848,6 +1403,10 @@ type StartSSOLoginRequest = LoginRequest;
848
1403
  type VerifyEmailRequest = {
849
1404
  token: string;
850
1405
  };
1406
+ type ResendEmailVerificationRequest = {
1407
+ app_id?: string;
1408
+ email: string;
1409
+ };
851
1410
  type CreateWebhookRequest = {
852
1411
  app_id?: string;
853
1412
  events: string[];
@@ -870,6 +1429,12 @@ interface Session {
870
1429
  interface APIError {
871
1430
  error: string;
872
1431
  code?: number;
1432
+ /**
1433
+ * Machine-readable error type set by the backend (e.g. "email_not_verified").
1434
+ * Currently not part of the OpenAPI spec, so it's parsed manually from the
1435
+ * error response body in the generated client's request helper.
1436
+ */
1437
+ type?: string;
873
1438
  }
874
1439
  /** Authentication state. */
875
1440
  type AuthState = {
@@ -882,9 +1447,43 @@ type AuthState = {
882
1447
  session: Session;
883
1448
  } | {
884
1449
  status: "unauthenticated";
885
- } | {
1450
+ }
1451
+ /**
1452
+ * Sign-in returned the MFA gate (HTTP 403 with type:"mfa_required").
1453
+ * The user must complete the second factor against the same ticket
1454
+ * via AuthManager.submitMFAChallenge(code) — the ticket is single-
1455
+ * use after a correct code and expires after 5 minutes server-side.
1456
+ *
1457
+ * `email` is preserved so the form can show "complete sign-in for
1458
+ * <email>" and so AuthManager.signIn(...) can be retried fully.
1459
+ *
1460
+ * `availableMethods` is what the backend reports as enrolled and
1461
+ * ready to validate — typically ["totp"] today.
1462
+ */
1463
+ | {
886
1464
  status: "mfa_required";
887
- session: Session;
1465
+ email: string;
1466
+ mfaTicket: string;
1467
+ availableMethods: string[];
1468
+ }
1469
+ /**
1470
+ * Returned when a sign-in attempt is rejected because the user's email
1471
+ * has not yet been verified, or when sign-up succeeded with email
1472
+ * verification required. The `email` is preserved so a "resend" CTA can
1473
+ * target the same account.
1474
+ */
1475
+ | {
1476
+ status: "email_not_verified";
1477
+ email: string;
1478
+ }
1479
+ /**
1480
+ * Sign-up succeeded but the account requires email verification before
1481
+ * sign-in works. The session token returned by the API in this state is
1482
+ * non-functional and is intentionally discarded.
1483
+ */
1484
+ | {
1485
+ status: "verification_pending";
1486
+ email: string;
888
1487
  } | {
889
1488
  status: "error";
890
1489
  error: string;
@@ -993,6 +1592,12 @@ interface ClientConfig {
993
1592
  device_authorization?: {
994
1593
  enabled: boolean;
995
1594
  };
1595
+ /** Captcha challenge (e.g. Cloudflare Turnstile). */
1596
+ captcha?: {
1597
+ required: boolean;
1598
+ provider?: string;
1599
+ site_key?: string;
1600
+ };
996
1601
  }
997
1602
  /** Interface for persisting tokens across sessions. */
998
1603
  interface TokenStorage {
@@ -1004,16 +1609,31 @@ interface TokenStorage {
1004
1609
  interface AuthClientConfig {
1005
1610
  /** Base URL of the AuthSome API (e.g., "https://api.example.com") */
1006
1611
  baseURL: string;
1612
+ /**
1613
+ * Publishable key (`pk_live_*` / `pk_test_*` / `pk_stg_*`) sent on every
1614
+ * request as the X-Publishable-Key header. The server resolves this to
1615
+ * the owning App on the public-auth path (signup, signin, forgot-
1616
+ * password, resend-verification), so frontends never need to know — or
1617
+ * send — the App's UUID. Without it, those endpoints reject with 400
1618
+ * "app context required".
1619
+ */
1620
+ publishableKey?: string;
1007
1621
  /** Optional custom fetch implementation */
1008
1622
  fetch?: typeof globalThis.fetch;
1009
1623
  }
1010
1624
  declare class AuthClient$1 {
1011
1625
  private baseURL;
1626
+ private publishableKey;
1012
1627
  private fetchFn;
1013
1628
  constructor(config: AuthClientConfig | Pick<{
1014
1629
  baseURL: string;
1630
+ publishableKey?: string;
1015
1631
  fetch?: typeof globalThis.fetch;
1016
- }, 'baseURL' | 'fetch'>);
1632
+ }, 'baseURL' | 'publishableKey' | 'fetch'>);
1633
+ /** Set the publishable key sent on every request as X-Publishable-Key. */
1634
+ setPublishableKey(key: string | undefined): void;
1635
+ /** Get the current publishable key. */
1636
+ getPublishableKey(): string | undefined;
1017
1637
  /**
1018
1638
  * Get AuthSome manifest
1019
1639
  * GET /.well-known/authsome/manifest
@@ -1024,6 +1644,96 @@ declare class AuthClient$1 {
1024
1644
  * GET /.well-known/authsome/openapi
1025
1645
  */
1026
1646
  getOpenAPI(): Promise<Record<string, unknown>>;
1647
+ /**
1648
+ * OpenID Connect Discovery
1649
+ * GET /.well-known/openid-configuration
1650
+ */
1651
+ oidcDiscovery(token: string): Promise<DiscoveryResponse>;
1652
+ /**
1653
+ * List SCIM Groups
1654
+ * GET /scim/v2/Groups
1655
+ */
1656
+ scimListGroups(token: string): Promise<ListResponse$1>;
1657
+ /**
1658
+ * Create SCIM Group
1659
+ * POST /scim/v2/Groups
1660
+ */
1661
+ scimCreateGroup(body: ScimCreateGroupRequest, token: string): Promise<GroupResource>;
1662
+ /**
1663
+ * Get SCIM Group
1664
+ * GET /scim/v2/Groups/{groupId}
1665
+ */
1666
+ scimGetGroup(groupId: string, token: string): Promise<GroupResource>;
1667
+ /**
1668
+ * Replace SCIM Group
1669
+ * PUT /scim/v2/Groups/{groupId}
1670
+ */
1671
+ scimReplaceGroup(groupId: string, body: ScimReplaceGroupRequest, token: string): Promise<GroupResource>;
1672
+ /**
1673
+ * Patch SCIM Group
1674
+ * PATCH /scim/v2/Groups/{groupId}
1675
+ */
1676
+ scimPatchGroup(groupId: string, body: ScimPatchGroupRequest, token: string): Promise<GroupResource>;
1677
+ /**
1678
+ * Delete SCIM Group
1679
+ * DELETE /scim/v2/Groups/{groupId}
1680
+ */
1681
+ scimDeleteGroup(groupId: string, body: ScimDeleteGroupRequest, token: string): Promise<Object$1>;
1682
+ /**
1683
+ * SCIM Resource Types
1684
+ * GET /scim/v2/ResourceTypes
1685
+ */
1686
+ scimResourceTypes(token: string): Promise<Object$1>;
1687
+ /**
1688
+ * SCIM Schemas
1689
+ * GET /scim/v2/Schemas
1690
+ */
1691
+ scimSchemas(token: string): Promise<Object$1>;
1692
+ /**
1693
+ * SCIM Service Provider Configuration
1694
+ * GET /scim/v2/ServiceProviderConfig
1695
+ */
1696
+ scimServiceProviderConfig(token: string): Promise<Object$1>;
1697
+ /**
1698
+ * List SCIM Users
1699
+ * GET /scim/v2/Users
1700
+ */
1701
+ scimListUsers(token: string): Promise<ListResponse$1>;
1702
+ /**
1703
+ * Create SCIM User
1704
+ * POST /scim/v2/Users
1705
+ */
1706
+ scimCreateUser(body: ScimCreateUserRequest, token: string): Promise<UserResource>;
1707
+ /**
1708
+ * Get SCIM User
1709
+ * GET /scim/v2/Users/{userId}
1710
+ */
1711
+ scimGetUser(userId: string, token: string): Promise<UserResource>;
1712
+ /**
1713
+ * Replace SCIM User
1714
+ * PUT /scim/v2/Users/{userId}
1715
+ */
1716
+ scimReplaceUser(userId: string, body: ScimReplaceUserRequest, token: string): Promise<UserResource>;
1717
+ /**
1718
+ * Patch SCIM User
1719
+ * PATCH /scim/v2/Users/{userId}
1720
+ */
1721
+ scimPatchUser(userId: string, body: ScimPatchUserRequest, token: string): Promise<UserResource>;
1722
+ /**
1723
+ * Delete SCIM User
1724
+ * DELETE /scim/v2/Users/{userId}
1725
+ */
1726
+ scimDeleteUser(userId: string, body: ScimDeleteUserRequest, token: string): Promise<Object$1>;
1727
+ /**
1728
+ * Create application (admin)
1729
+ * POST /v1/admin/apps
1730
+ */
1731
+ adminCreateApp(body: AdminCreateAppRequest, token: string): Promise<AdminAppResponse>;
1732
+ /**
1733
+ * Delete application (admin)
1734
+ * DELETE /v1/admin/apps/{appId}
1735
+ */
1736
+ adminDeleteApp(appId: string, body: AdminDeleteAppRequest, token: string): Promise<StatusResponse>;
1027
1737
  /**
1028
1738
  * Get per-app client config overrides
1029
1739
  * GET /v1/admin/apps/{appId}/client-config
@@ -1074,11 +1784,61 @@ declare class AuthClient$1 {
1074
1784
  * POST /v1/admin/impersonate/{userId}
1075
1785
  */
1076
1786
  adminImpersonate(userId: string, body: AdminImpersonateRequest, token: string): Promise<AuthResponse>;
1787
+ /**
1788
+ * List OAuth2 clients
1789
+ * GET /v1/admin/oauth/clients
1790
+ */
1791
+ listOAuth2Clients(token: string): Promise<ListClientsResponse>;
1792
+ /**
1793
+ * Create OAuth2 client
1794
+ * POST /v1/admin/oauth/clients
1795
+ */
1796
+ createOAuth2Client(body: CreateOAuth2ClientRequest, token: string): Promise<CreateClientResponse>;
1797
+ /**
1798
+ * Delete OAuth2 client
1799
+ * DELETE /v1/admin/oauth/clients/{clientId}
1800
+ */
1801
+ deleteOAuth2Client(clientId: string, body: DeleteOAuth2ClientRequest, token: string): Promise<void>;
1077
1802
  /**
1078
1803
  * List organizations (admin)
1079
1804
  * GET /v1/admin/orgs
1080
1805
  */
1081
- adminListOrgs(token: string): Promise<OrgListResponse>;
1806
+ adminListOrgs(): Promise<OrgListResponse>;
1807
+ /**
1808
+ * Grant platform-owner role (admin)
1809
+ * POST /v1/admin/platform/owners
1810
+ */
1811
+ adminGrantPlatformOwner(body: AdminGrantPlatformOwnerRequest, token: string): Promise<AdminPlatformOwnerResponse>;
1812
+ /**
1813
+ * Revoke platform-owner role (admin)
1814
+ * DELETE /v1/admin/platform/owners/{userID}
1815
+ */
1816
+ adminRevokePlatformOwner(userID: string, body: AdminRevokePlatformOwnerRequest, token: string): Promise<AdminPlatformOwnerResponse>;
1817
+ /**
1818
+ * List service accounts (admin)
1819
+ * GET /v1/admin/service-accounts
1820
+ */
1821
+ adminListServiceAccounts(token: string): Promise<AdminServiceAccountListResponse>;
1822
+ /**
1823
+ * Create service account (admin)
1824
+ * POST /v1/admin/service-accounts
1825
+ */
1826
+ adminCreateServiceAccount(body: AdminCreateServiceAccountRequest, token: string): Promise<AdminServiceAccountResponse>;
1827
+ /**
1828
+ * Get service account (admin)
1829
+ * GET /v1/admin/service-accounts/{serviceAccountId}
1830
+ */
1831
+ adminGetServiceAccount(serviceAccountId: string, token: string): Promise<AdminServiceAccountResponse>;
1832
+ /**
1833
+ * Delete service account (admin)
1834
+ * DELETE /v1/admin/service-accounts/{serviceAccountId}
1835
+ */
1836
+ adminDeleteServiceAccount(serviceAccountId: string, body: AdminDeleteServiceAccountRequest, token: string): Promise<StatusResponse>;
1837
+ /**
1838
+ * Create service account API key (admin)
1839
+ * POST /v1/admin/service-accounts/{serviceAccountId}/api-keys
1840
+ */
1841
+ adminCreateServiceAccountAPIKey(serviceAccountId: string, body: AdminCreateServiceAccountAPIKeyRequest, token: string): Promise<AdminServiceAccountAPIKeyResponse>;
1082
1842
  /**
1083
1843
  * List all setting definitions
1084
1844
  * GET /v1/admin/settings/definitions
@@ -1119,6 +1879,51 @@ declare class AuthClient$1 {
1119
1879
  * DELETE /v1/admin/settings/values/{key}
1120
1880
  */
1121
1881
  deleteSetting(key: string, body: DeleteSettingRequest, token: string): Promise<StatusResponse>;
1882
+ /**
1883
+ * List social providers (admin)
1884
+ * GET /v1/admin/social/providers
1885
+ */
1886
+ socialAdminListProviders(app_id: string, token: string): Promise<AdminListProvidersResponse>;
1887
+ /**
1888
+ * List supported social providers
1889
+ * GET /v1/admin/social/providers/catalog
1890
+ */
1891
+ socialAdminCatalog(token: string): Promise<AdminCatalogResponse>;
1892
+ /**
1893
+ * Configure a social provider (admin)
1894
+ * PUT /v1/admin/social/providers/{provider}
1895
+ */
1896
+ socialAdminUpsertProvider(provider: string, body: SocialAdminUpsertProviderRequest, app_id: string, token: string): Promise<AdminProviderResponse>;
1897
+ /**
1898
+ * Delete a social provider (admin)
1899
+ * DELETE /v1/admin/social/providers/{provider}
1900
+ */
1901
+ socialAdminDeleteProvider(provider: string, app_id: string, token: string): Promise<AdminDeleteProviderResponse>;
1902
+ /**
1903
+ * List SSO connections for an app (admin)
1904
+ * GET /v1/admin/sso/connections
1905
+ */
1906
+ ssoAdminListConnections(app_id: string, token: string): Promise<AdminListConnectionsResponse>;
1907
+ /**
1908
+ * Create SSO connection (admin)
1909
+ * POST /v1/admin/sso/connections
1910
+ */
1911
+ ssoAdminCreateConnection(body: SsoAdminCreateConnectionRequest, token: string): Promise<AdminCreateConnectionResponse>;
1912
+ /**
1913
+ * Get SSO connection (admin)
1914
+ * GET /v1/admin/sso/connections/{connectionId}
1915
+ */
1916
+ ssoAdminGetConnection(connectionId: string, token: string): Promise<Connection>;
1917
+ /**
1918
+ * Update SSO connection (admin)
1919
+ * PUT /v1/admin/sso/connections/{connectionId}
1920
+ */
1921
+ ssoAdminUpdateConnection(connectionId: string, body: SsoAdminUpdateConnectionRequest, token: string): Promise<Connection>;
1922
+ /**
1923
+ * Delete SSO connection (admin)
1924
+ * DELETE /v1/admin/sso/connections/{connectionId}
1925
+ */
1926
+ ssoAdminDeleteConnection(connectionId: string, token: string): Promise<AdminDeleteConnectionResponse>;
1122
1927
  /**
1123
1928
  * Get stats (admin)
1124
1929
  * GET /v1/admin/stats
@@ -1129,11 +1934,21 @@ declare class AuthClient$1 {
1129
1934
  * GET /v1/admin/users
1130
1935
  */
1131
1936
  adminListUsers(token: string): Promise<AdminUserListResponse>;
1937
+ /**
1938
+ * Create user (admin)
1939
+ * POST /v1/admin/users/create
1940
+ */
1941
+ adminCreateUser(body: AdminCreateUserRequest, token: string): Promise<User>;
1132
1942
  /**
1133
1943
  * Get user (admin)
1134
1944
  * GET /v1/admin/users/{userId}
1135
1945
  */
1136
1946
  adminGetUser(userId: string, token: string): Promise<User>;
1947
+ /**
1948
+ * Update user (admin)
1949
+ * PATCH /v1/admin/users/{userId}
1950
+ */
1951
+ adminUpdateUser(userId: string, body: AdminUpdateUserRequest, token: string): Promise<User>;
1137
1952
  /**
1138
1953
  * Delete user (admin)
1139
1954
  * DELETE /v1/admin/users/{userId}
@@ -1149,6 +1964,111 @@ declare class AuthClient$1 {
1149
1964
  * POST /v1/admin/users/{userId}/unban
1150
1965
  */
1151
1966
  adminUnbanUser(userId: string, body: AdminUnbanUserRequest, token: string): Promise<StatusResponse>;
1967
+ /**
1968
+ * List coupons
1969
+ * GET /v1/billing/coupons
1970
+ */
1971
+ listCoupons(token: string): Promise<ListCouponsResponse>;
1972
+ /**
1973
+ * Create coupon
1974
+ * POST /v1/billing/coupons
1975
+ */
1976
+ createCoupon(body: CreateCouponRequest, token: string): Promise<CouponResponse>;
1977
+ /**
1978
+ * Delete coupon
1979
+ * DELETE /v1/billing/coupons/{couponId}
1980
+ */
1981
+ deleteCoupon(couponId: string, body: DeleteCouponRequest, token: string): Promise<void>;
1982
+ /**
1983
+ * Check feature entitlement
1984
+ * GET /v1/billing/entitlements/{featureKey}
1985
+ */
1986
+ checkEntitlement(featureKey: string, token: string): Promise<EntitlementResponse>;
1987
+ /**
1988
+ * List invoices
1989
+ * GET /v1/billing/invoices
1990
+ */
1991
+ listInvoices(token: string): Promise<ListInvoicesResponse>;
1992
+ /**
1993
+ * Get invoice
1994
+ * GET /v1/billing/invoices/{invoiceId}
1995
+ */
1996
+ getInvoice(invoiceId: string, token: string): Promise<InvoiceResponse>;
1997
+ /**
1998
+ * Mark invoice as paid
1999
+ * POST /v1/billing/invoices/{invoiceId}/pay
2000
+ */
2001
+ markInvoicePaid(invoiceId: string, body: MarkInvoicePaidRequest, token: string): Promise<void>;
2002
+ /**
2003
+ * Void an invoice
2004
+ * POST /v1/billing/invoices/{invoiceId}/void
2005
+ */
2006
+ voidInvoice(invoiceId: string, body: VoidInvoiceRequest, token: string): Promise<void>;
2007
+ /**
2008
+ * List billing plans
2009
+ * GET /v1/billing/plans
2010
+ */
2011
+ listBillingPlans(token: string): Promise<ListPlansResponse>;
2012
+ /**
2013
+ * Create billing plan
2014
+ * POST /v1/billing/plans
2015
+ */
2016
+ createBillingPlan(body: CreateBillingPlanRequest, token: string): Promise<PlanResponse>;
2017
+ /**
2018
+ * Get billing plan
2019
+ * GET /v1/billing/plans/{planId}
2020
+ */
2021
+ getBillingPlan(planId: string, token: string): Promise<PlanResponse>;
2022
+ /**
2023
+ * Activate a billing plan
2024
+ * POST /v1/billing/plans/{planId}/activate
2025
+ */
2026
+ activateBillingPlan(planId: string, body: ActivateBillingPlanRequest, token: string): Promise<void>;
2027
+ /**
2028
+ * Archive a billing plan
2029
+ * POST /v1/billing/plans/{planId}/archive
2030
+ */
2031
+ archiveBillingPlan(planId: string, body: ArchiveBillingPlanRequest, token: string): Promise<void>;
2032
+ /**
2033
+ * List subscriptions
2034
+ * GET /v1/billing/subscriptions
2035
+ */
2036
+ listSubscriptions(token: string): Promise<ListSubscriptionsResponse>;
2037
+ /**
2038
+ * Create subscription
2039
+ * POST /v1/billing/subscriptions
2040
+ */
2041
+ createSubscription(body: CreateSubscriptionRequest, token: string): Promise<Response>;
2042
+ /**
2043
+ * Get active subscription
2044
+ * GET /v1/billing/subscriptions/active
2045
+ */
2046
+ getActiveSubscription(token: string): Promise<Response>;
2047
+ /**
2048
+ * Cancel subscription
2049
+ * POST /v1/billing/subscriptions/{subId}/cancel
2050
+ */
2051
+ cancelSubscription(subId: string, body: CancelSubscriptionRequest, token: string): Promise<void>;
2052
+ /**
2053
+ * Change subscription plan
2054
+ * POST /v1/billing/subscriptions/{subId}/change-plan
2055
+ */
2056
+ changeSubscriptionPlan(subId: string, body: ChangeSubscriptionPlanRequest, token: string): Promise<void>;
2057
+ /**
2058
+ * Pause subscription
2059
+ * POST /v1/billing/subscriptions/{subId}/pause
2060
+ */
2061
+ pauseSubscription(subId: string, body: PauseSubscriptionRequest, token: string): Promise<void>;
2062
+ /**
2063
+ * Resume subscription
2064
+ * POST /v1/billing/subscriptions/{subId}/resume
2065
+ */
2066
+ resumeSubscription(subId: string, body: ResumeSubscriptionRequest, token: string): Promise<void>;
2067
+ /**
2068
+ * Get usage summary
2069
+ * GET /v1/billing/usage
2070
+ */
2071
+ getUsageSummary(token: string): Promise<UsageSummaryResponse>;
1152
2072
  /**
1153
2073
  * Change password
1154
2074
  * POST /v1/change-password
@@ -1159,6 +2079,21 @@ declare class AuthClient$1 {
1159
2079
  * GET /v1/client-config
1160
2080
  */
1161
2081
  getClientConfig(token: string): Promise<ClientConfigResponse>;
2082
+ /**
2083
+ * List consents
2084
+ * GET /v1/consent
2085
+ */
2086
+ listConsents(): Promise<ListResponse$1>;
2087
+ /**
2088
+ * Grant consent
2089
+ * POST /v1/consent/grant
2090
+ */
2091
+ grantConsent(body: GrantConsentRequest): Promise<Consent>;
2092
+ /**
2093
+ * Revoke consent
2094
+ * POST /v1/consent/revoke
2095
+ */
2096
+ revokeConsent(body: RevokeConsentRequest): Promise<StatusResponse>;
1162
2097
  /**
1163
2098
  * List devices
1164
2099
  * GET /v1/devices
@@ -1234,6 +2169,11 @@ declare class AuthClient$1 {
1234
2169
  * GET /v1/health
1235
2170
  */
1236
2171
  getHealth(): Promise<HealthResponse>;
2172
+ /**
2173
+ * Introspect token
2174
+ * POST /v1/introspect
2175
+ */
2176
+ introspectToken(body: IntrospectTokenRequest): Promise<IntrospectResponse>;
1237
2177
  /**
1238
2178
  * List API keys
1239
2179
  * GET /v1/keys
@@ -1289,6 +2229,11 @@ declare class AuthClient$1 {
1289
2229
  * GET /v1/me/export
1290
2230
  */
1291
2231
  exportMyData(token: string): Promise<Record<string, unknown>>;
2232
+ /**
2233
+ * Switch active organization
2234
+ * POST /v1/me/switch-org
2235
+ */
2236
+ switchOrg(body: SwitchOrgRequest, token: string): Promise<SwitchOrgResponse>;
1292
2237
  /**
1293
2238
  * MFA challenge
1294
2239
  * POST /v1/mfa/challenge
@@ -1329,6 +2274,36 @@ declare class AuthClient$1 {
1329
2274
  * POST /v1/mfa/verify
1330
2275
  */
1331
2276
  verifyMFA(body: VerifyMFARequest): Promise<VerifyMFAResponse>;
2277
+ /**
2278
+ * OAuth2 Authorization
2279
+ * GET /v1/oauth/authorize
2280
+ */
2281
+ oauth2Authorize(): Promise<void>;
2282
+ /**
2283
+ * Device Authorization
2284
+ * POST /v1/oauth/device/authorize
2285
+ */
2286
+ oauth2DeviceAuthorize(body: Oauth2DeviceAuthorizeRequest): Promise<DeviceAuthResponse>;
2287
+ /**
2288
+ * Complete device authorization
2289
+ * POST /v1/oauth/device/complete
2290
+ */
2291
+ oauth2DeviceComplete(body: Oauth2DeviceCompleteRequest): Promise<DeviceCompleteResponse>;
2292
+ /**
2293
+ * Revoke token
2294
+ * POST /v1/oauth/revoke
2295
+ */
2296
+ oauth2Revoke(body: Oauth2RevokeRequest, token: string): Promise<void>;
2297
+ /**
2298
+ * OAuth2 Token
2299
+ * POST /v1/oauth/token
2300
+ */
2301
+ oauth2Token(body: Oauth2TokenRequest): Promise<TokenResponse>;
2302
+ /**
2303
+ * OIDC UserInfo
2304
+ * GET /v1/oauth/userinfo
2305
+ */
2306
+ oauth2UserInfo(token: string): Promise<UserInfo>;
1332
2307
  /**
1333
2308
  * List organizations
1334
2309
  * GET /v1/orgs
@@ -1426,7 +2401,7 @@ declare class AuthClient$1 {
1426
2401
  deleteTeam(orgId: string, teamId: string, body: DeleteTeamRequest, token: string): Promise<StatusResponse>;
1427
2402
  /**
1428
2403
  * List passkeys
1429
- * GET /v1/passkeys/
2404
+ * GET /v1/passkeys
1430
2405
  */
1431
2406
  listPasskeys(token: string): Promise<ListResponse$1>;
1432
2407
  /**
@@ -1454,6 +2429,16 @@ declare class AuthClient$1 {
1454
2429
  * DELETE /v1/passkeys/{credentialId}
1455
2430
  */
1456
2431
  deletePasskey(credentialId: string, body: DeletePasskeyRequest, token: string): Promise<DeleteResponse>;
2432
+ /**
2433
+ * Start phone authentication
2434
+ * POST /v1/phone/start
2435
+ */
2436
+ phoneAuthStart(body: PhoneAuthStartRequest): Promise<StartResponse>;
2437
+ /**
2438
+ * Verify phone OTP
2439
+ * POST /v1/phone/verify
2440
+ */
2441
+ phoneAuthVerify(body: PhoneAuthVerifyRequest): Promise<VerifyResponse>;
1457
2442
  /**
1458
2443
  * Refresh tokens
1459
2444
  * POST /v1/refresh
@@ -1574,6 +2559,11 @@ declare class AuthClient$1 {
1574
2559
  * POST /v1/verify-email
1575
2560
  */
1576
2561
  verifyEmail(body: VerifyEmailRequest): Promise<StatusResponse>;
2562
+ /**
2563
+ * Resend email verification
2564
+ * POST /v1/verify-email/resend
2565
+ */
2566
+ resendEmailVerification(body: ResendEmailVerificationRequest): Promise<StatusResponse>;
1577
2567
  /**
1578
2568
  * List webhooks
1579
2569
  * GET /v1/webhooks
@@ -1603,7 +2593,9 @@ declare class AuthClient$1 {
1603
2593
  }
1604
2594
  declare class AuthClientError extends Error {
1605
2595
  code?: number;
1606
- constructor(message: string, code?: number);
2596
+ type?: string;
2597
+ details?: Record<string, unknown>;
2598
+ constructor(message: string, code?: number, type?: string, details?: Record<string, unknown>);
1607
2599
  }
1608
2600
 
1609
2601
  /**
@@ -1680,11 +2672,26 @@ declare class AuthClient extends AuthClient$1 {
1680
2672
  * Simplifies the call-site by accepting code + token directly.
1681
2673
  */
1682
2674
  verifySMSCodeForMFA(code: string, token: string): Promise<any>;
2675
+ /**
2676
+ * Complete a device authorization (RFC 8628).
2677
+ *
2678
+ * Approves or denies a device code. Requires an authenticated session —
2679
+ * pass the session token so the backend can identify the user.
2680
+ */
2681
+ completeDeviceAuthorization(userCode: string, action: "approve" | "deny", token?: string): Promise<{
2682
+ status: string;
2683
+ }>;
1683
2684
  /**
1684
2685
  * Fetch the client configuration from the backend.
1685
2686
  *
1686
2687
  * The config describes which auth methods are enabled so SDK
1687
2688
  * components can auto-configure without manual props.
2689
+ *
2690
+ * Reads `baseURL` and `fetchFn` directly off the generated parent
2691
+ * class — earlier generator templates kept a `this.config` ref but
2692
+ * the current embedded template stores fields individually, so the
2693
+ * old `(this as any).config.baseURL` shape produced `undefined` and
2694
+ * the URL constructor threw.
1688
2695
  */
1689
2696
  fetchClientConfig(publishableKey?: string): Promise<ClientConfig>;
1690
2697
  }
@@ -1736,10 +2743,36 @@ declare class AuthManager {
1736
2743
  signIn(credentials: SignInRequest): Promise<void>;
1737
2744
  /** Sign up with email & password. */
1738
2745
  signUp(data: SignUpRequest): Promise<void>;
2746
+ /**
2747
+ * Resend the verification email for an unverified account.
2748
+ *
2749
+ * Always resolves; the backend returns 200 regardless of whether the
2750
+ * email is registered, unregistered, or already verified — that's the
2751
+ * enumeration-resistance contract. UI callers should disable the
2752
+ * button + show a generic "if your email is registered, we sent a new
2753
+ * link" confirmation rather than branching on the response.
2754
+ */
2755
+ resendVerification(email: string): Promise<void>;
1739
2756
  /** Sign out and clear the session. */
1740
2757
  signOut(): Promise<void>;
1741
- /** Submit an MFA challenge code. */
1742
- submitMFACode(enrollmentId: string, code: string): Promise<void>;
2758
+ /**
2759
+ * Submit the MFA challenge code against the ticket from the
2760
+ * mfa_required state. On success: real session minted, state →
2761
+ * "authenticated". On bad code: state stays "mfa_required" so
2762
+ * the form can show the error inline; the ticket remains valid
2763
+ * for the 5-minute server-side TTL.
2764
+ *
2765
+ * Throws if called outside the mfa_required state — the caller
2766
+ * has nowhere to send the code.
2767
+ */
2768
+ submitMFAChallenge(code: string): Promise<void>;
2769
+ /**
2770
+ * @deprecated Use submitMFAChallenge(code). The old enrollment-id
2771
+ * + partial-session shape was removed in the MFA consolidation;
2772
+ * this thin shim only exists so older callers don't break their
2773
+ * build, but the enrollmentId argument is now ignored.
2774
+ */
2775
+ submitMFACode(_enrollmentId: string, code: string): Promise<void>;
1743
2776
  /** Submit an MFA recovery code. */
1744
2777
  submitRecoveryCode(code: string): Promise<void>;
1745
2778
  /** Send an SMS code for MFA verification. Returns masked phone + expiry info. */
@@ -1752,8 +2785,19 @@ declare class AuthManager {
1752
2785
  submitSMSCode(code: string): Promise<void>;
1753
2786
  /** Refresh the current session manually. */
1754
2787
  refreshNow(): Promise<void>;
1755
- /** Get the current session token (if authenticated). */
2788
+ /**
2789
+ * Get the current session token (if authenticated). Returns null
2790
+ * during the MFA challenge — there is no real session yet, only a
2791
+ * ticket the challenge handler validates internally.
2792
+ */
1756
2793
  getSessionToken(): string | null;
2794
+ /**
2795
+ * Get the active MFA ticket (only set during the mfa_required
2796
+ * state). Form components driving the challenge UI read this to
2797
+ * confirm they have a partial-auth credential before letting the
2798
+ * user submit a code.
2799
+ */
2800
+ getMFATicket(): string | null;
1757
2801
  /** Get the current user (if authenticated). */
1758
2802
  getUser(): User | null;
1759
2803
  /** Get the cached client config (or null if not yet fetched). */