@stewardhq/sdk 0.5.0 → 0.6.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/LICENSE +201 -0
- package/README.md +229 -200
- package/dist/_chunks/events.d.ts +133 -122
- package/dist/_chunks/events.js +45 -7
- package/dist/_chunks/index.d.ts +970 -589
- package/dist/_chunks/locale.d.ts +3 -3
- package/dist/_chunks/src.js +130 -18
- package/dist/_chunks/validators.d.ts +2 -2
- package/dist/_chunks/webhook-core.d.ts +2 -2
- package/dist/contract.d.ts +2 -2
- package/dist/contract.js +3 -3
- package/dist/index.d.ts +24 -24
- package/dist/index.js +4 -4
- package/dist/server.d.ts +32 -20
- package/dist/server.js +7 -3
- package/package.json +14 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { $ as WebhookEndpointStatus, $a as CatalogPlanSchema, $i as ManualInvoiceInputSchema, $n as matchesFilter, $o as MAX_METERED_PRICE_PER_UNITS, $r as ErrorCode, $s as canonicalMeterFilter, $t as EmailExtraTextSchema, A as DoctorSeveritySchema, Aa as CheckoutPrefillSchema, Ai as MeResponse, An as PLAN_SET_MODES, Ao as CatalogBenefit, Ar as IngestRejectCode, As as MeterFilterClause, At as PaymentDueDaysSchema, B as hostedReadinessOf, Ba as CheckoutStatus, Bi as InvoiceLineSchema, Bn as ResyncResult, Bo as featureValueMatchesType, Br as FEATURE_FLAG_BENEFIT_TYPE, Bs as MeterPeriod, Bt as WebUrlSchema, C as DoctorProvider, Ca as PortalSessionError, Cc as InvoiceBillingReason, Ci as InvoiceIssueResponseSchema, Cn as emailLocaleOf, Co as BenefitDefSchema, Cr as EventsIngestInput, Cs as MeterCreditEntrySchema, Ct as LateGraceMinutesSchema, D as DoctorSettings, Da as CheckoutConsentInputSchema, Dc as MetadataSchema, Di as InvoiceWaiveResponseSchema, Dn as isEmailRelevant, Do as BenefitSourceSchema, Dr as INGEST_REJECT_CODES, Ds as MeterDefInput, Dt as MeteringSettings, E as DoctorReportSchema, Ea as CheckoutConsentInput, Ec as InvoicePaymentStatusSchema, Ei as InvoiceWaiveResponse, En as emailTemplateSettings, Eo as BenefitFeatureType, Er as EventsIngestResultSchema, Es as MeterDef, Et as MeterChargeModeSchema, F as DoctorWarningCode, Fa as CheckoutSessionCreateInputSchema, Fi as UncancelSubscriptionResponseSchema, Fn as PlanSetResponse, Fo as FeatureFlagProperties, Fr as isEventTimestampInRange, Fs as MeterFilterSchema, Ft as ReturnOriginSchema, G as WebhookEndpoint, Ga as MAX_CHECKOUT_CONSENT_DOCS, Gi as InvoiceSchema, Gn as MeterCreditBenefit, Go as AccountMeters, Gr as ResolvedBenefit, Gs as MeterPeriodStatusSchema, Gt as meteringSettingsOf, H as EventTypeSchema, Ha as Consent, Hi as InvoicePaymentSessionCreateInput, Hn as GrantedMeterCredit, Ho as isMeterCreditBenefit, Hr as OVERRIDE_BENEFIT_SOURCE, Hs as MeterPeriodListSchema, Ht as billingSettingsOf, I as DoctorWarningSchema, Ia as CheckoutSessionCreateParsed, Ii as Invoice, In as PlanSetResponseSchema, Io as FeatureFlagPropertiesSchema, Ir as BenefitRulesDefinition, Is as MeterFilterValue, It as SETTINGS_LOCALES, J as WebhookEndpointList, Ja as checkoutRedirectUrl, Ji as InvoiceVoidInputSchema, Jn as MeterRulesMeter, Jo as CatalogMeterSchema, Jr as isGrantActive, Js as MeterUnitsSchema, Jt as BillingPathSchema, K as WebhookEndpointCreateInput, Ka as ProviderPayload, Ki as InvoiceStatusSchema, Kn as MeterCreditsOptions, Ko as AccountMetersSchema, Kr as ResolvedBenefits, Ks as MeterStanding, Kt as returnOriginsOf, L as buildDoctorReport, La as CheckoutSessionCreated, Li as InvoiceIssueInput, Ln as PlanSetWarning, Lo as MeterCreditAccountBenefit, Lr as BenefitRulesSubscription, Ls as MeterLabel, Lt as SettingsLocale, M as DoctorUnsellablePriceSchema, Ma as CheckoutReturnStatus, Mi as STEWARD_CAPABILITIES, Mn as PlanSetInputSchema, Mo as FeatureFlagAccountBenefit, Mr as IngestRejection, Ms as MeterFilterGroup, Mt as ProductSettingsPatch, N as DoctorUnsellableReason, Na as CheckoutSession, Ni as StewardCapability, Nn as PlanSetMode, No as FeatureFlagBenefitDef, Nr as IngestRejectionSchema, Ns as MeterFilterOperand, Nt as ProductSettingsPatchSchema, O as DoctorSettingsSchema, Oa as CheckoutError, Oi as ManualInvoiceResponse, On as liveSubscriptionOf, Oo as BenefitType, Or as IngestEvent, Os as MeterDefSchema, Ot as MeteringSettingsPatchSchema, P as DoctorWarning, Pa as CheckoutSessionCreateInput, Pi as UncancelSubscriptionResponse, Pn as PlanSetModeSchema, Po as FeatureFlagBenefitDefSchema, Pr as hasControlCharacters, Ps as MeterFilterOperator, Pt as ProductSettingsSchema, Q as WebhookEndpointSchema, Qa as CatalogPlan, Qi as ManualInvoiceInput, Qn as contributionOf, Qo as DecimalUnitsStringSchema, Qr as ERROR_CODES, Qs as MeteredPriceSchema, Qt as EMAIL_TEMPLATE_BY_EVENT, R as emailReadinessOf, Ra as CheckoutSessionCreatedSchema, Ri as InvoiceIssueInputSchema, Rn as PlanSetWarningCode, Ro as MeterCreditBenefitDef, Rr as EntitlementRulesCatalog, Rs as MeterLabelSchema, Rt as SettingsLocaleSchema, S as DoctorOverageSchema, Sa as PortalSessionCreateInputSchema, Sc as IntervalSchema, Si as InvoiceIssueResponse, Sn as billingPageUrl, So as BenefitDef, Sr as EventNameSchema, Ss as MeterCreditEntryKindSchema, St as EventsSettingsSchema, T as DoctorReport, Ta as CHECKOUT_ERRORS, Tc as InvoicePaymentStatus, Ti as InvoiceVoidResponseSchema, Tn as emailTemplateOf, To as BenefitDescriptionSchema, Tr as EventsIngestResult, Ts as MeterCreditPropertiesSchema, Tt as MeterChargeMode, U as WEBHOOK_ENDPOINT_STATUSES, Ua as ConsentSchema, Ui as InvoicePaymentSessionCreateInputSchema, Un as MeterChargeTotalsLine, Uo as AccountMeter, Ur as ResolveBenefitsInput, Us as MeterPeriodSchema, Ut as eventsSettingsOf, V as DEFAULT_ENDPOINT_EVENT_TYPES, Va as CheckoutStatusSchema, Vi as InvoicePaymentSession, Vn as ResyncResultSchema, Vo as isFeatureFlagBenefit, Vr as LIVE_SUBSCRIPTION_STATUSES, Vs as MeterPeriodList, Vt as applySettingsPatch, W as WEBHOOK_SECRET_PREFIX, Wa as INDIVIDUAL_IDENTITY_PLACEHOLDER, Wi as InvoicePaymentSessionSchema, Wn as MeterContribution, Wo as AccountMeterSchema, Wr as ResolveEntitlementsInput, Ws as MeterPeriodStatus, Wt as isReturnUrlAllowed, X as WebhookEndpointRotateInput, Xa as AccountsRefreshResultSchema, Xi as InvoiceWaiveInputSchema, Xn as addUtcMonths, Xo as CreditGrantInputSchema, Xr as resolveBenefits, Xs as MeteredPriceDef, Xt as EMAIL_PAYLOAD_SCHEMAS, Y as WebhookEndpointListSchema, Ya as AccountsRefreshResult, Yi as InvoiceWaiveInput, Yn as OverageRateInput, Yo as CreditGrantInput, Yr as isLiveSubscriptionStatus, Ys as MeteredPrice, Yt as EMAIL_LOCALES, Z as WebhookEndpointRotateInputSchema, Za as Catalog, Zi as MANUAL_INVOICE_MAX_AMOUNT_MINOR, Zn as consumptionOf, Zo as DEFAULT_METER_LOW_AT, Zr as resolveEntitlements, Zs as MeteredPriceDefSchema, Zt as EMAIL_TEMPLATES, _ as DoctorEventsSchema, _a as SubscriptionChangeInputSchema, _c as ExternalRefSchema, _i as HEADER_ACTOR_REF, _n as PriceChangeNoticeEmail, _o as PriceDefSchema, _r as EventMetadata, _s as MeterChargeSchema, _t as DEFAULT_PAYMENT_DUE_DAYS, a as DOCTOR_ROLLUP_LAG_WARN_SECONDS, aa as CancelSubscriptionInputSchema, ac as Currency, ai as AccountUpsertResponse, an as EmailSettingsPatchSchema, ao as FeatureDef, ar as rateOverage, as as METER_FILTER_MAX_DEPTH, at as webhookEndpointUrlProblem, b as DoctorHostedSchema, ba as PortalSession, bc as IdSchema, bi as HEADER_REQUEST_ID, bn as PriceChangeNoticeMeteredRateSchema, bo as AccountBenefitSchema, br as EventMetadataValue, bs as MeterCreditEntry, bt as EventsSettings, c as DoctorBillingSchema, ca as GrantCreateInputSchema, cc as ERROR_CATEGORIES, ci as CancelSubscriptionResponseSchema, cn as EmailTemplateSchema, co as MAX_CATALOG_BENEFITS, cr as EVENTS_INGEST_MAX_BYTES, cs as METER_STANDINGS, ct as BillingSettingsSchema, d as DoctorEmails, da as Payment, dc as Entitlements, di as CheckoutSessionResponse, dn as InvoicePaymentDueEmail, do as MAX_PLAN_BENEFITS, dr as EVENT_METADATA_MAX_PAIRS, ds as MeterAggregationSchema, dt as BrandingSchema, ea as ManualInvoiceLineInput, ec as meterFilterClauseOf, ei as ErrorCodeSpec, en as EmailLocale, eo as CatalogSchema, er as meterChargeTotals, es as MAX_METER_UNITS, et as WebhookEndpointStatusSchema, f as DoctorEmailsSchema, fa as PaymentSchema, fc as EntitlementsSchema, fi as CheckoutSessionResponseSchema, fn as InvoicePaymentDueEmailSchema, fo as METERED_PRICE_TAX_MISMATCH, fr as EVENT_METADATA_STRING_MAX_LENGTH, fs as MeterCharge, ft as DEFAULT_CHECKOUT_TTL_MINUTES, g as DoctorEvents, ga as SubscriptionChangeInput, gc as ErrorResponseSchema, gi as GrantCreateResponseSchema, gn as NotificationEmailsSchema, go as PriceDef, gr as EventExternalIdSchema, gs as MeterChargeListSchema, gt as DEFAULT_MIN_INVOICE_MINOR, h as DoctorEndpointSchema, ha as Subscription, hc as ErrorResponse, hi as GrantCreateResponse, hn as NoticedMeteredRateSchema, ho as Price, hr as EVENT_TIMESTAMP_MAX_SKEW_MINUTES, hs as MeterChargeList, ht as DEFAULT_METER_CHARGE_MODE, i as DOCTOR_REQUIRED_LEGAL_LINKS, ia as CancelSubscriptionInput, ic as CodeSchema, ii as AccountDetailSchema, in as EmailSettingsPatch, io as CatalogSyncResultSchema, ir as periodBoundsOf, is as METER_FILTER_MAX_CONDITIONS, it as generateWebhookSecret, j as DoctorUnsellablePrice, ja as CheckoutRedirectTarget, ji as MeResponseSchema, jn as PlanSetInput, jo as CatalogBenefitSchema, jr as IngestRejectCodeSchema, js as MeterFilterCondition, jt as ProductSettings, k as DoctorSeverity, ka as CheckoutPrefill, ki as ManualInvoiceResponseSchema, kn as uniqueEmails, ko as BenefitTypeSchema, kr as IngestEventSchema, ks as MeterFilter, kt as MeteringSettingsSchema, l as DoctorCatalog, la as GrantSchema, lc as EntitlementValue, li as ChangeSubscriptionResponse, ln as EmailTemplateSettings, lo as MAX_CATALOG_METERED_PRICES, lr as EVENTS_INGEST_MAX_EVENTS, ls as MeterAggregation, lt as Branding, m as DoctorEndpointDiagnosis, ma as StatsSchema, mc as ErrorCategorySchema, mi as CreditGrantResponseSchema, mn as NoticedMeteredRate, mo as PlanDefSchema, mr as EVENT_TIMESTAMP_MAX_AGE_DAYS, ms as MeterChargeLineSchema, mt as DEFAULT_LATE_GRACE_MINUTES, n as DOCTOR_PROVIDER_ENVIRONMENTS, na as manualInvoiceTotals, nc as ActorRefSchema, ni as isKnownErrorCode, nn as EmailSenderSchema, no as CatalogSyncInputSchema, nr as overageCapReached, ns as METER_CHARGE_STATUSES, nt as WebhookLastDeliverySchema, o as DOCTOR_SEVERITIES, oa as Grant, oc as CurrencySchema, oi as AccountUpsertResponseSchema, on as EmailSettingsSchema, oo as FeatureDefSchema, or as rolloverOf, os as METER_FILTER_OPERATORS, ot as BillingSettings, p as DoctorEndpoint, pa as Stats, pc as ErrorCategory, pi as CreditGrantResponse, pn as MAX_NOTIFICATION_EMAILS, po as PlanDef, pr as EVENT_NAME_MAX_LENGTH, ps as MeterChargeLine, pt as DEFAULT_EVENT_RETENTION_DAYS, q as WebhookEndpointCreateInputSchema, qa as ProviderPayloadSchema, qi as InvoiceVoidInput, qn as MeterRulesEvent, qo as CatalogMeter, qr as ResolvedEntitlements, qs as MeterStandingSchema, qt as BILLING_PATH_PLACEHOLDERS, r as DOCTOR_REQUIRED_BRANDING, ra as splitInclusiveTax, rc as AmountMinorSchema, ri as AccountDetail, rn as EmailSettings, ro as CatalogSyncResult, rr as overageOf, rs as METER_CREDIT_ENTRY_KINDS, rt as WebhookSecretSchema, s as DoctorBilling, sa as GrantCreateInput, sc as DateTimeSchema, si as CancelSubscriptionResponse, sn as EmailTemplate, so as FeatureTypeSchema, sr as standingOf, ss as METER_PERIOD_STATUSES, st as BillingSettingsPatchSchema, t as DOCTOR_PENDING_BACKLOG_MS, ta as ManualInvoiceLineInputSchema, tc as API_VERSION, ti as errorCodeSpec, tn as EmailRelevanceFacts, to as CatalogSyncInput, tr as meterCreditsOf, ts as METER_AGGREGATION_KINDS, tt as WebhookLastDelivery, u as DoctorCatalogSchema, ua as MAX_GRANT_BENEFITS, uc as EntitlementValueSchema, ui as ChangeSubscriptionResponseSchema, un as EmailTemplateSettingsSchema, uo as MAX_CATALOG_METERS, ur as EVENT_METADATA_KEY_MAX_LENGTH, us as MeterAggregationKind, ut as BrandingPatchSchema, v as DoctorFacts, va as SubscriptionSchema, vc as INVOICE_BILLING_REASONS, vi as HEADER_API_VERSION, vn as PriceChangeNoticeEmailSchema, vo as PriceSchema, vr as EventMetadataKeySchema, vs as MeterChargeStatus, vt as DEFAULT_PORTAL_TTL_MINUTES, w as DoctorProviderSchema, wa as PortalSessionSchema, wc as InvoiceBillingReasonSchema, wi as InvoiceVoidResponse, wn as emailRecipients, wo as BenefitDescription, wr as EventsIngestInputSchema, ws as MeterCreditProperties, wt as METER_CHARGE_MODES, x as DoctorOverage, xa as PortalSessionCreateInput, xc as Interval, xi as HEADER_SDK, xn as applyEmailSettingsPatch, xo as BENEFIT_TYPES, xr as EventMetadataValueSchema, xs as MeterCreditEntryKind, xt as EventsSettingsPatchSchema, y as DoctorHosted, ya as PORTAL_SESSION_ERRORS, yc as INVOICE_PAYMENT_STATUSES, yi as HEADER_IDEMPOTENCY_KEY, yn as PriceChangeNoticeMeteredRate, yo as AccountBenefit, yr as EventMetadataSchema, ys as MeterChargeStatusSchema, yt as EventRetentionDaysSchema, z as endpointDiagnosisOf, za as CheckoutSessionSchema, zi as InvoiceLine, zn as PlanSetWarningSchema, zo as MeterCreditBenefitDefSchema, zr as EntitlementRulesGrant, zs as MeterLowAtSchema, zt as TtlMinutesSchema } from "./_chunks/index.js";
|
|
1
|
+
import { $ as WebhookEndpointStatus, $a as Consent, $i as InvoiceStatusSchema, $n as MeterCreditsOptions, $o as MeterCreditBenefitDefSchema, $r as ResolvedBenefits, $s as MeterLowAtSchema, $t as BankTransferInstructionsEmail, A as DoctorSeveritySchema, Aa as PortalSessionError, Ac as ErrorResponseSchema, Ai as InvoiceIssueResponseSchema, An as emailLocaleOf, Ao as PriceDef, Ar as EventsIngestInput, As as MeterChargeListSchema, At as MeterChargeMode, B as hostedReadinessOf, Ba as CheckoutPrefill, Bc as InvoicePaymentStatusSchema, Bi as StewardCapability, Bn as PlanSetMode, Bo as BenefitFeatureType, Br as IngestRejectionSchema, Bs as MeterDef, Bt as ReturnOriginSchema, C as DoctorProvider, Ca as SubscriptionChangeInput, Cc as EntitlementValue, Ci as GrantCreateResponseSchema, Cn as NotificationEmailsSchema, Co as MAX_CATALOG_METERED_PRICES, Cr as EventExternalIdSchema, Cs as MeterAggregation, Ct as DEFAULT_PORTAL_TTL_MINUTES, D as DoctorSettings, Da as PortalSession, Dc as ErrorCategory, Di as HEADER_REQUEST_ID, Dn as PriceChangeNoticeMeteredRateSchema, Do as PlanDef, Dr as EventMetadataValue, Ds as MeterChargeLine, Dt as EventsSettingsSchema, E as DoctorReportSchema, Ea as PORTAL_SESSION_ERRORS, Ec as EntitlementsSchema, Ei as HEADER_IDEMPOTENCY_KEY, En as PriceChangeNoticeMeteredRate, Eo as METERED_PRICE_TAX_MISMATCH, Er as EventMetadataSchema, Es as MeterCharge, Et as EventsSettingsPatchSchema, F as DoctorWarningCode, Fa as BankTransferRecordedSchema, Fc as Interval, Fi as ManualInvoiceResponse, Fn as liveSubscriptionOf, Fo as BENEFIT_TYPES, Fr as IngestEvent, Fs as MeterCreditEntryKind, Ft as PaymentDueDaysSchema, G as WebhookEndpoint, Ga as CheckoutSessionCreateInput, Gi as InvoiceIssueInputSchema, Gn as PlanSetWarningCode, Go as CatalogBenefitSchema, Gr as EntitlementRulesCatalog, Gs as MeterFilterCondition, Gt as WebUrlSchema, H as EventTypeSchema, Ha as CheckoutRedirectTarget, Hi as UncancelSubscriptionResponseSchema, Hn as PlanSetResponse, Ho as BenefitType, Hr as isEventTimestampInRange, Hs as MeterDefSchema, Ht as SettingsLocale, I as DoctorWarningSchema, Ia as CHECKOUT_ERRORS, Ic as IntervalSchema, Ii as ManualInvoiceResponseSchema, In as uniqueEmails, Io as BenefitDef, Ir as IngestEventSchema, Is as MeterCreditEntryKindSchema, It as ProductSettings, J as WebhookEndpointList, Ja as CheckoutSessionCreated, Ji as InvoicePaymentSession, Jn as ResyncResultSchema, Jo as FeatureFlagBenefitDefSchema, Jr as LIVE_SUBSCRIPTION_STATUSES, Js as MeterFilterOperator, Jt as eventsSettingsOf, K as WebhookEndpointCreateInput, Ka as CheckoutSessionCreateInputSchema, Ki as InvoiceLine, Kn as PlanSetWarningSchema, Ko as FeatureFlagAccountBenefit, Kr as EntitlementRulesGrant, Ks as MeterFilterGroup, Kt as applySettingsPatch, L as buildDoctorReport, La as CheckoutConsentInput, Lc as InvoiceBillingReason, Li as MeResponse, Ln as PLAN_SET_MODES, Lo as BenefitDefSchema, Lr as IngestRejectCode, Ls as MeterCreditEntrySchema, Lt as ProductSettingsPatch, M as DoctorUnsellablePriceSchema, Ma as BankTransferRecordInput, Mc as INVOICE_BILLING_REASONS, Mi as InvoiceVoidResponseSchema, Mn as emailTemplateOf, Mo as PriceSchema, Mr as EventsIngestResult, Ms as MeterChargeStatus, Mt as MeteringSettings, N as DoctorUnsellableReason, Na as BankTransferRecordInputSchema, Nc as INVOICE_PAYMENT_STATUSES, Ni as InvoiceWaiveResponse, Nn as emailTemplateSettings, No as AccountBenefit, Nr as EventsIngestResultSchema, Ns as MeterChargeStatusSchema, Nt as MeteringSettingsPatchSchema, O as DoctorSettingsSchema, Oa as PortalSessionCreateInput, Oc as ErrorCategorySchema, Oi as HEADER_SDK, On as applyEmailSettingsPatch, Oo as PlanDefSchema, Or as EventMetadataValueSchema, Os as MeterChargeLineSchema, Ot as LateGraceMinutesSchema, P as DoctorWarning, Pa as BankTransferRecorded, Pc as IdSchema, Pi as InvoiceWaiveResponseSchema, Pn as isEmailRelevant, Po as AccountBenefitSchema, Pr as INGEST_REJECT_CODES, Ps as MeterCreditEntry, Pt as MeteringSettingsSchema, Q as WebhookEndpointSchema, Qa as CheckoutStatusSchema, Qi as InvoiceSchema, Qn as MeterCreditBenefit, Qo as MeterCreditBenefitDef, Qr as ResolvedBenefit, Qs as MeterLabelSchema, Qt as BILLING_PATH_PLACEHOLDERS, R as emailReadinessOf, Ra as CheckoutConsentInputSchema, Rc as InvoiceBillingReasonSchema, Ri as MeResponseSchema, Rn as PlanSetInput, Ro as BenefitDescription, Rr as IngestRejectCodeSchema, Rs as MeterCreditProperties, Rt as ProductSettingsPatchSchema, S as DoctorOverageSchema, Sa as Subscription, Sc as ERROR_CATEGORIES, Si as GrantCreateResponse, Sn as NoticedMeteredRateSchema, So as MAX_CATALOG_BENEFITS, Sr as EVENT_TIMESTAMP_MAX_SKEW_MINUTES, Ss as METER_STANDINGS, St as DEFAULT_PAYMENT_DUE_DAYS, T as DoctorReport, Ta as SubscriptionSchema, Tc as Entitlements, Ti as HEADER_API_VERSION, Tn as PriceChangeNoticeEmailSchema, To as MAX_PLAN_BENEFITS, Tr as EventMetadataKeySchema, Ts as MeterAggregationSchema, Tt as EventsSettings, U as WEBHOOK_ENDPOINT_STATUSES, Ua as CheckoutReturnStatus, Ui as Invoice, Un as PlanSetResponseSchema, Uo as BenefitTypeSchema, Ur as BenefitRulesDefinition, Us as MeterFilter, Ut as SettingsLocaleSchema, V as DEFAULT_ENDPOINT_EVENT_TYPES, Va as CheckoutPrefillSchema, Vc as MetadataSchema, Vi as UncancelSubscriptionResponse, Vn as PlanSetModeSchema, Vo as BenefitSourceSchema, Vr as hasControlCharacters, Vs as MeterDefInput, Vt as SETTINGS_LOCALES, W as WEBHOOK_SECRET_PREFIX, Wa as CheckoutSession, Wi as InvoiceIssueInput, Wn as PlanSetWarning, Wo as CatalogBenefit, Wr as BenefitRulesSubscription, Ws as MeterFilterClause, Wt as TtlMinutesSchema, X as WebhookEndpointRotateInput, Xa as CheckoutSessionSchema, Xi as InvoicePaymentSessionCreateInputSchema, Xn as MeterChargeTotalsLine, Xo as FeatureFlagPropertiesSchema, Xr as ResolveBenefitsInput, Xs as MeterFilterValue, Xt as meteringSettingsOf, Y as WebhookEndpointListSchema, Ya as CheckoutSessionCreatedSchema, Yi as InvoicePaymentSessionCreateInput, Yn as GrantedMeterCredit, Yo as FeatureFlagProperties, Yr as OVERRIDE_BENEFIT_SOURCE, Ys as MeterFilterSchema, Yt as isReturnUrlAllowed, Z as WebhookEndpointRotateInputSchema, Za as CheckoutStatus, Zi as InvoicePaymentSessionSchema, Zn as MeterContribution, Zo as MeterCreditAccountBenefit, Zr as ResolveEntitlementsInput, Zs as MeterLabel, Zt as returnOriginsOf, _ as DoctorEventsSchema, _a as MAX_GRANT_BENEFITS, _c as AmountMinorSchema, _i as ChangeSubscriptionResponseSchema, _n as EmailTemplateSettingsSchema, _o as CatalogSyncResult, _r as EVENT_METADATA_KEY_MAX_LENGTH, _s as METER_CREDIT_ENTRY_KINDS, _t as DEFAULT_CHECKOUT_TTL_MINUTES, a as DOCTOR_ROLLUP_LAG_WARN_SECONDS, aa as ManualInvoiceInput, ac as MeterPeriodStatusSchema, ai as ERROR_CODES, an as EMAIL_TEMPLATE_BY_EVENT, ao as PaymentMethodSchema, ar as contributionOf, as as AccountMeters, at as webhookEndpointUrlProblem, b as DoctorHostedSchema, ba as Stats, bc as CurrencySchema, bi as CreditGrantResponse, bn as MAX_NOTIFICATION_EMAILS, bo as FeatureDefSchema, br as EVENT_NAME_MAX_LENGTH, bs as METER_FILTER_OPERATORS, bt as DEFAULT_METER_CHARGE_MODE, c as DoctorBillingSchema, ca as ManualInvoiceLineInputSchema, cc as MeterUnitsSchema, ci as errorCodeSpec, cn as EmailRelevanceFacts, co as checkoutRedirectUrl, cr as meterCreditsOf, cs as CatalogMeterSchema, ct as BankTransferSettingsPatchSchema, d as DoctorEmails, da as CancelSubscriptionInput, dc as MeteredPriceDefSchema, di as AccountDetailSchema, dn as EmailSettingsPatch, do as Catalog, dr as periodBoundsOf, ds as DEFAULT_METER_LOW_AT, dt as BillingSettingsPatchSchema, ea as InvoiceVoidInput, ec as MeterPeriod, ei as ResolvedEntitlements, en as BankTransferInstructionsEmailSchema, eo as ConsentSchema, er as MeterRulesEvent, es as featureValueMatchesType, et as WebhookEndpointStatusSchema, f as DoctorEmailsSchema, fa as CancelSubscriptionInputSchema, fc as MeteredPriceSchema, fi as AccountUpsertResponse, fn as EmailSettingsPatchSchema, fo as CatalogPlan, fr as rateOverage, fs as DecimalUnitsStringSchema, ft as BillingSettingsSchema, g as DoctorEvents, ga as GrantSchema, gc as ActorRefSchema, gi as ChangeSubscriptionResponse, gn as EmailTemplateSettings, go as CatalogSyncInputSchema, gr as EVENTS_INGEST_MAX_EVENTS, gs as METER_CHARGE_STATUSES, gt as DEFAULT_BANK_TRANSFER_PAYMENT_DAYS, h as DoctorEndpointSchema, ha as GrantCreateInputSchema, hc as API_VERSION, hi as CancelSubscriptionResponseSchema, hn as EmailTemplateSchema, ho as CatalogSyncInput, hr as EVENTS_INGEST_MAX_BYTES, hs as METER_AGGREGATION_KINDS, ht as BrandingSchema, i as DOCTOR_REQUIRED_LEGAL_LINKS, ia as MANUAL_INVOICE_MAX_AMOUNT_MINOR, ic as MeterPeriodStatus, ii as resolveEntitlements, in as EMAIL_TEMPLATES, io as PaymentMethod, ir as consumptionOf, is as AccountMeterSchema, it as generateWebhookSecret, j as DoctorUnsellablePrice, ja as PortalSessionSchema, jc as ExternalRefSchema, ji as InvoiceVoidResponse, jn as emailRecipients, jo as PriceDefSchema, jr as EventsIngestInputSchema, js as MeterChargeSchema, jt as MeterChargeModeSchema, k as DoctorSeverity, ka as PortalSessionCreateInputSchema, kc as ErrorResponse, ki as InvoiceIssueResponse, kn as billingPageUrl, ko as Price, kr as EventNameSchema, ks as MeterChargeList, kt as METER_CHARGE_MODES, l as DoctorCatalog, la as manualInvoiceTotals, lc as MeteredPrice, li as isKnownErrorCode, ln as EmailSenderSchema, lo as AccountsRefreshResult, lr as overageCapReached, ls as CreditGrantInput, lt as BankTransferSettingsSchema, m as DoctorEndpointDiagnosis, ma as GrantCreateInput, mc as meterFilterClauseOf, mi as CancelSubscriptionResponse, mn as EmailTemplate, mo as CatalogSchema, mr as standingOf, ms as MAX_METER_UNITS, mt as BrandingPatchSchema, n as DOCTOR_PROVIDER_ENVIRONMENTS, na as InvoiceWaiveInput, nc as MeterPeriodListSchema, ni as isLiveSubscriptionStatus, nn as EMAIL_LOCALES, no as MAX_CHECKOUT_CONSENT_DOCS, nr as OverageRateInput, ns as isMeterCreditBenefit, nt as WebhookLastDeliverySchema, o as DOCTOR_SEVERITIES, oa as ManualInvoiceInputSchema, oc as MeterStanding, oi as ErrorCode, on as EmailExtraTextSchema, oo as ProviderPayload, or as matchesFilter, os as AccountMetersSchema, ot as BankTransferPaymentDaysSchema, p as DoctorEndpoint, pa as Grant, pc as canonicalMeterFilter, pi as AccountUpsertResponseSchema, pn as EmailSettingsSchema, po as CatalogPlanSchema, pr as rolloverOf, ps as MAX_METERED_PRICE_PER_UNITS, pt as Branding, q as WebhookEndpointCreateInputSchema, qa as CheckoutSessionCreateParsed, qi as InvoiceLineSchema, qn as ResyncResult, qo as FeatureFlagBenefitDef, qr as FEATURE_FLAG_BENEFIT_TYPE, qs as MeterFilterOperand, qt as billingSettingsOf, r as DOCTOR_REQUIRED_BRANDING, ra as InvoiceWaiveInputSchema, rc as MeterPeriodSchema, ri as resolveBenefits, rn as EMAIL_PAYLOAD_SCHEMAS, ro as PAYMENT_METHODS, rr as addUtcMonths, rs as AccountMeter, rt as WebhookSecretSchema, s as DoctorBilling, sa as ManualInvoiceLineInput, sc as MeterStandingSchema, si as ErrorCodeSpec, sn as EmailLocale, so as ProviderPayloadSchema, sr as meterChargeTotals, ss as CatalogMeter, st as BankTransferSettings, t as DOCTOR_PENDING_BACKLOG_MS, ta as InvoiceVoidInputSchema, tc as MeterPeriodList, ti as isGrantActive, tn as BillingPathSchema, to as INDIVIDUAL_IDENTITY_PLACEHOLDER, tr as MeterRulesMeter, ts as isFeatureFlagBenefit, tt as WebhookLastDelivery, u as DoctorCatalogSchema, ua as splitInclusiveTax, uc as MeteredPriceDef, ui as AccountDetail, un as EmailSettings, uo as AccountsRefreshResultSchema, ur as overageOf, us as CreditGrantInputSchema, ut as BillingSettings, v as DoctorFacts, va as Payment, vc as CodeSchema, vi as CheckoutSessionResponse, vn as InvoicePaymentDueEmail, vo as CatalogSyncResultSchema, vr as EVENT_METADATA_MAX_PAIRS, vs as METER_FILTER_MAX_CONDITIONS, vt as DEFAULT_EVENT_RETENTION_DAYS, w as DoctorProviderSchema, wa as SubscriptionChangeInputSchema, wc as EntitlementValueSchema, wi as HEADER_ACTOR_REF, wn as PriceChangeNoticeEmail, wo as MAX_CATALOG_METERS, wr as EventMetadata, ws as MeterAggregationKind, wt as EventRetentionDaysSchema, x as DoctorOverage, xa as StatsSchema, xc as DateTimeSchema, xi as CreditGrantResponseSchema, xn as NoticedMeteredRate, xo as FeatureTypeSchema, xr as EVENT_TIMESTAMP_MAX_AGE_DAYS, xs as METER_PERIOD_STATUSES, xt as DEFAULT_MIN_INVOICE_MINOR, y as DoctorHosted, ya as PaymentSchema, yc as Currency, yi as CheckoutSessionResponseSchema, yn as InvoicePaymentDueEmailSchema, yo as FeatureDef, yr as EVENT_METADATA_STRING_MAX_LENGTH, ys as METER_FILTER_MAX_DEPTH, yt as DEFAULT_LATE_GRACE_MINUTES, z as endpointDiagnosisOf, za as CheckoutError, zc as InvoicePaymentStatus, zi as STEWARD_CAPABILITIES, zn as PlanSetInputSchema, zo as BenefitDescriptionSchema, zr as IngestRejection, zs as MeterCreditPropertiesSchema, zt as ProductSettingsSchema } from "./_chunks/index.js";
|
|
2
2
|
import { $ as EntitlementSnapshot, A as AccountMeterState, B as AccountScheduledChange, C as Account, D as AccountDunningStateSchema, E as AccountDunningState, F as AccountOpenCheckoutSchema, G as AccountSubscriptionState, H as AccountSchema, I as AccountOpenInvoice, J as AccountUpsertInputSchema, K as AccountSubscriptionStateSchema, L as AccountOpenInvoiceSchema, M as AccountMetersState, N as AccountMetersStateSchema, O as AccountInclude, P as AccountOpenCheckout, Q as BillingProfileSchema, R as AccountProfileState, S as AccessStateSchema, T as AccountDeleteResponseSchema, U as AccountState, V as AccountScheduledChangeSchema, W as AccountStateSchema, X as BillingProfileInput, Y as BillingProfile, Z as BillingProfileKindSchema, _ as Ping, a as BillingEvent, b as ACCOUNT_INCLUDES, c as EVENT_DETAIL_SCHEMAS, d as EventIdSchema, et as EntitlementSnapshotSchema, f as EventType, g as PING_EVENT_TYPE, h as LegacyEventType, i as ApiVersionSchema, it as SubscriptionSummarySchema, j as AccountMeterStateSchema, k as AccountLocaleSchema, l as EVENT_TYPES, m as LEGACY_EVENT_TYPES, n as AnyBillingEvent, nt as SubscriptionStatusSchema, o as BillingEventOf, p as FULL_STATE_EVENT_TYPES, q as AccountUpsertInput, r as AnyBillingEventSchema, rt as SubscriptionSummary, s as BillingEventSchema, t as AccountStateChangeCause, tt as SubscriptionStatus, u as EventDetail, v as PingSchema, w as AccountDeleteResponse, x as AccessState, y as isEventType, z as AccountProfileStateSchema } from "./_chunks/events.js";
|
|
3
3
|
import { a as MICRO_UNITS_PER_UNIT, c as isMicroPrecise, d as plainDecimalOf, f as toMicroUnits, i as InvalidUnitValueError, l as microToDecimalString, n as isValidTckn, o as UNIT_DECIMALS, r as isValidVkn, s as fromMicroUnits, t as isE164, u as parseMicroUnits } from "./_chunks/validators.js";
|
|
4
4
|
import { a as CatalogRead, c as Steward, d as StewardOptions, f as createSteward, g as AccountStateRead, h as AccountMetersRead, i as httpStatusFor, l as StewardEnv, m as RetryOptions, n as HttpStatusResult, o as InvoiceDocument, p as RetryClass, r as StewardLogger, s as MutationOptions, t as StewardLocale, u as StewardMe } from "./_chunks/locale.js";
|
|
5
5
|
//#region src/catalog.d.ts
|
|
6
|
-
type FeatureType =
|
|
6
|
+
type FeatureType = 'limit' | 'boolean' | 'string';
|
|
7
7
|
export type FeatureSpec<T extends FeatureType = FeatureType> = {
|
|
8
8
|
readonly type: T;
|
|
9
9
|
readonly description?: string;
|
|
@@ -12,12 +12,12 @@ type FeatureOptions = {
|
|
|
12
12
|
description?: string;
|
|
13
13
|
};
|
|
14
14
|
/** Sayısal limit: negatif olmayan tam sayı ya da `null` (sınırsız). */
|
|
15
|
-
export declare const limit: (options?: FeatureOptions) => FeatureSpec<
|
|
15
|
+
export declare const limit: (options?: FeatureOptions) => FeatureSpec<'limit'>;
|
|
16
16
|
/** Açık/kapalı özellik. */
|
|
17
|
-
export declare const flag: (options?: FeatureOptions) => FeatureSpec<
|
|
17
|
+
export declare const flag: (options?: FeatureOptions) => FeatureSpec<'boolean'>;
|
|
18
18
|
/** Serbest metin ayarı. */
|
|
19
|
-
export declare const text: (options?: FeatureOptions) => FeatureSpec<
|
|
20
|
-
export type FeatureValue<F extends FeatureSpec> = F[
|
|
19
|
+
export declare const text: (options?: FeatureOptions) => FeatureSpec<'string'>;
|
|
20
|
+
export type FeatureValue<F extends FeatureSpec> = F['type'] extends 'limit' ? number | null : F['type'] extends 'boolean' ? boolean : string;
|
|
21
21
|
export type FeatureSpecs = Record<string, FeatureSpec>;
|
|
22
22
|
/** Feature listesinin tam, tipli hak nesnesi. */
|
|
23
23
|
export type EntitlementsFor<F extends FeatureSpecs> = { [K in keyof F]: FeatureValue<F[K]>; };
|
|
@@ -25,7 +25,7 @@ export type EntitlementsFor<F extends FeatureSpecs> = { [K in keyof F]: FeatureV
|
|
|
25
25
|
export type FeatureFlagValues = Readonly<Record<string, EntitlementValue>>;
|
|
26
26
|
/** A `feature_flag` benefit (`featureFlag()`): the catalog feature values it grants. */
|
|
27
27
|
export type FeatureFlagSpec<V extends FeatureFlagValues = FeatureFlagValues> = {
|
|
28
|
-
readonly type:
|
|
28
|
+
readonly type: 'feature_flag';
|
|
29
29
|
readonly properties: Readonly<V>;
|
|
30
30
|
/** Customer-facing text per locale (hosted checkout and portal "what's included"). */
|
|
31
31
|
readonly description?: BenefitDescription;
|
|
@@ -35,7 +35,7 @@ export type FeatureFlagSpec<V extends FeatureFlagValues = FeatureFlagValues> = {
|
|
|
35
35
|
* the start of every meter period; `rolloverCapUnits` turns rollover on (M5, M6).
|
|
36
36
|
*/
|
|
37
37
|
export type MeterCreditSpec<M extends string = string> = {
|
|
38
|
-
readonly type:
|
|
38
|
+
readonly type: 'meter_credit';
|
|
39
39
|
readonly properties: {
|
|
40
40
|
readonly meter: M;
|
|
41
41
|
readonly units: number;
|
|
@@ -84,7 +84,7 @@ export declare const sum: (key: string) => MeterAggregation;
|
|
|
84
84
|
export declare const max: (key: string) => MeterAggregation;
|
|
85
85
|
export declare const unique: (key: string) => MeterAggregation;
|
|
86
86
|
/** A filter property: the event `name` or `metadata.<key>`. */
|
|
87
|
-
export type MeterFilterProperty =
|
|
87
|
+
export type MeterFilterProperty = 'name' | `metadata.${string}`;
|
|
88
88
|
type NameOperand = string | {
|
|
89
89
|
readonly eq: string;
|
|
90
90
|
} | {
|
|
@@ -233,11 +233,11 @@ export type CatalogResolveOptions = {
|
|
|
233
233
|
* stays open: steward may already know a benefit this build of the catalog does not (catalog pushed
|
|
234
234
|
* before the product deployed), so any string is accepted.
|
|
235
235
|
*/
|
|
236
|
-
export type CatalogAccountBenefit<B extends string = string> = Omit<AccountBenefit,
|
|
236
|
+
export type CatalogAccountBenefit<B extends string = string> = Omit<AccountBenefit, 'code'> & {
|
|
237
237
|
code: B | (string & Record<never, never>) | null;
|
|
238
238
|
};
|
|
239
239
|
/** `AccountState` with `benefits[].code` typed by the catalog (see `CatalogAccountBenefit`). */
|
|
240
|
-
export type CatalogAccountState<B extends string = string> = Omit<AccountState,
|
|
240
|
+
export type CatalogAccountState<B extends string = string> = Omit<AccountState, 'benefits'> & {
|
|
241
241
|
benefits?: CatalogAccountBenefit<B>[] | undefined;
|
|
242
242
|
};
|
|
243
243
|
export type DefinedCatalog<F extends FeatureSpecs, P extends string, B extends string = never, M extends string = never, E extends string = never> = {
|
|
@@ -301,7 +301,7 @@ export type StateFallbackEvent = {
|
|
|
301
301
|
reason: string;
|
|
302
302
|
};
|
|
303
303
|
/** 404 `account_not_found`: `throw` hata (varsayılan), `fallback` ürünün `fallback(ref)`'i (kesinti sayılmaz). */
|
|
304
|
-
export type StateMissingPolicy =
|
|
304
|
+
export type StateMissingPolicy = 'throw' | 'fallback';
|
|
305
305
|
export type StateCacheOptions = {
|
|
306
306
|
/** Varsayılan 30 sn. */
|
|
307
307
|
ttlMs?: number;
|
|
@@ -320,7 +320,7 @@ export type StateCacheOptions = {
|
|
|
320
320
|
/** Önbellekteki en çok hesap (LRU). Varsayılan 10 000. */
|
|
321
321
|
maxEntries?: number;
|
|
322
322
|
/** Bayat değer/fallback uyarıları; varsayılan `console`. */
|
|
323
|
-
logger?: Pick<StewardLogger,
|
|
323
|
+
logger?: Pick<StewardLogger, 'warn'>;
|
|
324
324
|
/** Saat, ms (test için). Varsayılan `Date.now`. */
|
|
325
325
|
now?: () => number;
|
|
326
326
|
};
|
|
@@ -393,19 +393,19 @@ export declare class StewardApiError extends StewardError {
|
|
|
393
393
|
}
|
|
394
394
|
/** Steward'a ulaşılamadı ya da zaman aşımı; yanıt yok (`httpStatus` 0), tekrar denenebilir. */
|
|
395
395
|
export declare class StewardNetworkError extends StewardError {
|
|
396
|
-
constructor(options?: Omit<StewardErrorOptions,
|
|
397
|
-
code?:
|
|
396
|
+
constructor(options?: Omit<StewardErrorOptions, 'code' | 'httpStatus' | 'category'> & {
|
|
397
|
+
code?: 'network_error' | 'timeout';
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
400
|
/** Yanıt sözleşme şemasına uymadı (sürüm kayması); aynı istek aynı sonucu verir. */
|
|
401
401
|
export declare class StewardContractError extends StewardError {
|
|
402
|
-
constructor(options?: Omit<StewardErrorOptions,
|
|
402
|
+
constructor(options?: Omit<StewardErrorOptions, 'code' | 'category'> & {
|
|
403
403
|
code?: string;
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
406
|
/** SDK yanlış yapılandırıldı (eksik `STEWARD_URL`, geçersiz katalog…); istek hiç gönderilmedi. */
|
|
407
407
|
export declare class StewardConfigError extends StewardError {
|
|
408
|
-
constructor(options?: Omit<StewardErrorOptions,
|
|
408
|
+
constructor(options?: Omit<StewardErrorOptions, 'code' | 'httpStatus' | 'category' | 'retryable'> & {
|
|
409
409
|
code?: string;
|
|
410
410
|
});
|
|
411
411
|
}
|
|
@@ -424,7 +424,7 @@ export type TrackOptions = {
|
|
|
424
424
|
timestamp?: Date | string;
|
|
425
425
|
};
|
|
426
426
|
/** An event for `ingest()`: `IngestEvent` with an optional `externalId` (generated) and `timestamp` (now). */
|
|
427
|
-
export type EventInput = Omit<IngestEvent,
|
|
427
|
+
export type EventInput = Omit<IngestEvent, 'externalId' | 'timestamp'> & {
|
|
428
428
|
externalId?: string;
|
|
429
429
|
timestamp?: Date | string;
|
|
430
430
|
};
|
|
@@ -432,7 +432,7 @@ export type EventInput = Omit<IngestEvent, "externalId" | "timestamp"> & {
|
|
|
432
432
|
export type EventsRejection = IngestRejection & {
|
|
433
433
|
event: IngestEvent;
|
|
434
434
|
};
|
|
435
|
-
export type EventsDropReason =
|
|
435
|
+
export type EventsDropReason = 'queue_full' | 'invalid_event' | 'request_failed';
|
|
436
436
|
export type EventsDropInfo = {
|
|
437
437
|
reason: EventsDropReason;
|
|
438
438
|
/** `invalid_event`: what is wrong; `request_failed`: the error code. */
|
|
@@ -467,7 +467,7 @@ export type EventsOptions<E extends string = never> = {
|
|
|
467
467
|
/** Events that will not be sent (queue full, invalid, permanent failure). */
|
|
468
468
|
onDrop?: (events: IngestEvent[], info: EventsDropInfo) => void;
|
|
469
469
|
/** Default `console`. */
|
|
470
|
-
logger?: Pick<StewardLogger,
|
|
470
|
+
logger?: Pick<StewardLogger, 'warn'>;
|
|
471
471
|
/** Clock, ms (tests). Default `Date.now`. */
|
|
472
472
|
now?: () => number;
|
|
473
473
|
/** Jitter source in [0, 1) (tests). Default `Math.random`. */
|
|
@@ -515,7 +515,7 @@ export type MetersCache = {
|
|
|
515
515
|
export type MetersPendingEvents = {
|
|
516
516
|
pending(ref: string): readonly PendingEvent[];
|
|
517
517
|
};
|
|
518
|
-
export type MeterSource =
|
|
518
|
+
export type MeterSource = 'live' | 'cached' | 'stale' | 'fallback';
|
|
519
519
|
/**
|
|
520
520
|
* A meter's open period as this process sees it: steward's values (`AccountMeter`) with this
|
|
521
521
|
* process's pending units added. Units are JSON numbers with at most 6 decimals.
|
|
@@ -576,7 +576,7 @@ export type MeterUnavailableContext<M extends string = string> = {
|
|
|
576
576
|
/** The error of the failed read (`StewardNetworkError`, `StewardApiError` 5xx/429). */
|
|
577
577
|
error: unknown;
|
|
578
578
|
};
|
|
579
|
-
export type MeterUnavailablePolicy<M extends string = string> =
|
|
579
|
+
export type MeterUnavailablePolicy<M extends string = string> = 'allow' | 'deny' | ((context: MeterUnavailableContext<M>) => boolean);
|
|
580
580
|
export type MeterFallbackEvent = {
|
|
581
581
|
ref: string;
|
|
582
582
|
/** The meter (`check`, `balance`, a meter steward does not report); `null` for `get`. */
|
|
@@ -602,7 +602,7 @@ export type MetersOptions<M extends string> = {
|
|
|
602
602
|
/** Accounts kept (LRU). Default 10 000. */
|
|
603
603
|
maxEntries?: number;
|
|
604
604
|
/** Default `console`. */
|
|
605
|
-
logger?: Pick<StewardLogger,
|
|
605
|
+
logger?: Pick<StewardLogger, 'warn'>;
|
|
606
606
|
/** Clock, ms (tests). Default `Date.now`. */
|
|
607
607
|
now?: () => number;
|
|
608
608
|
};
|
|
@@ -617,4 +617,4 @@ export type MetersClient<M extends string> = {
|
|
|
617
617
|
/** Meter reader and gate (M13, M15, M16); see the comment above. */
|
|
618
618
|
export declare function Meters<M extends string>(options: MetersOptions<M>): MetersClient<M>;
|
|
619
619
|
//#endregion
|
|
620
|
-
export { ACCOUNT_INCLUDES, API_VERSION, AccessState, AccessStateSchema, Account, AccountBenefit, AccountBenefitSchema, AccountDeleteResponse, AccountDeleteResponseSchema, AccountDetail, AccountDetailSchema, AccountDunningState, AccountDunningStateSchema, AccountInclude, AccountLocaleSchema, AccountMeter, AccountMeterSchema, AccountMeterState, AccountMeterStateSchema, AccountMeters, type AccountMetersRead, AccountMetersSchema, AccountMetersState, AccountMetersStateSchema, AccountOpenCheckout, AccountOpenCheckoutSchema, AccountOpenInvoice, AccountOpenInvoiceSchema, AccountProfileState, AccountProfileStateSchema, AccountScheduledChange, AccountScheduledChangeSchema, AccountSchema, AccountState, AccountStateChangeCause, type AccountStateRead, AccountStateSchema, AccountSubscriptionState, AccountSubscriptionStateSchema, AccountUpsertInput, AccountUpsertInputSchema, AccountUpsertResponse, AccountUpsertResponseSchema, AccountsRefreshResult, AccountsRefreshResultSchema, ActorRefSchema, AmountMinorSchema, AnyBillingEvent, AnyBillingEventSchema, ApiVersionSchema, BENEFIT_TYPES, BILLING_PATH_PLACEHOLDERS, BenefitDef, BenefitDefSchema, BenefitDescription, BenefitDescriptionSchema, BenefitFeatureType, BenefitRulesDefinition, BenefitRulesSubscription, BenefitSourceSchema, BenefitType, BenefitTypeSchema, BillingEvent, BillingEventOf, BillingEventSchema, BillingPathSchema, BillingProfile, BillingProfileInput, BillingProfileKindSchema, BillingProfileSchema, BillingSettings, BillingSettingsPatchSchema, BillingSettingsSchema, Branding, BrandingPatchSchema, BrandingSchema, CHECKOUT_ERRORS, CancelSubscriptionInput, CancelSubscriptionInputSchema, CancelSubscriptionResponse, CancelSubscriptionResponseSchema, Catalog, CatalogBenefit, CatalogBenefitSchema, CatalogMeter, CatalogMeterSchema, CatalogPlan, CatalogPlanSchema, CatalogRead, CatalogSchema, CatalogSyncInput, CatalogSyncInputSchema, CatalogSyncResult, CatalogSyncResultSchema, ChangeSubscriptionResponse, ChangeSubscriptionResponseSchema, CheckoutConsentInput, CheckoutConsentInputSchema, CheckoutError, CheckoutPrefill, CheckoutPrefillSchema, CheckoutRedirectTarget, CheckoutReturnStatus, CheckoutSession, CheckoutSessionCreateInput, CheckoutSessionCreateInputSchema, CheckoutSessionCreateParsed, CheckoutSessionCreated, CheckoutSessionCreatedSchema, CheckoutSessionResponse, CheckoutSessionResponseSchema, CheckoutSessionSchema, CheckoutStatus, CheckoutStatusSchema, CodeSchema, Consent, ConsentSchema, CreditGrantInput, CreditGrantInputSchema, CreditGrantResponse, CreditGrantResponseSchema, Currency, CurrencySchema, DEFAULT_CHECKOUT_TTL_MINUTES, DEFAULT_ENDPOINT_EVENT_TYPES, DEFAULT_EVENT_RETENTION_DAYS, DEFAULT_LATE_GRACE_MINUTES, DEFAULT_METER_CHARGE_MODE, DEFAULT_METER_LOW_AT, DEFAULT_MIN_INVOICE_MINOR, DEFAULT_PAYMENT_DUE_DAYS, DEFAULT_PORTAL_TTL_MINUTES, DOCTOR_PENDING_BACKLOG_MS, DOCTOR_PROVIDER_ENVIRONMENTS, DOCTOR_REQUIRED_BRANDING, DOCTOR_REQUIRED_LEGAL_LINKS, DOCTOR_ROLLUP_LAG_WARN_SECONDS, DOCTOR_SEVERITIES, DateTimeSchema, DecimalUnitsStringSchema, DoctorBilling, DoctorBillingSchema, DoctorCatalog, DoctorCatalogSchema, DoctorEmails, DoctorEmailsSchema, DoctorEndpoint, DoctorEndpointDiagnosis, DoctorEndpointSchema, DoctorEvents, DoctorEventsSchema, DoctorFacts, DoctorHosted, DoctorHostedSchema, DoctorOverage, DoctorOverageSchema, DoctorProvider, DoctorProviderSchema, DoctorReport, DoctorReportSchema, DoctorSettings, DoctorSettingsSchema, DoctorSeverity, DoctorSeveritySchema, DoctorUnsellablePrice, DoctorUnsellablePriceSchema, DoctorUnsellableReason, DoctorWarning, DoctorWarningCode, DoctorWarningSchema, EMAIL_LOCALES, EMAIL_PAYLOAD_SCHEMAS, EMAIL_TEMPLATES, EMAIL_TEMPLATE_BY_EVENT, ERROR_CATEGORIES, ERROR_CODES, EVENTS_INGEST_MAX_BYTES, EVENTS_INGEST_MAX_EVENTS, EVENT_DETAIL_SCHEMAS, EVENT_METADATA_KEY_MAX_LENGTH, EVENT_METADATA_MAX_PAIRS, EVENT_METADATA_STRING_MAX_LENGTH, EVENT_NAME_MAX_LENGTH, EVENT_TIMESTAMP_MAX_AGE_DAYS, EVENT_TIMESTAMP_MAX_SKEW_MINUTES, 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, EventExternalIdSchema, EventIdSchema, EventMetadata, EventMetadataKeySchema, EventMetadataSchema, EventMetadataValue, EventMetadataValueSchema, EventNameSchema, EventRetentionDaysSchema, EventType, EventTypeSchema, EventsIngestInput, EventsIngestInputSchema, EventsIngestResult, EventsIngestResultSchema, EventsSettings, EventsSettingsPatchSchema, EventsSettingsSchema, ExternalRefSchema, FEATURE_FLAG_BENEFIT_TYPE, FULL_STATE_EVENT_TYPES, FeatureDef, FeatureDefSchema, FeatureFlagAccountBenefit, FeatureFlagBenefitDef, FeatureFlagBenefitDefSchema, FeatureFlagProperties, FeatureFlagPropertiesSchema, FeatureTypeSchema, Grant, GrantCreateInput, GrantCreateInputSchema, GrantCreateResponse, GrantCreateResponseSchema, GrantSchema, GrantedMeterCredit, HEADER_ACTOR_REF, HEADER_API_VERSION, HEADER_IDEMPOTENCY_KEY, HEADER_REQUEST_ID, HEADER_SDK, HttpStatusResult, INDIVIDUAL_IDENTITY_PLACEHOLDER, INGEST_REJECT_CODES, INVOICE_BILLING_REASONS, INVOICE_PAYMENT_STATUSES, IdSchema, IngestEvent, IngestEventSchema, IngestRejectCode, IngestRejectCodeSchema, IngestRejection, IngestRejectionSchema, Interval, IntervalSchema, InvalidUnitValueError, Invoice, InvoiceBillingReason, InvoiceBillingReasonSchema, InvoiceDocument, InvoiceIssueInput, InvoiceIssueInputSchema, InvoiceIssueResponse, InvoiceIssueResponseSchema, InvoiceLine, InvoiceLineSchema, InvoicePaymentDueEmail, InvoicePaymentDueEmailSchema, InvoicePaymentSession, InvoicePaymentSessionCreateInput, InvoicePaymentSessionCreateInputSchema, InvoicePaymentSessionSchema, InvoicePaymentStatus, InvoicePaymentStatusSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceVoidInput, InvoiceVoidInputSchema, InvoiceVoidResponse, InvoiceVoidResponseSchema, InvoiceWaiveInput, InvoiceWaiveInputSchema, InvoiceWaiveResponse, InvoiceWaiveResponseSchema, LEGACY_EVENT_TYPES, LIVE_SUBSCRIPTION_STATUSES, LateGraceMinutesSchema, LegacyEventType, MANUAL_INVOICE_MAX_AMOUNT_MINOR, MAX_CATALOG_BENEFITS, MAX_CATALOG_METERED_PRICES, MAX_CATALOG_METERS, MAX_CHECKOUT_CONSENT_DOCS, MAX_GRANT_BENEFITS, MAX_METERED_PRICE_PER_UNITS, MAX_METER_UNITS, MAX_NOTIFICATION_EMAILS, MAX_PLAN_BENEFITS, METERED_PRICE_TAX_MISMATCH, METER_AGGREGATION_KINDS, METER_CHARGE_MODES, METER_CHARGE_STATUSES, METER_CREDIT_ENTRY_KINDS, METER_FILTER_MAX_CONDITIONS, METER_FILTER_MAX_DEPTH, METER_FILTER_OPERATORS, METER_PERIOD_STATUSES, METER_STANDINGS, MICRO_UNITS_PER_UNIT, ManualInvoiceInput, ManualInvoiceInputSchema, ManualInvoiceLineInput, ManualInvoiceLineInputSchema, ManualInvoiceResponse, ManualInvoiceResponseSchema, MeResponse, MeResponseSchema, MetadataSchema, MeterAggregation, MeterAggregationKind, MeterAggregationSchema, MeterCharge, MeterChargeLine, MeterChargeLineSchema, MeterChargeList, MeterChargeListSchema, MeterChargeMode, MeterChargeModeSchema, MeterChargeSchema, MeterChargeStatus, MeterChargeStatusSchema, MeterChargeTotalsLine, MeterContribution, MeterCreditAccountBenefit, MeterCreditBenefit, MeterCreditBenefitDef, MeterCreditBenefitDefSchema, MeterCreditEntry, MeterCreditEntryKind, MeterCreditEntryKindSchema, MeterCreditEntrySchema, MeterCreditProperties, MeterCreditPropertiesSchema, MeterCreditsOptions, MeterDef, MeterDefInput, MeterDefSchema, MeterFilter, MeterFilterClause, MeterFilterCondition, MeterFilterGroup, MeterFilterOperand, MeterFilterOperator, MeterFilterSchema, MeterFilterValue, MeterLabel, MeterLabelSchema, MeterLowAtSchema, MeterPeriod, MeterPeriodList, MeterPeriodListSchema, MeterPeriodSchema, MeterPeriodStatus, MeterPeriodStatusSchema, MeterRulesEvent, MeterRulesMeter, MeterStanding, MeterStandingSchema, MeterUnitsSchema, MeteredPrice, MeteredPriceDef, MeteredPriceDefSchema, MeteredPriceSchema, MeteringSettings, MeteringSettingsPatchSchema, MeteringSettingsSchema, MutationOptions, NoticedMeteredRate, NoticedMeteredRateSchema, NotificationEmailsSchema, OVERRIDE_BENEFIT_SOURCE, OverageRateInput, PING_EVENT_TYPE, PLAN_SET_MODES, PORTAL_SESSION_ERRORS, Payment, PaymentDueDaysSchema, PaymentSchema, Ping, PingSchema, PlanDef, PlanDefSchema, PlanSetInput, PlanSetInputSchema, PlanSetMode, PlanSetModeSchema, PlanSetResponse, PlanSetResponseSchema, PlanSetWarning, PlanSetWarningCode, PlanSetWarningSchema, PortalSession, PortalSessionCreateInput, PortalSessionCreateInputSchema, PortalSessionError, PortalSessionSchema, Price, PriceChangeNoticeEmail, PriceChangeNoticeEmailSchema, PriceChangeNoticeMeteredRate, PriceChangeNoticeMeteredRateSchema, PriceDef, PriceDefSchema, PriceSchema, ProductSettings, ProductSettingsPatch, ProductSettingsPatchSchema, ProductSettingsSchema, ProviderPayload, ProviderPayloadSchema, ResolveBenefitsInput, ResolveEntitlementsInput, ResolvedBenefit, ResolvedBenefits, ResolvedEntitlements, ResyncResult, ResyncResultSchema, type RetryClass, type RetryOptions, ReturnOriginSchema, SETTINGS_LOCALES, STEWARD_CAPABILITIES, SettingsLocale, SettingsLocaleSchema, Stats, StatsSchema, Steward, StewardCapability, StewardEnv, type StewardLocale, StewardLogger, StewardMe, StewardOptions, Subscription, SubscriptionChangeInput, SubscriptionChangeInputSchema, SubscriptionSchema, SubscriptionStatus, SubscriptionStatusSchema, SubscriptionSummary, SubscriptionSummarySchema, TtlMinutesSchema, UNIT_DECIMALS, UncancelSubscriptionResponse, UncancelSubscriptionResponseSchema, WEBHOOK_ENDPOINT_STATUSES, WEBHOOK_SECRET_PREFIX, WebUrlSchema, WebhookEndpoint, WebhookEndpointCreateInput, WebhookEndpointCreateInputSchema, WebhookEndpointList, WebhookEndpointListSchema, WebhookEndpointRotateInput, WebhookEndpointRotateInputSchema, WebhookEndpointSchema, WebhookEndpointStatus, WebhookEndpointStatusSchema, WebhookLastDelivery, WebhookLastDeliverySchema, WebhookSecretSchema, addUtcMonths, applyEmailSettingsPatch, applySettingsPatch, billingPageUrl, billingSettingsOf, buildDoctorReport, canonicalMeterFilter, checkoutRedirectUrl, consumptionOf, contributionOf, createSteward, emailLocaleOf, emailReadinessOf, emailRecipients, emailTemplateOf, emailTemplateSettings, endpointDiagnosisOf, errorCodeSpec, eventsSettingsOf, featureValueMatchesType, fromMicroUnits, generateWebhookSecret, hasControlCharacters, hostedReadinessOf, httpStatusFor, isE164, isEmailRelevant, isEventTimestampInRange, isEventType, isFeatureFlagBenefit, isGrantActive, isKnownErrorCode, isLiveSubscriptionStatus, isMeterCreditBenefit, isMicroPrecise, isReturnUrlAllowed, isValidTckn, isValidVkn, liveSubscriptionOf, manualInvoiceTotals, matchesFilter, meterChargeTotals, meterCreditsOf, meterFilterClauseOf, meteringSettingsOf, microToDecimalString, overageCapReached, overageOf, parseMicroUnits, periodBoundsOf, plainDecimalOf, rateOverage, resolveBenefits, resolveEntitlements, returnOriginsOf, rolloverOf, splitInclusiveTax, standingOf, toMicroUnits, uniqueEmails, webhookEndpointUrlProblem };
|
|
620
|
+
export { ACCOUNT_INCLUDES, API_VERSION, AccessState, AccessStateSchema, Account, AccountBenefit, AccountBenefitSchema, AccountDeleteResponse, AccountDeleteResponseSchema, AccountDetail, AccountDetailSchema, AccountDunningState, AccountDunningStateSchema, AccountInclude, AccountLocaleSchema, AccountMeter, AccountMeterSchema, AccountMeterState, AccountMeterStateSchema, AccountMeters, type AccountMetersRead, AccountMetersSchema, AccountMetersState, AccountMetersStateSchema, AccountOpenCheckout, AccountOpenCheckoutSchema, AccountOpenInvoice, AccountOpenInvoiceSchema, AccountProfileState, AccountProfileStateSchema, AccountScheduledChange, AccountScheduledChangeSchema, AccountSchema, AccountState, AccountStateChangeCause, type AccountStateRead, AccountStateSchema, AccountSubscriptionState, AccountSubscriptionStateSchema, AccountUpsertInput, AccountUpsertInputSchema, AccountUpsertResponse, AccountUpsertResponseSchema, AccountsRefreshResult, AccountsRefreshResultSchema, ActorRefSchema, AmountMinorSchema, AnyBillingEvent, AnyBillingEventSchema, ApiVersionSchema, BENEFIT_TYPES, BILLING_PATH_PLACEHOLDERS, BankTransferInstructionsEmail, BankTransferInstructionsEmailSchema, BankTransferPaymentDaysSchema, BankTransferRecordInput, BankTransferRecordInputSchema, BankTransferRecorded, BankTransferRecordedSchema, BankTransferSettings, BankTransferSettingsPatchSchema, BankTransferSettingsSchema, BenefitDef, BenefitDefSchema, BenefitDescription, BenefitDescriptionSchema, BenefitFeatureType, BenefitRulesDefinition, BenefitRulesSubscription, BenefitSourceSchema, BenefitType, BenefitTypeSchema, BillingEvent, BillingEventOf, BillingEventSchema, BillingPathSchema, BillingProfile, BillingProfileInput, BillingProfileKindSchema, BillingProfileSchema, BillingSettings, BillingSettingsPatchSchema, BillingSettingsSchema, Branding, BrandingPatchSchema, BrandingSchema, CHECKOUT_ERRORS, CancelSubscriptionInput, CancelSubscriptionInputSchema, CancelSubscriptionResponse, CancelSubscriptionResponseSchema, Catalog, CatalogBenefit, CatalogBenefitSchema, CatalogMeter, CatalogMeterSchema, CatalogPlan, CatalogPlanSchema, CatalogRead, CatalogSchema, CatalogSyncInput, CatalogSyncInputSchema, CatalogSyncResult, CatalogSyncResultSchema, ChangeSubscriptionResponse, ChangeSubscriptionResponseSchema, CheckoutConsentInput, CheckoutConsentInputSchema, CheckoutError, CheckoutPrefill, CheckoutPrefillSchema, CheckoutRedirectTarget, CheckoutReturnStatus, CheckoutSession, CheckoutSessionCreateInput, CheckoutSessionCreateInputSchema, CheckoutSessionCreateParsed, CheckoutSessionCreated, CheckoutSessionCreatedSchema, CheckoutSessionResponse, CheckoutSessionResponseSchema, CheckoutSessionSchema, CheckoutStatus, CheckoutStatusSchema, CodeSchema, Consent, ConsentSchema, CreditGrantInput, CreditGrantInputSchema, CreditGrantResponse, CreditGrantResponseSchema, Currency, CurrencySchema, DEFAULT_BANK_TRANSFER_PAYMENT_DAYS, DEFAULT_CHECKOUT_TTL_MINUTES, DEFAULT_ENDPOINT_EVENT_TYPES, DEFAULT_EVENT_RETENTION_DAYS, DEFAULT_LATE_GRACE_MINUTES, DEFAULT_METER_CHARGE_MODE, DEFAULT_METER_LOW_AT, DEFAULT_MIN_INVOICE_MINOR, DEFAULT_PAYMENT_DUE_DAYS, DEFAULT_PORTAL_TTL_MINUTES, DOCTOR_PENDING_BACKLOG_MS, DOCTOR_PROVIDER_ENVIRONMENTS, DOCTOR_REQUIRED_BRANDING, DOCTOR_REQUIRED_LEGAL_LINKS, DOCTOR_ROLLUP_LAG_WARN_SECONDS, DOCTOR_SEVERITIES, DateTimeSchema, DecimalUnitsStringSchema, DoctorBilling, DoctorBillingSchema, DoctorCatalog, DoctorCatalogSchema, DoctorEmails, DoctorEmailsSchema, DoctorEndpoint, DoctorEndpointDiagnosis, DoctorEndpointSchema, DoctorEvents, DoctorEventsSchema, DoctorFacts, DoctorHosted, DoctorHostedSchema, DoctorOverage, DoctorOverageSchema, DoctorProvider, DoctorProviderSchema, DoctorReport, DoctorReportSchema, DoctorSettings, DoctorSettingsSchema, DoctorSeverity, DoctorSeveritySchema, DoctorUnsellablePrice, DoctorUnsellablePriceSchema, DoctorUnsellableReason, DoctorWarning, DoctorWarningCode, DoctorWarningSchema, EMAIL_LOCALES, EMAIL_PAYLOAD_SCHEMAS, EMAIL_TEMPLATES, EMAIL_TEMPLATE_BY_EVENT, ERROR_CATEGORIES, ERROR_CODES, EVENTS_INGEST_MAX_BYTES, EVENTS_INGEST_MAX_EVENTS, EVENT_DETAIL_SCHEMAS, EVENT_METADATA_KEY_MAX_LENGTH, EVENT_METADATA_MAX_PAIRS, EVENT_METADATA_STRING_MAX_LENGTH, EVENT_NAME_MAX_LENGTH, EVENT_TIMESTAMP_MAX_AGE_DAYS, EVENT_TIMESTAMP_MAX_SKEW_MINUTES, 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, EventExternalIdSchema, EventIdSchema, EventMetadata, EventMetadataKeySchema, EventMetadataSchema, EventMetadataValue, EventMetadataValueSchema, EventNameSchema, EventRetentionDaysSchema, EventType, EventTypeSchema, EventsIngestInput, EventsIngestInputSchema, EventsIngestResult, EventsIngestResultSchema, EventsSettings, EventsSettingsPatchSchema, EventsSettingsSchema, ExternalRefSchema, FEATURE_FLAG_BENEFIT_TYPE, FULL_STATE_EVENT_TYPES, FeatureDef, FeatureDefSchema, FeatureFlagAccountBenefit, FeatureFlagBenefitDef, FeatureFlagBenefitDefSchema, FeatureFlagProperties, FeatureFlagPropertiesSchema, FeatureTypeSchema, Grant, GrantCreateInput, GrantCreateInputSchema, GrantCreateResponse, GrantCreateResponseSchema, GrantSchema, GrantedMeterCredit, HEADER_ACTOR_REF, HEADER_API_VERSION, HEADER_IDEMPOTENCY_KEY, HEADER_REQUEST_ID, HEADER_SDK, HttpStatusResult, INDIVIDUAL_IDENTITY_PLACEHOLDER, INGEST_REJECT_CODES, INVOICE_BILLING_REASONS, INVOICE_PAYMENT_STATUSES, IdSchema, IngestEvent, IngestEventSchema, IngestRejectCode, IngestRejectCodeSchema, IngestRejection, IngestRejectionSchema, Interval, IntervalSchema, InvalidUnitValueError, Invoice, InvoiceBillingReason, InvoiceBillingReasonSchema, InvoiceDocument, InvoiceIssueInput, InvoiceIssueInputSchema, InvoiceIssueResponse, InvoiceIssueResponseSchema, InvoiceLine, InvoiceLineSchema, InvoicePaymentDueEmail, InvoicePaymentDueEmailSchema, InvoicePaymentSession, InvoicePaymentSessionCreateInput, InvoicePaymentSessionCreateInputSchema, InvoicePaymentSessionSchema, InvoicePaymentStatus, InvoicePaymentStatusSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceVoidInput, InvoiceVoidInputSchema, InvoiceVoidResponse, InvoiceVoidResponseSchema, InvoiceWaiveInput, InvoiceWaiveInputSchema, InvoiceWaiveResponse, InvoiceWaiveResponseSchema, LEGACY_EVENT_TYPES, LIVE_SUBSCRIPTION_STATUSES, LateGraceMinutesSchema, LegacyEventType, MANUAL_INVOICE_MAX_AMOUNT_MINOR, MAX_CATALOG_BENEFITS, MAX_CATALOG_METERED_PRICES, MAX_CATALOG_METERS, MAX_CHECKOUT_CONSENT_DOCS, MAX_GRANT_BENEFITS, MAX_METERED_PRICE_PER_UNITS, MAX_METER_UNITS, MAX_NOTIFICATION_EMAILS, MAX_PLAN_BENEFITS, METERED_PRICE_TAX_MISMATCH, METER_AGGREGATION_KINDS, METER_CHARGE_MODES, METER_CHARGE_STATUSES, METER_CREDIT_ENTRY_KINDS, METER_FILTER_MAX_CONDITIONS, METER_FILTER_MAX_DEPTH, METER_FILTER_OPERATORS, METER_PERIOD_STATUSES, METER_STANDINGS, MICRO_UNITS_PER_UNIT, ManualInvoiceInput, ManualInvoiceInputSchema, ManualInvoiceLineInput, ManualInvoiceLineInputSchema, ManualInvoiceResponse, ManualInvoiceResponseSchema, MeResponse, MeResponseSchema, MetadataSchema, MeterAggregation, MeterAggregationKind, MeterAggregationSchema, MeterCharge, MeterChargeLine, MeterChargeLineSchema, MeterChargeList, MeterChargeListSchema, MeterChargeMode, MeterChargeModeSchema, MeterChargeSchema, MeterChargeStatus, MeterChargeStatusSchema, MeterChargeTotalsLine, MeterContribution, MeterCreditAccountBenefit, MeterCreditBenefit, MeterCreditBenefitDef, MeterCreditBenefitDefSchema, MeterCreditEntry, MeterCreditEntryKind, MeterCreditEntryKindSchema, MeterCreditEntrySchema, MeterCreditProperties, MeterCreditPropertiesSchema, MeterCreditsOptions, MeterDef, MeterDefInput, MeterDefSchema, MeterFilter, MeterFilterClause, MeterFilterCondition, MeterFilterGroup, MeterFilterOperand, MeterFilterOperator, MeterFilterSchema, MeterFilterValue, MeterLabel, MeterLabelSchema, MeterLowAtSchema, MeterPeriod, MeterPeriodList, MeterPeriodListSchema, MeterPeriodSchema, MeterPeriodStatus, MeterPeriodStatusSchema, MeterRulesEvent, MeterRulesMeter, MeterStanding, MeterStandingSchema, MeterUnitsSchema, MeteredPrice, MeteredPriceDef, MeteredPriceDefSchema, MeteredPriceSchema, MeteringSettings, MeteringSettingsPatchSchema, MeteringSettingsSchema, MutationOptions, NoticedMeteredRate, NoticedMeteredRateSchema, NotificationEmailsSchema, OVERRIDE_BENEFIT_SOURCE, OverageRateInput, PAYMENT_METHODS, PING_EVENT_TYPE, PLAN_SET_MODES, PORTAL_SESSION_ERRORS, Payment, PaymentDueDaysSchema, PaymentMethod, PaymentMethodSchema, PaymentSchema, Ping, PingSchema, PlanDef, PlanDefSchema, PlanSetInput, PlanSetInputSchema, PlanSetMode, PlanSetModeSchema, PlanSetResponse, PlanSetResponseSchema, PlanSetWarning, PlanSetWarningCode, PlanSetWarningSchema, PortalSession, PortalSessionCreateInput, PortalSessionCreateInputSchema, PortalSessionError, PortalSessionSchema, Price, PriceChangeNoticeEmail, PriceChangeNoticeEmailSchema, PriceChangeNoticeMeteredRate, PriceChangeNoticeMeteredRateSchema, PriceDef, PriceDefSchema, PriceSchema, ProductSettings, ProductSettingsPatch, ProductSettingsPatchSchema, ProductSettingsSchema, ProviderPayload, ProviderPayloadSchema, ResolveBenefitsInput, ResolveEntitlementsInput, ResolvedBenefit, ResolvedBenefits, ResolvedEntitlements, ResyncResult, ResyncResultSchema, type RetryClass, type RetryOptions, ReturnOriginSchema, SETTINGS_LOCALES, STEWARD_CAPABILITIES, SettingsLocale, SettingsLocaleSchema, Stats, StatsSchema, Steward, StewardCapability, StewardEnv, type StewardLocale, StewardLogger, StewardMe, StewardOptions, Subscription, SubscriptionChangeInput, SubscriptionChangeInputSchema, SubscriptionSchema, SubscriptionStatus, SubscriptionStatusSchema, SubscriptionSummary, SubscriptionSummarySchema, TtlMinutesSchema, UNIT_DECIMALS, UncancelSubscriptionResponse, UncancelSubscriptionResponseSchema, WEBHOOK_ENDPOINT_STATUSES, WEBHOOK_SECRET_PREFIX, WebUrlSchema, WebhookEndpoint, WebhookEndpointCreateInput, WebhookEndpointCreateInputSchema, WebhookEndpointList, WebhookEndpointListSchema, WebhookEndpointRotateInput, WebhookEndpointRotateInputSchema, WebhookEndpointSchema, WebhookEndpointStatus, WebhookEndpointStatusSchema, WebhookLastDelivery, WebhookLastDeliverySchema, WebhookSecretSchema, addUtcMonths, applyEmailSettingsPatch, applySettingsPatch, billingPageUrl, billingSettingsOf, buildDoctorReport, canonicalMeterFilter, checkoutRedirectUrl, consumptionOf, contributionOf, createSteward, emailLocaleOf, emailReadinessOf, emailRecipients, emailTemplateOf, emailTemplateSettings, endpointDiagnosisOf, errorCodeSpec, eventsSettingsOf, featureValueMatchesType, fromMicroUnits, generateWebhookSecret, hasControlCharacters, hostedReadinessOf, httpStatusFor, isE164, isEmailRelevant, isEventTimestampInRange, isEventType, isFeatureFlagBenefit, isGrantActive, isKnownErrorCode, isLiveSubscriptionStatus, isMeterCreditBenefit, isMicroPrecise, isReturnUrlAllowed, isValidTckn, isValidVkn, liveSubscriptionOf, manualInvoiceTotals, matchesFilter, meterChargeTotals, meterCreditsOf, meterFilterClauseOf, meteringSettingsOf, microToDecimalString, overageCapReached, overageOf, parseMicroUnits, periodBoundsOf, plainDecimalOf, rateOverage, resolveBenefits, resolveEntitlements, returnOriginsOf, rolloverOf, splitInclusiveTax, standingOf, toMicroUnits, uniqueEmails, webhookEndpointUrlProblem };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { $ as rolloverOf, $t as
|
|
1
|
+
import { $ as emailLocaleOf, $t as MeteredPriceSchema, A as SubscriptionStatusSchema, An as hasControlCharacters, At as METER_FILTER_MAX_CONDITIONS, B as EmailSenderSchema, Bn as EntitlementsSchema, Bt as MeterCreditEntryKindSchema, C as AccountSchema, Cn as EventNameSchema, Ct as DEFAULT_METER_LOW_AT, D as BillingProfileKindSchema, Dn as IngestEventSchema, Dt as METER_AGGREGATION_KINDS, E as AccountUpsertInputSchema, En as INGEST_REJECT_CODES, Et as MAX_METER_UNITS, F as EMAIL_LOCALES, Fn as CodeSchema, Ft as MeterAggregationSchema, G as InvoicePaymentDueEmailSchema, Gn as INVOICE_PAYMENT_STATUSES, Gt as MeterLabelSchema, H as EmailSettingsSchema, Hn as ErrorResponseSchema, Ht as MeterCreditPropertiesSchema, I as EMAIL_PAYLOAD_SCHEMAS, In as CurrencySchema, It as MeterChargeLineSchema, J as NotificationEmailsSchema, Jn as InvoiceBillingReasonSchema, Jt as MeterPeriodSchema, K as MAX_NOTIFICATION_EMAILS, Kn as IdSchema, Kt as MeterLowAtSchema, L as EMAIL_TEMPLATES, Ln as DateTimeSchema, Lt as MeterChargeListSchema, M as BILLING_PATH_PLACEHOLDERS, Mn as API_VERSION, Mt as METER_FILTER_OPERATORS, N as BankTransferInstructionsEmailSchema, Nn as ActorRefSchema, Nt as METER_PERIOD_STATUSES, O as BillingProfileSchema, On as IngestRejectCodeSchema, Ot as METER_CHARGE_STATUSES, P as BillingPathSchema, Pn as AmountMinorSchema, Pt as METER_STANDINGS, Q as billingPageUrl, Qt as MeteredPriceDefSchema, R as EMAIL_TEMPLATE_BY_EVENT, Rn as ERROR_CATEGORIES, Rt as MeterChargeSchema, S as AccountScheduledChangeSchema, Sn as EventMetadataValueSchema, St as CreditGrantInputSchema, T as AccountSubscriptionStateSchema, Tn as EventsIngestResultSchema, Tt as MAX_METERED_PRICE_PER_UNITS, U as EmailTemplateSchema, Un as ExternalRefSchema, Ut as MeterDefSchema, V as EmailSettingsPatchSchema, Vn as ErrorCategorySchema, Vt as MeterCreditEntrySchema, W as EmailTemplateSettingsSchema, Wn as INVOICE_BILLING_REASONS, Wt as MeterFilterSchema, X as PriceChangeNoticeMeteredRateSchema, Xn as MetadataSchema, Xt as MeterStandingSchema, Y as PriceChangeNoticeEmailSchema, Yn as InvoicePaymentStatusSchema, Yt as MeterPeriodStatusSchema, Z as applyEmailSettingsPatch, Zt as MeterUnitsSchema, _ as AccountMeterStateSchema, _n as EVENT_TIMESTAMP_MAX_AGE_DAYS, _t as isFeatureFlagBenefit, a as EVENT_TYPES, an as fromMicroUnits, at as uniqueEmails, b as AccountOpenInvoiceSchema, bn as EventMetadataKeySchema, bt as AccountMetersSchema, c as LEGACY_EVENT_TYPES, cn as parseMicroUnits, ct as BenefitDefSchema, d as isEventType, dn as EVENTS_INGEST_MAX_BYTES, dt as BenefitTypeSchema, en as canonicalMeterFilter, et as emailRecipients, f as ACCOUNT_INCLUDES, fn as EVENTS_INGEST_MAX_EVENTS, ft as CatalogBenefitSchema, g as AccountLocaleSchema, gn as EVENT_NAME_MAX_LENGTH, gt as featureValueMatchesType, h as AccountDunningStateSchema, hn as EVENT_METADATA_STRING_MAX_LENGTH, ht as MeterCreditBenefitDefSchema, i as EVENT_DETAIL_SCHEMAS, in as UNIT_DECIMALS, it as liveSubscriptionOf, j as SubscriptionSummarySchema, jn as isEventTimestampInRange, jt as METER_FILTER_MAX_DEPTH, k as EntitlementSnapshotSchema, kn as IngestRejectionSchema, kt as METER_CREDIT_ENTRY_KINDS, l as PING_EVENT_TYPE, ln as plainDecimalOf, lt as BenefitDescriptionSchema, m as AccountDeleteResponseSchema, mn as EVENT_METADATA_MAX_PAIRS, mt as FeatureFlagPropertiesSchema, n as ApiVersionSchema, nn as InvalidUnitValueError, nt as emailTemplateSettings, o as EventIdSchema, on as isMicroPrecise, ot as AccountBenefitSchema, p as AccessStateSchema, pn as EVENT_METADATA_KEY_MAX_LENGTH, pt as FeatureFlagBenefitDefSchema, q as NoticedMeteredRateSchema, qn as IntervalSchema, qt as MeterPeriodListSchema, r as BillingEventSchema, rn as MICRO_UNITS_PER_UNIT, rt as isEmailRelevant, s as FULL_STATE_EVENT_TYPES, sn as microToDecimalString, st as BENEFIT_TYPES, t as AnyBillingEventSchema, tn as meterFilterClauseOf, tt as emailTemplateOf, u as PingSchema, un as toMicroUnits, ut as BenefitSourceSchema, v as AccountMetersStateSchema, vn as EVENT_TIMESTAMP_MAX_SKEW_MINUTES, vt as isMeterCreditBenefit, w as AccountStateSchema, wn as EventsIngestInputSchema, wt as DecimalUnitsStringSchema, x as AccountProfileStateSchema, xn as EventMetadataSchema, xt as CatalogMeterSchema, y as AccountOpenCheckoutSchema, yn as EventExternalIdSchema, yt as AccountMeterSchema, z as EmailExtraTextSchema, zn as EntitlementValueSchema, zt as MeterChargeStatusSchema } from "./_chunks/events.js";
|
|
2
|
+
import { $ as rolloverOf, $n as MAX_CATALOG_BENEFITS, $t as CheckoutSessionCreatedSchema, A as WebhookEndpointRotateInputSchema, An as MeteringSettingsPatchSchema, At as InvoiceWaiveInputSchema, B as PlanSetResponseSchema, Bn as applySettingsPatch, Bt as PaymentSchema, C as hostedReadinessOf, Cn as DEFAULT_PORTAL_TTL_MINUTES, Ct as InvoiceIssueInputSchema, D as WEBHOOK_SECRET_PREFIX, Dn as LateGraceMinutesSchema, Dt as InvoiceSchema, E as WEBHOOK_ENDPOINT_STATUSES, En as EventsSettingsSchema, Et as InvoicePaymentSessionSchema, F as generateWebhookSecret, Fn as ReturnOriginSchema, Ft as splitInclusiveTax, G as contributionOf, Gn as returnOriginsOf, Gt as PortalSessionCreateInputSchema, H as ResyncResultSchema, Hn as eventsSettingsOf, Ht as SubscriptionChangeInputSchema, I as webhookEndpointUrlProblem, In as SETTINGS_LOCALES, It as CancelSubscriptionInputSchema, J as meterCreditsOf, Jn as CatalogSchema, Jt as BankTransferRecordedSchema, K as matchesFilter, Kn as AccountsRefreshResultSchema, Kt as PortalSessionSchema, L as PLAN_SET_MODES, Ln as SettingsLocaleSchema, Lt as GrantCreateInputSchema, M as WebhookEndpointStatusSchema, Mn as PaymentDueDaysSchema, Mt as ManualInvoiceInputSchema, N as WebhookLastDeliverySchema, Nn as ProductSettingsPatchSchema, Nt as ManualInvoiceLineInputSchema, O as WebhookEndpointCreateInputSchema, On as METER_CHARGE_MODES, Ot as InvoiceStatusSchema, P as WebhookSecretSchema, Pn as ProductSettingsSchema, Pt as manualInvoiceTotals, Q as rateOverage, Qn as FeatureTypeSchema, Qt as CheckoutSessionCreateInputSchema, R as PlanSetInputSchema, Rn as TtlMinutesSchema, Rt as GrantSchema, S as endpointDiagnosisOf, Sn as DEFAULT_PAYMENT_DUE_DAYS, St as UncancelSubscriptionResponseSchema, T as EventTypeSchema, Tn as EventsSettingsPatchSchema, Tt as InvoicePaymentSessionCreateInputSchema, U as addUtcMonths, Un as isReturnUrlAllowed, Ut as SubscriptionSchema, V as PlanSetWarningSchema, Vn as billingSettingsOf, Vt as StatsSchema, W as consumptionOf, Wn as meteringSettingsOf, Wt as PORTAL_SESSION_ERRORS, X as overageOf, Xn as CatalogSyncResultSchema, Xt as CheckoutConsentInputSchema, Y as overageCapReached, Yn as CatalogSyncInputSchema, Yt as CHECKOUT_ERRORS, Z as periodBoundsOf, Zn as FeatureDefSchema, Zt as CheckoutPrefillSchema, _ as DoctorSeveritySchema, _n as DEFAULT_CHECKOUT_TTL_MINUTES, _t as InvoiceVoidResponseSchema, a as DOCTOR_ROLLUP_LAG_WARN_SECONDS, an as PAYMENT_METHODS, ar as PriceDefSchema, at as AccountUpsertResponseSchema, b as buildDoctorReport, bn as DEFAULT_METER_CHARGE_MODE, bt as MeResponseSchema, c as DoctorCatalogSchema, cn as checkoutRedirectUrl, ct as CheckoutSessionResponseSchema, d as DoctorEventsSchema, dn as BankTransferSettingsSchema, dt as HEADER_ACTOR_REF, en as CheckoutSessionSchema, er as MAX_CATALOG_METERED_PRICES, et as standingOf, f as DoctorHostedSchema, fn as BillingSettingsPatchSchema, ft as HEADER_API_VERSION, g as DoctorSettingsSchema, gn as DEFAULT_BANK_TRANSFER_PAYMENT_DAYS, gt as InvoiceIssueResponseSchema, h as DoctorReportSchema, hn as BrandingSchema, ht as HEADER_SDK, i as DOCTOR_REQUIRED_LEGAL_LINKS, in as MAX_CHECKOUT_CONSENT_DOCS, ir as PlanDefSchema, it as AccountDetailSchema, j as WebhookEndpointSchema, jn as MeteringSettingsSchema, jt as MANUAL_INVOICE_MAX_AMOUNT_MINOR, k as WebhookEndpointListSchema, kn as MeterChargeModeSchema, kt as InvoiceVoidInputSchema, l as DoctorEmailsSchema, ln as BankTransferPaymentDaysSchema, lt as CreditGrantResponseSchema, m as DoctorProviderSchema, mn as BrandingPatchSchema, mt as HEADER_REQUEST_ID, n as DOCTOR_PROVIDER_ENVIRONMENTS, nn as ConsentSchema, nr as MAX_PLAN_BENEFITS, nt as errorCodeSpec, o as DOCTOR_SEVERITIES, on as PaymentMethodSchema, or as PriceSchema, ot as CancelSubscriptionResponseSchema, p as DoctorOverageSchema, pn as BillingSettingsSchema, pt as HEADER_IDEMPOTENCY_KEY, q as meterChargeTotals, qn as CatalogPlanSchema, qt as BankTransferRecordInputSchema, r as DOCTOR_REQUIRED_BRANDING, rn as INDIVIDUAL_IDENTITY_PLACEHOLDER, rr as METERED_PRICE_TAX_MISMATCH, rt as isKnownErrorCode, s as DoctorBillingSchema, sn as ProviderPayloadSchema, st as ChangeSubscriptionResponseSchema, t as DOCTOR_PENDING_BACKLOG_MS, tn as CheckoutStatusSchema, tr as MAX_CATALOG_METERS, tt as ERROR_CODES, u as DoctorEndpointSchema, un as BankTransferSettingsPatchSchema, ut as GrantCreateResponseSchema, v as DoctorUnsellablePriceSchema, vn as DEFAULT_EVENT_RETENTION_DAYS, vt as InvoiceWaiveResponseSchema, w as DEFAULT_ENDPOINT_EVENT_TYPES, wn as EventRetentionDaysSchema, wt as InvoiceLineSchema, x as emailReadinessOf, xn as DEFAULT_MIN_INVOICE_MINOR, xt as STEWARD_CAPABILITIES, y as DoctorWarningSchema, yn as DEFAULT_LATE_GRACE_MINUTES, yt as ManualInvoiceResponseSchema, z as PlanSetModeSchema, zn as WebUrlSchema, zt as MAX_GRANT_BENEFITS } from "./_chunks/src.js";
|
|
3
3
|
import { a as LIVE_SUBSCRIPTION_STATUSES, c as isLiveSubscriptionStatus, i as FEATURE_FLAG_BENEFIT_TYPE, l as resolveBenefits, n as isValidTckn, o as OVERRIDE_BENEFIT_SOURCE, r as isValidVkn, s as isGrantActive, t as isE164, u as resolveEntitlements } from "./_chunks/validators.js";
|
|
4
4
|
import { a as StewardNetworkError, i as StewardError, n as StewardConfigError, r as StewardContractError, t as StewardApiError } from "./_chunks/errors.js";
|
|
5
5
|
//#region ../contract/src/client.ts
|
|
@@ -306,7 +306,7 @@ async function withRetries(request, policy, send) {
|
|
|
306
306
|
}
|
|
307
307
|
//#endregion
|
|
308
308
|
//#region src/steward.ts
|
|
309
|
-
const SDK_HEADER = `@stewardhq/sdk/0.
|
|
309
|
+
const SDK_HEADER = `@stewardhq/sdk/0.6.0`;
|
|
310
310
|
const defaultEnv = () => globalThis.process?.env ?? {};
|
|
311
311
|
function isHttpUrl(value) {
|
|
312
312
|
try {
|
|
@@ -2151,4 +2151,4 @@ function Meters(options) {
|
|
|
2151
2151
|
};
|
|
2152
2152
|
}
|
|
2153
2153
|
//#endregion
|
|
2154
|
-
export { ACCOUNT_INCLUDES, API_VERSION, AccessStateSchema, AccountBenefitSchema, AccountDeleteResponseSchema, AccountDetailSchema, AccountDunningStateSchema, AccountLocaleSchema, AccountMeterSchema, AccountMeterStateSchema, AccountMetersSchema, AccountMetersStateSchema, AccountOpenCheckoutSchema, AccountOpenInvoiceSchema, AccountProfileStateSchema, AccountScheduledChangeSchema, AccountSchema, AccountStateSchema, AccountSubscriptionStateSchema, AccountUpsertInputSchema, AccountUpsertResponseSchema, AccountsRefreshResultSchema, ActorRefSchema, AmountMinorSchema, AnyBillingEventSchema, ApiVersionSchema, BENEFIT_TYPES, BILLING_PATH_PLACEHOLDERS, BenefitDefSchema, BenefitDescriptionSchema, BenefitSourceSchema, BenefitTypeSchema, BillingEventSchema, BillingPathSchema, BillingProfileKindSchema, BillingProfileSchema, BillingSettingsPatchSchema, BillingSettingsSchema, BrandingPatchSchema, BrandingSchema, CHECKOUT_ERRORS, CancelSubscriptionInputSchema, CancelSubscriptionResponseSchema, CatalogBenefitSchema, CatalogMeterSchema, CatalogPlanSchema, CatalogSchema, CatalogSyncInputSchema, CatalogSyncResultSchema, ChangeSubscriptionResponseSchema, CheckoutConsentInputSchema, CheckoutPrefillSchema, CheckoutSessionCreateInputSchema, CheckoutSessionCreatedSchema, CheckoutSessionResponseSchema, CheckoutSessionSchema, CheckoutStatusSchema, CodeSchema, ConsentSchema, CreditGrantInputSchema, CreditGrantResponseSchema, CurrencySchema, DEFAULT_CHECKOUT_TTL_MINUTES, DEFAULT_ENDPOINT_EVENT_TYPES, DEFAULT_EVENT_RETENTION_DAYS, DEFAULT_LATE_GRACE_MINUTES, DEFAULT_METER_CHARGE_MODE, DEFAULT_METER_LOW_AT, DEFAULT_MIN_INVOICE_MINOR, DEFAULT_PAYMENT_DUE_DAYS, DEFAULT_PORTAL_TTL_MINUTES, DOCTOR_PENDING_BACKLOG_MS, DOCTOR_PROVIDER_ENVIRONMENTS, DOCTOR_REQUIRED_BRANDING, DOCTOR_REQUIRED_LEGAL_LINKS, DOCTOR_ROLLUP_LAG_WARN_SECONDS, DOCTOR_SEVERITIES, DateTimeSchema, DecimalUnitsStringSchema, DoctorBillingSchema, DoctorCatalogSchema, DoctorEmailsSchema, DoctorEndpointSchema, DoctorEventsSchema, DoctorHostedSchema, DoctorOverageSchema, DoctorProviderSchema, DoctorReportSchema, DoctorSettingsSchema, DoctorSeveritySchema, DoctorUnsellablePriceSchema, DoctorWarningSchema, EMAIL_LOCALES, EMAIL_PAYLOAD_SCHEMAS, EMAIL_TEMPLATES, EMAIL_TEMPLATE_BY_EVENT, ERROR_CATEGORIES, ERROR_CODES, EVENTS_INGEST_MAX_BYTES, EVENTS_INGEST_MAX_EVENTS, EVENTS_RECENT_MS, EVENT_DETAIL_SCHEMAS, EVENT_METADATA_KEY_MAX_LENGTH, EVENT_METADATA_MAX_PAIRS, EVENT_METADATA_STRING_MAX_LENGTH, EVENT_NAME_MAX_LENGTH, EVENT_TIMESTAMP_MAX_AGE_DAYS, EVENT_TIMESTAMP_MAX_SKEW_MINUTES, EVENT_TYPES, EmailExtraTextSchema, EmailSenderSchema, EmailSettingsPatchSchema, EmailSettingsSchema, EmailTemplateSchema, EmailTemplateSettingsSchema, EntitlementSnapshotSchema, EntitlementValueSchema, EntitlementsSchema, ErrorCategorySchema, ErrorResponseSchema, EventExternalIdSchema, EventIdSchema, EventMetadataKeySchema, EventMetadataSchema, EventMetadataValueSchema, EventNameSchema, EventRetentionDaysSchema, EventTypeSchema, Events, EventsIngestInputSchema, EventsIngestResultSchema, EventsSettingsPatchSchema, EventsSettingsSchema, ExternalRefSchema, FEATURE_FLAG_BENEFIT_TYPE, FULL_STATE_EVENT_TYPES, FeatureDefSchema, FeatureFlagBenefitDefSchema, FeatureFlagPropertiesSchema, FeatureTypeSchema, GrantCreateInputSchema, GrantCreateResponseSchema, GrantSchema, HEADER_ACTOR_REF, HEADER_API_VERSION, HEADER_IDEMPOTENCY_KEY, HEADER_REQUEST_ID, HEADER_SDK, INDIVIDUAL_IDENTITY_PLACEHOLDER, INGEST_REJECT_CODES, INVOICE_BILLING_REASONS, INVOICE_PAYMENT_STATUSES, IdSchema, IngestEventSchema, IngestRejectCodeSchema, IngestRejectionSchema, IntervalSchema, InvalidUnitValueError, InvoiceBillingReasonSchema, InvoiceIssueInputSchema, InvoiceIssueResponseSchema, InvoiceLineSchema, InvoicePaymentDueEmailSchema, InvoicePaymentSessionCreateInputSchema, InvoicePaymentSessionSchema, InvoicePaymentStatusSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceVoidInputSchema, InvoiceVoidResponseSchema, InvoiceWaiveInputSchema, InvoiceWaiveResponseSchema, LEGACY_EVENT_TYPES, LIVE_SUBSCRIPTION_STATUSES, LateGraceMinutesSchema, MANUAL_INVOICE_MAX_AMOUNT_MINOR, MAX_CATALOG_BENEFITS, MAX_CATALOG_METERED_PRICES, MAX_CATALOG_METERS, MAX_CHECKOUT_CONSENT_DOCS, MAX_GRANT_BENEFITS, MAX_METERED_PRICE_PER_UNITS, MAX_METER_UNITS, MAX_NOTIFICATION_EMAILS, MAX_PLAN_BENEFITS, METERED_PRICE_TAX_MISMATCH, METER_AGGREGATION_KINDS, METER_CHARGE_MODES, METER_CHARGE_STATUSES, METER_CREDIT_ENTRY_KINDS, METER_FILTER_MAX_CONDITIONS, METER_FILTER_MAX_DEPTH, METER_FILTER_OPERATORS, METER_PERIOD_STATUSES, METER_STANDINGS, MICRO_UNITS_PER_UNIT, ManualInvoiceInputSchema, ManualInvoiceLineInputSchema, ManualInvoiceResponseSchema, MeResponseSchema, MetadataSchema, MeterAggregationSchema, MeterChargeLineSchema, MeterChargeListSchema, MeterChargeModeSchema, MeterChargeSchema, MeterChargeStatusSchema, MeterCreditBenefitDefSchema, MeterCreditEntryKindSchema, MeterCreditEntrySchema, MeterCreditPropertiesSchema, MeterDefSchema, MeterFilterSchema, MeterLabelSchema, MeterLowAtSchema, MeterPeriodListSchema, MeterPeriodSchema, MeterPeriodStatusSchema, MeterStandingSchema, MeterUnitsSchema, MeteredPriceDefSchema, MeteredPriceSchema, MeteringSettingsPatchSchema, MeteringSettingsSchema, Meters, NoticedMeteredRateSchema, NotificationEmailsSchema, OVERRIDE_BENEFIT_SOURCE, PING_EVENT_TYPE, PLAN_SET_MODES, PORTAL_SESSION_ERRORS, PaymentDueDaysSchema, PaymentSchema, PingSchema, PlanDefSchema, PlanSetInputSchema, PlanSetModeSchema, PlanSetResponseSchema, PlanSetWarningSchema, PortalSessionCreateInputSchema, PortalSessionSchema, PriceChangeNoticeEmailSchema, PriceChangeNoticeMeteredRateSchema, PriceDefSchema, PriceSchema, ProductSettingsPatchSchema, ProductSettingsSchema, ProviderPayloadSchema, ResyncResultSchema, ReturnOriginSchema, SETTINGS_LOCALES, STEWARD_CAPABILITIES, SettingsLocaleSchema, StatsSchema, StewardApiError, StewardConfigError, StewardContractError, StewardError, StewardNetworkError, SubscriptionChangeInputSchema, SubscriptionSchema, SubscriptionStatusSchema, SubscriptionSummarySchema, TtlMinutesSchema, UNIT_DECIMALS, UncancelSubscriptionResponseSchema, WEBHOOK_ENDPOINT_STATUSES, WEBHOOK_SECRET_PREFIX, WebUrlSchema, WebhookEndpointCreateInputSchema, WebhookEndpointListSchema, WebhookEndpointRotateInputSchema, WebhookEndpointSchema, WebhookEndpointStatusSchema, WebhookLastDeliverySchema, WebhookSecretSchema, addUtcMonths, applyEmailSettingsPatch, applySettingsPatch, billingPageUrl, billingSettingsOf, buildDoctorReport, canonicalMeterFilter, checkoutRedirectUrl, consumptionOf, contributionOf, count, createSteward, defineCatalog, emailLocaleOf, emailReadinessOf, emailRecipients, emailTemplateOf, emailTemplateSettings, endpointDiagnosisOf, errorCodeSpec, eventsSettingsOf, featureFlag, featureValueMatchesType, flag, fromMicroUnits, generateWebhookSecret, hasControlCharacters, hostedReadinessOf, httpStatusFor, isE164, isEmailRelevant, isEventTimestampInRange, isEventType, isFeatureFlagBenefit, isGrantActive, isKnownErrorCode, isLiveSubscriptionStatus, isMeterCreditBenefit, isMicroPrecise, isReturnUrlAllowed, isValidTckn, isValidVkn, limit, liveSubscriptionOf, manualInvoiceTotals, matchesFilter, max, meter, meterChargeTotals, meterCredit, meterCreditsOf, meterFilterClauseOf, meteringSettingsOf, microToDecimalString, overageCapReached, overageOf, parseMicroUnits, periodBoundsOf, plainDecimalOf, rateOverage, resolveBenefits, resolveEntitlements, returnOriginsOf, rolloverOf, splitInclusiveTax, standingOf, stateCache, sum, text, toMicroUnits, unique, uniqueEmails, webhookEndpointUrlProblem };
|
|
2154
|
+
export { ACCOUNT_INCLUDES, API_VERSION, AccessStateSchema, AccountBenefitSchema, AccountDeleteResponseSchema, AccountDetailSchema, AccountDunningStateSchema, AccountLocaleSchema, AccountMeterSchema, AccountMeterStateSchema, AccountMetersSchema, AccountMetersStateSchema, AccountOpenCheckoutSchema, AccountOpenInvoiceSchema, AccountProfileStateSchema, AccountScheduledChangeSchema, AccountSchema, AccountStateSchema, AccountSubscriptionStateSchema, AccountUpsertInputSchema, AccountUpsertResponseSchema, AccountsRefreshResultSchema, ActorRefSchema, AmountMinorSchema, AnyBillingEventSchema, ApiVersionSchema, BENEFIT_TYPES, BILLING_PATH_PLACEHOLDERS, BankTransferInstructionsEmailSchema, BankTransferPaymentDaysSchema, BankTransferRecordInputSchema, BankTransferRecordedSchema, BankTransferSettingsPatchSchema, BankTransferSettingsSchema, BenefitDefSchema, BenefitDescriptionSchema, BenefitSourceSchema, BenefitTypeSchema, BillingEventSchema, BillingPathSchema, BillingProfileKindSchema, BillingProfileSchema, BillingSettingsPatchSchema, BillingSettingsSchema, BrandingPatchSchema, BrandingSchema, CHECKOUT_ERRORS, CancelSubscriptionInputSchema, CancelSubscriptionResponseSchema, CatalogBenefitSchema, CatalogMeterSchema, CatalogPlanSchema, CatalogSchema, CatalogSyncInputSchema, CatalogSyncResultSchema, ChangeSubscriptionResponseSchema, CheckoutConsentInputSchema, CheckoutPrefillSchema, CheckoutSessionCreateInputSchema, CheckoutSessionCreatedSchema, CheckoutSessionResponseSchema, CheckoutSessionSchema, CheckoutStatusSchema, CodeSchema, ConsentSchema, CreditGrantInputSchema, CreditGrantResponseSchema, CurrencySchema, DEFAULT_BANK_TRANSFER_PAYMENT_DAYS, DEFAULT_CHECKOUT_TTL_MINUTES, DEFAULT_ENDPOINT_EVENT_TYPES, DEFAULT_EVENT_RETENTION_DAYS, DEFAULT_LATE_GRACE_MINUTES, DEFAULT_METER_CHARGE_MODE, DEFAULT_METER_LOW_AT, DEFAULT_MIN_INVOICE_MINOR, DEFAULT_PAYMENT_DUE_DAYS, DEFAULT_PORTAL_TTL_MINUTES, DOCTOR_PENDING_BACKLOG_MS, DOCTOR_PROVIDER_ENVIRONMENTS, DOCTOR_REQUIRED_BRANDING, DOCTOR_REQUIRED_LEGAL_LINKS, DOCTOR_ROLLUP_LAG_WARN_SECONDS, DOCTOR_SEVERITIES, DateTimeSchema, DecimalUnitsStringSchema, DoctorBillingSchema, DoctorCatalogSchema, DoctorEmailsSchema, DoctorEndpointSchema, DoctorEventsSchema, DoctorHostedSchema, DoctorOverageSchema, DoctorProviderSchema, DoctorReportSchema, DoctorSettingsSchema, DoctorSeveritySchema, DoctorUnsellablePriceSchema, DoctorWarningSchema, EMAIL_LOCALES, EMAIL_PAYLOAD_SCHEMAS, EMAIL_TEMPLATES, EMAIL_TEMPLATE_BY_EVENT, ERROR_CATEGORIES, ERROR_CODES, EVENTS_INGEST_MAX_BYTES, EVENTS_INGEST_MAX_EVENTS, EVENTS_RECENT_MS, EVENT_DETAIL_SCHEMAS, EVENT_METADATA_KEY_MAX_LENGTH, EVENT_METADATA_MAX_PAIRS, EVENT_METADATA_STRING_MAX_LENGTH, EVENT_NAME_MAX_LENGTH, EVENT_TIMESTAMP_MAX_AGE_DAYS, EVENT_TIMESTAMP_MAX_SKEW_MINUTES, EVENT_TYPES, EmailExtraTextSchema, EmailSenderSchema, EmailSettingsPatchSchema, EmailSettingsSchema, EmailTemplateSchema, EmailTemplateSettingsSchema, EntitlementSnapshotSchema, EntitlementValueSchema, EntitlementsSchema, ErrorCategorySchema, ErrorResponseSchema, EventExternalIdSchema, EventIdSchema, EventMetadataKeySchema, EventMetadataSchema, EventMetadataValueSchema, EventNameSchema, EventRetentionDaysSchema, EventTypeSchema, Events, EventsIngestInputSchema, EventsIngestResultSchema, EventsSettingsPatchSchema, EventsSettingsSchema, ExternalRefSchema, FEATURE_FLAG_BENEFIT_TYPE, FULL_STATE_EVENT_TYPES, FeatureDefSchema, FeatureFlagBenefitDefSchema, FeatureFlagPropertiesSchema, FeatureTypeSchema, GrantCreateInputSchema, GrantCreateResponseSchema, GrantSchema, HEADER_ACTOR_REF, HEADER_API_VERSION, HEADER_IDEMPOTENCY_KEY, HEADER_REQUEST_ID, HEADER_SDK, INDIVIDUAL_IDENTITY_PLACEHOLDER, INGEST_REJECT_CODES, INVOICE_BILLING_REASONS, INVOICE_PAYMENT_STATUSES, IdSchema, IngestEventSchema, IngestRejectCodeSchema, IngestRejectionSchema, IntervalSchema, InvalidUnitValueError, InvoiceBillingReasonSchema, InvoiceIssueInputSchema, InvoiceIssueResponseSchema, InvoiceLineSchema, InvoicePaymentDueEmailSchema, InvoicePaymentSessionCreateInputSchema, InvoicePaymentSessionSchema, InvoicePaymentStatusSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceVoidInputSchema, InvoiceVoidResponseSchema, InvoiceWaiveInputSchema, InvoiceWaiveResponseSchema, LEGACY_EVENT_TYPES, LIVE_SUBSCRIPTION_STATUSES, LateGraceMinutesSchema, MANUAL_INVOICE_MAX_AMOUNT_MINOR, MAX_CATALOG_BENEFITS, MAX_CATALOG_METERED_PRICES, MAX_CATALOG_METERS, MAX_CHECKOUT_CONSENT_DOCS, MAX_GRANT_BENEFITS, MAX_METERED_PRICE_PER_UNITS, MAX_METER_UNITS, MAX_NOTIFICATION_EMAILS, MAX_PLAN_BENEFITS, METERED_PRICE_TAX_MISMATCH, METER_AGGREGATION_KINDS, METER_CHARGE_MODES, METER_CHARGE_STATUSES, METER_CREDIT_ENTRY_KINDS, METER_FILTER_MAX_CONDITIONS, METER_FILTER_MAX_DEPTH, METER_FILTER_OPERATORS, METER_PERIOD_STATUSES, METER_STANDINGS, MICRO_UNITS_PER_UNIT, ManualInvoiceInputSchema, ManualInvoiceLineInputSchema, ManualInvoiceResponseSchema, MeResponseSchema, MetadataSchema, MeterAggregationSchema, MeterChargeLineSchema, MeterChargeListSchema, MeterChargeModeSchema, MeterChargeSchema, MeterChargeStatusSchema, MeterCreditBenefitDefSchema, MeterCreditEntryKindSchema, MeterCreditEntrySchema, MeterCreditPropertiesSchema, MeterDefSchema, MeterFilterSchema, MeterLabelSchema, MeterLowAtSchema, MeterPeriodListSchema, MeterPeriodSchema, MeterPeriodStatusSchema, MeterStandingSchema, MeterUnitsSchema, MeteredPriceDefSchema, MeteredPriceSchema, MeteringSettingsPatchSchema, MeteringSettingsSchema, Meters, NoticedMeteredRateSchema, NotificationEmailsSchema, OVERRIDE_BENEFIT_SOURCE, PAYMENT_METHODS, PING_EVENT_TYPE, PLAN_SET_MODES, PORTAL_SESSION_ERRORS, PaymentDueDaysSchema, PaymentMethodSchema, PaymentSchema, PingSchema, PlanDefSchema, PlanSetInputSchema, PlanSetModeSchema, PlanSetResponseSchema, PlanSetWarningSchema, PortalSessionCreateInputSchema, PortalSessionSchema, PriceChangeNoticeEmailSchema, PriceChangeNoticeMeteredRateSchema, PriceDefSchema, PriceSchema, ProductSettingsPatchSchema, ProductSettingsSchema, ProviderPayloadSchema, ResyncResultSchema, ReturnOriginSchema, SETTINGS_LOCALES, STEWARD_CAPABILITIES, SettingsLocaleSchema, StatsSchema, StewardApiError, StewardConfigError, StewardContractError, StewardError, StewardNetworkError, SubscriptionChangeInputSchema, SubscriptionSchema, SubscriptionStatusSchema, SubscriptionSummarySchema, TtlMinutesSchema, UNIT_DECIMALS, UncancelSubscriptionResponseSchema, WEBHOOK_ENDPOINT_STATUSES, WEBHOOK_SECRET_PREFIX, WebUrlSchema, WebhookEndpointCreateInputSchema, WebhookEndpointListSchema, WebhookEndpointRotateInputSchema, WebhookEndpointSchema, WebhookEndpointStatusSchema, WebhookLastDeliverySchema, WebhookSecretSchema, addUtcMonths, applyEmailSettingsPatch, applySettingsPatch, billingPageUrl, billingSettingsOf, buildDoctorReport, canonicalMeterFilter, checkoutRedirectUrl, consumptionOf, contributionOf, count, createSteward, defineCatalog, emailLocaleOf, emailReadinessOf, emailRecipients, emailTemplateOf, emailTemplateSettings, endpointDiagnosisOf, errorCodeSpec, eventsSettingsOf, featureFlag, featureValueMatchesType, flag, fromMicroUnits, generateWebhookSecret, hasControlCharacters, hostedReadinessOf, httpStatusFor, isE164, isEmailRelevant, isEventTimestampInRange, isEventType, isFeatureFlagBenefit, isGrantActive, isKnownErrorCode, isLiveSubscriptionStatus, isMeterCreditBenefit, isMicroPrecise, isReturnUrlAllowed, isValidTckn, isValidVkn, limit, liveSubscriptionOf, manualInvoiceTotals, matchesFilter, max, meter, meterChargeTotals, meterCredit, meterCreditsOf, meterFilterClauseOf, meteringSettingsOf, microToDecimalString, overageCapReached, overageOf, parseMicroUnits, periodBoundsOf, plainDecimalOf, rateOverage, resolveBenefits, resolveEntitlements, returnOriginsOf, rolloverOf, splitInclusiveTax, standingOf, stateCache, sum, text, toMicroUnits, unique, uniqueEmails, webhookEndpointUrlProblem };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ba as
|
|
1
|
+
import { Ba as CheckoutPrefill, Da as PortalSession, Fc as Interval, Ga as CheckoutSessionCreateInput, Ja as CheckoutSessionCreated, No as AccountBenefit, Oa as PortalSessionCreateInput, Za as CheckoutStatus, io as PaymentMethod, vi as CheckoutSessionResponse } from "./_chunks/index.js";
|
|
2
2
|
import { O as AccountInclude, U as AccountState, Y as BillingProfile, a as BillingEvent, f as EventType, n as AnyBillingEvent, o as BillingEventOf, u as EventDetail } from "./_chunks/events.js";
|
|
3
3
|
import { r as StewardLogger, s as MutationOptions, t as StewardLocale } from "./_chunks/locale.js";
|
|
4
4
|
import { a as HeaderSource, s as VerifyRawFailure } from "./_chunks/webhook-core.js";
|
|
@@ -55,6 +55,12 @@ type CheckoutCreateInput = {
|
|
|
55
55
|
displayName?: string;
|
|
56
56
|
/** Sayfanın ön doldurması (ad, e-posta, tür); kimlik verisi değil (K21). */
|
|
57
57
|
prefill?: CheckoutPrefill;
|
|
58
|
+
/**
|
|
59
|
+
* Upgrade: the account's live subscription this purchase replaces. Do NOT cancel it before the
|
|
60
|
+
* checkout: it keeps running until the payment is recorded (card or bank transfer) and is
|
|
61
|
+
* canceled in that same transaction; an abandoned checkout leaves it untouched.
|
|
62
|
+
*/
|
|
63
|
+
replacesSubscriptionId?: string;
|
|
58
64
|
};
|
|
59
65
|
type CheckoutCreated = {
|
|
60
66
|
id: string;
|
|
@@ -64,6 +70,12 @@ type CheckoutCreated = {
|
|
|
64
70
|
type CheckoutResult = {
|
|
65
71
|
status: CheckoutStatus;
|
|
66
72
|
planCode?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Chosen on the page: `bank_transfer` with `status: "open"` means the order waits for the
|
|
75
|
+
* customer's transfer (show "payment pending" and `account.bankTransferCode` from the state).
|
|
76
|
+
* Absent before a choice and from older steward.
|
|
77
|
+
*/
|
|
78
|
+
paymentMethod?: PaymentMethod;
|
|
67
79
|
/** Yalnızca `completed`: işlem sonrası hesap durumu (önbelleğe yazıldı). */
|
|
68
80
|
account?: AccountState;
|
|
69
81
|
};
|
|
@@ -105,12 +117,12 @@ export declare function CustomerPortal(options: CustomerPortalOptions): Customer
|
|
|
105
117
|
//#endregion
|
|
106
118
|
//#region src/server/webhooks.d.ts
|
|
107
119
|
/** Neden hook'u olan tipler: `account.state_changed` dışındaki her tip (neden olarak da gelirler). */
|
|
108
|
-
type CauseEventType = Exclude<EventType,
|
|
120
|
+
type CauseEventType = Exclude<EventType, 'account.state_changed'>;
|
|
109
121
|
type Pascal<S extends string> = S extends `${infer Head}_${infer Tail}` ? `${Capitalize<Head>}${Pascal<Tail>}` : Capitalize<S>;
|
|
110
122
|
/** `subscription.payment_failed` → `onSubscriptionPaymentFailed`. */
|
|
111
123
|
type EventHookName<T extends string> = T extends `${infer Scope}.${infer Name}` ? `on${Pascal<Scope>}${Pascal<Name>}` : `on${Pascal<T>}`;
|
|
112
|
-
type WebhookHandled =
|
|
113
|
-
type WebhookErrorCode =
|
|
124
|
+
type WebhookHandled = 'received' | 'no_state' | 'ignored' | 'deleted' | 'ping';
|
|
125
|
+
type WebhookErrorCode = 'not_configured' | VerifyRawFailure | 'invalid_payload' | 'id_mismatch' | 'state_unavailable' | 'profile_unavailable' | 'hook_failed';
|
|
114
126
|
type WebhookResult = {
|
|
115
127
|
status: 200;
|
|
116
128
|
body: {
|
|
@@ -139,7 +151,7 @@ type CauseHookArgs<T extends CauseEventType, S extends HookState = HookState> =
|
|
|
139
151
|
ref: string;
|
|
140
152
|
cause: T;
|
|
141
153
|
/** Filtresiz (eski) endpoint'te o tipin event'i, yeni endpoint'te `account.state_changed`. */
|
|
142
|
-
event: BillingEventOf<T> | BillingEventOf<
|
|
154
|
+
event: BillingEventOf<T> | BillingEventOf<'account.state_changed'>;
|
|
143
155
|
/** Teslimatın tam durumu (refetch'te canlı); yalnızca `refetch: false` + snapshot taşıyan eski gövdede `null`. */
|
|
144
156
|
state: S;
|
|
145
157
|
};
|
|
@@ -148,7 +160,7 @@ type NotificationHookArgs<T extends CauseEventType, S extends HookState = HookSt
|
|
|
148
160
|
profile?: BillingProfile | null;
|
|
149
161
|
};
|
|
150
162
|
/** Benefit grant types with a dedicated hook (`onBenefitGranted` / `onBenefitRevoked` / `onBenefitCycled`). */
|
|
151
|
-
type BenefitHookEventType =
|
|
163
|
+
type BenefitHookEventType = 'benefit_grant.created' | 'benefit_grant.revoked' | 'benefit_grant.cycled';
|
|
152
164
|
type BenefitHookArgs<T extends BenefitHookEventType, S extends HookState = HookState> = {
|
|
153
165
|
ref: string;
|
|
154
166
|
cause: T;
|
|
@@ -162,19 +174,19 @@ type BenefitHookArgs<T extends BenefitHookEventType, S extends HookState = HookS
|
|
|
162
174
|
state: S;
|
|
163
175
|
};
|
|
164
176
|
/** `onBenefitCycled` (`benefit_grant.cycled`): the renewed `meter_credit` grant and its new meter period. */
|
|
165
|
-
type BenefitCycledHookArgs<S extends HookState = HookState> = BenefitHookArgs<
|
|
177
|
+
type BenefitCycledHookArgs<S extends HookState = HookState> = BenefitHookArgs<'benefit_grant.cycled', S> & {
|
|
166
178
|
periodStart: string;
|
|
167
179
|
periodEnd: string;
|
|
168
180
|
};
|
|
169
181
|
/** `onMeterThreshold` (`meter.threshold_crossed`, cause hook). */
|
|
170
|
-
type MeterThresholdHookArgs<S extends HookState = HookState> = CauseHookArgs<
|
|
182
|
+
type MeterThresholdHookArgs<S extends HookState = HookState> = CauseHookArgs<'meter.threshold_crossed', S> & {
|
|
171
183
|
/** The event's detail when the event itself was delivered; `null` for an `account.state_changed` caused by it. */
|
|
172
|
-
threshold: EventDetail<
|
|
184
|
+
threshold: EventDetail<'meter.threshold_crossed'> | null;
|
|
173
185
|
};
|
|
174
186
|
/** `onMeterPeriodClosed` (`meter.period_closed`, cause hook). */
|
|
175
|
-
type MeterPeriodClosedHookArgs<S extends HookState = HookState> = CauseHookArgs<
|
|
187
|
+
type MeterPeriodClosedHookArgs<S extends HookState = HookState> = CauseHookArgs<'meter.period_closed', S> & {
|
|
176
188
|
/** The event's detail when the event itself was delivered; `null` for an `account.state_changed` caused by it. */
|
|
177
|
-
period: EventDetail<
|
|
189
|
+
period: EventDetail<'meter.period_closed'> | null;
|
|
178
190
|
};
|
|
179
191
|
type UnknownEventArgs<S extends HookState = HookState> = {
|
|
180
192
|
ref: string;
|
|
@@ -189,7 +201,7 @@ type AfterArgs<S extends HookState = HookState> = {
|
|
|
189
201
|
event: BillingEvent | AnyBillingEvent;
|
|
190
202
|
state: S;
|
|
191
203
|
/** Refetch açıkken `received` ya da (hesap silme teslimatı, F4e) `deleted`; `no_state` yalnızca `state: null` ile. */
|
|
192
|
-
handled: null extends S ? Exclude<WebhookHandled,
|
|
204
|
+
handled: null extends S ? Exclude<WebhookHandled, 'ping' | 'ignored'> : 'received' | 'deleted';
|
|
193
205
|
};
|
|
194
206
|
/** Dönüş değeri beklenir (`await`) ama kullanılmaz: sorgu/kuyruk promise'ı doğrudan dönebilir. */
|
|
195
207
|
type Hook<A> = (args: A) => unknown;
|
|
@@ -215,7 +227,7 @@ type WebhooksCache = {
|
|
|
215
227
|
invalidate?(ref: string): unknown;
|
|
216
228
|
};
|
|
217
229
|
type CauseHooks<S extends HookState> = { [T in CauseEventType as EventHookName<T>]?: Hook<CauseHookArgs<T, S>>; };
|
|
218
|
-
type WebhooksOptions<S extends HookState = HookState> = Omit<CauseHooks<S>,
|
|
230
|
+
type WebhooksOptions<S extends HookState = HookState> = Omit<CauseHooks<S>, 'onMeterPeriodClosed'> & {
|
|
219
231
|
/** `meter.period_closed` (cause hook); `period` is the event's detail when the event itself was delivered. */
|
|
220
232
|
onMeterPeriodClosed?: Hook<MeterPeriodClosedHookArgs<S>>;
|
|
221
233
|
/** A meter's standing changed (`meter.threshold_crossed`, cause hook); after `onMeterThresholdCrossed`. */
|
|
@@ -238,13 +250,13 @@ type WebhooksOptions<S extends HookState = HookState> = Omit<CauseHooks<S>, "onM
|
|
|
238
250
|
includeProfile?: boolean;
|
|
239
251
|
/** Tam durumlu her teslimatta (tekrar dahil). `"ignore"` dönerse hesap bilinmiyor: 200, diğer hook'lar ve `after` koşmaz. */
|
|
240
252
|
onStateChanged?: Hook<StateChangedArgs>;
|
|
241
|
-
onPaymentFailed?: Hook<NotificationHookArgs<
|
|
242
|
-
onSuspended?: Hook<NotificationHookArgs<
|
|
243
|
-
onTerminated?: Hook<NotificationHookArgs<
|
|
253
|
+
onPaymentFailed?: Hook<NotificationHookArgs<'subscription.payment_failed', S>>;
|
|
254
|
+
onSuspended?: Hook<NotificationHookArgs<'subscription.suspended', S>>;
|
|
255
|
+
onTerminated?: Hook<NotificationHookArgs<'subscription.terminated', S>>;
|
|
244
256
|
/** A benefit was granted (`benefit_grant.created`; the endpoint must list the type). After `onBenefitGrantCreated`. */
|
|
245
|
-
onBenefitGranted?: Hook<BenefitHookArgs<
|
|
257
|
+
onBenefitGranted?: Hook<BenefitHookArgs<'benefit_grant.created', S>>;
|
|
246
258
|
/** A benefit was revoked (`benefit_grant.revoked`; the endpoint must list the type). After `onBenefitGrantRevoked`. */
|
|
247
|
-
onBenefitRevoked?: Hook<BenefitHookArgs<
|
|
259
|
+
onBenefitRevoked?: Hook<BenefitHookArgs<'benefit_grant.revoked', S>>;
|
|
248
260
|
onUnknownEvent?: Hook<UnknownEventArgs<S>>;
|
|
249
261
|
/** Diğer hook'lardan sonra, her teslimatta (tekrar dahil; `"ignore"` hariç); ör. ağlara yayılma. */
|
|
250
262
|
after?: Hook<AfterArgs<S>>;
|
|
@@ -254,7 +266,7 @@ type WebhooksOptions<S extends HookState = HookState> = Omit<CauseHooks<S>, "onM
|
|
|
254
266
|
* `refetch` ve `steward` alanlarının tiplerinden hook durumu: `refetch: true` ya da (`refetch`
|
|
255
267
|
* verilmemiş ve `steward` verilmiş) → `AccountState`; aksi (ya da tip belirsizse) `AccountState | null`.
|
|
256
268
|
*/
|
|
257
|
-
type WebhooksHookState<R, St> = [R] extends [true] ? AccountState : [R] extends [undefined] ?
|
|
269
|
+
type WebhooksHookState<R, St> = [R] extends [true] ? AccountState : [R] extends [undefined] ? [undefined] extends [St] ? HookState : AccountState : HookState;
|
|
258
270
|
/** `Request`'in kullanılan kısmı (Hono `c.req.raw`, Next `req`, undici `Request`). */
|
|
259
271
|
type WebhookRequest = {
|
|
260
272
|
readonly headers: Headers;
|
|
@@ -266,7 +278,7 @@ type WebhooksHandler = {
|
|
|
266
278
|
/** Düz fonksiyon: ham gövde + başlıklar → `{status, body}` (ürün kendi yanıtını kurar). */
|
|
267
279
|
receive(rawBody: string, headers: HeaderSource): Promise<WebhookResult>;
|
|
268
280
|
};
|
|
269
|
-
export declare function Webhooks<const R extends boolean | undefined = undefined, St extends WebhooksSteward | undefined = undefined>(options: Omit<WebhooksOptions<WebhooksHookState<R, St>>,
|
|
281
|
+
export declare function Webhooks<const R extends boolean | undefined = undefined, St extends WebhooksSteward | undefined = undefined>(options: Omit<WebhooksOptions<WebhooksHookState<R, St>>, 'refetch' | 'steward'> & {
|
|
270
282
|
refetch?: R;
|
|
271
283
|
steward?: St;
|
|
272
284
|
}): WebhooksHandler;
|
package/dist/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Kn as IdSchema, Nn as ActorRefSchema, Un as ExternalRefSchema, a as EVENT_TYPES, l as PING_EVENT_TYPE, r as BillingEventSchema, t as AnyBillingEventSchema, u as PingSchema, w as AccountStateSchema } 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";
|
|
@@ -59,7 +59,8 @@ function Checkout(options) {
|
|
|
59
59
|
url
|
|
60
60
|
})) } : {},
|
|
61
61
|
...input.displayName !== void 0 ? { displayName: input.displayName } : {},
|
|
62
|
-
...input.prefill !== void 0 ? { prefill: input.prefill } : {}
|
|
62
|
+
...input.prefill !== void 0 ? { prefill: input.prefill } : {},
|
|
63
|
+
...input.replacesSubscriptionId !== void 0 ? { replacesSubscriptionId: input.replacesSubscriptionId } : {}
|
|
63
64
|
};
|
|
64
65
|
const session = await steward.checkoutSessions.create(input.ref, body, { actorRef: input.actorRef });
|
|
65
66
|
if (typeof session.url !== "string" || session.url === "") throw new StewardContractError({ message: "Checkout: steward hosted checkout adresi (url) döndürmedi; steward sürümü F2b öncesi mi?" });
|
|
@@ -73,17 +74,20 @@ function Checkout(options) {
|
|
|
73
74
|
if (!IdSchema.safeParse(id).success) throw notFound();
|
|
74
75
|
const session = await steward.checkoutSessions.get(id);
|
|
75
76
|
if (session.accountRef !== ref) throw notFound();
|
|
77
|
+
const method = session.paymentMethod ? { paymentMethod: session.paymentMethod } : {};
|
|
76
78
|
if (session.status === "completed" && session.account) {
|
|
77
79
|
await cache?.prime(session.account);
|
|
78
80
|
return {
|
|
79
81
|
status: session.status,
|
|
80
82
|
planCode: session.planCode,
|
|
83
|
+
...method,
|
|
81
84
|
account: session.account
|
|
82
85
|
};
|
|
83
86
|
}
|
|
84
87
|
return {
|
|
85
88
|
status: session.status,
|
|
86
|
-
planCode: session.planCode
|
|
89
|
+
planCode: session.planCode,
|
|
90
|
+
...method
|
|
87
91
|
};
|
|
88
92
|
}
|
|
89
93
|
};
|