platform-types 1.10.756 → 1.10.758

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/index.js CHANGED
@@ -78,6 +78,7 @@ __exportStar(require("./orderCollectionAttempt.js"), exports);
78
78
  __exportStar(require("./orderCompletionAttempt.js"), exports);
79
79
  __exportStar(require("./orderCreateAttempt.js"), exports);
80
80
  __exportStar(require("./payment.js"), exports);
81
+ __exportStar(require("./paymentAttempt.js"), exports);
81
82
  __exportStar(require("./platform.js"), exports);
82
83
  __exportStar(require("./presupuesto.js"), exports);
83
84
  __exportStar(require("./pricing.js"), exports);
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ /**
3
+ * Online payment attempts — a storefront order paid through Mercado Pago
4
+ * Checkout Pro on the store's connected account.
5
+ *
6
+ * An attempt is its own record, kept apart from the order: it never sets
7
+ * `Order.financialStatus`, `Order.linkedPayments` or fulfilment. The Mercado
8
+ * Pago webhook moves the attempt, and the existing payment pipeline settles the
9
+ * order.
10
+ *
11
+ * A shopper starts one for an order whose payment method row declares
12
+ * `storefront: 'mp-checkout-pro'` and is redirected to `redirectUrl`. While the
13
+ * attempt is live (until `expiresAt`), starting again answers the SAME attempt,
14
+ * whatever its state. A new attempt is minted only once the previous one is
15
+ * `expired` or `cancelled` and the order can still be paid.
16
+ *
17
+ * ⚠️ `paymentAttempt` is never a field of `Order`. The shopper's own order read
18
+ * answers a {@link StorefrontOrderView}, which carries it as a projection, so
19
+ * no operator write can carry it back onto the order.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.ORDER_NOT_PAYABLE_REASONS = exports.PAYMENT_ATTEMPT_ERROR_CODES = exports.PAYMENT_ATTEMPT_STATES = void 0;
23
+ /** Every {@link PaymentAttemptState}, in lifecycle order. */
24
+ exports.PAYMENT_ATTEMPT_STATES = [
25
+ 'created',
26
+ 'pending',
27
+ 'approved',
28
+ 'rejected',
29
+ 'expired',
30
+ 'cancelled',
31
+ 'refunded',
32
+ 'charged_back',
33
+ 'resolution',
34
+ ];
35
+ /**
36
+ * Every refusal code a payment-attempt start, or a checkout choosing an online
37
+ * method, answers:
38
+ *
39
+ * - `PAYMENT_PROVIDER_NOT_CONNECTED` · 412 — the store has no Mercado Pago
40
+ * account connected.
41
+ * - `PAYMENT_PROVIDER_TOKEN_EXPIRED` · 412 — the store's Mercado Pago
42
+ * connection was rejected by Mercado Pago and must be reconnected.
43
+ * - `ORDER_NOT_PAYABLE` · 409 — the order cannot be paid online; `data` is
44
+ * {@link OrderNotPayableData}.
45
+ * - `PAYMENT_ATTEMPT_EXPIRED` · 410 — the attempt's `expiresAt` passed.
46
+ * - `PAYMENT_METHOD_UNAVAILABLE` · 409 — the checkout chose an online payment
47
+ * method the store cannot take right now (its provider is not connected).
48
+ * - `MP_PREFERENCE_CREATE_FAILED` · 502 — Mercado Pago refused the checkout or
49
+ * did not answer in time. No attempt was written, so starting again is safe.
50
+ */
51
+ exports.PAYMENT_ATTEMPT_ERROR_CODES = [
52
+ 'PAYMENT_PROVIDER_NOT_CONNECTED',
53
+ 'PAYMENT_PROVIDER_TOKEN_EXPIRED',
54
+ 'ORDER_NOT_PAYABLE',
55
+ 'PAYMENT_ATTEMPT_EXPIRED',
56
+ 'PAYMENT_METHOD_UNAVAILABLE',
57
+ 'MP_PREFERENCE_CREATE_FAILED',
58
+ ];
59
+ /**
60
+ * Every `data.reason` of `409 ORDER_NOT_PAYABLE`:
61
+ *
62
+ * - `cancelled` — the order is cancelled.
63
+ * - `paid` — the order is already paid.
64
+ * - `not-online` — the order's payment method row does not declare
65
+ * `storefront: 'mp-checkout-pro'`.
66
+ */
67
+ exports.ORDER_NOT_PAYABLE_REASONS = ['cancelled', 'paid', 'not-online'];
@@ -519,6 +519,16 @@ exports.SOCKET_ACTIONS = [
519
519
  'mercadopago_static_qr_created',
520
520
  'mp_hook_log_appended',
521
521
  'mp_ipn_log_appended',
522
+ /**
523
+ * A storefront order's online payment attempt changed state. `data` is
524
+ * `OrderPaymentAttemptFrameData` (`paymentAttempt.ts`) — the order id and the
525
+ * minimised `OrderPaymentAttemptView`, never the stored attempt.
526
+ *
527
+ * ⚠️ To the order's OWN customer only (`wsPostCustomer`), never a store-wide
528
+ * customer broadcast. Published ahead of its producer: no api writer emits
529
+ * it yet.
530
+ */
531
+ 'orderPaymentAttempt',
522
532
  'stripe',
523
533
  'subscription',
524
534
  // Fiscal.
package/dist/cjs/store.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.STORE_PATCH_ERROR_CODES = exports.STORE_MODULE_ERROR_CODES = exports.isStoreModuleOn = exports.isStoreModuleKey = exports.STORE_MODULE_KEYS = exports.STORE_ONBOARDING_REVIEW_AREAS = exports.CUSTOM_DOMAIN_ROW_LIMIT = exports.CUSTOM_DOMAIN_SLOT_LIMIT = void 0;
3
+ exports.STORE_PATCH_ERROR_CODES = exports.STORE_MODULE_ERROR_CODES = exports.isStoreModuleOn = exports.isStoreModuleKey = exports.STORE_MODULE_KEYS = exports.STOREFRONT_METHOD_KINDS = exports.STORE_ONBOARDING_REVIEW_AREAS = exports.CUSTOM_DOMAIN_ROW_LIMIT = exports.CUSTOM_DOMAIN_SLOT_LIMIT = void 0;
4
4
  /**
5
5
  * How many custom-domain rows a store may hold that count: one active domain
6
6
  * and one spare, so a replacement can be verified and provisioned before the
@@ -24,6 +24,11 @@ exports.CUSTOM_DOMAIN_ROW_LIMIT = 10;
24
24
  * area is added in one place.
25
25
  */
26
26
  exports.STORE_ONBOARDING_REVIEW_AREAS = ['payments', 'delivery', 'pricing'];
27
+ /**
28
+ * Every `StorefrontMethodKind` — the ONE list `Method.storefront` is validated
29
+ * against on write (`POST /store`) and typed against on every read.
30
+ */
31
+ exports.STOREFRONT_METHOD_KINDS = ['offline', 'mp-checkout-pro'];
27
32
  /**
28
33
  * Every `StoreModuleKey`, in catalogue order — the ONE list. The type is derived
29
34
  * from it, so the `PATCH /store` validator and every client enumerate exactly
package/dist/index.d.ts CHANGED
@@ -54,6 +54,7 @@ export * from './orderCollectionAttempt.ts';
54
54
  export * from './orderCompletionAttempt.ts';
55
55
  export * from './orderCreateAttempt.ts';
56
56
  export * from './payment.ts';
57
+ export * from './paymentAttempt.ts';
57
58
  export * from './platform.ts';
58
59
  export * from './presupuesto.ts';
59
60
  export * from './pricing.ts';
package/dist/index.js CHANGED
@@ -62,6 +62,7 @@ export * from "./orderCollectionAttempt.js";
62
62
  export * from "./orderCompletionAttempt.js";
63
63
  export * from "./orderCreateAttempt.js";
64
64
  export * from "./payment.js";
65
+ export * from "./paymentAttempt.js";
65
66
  export * from "./platform.js";
66
67
  export * from "./presupuesto.js";
67
68
  export * from "./pricing.js";
package/dist/order.d.ts CHANGED
@@ -1282,10 +1282,14 @@ declare global {
1282
1282
  /**
1283
1283
  * Who initiated a cancellation. `customer` is the storefront self-service
1284
1284
  * path (`DELETE` on the web `/orders`); `operator` is
1285
- * `POST /orders { mode: 'cancel' }`, by ADMIN, SUPERVISOR or MANAGER. Both
1285
+ * `POST /orders { mode: 'cancel' }`, by ADMIN, SUPERVISOR or MANAGER. All
1286
1286
  * are distinct from a bare `disabled`, which records no cancellation.
1287
+ *
1288
+ * `system` is written only by the payment-hold expiry, which cancels an
1289
+ * order whose online payment attempt lapsed unpaid. No writer emits it yet;
1290
+ * it is published first so a client can render it before one does.
1287
1291
  */
1288
- type OrderCancellationSource = 'customer' | 'operator';
1292
+ type OrderCancellationSource = 'customer' | 'operator' | 'system';
1289
1293
  /**
1290
1294
  * Machine-readable reason an order is locked against a mutation — the
1291
1295
  * payload of `409 ORDER_LOCKED` (on the customer cancellation's `409 ORDER_CANCELLATION_LOCKED` it rides in `message` as `reason: <r>` and that body has no `reason` key; the operator cancellation's carries both), and the
@@ -2309,6 +2313,51 @@ declare global {
2309
2313
  */
2310
2314
  warehouseId?: string;
2311
2315
  }
