platform-types 1.10.860 → 1.10.862

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.
@@ -183,6 +183,9 @@ export declare const BALANCE_ATTEMPT_MAX_DEBITS = 50;
183
183
  * `order` — an orderless debit, or not the oldest open debit of its order.
184
184
  * - `BALANCE_NOTHING_OWED` · 409 — the selection owes nothing.
185
185
  * - `BALANCE_ATTEMPT_NOT_FOUND` · 404 — no such attempt of the caller's.
186
+ * - `BALANCE_ATTEMPT_CONFLICT` · 409 — a start of another selection by the same
187
+ * customer, at the same moment, took this attempt number; nothing was started
188
+ * for this request — retry.
186
189
  */
187
- export declare const BALANCE_PAYMENT_ERROR_CODES: readonly ["BALANCE_PAYMENT_DISABLED", "BALANCE_CURRENCY_UNSUPPORTED", "BALANCE_SELECTION_STALE", "BALANCE_SELECTION_NOT_PREFIX", "BALANCE_NOTHING_OWED", "BALANCE_ATTEMPT_NOT_FOUND"];
190
+ export declare const BALANCE_PAYMENT_ERROR_CODES: readonly ["BALANCE_PAYMENT_DISABLED", "BALANCE_CURRENCY_UNSUPPORTED", "BALANCE_SELECTION_STALE", "BALANCE_SELECTION_NOT_PREFIX", "BALANCE_NOTHING_OWED", "BALANCE_ATTEMPT_NOT_FOUND", "BALANCE_ATTEMPT_CONFLICT"];
188
191
  export {};
@@ -61,6 +61,9 @@ export const BALANCE_ATTEMPT_MAX_DEBITS = 50;
61
61
  * `order` — an orderless debit, or not the oldest open debit of its order.
62
62
  * - `BALANCE_NOTHING_OWED` · 409 — the selection owes nothing.
63
63
  * - `BALANCE_ATTEMPT_NOT_FOUND` · 404 — no such attempt of the caller's.
64
+ * - `BALANCE_ATTEMPT_CONFLICT` · 409 — a start of another selection by the same
65
+ * customer, at the same moment, took this attempt number; nothing was started
66
+ * for this request — retry.
64
67
  */
