platform-types 1.10.821 → 1.10.823

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,6 +83,11 @@ 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
91
  */
87
92
  exports.PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS = [
88
93
  'order-cancelled',
@@ -92,6 +97,8 @@ exports.PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS = [
92
97
  'line-unavailable',
93
98
  'nothing-to-withdraw',
94
99
  'not-delivered',
100
+ 'return-request-open',
101
+ 'too-many-lines',
95
102
  ];
96
103
  /**
97
104
  * Why accepting a withdrawal before fulfilment is refused
@@ -123,7 +130,8 @@ exports.PURCHASE_WITHDRAWAL_CODE_DUE_MS = 24 * 60 * 60 * 1000;
123
130
  * The `intent` a guest's withdrawal body names: the purchase withdrawal
124
131
  * (*"Me arrepentí"*) only. A warranty request is a separate body variant
125
132
  * ({@link SHOPPER_REQUEST_INTENTS}), never a widening of this tuple — the
126
- * withdrawal handler does not branch on `intent`.
133
+ * routes dispatch on `intent` to the warranty request before the withdrawal
134
+ * path, which itself never reads it.
127
135
  */
128
136
  exports.PURCHASE_WITHDRAWAL_GUEST_INTENTS = ['purchase-withdrawal'];
129
137
  /**
@@ -555,6 +555,16 @@ exports.SOCKET_ACTIONS = [
555
555
  * row, carrying or no longer carrying the dispatch lock) follows both.
556
556
  */
557
557
  'orderPurchaseWithdrawal',
558
+ /**
559
+ * A shopper's own return request (a warranty request) was opened. `data` is
560
+ * `OrderReturnRequestFrameData` (`rma.ts`) — the order id and the shopper's
561
+ * `OrderReturnRequestView`, an allow-list: never the description, the
562
+ * operator's reasons or actors, carrier or tracking.
563
+ *
564
+ * ⚠️ To the order's OWN customer only (`wsPostCustomer`), never a store-wide
565
+ * customer broadcast. The operator frame for the same write is `rma`.
566
+ */
567
+ 'orderReturnRequest',
558
568
  /**
559
569
  * A purchase withdrawal was requested, relayed or decided. `data` is the
560
570
  * `PurchaseWithdrawal` record as `GET /purchase-withdrawals` answers it.
package/dist/order.d.ts CHANGED
@@ -1290,6 +1290,15 @@ declare global {
1290
1290
  * never commit off the same read.
1291
1291
  */
1292
1292
  purchaseWithdrawalCount?: number;
1293
+ /**
1294
+ * How many RMAs were ever created on the order — every RMA, by an operator
1295
+ * (`POST /rma { mode: 'create' }`) or the shopper (a warranty request).
1296
+ * Server-owned: every RMA create pins it and bumps it, and a purchase
1297
+ * withdrawal pins it, each together with `purchaseWithdrawalCount` as
1298
+ * read, so no two of them commit off the same read of the order's free
1299
+ * lines.
1300
+ */
1301
+ returnRequestCount?: number;
1293
1302
  /** Bounded free text supplied by the canceller. */
1294
1303
  cancellationReason?: string;
1295
1304
  mercadolibreCreditNote?: {
@@ -65,8 +65,13 @@ 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
73
  */
69
- 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"];
74
+ 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"];
70
75
  /**
71
76
  * Why accepting a withdrawal before fulfilment is refused
72
77
  * `409 PURCHASE_WITHDRAWAL_FISCAL_IN_FLIGHT` (`data.cause`) — a factura is in
@@ -97,7 +102,8 @@ export declare const PURCHASE_WITHDRAWAL_CODE_DUE_MS: number;
97
102
  * The `intent` a guest's withdrawal body names: the purchase withdrawal
98
103
  * (*"Me arrepentí"*) only. A warranty request is a separate body variant
99
104
  * ({@link SHOPPER_REQUEST_INTENTS}), never a widening of this tuple — the
100
- * withdrawal handler does not branch on `intent`.
105
+ * routes dispatch on `intent` to the warranty request before the withdrawal
106
+ * path, which itself never reads it.
101
107
  */
102
108
  export declare const PURCHASE_WITHDRAWAL_GUEST_INTENTS: readonly ["purchase-withdrawal"];
103
109
  /**
@@ -339,11 +345,21 @@ declare global {
339
345
  source: 'W2';
340
346
  /** Unix ms. Present only when the store's change-of-mind policy is on but its window has passed too. */
341
347
  changeOfMindEndsAt?: number;
348
+ /**
349
+ * Unix ms — the end of the legal warranty window (`W3`), present only
350
+ * when the order was delivered and that window is still open, so the
351
+ * form can offer to resend the same request with `intent: 'warranty'`
352
+ * (a guest may resend the same code).
353
+ */
354
+ warrantyEndsAt?: number;
342
355
  }
343
356
  type ShopperRequestIntent = (typeof SHOPPER_REQUEST_INTENTS)[number];
344
357
  /**
345
- * The warranty variant of `POST /orders/purchase-withdrawal`. Reserved — the
346
- * live strict body refuses it `400` until the warranty request ships.
358
+ * The warranty variant of `POST /orders/purchase-withdrawal` (*"El producto
359
+ * tiene un problema"*): opens a shopper `Rma` (`flow: 'warranty'`) on a
360
+ * delivered order inside the warranty window. Never refused
361
+ * `PURCHASE_WITHDRAWAL_ALREADY_REQUESTED`; an undecided withdrawal holds
362
+ * only its own lines. `lines` absent means every line still available.
347
363
  */
348
364
  interface ShopperWarrantySubmitRequest {
349
365
  intent: 'warranty';
@@ -357,7 +373,12 @@ declare global {
357
373
  description: string;
358
374
  }
359
375
  type ShopperOrderRequest = PurchaseWithdrawalSubmitRequest | ShopperWarrantySubmitRequest;
360
- /** The warranty variant of the guest submit. Reserved, as {@link ShopperWarrantySubmitRequest}. */
376
+ /**
377
+ * The warranty variant of the guest submit, as {@link ShopperWarrantySubmitRequest}.
378
+ * The code is not bound to an intent: a guest refused
379
+ * `PURCHASE_WITHDRAWAL_WINDOW_CLOSED` may resend the same unspent code with
380
+ * `intent: 'warranty'`.
381
+ */
361
382
  interface ShopperWarrantyGuestSubmitRequest {
362
383
  challengeHandle: string;
363
384
  code: string;
@@ -387,6 +408,10 @@ declare global {
387
408
  reason: PurchaseWithdrawalIneligibleReason;
388
409
  /** The line refused, for `line-not-on-order` and `line-unavailable`. */
389
410
  orderItemIndex?: number;
411
+ /** The open shopper return request, for `return-request-open`. */
412
+ rmaId?: string;
413
+ /** The most lines one return request may hold, for `too-many-lines`. */
414
+ max?: number;
390
415
  }
391
416
  /** One of {@link PURCHASE_WITHDRAWAL_LIST_FILTERS}. */
392
417
  type PurchaseWithdrawalListFilter = (typeof PURCHASE_WITHDRAWAL_LIST_FILTERS)[number];
@@ -80,6 +80,11 @@ 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
88
  */
84
89
  export const PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS = [
85
90
  'order-cancelled',
@@ -89,6 +94,8 @@ export const PURCHASE_WITHDRAWAL_INELIGIBLE_REASONS = [
89
94
  'line-unavailable',
90
95
  'nothing-to-withdraw',
91
96
  'not-delivered',
97
+ 'return-request-open',
98
+ 'too-many-lines',
92
99
  ];
93
100
  /**
94
101
  * Why accepting a withdrawal before fulfilment is refused
@@ -120,7 +127,8 @@ export const PURCHASE_WITHDRAWAL_CODE_DUE_MS = 24 * 60 * 60 * 1000;
120
127
  * The `intent` a guest's withdrawal body names: the purchase withdrawal
121
128
  * (*"Me arrepentí"*) only. A warranty request is a separate body variant
122
129
  * ({@link SHOPPER_REQUEST_INTENTS}), never a widening of this tuple — the
123
- * withdrawal handler does not branch on `intent`.
130
+ * routes dispatch on `intent` to the warranty request before the withdrawal
131
+ * path, which itself never reads it.
124
132
  */
125
133
  export const PURCHASE_WITHDRAWAL_GUEST_INTENTS = ['purchase-withdrawal'];
126
134
  /**
package/dist/rma.d.ts CHANGED
@@ -83,13 +83,18 @@ declare global {
83
83
  customerId?: string;
84
84
  status: RmaStatus;
85
85
  items: RmaItem[];
86
- /** Operator who entered the request — typically off a phone call. */
86
+ /**
87
+ * Who entered the request: the operator (typically off a phone call), or
88
+ * — on a `shopper` request — the order's customer id (a guest row's id
89
+ * for a guest order).
90
+ */
87
91
  requestedBy: string;
88
92
  requestedAt: number;
89
93
  /**
90
- * Free text from the customer, relayed by the operator. Bounded. Not
91
- * written for a customer whose data was erased, and REMOVEd from the row
92
- * by an erasure (Ley 25.326 art. 16).
94
+ * Free text from the customer — relayed by the operator, or typed by the
95
+ * shopper on a `shopper` request (its `description`). Bounded. Not
96
+ * written for a customer whose data was erased, REMOVEd from the row by an
97
+ * erasure (Ley 25.326 art. 16), and never in an audit row.
93
98
  */
94
99
  requestReason?: string;
95
100
  authorizedBy?: string;
@@ -125,7 +130,12 @@ declare global {
125
130
  * field's meaning does not change.
126
131
  */
127
132
  expiresAt?: number;
128
- /** Who opened the request. Absent means `operator`. No writer sets another value yet. */
133
+ /**
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.
138
+ */
129
139
  source?: RmaSource;
130
140
  /** Server-derived legal track. Absent on an operator request. */
131
141
  flow?: ReturnFlow;
@@ -223,7 +233,8 @@ declare global {
223
233
  /**
224
234
  * A shopper-sourced return request as the shopper sees it, by ALLOW-LIST:
225
235
  * never the operator's reasons or actors, carrier, tracking, nor the
226
- * shopper's own description. Reserved — no read serves it yet.
236
+ * shopper's own description. Answered by the shopper's warranty request
237
+ * (`ShopperReturnRequestSubmitResponse`) and its `orderReturnRequest` frame.
227
238
  */
228
239
  interface OrderReturnRequestView {
229
240
  rmaId: string;
@@ -241,6 +252,11 @@ declare global {
241
252
  };
242
253
  refunds?: OrderPurchaseWithdrawalRefundView[];
243
254
  }
255
+ /** `data` of an `orderReturnRequest` socket frame, sent to the order's own customer only. */
256
+ interface OrderReturnRequestFrameData {
257
+ orderId: string;
258
+ returnRequest: OrderReturnRequestView;
259
+ }
244
260
  /** Whether the shopper can open a return request on the order now. Reserved — no read serves it yet. */
245
261
  interface OrderReturnRequestEligibility {
246
262
  warranty: {
package/dist/socket.d.ts CHANGED
@@ -26,7 +26,7 @@
26
26
  * A client must ignore actions it does not own rather than assume it
27
27
  * receives all of them.
28
28
  */
29
- export declare const SOCKET_ACTIONS: readonly ["account", "appointments", "appointmentWaitlist", "attendance", "attributes", "automation-rules", "baskets", "cart", "brands", "cash", "catalogOperation", "categories", "campaigns", "customers", "customerNote", "customerAddress", "customerContact", "deliveries", "globals", "inventory", "invoices", "literals", "loyalty", "orders", "presupuestos", "products", "promotions", "segments", "returns", "rma", "templates", "services", "service-templates", "shifts", "stores", "suppliers", "supplier-invoice", "support", "surveys", "users", "warehouses", "zones", "favorites", "webhooks", "account-delete", "baskets-delete", "cart-delete", "log-delete", "notifications", "support-message", "payment_received", "mp_payment_status_changed", "payment_linked", "payment_unlinked", "mercadopago", "mercadopago_dynamic_qr_created", "mercadopago_static_qr_created", "mp_hook_log_appended", "mp_ipn_log_appended", "orderPaymentAttempt", "orderDelivery", "paymentAttemptChanged", "orderPurchaseWithdrawal", "purchaseWithdrawalChanged", "stripe", "subscription", "caea", "print", "print-order", "print-invoice", "print-product", "print-tag", "print_job_failed", "request_printers", "printers_changed", "agent_status_changed", "print_rules_changed", "printers_active", "agent_command", "maintenance", "currency_auto_updated", "drain_progress", "integration_event_appended", "userActivityRecorded", "mercadolibre_settlement_period", "customDomain", "purchaseOrders", "cycleCounts", "stockTransfers", "workItems", "wholesaleRequests"];
29
+ export declare const SOCKET_ACTIONS: readonly ["account", "appointments", "appointmentWaitlist", "attendance", "attributes", "automation-rules", "baskets", "cart", "brands", "cash", "catalogOperation", "categories", "campaigns", "customers", "customerNote", "customerAddress", "customerContact", "deliveries", "globals", "inventory", "invoices", "literals", "loyalty", "orders", "presupuestos", "products", "promotions", "segments", "returns", "rma", "templates", "services", "service-templates", "shifts", "stores", "suppliers", "supplier-invoice", "support", "surveys", "users", "warehouses", "zones", "favorites", "webhooks", "account-delete", "baskets-delete", "cart-delete", "log-delete", "notifications", "support-message", "payment_received", "mp_payment_status_changed", "payment_linked", "payment_unlinked", "mercadopago", "mercadopago_dynamic_qr_created", "mercadopago_static_qr_created", "mp_hook_log_appended", "mp_ipn_log_appended", "orderPaymentAttempt", "orderDelivery", "paymentAttemptChanged", "orderPurchaseWithdrawal", "orderReturnRequest", "purchaseWithdrawalChanged", "stripe", "subscription", "caea", "print", "print-order", "print-invoice", "print-product", "print-tag", "print_job_failed", "request_printers", "printers_changed", "agent_status_changed", "print_rules_changed", "printers_active", "agent_command", "maintenance", "currency_auto_updated", "drain_progress", "integration_event_appended", "userActivityRecorded", "mercadolibre_settlement_period", "customDomain", "purchaseOrders", "cycleCounts", "stockTransfers", "workItems", "wholesaleRequests"];
30
30
  /** Union of every server→client data-frame action. */
31
31
  export type SocketAction = (typeof SOCKET_ACTIONS)[number];
32
32
  /**
package/dist/socket.js CHANGED
@@ -552,6 +552,16 @@ export const SOCKET_ACTIONS = [
552
552
  * row, carrying or no longer carrying the dispatch lock) follows both.
553
553
  */
554
554
  'orderPurchaseWithdrawal',
555
+ /**
556
+ * A shopper's own return request (a warranty request) was opened. `data` is
557
+ * `OrderReturnRequestFrameData` (`rma.ts`) — the order id and the shopper's
558
+ * `OrderReturnRequestView`, an allow-list: never the description, the
559
+ * operator's reasons or actors, carrier or tracking.
560
+ *
561
+ * ⚠️ To the order's OWN customer only (`wsPostCustomer`), never a store-wide
562
+ * customer broadcast. The operator frame for the same write is `rma`.
563
+ */
564
+ 'orderReturnRequest',
555
565
  /**
556
566
  * A purchase withdrawal was requested, relayed or decided. `data` is the
557
567
  * `PurchaseWithdrawal` record as `GET /purchase-withdrawals` answers it.
package/dist/store.d.ts CHANGED
@@ -992,8 +992,8 @@ declare global {
992
992
  /**
993
993
  * The store's voluntary change-of-mind return policy, beyond the
994
994
  * statutory withdrawal window. Absent, or `enabled: false`, means off.
995
- * Reserved — no `PATCH /store` validator accepts it yet. Written whole,
996
- * never cleared with `null`.
995
+ * Written whole through `PATCH /store` (ADMIN/SUPERVISOR/MANAGER); a
996
+ * plain USER is refused, and `null` never clears it.
997
997
  */
998
998
  changeOfMindReturns?: ChangeOfMindReturnsConfig;
999
999
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.821",
3
+ "version": "1.10.823",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",