2316
+ /**
2317
+ * The storefront `POST /orders` body (Web host, customer token) — the shape
2318
+ * `ordersPostSchema` (`stacks/helpers/storefrontCheckout.ts`) accepts, tied to
2319
+ * it there by `AssertStorefrontOrderCreateRequestMatchesSchema`. Not
2320
+ * `CreateOrderRequest`, which is the operator (POS) body.
2321
+ *
2322
+ * The lines are never sent: the order is built from the shopper's server-side
2323
+ * cart, and the customer and store come from the token. An undeclared key at
2324
+ * any level is dropped, not refused.
2325
+ */
2326
+ interface StorefrontOrderCreateRequest {
2327
+ /** A `Store.paymentMethods` row `id`; a value naming no row is refused. */
2328
+ paymentMethod: number;
2329
+ /** A `Store.deliveryMethods` row `id`. */
2330
+ deliveryMethod: number;
2331
+ /**
2332
+ * The billing identity the invoice is issued against. Every key is
2333
+ * optional; `docType` and `docNumber` are checked together as the ARCA
2334
+ * receptor identity.
2335
+ */
2336
+ invoiceMethod?: {
2337
+ condFiscal?: number;
2338
+ condFiscalName?: string;
2339
+ cuit?: string;
2340
+ razonSocial?: string;
2341
+ docType?: number;
2342
+ docNumber?: string;
2343
+ };
2344
+ comments?: string;
2345
+ /**
2346
+ * The delivery address. ⚠️ Every key is OPTIONAL here, unlike the stored
2347
+ * `Order.deliveryAddress`: a partial address is accepted, as it always has
2348
+ * been.
2349
+ */
2350
+ deliveryAddress?: {
2351
+ fullName?: string;
2352
+ address?: string;
2353
+ phone?: string;
2354
+ city?: string;
2355
+ province?: string;
2356
+ postalCode?: string;
2357
+ };
2358
+ /** Persist `deliveryAddress` as the customer's default. Directive only, never stored. */
2359
+ saveAsDefault?: boolean;
2360
+ }
2312
2361
  interface ZebraTag {
2313
2362
  orderId: string;
2314
2363
  fullName: string;
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Online payment attempts — a storefront order paid through Mercado Pago
3
+ * Checkout Pro on the store's connected account.
4
+ *
5
+ * An attempt is its own record, kept apart from the order: it never sets
6
+ * `Order.financialStatus`, `Order.linkedPayments` or fulfilment. The Mercado
7
+ * Pago webhook moves the attempt, and the existing payment pipeline settles the
8
+ * order.
9
+ *
10
+ * A shopper starts one for an order whose payment method row declares
11
+ * `storefront: 'mp-checkout-pro'` and is redirected to `redirectUrl`. While the
12
+ * attempt is live (until `expiresAt`), starting again answers the SAME attempt,
13
+ * whatever its state. A new attempt is minted only once the previous one is
14
+ * `expired` or `cancelled` and the order can still be paid.
15
+ *
16
+ * ⚠️ `paymentAttempt` is never a field of `Order`. The shopper's own order read
17
+ * answers a {@link StorefrontOrderView}, which carries it as a projection, so
18
+ * no operator write can carry it back onto the order.
19
+ */
20
+ declare global {
21
+ /**
22
+ * One of {@link PAYMENT_ATTEMPT_STATES}.
23
+ *
24
+ * - `created` — the Mercado Pago checkout exists; nothing paid yet.
25
+ * - `pending` — a payment was made and Mercado Pago has not decided it.
26
+ * - `approved` — a payment equal to the order total was approved, and the
27
+ * order is settled by the payment pipeline.
28
+ * - `rejected` — the last payment was rejected. ⚠️ NOT terminal: Checkout Pro
29
+ * lets the shopper retry inside the same checkout until `expiresAt`, so a
30
+ * later payment can move it to `pending` or `approved`.
31
+ * - `expired` — `expiresAt` passed with nothing approved; the order is
32
+ * cancelled (`Order.cancellationSource: 'system'`).
33
+ * - `cancelled` — the order was cancelled while the attempt was live.
34
+ * - `refunded` — the approved payment was refunded.
35
+ * - `charged_back` — the approved payment was charged back.
36
+ * - `resolution` — money landed that must NOT settle the order: an approval
37
+ * on an order already paid, on an expired or cancelled order, or for an
38
+ * amount other than the order total. The payment is recorded and an
39
+ * operator decides; the order is neither settled nor re-opened. Show it to
40
+ * the shopper as under review.
41
+ */
42
+ type PaymentAttemptState = (typeof PAYMENT_ATTEMPT_STATES)[number];
43
+ /** One of {@link PAYMENT_ATTEMPT_ERROR_CODES}. */
44
+ type PaymentAttemptErrorCode = (typeof PAYMENT_ATTEMPT_ERROR_CODES)[number];
45
+ /** One of {@link ORDER_NOT_PAYABLE_REASONS}. */
46
+ type OrderNotPayableReason = (typeof ORDER_NOT_PAYABLE_REASONS)[number];
47
+ /**
48
+ * The body that starts (or returns the live) payment attempt for an order.
49
+ * The caller must be the order's customer; the store is the token's. The
50
+ * amount is never sent: it is the order's total, read server-side.
51
+ */
52
+ interface StartPaymentAttemptRequest {
53
+ orderId: string;
54
+ }
55
+ /** `data` of a successful start. A repeat start while the attempt is live answers the same `attemptId`. */
56
+ interface StartPaymentAttemptResponse {
57
+ attemptId: string;
58
+ /** The Mercado Pago checkout URL to send the shopper to. */
59
+ redirectUrl: string;
60
+ /** ISO 8601. After it the checkout no longer takes a payment. */
61
+ expiresAt: string;
62
+ }
63
+ /** `data` of `409 ORDER_NOT_PAYABLE`. */
64
+ interface OrderNotPayableData {
65
+ reason: OrderNotPayableReason;
66
+ }
67
+ /**
68
+ * The minimised attempt the shopper sees on their own order — never the
69
+ * stored record.
70
+ */
71
+ interface OrderPaymentAttemptView {
72
+ attemptId: string;
73
+ state: PaymentAttemptState;
74
+ /** ISO 8601. */
75
+ expiresAt: string;
76
+ }
77
+ /**
78
+ * The shopper's own order read: the order plus its payment attempt, when it
79
+ * has one. `paymentAttempt` is attached on read and is never stored on the
80
+ * order.
81
+ */
82
+ type StorefrontOrderView = Order & {
83
+ paymentAttempt?: OrderPaymentAttemptView;
84
+ };
85
+ /**
86
+ * `data` of an `orderPaymentAttempt` socket frame, sent to the order's own
87
+ * customer only when the attempt changes.
88
+ */
89
+ interface OrderPaymentAttemptFrameData {
90
+ orderId: string;
91
+ paymentAttempt: OrderPaymentAttemptView;
92
+ }
93
+ }
94
+ /** Every {@link PaymentAttemptState}, in lifecycle order. */
95
+ export declare const PAYMENT_ATTEMPT_STATES: readonly ["created", "pending", "approved", "rejected", "expired", "cancelled", "refunded", "charged_back", "resolution"];
96
+ /**
97
+ * Every refusal code a payment-attempt start, or a checkout choosing an online
98
+ * method, answers:
99
+ *
100
+ * - `PAYMENT_PROVIDER_NOT_CONNECTED` · 412 — the store has no Mercado Pago
101
+ * account connected.
102
+ * - `PAYMENT_PROVIDER_TOKEN_EXPIRED` · 412 — the store's Mercado Pago
103
+ * connection was rejected by Mercado Pago and must be reconnected.
104
+ * - `ORDER_NOT_PAYABLE` · 409 — the order cannot be paid online; `data` is
105
+ * {@link OrderNotPayableData}.
106
+ * - `PAYMENT_ATTEMPT_EXPIRED` · 410 — the attempt's `expiresAt` passed.
107
+ * - `PAYMENT_METHOD_UNAVAILABLE` · 409 — the checkout chose an online payment
108
+ * method the store cannot take right now (its provider is not connected).
109
+ * - `MP_PREFERENCE_CREATE_FAILED` · 502 — Mercado Pago refused the checkout or
110
+ * did not answer in time. No attempt was written, so starting again is safe.
111
+ */
112
+ export declare const PAYMENT_ATTEMPT_ERROR_CODES: readonly ["PAYMENT_PROVIDER_NOT_CONNECTED", "PAYMENT_PROVIDER_TOKEN_EXPIRED", "ORDER_NOT_PAYABLE", "PAYMENT_ATTEMPT_EXPIRED", "PAYMENT_METHOD_UNAVAILABLE", "MP_PREFERENCE_CREATE_FAILED"];
113
+ /**
114
+ * Every `data.reason` of `409 ORDER_NOT_PAYABLE`:
115
+ *
116
+ * - `cancelled` — the order is cancelled.
117
+ * - `paid` — the order is already paid.
118
+ * - `not-online` — the order's payment method row does not declare
119
+ * `storefront: 'mp-checkout-pro'`.
120
+ */
121
+ export declare const ORDER_NOT_PAYABLE_REASONS: readonly ["cancelled", "paid", "not-online"];
122
+ export {};
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Online payment attempts — a storefront order paid through Mercado Pago
3
+ * Checkout Pro on the store's connected account.
4
+ *
5
+ * An attempt is its own record, kept apart from the order: it never sets
6
+ * `Order.financialStatus`, `Order.linkedPayments` or fulfilment. The Mercado
7
+ * Pago webhook moves the attempt, and the existing payment pipeline settles the
8
+ * order.
9
+ *
10
+ * A shopper starts one for an order whose payment method row declares
11
+ * `storefront: 'mp-checkout-pro'` and is redirected to `redirectUrl`. While the
12
+ * attempt is live (until `expiresAt`), starting again answers the SAME attempt,
13
+ * whatever its state. A new attempt is minted only once the previous one is
14
+ * `expired` or `cancelled` and the order can still be paid.
15
+ *
16
+ * ⚠️ `paymentAttempt` is never a field of `Order`. The shopper's own order read
17
+ * answers a {@link StorefrontOrderView}, which carries it as a projection, so
18
+ * no operator write can carry it back onto the order.
19
+ */
20
+ /** Every {@link PaymentAttemptState}, in lifecycle order. */
21
+ export const PAYMENT_ATTEMPT_STATES = [
22
+ 'created',
23
+ 'pending',
24
+ 'approved',
25
+ 'rejected',
26
+ 'expired',
27
+ 'cancelled',
28
+ 'refunded',
29
+ 'charged_back',
30
+ 'resolution',
31
+ ];
32
+ /**
33
+ * Every refusal code a payment-attempt start, or a checkout choosing an online
34
+ * method, answers:
35
+ *
36
+ * - `PAYMENT_PROVIDER_NOT_CONNECTED` · 412 — the store has no Mercado Pago
37
+ * account connected.
38
+ * - `PAYMENT_PROVIDER_TOKEN_EXPIRED` · 412 — the store's Mercado Pago
39
+ * connection was rejected by Mercado Pago and must be reconnected.
40
+ * - `ORDER_NOT_PAYABLE` · 409 — the order cannot be paid online; `data` is
41
+ * {@link OrderNotPayableData}.
42
+ * - `PAYMENT_ATTEMPT_EXPIRED` · 410 — the attempt's `expiresAt` passed.
43
+ * - `PAYMENT_METHOD_UNAVAILABLE` · 409 — the checkout chose an online payment
44
+ * method the store cannot take right now (its provider is not connected).
45
+ * - `MP_PREFERENCE_CREATE_FAILED` · 502 — Mercado Pago refused the checkout or
46
+ * did not answer in time. No attempt was written, so starting again is safe.
47
+ */
48
+ export const PAYMENT_ATTEMPT_ERROR_CODES = [
49
+ 'PAYMENT_PROVIDER_NOT_CONNECTED',
50
+ 'PAYMENT_PROVIDER_TOKEN_EXPIRED',
51
+ 'ORDER_NOT_PAYABLE',
52
+ 'PAYMENT_ATTEMPT_EXPIRED',
53
+ 'PAYMENT_METHOD_UNAVAILABLE',
54
+ 'MP_PREFERENCE_CREATE_FAILED',
55
+ ];
56
+ /**
57
+ * Every `data.reason` of `409 ORDER_NOT_PAYABLE`:
58
+ *
59
+ * - `cancelled` — the order is cancelled.
60
+ * - `paid` — the order is already paid.
61
+ * - `not-online` — the order's payment method row does not declare
62
+ * `storefront: 'mp-checkout-pro'`.
63
+ */
64
+ export const ORDER_NOT_PAYABLE_REASONS = ['cancelled', 'paid', 'not-online'];
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", "whatsapp-order-draft", "whatsapp-order-confirmation", "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", "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"];
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", "whatsapp-order-draft", "whatsapp-order-confirmation", "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", "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"];
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
@@ -516,6 +516,16 @@ export const SOCKET_ACTIONS = [
516
516
  'mercadopago_static_qr_created',
517
517
  'mp_hook_log_appended',
518
518
  'mp_ipn_log_appended',
519
+ /**
520
+ * A storefront order's online payment attempt changed state. `data` is
521
+ * `OrderPaymentAttemptFrameData` (`paymentAttempt.ts`) — the order id and the
522
+ * minimised `OrderPaymentAttemptView`, never the stored attempt.
523
+ *
524
+ * ⚠️ To the order's OWN customer only (`wsPostCustomer`), never a store-wide
525
+ * customer broadcast. Published ahead of its producer: no api writer emits
526
+ * it yet.
527
+ */
528
+ 'orderPaymentAttempt',
519
529
  'stripe',
520
530
  'subscription',
521
531
  // Fiscal.
package/dist/store.d.ts CHANGED
@@ -1734,12 +1734,35 @@ declare global {
1734
1734
  */
1735
1735
  onboardingReviewAdd?: StoreOnboardingReviewArea[];
1736
1736
  }
1737
+ /**
1738
+ * How the storefront offers a `paymentMethods` row — one of
1739
+ * `STOREFRONT_METHOD_KINDS`.
1740
+ *
1741
+ * - `'offline'` — offered, paid on delivery or pickup.
1742
+ * - `'mp-checkout-pro'` — offered, paid online through a payment attempt
1743
+ * (`StartPaymentAttemptRequest`) on the store's connected Mercado Pago
1744
+ * account.
1745
+ */
1746
+ type StorefrontMethodKind = (typeof STOREFRONT_METHOD_KINDS)[number];
1737
1747
  interface Method {
1738
1748
  id: number;
1739
1749
  name: string;
1740
1750
  value?: number;
1741
1751
  removable?: boolean;
1742
1752
  editable?: boolean;
1753
+ /**
1754
+ * How the storefront offers this row. Written by `POST /store` (a value
1755
+ * outside `STOREFRONT_METHOD_KINDS` is `400 VALIDATION_FAILED`) and carried
1756
+ * by every read of the row, the storefront `GET /store` and the CUSTOMER
1757
+ * STORE frame included.
1758
+ *
1759
+ * ⚠️ ABSENT means "not declared", never "not offered": the storefront
1760
+ * keeps its legacy filter until the store declares `storefront` on any
1761
+ * row. A stored value outside the tuple is dropped on read, never coerced.
1762
+ * `deliveryMethods` rows share the row schema, so the key is accepted
1763
+ * there too.
1764
+ */
1765
+ storefront?: StorefrontMethodKind;
1743
1766
  }
1744
1767
  interface FiscalCondition {
1745
1768
  CbteTipo: {
@@ -2168,6 +2191,11 @@ export declare const CUSTOM_DOMAIN_ROW_LIMIT = 10;
2168
2191
  * area is added in one place.
2169
2192
  */
2170
2193
  export declare const STORE_ONBOARDING_REVIEW_AREAS: readonly ["payments", "delivery", "pricing"];
2194
+ /**
2195
+ * Every `StorefrontMethodKind` — the ONE list `Method.storefront` is validated
2196
+ * against on write (`POST /store`) and typed against on every read.
2197
+ */
2198
+ export declare const STOREFRONT_METHOD_KINDS: readonly ["offline", "mp-checkout-pro"];
2171
2199
  /**
2172
2200
  * Every `StoreModuleKey`, in catalogue order — the ONE list. The type is derived
2173
2201
  * from it, so the `PATCH /store` validator and every client enumerate exactly
package/dist/store.js CHANGED
@@ -21,6 +21,11 @@ export const CUSTOM_DOMAIN_ROW_LIMIT = 10;
21
21
  * area is added in one place.
22
22
  */
23
23
  export const STORE_ONBOARDING_REVIEW_AREAS = ['payments', 'delivery', 'pricing'];
24
+ /**
25
+ * Every `StorefrontMethodKind` — the ONE list `Method.storefront` is validated
26
+ * against on write (`POST /store`) and typed against on every read.
27
+ */
28
+ export const STOREFRONT_METHOD_KINDS = ['offline', 'mp-checkout-pro'];
24
29
  /**
25
30
  * Every `StoreModuleKey`, in catalogue order — the ONE list. The type is derived
26
31
  * from it, so the `PATCH /store` validator and every client enumerate exactly
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.756",
3
+ "version": "1.10.758",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",