platform-types 1.10.788 → 1.10.790

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 CHANGED
@@ -118,8 +118,8 @@ export declare const GUEST_CART_TOKEN_HEADER = "X-Guest-Cart-Token";
118
118
  * cart that is gone, belongs to an account, is held by a till, was checked
119
119
  * out or was swept as abandoned — with one identical body, so the token is
120
120
  * never an oracle. Drop the token and start a new guest cart.
121
- * - GUEST_CHECKOUT_DISABLED (403): the shop does not sell to guests — it has not
122
- * switched guest checkout on, admits buyers only after approval, or hides
121
+ * - GUEST_CHECKOUT_DISABLED (403): the shop does not sell to guests — it
122
+ * switched guest checkout off, admits buyers only after approval, or hides
123
123
  * prices from anonymous visitors. Public `GET /store` reports the same verdict
124
124
  * as `ecommerce.config.guestCheckoutAvailable`.
125
125
  * - GUEST_CHECKOUT_SIGNED_IN (409): the request carried an `Authorization`
package/dist/basket.js CHANGED
@@ -87,8 +87,8 @@ export const GUEST_CART_TOKEN_HEADER = 'X-Guest-Cart-Token';
87
87
  * cart that is gone, belongs to an account, is held by a till, was checked
88
88
  * out or was swept as abandoned — with one identical body, so the token is
89
89
  * never an oracle. Drop the token and start a new guest cart.
90
- * - GUEST_CHECKOUT_DISABLED (403): the shop does not sell to guests — it has not
91
- * switched guest checkout on, admits buyers only after approval, or hides
90
+ * - GUEST_CHECKOUT_DISABLED (403): the shop does not sell to guests — it
91
+ * switched guest checkout off, admits buyers only after approval, or hides
92
92
  * prices from anonymous visitors. Public `GET /store` reports the same verdict
93
93
  * as `ecommerce.config.guestCheckoutAvailable`.
94
94
  * - GUEST_CHECKOUT_SIGNED_IN (409): the request carried an `Authorization`
@@ -90,8 +90,8 @@ exports.GUEST_CART_TOKEN_HEADER = 'X-Guest-Cart-Token';
90
90
  * cart that is gone, belongs to an account, is held by a till, was checked
91
91
  * out or was swept as abandoned — with one identical body, so the token is
92
92
  * never an oracle. Drop the token and start a new guest cart.
93
- * - GUEST_CHECKOUT_DISABLED (403): the shop does not sell to guests — it has not
94
- * switched guest checkout on, admits buyers only after approval, or hides
93
+ * - GUEST_CHECKOUT_DISABLED (403): the shop does not sell to guests — it
94
+ * switched guest checkout off, admits buyers only after approval, or hides
95
95
  * prices from anonymous visitors. Public `GET /store` reports the same verdict
96
96
  * as `ecommerce.config.guestCheckoutAvailable`.
97
97
  * - GUEST_CHECKOUT_SIGNED_IN (409): the request carried an `Authorization`
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * Guest order status link — the read-only page a buyer with no account opens
4
+ * from the order email (`/pedido/{token}`), and the route that mails a fresh
5
+ * link to the address stored on the order.
6
+ *
7
+ * The token (`gs1.…`) is a bearer credential over exactly ONE order, read-only:
8
+ * it authorises no cart write, payment, cancellation, withdrawal or export. It
9
+ * carries no expiry; the read is refused once the order was delivered (or
10
+ * cancelled) more than `guestStatusLinkDaysAfterDelivery` days ago, and every
11
+ * earlier link dies when a recovery or an operator revokes it.
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.GUEST_ORDER_STATUS_LINK_TEMPLATE = exports.GUEST_ORDER_STATUS_ERROR_CODES = void 0;
15
+ /**
16
+ * The refusals the guest status routes answer themselves.
17
+ *
18
+ * - GUEST_STATUS_TOKEN_INVALID (401): every reason the token cannot be honoured
19
+ * — missing, tampered, another version, minted for another store or presented
20
+ * on another store's host, revoked (a newer link was sent), past the delivery
21
+ * horizon, or naming an order that is gone or is not a guest order — with one
22
+ * identical body, so the token is never an oracle. Ask for a new link through
23
+ * `POST /orders/status/recover`.
24
+ */
25
+ exports.GUEST_ORDER_STATUS_ERROR_CODES = ['GUEST_STATUS_TOKEN_INVALID'];
26
+ /** The transactional email template that mails a guest their (new) status link. */
27
+ exports.GUEST_ORDER_STATUS_LINK_TEMPLATE = 'guest-order-status-link';
package/dist/cjs/index.js CHANGED
@@ -54,6 +54,7 @@ __exportStar(require("./delivery.js"), exports);
54
54
  __exportStar(require("./favorite.js"), exports);
