platform-types 1.10.858 → 1.10.860

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.
@@ -76,6 +76,13 @@ declare global {
76
76
  original: number;
77
77
  /** What is still owed on it — the amount a start charges for it. Always above zero. */
78
78
  remaining: number;
79
+ /**
80
+ * Whether a `mode: 'order'` start may name this debit: it is the OLDEST open
81
+ * debit of its order, counting the ones not listed here (an order's credit
82
+ * settles that one first). `false` on an orderless debit, and on any newer
83
+ * debit of its order — listed or not, the older one is paid first.
84
+ */
85
+ orderPayable: boolean;
79
86
  }
80
87
  /** `data` of web `GET /account?mode=open-debits`. */
81
88
  interface OpenAccountDebitsResponse {
@@ -584,6 +584,21 @@ exports.SOCKET_ACTIONS = [
584
584
  'purchaseWithdrawalChanged',
585
585
  'stripe',
586
586
  'subscription',
587
+ /**
588
+ * A message pack's credits landed on the store's bought balance, or a
589
+ * reversed pack took them back. `data` is the store's fresh
590
+ * `MessageBalanceView` (`messaging.ts`), exactly what
591
+ * `GET /message-credits?mode=balance` answers — replace the cached balance.
592
+ * AT MOST once per committed move, never on a provider redelivery: a send
593
+ * lost after the commit is not repeated, so it is a refresh hint, never the
594
+ * only way the balance reaches the client.
595
+ *
596
+ * ⚠️ OPERATOR sockets of the store only, and ADMIN tier only (`wsPostStore`
597
+ * with `audience: 'operator'` and `lowTierData: null` — the tier
598
+ * `GET /message-credits` admits). Never a customer socket. Silent while
599
+ * `tenantMessagingEnabled` is off.
600
+ */
601
+ 'messageCredits',
587
602
  // Fiscal.
588
603
  'caea',
589
604
  // Print agent audience (`wsPostPrinter`).
@@ -251,6 +251,42 @@ declare global {
251
251
  currency: MessagePackCurrency;
252
252
  displayOrder: number;
253
253
  }
254
+ /**
255
+ * One message pack the store paid for, as `GET /message-credits?mode=purchases`
256
+ * lists it — one MercadoPago payment, newest first by `paidAt`.
257
+ */
258
+ interface StoreMessagePackPurchase {
259
+ /** The MercadoPago payment id. */
260
+ paymentId: string;
261
+ packId: string;
262
+ /** The pack's CURRENT catalogue name (an inactive pack included); `null` once its row is gone. */
263
+ packName: string | null;
264
+ /** The credits the purchase added — frozen at checkout, never a later reprice. */
265
+ credits: number;
266
+ /** What was paid, in centavos; `null` when the provider reported no amount. */
267
+ amountCents: number | null;
268
+ /** As the provider reported it, lowercase (`ars`); `null` when it reported none. */
269
+ currency: string | null;
270
+ /** When MercadoPago reports it paid, else when the approval landed here. */
271
+ paidAt: number;
272
+ /**
273
+ * The payment refunded or charged back — its credits were taken back.
274
+ * When both happened, the EARLIER one.
275
+ */
276
+ reversal: null | {
277
+ cause: 'refunded' | 'charged_back';
278
+ at: number;
279
+ };
280
+ /** The platform's comprobante for the purchase. Always `null` for now. */
281
+ factura: PlatformFiscalDoc;
282
+ /** The platform's credit note for its reversal. Always `null` for now. */
283
+ creditNote: PlatformFiscalDoc;
284
+ }
285
+ /** One page of the store's pack purchases, newest first. `cursor` present only when more may follow. */
286
+ interface MessagePackPurchasePage {
287
+ items: StoreMessagePackPurchase[];
288
+ cursor?: string;
289
+ }
254
290
  /** `POST /platform/billing/message-packs` (managerToken). */
255
291
  interface MessagePackCreateRequest {
256
292
  name: string;
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", "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", "balancePaymentAttempt", "orderDelivery", "paymentAttemptChanged", "orderPurchaseWithdrawal", "orderReturnRequest", "purchaseWithdrawalChanged", "stripe", "subscription", "caea", "print", "print-order", "print-invoice", "print-product", "print-tag", "print-service-order", "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", "wholesaleRequests"];
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", "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", "balancePaymentAttempt", "orderDelivery", "paymentAttemptChanged", "orderPurchaseWithdrawal", "orderReturnRequest", "purchaseWithdrawalChanged", "stripe", "subscription", "messageCredits", "caea", "print", "print-order", "print-invoice", "print-product", "print-tag", "print-service-order", "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", "wholesaleRequests"];
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
@@ -581,6 +581,21 @@ export const SOCKET_ACTIONS = [
581
581
  'purchaseWithdrawalChanged',
582
582
  'stripe',
583
583
  'subscription',
584
+ /**
585
+ * A message pack's credits landed on the store's bought balance, or a
586
+ * reversed pack took them back. `data` is the store's fresh
587
+ * `MessageBalanceView` (`messaging.ts`), exactly what
588
+ * `GET /message-credits?mode=balance` answers — replace the cached balance.
589
+ * AT MOST once per committed move, never on a provider redelivery: a send
590
+ * lost after the commit is not repeated, so it is a refresh hint, never the
591
+ * only way the balance reaches the client.
592
+ *
593
+ * ⚠️ OPERATOR sockets of the store only, and ADMIN tier only (`wsPostStore`
594
+ * with `audience: 'operator'` and `lowTierData: null` — the tier
595
+ * `GET /message-credits` admits). Never a customer socket. Silent while
596
+ * `tenantMessagingEnabled` is off.
597
+ */
598
+ 'messageCredits',
584
599
  // Fiscal.
585
600
  'caea',
586
601
  // Print agent audience (`wsPostPrinter`).
@@ -724,6 +724,21 @@ declare global {
724
724
  refundedAt?: number;
725
725
  chargedBackAt?: number;
726
726
  }
727
+ /**
728
+ * The platform's own fiscal document for a charge it made a tenant (a
729
+ * subscription payment, a message pack) or for its reversal — never an
730
+ * `Invoice` the tenant issues. Always `null` for now: no platform
731
+ * self-billing writes it yet. `issuedAt` is Unix ms.
732
+ */
733
+ type PlatformFiscalDoc = null | {
734
+ status: 'pending';
735
+ } | {
736
+ status: 'issued';
737
+ letter: 'A' | 'B';
738
+ number: string;
739
+ cae: string;
740
+ issuedAt: number;
741
+ };
727
742
  /**
728
743
  * One charge SINFACTURA made against a tenant, normalized out of whichever
729
744
  * billing provider holds the money. Backs the per-tenant payment history and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.858",
3
+ "version": "1.10.860",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",