@stewardhq/sdk 0.2.0 → 0.3.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/README.md +8 -3
- package/dist/_chunks/errors.js +1 -1
- package/dist/_chunks/events.d.ts +15 -1
- package/dist/_chunks/events.js +171 -3
- package/dist/_chunks/index.d.ts +321 -4
- package/dist/_chunks/src.js +41 -5
- package/dist/_chunks/steward.d.ts +3 -3
- package/dist/_chunks/steward.js +8 -4
- package/dist/contract.d.ts +3 -3
- package/dist/contract.js +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/server.d.ts +2 -2
- package/dist/server.js +1 -1
- package/dist/testing.d.ts +33 -3
- package/dist/testing.js +51 -5
- package/package.json +3 -4
package/dist/contract.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { A as
|
|
1
|
+
import { $ as Branding, $n as CancelSubscriptionInputSchema, $r as PriceDef, $t as PlanSetWarningSchema, A as buildDoctorReport, An as InvoiceIssueResponse, Ar as CheckoutSessionSchema, At as EmailTemplate, B as WebhookEndpointCreateInputSchema, Bn as InvoiceLineSchema, Br as AccountsRefreshResultSchema, Bt as emailTemplateOf, C as DoctorSeveritySchema, Cn as GrantCreateResponse, Cr as CheckoutReturnStatus, Ct as EmailLocale, D as DoctorWarning, Dn as HEADER_IDEMPOTENCY_KEY, Dr as CheckoutSessionCreateParsed, Dt as EmailSettingsPatch, E as DoctorUnsellableReason, En as HEADER_API_VERSION, Er as CheckoutSessionCreateInputSchema, Et as EmailSettings, F as EventTypeSchema, Fn as ManualInvoiceResponseSchema, Fr as MAX_CHECKOUT_CONSENT_DOCS, Ft as NotificationEmailsSchema, G as WebhookEndpointSchema, Gn as MANUAL_INVOICE_MAX_AMOUNT_MINOR, Gr as CatalogSyncResult, Gt as PlanSetInput, H as WebhookEndpointListSchema, Hn as InvoiceStatusSchema, Hr as CatalogSchema, Ht as isEmailRelevant, I as WEBHOOK_ENDPOINT_STATUSES, In as Invoice, Ir as ProviderPayload, It as applyEmailSettingsPatch, J as WebhookLastDelivery, Jn as ManualInvoiceLineInput, Jr as FeatureDefSchema, Jt as PlanSetModeSchema, K as WebhookEndpointStatus, Kn as ManualInvoiceInput, Kr as CatalogSyncResultSchema, Kt as PlanSetInputSchema, L as WEBHOOK_SECRET_PREFIX, Ln as InvoiceIssueInput, Lr as ProviderPayloadSchema, Lt as billingPageUrl, M as endpointDiagnosisOf, Mn as InvoiceVoidResponse, Mr as CheckoutStatusSchema, Mt as EmailTemplateSettings, N as hostedReadinessOf, Nn as InvoiceVoidResponseSchema, Nr as Consent, Nt as EmailTemplateSettingsSchema, O as DoctorWarningCode, On as HEADER_REQUEST_ID, Or as CheckoutSessionCreated, Ot as EmailSettingsPatchSchema, P as DEFAULT_ENDPOINT_EVENT_TYPES, Pn as ManualInvoiceResponse, Pr as ConsentSchema, Pt as MAX_NOTIFICATION_EMAILS, Q as webhookEndpointUrlProblem, Qn as CancelSubscriptionInput, Qr as Price, Qt as PlanSetWarningCode, R as WebhookEndpoint, Rn as InvoiceIssueInputSchema, Rr as checkoutRedirectUrl, Rt as emailLocaleOf, S as DoctorSeverity, Si as MetadataSchema, Sn as CheckoutSessionResponseSchema, Sr as CheckoutRedirectTarget, St as EmailExtraTextSchema, T as DoctorUnsellablePriceSchema, Tn as HEADER_ACTOR_REF, Tr as CheckoutSessionCreateInput, Tt as EmailSenderSchema, U as WebhookEndpointRotateInput, Un as InvoiceVoidInput, Ur as CatalogSyncInput, Ut as uniqueEmails, V as WebhookEndpointList, Vn as InvoiceSchema, Vr as Catalog, Vt as emailTemplateSettings, W as WebhookEndpointRotateInputSchema, Wn as InvoiceVoidInputSchema, Wr as CatalogSyncInputSchema, Wt as PLAN_SET_MODES, X as WebhookSecretSchema, Xn as manualInvoiceTotals, Xr as PlanDef, Xt as PlanSetResponseSchema, Y as WebhookLastDeliverySchema, Yn as ManualInvoiceLineInputSchema, Yr as FeatureTypeSchema, Yt as PlanSetResponse, Z as generateWebhookSecret, Zn as splitInclusiveTax, Zr as PlanDefSchema, Zt as PlanSetWarning, _ as DoctorProviderSchema, _i as ErrorResponseSchema, _n as AccountUpsertResponse, _r as CheckoutConsentInput, _t as BILLING_PATH_PLACEHOLDERS, a as DOCTOR_SEVERITIES, ai as CodeSchema, an as ResolveEntitlementsInput, ar as PaymentSchema, at as ProductSettingsPatch, b as DoctorSettings, bi as Interval, bn as CancelSubscriptionResponseSchema, br as CheckoutPrefill, bt as EMAIL_TEMPLATES, c as DoctorEmails, ci as DateTimeSchema, cn as isLiveSubscriptionStatus, cr as Subscription, ct as ReturnOriginSchema, d as DoctorEndpointDiagnosis, di as EntitlementValueSchema, dn as ErrorCode, dr as PortalSession, dt as SettingsLocaleSchema, ei as PriceDefSchema, en as ResyncResult, er as Grant, et as BrandingPatchSchema, f as DoctorEndpointSchema, fi as Entitlements, fn as ErrorCodeSpec, fr as PortalSessionCreateInput, ft as TtlMinutesSchema, g as DoctorProvider, gi as ErrorResponse, gn as AccountDetailSchema, gr as CHECKOUT_ERRORS, gt as returnOriginsOf, h as DoctorHostedSchema, hi as ErrorCategorySchema, hn as AccountDetail, hr as PortalSessionSchema, ht as isReturnUrlAllowed, i as DOCTOR_REQUIRED_LEGAL_LINKS, ii as AmountMinorSchema, in as LIVE_SUBSCRIPTION_STATUSES, ir as Payment, it as ProductSettings, j as emailReadinessOf, jn as InvoiceIssueResponseSchema, jr as CheckoutStatus, jt as EmailTemplateSchema, k as DoctorWarningSchema, kn as HEADER_SDK, kr as CheckoutSessionCreatedSchema, kt as EmailSettingsSchema, l as DoctorEmailsSchema, li as ERROR_CATEGORIES, ln as resolveEntitlements, lr as SubscriptionSchema, lt as SETTINGS_LOCALES, m as DoctorHosted, mi as ErrorCategory, mn as isKnownErrorCode, mr as PortalSessionError, mt as applySettingsPatch, n as DOCTOR_PROVIDER_ENVIRONMENTS, ni as API_VERSION, nn as EntitlementRulesCatalog, nr as GrantCreateInputSchema, nt as DEFAULT_CHECKOUT_TTL_MINUTES, o as DoctorCatalog, oi as Currency, on as ResolvedEntitlements, or as Stats, ot as ProductSettingsPatchSchema, p as DoctorFacts, pi as EntitlementsSchema, pn as errorCodeSpec, pr as PortalSessionCreateInputSchema, pt as WebUrlSchema, q as WebhookEndpointStatusSchema, qn as ManualInvoiceInputSchema, qr as FeatureDef, qt as PlanSetMode, r as DOCTOR_REQUIRED_BRANDING, ri as ActorRefSchema, rn as EntitlementRulesGrant, rr as GrantSchema, rt as DEFAULT_PORTAL_TTL_MINUTES, s as DoctorCatalogSchema, si as CurrencySchema, sn as isGrantActive, sr as StatsSchema, st as ProductSettingsSchema, t as DOCTOR_PENDING_BACKLOG_MS, ti as PriceSchema, tn as ResyncResultSchema, tr as GrantCreateInput, tt as BrandingSchema, u as DoctorEndpoint, ui as EntitlementValue, un as ERROR_CODES, ur as PORTAL_SESSION_ERRORS, ut as SettingsLocale, v as DoctorReport, vi as ExternalRefSchema, vn as AccountUpsertResponseSchema, vr as CheckoutConsentInputSchema, vt as BillingPathSchema, w as DoctorUnsellablePrice, wn as GrantCreateResponseSchema, wr as CheckoutSession, wt as EmailRelevanceFacts, x as DoctorSettingsSchema, xi as IntervalSchema, xn as CheckoutSessionResponse, xr as CheckoutPrefillSchema, xt as EMAIL_TEMPLATE_BY_EVENT, y as DoctorReportSchema, yi as IdSchema, yn as CancelSubscriptionResponse, yr as CheckoutError, yt as EMAIL_LOCALES, z as WebhookEndpointCreateInput, zn as InvoiceLine, zr as AccountsRefreshResult, zt as emailRecipients } from "./_chunks/index.js";
|
|
2
|
+
import { A as AccountOpenCheckoutSchema, B as AccountUpsertInput, C as AccountDeleteResponse, D as AccountInclude, E as AccountDunningStateSchema, F as AccountSchema, G as BillingProfileSchema, H as BillingProfile, I as AccountState, J as SubscriptionStatus, K as EntitlementSnapshot, L as AccountStateSchema, M as AccountProfileStateSchema, N as AccountScheduledChange, O as AccountLocaleSchema, P as AccountScheduledChangeSchema, R as AccountSubscriptionState, S as Account, T as AccountDunningState, U as BillingProfileInput, V as AccountUpsertInputSchema, W as BillingProfileKindSchema, X as SubscriptionSummary, Y as SubscriptionStatusSchema, Z as SubscriptionSummarySchema, _ as PingSchema, a as BillingEvent, b as AccessState, c as EVENT_DETAIL_SCHEMAS, d as EventIdSchema, f as EventType, g as Ping, h as PING_EVENT_TYPE, i as ApiVersionSchema, j as AccountProfileState, k as AccountOpenCheckout, l as EVENT_TYPES, m as LegacyEventType, n as AnyBillingEvent, o as BillingEventOf, p as LEGACY_EVENT_TYPES, q as EntitlementSnapshotSchema, r as AnyBillingEventSchema, s as BillingEventSchema, t as AccountStateChangeCause, u as EventDetail, v as isEventType, w as AccountDeleteResponseSchema, x as AccessStateSchema, y as ACCOUNT_INCLUDES, z as AccountSubscriptionStateSchema } from "./_chunks/events.js";
|
|
3
3
|
import { n as isValidTckn, r as isValidVkn, t as isE164 } from "./_chunks/validators.js";
|
|
4
|
-
export { ACCOUNT_INCLUDES, API_VERSION, AccessState, AccessStateSchema, Account, AccountDeleteResponse, AccountDeleteResponseSchema, AccountDetail, AccountDetailSchema, AccountDunningState, AccountDunningStateSchema, AccountInclude, AccountOpenCheckout, AccountOpenCheckoutSchema, AccountProfileState, AccountProfileStateSchema, AccountScheduledChange, AccountScheduledChangeSchema, AccountSchema, AccountState, AccountStateChangeCause, AccountStateSchema, AccountSubscriptionState, AccountSubscriptionStateSchema, AccountUpsertInput, AccountUpsertInputSchema, AccountUpsertResponse, AccountUpsertResponseSchema, AccountsRefreshResult, AccountsRefreshResultSchema, ActorRefSchema, AmountMinorSchema, AnyBillingEvent, AnyBillingEventSchema, ApiVersionSchema, BillingEvent, BillingEventOf, BillingEventSchema, BillingProfile, BillingProfileInput, BillingProfileKindSchema, BillingProfileSchema, Branding, BrandingPatchSchema, BrandingSchema, CHECKOUT_ERRORS, CancelSubscriptionInput, CancelSubscriptionInputSchema, CancelSubscriptionResponse, CancelSubscriptionResponseSchema, Catalog, CatalogSchema, CatalogSyncInput, CatalogSyncInputSchema, CatalogSyncResult, CatalogSyncResultSchema, CheckoutConsentInput, CheckoutConsentInputSchema, CheckoutError, CheckoutPrefill, CheckoutPrefillSchema, CheckoutRedirectTarget, CheckoutReturnStatus, CheckoutSession, CheckoutSessionCreateInput, CheckoutSessionCreateInputSchema, CheckoutSessionCreateParsed, CheckoutSessionCreated, CheckoutSessionCreatedSchema, CheckoutSessionResponse, CheckoutSessionResponseSchema, CheckoutSessionSchema, CheckoutStatus, CheckoutStatusSchema, CodeSchema, Consent, ConsentSchema, Currency, CurrencySchema, DEFAULT_CHECKOUT_TTL_MINUTES, DEFAULT_ENDPOINT_EVENT_TYPES, DEFAULT_PORTAL_TTL_MINUTES, DOCTOR_PENDING_BACKLOG_MS, DOCTOR_PROVIDER_ENVIRONMENTS, DOCTOR_REQUIRED_BRANDING, DOCTOR_REQUIRED_LEGAL_LINKS, DOCTOR_SEVERITIES, DateTimeSchema, DoctorCatalog, DoctorCatalogSchema, DoctorEndpoint, DoctorEndpointDiagnosis, DoctorEndpointSchema, DoctorFacts, DoctorHosted, DoctorHostedSchema, DoctorProvider, DoctorProviderSchema, DoctorReport, DoctorReportSchema, DoctorSettings, DoctorSettingsSchema, DoctorSeverity, DoctorSeveritySchema, DoctorUnsellablePrice, DoctorUnsellablePriceSchema, DoctorUnsellableReason, DoctorWarning, DoctorWarningCode, DoctorWarningSchema, ERROR_CATEGORIES, ERROR_CODES, EVENT_DETAIL_SCHEMAS, EVENT_TYPES, EntitlementRulesCatalog, EntitlementRulesGrant, EntitlementSnapshot, EntitlementSnapshotSchema, EntitlementValue, EntitlementValueSchema, Entitlements, EntitlementsSchema, ErrorCategory, ErrorCategorySchema, ErrorCode, ErrorCodeSpec, ErrorResponse, ErrorResponseSchema, EventDetail, EventIdSchema, EventType, EventTypeSchema, ExternalRefSchema, FeatureDef, FeatureDefSchema, FeatureTypeSchema, Grant, GrantCreateInput, GrantCreateInputSchema, GrantCreateResponse, GrantCreateResponseSchema, GrantSchema, HEADER_ACTOR_REF, HEADER_API_VERSION, HEADER_IDEMPOTENCY_KEY, HEADER_REQUEST_ID, HEADER_SDK, IdSchema, Interval, IntervalSchema, Invoice, InvoiceIssueInput, InvoiceIssueInputSchema, InvoiceIssueResponse, InvoiceIssueResponseSchema, InvoiceLine, InvoiceLineSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceVoidInput, InvoiceVoidInputSchema, InvoiceVoidResponse, InvoiceVoidResponseSchema, LEGACY_EVENT_TYPES, LIVE_SUBSCRIPTION_STATUSES, LegacyEventType, MANUAL_INVOICE_MAX_AMOUNT_MINOR, MAX_CHECKOUT_CONSENT_DOCS, ManualInvoiceInput, ManualInvoiceInputSchema, ManualInvoiceLineInput, ManualInvoiceLineInputSchema, ManualInvoiceResponse, ManualInvoiceResponseSchema, MetadataSchema, PING_EVENT_TYPE, PLAN_SET_MODES, PORTAL_SESSION_ERRORS, Payment, PaymentSchema, Ping, PingSchema, PlanDef, PlanDefSchema, PlanSetInput, PlanSetInputSchema, PlanSetMode, PlanSetModeSchema, PlanSetResponse, PlanSetResponseSchema, PlanSetWarning, PlanSetWarningCode, PlanSetWarningSchema, PortalSession, PortalSessionCreateInput, PortalSessionCreateInputSchema, PortalSessionError, PortalSessionSchema, Price, PriceDef, PriceDefSchema, PriceSchema, ProductSettings, ProductSettingsPatch, ProductSettingsPatchSchema, ProductSettingsSchema, ProviderPayload, ProviderPayloadSchema, ResolveEntitlementsInput, ResolvedEntitlements, ResyncResult, ResyncResultSchema, ReturnOriginSchema, SETTINGS_LOCALES, SettingsLocale, SettingsLocaleSchema, Stats, StatsSchema, Subscription, SubscriptionSchema, SubscriptionStatus, SubscriptionStatusSchema, SubscriptionSummary, SubscriptionSummarySchema, TtlMinutesSchema, WEBHOOK_ENDPOINT_STATUSES, WEBHOOK_SECRET_PREFIX, WebUrlSchema, WebhookEndpoint, WebhookEndpointCreateInput, WebhookEndpointCreateInputSchema, WebhookEndpointList, WebhookEndpointListSchema, WebhookEndpointRotateInput, WebhookEndpointRotateInputSchema, WebhookEndpointSchema, WebhookEndpointStatus, WebhookEndpointStatusSchema, WebhookLastDelivery, WebhookLastDeliverySchema, WebhookSecretSchema, applySettingsPatch, buildDoctorReport, checkoutRedirectUrl, endpointDiagnosisOf, errorCodeSpec, generateWebhookSecret, hostedReadinessOf, isE164, isEventType, isGrantActive, isKnownErrorCode, isLiveSubscriptionStatus, isReturnUrlAllowed, isValidTckn, isValidVkn, manualInvoiceTotals, resolveEntitlements, returnOriginsOf, splitInclusiveTax, webhookEndpointUrlProblem };
|
|
4
|
+
export { ACCOUNT_INCLUDES, API_VERSION, AccessState, AccessStateSchema, Account, AccountDeleteResponse, AccountDeleteResponseSchema, AccountDetail, AccountDetailSchema, AccountDunningState, AccountDunningStateSchema, AccountInclude, AccountLocaleSchema, AccountOpenCheckout, AccountOpenCheckoutSchema, AccountProfileState, AccountProfileStateSchema, AccountScheduledChange, AccountScheduledChangeSchema, AccountSchema, AccountState, AccountStateChangeCause, AccountStateSchema, AccountSubscriptionState, AccountSubscriptionStateSchema, AccountUpsertInput, AccountUpsertInputSchema, AccountUpsertResponse, AccountUpsertResponseSchema, AccountsRefreshResult, AccountsRefreshResultSchema, ActorRefSchema, AmountMinorSchema, AnyBillingEvent, AnyBillingEventSchema, ApiVersionSchema, BILLING_PATH_PLACEHOLDERS, BillingEvent, BillingEventOf, BillingEventSchema, BillingPathSchema, BillingProfile, BillingProfileInput, BillingProfileKindSchema, BillingProfileSchema, Branding, BrandingPatchSchema, BrandingSchema, CHECKOUT_ERRORS, CancelSubscriptionInput, CancelSubscriptionInputSchema, CancelSubscriptionResponse, CancelSubscriptionResponseSchema, Catalog, CatalogSchema, CatalogSyncInput, CatalogSyncInputSchema, CatalogSyncResult, CatalogSyncResultSchema, CheckoutConsentInput, CheckoutConsentInputSchema, CheckoutError, CheckoutPrefill, CheckoutPrefillSchema, CheckoutRedirectTarget, CheckoutReturnStatus, CheckoutSession, CheckoutSessionCreateInput, CheckoutSessionCreateInputSchema, CheckoutSessionCreateParsed, CheckoutSessionCreated, CheckoutSessionCreatedSchema, CheckoutSessionResponse, CheckoutSessionResponseSchema, CheckoutSessionSchema, CheckoutStatus, CheckoutStatusSchema, CodeSchema, Consent, ConsentSchema, Currency, CurrencySchema, DEFAULT_CHECKOUT_TTL_MINUTES, DEFAULT_ENDPOINT_EVENT_TYPES, DEFAULT_PORTAL_TTL_MINUTES, DOCTOR_PENDING_BACKLOG_MS, DOCTOR_PROVIDER_ENVIRONMENTS, DOCTOR_REQUIRED_BRANDING, DOCTOR_REQUIRED_LEGAL_LINKS, DOCTOR_SEVERITIES, DateTimeSchema, DoctorCatalog, DoctorCatalogSchema, DoctorEmails, DoctorEmailsSchema, DoctorEndpoint, DoctorEndpointDiagnosis, DoctorEndpointSchema, DoctorFacts, DoctorHosted, DoctorHostedSchema, DoctorProvider, DoctorProviderSchema, DoctorReport, DoctorReportSchema, DoctorSettings, DoctorSettingsSchema, DoctorSeverity, DoctorSeveritySchema, DoctorUnsellablePrice, DoctorUnsellablePriceSchema, DoctorUnsellableReason, DoctorWarning, DoctorWarningCode, DoctorWarningSchema, EMAIL_LOCALES, EMAIL_TEMPLATES, EMAIL_TEMPLATE_BY_EVENT, ERROR_CATEGORIES, ERROR_CODES, EVENT_DETAIL_SCHEMAS, EVENT_TYPES, EmailExtraTextSchema, EmailLocale, EmailRelevanceFacts, EmailSenderSchema, EmailSettings, EmailSettingsPatch, EmailSettingsPatchSchema, EmailSettingsSchema, EmailTemplate, EmailTemplateSchema, EmailTemplateSettings, EmailTemplateSettingsSchema, EntitlementRulesCatalog, EntitlementRulesGrant, EntitlementSnapshot, EntitlementSnapshotSchema, EntitlementValue, EntitlementValueSchema, Entitlements, EntitlementsSchema, ErrorCategory, ErrorCategorySchema, ErrorCode, ErrorCodeSpec, ErrorResponse, ErrorResponseSchema, EventDetail, EventIdSchema, EventType, EventTypeSchema, ExternalRefSchema, FeatureDef, FeatureDefSchema, FeatureTypeSchema, Grant, GrantCreateInput, GrantCreateInputSchema, GrantCreateResponse, GrantCreateResponseSchema, GrantSchema, HEADER_ACTOR_REF, HEADER_API_VERSION, HEADER_IDEMPOTENCY_KEY, HEADER_REQUEST_ID, HEADER_SDK, IdSchema, Interval, IntervalSchema, Invoice, InvoiceIssueInput, InvoiceIssueInputSchema, InvoiceIssueResponse, InvoiceIssueResponseSchema, InvoiceLine, InvoiceLineSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceVoidInput, InvoiceVoidInputSchema, InvoiceVoidResponse, InvoiceVoidResponseSchema, LEGACY_EVENT_TYPES, LIVE_SUBSCRIPTION_STATUSES, LegacyEventType, MANUAL_INVOICE_MAX_AMOUNT_MINOR, MAX_CHECKOUT_CONSENT_DOCS, MAX_NOTIFICATION_EMAILS, ManualInvoiceInput, ManualInvoiceInputSchema, ManualInvoiceLineInput, ManualInvoiceLineInputSchema, ManualInvoiceResponse, ManualInvoiceResponseSchema, MetadataSchema, NotificationEmailsSchema, PING_EVENT_TYPE, PLAN_SET_MODES, PORTAL_SESSION_ERRORS, Payment, PaymentSchema, Ping, PingSchema, PlanDef, PlanDefSchema, PlanSetInput, PlanSetInputSchema, PlanSetMode, PlanSetModeSchema, PlanSetResponse, PlanSetResponseSchema, PlanSetWarning, PlanSetWarningCode, PlanSetWarningSchema, PortalSession, PortalSessionCreateInput, PortalSessionCreateInputSchema, PortalSessionError, PortalSessionSchema, Price, PriceDef, PriceDefSchema, PriceSchema, ProductSettings, ProductSettingsPatch, ProductSettingsPatchSchema, ProductSettingsSchema, ProviderPayload, ProviderPayloadSchema, ResolveEntitlementsInput, ResolvedEntitlements, ResyncResult, ResyncResultSchema, ReturnOriginSchema, SETTINGS_LOCALES, SettingsLocale, SettingsLocaleSchema, Stats, StatsSchema, Subscription, SubscriptionSchema, SubscriptionStatus, SubscriptionStatusSchema, SubscriptionSummary, SubscriptionSummarySchema, TtlMinutesSchema, WEBHOOK_ENDPOINT_STATUSES, WEBHOOK_SECRET_PREFIX, WebUrlSchema, WebhookEndpoint, WebhookEndpointCreateInput, WebhookEndpointCreateInputSchema, WebhookEndpointList, WebhookEndpointListSchema, WebhookEndpointRotateInput, WebhookEndpointRotateInputSchema, WebhookEndpointSchema, WebhookEndpointStatus, WebhookEndpointStatusSchema, WebhookLastDelivery, WebhookLastDeliverySchema, WebhookSecretSchema, applyEmailSettingsPatch, applySettingsPatch, billingPageUrl, buildDoctorReport, checkoutRedirectUrl, emailLocaleOf, emailReadinessOf, emailRecipients, emailTemplateOf, emailTemplateSettings, endpointDiagnosisOf, errorCodeSpec, generateWebhookSecret, hostedReadinessOf, isE164, isEmailRelevant, isEventType, isGrantActive, isKnownErrorCode, isLiveSubscriptionStatus, isReturnUrlAllowed, isValidTckn, isValidVkn, manualInvoiceTotals, resolveEntitlements, returnOriginsOf, splitInclusiveTax, uniqueEmails, webhookEndpointUrlProblem };
|
package/dist/contract.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { $ as
|
|
1
|
+
import { $ as CurrencySchema, A as EMAIL_LOCALES, B as NotificationEmailsSchema, C as BillingProfileKindSchema, D as SubscriptionSummarySchema, E as SubscriptionStatusSchema, F as EmailSettingsPatchSchema, G as emailTemplateOf, H as billingPageUrl, I as EmailSettingsSchema, J as uniqueEmails, K as emailTemplateSettings, L as EmailTemplateSchema, M as EMAIL_TEMPLATE_BY_EVENT, N as EmailExtraTextSchema, O as BILLING_PATH_PLACEHOLDERS, P as EmailSenderSchema, Q as CodeSchema, R as EmailTemplateSettingsSchema, S as AccountUpsertInputSchema, T as EntitlementSnapshotSchema, U as emailLocaleOf, V as applyEmailSettingsPatch, W as emailRecipients, X as ActorRefSchema, Y as API_VERSION, Z as AmountMinorSchema, _ as AccountProfileStateSchema, a as EVENT_TYPES, at as ErrorResponseSchema, b as AccountStateSchema, c as PING_EVENT_TYPE, ct as IntervalSchema, d as ACCOUNT_INCLUDES, et as DateTimeSchema, f as AccessStateSchema, g as AccountOpenCheckoutSchema, h as AccountLocaleSchema, i as EVENT_DETAIL_SCHEMAS, it as ErrorCategorySchema, j as EMAIL_TEMPLATES, k as BillingPathSchema, l as PingSchema, lt as MetadataSchema, m as AccountDunningStateSchema, n as ApiVersionSchema, nt as EntitlementValueSchema, o as EventIdSchema, ot as ExternalRefSchema, p as AccountDeleteResponseSchema, q as isEmailRelevant, r as BillingEventSchema, rt as EntitlementsSchema, s as LEGACY_EVENT_TYPES, st as IdSchema, t as AnyBillingEventSchema, tt as ERROR_CATEGORIES, u as isEventType, v as AccountScheduledChangeSchema, w as BillingProfileSchema, x as AccountSubscriptionStateSchema, y as AccountSchema, z as MAX_NOTIFICATION_EMAILS } from "./_chunks/events.js";
|
|
2
|
+
import { $ as InvoiceVoidResponseSchema, $t as PriceSchema, A as WebhookSecretSchema, At as checkoutRedirectUrl, B as errorCodeSpec, Bt as TtlMinutesSchema, C as WEBHOOK_SECRET_PREFIX, Ct as CheckoutSessionCreateInputSchema, D as WebhookEndpointSchema, Dt as ConsentSchema, E as WebhookEndpointRotateInputSchema, Et as CheckoutStatusSchema, F as PlanSetModeSchema, Ft as ProductSettingsPatchSchema, G as CheckoutSessionResponseSchema, Gt as AccountsRefreshResultSchema, H as AccountDetailSchema, Ht as applySettingsPatch, I as PlanSetResponseSchema, It as ProductSettingsSchema, J as HEADER_API_VERSION, Jt as CatalogSyncResultSchema, K as GrantCreateResponseSchema, Kt as CatalogSchema, L as PlanSetWarningSchema, Lt as ReturnOriginSchema, M as webhookEndpointUrlProblem, Mt as BrandingSchema, N as PLAN_SET_MODES, Nt as DEFAULT_CHECKOUT_TTL_MINUTES, O as WebhookEndpointStatusSchema, Ot as MAX_CHECKOUT_CONSENT_DOCS, P as PlanSetInputSchema, Pt as DEFAULT_PORTAL_TTL_MINUTES, Q as InvoiceIssueResponseSchema, Qt as PriceDefSchema, R as ResyncResultSchema, Rt as SETTINGS_LOCALES, S as WEBHOOK_ENDPOINT_STATUSES, St as CheckoutPrefillSchema, T as WebhookEndpointListSchema, Tt as CheckoutSessionSchema, U as AccountUpsertResponseSchema, Ut as isReturnUrlAllowed, V as isKnownErrorCode, Vt as WebUrlSchema, W as CancelSubscriptionResponseSchema, Wt as returnOriginsOf, X as HEADER_REQUEST_ID, Xt as FeatureTypeSchema, Y as HEADER_IDEMPOTENCY_KEY, Yt as FeatureDefSchema, Z as HEADER_SDK, Zt as PlanDefSchema, _ as emailReadinessOf, _t as PORTAL_SESSION_ERRORS, a as DOCTOR_SEVERITIES, at as InvoiceVoidInputSchema, b as DEFAULT_ENDPOINT_EVENT_TYPES, bt as CHECKOUT_ERRORS, c as DoctorEndpointSchema, ct as ManualInvoiceLineInputSchema, d as DoctorReportSchema, dt as CancelSubscriptionInputSchema, et as ManualInvoiceResponseSchema, f as DoctorSettingsSchema, ft as GrantCreateInputSchema, g as buildDoctorReport, gt as SubscriptionSchema, h as DoctorWarningSchema, ht as StatsSchema, i as DOCTOR_REQUIRED_LEGAL_LINKS, it as InvoiceStatusSchema, j as generateWebhookSecret, jt as BrandingPatchSchema, k as WebhookLastDeliverySchema, kt as ProviderPayloadSchema, l as DoctorHostedSchema, lt as manualInvoiceTotals, m as DoctorUnsellablePriceSchema, mt as PaymentSchema, n as DOCTOR_PROVIDER_ENVIRONMENTS, nt as InvoiceLineSchema, o as DoctorCatalogSchema, ot as MANUAL_INVOICE_MAX_AMOUNT_MINOR, p as DoctorSeveritySchema, pt as GrantSchema, q as HEADER_ACTOR_REF, qt as CatalogSyncInputSchema, r as DOCTOR_REQUIRED_BRANDING, rt as InvoiceSchema, s as DoctorEmailsSchema, st as ManualInvoiceInputSchema, t as DOCTOR_PENDING_BACKLOG_MS, tt as InvoiceIssueInputSchema, u as DoctorProviderSchema, ut as splitInclusiveTax, v as endpointDiagnosisOf, vt as PortalSessionCreateInputSchema, w as WebhookEndpointCreateInputSchema, wt as CheckoutSessionCreatedSchema, x as EventTypeSchema, xt as CheckoutConsentInputSchema, y as hostedReadinessOf, yt as PortalSessionSchema, z as ERROR_CODES, zt as SettingsLocaleSchema } from "./_chunks/src.js";
|
|
3
3
|
import { a as isGrantActive, i as LIVE_SUBSCRIPTION_STATUSES, n as isValidTckn, o as isLiveSubscriptionStatus, r as isValidVkn, s as resolveEntitlements, t as isE164 } from "./_chunks/validators.js";
|
|
4
|
-
export { ACCOUNT_INCLUDES, API_VERSION, AccessStateSchema, AccountDeleteResponseSchema, AccountDetailSchema, AccountDunningStateSchema, AccountOpenCheckoutSchema, AccountProfileStateSchema, AccountScheduledChangeSchema, AccountSchema, AccountStateSchema, AccountSubscriptionStateSchema, AccountUpsertInputSchema, AccountUpsertResponseSchema, AccountsRefreshResultSchema, ActorRefSchema, AmountMinorSchema, AnyBillingEventSchema, ApiVersionSchema, BillingEventSchema, BillingProfileKindSchema, BillingProfileSchema, BrandingPatchSchema, BrandingSchema, CHECKOUT_ERRORS, CancelSubscriptionInputSchema, CancelSubscriptionResponseSchema, CatalogSchema, CatalogSyncInputSchema, CatalogSyncResultSchema, CheckoutConsentInputSchema, CheckoutPrefillSchema, CheckoutSessionCreateInputSchema, CheckoutSessionCreatedSchema, CheckoutSessionResponseSchema, CheckoutSessionSchema, CheckoutStatusSchema, CodeSchema, ConsentSchema, CurrencySchema, DEFAULT_CHECKOUT_TTL_MINUTES, DEFAULT_ENDPOINT_EVENT_TYPES, DEFAULT_PORTAL_TTL_MINUTES, DOCTOR_PENDING_BACKLOG_MS, DOCTOR_PROVIDER_ENVIRONMENTS, DOCTOR_REQUIRED_BRANDING, DOCTOR_REQUIRED_LEGAL_LINKS, DOCTOR_SEVERITIES, DateTimeSchema, DoctorCatalogSchema, DoctorEndpointSchema, DoctorHostedSchema, DoctorProviderSchema, DoctorReportSchema, DoctorSettingsSchema, DoctorSeveritySchema, DoctorUnsellablePriceSchema, DoctorWarningSchema, ERROR_CATEGORIES, ERROR_CODES, EVENT_DETAIL_SCHEMAS, EVENT_TYPES, EntitlementSnapshotSchema, EntitlementValueSchema, EntitlementsSchema, ErrorCategorySchema, ErrorResponseSchema, EventIdSchema, EventTypeSchema, ExternalRefSchema, FeatureDefSchema, FeatureTypeSchema, GrantCreateInputSchema, GrantCreateResponseSchema, GrantSchema, HEADER_ACTOR_REF, HEADER_API_VERSION, HEADER_IDEMPOTENCY_KEY, HEADER_REQUEST_ID, HEADER_SDK, IdSchema, IntervalSchema, InvoiceIssueInputSchema, InvoiceIssueResponseSchema, InvoiceLineSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceVoidInputSchema, InvoiceVoidResponseSchema, LEGACY_EVENT_TYPES, LIVE_SUBSCRIPTION_STATUSES, MANUAL_INVOICE_MAX_AMOUNT_MINOR, MAX_CHECKOUT_CONSENT_DOCS, ManualInvoiceInputSchema, ManualInvoiceLineInputSchema, ManualInvoiceResponseSchema, MetadataSchema, PING_EVENT_TYPE, PLAN_SET_MODES, PORTAL_SESSION_ERRORS, PaymentSchema, PingSchema, PlanDefSchema, PlanSetInputSchema, PlanSetModeSchema, PlanSetResponseSchema, PlanSetWarningSchema, PortalSessionCreateInputSchema, PortalSessionSchema, PriceDefSchema, PriceSchema, ProductSettingsPatchSchema, ProductSettingsSchema, ProviderPayloadSchema, ResyncResultSchema, ReturnOriginSchema, SETTINGS_LOCALES, SettingsLocaleSchema, StatsSchema, SubscriptionSchema, SubscriptionStatusSchema, SubscriptionSummarySchema, TtlMinutesSchema, WEBHOOK_ENDPOINT_STATUSES, WEBHOOK_SECRET_PREFIX, WebUrlSchema, WebhookEndpointCreateInputSchema, WebhookEndpointListSchema, WebhookEndpointRotateInputSchema, WebhookEndpointSchema, WebhookEndpointStatusSchema, WebhookLastDeliverySchema, WebhookSecretSchema, applySettingsPatch, buildDoctorReport, checkoutRedirectUrl, endpointDiagnosisOf, errorCodeSpec, generateWebhookSecret, hostedReadinessOf, isE164, isEventType, isGrantActive, isKnownErrorCode, isLiveSubscriptionStatus, isReturnUrlAllowed, isValidTckn, isValidVkn, manualInvoiceTotals, resolveEntitlements, returnOriginsOf, splitInclusiveTax, webhookEndpointUrlProblem };
|
|
4
|
+
export { ACCOUNT_INCLUDES, API_VERSION, AccessStateSchema, AccountDeleteResponseSchema, AccountDetailSchema, AccountDunningStateSchema, AccountLocaleSchema, AccountOpenCheckoutSchema, AccountProfileStateSchema, AccountScheduledChangeSchema, AccountSchema, AccountStateSchema, AccountSubscriptionStateSchema, AccountUpsertInputSchema, AccountUpsertResponseSchema, AccountsRefreshResultSchema, ActorRefSchema, AmountMinorSchema, AnyBillingEventSchema, ApiVersionSchema, BILLING_PATH_PLACEHOLDERS, BillingEventSchema, BillingPathSchema, BillingProfileKindSchema, BillingProfileSchema, BrandingPatchSchema, BrandingSchema, CHECKOUT_ERRORS, CancelSubscriptionInputSchema, CancelSubscriptionResponseSchema, CatalogSchema, CatalogSyncInputSchema, CatalogSyncResultSchema, CheckoutConsentInputSchema, CheckoutPrefillSchema, CheckoutSessionCreateInputSchema, CheckoutSessionCreatedSchema, CheckoutSessionResponseSchema, CheckoutSessionSchema, CheckoutStatusSchema, CodeSchema, ConsentSchema, CurrencySchema, DEFAULT_CHECKOUT_TTL_MINUTES, DEFAULT_ENDPOINT_EVENT_TYPES, DEFAULT_PORTAL_TTL_MINUTES, DOCTOR_PENDING_BACKLOG_MS, DOCTOR_PROVIDER_ENVIRONMENTS, DOCTOR_REQUIRED_BRANDING, DOCTOR_REQUIRED_LEGAL_LINKS, DOCTOR_SEVERITIES, DateTimeSchema, DoctorCatalogSchema, DoctorEmailsSchema, DoctorEndpointSchema, DoctorHostedSchema, DoctorProviderSchema, DoctorReportSchema, DoctorSettingsSchema, DoctorSeveritySchema, DoctorUnsellablePriceSchema, DoctorWarningSchema, EMAIL_LOCALES, EMAIL_TEMPLATES, EMAIL_TEMPLATE_BY_EVENT, ERROR_CATEGORIES, ERROR_CODES, EVENT_DETAIL_SCHEMAS, EVENT_TYPES, EmailExtraTextSchema, EmailSenderSchema, EmailSettingsPatchSchema, EmailSettingsSchema, EmailTemplateSchema, EmailTemplateSettingsSchema, EntitlementSnapshotSchema, EntitlementValueSchema, EntitlementsSchema, ErrorCategorySchema, ErrorResponseSchema, EventIdSchema, EventTypeSchema, ExternalRefSchema, FeatureDefSchema, FeatureTypeSchema, GrantCreateInputSchema, GrantCreateResponseSchema, GrantSchema, HEADER_ACTOR_REF, HEADER_API_VERSION, HEADER_IDEMPOTENCY_KEY, HEADER_REQUEST_ID, HEADER_SDK, IdSchema, IntervalSchema, InvoiceIssueInputSchema, InvoiceIssueResponseSchema, InvoiceLineSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceVoidInputSchema, InvoiceVoidResponseSchema, LEGACY_EVENT_TYPES, LIVE_SUBSCRIPTION_STATUSES, MANUAL_INVOICE_MAX_AMOUNT_MINOR, MAX_CHECKOUT_CONSENT_DOCS, MAX_NOTIFICATION_EMAILS, ManualInvoiceInputSchema, ManualInvoiceLineInputSchema, ManualInvoiceResponseSchema, MetadataSchema, NotificationEmailsSchema, PING_EVENT_TYPE, PLAN_SET_MODES, PORTAL_SESSION_ERRORS, PaymentSchema, PingSchema, PlanDefSchema, PlanSetInputSchema, PlanSetModeSchema, PlanSetResponseSchema, PlanSetWarningSchema, PortalSessionCreateInputSchema, PortalSessionSchema, PriceDefSchema, PriceSchema, ProductSettingsPatchSchema, ProductSettingsSchema, ProviderPayloadSchema, ResyncResultSchema, ReturnOriginSchema, SETTINGS_LOCALES, SettingsLocaleSchema, StatsSchema, SubscriptionSchema, SubscriptionStatusSchema, SubscriptionSummarySchema, TtlMinutesSchema, WEBHOOK_ENDPOINT_STATUSES, WEBHOOK_SECRET_PREFIX, WebUrlSchema, WebhookEndpointCreateInputSchema, WebhookEndpointListSchema, WebhookEndpointRotateInputSchema, WebhookEndpointSchema, WebhookEndpointStatusSchema, WebhookLastDeliverySchema, WebhookSecretSchema, applyEmailSettingsPatch, applySettingsPatch, billingPageUrl, buildDoctorReport, checkoutRedirectUrl, emailLocaleOf, emailReadinessOf, emailRecipients, emailTemplateOf, emailTemplateSettings, endpointDiagnosisOf, errorCodeSpec, generateWebhookSecret, hostedReadinessOf, isE164, isEmailRelevant, isEventType, isGrantActive, isKnownErrorCode, isLiveSubscriptionStatus, isReturnUrlAllowed, isValidTckn, isValidVkn, manualInvoiceTotals, resolveEntitlements, returnOriginsOf, splitInclusiveTax, uniqueEmails, webhookEndpointUrlProblem };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { A as
|
|
1
|
+
import { $ as Branding, $n as CancelSubscriptionInputSchema, $r as PriceDef, $t as PlanSetWarningSchema, A as buildDoctorReport, An as InvoiceIssueResponse, Ar as CheckoutSessionSchema, At as EmailTemplate, B as WebhookEndpointCreateInputSchema, Bn as InvoiceLineSchema, Br as AccountsRefreshResultSchema, Bt as emailTemplateOf, C as DoctorSeveritySchema, Cn as GrantCreateResponse, Cr as CheckoutReturnStatus, Ct as EmailLocale, D as DoctorWarning, Dn as HEADER_IDEMPOTENCY_KEY, Dr as CheckoutSessionCreateParsed, Dt as EmailSettingsPatch, E as DoctorUnsellableReason, En as HEADER_API_VERSION, Er as CheckoutSessionCreateInputSchema, Et as EmailSettings, F as EventTypeSchema, Fn as ManualInvoiceResponseSchema, Fr as MAX_CHECKOUT_CONSENT_DOCS, Ft as NotificationEmailsSchema, G as WebhookEndpointSchema, Gn as MANUAL_INVOICE_MAX_AMOUNT_MINOR, Gr as CatalogSyncResult, Gt as PlanSetInput, H as WebhookEndpointListSchema, Hn as InvoiceStatusSchema, Hr as CatalogSchema, Ht as isEmailRelevant, I as WEBHOOK_ENDPOINT_STATUSES, In as Invoice, Ir as ProviderPayload, It as applyEmailSettingsPatch, J as WebhookLastDelivery, Jn as ManualInvoiceLineInput, Jr as FeatureDefSchema, Jt as PlanSetModeSchema, K as WebhookEndpointStatus, Kn as ManualInvoiceInput, Kr as CatalogSyncResultSchema, Kt as PlanSetInputSchema, L as WEBHOOK_SECRET_PREFIX, Ln as InvoiceIssueInput, Lr as ProviderPayloadSchema, Lt as billingPageUrl, M as endpointDiagnosisOf, Mn as InvoiceVoidResponse, Mr as CheckoutStatusSchema, Mt as EmailTemplateSettings, N as hostedReadinessOf, Nn as InvoiceVoidResponseSchema, Nr as Consent, Nt as EmailTemplateSettingsSchema, O as DoctorWarningCode, On as HEADER_REQUEST_ID, Or as CheckoutSessionCreated, Ot as EmailSettingsPatchSchema, P as DEFAULT_ENDPOINT_EVENT_TYPES, Pn as ManualInvoiceResponse, Pr as ConsentSchema, Pt as MAX_NOTIFICATION_EMAILS, Q as webhookEndpointUrlProblem, Qn as CancelSubscriptionInput, Qr as Price, Qt as PlanSetWarningCode, R as WebhookEndpoint, Rn as InvoiceIssueInputSchema, Rr as checkoutRedirectUrl, Rt as emailLocaleOf, S as DoctorSeverity, Si as MetadataSchema, Sn as CheckoutSessionResponseSchema, Sr as CheckoutRedirectTarget, St as EmailExtraTextSchema, T as DoctorUnsellablePriceSchema, Tn as HEADER_ACTOR_REF, Tr as CheckoutSessionCreateInput, Tt as EmailSenderSchema, U as WebhookEndpointRotateInput, Un as InvoiceVoidInput, Ur as CatalogSyncInput, Ut as uniqueEmails, V as WebhookEndpointList, Vn as InvoiceSchema, Vr as Catalog, Vt as emailTemplateSettings, W as WebhookEndpointRotateInputSchema, Wn as InvoiceVoidInputSchema, Wr as CatalogSyncInputSchema, Wt as PLAN_SET_MODES, X as WebhookSecretSchema, Xn as manualInvoiceTotals, Xr as PlanDef, Xt as PlanSetResponseSchema, Y as WebhookLastDeliverySchema, Yn as ManualInvoiceLineInputSchema, Yr as FeatureTypeSchema, Yt as PlanSetResponse, Z as generateWebhookSecret, Zn as splitInclusiveTax, Zr as PlanDefSchema, Zt as PlanSetWarning, _ as DoctorProviderSchema, _i as ErrorResponseSchema, _n as AccountUpsertResponse, _r as CheckoutConsentInput, _t as BILLING_PATH_PLACEHOLDERS, a as DOCTOR_SEVERITIES, ai as CodeSchema, an as ResolveEntitlementsInput, ar as PaymentSchema, at as ProductSettingsPatch, b as DoctorSettings, bi as Interval, bn as CancelSubscriptionResponseSchema, br as CheckoutPrefill, bt as EMAIL_TEMPLATES, c as DoctorEmails, ci as DateTimeSchema, cn as isLiveSubscriptionStatus, cr as Subscription, ct as ReturnOriginSchema, d as DoctorEndpointDiagnosis, di as EntitlementValueSchema, dn as ErrorCode, dr as PortalSession, dt as SettingsLocaleSchema, ei as PriceDefSchema, en as ResyncResult, er as Grant, et as BrandingPatchSchema, f as DoctorEndpointSchema, fi as Entitlements, fn as ErrorCodeSpec, fr as PortalSessionCreateInput, ft as TtlMinutesSchema, g as DoctorProvider, gi as ErrorResponse, gn as AccountDetailSchema, gr as CHECKOUT_ERRORS, gt as returnOriginsOf, h as DoctorHostedSchema, hi as ErrorCategorySchema, hn as AccountDetail, hr as PortalSessionSchema, ht as isReturnUrlAllowed, i as DOCTOR_REQUIRED_LEGAL_LINKS, ii as AmountMinorSchema, in as LIVE_SUBSCRIPTION_STATUSES, ir as Payment, it as ProductSettings, j as emailReadinessOf, jn as InvoiceIssueResponseSchema, jr as CheckoutStatus, jt as EmailTemplateSchema, k as DoctorWarningSchema, kn as HEADER_SDK, kr as CheckoutSessionCreatedSchema, kt as EmailSettingsSchema, l as DoctorEmailsSchema, li as ERROR_CATEGORIES, ln as resolveEntitlements, lr as SubscriptionSchema, lt as SETTINGS_LOCALES, m as DoctorHosted, mi as ErrorCategory, mn as isKnownErrorCode, mr as PortalSessionError, mt as applySettingsPatch, n as DOCTOR_PROVIDER_ENVIRONMENTS, ni as API_VERSION, nn as EntitlementRulesCatalog, nr as GrantCreateInputSchema, nt as DEFAULT_CHECKOUT_TTL_MINUTES, o as DoctorCatalog, oi as Currency, on as ResolvedEntitlements, or as Stats, ot as ProductSettingsPatchSchema, p as DoctorFacts, pi as EntitlementsSchema, pn as errorCodeSpec, pr as PortalSessionCreateInputSchema, pt as WebUrlSchema, q as WebhookEndpointStatusSchema, qn as ManualInvoiceInputSchema, qr as FeatureDef, qt as PlanSetMode, r as DOCTOR_REQUIRED_BRANDING, ri as ActorRefSchema, rn as EntitlementRulesGrant, rr as GrantSchema, rt as DEFAULT_PORTAL_TTL_MINUTES, s as DoctorCatalogSchema, si as CurrencySchema, sn as isGrantActive, sr as StatsSchema, st as ProductSettingsSchema, t as DOCTOR_PENDING_BACKLOG_MS, ti as PriceSchema, tn as ResyncResultSchema, tr as GrantCreateInput, tt as BrandingSchema, u as DoctorEndpoint, ui as EntitlementValue, un as ERROR_CODES, ur as PORTAL_SESSION_ERRORS, ut as SettingsLocale, v as DoctorReport, vi as ExternalRefSchema, vn as AccountUpsertResponseSchema, vr as CheckoutConsentInputSchema, vt as BillingPathSchema, w as DoctorUnsellablePrice, wn as GrantCreateResponseSchema, wr as CheckoutSession, wt as EmailRelevanceFacts, x as DoctorSettingsSchema, xi as IntervalSchema, xn as CheckoutSessionResponse, xr as CheckoutPrefillSchema, xt as EMAIL_TEMPLATE_BY_EVENT, y as DoctorReportSchema, yi as IdSchema, yn as CancelSubscriptionResponse, yr as CheckoutError, yt as EMAIL_LOCALES, z as WebhookEndpointCreateInput, zn as InvoiceLine, zr as AccountsRefreshResult, zt as emailRecipients } from "./_chunks/index.js";
|
|
2
|
+
import { A as AccountOpenCheckoutSchema, B as AccountUpsertInput, C as AccountDeleteResponse, D as AccountInclude, E as AccountDunningStateSchema, F as AccountSchema, G as BillingProfileSchema, H as BillingProfile, I as AccountState, J as SubscriptionStatus, K as EntitlementSnapshot, L as AccountStateSchema, M as AccountProfileStateSchema, N as AccountScheduledChange, O as AccountLocaleSchema, P as AccountScheduledChangeSchema, R as AccountSubscriptionState, S as Account, T as AccountDunningState, U as BillingProfileInput, V as AccountUpsertInputSchema, W as BillingProfileKindSchema, X as SubscriptionSummary, Y as SubscriptionStatusSchema, Z as SubscriptionSummarySchema, _ as PingSchema, a as BillingEvent, b as AccessState, c as EVENT_DETAIL_SCHEMAS, d as EventIdSchema, f as EventType, g as Ping, h as PING_EVENT_TYPE, i as ApiVersionSchema, j as AccountProfileState, k as AccountOpenCheckout, l as EVENT_TYPES, m as LegacyEventType, n as AnyBillingEvent, o as BillingEventOf, p as LEGACY_EVENT_TYPES, q as EntitlementSnapshotSchema, r as AnyBillingEventSchema, s as BillingEventSchema, t as AccountStateChangeCause, u as EventDetail, v as isEventType, w as AccountDeleteResponseSchema, x as AccessStateSchema, y as ACCOUNT_INCLUDES, z as AccountSubscriptionStateSchema } from "./_chunks/events.js";
|
|
3
3
|
import { n as isValidTckn, r as isValidVkn, t as isE164 } from "./_chunks/validators.js";
|
|
4
4
|
import { a as StewardEnv, c as createSteward, d as AccountStateRead, i as Steward, l as RetryClass, n as InvoiceDocument, o as StewardMe, r as MutationOptions, s as StewardOptions, t as CatalogRead, u as RetryOptions } from "./_chunks/steward.js";
|
|
5
5
|
import { i as httpStatusFor, n as HttpStatusResult, r as StewardLogger, t as StewardLocale } from "./_chunks/locale.js";
|
|
@@ -203,4 +203,4 @@ export declare class StewardConfigError extends StewardError {
|
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
205
|
//#endregion
|
|
206
|
-
export { ACCOUNT_INCLUDES, API_VERSION, AccessState, AccessStateSchema, Account, AccountDeleteResponse, AccountDeleteResponseSchema, AccountDetail, AccountDetailSchema, AccountDunningState, AccountDunningStateSchema, AccountInclude, AccountOpenCheckout, AccountOpenCheckoutSchema, AccountProfileState, AccountProfileStateSchema, AccountScheduledChange, AccountScheduledChangeSchema, AccountSchema, AccountState, AccountStateChangeCause, type AccountStateRead, AccountStateSchema, AccountSubscriptionState, AccountSubscriptionStateSchema, AccountUpsertInput, AccountUpsertInputSchema, AccountUpsertResponse, AccountUpsertResponseSchema, AccountsRefreshResult, AccountsRefreshResultSchema, ActorRefSchema, AmountMinorSchema, AnyBillingEvent, AnyBillingEventSchema, ApiVersionSchema, BillingEvent, BillingEventOf, BillingEventSchema, BillingProfile, BillingProfileInput, BillingProfileKindSchema, BillingProfileSchema, Branding, BrandingPatchSchema, BrandingSchema, CHECKOUT_ERRORS, CancelSubscriptionInput, CancelSubscriptionInputSchema, CancelSubscriptionResponse, CancelSubscriptionResponseSchema, Catalog, CatalogRead, CatalogSchema, CatalogSyncInput, CatalogSyncInputSchema, CatalogSyncResult, CatalogSyncResultSchema, CheckoutConsentInput, CheckoutConsentInputSchema, CheckoutError, CheckoutPrefill, CheckoutPrefillSchema, CheckoutRedirectTarget, CheckoutReturnStatus, CheckoutSession, CheckoutSessionCreateInput, CheckoutSessionCreateInputSchema, CheckoutSessionCreateParsed, CheckoutSessionCreated, CheckoutSessionCreatedSchema, CheckoutSessionResponse, CheckoutSessionResponseSchema, CheckoutSessionSchema, CheckoutStatus, CheckoutStatusSchema, CodeSchema, Consent, ConsentSchema, Currency, CurrencySchema, DEFAULT_CHECKOUT_TTL_MINUTES, DEFAULT_ENDPOINT_EVENT_TYPES, DEFAULT_PORTAL_TTL_MINUTES, DOCTOR_PENDING_BACKLOG_MS, DOCTOR_PROVIDER_ENVIRONMENTS, DOCTOR_REQUIRED_BRANDING, DOCTOR_REQUIRED_LEGAL_LINKS, DOCTOR_SEVERITIES, DateTimeSchema, DoctorCatalog, DoctorCatalogSchema, DoctorEndpoint, DoctorEndpointDiagnosis, DoctorEndpointSchema, DoctorFacts, DoctorHosted, DoctorHostedSchema, DoctorProvider, DoctorProviderSchema, DoctorReport, DoctorReportSchema, DoctorSettings, DoctorSettingsSchema, DoctorSeverity, DoctorSeveritySchema, DoctorUnsellablePrice, DoctorUnsellablePriceSchema, DoctorUnsellableReason, DoctorWarning, DoctorWarningCode, DoctorWarningSchema, ERROR_CATEGORIES, ERROR_CODES, EVENT_DETAIL_SCHEMAS, EVENT_TYPES, EntitlementRulesCatalog, EntitlementRulesGrant, EntitlementSnapshot, EntitlementSnapshotSchema, EntitlementValue, EntitlementValueSchema, Entitlements, EntitlementsSchema, ErrorCategory, ErrorCategorySchema, ErrorCode, ErrorCodeSpec, ErrorResponse, ErrorResponseSchema, EventDetail, EventIdSchema, EventType, EventTypeSchema, ExternalRefSchema, FeatureDef, FeatureDefSchema, FeatureTypeSchema, Grant, GrantCreateInput, GrantCreateInputSchema, GrantCreateResponse, GrantCreateResponseSchema, GrantSchema, HEADER_ACTOR_REF, HEADER_API_VERSION, HEADER_IDEMPOTENCY_KEY, HEADER_REQUEST_ID, HEADER_SDK, HttpStatusResult, IdSchema, Interval, IntervalSchema, Invoice, InvoiceDocument, InvoiceIssueInput, InvoiceIssueInputSchema, InvoiceIssueResponse, InvoiceIssueResponseSchema, InvoiceLine, InvoiceLineSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceVoidInput, InvoiceVoidInputSchema, InvoiceVoidResponse, InvoiceVoidResponseSchema, LEGACY_EVENT_TYPES, LIVE_SUBSCRIPTION_STATUSES, LegacyEventType, MANUAL_INVOICE_MAX_AMOUNT_MINOR, MAX_CHECKOUT_CONSENT_DOCS, ManualInvoiceInput, ManualInvoiceInputSchema, ManualInvoiceLineInput, ManualInvoiceLineInputSchema, ManualInvoiceResponse, ManualInvoiceResponseSchema, MetadataSchema, MutationOptions, PING_EVENT_TYPE, PLAN_SET_MODES, PORTAL_SESSION_ERRORS, Payment, PaymentSchema, Ping, PingSchema, PlanDef, PlanDefSchema, PlanSetInput, PlanSetInputSchema, PlanSetMode, PlanSetModeSchema, PlanSetResponse, PlanSetResponseSchema, PlanSetWarning, PlanSetWarningCode, PlanSetWarningSchema, PortalSession, PortalSessionCreateInput, PortalSessionCreateInputSchema, PortalSessionError, PortalSessionSchema, Price, PriceDef, PriceDefSchema, PriceSchema, ProductSettings, ProductSettingsPatch, ProductSettingsPatchSchema, ProductSettingsSchema, ProviderPayload, ProviderPayloadSchema, ResolveEntitlementsInput, ResolvedEntitlements, ResyncResult, ResyncResultSchema, type RetryClass, type RetryOptions, ReturnOriginSchema, SETTINGS_LOCALES, SettingsLocale, SettingsLocaleSchema, Stats, StatsSchema, Steward, StewardEnv, type StewardLocale, StewardLogger, StewardMe, StewardOptions, Subscription, SubscriptionSchema, SubscriptionStatus, SubscriptionStatusSchema, SubscriptionSummary, SubscriptionSummarySchema, TtlMinutesSchema, WEBHOOK_ENDPOINT_STATUSES, WEBHOOK_SECRET_PREFIX, WebUrlSchema, WebhookEndpoint, WebhookEndpointCreateInput, WebhookEndpointCreateInputSchema, WebhookEndpointList, WebhookEndpointListSchema, WebhookEndpointRotateInput, WebhookEndpointRotateInputSchema, WebhookEndpointSchema, WebhookEndpointStatus, WebhookEndpointStatusSchema, WebhookLastDelivery, WebhookLastDeliverySchema, WebhookSecretSchema, applySettingsPatch, buildDoctorReport, checkoutRedirectUrl, createSteward, endpointDiagnosisOf, errorCodeSpec, generateWebhookSecret, hostedReadinessOf, httpStatusFor, isE164, isEventType, isGrantActive, isKnownErrorCode, isLiveSubscriptionStatus, isReturnUrlAllowed, isValidTckn, isValidVkn, manualInvoiceTotals, resolveEntitlements, returnOriginsOf, splitInclusiveTax, webhookEndpointUrlProblem };
|
|
206
|
+
export { ACCOUNT_INCLUDES, API_VERSION, AccessState, AccessStateSchema, Account, AccountDeleteResponse, AccountDeleteResponseSchema, AccountDetail, AccountDetailSchema, AccountDunningState, AccountDunningStateSchema, AccountInclude, AccountLocaleSchema, AccountOpenCheckout, AccountOpenCheckoutSchema, AccountProfileState, AccountProfileStateSchema, AccountScheduledChange, AccountScheduledChangeSchema, AccountSchema, AccountState, AccountStateChangeCause, type AccountStateRead, AccountStateSchema, AccountSubscriptionState, AccountSubscriptionStateSchema, AccountUpsertInput, AccountUpsertInputSchema, AccountUpsertResponse, AccountUpsertResponseSchema, AccountsRefreshResult, AccountsRefreshResultSchema, ActorRefSchema, AmountMinorSchema, AnyBillingEvent, AnyBillingEventSchema, ApiVersionSchema, BILLING_PATH_PLACEHOLDERS, BillingEvent, BillingEventOf, BillingEventSchema, BillingPathSchema, BillingProfile, BillingProfileInput, BillingProfileKindSchema, BillingProfileSchema, Branding, BrandingPatchSchema, BrandingSchema, CHECKOUT_ERRORS, CancelSubscriptionInput, CancelSubscriptionInputSchema, CancelSubscriptionResponse, CancelSubscriptionResponseSchema, Catalog, CatalogRead, CatalogSchema, CatalogSyncInput, CatalogSyncInputSchema, CatalogSyncResult, CatalogSyncResultSchema, CheckoutConsentInput, CheckoutConsentInputSchema, CheckoutError, CheckoutPrefill, CheckoutPrefillSchema, CheckoutRedirectTarget, CheckoutReturnStatus, CheckoutSession, CheckoutSessionCreateInput, CheckoutSessionCreateInputSchema, CheckoutSessionCreateParsed, CheckoutSessionCreated, CheckoutSessionCreatedSchema, CheckoutSessionResponse, CheckoutSessionResponseSchema, CheckoutSessionSchema, CheckoutStatus, CheckoutStatusSchema, CodeSchema, Consent, ConsentSchema, Currency, CurrencySchema, DEFAULT_CHECKOUT_TTL_MINUTES, DEFAULT_ENDPOINT_EVENT_TYPES, DEFAULT_PORTAL_TTL_MINUTES, DOCTOR_PENDING_BACKLOG_MS, DOCTOR_PROVIDER_ENVIRONMENTS, DOCTOR_REQUIRED_BRANDING, DOCTOR_REQUIRED_LEGAL_LINKS, DOCTOR_SEVERITIES, DateTimeSchema, DoctorCatalog, DoctorCatalogSchema, DoctorEmails, DoctorEmailsSchema, DoctorEndpoint, DoctorEndpointDiagnosis, DoctorEndpointSchema, DoctorFacts, DoctorHosted, DoctorHostedSchema, DoctorProvider, DoctorProviderSchema, DoctorReport, DoctorReportSchema, DoctorSettings, DoctorSettingsSchema, DoctorSeverity, DoctorSeveritySchema, DoctorUnsellablePrice, DoctorUnsellablePriceSchema, DoctorUnsellableReason, DoctorWarning, DoctorWarningCode, DoctorWarningSchema, EMAIL_LOCALES, EMAIL_TEMPLATES, EMAIL_TEMPLATE_BY_EVENT, ERROR_CATEGORIES, ERROR_CODES, EVENT_DETAIL_SCHEMAS, EVENT_TYPES, EmailExtraTextSchema, EmailLocale, EmailRelevanceFacts, EmailSenderSchema, EmailSettings, EmailSettingsPatch, EmailSettingsPatchSchema, EmailSettingsSchema, EmailTemplate, EmailTemplateSchema, EmailTemplateSettings, EmailTemplateSettingsSchema, EntitlementRulesCatalog, EntitlementRulesGrant, EntitlementSnapshot, EntitlementSnapshotSchema, EntitlementValue, EntitlementValueSchema, Entitlements, EntitlementsSchema, ErrorCategory, ErrorCategorySchema, ErrorCode, ErrorCodeSpec, ErrorResponse, ErrorResponseSchema, EventDetail, EventIdSchema, EventType, EventTypeSchema, ExternalRefSchema, FeatureDef, FeatureDefSchema, FeatureTypeSchema, Grant, GrantCreateInput, GrantCreateInputSchema, GrantCreateResponse, GrantCreateResponseSchema, GrantSchema, HEADER_ACTOR_REF, HEADER_API_VERSION, HEADER_IDEMPOTENCY_KEY, HEADER_REQUEST_ID, HEADER_SDK, HttpStatusResult, IdSchema, Interval, IntervalSchema, Invoice, InvoiceDocument, InvoiceIssueInput, InvoiceIssueInputSchema, InvoiceIssueResponse, InvoiceIssueResponseSchema, InvoiceLine, InvoiceLineSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceVoidInput, InvoiceVoidInputSchema, InvoiceVoidResponse, InvoiceVoidResponseSchema, LEGACY_EVENT_TYPES, LIVE_SUBSCRIPTION_STATUSES, LegacyEventType, MANUAL_INVOICE_MAX_AMOUNT_MINOR, MAX_CHECKOUT_CONSENT_DOCS, MAX_NOTIFICATION_EMAILS, ManualInvoiceInput, ManualInvoiceInputSchema, ManualInvoiceLineInput, ManualInvoiceLineInputSchema, ManualInvoiceResponse, ManualInvoiceResponseSchema, MetadataSchema, MutationOptions, NotificationEmailsSchema, PING_EVENT_TYPE, PLAN_SET_MODES, PORTAL_SESSION_ERRORS, Payment, PaymentSchema, Ping, PingSchema, PlanDef, PlanDefSchema, PlanSetInput, PlanSetInputSchema, PlanSetMode, PlanSetModeSchema, PlanSetResponse, PlanSetResponseSchema, PlanSetWarning, PlanSetWarningCode, PlanSetWarningSchema, PortalSession, PortalSessionCreateInput, PortalSessionCreateInputSchema, PortalSessionError, PortalSessionSchema, Price, PriceDef, PriceDefSchema, PriceSchema, ProductSettings, ProductSettingsPatch, ProductSettingsPatchSchema, ProductSettingsSchema, ProviderPayload, ProviderPayloadSchema, ResolveEntitlementsInput, ResolvedEntitlements, ResyncResult, ResyncResultSchema, type RetryClass, type RetryOptions, ReturnOriginSchema, SETTINGS_LOCALES, SettingsLocale, SettingsLocaleSchema, Stats, StatsSchema, Steward, StewardEnv, type StewardLocale, StewardLogger, StewardMe, StewardOptions, Subscription, SubscriptionSchema, SubscriptionStatus, SubscriptionStatusSchema, SubscriptionSummary, SubscriptionSummarySchema, TtlMinutesSchema, WEBHOOK_ENDPOINT_STATUSES, WEBHOOK_SECRET_PREFIX, WebUrlSchema, WebhookEndpoint, WebhookEndpointCreateInput, WebhookEndpointCreateInputSchema, WebhookEndpointList, WebhookEndpointListSchema, WebhookEndpointRotateInput, WebhookEndpointRotateInputSchema, WebhookEndpointSchema, WebhookEndpointStatus, WebhookEndpointStatusSchema, WebhookLastDelivery, WebhookLastDeliverySchema, WebhookSecretSchema, applyEmailSettingsPatch, applySettingsPatch, billingPageUrl, buildDoctorReport, checkoutRedirectUrl, createSteward, emailLocaleOf, emailReadinessOf, emailRecipients, emailTemplateOf, emailTemplateSettings, endpointDiagnosisOf, errorCodeSpec, generateWebhookSecret, hostedReadinessOf, httpStatusFor, isE164, isEmailRelevant, isEventType, isGrantActive, isKnownErrorCode, isLiveSubscriptionStatus, isReturnUrlAllowed, isValidTckn, isValidVkn, manualInvoiceTotals, resolveEntitlements, returnOriginsOf, splitInclusiveTax, uniqueEmails, webhookEndpointUrlProblem };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { $ as
|
|
1
|
+
import { $ as CurrencySchema, A as EMAIL_LOCALES, B as NotificationEmailsSchema, C as BillingProfileKindSchema, D as SubscriptionSummarySchema, E as SubscriptionStatusSchema, F as EmailSettingsPatchSchema, G as emailTemplateOf, H as billingPageUrl, I as EmailSettingsSchema, J as uniqueEmails, K as emailTemplateSettings, L as EmailTemplateSchema, M as EMAIL_TEMPLATE_BY_EVENT, N as EmailExtraTextSchema, O as BILLING_PATH_PLACEHOLDERS, P as EmailSenderSchema, Q as CodeSchema, R as EmailTemplateSettingsSchema, S as AccountUpsertInputSchema, T as EntitlementSnapshotSchema, U as emailLocaleOf, V as applyEmailSettingsPatch, W as emailRecipients, X as ActorRefSchema, Y as API_VERSION, Z as AmountMinorSchema, _ as AccountProfileStateSchema, a as EVENT_TYPES, at as ErrorResponseSchema, b as AccountStateSchema, c as PING_EVENT_TYPE, ct as IntervalSchema, d as ACCOUNT_INCLUDES, et as DateTimeSchema, f as AccessStateSchema, g as AccountOpenCheckoutSchema, h as AccountLocaleSchema, i as EVENT_DETAIL_SCHEMAS, it as ErrorCategorySchema, j as EMAIL_TEMPLATES, k as BillingPathSchema, l as PingSchema, lt as MetadataSchema, m as AccountDunningStateSchema, n as ApiVersionSchema, nt as EntitlementValueSchema, o as EventIdSchema, ot as ExternalRefSchema, p as AccountDeleteResponseSchema, q as isEmailRelevant, r as BillingEventSchema, rt as EntitlementsSchema, s as LEGACY_EVENT_TYPES, st as IdSchema, t as AnyBillingEventSchema, tt as ERROR_CATEGORIES, u as isEventType, v as AccountScheduledChangeSchema, w as BillingProfileSchema, x as AccountSubscriptionStateSchema, y as AccountSchema, z as MAX_NOTIFICATION_EMAILS } from "./_chunks/events.js";
|
|
2
|
+
import { $ as InvoiceVoidResponseSchema, $t as PriceSchema, A as WebhookSecretSchema, At as checkoutRedirectUrl, B as errorCodeSpec, Bt as TtlMinutesSchema, C as WEBHOOK_SECRET_PREFIX, Ct as CheckoutSessionCreateInputSchema, D as WebhookEndpointSchema, Dt as ConsentSchema, E as WebhookEndpointRotateInputSchema, Et as CheckoutStatusSchema, F as PlanSetModeSchema, Ft as ProductSettingsPatchSchema, G as CheckoutSessionResponseSchema, Gt as AccountsRefreshResultSchema, H as AccountDetailSchema, Ht as applySettingsPatch, I as PlanSetResponseSchema, It as ProductSettingsSchema, J as HEADER_API_VERSION, Jt as CatalogSyncResultSchema, K as GrantCreateResponseSchema, Kt as CatalogSchema, L as PlanSetWarningSchema, Lt as ReturnOriginSchema, M as webhookEndpointUrlProblem, Mt as BrandingSchema, N as PLAN_SET_MODES, Nt as DEFAULT_CHECKOUT_TTL_MINUTES, O as WebhookEndpointStatusSchema, Ot as MAX_CHECKOUT_CONSENT_DOCS, P as PlanSetInputSchema, Pt as DEFAULT_PORTAL_TTL_MINUTES, Q as InvoiceIssueResponseSchema, Qt as PriceDefSchema, R as ResyncResultSchema, Rt as SETTINGS_LOCALES, S as WEBHOOK_ENDPOINT_STATUSES, St as CheckoutPrefillSchema, T as WebhookEndpointListSchema, Tt as CheckoutSessionSchema, U as AccountUpsertResponseSchema, Ut as isReturnUrlAllowed, V as isKnownErrorCode, Vt as WebUrlSchema, W as CancelSubscriptionResponseSchema, Wt as returnOriginsOf, X as HEADER_REQUEST_ID, Xt as FeatureTypeSchema, Y as HEADER_IDEMPOTENCY_KEY, Yt as FeatureDefSchema, Z as HEADER_SDK, Zt as PlanDefSchema, _ as emailReadinessOf, _t as PORTAL_SESSION_ERRORS, a as DOCTOR_SEVERITIES, at as InvoiceVoidInputSchema, b as DEFAULT_ENDPOINT_EVENT_TYPES, bt as CHECKOUT_ERRORS, c as DoctorEndpointSchema, ct as ManualInvoiceLineInputSchema, d as DoctorReportSchema, dt as CancelSubscriptionInputSchema, et as ManualInvoiceResponseSchema, f as DoctorSettingsSchema, ft as GrantCreateInputSchema, g as buildDoctorReport, gt as SubscriptionSchema, h as DoctorWarningSchema, ht as StatsSchema, i as DOCTOR_REQUIRED_LEGAL_LINKS, it as InvoiceStatusSchema, j as generateWebhookSecret, jt as BrandingPatchSchema, k as WebhookLastDeliverySchema, kt as ProviderPayloadSchema, l as DoctorHostedSchema, lt as manualInvoiceTotals, m as DoctorUnsellablePriceSchema, mt as PaymentSchema, n as DOCTOR_PROVIDER_ENVIRONMENTS, nt as InvoiceLineSchema, o as DoctorCatalogSchema, ot as MANUAL_INVOICE_MAX_AMOUNT_MINOR, p as DoctorSeveritySchema, pt as GrantSchema, q as HEADER_ACTOR_REF, qt as CatalogSyncInputSchema, r as DOCTOR_REQUIRED_BRANDING, rt as InvoiceSchema, s as DoctorEmailsSchema, st as ManualInvoiceInputSchema, t as DOCTOR_PENDING_BACKLOG_MS, tt as InvoiceIssueInputSchema, u as DoctorProviderSchema, ut as splitInclusiveTax, v as endpointDiagnosisOf, vt as PortalSessionCreateInputSchema, w as WebhookEndpointCreateInputSchema, wt as CheckoutSessionCreatedSchema, x as EventTypeSchema, xt as CheckoutConsentInputSchema, y as hostedReadinessOf, yt as PortalSessionSchema, z as ERROR_CODES, zt as SettingsLocaleSchema } from "./_chunks/src.js";
|
|
3
3
|
import { a as isGrantActive, i as LIVE_SUBSCRIPTION_STATUSES, n as isValidTckn, o as isLiveSubscriptionStatus, r as isValidVkn, s as resolveEntitlements, t as isE164 } from "./_chunks/validators.js";
|
|
4
4
|
import { t as createSteward } from "./_chunks/steward.js";
|
|
5
5
|
import { a as StewardNetworkError, i as StewardError, n as StewardConfigError, r as StewardContractError, t as StewardApiError } from "./_chunks/errors.js";
|
|
@@ -518,4 +518,4 @@ function defineCatalog(definition) {
|
|
|
518
518
|
});
|
|
519
519
|
}
|
|
520
520
|
//#endregion
|
|
521
|
-
export { ACCOUNT_INCLUDES, API_VERSION, AccessStateSchema, AccountDeleteResponseSchema, AccountDetailSchema, AccountDunningStateSchema, AccountOpenCheckoutSchema, AccountProfileStateSchema, AccountScheduledChangeSchema, AccountSchema, AccountStateSchema, AccountSubscriptionStateSchema, AccountUpsertInputSchema, AccountUpsertResponseSchema, AccountsRefreshResultSchema, ActorRefSchema, AmountMinorSchema, AnyBillingEventSchema, ApiVersionSchema, BillingEventSchema, BillingProfileKindSchema, BillingProfileSchema, BrandingPatchSchema, BrandingSchema, CHECKOUT_ERRORS, CancelSubscriptionInputSchema, CancelSubscriptionResponseSchema, CatalogSchema, CatalogSyncInputSchema, CatalogSyncResultSchema, CheckoutConsentInputSchema, CheckoutPrefillSchema, CheckoutSessionCreateInputSchema, CheckoutSessionCreatedSchema, CheckoutSessionResponseSchema, CheckoutSessionSchema, CheckoutStatusSchema, CodeSchema, ConsentSchema, CurrencySchema, DEFAULT_CHECKOUT_TTL_MINUTES, DEFAULT_ENDPOINT_EVENT_TYPES, DEFAULT_PORTAL_TTL_MINUTES, DOCTOR_PENDING_BACKLOG_MS, DOCTOR_PROVIDER_ENVIRONMENTS, DOCTOR_REQUIRED_BRANDING, DOCTOR_REQUIRED_LEGAL_LINKS, DOCTOR_SEVERITIES, DateTimeSchema, DoctorCatalogSchema, DoctorEndpointSchema, DoctorHostedSchema, DoctorProviderSchema, DoctorReportSchema, DoctorSettingsSchema, DoctorSeveritySchema, DoctorUnsellablePriceSchema, DoctorWarningSchema, ERROR_CATEGORIES, ERROR_CODES, EVENT_DETAIL_SCHEMAS, EVENT_TYPES, EntitlementSnapshotSchema, EntitlementValueSchema, EntitlementsSchema, ErrorCategorySchema, ErrorResponseSchema, EventIdSchema, EventTypeSchema, ExternalRefSchema, FeatureDefSchema, FeatureTypeSchema, GrantCreateInputSchema, GrantCreateResponseSchema, GrantSchema, HEADER_ACTOR_REF, HEADER_API_VERSION, HEADER_IDEMPOTENCY_KEY, HEADER_REQUEST_ID, HEADER_SDK, IdSchema, IntervalSchema, InvoiceIssueInputSchema, InvoiceIssueResponseSchema, InvoiceLineSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceVoidInputSchema, InvoiceVoidResponseSchema, LEGACY_EVENT_TYPES, LIVE_SUBSCRIPTION_STATUSES, MANUAL_INVOICE_MAX_AMOUNT_MINOR, MAX_CHECKOUT_CONSENT_DOCS, ManualInvoiceInputSchema, ManualInvoiceLineInputSchema, ManualInvoiceResponseSchema, MetadataSchema, PING_EVENT_TYPE, PLAN_SET_MODES, PORTAL_SESSION_ERRORS, PaymentSchema, PingSchema, PlanDefSchema, PlanSetInputSchema, PlanSetModeSchema, PlanSetResponseSchema, PlanSetWarningSchema, PortalSessionCreateInputSchema, PortalSessionSchema, PriceDefSchema, PriceSchema, ProductSettingsPatchSchema, ProductSettingsSchema, ProviderPayloadSchema, ResyncResultSchema, ReturnOriginSchema, SETTINGS_LOCALES, SettingsLocaleSchema, StatsSchema, StewardApiError, StewardConfigError, StewardContractError, StewardError, StewardNetworkError, SubscriptionSchema, SubscriptionStatusSchema, SubscriptionSummarySchema, TtlMinutesSchema, WEBHOOK_ENDPOINT_STATUSES, WEBHOOK_SECRET_PREFIX, WebUrlSchema, WebhookEndpointCreateInputSchema, WebhookEndpointListSchema, WebhookEndpointRotateInputSchema, WebhookEndpointSchema, WebhookEndpointStatusSchema, WebhookLastDeliverySchema, WebhookSecretSchema, applySettingsPatch, buildDoctorReport, checkoutRedirectUrl, createSteward, defineCatalog, endpointDiagnosisOf, errorCodeSpec, flag, generateWebhookSecret, hostedReadinessOf, httpStatusFor, isE164, isEventType, isGrantActive, isKnownErrorCode, isLiveSubscriptionStatus, isReturnUrlAllowed, isValidTckn, isValidVkn, limit, manualInvoiceTotals, resolveEntitlements, returnOriginsOf, splitInclusiveTax, stateCache, text, webhookEndpointUrlProblem };
|
|
521
|
+
export { ACCOUNT_INCLUDES, API_VERSION, AccessStateSchema, AccountDeleteResponseSchema, AccountDetailSchema, AccountDunningStateSchema, AccountLocaleSchema, AccountOpenCheckoutSchema, AccountProfileStateSchema, AccountScheduledChangeSchema, AccountSchema, AccountStateSchema, AccountSubscriptionStateSchema, AccountUpsertInputSchema, AccountUpsertResponseSchema, AccountsRefreshResultSchema, ActorRefSchema, AmountMinorSchema, AnyBillingEventSchema, ApiVersionSchema, BILLING_PATH_PLACEHOLDERS, BillingEventSchema, BillingPathSchema, BillingProfileKindSchema, BillingProfileSchema, BrandingPatchSchema, BrandingSchema, CHECKOUT_ERRORS, CancelSubscriptionInputSchema, CancelSubscriptionResponseSchema, CatalogSchema, CatalogSyncInputSchema, CatalogSyncResultSchema, CheckoutConsentInputSchema, CheckoutPrefillSchema, CheckoutSessionCreateInputSchema, CheckoutSessionCreatedSchema, CheckoutSessionResponseSchema, CheckoutSessionSchema, CheckoutStatusSchema, CodeSchema, ConsentSchema, CurrencySchema, DEFAULT_CHECKOUT_TTL_MINUTES, DEFAULT_ENDPOINT_EVENT_TYPES, DEFAULT_PORTAL_TTL_MINUTES, DOCTOR_PENDING_BACKLOG_MS, DOCTOR_PROVIDER_ENVIRONMENTS, DOCTOR_REQUIRED_BRANDING, DOCTOR_REQUIRED_LEGAL_LINKS, DOCTOR_SEVERITIES, DateTimeSchema, DoctorCatalogSchema, DoctorEmailsSchema, DoctorEndpointSchema, DoctorHostedSchema, DoctorProviderSchema, DoctorReportSchema, DoctorSettingsSchema, DoctorSeveritySchema, DoctorUnsellablePriceSchema, DoctorWarningSchema, EMAIL_LOCALES, EMAIL_TEMPLATES, EMAIL_TEMPLATE_BY_EVENT, ERROR_CATEGORIES, ERROR_CODES, EVENT_DETAIL_SCHEMAS, EVENT_TYPES, EmailExtraTextSchema, EmailSenderSchema, EmailSettingsPatchSchema, EmailSettingsSchema, EmailTemplateSchema, EmailTemplateSettingsSchema, EntitlementSnapshotSchema, EntitlementValueSchema, EntitlementsSchema, ErrorCategorySchema, ErrorResponseSchema, EventIdSchema, EventTypeSchema, ExternalRefSchema, FeatureDefSchema, FeatureTypeSchema, GrantCreateInputSchema, GrantCreateResponseSchema, GrantSchema, HEADER_ACTOR_REF, HEADER_API_VERSION, HEADER_IDEMPOTENCY_KEY, HEADER_REQUEST_ID, HEADER_SDK, IdSchema, IntervalSchema, InvoiceIssueInputSchema, InvoiceIssueResponseSchema, InvoiceLineSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceVoidInputSchema, InvoiceVoidResponseSchema, LEGACY_EVENT_TYPES, LIVE_SUBSCRIPTION_STATUSES, MANUAL_INVOICE_MAX_AMOUNT_MINOR, MAX_CHECKOUT_CONSENT_DOCS, MAX_NOTIFICATION_EMAILS, ManualInvoiceInputSchema, ManualInvoiceLineInputSchema, ManualInvoiceResponseSchema, MetadataSchema, NotificationEmailsSchema, PING_EVENT_TYPE, PLAN_SET_MODES, PORTAL_SESSION_ERRORS, PaymentSchema, PingSchema, PlanDefSchema, PlanSetInputSchema, PlanSetModeSchema, PlanSetResponseSchema, PlanSetWarningSchema, PortalSessionCreateInputSchema, PortalSessionSchema, PriceDefSchema, PriceSchema, ProductSettingsPatchSchema, ProductSettingsSchema, ProviderPayloadSchema, ResyncResultSchema, ReturnOriginSchema, SETTINGS_LOCALES, SettingsLocaleSchema, StatsSchema, StewardApiError, StewardConfigError, StewardContractError, StewardError, StewardNetworkError, SubscriptionSchema, SubscriptionStatusSchema, SubscriptionSummarySchema, TtlMinutesSchema, WEBHOOK_ENDPOINT_STATUSES, WEBHOOK_SECRET_PREFIX, WebUrlSchema, WebhookEndpointCreateInputSchema, WebhookEndpointListSchema, WebhookEndpointRotateInputSchema, WebhookEndpointSchema, WebhookEndpointStatusSchema, WebhookLastDeliverySchema, WebhookSecretSchema, applyEmailSettingsPatch, applySettingsPatch, billingPageUrl, buildDoctorReport, checkoutRedirectUrl, createSteward, defineCatalog, emailLocaleOf, emailReadinessOf, emailRecipients, emailTemplateOf, emailTemplateSettings, endpointDiagnosisOf, errorCodeSpec, flag, generateWebhookSecret, hostedReadinessOf, httpStatusFor, isE164, isEmailRelevant, isEventType, isGrantActive, isKnownErrorCode, isLiveSubscriptionStatus, isReturnUrlAllowed, isValidTckn, isValidVkn, limit, manualInvoiceTotals, resolveEntitlements, returnOriginsOf, splitInclusiveTax, stateCache, text, uniqueEmails, webhookEndpointUrlProblem };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { D as AccountInclude,
|
|
1
|
+
import { Or as CheckoutSessionCreated, Tr as CheckoutSessionCreateInput, bi as Interval, br as CheckoutPrefill, dr as PortalSession, fr as PortalSessionCreateInput, jr as CheckoutStatus, xn as CheckoutSessionResponse } from "./_chunks/index.js";
|
|
2
|
+
import { D as AccountInclude, H as BillingProfile, I as AccountState, a as BillingEvent, f as EventType, n as AnyBillingEvent, o as BillingEventOf } from "./_chunks/events.js";
|
|
3
3
|
import { r as MutationOptions } from "./_chunks/steward.js";
|
|
4
4
|
import { r as StewardLogger, t as StewardLocale } from "./_chunks/locale.js";
|
|
5
5
|
import { a as HeaderSource, s as VerifyRawFailure } from "./_chunks/webhook-core.js";
|
package/dist/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { X as ActorRefSchema, a as EVENT_TYPES, b as AccountStateSchema, c as PING_EVENT_TYPE, l as PingSchema, ot as ExternalRefSchema, r as BillingEventSchema, st as IdSchema, t as AnyBillingEventSchema } from "./_chunks/events.js";
|
|
2
2
|
import "./_chunks/src.js";
|
|
3
3
|
import { n as StewardConfigError, r as StewardContractError, t as StewardApiError } from "./_chunks/errors.js";
|
|
4
4
|
import { i as verifyWebhookRaw } from "./_chunks/webhook.js";
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { $n as CancelSubscriptionInputSchema, An as InvoiceIssueResponse, At as EmailTemplate, Cn as GrantCreateResponse, Dr as CheckoutSessionCreateParsed, Gr as CatalogSyncResult, In as Invoice, Kt as PlanSetInputSchema, Nr as Consent, Or as CheckoutSessionCreated, Rn as InvoiceIssueInputSchema, Ur as CatalogSyncInput, Wr as CatalogSyncInputSchema, Yt as PlanSetResponse, _n as AccountUpsertResponse, at as ProductSettingsPatch, bi as Interval, br as CheckoutPrefill, dn as ErrorCode, dr as PortalSession, en as ResyncResult, hn as AccountDetail, it as ProductSettings, nr as GrantCreateInputSchema, or as Stats, pr as PortalSessionCreateInputSchema, qr as FeatureDef, ui as EntitlementValue, wr as CheckoutSession, xn as CheckoutSessionResponse, yn as CancelSubscriptionResponse, zr as AccountsRefreshResult } from "./_chunks/index.js";
|
|
2
|
+
import { C as AccountDeleteResponse, D as AccountInclude, H as BillingProfile, I as AccountState, J as SubscriptionStatus, V as AccountUpsertInputSchema, a as BillingEvent, f as EventType, o as BillingEventOf, u as EventDetail } from "./_chunks/events.js";
|
|
3
3
|
import { i as Steward, s as StewardOptions } from "./_chunks/steward.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#endregion
|
|
@@ -48,6 +48,10 @@ type AccountRow = {
|
|
|
48
48
|
/** Yazılan her durum (version sırasıyla); `simulate.deliver({outOfOrder})` eski durumu buradan alır. */
|
|
49
49
|
history: AccountState[];
|
|
50
50
|
profile: BillingProfile | null;
|
|
51
|
+
/** Extra billing email recipients (`PUT /v1/accounts/:ref` `notificationEmails`). */
|
|
52
|
+
notificationEmails: string[];
|
|
53
|
+
/** Billing email language set by the product. */
|
|
54
|
+
locale: "tr" | "en" | null;
|
|
51
55
|
/** KVKK anonimleştirme anı (F4e, `deleteAccount`); doluysa hesap yolunun uçları 410. */
|
|
52
56
|
deletedAt?: Ms;
|
|
53
57
|
};
|
|
@@ -196,6 +200,15 @@ type EventRow = {
|
|
|
196
200
|
/** Endpoint yoksa ya da filtresi tipi içermiyorsa null. */
|
|
197
201
|
delivery: DeliveryRow | null;
|
|
198
202
|
};
|
|
203
|
+
/** A billing email the fake steward sent (`fake.emails()`). */
|
|
204
|
+
type EmailRow = {
|
|
205
|
+
eventId: string;
|
|
206
|
+
template: EmailTemplate;
|
|
207
|
+
accountRef: string;
|
|
208
|
+
to: string[];
|
|
209
|
+
locale: "tr" | "en";
|
|
210
|
+
sentAt: Ms;
|
|
211
|
+
};
|
|
199
212
|
type World = {
|
|
200
213
|
readonly productCode: string;
|
|
201
214
|
/** Ürün ayarları (`GET/PATCH /v1/admin/settings`; checkout TTL ve dönüş origin'i buradan). */
|
|
@@ -224,6 +237,7 @@ type World = {
|
|
|
224
237
|
invoices: InvoiceRow[];
|
|
225
238
|
grants: GrantRow[];
|
|
226
239
|
events: EventRow[];
|
|
240
|
+
emails: EmailRow[];
|
|
227
241
|
now(): Ms;
|
|
228
242
|
/** Saati ileri alır (geri almaz). */
|
|
229
243
|
setNow(ms: Ms): void;
|
|
@@ -588,9 +602,25 @@ type FakeSteward = {
|
|
|
588
602
|
connect(handler: FakeWebhookHandler): void;
|
|
589
603
|
/** Published events in publish order (the outbox; legacy types carry the full state too). */
|
|
590
604
|
events(ref?: string): readonly BillingEvent[];
|
|
605
|
+
/**
|
|
606
|
+
* Billing emails steward would send (issue #15), in send order. The fake applies the
|
|
607
|
+
* service's rules (template switch, send-time relevance, recipients, locale) immediately
|
|
608
|
+
* when the event is published; skipped emails are not listed. Content is not rendered.
|
|
609
|
+
*/
|
|
610
|
+
emails(ref?: string): readonly FakeEmail[];
|
|
591
611
|
/** Sahte saat. */
|
|
592
612
|
now(): Date;
|
|
593
613
|
};
|
|
614
|
+
type FakeEmail = {
|
|
615
|
+
/** Triggering event (`fake.events()`); one email per event. */
|
|
616
|
+
eventId: string;
|
|
617
|
+
template: EmailTemplate;
|
|
618
|
+
accountRef: string;
|
|
619
|
+
/** Billing profile email first, then the account's `notificationEmails`. */
|
|
620
|
+
to: readonly string[];
|
|
621
|
+
locale: "tr" | "en";
|
|
622
|
+
sentAt: string;
|
|
623
|
+
};
|
|
594
624
|
export declare function createFakeSteward(options?: FakeStewardOptions): FakeSteward;
|
|
595
625
|
//#endregion
|
|
596
626
|
//#region src/testing/signed-event.d.ts
|
|
@@ -623,4 +653,4 @@ type SignedEvent<T extends EventType = EventType> = {
|
|
|
623
653
|
};
|
|
624
654
|
export declare function signedEvent<T extends EventType>(type: T, overrides?: SignedEventOverrides<T>, options?: SignedEventOptions): SignedEvent<T>;
|
|
625
655
|
//#endregion
|
|
626
|
-
export type { FakeDeliverOptions, FakeDelivery, FakeDunningPolicy, FakeHostedCheckoutResult, FakePortalActionResult, FakeRequest, FakeSimulate, FakeSteward, FakeStewardOptions, FakeWebhookHandler, FakeWebhookOptions, SignedEvent, SignedEventOptions, SignedEventOverrides };
|
|
656
|
+
export type { FakeDeliverOptions, FakeDelivery, FakeDunningPolicy, FakeEmail, FakeHostedCheckoutResult, FakePortalActionResult, FakeRequest, FakeSimulate, FakeSteward, FakeStewardOptions, FakeWebhookHandler, FakeWebhookOptions, SignedEvent, SignedEventOptions, SignedEventOverrides };
|
package/dist/testing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { G as emailTemplateOf, K as emailTemplateSettings, S as AccountUpsertInputSchema, U as emailLocaleOf, W as emailRecipients, X as ActorRefSchema, Y as API_VERSION, a as EVENT_TYPES, d as ACCOUNT_INCLUDES, i as EVENT_DETAIL_SCHEMAS, ot as ExternalRefSchema, q as isEmailRelevant, r as BillingEventSchema, s as LEGACY_EVENT_TYPES, st as IdSchema, w as BillingProfileSchema } from "./_chunks/events.js";
|
|
2
|
+
import { At as checkoutRedirectUrl, Ct as CheckoutSessionCreateInputSchema, E as WebhookEndpointRotateInputSchema, Ft as ProductSettingsPatchSchema, Ht as applySettingsPatch, It as ProductSettingsSchema, M as webhookEndpointUrlProblem, P as PlanSetInputSchema, Ut as isReturnUrlAllowed, X as HEADER_REQUEST_ID, Y as HEADER_IDEMPOTENCY_KEY, at as InvoiceVoidInputSchema, b as DEFAULT_ENDPOINT_EVENT_TYPES, dt as CancelSubscriptionInputSchema, ft as GrantCreateInputSchema, g as buildDoctorReport, lt as manualInvoiceTotals, q as HEADER_ACTOR_REF, qt as CatalogSyncInputSchema, st as ManualInvoiceInputSchema, tt as InvoiceIssueInputSchema, ut as splitInclusiveTax, vt as PortalSessionCreateInputSchema, w as WebhookEndpointCreateInputSchema, z as ERROR_CODES } from "./_chunks/src.js";
|
|
3
3
|
import { i as LIVE_SUBSCRIPTION_STATUSES, r as isValidVkn, s as resolveEntitlements, t as isE164 } from "./_chunks/validators.js";
|
|
4
4
|
import { t as createSteward } from "./_chunks/steward.js";
|
|
5
5
|
import { n as signWebhook } from "./_chunks/webhook.js";
|
|
@@ -54,6 +54,7 @@ function createWorld(options) {
|
|
|
54
54
|
invoices: [],
|
|
55
55
|
grants: [],
|
|
56
56
|
events: [],
|
|
57
|
+
emails: [],
|
|
57
58
|
now,
|
|
58
59
|
setNow: (ms) => {
|
|
59
60
|
const current = now();
|
|
@@ -297,8 +298,33 @@ function emitEvent(w, ref, state, event) {
|
|
|
297
298
|
deliveredAt: null
|
|
298
299
|
} : null
|
|
299
300
|
});
|
|
301
|
+
sendEmail(w, ref, state, event, id);
|
|
300
302
|
return id;
|
|
301
303
|
}
|
|
304
|
+
/** The service's email/sender.ts rules without transport (skipped emails are not recorded). */
|
|
305
|
+
function sendEmail(w, ref, state, event, eventId) {
|
|
306
|
+
const template = emailTemplateOf(event.type);
|
|
307
|
+
const row = w.accounts.get(ref);
|
|
308
|
+
if (template === null || !row || row.deletedAt !== void 0) return;
|
|
309
|
+
if (!emailTemplateSettings(w.settings.emails, template).enabled) return;
|
|
310
|
+
const detail = event.detail;
|
|
311
|
+
if (!isEmailRelevant(template, {
|
|
312
|
+
state,
|
|
313
|
+
subscriptionId: detail.subscriptionId ?? null,
|
|
314
|
+
invoiceStatus: "issued"
|
|
315
|
+
})) return;
|
|
316
|
+
const to = emailRecipients(row.profile?.email, row.notificationEmails);
|
|
317
|
+
if (to.length === 0) return;
|
|
318
|
+
const lastSession = w.sessions.filter((s) => s.accountRef === ref).sort((a, b) => b.createdAt - a.createdAt)[0];
|
|
319
|
+
w.emails.push({
|
|
320
|
+
eventId,
|
|
321
|
+
template,
|
|
322
|
+
accountRef: ref,
|
|
323
|
+
to,
|
|
324
|
+
locale: emailLocaleOf(row.locale, lastSession?.locale, w.settings.defaultLocale),
|
|
325
|
+
sentAt: w.now()
|
|
326
|
+
});
|
|
327
|
+
}
|
|
302
328
|
const SNAPSHOT_KEYS = [
|
|
303
329
|
"planCode",
|
|
304
330
|
"accessState",
|
|
@@ -575,7 +601,9 @@ function toAccount(row) {
|
|
|
575
601
|
displayName: row.displayName,
|
|
576
602
|
metadata: row.metadata,
|
|
577
603
|
createdAt: iso(row.createdAt),
|
|
578
|
-
snapshot: toSnapshot(stateOf(row))
|
|
604
|
+
snapshot: toSnapshot(stateOf(row)),
|
|
605
|
+
notificationEmails: [...row.notificationEmails],
|
|
606
|
+
locale: row.locale
|
|
579
607
|
};
|
|
580
608
|
}
|
|
581
609
|
function stateOf(row) {
|
|
@@ -594,13 +622,17 @@ function upsertAccount(w, ref, input) {
|
|
|
594
622
|
version: 0,
|
|
595
623
|
state: null,
|
|
596
624
|
history: [],
|
|
597
|
-
profile: null
|
|
625
|
+
profile: null,
|
|
626
|
+
notificationEmails: input.notificationEmails ?? [],
|
|
627
|
+
locale: input.locale ?? null
|
|
598
628
|
};
|
|
599
629
|
computeState(w, row, w.now());
|
|
600
630
|
w.accounts.set(ref, row);
|
|
601
631
|
} else {
|
|
602
632
|
row.displayName = input.displayName;
|
|
603
633
|
row.metadata = input.metadata;
|
|
634
|
+
if (input.notificationEmails !== void 0) row.notificationEmails = input.notificationEmails;
|
|
635
|
+
if (input.locale !== void 0) row.locale = input.locale;
|
|
604
636
|
}
|
|
605
637
|
const { state } = commitAccountChange(w, ref, "account.upserted");
|
|
606
638
|
return {
|
|
@@ -1209,6 +1241,8 @@ function deleteAccount(w, ref, actorRef) {
|
|
|
1209
1241
|
displayName: "",
|
|
1210
1242
|
metadata: {},
|
|
1211
1243
|
profile: null,
|
|
1244
|
+
notificationEmails: [],
|
|
1245
|
+
locale: null,
|
|
1212
1246
|
deletedAt: now
|
|
1213
1247
|
});
|
|
1214
1248
|
for (const event of w.events) {
|
|
@@ -1891,7 +1925,11 @@ function doctorReport(w) {
|
|
|
1891
1925
|
oldestPendingAt: null,
|
|
1892
1926
|
lastDelivery: null
|
|
1893
1927
|
})),
|
|
1894
|
-
dunning: { dryRun: w.dunningPolicy.dryRun }
|
|
1928
|
+
dunning: { dryRun: w.dunningPolicy.dryRun },
|
|
1929
|
+
emailTransport: {
|
|
1930
|
+
configured: true,
|
|
1931
|
+
defaultFromConfigured: true
|
|
1932
|
+
}
|
|
1895
1933
|
});
|
|
1896
1934
|
}
|
|
1897
1935
|
const cmp = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
@@ -3631,6 +3669,14 @@ function createFakeSteward(options = {}) {
|
|
|
3631
3669
|
handler = next;
|
|
3632
3670
|
},
|
|
3633
3671
|
events: (ref) => w.events.filter((e) => ref === void 0 || e.accountRef === ref).map((e) => e.payload),
|
|
3672
|
+
emails: (ref) => w.emails.filter((e) => ref === void 0 || e.accountRef === ref).map((e) => ({
|
|
3673
|
+
eventId: e.eventId,
|
|
3674
|
+
template: e.template,
|
|
3675
|
+
accountRef: e.accountRef,
|
|
3676
|
+
to: [...e.to],
|
|
3677
|
+
locale: e.locale,
|
|
3678
|
+
sentAt: new Date(e.sentAt).toISOString()
|
|
3679
|
+
})),
|
|
3634
3680
|
now: () => new Date(w.now())
|
|
3635
3681
|
};
|
|
3636
3682
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stewardhq/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Steward SDK: contract schemas, typed API client and webhook signing.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -45,8 +45,7 @@
|
|
|
45
45
|
],
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public",
|
|
48
|
-
"registry": "https://registry.npmjs.org"
|
|
49
|
-
"provenance": true
|
|
48
|
+
"registry": "https://registry.npmjs.org"
|
|
50
49
|
},
|
|
51
50
|
"dependencies": {
|
|
52
51
|
"zod": "^4.0.0"
|
|
@@ -55,7 +54,7 @@
|
|
|
55
54
|
"@types/node": "^24.13.3",
|
|
56
55
|
"tsdown": "^0.23.0",
|
|
57
56
|
"typescript": "^5.9.0",
|
|
58
|
-
"vitest": "^
|
|
57
|
+
"vitest": "^5.0.1",
|
|
59
58
|
"workerd": "^1.20260916.1",
|
|
60
59
|
"@steward/contract": "0.2.0"
|
|
61
60
|
},
|