platform-types 1.10.824 → 1.10.826

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.
@@ -83,11 +83,14 @@ exports.PURCHASE_WITHDRAWAL_ACTION_MODES = ['accept', 'decline', 'relay'];
83
83
  * already returned (`data.orderItemIndex`).
84
84
  * - `nothing-to-withdraw` — every line is already withdrawn or returned.
85
85
  * - `not-delivered` — a warranty request on an order not yet delivered.
86
- * - `return-request-open` — a warranty request on an order that already has an
87
- * open shopper return request (`requested`, `authorized` or `received`);
88
- * `data.rmaId` names it. One open shopper request per order.
89
- * - `too-many-lines` — a warranty request naming, or resolving to, more lines
90
- * than one return request may hold; `data.max` is the bound.
86
+ * - `return-request-open` — a shopper return request (a warranty request, or a
87
+ * change of mind: a withdrawal-shaped body past W2 while the store's policy is
88
+ * on) on an order that already has an open shopper return request
89
+ * (`requested`, `authorized` or `received`); `data.rmaId` names it. One open
90
+ * shopper request per order.
91
+ * - `too-many-lines` — a shopper return request (either flow) naming, or
92
+ * resolving to, more lines than one return request may hold; `data.max` is
93
+ * the bound.
91
94
  */
