platform-types 1.10.702 → 1.10.704
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/basket.d.ts +4 -4
- package/dist/basket.js +5 -3
- package/dist/cart.d.ts +20 -0
- package/dist/cjs/basket.js +5 -3
- package/dist/cjs/subscription.js +5 -3
- package/dist/store.d.ts +10 -4
- package/dist/subscription.d.ts +31 -7
- package/dist/subscription.js +5 -3
- package/package.json +1 -1
package/dist/basket.d.ts
CHANGED
|
@@ -63,9 +63,9 @@ declare global {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
|
-
* Domain refusals from POST /baskets
|
|
67
|
-
* and
|
|
68
|
-
* refusals. GET
|
|
66
|
+
* Domain refusals from POST /baskets (replacement, named actions and park/resume)
|
|
67
|
+
* and GET /baskets?mode=review. Check GATING_ERROR_CODES separately for middleware
|
|
68
|
+
* and role refusals. Other GET modes and storefront-only refusals remain separate.
|
|
69
69
|
*
|
|
70
70
|
* Coupon and promotion reasons are forwarded from evaluateCoupon and
|
|
71
71
|
* evaluatePromotion (stacks/services/coupons.ts and promotions.ts). Checkout's
|
|
@@ -74,6 +74,6 @@ declare global {
|
|
|
74
74
|
* priceHandler.resolveLineStamp. The legacy loose body also reaches the shared
|
|
75
75
|
* foreign-index-key guard; its owned terminalId is validated before that guard.
|
|
76
76
|
*/
|
|
77
|
-
export declare const BASKET_ERROR_CODES: readonly ["VALIDATION_FAILED", "FOREIGN_INDEX_KEY_ATTRIBUTE", "CART_TARGET_REQUIRED", "CART_NOT_FOUND", "CART_NOT_PARKED", "CART_ALREADY_PARKED", "TERMINAL_INDEX_UNAVAILABLE", "PRODUCT_NOT_FOUND", "PRODUCT_COST_UNKNOWN", "UNIT_QUANTITY_NOT_WHOLE", "BASKET_VERSION_CONFLICT", "BASKET_LINE_LIMIT", "BASKET_SIZE_LIMIT", "UNKNOWN_LINE", "INVALID_PRICE", "LINE_DISCOUNT_NOT_ALLOWED", "LINE_DISCOUNT_EXCEEDS_MAX", "FX_CONVERSION_UNAVAILABLE", "COUPON_NOT_FOUND", "COUPON_NOT_ACTIVE", "COUPON_EXPIRED", "COUPON_EXHAUSTED", "COUPON_MIN_SUBTOTAL", "COUPON_REQUIRES_CUSTOMER", "COUPON_BUDGET_EXHAUSTED", "COUPON_RATE_LIMITED", "COUPON_CURRENCY_MISMATCH", "PROMOTION_NOT_FOUND", "PROMOTION_NOT_ACTIVE", "PROMOTION_NOT_STARTED", "PROMOTION_EXPIRED", "PROMOTION_NOT_CART_APPLICABLE"];
|
|
77
|
+
export declare const BASKET_ERROR_CODES: readonly ["VALIDATION_FAILED", "FOREIGN_INDEX_KEY_ATTRIBUTE", "CART_TARGET_REQUIRED", "CART_NOT_FOUND", "CART_REVIEW_INCOMPLETE", "CART_REVIEW_UNAVAILABLE", "CART_NOT_PARKED", "CART_ALREADY_PARKED", "TERMINAL_INDEX_UNAVAILABLE", "PRODUCT_NOT_FOUND", "PRODUCT_COST_UNKNOWN", "UNIT_QUANTITY_NOT_WHOLE", "BASKET_VERSION_CONFLICT", "BASKET_LINE_LIMIT", "BASKET_SIZE_LIMIT", "UNKNOWN_LINE", "INVALID_PRICE", "LINE_DISCOUNT_NOT_ALLOWED", "LINE_DISCOUNT_EXCEEDS_MAX", "FX_CONVERSION_UNAVAILABLE", "COUPON_NOT_FOUND", "COUPON_NOT_ACTIVE", "COUPON_EXPIRED", "COUPON_EXHAUSTED", "COUPON_MIN_SUBTOTAL", "COUPON_REQUIRES_CUSTOMER", "COUPON_BUDGET_EXHAUSTED", "COUPON_RATE_LIMITED", "COUPON_CURRENCY_MISMATCH", "PROMOTION_NOT_FOUND", "PROMOTION_NOT_ACTIVE", "PROMOTION_NOT_STARTED", "PROMOTION_EXPIRED", "PROMOTION_NOT_CART_APPLICABLE"];
|
|
78
78
|
export type BasketErrorCode = (typeof BASKET_ERROR_CODES)[number];
|
|
79
79
|
export {};
|
package/dist/basket.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Domain refusals from POST /baskets
|
|
3
|
-
* and
|
|
4
|
-
* refusals. GET
|
|
2
|
+
* Domain refusals from POST /baskets (replacement, named actions and park/resume)
|
|
3
|
+
* and GET /baskets?mode=review. Check GATING_ERROR_CODES separately for middleware
|
|
4
|
+
* and role refusals. Other GET modes and storefront-only refusals remain separate.
|
|
5
5
|
*
|
|
6
6
|
* Coupon and promotion reasons are forwarded from evaluateCoupon and
|
|
7
7
|
* evaluatePromotion (stacks/services/coupons.ts and promotions.ts). Checkout's
|
|
@@ -15,6 +15,8 @@ export const BASKET_ERROR_CODES = [
|
|
|
15
15
|
'FOREIGN_INDEX_KEY_ATTRIBUTE',
|
|
16
16
|
'CART_TARGET_REQUIRED',
|
|
17
17
|
'CART_NOT_FOUND',
|
|
18
|
+
'CART_REVIEW_INCOMPLETE',
|
|
19
|
+
'CART_REVIEW_UNAVAILABLE',
|
|
18
20
|
'CART_NOT_PARKED',
|
|
19
21
|
'CART_ALREADY_PARKED',
|
|
20
22
|
'TERMINAL_INDEX_UNAVAILABLE',
|
package/dist/cart.d.ts
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
declare global {
|
|
2
|
+
interface OperatorCartReviewRequest {
|
|
3
|
+
mode: 'review';
|
|
4
|
+
customerId: string;
|
|
5
|
+
cartId?: string;
|
|
6
|
+
}
|
|
7
|
+
interface OperatorCartReviewCart extends Omit<Cart, 'customer'> {
|
|
8
|
+
customer?: Partial<Pick<Customer, 'customerId' | 'fullName'>>;
|
|
9
|
+
}
|
|
10
|
+
type OperatorCartReviewData = OperatorCartReviewCart | null;
|
|
11
|
+
/**
|
|
12
|
+
* Completed discovery returns null; an exact missing cart is a refusal.
|
|
13
|
+
* Discovery over several customer carts is never ambiguous: it returns the
|
|
14
|
+
* cart a customer-targeted write resolves (a terminal-less cart before a
|
|
15
|
+
* till's ticket, newest within each group, a new-partition row before a
|
|
16
|
+
* legacy one).
|
|
17
|
+
*/
|
|
18
|
+
interface OperatorCartReviewResponse {
|
|
19
|
+
message: string;
|
|
20
|
+
data: OperatorCartReviewData;
|
|
21
|
+
}
|
|
2
22
|
/**
|
|
3
23
|
* A cart, keyed by its OWN minted id rather than by the customer.
|
|
4
24
|
*
|
package/dist/cjs/basket.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BASKET_ERROR_CODES = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Domain refusals from POST /baskets
|
|
6
|
-
* and
|
|
7
|
-
* refusals. GET
|
|
5
|
+
* Domain refusals from POST /baskets (replacement, named actions and park/resume)
|
|
6
|
+
* and GET /baskets?mode=review. Check GATING_ERROR_CODES separately for middleware
|
|
7
|
+
* and role refusals. Other GET modes and storefront-only refusals remain separate.
|
|
8
8
|
*
|
|
9
9
|
* Coupon and promotion reasons are forwarded from evaluateCoupon and
|
|
10
10
|
* evaluatePromotion (stacks/services/coupons.ts and promotions.ts). Checkout's
|
|
@@ -18,6 +18,8 @@ exports.BASKET_ERROR_CODES = [
|
|
|
18
18
|
'FOREIGN_INDEX_KEY_ATTRIBUTE',
|
|
19
19
|
'CART_TARGET_REQUIRED',
|
|
20
20
|
'CART_NOT_FOUND',
|
|
21
|
+
'CART_REVIEW_INCOMPLETE',
|
|
22
|
+
'CART_REVIEW_UNAVAILABLE',
|
|
21
23
|
'CART_NOT_PARKED',
|
|
22
24
|
'CART_ALREADY_PARKED',
|
|
23
25
|
'TERMINAL_INDEX_UNAVAILABLE',
|
package/dist/cjs/subscription.js
CHANGED
|
@@ -10,9 +10,11 @@
|
|
|
10
10
|
* - Tier names are the 4 locked Spanish tiers (per SUBSCRIPTION_TIERS_BEST_PRACTICES §0):
|
|
11
11
|
* BÁSICO, EMPRENDEDOR, PROFESIONAL, AVANZADO. A new store starts trialing on
|
|
12
12
|
* the `trialTier` platform global, with `trialEndsAt` set `trialDays` days out
|
|
13
|
-
* (see `PlanCatalogue.trial`)
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* (see `PlanCatalogue.trial`). A trial with no payment method drops to
|
|
14
|
+
* `basico` (`active`, free-tier limits, no lock-out) on the first nightly
|
|
15
|
+
* sweep after that date, unless a courtesy gift covers today. A Stripe
|
|
16
|
+
* checkout adds its own fixed 30-day trial, which does not follow those
|
|
17
|
+
* globals (ADR-0010) and is ended by Stripe's events. Courtesy
|
|
16
18
|
* gifts (formerly the Founders cohort) are now a one-off ops action via
|
|
17
19
|
* `gift-subscription` that sets `freeUntil` on the SUBSCRIPTION row.
|
|
18
20
|
* - `freeUntil` lives on every Subscription independent of status. It is the
|
package/dist/store.d.ts
CHANGED
|
@@ -829,10 +829,16 @@ declare global {
|
|
|
829
829
|
* writes `planTier: 'basico'` on a delinquent store at day 14. A security
|
|
830
830
|
* posture does not lapse because an invoice did.
|
|
831
831
|
*
|
|
832
|
-
* Verified rather than assumed:
|
|
833
|
-
* `
|
|
834
|
-
*
|
|
835
|
-
*
|
|
832
|
+
* Verified rather than assumed: on the SUBSCRIPTION row `graceSweep`
|
|
833
|
+
* writes `status`, `planTier`, `pastDueSince`, `canceledFromTier`,
|
|
834
|
+
* `canceledAt`, `trialEndingNotifiedAt` and `updatedAt`, SETs
|
|
835
|
+
* `trialEndedFromTier` and REMOVEs `trialEndsAt` on a trial expiry, and
|
|
836
|
+
* REMOVEs `pastDueSince` and `trialEndedFromTier` on a cancel. Its other
|
|
837
|
+
* writes are its checkpoint row, ERROR rows and the shop-grace reconcile,
|
|
838
|
+
* which SETs only the STORE row's `ecommerce.deactivatesAt` and
|
|
839
|
+
* `updatedAt` (plus its own grace rows and custom-domain rows'
|
|
840
|
+
* `deactivatesAt`) — none of them touches `totp` or anything under
|
|
841
|
+
* `config`. So an obligation kept here survives the downgrade **by
|
|
836
842
|
* construction**, with no special case for anyone to remember and nothing
|
|
837
843
|
* to re-check when the sweep changes.
|
|
838
844
|
*
|
package/dist/subscription.d.ts
CHANGED
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
* - Tier names are the 4 locked Spanish tiers (per SUBSCRIPTION_TIERS_BEST_PRACTICES §0):
|
|
10
10
|
* BÁSICO, EMPRENDEDOR, PROFESIONAL, AVANZADO. A new store starts trialing on
|
|
11
11
|
* the `trialTier` platform global, with `trialEndsAt` set `trialDays` days out
|
|
12
|
-
* (see `PlanCatalogue.trial`)
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* (see `PlanCatalogue.trial`). A trial with no payment method drops to
|
|
13
|
+
* `basico` (`active`, free-tier limits, no lock-out) on the first nightly
|
|
14
|
+
* sweep after that date, unless a courtesy gift covers today. A Stripe
|
|
15
|
+
* checkout adds its own fixed 30-day trial, which does not follow those
|
|
16
|
+
* globals (ADR-0010) and is ended by Stripe's events. Courtesy
|
|
15
17
|
* gifts (formerly the Founders cohort) are now a one-off ops action via
|
|
16
18
|
* `gift-subscription` that sets `freeUntil` on the SUBSCRIPTION row.
|
|
17
19
|
* - `freeUntil` lives on every Subscription independent of status. It is the
|
|
@@ -34,8 +36,9 @@ declare global {
|
|
|
34
36
|
*
|
|
35
37
|
* - `trialing` — a trial on a paid tier: a new store trials on the
|
|
36
38
|
* `trialTier` platform global with `trialEndsAt` set `trialDays` days out
|
|
37
|
-
* (`PlanCatalogue.trial`) —
|
|
38
|
-
*
|
|
39
|
+
* (`PlanCatalogue.trial`) — once that date passes with no payment method the
|
|
40
|
+
* nightly sweep drops the row to `basico`/`active` (unless a courtesy gift
|
|
41
|
+
* covers today) — and a Stripe checkout adds its own fixed 30-day trial.
|
|
39
42
|
* - `active` — paid subscription, period current.
|
|
40
43
|
* - `past_due` — payment failed, in the 7-day grace window.
|
|
41
44
|
* - `readonly` — grace elapsed, writes blocked, tenant can still read.
|
|
@@ -336,8 +339,10 @@ declare global {
|
|
|
336
339
|
groups: PlanFeatureGroup[];
|
|
337
340
|
/**
|
|
338
341
|
* What a store registered now starts on: `tier` — a paid tier — in status
|
|
339
|
-
* `trialing`, with `trialEndsAt` set `days` days out.
|
|
340
|
-
*
|
|
342
|
+
* `trialing`, with `trialEndsAt` set `days` days out. A store that has
|
|
343
|
+
* attached no payment method by then drops to `basico` (`active`, free-tier
|
|
344
|
+
* limits) on the first nightly sweep after that date, unless a courtesy gift
|
|
345
|
+
* covers today. Resolved from the platform globals
|
|
341
346
|
* `trialTier` / `trialDays` — `profesional` / `30` when unset or invalid —
|
|
342
347
|
* so it is always present.
|
|
343
348
|
*/
|
|
@@ -502,6 +507,16 @@ declare global {
|
|
|
502
507
|
* field existed — forward-only, readers fall back to generic copy.
|
|
503
508
|
*/
|
|
504
509
|
canceledFromTier?: PlanTier | null;
|
|
510
|
+
/**
|
|
511
|
+
* The paid tier a trial ran on when it lapsed with no payment method —
|
|
512
|
+
* set only by the grace sweep when it moves a provider-less `trialing`
|
|
513
|
+
* row (no provider, no provider subscription or customer id) whose
|
|
514
|
+
* `trialEndsAt` has passed to `basico`/`active`. Cleared (`null`) when
|
|
515
|
+
* the store re-subscribes to a paid tier or is canceled — a cancel
|
|
516
|
+
* records its own lost plan in `canceledFromTier`. `null` when absent —
|
|
517
|
+
* every row that never expired that way, or has moved on since.
|
|
518
|
+
*/
|
|
519
|
+
trialEndedFromTier?: PlanTier | null;
|
|
505
520
|
entitlements: SubscriptionEntitlementEntry[];
|
|
506
521
|
usage: SubscriptionUsageEntry[];
|
|
507
522
|
}
|
|
@@ -608,6 +623,8 @@ declare global {
|
|
|
608
623
|
* it together with `provider`.
|
|
609
624
|
*/
|
|
610
625
|
mode?: 'preapproval' | 'manual';
|
|
626
|
+
/** The paid tier an expired trial dropped from; `null` when a write cleared it. */
|
|
627
|
+
trialEndedFromTier?: PlanTier | null;
|
|
611
628
|
};
|
|
612
629
|
/**
|
|
613
630
|
* One audit row for a MANAGER out-of-band subscription change, as returned by
|
|
@@ -616,6 +633,13 @@ declare global {
|
|
|
616
633
|
* `AUDIT#SUBSCRIPTION#{storeId}` partition. `before`/`after` carry the
|
|
617
634
|
* subscription fields an operator can change.
|
|
618
635
|
*
|
|
636
|
+
* The partition also carries SYSTEM-written `subscription.trial_expired`
|
|
637
|
+
* rows from the grace sweep: `actor` is empty (`userId: ''`,
|
|
638
|
+
* `fullName: ''`), `before` holds the trial's `status`/`planTier`/
|
|
639
|
+
* `trialEndsAt`, and `after` holds `status: 'active'`,
|
|
640
|
+
* `planTier: 'basico'`, `trialEndsAt: null` and `trialEndedFromTier`
|
|
641
|
+
* (the trial's tier).
|
|
642
|
+
*
|
|
619
643
|
* ⚠️ The same partition also carries entitlement-override and advancedPricing
|
|
620
644
|
* rows whose `before`/`after` hold different keys, so consumers must read
|
|
621
645
|
* each side structurally rather than trusting every field to be present.
|
package/dist/subscription.js
CHANGED
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
* - Tier names are the 4 locked Spanish tiers (per SUBSCRIPTION_TIERS_BEST_PRACTICES §0):
|
|
10
10
|
* BÁSICO, EMPRENDEDOR, PROFESIONAL, AVANZADO. A new store starts trialing on
|
|
11
11
|
* the `trialTier` platform global, with `trialEndsAt` set `trialDays` days out
|
|
12
|
-
* (see `PlanCatalogue.trial`)
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* (see `PlanCatalogue.trial`). A trial with no payment method drops to
|
|
13
|
+
* `basico` (`active`, free-tier limits, no lock-out) on the first nightly
|
|
14
|
+
* sweep after that date, unless a courtesy gift covers today. A Stripe
|
|
15
|
+
* checkout adds its own fixed 30-day trial, which does not follow those
|
|
16
|
+
* globals (ADR-0010) and is ended by Stripe's events. Courtesy
|
|
15
17
|
* gifts (formerly the Founders cohort) are now a one-off ops action via
|
|
16
18
|
* `gift-subscription` that sets `freeUntil` on the SUBSCRIPTION row.
|
|
17
19
|
* - `freeUntil` lives on every Subscription independent of status. It is the
|