platform-types 1.10.790 → 1.10.792

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.
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ /**
3
+ * Attach guest orders to an account — `POST /user { mode: 'attach-guest-orders' }`
4
+ * on the Web host. A signed-in shopper whose account email is VERIFIED names the
5
+ * guest orders they placed with that same email; each matched guest row is
6
+ * folded into their account by the customer merge, so the orders appear in the
7
+ * account's `GET /orders` and the orders' old guest status links stop working.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.GUEST_ATTACH_ERROR_CODES = void 0;
11
+ /**
12
+ * The refusals the attach answers itself.
13
+ *
14
+ * - GUEST_ATTACH_EMAIL_UNVERIFIED (403): the caller's account email is not
15
+ * verified (`Customer.emailVerified !== true`). Verify it through
16
+ * `POST /auth { mode: 'send-otp' | 'verify-otp' }` and retry. Nothing else is
17
+ * read.
18
+ * - GUEST_ATTACH_NOT_MATCHED (404): at least one named order is missing, is not
19
+ * a guest order, was placed with another email, or was already attached to
20
+ * another account; or its guest row also holds another customer folded into
21
+ * it, or staff cancelled its merge into this account (or the caller's own
22
+ * account was merged away or erased). One identical body whatever the
23
+ * reason, and this request attaches nothing — not even the orders that did
24
+ * match. Found before anything is written, it writes nothing; answered after
25
+ * a merge refusal or an operator cancel raced the request, it may follow the
26
+ * bump of that order's guest status fence (its old link already answers 401).
27
+ * - GUEST_ATTACH_ALREADY_DONE (409): every named order is already attached to
28
+ * the caller's account. Nothing is written.
29
+ *
30
+ * The account refusals, shared with other storefront routes (the same codes and
31
+ * statuses as `WholesaleRequestErrorCode`), answered off the one caller read
32
+ * before anything else is read:
33
+ *
34
+ * - USER_NOT_ENABLED (403): the shop disabled the account.
35
+ * - CUSTOMER_ACCESS_PENDING (403): the shop has not approved the account yet.
36
+ * - CUSTOMER_ACCESS_REJECTED (403): the shop rejected the account.
37
+ */
38
+ exports.GUEST_ATTACH_ERROR_CODES = [
39
+ 'GUEST_ATTACH_EMAIL_UNVERIFIED',
40
+ 'GUEST_ATTACH_NOT_MATCHED',
41
+ 'GUEST_ATTACH_ALREADY_DONE',
42
+ 'USER_NOT_ENABLED',
43
+ 'CUSTOMER_ACCESS_PENDING',
44
+ 'CUSTOMER_ACCESS_REJECTED',
45
+ ];
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("./guestAttach.js"), exports);
57
58
  __exportStar(require("./guestOrderStatus.js"), exports);
58
59
  __exportStar(require("./holdingCost.js"), exports);
59
60
  __exportStar(require("./demo.js"), exports);
