sinfactura-types 1.10.356 → 1.10.358

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/account.d.ts CHANGED
@@ -368,7 +368,20 @@ declare global {
368
368
  * candidate forever on a drift that will never be checkpointed.
369
369
  */
370
370
  candidates: number;
371
- /** `BALANCE-{customerId}-{date}` rows written. */
371
+ /**
372
+ * `BALANCE-{customerId}-{date}` rows written — by the ordinary full pass AND
373
+ * by the bounded catch-up passes.
374
+ *
375
+ * ⚠️ **A catch-up write counts, and excluding it inverted the one number an
376
+ * operator reads.** A customer whose ledger is too long for the full walk
377
+ * ends on `ledgerTruncated`, which is counted as `failed`; when the catch-up
378
+ * loop inside that branch wrote three checkpoints, three rows landed, the
379
+ * next walk got strictly shorter, and the run still reported one failure and
380
+ * zero checkpoints. Converging looked identical to stuck — on exactly the
381
+ * customers the catch-up pass exists for. A customer can therefore appear in
382
+ * both `checkpointed` and `failed` in one run; that pair IS the state
383
+ * "advancing but not done", and neither number alone can say it.
384
+ */
372
385
  checkpointed: number;
373
386
  /** Candidates whose RE-DERIVED count came in under the threshold. Correct refusals, never errors. */
374
387
  skippedBelowThreshold: number;
package/dist/afip.d.ts CHANGED
@@ -111,5 +111,36 @@ declare global {
111
111
  lastSuccessAt?: number;
112
112
  fetchedAt: number;
113
113
  }
114
+ /**
115
+ * Why `POST /afip {mode: upload}` refused an AFIP certificate or private key.
116
+ *
117
+ * A CLOSED vocabulary the FE maps to copy, so it is published rather than
118
+ * left as a `string`. Every member arrives as a `400` with the code in
119
+ * `error` and Spanish copy in `message`; none of them carries a CUIT value
120
+ * or a PEM byte (Ley 25.326), so the code is all an FE has to branch on.
121
+ *
122
+ * ⚠️ `AFIP_CERT_CUIT_MISSING` / `_UNREADABLE` / `_MISMATCH` are the SAME
123
+ * three strings `verifiedAfipCuit` throws at WSAA login time. The upload
124
+ * pre-flight is that check moved to the only moment where the message can
125
+ * name the fix; an FE keyed on the string handles both origins.
126
+ *
127
+ * `AFIP_CERT_NOT_A_CERTIFICATE` — the file is not a parseable X.509 PEM.
128
+ * `AFIP_KEY_NOT_A_PRIVATE_KEY` — the file is not a parseable private key.
129
+ * `AFIP_CERT_CUIT_MISSING` — the store has no `integrations.afip.cuit`
130
+ * to verify the certificate against.
131
+ * `AFIP_CERT_CUIT_UNREADABLE` — the certificate declares no CUIT in its
132
+ * subject `serialNumber` RDN.
133
+ * `AFIP_CERT_CUIT_MISMATCH` — the certificate was issued to a DIFFERENT
134
+ * taxpayer than the store declares.
135
+ * `AFIP_CERT_KEY_MISMATCH` — certificate and stored private key are not
136
+ * one keypair (a re-enrolment against a
137
+ * stale CSR is how they come apart).
138
+ * `AFIP_CERT_EXPIRED` — the certificate's `notAfter` has passed.
139
+ *
140
+ * ⚠️ A FUTURE `notBefore` is deliberately NOT refused: ARCA issues in Buenos
141
+ * Aires local time and a few hours of skew would otherwise refuse a good
142
+ * certificate at the one moment the operator is uploading it.
143
+ */
144
+ type AfipCertUploadErrorCode = 'AFIP_CERT_NOT_A_CERTIFICATE' | 'AFIP_KEY_NOT_A_PRIVATE_KEY' | 'AFIP_CERT_CUIT_MISSING' | 'AFIP_CERT_CUIT_UNREADABLE' | 'AFIP_CERT_CUIT_MISMATCH' | 'AFIP_CERT_KEY_MISMATCH' | 'AFIP_CERT_EXPIRED';
114
145
  }
115
146
  export {};
