platform-types 1.10.795 → 1.10.797

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.
@@ -19,7 +19,7 @@
19
19
  * no operator write can carry it back onto the order.
20
20
  */
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.PAYMENT_HOLD_MINUTES_DEFAULT = exports.PAYMENT_HOLD_MINUTES_MAX = exports.PAYMENT_HOLD_MINUTES_MIN = exports.PAYMENT_ATTEMPT_RESOLUTION_CAUSES = exports.ORDER_NOT_PAYABLE_REASONS = exports.PAYMENT_ATTEMPT_RESOLUTION_REASON_MAX = exports.PAYMENT_ATTEMPT_RESOLUTION_OUTCOMES = exports.PAYMENT_ATTEMPT_ERROR_CODES = exports.PAYMENT_ATTEMPT_STATES = void 0;
22
+ exports.PAYMENT_HOLD_MINUTES_DEFAULT = exports.PAYMENT_HOLD_MINUTES_MAX = exports.PAYMENT_HOLD_MINUTES_MIN = exports.PAYMENT_ATTEMPT_RESOLUTION_CAUSES = exports.ORDER_NOT_PAYABLE_REASONS = exports.PAYMENT_ATTEMPT_RESOLUTION_REASON_MAX = exports.PAYMENT_ATTEMPT_RESOLUTION_OUTCOMES = exports.GUEST_PAYMENT_ERROR_CODES = exports.PAYMENT_ATTEMPT_ERROR_CODES = exports.PAYMENT_ATTEMPT_STATES = void 0;
23
23
  /** Every {@link PaymentAttemptState}, in lifecycle order. */