55
55
  __exportStar(require("./fiscalConditions.js"), exports);
56
56
  __exportStar(require("./gating.js"), exports);
57
+ __exportStar(require("./guestOrderStatus.js"), exports);
57
58
  __exportStar(require("./holdingCost.js"), exports);
58
59
  __exportStar(require("./demo.js"), exports);
59
60
  __exportStar(require("./emailIdentity.js"), exports);
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Guest order status link — the read-only page a buyer with no account opens
3
+ * from the order email (`/pedido/{token}`), and the route that mails a fresh
4
+ * link to the address stored on the order.
5
+ *
6
+ * The token (`gs1.…`) is a bearer credential over exactly ONE order, read-only:
7
+ * it authorises no cart write, payment, cancellation, withdrawal or export. It
8
+ * carries no expiry; the read is refused once the order was delivered (or
9
+ * cancelled) more than `guestStatusLinkDaysAfterDelivery` days ago, and every
10
+ * earlier link dies when a recovery or an operator revokes it.
11
+ */
12
+ /**
13
+ * The refusals the guest status routes answer themselves.
14
+ *
15
+ * - GUEST_STATUS_TOKEN_INVALID (401): every reason the token cannot be honoured
16
+ * — missing, tampered, another version, minted for another store or presented
17
+ * on another store's host, revoked (a newer link was sent), past the delivery
18
+ * horizon, or naming an order that is gone or is not a guest order — with one
19
+ * identical body, so the token is never an oracle. Ask for a new link through
20
+ * `POST /orders/status/recover`.
21
+ */
22
+ export declare const GUEST_ORDER_STATUS_ERROR_CODES: readonly ["GUEST_STATUS_TOKEN_INVALID"];
23
+ export type GuestOrderStatusErrorCode = (typeof GUEST_ORDER_STATUS_ERROR_CODES)[number];
24
+ /** The transactional email template that mails a guest their (new) status link. */
25
+ export declare const GUEST_ORDER_STATUS_LINK_TEMPLATE: "guest-order-status-link";
26
+ declare global {
27
+ /** One line of a {@link GuestOrderStatusView}, in the order's currency. */
28
+ interface GuestOrderStatusLine {
29
+ /** The line's name as sold. */
30
+ description: string;
31
+ sku?: string;
32
+ quantity: number;
33
+ /** The unit price the order booked for the line (`OrderLine.price`). */
34
+ unitPrice: number;
35
+ /** `unitPrice × quantity` as the order booked it. */
36
+ lineTotal: number;
37
+ }
38
+ /**
39
+ * The order's money as the buyer is shown it. Named by UNIT, because the
40
+ * stored order mixes units: `discountPercent` is a percentage, never money.
41
+ */
42
+ interface GuestOrderStatusTotals {
43
+ /**
44
+ * What the order charges — `Order.total`, already net of every discount
45
+ * and including freight. Do not re-apply `discountPercent` to it.
46
+ */
47
+ total: number;
48
+ /** `Order.discount`: the composed order-level percentage (0–100). */
49
+ discountPercent: number;
50
+ /** Money the redeemed coupon(s) took off (`Order.coupons[].amount`), when any. */
51
+ couponAmount?: number;
52
+ /** The delivery charge (the order's freight line), when one was booked. */
53
+ freight?: number;
54
+ }
55
+ /**
56
+ * `GET /orders/status?token=` — one guest order, projected by ALLOW-LIST.
57
+ * Carries no address, document, full email, phone, customer id or other
58
+ * internal id; a client must not expect any field not listed here.
59
+ */
60
+ interface GuestOrderStatusView {
61
+ orderId: string;
62
+ /** Epoch ms the order was placed. */
63
+ dated: number;
64
+ /**
65
+ * Derived when the stored order carries none. ⚠️ A cancelled order reads
66
+ * `'delivered'` here (a cancellation lands the row in the delivered end
67
+ * state), so a client must check `cancelled` first.
68
+ */
69
+ fulfilmentStatus: OrderFulfilmentStatus;
70
+ /** Derived when the stored order carries none. */
71
+ financialStatus: OrderFinancialStatus;
72
+ /**
73
+ * Present, and `true`, only when the order was cancelled (`Order.cancelledAt`
74
+ * set) — by the buyer, the store or the system. Absent on every live order.
75
+ */
76
+ cancelled?: true;
77
+ lines: GuestOrderStatusLine[];
78
+ totals: GuestOrderStatusTotals;
79
+ /** The order's currency catalog id. */
80
+ currency: string;
81
+ /** The store's name for the delivery method chosen, when it still resolves. */
82
+ deliveryMethodName?: string;
83
+ /** The latest online payment attempt, when the order has one. */
84
+ paymentAttempt?: OrderPaymentAttemptView;
85
+ contact: {
86
+ /** The stored address, masked (e.g. `j***@d***.com`). */
87
+ emailMasked: string;
88
+ firstName: string;
89
+ };
90
+ }
91
+ /**
92
+ * `POST /orders/status/recover` body. Always answers the same `202` whether
93
+ * or not anything matched; a match within budget mails a new link to the
94
+ * address STORED on the order (never this one) and kills every earlier link.
95
+ * Only a malformed body answers otherwise (`400`).
96
+ */
97
+ interface GuestOrderStatusRecoverRequest {
98
+ orderId: string;
99
+ email: string;
100
+ }
101
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Guest order status link — the read-only page a buyer with no account opens
3
+ * from the order email (`/pedido/{token}`), and the route that mails a fresh
4
+ * link to the address stored on the order.
5
+ *
6
+ * The token (`gs1.…`) is a bearer credential over exactly ONE order, read-only:
7
+ * it authorises no cart write, payment, cancellation, withdrawal or export. It
8
+ * carries no expiry; the read is refused once the order was delivered (or
9
+ * cancelled) more than `guestStatusLinkDaysAfterDelivery` days ago, and every
10
+ * earlier link dies when a recovery or an operator revokes it.
11
+ */
12
+ /**
13
+ * The refusals the guest status routes answer themselves.
14
+ *
15
+ * - GUEST_STATUS_TOKEN_INVALID (401): every reason the token cannot be honoured
16
+ * — missing, tampered, another version, minted for another store or presented
17
+ * on another store's host, revoked (a newer link was sent), past the delivery
18
+ * horizon, or naming an order that is gone or is not a guest order — with one
19
+ * identical body, so the token is never an oracle. Ask for a new link through
20
+ * `POST /orders/status/recover`.
21
+ */
22
+ export const GUEST_ORDER_STATUS_ERROR_CODES = ['GUEST_STATUS_TOKEN_INVALID'];
23
+ /** The transactional email template that mails a guest their (new) status link. */
24
+ export const GUEST_ORDER_STATUS_LINK_TEMPLATE = 'guest-order-status-link';
package/dist/index.d.ts CHANGED
@@ -30,6 +30,7 @@ export * from './delivery.ts';
30
30
  export * from './favorite.ts';
31
31
  export * from './fiscalConditions.ts';
32
32
  export * from './gating.ts';
33
+ export * from './guestOrderStatus.ts';
33
34
  export * from './holdingCost.ts';
34
35
  export * from './demo.ts';
35
36
  export * from './emailIdentity.ts';
package/dist/index.js CHANGED
@@ -38,6 +38,7 @@ export * from "./delivery.js";
38
38
  export * from "./favorite.js";
39
39
  export * from "./fiscalConditions.js";
40
40
  export * from "./gating.js";
41
+ export * from "./guestOrderStatus.js";
41
42
  export * from "./holdingCost.js";
42
43
  export * from "./demo.js";
43
44
  export * from "./emailIdentity.js";
package/dist/store.d.ts CHANGED
@@ -160,7 +160,8 @@ declare global {
160
160
  wholesaleRequests?: boolean;
161
161
  /**
162
162
  * Whether the shop sells to shoppers without an account (server guest
163
- * cart, guest checkout). Absent means OFF: a shop opts in. Honoured only
163
+ * cart, guest checkout). Absent means ON: a shop opts out by storing
164
+ * `false`, and only the boolean `false` closes it. Honoured only
164
165
  * while `registrationMode` is not `'approval'` and `showDefaultPriceList`
165
166
  * is not `0` — a shop that vets every buyer, or hides prices from
166
167
  * anonymous visitors, never sells to a guest whatever this says.
@@ -172,7 +173,7 @@ declare global {
172
173
  /**
173
174
  * SHOPPER-ONLY, never stored: present on web `GET /store` and the
174
175
  * customer `stores` frame, `true` when the shop accepts guest carts and
175
- * guest checkout right now — `guestCheckout` on AND registration open AND
176
+ * guest checkout right now — `guestCheckout` not `false` AND registration open AND
176
177
  * prices shown to anonymous visitors. The guest routes refuse
177
178
  * `403 GUEST_CHECKOUT_DISABLED` whenever this is `false`.
178
179
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.788",
3
+ "version": "1.10.790",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",