platform-types 1.10.835 → 1.10.836
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/store.js +1 -1
- package/dist/print.d.ts +18 -0
- package/dist/store.d.ts +41 -1
- package/dist/store.js +1 -1
- package/package.json +1 -1
package/dist/cjs/store.js
CHANGED
|
@@ -112,7 +112,7 @@ exports.STORE_MODULE_ERROR_CODES = [
|
|
|
112
112
|
* Role refusals, `403` — a plain USER writing a privileged section. Each is
|
|
113
113
|
* judged before any other check on that section:
|
|
114
114
|
* - `STORE_CONFIG_FORBIDDEN` — any privileged `config` leaf (`modules`,
|
|
115
|
-
* `stock`, `priceDecimals`, `changePrice`, `mandatory2fa`, …).
|
|
115
|
+
* `stock`, `priceDecimals`, `changePrice`, `mandatory2fa`, `autoPrint`, …).
|
|
116
116
|
* - `STORE_ECOMMERCE_FORBIDDEN` — any `ecommerce` block.
|
|
117
117
|
* - `STORE_FISCAL_FIELD_FORBIDDEN` — a fiscal field of the store.
|
|
118
118
|
* - `STORE_JURISDICTION_FORBIDDEN` — `jurisdiction`.
|
package/dist/print.d.ts
CHANGED
|
@@ -560,8 +560,26 @@ declare global {
|
|
|
560
560
|
* sorted and joined by `+`; an agent `ACK_FAILED` can classify to `PRINTER_PAUSED` /
|
|
561
561
|
* `NO_PRINTER_ASSIGNED` / `PRINTER_NOT_FOUND`. Unrecognised agent
|
|
562
562
|
* text stays in `detail` only, so absence of a code does NOT mean success.
|
|
563
|
+
*
|
|
564
|
+
* An automatic job (`Store.config.autoPrint`) adds three BE-side codes on
|
|
565
|
+
* `error`: `PRINT_QUEUE_EXPIRED` — it was held for want of a connected
|
|
566
|
+
* agent and its `heldUntil` passed — `AUTO_PRINT_SOURCE_GONE` — the
|
|
567
|
+
* order or invoice it was printing no longer exists when it was replayed —
|
|
568
|
+
* and `AUTO_PRINT_NO_LONGER_ELIGIBLE` — at replay it no longer passed the
|
|
569
|
+
* checks it was minted under (the store's switch for its event is off, the
|
|
570
|
+
* order was cancelled or its ready / delivered mark cleared, the factura is
|
|
571
|
+
* a credit note), so it was never sent.
|
|
572
|
+
* A HELD job is `queued` with `NO_PRINTER_CONNECTED` and `heldUntil`.
|
|
563
573
|
*/
|
|
564
574
|
errorCode?: string;
|
|
575
|
+
/**
|
|
576
|
+
* ms epoch until which an automatic job with no connected agent is HELD —
|
|
577
|
+
* present only while the summary is `queued` waiting for an agent. The
|
|
578
|
+
* job is replayed when an agent of the store registers its printers, and
|
|
579
|
+
* ends `error` / `PRINT_QUEUE_EXPIRED` once this passes. Every later
|
|
580
|
+
* transition removes it. A manual print is never held.
|
|
581
|
+
*/
|
|
582
|
+
heldUntil?: number;
|
|
565
583
|
}
|
|
566
584
|
/**
|
|
567
585
|
* `data` payload of the server → agent `printers_active` WSS frame,
|
package/dist/store.d.ts
CHANGED
|
@@ -87,6 +87,28 @@ declare global {
|
|
|
87
87
|
/** MercadoLibre orders. */
|
|
88
88
|
mercadolibre?: string;
|
|
89
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* The automatic-print switches — see `Store.config.autoPrint`. Every switch is
|
|
92
|
+
* OFF unless it is `true`: an absent leaf, an absent key and `false` all mean
|
|
93
|
+
* "do not print this automatically".
|
|
94
|
+
*/
|
|
95
|
+
interface StoreAutoPrintConfig {
|
|
96
|
+
/** A factura authorised by ARCA (CAE, CAEA stamp, or the pending drain settling it). Credit notes never. */
|
|
97
|
+
invoiceAuthorized?: boolean;
|
|
98
|
+
/** A new order, per sales channel. A `service` channel order has no switch. */
|
|
99
|
+
orderCreated?: {
|
|
100
|
+
/** `POST /orders` on the App, including a presupuesto conversion. */
|
|
101
|
+
counter?: boolean;
|
|
102
|
+
/** The public storefront checkout. */
|
|
103
|
+
storefront?: boolean;
|
|
104
|
+
/** An order imported from MercadoLibre. */
|
|
105
|
+
meli?: boolean;
|
|
106
|
+
};
|
|
107
|
+
/** An order marked ready (its `readyAt` moving from unset to set). */
|
|
108
|
+
orderReady?: boolean;
|
|
109
|
+
/** The shipping tag, when an order with a delivery address is marked delivered. */
|
|
110
|
+
deliveryTag?: boolean;
|
|
111
|
+
}
|
|
90
112
|
/**
|
|
91
113
|
* One store-wide module a store can switch off for every user — the
|
|
92
114
|
* catalogue is the shared `domain/STORE_MODULES.md`. Enumerable at runtime as
|
|
@@ -1135,6 +1157,24 @@ declare global {
|
|
|
1135
1157
|
* whatever this holds.
|
|
1136
1158
|
*/
|
|
1137
1159
|
channelWarehouses?: StoreChannelWarehouses;
|
|
1160
|
+
/**
|
|
1161
|
+
* Automatic printing — which events print a document with no operator
|
|
1162
|
+
* pressing «Imprimir». Written through `PATCH /store` `config` at the
|
|
1163
|
+
* PRIVILEGED tier (ADMIN/SUPERVISOR/MANAGER; a plain USER is refused
|
|
1164
|
+
* `STORE_CONFIG_FORBIDDEN`). No plan gate.
|
|
1165
|
+
*
|
|
1166
|
+
* ⚠️ The merge REPLACES the whole leaf, like every other `config` leaf: a
|
|
1167
|
+
* body carrying `autoPrint: { orderReady: true }` switches every other
|
|
1168
|
+
* event off. Send the full leaf.
|
|
1169
|
+
*
|
|
1170
|
+
* An automatic job fans out exactly as «Imprimir» does (the store's print
|
|
1171
|
+
* rules decide). When no print agent is connected it is HELD as `queued`
|
|
1172
|
+
* with `heldUntil` on its `PrintJobSummary`, replayed when an agent of the
|
|
1173
|
+
* store registers, and ended `error` / `PRINT_QUEUE_EXPIRED` at the end
|
|
1174
|
+
* of the store's Buenos Aires day or 12 h after the event, whichever is
|
|
1175
|
+
* first. Absent means nothing prints automatically.
|
|
1176
|
+
*/
|
|
1177
|
+
autoPrint?: StoreAutoPrintConfig;
|
|
1138
1178
|
/**
|
|
1139
1179
|
* Store-wide module switches — see `StoreModules`. Written through
|
|
1140
1180
|
* `PATCH /store` `config` at the PRIVILEGED tier (ADMIN/SUPERVISOR/MANAGER;
|
|
@@ -2592,7 +2632,7 @@ export type StoreModuleRefusalBody = {
|
|
|
2592
2632
|
* Role refusals, `403` — a plain USER writing a privileged section. Each is
|
|
2593
2633
|
* judged before any other check on that section:
|
|
2594
2634
|
* - `STORE_CONFIG_FORBIDDEN` — any privileged `config` leaf (`modules`,
|
|
2595
|
-
* `stock`, `priceDecimals`, `changePrice`, `mandatory2fa`, …).
|
|
2635
|
+
* `stock`, `priceDecimals`, `changePrice`, `mandatory2fa`, `autoPrint`, …).
|
|
2596
2636
|
* - `STORE_ECOMMERCE_FORBIDDEN` — any `ecommerce` block.
|
|
2597
2637
|
* - `STORE_FISCAL_FIELD_FORBIDDEN` — a fiscal field of the store.
|
|
2598
2638
|
* - `STORE_JURISDICTION_FORBIDDEN` — `jurisdiction`.
|
package/dist/store.js
CHANGED
|
@@ -107,7 +107,7 @@ export const STORE_MODULE_ERROR_CODES = [
|
|
|
107
107
|
* Role refusals, `403` — a plain USER writing a privileged section. Each is
|
|
108
108
|
* judged before any other check on that section:
|
|
109
109
|
* - `STORE_CONFIG_FORBIDDEN` — any privileged `config` leaf (`modules`,
|
|
110
|
-
* `stock`, `priceDecimals`, `changePrice`, `mandatory2fa`, …).
|
|
110
|
+
* `stock`, `priceDecimals`, `changePrice`, `mandatory2fa`, `autoPrint`, …).
|
|
111
111
|
* - `STORE_ECOMMERCE_FORBIDDEN` — any `ecommerce` block.
|
|
112
112
|
* - `STORE_FISCAL_FIELD_FORBIDDEN` — a fiscal field of the store.
|
|
113
113
|
* - `STORE_JURISDICTION_FORBIDDEN` — `jurisdiction`.
|