@fonderie/client 0.27.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -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 {
@@ -1420,6 +1443,30 @@ declare class BillingAdminClient {
1420
1443
  grant(input: IAdminGrantInput): Promise<IApiResponse<unknown>>;
1421
1444
  }
1422
1445
 
1446
+ interface IAuditAdminClientOptions {
1447
+ baseUrl: string;
1448
+ adminToken: string;
1449
+ prefix?: string;
1450
+ actor?: string;
1451
+ }
1452
+ interface IAdminAuditQuery {
1453
+ workspaceId?: string;
1454
+ type?: string;
1455
+ actorId?: string;
1456
+ from?: Date;
1457
+ to?: Date;
1458
+ limit?: number;
1459
+ cursor?: string;
1460
+ }
1461
+ declare class AuditAdminClient {
1462
+ private http;
1463
+ private adminToken;
1464
+ private prefix;
1465
+ private actorHeaders;
1466
+ constructor(opts: IAuditAdminClientOptions);
1467
+ listAudit(query?: IAdminAuditQuery): Promise<IApiResponse<IAuditPageResult>>;
1468
+ }
1469
+
1423
1470
  interface ISetTemplateInput {
1424
1471
  text: string;
1425
1472
  subject?: string;
@@ -1451,4 +1498,4 @@ declare class CourierAdminClient {
1451
1498
  rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
1452
1499
  }
1453
1500
 
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 };
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 {
@@ -1420,6 +1443,30 @@ declare class BillingAdminClient {
1420
1443
  grant(input: IAdminGrantInput): Promise<IApiResponse<unknown>>;
1421
1444
  }
1422
1445
 
1446
+ interface IAuditAdminClientOptions {
1447
+ baseUrl: string;
1448
+ adminToken: string;
1449
+ prefix?: string;
1450
+ actor?: string;
1451
+ }
1452
+ interface IAdminAuditQuery {
1453
+ workspaceId?: string;
1454
+ type?: string;
1455
+ actorId?: string;
1456
+ from?: Date;
1457
+ to?: Date;
1458
+ limit?: number;
1459
+ cursor?: string;
1460
+ }
1461
+ declare class AuditAdminClient {
1462
+ private http;
1463
+ private adminToken;
1464
+ private prefix;
1465
+ private actorHeaders;
1466
+ constructor(opts: IAuditAdminClientOptions);
1467
+ listAudit(query?: IAdminAuditQuery): Promise<IApiResponse<IAuditPageResult>>;
1468
+ }
1469
+
1423
1470
  interface ISetTemplateInput {
1424
1471
  text: string;
1425
1472
  subject?: string;
@@ -1451,4 +1498,4 @@ declare class CourierAdminClient {
1451
1498
  rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
1452
1499
  }
1453
1500
 
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 };
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
@@ -1711,11 +1711,15 @@ var AdminClient = class {
1711
1711
  this.actorHeaders = opts.actor ? { "X-Actor": opts.actor } : void 0;
1712
1712
  }
1713
1713
  get(suffix) {
1714
+ return this.call("GET", suffix);
1715
+ }
1716
+ call(method, suffix, body) {
1714
1717
  return this.http.request({
1715
- method: "GET",
1718
+ method,
1716
1719
  path: `${this.prefix}${suffix}`,
1717
1720
  token: this.adminToken,
1718
- headers: this.actorHeaders
1721
+ headers: this.actorHeaders,
1722
+ ...body !== void 0 ? { body } : {}
1719
1723
  });
1720
1724
  }
1721
1725
  attention() {
@@ -1743,6 +1747,14 @@ var AdminClient = class {
1743
1747
  const qs = q.toString();
1744
1748
  return this.get(`/activity/admin-log${qs ? `?${qs}` : ""}`);
1745
1749
  }
1750
+ // Root token only. The plaintext comes back once.
1751
+ issueToken(input) {
1752
+ return this.call("POST", "/access/tokens", input);
1753
+ }
1754
+ // Root token only.
1755
+ revokeToken(id) {
1756
+ return this.call("DELETE", `/access/tokens/${encodeURIComponent(id)}`);
1757
+ }
1746
1758
  };
1747
1759
 
1748
1760
  // src/modules/auth-admin.ts
@@ -1856,6 +1868,38 @@ var BillingAdminClient = class {
1856
1868
  }
1857
1869
  };
1858
1870
 
1871
+ // src/modules/audit-admin.ts
1872
+ var AuditAdminClient = class {
1873
+ http;
1874
+ adminToken;
1875
+ prefix;
1876
+ actorHeaders;
1877
+ constructor(opts) {
1878
+ this.http = new HttpClient(opts.baseUrl);
1879
+ this.adminToken = opts.adminToken;
1880
+ this.prefix = (opts.prefix ?? "/_admin").replace(/\/+$/, "");
1881
+ this.actorHeaders = opts.actor ? { "X-Actor": opts.actor } : void 0;
1882
+ }
1883
+ // Every workspace unless one is named. Newest first, keyset-paged.
1884
+ listAudit(query = {}) {
1885
+ const q = new URLSearchParams();
1886
+ if (query.workspaceId) q.set("workspaceId", query.workspaceId);
1887
+ if (query.type) q.set("type", query.type);
1888
+ if (query.actorId) q.set("actorId", query.actorId);
1889
+ if (query.from) q.set("from", query.from.toISOString());
1890
+ if (query.to) q.set("to", query.to.toISOString());
1891
+ if (query.limit) q.set("limit", String(query.limit));
1892
+ if (query.cursor) q.set("cursor", query.cursor);
1893
+ const qs = q.toString();
1894
+ return this.http.request({
1895
+ method: "GET",
1896
+ path: `${this.prefix}/audit${qs ? `?${qs}` : ""}`,
1897
+ token: this.adminToken,
1898
+ headers: this.actorHeaders
1899
+ });
1900
+ }
1901
+ };
1902
+
1859
1903
  // src/modules/courier-admin.ts
1860
1904
  var CourierAdminClient = class {
1861
1905
  http;
@@ -1946,6 +1990,7 @@ function isMfaRequired(result) {
1946
1990
  }
1947
1991
  export {
1948
1992
  AdminClient,
1993
+ AuditAdminClient,
1949
1994
  AuditClient,
1950
1995
  AuthAdminClient,
1951
1996
  AuthClient,