@owlmeans/payment 0.1.18-rc.46 → 0.1.18-rc.47
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 +2 -2
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/payment/SKILL.md +49 -15
- package/build/advertise.js +1 -11
- package/build/advertise.js.map +1 -1
- 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 +2 -0
- package/build/checkout/index.d.ts.map +1 -1
- package/build/checkout/index.js +1 -0
- package/build/checkout/index.js.map +1 -1
- package/build/checkout/narrow.d.ts +1 -4
- package/build/checkout/narrow.d.ts.map +1 -1
- package/build/checkout/narrow.js.map +1 -1
- package/build/checkout/protocols.d.ts +1 -25
- package/build/checkout/protocols.d.ts.map +1 -1
- package/build/checkout/protocols.js +1 -1
- package/build/checkout/protocols.js.map +1 -1
- 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 +80 -1
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +143 -1
- 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 +1 -1
- package/build/consumer/cancel.d.ts.map +1 -1
- package/build/consumer/cancel.js.map +1 -1
- 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 +4 -0
- package/build/consumer/consts.local.d.ts.map +1 -0
- package/build/consumer/consts.local.js +4 -0
- package/build/consumer/consts.local.js.map +1 -0
- package/build/consumer/copy.d.ts +19 -23
- package/build/consumer/copy.d.ts.map +1 -1
- package/build/consumer/copy.js +29 -8
- package/build/consumer/copy.js.map +1 -1
- package/build/consumer/deadline.d.ts +2 -18
- package/build/consumer/deadline.d.ts.map +1 -1
- package/build/consumer/deadline.js +1 -1
- package/build/consumer/deadline.js.map +1 -1
- package/build/consumer/fifo.d.ts +1 -27
- package/build/consumer/fifo.d.ts.map +1 -1
- package/build/consumer/fifo.js +0 -6
- package/build/consumer/fifo.js.map +1 -1
- package/build/consumer/index.d.ts +2 -0
- package/build/consumer/index.d.ts.map +1 -1
- package/build/consumer/index.js +1 -0
- package/build/consumer/index.js.map +1 -1
- package/build/consumer/policy.d.ts +5 -21
- package/build/consumer/policy.d.ts.map +1 -1
- package/build/consumer/policy.js +8 -37
- package/build/consumer/policy.js.map +1 -1
- package/build/consumer/protocols.d.ts +1 -86
- package/build/consumer/protocols.d.ts.map +1 -1
- package/build/consumer/protocols.js +1 -4
- package/build/consumer/protocols.js.map +1 -1
- package/build/consumer/refund.d.ts +1 -51
- package/build/consumer/refund.d.ts.map +1 -1
- package/build/consumer/refund.js +1 -1
- package/build/consumer/refund.js.map +1 -1
- package/build/consumer/revive.d.ts.map +1 -1
- package/build/consumer/revive.js +3 -0
- package/build/consumer/revive.js.map +1 -1
- 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 +10 -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 +0 -18
- package/build/countries.d.ts.map +1 -1
- package/build/countries.js +1 -62
- package/build/countries.js.map +1 -1
- package/build/entitlement.d.ts +1 -39
- package/build/entitlement.d.ts.map +1 -1
- package/build/entitlement.js +1 -31
- package/build/entitlement.js.map +1 -1
- package/build/errors.d.ts +1 -27
- package/build/errors.d.ts.map +1 -1
- package/build/errors.js +1 -9
- package/build/errors.js.map +1 -1
- package/build/estimate.d.ts +1 -27
- package/build/estimate.d.ts.map +1 -1
- package/build/estimate.js +0 -10
- package/build/estimate.js.map +1 -1
- package/build/i18n/consumer-rights/be.json +12 -4
- package/build/i18n/consumer-rights/de.json +12 -4
- package/build/i18n/consumer-rights/en.json +12 -4
- package/build/i18n/consumer-rights/es.json +12 -4
- package/build/i18n/consumer-rights/fr.json +12 -4
- package/build/i18n/consumer-rights/pl.json +12 -4
- package/build/i18n/consumer-rights/ru.json +12 -4
- package/build/i18n/consumer-rights/uk.json +12 -4
- package/build/limit.d.ts +1 -10
- package/build/limit.d.ts.map +1 -1
- package/build/limit.js +2 -6
- package/build/limit.js.map +1 -1
- package/build/model/checkout.js +1 -1
- 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 +1 -10
- package/build/model/consumer.d.ts.map +1 -1
- package/build/model/consumer.js +7 -160
- package/build/model/consumer.js.map +1 -1
- package/build/model/estimate.d.ts.map +1 -1
- package/build/model/estimate.js +2 -27
- package/build/model/estimate.js.map +1 -1
- package/build/model/index.d.ts +1 -0
- package/build/model/index.d.ts.map +1 -1
- package/build/model/index.js +1 -0
- package/build/model/index.js.map +1 -1
- package/build/model/plan.js +1 -1
- package/build/model/plan.js.map +1 -1
- package/build/model/view.d.ts +1 -6
- package/build/model/view.d.ts.map +1 -1
- package/build/model/view.js +2 -73
- package/build/model/view.js.map +1 -1
- package/build/regions.d.ts +1 -21
- package/build/regions.d.ts.map +1 -1
- package/build/regions.js +1 -36
- package/build/regions.js.map +1 -1
- package/build/service.d.ts.map +1 -1
- package/build/service.js +1 -3
- package/build/service.js.map +1 -1
- package/build/types.d.ts +71 -0
- 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.d.ts.map +1 -1
- package/build/view.js +3 -4
- package/build/view.js.map +1 -1
- package/package.json +11 -11
- package/src/advertise.ts +1 -14
- package/src/checkout/consts.ts +1 -0
- package/src/checkout/index.ts +2 -0
- package/src/checkout/narrow.ts +1 -5
- package/src/checkout/protocols.ts +3 -24
- package/src/checkout/types.ts +27 -0
- package/src/consts.local.ts +34 -0
- package/src/consts.ts +158 -1
- package/src/consumer/cancel.ts +1 -2
- package/src/consumer/consts.local.ts +5 -0
- package/src/consumer/consts.ts +46 -0
- package/src/consumer/copy.ts +36 -28
- package/src/consumer/deadline.ts +3 -21
- package/src/consumer/fifo.ts +2 -27
- package/src/consumer/index.ts +2 -0
- package/src/consumer/policy.ts +9 -45
- package/src/consumer/protocols.ts +4 -79
- package/src/consumer/refund.ts +2 -53
- package/src/consumer/revive.ts +1 -2
- package/src/consumer/types.local.ts +10 -0
- package/src/consumer/types.ts +188 -0
- package/src/countries.ts +1 -64
- package/src/entitlement.ts +2 -44
- package/src/errors.ts +2 -47
- package/src/estimate.ts +1 -27
- package/src/i18n/consumer-rights/be.json +12 -4
- package/src/i18n/consumer-rights/de.json +12 -4
- package/src/i18n/consumer-rights/en.json +12 -4
- package/src/i18n/consumer-rights/es.json +12 -4
- package/src/i18n/consumer-rights/fr.json +12 -4
- package/src/i18n/consumer-rights/pl.json +12 -4
- package/src/i18n/consumer-rights/ru.json +12 -4
- package/src/i18n/consumer-rights/uk.json +12 -4
- package/src/limit.ts +3 -17
- package/src/model/checkout.ts +1 -1
- package/src/model/consts.local.ts +83 -0
- package/src/model/consts.ts +206 -0
- package/src/model/consumer.ts +8 -183
- package/src/model/estimate.ts +3 -30
- package/src/model/index.ts +1 -0
- package/src/model/plan.ts +1 -1
- package/src/model/view.ts +3 -82
- package/src/regions.ts +2 -43
- package/src/service.ts +3 -10
- package/src/types.local.ts +5 -0
- package/src/types.ts +73 -0
- package/src/view.ts +4 -6
- package/tests/consumer-copy.spec.ts +193 -8
- package/tests/consumer-wire.spec.ts +43 -2
- package/tests/entitlement.spec.ts +2 -4
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ server integration (`@owlmeans/server-payment`) implements against these contrac
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
bun add @owlmeans/payment@^0.1.18-rc.
|
|
11
|
+
bun add @owlmeans/payment@^0.1.18-rc.47
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## Concepts
|
|
@@ -129,7 +129,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
129
129
|
your project's skill store (`.agents/skills/`):
|
|
130
130
|
|
|
131
131
|
```sh
|
|
132
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
132
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.48
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/payment",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-10-
|
|
4
|
+
"version": "0.1.18-rc.47",
|
|
5
|
+
"generatedAt": "2026-10-05T08:32:19.125Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/payment
|
|
9
9
|
|
|
10
10
|
**Layer:** Core
|
|
11
|
-
**Install:** `"@owlmeans/payment": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/payment": "^0.1.18-rc.47"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
The contracts half of payments: the catalogue (products, plans, localizations), amount- and
|
|
14
14
|
quantity-priced checkout, the entitlement model — plan capabilities, counted limits, promos,
|
|
@@ -48,7 +48,7 @@ admission, the usage ledger, the two gate services — is the `entitlements` ski
|
|
|
48
48
|
| `ConsumerRightsPolicy` (+ `Links`, `Mechanisms`, schemas) · `DEFAULT_CONSUMER_RIGHTS` · `makeConsumerRightsPolicy` · `assertConsumerRightsPolicy` · `linksOf` · `CONSUMER_RIGHTS_RECORD_TYPE`/`_ID` | The consumer-rights policy record. |
|
|
49
49
|
| `BillingProfileView` · `PurchaseView`/`List` · `PerformanceConsentView`/`Body`/`Response` · `SubscriptionStartView`/`Query`/`Body`/`Response` · `WithdrawalEstimate` · `WithdrawalCandidate`/`List` · `WithdrawalBody` · `DeclarationReceipt` · `WithdrawalReceipt` · `CancellationBody` · `CancellationReceipt` · `ConsumerRightsPublicView` (+ schemas) · `revive*` | Consumer-rights wire shapes (ISO dates) and their revivers. |
|
|
50
50
|
| `withdrawalDeadlineOf` · `lastWithdrawalDayOf` · `withdrawalOpen` · `oneTimeWithdrawalRefund` · `subscriptionWithdrawalRefund` · `splitByShares` · `allocateFifo` · `unitsUsedAfter` · `cancellationEffectiveAt` | Pure calculators. |
|
|
51
|
-
| `CONSUMER_RIGHTS_RESOURCE` · `CONSUMER_RIGHTS_COPY_VERSION` · `consumerRightsCopy` · `consumerText` · `consentStatementOf` · `legalLabelsOf` · `placeholdersOf` | The legal copy. |
|
|
51
|
+
| `CONSUMER_RIGHTS_RESOURCE` · `CONSUMER_RIGHTS_COPY_VERSION` · `consumerRightsCopy` · `consumerText` · `consentStatementOf` · `startContextOf` · `legalLabelsOf` · `placeholdersOf` | The legal copy and the start statement's variant. |
|
|
52
52
|
| `makeConsumerRightsProtocols` · `makeCheckoutReadProtocols` | Protocol factories. |
|
|
53
53
|
| `AmountNarrowing` · `narrowAmountPolicy` · `amountAllowed` · `CheckoutLimitView` · `AmountPolicyView`/`Query` · `PlanPriceView`/`List`/`PlanPricesQuery` (+ schemas) | Per-entity narrowing of an amount checkout, and synced plan prices. |
|
|
54
54
|
|
|
@@ -310,15 +310,20 @@ day and holiday clusters need up to five, no per-country calendar is kept —, e
|
|
|
310
310
|
usable 3600 s) — and `assertConsumerRightsPolicy` (non-empty `textVersion`, `^[A-Z]{2}$`
|
|
311
311
|
countries, `withdrawalDays >= 14`, margin 0..7, lowercase currencies, https links, the default
|
|
312
312
|
language present, `withdrawalInformation` required while `withdrawal` or `performanceConsent` is
|
|
313
|
-
on
|
|
314
|
-
|
|
315
|
-
|
|
313
|
+
on, `consentContext` a lowercase key `^[a-z][a-z0-9-]*$`; throws
|
|
314
|
+
`ConsumerRightsError('policy:<field>')`). It carries only public links, territories, switches and
|
|
315
|
+
the consent context — mail options live in a backend-only plugin config — so it is ADVERTISED to
|
|
316
|
+
the browser like the pricing policy. **`consentContext`** names the copy variant of the
|
|
317
|
+
performance consent (`'included'`: the credit limits included in a plan are used first, so the
|
|
318
|
+
consent covers topped-up credits once those limits have run out): the server records and mails, and the dialog
|
|
319
|
+
shows, the `_<context>` texts (§ The legal copy); absent, the base texts. `PaymentService.consumerRightsPolicy()` answers `null` when none
|
|
316
320
|
is declared: no consumer-rights behaviour at all. `linksOf(policy, lng)` merges a language's links
|
|
317
321
|
field by field over the default language's (`de-AT` reads `de`).
|
|
318
322
|
|
|
319
323
|
`ProductPlan.withdrawal.components: PlanWithdrawalComponent[]` (`{ key, basis: 'time' | 'units',
|
|
320
324
|
shareMinor }`) states the separately priced parts of a subscription (CJEU C-641/19 PE Digital:
|
|
321
|
-
without them the whole price is pro rata by time).
|
|
325
|
+
without them the whole price is pro rata by time). The same declaration picks the subscription start
|
|
326
|
+
statement: a `units` part makes it the `_units` variant (`startContextOf`, § The legal copy).
|
|
322
327
|
|
|
323
328
|
### Wire views
|
|
324
329
|
|
|
@@ -327,7 +332,9 @@ Every view schema carries dates as ISO strings (as `model/view.ts` does) and is
|
|
|
327
332
|
`reviveConsentResponse`, `reviveStartResponse`, `reviveWithdrawalList`, `reviveReceipt`,
|
|
328
333
|
`reviveCheckoutLimit`, `reviveAmountPolicyView`) — idempotent. A nullable enum on the wire lists
|
|
329
334
|
`null` in its enum (ajv rejects `null` otherwise). The consent and start views carry `trader`, the
|
|
330
|
-
name the statement is rendered with,
|
|
335
|
+
name the statement is rendered with, and `context`, the variant it is rendered with — the consent
|
|
336
|
+
view the policy's `consentContext`, the start view `startContextOf(plan)` (`'units'`), each absent
|
|
337
|
+
for the base — so the server's record and the dialog's text are identical.
|
|
331
338
|
`WithdrawalBody` and `CancellationBody` ask only for name, contract and e-mail (plus the
|
|
332
339
|
cancellation kind, reason and date) and accept an optional `honeypot` a person never fills. A
|
|
333
340
|
public declaration answers `DeclarationReceipt` — what was declared and when, never whether a
|
|
@@ -386,10 +393,11 @@ The i18n resource `payment-consumer-rights` (`CONSUMER_RIGHTS_RESOURCE`, library
|
|
|
386
393
|
namespace), in en pl ru be uk es de fr, versioned by `CONSUMER_RIGHTS_COPY_VERSION` (bump it on ANY
|
|
387
394
|
change to a bundle). Branches: `performance-consent`, `subscription-start` (`title`, `intro`,
|
|
388
395
|
`request`, `acknowledgement`, `checkbox` = request + space + acknowledgement, `confirm`,
|
|
389
|
-
`decline`; the consent branch also `purchase
|
|
396
|
+
`decline`; the consent branch also `purchase`; the start branch's `request`/`acknowledgement`/
|
|
397
|
+
`checkbox` also as `_units`), `withdrawal`, `cancellation` (form labels and the
|
|
390
398
|
statutory buttons `function` / `confirm`), `links`, `checkout` (`terms-acceptance.{in-scope,
|
|
391
399
|
other}` markdown, `renewal.{month, year, after-submit}`, `price.{exclusive, inclusive, exclusive-tax}` (VAT wording for the territories, "applicable tax" for a buyer outside them), `top-up`,
|
|
392
|
-
`top-up-note`), `email.{common, consent, start, purchase, withdrawal, cancellation}` (the purchase
|
|
400
|
+
`top-up-note`), `email.{common, consent, start (`rule` + `rule_units`), purchase, withdrawal, cancellation}` (the purchase
|
|
393
401
|
mail carries the CRD Annex I(A) withdrawal information with the function's address and the Annex
|
|
394
402
|
I(B) model form, per language from the national models; there `{{trader}}` is the trader's whole
|
|
395
403
|
identity — legal name, address, e-mail; a `review` withdrawal receipt promises the reimbursement
|
|
@@ -398,11 +406,35 @@ whose status is `CancellationStatus.Review`), `credit-note.memo`. In the consent
|
|
|
398
406
|
STATEMENTS `{{trader}}` is the trader's short name.
|
|
399
407
|
|
|
400
408
|
- Read it with `consumerRightsCopy(lng)` (any language, merged key by key over English, no i18next
|
|
401
|
-
instance, never drains a bundle — `resolveI18nResource`), `consumerText(lng, path, vars
|
|
402
|
-
`{{name}}`; throws `ConsumerRightsError('copy:<path>[:<name>]')` on a missing
|
|
403
|
-
legal text never goes out with a hole), `consentStatementOf(lng, kind, {
|
|
404
|
-
exact statement the dialog shows, the server records and the
|
|
405
|
-
`legalLabelsOf(lng)`.
|
|
409
|
+
instance, never drains a bundle — `resolveI18nResource`), `consumerText(lng, path, vars,
|
|
410
|
+
context?)` (fills `{{name}}`; throws `ConsumerRightsError('copy:<path>[:<name>]')` on a missing
|
|
411
|
+
text or value — a legal text never goes out with a hole), `consentStatementOf(lng, kind, {
|
|
412
|
+
trader, plan?, context? })` (the exact statement the dialog shows, the server records and the
|
|
413
|
+
mail repeats) and `legalLabelsOf(lng)`.
|
|
414
|
+
- **Context variants** (the i18next context suffix): with a `context`, `consumerText` reads
|
|
415
|
+
`<path>_<context>` first and the base `path` only where no such variant exists (a missing value
|
|
416
|
+
then names the variant: `copy:<path>_<context>:<name>`); an empty context is none.
|
|
417
|
+
`consentStatementOf` passes its `context` to all three texts. Shipped variants, all eight
|
|
418
|
+
languages, same placeholders as the base keys, each request keeping the base request's statutory
|
|
419
|
+
opening verbatim; a new variant lands in every language at once, with its base key's placeholders:
|
|
420
|
+
- `performance-consent.{title,intro,request,checkbox}_included` — the consuming platform's
|
|
421
|
+
vocabulary: "topped-up credits" (pl doładowane, ru пополненные, be папоўненыя, uk поповнені, es
|
|
422
|
+
recargados, de aufgeladene, fr rechargés) are spent once "the credit limits included in my plan"
|
|
423
|
+
(a plan's non-monetary credits) have run out; `checkbox_included` = `request_included` + space +
|
|
424
|
+
the BASE `acknowledgement` (generic "credits", so `acknowledgement` has no variant).
|
|
425
|
+
- **The subscription start statement follows the plan's withdrawal arithmetic.** The BASE
|
|
426
|
+
`subscription-start.{request,acknowledgement,checkbox}` and `email.start.rule` describe the
|
|
427
|
+
common case — the plan withdrawn pro rata by the DAYS ELAPSED only ("starts the {{plan}}
|
|
428
|
+
services — including the AI work within the usage the plan includes — now …; … I pay for the
|
|
429
|
+
services provided until then, pro rata by the days elapsed, and everything else is
|
|
430
|
+
reimbursed"); `…_units` (`checkbox_units` = `request_units` + space + `acknowledgement_units`)
|
|
431
|
+
describe the split — services pro rata by time, the right of withdrawal expiring for the
|
|
432
|
+
included units used. `startContextOf(plan)` is the ONE decision: `'units'` exactly when the
|
|
433
|
+
plan's `withdrawal.components` has a `basis: 'units'` part, else `undefined`. Every renderer
|
|
434
|
+
takes the context from it — the server's start view, the recorded statement and the start mail,
|
|
435
|
+
and the dialog (from the view's `context`) — so the statement on screen is the one recorded.
|
|
436
|
+
`title`, `intro`, `confirm`, `decline` have no `_units` variant. Generic statutory text (the
|
|
437
|
+
purchase mail's withdrawal information) stays generic.
|
|
406
438
|
- Statutory labels are pinned by a test: en "Withdraw from contract here" / "Confirm withdrawal",
|
|
407
439
|
"Cancel contracts here" / "Cancel now"; de "Vertrag widerrufen" / "Widerruf bestätigen",
|
|
408
440
|
"Verträge hier kündigen" / "Jetzt kündigen"; fr "Renoncer au contrat ici" / "Confirmer la
|
|
@@ -412,7 +444,9 @@ STATEMENTS `{{trader}}` is the trader's short name.
|
|
|
412
444
|
"Cancelar ahora"; uk/ru/be are courtesy translations.
|
|
413
445
|
- The express request uses the statutory verbs (PL "Żądam i wyrażam wyraźną zgodę … Przyjmuję do
|
|
414
446
|
wiadomości …", DE "Ich verlange ausdrücklich und stimme ausdrücklich zu … Mir ist bekannt …", FR
|
|
415
|
-
"Je demande expressément et j’accepte expressément … Je reconnais perdre …").
|
|
447
|
+
"Je demande expressément et j’accepte expressément … Je reconnais perdre …"). Every start
|
|
448
|
+
request — base and `_units`, every language — opens with the same three words as that language's
|
|
449
|
+
performance request (pinned by the copy spec).
|
|
416
450
|
- Wording rule, enforced by a scan of every language: say "the right of withdrawal expires" and
|
|
417
451
|
"only unused credits are reimbursed" — never non-refundable / nicht erstattungsfähig / non
|
|
418
452
|
remboursable / bezzwrotny / no reembolsable / невозвратный / неповоротний / незваротны.
|
package/build/advertise.js
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { CONFIG_RECORD } from '@owlmeans/context';
|
|
2
2
|
import { apiConfigPlugin, every } from '@owlmeans/api-config';
|
|
3
|
-
import {
|
|
4
|
-
/**
|
|
5
|
-
* The pricing policy record carries only flags and TTLs (never a Stripe secret, an API version, or
|
|
6
|
-
* a migration switch — those stay in a backend-only plugin), so advertising it to the browser is
|
|
7
|
-
* safe. The consumer-rights policy record carries only public links, territories and switches
|
|
8
|
-
* (the mail options — sender, archive copy — stay in a backend-only plugin config), so the browser
|
|
9
|
-
* renders the same links and switches the server enforces.
|
|
10
|
-
*/
|
|
11
|
-
const advertisedRecordTypes = new Set([
|
|
12
|
-
L10N_RECORD_TYPE, PLAN_RECORD_TYPE, PRODUCT_RECORD_TYPE, PRICING_POLICY_RECORD_TYPE, CONSUMER_RIGHTS_RECORD_TYPE,
|
|
13
|
-
]);
|
|
3
|
+
import { advertisedRecordTypes } from './consts.local.js';
|
|
14
4
|
apiConfigPlugin({
|
|
15
5
|
allow: {
|
|
16
6
|
[CONFIG_RECORD]: every(true, value => value != null && typeof value === 'object'
|
package/build/advertise.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advertise.js","sourceRoot":"","sources":["../src/advertise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"advertise.js","sourceRoot":"","sources":["../src/advertise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,eAAe,CAAC;IACd,KAAK,EAAE;QACL,CAAC,aAAa,CAAC,EAAE,KAAK,CACpB,IAAI,EACJ,KAAK,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;eAC9C,qBAAqB,CAAC,GAAG,CAAE,KAAiC,CAAC,UAAU,IAAI,EAAE,CAAC,CACpF;KACF;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/checkout/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/checkout/consts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/checkout/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/checkout/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA"}
|
package/build/checkout/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/checkout/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/checkout/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAE3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { AmountCheckoutPolicy, AmountNarrowing, AmountPolicyView } from '../types.js';
|
|
2
|
-
|
|
3
|
-
productSku?: string;
|
|
4
|
-
planSku?: string;
|
|
5
|
-
}
|
|
2
|
+
import type { NarrowAmountPolicyOptions } from './types.js';
|
|
6
3
|
/**
|
|
7
4
|
* An amount policy narrowed for one entity — the one computation the server's refusal and the
|
|
8
5
|
* dialog's control share, so a disabled control and a refusal cannot disagree.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"narrow.d.ts","sourceRoot":"","sources":["../../src/checkout/narrow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,gBAAgB,EAAqB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"narrow.d.ts","sourceRoot":"","sources":["../../src/checkout/narrow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,gBAAgB,EAAqB,MAAM,aAAa,CAAA;AAC7G,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAK3D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,SACvB,oBAAoB,cAAc,eAAe,EAAE,SAAQ,yBAAyB,KACzF,gBAqCF,CAAA;AAED,iFAAiF;AACjF,eAAO,MAAM,aAAa,SAAU,gBAAgB,eAAe,MAAM,KAAG,OAEW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"narrow.js","sourceRoot":"","sources":["../../src/checkout/narrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"narrow.js","sourceRoot":"","sources":["../../src/checkout/narrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAA;AAI1D,MAAM,SAAS,GAAG,CAAC,SAA0B,EAAU,EAAE,CACvD,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAE/F;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,IAA0B,EAAE,UAA6B,EAAE,IAAI,GAA8B,EAAE,EAC7E,EAAE;IACpB,0BAA0B,CAAC,IAAI,CAAC,CAAA;IAChC,IAAI,MAAM,GAA2B,IAAI,CAAA;IACzC,IAAI,OAAO,GAAG,IAAI,CAAC,YAAY,CAAA;IAC/B,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,CAAA;QACtC,IAAI,SAAS,GAAG,OAAO,EAAE,CAAC;YACxB,OAAO,GAAG,SAAS,CAAA;YACnB,MAAM,GAAG,SAAS,CAAA;QACpB,CAAC;IACH,CAAC;IACD,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACnB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;IACtC,CAAC;IAED,MAAM,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC,YAAY,CAAA;IAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CA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E,OAAO,KAAK,IAAI,IAAI,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC;OAC9D,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,CAAA"}
|
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { RouteParent } from '@owlmeans/route';
|
|
3
|
-
import type { AmountPolicyQuery, AmountPolicyView, PlanPriceList, PlanPricesQuery } from '../types.js';
|
|
4
|
-
export declare const CHECKOUT_READ_API_PATH = "/checkout";
|
|
5
|
-
export interface CheckoutReadProtocolOptions {
|
|
6
|
-
/** Alias prefix of every declaration, e.g. `my-app:account:checkout`. */
|
|
7
|
-
prefix: string;
|
|
8
|
-
/** The application's guarded parent — its guards and gate are inherited. */
|
|
9
|
-
parent?: RouteParent;
|
|
10
|
-
guards?: EntrypointOptions['guards'];
|
|
11
|
-
gate?: EntrypointOptions['gate'];
|
|
12
|
-
/** Default `/checkout`. */
|
|
13
|
-
path?: string;
|
|
14
|
-
}
|
|
15
|
-
export type CheckoutReadProtocols = {
|
|
16
|
-
base: EntrypointProtocol<OpenRequest, OpenValue>;
|
|
17
|
-
/** The entity's amount policy as narrowed now — the same computation the checkout enforces. */
|
|
18
|
-
amountPolicy: EntrypointProtocol<{
|
|
19
|
-
query: AmountPolicyQuery;
|
|
20
|
-
}, AmountPolicyView>;
|
|
21
|
-
/** The prices a product's plans are charged at, per currency, as last synchronized. */
|
|
22
|
-
planPrices: EntrypointProtocol<{
|
|
23
|
-
query: PlanPricesQuery;
|
|
24
|
-
}, PlanPriceList>;
|
|
25
|
-
};
|
|
1
|
+
import type { CheckoutReadProtocolOptions, CheckoutReadProtocols } from './types.js';
|
|
26
2
|
/**
|
|
27
3
|
* The read side of checkout: `amountPolicy` GET `/amount-policy?productSku&planSku` and
|
|
28
4
|
* `planPrices` GET `/plan-prices?productSku`, under the application's guarded `parent` (or its own
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocols.d.ts","sourceRoot":"","sources":["../../src/checkout/protocols.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"protocols.d.ts","sourceRoot":"","sources":["../../src/checkout/protocols.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEpF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,SAAU,2BAA2B,KAAG,qBAwB7E,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { contract, openProtocol, protocol, typed } from '@owlmeans/entrypoint';
|
|
2
2
|
import { backend, route, RouteMethod } from '@owlmeans/route';
|
|
3
3
|
import { AmountPolicyQuerySchema, AmountPolicyViewSchema, PlanPriceListSchema, PlanPricesQuerySchema, } from '../model/consumer.js';
|
|
4
|
-
|
|
4
|
+
import { CHECKOUT_READ_API_PATH } from './consts.js';
|
|
5
5
|
/**
|
|
6
6
|
* The read side of checkout: `amountPolicy` GET `/amount-policy?productSku&planSku` and
|
|
7
7
|
* `planPrices` GET `/plan-prices?productSku`, under the application's guarded `parent` (or its own
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocols.js","sourceRoot":"","sources":["../../src/checkout/protocols.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"protocols.js","sourceRoot":"","sources":["../../src/checkout/protocols.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC9E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EACL,uBAAuB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,qBAAqB,G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AK,EAAE,KAAK,CAAoB,uBAAuB,CAAC,EAAE,EAAE,sBAAsB,CAAC,CACvG;QACD,UAAU,EAAE,QAAQ,CAClB,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,EAC/F,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,CAAkB,qBAAqB,CAAC,EAAE,EAAE,mBAAmB,CAAC,CAChG;KACF,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RouteParent } from '@owlmeans/route';
|
|
2
|
+
import type { EntrypointOptions, EntrypointProtocol, OpenRequest, OpenValue } from '@owlmeans/entrypoint';
|
|
3
|
+
import type { AmountPolicyQuery, AmountPolicyView, PlanPriceList, PlanPricesQuery } from '../types.js';
|
|
4
|
+
export interface NarrowAmountPolicyOptions {
|
|
5
|
+
productSku?: string;
|
|
6
|
+
planSku?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CheckoutReadProtocolOptions {
|
|
9
|
+
/** Alias prefix of every declaration, e.g. `my-app:account:checkout`. */
|
|
10
|
+
prefix: string;
|
|
11
|
+
/** The application's guarded parent — its guards and gate are inherited. */
|
|
12
|
+
parent?: RouteParent;
|
|
13
|
+
guards?: EntrypointOptions['guards'];
|
|
14
|
+
gate?: EntrypointOptions['gate'];
|
|
15
|
+
/** Default `/checkout`. */
|
|
16
|
+
path?: string;
|
|
17
|
+
}
|
|
18
|
+
export type CheckoutReadProtocols = {
|
|
19
|
+
base: EntrypointProtocol<OpenRequest, OpenValue>;
|
|
20
|
+
/** The entity's amount policy as narrowed now — the same computation the checkout enforces. */
|
|
21
|
+
amountPolicy: EntrypointProtocol<{
|
|
22
|
+
query: AmountPolicyQuery;
|
|
23
|
+
}, AmountPolicyView>;
|
|
24
|
+
/** The prices a product's plans are charged at, per currency, as last synchronized. */
|
|
25
|
+
planPrices: EntrypointProtocol<{
|
|
26
|
+
query: PlanPricesQuery;
|
|
27
|
+
}, PlanPriceList>;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/checkout/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACzG,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAEtG,MAAM,WAAW,yBAAyB;IACxC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,2BAA2B;IAC1C,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAA;IACd,4EAA4E;IAC5E,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,MAAM,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAA;IACpC,IAAI,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAA;IAChC,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,kBAAkB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;IAChD,+FAA+F;IAC/F,YAAY,EAAE,kBAAkB,CAAC;QAAE,KAAK,EAAE,iBAAiB,CAAA;KAAE,EAAE,gBAAgB,CAAC,CAAA;IAChF,uFAAuF;IACvF,UAAU,EAAE,kBAAkB,CAAC;QAAE,KAAK,EAAE,eAAe,CAAA;KAAE,EAAE,aAAa,CAAC,CAAA;CAC1E,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/checkout/types.ts"],"names":[],"mappings":""}
|
package/build/consts.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { JSONSchemaType } from 'ajv';
|
|
2
|
+
import type { PricingPolicy } from './types.js';
|
|
2
3
|
export declare enum ProductType {
|
|
3
4
|
Simple = "simple",
|
|
4
5
|
Service = "service",
|
|
@@ -209,7 +210,85 @@ export declare const CONSUMER_RIGHTS_RESOURCE = "payment-consumer-rights";
|
|
|
209
210
|
* The version of the legal copy this package ships. Bumped on ANY change to a
|
|
210
211
|
* `payment-consumer-rights` bundle, so a consent recorded against an older wording is told apart.
|
|
211
212
|
*/
|
|
212
|
-
export declare const CONSUMER_RIGHTS_COPY_VERSION = "2026-
|
|
213
|
+
export declare const CONSUMER_RIGHTS_COPY_VERSION = "2026-10-04.2";
|
|
213
214
|
export declare const DEFAULT_ALIAS = "payment";
|
|
214
215
|
export declare const PAYMENT_SERVICE = "payment";
|
|
216
|
+
/**
|
|
217
|
+
* ISO 3166-1 alpha-2 country code → lowercase ISO 4217 currency code — the currency circulating in
|
|
218
|
+
* that country, for the "≈ local total" line of a price estimate. Not a Stripe list: Stripe Tax can
|
|
219
|
+
* compute a rate for a country this map has no entry for (or none at all, `location-required`), and
|
|
220
|
+
* `currencyOfCountry` returning `null` just means the estimate carries no local-currency line, never
|
|
221
|
+
* a rejected request.
|
|
222
|
+
*
|
|
223
|
+
* A territory that circulates another country's currency (Ecuador, Kosovo, Puerto Rico, …) is
|
|
224
|
+
* mapped to that currency, not left out.
|
|
225
|
+
*/
|
|
226
|
+
export declare const COUNTRY_CURRENCIES: Readonly<Record<string, string>>;
|
|
227
|
+
/**
|
|
228
|
+
* A permissive ISO 3166-1 alpha-2 shape (two uppercase letters) — not restricted to
|
|
229
|
+
* `COUNTRY_CURRENCIES`, so a country this map cannot name a currency for is still a valid request;
|
|
230
|
+
* it only loses the local-currency line of its estimate.
|
|
231
|
+
*/
|
|
232
|
+
export declare const CountrySchema: JSONSchemaType<string>;
|
|
233
|
+
/**
|
|
234
|
+
* The gate alias a paid capability is asserted under.
|
|
235
|
+
*
|
|
236
|
+
* Distinct from `paymentGate.base` (a ROUTE id) and from the gateway service alias — three
|
|
237
|
+
* different things that would otherwise all be called "payment gate".
|
|
238
|
+
*/
|
|
239
|
+
export declare const ENTITLEMENT_GATE = "entitlement-gate";
|
|
240
|
+
/**
|
|
241
|
+
* The gate alias a plan limit is asserted under (`limit:<key>[>=n]`).
|
|
242
|
+
*
|
|
243
|
+
* A separate alias from `ENTITLEMENT_GATE` because the framework collects an entrypoint's gates
|
|
244
|
+
* per gate SERVICE: a capability requirement and a limit requirement under one alias would hide
|
|
245
|
+
* each other.
|
|
246
|
+
*/
|
|
247
|
+
export declare const LIMIT_GATE = "limit-gate";
|
|
248
|
+
/**
|
|
249
|
+
* The capability scope that carries FEATURE flags.
|
|
250
|
+
*
|
|
251
|
+
* Kept apart from `renewable`, which carries numeric quotas that are consumed or counted. Merging
|
|
252
|
+
* them would make "has one production slot left" and "may remove the platform credit" the same
|
|
253
|
+
* number, and the first purchase that spent the quota would take the feature with it.
|
|
254
|
+
*/
|
|
255
|
+
export declare const CAPABILITY_FEATURE_SCOPE = "feature";
|
|
256
|
+
/**
|
|
257
|
+
* The scope RESERVED for limit parameters (`limit:<key>[>=n]`).
|
|
258
|
+
*
|
|
259
|
+
* Never a declarable capability scope: a plan's limits live in `ProductPlan.limits`, and a
|
|
260
|
+
* capability predicate refuses any parameter under this scope, so a limit requirement can never be
|
|
261
|
+
* satisfied by a capability grant.
|
|
262
|
+
*/
|
|
263
|
+
export declare const CAPABILITY_LIMIT_SCOPE = "limit";
|
|
264
|
+
/**
|
|
265
|
+
* Preserves today's fixed behavior for every consumer that declares no policy: automatic tax and
|
|
266
|
+
* tax-id collection stay on for every checkout (`taxOptions` before this policy existed), no
|
|
267
|
+
* `behavior` is forced onto a synced price, no Adaptive Pricing, and the estimate endpoints are off
|
|
268
|
+
* (a new capability, opt-in only).
|
|
269
|
+
*/
|
|
270
|
+
export declare const DEFAULT_PRICING_POLICY: PricingPolicy;
|
|
271
|
+
/** The window key a lifetime limit's counter lives under. */
|
|
272
|
+
export declare const LIFETIME_WINDOW = "lifetime";
|
|
273
|
+
/** The window key an occupancy limit's counter lives under. */
|
|
274
|
+
export declare const OCCUPANCY_WINDOW = "occupancy";
|
|
275
|
+
/** The 27 EU member states (ISO 3166-1 alpha-2; Greece is `GR`, as Stripe reports it). */
|
|
276
|
+
export declare const EU_COUNTRIES: readonly string[];
|
|
277
|
+
/**
|
|
278
|
+
* The member states plus the parts of them that carry their own ISO code — Åland (FI) and the
|
|
279
|
+
* French outermost regions (French Guiana, Guadeloupe, Martinique, Réunion, Mayotte, Saint-Martin).
|
|
280
|
+
* EU consumer law applies there even where EU VAT does not; the Canary Islands, Azores and Madeira
|
|
281
|
+
* share their state's code. Scope beyond the member states is a question for the lawyer.
|
|
282
|
+
*/
|
|
283
|
+
export declare const EU_CONSUMER_TERRITORIES: readonly string[];
|
|
284
|
+
/** The EEA members outside the EU. */
|
|
285
|
+
export declare const EEA_EXTRA: readonly string[];
|
|
286
|
+
/** The territories whose consumers have the right of withdrawal by default: the EU's and the EEA's. */
|
|
287
|
+
export declare const CONSUMER_RIGHTS_TERRITORIES: readonly string[];
|
|
288
|
+
/**
|
|
289
|
+
* Country → the language of its legal copy, only where that is unambiguous (Belgium, Luxembourg,
|
|
290
|
+
* Switzerland, Canada … are absent and fall back to the policy's default). An application widens
|
|
291
|
+
* or overrides it with `ConsumerRightsPolicy.languages`.
|
|
292
|
+
*/
|
|
293
|
+
export declare const COUNTRY_LANGUAGES: Readonly<Record<string, string>>;
|
|
215
294
|
//# sourceMappingURL=consts.d.ts.map
|
package/build/consts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,UAAU,eAAe;CAC1B;AAED,oBAAY,mBAAmB;IAC7B,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,aAAa,mBAAmB;CACjC;AAED,oBAAY,UAAU;IACpB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,UAAU,eAAe;IACzB,SAAS,cAAc;CACxB;AAED,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB;;;OAGG;IACH,UAAU,eAAe;CAC1B;AAED,oBAAY,kBAAkB;IAC5B,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,mEAAmE;IACnE,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,oEAAoE;IACpE,OAAO,aAAa;CACrB;AAED,gEAAgE;AAChE,eAAO,MAAM,kBAAkB,EAAE,SAAS,kBAAkB,EAE1D,CAAA;AAEF,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,EAAE,SAAS,kBAAkB,EAGzD,CAAA;AAEF,oCAAoC;AACpC,oBAAY,SAAS;IACnB,uDAAuD;IACvD,MAAM,WAAW;IACjB,iFAAiF;IACjF,QAAQ,aAAa;IACrB,mFAAmF;IACn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