platform-types 1.10.816 → 1.10.818

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.
@@ -7,8 +7,13 @@
7
7
  * The token (`gs1.…`) is a bearer credential over exactly ONE order, read-only:
8
8
  * it authorises no cart write, payment, cancellation, withdrawal or export. It
9
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.
10
+ * cancelled) more than `guestStatusLinkDaysAfterDelivery` days ago — unless a
11
+ * purchase withdrawal on it is not final or a refund on it is not closed — and
12
+ * every earlier link dies when a recovery or an operator revokes it.
13
+ *
14
+ * The guest purchase-withdrawal start (`POST /orders/purchase-withdrawal/guest/start`)
15
+ * accepts the token only to NAME the order: the withdrawal itself needs the
16
+ * code mailed to the order's address, so the token still authorises none.
12
17
  */
13
18
  Object.defineProperty(exports, "__esModule", { value: true });
14
19
  exports.GUEST_ORDER_STATUS_LINK_TEMPLATE = exports.GUEST_ORDER_STATUS_ERROR_CODES = void 0;
package/dist/cjs/order.js CHANGED
@@ -671,6 +671,9 @@ exports.ORDER_ERROR_CODES = [
671
671
  // Storefront checkout: the cart re-priced since the shopper saw it (re-read and
672
672
  // confirm), and an allocated order id already taken (retry).
673
673
  'CART_PRICES_CHANGED',
674
+ // Storefront checkout: a cart line whose product the shopper's list no longer
675
+ // prices (or a channel-gated one); `unavailableProducts` names the product ids.
676
+ 'PRODUCT_NOT_AVAILABLE',
674
677
  'ORDER_ID_COLLISION',
675
678
  'DELIVERY_METHOD_NOT_FOUND',
676
679
  // A priced delivery method (`Method.fee`): the freight moved since the shopper
@@ -20,7 +20,7 @@
20
20
  * `status`, `revisedAt` replaces `updatedAt`, and there is no `dated`.
21
21
  */
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.PURCHASE_WITHDRAWAL_CODE_DUE_MS = exports.PURCHASE_WITHDRAWAL_CODE_DUE_SOURCE = exports.PURCHASE_WITHDRAWAL_WINDOW_SOURCE = exports.PURCHASE_WITHDRAWAL_WINDOW_DAYS = exports.PURCHASE_WITHDRAWAL_LINES_MAX = exports.PURCHASE_WITHDRAWAL_NOTE_MAX = exports.PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS = exports.PURCHASE_WITHDRAWAL_ACTION_MODES = exports.PURCHASE_WITHDRAWAL_RELAY_CHANNELS = exports.PURCHASE_WITHDRAWAL_DECLINE_REASONS = exports.PURCHASE_WITHDRAWAL_SOURCES = exports.PURCHASE_WITHDRAWAL_LIST_FILTERS = exports.PURCHASE_WITHDRAWAL_STATES = void 0;
23
+ exports.PURCHASE_WITHDRAWAL_VERIFICATION_FAILED = exports.PURCHASE_WITHDRAWAL_GUEST_INTENTS = exports.PURCHASE_WITHDRAWAL_CODE_DUE_MS = exports.PURCHASE_WITHDRAWAL_CODE_DUE_SOURCE = exports.PURCHASE_WITHDRAWAL_WINDOW_SOURCE = exports.PURCHASE_WITHDRAWAL_WINDOW_DAYS = exports.PURCHASE_WITHDRAWAL_LINES_MAX = exports.PURCHASE_WITHDRAWAL_NOTE_MAX = exports.PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS = exports.PURCHASE_WITHDRAWAL_ACTION_MODES = exports.PURCHASE_WITHDRAWAL_RELAY_CHANNELS = exports.PURCHASE_WITHDRAWAL_DECLINE_REASONS = exports.PURCHASE_WITHDRAWAL_SOURCES = exports.PURCHASE_WITHDRAWAL_LIST_FILTERS = exports.PURCHASE_WITHDRAWAL_STATES = void 0;
24
24
  /**
25
25
  * - `requested` — submitted, the code minted, the order's dispatch locked
26
26
  * (`purchase-withdrawal-pending`) until an operator decides.
@@ -100,3 +100,17 @@ exports.PURCHASE_WITHDRAWAL_WINDOW_SOURCE = 'W2';
100
100
  exports.PURCHASE_WITHDRAWAL_CODE_DUE_SOURCE = 'W1';
101
101
  /** How long after a relayed request was received its code is due, in ms. */
102
102
  exports.PURCHASE_WITHDRAWAL_CODE_DUE_MS = 24 * 60 * 60 * 1000;
103
+ /**
104
+ * The `intent` a guest's `POST /orders/purchase-withdrawal/guest` names. Only
105
+ * the purchase withdrawal (*"Me arrepentí"*) today; the warranty intent joins
106
+ * this tuple with the warranty request.
107
+ */
108
+ exports.PURCHASE_WITHDRAWAL_GUEST_INTENTS = ['purchase-withdrawal'];
109
+ /**
110
+ * The one refusal of every guest code failure on `POST
111
+ * /orders/purchase-withdrawal/guest` (`401`): a wrong, expired, exhausted or
112
+ * already used code, a challenge that does not exist (another store's
113
+ * included), and an order that is no longer a guest order — one body, so the
114
+ * route is never an oracle for which one it was.
115
+ */
116
+ exports.PURCHASE_WITHDRAWAL_VERIFICATION_FAILED = 'PURCHASE_WITHDRAWAL_VERIFICATION_FAILED';
@@ -551,7 +551,8 @@ exports.SOCKET_ACTIONS = [
551
551
  *
552
552
  * ⚠️ To the order's OWN customer only (`wsPostCustomer`), never a store-wide
553
553
  * customer broadcast. The operator frame for the same write is
554
- * `purchaseWithdrawalChanged`.
554
+ * `purchaseWithdrawalChanged`; the order's own `orders` frame (the post-commit
555
+ * row, carrying or no longer carrying the dispatch lock) follows both.
555
556
  */
556
557
  'orderPurchaseWithdrawal',
557
558
  /**
@@ -6,8 +6,13 @@
6
6
  * The token (`gs1.…`) is a bearer credential over exactly ONE order, read-only:
7
7
  * it authorises no cart write, payment, cancellation, withdrawal or export. It
8
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.
9
+ * cancelled) more than `guestStatusLinkDaysAfterDelivery` days ago — unless a
10
+ * purchase withdrawal on it is not final or a refund on it is not closed — and
11
+ * every earlier link dies when a recovery or an operator revokes it.
12
+ *
13
+ * The guest purchase-withdrawal start (`POST /orders/purchase-withdrawal/guest/start`)
14
+ * accepts the token only to NAME the order: the withdrawal itself needs the
15
+ * code mailed to the order's address, so the token still authorises none.
11
16
  */
12
17
  /**
13
18
  * The refusals the guest status routes answer themselves.
@@ -93,6 +98,14 @@ declare global {
93
98
  onlinePayment?: true;
94
99
  /** The latest online payment attempt, when the order has one. */
95
100
  paymentAttempt?: OrderPaymentAttemptView;
101
+ /**
102
+ * The order's purchase withdrawals, newest first, with their refunds —
103
+ * the same `OrderPurchaseWithdrawalView`s `StorefrontOrderView` carries.
104
+ * Absent when the order has none.
105
+ */
106
+ purchaseWithdrawals?: OrderPurchaseWithdrawalView[];
107
+ /** Whether the withdrawal window is open now — as on `StorefrontOrderView`. Always present. */
108
+ purchaseWithdrawalEligibility: OrderPurchaseWithdrawalEligibility;
96
109
  contact: {
97
110
  /** The stored address, masked (e.g. `j***@d***.com`). */
98
111
  emailMasked: string;
@@ -6,8 +6,13 @@
6
6
  * The token (`gs1.…`) is a bearer credential over exactly ONE order, read-only:
7
7
  * it authorises no cart write, payment, cancellation, withdrawal or export. It
8
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.
9
+ * cancelled) more than `guestStatusLinkDaysAfterDelivery` days ago — unless a
10
+ * purchase withdrawal on it is not final or a refund on it is not closed — and
11
+ * every earlier link dies when a recovery or an operator revokes it.
12
+ *
13
+ * The guest purchase-withdrawal start (`POST /orders/purchase-withdrawal/guest/start`)
14
+ * accepts the token only to NAME the order: the withdrawal itself needs the
15
+ * code mailed to the order's address, so the token still authorises none.
11
16
  */
12
17
  /**
13
18
  * The refusals the guest status routes answer themselves.
package/dist/order.d.ts CHANGED
@@ -1107,7 +1107,9 @@ declare global {
1107
1107
  * checkout and the presupuesto conversion refuse (`PRODUCT_COST_UNKNOWN` —
1108
1108
  * an operator is standing there who can cost the product), while the
1109
1109
  * STOREFRONT checkout and the SERVICE HANDOVER commit and write one deduped
1110
- * `ORDER_PRODUCT_COST_UNKNOWN` log instead. The handover is deliberate: it
1110
+ * `ORDER_PRODUCT_COST_UNKNOWN` log instead. On the storefront that is only
1111
+ * reachable for a line priced by an ABSOLUTE slot: a cost-less product on a
1112
+ * percent slot has no selling price and is refused `PRODUCT_NOT_AVAILABLE`. The handover is deliberate: it
1111
1113
  * is a customer collecting their own repaired equipment, and that path
1112
1114
  * declines to block on a stock shortfall for the same reason.
1113
1115
  *
@@ -3075,6 +3077,6 @@ export declare const orderFulfilmentProgress: (order: OrderFulfilmentProgressInp
3075
3077
  * `SUBSCRIPTION_READONLY`) sit on the order CREATE leg only: an edit is not a new
3076
3078
  * order, so `bareOrderPostHandler` routes past `requireMetered` entirely.
3077
3079
  */
3078
- export declare const ORDER_ERROR_CODES: readonly ["ORDER_COST_DENOMINATION_UNKNOWN", "SERVICE_ORDER_DELIVERY_MANAGED", "ORDER_NOT_FOUND", "ORDER_LOCKED", "ORDER_NOT_READY", "ORDER_DELIVERED_ANOTHER_DAY", "ORDER_DELIVERY_STATE_UNCHANGED", "ORDER_ILLEGAL_TRANSITION", "ORDER_VERSION_CONFLICT", "CUSTOMER_NOT_FOUND", "CUSTOMER_MERGED", "ORDER_HAS_NO_CUSTOMER", "CUSTOMER_ANONYMIZED", "FX_CONVERSION_UNAVAILABLE", "ROLE_FORBIDDEN", "ORDER_CANCELLED", "PAYMENT_SETTLED_ON_ANOTHER_ORDER", "ORDER_HAS_SHIPMENTS", "ORDER_HAS_RETURNS", "SHIPMENT_QUANTITY_EXCEEDED", "SHIPMENT_LINE_MISMATCH", "SHIPMENT_NOT_FOUND", "SHIPMENT_LIMIT_REACHED", "SHIPMENT_TOO_LARGE", "ORDER_FULFILMENT_EXTERNAL", "SHIPMENT_FAILED", "ADMIN_REQUIRED", "IDEMPOTENCY_KEY_REQUIRED", "INVALID_IDEMPOTENCY_KEY", "IDEMPOTENCY_KEY_REUSE", "IDEMPOTENCY_IN_PROGRESS", "IDEMPOTENCY_LOCK_CONTENTION", "IDEMPOTENCY_KEY_FAILED", "IDEMPOTENT_RESPONSE_NOT_CACHED", "ORDER_CANCELLATION_NOT_PROTECTED", "ORDER_CANCELLATION_COMMITTED", "ORDER_CANCELLATION_LOCKED", "ORDER_CANCELLATION_TOO_LARGE", "ORDER_CANCELLATION_FAILED", "SALE_LEDGER_RETRACTION_REFUSED", "SALE_LEDGER_ROW_NOT_OWNED", "PRODUCT_NOT_FOUND", "PRODUCT_SALE_LIMIT_EXCEEDED", "PRODUCT_SALE_LIMIT_INVALID", "DEPOSIT_SOURCE_NOT_ALLOWED", "DEPOSIT_CURRENCY_MISMATCH", "DEPOSIT_EXCEEDS_TOTAL", "DEPOSIT_FREEZE_REQUIRES_INVOICE", "DEPOSIT_FREEZE_INVOICE_PENDING", "DEPOSIT_CHARACTERIZATION_CONFLICT", "DEPOSIT_FREEZE_INVOICE_NOT_QUALIFYING", "DEPOSIT_INVOICED_ORDER_MUST_FREEZE", "DEPOSIT_FROZEN_ORDER_MUST_FREEZE", "DEPOSIT_REFERENCE_IS_LINKED_PAYMENT", "DEPOSIT_DUPLICATE_REFERENCE", "TILL_TENDER_REQUIRES_DEPOSIT", "PAYMENT_REFERENCED_BY_DEPOSIT", "ORDER_HAS_UNREFUNDED_DEPOSIT", "ORDER_PRICE_FROZEN", "DEPOSIT_NOT_FOUND", "DEPOSIT_ALREADY_REFUNDED", "UNIT_QUANTITY_NOT_WHOLE", "UNIT_REVISION_STALE", "UNIT_QUANTITY_UNREPRESENTABLE", "KIT_RECIPE_CHANGED", "CART_PROMOTION_UNAVAILABLE", "ORDER_HAS_KIT_LINES", "ORDER_HAS_FREIGHT_LINE", "ORDER_TARGET_REQUIRED", "ORDER_SOURCE_CONFLICT", "ORDER_CUSTOMER_REQUIRED", "BASKET_EMPTY", "BASKET_CHANGED_DURING_CHECKOUT", "CART_VERSION_CREATE_ONLY", "CART_VERSION_REQUIRES_CART_ID", "CART_REVISION_STALE", "CART_CUSTOMER_MISMATCH", "COUNTER_SALE_CREATE_ONLY", "SOLD_AT_CREATE_ONLY", "SOLD_AT_IN_FUTURE", "ORDER_TENDER_CREATE_ONLY", "CREDIT_OVERRIDE_CREATE_ONLY", "ON_ACCOUNT_CREATE_ONLY", "ON_ACCOUNT_WITH_TENDERS", "TENDERS_REQUIRE_COUNTER_SALE", "LINES_REQUIRE_COUNTER_SALE", "PRODUCT_COST_UNKNOWN", "PRICE_CHANGE_DISABLED", "LINE_DISCOUNT_EXCEEDS_MAX", "CUSTOMER_DISABLED", "SHIFT_NOT_AVAILABLE", "SOLD_AT_OUTSIDE_SHIFT", "ORDER_CURRENCY_NOT_SUBSCRIBED", "PAYMENT_METHODS_NOT_CONFIGURED", "PAYMENT_METHOD_NOT_FOUND", "PAYMENT_METHOD_UNAVAILABLE", "CART_PRICES_CHANGED", "ORDER_ID_COLLISION", "DELIVERY_METHOD_NOT_FOUND", "DELIVERY_FEE_CHANGED", "DELIVERY_FEE_CURRENCY_UNSUPPORTED", "GUEST_CONTACT_REQUIRED", "ORDER_BELOW_MINIMUM_PURCHASE", "ORDER_INVALID_CART", "CART_CHANGED_SINCE_CONFIRM", "EMAIL_VERIFICATION_REQUIRED", "ACCOUNT_DISABLED", "CUSTOMER_ACCESS_PENDING", "CUSTOMER_ACCESS_REJECTED", "CURRENCY_MISMATCH", "SHIFT_NOT_OPEN", "ORDER_DISCOUNT_AFTER_INVOICE", "ORDER_DISCOUNT_ON_SERVICE_ORDER", "ORDER_DISCOUNT_ON_MARKETPLACE_ORDER", "ORDER_INVOICE_METHOD_OUTSTANDING_FACTURA", "ORDER_SERVICE_PERIOD_AFTER_INVOICE", "ORDER_ATTEMPT_COMMITTED", "ORDER_ATTEMPT_ABANDONED", "ORDER_ATTEMPT_KEY_EXPIRED", "ORDER_ATTEMPT_KEY_SCOPE_MISMATCH", "ORDER_COMPLETION_ATTEMPT_COMMITTED", "ORDER_COMPLETION_ATTEMPT_ABANDONED"];
3080
+ export declare const ORDER_ERROR_CODES: readonly ["ORDER_COST_DENOMINATION_UNKNOWN", "SERVICE_ORDER_DELIVERY_MANAGED", "ORDER_NOT_FOUND", "ORDER_LOCKED", "ORDER_NOT_READY", "ORDER_DELIVERED_ANOTHER_DAY", "ORDER_DELIVERY_STATE_UNCHANGED", "ORDER_ILLEGAL_TRANSITION", "ORDER_VERSION_CONFLICT", "CUSTOMER_NOT_FOUND", "CUSTOMER_MERGED", "ORDER_HAS_NO_CUSTOMER", "CUSTOMER_ANONYMIZED", "FX_CONVERSION_UNAVAILABLE", "ROLE_FORBIDDEN", "ORDER_CANCELLED", "PAYMENT_SETTLED_ON_ANOTHER_ORDER", "ORDER_HAS_SHIPMENTS", "ORDER_HAS_RETURNS", "SHIPMENT_QUANTITY_EXCEEDED", "SHIPMENT_LINE_MISMATCH", "SHIPMENT_NOT_FOUND", "SHIPMENT_LIMIT_REACHED", "SHIPMENT_TOO_LARGE", "ORDER_FULFILMENT_EXTERNAL", "SHIPMENT_FAILED", "ADMIN_REQUIRED", "IDEMPOTENCY_KEY_REQUIRED", "INVALID_IDEMPOTENCY_KEY", "IDEMPOTENCY_KEY_REUSE", "IDEMPOTENCY_IN_PROGRESS", "IDEMPOTENCY_LOCK_CONTENTION", "IDEMPOTENCY_KEY_FAILED", "IDEMPOTENT_RESPONSE_NOT_CACHED", "ORDER_CANCELLATION_NOT_PROTECTED", "ORDER_CANCELLATION_COMMITTED", "ORDER_CANCELLATION_LOCKED", "ORDER_CANCELLATION_TOO_LARGE", "ORDER_CANCELLATION_FAILED", "SALE_LEDGER_RETRACTION_REFUSED", "SALE_LEDGER_ROW_NOT_OWNED", "PRODUCT_NOT_FOUND", "PRODUCT_SALE_LIMIT_EXCEEDED", "PRODUCT_SALE_LIMIT_INVALID", "DEPOSIT_SOURCE_NOT_ALLOWED", "DEPOSIT_CURRENCY_MISMATCH", "DEPOSIT_EXCEEDS_TOTAL", "DEPOSIT_FREEZE_REQUIRES_INVOICE", "DEPOSIT_FREEZE_INVOICE_PENDING", "DEPOSIT_CHARACTERIZATION_CONFLICT", "DEPOSIT_FREEZE_INVOICE_NOT_QUALIFYING", "DEPOSIT_INVOICED_ORDER_MUST_FREEZE", "DEPOSIT_FROZEN_ORDER_MUST_FREEZE", "DEPOSIT_REFERENCE_IS_LINKED_PAYMENT", "DEPOSIT_DUPLICATE_REFERENCE", "TILL_TENDER_REQUIRES_DEPOSIT", "PAYMENT_REFERENCED_BY_DEPOSIT", "ORDER_HAS_UNREFUNDED_DEPOSIT", "ORDER_PRICE_FROZEN", "DEPOSIT_NOT_FOUND", "DEPOSIT_ALREADY_REFUNDED", "UNIT_QUANTITY_NOT_WHOLE", "UNIT_REVISION_STALE", "UNIT_QUANTITY_UNREPRESENTABLE", "KIT_RECIPE_CHANGED", "CART_PROMOTION_UNAVAILABLE", "ORDER_HAS_KIT_LINES", "ORDER_HAS_FREIGHT_LINE", "ORDER_TARGET_REQUIRED", "ORDER_SOURCE_CONFLICT", "ORDER_CUSTOMER_REQUIRED", "BASKET_EMPTY", "BASKET_CHANGED_DURING_CHECKOUT", "CART_VERSION_CREATE_ONLY", "CART_VERSION_REQUIRES_CART_ID", "CART_REVISION_STALE", "CART_CUSTOMER_MISMATCH", "COUNTER_SALE_CREATE_ONLY", "SOLD_AT_CREATE_ONLY", "SOLD_AT_IN_FUTURE", "ORDER_TENDER_CREATE_ONLY", "CREDIT_OVERRIDE_CREATE_ONLY", "ON_ACCOUNT_CREATE_ONLY", "ON_ACCOUNT_WITH_TENDERS", "TENDERS_REQUIRE_COUNTER_SALE", "LINES_REQUIRE_COUNTER_SALE", "PRODUCT_COST_UNKNOWN", "PRICE_CHANGE_DISABLED", "LINE_DISCOUNT_EXCEEDS_MAX", "CUSTOMER_DISABLED", "SHIFT_NOT_AVAILABLE", "SOLD_AT_OUTSIDE_SHIFT", "ORDER_CURRENCY_NOT_SUBSCRIBED", "PAYMENT_METHODS_NOT_CONFIGURED", "PAYMENT_METHOD_NOT_FOUND", "PAYMENT_METHOD_UNAVAILABLE", "CART_PRICES_CHANGED", "PRODUCT_NOT_AVAILABLE", "ORDER_ID_COLLISION", "DELIVERY_METHOD_NOT_FOUND", "DELIVERY_FEE_CHANGED", "DELIVERY_FEE_CURRENCY_UNSUPPORTED", "GUEST_CONTACT_REQUIRED", "ORDER_BELOW_MINIMUM_PURCHASE", "ORDER_INVALID_CART", "CART_CHANGED_SINCE_CONFIRM", "EMAIL_VERIFICATION_REQUIRED", "ACCOUNT_DISABLED", "CUSTOMER_ACCESS_PENDING", "CUSTOMER_ACCESS_REJECTED", "CURRENCY_MISMATCH", "SHIFT_NOT_OPEN", "ORDER_DISCOUNT_AFTER_INVOICE", "ORDER_DISCOUNT_ON_SERVICE_ORDER", "ORDER_DISCOUNT_ON_MARKETPLACE_ORDER", "ORDER_INVOICE_METHOD_OUTSTANDING_FACTURA", "ORDER_SERVICE_PERIOD_AFTER_INVOICE", "ORDER_ATTEMPT_COMMITTED", "ORDER_ATTEMPT_ABANDONED", "ORDER_ATTEMPT_KEY_EXPIRED", "ORDER_ATTEMPT_KEY_SCOPE_MISMATCH", "ORDER_COMPLETION_ATTEMPT_COMMITTED", "ORDER_COMPLETION_ATTEMPT_ABANDONED"];
3079
3081
  export type OrderErrorCode = (typeof ORDER_ERROR_CODES)[number];
3080
3082
  export {};
package/dist/order.js CHANGED
@@ -664,6 +664,9 @@ export const ORDER_ERROR_CODES = [
664
664
  // Storefront checkout: the cart re-priced since the shopper saw it (re-read and
665
665
  // confirm), and an allocated order id already taken (retry).
666
666
  'CART_PRICES_CHANGED',
667
+ // Storefront checkout: a cart line whose product the shopper's list no longer
668
+ // prices (or a channel-gated one); `unavailableProducts` names the product ids.
669
+ 'PRODUCT_NOT_AVAILABLE',
667
670
  'ORDER_ID_COLLISION',
668
671
  'DELIVERY_METHOD_NOT_FOUND',
669
672
  // A priced delivery method (`Method.fee`): the freight moved since the shopper
@@ -75,6 +75,20 @@ export declare const PURCHASE_WITHDRAWAL_WINDOW_SOURCE = "W2";
75
75
  export declare const PURCHASE_WITHDRAWAL_CODE_DUE_SOURCE = "W1";
76
76
  /** How long after a relayed request was received its code is due, in ms. */
77
77
  export declare const PURCHASE_WITHDRAWAL_CODE_DUE_MS: number;
78
+ /**
79
+ * The `intent` a guest's `POST /orders/purchase-withdrawal/guest` names. Only
80
+ * the purchase withdrawal (*"Me arrepentí"*) today; the warranty intent joins
81
+ * this tuple with the warranty request.
82
+ */
83
+ export declare const PURCHASE_WITHDRAWAL_GUEST_INTENTS: readonly ["purchase-withdrawal"];
84
+ /**
85
+ * The one refusal of every guest code failure on `POST
86
+ * /orders/purchase-withdrawal/guest` (`401`): a wrong, expired, exhausted or
87
+ * already used code, a challenge that does not exist (another store's
88
+ * included), and an order that is no longer a guest order — one body, so the
89
+ * route is never an oracle for which one it was.
90
+ */
91
+ export declare const PURCHASE_WITHDRAWAL_VERIFICATION_FAILED: "PURCHASE_WITHDRAWAL_VERIFICATION_FAILED";
78
92
  declare global {
79
93
  type PurchaseWithdrawalState = (typeof PURCHASE_WITHDRAWAL_STATES)[number];
80
94
  type PurchaseWithdrawalSource = (typeof PURCHASE_WITHDRAWAL_SOURCES)[number];
@@ -82,6 +96,7 @@ declare global {
82
96
  type PurchaseWithdrawalRelayChannel = (typeof PURCHASE_WITHDRAWAL_RELAY_CHANNELS)[number];
83
97
  type PurchaseWithdrawalActionMode = (typeof PURCHASE_WITHDRAWAL_ACTION_MODES)[number];
84
98
  type PurchaseWithdrawalIneligibleReason = (typeof PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS)[number];
99
+ type PurchaseWithdrawalGuestIntent = (typeof PURCHASE_WITHDRAWAL_GUEST_INTENTS)[number];
85
100
  /** One withdrawn order line, by its index in `Order.items`. */
86
101
  interface PurchaseWithdrawalLine {
87
102
  orderItemIndex: number;
@@ -239,6 +254,54 @@ declare global {
239
254
  interface PurchaseWithdrawalSubmitResponse {
240
255
  purchaseWithdrawal: OrderPurchaseWithdrawalView;
241
256
  }
257
+ /**
258
+ * `POST /orders/purchase-withdrawal/guest/start` (Web host, PUBLIC, bound
259
+ * origin). Strict body, ONE of two shapes, each naming the order only:
260
+ *
261
+ * - `{ token }` — the guest order status token (`gs1.…`). It grants nothing
262
+ * by itself: the code still goes to the order's address.
263
+ * - `{ orderId, email }` — the order number and the address the order was
264
+ * placed with.
265
+ *
266
+ * Always the same `202` ({@link PurchaseWithdrawalGuestStartResponse})
267
+ * whether or not anything matches; a match within budget mails a 6-digit
268
+ * code to the address on the order's LIVE guest customer row (never the one
269
+ * typed). Only a malformed body answers otherwise (`400`).
270
+ */
271
+ type PurchaseWithdrawalGuestStartRequest = {
272
+ token: string;
273
+ } | {
274
+ orderId: string;
275
+ email: string;
276
+ };
277
+ /** `data` of the `202` of the guest start: the handle step 2 names. Random, 128 bits, base64url. */
278
+ interface PurchaseWithdrawalGuestStartResponse {
279
+ challengeHandle: string;
280
+ }
281
+ /**
282
+ * `POST /orders/purchase-withdrawal/guest` (Web host, PUBLIC, bound origin).
283
+ * Strict body. `lines` as on {@link PurchaseWithdrawalSubmitRequest}. Every
284
+ * code failure is the one `401 PURCHASE_WITHDRAWAL_VERIFICATION_FAILED`;
285
+ * the fifth wrong code burns the challenge. A correct code is consumed by
286
+ * the request's own transaction, so it creates at most one record.
287
+ */
288
+ interface PurchaseWithdrawalGuestSubmitRequest {
289
+ /** The start's `challengeHandle`. */
290
+ challengeHandle: string;
291
+ /** The 6-digit code mailed to the order's address. */
292
+ code: string;
293
+ intent: PurchaseWithdrawalGuestIntent;
294
+ lines?: PurchaseWithdrawalLine[];
295
+ }
296
+ /**
297
+ * `data` of the `201` of the guest submit: the code on screen, and a guest
298
+ * order status token minted at the order's CURRENT fence generation (no
299
+ * earlier link dies) — the storefront opens `/pedido/{statusToken}` to follow
300
+ * the refund. Absent only when the token could not be minted.
301
+ */
302
+ interface PurchaseWithdrawalGuestSubmitResponse extends PurchaseWithdrawalSubmitResponse {
303
+ statusToken?: string;
304
+ }
242
305
  /** `data` of `409 PURCHASE_WITHDRAWAL_ALREADY_REQUESTED`: the undecided request's code. */
243
306
  interface PurchaseWithdrawalAlreadyRequestedData {
244
307
  withdrawalId: string;
@@ -97,3 +97,17 @@ export const PURCHASE_WITHDRAWAL_WINDOW_SOURCE = 'W2';
97
97
  export const PURCHASE_WITHDRAWAL_CODE_DUE_SOURCE = 'W1';
98
98
  /** How long after a relayed request was received its code is due, in ms. */
99
99
  export const PURCHASE_WITHDRAWAL_CODE_DUE_MS = 24 * 60 * 60 * 1000;
100
+ /**
101
+ * The `intent` a guest's `POST /orders/purchase-withdrawal/guest` names. Only
102
+ * the purchase withdrawal (*"Me arrepentí"*) today; the warranty intent joins
103
+ * this tuple with the warranty request.
104
+ */
105
+ export const PURCHASE_WITHDRAWAL_GUEST_INTENTS = ['purchase-withdrawal'];
106
+ /**
107
+ * The one refusal of every guest code failure on `POST
108
+ * /orders/purchase-withdrawal/guest` (`401`): a wrong, expired, exhausted or
109
+ * already used code, a challenge that does not exist (another store's
110
+ * included), and an order that is no longer a guest order — one body, so the
111
+ * route is never an oracle for which one it was.
112
+ */
113
+ export const PURCHASE_WITHDRAWAL_VERIFICATION_FAILED = 'PURCHASE_WITHDRAWAL_VERIFICATION_FAILED';
package/dist/socket.js CHANGED
@@ -548,7 +548,8 @@ export const SOCKET_ACTIONS = [
548
548
  *
549
549
  * ⚠️ To the order's OWN customer only (`wsPostCustomer`), never a store-wide
550
550
  * customer broadcast. The operator frame for the same write is
551
- * `purchaseWithdrawalChanged`.
551
+ * `purchaseWithdrawalChanged`; the order's own `orders` frame (the post-commit
552
+ * row, carrying or no longer carrying the dispatch lock) follows both.
552
553
  */
553
554
  'orderPurchaseWithdrawal',
554
555
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.816",
3
+ "version": "1.10.818",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",