@pithy-sh/payments 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/coverage.d.ts +35 -0
- package/dist/admin/coverage.d.ts.map +1 -0
- package/dist/admin/coverage.js +56 -0
- package/dist/admin/read.d.ts +222 -0
- package/dist/admin/read.d.ts.map +1 -0
- package/dist/admin/read.js +159 -0
- package/dist/audit/actions.d.ts +211 -0
- package/dist/audit/actions.d.ts.map +1 -0
- package/dist/audit/actions.js +211 -0
- package/dist/capability.d.ts +72 -0
- package/dist/capability.d.ts.map +1 -0
- package/dist/capability.js +228 -0
- package/dist/client/api.d.ts +435 -0
- package/dist/client/api.d.ts.map +1 -0
- package/dist/client/api.js +415 -0
- package/dist/client/checkout.d.ts +144 -0
- package/dist/client/checkout.d.ts.map +1 -0
- package/dist/client/checkout.js +173 -0
- package/dist/client/fixtures/price-preview-de.js +89 -0
- package/dist/client/fixtures/price-preview-gb.js +89 -0
- package/dist/client/fixtures/price-preview-jp-yen.js +89 -0
- package/dist/client/fixtures/price-preview-us-country-only.js +89 -0
- package/dist/client/fixtures/price-preview-us-new-york.js +89 -0
- package/dist/client/fixtures/pricePreview.d.ts +54 -0
- package/dist/client/fixtures/pricePreview.d.ts.map +1 -0
- package/dist/client/fixtures/pricePreview.js +61 -0
- package/dist/client/hooks.d.ts +235 -0
- package/dist/client/hooks.d.ts.map +1 -0
- package/dist/client/hooks.js +428 -0
- package/dist/client/paddle.d.ts +433 -0
- package/dist/client/paddle.d.ts.map +1 -0
- package/dist/client/paddle.js +391 -0
- package/dist/client/paddleCache.d.ts +123 -0
- package/dist/client/paddleCache.d.ts.map +1 -0
- package/dist/client/paddleCache.js +159 -0
- package/dist/client/paddlePrices.d.ts +94 -0
- package/dist/client/paddlePrices.d.ts.map +1 -0
- package/dist/client/paddlePrices.js +55 -0
- package/dist/client/paddlePricesTag.d.ts +127 -0
- package/dist/client/paddlePricesTag.d.ts.map +1 -0
- package/dist/client/paddlePricesTag.js +207 -0
- package/dist/client/projection.d.ts +128 -0
- package/dist/client/projection.d.ts.map +1 -0
- package/dist/client/projection.js +0 -0
- package/dist/client/test-utils/cacheStore.d.ts +18 -0
- package/dist/client/test-utils/cacheStore.d.ts.map +1 -0
- package/dist/client/test-utils/cacheStore.js +42 -0
- package/dist/client/wholeUnits.d.ts +18 -0
- package/dist/client/wholeUnits.d.ts.map +1 -0
- package/dist/client/wholeUnits.js +120 -0
- package/dist/config/config.d.ts +238 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +249 -0
- package/dist/data/discount.d.ts +127 -0
- package/dist/data/discount.d.ts.map +1 -0
- package/dist/data/discount.js +91 -0
- package/dist/data/entitlement.d.ts +43 -0
- package/dist/data/entitlement.d.ts.map +1 -0
- package/dist/data/entitlement.js +43 -0
- package/dist/data/money.d.ts +15 -0
- package/dist/data/money.d.ts.map +1 -0
- package/dist/data/money.js +76 -0
- package/dist/data/pause.d.ts +133 -0
- package/dist/data/pause.d.ts.map +1 -0
- package/dist/data/pause.js +63 -0
- package/dist/data/providerAccount.d.ts +40 -0
- package/dist/data/providerAccount.d.ts.map +1 -0
- package/dist/data/providerAccount.js +34 -0
- package/dist/data/purchase.d.ts +107 -0
- package/dist/data/purchase.d.ts.map +1 -0
- package/dist/data/purchase.js +77 -0
- package/dist/data/rail.d.ts +74 -0
- package/dist/data/rail.d.ts.map +1 -0
- package/dist/data/rail.js +74 -0
- package/dist/data/reconcileRun.d.ts +120 -0
- package/dist/data/reconcileRun.d.ts.map +1 -0
- package/dist/data/reconcileRun.js +120 -0
- package/dist/data/renderMoney.d.ts +85 -0
- package/dist/data/renderMoney.d.ts.map +1 -0
- package/dist/data/renderMoney.js +146 -0
- package/dist/data/status.d.ts +58 -0
- package/dist/data/status.d.ts.map +1 -0
- package/dist/data/status.js +68 -0
- package/dist/data/subject.d.ts +111 -0
- package/dist/data/subject.d.ts.map +1 -0
- package/dist/data/subject.js +125 -0
- package/dist/data/subscription.d.ts +624 -0
- package/dist/data/subscription.d.ts.map +1 -0
- package/dist/data/subscription.js +497 -0
- package/dist/data/syncCursor.d.ts +33 -0
- package/dist/data/syncCursor.d.ts.map +1 -0
- package/dist/data/syncCursor.js +29 -0
- package/dist/data/tables.d.ts +37 -0
- package/dist/data/tables.d.ts.map +1 -0
- package/dist/data/tables.js +44 -0
- package/dist/data/webhookEvent.d.ts +134 -0
- package/dist/data/webhookEvent.d.ts.map +1 -0
- package/dist/data/webhookEvent.js +128 -0
- package/dist/entitlement/manual.d.ts +101 -0
- package/dist/entitlement/manual.d.ts.map +1 -0
- package/dist/entitlement/manual.js +84 -0
- package/dist/entitlement/resolver.d.ts +60 -0
- package/dist/entitlement/resolver.d.ts.map +1 -0
- package/dist/entitlement/resolver.js +101 -0
- package/dist/entitlement/subjectSeam.d.ts +102 -0
- package/dist/entitlement/subjectSeam.d.ts.map +1 -0
- package/dist/entitlement/subjectSeam.js +85 -0
- package/dist/error/errors.d.ts +247 -0
- package/dist/error/errors.d.ts.map +1 -0
- package/dist/error/errors.js +326 -0
- package/dist/grants/apply.d.ts +74 -0
- package/dist/grants/apply.d.ts.map +1 -0
- package/dist/grants/apply.js +148 -0
- package/dist/grants/clawback.d.ts +43 -0
- package/dist/grants/clawback.d.ts.map +1 -0
- package/dist/grants/clawback.js +71 -0
- package/dist/grants/ledgerSeam.d.ts +89 -0
- package/dist/grants/ledgerSeam.d.ts.map +1 -0
- package/dist/grants/ledgerSeam.js +66 -0
- package/dist/http/dispatch.d.ts +35 -0
- package/dist/http/dispatch.d.ts.map +1 -0
- package/dist/http/dispatch.js +40 -0
- package/dist/http/guards.d.ts +43 -0
- package/dist/http/guards.d.ts.map +1 -0
- package/dist/http/guards.js +52 -0
- package/dist/http/manifestConfig.d.ts +38 -0
- package/dist/http/manifestConfig.d.ts.map +1 -0
- package/dist/http/manifestConfig.js +49 -0
- package/dist/http/responses.d.ts +1455 -0
- package/dist/http/responses.d.ts.map +1 -0
- package/dist/http/responses.js +728 -0
- package/dist/http/routes.d.ts +315 -0
- package/dist/http/routes.d.ts.map +1 -0
- package/dist/http/routes.js +1966 -0
- package/dist/http/schemas.d.ts +404 -0
- package/dist/http/schemas.d.ts.map +1 -0
- package/dist/http/schemas.js +359 -0
- package/dist/http/scopes.d.ts +160 -0
- package/dist/http/scopes.d.ts.map +1 -0
- package/dist/http/scopes.js +240 -0
- package/dist/http/view.d.ts +96 -0
- package/dist/http/view.d.ts.map +1 -0
- package/dist/http/view.js +170 -0
- package/dist/http/webhookGuard.d.ts +109 -0
- package/dist/http/webhookGuard.d.ts.map +1 -0
- package/dist/http/webhookGuard.js +206 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/migrations/0001_purchases.d.ts +35 -0
- package/dist/migrations/0001_purchases.d.ts.map +1 -0
- package/dist/migrations/0001_purchases.js +80 -0
- package/dist/pricing/location.d.ts +138 -0
- package/dist/pricing/location.d.ts.map +1 -0
- package/dist/pricing/location.js +81 -0
- package/dist/pricing/visitor.d.ts +56 -0
- package/dist/pricing/visitor.d.ts.map +1 -0
- package/dist/pricing/visitor.js +35 -0
- package/dist/projection/event.d.ts +66 -0
- package/dist/projection/event.d.ts.map +1 -0
- package/dist/projection/event.js +45 -0
- package/dist/projection/orphans.d.ts +114 -0
- package/dist/projection/orphans.d.ts.map +1 -0
- package/dist/projection/orphans.js +162 -0
- package/dist/projection/owner.d.ts +121 -0
- package/dist/projection/owner.d.ts.map +1 -0
- package/dist/projection/owner.js +114 -0
- package/dist/projection/resolve.d.ts +30 -0
- package/dist/projection/resolve.d.ts.map +1 -0
- package/dist/projection/resolve.js +42 -0
- package/dist/projection/writer.d.ts +103 -0
- package/dist/projection/writer.d.ts.map +1 -0
- package/dist/projection/writer.js +280 -0
- package/dist/provision/resolvePaymentsConfig.d.ts +48 -0
- package/dist/provision/resolvePaymentsConfig.d.ts.map +1 -0
- package/dist/provision/resolvePaymentsConfig.js +41 -0
- package/dist/rails/apple/certs.d.ts +7 -0
- package/dist/rails/apple/certs.d.ts.map +1 -0
- package/dist/rails/apple/certs.js +8 -0
- package/dist/rails/apple/der.d.ts +107 -0
- package/dist/rails/apple/der.d.ts.map +1 -0
- package/dist/rails/apple/der.js +217 -0
- package/dist/rails/apple/fixtures/chain.d.ts +117 -0
- package/dist/rails/apple/fixtures/chain.d.ts.map +1 -0
- package/dist/rails/apple/fixtures/chain.js +289 -0
- package/dist/rails/apple/http.d.ts +74 -0
- package/dist/rails/apple/http.d.ts.map +1 -0
- package/dist/rails/apple/http.js +32 -0
- package/dist/rails/apple/jws.d.ts +17 -0
- package/dist/rails/apple/jws.d.ts.map +1 -0
- package/dist/rails/apple/jws.js +75 -0
- package/dist/rails/apple/notification.d.ts +116 -0
- package/dist/rails/apple/notification.d.ts.map +1 -0
- package/dist/rails/apple/notification.js +199 -0
- package/dist/rails/apple/rail.d.ts +25 -0
- package/dist/rails/apple/rail.d.ts.map +1 -0
- package/dist/rails/apple/rail.js +68 -0
- package/dist/rails/apple/serverApi.d.ts +120 -0
- package/dist/rails/apple/serverApi.d.ts.map +1 -0
- package/dist/rails/apple/serverApi.js +244 -0
- package/dist/rails/apple/verify.d.ts +36 -0
- package/dist/rails/apple/verify.d.ts.map +1 -0
- package/dist/rails/apple/verify.js +46 -0
- package/dist/rails/apple/x509.d.ts +85 -0
- package/dist/rails/apple/x509.d.ts.map +1 -0
- package/dist/rails/apple/x509.js +273 -0
- package/dist/rails/contract.d.ts +871 -0
- package/dist/rails/contract.d.ts.map +1 -0
- package/dist/rails/contract.js +60 -0
- package/dist/rails/google/fixtures/push.d.ts +71 -0
- package/dist/rails/google/fixtures/push.d.ts.map +1 -0
- package/dist/rails/google/fixtures/push.js +107 -0
- package/dist/rails/google/http.d.ts +77 -0
- package/dist/rails/google/http.d.ts.map +1 -0
- package/dist/rails/google/http.js +39 -0
- package/dist/rails/google/jwt.d.ts +53 -0
- package/dist/rails/google/jwt.d.ts.map +1 -0
- package/dist/rails/google/jwt.js +94 -0
- package/dist/rails/google/oidc.d.ts +112 -0
- package/dist/rails/google/oidc.d.ts.map +1 -0
- package/dist/rails/google/oidc.js +179 -0
- package/dist/rails/google/playApi.d.ts +188 -0
- package/dist/rails/google/playApi.d.ts.map +1 -0
- package/dist/rails/google/playApi.js +350 -0
- package/dist/rails/google/rail.d.ts +57 -0
- package/dist/rails/google/rail.d.ts.map +1 -0
- package/dist/rails/google/rail.js +70 -0
- package/dist/rails/google/rtdn.d.ts +105 -0
- package/dist/rails/google/rtdn.d.ts.map +1 -0
- package/dist/rails/google/rtdn.js +179 -0
- package/dist/rails/google/verify.d.ts +20 -0
- package/dist/rails/google/verify.d.ts.map +1 -0
- package/dist/rails/google/verify.js +76 -0
- package/dist/rails/lemonSqueezy/api.d.ts +92 -0
- package/dist/rails/lemonSqueezy/api.d.ts.map +1 -0
- package/dist/rails/lemonSqueezy/api.js +121 -0
- package/dist/rails/lemonSqueezy/checkout.d.ts +52 -0
- package/dist/rails/lemonSqueezy/checkout.d.ts.map +1 -0
- package/dist/rails/lemonSqueezy/checkout.js +84 -0
- package/dist/rails/lemonSqueezy/discounts.d.ts +50 -0
- package/dist/rails/lemonSqueezy/discounts.d.ts.map +1 -0
- package/dist/rails/lemonSqueezy/discounts.js +75 -0
- package/dist/rails/lemonSqueezy/fixtures/events.d.ts +56 -0
- package/dist/rails/lemonSqueezy/fixtures/events.d.ts.map +1 -0
- package/dist/rails/lemonSqueezy/fixtures/events.js +144 -0
- package/dist/rails/lemonSqueezy/objects.d.ts +229 -0
- package/dist/rails/lemonSqueezy/objects.d.ts.map +1 -0
- package/dist/rails/lemonSqueezy/objects.js +379 -0
- package/dist/rails/lemonSqueezy/portal.d.ts +35 -0
- package/dist/rails/lemonSqueezy/portal.d.ts.map +1 -0
- package/dist/rails/lemonSqueezy/portal.js +18 -0
- package/dist/rails/lemonSqueezy/pricing.d.ts +25 -0
- package/dist/rails/lemonSqueezy/pricing.d.ts.map +1 -0
- package/dist/rails/lemonSqueezy/pricing.js +54 -0
- package/dist/rails/lemonSqueezy/rail.d.ts +41 -0
- package/dist/rails/lemonSqueezy/rail.d.ts.map +1 -0
- package/dist/rails/lemonSqueezy/rail.js +67 -0
- package/dist/rails/lemonSqueezy/read.d.ts +28 -0
- package/dist/rails/lemonSqueezy/read.d.ts.map +1 -0
- package/dist/rails/lemonSqueezy/read.js +37 -0
- package/dist/rails/lemonSqueezy/refresh.d.ts +42 -0
- package/dist/rails/lemonSqueezy/refresh.d.ts.map +1 -0
- package/dist/rails/lemonSqueezy/refresh.js +40 -0
- package/dist/rails/lemonSqueezy/signature.d.ts +56 -0
- package/dist/rails/lemonSqueezy/signature.d.ts.map +1 -0
- package/dist/rails/lemonSqueezy/signature.js +92 -0
- package/dist/rails/lemonSqueezy/verify.d.ts +33 -0
- package/dist/rails/lemonSqueezy/verify.d.ts.map +1 -0
- package/dist/rails/lemonSqueezy/verify.js +41 -0
- package/dist/rails/lemonSqueezy/webhook.d.ts +53 -0
- package/dist/rails/lemonSqueezy/webhook.d.ts.map +1 -0
- package/dist/rails/lemonSqueezy/webhook.js +179 -0
- package/dist/rails/paddle/adjustments.d.ts +60 -0
- package/dist/rails/paddle/adjustments.d.ts.map +1 -0
- package/dist/rails/paddle/adjustments.js +66 -0
- package/dist/rails/paddle/api.d.ts +138 -0
- package/dist/rails/paddle/api.d.ts.map +1 -0
- package/dist/rails/paddle/api.js +152 -0
- package/dist/rails/paddle/checkout.d.ts +69 -0
- package/dist/rails/paddle/checkout.d.ts.map +1 -0
- package/dist/rails/paddle/checkout.js +100 -0
- package/dist/rails/paddle/discounts.d.ts +67 -0
- package/dist/rails/paddle/discounts.d.ts.map +1 -0
- package/dist/rails/paddle/discounts.js +73 -0
- package/dist/rails/paddle/events.d.ts +140 -0
- package/dist/rails/paddle/events.d.ts.map +1 -0
- package/dist/rails/paddle/events.js +183 -0
- package/dist/rails/paddle/fixtures/browserForged.d.ts +42 -0
- package/dist/rails/paddle/fixtures/browserForged.d.ts.map +1 -0
- package/dist/rails/paddle/fixtures/browserForged.js +52 -0
- package/dist/rails/paddle/fixtures/pausedSubscription.d.ts +78 -0
- package/dist/rails/paddle/fixtures/pausedSubscription.d.ts.map +1 -0
- package/dist/rails/paddle/fixtures/pausedSubscription.js +76 -0
- package/dist/rails/paddle/objects.d.ts +519 -0
- package/dist/rails/paddle/objects.d.ts.map +1 -0
- package/dist/rails/paddle/objects.js +588 -0
- package/dist/rails/paddle/portal.d.ts +45 -0
- package/dist/rails/paddle/portal.d.ts.map +1 -0
- package/dist/rails/paddle/portal.js +42 -0
- package/dist/rails/paddle/rail.d.ts +55 -0
- package/dist/rails/paddle/rail.d.ts.map +1 -0
- package/dist/rails/paddle/rail.js +117 -0
- package/dist/rails/paddle/read.d.ts +53 -0
- package/dist/rails/paddle/read.d.ts.map +1 -0
- package/dist/rails/paddle/read.js +66 -0
- package/dist/rails/paddle/recorded.d.ts +49 -0
- package/dist/rails/paddle/recorded.d.ts.map +1 -0
- package/dist/rails/paddle/recorded.js +79 -0
- package/dist/rails/paddle/refresh.d.ts +54 -0
- package/dist/rails/paddle/refresh.d.ts.map +1 -0
- package/dist/rails/paddle/refresh.js +94 -0
- package/dist/rails/paddle/refund.d.ts +82 -0
- package/dist/rails/paddle/refund.d.ts.map +1 -0
- package/dist/rails/paddle/refund.js +175 -0
- package/dist/rails/paddle/signature.d.ts +83 -0
- package/dist/rails/paddle/signature.d.ts.map +1 -0
- package/dist/rails/paddle/signature.js +163 -0
- package/dist/rails/paddle/subscription.d.ts +137 -0
- package/dist/rails/paddle/subscription.d.ts.map +1 -0
- package/dist/rails/paddle/subscription.js +538 -0
- package/dist/rails/paddle/verify.d.ts +46 -0
- package/dist/rails/paddle/verify.d.ts.map +1 -0
- package/dist/rails/paddle/verify.js +43 -0
- package/dist/rails/paddle/webhook.d.ts +98 -0
- package/dist/rails/paddle/webhook.d.ts.map +1 -0
- package/dist/rails/paddle/webhook.js +181 -0
- package/dist/rails/providers.d.ts +73 -0
- package/dist/rails/providers.d.ts.map +1 -0
- package/dist/rails/providers.js +62 -0
- package/dist/rails/stripe/api.d.ts +118 -0
- package/dist/rails/stripe/api.d.ts.map +1 -0
- package/dist/rails/stripe/api.js +153 -0
- package/dist/rails/stripe/checkout.d.ts +60 -0
- package/dist/rails/stripe/checkout.d.ts.map +1 -0
- package/dist/rails/stripe/checkout.js +86 -0
- package/dist/rails/stripe/discounts.d.ts +50 -0
- package/dist/rails/stripe/discounts.d.ts.map +1 -0
- package/dist/rails/stripe/discounts.js +87 -0
- package/dist/rails/stripe/fixtures/events.d.ts +64 -0
- package/dist/rails/stripe/fixtures/events.d.ts.map +1 -0
- package/dist/rails/stripe/fixtures/events.js +67 -0
- package/dist/rails/stripe/objects.d.ts +237 -0
- package/dist/rails/stripe/objects.d.ts.map +1 -0
- package/dist/rails/stripe/objects.js +389 -0
- package/dist/rails/stripe/portal.d.ts +29 -0
- package/dist/rails/stripe/portal.d.ts.map +1 -0
- package/dist/rails/stripe/portal.js +41 -0
- package/dist/rails/stripe/pricing.d.ts +25 -0
- package/dist/rails/stripe/pricing.d.ts.map +1 -0
- package/dist/rails/stripe/pricing.js +68 -0
- package/dist/rails/stripe/rail.d.ts +28 -0
- package/dist/rails/stripe/rail.d.ts.map +1 -0
- package/dist/rails/stripe/rail.js +81 -0
- package/dist/rails/stripe/refresh.d.ts +33 -0
- package/dist/rails/stripe/refresh.d.ts.map +1 -0
- package/dist/rails/stripe/refresh.js +21 -0
- package/dist/rails/stripe/signature.d.ts +71 -0
- package/dist/rails/stripe/signature.d.ts.map +1 -0
- package/dist/rails/stripe/signature.js +92 -0
- package/dist/rails/stripe/verify.d.ts +15 -0
- package/dist/rails/stripe/verify.d.ts.map +1 -0
- package/dist/rails/stripe/verify.js +63 -0
- package/dist/rails/stripe/webhook.d.ts +26 -0
- package/dist/rails/stripe/webhook.d.ts.map +1 -0
- package/dist/rails/stripe/webhook.js +31 -0
- package/dist/secret/registry.d.ts +192 -0
- package/dist/secret/registry.d.ts.map +1 -0
- package/dist/secret/registry.js +154 -0
- package/dist/seeds/example.d.ts +3 -0
- package/dist/seeds/example.d.ts.map +1 -0
- package/dist/seeds/example.js +171 -0
- package/dist/version.generated.d.ts +5 -0
- package/dist/version.generated.d.ts.map +1 -0
- package/dist/version.generated.js +7 -0
- package/dist/workflows/paddleSweep.d.ts +175 -0
- package/dist/workflows/paddleSweep.d.ts.map +1 -0
- package/dist/workflows/paddleSweep.js +433 -0
- package/dist/workflows/railAccess.d.ts +48 -0
- package/dist/workflows/railAccess.d.ts.map +1 -0
- package/dist/workflows/railAccess.js +36 -0
- package/dist/workflows/reconcile.d.ts +161 -0
- package/dist/workflows/reconcile.d.ts.map +1 -0
- package/dist/workflows/reconcile.js +352 -0
- package/dist/workflows/report.d.ts +28 -0
- package/dist/workflows/report.d.ts.map +1 -0
- package/dist/workflows/report.js +54 -0
- package/dist/workflows/retryPolicy.d.ts +29 -0
- package/dist/workflows/retryPolicy.d.ts.map +1 -0
- package/dist/workflows/retryPolicy.js +37 -0
- package/dist/workflows/specs.d.ts +102 -0
- package/dist/workflows/specs.d.ts.map +1 -0
- package/dist/workflows/specs.js +84 -0
- package/dist/workflows/worker.d.ts +62 -0
- package/dist/workflows/worker.d.ts.map +1 -0
- package/dist/workflows/worker.js +92 -0
- package/dist/workflows/workerConfig.d.ts +46 -0
- package/dist/workflows/workerConfig.d.ts.map +1 -0
- package/dist/workflows/workerConfig.js +38 -0
- package/package.json +22 -13
- package/pithy.manifest.json +19 -13
- package/src/version.generated.ts +1 -1
- package/src/client/paddlePrices.iife.ts +0 -43
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { PaymentsEntitlement } from "./entitlement.js";
|
|
2
|
+
import { PaymentsProviderAccount } from "./providerAccount.js";
|
|
3
|
+
import { PaymentsPurchase } from "./purchase.js";
|
|
4
|
+
import { PaymentsReconcileRun } from "./reconcileRun.js";
|
|
5
|
+
import { PaymentsSyncCursor } from "./syncCursor.js";
|
|
6
|
+
import { PaymentsWebhookEvent } from "./webhookEvent.js";
|
|
7
|
+
import { createDatabase } from "@pithy-sh/core/src/data/db";
|
|
8
|
+
//#region src/data/tables.ts
|
|
9
|
+
/** The projection of provider truth. `CamelCasePlugin` snake-cases it to `pithy_payments_purchases`. */
|
|
10
|
+
const PAYMENTS_PURCHASES_TABLE = "pithyPaymentsPurchases";
|
|
11
|
+
/** The materialized read model `requireEntitlement()` hits. → `pithy_payments_entitlements`. */
|
|
12
|
+
const PAYMENTS_ENTITLEMENTS_TABLE = "pithyPaymentsEntitlements";
|
|
13
|
+
/** Provider identity → the subject that holds it. → `pithy_payments_provider_accounts`. */
|
|
14
|
+
const PAYMENTS_PROVIDER_ACCOUNTS_TABLE = "pithyPaymentsProviderAccounts";
|
|
15
|
+
/** Raw received notifications, the replay source. → `pithy_payments_webhook_events`. */
|
|
16
|
+
const PAYMENTS_WEBHOOK_EVENTS_TABLE = "pithyPaymentsWebhookEvents";
|
|
17
|
+
/** One row per reconciliation pass — the tally, kept. → `pithy_payments_reconcile_runs`. */
|
|
18
|
+
const PAYMENTS_RECONCILE_RUNS_TABLE = "pithyPaymentsReconcileRuns";
|
|
19
|
+
/** Where a resumable sweep of a provider's stream left off. → `pithy_payments_sync_cursors`. */
|
|
20
|
+
const PAYMENTS_SYNC_CURSORS_TABLE = "pithyPaymentsSyncCursors";
|
|
21
|
+
/** The payments tables map. All six are always present — none is behind a config flag. */
|
|
22
|
+
function paymentsTables() {
|
|
23
|
+
return {
|
|
24
|
+
[PAYMENTS_PURCHASES_TABLE]: PaymentsPurchase,
|
|
25
|
+
[PAYMENTS_ENTITLEMENTS_TABLE]: PaymentsEntitlement,
|
|
26
|
+
[PAYMENTS_PROVIDER_ACCOUNTS_TABLE]: PaymentsProviderAccount,
|
|
27
|
+
[PAYMENTS_WEBHOOK_EVENTS_TABLE]: PaymentsWebhookEvent,
|
|
28
|
+
[PAYMENTS_RECONCILE_RUNS_TABLE]: PaymentsReconcileRun,
|
|
29
|
+
[PAYMENTS_SYNC_CURSORS_TABLE]: PaymentsSyncCursor
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Build the payments database from the `DB` binding (CamelCasePlugin installed). */
|
|
33
|
+
function paymentsDatabase(d1) {
|
|
34
|
+
return createDatabase(d1, {
|
|
35
|
+
[PAYMENTS_PURCHASES_TABLE]: PaymentsPurchase,
|
|
36
|
+
[PAYMENTS_ENTITLEMENTS_TABLE]: PaymentsEntitlement,
|
|
37
|
+
[PAYMENTS_PROVIDER_ACCOUNTS_TABLE]: PaymentsProviderAccount,
|
|
38
|
+
[PAYMENTS_WEBHOOK_EVENTS_TABLE]: PaymentsWebhookEvent,
|
|
39
|
+
[PAYMENTS_RECONCILE_RUNS_TABLE]: PaymentsReconcileRun,
|
|
40
|
+
[PAYMENTS_SYNC_CURSORS_TABLE]: PaymentsSyncCursor
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { PAYMENTS_ENTITLEMENTS_TABLE, PAYMENTS_PROVIDER_ACCOUNTS_TABLE, PAYMENTS_PURCHASES_TABLE, PAYMENTS_RECONCILE_RUNS_TABLE, PAYMENTS_SYNC_CURSORS_TABLE, PAYMENTS_WEBHOOK_EVENTS_TABLE, paymentsDatabase, paymentsTables };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { SQLiteDate } from "@pithy-sh/core/src/data/codecs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/**
|
|
4
|
+
* One received provider notification — the row in `pithy_payments_webhook_events`, keyed
|
|
5
|
+
* `UNIQUE (rail, providerEventId)`.
|
|
6
|
+
*
|
|
7
|
+
* Every provider delivers at-least-once and retries, so a redelivery is expected and must be recognized
|
|
8
|
+
* rather than reprocessed. This is the replay source, and it is what makes "why didn't this renew"
|
|
9
|
+
* answerable: `receivedAt` says whether the notification arrived at all, `processedAt` whether it was
|
|
10
|
+
* finished with, `abandonedAt` whether a repair pass gave up on it, and `error` why.
|
|
11
|
+
*
|
|
12
|
+
* ## Why two timestamps and no status column (#337)
|
|
13
|
+
*
|
|
14
|
+
* `processedAt` used to be the whole answer, and three writers meant three different things by it —
|
|
15
|
+
* projected, tried and failed, and given up on. Because the webhook guard short-circuits on it, two of
|
|
16
|
+
* those three silently stopped a purchase from ever being projected.
|
|
17
|
+
*
|
|
18
|
+
* **The defect was not too few states. It was every reader spelling out its own predicate over a column
|
|
19
|
+
* whose meaning the writers disagreed about.** A stored `status` enum makes the writers exhaustive and
|
|
20
|
+
* leaves the readers exactly as free to write `status <> 'pending'` — which is the short-circuit that was
|
|
21
|
+
* wrong. So the fix has to be a named question each reader asks by name, and once there is one, the
|
|
22
|
+
* storage shape is the smaller decision.
|
|
23
|
+
*
|
|
24
|
+
* Given that, two nullable timestamps beat an enum twice over. They answer *when*, which is what this
|
|
25
|
+
* table is read for, and they cannot contradict themselves the way `status = 'projected'` beside a null
|
|
26
|
+
* `processedAt` can. An enum would add an invariant nothing enforces; a timestamp is its own evidence.
|
|
27
|
+
*
|
|
28
|
+
* So the state is **derived, never stored** — see {@link webhookEventState} — and the two readers that
|
|
29
|
+
* matter ask different questions of it: {@link isWebhookEventFinished} for the guard's short-circuit, and
|
|
30
|
+
* {@link isWebhookEventOutstanding} for a repair pass. Both switch over every state, so a fifth one cannot
|
|
31
|
+
* be added without each reader saying what it means by it.
|
|
32
|
+
*
|
|
33
|
+
* A third reader asks a question the state cannot answer — see {@link webhookEventAwaitsOwner}. It exists
|
|
34
|
+
* because a link repairs one kind of unfinished row and not the others, and *which* kind is in `error`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const PaymentsWebhookEvent: z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
rail: z.ZodEnum<{
|
|
39
|
+
apple: "apple";
|
|
40
|
+
google: "google";
|
|
41
|
+
lemonSqueezy: "lemonSqueezy";
|
|
42
|
+
paddle: "paddle";
|
|
43
|
+
stripe: "stripe";
|
|
44
|
+
}>;
|
|
45
|
+
providerEventId: z.ZodString;
|
|
46
|
+
payload: z.ZodCodec<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
47
|
+
receivedAt: z.ZodCodec<z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodDate]>, z.ZodDate>;
|
|
48
|
+
processedAt: z.ZodNullable<z.ZodCodec<z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodDate]>, z.ZodDate>>;
|
|
49
|
+
abandonedAt: z.ZodOptional<z.ZodNullable<z.ZodCodec<z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodDate]>, z.ZodDate>>>;
|
|
50
|
+
error: z.ZodNullable<z.ZodString>;
|
|
51
|
+
attempts: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
createdAt: z.ZodCodec<z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodDate]>, z.ZodDate>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export type PaymentsWebhookEvent = z.output<typeof PaymentsWebhookEvent>;
|
|
55
|
+
export type PaymentsWebhookEventRow = z.input<typeof PaymentsWebhookEvent>;
|
|
56
|
+
/**
|
|
57
|
+
* What has become of a recorded delivery. Four cases, and each one behaves differently.
|
|
58
|
+
*
|
|
59
|
+
* - `pending` — it arrived and nothing has tried it yet.
|
|
60
|
+
* - `failed` — it was tried, it did not project, and it is still outstanding.
|
|
61
|
+
* - `abandoned` — a repair pass gave up so its stream could advance. Outstanding, but not to that pass.
|
|
62
|
+
* - `finished` — projected, or deliberately nothing to project. Nothing is left to do.
|
|
63
|
+
*/
|
|
64
|
+
export type PaymentsWebhookEventState = "pending" | "failed" | "abandoned" | "finished";
|
|
65
|
+
/**
|
|
66
|
+
* The two timestamps and the reason, as a reader gets them off a narrow `select`.
|
|
67
|
+
*
|
|
68
|
+
* Deliberately the **encoded** shape rather than {@link PaymentsWebhookEvent}: both readers want two or
|
|
69
|
+
* three columns, and making them decode a whole row — payload included — to answer "may this be
|
|
70
|
+
* short-circuited" would be a JSON parse per redelivery. `undefined` is accepted beside `null` for the
|
|
71
|
+
* same reason a defaulted column can read back absent.
|
|
72
|
+
*/
|
|
73
|
+
export interface PaymentsWebhookEventProgress {
|
|
74
|
+
/** `processed_at`, as `SQLiteDate` accepts it, or absent. Only its presence is read here. */
|
|
75
|
+
readonly processedAt?: z.input<typeof SQLiteDate> | null;
|
|
76
|
+
/** `abandoned_at`, likewise. */
|
|
77
|
+
readonly abandonedAt?: z.input<typeof SQLiteDate> | null;
|
|
78
|
+
/** `error`, or absent. */
|
|
79
|
+
readonly error?: string | null;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Classify one recorded delivery. **Derived here, once, rather than stored** — see the module doc.
|
|
83
|
+
*
|
|
84
|
+
* Finished wins over abandoned, and that ordering is the point rather than an accident: an event the sweep
|
|
85
|
+
* gave up on and a later delivery then projected is *finished*, and `abandonedAt` stays on the row as the
|
|
86
|
+
* record of how close that purchase came to being lost.
|
|
87
|
+
*/
|
|
88
|
+
export declare function webhookEventState(row: PaymentsWebhookEventProgress): PaymentsWebhookEventState;
|
|
89
|
+
/**
|
|
90
|
+
* May a redelivery be answered as a duplicate without running anything?
|
|
91
|
+
*
|
|
92
|
+
* **Only for a delivery that is finished with.** This is the webhook guard's short-circuit, and it is the
|
|
93
|
+
* whole of #337: while it meant "we have seen this", a delivery that arrived and failed was answered 200
|
|
94
|
+
* for ever, and no path in this package repaired it.
|
|
95
|
+
*/
|
|
96
|
+
export declare function isWebhookEventFinished(state: PaymentsWebhookEventState): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* The prefix an event's `error` carries when the one thing missing was **an owner**.
|
|
99
|
+
*
|
|
100
|
+
* `error` is free text an operator reads, and two writers put two different sentences in it for the same
|
|
101
|
+
* condition — the webhook handler's "no subject could be resolved", and the sweep's own `orphaned:`. That
|
|
102
|
+
* was fine while nothing queried it. It stopped being fine with #341: linking an account has to find exactly
|
|
103
|
+
* the rows that were waiting on that link, and "waiting on a link" is not derivable from the two timestamps —
|
|
104
|
+
* a quarantine after three failures wears the same pair.
|
|
105
|
+
*
|
|
106
|
+
* So the reason is written on the row, once, by a constant both writers share. A prefix rather than a column
|
|
107
|
+
* because it costs no migration and stays legible to the operator reading `error`, and it is a prefix rather
|
|
108
|
+
* than a substring so the match is anchored and a note quoting the word cannot be mistaken for one.
|
|
109
|
+
*
|
|
110
|
+
* See {@link webhookEventAwaitsOwner} for the reader, and `projection/orphans.ts` for what it is read by.
|
|
111
|
+
*/
|
|
112
|
+
export declare const WEBHOOK_EVENT_ORPHANED = "orphaned:";
|
|
113
|
+
/**
|
|
114
|
+
* Is this event outstanding for want of an owner, rather than for want of anything else?
|
|
115
|
+
*
|
|
116
|
+
* The question the relink repair asks, and it is deliberately narrower than "not finished". A quarantined
|
|
117
|
+
* event, a failed projection, an unmapped SKU — none of those is repaired by an account linking, and running
|
|
118
|
+
* them again on that signal would be a second unbounded retry loop wearing the first one's clothes.
|
|
119
|
+
*
|
|
120
|
+
* `abandoned` and `failed` both qualify, because both paths produce an orphan and they produce different
|
|
121
|
+
* states: the sweep abandons one so its stream can advance, and the webhook handler leaves one failed so a
|
|
122
|
+
* redelivery repairs it. Neither is finished, and both are waiting on the same thing.
|
|
123
|
+
*/
|
|
124
|
+
export declare function webhookEventAwaitsOwner(row: PaymentsWebhookEventProgress): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Has a repair pass anything left to do with this event?
|
|
127
|
+
*
|
|
128
|
+
* `abandoned` is false here, and false is right: the bound exists so one unprojectable event cannot hold a
|
|
129
|
+
* stream up for ever, and a pass that picked its own quarantines back up would restart the count and stall
|
|
130
|
+
* again. That is the asymmetry the two readers exist for — the pass must move on, and a webhook delivery
|
|
131
|
+
* must still be able to repair what it walked past.
|
|
132
|
+
*/
|
|
133
|
+
export declare function isWebhookEventOutstanding(state: PaymentsWebhookEventState): boolean;
|
|
134
|
+
//# sourceMappingURL=webhookEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhookEvent.d.ts","sourceRoot":"","sources":["../../src/data/webhookEvent.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAc,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;iBAqCiF,CAAC;AACnH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACzE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE3E;;;;;;;GAOG;AACH,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AAExF;;;;;;;GAOG;AACH,MAAM,WAAW,4BAA4B;IAC3C,6FAA6F;IAC7F,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;IACzD,gCAAgC;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;IACzD,0BAA0B;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,4BAA4B,GAAG,yBAAyB,CAK9F;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAShF;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAElD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,4BAA4B,GAAG,OAAO,CAGlF;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CASnF"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { PaymentsRail } from "./rail.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { SQLiteDate, sqliteJson } from "@pithy-sh/core/src/data/codecs";
|
|
4
|
+
//#region src/data/webhookEvent.ts
|
|
5
|
+
/** A received notification body, as the rail delivered it. Only the envelope is fixed; shapes differ. */
|
|
6
|
+
const NotificationPayload = z.record(z.string(), z.unknown()).describe("The notification body as received, before any rail-specific interpretation.");
|
|
7
|
+
/**
|
|
8
|
+
* One received provider notification — the row in `pithy_payments_webhook_events`, keyed
|
|
9
|
+
* `UNIQUE (rail, providerEventId)`.
|
|
10
|
+
*
|
|
11
|
+
* Every provider delivers at-least-once and retries, so a redelivery is expected and must be recognized
|
|
12
|
+
* rather than reprocessed. This is the replay source, and it is what makes "why didn't this renew"
|
|
13
|
+
* answerable: `receivedAt` says whether the notification arrived at all, `processedAt` whether it was
|
|
14
|
+
* finished with, `abandonedAt` whether a repair pass gave up on it, and `error` why.
|
|
15
|
+
*
|
|
16
|
+
* ## Why two timestamps and no status column (#337)
|
|
17
|
+
*
|
|
18
|
+
* `processedAt` used to be the whole answer, and three writers meant three different things by it —
|
|
19
|
+
* projected, tried and failed, and given up on. Because the webhook guard short-circuits on it, two of
|
|
20
|
+
* those three silently stopped a purchase from ever being projected.
|
|
21
|
+
*
|
|
22
|
+
* **The defect was not too few states. It was every reader spelling out its own predicate over a column
|
|
23
|
+
* whose meaning the writers disagreed about.** A stored `status` enum makes the writers exhaustive and
|
|
24
|
+
* leaves the readers exactly as free to write `status <> 'pending'` — which is the short-circuit that was
|
|
25
|
+
* wrong. So the fix has to be a named question each reader asks by name, and once there is one, the
|
|
26
|
+
* storage shape is the smaller decision.
|
|
27
|
+
*
|
|
28
|
+
* Given that, two nullable timestamps beat an enum twice over. They answer *when*, which is what this
|
|
29
|
+
* table is read for, and they cannot contradict themselves the way `status = 'projected'` beside a null
|
|
30
|
+
* `processedAt` can. An enum would add an invariant nothing enforces; a timestamp is its own evidence.
|
|
31
|
+
*
|
|
32
|
+
* So the state is **derived, never stored** — see {@link webhookEventState} — and the two readers that
|
|
33
|
+
* matter ask different questions of it: {@link isWebhookEventFinished} for the guard's short-circuit, and
|
|
34
|
+
* {@link isWebhookEventOutstanding} for a repair pass. Both switch over every state, so a fifth one cannot
|
|
35
|
+
* be added without each reader saying what it means by it.
|
|
36
|
+
*
|
|
37
|
+
* A third reader asks a question the state cannot answer — see {@link webhookEventAwaitsOwner}. It exists
|
|
38
|
+
* because a link repairs one kind of unfinished row and not the others, and *which* kind is in `error`.
|
|
39
|
+
*/
|
|
40
|
+
const PaymentsWebhookEvent = z.object({
|
|
41
|
+
id: z.string().describe("The row's UUID."),
|
|
42
|
+
rail: PaymentsRail.describe("Which store delivered the notification."),
|
|
43
|
+
providerEventId: z.string().describe("The rail's own event id. `UNIQUE (rail, providerEventId)` — a redelivery is recognized, not reprocessed."),
|
|
44
|
+
payload: sqliteJson(NotificationPayload).describe("The notification body, Zod-validated on write and on read. The replay source, so it is stored whole."),
|
|
45
|
+
receivedAt: SQLiteDate.describe("When the notification arrived. Present even for one that never processed."),
|
|
46
|
+
processedAt: SQLiteDate.nullable().describe("When this delivery was finished with — projected, or deliberately nothing to project — or null while it has not been. The only column the webhook guard short-circuits on, so it means 'we have finished this' and never 'we have seen this'. Null with an old `receivedAt` is the drift signal."),
|
|
47
|
+
abandonedAt: SQLiteDate.nullable().optional().describe("When a repair pass gave up on this event so its stream could advance, or null. Separate from `processedAt` because abandoning is that pass's decision about its own progress and must never answer for a webhook: a later delivery of the same event has to be reprocessed, and fixing the cause has to be able to repair it. Optional because the webhook path never abandons anything and the column defaults to null for it."),
|
|
48
|
+
error: z.string().nullable().describe("Why this delivery did not project — or, beside a set `processedAt`, why there was never anything to project. Internal text: it is read by an operator and never rendered to a client. Its presence is not the state; the two timestamps are, because an explanation must not be able to change one."),
|
|
49
|
+
attempts: z.number().int().nonnegative().optional().describe("How many times a repair pass has tried this event and failed. Optional because the webhook path neither retries nor counts, and the column defaults to 0 for it; the sweep uses it to bound how long one unprojectable event may hold the stream up before it is quarantined."),
|
|
50
|
+
createdAt: SQLiteDate.describe("When this row was written.")
|
|
51
|
+
}).describe("One received provider notification — the row in `pithy_payments_webhook_events`, the replay source.");
|
|
52
|
+
/**
|
|
53
|
+
* Classify one recorded delivery. **Derived here, once, rather than stored** — see the module doc.
|
|
54
|
+
*
|
|
55
|
+
* Finished wins over abandoned, and that ordering is the point rather than an accident: an event the sweep
|
|
56
|
+
* gave up on and a later delivery then projected is *finished*, and `abandonedAt` stays on the row as the
|
|
57
|
+
* record of how close that purchase came to being lost.
|
|
58
|
+
*/
|
|
59
|
+
function webhookEventState(row) {
|
|
60
|
+
if (row.processedAt !== null && row.processedAt !== void 0) return "finished";
|
|
61
|
+
if (row.abandonedAt !== null && row.abandonedAt !== void 0) return "abandoned";
|
|
62
|
+
if (row.error !== null && row.error !== void 0) return "failed";
|
|
63
|
+
return "pending";
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* May a redelivery be answered as a duplicate without running anything?
|
|
67
|
+
*
|
|
68
|
+
* **Only for a delivery that is finished with.** This is the webhook guard's short-circuit, and it is the
|
|
69
|
+
* whole of #337: while it meant "we have seen this", a delivery that arrived and failed was answered 200
|
|
70
|
+
* for ever, and no path in this package repaired it.
|
|
71
|
+
*/
|
|
72
|
+
function isWebhookEventFinished(state) {
|
|
73
|
+
switch (state) {
|
|
74
|
+
case "finished": return true;
|
|
75
|
+
case "pending":
|
|
76
|
+
case "failed":
|
|
77
|
+
case "abandoned": return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The prefix an event's `error` carries when the one thing missing was **an owner**.
|
|
82
|
+
*
|
|
83
|
+
* `error` is free text an operator reads, and two writers put two different sentences in it for the same
|
|
84
|
+
* condition — the webhook handler's "no subject could be resolved", and the sweep's own `orphaned:`. That
|
|
85
|
+
* was fine while nothing queried it. It stopped being fine with #341: linking an account has to find exactly
|
|
86
|
+
* the rows that were waiting on that link, and "waiting on a link" is not derivable from the two timestamps —
|
|
87
|
+
* a quarantine after three failures wears the same pair.
|
|
88
|
+
*
|
|
89
|
+
* So the reason is written on the row, once, by a constant both writers share. A prefix rather than a column
|
|
90
|
+
* because it costs no migration and stays legible to the operator reading `error`, and it is a prefix rather
|
|
91
|
+
* than a substring so the match is anchored and a note quoting the word cannot be mistaken for one.
|
|
92
|
+
*
|
|
93
|
+
* See {@link webhookEventAwaitsOwner} for the reader, and `projection/orphans.ts` for what it is read by.
|
|
94
|
+
*/
|
|
95
|
+
const WEBHOOK_EVENT_ORPHANED = "orphaned:";
|
|
96
|
+
/**
|
|
97
|
+
* Is this event outstanding for want of an owner, rather than for want of anything else?
|
|
98
|
+
*
|
|
99
|
+
* The question the relink repair asks, and it is deliberately narrower than "not finished". A quarantined
|
|
100
|
+
* event, a failed projection, an unmapped SKU — none of those is repaired by an account linking, and running
|
|
101
|
+
* them again on that signal would be a second unbounded retry loop wearing the first one's clothes.
|
|
102
|
+
*
|
|
103
|
+
* `abandoned` and `failed` both qualify, because both paths produce an orphan and they produce different
|
|
104
|
+
* states: the sweep abandons one so its stream can advance, and the webhook handler leaves one failed so a
|
|
105
|
+
* redelivery repairs it. Neither is finished, and both are waiting on the same thing.
|
|
106
|
+
*/
|
|
107
|
+
function webhookEventAwaitsOwner(row) {
|
|
108
|
+
if (webhookEventState(row) === "finished") return false;
|
|
109
|
+
return (row.error ?? "").startsWith(WEBHOOK_EVENT_ORPHANED);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Has a repair pass anything left to do with this event?
|
|
113
|
+
*
|
|
114
|
+
* `abandoned` is false here, and false is right: the bound exists so one unprojectable event cannot hold a
|
|
115
|
+
* stream up for ever, and a pass that picked its own quarantines back up would restart the count and stall
|
|
116
|
+
* again. That is the asymmetry the two readers exist for — the pass must move on, and a webhook delivery
|
|
117
|
+
* must still be able to repair what it walked past.
|
|
118
|
+
*/
|
|
119
|
+
function isWebhookEventOutstanding(state) {
|
|
120
|
+
switch (state) {
|
|
121
|
+
case "pending":
|
|
122
|
+
case "failed": return true;
|
|
123
|
+
case "abandoned":
|
|
124
|
+
case "finished": return false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
export { PaymentsWebhookEvent, WEBHOOK_EVENT_ORPHANED, isWebhookEventFinished, isWebhookEventOutstanding, webhookEventAwaitsOwner, webhookEventState };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { D1Database } from "@cloudflare/workers-types";
|
|
2
|
+
import { type PaymentsConfig } from "../config/config";
|
|
3
|
+
import { PaymentsEntitlement } from "../data/entitlement";
|
|
4
|
+
import { type PaymentsSubject } from "../data/subject";
|
|
5
|
+
/**
|
|
6
|
+
* Manual entitlement writes — the support surface behind `POST /payments/entitlements/grant` and `/revoke`.
|
|
7
|
+
*
|
|
8
|
+
* These are the only writes to the read model that no purchase produced, which is exactly why the routes over
|
|
9
|
+
* them are `control-plane`, default-denied, and audited on both paths. Everything else in this package can be
|
|
10
|
+
* traced back to a store's own artifact; this cannot, so the trail is the only record of who decided it.
|
|
11
|
+
*
|
|
12
|
+
* ## The hold, and why `grant` and `revoke` are not symmetric
|
|
13
|
+
*
|
|
14
|
+
* Every other row in this table is derived: the projection recomputes it from the purchases table on every
|
|
15
|
+
* write that touches its key, which is what keeps the read model from silently disagreeing with the money.
|
|
16
|
+
* A comp has no purchase behind it, so a derivation would find nothing supporting it and clear it — and a
|
|
17
|
+
* support comp erased by the user's next renewal is worse than no comp at all, because nobody would notice.
|
|
18
|
+
*
|
|
19
|
+
* So a grant sets `manual`, and the projection skips a row carrying it. Both shapes work and both last:
|
|
20
|
+
* comping a key the catalog does not sell (`founder`) and comping one it does (`pro`).
|
|
21
|
+
*
|
|
22
|
+
* ## The catalog check is here, at the write
|
|
23
|
+
*
|
|
24
|
+
* {@link grantEntitlement} refuses a key this project does not define, with
|
|
25
|
+
* `payments/entitlement_not_in_catalog`, a 400 naming the key (#300). An operator who meant `pro` and
|
|
26
|
+
* typed `pr` used to get a 200, a row, and a customer who stayed locked out, invisible on both sides.
|
|
27
|
+
*
|
|
28
|
+
* That check first landed in `POST /payments/entitlements/grant`, and lived there alone (#305). A rule at a
|
|
29
|
+
* call site has a second call site eventually: an adopter's own handler, a later route in this package, the
|
|
30
|
+
* reconciliation workflow — each one a path to the row write with the rule removed. So the check moved to
|
|
31
|
+
* the thing being called. The route no longer decides; it reports.
|
|
32
|
+
*
|
|
33
|
+
* The shape that makes that unbypassable is a **split**: `writeEntitlement` below asks nothing and is not
|
|
34
|
+
* exported, and the exported grant takes a {@link PaymentsConfig} it cannot be called without. A caller
|
|
35
|
+
* cannot reach the unchecked half from outside this module, and the type says why.
|
|
36
|
+
*
|
|
37
|
+
* Comping a key nothing sells is therefore **declared** rather than achieved by nobody checking:
|
|
38
|
+
* `manualEntitlements` in `pithy.config.ts` is where an adopter names the keys they comp but do not sell,
|
|
39
|
+
* and those keys are grantable and are published on the catalog read beside the products. The check reads
|
|
40
|
+
* `grantableEntitlements`, so that escape travels with it. Only grants are constrained. A revoke is not, or
|
|
41
|
+
* dropping a product from the catalog would be irreversible for every account still holding its key — which
|
|
42
|
+
* is why {@link revokeEntitlement} takes no config, and must never grow one.
|
|
43
|
+
*
|
|
44
|
+
* A **revoke clears the hold** rather than setting it, which is the deliberate asymmetry. It means a revoke
|
|
45
|
+
* is the exact inverse of a grant — it takes the row back out of a human's hands — and it means a revoke
|
|
46
|
+
* never becomes a permanent block on a user who later pays. That matters: an entitlement the purchases still
|
|
47
|
+
* support is re-derived on the next event, so revoking a *paid* subscription here holds only until the store
|
|
48
|
+
* next says something about it. To end a paid entitlement, refund it through the store; that is the record
|
|
49
|
+
* the projection reads, and the only one that keeps the read model and the money agreeing.
|
|
50
|
+
*
|
|
51
|
+
* A revoke writes an inactive row even when the subject held nothing, because support tooling should not have
|
|
52
|
+
* to know whether a row exists, and because the row is itself the record that somebody decided this account is
|
|
53
|
+
* not entitled.
|
|
54
|
+
*
|
|
55
|
+
* ## The holder is a subject, and both halves are named
|
|
56
|
+
*
|
|
57
|
+
* A comp is a contract somebody signed, and under organization billing the party to it is the company rather
|
|
58
|
+
* than whoever at the company asked. So these take a {@link PaymentsSubject} — the pair, never an id on its
|
|
59
|
+
* own. The pair is the upsert's conflict target, the read-back's predicate and the row's identity, and it is
|
|
60
|
+
* the same pair the read path filters on, so a grant and the gate that honors it cannot disagree about who
|
|
61
|
+
* was meant. `user:acme` and `organization:acme` are two holders: nothing in the kit makes those id spaces
|
|
62
|
+
* disjoint, and support revoking the right id under the wrong kind must take nothing away from the other.
|
|
63
|
+
*/
|
|
64
|
+
/**
|
|
65
|
+
* Who, and to what. The caller has already been through `requireControlPlane`.
|
|
66
|
+
*
|
|
67
|
+
* It **extends** {@link PaymentsSubject} rather than restating two strings, so a caller cannot supply half a
|
|
68
|
+
* holder and the type is the same one every other subject-bearing surface takes. Never the caller's own
|
|
69
|
+
* subject — this is support acting on somebody else's account.
|
|
70
|
+
*/
|
|
71
|
+
export interface ManualEntitlementInput extends PaymentsSubject {
|
|
72
|
+
/** The entitlement key, as gating code names it. */
|
|
73
|
+
entitlement: string;
|
|
74
|
+
/** When a grant lapses. Absent or null never lapses; ignored on a revoke. */
|
|
75
|
+
expiresAt?: Date | null;
|
|
76
|
+
}
|
|
77
|
+
/** The clock and the id minter, injected so a test is deterministic. */
|
|
78
|
+
export interface ManualEntitlementOptions {
|
|
79
|
+
/** The write timestamp. Defaults to now. */
|
|
80
|
+
now?: Date;
|
|
81
|
+
/** The id minter for a row that does not exist yet. Defaults to `crypto.randomUUID`. */
|
|
82
|
+
newId?: () => string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Grant an entitlement by hand, and hold it against the projection. Idempotent; overwrites whatever the
|
|
86
|
+
* projection last derived for this key, and survives every later purchase event for it.
|
|
87
|
+
*
|
|
88
|
+
* Refuses a key this project does not define — no product grants it and `manualEntitlements` does not
|
|
89
|
+
* declare it — before any row is written. The config is a parameter rather than a closure because a grant
|
|
90
|
+
* without one is the defect: see the module doc.
|
|
91
|
+
*/
|
|
92
|
+
export declare function grantEntitlement(d1: D1Database, config: PaymentsConfig, input: ManualEntitlementInput, options?: ManualEntitlementOptions): Promise<PaymentsEntitlement>;
|
|
93
|
+
/**
|
|
94
|
+
* Revoke an entitlement by hand and release the hold. Idempotent, and records the decision even where there
|
|
95
|
+
* was nothing to clear. A key the purchases still support is re-derived on the next event — see the module doc.
|
|
96
|
+
*
|
|
97
|
+
* **Takes no config, deliberately.** A revoke of a key the catalog has since dropped must stay legal, or a
|
|
98
|
+
* catalog edit becomes irreversible for every account still holding it. The missing parameter is the rule.
|
|
99
|
+
*/
|
|
100
|
+
export declare function revokeEntitlement(d1: D1Database, input: ManualEntitlementInput, options?: ManualEntitlementOptions): Promise<PaymentsEntitlement>;
|
|
101
|
+
//# sourceMappingURL=manual.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual.d.ts","sourceRoot":"","sources":["../../src/entitlement/manual.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAI/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,sBAAuB,SAAQ,eAAe;IAC7D,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACzB;AAED,wEAAwE;AACxE,MAAM,WAAW,wBAAwB;IACvC,4CAA4C;IAC5C,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,EAAE,EAAE,UAAU,EACd,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,sBAAsB,EAC7B,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,mBAAmB,CAAC,CAY9B;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,sBAAsB,EAC7B,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,mBAAmB,CAAC,CAE9B"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { encodeSubjectReference } from "../data/subject.js";
|
|
2
|
+
import { grantableEntitlements } from "../config/config.js";
|
|
3
|
+
import { PaymentsEntitlement } from "../data/entitlement.js";
|
|
4
|
+
import { PAYMENTS_ENTITLEMENTS_TABLE, paymentsDatabase } from "../data/tables.js";
|
|
5
|
+
import { PaymentsEntitlementNotInCatalogError } from "../error/errors.js";
|
|
6
|
+
import { InternalError } from "@pithy-sh/core/src/error/pithyError";
|
|
7
|
+
import { withD1Retry } from "@pithy-sh/core/src/data/withD1Retry";
|
|
8
|
+
//#region src/entitlement/manual.ts
|
|
9
|
+
/**
|
|
10
|
+
* Grant an entitlement by hand, and hold it against the projection. Idempotent; overwrites whatever the
|
|
11
|
+
* projection last derived for this key, and survives every later purchase event for it.
|
|
12
|
+
*
|
|
13
|
+
* Refuses a key this project does not define — no product grants it and `manualEntitlements` does not
|
|
14
|
+
* declare it — before any row is written. The config is a parameter rather than a closure because a grant
|
|
15
|
+
* without one is the defect: see the module doc.
|
|
16
|
+
*/
|
|
17
|
+
async function grantEntitlement(d1, config, input, options = {}) {
|
|
18
|
+
const grantable = grantableEntitlements(config);
|
|
19
|
+
if (!grantable.has(input.entitlement)) throw new PaymentsEntitlementNotInCatalogError({
|
|
20
|
+
message: `No entitlement "${input.entitlement}" is defined here.`,
|
|
21
|
+
detail: `No product grants "${input.entitlement}" and \`manualEntitlements\` does not declare it. Defined: ${[...grantable].sort().join(", ") || "nothing"}.`
|
|
22
|
+
});
|
|
23
|
+
return writeEntitlement(d1, input, true, options);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Revoke an entitlement by hand and release the hold. Idempotent, and records the decision even where there
|
|
27
|
+
* was nothing to clear. A key the purchases still support is re-derived on the next event — see the module doc.
|
|
28
|
+
*
|
|
29
|
+
* **Takes no config, deliberately.** A revoke of a key the catalog has since dropped must stay legal, or a
|
|
30
|
+
* catalog edit becomes irreversible for every account still holding it. The missing parameter is the rule.
|
|
31
|
+
*/
|
|
32
|
+
function revokeEntitlement(d1, input, options = {}) {
|
|
33
|
+
return writeEntitlement(d1, input, false, options);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The upsert both directions share. One statement, on the `UNIQUE (subjectType, subjectId, entitlement)`
|
|
37
|
+
* conflict target, so a concurrent write cannot produce a second row for one key.
|
|
38
|
+
*
|
|
39
|
+
* The target is all three columns because that is the index the table really has. A two-column target names
|
|
40
|
+
* no unique constraint and SQLite refuses the statement outright — which is the loud failure worth having
|
|
41
|
+
* here, rather than an upsert that quietly inserts a second row per holder and leaves two answers to one
|
|
42
|
+
* gate. The read-back's predicate is the same three columns for the same reason.
|
|
43
|
+
*
|
|
44
|
+
* `sourcePurchaseId` is set to null on both paths, and that is the honest answer: no purchase supports this
|
|
45
|
+
* row. `manual` is the half that differs — set by a grant, cleared by a revoke — and it is what the
|
|
46
|
+
* projection's derivation reads to decide whether the row is its to touch.
|
|
47
|
+
*/
|
|
48
|
+
async function writeEntitlement(d1, input, active, options) {
|
|
49
|
+
const now = options.now ?? /* @__PURE__ */ new Date();
|
|
50
|
+
const newId = options.newId ?? (() => crypto.randomUUID());
|
|
51
|
+
const db = paymentsDatabase(d1);
|
|
52
|
+
const row = PaymentsEntitlement.encode({
|
|
53
|
+
id: newId(),
|
|
54
|
+
subjectType: input.subjectType,
|
|
55
|
+
subjectId: input.subjectId,
|
|
56
|
+
entitlement: input.entitlement,
|
|
57
|
+
active,
|
|
58
|
+
expiresAt: active ? input.expiresAt ?? null : null,
|
|
59
|
+
sourcePurchaseId: null,
|
|
60
|
+
manual: active,
|
|
61
|
+
createdAt: now,
|
|
62
|
+
updatedAt: now
|
|
63
|
+
});
|
|
64
|
+
await withD1Retry(() => db.insertInto(PAYMENTS_ENTITLEMENTS_TABLE).values(row).onConflict((oc) => oc.columns([
|
|
65
|
+
"subjectType",
|
|
66
|
+
"subjectId",
|
|
67
|
+
"entitlement"
|
|
68
|
+
]).doUpdateSet({
|
|
69
|
+
active: row.active,
|
|
70
|
+
expiresAt: row.expiresAt,
|
|
71
|
+
sourcePurchaseId: null,
|
|
72
|
+
manual: row.manual,
|
|
73
|
+
updatedAt: row.updatedAt
|
|
74
|
+
})).execute());
|
|
75
|
+
const written = await db.selectFrom(PAYMENTS_ENTITLEMENTS_TABLE).selectAll().where("subjectType", "=", input.subjectType).where("subjectId", "=", input.subjectId).where("entitlement", "=", input.entitlement).executeTakeFirst();
|
|
76
|
+
if (written === void 0) throw new InternalError({
|
|
77
|
+
message: "The entitlement could not be recorded.",
|
|
78
|
+
action: "Retry. If it persists, check the app database for the pithy_payments_* tables.",
|
|
79
|
+
detail: `Wrote entitlement "${input.entitlement}" for ${encodeSubjectReference(input)} but could not read it back.`
|
|
80
|
+
});
|
|
81
|
+
return PaymentsEntitlement.parse(written);
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { grantEntitlement, revokeEntitlement };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { PithyMiddleware } from "@pithy-sh/core/src/capability/capability";
|
|
2
|
+
import type { EntitlementHolder, EntitlementResolver } from "@pithy-sh/core/src/entitlement/entitlement";
|
|
3
|
+
import { type PaymentsSubject } from "../data/subject";
|
|
4
|
+
import type { PaymentsDatabase } from "../data/tables";
|
|
5
|
+
import { type PaymentsSubjectSeam } from "./subjectSeam";
|
|
6
|
+
/**
|
|
7
|
+
* Payments filling the entitlement seam. Core's default (`noEntitlementProvider`) holds nothing so that an
|
|
8
|
+
* uncomposed gate denies; this replaces it with a resolver over the materialized read model in D1.
|
|
9
|
+
*
|
|
10
|
+
* The name payments answers under. `requireEntitlement()` puts it in `detail` on a denial, which is what
|
|
11
|
+
* lets an operator tell "genuinely unentitled" from "nothing wired" without telling a client either.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PAYMENTS_ENTITLEMENT_PROVIDER = "payments";
|
|
14
|
+
/**
|
|
15
|
+
* How a subject appears in a denial's `detail` and on a denial's audit row — core's {@link EntitlementHolder},
|
|
16
|
+
* which is display text and an audit dimension and **nothing a gate compares**.
|
|
17
|
+
*
|
|
18
|
+
* The label is `encodeSubjectReference`'s form, so the string in a log line is the same string the rails
|
|
19
|
+
* stamp into a store and the same one `pithy payments reconcile --subject` takes. One spelling of a holder
|
|
20
|
+
* across the whole capability means an operator reading a denial can paste it into the support command.
|
|
21
|
+
*
|
|
22
|
+
* **`tenant` is the organization id, or null under per-person billing** — and the null is the honest answer
|
|
23
|
+
* rather than a gap. `AuditEvent.tenant` is the dimension a trail is read by, and a consumer app has no such
|
|
24
|
+
* dimension: the holder is the actor, so a tenant here would echo `actorId` and invent a tenancy the app
|
|
25
|
+
* does not have. Under organization billing it is exactly the value that answers "which of our customers is
|
|
26
|
+
* hitting the paywall", which `actorId` cannot, because one person acts in two organizations.
|
|
27
|
+
*/
|
|
28
|
+
export declare function paymentsEntitlementHolder(subject: PaymentsSubject): EntitlementHolder;
|
|
29
|
+
/**
|
|
30
|
+
* A resolver for one subject, over one database. The whole seam: who is asking is already decided.
|
|
31
|
+
*
|
|
32
|
+
* The subject is the **pair**, never an id — `data/subject.ts` for why both halves travel together. Taking
|
|
33
|
+
* one object rather than two strings is what keeps a caller from transposing them, and what keeps a
|
|
34
|
+
* `subjectType` from config being paired with a `subjectId` from somewhere else.
|
|
35
|
+
*/
|
|
36
|
+
export declare function createPaymentsEntitlementResolver(db: PaymentsDatabase, subject: PaymentsSubject, now?: () => Date): EntitlementResolver;
|
|
37
|
+
/**
|
|
38
|
+
* The middleware that installs the resolver, per request, over `c.var.db.<database>`.
|
|
39
|
+
*
|
|
40
|
+
* **Everything is resolved inside `list()`, not around it, and that is the point.** Middleware order is the
|
|
41
|
+
* adopter's — it follows the order of the `capabilities` array in their `pithy.config.ts` — so this
|
|
42
|
+
* middleware may well run before `@pithy-sh/auth` has set `c.var.auth`. Reading the caller at gate time
|
|
43
|
+
* rather than at install time makes the resolver correct whatever that order is, and it means a request that
|
|
44
|
+
* never gates on an entitlement never builds a Kysely instance or touches D1. The subject seam is resolved
|
|
45
|
+
* on the same schedule and for the same reason: an adopter's resolver reads the session, and the session is
|
|
46
|
+
* only on the request once whichever middleware sets it has run.
|
|
47
|
+
*
|
|
48
|
+
* **The subject is resolved first, before the database is even looked for.** With nobody resolved there is
|
|
49
|
+
* nothing to ask D1, so the binding check below has no business running — an organization-billed Worker
|
|
50
|
+
* whose seam answers nothing must read as unentitled, which is a denial from the gate, and not as broken,
|
|
51
|
+
* which is what a 500 from a wiring check would have said. Unanswered is unentitled: see `subjectSeam.ts`
|
|
52
|
+
* for why that is the only safe direction, and why nothing here falls back to `c.var.auth.userId`.
|
|
53
|
+
*
|
|
54
|
+
* With nobody to resolve for, the resolver holds nothing. It still names payments as the provider, because
|
|
55
|
+
* payments *is* composed — an anonymous caller is a 401 from the gate and an unresolved subject is a 403,
|
|
56
|
+
* neither is a composition problem, and reporting `null` here would send an operator looking for a missing
|
|
57
|
+
* capability.
|
|
58
|
+
*/
|
|
59
|
+
export declare function installEntitlementResolver(database: string, seam: PaymentsSubjectSeam): PithyMiddleware;
|
|
60
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/entitlement/resolver.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,KAAK,EAAe,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEtH,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,KAAK,mBAAmB,EAA0B,MAAM,eAAe,CAAC;AAEjF;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,aAAa,CAAC;AAExD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,eAAe,GAAG,iBAAiB,CAKrF;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAC/C,EAAE,EAAE,gBAAgB,EACpB,OAAO,EAAE,eAAe,EACxB,GAAG,GAAE,MAAM,IAAuB,GACjC,mBAAmB,CAOrB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,GAAG,eAAe,CAyCvG"}
|