65
68
  export const BALANCE_PAYMENT_ERROR_CODES = [
66
69
  'BALANCE_PAYMENT_DISABLED',
@@ -69,4 +72,5 @@ export const BALANCE_PAYMENT_ERROR_CODES = [
69
72
  'BALANCE_SELECTION_NOT_PREFIX',
70
73
  'BALANCE_NOTHING_OWED',
71
74
  'BALANCE_ATTEMPT_NOT_FOUND',
75
+ 'BALANCE_ATTEMPT_CONFLICT',
72
76
  ];
@@ -64,6 +64,9 @@ exports.BALANCE_ATTEMPT_MAX_DEBITS = 50;
64
64
  * `order` — an orderless debit, or not the oldest open debit of its order.
65
65
  * - `BALANCE_NOTHING_OWED` · 409 — the selection owes nothing.
66
66
  * - `BALANCE_ATTEMPT_NOT_FOUND` · 404 — no such attempt of the caller's.
67
+ * - `BALANCE_ATTEMPT_CONFLICT` · 409 — a start of another selection by the same
68
+ * customer, at the same moment, took this attempt number; nothing was started
69
+ * for this request — retry.
67
70
  */
68
71
  exports.BALANCE_PAYMENT_ERROR_CODES = [
69
72
  'BALANCE_PAYMENT_DISABLED',
@@ -72,4 +75,5 @@ exports.BALANCE_PAYMENT_ERROR_CODES = [
72
75
  'BALANCE_SELECTION_NOT_PREFIX',
73
76
  'BALANCE_NOTHING_OWED',
74
77
  'BALANCE_ATTEMPT_NOT_FOUND',
78
+ 'BALANCE_ATTEMPT_CONFLICT',
75
79
  ];
@@ -92,8 +92,10 @@ exports.TERMINAL_ENROLMENT_ERROR_CODES = [
92
92
  * did not match.
93
93
  * - `PASSWORD_NOT_SET` · 409 — `POST /terminal/activation` and `POST
94
94
  * /terminal/pin`: the employee (a founder registered with Google or Apple) has
95
- * no password. The body carries `providers`, the recorded sign-in providers, as
96
- * `POST /auth/verify-password` does. Nothing is counted against the account.
95
+ * no password. On `/terminal/pin` the body carries `providers`, the recorded
96
+ * sign-in providers, as `POST /auth/verify-password` does; `/terminal/activation`
97
+ * answers it after the lock and captcha gates, with no `providers`. Nothing is
98
+ * counted against the account.
97
99
  * - `IDEMPOTENCY_KEY_REUSE` · 422 / `IDEMPOTENCY_IN_PROGRESS` · 409 /
98
100
  * `INVALID_IDEMPOTENCY_KEY` · 400 — the `Idempotency-Key` header's own
99
101
  * refusals on `POST /terminal/operators`. A MISSING header is
@@ -64,6 +64,17 @@ declare global {
64
64
  /** Optional operator reason (10-500 chars, refused when it carries personal data). Internal: AUDIT row only. */
65
65
  reason?: string;
66
66
  }
67
+ /**
68
+ * The `422 BROADCAST_CHANNEL_NOT_CONFIGURED` body of a maintenance broadcast:
69
+ * `channels` names every requested channel with no platform sender (never
70
+ * `'email'`), in request order. Refused whole, before the roster read, any
71
+ * claim or any send.
72
+ */
73
+ interface MaintenanceBroadcastChannelRefusal {
74
+ message: string;
75
+ error: 'BROADCAST_CHANNEL_NOT_CONFIGURED';
76
+ channels: MaintenanceBroadcastChannel[];
77
+ }
67
78
  /**
68
79
  * What one channel actually did.
69
80
  *
@@ -277,9 +277,12 @@ declare global {
277
277
  cause: 'refunded' | 'charged_back';
278
278
  at: number;
279
279
  };
280
- /** The platform's comprobante for the purchase. Always `null` for now. */
280
+ /**
281
+ * The platform's comprobante for the purchase — non-null only for a
282
+ * purchase approved on or after the platform's self-billing go-live.
283
+ */
281
284
  factura: PlatformFiscalDoc;
282
- /** The platform's credit note for its reversal. Always `null` for now. */
285
+ /** The platform's credit note for its reversal — non-null only when `reversal` is set and `factura` is non-null. */
283
286
  creditNote: PlatformFiscalDoc;
284
287
  }
285
288
  /** One page of the store's pack purchases, newest first. `cursor` present only when more may follow. */
@@ -727,8 +727,12 @@ declare global {
727
727
  /**
728
728
  * The platform's own fiscal document for a charge it made a tenant (a
729
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.
730
+ * `Invoice` the tenant issues. `null` when there is none; `pending` while it
731
+ * is owed and not yet authorised — an ARCA rejection or a retry stays
732
+ * `pending`, never a third state; `issued` once ARCA authorised it. `number`
733
+ * is `PPPP-NNNNNNNN` (point of sale and comprobante number, zero-padded);
734
+ * `issuedAt` is Unix ms. Nothing writes one yet, so every reader still
735
+ * answers `null`.
732
736
  */
733
737
  type PlatformFiscalDoc = null | {
734
738
  status: 'pending';
@@ -739,6 +743,21 @@ declare global {
739
743
  cae: string;
740
744
  issuedAt: number;
741
745
  };
746
+ /** Which platform document `GET /subscription/invoices/{paymentId}/pdf` renders. */
747
+ type PlatformFiscalDocKind = 'factura' | 'creditNote';
748
+ /**
749
+ * `data` of `GET /subscription/invoices/{paymentId}/pdf?doc=factura|creditNote`
750
+ * (adminToken), for a subscription OR a message-pack payment of the token's
751
+ * store: a short-lived presigned `url` to the rendered PDF, valid until
752
+ * `expiresAt` (Unix ms, about 5 minutes). Fetch it on click, never cache it.
753
+ * `404 PLATFORM_FISCAL_DOC_NOT_FOUND` when the payment or its document does
754
+ * not exist; `409 PLATFORM_FISCAL_DOC_PENDING` while it is still pending.
755
+ * The route itself ships with platform self-billing's PDF slice.
756
+ */
757
+ interface PlatformFiscalDocPdf {
758
+ url: string;
759
+ expiresAt: number;
760
+ }
742
761
  /**
743
762
  * One charge SINFACTURA made against a tenant, normalized out of whichever
744
763
  * billing provider holds the money. Backs the per-tenant payment history and
@@ -751,6 +770,12 @@ declare global {
751
770
  * unpaid and identity-proven distinct paid provider entries without counting matched payments
752
771
  * twice. Unknown or partially overlapping paid aggregates are omitted and the response is truncated; retained rows carry the paid plan and period metadata below. The
753
772
  * cross-tenant billing rollup continues to read live provider history only.
773
+ *
774
+ * Every row also carries `factura` and `creditNote` — the platform's OWN
775
+ * comprobante for the charge and its reversal, required and `null` when
776
+ * absent: non-null only on a retained `mercadopago` row that is `'paid'` or a
777
+ * reversed `'void'`, approved on or after the self-billing go-live (rules on
778
+ * each field). Top-level `pdfUrl` / `issuedAt` are unchanged by them.
754
779
  */
755
780
  interface InvoiceSummary {
756
781
  id: string;
@@ -777,6 +802,21 @@ declare global {
777
802
  /** Unix ms; reversal facts preserve the original amount and map status to void. */
778
803
  refundedAt?: number;
779
804
  chargedBackAt?: number;
805
+ /**
806
+ * The platform's comprobante for this charge. Non-null only on a
807
+ * retained `mercadopago` row whose status is `'paid'`, or `'void'`
808
+ * because it was reversed (`refundedAt` / `chargedBackAt` set), approved
809
+ * on or after the platform's self-billing go-live. Stripe rows, live
810
+ * provider rows (`'open'`, `'failed'`, and paid entries with no retained
811
+ * row) and payments before the go-live are always `null`. Never omitted.
812
+ */
813
+ factura: PlatformFiscalDoc;
814
+ /**
815
+ * The platform's credit note reversing that comprobante. Non-null only
816
+ * on a reversed (`'void'`) row whose `factura` is non-null; `null` on a
817
+ * `'paid'` row and wherever `factura` is `null`. Never omitted.
818
+ */
819
+ creditNote: PlatformFiscalDoc;
780
820
  }
781
821
  /**
782
822
  * One tier's `SK: PLAN` template row, as assessed by
@@ -589,8 +589,10 @@ export type TerminalEnrolmentErrorCode = (typeof TERMINAL_ENROLMENT_ERROR_CODES)
589
589
  * did not match.
590
590
  * - `PASSWORD_NOT_SET` · 409 — `POST /terminal/activation` and `POST
591
591
  * /terminal/pin`: the employee (a founder registered with Google or Apple) has
592
- * no password. The body carries `providers`, the recorded sign-in providers, as
593
- * `POST /auth/verify-password` does. Nothing is counted against the account.
592
+ * no password. On `/terminal/pin` the body carries `providers`, the recorded
593
+ * sign-in providers, as `POST /auth/verify-password` does; `/terminal/activation`
594
+ * answers it after the lock and captcha gates, with no `providers`. Nothing is
595
+ * counted against the account.
594
596
  * - `IDEMPOTENCY_KEY_REUSE` · 422 / `IDEMPOTENCY_IN_PROGRESS` · 409 /
595
597
  * `INVALID_IDEMPOTENCY_KEY` · 400 — the `Idempotency-Key` header's own
596
598
  * refusals on `POST /terminal/operators`. A MISSING header is
package/dist/terminal.js CHANGED
@@ -89,8 +89,10 @@ export const TERMINAL_ENROLMENT_ERROR_CODES = [
89
89
  * did not match.
90
90
  * - `PASSWORD_NOT_SET` · 409 — `POST /terminal/activation` and `POST
91
91
  * /terminal/pin`: the employee (a founder registered with Google or Apple) has
92
- * no password. The body carries `providers`, the recorded sign-in providers, as
93
- * `POST /auth/verify-password` does. Nothing is counted against the account.
92
+ * no password. On `/terminal/pin` the body carries `providers`, the recorded
93
+ * sign-in providers, as `POST /auth/verify-password` does; `/terminal/activation`
94
+ * answers it after the lock and captcha gates, with no `providers`. Nothing is
95
+ * counted against the account.
94
96
  * - `IDEMPOTENCY_KEY_REUSE` · 422 / `IDEMPOTENCY_IN_PROGRESS` · 409 /
95
97
  * `INVALID_IDEMPOTENCY_KEY` · 400 — the `Idempotency-Key` header's own
96
98
  * refusals on `POST /terminal/operators`. A MISSING header is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.860",
3
+ "version": "1.10.862",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",