@fonderie/client 0.26.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/brain/signatures.md +78 -0
- package/dist/index.cjs +62 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +81 -1
- package/dist/index.d.ts +81 -1
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -505,6 +505,55 @@ interface IAdminLogPage {
|
|
|
505
505
|
interface IAdminUserDTO extends IUserDTO {
|
|
506
506
|
deletedAt: string | null;
|
|
507
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
|
+
}
|
|
508
557
|
interface IConfigEntry {
|
|
509
558
|
key: string;
|
|
510
559
|
value: unknown;
|
|
@@ -1340,6 +1389,37 @@ declare class AuthAdminClient {
|
|
|
1340
1389
|
unsuspendUser(id: string): Promise<IApiResponse<IAdminUserDTO>>;
|
|
1341
1390
|
}
|
|
1342
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
|
+
|
|
1343
1423
|
interface ISetTemplateInput {
|
|
1344
1424
|
text: string;
|
|
1345
1425
|
subject?: string;
|
|
@@ -1371,4 +1451,4 @@ declare class CourierAdminClient {
|
|
|
1371
1451
|
rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
|
|
1372
1452
|
}
|
|
1373
1453
|
|
|
1374
|
-
export { AdminClient, type AdminRouteGuard, AuditClient, AuthAdminClient, 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 IAdminLoginHistoryQuery, type IAdminManifest, type IAdminModuleEntry, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminTokensReport, type IAdminUserDTO, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditEventDTO, type IAuditPageResult, type IAuthAdminClientOptions, 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
|
@@ -505,6 +505,55 @@ interface IAdminLogPage {
|
|
|
505
505
|
interface IAdminUserDTO extends IUserDTO {
|
|
506
506
|
deletedAt: string | null;
|
|
507
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
|
+
}
|
|
508
557
|
interface IConfigEntry {
|
|
509
558
|
key: string;
|
|
510
559
|
value: unknown;
|
|
@@ -1340,6 +1389,37 @@ declare class AuthAdminClient {
|
|
|
1340
1389
|
unsuspendUser(id: string): Promise<IApiResponse<IAdminUserDTO>>;
|
|
1341
1390
|
}
|
|
1342
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
|
+
|
|
1343
1423
|
interface ISetTemplateInput {
|
|
1344
1424
|
text: string;
|
|
1345
1425
|
subject?: string;
|
|
@@ -1371,4 +1451,4 @@ declare class CourierAdminClient {
|
|
|
1371
1451
|
rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
|
|
1372
1452
|
}
|
|
1373
1453
|
|
|
1374
|
-
export { AdminClient, type AdminRouteGuard, AuditClient, AuthAdminClient, 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 IAdminLoginHistoryQuery, type IAdminManifest, type IAdminModuleEntry, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminTokensReport, type IAdminUserDTO, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditEventDTO, type IAuditPageResult, type IAuthAdminClientOptions, 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
|
@@ -1796,6 +1796,66 @@ var AuthAdminClient = class {
|
|
|
1796
1796
|
}
|
|
1797
1797
|
};
|
|
1798
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
|
+
|
|
1799
1859
|
// src/modules/courier-admin.ts
|
|
1800
1860
|
var CourierAdminClient = class {
|
|
1801
1861
|
http;
|
|
@@ -1889,6 +1949,7 @@ export {
|
|
|
1889
1949
|
AuditClient,
|
|
1890
1950
|
AuthAdminClient,
|
|
1891
1951
|
AuthClient,
|
|
1952
|
+
BillingAdminClient,
|
|
1892
1953
|
BillingClient,
|
|
1893
1954
|
ConfigAdminClient,
|
|
1894
1955
|
CourierAdminClient,
|