24
24
  exports.PAYMENT_ATTEMPT_STATES = [
25
25
  'created',
@@ -71,6 +71,20 @@ exports.PAYMENT_ATTEMPT_ERROR_CODES = [
71
71
  'PAYMENT_ATTEMPT_NOT_IN_RESOLUTION',
72
72
  'PAYMENT_ATTEMPT_CHANGED',
73
73
  ];
74
+ /**
75
+ * The refusal the guest payment start (`POST /payments/attempts/guest`) answers
76
+ * itself, beside every {@link PAYMENT_ATTEMPT_ERROR_CODES} entry it shares with
77
+ * the signed-in start.
78
+ *
79
+ * - `GUEST_PAYMENT_GRANT_INVALID` · 401 — every reason the grant cannot be
80
+ * honoured: missing, tampered, another version (a guest STATUS token
81
+ * included), expired (7 days after it was issued), minted for another order
82
+ * or another store, presented on another store's host, or naming an order
83
+ * that is not — or is no longer — an unattached guest order (attached to an
84
+ * account, its buyer then pays signed in). One identical body, so the grant is
85
+ * never an oracle.
86
+ */
87
+ exports.GUEST_PAYMENT_ERROR_CODES = ['GUEST_PAYMENT_GRANT_INVALID'];
74
88
  /**
75
89
  * Every `outcome` of {@link ResolvePaymentAttemptRequest}:
76
90
  *
package/dist/order.d.ts CHANGED
@@ -2494,6 +2494,24 @@ declare global {
2494
2494
  expectedCartId: string;
2495
2495
  expectedCartVersion: number;
2496
2496
  }
2497
+ /**
2498
+ * `data` of a successful Web `POST /orders/guest`: the placed order, as the
2499
+ * signed-in checkout answers it (the storefront reads `orderId`), plus the
2500
+ * guest's payment grant.
2501
+ */
2502
+ interface StorefrontGuestOrderCreateResponse extends Partial<Order> {
2503
+ orderId: string;
2504
+ /**
2505
+ * The guest payment grant (`gp1.…`) for THIS order, valid 7 days: the
2506
+ * credential `POST /payments/attempts/guest` takes
2507
+ * ({@link StartGuestPaymentAttemptRequest}). Present only when the order
2508
+ * can be paid online when the answer is built (its payment method row
2509
+ * declares `storefront: 'mp-checkout-pro'`, pesos, something to charge) and
2510
+ * the grant could be minted; absent otherwise. A replay of the checkout
2511
+ * answers a freshly minted one. Keep it in memory or the URL fragment only.
2512
+ */
2513
+ paymentGrant?: string;
2514
+ }
2497
2515
  interface ZebraTag {
2498
2516
  orderId: string;
2499
2517
  fullName: string;
@@ -57,6 +57,8 @@ declare global {
57
57
  type PaymentAttemptState = (typeof PAYMENT_ATTEMPT_STATES)[number];
58
58
  /** One of {@link PAYMENT_ATTEMPT_ERROR_CODES}. */
59
59
  type PaymentAttemptErrorCode = (typeof PAYMENT_ATTEMPT_ERROR_CODES)[number];
60
+ /** One of {@link GUEST_PAYMENT_ERROR_CODES}. */
61
+ type GuestPaymentErrorCode = (typeof GUEST_PAYMENT_ERROR_CODES)[number];
60
62
  /** One of {@link ORDER_NOT_PAYABLE_REASONS}. */
61
63
  type OrderNotPayableReason = (typeof ORDER_NOT_PAYABLE_REASONS)[number];
62
64
  /** One of {@link PAYMENT_ATTEMPT_RESOLUTION_CAUSES}. */
@@ -71,6 +73,22 @@ declare global {
71
73
  interface StartPaymentAttemptRequest {
72
74
  orderId: string;
73
75
  }
76
+ /**
77
+ * Web `POST /payments/attempts/guest` body: a buyer with NO account starts
78
+ * (or gets back the live) payment attempt of one guest order. Answers
79
+ * {@link StartPaymentAttemptResponse}, with every {@link PAYMENT_ATTEMPT_ERROR_CODES}
80
+ * refusal the signed-in start answers, plus {@link GUEST_PAYMENT_ERROR_CODES}.
81
+ */
82
+ interface StartGuestPaymentAttemptRequest {
83
+ orderId: string;
84
+ /**
85
+ * The guest payment grant (`gp1.…`) the guest checkout answered
86
+ * (`StorefrontGuestOrderCreateResponse.paymentGrant`) or the order email's
87
+ * "Pagar" link carried in its `#pagar=` fragment. A bearer credential:
88
+ * never put it in a URL a server or Mercado Pago sees, nor in `back_urls`.
89
+ */
90
+ paymentGrant: string;
91
+ }
74
92
  /** `data` of a successful start. A repeat start while the attempt is live answers the same `attemptId`. */
75
93
  interface StartPaymentAttemptResponse {
76
94
  attemptId: string;
@@ -237,6 +255,20 @@ export declare const PAYMENT_ATTEMPT_STATES: readonly ["created", "pending", "ap
237
255
  * written; `data` is {@link PaymentAttemptChangedData}.
238
256
  */
239
257
  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", "PAYMENT_ATTEMPT_NOT_FOUND", "PAYMENT_ATTEMPT_NOT_IN_RESOLUTION", "PAYMENT_ATTEMPT_CHANGED"];
258
+ /**
259
+ * The refusal the guest payment start (`POST /payments/attempts/guest`) answers
260
+ * itself, beside every {@link PAYMENT_ATTEMPT_ERROR_CODES} entry it shares with
261
+ * the signed-in start.
262
+ *
263
+ * - `GUEST_PAYMENT_GRANT_INVALID` · 401 — every reason the grant cannot be
264
+ * honoured: missing, tampered, another version (a guest STATUS token
265
+ * included), expired (7 days after it was issued), minted for another order
266
+ * or another store, presented on another store's host, or naming an order
267
+ * that is not — or is no longer — an unattached guest order (attached to an
268
+ * account, its buyer then pays signed in). One identical body, so the grant is
269
+ * never an oracle.
270
+ */
271
+ export declare const GUEST_PAYMENT_ERROR_CODES: readonly ["GUEST_PAYMENT_GRANT_INVALID"];
240
272
  /**
241
273
  * Every `outcome` of {@link ResolvePaymentAttemptRequest}:
242
274
  *
@@ -68,6 +68,20 @@ export const PAYMENT_ATTEMPT_ERROR_CODES = [
68
68
  'PAYMENT_ATTEMPT_NOT_IN_RESOLUTION',
69
69
  'PAYMENT_ATTEMPT_CHANGED',
70
70
  ];
71
+ /**
72
+ * The refusal the guest payment start (`POST /payments/attempts/guest`) answers
73
+ * itself, beside every {@link PAYMENT_ATTEMPT_ERROR_CODES} entry it shares with
74
+ * the signed-in start.
75
+ *
76
+ * - `GUEST_PAYMENT_GRANT_INVALID` · 401 — every reason the grant cannot be
77
+ * honoured: missing, tampered, another version (a guest STATUS token
78
+ * included), expired (7 days after it was issued), minted for another order
79
+ * or another store, presented on another store's host, or naming an order
80
+ * that is not — or is no longer — an unattached guest order (attached to an
81
+ * account, its buyer then pays signed in). One identical body, so the grant is
82
+ * never an oracle.
83
+ */
84
+ export const GUEST_PAYMENT_ERROR_CODES = ['GUEST_PAYMENT_GRANT_INVALID'];
71
85
  /**
72
86
  * Every `outcome` of {@link ResolvePaymentAttemptRequest}:
73
87
  *
package/dist/product.d.ts CHANGED
@@ -30,7 +30,8 @@ declare global {
30
30
  unitRevision: number;
31
31
  }
32
32
  type ProductUnitsInput = Omit<ProductUnits, 'unitRevision'>;
33
- type PublicProductUnits = Pick<ProductUnits, 'baseUnit' | 'purchaseUnit' | 'packLabel'>;
33
+ /** The display declaration plus the purchase-unit factor; `unitRevision` stays server-only. */
34
+ type PublicProductUnits = Pick<ProductUnits, 'baseUnit' | 'purchaseUnit' | 'packLabel' | 'baseUnitsPerPurchaseUnit'>;
34
35
  type PublicProduct = Omit<Partial<Product>, 'units' | 'unitRevisionGeneration'> & {
35
36
  units?: PublicProductUnits | null;
36
37
  };
package/dist/store.d.ts CHANGED
@@ -528,6 +528,52 @@ declare global {
528
528
  /** Unix ms — when the retired label's redirect ends (its reservation end). */
529
529
  redirectUntil?: number;
530
530
  }
531
+ /** An identity or withdrawal fact {@link StorePublicLegal} could not resolve; the storefront warns or degrades on it. */
532
+ type StorePublicLegalMissing = 'razonSocial' | 'fiscalAddress' | 'email' | 'phone' | 'withdrawalChannel';
533
+ /**
534
+ * The consumer-law facts a storefront renders: the merchant identity disclosure, the
535
+ * Botón de Arrepentimiento and the privacy-text variants. Built by the api at read time
536
+ * from the STORE row, never stored or writable, and never inferred from a price list's
537
+ * `audienceClass` — every caller of one store sees the same block.
538
+ */
539
+ interface StorePublicLegal {
540
+ identity: {
541
+ /** `integrations.afip.razonSocial` trimmed, else `Store.name` (the invoice emisor rule). */
542
+ legalName: string;
543
+ /** `Store.cuit`, as the frame's own `cuit`. */
544
+ cuit?: string;
545
+ /**
546
+ * The invoice's fiscal domicile composition of the `integrations.afip` address leaves
547
+ * once they are complete (`address`, `postalCode`, `province`; `city` optional), else
548
+ * `Store.address` with `missing` naming `fiscalAddress` — a partial domicile is never
549
+ * published. Never the public contact's `address`.
550
+ */
551
+ fiscalAddress?: string;
552
+ /** Only the frame's own `publicContact` targets: absent when the shop publishes none. */
553
+ email?: string;
554
+ phone?: StorefrontPublicContact['phone'];
555
+ whatsapp?: StorefrontPublicContact['whatsapp'];
556
+ };
557
+ /**
558
+ * Always sent: its presence means "render the withdrawal button". `channels` are the
559
+ * public contact's targets, never prefilled links — the request text is the storefront's;
560
+ * empty when the shop publishes neither, and `missing` then names `withdrawalChannel`.
561
+ */
562
+ withdrawal: {
563
+ channels: {
564
+ email?: string;
565
+ whatsapp?: StorefrontPublicContact['whatsapp'];
566
+ };
567
+ hours?: StorefrontContactHours;
568
+ };
569
+ privacy: {
570
+ /** The same verdict as `ecommerce.config.guestCheckoutAvailable`. */
571
+ guestPurchase: boolean;
572
+ /** `['mercadopago']` while any `paymentMethods` row is `storefront: 'mp-checkout-pro'`, whatever its audience rule; else `[]`. */
573
+ onlinePayment: Array<'mercadopago'>;
574
+ };
575
+ missing: StorePublicLegalMissing[];
576
+ }
531
577
  interface Store {
532
578
  /** Optional operational mail preferences; absent sales-digest/email means enabled. */
533
579
  notificationPreferences?: Partial<Record<'sales-digest', Partial<Record<NotificationPreferenceChannel, boolean>>>>;
@@ -1156,6 +1202,13 @@ declare global {
1156
1202
  * email/phone pair explicitly consented by config.publicContact is used.
1157
1203
  */
1158
1204
  publicContact?: StorefrontPublicContact;
1205
+ /**
1206
+ * Server-built consumer-law block: sent on every `200` of web `GET /store` and on the
1207
+ * storefront preview's store frame, the same for a guest and a customer. Read-time,
1208
+ * never stored or writable. NOT on customer STORE frames: a storefront rehydrates it by
1209
+ * refetching web `GET /store`, as it does on socket reconnect.
1210
+ */
1211
+ legal?: StorePublicLegal;
1159
1212
  /** Read-only legacy editor seed, available only to the entitled tenant ADMIN. */
1160
1213
  storefrontEditorBaseline?: StorefrontEditorBaseline;
1161
1214
  /** Public aggregate from the immutable publication and live platform layers. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.795",
3
+ "version": "1.10.797",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",