package/dist/auth.d.ts CHANGED
@@ -454,8 +454,21 @@ declare global {
454
454
  * — the mandate is scoped to operator surfaces, and there is no customer
455
455
  * enrolment endpoint for a web mandate to be satisfiable against, so a
456
456
  * `kind: 'CUSTOMER'` row can never carry it.
457
+ * - `role_not_allowed` — the credentials were correct and the account is
458
+ * enabled, but the ROLE it carries is not admitted at the door it knocked
459
+ * on. ⚠️ A property of the DOOR, not of the account, which is what makes it
460
+ * different from `disabled`: the same row may be refused here and sign in
461
+ * successfully at another mode, so it must never be rendered as "this
462
+ * account is blocked". Emitted by `login`, `social`, `magic-link-verify`
463
+ * and `printer`.
457
464
  */
458
- type LoginOutcome = 'success' | 'wrong_password' | 'disabled' | 'blocked' | 'requires_2fa' | 'wrong_totp' | 'totp_replay' | 'totp_locked' | 'enrollment_required';
465
+ type LoginOutcome = 'success' | 'wrong_password' | 'disabled' | 'blocked' | 'requires_2fa' | 'wrong_totp' | 'totp_replay' | 'totp_locked' | 'enrollment_required'
466
+ /**
467
+ * See the list above. Forward-only like every other value — rows written
468
+ * before it existed carry nothing, and an EMPTY history is still never
469
+ * proof that nothing was attempted.
470
+ */
471
+ | 'role_not_allowed';
459
472
  /**
460
473
  * One row of `GET /auth?mode=login-history[&days=N]` — a storefront
461
474
  * customer's own login audit trail. The stored row reaches the wire
@@ -420,7 +420,26 @@ declare global {
420
420
  * stopped short is indistinguishable from a clean history, and erasure is
421
421
  * irreversible.
422
422
  */
423
- | 'CUSTOMER_ORDER_HISTORY_TRUNCATED';
423
+ | 'CUSTOMER_ORDER_HISTORY_TRUNCATED'
424
+ /**
425
+ * The customer's ACCOUNT ledger could not be read to the end, so the live
426
+ * balance could not be derived. Refused for the same reason as
427
+ * `CUSTOMER_ORDER_HISTORY_TRUNCATED`: a short fold is a WRONG SUM rather
428
+ * than a short list, and erasure is irreversible.
429
+ */
430
+ | 'CUSTOMER_LEDGER_TRUNCATED'
431
+ /**
432
+ * A concurrent LEDGER write moved `balance` or `eventSeq` between the
433
+ * erasure's pre-read and its conditional write, so the write cancelled.
434
+ *
435
+ * ⚠️ **NOTHING was erased, and this is the one refusal that is safe to
436
+ * retry immediately.** It is distinct from `CUSTOMER_ALREADY_ANONYMIZED`
437
+ * precisely because the two used to be reported as one: the erasure's
438
+ * condition pins three predicates and DynamoDB reports one cancellation
439
+ * code for all of them, so a customer who simply took delivery of an order
440
+ * mid-request was announced to the operator as already erased.
441
+ */
442
+ | 'CUSTOMER_CHANGED_DURING_ERASURE';
424
443
  /**
425
444
  * ONE channel's consent as the customer row records it — a CURRENT value
426
445
  * with its provenance, flattened per channel for the data-subject export.
@@ -501,6 +520,21 @@ declare global {
501
520
  * operator handler additionally writes an un-deduped `ERROR` row.
502
521
  */
503
522
  sessionRevocationComplete: boolean;
523
+ /**
524
+ * `ACCOUNT#` ledger rows whose denormalised `fullName` was removed by this
525
+ * erasure.
526
+ *
527
+ * ⚠️ The ledger rows are NOT erased — they are the retained fiscal trail.
528
+ * Only the personal attributes copied onto them are, which is what stops an
529
+ * erased customer's name being served on statements and exports.
530
+ */
531
+ ledgerRowsScrubbed: number;
532
+ /**
533
+ * `false` when the ledger could not be read to the end, so rows carrying the
534
+ * name may remain. The CUSTOMER row IS anonymised either way; a caller must
535
+ * surface this rather than implying a clean scrub.
536
+ */
537
+ ledgerScrubComplete: boolean;
504
538
  }
505
539
  /**
506
540
  * A stored `Customer` plus the session tokens. Same caveat as `AuthUser`:
package/dist/store.d.ts CHANGED
@@ -873,11 +873,12 @@ declare global {
873
873
  * A tenant may carry both; treat `staticQr` as the legacy default counter.
874
874
  *
875
875
  * Every field here is server-written by the dedicated POS endpoints, never
876
- * by a client. It sits under `integrations.mercadopago`, and BOTH `.loose()`
877
- * pass-throughs already delete the whole `integrations` umbrella
878
- * (`store/_post.ts`, `tenants/_post.ts` — which also drops a top-level
879
- * `mercadopago`), so this inherits that protection rather than needing its
880
- * own strip-list entry.
876
+ * by a client — and that is enforced rather than inherited: the top-level
877
+ * `mercadopago` write vehicle is narrowed to `MP_CLIENT_WRITABLE`
878
+ * (`stacks/helpers/integrationsWrite.ts`, an ALLOW-list), which this key is
879
+ * not on, so every one of the three writers drops it. BOTH `.loose()`
880
+ * pass-throughs additionally delete the whole `integrations` umbrella
881
+ * (`store/_post.ts`, `tenants/_post.ts`).
881
882
  */
882
883
  staticQrs?: Record<string, MercadopagoStaticQr>;
883
884
  lastMovementCheckpoint?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.356",
3
+ "version": "1.10.358",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",