@fonderie/client 1.10.0 → 1.11.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 +11 -0
- package/dist/index.cjs +42 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +39 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1724,6 +1724,25 @@ declare class CourierAdminClient {
|
|
|
1724
1724
|
previewTemplate(type: string, input: IPreviewTemplateInput, locale?: string | null): Promise<IApiResponse<IRenderedTemplateResult>>;
|
|
1725
1725
|
}
|
|
1726
1726
|
|
|
1727
|
+
/** One email and every locale it exists in. */
|
|
1728
|
+
interface ITemplateGroup {
|
|
1729
|
+
type: string;
|
|
1730
|
+
/** Default locale (null) first, then the rest alphabetically. */
|
|
1731
|
+
entries: ITemplateEntry[];
|
|
1732
|
+
/** The entry a click on the email itself should open: the default, else the first. */
|
|
1733
|
+
primary: ITemplateEntry;
|
|
1734
|
+
/** Built-in email (its default-locale row can never be deleted). */
|
|
1735
|
+
system: boolean;
|
|
1736
|
+
}
|
|
1737
|
+
/** Rows grouped by type, types in the order the server listed them. */
|
|
1738
|
+
declare function groupTemplatesByType(rows: readonly ITemplateEntry[]): ITemplateGroup[];
|
|
1739
|
+
/**
|
|
1740
|
+
* Locales the app already uses elsewhere that `type` has no version in yet —
|
|
1741
|
+
* what "Add locale" should suggest first. A French welcome email with no French
|
|
1742
|
+
* receipt is exactly the gap an operator is looking for.
|
|
1743
|
+
*/
|
|
1744
|
+
declare function missingTemplateLocales(rows: readonly ITemplateEntry[], type: string): string[];
|
|
1745
|
+
|
|
1727
1746
|
type ConfigValueType = 'string' | 'number' | 'boolean' | 'json';
|
|
1728
1747
|
declare const CONFIG_VALUE_TYPES: readonly ConfigValueType[];
|
|
1729
1748
|
/** The editor type for a stored value. Objects, arrays and null are JSON. */
|
|
@@ -2353,6 +2372,7 @@ declare const en: {
|
|
|
2353
2372
|
};
|
|
2354
2373
|
templates: {
|
|
2355
2374
|
defaultLocale: string;
|
|
2375
|
+
defaultChip: string;
|
|
2356
2376
|
builtInBadge: string;
|
|
2357
2377
|
subject: string;
|
|
2358
2378
|
htmlBody: string;
|
|
@@ -2362,9 +2382,12 @@ declare const en: {
|
|
|
2362
2382
|
newTemplate: string;
|
|
2363
2383
|
hint: string;
|
|
2364
2384
|
loading: string;
|
|
2385
|
+
openLocale: string;
|
|
2365
2386
|
};
|
|
2366
2387
|
editor: {
|
|
2367
2388
|
loading: string;
|
|
2389
|
+
locales: string;
|
|
2390
|
+
discardChanges: string;
|
|
2368
2391
|
addLocale: string;
|
|
2369
2392
|
builtInNote: string;
|
|
2370
2393
|
active: string;
|
|
@@ -2438,4 +2461,4 @@ type AdminT = ReturnType<typeof createAdminT>;
|
|
|
2438
2461
|
/** Dates in the console's language: 'date', 'datetime' or 'time'. */
|
|
2439
2462
|
declare function formatAdminDate(value: string | number | Date, locale?: AdminLocale | undefined, style?: 'date' | 'datetime' | 'time'): string;
|
|
2440
2463
|
|
|
2441
|
-
export { ADMIN_LOCALES, AdminClient, type AdminLocale, type AdminMessageKey, type AdminMessageParams, type AdminMessages, type AdminRouteGuard, type AdminScope, type AdminSessionState, type AdminT, AuditAdminClient, AuditClient, AuthAdminClient, AuthClient, BillingAdminClient, BillingClient, CONFIG_KEY_PATTERN, CONFIG_VALUE_TYPES, type CastResult, ConfigAdminClient, ConfigClient, type ConfigValueType, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, DEFAULT_ADMIN_LOCALE, 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 IAdminCreatedLink, type IAdminDoctorReport, type IAdminEnrollment, type IAdminEnvironmentReport, 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 IAdminOperator, type IAdminOperatorLink, type IAdminOperatorsReport, type IAdminPendingMigration, type IAdminPlanInput, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminSecondFactor, type IAdminSession, 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 IInferredConfigValue, 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 IRemoteConfigState, type IRenderedTemplateResult, type IRequestConfig, type IRequestLocationDTO, 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, type LocaleMap, MediaClient, type MigrationImpact, type SubscriberType, WebhooksClient, WorkspacesClient, adminLocaleNames, adminLocaleTags, castConfigValue, configKeyProblem, configValueLabel, configValueType, createAdminT, createMemoryCache, describeLocation, detectAdminLocale, formatAdminDate, formatConfigValue, inferConfigValue, isAdminLocale, isMfaRequired };
|
|
2464
|
+
export { ADMIN_LOCALES, AdminClient, type AdminLocale, type AdminMessageKey, type AdminMessageParams, type AdminMessages, type AdminRouteGuard, type AdminScope, type AdminSessionState, type AdminT, AuditAdminClient, AuditClient, AuthAdminClient, AuthClient, BillingAdminClient, BillingClient, CONFIG_KEY_PATTERN, CONFIG_VALUE_TYPES, type CastResult, ConfigAdminClient, ConfigClient, type ConfigValueType, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, DEFAULT_ADMIN_LOCALE, 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 IAdminCreatedLink, type IAdminDoctorReport, type IAdminEnrollment, type IAdminEnvironmentReport, 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 IAdminOperator, type IAdminOperatorLink, type IAdminOperatorsReport, type IAdminPendingMigration, type IAdminPlanInput, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminSecondFactor, type IAdminSession, 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 IInferredConfigValue, 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 IRemoteConfigState, type IRenderedTemplateResult, type IRequestConfig, type IRequestLocationDTO, 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 ITemplateGroup, 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, type LocaleMap, MediaClient, type MigrationImpact, type SubscriberType, WebhooksClient, WorkspacesClient, adminLocaleNames, adminLocaleTags, castConfigValue, configKeyProblem, configValueLabel, configValueType, createAdminT, createMemoryCache, describeLocation, detectAdminLocale, formatAdminDate, formatConfigValue, groupTemplatesByType, inferConfigValue, isAdminLocale, isMfaRequired, missingTemplateLocales };
|
package/dist/index.d.ts
CHANGED
|
@@ -1724,6 +1724,25 @@ declare class CourierAdminClient {
|
|
|
1724
1724
|
previewTemplate(type: string, input: IPreviewTemplateInput, locale?: string | null): Promise<IApiResponse<IRenderedTemplateResult>>;
|
|
1725
1725
|
}
|
|
1726
1726
|
|
|
1727
|
+
/** One email and every locale it exists in. */
|
|
1728
|
+
interface ITemplateGroup {
|
|
1729
|
+
type: string;
|
|
1730
|
+
/** Default locale (null) first, then the rest alphabetically. */
|
|
1731
|
+
entries: ITemplateEntry[];
|
|
1732
|
+
/** The entry a click on the email itself should open: the default, else the first. */
|
|
1733
|
+
primary: ITemplateEntry;
|
|
1734
|
+
/** Built-in email (its default-locale row can never be deleted). */
|
|
1735
|
+
system: boolean;
|
|
1736
|
+
}
|
|
1737
|
+
/** Rows grouped by type, types in the order the server listed them. */
|
|
1738
|
+
declare function groupTemplatesByType(rows: readonly ITemplateEntry[]): ITemplateGroup[];
|
|
1739
|
+
/**
|
|
1740
|
+
* Locales the app already uses elsewhere that `type` has no version in yet —
|
|
1741
|
+
* what "Add locale" should suggest first. A French welcome email with no French
|
|
1742
|
+
* receipt is exactly the gap an operator is looking for.
|
|
1743
|
+
*/
|
|
1744
|
+
declare function missingTemplateLocales(rows: readonly ITemplateEntry[], type: string): string[];
|
|
1745
|
+
|
|
1727
1746
|
type ConfigValueType = 'string' | 'number' | 'boolean' | 'json';
|
|
1728
1747
|
declare const CONFIG_VALUE_TYPES: readonly ConfigValueType[];
|
|
1729
1748
|
/** The editor type for a stored value. Objects, arrays and null are JSON. */
|
|
@@ -2353,6 +2372,7 @@ declare const en: {
|
|
|
2353
2372
|
};
|
|
2354
2373
|
templates: {
|
|
2355
2374
|
defaultLocale: string;
|
|
2375
|
+
defaultChip: string;
|
|
2356
2376
|
builtInBadge: string;
|
|
2357
2377
|
subject: string;
|
|
2358
2378
|
htmlBody: string;
|
|
@@ -2362,9 +2382,12 @@ declare const en: {
|
|
|
2362
2382
|
newTemplate: string;
|
|
2363
2383
|
hint: string;
|
|
2364
2384
|
loading: string;
|
|
2385
|
+
openLocale: string;
|
|
2365
2386
|
};
|
|
2366
2387
|
editor: {
|
|
2367
2388
|
loading: string;
|
|
2389
|
+
locales: string;
|
|
2390
|
+
discardChanges: string;
|
|
2368
2391
|
addLocale: string;
|
|
2369
2392
|
builtInNote: string;
|
|
2370
2393
|
active: string;
|
|
@@ -2438,4 +2461,4 @@ type AdminT = ReturnType<typeof createAdminT>;
|
|
|
2438
2461
|
/** Dates in the console's language: 'date', 'datetime' or 'time'. */
|
|
2439
2462
|
declare function formatAdminDate(value: string | number | Date, locale?: AdminLocale | undefined, style?: 'date' | 'datetime' | 'time'): string;
|
|
2440
2463
|
|
|
2441
|
-
export { ADMIN_LOCALES, AdminClient, type AdminLocale, type AdminMessageKey, type AdminMessageParams, type AdminMessages, type AdminRouteGuard, type AdminScope, type AdminSessionState, type AdminT, AuditAdminClient, AuditClient, AuthAdminClient, AuthClient, BillingAdminClient, BillingClient, CONFIG_KEY_PATTERN, CONFIG_VALUE_TYPES, type CastResult, ConfigAdminClient, ConfigClient, type ConfigValueType, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, DEFAULT_ADMIN_LOCALE, 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 IAdminCreatedLink, type IAdminDoctorReport, type IAdminEnrollment, type IAdminEnvironmentReport, 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 IAdminOperator, type IAdminOperatorLink, type IAdminOperatorsReport, type IAdminPendingMigration, type IAdminPlanInput, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminSecondFactor, type IAdminSession, 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 IInferredConfigValue, 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 IRemoteConfigState, type IRenderedTemplateResult, type IRequestConfig, type IRequestLocationDTO, 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, type LocaleMap, MediaClient, type MigrationImpact, type SubscriberType, WebhooksClient, WorkspacesClient, adminLocaleNames, adminLocaleTags, castConfigValue, configKeyProblem, configValueLabel, configValueType, createAdminT, createMemoryCache, describeLocation, detectAdminLocale, formatAdminDate, formatConfigValue, inferConfigValue, isAdminLocale, isMfaRequired };
|
|
2464
|
+
export { ADMIN_LOCALES, AdminClient, type AdminLocale, type AdminMessageKey, type AdminMessageParams, type AdminMessages, type AdminRouteGuard, type AdminScope, type AdminSessionState, type AdminT, AuditAdminClient, AuditClient, AuthAdminClient, AuthClient, BillingAdminClient, BillingClient, CONFIG_KEY_PATTERN, CONFIG_VALUE_TYPES, type CastResult, ConfigAdminClient, ConfigClient, type ConfigValueType, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, DEFAULT_ADMIN_LOCALE, 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 IAdminCreatedLink, type IAdminDoctorReport, type IAdminEnrollment, type IAdminEnvironmentReport, 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 IAdminOperator, type IAdminOperatorLink, type IAdminOperatorsReport, type IAdminPendingMigration, type IAdminPlanInput, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminSecondFactor, type IAdminSession, 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 IInferredConfigValue, 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 IRemoteConfigState, type IRenderedTemplateResult, type IRequestConfig, type IRequestLocationDTO, 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 ITemplateGroup, 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, type LocaleMap, MediaClient, type MigrationImpact, type SubscriberType, WebhooksClient, WorkspacesClient, adminLocaleNames, adminLocaleTags, castConfigValue, configKeyProblem, configValueLabel, configValueType, createAdminT, createMemoryCache, describeLocation, detectAdminLocale, formatAdminDate, formatConfigValue, groupTemplatesByType, inferConfigValue, isAdminLocale, isMfaRequired, missingTemplateLocales };
|
package/dist/index.js
CHANGED
|
@@ -2198,6 +2198,27 @@ var CourierAdminClient = class {
|
|
|
2198
2198
|
}
|
|
2199
2199
|
};
|
|
2200
2200
|
|
|
2201
|
+
// src/template-locales.ts
|
|
2202
|
+
var byLocale = (a, b) => a.locale === b.locale ? 0 : a.locale === null ? -1 : b.locale === null ? 1 : a.locale.localeCompare(b.locale);
|
|
2203
|
+
function groupTemplatesByType(rows) {
|
|
2204
|
+
const groups = /* @__PURE__ */ new Map();
|
|
2205
|
+
for (const row of rows) {
|
|
2206
|
+
const entries = groups.get(row.type);
|
|
2207
|
+
if (entries) entries.push(row);
|
|
2208
|
+
else groups.set(row.type, [row]);
|
|
2209
|
+
}
|
|
2210
|
+
return [...groups].map(([type, entries]) => {
|
|
2211
|
+
entries.sort(byLocale);
|
|
2212
|
+
const primary = entries[0];
|
|
2213
|
+
return { type, entries, primary, system: entries.some((e) => e.system === true) };
|
|
2214
|
+
});
|
|
2215
|
+
}
|
|
2216
|
+
function missingTemplateLocales(rows, type) {
|
|
2217
|
+
const has = new Set(rows.filter((r) => r.type === type).map((r) => r.locale));
|
|
2218
|
+
const used = new Set(rows.map((r) => r.locale).filter((l) => l !== null && !has.has(l)));
|
|
2219
|
+
return [...used].sort();
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2201
2222
|
// src/types.ts
|
|
2202
2223
|
function isMfaRequired(result) {
|
|
2203
2224
|
return !("tokens" in result);
|
|
@@ -2915,6 +2936,7 @@ var config_default = config;
|
|
|
2915
2936
|
// src/admin-i18n/en/templates.ts
|
|
2916
2937
|
var templates = {
|
|
2917
2938
|
defaultLocale: "default locale",
|
|
2939
|
+
defaultChip: "default",
|
|
2918
2940
|
builtInBadge: "built-in",
|
|
2919
2941
|
subject: "Subject",
|
|
2920
2942
|
htmlBody: "HTML body",
|
|
@@ -2923,10 +2945,13 @@ var templates = {
|
|
|
2923
2945
|
title: "Templates",
|
|
2924
2946
|
newTemplate: "New template",
|
|
2925
2947
|
hint: "Every email the app sends. Open one to edit its copy and preview it live.",
|
|
2926
|
-
loading: "Loading templates\u2026"
|
|
2948
|
+
loading: "Loading templates\u2026",
|
|
2949
|
+
openLocale: "Open the {locale} version of {type}"
|
|
2927
2950
|
},
|
|
2928
2951
|
editor: {
|
|
2929
2952
|
loading: "Loading template\u2026",
|
|
2953
|
+
locales: "Locales",
|
|
2954
|
+
discardChanges: "You have unsaved changes to this locale. Discard them and switch?",
|
|
2930
2955
|
addLocale: "+ Add locale",
|
|
2931
2956
|
builtInNote: "built-in email: edit or roll back, it cannot be deleted",
|
|
2932
2957
|
active: "Active",
|
|
@@ -3606,6 +3631,7 @@ var config_default2 = config2;
|
|
|
3606
3631
|
// src/admin-i18n/es/templates.ts
|
|
3607
3632
|
var templates2 = {
|
|
3608
3633
|
defaultLocale: "idioma predeterminado",
|
|
3634
|
+
defaultChip: "predeterminado",
|
|
3609
3635
|
builtInBadge: "integrado",
|
|
3610
3636
|
subject: "Asunto",
|
|
3611
3637
|
htmlBody: "Cuerpo HTML",
|
|
@@ -3614,10 +3640,13 @@ var templates2 = {
|
|
|
3614
3640
|
title: "Plantillas",
|
|
3615
3641
|
newTemplate: "Nueva plantilla",
|
|
3616
3642
|
hint: "Cada correo que env\xEDa la aplicaci\xF3n. Abre uno para editar su contenido y ver la vista previa en directo.",
|
|
3617
|
-
loading: "Cargando plantillas\u2026"
|
|
3643
|
+
loading: "Cargando plantillas\u2026",
|
|
3644
|
+
openLocale: "Abrir la versi\xF3n {locale} de {type}"
|
|
3618
3645
|
},
|
|
3619
3646
|
editor: {
|
|
3620
3647
|
loading: "Cargando plantilla\u2026",
|
|
3648
|
+
locales: "Idiomas",
|
|
3649
|
+
discardChanges: "Este idioma tiene cambios sin guardar. \xBFDescartarlos y cambiar de idioma?",
|
|
3621
3650
|
addLocale: "+ A\xF1adir idioma",
|
|
3622
3651
|
builtInNote: "correo integrado: se puede editar o restaurar, no eliminar",
|
|
3623
3652
|
active: "Activa",
|
|
@@ -4297,6 +4326,7 @@ var config_default3 = config3;
|
|
|
4297
4326
|
// src/admin-i18n/fr/templates.ts
|
|
4298
4327
|
var templates3 = {
|
|
4299
4328
|
defaultLocale: "langue par d\xE9faut",
|
|
4329
|
+
defaultChip: "par d\xE9faut",
|
|
4300
4330
|
builtInBadge: "int\xE9gr\xE9",
|
|
4301
4331
|
subject: "Objet",
|
|
4302
4332
|
htmlBody: "Corps HTML",
|
|
@@ -4305,10 +4335,13 @@ var templates3 = {
|
|
|
4305
4335
|
title: "Mod\xE8les",
|
|
4306
4336
|
newTemplate: "Nouveau mod\xE8le",
|
|
4307
4337
|
hint: "Chaque e-mail envoy\xE9 par l'application. Ouvrez-en un pour modifier son contenu et le pr\xE9visualiser en direct.",
|
|
4308
|
-
loading: "Chargement des mod\xE8les\u2026"
|
|
4338
|
+
loading: "Chargement des mod\xE8les\u2026",
|
|
4339
|
+
openLocale: "Ouvrir la version {locale} de {type}"
|
|
4309
4340
|
},
|
|
4310
4341
|
editor: {
|
|
4311
4342
|
loading: "Chargement du mod\xE8le\u2026",
|
|
4343
|
+
locales: "Langues",
|
|
4344
|
+
discardChanges: "Cette langue a des modifications non enregistr\xE9es. Les abandonner et changer de langue ?",
|
|
4312
4345
|
addLocale: "+ Ajouter une langue",
|
|
4313
4346
|
builtInNote: "e-mail int\xE9gr\xE9 : modifiable ou restaurable, mais pas supprimable",
|
|
4314
4347
|
active: "Actif",
|
|
@@ -4428,8 +4461,10 @@ export {
|
|
|
4428
4461
|
detectAdminLocale,
|
|
4429
4462
|
formatAdminDate,
|
|
4430
4463
|
formatConfigValue,
|
|
4464
|
+
groupTemplatesByType,
|
|
4431
4465
|
inferConfigValue,
|
|
4432
4466
|
isAdminLocale,
|
|
4433
|
-
isMfaRequired
|
|
4467
|
+
isMfaRequired,
|
|
4468
|
+
missingTemplateLocales
|
|
4434
4469
|
};
|
|
4435
4470
|
//# sourceMappingURL=index.js.map
|