platform-types 1.10.788 → 1.10.789
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/cjs/guestOrderStatus.js +27 -0
- package/dist/cjs/index.js +1 -0
- package/dist/guestOrderStatus.d.ts +101 -0
- package/dist/guestOrderStatus.js +24 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Guest order status link — the read-only page a buyer with no account opens
|
|
4
|
+
* from the order email (`/pedido/{token}`), and the route that mails a fresh
|
|
5
|
+
* link to the address stored on the order.
|
|
6
|
+
*
|
|
7
|
+
* The token (`gs1.…`) is a bearer credential over exactly ONE order, read-only:
|
|
8
|
+
* it authorises no cart write, payment, cancellation, withdrawal or export. It
|
|
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.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.GUEST_ORDER_STATUS_LINK_TEMPLATE = exports.GUEST_ORDER_STATUS_ERROR_CODES = void 0;
|
|
15
|
+
/**
|
|
16
|
+
* The refusals the guest status routes answer themselves.
|
|
17
|
+
*
|
|
18
|
+
* - GUEST_STATUS_TOKEN_INVALID (401): every reason the token cannot be honoured
|
|
19
|
+
* — missing, tampered, another version, minted for another store or presented
|
|
20
|
+
* on another store's host, revoked (a newer link was sent), past the delivery
|
|
21
|
+
* horizon, or naming an order that is gone or is not a guest order — with one
|
|
22
|
+
* identical body, so the token is never an oracle. Ask for a new link through
|
|
23
|
+
* `POST /orders/status/recover`.
|
|
24
|
+
*/
|
|
25
|
+
exports.GUEST_ORDER_STATUS_ERROR_CODES = ['GUEST_STATUS_TOKEN_INVALID'];
|
|
26
|
+
/** The transactional email template that mails a guest their (new) status link. */
|
|
27
|
+
exports.GUEST_ORDER_STATUS_LINK_TEMPLATE = 'guest-order-status-link';
|
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("./guestOrderStatus.js"), exports);
|
|
57
58
|
__exportStar(require("./holdingCost.js"), exports);
|
|
58
59
|
__exportStar(require("./demo.js"), exports);
|
|
59
60
|
__exportStar(require("./emailIdentity.js"), exports);
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guest order status link — the read-only page a buyer with no account opens
|
|
3
|
+
* from the order email (`/pedido/{token}`), and the route that mails a fresh
|
|
4
|
+
* link to the address stored on the order.
|
|
5
|
+
*
|
|
6
|
+
* The token (`gs1.…`) is a bearer credential over exactly ONE order, read-only:
|
|
7
|
+
* it authorises no cart write, payment, cancellation, withdrawal or export. It
|
|
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.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The refusals the guest status routes answer themselves.
|
|
14
|
+
*
|
|
15
|
+
* - GUEST_STATUS_TOKEN_INVALID (401): every reason the token cannot be honoured
|
|
16
|
+
* — missing, tampered, another version, minted for another store or presented
|
|
17
|
+
* on another store's host, revoked (a newer link was sent), past the delivery
|
|
18
|
+
* horizon, or naming an order that is gone or is not a guest order — with one
|
|
19
|
+
* identical body, so the token is never an oracle. Ask for a new link through
|
|
20
|
+
* `POST /orders/status/recover`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const GUEST_ORDER_STATUS_ERROR_CODES: readonly ["GUEST_STATUS_TOKEN_INVALID"];
|
|
23
|
+
export type GuestOrderStatusErrorCode = (typeof GUEST_ORDER_STATUS_ERROR_CODES)[number];
|
|
24
|
+
/** The transactional email template that mails a guest their (new) status link. */
|
|
25
|
+
export declare const GUEST_ORDER_STATUS_LINK_TEMPLATE: "guest-order-status-link";
|
|
26
|
+
declare global {
|
|
27
|
+
/** One line of a {@link GuestOrderStatusView}, in the order's currency. */
|
|
28
|
+
interface GuestOrderStatusLine {
|
|
29
|
+
/** The line's name as sold. */
|
|
30
|
+
description: string;
|
|
31
|
+
sku?: string;
|
|
32
|
+
quantity: number;
|
|
33
|
+
/** The unit price the order booked for the line (`OrderLine.price`). */
|
|
34
|
+
unitPrice: number;
|
|
35
|
+
/** `unitPrice × quantity` as the order booked it. */
|
|
36
|
+
lineTotal: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The order's money as the buyer is shown it. Named by UNIT, because the
|
|
40
|
+
* stored order mixes units: `discountPercent` is a percentage, never money.
|
|
41
|
+
*/
|
|
42
|
+
interface GuestOrderStatusTotals {
|
|
43
|
+
/**
|
|
44
|
+
* What the order charges — `Order.total`, already net of every discount
|
|
45
|
+
* and including freight. Do not re-apply `discountPercent` to it.
|
|
46
|
+
*/
|
|
47
|
+
total: number;
|
|
48
|
+
/** `Order.discount`: the composed order-level percentage (0–100). */
|
|
49
|
+
discountPercent: number;
|
|
50
|
+
/** Money the redeemed coupon(s) took off (`Order.coupons[].amount`), when any. */
|
|
51
|
+
couponAmount?: number;
|
|
52
|
+
/** The delivery charge (the order's freight line), when one was booked. */
|
|
53
|
+
freight?: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* `GET /orders/status?token=` — one guest order, projected by ALLOW-LIST.
|
|
57
|
+
* Carries no address, document, full email, phone, customer id or other
|
|
58
|
+
* internal id; a client must not expect any field not listed here.
|
|
59
|
+
*/
|
|
60
|
+
interface GuestOrderStatusView {
|
|
61
|
+
orderId: string;
|
|
62
|
+
/** Epoch ms the order was placed. */
|
|
63
|
+
dated: number;
|
|
64
|
+
/**
|
|
65
|
+
* Derived when the stored order carries none. ⚠️ A cancelled order reads
|
|
66
|
+
* `'delivered'` here (a cancellation lands the row in the delivered end
|
|
67
|
+
* state), so a client must check `cancelled` first.
|
|
68
|
+
*/
|
|
69
|
+
fulfilmentStatus: OrderFulfilmentStatus;
|
|
70
|
+
/** Derived when the stored order carries none. */
|
|
71
|
+
financialStatus: OrderFinancialStatus;
|
|
72
|
+
/**
|
|
73
|
+
* Present, and `true`, only when the order was cancelled (`Order.cancelledAt`
|
|
74
|
+
* set) — by the buyer, the store or the system. Absent on every live order.
|
|
75
|
+
*/
|
|
76
|
+
cancelled?: true;
|
|
77
|
+
lines: GuestOrderStatusLine[];
|
|
78
|
+
totals: GuestOrderStatusTotals;
|
|
79
|
+
/** The order's currency catalog id. */
|
|
80
|
+
currency: string;
|
|
81
|
+
/** The store's name for the delivery method chosen, when it still resolves. */
|
|
82
|
+
deliveryMethodName?: string;
|
|
83
|
+
/** The latest online payment attempt, when the order has one. */
|
|
84
|
+
paymentAttempt?: OrderPaymentAttemptView;
|
|
85
|
+
contact: {
|
|
86
|
+
/** The stored address, masked (e.g. `j***@d***.com`). */
|
|
87
|
+
emailMasked: string;
|
|
88
|
+
firstName: string;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* `POST /orders/status/recover` body. Always answers the same `202` whether
|
|
93
|
+
* or not anything matched; a match within budget mails a new link to the
|
|
94
|
+
* address STORED on the order (never this one) and kills every earlier link.
|
|
95
|
+
* Only a malformed body answers otherwise (`400`).
|
|
96
|
+
*/
|
|
97
|
+
interface GuestOrderStatusRecoverRequest {
|
|
98
|
+
orderId: string;
|
|
99
|
+
email: string;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guest order status link — the read-only page a buyer with no account opens
|
|
3
|
+
* from the order email (`/pedido/{token}`), and the route that mails a fresh
|
|
4
|
+
* link to the address stored on the order.
|
|
5
|
+
*
|
|
6
|
+
* The token (`gs1.…`) is a bearer credential over exactly ONE order, read-only:
|
|
7
|
+
* it authorises no cart write, payment, cancellation, withdrawal or export. It
|
|
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.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The refusals the guest status routes answer themselves.
|
|
14
|
+
*
|
|
15
|
+
* - GUEST_STATUS_TOKEN_INVALID (401): every reason the token cannot be honoured
|
|
16
|
+
* — missing, tampered, another version, minted for another store or presented
|
|
17
|
+
* on another store's host, revoked (a newer link was sent), past the delivery
|
|
18
|
+
* horizon, or naming an order that is gone or is not a guest order — with one
|
|
19
|
+
* identical body, so the token is never an oracle. Ask for a new link through
|
|
20
|
+
* `POST /orders/status/recover`.
|
|
21
|
+
*/
|
|
22
|
+
export const GUEST_ORDER_STATUS_ERROR_CODES = ['GUEST_STATUS_TOKEN_INVALID'];
|
|
23
|
+
/** The transactional email template that mails a guest their (new) status link. */
|
|
24
|
+
export const GUEST_ORDER_STATUS_LINK_TEMPLATE = 'guest-order-status-link';
|
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 './guestOrderStatus.ts';
|
|
33
34
|
export * from './holdingCost.ts';
|
|
34
35
|
export * from './demo.ts';
|
|
35
36
|
export * from './emailIdentity.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 "./guestOrderStatus.js";
|
|
41
42
|
export * from "./holdingCost.js";
|
|
42
43
|
export * from "./demo.js";
|
|
43
44
|
export * from "./emailIdentity.js";
|