@fonderie/client 0.28.0 → 0.29.1

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
@@ -474,6 +474,17 @@ interface IAdminRoutesReport {
474
474
  guard: AdminRouteGuard;
475
475
  }>;
476
476
  }
477
+ type AdminScope = 'read' | 'write' | 'secrets';
478
+ interface IAdminTokenRecord {
479
+ id: string;
480
+ name: string;
481
+ scopes: AdminScope[];
482
+ createdBy: string;
483
+ createdAt: string;
484
+ expiresAt: string | null;
485
+ revokedAt: string | null;
486
+ lastUsedAt: string | null;
487
+ }
477
488
  interface IAdminTokensReport {
478
489
  generatedAt: string;
479
490
  admin: {
@@ -484,6 +495,15 @@ interface IAdminTokensReport {
484
495
  module: string;
485
496
  set: boolean;
486
497
  }>;
498
+ issued: IAdminTokenRecord[] | null;
499
+ }
500
+ interface IAdminIssueTokenInput {
501
+ name: string;
502
+ scopes: AdminScope[];
503
+ expiresInDays?: number;
504
+ }
505
+ interface IAdminIssuedToken extends IAdminTokenRecord {
506
+ token: string;
487
507
  }
488
508
  interface IAdminLogEntry {
489
509
  id: string;
@@ -1354,6 +1374,7 @@ declare class AdminClient {
1354
1374
  private actorHeaders;
1355
1375
  constructor(opts: IAdminClientOptions);
1356
1376
  private get;
1377
+ private call;
1357
1378
  attention(): Promise<IApiResponse<IAdminAttention>>;
1358
1379
  manifest(): Promise<IApiResponse<IAdminManifest>>;
1359
1380
  doctor(): Promise<IApiResponse<IAdminDoctorReport>>;
@@ -1361,6 +1382,8 @@ declare class AdminClient {
1361
1382
  routes(): Promise<IApiResponse<IAdminRoutesReport>>;
1362
1383
  tokens(): Promise<IApiResponse<IAdminTokensReport>>;
1363
1384
  adminLog(query?: IAdminLogQuery): Promise<IApiResponse<IAdminLogPage>>;
1385
+ issueToken(input: IAdminIssueTokenInput): Promise<IApiResponse<IAdminIssuedToken>>;
1386
+ revokeToken(id: string): Promise<IApiResponse<undefined>>;
1364
1387
  }
1365
1388
 
1366
1389
  interface IAuthAdminClientOptions {
@@ -1475,4 +1498,4 @@ declare class CourierAdminClient {
1475
1498
  rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
1476
1499
  }
1477
1500
 
1478
- export { AdminClient, type AdminRouteGuard, 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 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 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 };
1501
+ 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 };
package/dist/index.d.ts CHANGED
@@ -474,6 +474,17 @@ interface IAdminRoutesReport {
474
474
  guard: AdminRouteGuard;
475
475
  }>;
476
476
  }
477
+ type AdminScope = 'read' | 'write' | 'secrets';
478
+ interface IAdminTokenRecord {
479
+ id: string;
480
+ name: string;
481
+ scopes: AdminScope[];
482
+ createdBy: string;
483
+ createdAt: string;
484
+ expiresAt: string | null;
485
+ revokedAt: string | null;
486
+ lastUsedAt: string | null;
487
+ }
477
488
  interface IAdminTokensReport {
478
489
  generatedAt: string;
479
490
  admin: {
@@ -484,6 +495,15 @@ interface IAdminTokensReport {
484
495
  module: string;
485
496
  set: boolean;
486
497
  }>;
498
+ issued: IAdminTokenRecord[] | null;
499
+ }
500
+ interface IAdminIssueTokenInput {
501
+ name: string;
502
+ scopes: AdminScope[];
503
+ expiresInDays?: number;
504
+ }
505
+ interface IAdminIssuedToken extends IAdminTokenRecord {
506
+ token: string;
487
507
  }
488
508
  interface IAdminLogEntry {
489
509
  id: string;
@@ -1354,6 +1374,7 @@ declare class AdminClient {
1354
1374
  private actorHeaders;
1355
1375
  constructor(opts: IAdminClientOptions);
1356
1376
  private get;
1377
+ private call;
1357
1378
  attention(): Promise<IApiResponse<IAdminAttention>>;
1358
1379
  manifest(): Promise<IApiResponse<IAdminManifest>>;
1359
1380
  doctor(): Promise<IApiResponse<IAdminDoctorReport>>;
@@ -1361,6 +1382,8 @@ declare class AdminClient {
1361
1382
  routes(): Promise<IApiResponse<IAdminRoutesReport>>;
1362
1383
  tokens(): Promise<IApiResponse<IAdminTokensReport>>;
1363
1384
  adminLog(query?: IAdminLogQuery): Promise<IApiResponse<IAdminLogPage>>;
1385
+ issueToken(input: IAdminIssueTokenInput): Promise<IApiResponse<IAdminIssuedToken>>;
1386
+ revokeToken(id: string): Promise<IApiResponse<undefined>>;
1364
1387
  }
1365
1388
 
1366
1389
  interface IAuthAdminClientOptions {
@@ -1475,4 +1498,4 @@ declare class CourierAdminClient {
1475
1498
  rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
1476
1499
  }
1477
1500
 
1478
- export { AdminClient, type AdminRouteGuard, 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 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 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 };
1501
+ 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 };
package/dist/index.js CHANGED
@@ -128,7 +128,8 @@ var HttpClient = class {
128
128
  if (newToken) return this.exec({ ...opts, token: newToken }, true);
129
129
  }
130
130
  if (res.status === 204) {
131
- if (!res.ok) throw new FonderieApiError("unknown", res.statusText, res.status, void 0, rid);
131
+ if (!res.ok)
132
+ throw new FonderieApiError("unknown", res.statusText, res.status, void 0, rid);
132
133
  return void 0;
133
134
  }
134
135
  const data = await res.json();
@@ -1531,19 +1532,49 @@ var FonderieClient = class {
1531
1532
  });
1532
1533
  }
1533
1534
  post(path, body, config) {
1534
- return this.request({ method: "POST", path, body, token: config?.token, workspaceId: config?.workspaceId, invalidate: config?.invalidate });
1535
+ return this.request({
1536
+ method: "POST",
1537
+ path,
1538
+ body,
1539
+ token: config?.token,
1540
+ workspaceId: config?.workspaceId,
1541
+ invalidate: config?.invalidate
1542
+ });
1535
1543
  }
1536
1544
  put(path, body, config) {
1537
- return this.request({ method: "PUT", path, body, token: config?.token, workspaceId: config?.workspaceId, invalidate: config?.invalidate });
1545
+ return this.request({
1546
+ method: "PUT",
1547
+ path,
1548
+ body,
1549
+ token: config?.token,
1550
+ workspaceId: config?.workspaceId,
1551
+ invalidate: config?.invalidate
1552
+ });
1538
1553
  }
1539
1554
  patch(path, body, config) {
1540
- return this.request({ method: "PATCH", path, body, token: config?.token, workspaceId: config?.workspaceId, invalidate: config?.invalidate });
1555
+ return this.request({
1556
+ method: "PATCH",
1557
+ path,
1558
+ body,
1559
+ token: config?.token,
1560
+ workspaceId: config?.workspaceId,
1561
+ invalidate: config?.invalidate
1562
+ });
1541
1563
  }
1542
1564
  delete(path, config) {
1543
- return this.request({ method: "DELETE", path, token: config?.token, workspaceId: config?.workspaceId, invalidate: config?.invalidate });
1565
+ return this.request({
1566
+ method: "DELETE",
1567
+ path,
1568
+ token: config?.token,
1569
+ workspaceId: config?.workspaceId,
1570
+ invalidate: config?.invalidate
1571
+ });
1544
1572
  }
1545
1573
  };
1546
1574
 
1575
+ // src/path.ts
1576
+ var normalizeMountPath = (path) => path.replace(/\/+$/, "");
1577
+
1547
1578
  // src/modules/config-admin.ts
1548
1579
  function envQuery(environment) {
1549
1580
  return environment ? `?environment=${encodeURIComponent(environment)}` : "";
@@ -1556,7 +1587,7 @@ var ConfigAdminClient = class {
1556
1587
  constructor(opts) {
1557
1588
  this.http = new HttpClient(opts.baseUrl);
1558
1589
  this.adminToken = opts.adminToken;
1559
- this.prefix = opts.prefix?.replace(/\/+$/, "");
1590
+ this.prefix = opts.prefix ? normalizeMountPath(opts.prefix) : void 0;
1560
1591
  this.actorHeaders = opts.actor ? { "X-Actor": opts.actor } : void 0;
1561
1592
  }
1562
1593
  // The path literals stay on the legacy '/admin/...' so the route table and
@@ -1707,15 +1738,19 @@ var AdminClient = class {
1707
1738
  constructor(opts) {
1708
1739
  this.http = new HttpClient(opts.baseUrl);
1709
1740
  this.adminToken = opts.adminToken;
1710
- this.prefix = (opts.prefix ?? "/_admin").replace(/\/+$/, "");
1741
+ this.prefix = normalizeMountPath(opts.prefix ?? "/_admin");
1711
1742
  this.actorHeaders = opts.actor ? { "X-Actor": opts.actor } : void 0;
1712
1743
  }
1713
1744
  get(suffix) {
1745
+ return this.call("GET", suffix);
1746
+ }
1747
+ call(method, suffix, body) {
1714
1748
  return this.http.request({
1715
- method: "GET",
1749
+ method,
1716
1750
  path: `${this.prefix}${suffix}`,
1717
1751
  token: this.adminToken,
1718
- headers: this.actorHeaders
1752
+ headers: this.actorHeaders,
1753
+ ...body !== void 0 ? { body } : {}
1719
1754
  });
1720
1755
  }
1721
1756
  attention() {
@@ -1743,6 +1778,14 @@ var AdminClient = class {
1743
1778
  const qs = q.toString();
1744
1779
  return this.get(`/activity/admin-log${qs ? `?${qs}` : ""}`);
1745
1780
  }
1781
+ // Root token only. The plaintext comes back once.
1782
+ issueToken(input) {
1783
+ return this.call("POST", "/access/tokens", input);
1784
+ }
1785
+ // Root token only.
1786
+ revokeToken(id) {
1787
+ return this.call("DELETE", `/access/tokens/${encodeURIComponent(id)}`);
1788
+ }
1746
1789
  };
1747
1790
 
1748
1791
  // src/modules/auth-admin.ts
@@ -1754,7 +1797,7 @@ var AuthAdminClient = class {
1754
1797
  constructor(opts) {
1755
1798
  this.http = new HttpClient(opts.baseUrl);
1756
1799
  this.adminToken = opts.adminToken;
1757
- this.prefix = (opts.prefix ?? "/_admin").replace(/\/+$/, "");
1800
+ this.prefix = normalizeMountPath(opts.prefix ?? "/_admin");
1758
1801
  this.actorHeaders = opts.actor ? { "X-Actor": opts.actor } : void 0;
1759
1802
  }
1760
1803
  call(method, suffix) {
@@ -1805,7 +1848,7 @@ var BillingAdminClient = class {
1805
1848
  constructor(opts) {
1806
1849
  this.http = new HttpClient(opts.baseUrl);
1807
1850
  this.adminToken = opts.adminToken;
1808
- this.prefix = (opts.prefix ?? "/_admin").replace(/\/+$/, "");
1851
+ this.prefix = normalizeMountPath(opts.prefix ?? "/_admin");
1809
1852
  this.actorHeaders = opts.actor ? { "X-Actor": opts.actor } : void 0;
1810
1853
  }
1811
1854
  call(method, suffix, body) {
@@ -1865,7 +1908,7 @@ var AuditAdminClient = class {
1865
1908
  constructor(opts) {
1866
1909
  this.http = new HttpClient(opts.baseUrl);
1867
1910
  this.adminToken = opts.adminToken;
1868
- this.prefix = (opts.prefix ?? "/_admin").replace(/\/+$/, "");
1911
+ this.prefix = normalizeMountPath(opts.prefix ?? "/_admin");
1869
1912
  this.actorHeaders = opts.actor ? { "X-Actor": opts.actor } : void 0;
1870
1913
  }
1871
1914
  // Every workspace unless one is named. Newest first, keyset-paged.
@@ -1897,7 +1940,7 @@ var CourierAdminClient = class {
1897
1940
  constructor(opts) {
1898
1941
  this.http = new HttpClient(opts.baseUrl);
1899
1942
  this.adminToken = opts.adminToken;
1900
- this.prefix = opts.prefix?.replace(/\/+$/, "");
1943
+ this.prefix = opts.prefix ? normalizeMountPath(opts.prefix) : void 0;
1901
1944
  this.actorHeaders = opts.actor ? { "X-Actor": opts.actor } : void 0;
1902
1945
  }
1903
1946
  // The path literals stay on the legacy '/admin/...' so the route table and