platform-types 1.10.789 → 1.10.791
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 +2 -2
- package/dist/basket.js +2 -2
- package/dist/cjs/basket.js +2 -2
- package/dist/cjs/guestAttach.js +45 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/invoice.js +3 -0
- package/dist/customerAddress.d.ts +4 -1
- package/dist/guestAttach.d.ts +59 -0
- package/dist/guestAttach.js +42 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/invoice.d.ts +3 -0
- package/dist/invoice.js +3 -0
- package/dist/store.d.ts +3 -2
- package/package.json +1 -1
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
|
|
122
|
-
* switched guest checkout
|
|
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
|
|
91
|
-
* switched guest checkout
|
|
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`
|
package/dist/cjs/basket.js
CHANGED
|
@@ -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
|
|
94
|
-
* switched guest checkout
|
|
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,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);
|
package/dist/cjs/invoice.js
CHANGED
|
@@ -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,
|
|
@@ -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/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
|
|
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`
|
|
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
|
*/
|