92
95
  exports.PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS = [
93
96
  'order-cancelled',
@@ -106,9 +106,14 @@ declare global {
106
106
  purchaseWithdrawals?: OrderPurchaseWithdrawalView[];
107
107
  /** Whether the withdrawal window is open now — as on `StorefrontOrderView`. Always present. */
108
108
  purchaseWithdrawalEligibility: OrderPurchaseWithdrawalEligibility;
109
- /** Shopper-sourced return requests, newest first. Reserved — not attached yet. */
109
+ /**
110
+ * The order's shopper-sourced return requests (`source: 'shopper'`), any
111
+ * status, newest first. Absent when there are none, and — with
112
+ * `returnRequestEligibility` — when the store's return requests could not be
113
+ * read whole.
114
+ */
110
115
  returnRequests?: OrderReturnRequestView[];
111
- /** Reserved — not attached yet. */
116
+ /** Whether a return request can be opened now. Absent only when the return requests could not be read whole. */
112
117
  returnRequestEligibility?: OrderReturnRequestEligibility;
113
118
  contact: {
114
119
  /** The stored address, masked (e.g. `j***@d***.com`). */
@@ -136,9 +136,14 @@ declare global {
136
136
  delivery?: OrderDeliveryView;
137
137
  purchaseWithdrawals?: OrderPurchaseWithdrawalView[];
138
138
  purchaseWithdrawalEligibility?: OrderPurchaseWithdrawalEligibility;
139
- /** Shopper-sourced return requests, newest first. Reserved — not attached yet. */
139
+ /**
140
+ * The order's shopper-sourced return requests (`source: 'shopper'`), any
141
+ * status, newest first. Absent when there are none, and — with
142
+ * `returnRequestEligibility` — when the store's return requests could not be
143
+ * read whole.
144
+ */
140
145
  returnRequests?: OrderReturnRequestView[];
141
- /** Reserved — not attached yet. */
146
+ /** Whether a return request can be opened now. Absent only when the return requests could not be read whole. */
142
147
  returnRequestEligibility?: OrderReturnRequestEligibility;
143
148
  };
144
149
  /**
@@ -65,11 +65,14 @@ export declare const PURCHASE_WITHDRAWAL_ACTION_MODES: readonly ["accept", "decl
65
65
  * already returned (`data.orderItemIndex`).
66
66
  * - `nothing-to-withdraw` — every line is already withdrawn or returned.
67
67
  * - `not-delivered` — a warranty request on an order not yet delivered.
68
- * - `return-request-open` — a warranty request on an order that already has an
69
- * open shopper return request (`requested`, `authorized` or `received`);
70
- * `data.rmaId` names it. One open shopper request per order.
71
- * - `too-many-lines` — a warranty request naming, or resolving to, more lines
72
- * than one return request may hold; `data.max` is the bound.
68
+ * - `return-request-open` — a shopper return request (a warranty request, or a
69
+ * change of mind: a withdrawal-shaped body past W2 while the store's policy is
70
+ * on) on an order that already has an open shopper return request
71
+ * (`requested`, `authorized` or `received`); `data.rmaId` names it. One open
72
+ * shopper request per order.
73
+ * - `too-many-lines` — a shopper return request (either flow) naming, or
74
+ * resolving to, more lines than one return request may hold; `data.max` is
75
+ * the bound.
73
76
  */
74
77
  export declare const PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS: readonly ["order-cancelled", "no-customer", "partial-before-fulfilment", "line-not-on-order", "line-unavailable", "nothing-to-withdraw", "not-delivered", "return-request-open", "too-many-lines"];
75
78
  /**
@@ -282,7 +285,14 @@ declare global {
282
285
  /** 1–{@link PURCHASE_WITHDRAWAL_LINES_MAX} distinct lines, each with a positive quantity. */
283
286
  lines?: PurchaseWithdrawalLine[];
284
287
  }
285
- /** `data` of the `201` of `POST /orders/purchase-withdrawal`: the code is `purchaseWithdrawal.withdrawalId`. */
288
+ /**
289
+ * `data` of the `201` of `POST /orders/purchase-withdrawal` when a withdrawal
290
+ * was recorded: the code is `purchaseWithdrawal.withdrawalId`. A
291
+ * withdrawal-shaped body past W2 may instead open a change-of-mind return
292
+ * request (the store's policy on, its window open) and answer
293
+ * {@link ShopperReturnRequestSubmitResponse} — tell them apart by key
294
+ * ({@link ShopperOrderRequestResponse}).
295
+ */
286
296
  interface PurchaseWithdrawalSubmitResponse {
287
297
  purchaseWithdrawal: OrderPurchaseWithdrawalView;
288
298
  }
@@ -329,7 +339,11 @@ declare global {
329
339
  * `data` of the `201` of the guest submit: the code on screen, and a guest
330
340
  * order status token minted at the order's CURRENT fence generation (no
331
341
  * earlier link dies) — the storefront opens `/pedido/{statusToken}` to follow
332
- * the refund. Absent only when the token could not be minted.
342
+ * the refund. Absent only when the token could not be minted. A
343
+ * withdrawal-shaped body past W2 may instead open a change-of-mind return
344
+ * request (the store's policy on, its window open) and answer
345
+ * {@link ShopperReturnRequestGuestSubmitResponse} — tell them apart by key
346
+ * ({@link ShopperOrderGuestRequestResponse}).
333
347
  */
334
348
  interface PurchaseWithdrawalGuestSubmitResponse extends PurchaseWithdrawalSubmitResponse {
335
349
  statusToken?: string;
@@ -80,11 +80,14 @@ export const PURCHASE_WITHDRAWAL_ACTION_MODES = ['accept', 'decline', 'relay'];
80
80
  * already returned (`data.orderItemIndex`).
81
81
  * - `nothing-to-withdraw` — every line is already withdrawn or returned.
82
82
  * - `not-delivered` — a warranty request on an order not yet delivered.
83
- * - `return-request-open` — a warranty request on an order that already has an
84
- * open shopper return request (`requested`, `authorized` or `received`);
85
- * `data.rmaId` names it. One open shopper request per order.
86
- * - `too-many-lines` — a warranty request naming, or resolving to, more lines
87
- * than one return request may hold; `data.max` is the bound.
83
+ * - `return-request-open` — a shopper return request (a warranty request, or a
84
+ * change of mind: a withdrawal-shaped body past W2 while the store's policy is
85
+ * on) on an order that already has an open shopper return request
86
+ * (`requested`, `authorized` or `received`); `data.rmaId` names it. One open
87
+ * shopper request per order.
88
+ * - `too-many-lines` — a shopper return request (either flow) naming, or
89
+ * resolving to, more lines than one return request may hold; `data.max` is
90
+ * the bound.
88
91
  */
89
92
  export const PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS = [
90
93
  'order-cancelled',
package/dist/rma.d.ts CHANGED
@@ -132,9 +132,10 @@ declare global {
132
132
  expiresAt?: number;
133
133
  /**
134
134
  * Who opened the request. Absent means `operator`. `shopper` is the
135
- * storefront warranty request (`POST /orders/purchase-withdrawal` and its
136
- * guest twin with `intent: 'warranty'`); `purchase-withdrawal` has no
137
- * writer yet.
135
+ * storefront's own request on `POST /orders/purchase-withdrawal` and its
136
+ * guest twin: the warranty request (`intent: 'warranty'`), or a change of
137
+ * mind (a withdrawal-shaped body past W2 while the store's policy is on);
138
+ * `purchase-withdrawal` has no writer yet.
138
139
  */
139
140
  source?: RmaSource;
140
141
  /** Server-derived legal track. Absent on an operator request. */
@@ -233,14 +234,21 @@ declare global {
233
234
  /**
234
235
  * A shopper-sourced return request as the shopper sees it, by ALLOW-LIST:
235
236
  * never the operator's reasons or actors, carrier, tracking, nor the
236
- * shopper's own description. Answered by the shopper's warranty request
237
- * (`ShopperReturnRequestSubmitResponse`) and its `orderReturnRequest` frame.
237
+ * shopper's own description. Answered by the shopper's warranty or
238
+ * change-of-mind request (`ShopperReturnRequestSubmitResponse`), its `orderReturnRequest` frame (on
239
+ * the request and on every later status move), and the order reads
240
+ * (`StorefrontOrderView.returnRequests`, `GuestOrderStatusView.returnRequests`).
238
241
  */
239
242
  interface OrderReturnRequestView {
240
243
  rmaId: string;
241
244
  flow: ShopperReturnRequestFlow;
242
245
  status: RmaStatus;
243
246
  requestedAt: number;
247
+ /**
248
+ * Unix ms of the request's last write (the `Rma` row's `updatedAt`). Of two
249
+ * frames or reads of one request, the later `updatedAt` is the current one.
250
+ */
251
+ updatedAt: number;
244
252
  items: OrderReturnRequestItemView[];
245
253
  /** Unix ms. */
246
254
  warrantyEndsAt?: number;
@@ -250,6 +258,10 @@ declare global {
250
258
  returnShippingPaidBy: ChangeOfMindReturnShippingPayer;
251
259
  refundAs: ChangeOfMindRefundAs;
252
260
  };
261
+ /**
262
+ * The refunds owed on this request, as on a withdrawal. No writer links a
263
+ * refund to a shopper request yet, so it is absent today.
264
+ */
253
265
  refunds?: OrderPurchaseWithdrawalRefundView[];
254
266
  }
255
267
  /** `data` of an `orderReturnRequest` socket frame, sent to the order's own customer only. */
@@ -257,7 +269,11 @@ declare global {
257
269
  orderId: string;
258
270
  returnRequest: OrderReturnRequestView;
259
271
  }
260
- /** Whether the shopper can open a return request on the order now. Reserved — no read serves it yet. */
272
+ /**
273
+ * Whether the shopper can open a return request on the order now — display
274
+ * only; the request path decides. Served on the order reads beside
275
+ * `returnRequests`.
276
+ */
261
277
  interface OrderReturnRequestEligibility {
262
278
  warranty: {
263
279
  open: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.824",
3
+ "version": "1.10.826",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",