@fonderie/client 0.25.0 → 0.27.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
@@ -502,6 +502,58 @@ interface IAdminLogPage {
502
502
  entries: IAdminLogEntry[];
503
503
  next: string | null;
504
504
  }
505
+ interface IAdminUserDTO extends IUserDTO {
506
+ deletedAt: string | null;
507
+ }
508
+ interface IAdminCatalog {
509
+ configured: unknown[];
510
+ stored: IPlanDTO[];
511
+ }
512
+ interface IAdminSubscriptionDTO {
513
+ id: string;
514
+ subscriberType: SubscriberType;
515
+ subscriberId: string;
516
+ plan: string;
517
+ interval: string;
518
+ status: string;
519
+ providerCustomerId: string | null;
520
+ providerSubscriptionId: string | null;
521
+ currentPeriodStart: string | null;
522
+ currentPeriodEnd: string | null;
523
+ cancelAtPeriodEnd: boolean;
524
+ trialEndsAt: string | null;
525
+ createdAt: string;
526
+ }
527
+ interface IAdminWalletDTO extends IWalletDTO {
528
+ version: number;
529
+ updatedAt: string | null;
530
+ }
531
+ interface IAdminWalletLedgerPage {
532
+ currency: string;
533
+ entries: IWalletTransactionDTO[];
534
+ nextCursor: string | null;
535
+ }
536
+ interface IAdminPlanInput {
537
+ name?: string;
538
+ description?: string | null;
539
+ tier?: number;
540
+ seats?: number | null;
541
+ trialDays?: number;
542
+ monthlyAmount?: number | null;
543
+ monthlyPriceId?: string | null;
544
+ yearlyAmount?: number | null;
545
+ yearlyPriceId?: string | null;
546
+ features?: unknown;
547
+ metadata?: unknown;
548
+ }
549
+ interface IAdminGrantInput {
550
+ subscriberType: SubscriberType;
551
+ subscriberId: string;
552
+ amount: string | number;
553
+ currency?: string;
554
+ description?: string;
555
+ idempotencyKey: string;
556
+ }
505
557
  interface IConfigEntry {
506
558
  key: string;
507
559
  value: unknown;
@@ -1311,6 +1363,63 @@ declare class AdminClient {
1311
1363
  adminLog(query?: IAdminLogQuery): Promise<IApiResponse<IAdminLogPage>>;
1312
1364
  }
1313
1365
 
1366
+ interface IAuthAdminClientOptions {
1367
+ baseUrl: string;
1368
+ adminToken: string;
1369
+ prefix?: string;
1370
+ actor?: string;
1371
+ }
1372
+ interface IAdminLoginHistoryQuery {
1373
+ limit?: number;
1374
+ cursor?: string;
1375
+ }
1376
+ declare class AuthAdminClient {
1377
+ private http;
1378
+ private adminToken;
1379
+ private prefix;
1380
+ private actorHeaders;
1381
+ constructor(opts: IAuthAdminClientOptions);
1382
+ private call;
1383
+ findUser(email: string): Promise<IApiResponse<IAdminUserDTO>>;
1384
+ getUser(id: string): Promise<IApiResponse<IAdminUserDTO>>;
1385
+ listUserSessions(id: string): Promise<IApiResponse<ISessionDTO[]>>;
1386
+ revokeUserSessions(id: string): Promise<IApiResponse<undefined>>;
1387
+ userLoginHistory(id: string, query?: IAdminLoginHistoryQuery): Promise<IApiResponse<ILoginHistoryPageResult>>;
1388
+ suspendUser(id: string): Promise<IApiResponse<IAdminUserDTO>>;
1389
+ unsuspendUser(id: string): Promise<IApiResponse<IAdminUserDTO>>;
1390
+ }
1391
+
1392
+ interface IBillingAdminClientOptions {
1393
+ baseUrl: string;
1394
+ adminToken: string;
1395
+ prefix?: string;
1396
+ actor?: string;
1397
+ }
1398
+ interface IAdminLedgerQuery {
1399
+ currency?: string;
1400
+ limit?: number;
1401
+ cursor?: string;
1402
+ }
1403
+ declare class BillingAdminClient {
1404
+ private http;
1405
+ private adminToken;
1406
+ private prefix;
1407
+ private actorHeaders;
1408
+ constructor(opts: IBillingAdminClientOptions);
1409
+ private call;
1410
+ private sub;
1411
+ catalog(): Promise<IApiResponse<IAdminCatalog>>;
1412
+ createPlan(input: IAdminPlanInput & {
1413
+ name: string;
1414
+ }): Promise<IApiResponse<IPlanDTO>>;
1415
+ updatePlan(planId: string, input: IAdminPlanInput): Promise<IApiResponse<IPlanDTO>>;
1416
+ deletePlan(planId: string): Promise<IApiResponse<undefined>>;
1417
+ subscription(type: SubscriberType, id: string): Promise<IApiResponse<IAdminSubscriptionDTO>>;
1418
+ wallet(type: SubscriberType, id: string, currency?: string): Promise<IApiResponse<IAdminWalletDTO>>;
1419
+ walletLedger(type: SubscriberType, id: string, query?: IAdminLedgerQuery): Promise<IApiResponse<IAdminWalletLedgerPage>>;
1420
+ grant(input: IAdminGrantInput): Promise<IApiResponse<unknown>>;
1421
+ }
1422
+
1314
1423
  interface ISetTemplateInput {
1315
1424
  text: string;
1316
1425
  subject?: string;
@@ -1342,4 +1451,4 @@ declare class CourierAdminClient {
1342
1451
  rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
1343
1452
  }
1344
1453
 
1345
- 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 };
1454
+ export { AdminClient, type AdminRouteGuard, AuditClient, AuthAdminClient, AuthClient, BillingAdminClient, 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 IAdminCatalog, type IAdminCheckResult, type IAdminClientOptions, type IAdminConfigReport, type IAdminDoctorReport, type IAdminGrantInput, type IAdminLedgerQuery, type IAdminLogEntry, type IAdminLogPage, type IAdminLogQuery, type IAdminLoginHistoryQuery, type IAdminManifest, type IAdminModuleEntry, type IAdminPlanInput, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminSubscriptionDTO, type IAdminTokensReport, type IAdminUserDTO, type IAdminWalletDTO, type IAdminWalletLedgerPage, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditEventDTO, type IAuditPageResult, type IAuthAdminClientOptions, type IBillingAdminClientOptions, 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
@@ -502,6 +502,58 @@ interface IAdminLogPage {
502
502
  entries: IAdminLogEntry[];
503
503
  next: string | null;
504
504
  }
505
+ interface IAdminUserDTO extends IUserDTO {
506
+ deletedAt: string | null;
507
+ }
508
+ interface IAdminCatalog {
509
+ configured: unknown[];
510
+ stored: IPlanDTO[];
511
+ }
512
+ interface IAdminSubscriptionDTO {
513
+ id: string;
514
+ subscriberType: SubscriberType;
515
+ subscriberId: string;
516
+ plan: string;
517
+ interval: string;
518
+ status: string;
519
+ providerCustomerId: string | null;
520
+ providerSubscriptionId: string | null;
521
+ currentPeriodStart: string | null;
522
+ currentPeriodEnd: string | null;
523
+ cancelAtPeriodEnd: boolean;
524
+ trialEndsAt: string | null;
525
+ createdAt: string;
526
+ }
527
+ interface IAdminWalletDTO extends IWalletDTO {
528
+ version: number;
529
+ updatedAt: string | null;
530
+ }
531
+ interface IAdminWalletLedgerPage {
532
+ currency: string;
533
+ entries: IWalletTransactionDTO[];
534
+ nextCursor: string | null;
535
+ }
536
+ interface IAdminPlanInput {
537
+ name?: string;
538
+ description?: string | null;
539
+ tier?: number;
540
+ seats?: number | null;
541
+ trialDays?: number;
542
+ monthlyAmount?: number | null;
543
+ monthlyPriceId?: string | null;
544
+ yearlyAmount?: number | null;
545
+ yearlyPriceId?: string | null;
546
+ features?: unknown;
547
+ metadata?: unknown;
548
+ }
549
+ interface IAdminGrantInput {
550
+ subscriberType: SubscriberType;
551
+ subscriberId: string;
552
+ amount: string | number;
553
+ currency?: string;
554
+ description?: string;
555
+ idempotencyKey: string;
556
+ }
505
557
  interface IConfigEntry {
506
558
  key: string;
507
559
  value: unknown;
@@ -1311,6 +1363,63 @@ declare class AdminClient {
1311
1363
  adminLog(query?: IAdminLogQuery): Promise<IApiResponse<IAdminLogPage>>;
1312
1364
  }
1313
1365
 
1366
+ interface IAuthAdminClientOptions {
1367
+ baseUrl: string;
1368
+ adminToken: string;
1369
+ prefix?: string;
1370
+ actor?: string;
1371
+ }
1372
+ interface IAdminLoginHistoryQuery {
1373
+ limit?: number;
1374
+ cursor?: string;
1375
+ }
1376
+ declare class AuthAdminClient {
1377
+ private http;
1378
+ private adminToken;
1379
+ private prefix;
1380
+ private actorHeaders;
1381
+ constructor(opts: IAuthAdminClientOptions);
1382
+ private call;
1383
+ findUser(email: string): Promise<IApiResponse<IAdminUserDTO>>;
1384
+ getUser(id: string): Promise<IApiResponse<IAdminUserDTO>>;
1385
+ listUserSessions(id: string): Promise<IApiResponse<ISessionDTO[]>>;
1386
+ revokeUserSessions(id: string): Promise<IApiResponse<undefined>>;
1387
+ userLoginHistory(id: string, query?: IAdminLoginHistoryQuery): Promise<IApiResponse<ILoginHistoryPageResult>>;
1388
+ suspendUser(id: string): Promise<IApiResponse<IAdminUserDTO>>;
1389
+ unsuspendUser(id: string): Promise<IApiResponse<IAdminUserDTO>>;
1390
+ }
1391
+
1392
+ interface IBillingAdminClientOptions {
1393
+ baseUrl: string;
1394
+ adminToken: string;
1395
+ prefix?: string;
1396
+ actor?: string;
1397
+ }
1398
+ interface IAdminLedgerQuery {
1399
+ currency?: string;
1400
+ limit?: number;
1401
+ cursor?: string;
1402
+ }
1403
+ declare class BillingAdminClient {
1404
+ private http;
1405
+ private adminToken;
1406
+ private prefix;
1407
+ private actorHeaders;
1408
+ constructor(opts: IBillingAdminClientOptions);
1409
+ private call;
1410
+ private sub;
1411
+ catalog(): Promise<IApiResponse<IAdminCatalog>>;
1412
+ createPlan(input: IAdminPlanInput & {
1413
+ name: string;
1414
+ }): Promise<IApiResponse<IPlanDTO>>;
1415
+ updatePlan(planId: string, input: IAdminPlanInput): Promise<IApiResponse<IPlanDTO>>;
1416
+ deletePlan(planId: string): Promise<IApiResponse<undefined>>;
1417
+ subscription(type: SubscriberType, id: string): Promise<IApiResponse<IAdminSubscriptionDTO>>;
1418
+ wallet(type: SubscriberType, id: string, currency?: string): Promise<IApiResponse<IAdminWalletDTO>>;
1419
+ walletLedger(type: SubscriberType, id: string, query?: IAdminLedgerQuery): Promise<IApiResponse<IAdminWalletLedgerPage>>;
1420
+ grant(input: IAdminGrantInput): Promise<IApiResponse<unknown>>;
1421
+ }
1422
+
1314
1423
  interface ISetTemplateInput {
1315
1424
  text: string;
1316
1425
  subject?: string;
@@ -1342,4 +1451,4 @@ declare class CourierAdminClient {
1342
1451
  rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
1343
1452
  }
1344
1453
 
1345
- 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 };
1454
+ export { AdminClient, type AdminRouteGuard, AuditClient, AuthAdminClient, AuthClient, BillingAdminClient, 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 IAdminCatalog, type IAdminCheckResult, type IAdminClientOptions, type IAdminConfigReport, type IAdminDoctorReport, type IAdminGrantInput, type IAdminLedgerQuery, type IAdminLogEntry, type IAdminLogPage, type IAdminLogQuery, type IAdminLoginHistoryQuery, type IAdminManifest, type IAdminModuleEntry, type IAdminPlanInput, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminSubscriptionDTO, type IAdminTokensReport, type IAdminUserDTO, type IAdminWalletDTO, type IAdminWalletLedgerPage, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditEventDTO, type IAuditPageResult, type IAuthAdminClientOptions, type IBillingAdminClientOptions, 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
@@ -1745,6 +1745,117 @@ var AdminClient = class {
1745
1745
  }
1746
1746
  };
1747
1747
 
1748
+ // src/modules/auth-admin.ts
1749
+ var AuthAdminClient = class {
1750
+ http;
1751
+ adminToken;
1752
+ prefix;
1753
+ actorHeaders;
1754
+ constructor(opts) {
1755
+ this.http = new HttpClient(opts.baseUrl);
1756
+ this.adminToken = opts.adminToken;
1757
+ this.prefix = (opts.prefix ?? "/_admin").replace(/\/+$/, "");
1758
+ this.actorHeaders = opts.actor ? { "X-Actor": opts.actor } : void 0;
1759
+ }
1760
+ call(method, suffix) {
1761
+ return this.http.request({
1762
+ method,
1763
+ path: `${this.prefix}/users${suffix}`,
1764
+ token: this.adminToken,
1765
+ headers: this.actorHeaders
1766
+ });
1767
+ }
1768
+ findUser(email) {
1769
+ return this.call("GET", `?email=${encodeURIComponent(email)}`);
1770
+ }
1771
+ getUser(id) {
1772
+ return this.call("GET", `/${encodeURIComponent(id)}`);
1773
+ }
1774
+ listUserSessions(id) {
1775
+ return this.call("GET", `/${encodeURIComponent(id)}/sessions`);
1776
+ }
1777
+ // Signs the user out everywhere.
1778
+ revokeUserSessions(id) {
1779
+ return this.call("DELETE", `/${encodeURIComponent(id)}/sessions`);
1780
+ }
1781
+ userLoginHistory(id, query = {}) {
1782
+ const q = new URLSearchParams();
1783
+ if (query.limit) q.set("limit", String(query.limit));
1784
+ if (query.cursor) q.set("cursor", query.cursor);
1785
+ const qs = q.toString();
1786
+ return this.call(
1787
+ "GET",
1788
+ `/${encodeURIComponent(id)}/login-history${qs ? `?${qs}` : ""}`
1789
+ );
1790
+ }
1791
+ suspendUser(id) {
1792
+ return this.call("POST", `/${encodeURIComponent(id)}/suspend`);
1793
+ }
1794
+ unsuspendUser(id) {
1795
+ return this.call("POST", `/${encodeURIComponent(id)}/unsuspend`);
1796
+ }
1797
+ };
1798
+
1799
+ // src/modules/billing-admin.ts
1800
+ var BillingAdminClient = class {
1801
+ http;
1802
+ adminToken;
1803
+ prefix;
1804
+ actorHeaders;
1805
+ constructor(opts) {
1806
+ this.http = new HttpClient(opts.baseUrl);
1807
+ this.adminToken = opts.adminToken;
1808
+ this.prefix = (opts.prefix ?? "/_admin").replace(/\/+$/, "");
1809
+ this.actorHeaders = opts.actor ? { "X-Actor": opts.actor } : void 0;
1810
+ }
1811
+ call(method, suffix, body) {
1812
+ return this.http.request({
1813
+ method,
1814
+ path: `${this.prefix}${suffix}`,
1815
+ token: this.adminToken,
1816
+ headers: this.actorHeaders,
1817
+ ...body !== void 0 ? { body } : {}
1818
+ });
1819
+ }
1820
+ sub(type, id) {
1821
+ return `/${type}/${encodeURIComponent(id)}`;
1822
+ }
1823
+ catalog() {
1824
+ return this.call("GET", "/catalog");
1825
+ }
1826
+ createPlan(input) {
1827
+ return this.call("POST", "/plans", input);
1828
+ }
1829
+ updatePlan(planId, input) {
1830
+ return this.call("PUT", `/plans/${encodeURIComponent(planId)}`, input);
1831
+ }
1832
+ deletePlan(planId) {
1833
+ return this.call("DELETE", `/plans/${encodeURIComponent(planId)}`);
1834
+ }
1835
+ subscription(type, id) {
1836
+ return this.call("GET", `/subscriptions${this.sub(type, id)}`);
1837
+ }
1838
+ wallet(type, id, currency) {
1839
+ const qs = currency ? `?currency=${encodeURIComponent(currency)}` : "";
1840
+ return this.call("GET", `/wallet${this.sub(type, id)}${qs}`);
1841
+ }
1842
+ walletLedger(type, id, query = {}) {
1843
+ const q = new URLSearchParams();
1844
+ if (query.currency) q.set("currency", query.currency);
1845
+ if (query.limit) q.set("limit", String(query.limit));
1846
+ if (query.cursor) q.set("cursor", query.cursor);
1847
+ const qs = q.toString();
1848
+ return this.call(
1849
+ "GET",
1850
+ `/wallet${this.sub(type, id)}/ledger${qs ? `?${qs}` : ""}`
1851
+ );
1852
+ }
1853
+ // Manual credit — an idempotency key is required by the server.
1854
+ grant(input) {
1855
+ return this.call("POST", "/wallet/grant", input);
1856
+ }
1857
+ };
1858
+
1748
1859
  // src/modules/courier-admin.ts
1749
1860
  var CourierAdminClient = class {
1750
1861
  http;
@@ -1836,7 +1947,9 @@ function isMfaRequired(result) {
1836
1947
  export {
1837
1948
  AdminClient,
1838
1949
  AuditClient,
1950
+ AuthAdminClient,
1839
1951
  AuthClient,
1952
+ BillingAdminClient,
1840
1953
  BillingClient,
1841
1954
  ConfigAdminClient,
1842
1955
  CourierAdminClient,