@fonderie/client 0.29.2 → 0.31.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 +59 -0
- package/dist/index.cjs +54 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +58 -1
- package/dist/index.d.ts +58 -1
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -549,6 +549,10 @@ interface IAdminWalletDTO extends IWalletDTO {
|
|
|
549
549
|
version: number;
|
|
550
550
|
updatedAt: string | null;
|
|
551
551
|
}
|
|
552
|
+
interface IAdminSubscriptionPage {
|
|
553
|
+
subscriptions: IAdminSubscriptionDTO[];
|
|
554
|
+
nextCursor: string | null;
|
|
555
|
+
}
|
|
552
556
|
interface IAdminWalletLedgerPage {
|
|
553
557
|
currency: string;
|
|
554
558
|
entries: IWalletTransactionDTO[];
|
|
@@ -633,6 +637,10 @@ interface ILoginEventDTO {
|
|
|
633
637
|
userAgent: string | null;
|
|
634
638
|
createdAt: string;
|
|
635
639
|
}
|
|
640
|
+
interface IAdminUserPageResult {
|
|
641
|
+
users: IAdminUserDTO[];
|
|
642
|
+
nextCursor: string | null;
|
|
643
|
+
}
|
|
636
644
|
interface ILoginHistoryPageResult {
|
|
637
645
|
events: ILoginEventDTO[];
|
|
638
646
|
nextCursor: string | null;
|
|
@@ -841,6 +849,22 @@ interface ICustomerRelationshipResult {
|
|
|
841
849
|
interface ICustomerLabelListResult {
|
|
842
850
|
labels: ICustomerLabelDTO[];
|
|
843
851
|
}
|
|
852
|
+
type MigrationImpact = 'additive' | 'destructive';
|
|
853
|
+
interface IAdminPendingMigration {
|
|
854
|
+
file: string;
|
|
855
|
+
impact: MigrationImpact;
|
|
856
|
+
destructive: string[];
|
|
857
|
+
}
|
|
858
|
+
interface IAdminMigrationModule {
|
|
859
|
+
name: string;
|
|
860
|
+
pending: IAdminPendingMigration[];
|
|
861
|
+
blockedBy: string | null;
|
|
862
|
+
appliable: boolean;
|
|
863
|
+
}
|
|
864
|
+
interface IAdminMigrationsReport {
|
|
865
|
+
everApplied: boolean;
|
|
866
|
+
modules: IAdminMigrationModule[];
|
|
867
|
+
}
|
|
844
868
|
|
|
845
869
|
interface IListAuditEventsInput {
|
|
846
870
|
type?: string;
|
|
@@ -1385,6 +1409,16 @@ declare class AdminClient {
|
|
|
1385
1409
|
adminLog(query?: IAdminLogQuery): Promise<IApiResponse<IAdminLogPage>>;
|
|
1386
1410
|
issueToken(input: IAdminIssueTokenInput): Promise<IApiResponse<IAdminIssuedToken>>;
|
|
1387
1411
|
revokeToken(id: string): Promise<IApiResponse<undefined>>;
|
|
1412
|
+
migrations(): Promise<IApiResponse<IAdminMigrationsReport>>;
|
|
1413
|
+
/**
|
|
1414
|
+
* Apply one module's pending migrations — all of them, or none.
|
|
1415
|
+
*
|
|
1416
|
+
* `expect` is the pending list you were shown, in order. If it no longer
|
|
1417
|
+
* matches, the server refuses with 409 MIGRATIONS_CHANGED rather than
|
|
1418
|
+
* applying something nobody reviewed. Also refuses 409 when an earlier
|
|
1419
|
+
* module is behind, and 422 when any pending file deletes data.
|
|
1420
|
+
*/
|
|
1421
|
+
applyMigrations(module: string, expect: readonly string[]): Promise<IApiResponse<IAdminMigrationModule>>;
|
|
1388
1422
|
}
|
|
1389
1423
|
|
|
1390
1424
|
interface IAuthAdminClientOptions {
|
|
@@ -1397,6 +1431,10 @@ interface IAdminLoginHistoryQuery {
|
|
|
1397
1431
|
limit?: number;
|
|
1398
1432
|
cursor?: string;
|
|
1399
1433
|
}
|
|
1434
|
+
interface IAdminUsersQuery {
|
|
1435
|
+
limit?: number;
|
|
1436
|
+
cursor?: string;
|
|
1437
|
+
}
|
|
1400
1438
|
declare class AuthAdminClient {
|
|
1401
1439
|
private http;
|
|
1402
1440
|
private adminToken;
|
|
@@ -1404,6 +1442,7 @@ declare class AuthAdminClient {
|
|
|
1404
1442
|
private actorHeaders;
|
|
1405
1443
|
constructor(opts: IAuthAdminClientOptions);
|
|
1406
1444
|
private call;
|
|
1445
|
+
listUsers(query?: IAdminUsersQuery): Promise<IApiResponse<IAdminUserPageResult>>;
|
|
1407
1446
|
findUser(email: string): Promise<IApiResponse<IAdminUserDTO>>;
|
|
1408
1447
|
getUser(id: string): Promise<IApiResponse<IAdminUserDTO>>;
|
|
1409
1448
|
listUserSessions(id: string): Promise<IApiResponse<ISessionDTO[]>>;
|
|
@@ -1419,6 +1458,10 @@ interface IBillingAdminClientOptions {
|
|
|
1419
1458
|
prefix?: string;
|
|
1420
1459
|
actor?: string;
|
|
1421
1460
|
}
|
|
1461
|
+
interface IAdminSubscriptionsQuery {
|
|
1462
|
+
limit?: number;
|
|
1463
|
+
cursor?: string;
|
|
1464
|
+
}
|
|
1422
1465
|
interface IAdminLedgerQuery {
|
|
1423
1466
|
currency?: string;
|
|
1424
1467
|
limit?: number;
|
|
@@ -1438,6 +1481,7 @@ declare class BillingAdminClient {
|
|
|
1438
1481
|
}): Promise<IApiResponse<IPlanDTO>>;
|
|
1439
1482
|
updatePlan(planId: string, input: IAdminPlanInput): Promise<IApiResponse<IPlanDTO>>;
|
|
1440
1483
|
deletePlan(planId: string): Promise<IApiResponse<undefined>>;
|
|
1484
|
+
listSubscriptions(query?: IAdminSubscriptionsQuery): Promise<IApiResponse<IAdminSubscriptionPage>>;
|
|
1441
1485
|
subscription(type: SubscriberType, id: string): Promise<IApiResponse<IAdminSubscriptionDTO>>;
|
|
1442
1486
|
wallet(type: SubscriberType, id: string, currency?: string): Promise<IApiResponse<IAdminWalletDTO>>;
|
|
1443
1487
|
walletLedger(type: SubscriberType, id: string, query?: IAdminLedgerQuery): Promise<IApiResponse<IAdminWalletLedgerPage>>;
|
|
@@ -1478,6 +1522,18 @@ interface ISetTemplateInput {
|
|
|
1478
1522
|
interface IRollbackTemplateInput {
|
|
1479
1523
|
toVersion: number;
|
|
1480
1524
|
}
|
|
1525
|
+
interface IPreviewTemplateInput {
|
|
1526
|
+
text: string;
|
|
1527
|
+
subject?: string;
|
|
1528
|
+
html?: string;
|
|
1529
|
+
data?: Record<string, unknown>;
|
|
1530
|
+
}
|
|
1531
|
+
interface IRenderedTemplateResult {
|
|
1532
|
+
subject?: string;
|
|
1533
|
+
html?: string;
|
|
1534
|
+
text: string;
|
|
1535
|
+
variables: string[];
|
|
1536
|
+
}
|
|
1481
1537
|
interface ICourierAdminClientOptions {
|
|
1482
1538
|
baseUrl: string;
|
|
1483
1539
|
adminToken: string;
|
|
@@ -1497,6 +1553,7 @@ declare class CourierAdminClient {
|
|
|
1497
1553
|
deleteTemplate(type: string, locale?: string | null): Promise<IApiResponse<undefined>>;
|
|
1498
1554
|
listRevisions(type: string, locale?: string | null): Promise<IApiResponse<ITemplateRevision[]>>;
|
|
1499
1555
|
rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
|
|
1556
|
+
previewTemplate(type: string, input: IPreviewTemplateInput, locale?: string | null): Promise<IApiResponse<IRenderedTemplateResult>>;
|
|
1500
1557
|
}
|
|
1501
1558
|
|
|
1502
|
-
export { AdminClient, type AdminRouteGuard, type AdminScope, AuditAdminClient, 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 IAdminAuditQuery, type IAdminCatalog, type IAdminCheckResult, type IAdminClientOptions, type IAdminConfigReport, type IAdminDoctorReport, type IAdminGrantInput, type IAdminIssueTokenInput, type IAdminIssuedToken, 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 IAdminTokenRecord, type IAdminTokensReport, type IAdminUserDTO, type IAdminWalletDTO, type IAdminWalletLedgerPage, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditAdminClientOptions, 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 };
|
|
1559
|
+
export { AdminClient, type AdminRouteGuard, type AdminScope, AuditAdminClient, 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 IAdminAuditQuery, type IAdminCatalog, type IAdminCheckResult, type IAdminClientOptions, type IAdminConfigReport, type IAdminDoctorReport, type IAdminGrantInput, type IAdminIssueTokenInput, type IAdminIssuedToken, type IAdminLedgerQuery, type IAdminLogEntry, type IAdminLogPage, type IAdminLogQuery, type IAdminLoginHistoryQuery, type IAdminManifest, type IAdminMigrationModule, type IAdminMigrationsReport, type IAdminModuleEntry, type IAdminPendingMigration, type IAdminPlanInput, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminSubscriptionDTO, type IAdminSubscriptionPage, type IAdminSubscriptionsQuery, type IAdminTokenRecord, type IAdminTokensReport, type IAdminUserDTO, type IAdminUserPageResult, type IAdminUsersQuery, type IAdminWalletDTO, type IAdminWalletLedgerPage, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditAdminClientOptions, 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 IPreviewTemplateInput, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRenderedTemplateResult, 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 MigrationImpact, type SubscriberType, WebhooksClient, WorkspacesClient, createMemoryCache, isMfaRequired };
|
package/dist/index.d.ts
CHANGED
|
@@ -549,6 +549,10 @@ interface IAdminWalletDTO extends IWalletDTO {
|
|
|
549
549
|
version: number;
|
|
550
550
|
updatedAt: string | null;
|
|
551
551
|
}
|
|
552
|
+
interface IAdminSubscriptionPage {
|
|
553
|
+
subscriptions: IAdminSubscriptionDTO[];
|
|
554
|
+
nextCursor: string | null;
|
|
555
|
+
}
|
|
552
556
|
interface IAdminWalletLedgerPage {
|
|
553
557
|
currency: string;
|
|
554
558
|
entries: IWalletTransactionDTO[];
|
|
@@ -633,6 +637,10 @@ interface ILoginEventDTO {
|
|
|
633
637
|
userAgent: string | null;
|
|
634
638
|
createdAt: string;
|
|
635
639
|
}
|
|
640
|
+
interface IAdminUserPageResult {
|
|
641
|
+
users: IAdminUserDTO[];
|
|
642
|
+
nextCursor: string | null;
|
|
643
|
+
}
|
|
636
644
|
interface ILoginHistoryPageResult {
|
|
637
645
|
events: ILoginEventDTO[];
|
|
638
646
|
nextCursor: string | null;
|
|
@@ -841,6 +849,22 @@ interface ICustomerRelationshipResult {
|
|
|
841
849
|
interface ICustomerLabelListResult {
|
|
842
850
|
labels: ICustomerLabelDTO[];
|
|
843
851
|
}
|
|
852
|
+
type MigrationImpact = 'additive' | 'destructive';
|
|
853
|
+
interface IAdminPendingMigration {
|
|
854
|
+
file: string;
|
|
855
|
+
impact: MigrationImpact;
|
|
856
|
+
destructive: string[];
|
|
857
|
+
}
|
|
858
|
+
interface IAdminMigrationModule {
|
|
859
|
+
name: string;
|
|
860
|
+
pending: IAdminPendingMigration[];
|
|
861
|
+
blockedBy: string | null;
|
|
862
|
+
appliable: boolean;
|
|
863
|
+
}
|
|
864
|
+
interface IAdminMigrationsReport {
|
|
865
|
+
everApplied: boolean;
|
|
866
|
+
modules: IAdminMigrationModule[];
|
|
867
|
+
}
|
|
844
868
|
|
|
845
869
|
interface IListAuditEventsInput {
|
|
846
870
|
type?: string;
|
|
@@ -1385,6 +1409,16 @@ declare class AdminClient {
|
|
|
1385
1409
|
adminLog(query?: IAdminLogQuery): Promise<IApiResponse<IAdminLogPage>>;
|
|
1386
1410
|
issueToken(input: IAdminIssueTokenInput): Promise<IApiResponse<IAdminIssuedToken>>;
|
|
1387
1411
|
revokeToken(id: string): Promise<IApiResponse<undefined>>;
|
|
1412
|
+
migrations(): Promise<IApiResponse<IAdminMigrationsReport>>;
|
|
1413
|
+
/**
|
|
1414
|
+
* Apply one module's pending migrations — all of them, or none.
|
|
1415
|
+
*
|
|
1416
|
+
* `expect` is the pending list you were shown, in order. If it no longer
|
|
1417
|
+
* matches, the server refuses with 409 MIGRATIONS_CHANGED rather than
|
|
1418
|
+
* applying something nobody reviewed. Also refuses 409 when an earlier
|
|
1419
|
+
* module is behind, and 422 when any pending file deletes data.
|
|
1420
|
+
*/
|
|
1421
|
+
applyMigrations(module: string, expect: readonly string[]): Promise<IApiResponse<IAdminMigrationModule>>;
|
|
1388
1422
|
}
|
|
1389
1423
|
|
|
1390
1424
|
interface IAuthAdminClientOptions {
|
|
@@ -1397,6 +1431,10 @@ interface IAdminLoginHistoryQuery {
|
|
|
1397
1431
|
limit?: number;
|
|
1398
1432
|
cursor?: string;
|
|
1399
1433
|
}
|
|
1434
|
+
interface IAdminUsersQuery {
|
|
1435
|
+
limit?: number;
|
|
1436
|
+
cursor?: string;
|
|
1437
|
+
}
|
|
1400
1438
|
declare class AuthAdminClient {
|
|
1401
1439
|
private http;
|
|
1402
1440
|
private adminToken;
|
|
@@ -1404,6 +1442,7 @@ declare class AuthAdminClient {
|
|
|
1404
1442
|
private actorHeaders;
|
|
1405
1443
|
constructor(opts: IAuthAdminClientOptions);
|
|
1406
1444
|
private call;
|
|
1445
|
+
listUsers(query?: IAdminUsersQuery): Promise<IApiResponse<IAdminUserPageResult>>;
|
|
1407
1446
|
findUser(email: string): Promise<IApiResponse<IAdminUserDTO>>;
|
|
1408
1447
|
getUser(id: string): Promise<IApiResponse<IAdminUserDTO>>;
|
|
1409
1448
|
listUserSessions(id: string): Promise<IApiResponse<ISessionDTO[]>>;
|
|
@@ -1419,6 +1458,10 @@ interface IBillingAdminClientOptions {
|
|
|
1419
1458
|
prefix?: string;
|
|
1420
1459
|
actor?: string;
|
|
1421
1460
|
}
|
|
1461
|
+
interface IAdminSubscriptionsQuery {
|
|
1462
|
+
limit?: number;
|
|
1463
|
+
cursor?: string;
|
|
1464
|
+
}
|
|
1422
1465
|
interface IAdminLedgerQuery {
|
|
1423
1466
|
currency?: string;
|
|
1424
1467
|
limit?: number;
|
|
@@ -1438,6 +1481,7 @@ declare class BillingAdminClient {
|
|
|
1438
1481
|
}): Promise<IApiResponse<IPlanDTO>>;
|
|
1439
1482
|
updatePlan(planId: string, input: IAdminPlanInput): Promise<IApiResponse<IPlanDTO>>;
|
|
1440
1483
|
deletePlan(planId: string): Promise<IApiResponse<undefined>>;
|
|
1484
|
+
listSubscriptions(query?: IAdminSubscriptionsQuery): Promise<IApiResponse<IAdminSubscriptionPage>>;
|
|
1441
1485
|
subscription(type: SubscriberType, id: string): Promise<IApiResponse<IAdminSubscriptionDTO>>;
|
|
1442
1486
|
wallet(type: SubscriberType, id: string, currency?: string): Promise<IApiResponse<IAdminWalletDTO>>;
|
|
1443
1487
|
walletLedger(type: SubscriberType, id: string, query?: IAdminLedgerQuery): Promise<IApiResponse<IAdminWalletLedgerPage>>;
|
|
@@ -1478,6 +1522,18 @@ interface ISetTemplateInput {
|
|
|
1478
1522
|
interface IRollbackTemplateInput {
|
|
1479
1523
|
toVersion: number;
|
|
1480
1524
|
}
|
|
1525
|
+
interface IPreviewTemplateInput {
|
|
1526
|
+
text: string;
|
|
1527
|
+
subject?: string;
|
|
1528
|
+
html?: string;
|
|
1529
|
+
data?: Record<string, unknown>;
|
|
1530
|
+
}
|
|
1531
|
+
interface IRenderedTemplateResult {
|
|
1532
|
+
subject?: string;
|
|
1533
|
+
html?: string;
|
|
1534
|
+
text: string;
|
|
1535
|
+
variables: string[];
|
|
1536
|
+
}
|
|
1481
1537
|
interface ICourierAdminClientOptions {
|
|
1482
1538
|
baseUrl: string;
|
|
1483
1539
|
adminToken: string;
|
|
@@ -1497,6 +1553,7 @@ declare class CourierAdminClient {
|
|
|
1497
1553
|
deleteTemplate(type: string, locale?: string | null): Promise<IApiResponse<undefined>>;
|
|
1498
1554
|
listRevisions(type: string, locale?: string | null): Promise<IApiResponse<ITemplateRevision[]>>;
|
|
1499
1555
|
rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
|
|
1556
|
+
previewTemplate(type: string, input: IPreviewTemplateInput, locale?: string | null): Promise<IApiResponse<IRenderedTemplateResult>>;
|
|
1500
1557
|
}
|
|
1501
1558
|
|
|
1502
|
-
export { AdminClient, type AdminRouteGuard, type AdminScope, AuditAdminClient, 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 IAdminAuditQuery, type IAdminCatalog, type IAdminCheckResult, type IAdminClientOptions, type IAdminConfigReport, type IAdminDoctorReport, type IAdminGrantInput, type IAdminIssueTokenInput, type IAdminIssuedToken, 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 IAdminTokenRecord, type IAdminTokensReport, type IAdminUserDTO, type IAdminWalletDTO, type IAdminWalletLedgerPage, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditAdminClientOptions, 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 };
|
|
1559
|
+
export { AdminClient, type AdminRouteGuard, type AdminScope, AuditAdminClient, 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 IAdminAuditQuery, type IAdminCatalog, type IAdminCheckResult, type IAdminClientOptions, type IAdminConfigReport, type IAdminDoctorReport, type IAdminGrantInput, type IAdminIssueTokenInput, type IAdminIssuedToken, type IAdminLedgerQuery, type IAdminLogEntry, type IAdminLogPage, type IAdminLogQuery, type IAdminLoginHistoryQuery, type IAdminManifest, type IAdminMigrationModule, type IAdminMigrationsReport, type IAdminModuleEntry, type IAdminPendingMigration, type IAdminPlanInput, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminSubscriptionDTO, type IAdminSubscriptionPage, type IAdminSubscriptionsQuery, type IAdminTokenRecord, type IAdminTokensReport, type IAdminUserDTO, type IAdminUserPageResult, type IAdminUsersQuery, type IAdminWalletDTO, type IAdminWalletLedgerPage, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditAdminClientOptions, 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 IPreviewTemplateInput, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRenderedTemplateResult, 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 MigrationImpact, type SubscriberType, WebhooksClient, WorkspacesClient, createMemoryCache, isMfaRequired };
|
package/dist/index.js
CHANGED
|
@@ -1786,6 +1786,26 @@ var AdminClient = class {
|
|
|
1786
1786
|
revokeToken(id) {
|
|
1787
1787
|
return this.call("DELETE", `/access/tokens/${encodeURIComponent(id)}`);
|
|
1788
1788
|
}
|
|
1789
|
+
// What each module is waiting on, with every pending file's impact. Empty
|
|
1790
|
+
// when the deployment did not hand its migration sequence to the surface.
|
|
1791
|
+
migrations() {
|
|
1792
|
+
return this.get("/migrations");
|
|
1793
|
+
}
|
|
1794
|
+
/**
|
|
1795
|
+
* Apply one module's pending migrations — all of them, or none.
|
|
1796
|
+
*
|
|
1797
|
+
* `expect` is the pending list you were shown, in order. If it no longer
|
|
1798
|
+
* matches, the server refuses with 409 MIGRATIONS_CHANGED rather than
|
|
1799
|
+
* applying something nobody reviewed. Also refuses 409 when an earlier
|
|
1800
|
+
* module is behind, and 422 when any pending file deletes data.
|
|
1801
|
+
*/
|
|
1802
|
+
applyMigrations(module, expect) {
|
|
1803
|
+
return this.call(
|
|
1804
|
+
"POST",
|
|
1805
|
+
`/migrations/${encodeURIComponent(module)}/apply`,
|
|
1806
|
+
{ expect }
|
|
1807
|
+
);
|
|
1808
|
+
}
|
|
1789
1809
|
};
|
|
1790
1810
|
|
|
1791
1811
|
// src/modules/auth-admin.ts
|
|
@@ -1808,6 +1828,15 @@ var AuthAdminClient = class {
|
|
|
1808
1828
|
headers: this.actorHeaders
|
|
1809
1829
|
});
|
|
1810
1830
|
}
|
|
1831
|
+
// A page of users, newest first. The same route as findUser — with an email
|
|
1832
|
+
// it looks one up, without one it lists.
|
|
1833
|
+
listUsers(query = {}) {
|
|
1834
|
+
const q = new URLSearchParams();
|
|
1835
|
+
if (query.limit) q.set("limit", String(query.limit));
|
|
1836
|
+
if (query.cursor) q.set("cursor", query.cursor);
|
|
1837
|
+
const qs = q.toString();
|
|
1838
|
+
return this.call("GET", qs ? `?${qs}` : "");
|
|
1839
|
+
}
|
|
1811
1840
|
findUser(email) {
|
|
1812
1841
|
return this.call("GET", `?email=${encodeURIComponent(email)}`);
|
|
1813
1842
|
}
|
|
@@ -1875,6 +1904,15 @@ var BillingAdminClient = class {
|
|
|
1875
1904
|
deletePlan(planId) {
|
|
1876
1905
|
return this.call("DELETE", `/plans/${encodeURIComponent(planId)}`);
|
|
1877
1906
|
}
|
|
1907
|
+
// A page of subscribers, newest first. The lookup below still answers for a
|
|
1908
|
+
// known subscriber; this is for finding one you cannot name.
|
|
1909
|
+
listSubscriptions(query = {}) {
|
|
1910
|
+
const q = new URLSearchParams();
|
|
1911
|
+
if (query.limit) q.set("limit", String(query.limit));
|
|
1912
|
+
if (query.cursor) q.set("cursor", query.cursor);
|
|
1913
|
+
const qs = q.toString();
|
|
1914
|
+
return this.call("GET", `/subscriptions${qs ? `?${qs}` : ""}`);
|
|
1915
|
+
}
|
|
1878
1916
|
subscription(type, id) {
|
|
1879
1917
|
return this.call("GET", `/subscriptions${this.sub(type, id)}`);
|
|
1880
1918
|
}
|
|
@@ -2013,6 +2051,22 @@ var CourierAdminClient = class {
|
|
|
2013
2051
|
})
|
|
2014
2052
|
);
|
|
2015
2053
|
}
|
|
2054
|
+
// Renders content you are HOLDING, not what is stored — so an editor can
|
|
2055
|
+
// show the change before it is saved. Server-side on purpose: the shell and
|
|
2056
|
+
// the variable substitution are the resolver's, and a preview rendered any
|
|
2057
|
+
// other way would not be the mail that sends.
|
|
2058
|
+
previewTemplate(type, input, locale) {
|
|
2059
|
+
const q = locale ? `?locale=${encodeURIComponent(locale)}` : "";
|
|
2060
|
+
return this.http.request(
|
|
2061
|
+
this.rebase({
|
|
2062
|
+
method: "POST",
|
|
2063
|
+
path: `/admin/templates/${encodeURIComponent(type)}/preview${q}`,
|
|
2064
|
+
body: input,
|
|
2065
|
+
token: this.adminToken,
|
|
2066
|
+
headers: this.actorHeaders
|
|
2067
|
+
})
|
|
2068
|
+
);
|
|
2069
|
+
}
|
|
2016
2070
|
};
|
|
2017
2071
|
|
|
2018
2072
|
// src/types.ts
|