@owlmeans/server-payment 0.1.18-rc.8 → 0.1.18
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 +157 -26
- package/agent-meta/manifest.json +30 -4
- package/agent-meta/skills/server-payment/SKILL.md +613 -54
- package/agent-meta/skills/server-payment/parts/reference.md +174 -0
- package/build/access/types.d.ts +46 -0
- package/build/access/types.d.ts.map +1 -0
- package/build/access/types.js +2 -0
- package/build/access/types.js.map +1 -0
- package/build/access.d.ts +6 -0
- package/build/access.d.ts.map +1 -0
- package/build/access.js +45 -0
- package/build/access.js.map +1 -0
- package/build/actions/index.d.ts +1 -0
- package/build/actions/index.d.ts.map +1 -1
- package/build/actions/index.js +1 -0
- package/build/actions/index.js.map +1 -1
- package/build/actions/resync-subscriptions.d.ts +3 -0
- package/build/actions/resync-subscriptions.d.ts.map +1 -0
- package/build/actions/resync-subscriptions.js +7 -0
- package/build/actions/resync-subscriptions.js.map +1 -0
- package/build/actions/resync.d.ts +6 -1
- package/build/actions/resync.d.ts.map +1 -1
- package/build/actions/resync.js +15 -5
- package/build/actions/resync.js.map +1 -1
- package/build/actions/webhook.d.ts +2 -1
- package/build/actions/webhook.d.ts.map +1 -1
- package/build/actions/webhook.js +10 -4
- package/build/actions/webhook.js.map +1 -1
- package/build/bootstrap/types.d.ts +16 -0
- package/build/bootstrap/types.d.ts.map +1 -0
- package/build/bootstrap/types.js +2 -0
- package/build/bootstrap/types.js.map +1 -0
- package/build/bootstrap.d.ts +6 -0
- package/build/bootstrap.d.ts.map +1 -0
- package/build/bootstrap.js +26 -0
- package/build/bootstrap.js.map +1 -0
- package/build/catalogue/types.d.ts +38 -0
- package/build/catalogue/types.d.ts.map +1 -0
- package/build/catalogue/types.js +2 -0
- package/build/catalogue/types.js.map +1 -0
- package/build/catalogue.d.ts +6 -0
- package/build/catalogue.d.ts.map +1 -0
- package/build/catalogue.js +110 -0
- package/build/catalogue.js.map +1 -0
- package/build/commit/types.d.ts +22 -0
- package/build/commit/types.d.ts.map +1 -0
- package/build/commit/types.js +2 -0
- package/build/commit/types.js.map +1 -0
- package/build/commit.d.ts +6 -0
- package/build/commit.d.ts.map +1 -0
- package/build/commit.js +125 -0
- package/build/commit.js.map +1 -0
- package/build/config.d.ts +44 -5
- package/build/config.d.ts.map +1 -1
- package/build/config.js +216 -10
- package/build/config.js.map +1 -1
- package/build/consts.d.ts +74 -16
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +86 -23
- package/build/consts.js.map +1 -1
- package/build/consts.local.d.ts +94 -0
- package/build/consts.local.d.ts.map +1 -0
- package/build/consts.local.js +44 -0
- package/build/consts.local.js.map +1 -0
- package/build/consumer/cancellation/types.d.ts +11 -0
- package/build/consumer/cancellation/types.d.ts.map +1 -0
- package/build/consumer/cancellation/types.js +2 -0
- package/build/consumer/cancellation/types.js.map +1 -0
- package/build/consumer/cancellation.d.ts +6 -0
- package/build/consumer/cancellation.d.ts.map +1 -0
- package/build/consumer/cancellation.js +33 -0
- package/build/consumer/cancellation.js.map +1 -0
- package/build/consumer/capture/types.d.ts +50 -0
- package/build/consumer/capture/types.d.ts.map +1 -0
- package/build/consumer/capture/types.js +2 -0
- package/build/consumer/capture/types.js.map +1 -0
- package/build/consumer/capture.d.ts +6 -0
- package/build/consumer/capture.d.ts.map +1 -0
- package/build/consumer/capture.js +284 -0
- package/build/consumer/capture.js.map +1 -0
- package/build/consumer/consts.local.d.ts +10 -0
- package/build/consumer/consts.local.d.ts.map +1 -0
- package/build/consumer/consts.local.js +11 -0
- package/build/consumer/consts.local.js.map +1 -0
- package/build/consumer/format/types.d.ts +30 -0
- package/build/consumer/format/types.d.ts.map +1 -0
- package/build/consumer/format/types.js +2 -0
- package/build/consumer/format/types.js.map +1 -0
- package/build/consumer/format.d.ts +4 -0
- package/build/consumer/format.d.ts.map +1 -0
- package/build/consumer/format.js +73 -0
- package/build/consumer/format.js.map +1 -0
- package/build/consumer/handlers.d.ts +21 -0
- package/build/consumer/handlers.d.ts.map +1 -0
- package/build/consumer/handlers.js +174 -0
- package/build/consumer/handlers.js.map +1 -0
- package/build/consumer/index.d.ts +10 -0
- package/build/consumer/index.d.ts.map +1 -0
- package/build/consumer/index.js +6 -0
- package/build/consumer/index.js.map +1 -0
- package/build/consumer/mail/types.d.ts +29 -0
- package/build/consumer/mail/types.d.ts.map +1 -0
- package/build/consumer/mail/types.js +2 -0
- package/build/consumer/mail/types.js.map +1 -0
- package/build/consumer/mail.d.ts +6 -0
- package/build/consumer/mail.d.ts.map +1 -0
- package/build/consumer/mail.js +313 -0
- package/build/consumer/mail.js.map +1 -0
- package/build/consumer/observers/types.d.ts +15 -0
- package/build/consumer/observers/types.d.ts.map +1 -0
- package/build/consumer/observers/types.js +2 -0
- package/build/consumer/observers/types.js.map +1 -0
- package/build/consumer/observers.d.ts +6 -0
- package/build/consumer/observers.d.ts.map +1 -0
- package/build/consumer/observers.js +74 -0
- package/build/consumer/observers.js.map +1 -0
- package/build/consumer/origin/types.d.ts +17 -0
- package/build/consumer/origin/types.d.ts.map +1 -0
- package/build/consumer/origin/types.js +2 -0
- package/build/consumer/origin/types.js.map +1 -0
- package/build/consumer/origin.d.ts +8 -0
- package/build/consumer/origin.d.ts.map +1 -0
- package/build/consumer/origin.js +43 -0
- package/build/consumer/origin.js.map +1 -0
- package/build/consumer/reconcile/types.d.ts +13 -0
- package/build/consumer/reconcile/types.d.ts.map +1 -0
- package/build/consumer/reconcile/types.js +2 -0
- package/build/consumer/reconcile/types.js.map +1 -0
- package/build/consumer/reconcile.d.ts +5 -0
- package/build/consumer/reconcile.d.ts.map +1 -0
- package/build/consumer/reconcile.js +320 -0
- package/build/consumer/reconcile.js.map +1 -0
- package/build/consumer/records/types.d.ts +66 -0
- package/build/consumer/records/types.d.ts.map +1 -0
- package/build/consumer/records/types.js +2 -0
- package/build/consumer/records/types.js.map +1 -0
- package/build/consumer/records.d.ts +6 -0
- package/build/consumer/records.d.ts.map +1 -0
- package/build/consumer/records.js +243 -0
- package/build/consumer/records.js.map +1 -0
- package/build/consumer/service.d.ts +28 -0
- package/build/consumer/service.d.ts.map +1 -0
- package/build/consumer/service.js +706 -0
- package/build/consumer/service.js.map +1 -0
- package/build/consumer/types.d.ts +84 -0
- package/build/consumer/types.d.ts.map +1 -0
- package/build/consumer/types.js +2 -0
- package/build/consumer/types.js.map +1 -0
- package/build/consumer/types.local.d.ts +26 -0
- package/build/consumer/types.local.d.ts.map +1 -0
- package/build/consumer/types.local.js +2 -0
- package/build/consumer/types.local.js.map +1 -0
- package/build/consumer/withdrawal/types.d.ts +36 -0
- package/build/consumer/withdrawal/types.d.ts.map +1 -0
- package/build/consumer/withdrawal/types.js +2 -0
- package/build/consumer/withdrawal/types.js.map +1 -0
- package/build/consumer/withdrawal.d.ts +6 -0
- package/build/consumer/withdrawal.d.ts.map +1 -0
- package/build/consumer/withdrawal.js +237 -0
- package/build/consumer/withdrawal.js.map +1 -0
- package/build/entitlement.d.ts +4 -0
- package/build/entitlement.d.ts.map +1 -0
- package/build/entitlement.js +72 -0
- package/build/entitlement.js.map +1 -0
- package/build/entrypoints.d.ts +19 -2
- package/build/entrypoints.d.ts.map +1 -1
- package/build/entrypoints.js +16 -4
- package/build/entrypoints.js.map +1 -1
- package/build/gate/request.d.ts +4 -0
- package/build/gate/request.d.ts.map +1 -0
- package/build/gate/request.js +17 -0
- package/build/gate/request.js.map +1 -0
- package/build/gate/types.d.ts +15 -0
- package/build/gate/types.d.ts.map +1 -0
- package/build/gate/types.js +2 -0
- package/build/gate/types.js.map +1 -0
- package/build/gate.d.ts +13 -9
- package/build/gate.d.ts.map +1 -1
- package/build/gate.js +36 -21
- package/build/gate.js.map +1 -1
- package/build/index.d.ts +50 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +29 -3
- package/build/index.js.map +1 -1
- package/build/limit.d.ts +11 -0
- package/build/limit.d.ts.map +1 -0
- package/build/limit.js +48 -0
- package/build/limit.js.map +1 -0
- package/build/log.d.ts +3 -0
- package/build/log.d.ts.map +1 -0
- package/build/log.js +4 -0
- package/build/log.js.map +1 -0
- package/build/models/declarations/types.d.ts +22 -0
- package/build/models/declarations/types.d.ts.map +1 -0
- package/build/models/declarations/types.js +2 -0
- package/build/models/declarations/types.js.map +1 -0
- package/build/models/declarations.d.ts +4 -0
- package/build/models/declarations.d.ts.map +1 -0
- package/build/models/declarations.js +26 -0
- package/build/models/declarations.js.map +1 -0
- package/build/models/purchase/types.d.ts +13 -0
- package/build/models/purchase/types.d.ts.map +1 -0
- package/build/models/purchase/types.js +2 -0
- package/build/models/purchase/types.js.map +1 -0
- package/build/models/purchase.d.ts +4 -0
- package/build/models/purchase.d.ts.map +1 -0
- package/build/models/purchase.js +37 -0
- package/build/models/purchase.js.map +1 -0
- package/build/observer.d.ts +9 -0
- package/build/observer.d.ts.map +1 -1
- package/build/observer.js +38 -12
- package/build/observer.js.map +1 -1
- package/build/plan/types.d.ts +21 -0
- package/build/plan/types.d.ts.map +1 -0
- package/build/plan/types.js +2 -0
- package/build/plan/types.js.map +1 -0
- package/build/plan.d.ts +7 -0
- package/build/plan.d.ts.map +1 -0
- package/build/plan.js +29 -0
- package/build/plan.js.map +1 -0
- package/build/plugins/checkout-plugins/types.d.ts +25 -0
- package/build/plugins/checkout-plugins/types.d.ts.map +1 -0
- package/build/plugins/checkout-plugins/types.js +2 -0
- package/build/plugins/checkout-plugins/types.js.map +1 -0
- package/build/plugins/checkout-plugins.d.ts +12 -0
- package/build/plugins/checkout-plugins.d.ts.map +1 -0
- package/build/plugins/checkout-plugins.js +72 -0
- package/build/plugins/checkout-plugins.js.map +1 -0
- package/build/plugins/checkout-policy/types.d.ts +18 -0
- package/build/plugins/checkout-policy/types.d.ts.map +1 -0
- package/build/plugins/checkout-policy/types.js +2 -0
- package/build/plugins/checkout-policy/types.js.map +1 -0
- package/build/plugins/checkout-policy.d.ts +4 -0
- package/build/plugins/checkout-policy.d.ts.map +1 -0
- package/build/plugins/checkout-policy.js +26 -0
- package/build/plugins/checkout-policy.js.map +1 -0
- package/build/plugins/checkout-registry/types.d.ts +7 -0
- package/build/plugins/checkout-registry/types.d.ts.map +1 -0
- package/build/plugins/checkout-registry/types.js +2 -0
- package/build/plugins/checkout-registry/types.js.map +1 -0
- package/build/plugins/checkout-registry.d.ts +8 -0
- package/build/plugins/checkout-registry.d.ts.map +1 -0
- package/build/plugins/checkout-registry.js +21 -0
- package/build/plugins/checkout-registry.js.map +1 -0
- package/build/plugins/consts.local.d.ts +13 -0
- package/build/plugins/consts.local.d.ts.map +1 -0
- package/build/plugins/consts.local.js +22 -0
- package/build/plugins/consts.local.js.map +1 -0
- package/build/plugins/customer-lock/types.d.ts +6 -0
- package/build/plugins/customer-lock/types.d.ts.map +1 -0
- package/build/plugins/customer-lock/types.js +2 -0
- package/build/plugins/customer-lock/types.js.map +1 -0
- package/build/plugins/customer-lock.d.ts +5 -0
- package/build/plugins/customer-lock.d.ts.map +1 -0
- package/build/plugins/customer-lock.js +22 -0
- package/build/plugins/customer-lock.js.map +1 -0
- package/build/plugins/estimate/cache.d.ts +4 -0
- package/build/plugins/estimate/cache.d.ts.map +1 -0
- package/build/plugins/estimate/cache.js +7 -0
- package/build/plugins/estimate/cache.js.map +1 -0
- package/build/plugins/estimate/types.d.ts +27 -0
- package/build/plugins/estimate/types.d.ts.map +1 -0
- package/build/plugins/estimate/types.js +2 -0
- package/build/plugins/estimate/types.js.map +1 -0
- package/build/plugins/estimate.d.ts +6 -0
- package/build/plugins/estimate.d.ts.map +1 -0
- package/build/plugins/estimate.js +271 -0
- package/build/plugins/estimate.js.map +1 -0
- package/build/plugins/events/types.d.ts +12 -0
- package/build/plugins/events/types.d.ts.map +1 -0
- package/build/plugins/events/types.js +2 -0
- package/build/plugins/events/types.js.map +1 -0
- package/build/plugins/events.d.ts +6 -13
- package/build/plugins/events.d.ts.map +1 -1
- package/build/plugins/events.js +441 -144
- package/build/plugins/events.js.map +1 -1
- package/build/plugins/fx/types.d.ts +33 -0
- package/build/plugins/fx/types.d.ts.map +1 -0
- package/build/plugins/fx/types.js +2 -0
- package/build/plugins/fx/types.js.map +1 -0
- package/build/plugins/fx.d.ts +6 -0
- package/build/plugins/fx.d.ts.map +1 -0
- package/build/plugins/fx.js +83 -0
- package/build/plugins/fx.js.map +1 -0
- package/build/plugins/portal/types.d.ts +44 -0
- package/build/plugins/portal/types.d.ts.map +1 -0
- package/build/plugins/portal/types.js +2 -0
- package/build/plugins/portal/types.js.map +1 -0
- package/build/plugins/portal.d.ts +6 -0
- package/build/plugins/portal.d.ts.map +1 -0
- package/build/plugins/portal.js +255 -0
- package/build/plugins/portal.js.map +1 -0
- package/build/plugins/refunds/types.d.ts +35 -0
- package/build/plugins/refunds/types.d.ts.map +1 -0
- package/build/plugins/refunds/types.js +2 -0
- package/build/plugins/refunds/types.js.map +1 -0
- package/build/plugins/refunds.d.ts +6 -0
- package/build/plugins/refunds.d.ts.map +1 -0
- package/build/plugins/refunds.js +81 -0
- package/build/plugins/refunds.js.map +1 -0
- package/build/plugins/session/types.d.ts +32 -0
- package/build/plugins/session/types.d.ts.map +1 -0
- package/build/plugins/session/types.js +2 -0
- package/build/plugins/session/types.js.map +1 -0
- package/build/plugins/session.d.ts +4 -0
- package/build/plugins/session.d.ts.map +1 -0
- package/build/plugins/session.js +58 -0
- package/build/plugins/session.js.map +1 -0
- package/build/plugins/status.d.ts +8 -0
- package/build/plugins/status.d.ts.map +1 -0
- package/build/plugins/status.js +21 -0
- package/build/plugins/status.js.map +1 -0
- package/build/plugins/stripe/types.d.ts +20 -0
- package/build/plugins/stripe/types.d.ts.map +1 -0
- package/build/plugins/stripe/types.js +2 -0
- package/build/plugins/stripe/types.js.map +1 -0
- package/build/plugins/stripe.d.ts +5 -13
- package/build/plugins/stripe.d.ts.map +1 -1
- package/build/plugins/stripe.js +481 -129
- package/build/plugins/stripe.js.map +1 -1
- package/build/plugins/subscriptions/types.d.ts +41 -0
- package/build/plugins/subscriptions/types.d.ts.map +1 -0
- package/build/plugins/subscriptions/types.js +2 -0
- package/build/plugins/subscriptions/types.js.map +1 -0
- package/build/plugins/subscriptions.d.ts +6 -0
- package/build/plugins/subscriptions.d.ts.map +1 -0
- package/build/plugins/subscriptions.js +169 -0
- package/build/plugins/subscriptions.js.map +1 -0
- package/build/plugins/types.d.ts +7 -0
- package/build/plugins/types.d.ts.map +1 -0
- package/build/plugins/types.js +2 -0
- package/build/plugins/types.js.map +1 -0
- package/build/plugins/types.local.d.ts +75 -0
- package/build/plugins/types.local.d.ts.map +1 -0
- package/build/plugins/types.local.js +2 -0
- package/build/plugins/types.local.js.map +1 -0
- package/build/plugins/webhook-manager/types.d.ts +62 -0
- package/build/plugins/webhook-manager/types.d.ts.map +1 -0
- package/build/plugins/webhook-manager/types.js +2 -0
- package/build/plugins/webhook-manager/types.js.map +1 -0
- package/build/plugins/webhook-manager.d.ts +8 -0
- package/build/plugins/webhook-manager.d.ts.map +1 -0
- package/build/plugins/webhook-manager.js +245 -0
- package/build/plugins/webhook-manager.js.map +1 -0
- package/build/protocol.d.ts +13 -0
- package/build/protocol.d.ts.map +1 -0
- package/build/protocol.js +17 -0
- package/build/protocol.js.map +1 -0
- package/build/reconcile/types.d.ts +17 -0
- package/build/reconcile/types.d.ts.map +1 -0
- package/build/reconcile/types.js +2 -0
- package/build/reconcile/types.js.map +1 -0
- package/build/reconcile.d.ts +12 -0
- package/build/reconcile.d.ts.map +1 -0
- package/build/reconcile.js +91 -0
- package/build/reconcile.js.map +1 -0
- package/build/resource.d.ts +12 -1
- package/build/resource.d.ts.map +1 -1
- package/build/resource.js +97 -6
- package/build/resource.js.map +1 -1
- package/build/schemas.d.ts +19 -0
- package/build/schemas.d.ts.map +1 -0
- package/build/schemas.js +244 -0
- package/build/schemas.js.map +1 -0
- package/build/service.d.ts +28 -3
- package/build/service.d.ts.map +1 -1
- package/build/service.js +140 -19
- package/build/service.js.map +1 -1
- package/build/subscription/types.d.ts +21 -0
- package/build/subscription/types.d.ts.map +1 -0
- package/build/subscription/types.js +2 -0
- package/build/subscription/types.js.map +1 -0
- package/build/subscription.d.ts +4 -0
- package/build/subscription.d.ts.map +1 -0
- package/build/subscription.js +84 -0
- package/build/subscription.js.map +1 -0
- package/build/sync/types.d.ts +25 -0
- package/build/sync/types.d.ts.map +1 -0
- package/build/sync/types.js +2 -0
- package/build/sync/types.js.map +1 -0
- package/build/sync.d.ts +4 -3
- package/build/sync.d.ts.map +1 -1
- package/build/sync.js +231 -79
- package/build/sync.js.map +1 -1
- package/build/types.d.ts +1258 -36
- package/build/types.d.ts.map +1 -1
- package/build/types.local.d.ts +22 -0
- package/build/types.local.d.ts.map +1 -0
- package/build/types.local.js +2 -0
- package/build/types.local.js.map +1 -0
- package/build/usage/types.d.ts +56 -0
- package/build/usage/types.d.ts.map +1 -0
- package/build/usage/types.js +2 -0
- package/build/usage/types.js.map +1 -0
- package/build/usage.d.ts +6 -0
- package/build/usage.d.ts.map +1 -0
- package/build/usage.js +365 -0
- package/build/usage.js.map +1 -0
- package/build/utils/types.d.ts +31 -0
- package/build/utils/types.d.ts.map +1 -0
- package/build/utils/types.js +2 -0
- package/build/utils/types.js.map +1 -0
- package/build/utils.d.ts +21 -7
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +56 -17
- package/build/utils.js.map +1 -1
- package/package.json +22 -17
- package/src/access/types.ts +52 -0
- package/src/access.ts +86 -0
- package/src/actions/index.ts +1 -0
- package/src/actions/resync-subscriptions.ts +10 -0
- package/src/actions/resync.ts +14 -5
- package/src/actions/webhook.ts +9 -4
- package/src/bootstrap/types.ts +16 -0
- package/src/bootstrap.ts +31 -0
- package/src/catalogue/types.ts +32 -0
- package/src/catalogue.ts +135 -0
- package/src/commit/types.ts +27 -0
- package/src/commit.ts +152 -0
- package/src/config.ts +234 -14
- package/src/consts.local.ts +62 -0
- package/src/consts.ts +100 -36
- package/src/consumer/cancellation/types.ts +13 -0
- package/src/consumer/cancellation.ts +43 -0
- package/src/consumer/capture/types.ts +53 -0
- package/src/consumer/capture.ts +321 -0
- package/src/consumer/consts.local.ts +18 -0
- package/src/consumer/format/types.ts +29 -0
- package/src/consumer/format.ts +85 -0
- package/src/consumer/handlers.ts +204 -0
- package/src/consumer/index.ts +9 -0
- package/src/consumer/mail/types.ts +31 -0
- package/src/consumer/mail.ts +353 -0
- package/src/consumer/observers/types.ts +22 -0
- package/src/consumer/observers.ts +97 -0
- package/src/consumer/origin/types.ts +17 -0
- package/src/consumer/origin.ts +61 -0
- package/src/consumer/reconcile/types.ts +13 -0
- package/src/consumer/reconcile.ts +330 -0
- package/src/consumer/records/types.ts +64 -0
- package/src/consumer/records.ts +288 -0
- package/src/consumer/service.ts +768 -0
- package/src/consumer/types.local.ts +22 -0
- package/src/consumer/types.ts +96 -0
- package/src/consumer/withdrawal/types.ts +37 -0
- package/src/consumer/withdrawal.ts +268 -0
- package/src/entitlement.ts +85 -0
- package/src/entrypoints.ts +17 -4
- package/src/gate/request.ts +24 -0
- package/src/gate/types.ts +13 -0
- package/src/gate.ts +47 -30
- package/src/index.ts +55 -3
- package/src/limit.ts +54 -0
- package/src/log.ts +4 -0
- package/src/models/declarations/types.ts +22 -0
- package/src/models/declarations.ts +30 -0
- package/src/models/purchase/types.ts +13 -0
- package/src/models/purchase.ts +43 -0
- package/src/observer.ts +44 -11
- package/src/plan/types.ts +21 -0
- package/src/plan.ts +46 -0
- package/src/plugins/checkout-plugins/types.ts +25 -0
- package/src/plugins/checkout-plugins.ts +90 -0
- package/src/plugins/checkout-policy/types.ts +18 -0
- package/src/plugins/checkout-policy.ts +34 -0
- package/src/plugins/checkout-registry/types.ts +7 -0
- package/src/plugins/checkout-registry.ts +23 -0
- package/src/plugins/consts.local.ts +30 -0
- package/src/plugins/customer-lock/types.ts +5 -0
- package/src/plugins/customer-lock.ts +25 -0
- package/src/plugins/estimate/cache.ts +12 -0
- package/src/plugins/estimate/types.ts +28 -0
- package/src/plugins/estimate.ts +305 -0
- package/src/plugins/events/types.ts +11 -0
- package/src/plugins/events.ts +466 -132
- package/src/plugins/fx/types.ts +40 -0
- package/src/plugins/fx.ts +101 -0
- package/src/plugins/portal/types.ts +45 -0
- package/src/plugins/portal.ts +284 -0
- package/src/plugins/refunds/types.ts +31 -0
- package/src/plugins/refunds.ts +95 -0
- package/src/plugins/session/types.ts +28 -0
- package/src/plugins/session.ts +73 -0
- package/src/plugins/status.ts +22 -0
- package/src/plugins/stripe/types.ts +20 -0
- package/src/plugins/stripe.ts +523 -135
- package/src/plugins/subscriptions/types.ts +39 -0
- package/src/plugins/subscriptions.ts +195 -0
- package/src/plugins/types.local.ts +61 -0
- package/src/plugins/types.ts +7 -0
- package/src/plugins/webhook-manager/types.ts +63 -0
- package/src/plugins/webhook-manager.ts +288 -0
- package/src/protocol.ts +29 -0
- package/src/reconcile/types.ts +17 -0
- package/src/reconcile.ts +110 -0
- package/src/resource.ts +158 -11
- package/src/schemas.ts +271 -0
- package/src/service.ts +161 -19
- package/src/subscription/types.ts +23 -0
- package/src/subscription.ts +104 -0
- package/src/sync/types.ts +25 -0
- package/src/sync.ts +255 -72
- package/src/types.local.ts +18 -0
- package/src/types.ts +1365 -32
- package/src/usage/types.ts +51 -0
- package/src/usage.ts +432 -0
- package/src/utils/types.ts +30 -0
- package/src/utils.ts +94 -29
- package/tests/checkout-consumer.spec.ts +366 -0
- package/tests/checkout-locks.spec.ts +161 -0
- package/tests/checkout-plugins.spec.ts +164 -0
- package/tests/checkout.spec.ts +209 -93
- package/tests/consumer-events.spec.ts +215 -0
- package/tests/consumer-fixtures.ts +134 -0
- package/tests/consumer-ops.spec.ts +350 -0
- package/tests/consumer-rights.integration.spec.ts +147 -0
- package/tests/consumer-rights.spec.ts +572 -0
- package/tests/context.ts +110 -0
- package/tests/entitlement.spec.ts +139 -0
- package/tests/estimate.spec.ts +350 -0
- package/tests/events.spec.ts +357 -0
- package/tests/fake-stripe.ts +981 -0
- package/tests/gate-handlers.spec.ts +120 -0
- package/tests/gate.spec.ts +63 -72
- package/tests/gateway-options.spec.ts +180 -0
- package/tests/limit-gate.spec.ts +66 -0
- package/tests/portal.spec.ts +202 -0
- package/tests/protocol.spec.ts +17 -3
- package/tests/sync.spec.ts +114 -0
- package/tests/usage.integration.spec.ts +133 -0
- package/tests/usage.spec.ts +169 -0
- package/tests/webhook-manager.spec.ts +149 -0
- package/build/model.d.ts +0 -6
- package/build/model.d.ts.map +0 -1
- package/build/model.js +0 -33
- package/build/model.js.map +0 -1
- package/src/model.ts +0 -37
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { ConsentKind, CONSUMER_RIGHTS_COPY_VERSION, PurchaseKind, consumerRegionHelper, withdrawalDeadlineHelper } from '@owlmeans/payment';
|
|
2
|
+
import { memoHelper } from '@owlmeans/context';
|
|
3
|
+
import { STRIPE_PAYGATE_ALIAS } from '../consts.js';
|
|
4
|
+
import { log } from '../log.js';
|
|
5
|
+
import { paymentAccessOf } from '../access.js';
|
|
6
|
+
import { paymentUtils } from '../utils.js';
|
|
7
|
+
import { consumerRecordsOf } from './records.js';
|
|
8
|
+
import { consumerMailOf } from './mail.js';
|
|
9
|
+
const deadlineOf = (policy, scoped, purchasedAt) => scoped ? withdrawalDeadlineHelper.withdrawalDeadlineOf(purchasedAt, policy) : undefined;
|
|
10
|
+
export const makeCaptureHelper = (ctx) => {
|
|
11
|
+
const access = paymentAccessOf(ctx);
|
|
12
|
+
const records = consumerRecordsOf(ctx);
|
|
13
|
+
const sessionEvidenceOf = (session) => {
|
|
14
|
+
const details = session.customer_details;
|
|
15
|
+
const presentment = session.presentment_details;
|
|
16
|
+
const subtotal = session.amount_subtotal ?? 0;
|
|
17
|
+
const tax = session.total_details?.amount_tax ?? 0;
|
|
18
|
+
return paymentUtils.compact({
|
|
19
|
+
country: details?.address?.country?.toUpperCase() ?? undefined,
|
|
20
|
+
email: details?.email ?? undefined,
|
|
21
|
+
name: details?.name ?? undefined,
|
|
22
|
+
business: (details?.tax_ids?.length ?? 0) > 0 || details?.tax_exempt === 'reverse' ? true : undefined,
|
|
23
|
+
currency: (session.currency ?? '').toLowerCase(),
|
|
24
|
+
subtotalMinor: subtotal,
|
|
25
|
+
taxMinor: tax,
|
|
26
|
+
totalMinor: session.amount_total ?? subtotal + tax,
|
|
27
|
+
presentmentCurrency: presentment?.presentment_currency?.toLowerCase(),
|
|
28
|
+
presentmentAmountMinor: presentment?.presentment_amount,
|
|
29
|
+
termsAccepted: session.consent?.terms_of_service === 'accepted' ? true
|
|
30
|
+
: session.consent?.terms_of_service != null ? false : undefined,
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const invoiceEvidenceOf = async (stripe, invoiceId) => {
|
|
34
|
+
if (stripe == null || invoiceId == null) {
|
|
35
|
+
return {};
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
const invoice = await stripe.invoices.retrieve(invoiceId);
|
|
39
|
+
const typed = invoice;
|
|
40
|
+
return paymentUtils.compact({
|
|
41
|
+
invoiceNumber: invoice.number ?? undefined,
|
|
42
|
+
invoiceLineId: invoice.lines?.data?.[0]?.id,
|
|
43
|
+
paymentIntentId: paymentUtils.idOf(typed.payment_intent),
|
|
44
|
+
country: invoice.customer_address?.country?.toUpperCase() ?? undefined,
|
|
45
|
+
subtotalMinor: invoice.subtotal ?? undefined,
|
|
46
|
+
taxMinor: typed.tax ?? undefined,
|
|
47
|
+
totalMinor: invoice.total ?? undefined,
|
|
48
|
+
currency: invoice.currency ?? undefined,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
if (!paymentUtils.isMissingObject(error)) {
|
|
53
|
+
log.warn('Invoice unreadable for its purchase', { invoiceId, error });
|
|
54
|
+
}
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Lock the entity's billing country from a completed checkout, when the policy locks countries: the
|
|
60
|
+
* buyer's address at Stripe, else the declared country — the pinned one first when the session held
|
|
61
|
+
* it (`countryPinned`: tax was calculated on it, the card form's country moved nothing).
|
|
62
|
+
*/
|
|
63
|
+
const lockFromSession = async (policy, entityId, session, evidence) => {
|
|
64
|
+
const metadata = session.metadata ?? {};
|
|
65
|
+
const country = metadata.countryPinned === 'true'
|
|
66
|
+
? metadata.country ?? evidence.country
|
|
67
|
+
: evidence.country ?? metadata.country;
|
|
68
|
+
if (!policy.mechanisms.countryLock || country == null || country === '') {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
const { record } = await records.lockProfile(policy, {
|
|
72
|
+
entityId, country, source: 'checkout', customerId: paymentUtils.idOf(session.customer), sessionId: session.id,
|
|
73
|
+
ipCountry: metadata.ipCountry, email: evidence.email, name: evidence.name, business: evidence.business,
|
|
74
|
+
currency: evidence.currency, language: metadata.language,
|
|
75
|
+
});
|
|
76
|
+
return record;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Mail the purchase confirmation once per purchase: only the delivery that claims the purchase's
|
|
80
|
+
* `confirmationMailAt` (a conditional write — concurrent deliveries in several processes, a
|
|
81
|
+
* redelivery, the checkout refining a subscription) sends it; one that failed is retried by
|
|
82
|
+
* `reconcile`, never here. A purchase mailed before the claim existed is recognised by its event.
|
|
83
|
+
*/
|
|
84
|
+
const confirmPurchase = async (policy, purchase) => {
|
|
85
|
+
if (!policy.mechanisms.purchaseConfirmation || !purchase.inScope) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (await records.hasEvent(purchase.purchaseId, 'mail', 'purchase')) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const claimed = await paymentUtils.conditionalSet(access.purchases(), { purchaseId: purchase.purchaseId, confirmationMailAt: null }, {
|
|
92
|
+
confirmationMailAt: new Date(),
|
|
93
|
+
});
|
|
94
|
+
if (!claimed) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
await consumerMailOf(ctx).sendConsumerMail(policy, 'purchase', purchase.purchaseId);
|
|
98
|
+
};
|
|
99
|
+
const capturePaymentPurchase = async (stripe, session, extra = {}, opts = {}) => {
|
|
100
|
+
const policy = await access.payment().consumerRightsPolicy();
|
|
101
|
+
if (policy == null) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
const metadata = session.metadata ?? {};
|
|
105
|
+
const entityId = metadata.entityId;
|
|
106
|
+
if (entityId == null || metadata.productSku == null) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
const evidence = sessionEvidenceOf(session);
|
|
110
|
+
const profile = await lockFromSession(policy, entityId, session, evidence);
|
|
111
|
+
const existing = await access.purchases().byPurchaseId(records.purchaseIdOf(session.id));
|
|
112
|
+
if (existing != null) {
|
|
113
|
+
if (opts.mail !== false)
|
|
114
|
+
await confirmPurchase(policy, existing);
|
|
115
|
+
return { purchase: existing, created: false };
|
|
116
|
+
}
|
|
117
|
+
const country = evidence.country ?? metadata.country ?? profile?.country;
|
|
118
|
+
const region = consumerRegionHelper.regionOf(country, policy);
|
|
119
|
+
// Protected when either the buyer's own address or the organization's locked country is in scope.
|
|
120
|
+
const scoped = consumerRegionHelper.inScope(region, country, policy) || (profile != null && consumerRegionHelper.inScope(profile.region, profile.country, policy));
|
|
121
|
+
const invoice = await invoiceEvidenceOf(stripe, paymentUtils.idOf(session.invoice));
|
|
122
|
+
const purchasedAt = extra.at ?? new Date();
|
|
123
|
+
const draft = paymentUtils.compact({
|
|
124
|
+
purchaseId: records.purchaseIdOf(session.id),
|
|
125
|
+
entityId,
|
|
126
|
+
kind: PurchaseKind.TopUp,
|
|
127
|
+
paygate: STRIPE_PAYGATE_ALIAS,
|
|
128
|
+
sessionId: session.id,
|
|
129
|
+
paymentIntentId: paymentUtils.idOf(session.payment_intent) ?? invoice.paymentIntentId,
|
|
130
|
+
invoiceId: paymentUtils.idOf(session.invoice),
|
|
131
|
+
invoiceNumber: invoice.invoiceNumber,
|
|
132
|
+
invoiceLineId: invoice.invoiceLineId,
|
|
133
|
+
productSku: metadata.productSku,
|
|
134
|
+
planSku: metadata.planSku,
|
|
135
|
+
profileId: metadata.profileId,
|
|
136
|
+
country,
|
|
137
|
+
region: region ?? undefined,
|
|
138
|
+
ipCountry: metadata.ipCountry,
|
|
139
|
+
inScope: scoped,
|
|
140
|
+
language: profile?.language ?? metadata.language ?? consumerRegionHelper.billingLanguageOf(country, policy),
|
|
141
|
+
email: evidence.email,
|
|
142
|
+
name: evidence.name,
|
|
143
|
+
business: evidence.business,
|
|
144
|
+
currency: evidence.currency,
|
|
145
|
+
amountSubtotalMinor: evidence.subtotalMinor,
|
|
146
|
+
amountTaxMinor: evidence.taxMinor,
|
|
147
|
+
amountTotalMinor: evidence.totalMinor,
|
|
148
|
+
presentmentCurrency: evidence.presentmentCurrency,
|
|
149
|
+
presentmentAmountMinor: evidence.presentmentAmountMinor,
|
|
150
|
+
netAmountMinor: extra.netAmountMinor,
|
|
151
|
+
amountCurrency: extra.amountCurrency,
|
|
152
|
+
units: extra.units,
|
|
153
|
+
taxBehavior: extra.taxBehavior,
|
|
154
|
+
termsAccepted: evidence.termsAccepted,
|
|
155
|
+
textVersion: metadata.termsVersion ?? policy.textVersion,
|
|
156
|
+
copyVersion: metadata.copyVersion ?? CONSUMER_RIGHTS_COPY_VERSION,
|
|
157
|
+
purchasedAt,
|
|
158
|
+
deadline: deadlineOf(policy, scoped, purchasedAt),
|
|
159
|
+
});
|
|
160
|
+
const { record, created } = await records.createPurchase(draft);
|
|
161
|
+
if (opts.mail !== false)
|
|
162
|
+
await confirmPurchase(policy, record);
|
|
163
|
+
return { purchase: record, created };
|
|
164
|
+
};
|
|
165
|
+
/** The start request a subscription's metadata names, when it is a real start request of that entity. */
|
|
166
|
+
const startRequestOf = async (entityId, id) => {
|
|
167
|
+
if (id == null || id === '') {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
const consent = await access.consumerConsents().load(id).catch(() => null);
|
|
171
|
+
return consent != null && consent.kind === ConsentKind.SubscriptionStart && consent.entityId === entityId ? consent : null;
|
|
172
|
+
};
|
|
173
|
+
const captureSubscriptionPurchase = async (stripe, subscription, row) => {
|
|
174
|
+
const policy = await access.payment().consumerRightsPolicy();
|
|
175
|
+
if (policy == null) {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
const purchaseId = records.purchaseIdOf(subscription.id);
|
|
179
|
+
const existing = await access.purchases().byPurchaseId(purchaseId);
|
|
180
|
+
if (existing != null) {
|
|
181
|
+
return { purchase: existing, created: false };
|
|
182
|
+
}
|
|
183
|
+
const metadata = subscription.metadata ?? {};
|
|
184
|
+
const item = subscription.items?.data?.[0];
|
|
185
|
+
const invoiceId = paymentUtils.idOf(subscription.latest_invoice);
|
|
186
|
+
const invoice = await invoiceEvidenceOf(stripe, invoiceId);
|
|
187
|
+
const profile = await access.billingProfiles().byEntity(row.entityId);
|
|
188
|
+
const country = invoice.country ?? profile?.country ?? metadata.country;
|
|
189
|
+
const region = consumerRegionHelper.regionOf(country, policy);
|
|
190
|
+
const scoped = consumerRegionHelper.inScope(region, country, policy) || (profile != null && consumerRegionHelper.inScope(profile.region, profile.country, policy));
|
|
191
|
+
const start = await startRequestOf(row.entityId, metadata.startRequestId);
|
|
192
|
+
const subtotal = invoice.subtotalMinor ?? (item?.price?.unit_amount ?? 0) * (item?.quantity ?? 1);
|
|
193
|
+
const tax = invoice.taxMinor ?? 0;
|
|
194
|
+
const purchasedAt = paymentUtils.dateOf(subscription.created) ?? new Date();
|
|
195
|
+
const draft = paymentUtils.compact({
|
|
196
|
+
purchaseId,
|
|
197
|
+
entityId: row.entityId,
|
|
198
|
+
kind: PurchaseKind.Subscription,
|
|
199
|
+
paygate: STRIPE_PAYGATE_ALIAS,
|
|
200
|
+
subscriptionId: subscription.id,
|
|
201
|
+
paymentIntentId: invoice.paymentIntentId,
|
|
202
|
+
invoiceId,
|
|
203
|
+
invoiceNumber: invoice.invoiceNumber,
|
|
204
|
+
invoiceLineId: invoice.invoiceLineId,
|
|
205
|
+
productSku: row.productSku,
|
|
206
|
+
planSku: row.planSku,
|
|
207
|
+
profileId: metadata.profileId,
|
|
208
|
+
country,
|
|
209
|
+
region: region ?? undefined,
|
|
210
|
+
ipCountry: metadata.ipCountry,
|
|
211
|
+
inScope: scoped,
|
|
212
|
+
language: profile?.language ?? metadata.language ?? consumerRegionHelper.billingLanguageOf(country, policy),
|
|
213
|
+
currency: (invoice.currency ?? subscription.currency ?? item?.price?.currency ?? 'usd').toLowerCase(),
|
|
214
|
+
amountSubtotalMinor: subtotal,
|
|
215
|
+
amountTaxMinor: tax,
|
|
216
|
+
amountTotalMinor: invoice.totalMinor ?? subtotal + tax,
|
|
217
|
+
taxBehavior: item?.price?.tax_behavior ?? undefined,
|
|
218
|
+
textVersion: metadata.termsVersion ?? policy.textVersion,
|
|
219
|
+
copyVersion: metadata.copyVersion ?? CONSUMER_RIGHTS_COPY_VERSION,
|
|
220
|
+
startRequestId: start?.id,
|
|
221
|
+
servicesStartedAt: start?.decidedAt,
|
|
222
|
+
consentId: start?.id,
|
|
223
|
+
consentedAt: start?.decidedAt,
|
|
224
|
+
purchasedAt,
|
|
225
|
+
deadline: deadlineOf(policy, scoped, purchasedAt),
|
|
226
|
+
});
|
|
227
|
+
const { record, created } = await records.createPurchase(draft);
|
|
228
|
+
return { purchase: record, created };
|
|
229
|
+
};
|
|
230
|
+
const completeSubscriptionPurchase = async (stripe, session, purchase, opts = {}) => {
|
|
231
|
+
const policy = await access.payment().consumerRightsPolicy();
|
|
232
|
+
if (policy == null) {
|
|
233
|
+
return purchase;
|
|
234
|
+
}
|
|
235
|
+
const evidence = sessionEvidenceOf(session);
|
|
236
|
+
const profile = await lockFromSession(policy, purchase.entityId, session, evidence);
|
|
237
|
+
const country = evidence.country ?? purchase.country ?? profile?.country;
|
|
238
|
+
const region = consumerRegionHelper.regionOf(country, policy);
|
|
239
|
+
const scoped = consumerRegionHelper.inScope(region, country, policy) || (profile != null && consumerRegionHelper.inScope(profile.region, profile.country, policy));
|
|
240
|
+
const invoice = purchase.invoiceLineId == null || purchase.paymentIntentId == null
|
|
241
|
+
? await invoiceEvidenceOf(stripe, purchase.invoiceId ?? paymentUtils.idOf(session.invoice)) : {};
|
|
242
|
+
const purchasedAt = new Date(purchase.purchasedAt);
|
|
243
|
+
const fields = paymentUtils.compact({
|
|
244
|
+
sessionId: session.id,
|
|
245
|
+
invoiceId: purchase.invoiceId ?? paymentUtils.idOf(session.invoice),
|
|
246
|
+
invoiceNumber: purchase.invoiceNumber ?? invoice.invoiceNumber,
|
|
247
|
+
invoiceLineId: purchase.invoiceLineId ?? invoice.invoiceLineId,
|
|
248
|
+
paymentIntentId: purchase.paymentIntentId ?? invoice.paymentIntentId,
|
|
249
|
+
country,
|
|
250
|
+
region: region ?? undefined,
|
|
251
|
+
inScope: scoped,
|
|
252
|
+
deadline: scoped ? purchase.deadline ?? withdrawalDeadlineHelper.withdrawalDeadlineOf(purchasedAt, policy) : undefined,
|
|
253
|
+
email: evidence.email ?? purchase.email,
|
|
254
|
+
name: evidence.name ?? purchase.name,
|
|
255
|
+
business: evidence.business ?? purchase.business,
|
|
256
|
+
currency: evidence.currency !== '' ? evidence.currency : purchase.currency,
|
|
257
|
+
amountSubtotalMinor: evidence.subtotalMinor,
|
|
258
|
+
amountTaxMinor: evidence.taxMinor,
|
|
259
|
+
amountTotalMinor: evidence.totalMinor,
|
|
260
|
+
presentmentCurrency: evidence.presentmentCurrency,
|
|
261
|
+
presentmentAmountMinor: evidence.presentmentAmountMinor,
|
|
262
|
+
termsAccepted: evidence.termsAccepted,
|
|
263
|
+
ipCountry: purchase.ipCountry ?? session.metadata?.ipCountry,
|
|
264
|
+
language: profile?.language ?? purchase.language,
|
|
265
|
+
});
|
|
266
|
+
await records.patchPurchase(purchase.purchaseId, fields);
|
|
267
|
+
const updated = { ...purchase, ...fields };
|
|
268
|
+
if (!scoped && purchase.deadline != null) {
|
|
269
|
+
// Out of scope after all (the buyer's own country): no window.
|
|
270
|
+
await records.patchPurchase(purchase.purchaseId, { deadline: null });
|
|
271
|
+
delete updated.deadline;
|
|
272
|
+
}
|
|
273
|
+
if (opts.mail !== false)
|
|
274
|
+
await confirmPurchase(policy, updated);
|
|
275
|
+
return updated;
|
|
276
|
+
};
|
|
277
|
+
return {
|
|
278
|
+
sessionEvidenceOf, invoiceEvidenceOf, capturePaymentPurchase, captureSubscriptionPurchase,
|
|
279
|
+
completeSubscriptionPurchase,
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
/** The purchase capture of a context — one per context. */
|
|
283
|
+
export const captureOf = memoHelper.oncePer(makeCaptureHelper);
|
|
284
|
+
//# sourceMappingURL=capture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/consumer/capture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,4BAA4B,EAAE,YAAY,EAA6B,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAEtK,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAKnD,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1C,MAAM,UAAU,GAAG,CAAC,MAA4B,EAAE,MAAe,EAAE,WAAiB,EAAoB,EAAE,CACxG,MAAM,CAAC,CAAC,CAAC,wBAAwB,CAAC,oBAAoB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAEzF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAe,EAAiB,EAAE;IAClE,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,CAAA;IACnC,MAAM,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Kind, ConsumerRecordKind>;
|
|
4
|
+
export declare const USER_AGENT_MAX = 512;
|
|
5
|
+
export declare const HEADER_MAX = 1024;
|
|
6
|
+
export declare const DAY_MS = 86400000;
|
|
7
|
+
/** A paygate step failed this often is left to an operator. */
|
|
8
|
+
export declare const MAX_ATTEMPTS = 5;
|
|
9
|
+
export declare const CONTRACT_REF_ATTEMPTS = 6;
|
|
10
|
+
//# sourceMappingURL=consts.local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../src/consumer/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEvE,eAAO,MAAM,qBAAqB,OAAO,CAAA;AAEzC,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,CAEpE,CAAA;AAED,eAAO,MAAM,cAAc,MAAM,CAAA;AAEjC,eAAO,MAAM,UAAU,OAAO,CAAA;AAE9B,eAAO,MAAM,MAAM,WAAa,CAAA;AAEhC,+DAA+D;AAC/D,eAAO,MAAM,YAAY,IAAI,CAAA;AAE7B,eAAO,MAAM,qBAAqB,IAAI,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const DEFAULT_PUBLIC_MIN_MS = 1000;
|
|
2
|
+
export const RECORD_KIND = {
|
|
3
|
+
purchase: 'purchase', consent: 'consent', start: 'consent', withdrawal: 'declaration', cancellation: 'declaration',
|
|
4
|
+
};
|
|
5
|
+
export const USER_AGENT_MAX = 512;
|
|
6
|
+
export const HEADER_MAX = 1024;
|
|
7
|
+
export const DAY_MS = 86_400_000;
|
|
8
|
+
/** A paygate step failed this often is left to an operator. */
|
|
9
|
+
export const MAX_ATTEMPTS = 5;
|
|
10
|
+
export const CONTRACT_REF_ATTEMPTS = 6;
|
|
11
|
+
//# sourceMappingURL=consts.local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/consumer/consts.local.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAA;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAiD;IACvE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa;CACnH,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;AAEjC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAA;AAE9B,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAA;AAEhC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAA;AAE7B,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** How the consumer-rights flows write and read references, addresses, amounts and dates — pure. */
|
|
2
|
+
export interface ConsumerFormatHelper {
|
|
3
|
+
/** `CR-YYMMDD-XXXXXX` — the purchase's UTC date and six characters of an unambiguous alphabet. */
|
|
4
|
+
newContractRef: (at?: Date) => string;
|
|
5
|
+
/** A contract reference as a person may type it: trimmed, upper-cased, look-alike dashes unified. */
|
|
6
|
+
normalizeContractRef: (value: string) => string;
|
|
7
|
+
normalizeEmail: (value: string | null | undefined) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether an address is on a reserved top-level domain (`.test`, `.example`, `.invalid`,
|
|
10
|
+
* `.localhost` — RFC 2606 / 6761), any subdomain included: `a@shop.test`, `a@mail.shop.test`,
|
|
11
|
+
* `a@localhost`. Case, surrounding spaces, a display-name form (`Name <a@shop.test>`) and a
|
|
12
|
+
* trailing root dot are all read through.
|
|
13
|
+
*/
|
|
14
|
+
isReservedAddress: (address: string) => boolean;
|
|
15
|
+
escapeHtml: (value: string) => string;
|
|
16
|
+
/** Minor units as a localized amount with its currency (`12,56 €`, `$12.56`). */
|
|
17
|
+
formatMoney: (amountMinor: number, currency: string, lng: string) => string;
|
|
18
|
+
/** A date and time in UTC, localized (`23 September 2026, 14:05`). */
|
|
19
|
+
formatDateTime: (at: Date, lng: string) => string;
|
|
20
|
+
/** A calendar date in UTC, localized. */
|
|
21
|
+
formatDate: (at: Date, lng: string) => string;
|
|
22
|
+
/**
|
|
23
|
+
* The last included day of a window whose deadline is EXCLUSIVE (the first instant it is over),
|
|
24
|
+
* as a UTC date — the copy says "until the end of <date>": 13 October 00:00 UTC is "12 October".
|
|
25
|
+
*/
|
|
26
|
+
formatDeadline: (deadline: Date, lng: string) => string;
|
|
27
|
+
/** A country's name in a language, else its code. */
|
|
28
|
+
countryName: (country: string, lng: string) => string;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/consumer/format/types.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,MAAM,WAAW,oBAAoB;IACnC,kGAAkG;IAClG,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,KAAK,MAAM,CAAA;IACrC,qGAAqG;IACrG,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/C,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,KAAK,MAAM,CAAA;IAC5D;;;;;OAKG;IACH,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAA;IAC/C,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACrC,iFAAiF;IACjF,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IAC3E,sEAAsE;IACtE,cAAc,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACjD,yCAAyC;IACzC,UAAU,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IAC7C;;;OAGG;IACH,cAAc,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACvD,qDAAqD;IACrD,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;CACtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/consumer/format/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/consumer/format.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAG7D,eAAO,MAAM,0BAA0B,QAAO,oBA6E7C,CAAA;AAED,eAAO,MAAM,oBAAoB,sBAA+B,CAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { randomInt } from 'node:crypto';
|
|
2
|
+
import { CONTRACT_REF_ALPHABET, RESERVED_MAIL_TLDS } from '../consts.js';
|
|
3
|
+
import { withdrawalDeadlineHelper } from '@owlmeans/payment';
|
|
4
|
+
export const createConsumerFormatHelper = () => {
|
|
5
|
+
const newContractRef = (at = new Date()) => {
|
|
6
|
+
const date = [at.getUTCFullYear() % 100, at.getUTCMonth() + 1, at.getUTCDate()]
|
|
7
|
+
.map(part => String(part).padStart(2, '0')).join('');
|
|
8
|
+
const suffix = Array.from({ length: 6 }, () => CONTRACT_REF_ALPHABET[randomInt(CONTRACT_REF_ALPHABET.length)])
|
|
9
|
+
.join('');
|
|
10
|
+
return `CR-${date}-${suffix}`;
|
|
11
|
+
};
|
|
12
|
+
const normalizeContractRef = (value) => value.trim().toUpperCase().replace(/[‐-―−\s]+/g, '-');
|
|
13
|
+
const normalizeEmail = (value) => (value ?? '').trim().toLowerCase();
|
|
14
|
+
const isReservedAddress = (address) => {
|
|
15
|
+
const bare = normalizeEmail(address).replace(/^.*<([^>]*)>.*$/, '$1');
|
|
16
|
+
const domain = (bare.split('@').pop() ?? '').trim().replace(/\.+$/, '');
|
|
17
|
+
const tld = domain.split('.').pop() ?? '';
|
|
18
|
+
return RESERVED_MAIL_TLDS.includes(tld);
|
|
19
|
+
};
|
|
20
|
+
const escapeHtml = (value) => value
|
|
21
|
+
.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|
|
22
|
+
.replace(/"/g, '"').replace(/'/g, ''');
|
|
23
|
+
const fractionDigitsOf = (currency) => {
|
|
24
|
+
try {
|
|
25
|
+
return new Intl.NumberFormat('en', { style: 'currency', currency: currency.toUpperCase() })
|
|
26
|
+
.resolvedOptions().maximumFractionDigits ?? 2;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return 2;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const formatMoney = (amountMinor, currency, lng) => {
|
|
33
|
+
const digits = fractionDigitsOf(currency);
|
|
34
|
+
const major = amountMinor / 10 ** digits;
|
|
35
|
+
try {
|
|
36
|
+
return new Intl.NumberFormat(lng, { style: 'currency', currency: currency.toUpperCase() }).format(major);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return `${major.toFixed(digits)} ${currency.toUpperCase()}`;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const formatDateTime = (at, lng) => {
|
|
43
|
+
try {
|
|
44
|
+
return new Intl.DateTimeFormat(lng, { dateStyle: 'long', timeStyle: 'short', timeZone: 'UTC' }).format(at);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return at.toISOString().replace('T', ' ').slice(0, 16);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const formatDate = (at, lng) => {
|
|
51
|
+
try {
|
|
52
|
+
return new Intl.DateTimeFormat(lng, { dateStyle: 'long', timeZone: 'UTC' }).format(at);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return at.toISOString().slice(0, 10);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const formatDeadline = (deadline, lng) => formatDate(withdrawalDeadlineHelper.lastWithdrawalDayOf(deadline), lng);
|
|
59
|
+
const countryName = (country, lng) => {
|
|
60
|
+
try {
|
|
61
|
+
return new Intl.DisplayNames([lng], { type: 'region' }).of(country.toUpperCase()) ?? country;
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return country;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return {
|
|
68
|
+
newContractRef, normalizeContractRef, normalizeEmail, isReservedAddress, escapeHtml, formatMoney, formatDateTime,
|
|
69
|
+
formatDate, formatDeadline, countryName,
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export const consumerFormatHelper = createConsumerFormatHelper();
|
|
73
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/consumer/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAExE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAE5D,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAyB,EAAE;IACnE,MAAM,cAAc,GAAG,CAAC,EAAE,GAAS,IAAI,IAAI,EAAE,EAAU,EAAE;QACvD,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,GAAG,EAAE,EAAE,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE,C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AE,UAAU,EAAE,WAAW,EAAE,cAAc;QAChH,UAAU,EAAE,cAAc,EAAE,WAAW;KACxC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,EAAE,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type CheckoutReadProtocols } from '@owlmeans/payment';
|
|
2
|
+
import type { CheckoutReadHandlerOptions, ConsumerRightsHandlerOptions } from '../types.js';
|
|
3
|
+
import type { Bound, ConsumerRightsTree } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Server bindings of `makeConsumerRightsProtocols`' tree over the consumer-rights service. The
|
|
6
|
+
* account routes act for the request's organization (`resolveEntity`, default `req.entity.id`);
|
|
7
|
+
* the money-moving acts (consent, start request, withdrawal, cancellation) pass `guardMoney` first
|
|
8
|
+
* (refuse an API key there). The public routes — the statutory functions without a login — need
|
|
9
|
+
* `throttle` (a wiring error otherwise), drop a filled honeypot silently, and answer every
|
|
10
|
+
* declaration with the same receipt shape after at least `publicMinMs`, matched or not. Every hook
|
|
11
|
+
* gets the request's context as its last argument.
|
|
12
|
+
*
|
|
13
|
+
* @throws SyntaxError when the tree has a public subtree and no `throttle` is given
|
|
14
|
+
*/
|
|
15
|
+
export declare const consumerRightsEntrypoints: (protocols: ConsumerRightsTree, opts?: ConsumerRightsHandlerOptions) => Bound[];
|
|
16
|
+
/**
|
|
17
|
+
* Server bindings of `makeCheckoutReadProtocols`' tree: the entity's amount policy as the checkout
|
|
18
|
+
* plugins narrow it now (the same computation the checkout enforces) and the synced plan prices.
|
|
19
|
+
*/
|
|
20
|
+
export declare const checkoutReadEntrypoints: (protocols: CheckoutReadProtocols, opts?: CheckoutReadHandlerOptions) => Bound[];
|
|
21
|
+
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/consumer/handlers.ts"],"names":[],"mappings":"AAGA,OAAO,EACoC,KAAK,qBAAqB,EAEpE,MAAM,mBAAmB,CAAA;AAI1B,OAAO,KAAK,EACV,0BAA0B,EAAE,4BAA4B,EAEzD,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAkC3D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,cACzB,kBAAkB,SAAQ,4BAA4B,KAChE,KAAK,EA+GP,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,cAAe,qBAAqB,SAAQ,0BAA0B,KAAQ,KAAK,EAwBtH,CAAA"}
|