@@ -113,6 +113,9 @@ exports.INVOICE_ISSUANCE_REFUSAL_RECOVERY = {
113
113
  * `POST /invoices` `{mode:'email'}` answers both before anything is enqueued, and
114
114
  * `POST /mercadolibre/events` `{mode:'reuploadFiscalDocument'}` answers both for
115
115
  * the factura it chose.
116
+ * The web (storefront) invoice PDF answers `INVOICE_NOT_FOUND` too: one uniform
117
+ * 404 for an invoice that is absent or not the caller's, where the caller's
118
+ * own invoices include those owned by an id folded (merged) into their account.
116
119
  *
117
120
  * - `INVOICE_NOT_FOUND` · 404 — no invoice row has this id in the caller's
118
121
  * store. Answered before any store read, render, print stamp, broadcast,
package/dist/cjs/order.js CHANGED
@@ -286,9 +286,11 @@ exports.orderFulfilmentProgress = orderFulfilmentProgress;
286
286
  * is refused after it, like every other refusal at commit.
287
287
  * - `ORDER_HAS_KIT_LINES` · 409 — `mode: 'edit'` on an order holding a kit line
288
288
  * (`CartLine.kit`). Cancel or return the order instead. Nothing was written.
289
- * - `ORDER_HAS_FREIGHT_LINE` · 409 — `mode: 'edit'` on an order holding a
290
- * freight line (`OrderLine.lineKind: 'freight'`). Cancel or return the order
291
- * instead. Nothing was written.
289
+ * - `ORDER_HAS_FREIGHT_LINE` · 409 — on an order holding a freight line
290
+ * (`OrderLine.lineKind: 'freight'`): `mode: 'edit'`, and a `POST /orders`
291
+ * update that CHANGES `deliveryMethod` (the freight was charged for the stored
292
+ * method, and is never re-priced; re-sending the stored method is not refused).
293
+ * Cancel or return the order instead. Nothing was written.
292
294
  * - `CART_PROMOTION_UNAVAILABLE` · 409 — the insert leg converting a STORED
293
295
  * ticket whose promotion ended, was paused, deleted, has not started or is
294
296
  * no longer cart-applicable; the `PromotionRefusal` rides `data.reason`. No
@@ -117,7 +117,10 @@ declare global {
117
117
  * address changed under every bounded retry; retry is safe. ALSO answered
118
118
  * by `POST /customers` and the storefront `POST /user` when an edit of
119
119
  * the address loses to a rival that moved the default or its copy — those
120
- * refuse on the FIRST failure, with no retry of their own.
120
+ * refuse on the FIRST failure, with no retry of their own. The storefront
121
+ * `POST /user` also answers it for ANY profile edit whose stored `email`
122
+ * changed after its read (another session moved it); nothing was written
123
+ * and the same edit, re-sent, is safe.
121
124
  *
122
125
  * Those two legacy writers' other row-state refusals are not in this union:
123
126
  * `409 CUSTOMER_ANONYMIZED` (see `Customer.anonymizedAt`) and `409
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Attach guest orders to an account — `POST /user { mode: 'attach-guest-orders' }`
3
+ * on the Web host. A signed-in shopper whose account email is VERIFIED names the
4
+ * guest orders they placed with that same email; each matched guest row is
5
+ * folded into their account by the customer merge, so the orders appear in the
6
+ * account's `GET /orders` and the orders' old guest status links stop working.
7
+ */
8
+ /**
9
+ * The refusals the attach answers itself.
10
+ *
11
+ * - GUEST_ATTACH_EMAIL_UNVERIFIED (403): the caller's account email is not
12
+ * verified (`Customer.emailVerified !== true`). Verify it through
13
+ * `POST /auth { mode: 'send-otp' | 'verify-otp' }` and retry. Nothing else is
14
+ * read.
15
+ * - GUEST_ATTACH_NOT_MATCHED (404): at least one named order is missing, is not
16
+ * a guest order, was placed with another email, or was already attached to
17
+ * another account; or its guest row also holds another customer folded into
18
+ * it, or staff cancelled its merge into this account (or the caller's own
19
+ * account was merged away or erased). One identical body whatever the
20
+ * reason, and this request attaches nothing — not even the orders that did
21
+ * match. Found before anything is written, it writes nothing; answered after
22
+ * a merge refusal or an operator cancel raced the request, it may follow the
23
+ * bump of that order's guest status fence (its old link already answers 401).
24
+ * - GUEST_ATTACH_ALREADY_DONE (409): every named order is already attached to
25
+ * the caller's account. Nothing is written.
26
+ *
27
+ * The account refusals, shared with other storefront routes (the same codes and
28
+ * statuses as `WholesaleRequestErrorCode`), answered off the one caller read
29
+ * before anything else is read:
30
+ *
31
+ * - USER_NOT_ENABLED (403): the shop disabled the account.
32
+ * - CUSTOMER_ACCESS_PENDING (403): the shop has not approved the account yet.
33
+ * - CUSTOMER_ACCESS_REJECTED (403): the shop rejected the account.
34
+ */
35
+ export declare const GUEST_ATTACH_ERROR_CODES: readonly ["GUEST_ATTACH_EMAIL_UNVERIFIED", "GUEST_ATTACH_NOT_MATCHED", "GUEST_ATTACH_ALREADY_DONE", "USER_NOT_ENABLED", "CUSTOMER_ACCESS_PENDING", "CUSTOMER_ACCESS_REJECTED"];
36
+ export type GuestAttachErrorCode = (typeof GUEST_ATTACH_ERROR_CODES)[number];
37
+ declare global {
38
+ /**
39
+ * `POST /user` body. `orderIds`: 1–20 distinct ids (`^ORD\d{6,10}$`). Strict:
40
+ * an undeclared key is a 400. The account is always the token's own.
41
+ */
42
+ interface GuestAttachRequest {
43
+ mode: 'attach-guest-orders';
44
+ orderIds: string[];
45
+ }
46
+ /**
47
+ * `data` of a `200`. The named orders that are attached to the caller's
48
+ * account once this request ends — those this request attached and those an
49
+ * earlier request already had.
50
+ *
51
+ * ⚠️ It may be a SUBSET of the request: an attach is resumable, and a run that
52
+ * runs out of time leaves the rest unattached. Re-issue the SAME request to
53
+ * finish it; a request whose orders are all attached answers
54
+ * `409 GUEST_ATTACH_ALREADY_DONE`.
55
+ */
56
+ interface GuestAttachResponse {
57
+ attachedOrderIds: string[];
58
+ }
59
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Attach guest orders to an account — `POST /user { mode: 'attach-guest-orders' }`
3
+ * on the Web host. A signed-in shopper whose account email is VERIFIED names the
4
+ * guest orders they placed with that same email; each matched guest row is
5
+ * folded into their account by the customer merge, so the orders appear in the
6
+ * account's `GET /orders` and the orders' old guest status links stop working.
7
+ */
8
+ /**
9
+ * The refusals the attach answers itself.
10
+ *
11
+ * - GUEST_ATTACH_EMAIL_UNVERIFIED (403): the caller's account email is not
12
+ * verified (`Customer.emailVerified !== true`). Verify it through
13
+ * `POST /auth { mode: 'send-otp' | 'verify-otp' }` and retry. Nothing else is
14
+ * read.
15
+ * - GUEST_ATTACH_NOT_MATCHED (404): at least one named order is missing, is not
16
+ * a guest order, was placed with another email, or was already attached to
17
+ * another account; or its guest row also holds another customer folded into
18
+ * it, or staff cancelled its merge into this account (or the caller's own
19
+ * account was merged away or erased). One identical body whatever the
20
+ * reason, and this request attaches nothing — not even the orders that did
21
+ * match. Found before anything is written, it writes nothing; answered after
22
+ * a merge refusal or an operator cancel raced the request, it may follow the
23
+ * bump of that order's guest status fence (its old link already answers 401).
24
+ * - GUEST_ATTACH_ALREADY_DONE (409): every named order is already attached to
25
+ * the caller's account. Nothing is written.
26
+ *
27
+ * The account refusals, shared with other storefront routes (the same codes and
28
+ * statuses as `WholesaleRequestErrorCode`), answered off the one caller read
29
+ * before anything else is read:
30
+ *
31
+ * - USER_NOT_ENABLED (403): the shop disabled the account.
32
+ * - CUSTOMER_ACCESS_PENDING (403): the shop has not approved the account yet.
33
+ * - CUSTOMER_ACCESS_REJECTED (403): the shop rejected the account.
34
+ */
35
+ export const GUEST_ATTACH_ERROR_CODES = [
36
+ 'GUEST_ATTACH_EMAIL_UNVERIFIED',
37
+ 'GUEST_ATTACH_NOT_MATCHED',
38
+ 'GUEST_ATTACH_ALREADY_DONE',
39
+ 'USER_NOT_ENABLED',
40
+ 'CUSTOMER_ACCESS_PENDING',
41
+ 'CUSTOMER_ACCESS_REJECTED',
42
+ ];
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 './guestAttach.ts';
33
34
  export * from './guestOrderStatus.ts';
34
35
  export * from './holdingCost.ts';
35
36
  export * from './demo.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 "./guestAttach.js";
41
42
  export * from "./guestOrderStatus.js";
42
43
  export * from "./holdingCost.js";
43
44
  export * from "./demo.js";
package/dist/invoice.d.ts CHANGED
@@ -1070,6 +1070,9 @@ export declare const INVOICE_ISSUANCE_REFUSAL_RECOVERY: {
1070
1070
  * `POST /invoices` `{mode:'email'}` answers both before anything is enqueued, and
1071
1071
  * `POST /mercadolibre/events` `{mode:'reuploadFiscalDocument'}` answers both for
1072
1072
  * the factura it chose.
1073
+ * The web (storefront) invoice PDF answers `INVOICE_NOT_FOUND` too: one uniform
1074
+ * 404 for an invoice that is absent or not the caller's, where the caller's
1075
+ * own invoices include those owned by an id folded (merged) into their account.
1073
1076
  *
1074
1077
  * - `INVOICE_NOT_FOUND` · 404 — no invoice row has this id in the caller's
1075
1078
  * store. Answered before any store read, render, print stamp, broadcast,
package/dist/invoice.js CHANGED
@@ -110,6 +110,9 @@ export const INVOICE_ISSUANCE_REFUSAL_RECOVERY = {
110
110
  * `POST /invoices` `{mode:'email'}` answers both before anything is enqueued, and
111
111
  * `POST /mercadolibre/events` `{mode:'reuploadFiscalDocument'}` answers both for
112
112
  * the factura it chose.
113
+ * The web (storefront) invoice PDF answers `INVOICE_NOT_FOUND` too: one uniform
114
+ * 404 for an invoice that is absent or not the caller's, where the caller's
115
+ * own invoices include those owned by an id folded (merged) into their account.
113
116
  *
114
117
  * - `INVOICE_NOT_FOUND` · 404 — no invoice row has this id in the caller's
115
118
  * store. Answered before any store read, render, print stamp, broadcast,
package/dist/order.d.ts CHANGED
@@ -2773,9 +2773,11 @@ export declare const orderFulfilmentProgress: (order: OrderFulfilmentProgressInp
2773
2773
  * is refused after it, like every other refusal at commit.
2774
2774
  * - `ORDER_HAS_KIT_LINES` · 409 — `mode: 'edit'` on an order holding a kit line
2775
2775
  * (`CartLine.kit`). Cancel or return the order instead. Nothing was written.
2776
- * - `ORDER_HAS_FREIGHT_LINE` · 409 — `mode: 'edit'` on an order holding a
2777
- * freight line (`OrderLine.lineKind: 'freight'`). Cancel or return the order
2778
- * instead. Nothing was written.
2776
+ * - `ORDER_HAS_FREIGHT_LINE` · 409 — on an order holding a freight line
2777
+ * (`OrderLine.lineKind: 'freight'`): `mode: 'edit'`, and a `POST /orders`
2778
+ * update that CHANGES `deliveryMethod` (the freight was charged for the stored
2779
+ * method, and is never re-priced; re-sending the stored method is not refused).
2780
+ * Cancel or return the order instead. Nothing was written.
2779
2781
  * - `CART_PROMOTION_UNAVAILABLE` · 409 — the insert leg converting a STORED
2780
2782
  * ticket whose promotion ended, was paused, deleted, has not started or is
2781
2783
  * no longer cart-applicable; the `PromotionRefusal` rides `data.reason`. No
package/dist/order.js CHANGED
@@ -279,9 +279,11 @@ export const orderFulfilmentProgress = (order) => {
279
279
  * is refused after it, like every other refusal at commit.
280
280
  * - `ORDER_HAS_KIT_LINES` · 409 — `mode: 'edit'` on an order holding a kit line
281
281
  * (`CartLine.kit`). Cancel or return the order instead. Nothing was written.
282
- * - `ORDER_HAS_FREIGHT_LINE` · 409 — `mode: 'edit'` on an order holding a
283
- * freight line (`OrderLine.lineKind: 'freight'`). Cancel or return the order
284
- * instead. Nothing was written.
282
+ * - `ORDER_HAS_FREIGHT_LINE` · 409 — on an order holding a freight line
283
+ * (`OrderLine.lineKind: 'freight'`): `mode: 'edit'`, and a `POST /orders`
284
+ * update that CHANGES `deliveryMethod` (the freight was charged for the stored
285
+ * method, and is never re-priced; re-sending the stored method is not refused).
286
+ * Cancel or return the order instead. Nothing was written.
285
287
  * - `CART_PROMOTION_UNAVAILABLE` · 409 — the insert leg converting a STORED
286
288
  * ticket whose promotion ended, was paused, deleted, has not started or is
287
289
  * no longer cart-applicable; the `PromotionRefusal` rides `data.reason`. No
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.790",
3
+ "version": "1.10.792",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",