@zonastery/bursar 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/billing/auto-recharge-port.d.ts +3 -2
- package/dist/billing/auto-recharge-port.d.ts.map +1 -1
- package/dist/billing/auto-recharge-port.js.map +1 -1
- package/dist/billing/auto-recharge-service.d.ts.map +1 -1
- package/dist/billing/auto-recharge-service.js +3 -3
- package/dist/billing/auto-recharge-service.js.map +1 -1
- package/dist/billing/billing-service.d.ts +3 -2
- package/dist/billing/billing-service.d.ts.map +1 -1
- package/dist/billing/billing-service.js +2 -10
- package/dist/billing/billing-service.js.map +1 -1
- package/dist/billing/billing-store.d.ts +6 -6
- package/dist/billing/billing-store.d.ts.map +1 -1
- package/dist/billing/billing-store.js.map +1 -1
- package/dist/billing/contracts.d.ts +8 -7
- package/dist/billing/contracts.d.ts.map +1 -1
- package/dist/billing/contracts.js.map +1 -1
- package/dist/billing/event-handlers.d.ts +5 -9
- package/dist/billing/event-handlers.d.ts.map +1 -1
- package/dist/billing/event-handlers.js +191 -285
- package/dist/billing/event-handlers.js.map +1 -1
- package/dist/billing/event-processor.d.ts +1 -1
- package/dist/billing/event-processor.d.ts.map +1 -1
- package/dist/billing/event-processor.js +32 -23
- package/dist/billing/event-processor.js.map +1 -1
- package/dist/billing/financial-event-handlers.d.ts +3 -9
- package/dist/billing/financial-event-handlers.d.ts.map +1 -1
- package/dist/billing/financial-event-handlers.js +10 -12
- package/dist/billing/financial-event-handlers.js.map +1 -1
- package/dist/billing/index.d.ts +1 -1
- package/dist/billing/index.d.ts.map +1 -1
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/management.d.ts +3 -2
- package/dist/billing/management.d.ts.map +1 -1
- package/dist/billing/management.js.map +1 -1
- package/dist/billing/policy-window.js.map +1 -1
- package/dist/billing/postgres/repositories/auto-recharge.d.ts +2 -1
- package/dist/billing/postgres/repositories/auto-recharge.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/auto-recharge.js +58 -40
- package/dist/billing/postgres/repositories/auto-recharge.js.map +1 -1
- package/dist/billing/postgres/repositories/customer.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/customer.js.map +1 -1
- package/dist/billing/postgres/repositories/dispute.d.ts +2 -1
- package/dist/billing/postgres/repositories/dispute.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/dispute.js.map +1 -1
- package/dist/billing/postgres/repositories/event.d.ts +2 -2
- package/dist/billing/postgres/repositories/event.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/event.js.map +1 -1
- package/dist/billing/postgres/repositories/invoice.d.ts +2 -1
- package/dist/billing/postgres/repositories/invoice.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/invoice.js +8 -12
- package/dist/billing/postgres/repositories/invoice.js.map +1 -1
- package/dist/billing/postgres/repositories/offer.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/offer.js +5 -0
- package/dist/billing/postgres/repositories/offer.js.map +1 -1
- package/dist/billing/postgres/repositories/payment.d.ts +4 -4
- package/dist/billing/postgres/repositories/payment.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/payment.js +1 -1
- package/dist/billing/postgres/repositories/payment.js.map +1 -1
- package/dist/billing/postgres/repositories/preferences.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/preferences.js.map +1 -1
- package/dist/billing/postgres/repositories/refund.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/refund.js.map +1 -1
- package/dist/billing/postgres/repositories/subscription-change.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/subscription-change.js +1 -9
- package/dist/billing/postgres/repositories/subscription-change.js.map +1 -1
- package/dist/billing/postgres/repositories/subscription.d.ts +11 -11
- package/dist/billing/postgres/repositories/subscription.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/subscription.js +29 -30
- package/dist/billing/postgres/repositories/subscription.js.map +1 -1
- package/dist/billing/postgres/repositories/topup.d.ts +1 -1
- package/dist/billing/postgres/repositories/topup.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/topup.js.map +1 -1
- package/dist/billing/postgres/store.d.ts +6 -5
- package/dist/billing/postgres/store.d.ts.map +1 -1
- package/dist/billing/postgres/store.js +15 -13
- package/dist/billing/postgres/store.js.map +1 -1
- package/dist/billing/types/auto-recharge.d.ts +2 -1
- package/dist/billing/types/auto-recharge.d.ts.map +1 -1
- package/dist/billing/types/auto-recharge.js.map +1 -1
- package/dist/billing/types/documents.d.ts +2 -1
- package/dist/billing/types/documents.d.ts.map +1 -1
- package/dist/billing/types/documents.js.map +1 -1
- package/dist/billing/types/events.d.ts +3 -2
- package/dist/billing/types/events.d.ts.map +1 -1
- package/dist/billing/types/events.js +73 -39
- package/dist/billing/types/events.js.map +1 -1
- package/dist/billing/types/subscriptions.d.ts +4 -1
- package/dist/billing/types/subscriptions.d.ts.map +1 -1
- package/dist/billing/types/subscriptions.js.map +1 -1
- package/dist/breakdown.d.ts +3 -2
- package/dist/breakdown.d.ts.map +1 -1
- package/dist/breakdown.js.map +1 -1
- package/dist/bursar.d.ts.map +1 -1
- package/dist/bursar.js +4 -3
- package/dist/bursar.js.map +1 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +45 -42
- package/dist/catalog.js.map +1 -1
- package/dist/commerce/errors.d.ts.map +1 -1
- package/dist/commerce/errors.js.map +1 -1
- package/dist/commerce/provider-registry.d.ts.map +1 -1
- package/dist/commerce/provider-registry.js +11 -6
- package/dist/commerce/provider-registry.js.map +1 -1
- package/dist/commerce/service.d.ts +1 -1
- package/dist/commerce/service.d.ts.map +1 -1
- package/dist/commerce/service.js +16 -22
- package/dist/commerce/service.js.map +1 -1
- package/dist/commerce/types.d.ts.map +1 -1
- package/dist/commerce/types.js.map +1 -1
- package/dist/config/parse-access.d.ts +5 -2
- package/dist/config/parse-access.d.ts.map +1 -1
- package/dist/config/parse-access.js +60 -41
- package/dist/config/parse-access.js.map +1 -1
- package/dist/config/parse-commerce.d.ts +2 -1
- package/dist/config/parse-commerce.d.ts.map +1 -1
- package/dist/config/parse-commerce.js +49 -29
- package/dist/config/parse-commerce.js.map +1 -1
- package/dist/config/parse-credits.d.ts +2 -1
- package/dist/config/parse-credits.d.ts.map +1 -1
- package/dist/config/parse-credits.js +39 -23
- package/dist/config/parse-credits.js.map +1 -1
- package/dist/config/parse-plans.d.ts +7 -2
- package/dist/config/parse-plans.d.ts.map +1 -1
- package/dist/config/parse-plans.js +49 -22
- package/dist/config/parse-plans.js.map +1 -1
- package/dist/config/parse-pricing.d.ts +2 -1
- package/dist/config/parse-pricing.d.ts.map +1 -1
- package/dist/config/parse-pricing.js +41 -31
- package/dist/config/parse-pricing.js.map +1 -1
- package/dist/config/parse-utils.d.ts +15 -11
- package/dist/config/parse-utils.d.ts.map +1 -1
- package/dist/config/parse-utils.js +90 -27
- package/dist/config/parse-utils.js.map +1 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/config.d.ts +6 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +65 -35
- package/dist/config.js.map +1 -1
- package/dist/credits/amount.d.ts +1 -1
- package/dist/credits/amount.d.ts.map +1 -1
- package/dist/credits/amount.js +5 -4
- package/dist/credits/amount.js.map +1 -1
- package/dist/credits/catalog-runtime.d.ts.map +1 -1
- package/dist/credits/catalog-runtime.js +2 -3
- package/dist/credits/catalog-runtime.js.map +1 -1
- package/dist/credits/events.d.ts +12 -1
- package/dist/credits/events.d.ts.map +1 -1
- package/dist/credits/events.js +35 -21
- package/dist/credits/events.js.map +1 -1
- package/dist/credits/lease-workflow.d.ts +2 -1
- package/dist/credits/lease-workflow.d.ts.map +1 -1
- package/dist/credits/lease-workflow.js +3 -2
- package/dist/credits/lease-workflow.js.map +1 -1
- package/dist/credits/low-balance-monitor.d.ts +2 -1
- package/dist/credits/low-balance-monitor.d.ts.map +1 -1
- package/dist/credits/low-balance-monitor.js.map +1 -1
- package/dist/credits/postgres/repositories/analytics.d.ts +2 -2
- package/dist/credits/postgres/repositories/analytics.d.ts.map +1 -1
- package/dist/credits/postgres/repositories/analytics.js +14 -6
- package/dist/credits/postgres/repositories/analytics.js.map +1 -1
- package/dist/credits/postgres/repositories/balance.d.ts.map +1 -1
- package/dist/credits/postgres/repositories/balance.js +6 -6
- package/dist/credits/postgres/repositories/balance.js.map +1 -1
- package/dist/credits/postgres/repositories/bucket.d.ts.map +1 -1
- package/dist/credits/postgres/repositories/bucket.js.map +1 -1
- package/dist/credits/postgres/repositories/catalog.d.ts +5 -4
- package/dist/credits/postgres/repositories/catalog.d.ts.map +1 -1
- package/dist/credits/postgres/repositories/catalog.js +4 -3
- package/dist/credits/postgres/repositories/catalog.js.map +1 -1
- package/dist/credits/postgres/repositories/deduction.d.ts.map +1 -1
- package/dist/credits/postgres/repositories/deduction.js +2 -2
- package/dist/credits/postgres/repositories/deduction.js.map +1 -1
- package/dist/credits/postgres/repositories/lease.d.ts +2 -2
- package/dist/credits/postgres/repositories/lease.d.ts.map +1 -1
- package/dist/credits/postgres/repositories/lease.js.map +1 -1
- package/dist/credits/postgres/repositories/plan.d.ts +11 -11
- package/dist/credits/postgres/repositories/plan.d.ts.map +1 -1
- package/dist/credits/postgres/repositories/plan.js.map +1 -1
- package/dist/credits/postgres/repositories/team.d.ts +2 -2
- package/dist/credits/postgres/repositories/team.d.ts.map +1 -1
- package/dist/credits/postgres/repositories/team.js.map +1 -1
- package/dist/credits/postgres/store.d.ts +3 -2
- package/dist/credits/postgres/store.d.ts.map +1 -1
- package/dist/credits/postgres/store.js +17 -10
- package/dist/credits/postgres/store.js.map +1 -1
- package/dist/credits/postgres/value-mappers.d.ts +4 -3
- package/dist/credits/postgres/value-mappers.d.ts.map +1 -1
- package/dist/credits/postgres/value-mappers.js +10 -11
- package/dist/credits/postgres/value-mappers.js.map +1 -1
- package/dist/credits/queries.d.ts.map +1 -1
- package/dist/credits/queries.js.map +1 -1
- package/dist/credits/service.d.ts.map +1 -1
- package/dist/credits/service.js +10 -5
- package/dist/credits/service.js.map +1 -1
- package/dist/credits/store.d.ts +5 -4
- package/dist/credits/store.d.ts.map +1 -1
- package/dist/credits/store.js.map +1 -1
- package/dist/credits/types/account.d.ts +5 -4
- package/dist/credits/types/account.d.ts.map +1 -1
- package/dist/credits/types/account.js.map +1 -1
- package/dist/credits/types/catalog.d.ts +2 -1
- package/dist/credits/types/catalog.d.ts.map +1 -1
- package/dist/credits/types/catalog.js.map +1 -1
- package/dist/credits/types/grants.d.ts.map +1 -1
- package/dist/credits/types/grants.js.map +1 -1
- package/dist/credits/types/ledger.d.ts +3 -2
- package/dist/credits/types/ledger.d.ts.map +1 -1
- package/dist/credits/types/ledger.js.map +1 -1
- package/dist/engine.d.ts +2 -2
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +39 -10
- package/dist/engine.js.map +1 -1
- package/dist/errors.d.ts +7 -4
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +18 -11
- package/dist/errors.js.map +1 -1
- package/dist/expr/ast.d.ts.map +1 -1
- package/dist/expr/ast.js.map +1 -1
- package/dist/expr/evaluator.js.map +1 -1
- package/dist/expr/parser.d.ts.map +1 -1
- package/dist/expr/parser.js.map +1 -1
- package/dist/expr/tokenizer.d.ts.map +1 -1
- package/dist/expr/tokenizer.js +34 -12
- package/dist/expr/tokenizer.js.map +1 -1
- package/dist/expr.d.ts.map +1 -1
- package/dist/expr.js +12 -6
- package/dist/expr.js.map +1 -1
- package/dist/generated/pricing-config.schema.json +0 -12
- package/dist/generated/pricing-config.types.d.ts +2 -8
- package/dist/generated/pricing-config.types.d.ts.map +1 -1
- package/dist/generated/pricing-config.types.js.map +1 -1
- package/dist/integrations/better-auth.d.ts +4 -1
- package/dist/integrations/better-auth.d.ts.map +1 -1
- package/dist/integrations/better-auth.js +7 -4
- package/dist/integrations/better-auth.js.map +1 -1
- package/dist/load-config-file.d.ts +2 -1
- package/dist/load-config-file.d.ts.map +1 -1
- package/dist/load-config-file.js +19 -13
- package/dist/load-config-file.js.map +1 -1
- package/dist/metrics.d.ts +2 -1
- package/dist/metrics.d.ts.map +1 -1
- package/dist/metrics.js.map +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js.map +1 -1
- package/dist/providers/_shared.d.ts +8 -5
- package/dist/providers/_shared.d.ts.map +1 -1
- package/dist/providers/_shared.js +15 -11
- package/dist/providers/_shared.js.map +1 -1
- package/dist/providers/dodo/better-auth-core.d.ts +30 -0
- package/dist/providers/dodo/better-auth-core.d.ts.map +1 -0
- package/dist/providers/dodo/better-auth-core.js +14 -0
- package/dist/providers/dodo/better-auth-core.js.map +1 -0
- package/dist/providers/dodo/better-auth.d.ts +5 -9
- package/dist/providers/dodo/better-auth.d.ts.map +1 -1
- package/dist/providers/dodo/better-auth.js +16 -13
- package/dist/providers/dodo/better-auth.js.map +1 -1
- package/dist/providers/dodo/client-contract.d.ts +12 -10
- package/dist/providers/dodo/client-contract.d.ts.map +1 -1
- package/dist/providers/dodo/client-contract.js.map +1 -1
- package/dist/providers/dodo/event-mapper.d.ts +7 -4
- package/dist/providers/dodo/event-mapper.d.ts.map +1 -1
- package/dist/providers/dodo/event-mapper.js +121 -113
- package/dist/providers/dodo/event-mapper.js.map +1 -1
- package/dist/providers/dodo/nextjs-core.d.ts +22 -0
- package/dist/providers/dodo/nextjs-core.d.ts.map +1 -0
- package/dist/providers/dodo/nextjs-core.js +14 -0
- package/dist/providers/dodo/nextjs-core.js.map +1 -0
- package/dist/providers/dodo/nextjs.d.ts +5 -7
- package/dist/providers/dodo/nextjs.d.ts.map +1 -1
- package/dist/providers/dodo/nextjs.js +11 -10
- package/dist/providers/dodo/nextjs.js.map +1 -1
- package/dist/providers/dodo/provider.d.ts +3 -3
- package/dist/providers/dodo/provider.d.ts.map +1 -1
- package/dist/providers/dodo/provider.js +42 -35
- package/dist/providers/dodo/provider.js.map +1 -1
- package/dist/providers/dodo/react-native-core.d.ts +56 -0
- package/dist/providers/dodo/react-native-core.d.ts.map +1 -0
- package/dist/providers/dodo/react-native-core.js +56 -0
- package/dist/providers/dodo/react-native-core.js.map +1 -0
- package/dist/providers/dodo/react-native.d.ts +6 -50
- package/dist/providers/dodo/react-native.d.ts.map +1 -1
- package/dist/providers/dodo/react-native.js +5 -49
- package/dist/providers/dodo/react-native.js.map +1 -1
- package/dist/providers/dodo/webhook-bridge.d.ts +4 -2
- package/dist/providers/dodo/webhook-bridge.d.ts.map +1 -1
- package/dist/providers/dodo/webhook-bridge.js.map +1 -1
- package/dist/providers/environment.d.ts +1 -1
- package/dist/providers/environment.d.ts.map +1 -1
- package/dist/providers/environment.js +4 -2
- package/dist/providers/environment.js.map +1 -1
- package/dist/providers/mock/provider.d.ts.map +1 -1
- package/dist/providers/mock/provider.js +5 -10
- package/dist/providers/mock/provider.js.map +1 -1
- package/dist/providers/stripe/event-mapper.d.ts.map +1 -1
- package/dist/providers/stripe/event-mapper.js +33 -9
- package/dist/providers/stripe/event-mapper.js.map +1 -1
- package/dist/providers/stripe/provider.d.ts.map +1 -1
- package/dist/providers/stripe/provider.js +101 -61
- package/dist/providers/stripe/provider.js.map +1 -1
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/providers/types.js.map +1 -1
- package/dist/retry.d.ts.map +1 -1
- package/dist/retry.js +16 -9
- package/dist/retry.js.map +1 -1
- package/dist/shared/diagnostics.d.ts +5 -5
- package/dist/shared/diagnostics.d.ts.map +1 -1
- package/dist/shared/diagnostics.js +32 -22
- package/dist/shared/diagnostics.js.map +1 -1
- package/dist/shared/idempotency.d.ts +4 -3
- package/dist/shared/idempotency.d.ts.map +1 -1
- package/dist/shared/idempotency.js +21 -10
- package/dist/shared/idempotency.js.map +1 -1
- package/dist/shared/json.d.ts +28 -0
- package/dist/shared/json.d.ts.map +1 -0
- package/dist/shared/json.js +41 -0
- package/dist/shared/json.js.map +1 -0
- package/dist/shared/logger.d.ts +10 -4
- package/dist/shared/logger.d.ts.map +1 -1
- package/dist/shared/logger.js +28 -4
- package/dist/shared/logger.js.map +1 -1
- package/dist/shared/postgres-client.d.ts +8 -6
- package/dist/shared/postgres-client.d.ts.map +1 -1
- package/dist/shared/postgres-client.js +69 -47
- package/dist/shared/postgres-client.js.map +1 -1
- package/dist/shared/postgres-errors.d.ts +1 -1
- package/dist/shared/postgres-errors.d.ts.map +1 -1
- package/dist/shared/postgres-errors.js +32 -31
- package/dist/shared/postgres-errors.js.map +1 -1
- package/dist/shared/postgres-types.d.ts +3 -2
- package/dist/shared/postgres-types.d.ts.map +1 -1
- package/dist/shared/postgres-types.js.map +1 -1
- package/dist/shared/postgres-validation.d.ts +7 -6
- package/dist/shared/postgres-validation.d.ts.map +1 -1
- package/dist/shared/postgres-validation.js +17 -10
- package/dist/shared/postgres-validation.js.map +1 -1
- package/dist/storage/adapters/clickhouse.d.ts +11 -4
- package/dist/storage/adapters/clickhouse.d.ts.map +1 -1
- package/dist/storage/adapters/clickhouse.js +8 -6
- package/dist/storage/adapters/clickhouse.js.map +1 -1
- package/dist/storage/adapters/s3.d.ts +28 -5
- package/dist/storage/adapters/s3.d.ts.map +1 -1
- package/dist/storage/adapters/s3.js +48 -33
- package/dist/storage/adapters/s3.js.map +1 -1
- package/dist/storage/diagnostics.d.ts +1 -1
- package/dist/storage/diagnostics.d.ts.map +1 -1
- package/dist/storage/diagnostics.js +13 -12
- package/dist/storage/diagnostics.js.map +1 -1
- package/dist/storage/maintenance.d.ts.map +1 -1
- package/dist/storage/maintenance.js +31 -25
- package/dist/storage/maintenance.js.map +1 -1
- package/dist/storage/outbox-worker.d.ts +1 -1
- package/dist/storage/outbox-worker.d.ts.map +1 -1
- package/dist/storage/outbox-worker.js +18 -18
- package/dist/storage/outbox-worker.js.map +1 -1
- package/dist/storage/ports.d.ts +10 -7
- package/dist/storage/ports.d.ts.map +1 -1
- package/dist/storage/ports.js.map +1 -1
- package/dist/storage/postgres-repository.d.ts +3 -1
- package/dist/storage/postgres-repository.d.ts.map +1 -1
- package/dist/storage/postgres-repository.js +10 -4
- package/dist/storage/postgres-repository.js.map +1 -1
- package/dist/storage/runtime.d.ts +1 -1
- package/dist/storage/runtime.d.ts.map +1 -1
- package/dist/storage/runtime.js +165 -182
- package/dist/storage/runtime.js.map +1 -1
- package/dist/telemetry/index.d.ts +10 -6
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +26 -23
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/opentelemetry.d.ts.map +1 -1
- package/dist/telemetry/opentelemetry.js +3 -3
- package/dist/telemetry/opentelemetry.js.map +1 -1
- package/package.json +40 -40
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/billing/contracts.ts"],"names":[],"mappings":"","sourcesContent":["import type { AutoRechargeService } from \"./auto-recharge-service.js\";\nimport type { Decimal } from \"decimal.js\";\nimport type {\n BillingAutoRechargeAttempt,\n BillingAutoRechargeAttemptState,\n BillingAutoRechargeProfile,\n BillingCustomerRecord,\n BillingDisputeInfo,\n BillingEvent,\n BillingEventResult,\n BillingInvoiceInfo,\n BillingInvoiceRecord,\n BillingOfferResult,\n BillingPaymentInfo,\n BillingPreferences,\n BillingRefundInfo,\n BillingSubscriptionChange,\n BillingSubscriptionChangeInput,\n BillingSubscriptionState,\n BillingTopupResult,\n CheckoutIntent,\n} from \"./types/index.js\";\n\nexport interface CheckoutIntentCreate {\n subjectId: string;\n provider: string;\n operationKey: string;\n checkoutKind: \"subscription\" | \"credit_topup\";\n productKey: string;\n requestDigest: string;\n expiresAt: string;\n}\n\nexport interface CheckoutIntentUpdate {\n status?: \"open\" | \"completed\" | \"failed\" | \"expired\";\n providerSessionId?: string | null;\n checkoutUrl?: string | null;\n}\n\nexport interface BillingSubscriptionChangeUpdate {\n state?: BillingSubscriptionChange[\"state\"];\n providerOperationId?: string | null;\n errorMessage?: string | null;\n}\n\nexport interface BillingSubscriptionConflictCreate {\n userId?: string | null;\n provider: string;\n duplicateSubscriptionId: string;\n existingSubscriptionId?: string | null;\n eventId?: string | null;\n metadata?:
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/billing/contracts.ts"],"names":[],"mappings":"","sourcesContent":["import type { AutoRechargeService } from \"./auto-recharge-service.js\";\nimport type { Decimal } from \"decimal.js\";\nimport type { JsonObject } from \"../shared/json.js\";\nimport type {\n BillingAutoRechargeAttempt,\n BillingAutoRechargeAttemptState,\n BillingAutoRechargeProfile,\n BillingCustomerRecord,\n BillingDisputeInfo,\n BillingEvent,\n BillingEventResult,\n BillingInvoiceInfo,\n BillingInvoiceRecord,\n BillingOfferResult,\n BillingPaymentInfo,\n BillingPreferences,\n BillingRefundInfo,\n BillingSubscriptionChange,\n BillingSubscriptionChangeInput,\n BillingSubscriptionState,\n BillingTopupResult,\n CheckoutIntent,\n} from \"./types/index.js\";\n\nexport interface CheckoutIntentCreate {\n subjectId: string;\n provider: string;\n operationKey: string;\n checkoutKind: \"subscription\" | \"credit_topup\";\n productKey: string;\n requestDigest: string;\n expiresAt: string;\n}\n\nexport interface CheckoutIntentUpdate {\n status?: \"open\" | \"completed\" | \"failed\" | \"expired\";\n providerSessionId?: string | null;\n checkoutUrl?: string | null;\n}\n\nexport interface BillingSubscriptionChangeUpdate {\n state?: BillingSubscriptionChange[\"state\"];\n providerOperationId?: string | null;\n errorMessage?: string | null;\n}\n\nexport interface BillingSubscriptionConflictCreate {\n userId?: string | null;\n provider: string;\n duplicateSubscriptionId: string;\n existingSubscriptionId?: string | null;\n eventId?: string | null;\n metadata?: JsonObject;\n}\n\nexport interface BillingPaymentUpsert {\n provider: string;\n providerPaymentId: string;\n providerInvoiceId?: string | null;\n userId: string;\n amountMinor: number;\n taxMinor: number;\n currency: string;\n purpose: \"subscription\" | \"credit_topup\";\n status: \"pending\" | \"succeeded\" | \"failed\" | \"canceled\";\n providerUpdatedAt: string;\n metadata?: JsonObject | null;\n}\n\nexport interface BillingCreditGrantCreate {\n paymentId?: string | null;\n subscriptionId?: string | null;\n topupId?: string | null;\n configuredCredits: Decimal;\n quantity: number;\n billingEventId?: string | null;\n}\n\nexport interface BillingRefundUpsert {\n provider: string;\n providerRefundId: string;\n providerPaymentId: string;\n userId: string;\n amountMinor: number;\n currency: string;\n reason?: string | null;\n status: \"pending\" | \"succeeded\" | \"failed\" | \"canceled\";\n providerUpdatedAt: string;\n metadata?: JsonObject | null;\n}\n\nexport interface BillingInvoiceUpsert {\n provider: string;\n providerInvoiceId: string;\n providerSubscriptionId?: string | null;\n userId: string;\n status: \"draft\" | \"open\" | \"paid\" | \"void\" | \"uncollectible\";\n amountPaidMinor: number;\n amountDueMinor: number;\n currency: string;\n periodStart?: string | null;\n periodEnd?: string | null;\n metadata?: JsonObject | null;\n providerUpdatedAt: string;\n}\n\nexport interface BillingDisputeUpsert {\n provider: string;\n providerDisputeId: string;\n providerPaymentId: string;\n status: \"needs_response\" | \"under_review\" | \"won\" | \"lost\" | \"closed\";\n reason?: string | null;\n metadata?: JsonObject | null;\n providerUpdatedAt: string;\n}\n\nexport interface AutoRechargeAttemptClaim {\n userId: string;\n idempotencyKey: string;\n}\n\nexport interface AutoRechargeAttemptUpdate {\n id: string;\n state: BillingAutoRechargeAttemptState;\n providerAttemptId?: string | null;\n failureCode?: string | null;\n failureMessage?: string | null;\n metadata?: JsonObject;\n}\n\nexport interface AutoRechargeProviderPaymentUpdate {\n provider: string;\n providerPaymentId: string;\n state: BillingAutoRechargeAttemptState;\n failureCode?: string | null;\n failureMessage?: string | null;\n}\n\n/** Boundary used by payment providers to submit normalized lifecycle events. */\nexport interface BillingEventSink {\n ingestBillingEvent(event: BillingEvent): Promise<BillingEventResult>;\n}\n\n/** Application-facing billing capability exposed by Bursar. */\nexport interface BillingCapability extends BillingEventSink {\n readonly autoRecharge: AutoRechargeService;\n readonly hasProvisioning: boolean;\n createOrGetCheckoutIntent(input: CheckoutIntentCreate): Promise<CheckoutIntent>;\n updateCheckoutIntent(id: string, update: CheckoutIntentUpdate): Promise<void>;\n getCheckoutIntent(id: string, subjectId: string): Promise<CheckoutIntent | null>;\n getUserSubscription(userId: string): Promise<BillingSubscriptionState | null>;\n getActiveSubscription(userId: string): Promise<BillingSubscriptionState | null>;\n getBlockingSubscription(userId: string): Promise<BillingSubscriptionState | null>;\n getUserPreferences(userId: string): Promise<BillingPreferences | null>;\n getActiveCatalogDocument(): Promise<JsonObject | null>;\n listCancellableProviderSubscriptionIds(userId: string): Promise<string[]>;\n listCancellableSubscriptions(userId: string): Promise<BillingSubscriptionState[]>;\n listBillingInvoices(userId: string): Promise<BillingInvoiceRecord[]>;\n createBillingSubscriptionChange(\n input: BillingSubscriptionChangeInput,\n ): Promise<BillingSubscriptionChange>;\n getOpenBillingSubscriptionChange(\n provider: string,\n providerSubscriptionId: string,\n ): Promise<BillingSubscriptionChange | null>;\n updateBillingSubscriptionChange(\n id: string,\n update: BillingSubscriptionChangeUpdate,\n ): Promise<void>;\n recordSubscriptionConflict(input: BillingSubscriptionConflictCreate): Promise<void>;\n upsertBillingSubscription(state: BillingSubscriptionState): Promise<void>;\n updateUserPreferences(preferences: BillingPreferences): Promise<void>;\n getAutoRechargeProfile(userId: string): Promise<BillingAutoRechargeProfile | null>;\n upsertAutoRechargeProfile(\n profile: BillingAutoRechargeProfile,\n options?: { resetCooldown?: boolean },\n ): Promise<void>;\n claimAutoRechargeAttempt(\n input: AutoRechargeAttemptClaim,\n ): Promise<BillingAutoRechargeAttempt | null>;\n updateAutoRechargeAttempt(input: AutoRechargeAttemptUpdate): Promise<void>;\n updateAutoRechargeAttemptByProviderPayment(\n input: AutoRechargeProviderPaymentUpdate,\n ): Promise<void>;\n countAutoRechargeAttempts(userId: string, since: string | Date): Promise<number>;\n expirePastDueGracePeriods(now?: Date): Promise<number>;\n invalidateOfferCache(): void;\n getCustomerByUserId(\n userId: string,\n provider?: string | null,\n ): Promise<BillingCustomerRecord | null>;\n resolveOffer(\n provider: string,\n productId?: string | null,\n priceId?: string | null,\n ): Promise<BillingOfferResult | null>;\n resolveOfferByLookup(provider: string, lookupKey: string): Promise<BillingOfferResult | null>;\n resolveTopup(\n provider: string,\n productId?: string | null,\n priceId?: string | null,\n ): Promise<BillingTopupResult | null>;\n resolveTopupByLookup(provider: string, lookupKey: string): Promise<BillingTopupResult | null>;\n upsertCustomer(\n provider: string,\n providerCustomerId: string,\n userId: string,\n email?: string | null,\n ): Promise<void>;\n pseudonymizeFinancialSubject(userId: string): Promise<void>;\n}\n\n// Keep document-record types reachable from the contract module for store\n// implementers without forcing them to import the broad billing type barrel.\nexport type {\n BillingDisputeInfo,\n BillingInvoiceInfo,\n BillingInvoiceRecord,\n BillingPaymentInfo,\n BillingRefundInfo,\n};\n"]}
|
|
@@ -13,6 +13,7 @@ export declare class BillingEventHandlers {
|
|
|
13
13
|
private readonly financial;
|
|
14
14
|
private readonly handlerMap;
|
|
15
15
|
get hasProvisioning(): boolean;
|
|
16
|
+
get terminalPlan(): string | null;
|
|
16
17
|
constructor(store: BillingStore, options?: BillingServiceOptions);
|
|
17
18
|
getHandler(eventType: BillingEventType): ((event: BillingEvent) => Promise<BillingEventResult>) | undefined;
|
|
18
19
|
invalidateOfferCache(): void;
|
|
@@ -30,6 +31,9 @@ export declare class BillingEventHandlers {
|
|
|
30
31
|
private getExistingSubscription;
|
|
31
32
|
private buildSubscriptionState;
|
|
32
33
|
private resolveOfferAndKeys;
|
|
34
|
+
private subscriptionPlanAnchor;
|
|
35
|
+
private reconcileSubscriptionEvent;
|
|
36
|
+
private applySubscriptionEvent;
|
|
33
37
|
private handleSubscriptionCreated;
|
|
34
38
|
private handleSubscriptionUpdated;
|
|
35
39
|
private handleSubscriptionActivated;
|
|
@@ -42,15 +46,7 @@ export declare class BillingEventHandlers {
|
|
|
42
46
|
private handleSubscriptionPaused;
|
|
43
47
|
private handleSubscriptionResumed;
|
|
44
48
|
private handleTrialWillEnd;
|
|
45
|
-
private provisionSubscription;
|
|
46
49
|
private grantSubscriptionCycle;
|
|
47
|
-
private
|
|
48
|
-
/**
|
|
49
|
-
* Do not revoke access because a stale subscription record ended while a
|
|
50
|
-
* newer subscription for the same user is still active.
|
|
51
|
-
*/
|
|
52
|
-
revokeIfCurrentSubscription(uid: string, subscriptionId: string): Promise<void>;
|
|
53
|
-
private reEvaluateAccess;
|
|
54
|
-
private resolveOfferFromEvent;
|
|
50
|
+
private revokeCustomerAccess;
|
|
55
51
|
}
|
|
56
52
|
//# sourceMappingURL=event-handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-handlers.d.ts","sourceRoot":"","sources":["../../src/billing/event-handlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-handlers.d.ts","sourceRoot":"","sources":["../../src/billing/event-handlers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAKnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,KAAK,EAA2B,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAmCzF,qBAAa,oBAAoB;IAmB7B,OAAO,CAAC,QAAQ,CAAC,KAAK;IAlBxB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAiC;IAC9D,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAU;IACtD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAC9C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgB;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkD;IAC7E,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgC;IAC1D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuE;IAElG,IAAI,eAAe,IAAI,OAAO,CAE7B;IAED,IAAI,YAAY,IAAI,MAAM,GAAG,IAAI,CAEhC;IAED,YACmB,KAAK,EAAE,YAAY,EACpC,OAAO,CAAC,EAAE,qBAAqB,EAoEhC;IAED,UAAU,CACR,SAAS,EAAE,gBAAgB,GAC1B,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC,GAAG,SAAS,CAEpE;IAED,oBAAoB,IAAI,IAAI,CAE3B;IAEK,6BAA6B,CACjC,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,GACzC,OAAO,CAAC,IAAI,CAAC,CAIf;IAED;;;;OAIG;YACW,gBAAgB;YAqChB,yBAAyB;YAYzB,qBAAqB;YAmBrB,qBAAqB;YAcrB,uBAAuB;YAwBvB,uBAAuB;IAUrC,OAAO,CAAC,sBAAsB;YA8DhB,mBAAmB;IA+CjC,OAAO,CAAC,sBAAsB;YAyBhB,0BAA0B;YAyD1B,sBAAsB;YA4DtB,yBAAyB;YAiGzB,yBAAyB;YAazB,2BAA2B;YAW3B,yBAAyB;YAYzB,6BAA6B;YAO7B,2BAA2B;YAQ3B,6BAA6B;YAQ7B,0BAA0B;YAsC1B,yBAAyB;YASzB,wBAAwB;YAQxB,yBAAyB;YAQzB,kBAAkB;YAMlB,sBAAsB;YAkCtB,oBAAoB;CAQnC"}
|