@fonderie/client 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -95,6 +95,8 @@ interface IUserDTO {
95
95
  isEmailVerified: boolean;
96
96
  isPhoneVerified: boolean;
97
97
  mfaEnabled: boolean;
98
+ provider: string;
99
+ hasPassword: boolean;
98
100
  suspended: boolean;
99
101
  whitelist: boolean;
100
102
  ipWhitelist: string[];
@@ -399,6 +401,107 @@ interface ITemplateRevision {
399
401
  actor: string | null;
400
402
  createdAt: string;
401
403
  }
404
+ interface IAdminReadinessProblem {
405
+ module: string;
406
+ severity: 'error' | 'warning';
407
+ message: string;
408
+ }
409
+ interface IAdminReadiness {
410
+ ok: boolean;
411
+ problems: IAdminReadinessProblem[];
412
+ }
413
+ interface IAdminModuleEntry {
414
+ name: string;
415
+ version: string | null;
416
+ readiness: IAdminReadiness;
417
+ describesAdmin: boolean;
418
+ }
419
+ interface IAdminRouteEntry {
420
+ method: string;
421
+ path: string;
422
+ module?: string;
423
+ }
424
+ interface IAdminManifest {
425
+ generatedAt: string;
426
+ env: string;
427
+ admin: {
428
+ version: string;
429
+ log: boolean;
430
+ };
431
+ modules: IAdminModuleEntry[];
432
+ readiness: IAdminReadiness;
433
+ routes: IAdminRouteEntry[];
434
+ }
435
+ interface IAdminCheckResult {
436
+ name: string;
437
+ module: string;
438
+ ok: boolean;
439
+ findings: string[];
440
+ skipped?: string;
441
+ durationMs: number;
442
+ }
443
+ interface IAdminDoctorReport {
444
+ generatedAt: string;
445
+ ok: boolean;
446
+ checks: IAdminCheckResult[];
447
+ }
448
+ interface IAdminAttentionItem {
449
+ source: string;
450
+ severity: 'error' | 'advice';
451
+ message: string;
452
+ }
453
+ interface IAdminAttention {
454
+ generatedAt: string;
455
+ ok: boolean;
456
+ items: IAdminAttentionItem[];
457
+ }
458
+ interface IAdminConfigReport {
459
+ generatedAt: string;
460
+ readiness: IAdminReadiness;
461
+ modules: Array<{
462
+ name: string;
463
+ problems: IAdminReadinessProblem[];
464
+ }>;
465
+ env: Array<{
466
+ name: string;
467
+ set: boolean;
468
+ }>;
469
+ }
470
+ type AdminRouteGuard = 'admin' | 'probe' | 'app';
471
+ interface IAdminRoutesReport {
472
+ generatedAt: string;
473
+ routes: Array<IAdminRouteEntry & {
474
+ guard: AdminRouteGuard;
475
+ }>;
476
+ }
477
+ interface IAdminTokensReport {
478
+ generatedAt: string;
479
+ admin: {
480
+ ok: boolean;
481
+ problems: IAdminReadinessProblem[];
482
+ };
483
+ legacy: Array<{
484
+ module: string;
485
+ set: boolean;
486
+ }>;
487
+ }
488
+ interface IAdminLogEntry {
489
+ id: string;
490
+ at: string;
491
+ actor: string;
492
+ method: string;
493
+ path: string;
494
+ route: string;
495
+ module: string;
496
+ status: number;
497
+ durationMs: number;
498
+ requestId: string | null;
499
+ clientIp: string | null;
500
+ }
501
+ interface IAdminLogPage {
502
+ entries: IAdminLogEntry[];
503
+ next: string | null;
504
+ }
402
505
  interface IConfigEntry {
403
506
  key: string;
404
507
  value: unknown;
@@ -759,6 +862,15 @@ declare class AuthClient {
759
862
  * error page, which the app cannot explain.
760
863
  */
761
864
  providers(): Promise<IApiResponse<IAuthProvidersResult>>;
865
+ /**
866
+ * Disconnect the OAuth provider linked to the signed-in account.
867
+ *
868
+ * Refused with 409 PASSWORD_REQUIRED when the account has no password:
869
+ * removing the only credential is account deletion, not a settings toggle.
870
+ * Check `user.hasPassword` before offering the control so the user is asked
871
+ * to set a password first rather than shown an error they can't act on.
872
+ */
873
+ unlinkOauth(provider: string): Promise<IApiResponse<null>>;
762
874
  register(input: IRegisterInput): Promise<IApiResponse<IRegisterResult>>;
763
875
  login(input: ILoginInput): Promise<IApiResponse<ILoginResult | IMfaRequiredResult>>;
764
876
  appleNative(input: IAppleNativeInput): Promise<IApiResponse<ILoginResult>>;
@@ -1170,6 +1282,32 @@ declare class ConfigAdminClient {
1170
1282
  revealSecret(key: string, environment?: string): Promise<IApiResponse<IRevealSecretResult>>;
1171
1283
  }
1172
1284
 
1285
+ interface IAdminClientOptions {
1286
+ baseUrl: string;
1287
+ adminToken: string;
1288
+ prefix?: string;
1289
+ actor?: string;
1290
+ }
1291
+ interface IAdminLogQuery {
1292
+ limit?: number;
1293
+ before?: string;
1294
+ }
1295
+ declare class AdminClient {
1296
+ private http;
1297
+ private adminToken;
1298
+ private prefix;
1299
+ private actorHeaders;
1300
+ constructor(opts: IAdminClientOptions);
1301
+ private get;
1302
+ attention(): Promise<IApiResponse<IAdminAttention>>;
1303
+ manifest(): Promise<IApiResponse<IAdminManifest>>;
1304
+ doctor(): Promise<IApiResponse<IAdminDoctorReport>>;
1305
+ config(): Promise<IApiResponse<IAdminConfigReport>>;
1306
+ routes(): Promise<IApiResponse<IAdminRoutesReport>>;
1307
+ tokens(): Promise<IApiResponse<IAdminTokensReport>>;
1308
+ adminLog(query?: IAdminLogQuery): Promise<IApiResponse<IAdminLogPage>>;
1309
+ }
1310
+
1173
1311
  interface ISetTemplateInput {
1174
1312
  text: string;
1175
1313
  subject?: string;
@@ -1198,4 +1336,4 @@ declare class CourierAdminClient {
1198
1336
  rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
1199
1337
  }
1200
1338
 
1201
- export { AuditClient, AuthClient, BillingClient, ConfigAdminClient, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, FonderieApiError, FonderieClient, type IAcceptInvitationResult, type IAddAddressInput, type IAddEmailInput, type IAddPhoneInput, type IAddRelationshipInput, type IAddressDTO, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditEventDTO, type IAuditPageResult, type IBlacklistCustomerInput, type ICache, type ICancelSubscriptionInput, type IChangePasswordInput, type ICheckoutInput, type ICheckoutUrlResult, type IClientAuthConfig, type IConfigAdminClientOptions, type IConfigEntry, type IConfigRevision, type ICourierAdminClientOptions, type ICreateCustomerInput, type ICreatePlanInput, type ICreateRoleInput, type ICreateWebhookEndpointInput, type ICreateWorkspaceInput, type ICustomerAddressDTO, type ICustomerAddressListResult, type ICustomerAddressResult, type ICustomerDTO, type ICustomerDetailD2DTO, type ICustomerDetailDTO, type ICustomerEmailDTO, type ICustomerEmailListResult, type ICustomerEmailResult, type ICustomerLabelDTO, type ICustomerLabelListResult, type ICustomerListResult, type ICustomerNoteDTO, type ICustomerNoteListResult, type ICustomerNoteResult, type ICustomerPhoneDTO, type ICustomerPhoneListResult, type ICustomerPhoneResult, type ICustomerRelationshipDTO, type ICustomerRelationshipExpandedD2DTO, type ICustomerRelationshipExpandedDTO, type ICustomerRelationshipListResult, type ICustomerRelationshipResult, type ICustomerResult, type ICustomerShallowDTO, type ICustomerTagListResult, type IFonderieClientOptions, type IGetCustomerInput, type IGetLoginHistoryInput, type IInvitationDTO, type IInvitationListResult, type IInviteEntry, type IInviteResult, type IInvoiceDTO, type IInvoicesResult, type IListAuditEventsInput, type IListCustomersInput, type ILoginEventDTO, type ILoginHistoryPageResult, type ILoginInput, type ILoginResult, type IMeResult, type IMediaAssetDTO, type IMediaAssetResult, type IMemberDTO, type IMemberListResult, type IMemoryCacheOptions, type IMfaEnabledResult, type IMfaRequiredResult, type IMfaSetupResult, type IPaymentMethodDTO, type IPaymentMethodResult, type IPlanDTO, type IPlanFeature, type IPlanListResult, type IPlanResult, type IPortalUrlResult, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRequestConfig, type IResendVerificationResult, type IResetPasswordInput, type IRevealSecretResult, type IRoleDTO, type IRoleListResult, type IRolePermission, type IRolePermissionInput, type IRolePermissionsResult, type IRoleResult, type IRollbackInput, type IRollbackTemplateInput, type ISecretEntry, type ISecretRevision, type ISessionDTO, type ISessionsResult, type ISetConfigInput, type ISetSecretInput, type ISetTemplateInput, type ISubscriptionChangeResult, type ISubscriptionDTO, type ISubscriptionResult, type ITemplateEntry, type ITemplateRevision, type ITestWebhookResult, type ITokens, type IUpdateCustomerInput, type IUpdatePlanInput, type IUpdatePreferencesInput, type IUpdateProfileInput, type IUpdateRoleInput, type IUpdateSettingsInput, type IUpdateWebhookEndpointInput, type IUpdateWorkspaceInput, type IUploadMediaInput, type IUsageResult, type IUserDTO, type IUserPreferences, type IVerifyEmailResult, type IWalletCheckoutInput, type IWalletDTO, type IWalletPreferencesInput, type IWalletPurchaseInput, type IWalletPurchaseResult, type IWalletResult, type IWalletTransactionDTO, type IWalletTransactionsResult, type IWebhookDeliveryDTO, type IWebhookDeliveryListResult, type IWebhookEndpointCreatedDTO, type IWebhookEndpointDTO, type IWebhookEndpointListResult, type IWorkspaceAddressDTO, type IWorkspaceDTO, type IWorkspaceListResult, type IWorkspaceResult, type IWorkspaceSettingsDTO, type IWorkspaceSettingsResult, MediaClient, type SubscriberType, WebhooksClient, WorkspacesClient, createMemoryCache, isMfaRequired };
1339
+ export { AdminClient, type AdminRouteGuard, AuditClient, AuthClient, BillingClient, ConfigAdminClient, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, FonderieApiError, FonderieClient, type IAcceptInvitationResult, type IAddAddressInput, type IAddEmailInput, type IAddPhoneInput, type IAddRelationshipInput, type IAddressDTO, type IAdminAttention, type IAdminAttentionItem, type IAdminCheckResult, type IAdminClientOptions, type IAdminConfigReport, type IAdminDoctorReport, type IAdminLogEntry, type IAdminLogPage, type IAdminLogQuery, type IAdminManifest, type IAdminModuleEntry, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminTokensReport, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditEventDTO, type IAuditPageResult, type IBlacklistCustomerInput, type ICache, type ICancelSubscriptionInput, type IChangePasswordInput, type ICheckoutInput, type ICheckoutUrlResult, type IClientAuthConfig, type IConfigAdminClientOptions, type IConfigEntry, type IConfigRevision, type ICourierAdminClientOptions, type ICreateCustomerInput, type ICreatePlanInput, type ICreateRoleInput, type ICreateWebhookEndpointInput, type ICreateWorkspaceInput, type ICustomerAddressDTO, type ICustomerAddressListResult, type ICustomerAddressResult, type ICustomerDTO, type ICustomerDetailD2DTO, type ICustomerDetailDTO, type ICustomerEmailDTO, type ICustomerEmailListResult, type ICustomerEmailResult, type ICustomerLabelDTO, type ICustomerLabelListResult, type ICustomerListResult, type ICustomerNoteDTO, type ICustomerNoteListResult, type ICustomerNoteResult, type ICustomerPhoneDTO, type ICustomerPhoneListResult, type ICustomerPhoneResult, type ICustomerRelationshipDTO, type ICustomerRelationshipExpandedD2DTO, type ICustomerRelationshipExpandedDTO, type ICustomerRelationshipListResult, type ICustomerRelationshipResult, type ICustomerResult, type ICustomerShallowDTO, type ICustomerTagListResult, type IFonderieClientOptions, type IGetCustomerInput, type IGetLoginHistoryInput, type IInvitationDTO, type IInvitationListResult, type IInviteEntry, type IInviteResult, type IInvoiceDTO, type IInvoicesResult, type IListAuditEventsInput, type IListCustomersInput, type ILoginEventDTO, type ILoginHistoryPageResult, type ILoginInput, type ILoginResult, type IMeResult, type IMediaAssetDTO, type IMediaAssetResult, type IMemberDTO, type IMemberListResult, type IMemoryCacheOptions, type IMfaEnabledResult, type IMfaRequiredResult, type IMfaSetupResult, type IPaymentMethodDTO, type IPaymentMethodResult, type IPlanDTO, type IPlanFeature, type IPlanListResult, type IPlanResult, type IPortalUrlResult, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRequestConfig, type IResendVerificationResult, type IResetPasswordInput, type IRevealSecretResult, type IRoleDTO, type IRoleListResult, type IRolePermission, type IRolePermissionInput, type IRolePermissionsResult, type IRoleResult, type IRollbackInput, type IRollbackTemplateInput, type ISecretEntry, type ISecretRevision, type ISessionDTO, type ISessionsResult, type ISetConfigInput, type ISetSecretInput, type ISetTemplateInput, type ISubscriptionChangeResult, type ISubscriptionDTO, type ISubscriptionResult, type ITemplateEntry, type ITemplateRevision, type ITestWebhookResult, type ITokens, type IUpdateCustomerInput, type IUpdatePlanInput, type IUpdatePreferencesInput, type IUpdateProfileInput, type IUpdateRoleInput, type IUpdateSettingsInput, type IUpdateWebhookEndpointInput, type IUpdateWorkspaceInput, type IUploadMediaInput, type IUsageResult, type IUserDTO, type IUserPreferences, type IVerifyEmailResult, type IWalletCheckoutInput, type IWalletDTO, type IWalletPreferencesInput, type IWalletPurchaseInput, type IWalletPurchaseResult, type IWalletResult, type IWalletTransactionDTO, type IWalletTransactionsResult, type IWebhookDeliveryDTO, type IWebhookDeliveryListResult, type IWebhookEndpointCreatedDTO, type IWebhookEndpointDTO, type IWebhookEndpointListResult, type IWorkspaceAddressDTO, type IWorkspaceDTO, type IWorkspaceListResult, type IWorkspaceResult, type IWorkspaceSettingsDTO, type IWorkspaceSettingsResult, MediaClient, type SubscriberType, WebhooksClient, WorkspacesClient, createMemoryCache, isMfaRequired };
package/dist/index.d.ts CHANGED
@@ -95,6 +95,8 @@ interface IUserDTO {
95
95
  isEmailVerified: boolean;
96
96
  isPhoneVerified: boolean;
97
97
  mfaEnabled: boolean;
98
+ provider: string;
99
+ hasPassword: boolean;
98
100
  suspended: boolean;
99
101
  whitelist: boolean;
100
102
  ipWhitelist: string[];
@@ -399,6 +401,107 @@ interface ITemplateRevision {
399
401
  actor: string | null;
400
402
  createdAt: string;
401
403
  }
404
+ interface IAdminReadinessProblem {
405
+ module: string;
406
+ severity: 'error' | 'warning';
407
+ message: string;
408
+ }
409
+ interface IAdminReadiness {
410
+ ok: boolean;
411
+ problems: IAdminReadinessProblem[];
412
+ }
413
+ interface IAdminModuleEntry {
414
+ name: string;
415
+ version: string | null;
416
+ readiness: IAdminReadiness;
417
+ describesAdmin: boolean;
418
+ }
419
+ interface IAdminRouteEntry {
420
+ method: string;
421
+ path: string;
422
+ module?: string;
423
+ }
424
+ interface IAdminManifest {
425
+ generatedAt: string;
426
+ env: string;
427
+ admin: {
428
+ version: string;
429
+ log: boolean;
430
+ };
431
+ modules: IAdminModuleEntry[];
432
+ readiness: IAdminReadiness;
433
+ routes: IAdminRouteEntry[];
434
+ }
435
+ interface IAdminCheckResult {
436
+ name: string;
437
+ module: string;
438
+ ok: boolean;
439
+ findings: string[];
440
+ skipped?: string;
441
+ durationMs: number;
442
+ }
443
+ interface IAdminDoctorReport {
444
+ generatedAt: string;
445
+ ok: boolean;
446
+ checks: IAdminCheckResult[];
447
+ }
448
+ interface IAdminAttentionItem {
449
+ source: string;
450
+ severity: 'error' | 'advice';
451
+ message: string;
452
+ }
453
+ interface IAdminAttention {
454
+ generatedAt: string;
455
+ ok: boolean;
456
+ items: IAdminAttentionItem[];
457
+ }
458
+ interface IAdminConfigReport {
459
+ generatedAt: string;
460
+ readiness: IAdminReadiness;
461
+ modules: Array<{
462
+ name: string;
463
+ problems: IAdminReadinessProblem[];
464
+ }>;
465
+ env: Array<{
466
+ name: string;
467
+ set: boolean;
468
+ }>;
469
+ }
470
+ type AdminRouteGuard = 'admin' | 'probe' | 'app';
471
+ interface IAdminRoutesReport {
472
+ generatedAt: string;
473
+ routes: Array<IAdminRouteEntry & {
474
+ guard: AdminRouteGuard;
475
+ }>;
476
+ }
477
+ interface IAdminTokensReport {
478
+ generatedAt: string;
479
+ admin: {
480
+ ok: boolean;
481
+ problems: IAdminReadinessProblem[];
482
+ };
483
+ legacy: Array<{
484
+ module: string;
485
+ set: boolean;
486
+ }>;
487
+ }
488
+ interface IAdminLogEntry {
489
+ id: string;
490
+ at: string;
491
+ actor: string;
492
+ method: string;
493
+ path: string;
494
+ route: string;
495
+ module: string;
496
+ status: number;
497
+ durationMs: number;
498
+ requestId: string | null;
499
+ clientIp: string | null;
500
+ }
501
+ interface IAdminLogPage {
502
+ entries: IAdminLogEntry[];
503
+ next: string | null;
504
+ }
402
505
  interface IConfigEntry {
403
506
  key: string;
404
507
  value: unknown;
@@ -759,6 +862,15 @@ declare class AuthClient {
759
862
  * error page, which the app cannot explain.
760
863
  */
761
864
  providers(): Promise<IApiResponse<IAuthProvidersResult>>;
865
+ /**
866
+ * Disconnect the OAuth provider linked to the signed-in account.
867
+ *
868
+ * Refused with 409 PASSWORD_REQUIRED when the account has no password:
869
+ * removing the only credential is account deletion, not a settings toggle.
870
+ * Check `user.hasPassword` before offering the control so the user is asked
871
+ * to set a password first rather than shown an error they can't act on.
872
+ */
873
+ unlinkOauth(provider: string): Promise<IApiResponse<null>>;
762
874
  register(input: IRegisterInput): Promise<IApiResponse<IRegisterResult>>;
763
875
  login(input: ILoginInput): Promise<IApiResponse<ILoginResult | IMfaRequiredResult>>;
764
876
  appleNative(input: IAppleNativeInput): Promise<IApiResponse<ILoginResult>>;
@@ -1170,6 +1282,32 @@ declare class ConfigAdminClient {
1170
1282
  revealSecret(key: string, environment?: string): Promise<IApiResponse<IRevealSecretResult>>;
1171
1283
  }
1172
1284
 
1285
+ interface IAdminClientOptions {
1286
+ baseUrl: string;
1287
+ adminToken: string;
1288
+ prefix?: string;
1289
+ actor?: string;
1290
+ }
1291
+ interface IAdminLogQuery {
1292
+ limit?: number;
1293
+ before?: string;
1294
+ }
1295
+ declare class AdminClient {
1296
+ private http;
1297
+ private adminToken;
1298
+ private prefix;
1299
+ private actorHeaders;
1300
+ constructor(opts: IAdminClientOptions);
1301
+ private get;
1302
+ attention(): Promise<IApiResponse<IAdminAttention>>;
1303
+ manifest(): Promise<IApiResponse<IAdminManifest>>;
1304
+ doctor(): Promise<IApiResponse<IAdminDoctorReport>>;
1305
+ config(): Promise<IApiResponse<IAdminConfigReport>>;
1306
+ routes(): Promise<IApiResponse<IAdminRoutesReport>>;
1307
+ tokens(): Promise<IApiResponse<IAdminTokensReport>>;
1308
+ adminLog(query?: IAdminLogQuery): Promise<IApiResponse<IAdminLogPage>>;
1309
+ }
1310
+
1173
1311
  interface ISetTemplateInput {
1174
1312
  text: string;
1175
1313
  subject?: string;
@@ -1198,4 +1336,4 @@ declare class CourierAdminClient {
1198
1336
  rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
1199
1337
  }
1200
1338
 
1201
- export { AuditClient, AuthClient, BillingClient, ConfigAdminClient, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, FonderieApiError, FonderieClient, type IAcceptInvitationResult, type IAddAddressInput, type IAddEmailInput, type IAddPhoneInput, type IAddRelationshipInput, type IAddressDTO, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditEventDTO, type IAuditPageResult, type IBlacklistCustomerInput, type ICache, type ICancelSubscriptionInput, type IChangePasswordInput, type ICheckoutInput, type ICheckoutUrlResult, type IClientAuthConfig, type IConfigAdminClientOptions, type IConfigEntry, type IConfigRevision, type ICourierAdminClientOptions, type ICreateCustomerInput, type ICreatePlanInput, type ICreateRoleInput, type ICreateWebhookEndpointInput, type ICreateWorkspaceInput, type ICustomerAddressDTO, type ICustomerAddressListResult, type ICustomerAddressResult, type ICustomerDTO, type ICustomerDetailD2DTO, type ICustomerDetailDTO, type ICustomerEmailDTO, type ICustomerEmailListResult, type ICustomerEmailResult, type ICustomerLabelDTO, type ICustomerLabelListResult, type ICustomerListResult, type ICustomerNoteDTO, type ICustomerNoteListResult, type ICustomerNoteResult, type ICustomerPhoneDTO, type ICustomerPhoneListResult, type ICustomerPhoneResult, type ICustomerRelationshipDTO, type ICustomerRelationshipExpandedD2DTO, type ICustomerRelationshipExpandedDTO, type ICustomerRelationshipListResult, type ICustomerRelationshipResult, type ICustomerResult, type ICustomerShallowDTO, type ICustomerTagListResult, type IFonderieClientOptions, type IGetCustomerInput, type IGetLoginHistoryInput, type IInvitationDTO, type IInvitationListResult, type IInviteEntry, type IInviteResult, type IInvoiceDTO, type IInvoicesResult, type IListAuditEventsInput, type IListCustomersInput, type ILoginEventDTO, type ILoginHistoryPageResult, type ILoginInput, type ILoginResult, type IMeResult, type IMediaAssetDTO, type IMediaAssetResult, type IMemberDTO, type IMemberListResult, type IMemoryCacheOptions, type IMfaEnabledResult, type IMfaRequiredResult, type IMfaSetupResult, type IPaymentMethodDTO, type IPaymentMethodResult, type IPlanDTO, type IPlanFeature, type IPlanListResult, type IPlanResult, type IPortalUrlResult, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRequestConfig, type IResendVerificationResult, type IResetPasswordInput, type IRevealSecretResult, type IRoleDTO, type IRoleListResult, type IRolePermission, type IRolePermissionInput, type IRolePermissionsResult, type IRoleResult, type IRollbackInput, type IRollbackTemplateInput, type ISecretEntry, type ISecretRevision, type ISessionDTO, type ISessionsResult, type ISetConfigInput, type ISetSecretInput, type ISetTemplateInput, type ISubscriptionChangeResult, type ISubscriptionDTO, type ISubscriptionResult, type ITemplateEntry, type ITemplateRevision, type ITestWebhookResult, type ITokens, type IUpdateCustomerInput, type IUpdatePlanInput, type IUpdatePreferencesInput, type IUpdateProfileInput, type IUpdateRoleInput, type IUpdateSettingsInput, type IUpdateWebhookEndpointInput, type IUpdateWorkspaceInput, type IUploadMediaInput, type IUsageResult, type IUserDTO, type IUserPreferences, type IVerifyEmailResult, type IWalletCheckoutInput, type IWalletDTO, type IWalletPreferencesInput, type IWalletPurchaseInput, type IWalletPurchaseResult, type IWalletResult, type IWalletTransactionDTO, type IWalletTransactionsResult, type IWebhookDeliveryDTO, type IWebhookDeliveryListResult, type IWebhookEndpointCreatedDTO, type IWebhookEndpointDTO, type IWebhookEndpointListResult, type IWorkspaceAddressDTO, type IWorkspaceDTO, type IWorkspaceListResult, type IWorkspaceResult, type IWorkspaceSettingsDTO, type IWorkspaceSettingsResult, MediaClient, type SubscriberType, WebhooksClient, WorkspacesClient, createMemoryCache, isMfaRequired };
1339
+ export { AdminClient, type AdminRouteGuard, AuditClient, AuthClient, BillingClient, ConfigAdminClient, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, FonderieApiError, FonderieClient, type IAcceptInvitationResult, type IAddAddressInput, type IAddEmailInput, type IAddPhoneInput, type IAddRelationshipInput, type IAddressDTO, type IAdminAttention, type IAdminAttentionItem, type IAdminCheckResult, type IAdminClientOptions, type IAdminConfigReport, type IAdminDoctorReport, type IAdminLogEntry, type IAdminLogPage, type IAdminLogQuery, type IAdminManifest, type IAdminModuleEntry, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminTokensReport, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditEventDTO, type IAuditPageResult, type IBlacklistCustomerInput, type ICache, type ICancelSubscriptionInput, type IChangePasswordInput, type ICheckoutInput, type ICheckoutUrlResult, type IClientAuthConfig, type IConfigAdminClientOptions, type IConfigEntry, type IConfigRevision, type ICourierAdminClientOptions, type ICreateCustomerInput, type ICreatePlanInput, type ICreateRoleInput, type ICreateWebhookEndpointInput, type ICreateWorkspaceInput, type ICustomerAddressDTO, type ICustomerAddressListResult, type ICustomerAddressResult, type ICustomerDTO, type ICustomerDetailD2DTO, type ICustomerDetailDTO, type ICustomerEmailDTO, type ICustomerEmailListResult, type ICustomerEmailResult, type ICustomerLabelDTO, type ICustomerLabelListResult, type ICustomerListResult, type ICustomerNoteDTO, type ICustomerNoteListResult, type ICustomerNoteResult, type ICustomerPhoneDTO, type ICustomerPhoneListResult, type ICustomerPhoneResult, type ICustomerRelationshipDTO, type ICustomerRelationshipExpandedD2DTO, type ICustomerRelationshipExpandedDTO, type ICustomerRelationshipListResult, type ICustomerRelationshipResult, type ICustomerResult, type ICustomerShallowDTO, type ICustomerTagListResult, type IFonderieClientOptions, type IGetCustomerInput, type IGetLoginHistoryInput, type IInvitationDTO, type IInvitationListResult, type IInviteEntry, type IInviteResult, type IInvoiceDTO, type IInvoicesResult, type IListAuditEventsInput, type IListCustomersInput, type ILoginEventDTO, type ILoginHistoryPageResult, type ILoginInput, type ILoginResult, type IMeResult, type IMediaAssetDTO, type IMediaAssetResult, type IMemberDTO, type IMemberListResult, type IMemoryCacheOptions, type IMfaEnabledResult, type IMfaRequiredResult, type IMfaSetupResult, type IPaymentMethodDTO, type IPaymentMethodResult, type IPlanDTO, type IPlanFeature, type IPlanListResult, type IPlanResult, type IPortalUrlResult, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRequestConfig, type IResendVerificationResult, type IResetPasswordInput, type IRevealSecretResult, type IRoleDTO, type IRoleListResult, type IRolePermission, type IRolePermissionInput, type IRolePermissionsResult, type IRoleResult, type IRollbackInput, type IRollbackTemplateInput, type ISecretEntry, type ISecretRevision, type ISessionDTO, type ISessionsResult, type ISetConfigInput, type ISetSecretInput, type ISetTemplateInput, type ISubscriptionChangeResult, type ISubscriptionDTO, type ISubscriptionResult, type ITemplateEntry, type ITemplateRevision, type ITestWebhookResult, type ITokens, type IUpdateCustomerInput, type IUpdatePlanInput, type IUpdatePreferencesInput, type IUpdateProfileInput, type IUpdateRoleInput, type IUpdateSettingsInput, type IUpdateWebhookEndpointInput, type IUpdateWorkspaceInput, type IUploadMediaInput, type IUsageResult, type IUserDTO, type IUserPreferences, type IVerifyEmailResult, type IWalletCheckoutInput, type IWalletDTO, type IWalletPreferencesInput, type IWalletPurchaseInput, type IWalletPurchaseResult, type IWalletResult, type IWalletTransactionDTO, type IWalletTransactionsResult, type IWebhookDeliveryDTO, type IWebhookDeliveryListResult, type IWebhookEndpointCreatedDTO, type IWebhookEndpointDTO, type IWebhookEndpointListResult, type IWorkspaceAddressDTO, type IWorkspaceDTO, type IWorkspaceListResult, type IWorkspaceResult, type IWorkspaceSettingsDTO, type IWorkspaceSettingsResult, MediaClient, type SubscriberType, WebhooksClient, WorkspacesClient, createMemoryCache, isMfaRequired };
package/dist/index.js CHANGED
@@ -257,6 +257,20 @@ var AuthClient = class {
257
257
  path: "/auth/providers"
258
258
  });
259
259
  }
260
+ /**
261
+ * Disconnect the OAuth provider linked to the signed-in account.
262
+ *
263
+ * Refused with 409 PASSWORD_REQUIRED when the account has no password:
264
+ * removing the only credential is account deletion, not a settings toggle.
265
+ * Check `user.hasPassword` before offering the control so the user is asked
266
+ * to set a password first rather than shown an error they can't act on.
267
+ */
268
+ unlinkOauth(provider) {
269
+ return this.http.request({
270
+ method: "DELETE",
271
+ path: `/auth/oauth/${encodeURIComponent(provider)}`
272
+ });
273
+ }
260
274
  register(input) {
261
275
  return this.http.request({
262
276
  method: "POST",
@@ -1650,6 +1664,53 @@ var ConfigAdminClient = class {
1650
1664
  }
1651
1665
  };
1652
1666
 
1667
+ // src/modules/admin.ts
1668
+ var AdminClient = class {
1669
+ http;
1670
+ adminToken;
1671
+ prefix;
1672
+ actorHeaders;
1673
+ constructor(opts) {
1674
+ this.http = new HttpClient(opts.baseUrl);
1675
+ this.adminToken = opts.adminToken;
1676
+ this.prefix = (opts.prefix ?? "/_admin").replace(/\/+$/, "");
1677
+ this.actorHeaders = opts.actor ? { "X-Actor": opts.actor } : void 0;
1678
+ }
1679
+ get(suffix) {
1680
+ return this.http.request({
1681
+ method: "GET",
1682
+ path: `${this.prefix}${suffix}`,
1683
+ token: this.adminToken,
1684
+ headers: this.actorHeaders
1685
+ });
1686
+ }
1687
+ attention() {
1688
+ return this.get("");
1689
+ }
1690
+ manifest() {
1691
+ return this.get("/manifest");
1692
+ }
1693
+ doctor() {
1694
+ return this.get("/doctor");
1695
+ }
1696
+ config() {
1697
+ return this.get("/config");
1698
+ }
1699
+ routes() {
1700
+ return this.get("/routes");
1701
+ }
1702
+ tokens() {
1703
+ return this.get("/access/tokens");
1704
+ }
1705
+ adminLog(query = {}) {
1706
+ const q = new URLSearchParams();
1707
+ if (query.limit) q.set("limit", String(query.limit));
1708
+ if (query.before) q.set("before", query.before);
1709
+ const qs = q.toString();
1710
+ return this.get(`/activity/admin-log${qs ? `?${qs}` : ""}`);
1711
+ }
1712
+ };
1713
+
1653
1714
  // src/modules/courier-admin.ts
1654
1715
  var CourierAdminClient = class {
1655
1716
  http;
@@ -1719,6 +1780,7 @@ function isMfaRequired(result) {
1719
1780
  return !("tokens" in result);
1720
1781
  }
1721
1782
  export {
1783
+ AdminClient,
1722
1784
  AuditClient,
1723
1785
  AuthClient,
1724
1786
  BillingClient,