@owlmeans/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 +95 -57
- package/agent-meta/manifest.json +10 -3
- package/agent-meta/skills/entitlements/SKILL.md +159 -0
- package/agent-meta/skills/payment/SKILL.md +491 -28
- package/build/advertise.d.ts +2 -0
- package/build/advertise.d.ts.map +1 -0
- package/build/advertise.js +10 -0
- package/build/advertise.js.map +1 -0
- package/build/checkout/consts.d.ts +2 -0
- package/build/checkout/consts.d.ts.map +1 -0
- package/build/checkout/consts.js +2 -0
- package/build/checkout/consts.js.map +1 -0
- package/build/checkout/index.d.ts +6 -0
- package/build/checkout/index.d.ts.map +1 -0
- package/build/checkout/index.js +4 -0
- package/build/checkout/index.js.map +1 -0
- package/build/checkout/narrow/types.d.ts +25 -0
- package/build/checkout/narrow/types.d.ts.map +1 -0
- package/build/checkout/narrow/types.js +2 -0
- package/build/checkout/narrow/types.js.map +1 -0
- package/build/checkout/narrow.d.ts +8 -0
- package/build/checkout/narrow.d.ts.map +1 -0
- package/build/checkout/narrow.js +47 -0
- package/build/checkout/narrow.js.map +1 -0
- package/build/checkout/protocols.d.ts +8 -0
- package/build/checkout/protocols.d.ts.map +1 -0
- package/build/checkout/protocols.js +28 -0
- package/build/checkout/protocols.js.map +1 -0
- package/build/checkout/types.d.ts +29 -0
- package/build/checkout/types.d.ts.map +1 -0
- package/build/checkout/types.js +2 -0
- package/build/checkout/types.js.map +1 -0
- package/build/consts.d.ts +242 -25
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +377 -24
- package/build/consts.js.map +1 -1
- package/build/consts.local.d.ts +20 -0
- package/build/consts.local.d.ts.map +1 -0
- package/build/consts.local.js +23 -0
- package/build/consts.local.js.map +1 -0
- package/build/consumer/cancel.d.ts +11 -0
- package/build/consumer/cancel.d.ts.map +1 -0
- package/build/consumer/cancel.js +33 -0
- package/build/consumer/cancel.js.map +1 -0
- package/build/consumer/consts.d.ts +20 -0
- package/build/consumer/consts.d.ts.map +1 -0
- package/build/consumer/consts.js +39 -0
- package/build/consumer/consts.js.map +1 -0
- package/build/consumer/consts.local.d.ts +7 -0
- package/build/consumer/consts.local.d.ts.map +1 -0
- package/build/consumer/consts.local.js +13 -0
- package/build/consumer/consts.local.js.map +1 -0
- package/build/consumer/copy/types.d.ts +56 -0
- package/build/consumer/copy/types.d.ts.map +1 -0
- package/build/consumer/copy/types.js +2 -0
- package/build/consumer/copy/types.js.map +1 -0
- package/build/consumer/copy.d.ts +22 -0
- package/build/consumer/copy.d.ts.map +1 -0
- package/build/consumer/copy.js +87 -0
- package/build/consumer/copy.js.map +1 -0
- package/build/consumer/deadline/types.d.ts +30 -0
- package/build/consumer/deadline/types.d.ts.map +1 -0
- package/build/consumer/deadline/types.js +2 -0
- package/build/consumer/deadline/types.js.map +1 -0
- package/build/consumer/deadline.d.ts +12 -0
- package/build/consumer/deadline.d.ts.map +1 -0
- package/build/consumer/deadline.js +44 -0
- package/build/consumer/deadline.js.map +1 -0
- package/build/consumer/fifo/types.d.ts +17 -0
- package/build/consumer/fifo/types.d.ts.map +1 -0
- package/build/consumer/fifo/types.js +2 -0
- package/build/consumer/fifo/types.js.map +1 -0
- package/build/consumer/fifo.d.ts +4 -0
- package/build/consumer/fifo.d.ts.map +1 -0
- package/build/consumer/fifo.js +34 -0
- package/build/consumer/fifo.js.map +1 -0
- package/build/consumer/index.d.ts +18 -0
- package/build/consumer/index.d.ts.map +1 -0
- package/build/consumer/index.js +11 -0
- package/build/consumer/index.js.map +1 -0
- package/build/consumer/policy/types.d.ts +20 -0
- package/build/consumer/policy/types.d.ts.map +1 -0
- package/build/consumer/policy/types.js +2 -0
- package/build/consumer/policy/types.js.map +1 -0
- package/build/consumer/policy.d.ts +17 -0
- package/build/consumer/policy.d.ts.map +1 -0
- package/build/consumer/policy.js +91 -0
- package/build/consumer/policy.js.map +1 -0
- package/build/consumer/protocols.d.ts +20 -0
- package/build/consumer/protocols.d.ts.map +1 -0
- package/build/consumer/protocols.js +70 -0
- package/build/consumer/protocols.js.map +1 -0
- package/build/consumer/refund/types.d.ts +27 -0
- package/build/consumer/refund/types.d.ts.map +1 -0
- package/build/consumer/refund/types.js +2 -0
- package/build/consumer/refund/types.js.map +1 -0
- package/build/consumer/refund.d.ts +9 -0
- package/build/consumer/refund.d.ts.map +1 -0
- package/build/consumer/refund.js +112 -0
- package/build/consumer/refund.js.map +1 -0
- package/build/consumer/refusal.d.ts +10 -0
- package/build/consumer/refusal.d.ts.map +1 -0
- package/build/consumer/refusal.js +35 -0
- package/build/consumer/refusal.js.map +1 -0
- package/build/consumer/revive/types.d.ts +19 -0
- package/build/consumer/revive/types.d.ts.map +1 -0
- package/build/consumer/revive/types.js +2 -0
- package/build/consumer/revive/types.js.map +1 -0
- package/build/consumer/revive.d.ts +13 -0
- package/build/consumer/revive.d.ts.map +1 -0
- package/build/consumer/revive.js +43 -0
- package/build/consumer/revive.js.map +1 -0
- package/build/consumer/types.d.ts +196 -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 +11 -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/countries.d.ts +3 -0
- package/build/countries.d.ts.map +1 -0
- package/build/countries.js +4 -0
- package/build/countries.js.map +1 -0
- package/build/entitled.d.ts +14 -0
- package/build/entitled.d.ts.map +1 -0
- package/build/entitled.js +17 -0
- package/build/entitled.js.map +1 -0
- package/build/entitlement/types.d.ts +29 -0
- package/build/entitlement/types.d.ts.map +1 -0
- package/build/entitlement/types.js +2 -0
- package/build/entitlement/types.js.map +1 -0
- package/build/entitlement.d.ts +12 -0
- package/build/entitlement.d.ts.map +1 -0
- package/build/entitlement.js +64 -0
- package/build/entitlement.js.map +1 -0
- package/build/errors.d.ts +189 -0
- package/build/errors.d.ts.map +1 -1
- package/build/errors.js +361 -0
- package/build/errors.js.map +1 -1
- package/build/estimate/types.d.ts +34 -0
- package/build/estimate/types.d.ts.map +1 -0
- package/build/estimate/types.js +2 -0
- package/build/estimate/types.js.map +1 -0
- package/build/estimate.d.ts +11 -0
- package/build/estimate.d.ts.map +1 -0
- package/build/estimate.js +76 -0
- package/build/estimate.js.map +1 -0
- package/build/i18n/consumer-rights/be.json +131 -0
- package/build/i18n/consumer-rights/de.json +131 -0
- package/build/i18n/consumer-rights/en.json +131 -0
- package/build/i18n/consumer-rights/es.json +131 -0
- package/build/i18n/consumer-rights/fr.json +131 -0
- package/build/i18n/consumer-rights/pl.json +131 -0
- package/build/i18n/consumer-rights/ru.json +131 -0
- package/build/i18n/consumer-rights/uk.json +131 -0
- package/build/i18n/errors/be.json +30 -0
- package/build/i18n/errors/de.json +30 -0
- package/build/i18n/errors/en.json +30 -0
- package/build/i18n/errors/es.json +30 -0
- package/build/i18n/errors/fr.json +30 -0
- package/build/i18n/errors/pl.json +30 -0
- package/build/i18n/errors/ru.json +30 -0
- package/build/i18n/errors/uk.json +30 -0
- package/build/i18n/fr.json +39 -0
- package/build/i18n.js +53 -8
- package/build/i18n.js.map +1 -1
- package/build/index.d.ts +19 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +12 -1
- package/build/index.js.map +1 -1
- package/build/limit/types.d.ts +44 -0
- package/build/limit/types.d.ts.map +1 -0
- package/build/limit/types.js +2 -0
- package/build/limit/types.js.map +1 -0
- package/build/limit.d.ts +23 -0
- package/build/limit.d.ts.map +1 -0
- package/build/limit.js +97 -0
- package/build/limit.js.map +1 -0
- package/build/model/checkout.d.ts +2 -3
- package/build/model/checkout.d.ts.map +1 -1
- package/build/model/checkout.js +12 -7
- package/build/model/checkout.js.map +1 -1
- package/build/model/consts.d.ts +15 -0
- package/build/model/consts.d.ts.map +1 -0
- package/build/model/consts.js +193 -0
- package/build/model/consts.js.map +1 -0
- package/build/model/consts.local.d.ts +35 -0
- package/build/model/consts.local.d.ts.map +1 -0
- package/build/model/consts.local.js +65 -0
- package/build/model/consts.local.js.map +1 -0
- package/build/model/consumer.d.ts +23 -0
- package/build/model/consumer.d.ts.map +1 -0
- package/build/model/consumer.js +272 -0
- package/build/model/consumer.js.map +1 -0
- package/build/model/estimate.d.ts +5 -0
- package/build/model/estimate.d.ts.map +1 -0
- package/build/model/estimate.js +69 -0
- package/build/model/estimate.js.map +1 -0
- package/build/model/index.d.ts +7 -2
- package/build/model/index.d.ts.map +1 -1
- package/build/model/index.js +7 -2
- package/build/model/index.js.map +1 -1
- package/build/model/limit.d.ts +7 -0
- package/build/model/limit.d.ts.map +1 -0
- package/build/model/limit.js +32 -0
- package/build/model/limit.js.map +1 -0
- package/build/model/plan.d.ts.map +1 -1
- package/build/model/plan.js +24 -11
- package/build/model/plan.js.map +1 -1
- package/build/model/portal.d.ts +4 -0
- package/build/model/portal.d.ts.map +1 -0
- package/build/model/portal.js +22 -0
- package/build/model/portal.js.map +1 -0
- package/build/model/pricing.d.ts +4 -0
- package/build/model/pricing.d.ts.map +1 -0
- package/build/model/pricing.js +31 -0
- package/build/model/pricing.js.map +1 -0
- package/build/model/view.d.ts +3 -0
- package/build/model/view.d.ts.map +1 -0
- package/build/model/view.js +15 -0
- package/build/model/view.js.map +1 -0
- package/build/pricing/types.d.ts +13 -0
- package/build/pricing/types.d.ts.map +1 -0
- package/build/pricing/types.js +2 -0
- package/build/pricing/types.js.map +1 -0
- package/build/pricing.d.ts +13 -0
- package/build/pricing.d.ts.map +1 -0
- package/build/pricing.js +74 -0
- package/build/pricing.js.map +1 -0
- package/build/promo/types.d.ts +14 -0
- package/build/promo/types.d.ts.map +1 -0
- package/build/promo/types.js +2 -0
- package/build/promo/types.js.map +1 -0
- package/build/promo.d.ts +7 -0
- package/build/promo.d.ts.map +1 -0
- package/build/promo.js +25 -0
- package/build/promo.js.map +1 -0
- package/build/regions/types.d.ts +32 -0
- package/build/regions/types.d.ts.map +1 -0
- package/build/regions/types.js +2 -0
- package/build/regions/types.js.map +1 -0
- package/build/regions.d.ts +15 -0
- package/build/regions.d.ts.map +1 -0
- package/build/regions.js +43 -0
- package/build/regions.js.map +1 -0
- package/build/service.d.ts.map +1 -1
- package/build/service.js +24 -9
- package/build/service.js.map +1 -1
- package/build/types.d.ts +619 -52
- package/build/types.d.ts.map +1 -1
- package/build/types.local.d.ts +4 -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/view/types.d.ts +33 -0
- package/build/view/types.d.ts.map +1 -0
- package/build/view/types.js +2 -0
- package/build/view/types.js.map +1 -0
- package/build/view.d.ts +13 -0
- package/build/view.d.ts.map +1 -0
- package/build/view.js +78 -0
- package/build/view.js.map +1 -0
- package/package.json +14 -12
- package/src/advertise.ts +13 -0
- package/src/checkout/consts.ts +1 -0
- package/src/checkout/index.ts +5 -0
- package/src/checkout/narrow/types.ts +27 -0
- package/src/checkout/narrow.ts +63 -0
- package/src/checkout/protocols.ts +39 -0
- package/src/checkout/types.ts +27 -0
- package/src/consts.local.ts +34 -0
- package/src/consts.ts +417 -24
- package/src/consumer/cancel.ts +40 -0
- package/src/consumer/consts.local.ts +16 -0
- package/src/consumer/consts.ts +46 -0
- package/src/consumer/copy/types.ts +54 -0
- package/src/consumer/copy.ts +121 -0
- package/src/consumer/deadline/types.ts +30 -0
- package/src/consumer/deadline.ts +61 -0
- package/src/consumer/fifo/types.ts +17 -0
- package/src/consumer/fifo.ts +42 -0
- package/src/consumer/index.ts +17 -0
- package/src/consumer/policy/types.ts +20 -0
- package/src/consumer/policy.ts +101 -0
- package/src/consumer/protocols.ts +116 -0
- package/src/consumer/refund/types.ts +27 -0
- package/src/consumer/refund.ts +136 -0
- package/src/consumer/refusal.ts +35 -0
- package/src/consumer/revive/types.ts +23 -0
- package/src/consumer/revive.ts +82 -0
- package/src/consumer/types.local.ts +10 -0
- package/src/consumer/types.ts +189 -0
- package/src/countries.ts +5 -0
- package/src/entitled.ts +20 -0
- package/src/entitlement/types.ts +29 -0
- package/src/entitlement.ts +86 -0
- package/src/errors.ts +445 -0
- package/src/estimate/types.ts +34 -0
- package/src/estimate.ts +90 -0
- package/src/i18n/consumer-rights/be.json +131 -0
- package/src/i18n/consumer-rights/de.json +131 -0
- package/src/i18n/consumer-rights/en.json +131 -0
- package/src/i18n/consumer-rights/es.json +131 -0
- package/src/i18n/consumer-rights/fr.json +131 -0
- package/src/i18n/consumer-rights/pl.json +131 -0
- package/src/i18n/consumer-rights/ru.json +131 -0
- package/src/i18n/consumer-rights/uk.json +131 -0
- package/src/i18n/errors/be.json +30 -0
- package/src/i18n/errors/de.json +30 -0
- package/src/i18n/errors/en.json +30 -0
- package/src/i18n/errors/es.json +30 -0
- package/src/i18n/errors/fr.json +30 -0
- package/src/i18n/errors/pl.json +30 -0
- package/src/i18n/errors/ru.json +30 -0
- package/src/i18n/errors/uk.json +30 -0
- package/src/i18n/fr.json +39 -0
- package/src/i18n.ts +58 -8
- package/src/index.ts +19 -2
- package/src/limit/types.ts +41 -0
- package/src/limit.ts +132 -0
- package/src/model/checkout.ts +12 -7
- package/src/model/consts.local.ts +83 -0
- package/src/model/consts.ts +206 -0
- package/src/model/consumer.ts +294 -0
- package/src/model/estimate.ts +73 -0
- package/src/model/index.ts +7 -2
- package/src/model/limit.ts +36 -0
- package/src/model/plan.ts +25 -12
- package/src/model/portal.ts +25 -0
- package/src/model/pricing.ts +34 -0
- package/src/model/view.ts +17 -0
- package/src/pricing/types.ts +13 -0
- package/src/pricing.ts +110 -0
- package/src/promo/types.ts +18 -0
- package/src/promo.ts +46 -0
- package/src/regions/types.ts +42 -0
- package/src/regions.ts +85 -0
- package/src/service.ts +32 -15
- package/src/types.local.ts +5 -0
- package/src/types.ts +669 -49
- package/src/view/types.ts +39 -0
- package/src/view.ts +119 -0
- package/tests/checkout-narrow.spec.ts +75 -0
- package/tests/consumer-copy.spec.ts +378 -0
- package/tests/consumer-deadline.spec.ts +85 -0
- package/tests/consumer-fifo.spec.ts +61 -0
- package/tests/consumer-protocols.spec.ts +103 -0
- package/tests/consumer-refund.spec.ts +134 -0
- package/tests/consumer-regions.spec.ts +140 -0
- package/tests/consumer-wire.spec.ts +170 -0
- package/tests/contract.spec.ts +183 -0
- package/tests/entitlement.spec.ts +103 -0
- package/tests/errors.spec.ts +168 -0
- package/tests/estimate.spec.ts +139 -0
- package/tests/limit.spec.ts +117 -0
- package/tests/pricing.spec.ts +30 -0
- package/tests/tsconfig.json +11 -0
- package/tests/view.spec.ts +130 -0
- package/tsconfig.json +6 -1
- package/build/.gitkeep +0 -0
- package/src/model/subscription.ts +0 -63
- package/src/model/utils.ts +0 -32
- package/src/modules.ts +0 -43
package/build/consts.js
CHANGED
|
@@ -4,6 +4,11 @@ export var ProductType;
|
|
|
4
4
|
ProductType["Service"] = "service";
|
|
5
5
|
ProductType["Consumable"] = "consumable";
|
|
6
6
|
})(ProductType || (ProductType = {}));
|
|
7
|
+
export var CheckoutPricingMode;
|
|
8
|
+
(function (CheckoutPricingMode) {
|
|
9
|
+
CheckoutPricingMode["Quantity"] = "quantity";
|
|
10
|
+
CheckoutPricingMode["Amount"] = "amount";
|
|
11
|
+
})(CheckoutPricingMode || (CheckoutPricingMode = {}));
|
|
7
12
|
export var PaymentEntityType;
|
|
8
13
|
(function (PaymentEntityType) {
|
|
9
14
|
PaymentEntityType["Product"] = "product";
|
|
@@ -37,17 +42,207 @@ export var SubscriptionStatus;
|
|
|
37
42
|
SubscriptionStatus["Trial"] = "trial";
|
|
38
43
|
SubscriptionStatus["Canceled"] = "canceled";
|
|
39
44
|
SubscriptionStatus["Expired"] = "expired";
|
|
45
|
+
/** Revoked until resumed: unpaid, paused, or collection paused. */
|
|
40
46
|
SubscriptionStatus["Suspended"] = "suspended";
|
|
41
47
|
SubscriptionStatus["Blocked"] = "blocked";
|
|
42
48
|
SubscriptionStatus["Ended"] = "ended";
|
|
43
|
-
SubscriptionStatus["Free"] = "free";
|
|
44
49
|
SubscriptionStatus["Active"] = "active";
|
|
45
|
-
|
|
50
|
+
/** Payment failed and is being retried: still entitled, flagged. */
|
|
51
|
+
SubscriptionStatus["PastDue"] = "past-due";
|
|
46
52
|
})(SubscriptionStatus || (SubscriptionStatus = {}));
|
|
53
|
+
/** The statuses that grant a plan's capabilities and limits. */
|
|
54
|
+
export const ENTITLING_STATUSES = Object.freeze([
|
|
55
|
+
SubscriptionStatus.Active, SubscriptionStatus.Trial, SubscriptionStatus.PastDue,
|
|
56
|
+
]);
|
|
57
|
+
/** The statuses a subscription never leaves on its own. */
|
|
58
|
+
export const TERMINAL_STATUSES = Object.freeze([
|
|
59
|
+
SubscriptionStatus.Canceled, SubscriptionStatus.Expired, SubscriptionStatus.Ended,
|
|
60
|
+
SubscriptionStatus.Blocked,
|
|
61
|
+
]);
|
|
62
|
+
/** How a limit's counter renews. */
|
|
63
|
+
export var LimitKind;
|
|
64
|
+
(function (LimitKind) {
|
|
65
|
+
/** Renews on the calendar UTC or subscription-anchored `LimitWindow`. */
|
|
66
|
+
LimitKind["Window"] = "window";
|
|
67
|
+
/** Never renews: the counter belongs to the entity and survives plan changes. */
|
|
68
|
+
LimitKind["Lifetime"] = "lifetime";
|
|
69
|
+
/** A held count (`+1` on acquire, `-1` on release), reconciled against reality. */
|
|
70
|
+
LimitKind["Occupancy"] = "occupancy";
|
|
71
|
+
})(LimitKind || (LimitKind = {}));
|
|
72
|
+
/** Calendar UTC windows, or a seven-day window anchored at subscription creation. */
|
|
73
|
+
export var LimitWindow;
|
|
74
|
+
(function (LimitWindow) {
|
|
75
|
+
LimitWindow["Day"] = "day";
|
|
76
|
+
LimitWindow["Month"] = "month";
|
|
77
|
+
LimitWindow["SubscriptionWeek"] = "subscription-week";
|
|
78
|
+
})(LimitWindow || (LimitWindow = {}));
|
|
79
|
+
export const SUBSCRIPTION_WEEK_MS = 7 * 24 * 60 * 60 * 1000;
|
|
80
|
+
export const SUBSCRIPTION_WEEK_PREFIX = 'subscription-week:';
|
|
81
|
+
/** Which paygate portal flow a portal link opens. */
|
|
82
|
+
export var PortalFlow;
|
|
83
|
+
(function (PortalFlow) {
|
|
84
|
+
PortalFlow["Manage"] = "manage";
|
|
85
|
+
PortalFlow["Cancel"] = "cancel";
|
|
86
|
+
PortalFlow["Update"] = "update";
|
|
87
|
+
PortalFlow["Change"] = "change";
|
|
88
|
+
PortalFlow["PaymentMethod"] = "payment-method";
|
|
89
|
+
})(PortalFlow || (PortalFlow = {}));
|
|
90
|
+
/** Whether a price's amount includes tax, or tax is added on top — never inferred, always declared. */
|
|
91
|
+
export var TaxBehavior;
|
|
92
|
+
(function (TaxBehavior) {
|
|
93
|
+
TaxBehavior["Exclusive"] = "exclusive";
|
|
94
|
+
TaxBehavior["Inclusive"] = "inclusive";
|
|
95
|
+
})(TaxBehavior || (TaxBehavior = {}));
|
|
96
|
+
/** What a price estimate says about tax at one billing country. */
|
|
97
|
+
export var TaxEstimateStatus;
|
|
98
|
+
(function (TaxEstimateStatus) {
|
|
99
|
+
/** Tax is due and its rate(s) are in `TaxEstimate.rates`. */
|
|
100
|
+
TaxEstimateStatus["Taxed"] = "taxed";
|
|
101
|
+
/** No tax because the buyer's tax id shifts liability to them (EU/GB reverse charge). */
|
|
102
|
+
TaxEstimateStatus["ReverseCharge"] = "reverse-charge";
|
|
103
|
+
/** No tax for any other reason (not registered there, exempt, zero-rated). */
|
|
104
|
+
TaxEstimateStatus["None"] = "none";
|
|
105
|
+
/** The gateway could not resolve a rate from what it was given; the real total shows at checkout. */
|
|
106
|
+
TaxEstimateStatus["AtCheckout"] = "at-checkout";
|
|
107
|
+
/** No country was given and none could be inferred from the entity's paygate customer. */
|
|
108
|
+
TaxEstimateStatus["LocationRequired"] = "location-required";
|
|
109
|
+
})(TaxEstimateStatus || (TaxEstimateStatus = {}));
|
|
110
|
+
/** A tax type a rate carries, collapsed from Stripe's finer `tax_type` for display. */
|
|
111
|
+
export var TaxType;
|
|
112
|
+
(function (TaxType) {
|
|
113
|
+
TaxType["Vat"] = "vat";
|
|
114
|
+
TaxType["Gst"] = "gst";
|
|
115
|
+
TaxType["SalesTax"] = "sales-tax";
|
|
116
|
+
/** Any other Stripe `tax_type` (excise, lease, tourism, …). */
|
|
117
|
+
TaxType["Tax"] = "tax";
|
|
118
|
+
})(TaxType || (TaxType = {}));
|
|
119
|
+
/** The paygate alias of subscriptions the application grants itself (a free plan, a comp). */
|
|
120
|
+
export const INTERNAL_PAYGATE = 'internal';
|
|
121
|
+
/**
|
|
122
|
+
* Where a billing country sits for consumer rights and the charge currency: inside the declared
|
|
123
|
+
* consumer-rights territories (`ConsumerRightsPolicy.countries`) or outside them.
|
|
124
|
+
*/
|
|
125
|
+
export var ConsumerRegion;
|
|
126
|
+
(function (ConsumerRegion) {
|
|
127
|
+
ConsumerRegion["Eu"] = "eu";
|
|
128
|
+
ConsumerRegion["Other"] = "other";
|
|
129
|
+
})(ConsumerRegion || (ConsumerRegion = {}));
|
|
130
|
+
/** What a purchase — a window of the right of withdrawal — was. */
|
|
131
|
+
export var PurchaseKind;
|
|
132
|
+
(function (PurchaseKind) {
|
|
133
|
+
/** A paid one-time checkout of an amount or quantity plan (prepaid credits). */
|
|
134
|
+
PurchaseKind["TopUp"] = "top-up";
|
|
135
|
+
/** The FIRST invoice of a subscription. Renewals are not purchases. */
|
|
136
|
+
PurchaseKind["Subscription"] = "subscription";
|
|
137
|
+
})(PurchaseKind || (PurchaseKind = {}));
|
|
138
|
+
/** What a consumer expressly requested. */
|
|
139
|
+
export var ConsentKind;
|
|
140
|
+
(function (ConsentKind) {
|
|
141
|
+
/** Start performing now, before the withdrawal period of a credit purchase ends. */
|
|
142
|
+
ConsentKind["Performance"] = "performance";
|
|
143
|
+
/** Start a subscription's services now — given before its checkout. */
|
|
144
|
+
ConsentKind["SubscriptionStart"] = "subscription-start";
|
|
145
|
+
})(ConsentKind || (ConsentKind = {}));
|
|
146
|
+
/** What a consumer declared through a statutory function. */
|
|
147
|
+
export var DeclarationKind;
|
|
148
|
+
(function (DeclarationKind) {
|
|
149
|
+
DeclarationKind["Withdrawal"] = "withdrawal";
|
|
150
|
+
DeclarationKind["Cancellation"] = "cancellation";
|
|
151
|
+
})(DeclarationKind || (DeclarationKind = {}));
|
|
152
|
+
/** Where a declaration was made: signed in, or through the public page without a login. */
|
|
153
|
+
export var DeclarationChannel;
|
|
154
|
+
(function (DeclarationChannel) {
|
|
155
|
+
DeclarationChannel["InApp"] = "in-app";
|
|
156
|
+
DeclarationChannel["Public"] = "public";
|
|
157
|
+
})(DeclarationChannel || (DeclarationChannel = {}));
|
|
158
|
+
export var CancellationKind;
|
|
159
|
+
(function (CancellationKind) {
|
|
160
|
+
CancellationKind["Ordinary"] = "ordinary";
|
|
161
|
+
/** For cause; carries a reason. */
|
|
162
|
+
CancellationKind["Extraordinary"] = "extraordinary";
|
|
163
|
+
})(CancellationKind || (CancellationKind = {}));
|
|
164
|
+
export var WithdrawalStatus;
|
|
165
|
+
(function (WithdrawalStatus) {
|
|
166
|
+
/** Recorded; nothing is disclosed yet (a public declaration always answers this). */
|
|
167
|
+
WithdrawalStatus["Received"] = "received";
|
|
168
|
+
WithdrawalStatus["Processing"] = "processing";
|
|
169
|
+
WithdrawalStatus["Refunded"] = "refunded";
|
|
170
|
+
/** Recorded, and left to an operator: no usage meter, or automatic refunds are off. */
|
|
171
|
+
WithdrawalStatus["Review"] = "review";
|
|
172
|
+
WithdrawalStatus["Failed"] = "failed";
|
|
173
|
+
/** Received after the withdrawal period ended; recorded, not executed. */
|
|
174
|
+
WithdrawalStatus["Expired"] = "expired";
|
|
175
|
+
})(WithdrawalStatus || (WithdrawalStatus = {}));
|
|
176
|
+
export var CancellationStatus;
|
|
177
|
+
(function (CancellationStatus) {
|
|
178
|
+
CancellationStatus["Received"] = "received";
|
|
179
|
+
CancellationStatus["Scheduled"] = "scheduled";
|
|
180
|
+
CancellationStatus["AlreadyScheduled"] = "already-scheduled";
|
|
181
|
+
/** Recorded and left to an operator — an extraordinary cancellation (for cause). */
|
|
182
|
+
CancellationStatus["Review"] = "review";
|
|
183
|
+
})(CancellationStatus || (CancellationStatus = {}));
|
|
184
|
+
export var WithdrawalUnavailableReason;
|
|
185
|
+
(function (WithdrawalUnavailableReason) {
|
|
186
|
+
WithdrawalUnavailableReason["NotInScope"] = "not-in-scope";
|
|
187
|
+
WithdrawalUnavailableReason["Expired"] = "expired";
|
|
188
|
+
WithdrawalUnavailableReason["Withdrawn"] = "withdrawn";
|
|
189
|
+
/** Fully performed after consent: the right of withdrawal has expired, nothing would be reimbursed. */
|
|
190
|
+
WithdrawalUnavailableReason["Performed"] = "performed";
|
|
191
|
+
WithdrawalUnavailableReason["Unknown"] = "unknown";
|
|
192
|
+
})(WithdrawalUnavailableReason || (WithdrawalUnavailableReason = {}));
|
|
193
|
+
export var CancellationUnavailableReason;
|
|
194
|
+
(function (CancellationUnavailableReason) {
|
|
195
|
+
CancellationUnavailableReason["NoSubscription"] = "no-subscription";
|
|
196
|
+
CancellationUnavailableReason["Ended"] = "ended";
|
|
197
|
+
})(CancellationUnavailableReason || (CancellationUnavailableReason = {}));
|
|
198
|
+
export const ConsumerRegionSchema = {
|
|
199
|
+
type: 'string',
|
|
200
|
+
enum: Object.values(ConsumerRegion),
|
|
201
|
+
};
|
|
202
|
+
export const PurchaseKindSchema = {
|
|
203
|
+
type: 'string',
|
|
204
|
+
enum: Object.values(PurchaseKind),
|
|
205
|
+
};
|
|
206
|
+
export const ConsentKindSchema = {
|
|
207
|
+
type: 'string',
|
|
208
|
+
enum: Object.values(ConsentKind),
|
|
209
|
+
};
|
|
210
|
+
export const DeclarationKindSchema = {
|
|
211
|
+
type: 'string',
|
|
212
|
+
enum: Object.values(DeclarationKind),
|
|
213
|
+
};
|
|
214
|
+
export const DeclarationChannelSchema = {
|
|
215
|
+
type: 'string',
|
|
216
|
+
enum: Object.values(DeclarationChannel),
|
|
217
|
+
};
|
|
218
|
+
export const CancellationKindSchema = {
|
|
219
|
+
type: 'string',
|
|
220
|
+
enum: Object.values(CancellationKind),
|
|
221
|
+
};
|
|
222
|
+
export const WithdrawalStatusSchema = {
|
|
223
|
+
type: 'string',
|
|
224
|
+
enum: Object.values(WithdrawalStatus),
|
|
225
|
+
};
|
|
226
|
+
export const CancellationStatusSchema = {
|
|
227
|
+
type: 'string',
|
|
228
|
+
enum: Object.values(CancellationStatus),
|
|
229
|
+
};
|
|
230
|
+
export const WithdrawalUnavailableReasonSchema = {
|
|
231
|
+
type: 'string',
|
|
232
|
+
enum: Object.values(WithdrawalUnavailableReason),
|
|
233
|
+
};
|
|
234
|
+
export const CancellationUnavailableReasonSchema = {
|
|
235
|
+
type: 'string',
|
|
236
|
+
enum: Object.values(CancellationUnavailableReason),
|
|
237
|
+
};
|
|
47
238
|
export const ProductTypeSchema = {
|
|
48
239
|
type: 'string',
|
|
49
240
|
enum: Object.values(ProductType)
|
|
50
241
|
};
|
|
242
|
+
export const CheckoutPricingModeSchema = {
|
|
243
|
+
type: 'string',
|
|
244
|
+
enum: Object.values(CheckoutPricingMode),
|
|
245
|
+
};
|
|
51
246
|
export const PaymentEntityTypeSchema = {
|
|
52
247
|
type: 'string',
|
|
53
248
|
enum: Object.values(PaymentEntityType)
|
|
@@ -64,6 +259,30 @@ export const SubscriptionStatusSchema = {
|
|
|
64
259
|
type: 'string',
|
|
65
260
|
enum: Object.values(SubscriptionStatus)
|
|
66
261
|
};
|
|
262
|
+
export const LimitKindSchema = {
|
|
263
|
+
type: 'string',
|
|
264
|
+
enum: Object.values(LimitKind)
|
|
265
|
+
};
|
|
266
|
+
export const LimitWindowSchema = {
|
|
267
|
+
type: 'string',
|
|
268
|
+
enum: Object.values(LimitWindow)
|
|
269
|
+
};
|
|
270
|
+
export const PortalFlowSchema = {
|
|
271
|
+
type: 'string',
|
|
272
|
+
enum: Object.values(PortalFlow)
|
|
273
|
+
};
|
|
274
|
+
export const TaxBehaviorSchema = {
|
|
275
|
+
type: 'string',
|
|
276
|
+
enum: Object.values(TaxBehavior)
|
|
277
|
+
};
|
|
278
|
+
export const TaxEstimateStatusSchema = {
|
|
279
|
+
type: 'string',
|
|
280
|
+
enum: Object.values(TaxEstimateStatus)
|
|
281
|
+
};
|
|
282
|
+
export const TaxTypeSchema = {
|
|
283
|
+
type: 'string',
|
|
284
|
+
enum: Object.values(TaxType)
|
|
285
|
+
};
|
|
67
286
|
export const ProductTitleSchema = {
|
|
68
287
|
type: 'string', minLength: 1, maxLength: 128
|
|
69
288
|
};
|
|
@@ -79,29 +298,163 @@ export const PLAN_RECORD_TYPE = 'plan';
|
|
|
79
298
|
export const PLAN_RECORD_PREFIX = PLAN_RECORD_TYPE;
|
|
80
299
|
export const L10N_RECORD_TYPE = 'l10n';
|
|
81
300
|
export const L10N_RECORD_PREFIX = L10N_RECORD_TYPE;
|
|
301
|
+
/** A singleton record: at most one per configuration, at this fixed id. */
|
|
302
|
+
export const PRICING_POLICY_RECORD_TYPE = 'pricing-policy';
|
|
303
|
+
export const PRICING_POLICY_RECORD_ID = PRICING_POLICY_RECORD_TYPE;
|
|
304
|
+
/** A singleton record: the declared `ConsumerRightsPolicy`, at this fixed id. */
|
|
305
|
+
export const CONSUMER_RIGHTS_RECORD_TYPE = 'consumer-rights-policy';
|
|
306
|
+
export const CONSUMER_RIGHTS_RECORD_ID = CONSUMER_RIGHTS_RECORD_TYPE;
|
|
307
|
+
/** The i18n resource (library tier, `lib` namespace) holding the consumer-rights legal copy. */
|
|
308
|
+
export const CONSUMER_RIGHTS_RESOURCE = 'payment-consumer-rights';
|
|
309
|
+
/**
|
|
310
|
+
* The version of the legal copy this package ships. Bumped on ANY change to a
|
|
311
|
+
* `payment-consumer-rights` bundle, so a consent recorded against an older wording is told apart.
|
|
312
|
+
*/
|
|
313
|
+
export const CONSUMER_RIGHTS_COPY_VERSION = '2026-10-04.2';
|
|
82
314
|
export const DEFAULT_ALIAS = 'payment';
|
|
83
315
|
export const PAYMENT_SERVICE = DEFAULT_ALIAS;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
316
|
+
/**
|
|
317
|
+
* ISO 3166-1 alpha-2 country code → lowercase ISO 4217 currency code — the currency circulating in
|
|
318
|
+
* that country, for the "≈ local total" line of a price estimate. Not a Stripe list: Stripe Tax can
|
|
319
|
+
* compute a rate for a country this map has no entry for (or none at all, `location-required`), and
|
|
320
|
+
* `currencyOfCountry` returning `null` just means the estimate carries no local-currency line, never
|
|
321
|
+
* a rejected request.
|
|
322
|
+
*
|
|
323
|
+
* A territory that circulates another country's currency (Ecuador, Kosovo, Puerto Rico, …) is
|
|
324
|
+
* mapped to that currency, not left out.
|
|
325
|
+
*/
|
|
326
|
+
export const COUNTRY_CURRENCIES = Object.freeze({
|
|
327
|
+
AD: 'eur', AE: 'aed', AF: 'afn', AG: 'xcd', AI: 'xcd', AL: 'all', AM: 'amd', AO: 'aoa',
|
|
328
|
+
AR: 'ars', AS: 'usd', AT: 'eur', AU: 'aud', AW: 'awg', AX: 'eur', AZ: 'azn',
|
|
329
|
+
BA: 'bam', BB: 'bbd', BD: 'bdt', BE: 'eur', BF: 'xof', BG: 'bgn', BH: 'bhd', BI: 'bif',
|
|
330
|
+
BJ: 'xof', BL: 'eur', BM: 'bmd', BN: 'bnd', BO: 'bob', BQ: 'usd', BR: 'brl', BS: 'bsd',
|
|
331
|
+
BT: 'btn', BW: 'bwp', BY: 'byn', BZ: 'bzd',
|
|
332
|
+
CA: 'cad', CD: 'cdf', CF: 'xaf', CG: 'xaf', CH: 'chf', CI: 'xof', CK: 'nzd', CL: 'clp',
|
|
333
|
+
CM: 'xaf', CN: 'cny', CO: 'cop', CR: 'crc', CU: 'cup', CV: 'cve', CW: 'ang', CY: 'eur',
|
|
334
|
+
CZ: 'czk',
|
|
335
|
+
DE: 'eur', DJ: 'djf', DK: 'dkk', DM: 'xcd', DO: 'dop', DZ: 'dzd',
|
|
336
|
+
EC: 'usd', EE: 'eur', EG: 'egp', EH: 'mad', ER: 'ern', ES: 'eur', ET: 'etb',
|
|
337
|
+
FI: 'eur', FJ: 'fjd', FK: 'fkp', FM: 'usd', FO: 'dkk', FR: 'eur',
|
|
338
|
+
GA: 'xaf', GB: 'gbp', GD: 'xcd', GE: 'gel', GF: 'eur', GG: 'gbp', GH: 'ghs', GI: 'gip',
|
|
339
|
+
GL: 'dkk', GM: 'gmd', GN: 'gnf', GP: 'eur', GQ: 'xaf', GR: 'eur', GT: 'gtq', GU: 'usd',
|
|
340
|
+
GW: 'xof', GY: 'gyd',
|
|
341
|
+
HK: 'hkd', HN: 'hnl', HR: 'eur', HT: 'htg', HU: 'huf',
|
|
342
|
+
ID: 'idr', IE: 'eur', IL: 'ils', IM: 'gbp', IN: 'inr', IQ: 'iqd', IR: 'irr', IS: 'isk',
|
|
343
|
+
IT: 'eur',
|
|
344
|
+
JE: 'gbp', JM: 'jmd', JO: 'jod', JP: 'jpy',
|
|
345
|
+
KE: 'kes', KG: 'kgs', KH: 'khr', KI: 'aud', KM: 'kmf', KN: 'xcd', KP: 'kpw', KR: 'krw',
|
|
346
|
+
KW: 'kwd', KY: 'kyd', KZ: 'kzt',
|
|
347
|
+
LA: 'lak', LB: 'lbp', LC: 'xcd', LI: 'chf', LK: 'lkr', LR: 'lrd', LS: 'lsl', LT: 'eur',
|
|
348
|
+
LU: 'eur', LV: 'eur', LY: 'lyd',
|
|
349
|
+
MA: 'mad', MC: 'eur', MD: 'mdl', ME: 'eur', MF: 'eur', MG: 'mga', MH: 'usd', MK: 'mkd',
|
|
350
|
+
ML: 'xof', MM: 'mmk', MN: 'mnt', MO: 'mop', MQ: 'eur', MR: 'mru', MS: 'xcd', MT: 'eur',
|
|
351
|
+
MU: 'mur', MV: 'mvr', MW: 'mwk', MX: 'mxn', MY: 'myr', MZ: 'mzn',
|
|
352
|
+
NA: 'nad', NC: 'xpf', NE: 'xof', NG: 'ngn', NI: 'nio', NL: 'eur', NO: 'nok', NP: 'npr',
|
|
353
|
+
NR: 'aud', NU: 'nzd', NZ: 'nzd',
|
|
354
|
+
OM: 'omr',
|
|
355
|
+
PA: 'pab', PE: 'pen', PF: 'xpf', PG: 'pgk', PH: 'php', PK: 'pkr', PL: 'pln', PR: 'usd',
|
|
356
|
+
PS: 'ils', PT: 'eur', PW: 'usd', PY: 'pyg',
|
|
357
|
+
QA: 'qar',
|
|
358
|
+
RE: 'eur', RO: 'ron', RS: 'rsd', RU: 'rub', RW: 'rwf',
|
|
359
|
+
SA: 'sar', SB: 'sbd', SC: 'scr', SD: 'sdg', SE: 'sek', SG: 'sgd', SH: 'shp', SI: 'eur',
|
|
360
|
+
SK: 'eur', SL: 'sle', SM: 'eur', SN: 'xof', SO: 'sos', SR: 'srd', SS: 'ssp', ST: 'stn',
|
|
361
|
+
SV: 'usd', SX: 'ang', SY: 'syp', SZ: 'szl',
|
|
362
|
+
TC: 'usd', TD: 'xaf', TG: 'xof', TH: 'thb', TJ: 'tjs', TK: 'nzd', TL: 'usd', TM: 'tmt',
|
|
363
|
+
TN: 'tnd', TO: 'top', TR: 'try', TT: 'ttd', TV: 'aud', TW: 'twd', TZ: 'tzs',
|
|
364
|
+
UA: 'uah', UG: 'ugx', US: 'usd', UY: 'uyu', UZ: 'uzs',
|
|
365
|
+
VA: 'eur', VC: 'xcd', VE: 'ves', VG: 'usd', VI: 'usd', VN: 'vnd', VU: 'vuv',
|
|
366
|
+
WF: 'xpf', WS: 'wst',
|
|
367
|
+
YE: 'yer', YT: 'eur',
|
|
368
|
+
ZA: 'zar', ZM: 'zmw', ZW: 'zwl',
|
|
369
|
+
});
|
|
370
|
+
/** Every country code `COUNTRY_CURRENCIES` names, sorted. */
|
|
371
|
+
export const COUNTRY_CODES = Object.freeze(Object.keys(COUNTRY_CURRENCIES).sort());
|
|
372
|
+
/**
|
|
373
|
+
* A permissive ISO 3166-1 alpha-2 shape (two uppercase letters) — not restricted to
|
|
374
|
+
* `COUNTRY_CURRENCIES`, so a country this map cannot name a currency for is still a valid request;
|
|
375
|
+
* it only loses the local-currency line of its estimate.
|
|
376
|
+
*/
|
|
377
|
+
export const CountrySchema = {
|
|
378
|
+
type: 'string', pattern: '^[A-Z]{2}$',
|
|
106
379
|
};
|
|
380
|
+
/**
|
|
381
|
+
* The gate alias a paid capability is asserted under.
|
|
382
|
+
*
|
|
383
|
+
* Distinct from `paymentGate.base` (a ROUTE id) and from the gateway service alias — three
|
|
384
|
+
* different things that would otherwise all be called "payment gate".
|
|
385
|
+
*/
|
|
386
|
+
export const ENTITLEMENT_GATE = 'entitlement-gate';
|
|
387
|
+
/**
|
|
388
|
+
* The gate alias a plan limit is asserted under (`limit:<key>[>=n]`).
|
|
389
|
+
*
|
|
390
|
+
* A separate alias from `ENTITLEMENT_GATE` because the framework collects an entrypoint's gates
|
|
391
|
+
* per gate SERVICE: a capability requirement and a limit requirement under one alias would hide
|
|
392
|
+
* each other.
|
|
393
|
+
*/
|
|
394
|
+
export const LIMIT_GATE = 'limit-gate';
|
|
395
|
+
/**
|
|
396
|
+
* The capability scope that carries FEATURE flags.
|
|
397
|
+
*
|
|
398
|
+
* Kept apart from `renewable`, which carries numeric quotas that are consumed or counted. Merging
|
|
399
|
+
* them would make "has one production slot left" and "may remove the platform credit" the same
|
|
400
|
+
* number, and the first purchase that spent the quota would take the feature with it.
|
|
401
|
+
*/
|
|
402
|
+
export const CAPABILITY_FEATURE_SCOPE = 'feature';
|
|
403
|
+
/**
|
|
404
|
+
* The scope RESERVED for limit parameters (`limit:<key>[>=n]`).
|
|
405
|
+
*
|
|
406
|
+
* Never a declarable capability scope: a plan's limits live in `ProductPlan.limits`, and a
|
|
407
|
+
* capability predicate refuses any parameter under this scope, so a limit requirement can never be
|
|
408
|
+
* satisfied by a capability grant.
|
|
409
|
+
*/
|
|
410
|
+
export const CAPABILITY_LIMIT_SCOPE = 'limit';
|
|
411
|
+
/**
|
|
412
|
+
* Preserves today's fixed behavior for every consumer that declares no policy: automatic tax and
|
|
413
|
+
* tax-id collection stay on for every checkout (`taxOptions` before this policy existed), no
|
|
414
|
+
* `behavior` is forced onto a synced price, no Adaptive Pricing, and the estimate endpoints are off
|
|
415
|
+
* (a new capability, opt-in only).
|
|
416
|
+
*/
|
|
417
|
+
export const DEFAULT_PRICING_POLICY = Object.freeze({
|
|
418
|
+
tax: Object.freeze({ automatic: true, collectTaxId: true, estimate: false }),
|
|
419
|
+
currency: Object.freeze({ estimate: false }),
|
|
420
|
+
});
|
|
421
|
+
/** The window key a lifetime limit's counter lives under. */
|
|
422
|
+
export const LIFETIME_WINDOW = 'lifetime';
|
|
423
|
+
/** The window key an occupancy limit's counter lives under. */
|
|
424
|
+
export const OCCUPANCY_WINDOW = 'occupancy';
|
|
425
|
+
/** The 27 EU member states (ISO 3166-1 alpha-2; Greece is `GR`, as Stripe reports it). */
|
|
426
|
+
export const EU_COUNTRIES = Object.freeze([
|
|
427
|
+
'AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GR', 'HR', 'HU',
|
|
428
|
+
'IE', 'IT', 'LT', 'LU', 'LV', 'MT', 'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK',
|
|
429
|
+
]);
|
|
430
|
+
/**
|
|
431
|
+
* The member states plus the parts of them that carry their own ISO code — Åland (FI) and the
|
|
432
|
+
* French outermost regions (French Guiana, Guadeloupe, Martinique, Réunion, Mayotte, Saint-Martin).
|
|
433
|
+
* EU consumer law applies there even where EU VAT does not; the Canary Islands, Azores and Madeira
|
|
434
|
+
* share their state's code. Scope beyond the member states is a question for the lawyer.
|
|
435
|
+
*/
|
|
436
|
+
export const EU_CONSUMER_TERRITORIES = Object.freeze([
|
|
437
|
+
...EU_COUNTRIES, 'AX', 'GF', 'GP', 'MQ', 'RE', 'YT', 'MF',
|
|
438
|
+
]);
|
|
439
|
+
/** The EEA members outside the EU. */
|
|
440
|
+
export const EEA_EXTRA = Object.freeze(['IS', 'LI', 'NO']);
|
|
441
|
+
/** The territories whose consumers have the right of withdrawal by default: the EU's and the EEA's. */
|
|
442
|
+
export const CONSUMER_RIGHTS_TERRITORIES = Object.freeze([
|
|
443
|
+
...EU_CONSUMER_TERRITORIES, ...EEA_EXTRA,
|
|
444
|
+
]);
|
|
445
|
+
/**
|
|
446
|
+
* Country → the language of its legal copy, only where that is unambiguous (Belgium, Luxembourg,
|
|
447
|
+
* Switzerland, Canada … are absent and fall back to the policy's default). An application widens
|
|
448
|
+
* or overrides it with `ConsumerRightsPolicy.languages`.
|
|
449
|
+
*/
|
|
450
|
+
export const COUNTRY_LANGUAGES = Object.freeze({
|
|
451
|
+
DE: 'de', AT: 'de', LI: 'de',
|
|
452
|
+
FR: 'fr', GF: 'fr', GP: 'fr', MQ: 'fr', RE: 'fr', YT: 'fr', MF: 'fr', MC: 'fr',
|
|
453
|
+
PL: 'pl',
|
|
454
|
+
ES: 'es',
|
|
455
|
+
IE: 'en', MT: 'en', GB: 'en', US: 'en', AU: 'en', NZ: 'en',
|
|
456
|
+
UA: 'uk',
|
|
457
|
+
BY: 'be',
|
|
458
|
+
RU: 'ru',
|
|
459
|
+
});
|
|
107
460
|
//# sourceMappingURL=consts.js.map
|
package/build/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,kCAAmB,CAAA;IACnB,wCAAyB,CAAA;AAC3B,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,kCAAa,CAAA;IACb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,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;CACT,CAAC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pricing policy record carries only flags and TTLs (never a Stripe secret, an API version, or
|
|
3
|
+
* a migration switch — those stay in a backend-only plugin), so advertising it to the browser is
|
|
4
|
+
* safe. The consumer-rights policy record carries only public links, territories and switches
|
|
5
|
+
* (the mail options — sender, archive copy — stay in a backend-only plugin config), so the browser
|
|
6
|
+
* renders the same links and switches the server enforces.
|
|
7
|
+
*/
|
|
8
|
+
export declare const advertisedRecordTypes: Set<string>;
|
|
9
|
+
export declare const CAPABILITY_REQUIRED_MARKER = "capability-required:";
|
|
10
|
+
export declare const LIMIT_EXHAUSTED_MARKER = "limit-exhausted:";
|
|
11
|
+
export declare const LIMIT_EXHAUSTED_FIELDS: RegExp;
|
|
12
|
+
export declare const PERFORMANCE_CONSENT_MARKER = "performance-consent-required:";
|
|
13
|
+
export declare const SUBSCRIPTION_START_MARKER = "subscription-start-required:";
|
|
14
|
+
export declare const BILLING_COUNTRY_LOCKED_MARKER = "billing-country-locked:";
|
|
15
|
+
export declare const WITHDRAWAL_UNAVAILABLE_MARKER = "withdrawal-unavailable:";
|
|
16
|
+
export declare const CANCELLATION_UNAVAILABLE_MARKER = "cancellation-unavailable:";
|
|
17
|
+
export declare const CHECKOUT_LIMIT_MARKER = "checkout-limit-exceeded:";
|
|
18
|
+
export declare const PLAN_DATES: readonly ['subscribedAt', 'periodStart', 'periodEnd', 'trialEnd', 'pausedAt'];
|
|
19
|
+
export declare const LIMIT_DATES: readonly ['windowStart', 'resetsAt'];
|
|
20
|
+
//# sourceMappingURL=consts.local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../src/consts.local.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,aAEhC,CAAA;AAEF,eAAO,MAAM,0BAA0B,yBAAyB,CAAA;AAEhE,eAAO,MAAM,sBAAsB,qBAAqB,CAAA;AAExD,eAAO,MAAM,sBAAsB,QAAwC,CAAA;AAE3E,eAAO,MAAM,0BAA0B,kCAAkC,CAAA;AAEzE,eAAO,MAAM,yBAAyB,iCAAiC,CAAA;AAEvE,eAAO,MAAM,6BAA6B,4BAA4B,CAAA;AAEtE,eAAO,MAAM,6BAA6B,4BAA4B,CAAA;AAEtE,eAAO,MAAM,+BAA+B,8BAA8B,CAAA;AAE1E,eAAO,MAAM,qBAAqB,6BAA6B,CAAA;AAE/D,eAAO,MAAM,UAAU,YAAI,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,CAAU,CAAA;AAEvG,eAAO,MAAM,WAAW,YAAI,aAAa,EAAE,UAAU,CAAU,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CONSUMER_RIGHTS_RECORD_TYPE, L10N_RECORD_TYPE, PLAN_RECORD_TYPE, PRICING_POLICY_RECORD_TYPE, PRODUCT_RECORD_TYPE } from './consts.js';
|
|
2
|
+
/**
|
|
3
|
+
* The pricing policy record carries only flags and TTLs (never a Stripe secret, an API version, or
|
|
4
|
+
* a migration switch — those stay in a backend-only plugin), so advertising it to the browser is
|
|
5
|
+
* safe. The consumer-rights policy record carries only public links, territories and switches
|
|
6
|
+
* (the mail options — sender, archive copy — stay in a backend-only plugin config), so the browser
|
|
7
|
+
* renders the same links and switches the server enforces.
|
|
8
|
+
*/
|
|
9
|
+
export const advertisedRecordTypes = new Set([
|
|
10
|
+
L10N_RECORD_TYPE, PLAN_RECORD_TYPE, PRODUCT_RECORD_TYPE, PRICING_POLICY_RECORD_TYPE, CONSUMER_RIGHTS_RECORD_TYPE,
|
|
11
|
+
]);
|
|
12
|
+
export const CAPABILITY_REQUIRED_MARKER = 'capability-required:';
|
|
13
|
+
export const LIMIT_EXHAUSTED_MARKER = 'limit-exhausted:';
|
|
14
|
+
export const LIMIT_EXHAUSTED_FIELDS = /^(.*):([^:/]+)\/([^:/]+)(?::(.+))?$/;
|
|
15
|
+
export const PERFORMANCE_CONSENT_MARKER = 'performance-consent-required:';
|
|
16
|
+
export const SUBSCRIPTION_START_MARKER = 'subscription-start-required:';
|
|
17
|
+
export const BILLING_COUNTRY_LOCKED_MARKER = 'billing-country-locked:';
|
|
18
|
+
export const WITHDRAWAL_UNAVAILABLE_MARKER = 'withdrawal-unavailable:';
|
|
19
|
+
export const CANCELLATION_UNAVAILABLE_MARKER = 'cancellation-unavailable:';
|
|
20
|
+
export const CHECKOUT_LIMIT_MARKER = 'checkout-limit-exceeded:';
|
|
21
|
+
export const PLAN_DATES = ['subscribedAt', 'periodStart', 'periodEnd', 'trialEnd', 'pausedAt'];
|
|
22
|
+
export const LIMIT_DATES = ['windowStart', 'resetsAt'];
|
|
23
|
+
//# sourceMappingURL=consts.local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../src/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAE9I;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IAC3C,gBAAgB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,2BAA2B;CACjH,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,sBAAsB,CAAA;AAEhE,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAA;AAExD,MAAM,CAAC,MAAM,sBAAsB,GAAG,qCAAqC,CAAA;AAE3E,MAAM,CAAC,MAAM,0BAA0B,GAAG,+BAA+B,CAAA;AAEzE,MAAM,CAAC,MAAM,yBAAyB,GAAG,8BAA8B,CAAA;AAEvE,MAAM,CAAC,MAAM,6BAA6B,GAAG,yBAAyB,CAAA;AAEtE,MAAM,CAAC,MAAM,6BAA6B,GAAG,yBAAyB,CAAA;AAEtE,MAAM,CAAC,MAAM,+BAA+B,GAAG,2BAA2B,CAAA;AAE1E,MAAM,CAAC,MAAM,qBAAqB,GAAG,0BAA0B,CAAA;AAE/D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,CAAU,CAAA;AAEvG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,aAAa,EAAE,UAAU,CAAU,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BillingInterval } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* When an ordinary cancellation takes effect. No requested date, or one on or before the current
|
|
4
|
+
* period's end, ends the contract at `periodEnd`; a later date ends it at the first period
|
|
5
|
+
* boundary on or after that date — whole intervals stepped from `periodEnd`, each step measured
|
|
6
|
+
* from `periodEnd` itself so a 31st stays the 31st where the month has one.
|
|
7
|
+
*
|
|
8
|
+
* @throws ConsumerRightsError (`cancellation:date`) for an invalid date.
|
|
9
|
+
*/
|
|
10
|
+
export declare const cancellationEffectiveAt: (periodEnd: Date, interval: BillingInterval, requested?: Date | null) => Date;
|
|
11
|
+
//# sourceMappingURL=cancel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../src/consumer/cancel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAcjD;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,cAAe,IAAI,YAAY,eAAe,cAAc,IAAI,GAAG,IAAI,KAAG,IAgB7G,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ConsumerRightsError } from '../errors.js';
|
|
2
|
+
/** `anchor` moved by `months` calendar months (UTC), its day clamped to the target month's end. */
|
|
3
|
+
const addMonths = (anchor, months) => {
|
|
4
|
+
const year = anchor.getUTCFullYear();
|
|
5
|
+
const month = anchor.getUTCMonth() + months;
|
|
6
|
+
const lastDay = new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
|
|
7
|
+
return new Date(Date.UTC(year, month, Math.min(anchor.getUTCDate(), lastDay), anchor.getUTCHours(), anchor.getUTCMinutes(), anchor.getUTCSeconds(), anchor.getUTCMilliseconds()));
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* When an ordinary cancellation takes effect. No requested date, or one on or before the current
|
|
11
|
+
* period's end, ends the contract at `periodEnd`; a later date ends it at the first period
|
|
12
|
+
* boundary on or after that date — whole intervals stepped from `periodEnd`, each step measured
|
|
13
|
+
* from `periodEnd` itself so a 31st stays the 31st where the month has one.
|
|
14
|
+
*
|
|
15
|
+
* @throws ConsumerRightsError (`cancellation:date`) for an invalid date.
|
|
16
|
+
*/
|
|
17
|
+
export const cancellationEffectiveAt = (periodEnd, interval, requested) => {
|
|
18
|
+
if (Number.isNaN(periodEnd.getTime()) || (requested != null && Number.isNaN(requested.getTime()))) {
|
|
19
|
+
throw new ConsumerRightsError('cancellation:date');
|
|
20
|
+
}
|
|
21
|
+
if (requested == null || requested.getTime() <= periodEnd.getTime()) {
|
|
22
|
+
return periodEnd;
|
|
23
|
+
}
|
|
24
|
+
const step = interval === 'year' ? 12 : 1;
|
|
25
|
+
let count = 1;
|
|
26
|
+
let candidate = addMonths(periodEnd, step);
|
|
27
|
+
while (candidate.getTime() < requested.getTime()) {
|
|
28
|
+
count += 1;
|
|
29
|
+
candidate = addMonths(periodEnd, step * count);
|
|
30
|
+
}
|
|
31
|
+
return candidate;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=cancel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../src/consumer/cancel.ts"],"names":[],"mappings":"AAAA,OAA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EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IACzC,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;IAC1C,OAAO,SAAS,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC;QACjD,KAAK,IAAI,CAAC,CAAA;QACV,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC,CAAA;IAChD,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ConsumerRightsMechanisms, ConsumerRightsPolicy } from '../types.js';
|
|
2
|
+
export declare const DAY_MS = 86400000;
|
|
3
|
+
/** Every mechanism off: declaring a policy changes nothing until the application switches one on. */
|
|
4
|
+
export declare const NO_CONSUMER_RIGHTS_MECHANISMS: ConsumerRightsMechanisms;
|
|
5
|
+
/**
|
|
6
|
+
* What a declaration leaves out: the EU and EEA territories, an unknown country protected, 14 days
|
|
7
|
+
* ending at the end of a UTC day, a weekend end moved to Monday, five margin days, every mechanism
|
|
8
|
+
* off, English as the default language, start requests usable for an hour.
|
|
9
|
+
*
|
|
10
|
+
* Five margin days because a period ending on a public holiday runs to the next working day (EU
|
|
11
|
+
* Reg. 1182/71 art. 3(4)) and holiday clusters (24–26 December plus a weekend, Maundy Thursday to
|
|
12
|
+
* Easter Monday) need up to five; no per-country holiday calendar is kept, so a generous margin
|
|
13
|
+
* keeps the withdrawal function open for the whole statutory period everywhere.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_CONSUMER_RIGHTS: Readonly<Omit<ConsumerRightsPolicy, 'textVersion' | 'links'>>;
|
|
16
|
+
export declare const CONSUMER_RIGHTS_API_PATH = "/consumer-rights";
|
|
17
|
+
export declare const CONSUMER_RIGHTS_PUBLIC_PATH = "/public/consumer-rights";
|
|
18
|
+
export declare const CONSUMER_RIGHTS_WITHDRAWAL_SCREEN_PATH = "/legal/withdraw";
|
|
19
|
+
export declare const CONSUMER_RIGHTS_CANCELLATION_SCREEN_PATH = "/legal/cancel";
|
|
20
|
+
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/consumer/consts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAGjF,eAAO,MAAM,MAAM,WAAa,CAAA;AAEhC,qGAAqG;AACrG,eAAO,MAAM,6BAA6B,EAAE,wBAS1C,CAAA;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,aAAa,GAAG,OAAO,CAAC,CAUhG,CAAA;AAEF,eAAO,MAAM,wBAAwB,qBAAqB,CAAA;AAE1D,eAAO,MAAM,2BAA2B,4BAA4B,CAAA;AAEpE,eAAO,MAAM,sCAAsC,oBAAoB,CAAA;AAEvE,eAAO,MAAM,wCAAwC,kBAAkB,CAAA"}
|