sinfactura-types 1.10.621 → 1.10.622

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.
Files changed (2) hide show
  1. package/dist/customer.d.ts +62 -2
  2. package/package.json +1 -1
@@ -643,7 +643,8 @@ declare global {
643
643
  * Every refusal `POST /customers { mode: 'data-export' | 'anonymize' }` and
644
644
  * its storefront twin `POST /user` can answer, as the bare SCREAMING_SNAKE
645
645
  * `error` code on the wire. Thrown by `stacks/services/customerDataRights.ts`
646
- * and mapped to one status each by `@helpers/customerDataRightsRefusal`.
646
+ * (`RETENTION_REQUEST_CONFLICT` by the operator handler, before the service
647
+ * runs) and mapped to one status each by `@helpers/customerDataRightsRefusal`.
647
648
  */
648
649
  type CustomerDataRightsErrorCode =
649
650
  /** No such customer in the TOKEN's store — includes every cross-store id. */
@@ -731,7 +732,17 @@ declare global {
731
732
  * day, tells staff that the customer asked. The client tells the shopper to
732
733
  * contact the shop; retrying cannot succeed.
733
734
  */
734
- | 'CUSTOMER_ERASURE_REQUIRES_STAFF';
735
+ | 'CUSTOMER_ERASURE_REQUIRES_STAFF'
736
+ /**
737
+ * 409, OPERATOR ONLY (`POST /customers` mode `anonymize`). The request's
738
+ * `requestId` is already bound to the erasure of ANOTHER customer (or its
739
+ * receipt names a retention job that no longer exists). Refused BEFORE the
740
+ * erasure: NOTHING was erased. Send a fresh `requestId`, or none — the
741
+ * request id is then derived from the customer named. `data` is
742
+ * `{ customerId }`, the id the request named. The storefront derives its
743
+ * request id and never answers this code.
744
+ */
745
+ | 'RETENTION_REQUEST_CONFLICT';
735
746
  /**
736
747
  * Why an erasure was refused or its committed completion remains incomplete.
737
748
  *
@@ -1225,6 +1236,55 @@ declare global {
1225
1236
  * for the same reason (the rejection reasons are operator-written).
1226
1237
  */
1227
1238
  type WebAnonymizeCustomerResult = Omit<AnonymizeCustomerResult, 'notesErased' | 'notesEraseComplete' | 'rmaReasonsErased' | 'rmaEraseComplete'>;
1239
+ /**
1240
+ * Where a retention job stands. `completed` is terminal and is reached only
1241
+ * when every individually erasable surface is `erased-and-verified`;
1242
+ * `retained-by-policy` is retention, never an erasure.
1243
+ */
1244
+ type CustomerErasureRetentionState = 'retained-by-policy' | 'erased-and-verified' | 'pending-delivery' | 'retryable-failure' | 'identity-unresolved' | 'completed';
1245
+ /**
1246
+ * The retention job an erasure request recorded: what each retention surface
1247
+ * (logs, audit trails, analytics events) owes the erasure, beyond the
1248
+ * customer rows the erasure itself rewrote. The job is opened BEFORE the
1249
+ * erasure, keyed by the request as sent (store and the customer NAMED), and
1250
+ * lists every id the erasure ran as its subjects. Both erasure surfaces record
1251
+ * one; only the operator surface answers it (`StaffAnonymizeCustomerResult`).
1252
+ */
1253
+ interface AnonymizeCustomerRetention {
1254
+ /**
1255
+ * The job's id. The same request (same `requestId`, or none sent twice for
1256
+ * the same customer named) answers the same id — whichever survivor a retry
1257
+ * resolves. Absent when the job could not be opened; re-issuing the erasure
1258
+ * records it.
1259
+ */
1260
+ jobId?: string;
1261
+ /**
1262
+ * The job's folded state. `identity-unresolved` when the erasure could not
1263
+ * rule out a merge survivor (`erasureIncompleteReason:
1264
+ * 'MERGE_LOOKUP_TRUNCATED'`); `retryable-failure` when the job could not be
1265
+ * opened or brought up to date — re-issue the erasure.
1266
+ */
1267
+ state: CustomerErasureRetentionState;
1268
+ /**
1269
+ * `true` until an analytics adapter records the subject's storefront
1270
+ * analytics events erased and verified, which is what folds the job to
1271
+ * `completed`. No analytics adapter records that yet, so today this is
1272
+ * always `true`: those events are NOT erased by this request. A client must
1273
+ * not present the erasure as complete while it is `true`.
1274
+ */
1275
+ analyticsPending: boolean;
1276
+ /**
1277
+ * `true` when a derivative of an erased id (an export, an artifact, a cached
1278
+ * query result) may still be `registered`, or an erased id is not yet fenced
1279
+ * against new registrations: the sweep failed or ran out of time. Re-issue
1280
+ * the erasure; it resumes where the sweep stopped.
1281
+ */
1282
+ derivativesPending: boolean;
1283
+ }
1284
+ /** `data` of the OPERATOR erasure (`POST /customers` mode `anonymize`). The storefront twin answers no `retention`. */
1285
+ type StaffAnonymizeCustomerResult = AnonymizeCustomerResult & {
1286
+ retention: AnonymizeCustomerRetention;
1287
+ };
1228
1288
  /**
1229
1289
  * The outcome of a Ley 25.326 art. 16 erasure (`anonymizeCustomer`). The
1230
1290
  * row is anonymised in place and KEPT — see `Customer.anonymizedAt`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.621",
3
+ "version": "1.10.622",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",