platform-types 1.10.848 → 1.10.850

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/auth.d.ts CHANGED
@@ -296,6 +296,14 @@ declare global {
296
296
  province?: string;
297
297
  /** Receptor identities. Every field of each entry is REQUIRED — there is no partial entry. */
298
298
  afip?: CustomerRegisterAfipInput[];
299
+ /**
300
+ * The shopper's own opt-in to marketing EMAIL, ticked at registration.
301
+ * `true` creates the customer with `marketing.email: true` and its
302
+ * provenance stamp `marketing.consent.email = { ts, source: 'storefront',
303
+ * ip? }` (the viewer's IP, when the request has one). `false` or absent
304
+ * writes no `marketing` at all — and absence is never consent.
305
+ */
306
+ marketingEmail?: boolean;
299
307
  }
300
308
  /**
301
309
  * Registration request body.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MARKETING_COPY_VARIANTS_MAX = exports.MARKETING_COPY_VARIANTS_MIN = exports.MARKETING_COPY_FACT_MAX_CHARS = exports.MARKETING_COPY_FACTS_MAX = exports.MARKETING_COPY_FACTS_MIN = exports.MARKETING_COPY_GOAL_MAX_CHARS = exports.ABANDONED_CART_SNAPSHOT_NAME_MAX = exports.ABANDONED_CART_SNAPSHOT_MAX_LINES = exports.CART_APPLICABLE_PROMOTION_TYPES = exports.PROMOTION_TYPES = exports.AUTOMATION_RULE_STATUSES = exports.AUTOMATION_SEND_STATUSES = exports.ATTRIBUTION_WINDOW_HOURS = exports.RFM_SEGMENT_LABELS = exports.CAMPAIGN_ERROR_CODES = exports.CAMPAIGN_CLIENT_STATUSES = exports.AUTOMATION_TRIGGERS = void 0;
3
+ exports.MARKETING_COPY_VARIANTS_MAX = exports.MARKETING_COPY_VARIANTS_MIN = exports.MARKETING_COPY_FACT_MAX_CHARS = exports.MARKETING_COPY_FACTS_MAX = exports.MARKETING_COPY_FACTS_MIN = exports.MARKETING_COPY_GOAL_MAX_CHARS = exports.ABANDONED_CART_SNAPSHOT_NAME_MAX = exports.ABANDONED_CART_MAX_DELAY_MINUTES = exports.ABANDONED_CART_MIN_DELAY_MINUTES = exports.ABANDONED_CART_SNAPSHOT_MAX_LINES = exports.CART_APPLICABLE_PROMOTION_TYPES = exports.PROMOTION_TYPES = exports.AUTOMATION_RULE_STATUSES = exports.AUTOMATION_SEND_STATUSES = exports.ATTRIBUTION_WINDOW_HOURS = exports.RFM_SEGMENT_LABELS = exports.CAMPAIGN_ERROR_CODES = exports.CAMPAIGN_CLIENT_STATUSES = exports.AUTOMATION_TRIGGERS = void 0;
4
4
  /**
5
5
  * Runtime source for {@link AutomationTrigger}, the api’s Zod enum and the
6
6
  * configuration picker. Derive them from this tuple; a separate union plus
@@ -129,6 +129,25 @@ exports.CART_APPLICABLE_PROMOTION_TYPES = [
129
129
  * not assume `lines.length <= ` this value.
130
130
  */
131
131
  exports.ABANDONED_CART_SNAPSHOT_MAX_LINES = 5;
132
+ /**
133
+ * The smallest `delayMinutes` an `'ABANDONED_CART'` rule may carry.
134
+ *
135
+ * `POST /automation-rules` refuses a lower value with `400` at `delayMinutes`,
136
+ * on create and on an update that would leave the rule below it. A rule stored
137
+ * before the floor existed is READ as this value by the recovery cron and
138
+ * never rewritten. An hour is also the cron's own cadence: a shorter delay
139
+ * could not be honoured more precisely than one tick anyway.
140
+ */
141
+ exports.ABANDONED_CART_MIN_DELAY_MINUTES = 60;
142
+ /**
143
+ * The longest delay an `ABANDONED_CART` rule may set, in minutes: 71 hours.
144
+ * The recovery cron only considers carts whose last change is within the
145
+ * last 72 hours, so a delay of 72 hours or more leaves no cart it could ever
146
+ * arm. One hour below that keeps at least one hourly tick inside the window.
147
+ * Refused above this on create and update; a rule stored above it is READ as
148
+ * this value by the cron and never rewritten.
149
+ */
150
+ exports.ABANDONED_CART_MAX_DELAY_MINUTES = 71 * 60;
132
151
  /**
133
152
  * How many characters of a product NAME the snapshot keeps.
134
153
  *
@@ -1257,6 +1257,88 @@ declare global {
1257
1257
  productId: string;
1258
1258
  lastOrderedAt: number;
1259
1259
  }
1260
+ /**
1261
+ * One entry of `CustomerDataExport.serviceOrders`: a service ticket as the
1262
+ * customer was told about it — an ALLOW-LIST of the `ServiceOrder` row, never
1263
+ * the row itself. The diagnosis, the work logs, the parts and their cost, the
1264
+ * technician, the operator status notes and who moved each status, the quote's
1265
+ * approver/rejecter and rejection note, the hold, the deposits and the
1266
+ * pictures are the workshop's own record and are NOT here.
1267
+ */
1268
+ interface CustomerDataExportServiceOrder {
1269
+ serviceOrderId: string;
1270
+ ticketNumber: string;
1271
+ serviceType: ServiceType;
1272
+ status: ServiceStatus;
1273
+ /** The status timeline, oldest first: each status and when it was entered, nothing else. */
1274
+ statusHistory: {
1275
+ status: ServiceStatus;
1276
+ timestamp: number;
1277
+ }[];
1278
+ /** The equipment as received. Absent when the ticket recorded none (or an erasure removed it). */
1279
+ equipment?: {
1280
+ type?: string;
1281
+ brand?: string;
1282
+ model?: string;
1283
+ serialNumber?: string;
1284
+ accessories?: string[];
1285
+ condition?: string;
1286
+ reportedIssue?: string;
1287
+ };
1288
+ /** Every quote version, oldest first — the customer-facing fields only. */
1289
+ quote?: {
1290
+ quoteId: string;
1291
+ version: number;
1292
+ status: ServiceQuoteStatus;
1293
+ amount: number;
1294
+ currency?: string;
1295
+ quotedAt?: number;
1296
+ expiresAt?: number;
1297
+ /** When and through which channel the customer approved — never who recorded it. */
1298
+ approval?: {
1299
+ at: number;
1300
+ channel: ServiceQuoteChannel;
1301
+ };
1302
+ /** When and why the customer declined — never the operator's note or who recorded it. */
1303
+ rejection?: {
1304
+ at: number;
1305
+ reason: ServiceQuoteRejectionReason;
1306
+ };
1307
+ }[];
1308
+ total?: number;
1309
+ currency: string;
1310
+ createdAt: number;
1311
+ promisedAt?: number;
1312
+ readyAt?: number;
1313
+ deliveredAt?: number;
1314
+ /** `true` on a ticket the store soft-deleted; absent on a live one. */
1315
+ disabled?: boolean;
1316
+ }
1317
+ /**
1318
+ * `CustomerDataExport.loyalty`: the subject's points account and ledger. Never
1319
+ * the acting user (`createdBy`) of a ledger row — a third party's id.
1320
+ */
1321
+ interface CustomerDataExportLoyalty {
1322
+ /** Absent when nothing ever credited or debited the customer (no account row exists). */
1323
+ account?: {
1324
+ balance: number;
1325
+ lifetimePoints: number;
1326
+ tierId?: string;
1327
+ updatedAt: number;
1328
+ };
1329
+ /** The ledger, newest first. */
1330
+ transactions: {
1331
+ transactionId: string;
1332
+ kind: LoyaltyTransactionKind;
1333
+ /** Signed, as written: an `earn` positive, a `redeem` negative, an `adjust` either. */
1334
+ points: number;
1335
+ currency: string;
1336
+ createdAt: number;
1337
+ orderId?: string;
1338
+ couponCode?: string;
1339
+ rewardId?: string;
1340
+ }[];
1341
+ }
1260
1342
  /**
1261
1343
  * Supported customer, CRM, order, invoice, ledger and directly customer-linked
1262
1344
  * payment collections, assembled for the SUBJECT
@@ -1364,6 +1446,20 @@ declare global {
1364
1446
  * storefront quote requests).
1365
1447
  */
1366
1448
  quoteRequests?: QuoteRequest[];
1449
+ /**
1450
+ * The subject's service tickets, newest first, on BOTH surfaces: live and
1451
+ * soft-deleted (`disabled: true`), under their own id plus any merged-away id
1452
+ * folded into them (the same folded ids, and the same cap, as the financial
1453
+ * collections). At most 200 live and 200 soft-deleted per id. Absent when
1454
+ * there is none (and from servers predating this section).
1455
+ */
1456
+ serviceOrders?: CustomerDataExportServiceOrder[];
1457
+ /**
1458
+ * The subject's loyalty account and points ledger (at most 1,000 rows), on
1459
+ * BOTH surfaces, under their OWN id only. Absent when there is neither an
1460
+ * account nor a ledger row (and from servers predating this section).
1461
+ */
1462
+ loyalty?: CustomerDataExportLoyalty;
1367
1463
  /**
1368
1464
  * Per COLLECTION, and honest: `true` means the read stopped before the
1369
1465
  * end of a partition, folded financial IDs were omitted at the cap, or whole
@@ -1399,6 +1495,15 @@ declare global {
1399
1495
  * past the per-export request cap, may be missing.
1400
1496
  */
1401
1497
  quoteRequests?: boolean;
1498
+ /**
1499
+ * Present when `serviceOrders` is, or when merged-away ids were cut at the
1500
+ * folded-id cap — then `true`: a ticket under an omitted id, past the
1501
+ * per-id cap or the read budget, or cut by the response-byte bound, may be
1502
+ * missing.
1503
+ */
1504
+ serviceOrders?: boolean;
1505
+ /** Present exactly when `loyalty` is: `true` when ledger rows past the cap, or the byte bound, are missing. */
1506
+ loyalty?: boolean;
1402
1507
  };
1403
1508
  }
1404
1509
  /**
@@ -1737,6 +1842,25 @@ declare global {
1737
1842
  * (`CUSTOMER_ANONYMIZE_CREDIT_NOTE_MARKER_INCOMPLETE`).
1738
1843
  */
1739
1844
  creditNoteMarkerEraseComplete?: boolean;
1845
+ /**
1846
+ * `SERVICE#` tickets of this customer, live and soft-deleted, whose
1847
+ * customer-describing free text this erasure took off: `equipment`'s
1848
+ * `serialNumber`, `reportedIssue`, `condition` and `accessories` REMOVEd, and
1849
+ * `search` rebuilt without the serial and the customer's name. The ticket's
1850
+ * operational and fiscal skeleton is kept. Both wires carry it: it counts the
1851
+ * subject's own rows. A re-issue counts only the tickets an earlier pass did
1852
+ * not reach. Optional only so the field is additive.
1853
+ */
1854
+ serviceOrdersScrubbed?: number;
1855
+ /**
1856
+ * `false` when those tickets could not be read or written to the end, so a
1857
+ * serial or a reported fault may remain. Re-issuing the erasure re-runs the
1858
+ * step (it reads at most 1,000 of the subject's tickets, so past that a
1859
+ * re-issue cannot finish it); BOTH erasure handlers write a deduped `ERROR` row
1860
+ * (`CUSTOMER_ANONYMIZE_SERVICE_ORDERS_INCOMPLETE`). Only a measured `true` is
1861
+ * a finished step.
1862
+ */
1863
+ serviceOrderScrubComplete?: boolean;
1740
1864
  /**
1741
1865
  * Storefront quote requests the subject sent signed in
1742
1866
  * (`QUOTEREQUEST#{storeId}`), DELETED by this erasure — the whole row goes:
@@ -510,7 +510,8 @@ declare global {
510
510
  * a per-customer frequency cap. The configuration record for automated
511
511
  * marketing — abandoned-cart recovery first.
512
512
  *
513
- * ⚠️ **An `'active'` rule is an ARMED SENDER.** `cartSweep` (`ABANDONED_CART`)
513
+ * ⚠️ **An `'active'` rule is an ARMED SENDER.** `cartRecoveryCron`
514
+ * (`ABANDONED_CART`, hourly, carts idle between the rule's delay and 72 hours)
514
515
  * and `reorderDueCron` (`REORDER_DUE`) arm an {@link AutomationSend} for
515
516
  * every active rule matching the trigger; the `automation-due` cron re-reads
516
517
  * the rule, its template, the cap and consent when the delay ends, and the
@@ -562,6 +563,11 @@ declare global {
562
563
  * message delay at 15 minutes, and the whole point of an abandoned-cart
563
564
  * recovery is that it lands hours later. What implements the wait is the
564
565
  * consumer slice's problem; the rule only declares it.
566
+ *
567
+ * ⚠️ At least {@link ABANDONED_CART_MIN_DELAY_MINUTES} on an
568
+ * `'ABANDONED_CART'` rule — counted from the cart's own last update, and
569
+ * a send that would land between 21:00 and 09:00 ART is deferred to
570
+ * 09:00 ART.
565
571
  */
566
572
  delayMinutes: number;
567
573
  /**
@@ -593,9 +599,13 @@ declare global {
593
599
  * consent re-check, because the store had its Marketing module switched
594
600
  * off (`reason: 'MODULE_OFF'`, a store choice rather than a customer's),
595
601
  * because its plan does not carry `marketing`
596
- * (`reason: 'AUTOMATION_NOT_ENTITLED'`), or because the rule's template was
597
- * archived (`reason: 'AUTOMATION_TEMPLATE_ARCHIVED'`). A `'skipped'` row
598
- * does not count against the frequency cap.
602
+ * (`reason: 'AUTOMATION_NOT_ENTITLED'`), because the rule's template was
603
+ * archived (`reason: 'AUTOMATION_TEMPLATE_ARCHIVED'`), or — on an
604
+ * `'ABANDONED_CART'` send — because the cart stopped being abandoned before
605
+ * the send was due: the customer ordered (`'ABANDONED_CART_CONVERTED'`),
606
+ * came back to the cart (`'ABANDONED_CART_TOUCHED'`), or the cart is gone or
607
+ * empty (`'ABANDONED_CART_GONE'`). A `'skipped'` row does not count against
608
+ * the frequency cap.
599
609
  *
600
610
  * Deliberately the same four values as {@link CampaignRecipientStatus}, and
601
611
  * deliberately a SEPARATE type rather than an alias: the two vocabularies
@@ -968,6 +978,46 @@ declare global {
968
978
  */
969
979
  complete: boolean;
970
980
  }
981
+ /**
982
+ * What one pass of the hourly abandoned-cart recovery EMITTER
983
+ * (`cartRecoveryCron`) did — the body of its operator-facing `response()`.
984
+ *
985
+ * ⚠️ See {@link AutomationDueCronTotals} for why each cron has its own type.
986
+ */
987
+ interface CartRecoveryCronTotals {
988
+ /** Tenants visited this pass. */
989
+ stores: number;
990
+ /** Of those, the few with an ACTIVE `'ABANDONED_CART'` rule — the only ones whose carts are read. */
991
+ storesWithRules: number;
992
+ /** Tenants whose pass threw. Isolated: the rest of the tick still ran. */
993
+ storesFailed: number;
994
+ /** The store roster hit its page bound, so some tenants went unvisited. */
995
+ rosterTruncated: boolean;
996
+ /** Candidate cart rows read inside the recovery window. */
997
+ scanned: number;
998
+ /** Carts claimed for this version and handed to the rules. */
999
+ carts: number;
1000
+ /** Sends queued across every rule, for those carts. */
1001
+ sendsArmed: number;
1002
+ /** Rule matches declined at arm time because the customer was at that rule's cap. */
1003
+ sendsCapped: number;
1004
+ /**
1005
+ * Candidates already claimed for the version of the cart stored now — an
1006
+ * earlier tick armed them and the shopper has not been back since. The
1007
+ * EXPECTED steady state for most of the window.
1008
+ */
1009
+ alreadyArmed: number;
1010
+ /** Candidates that are not a recoverable cart — no valid customer or no items. */
1011
+ ineligible: number;
1012
+ /** Carts touched (or deleted) between the read and the claim — left for a later tick. */
1013
+ raced: number;
1014
+ /**
1015
+ * The pass reached the end of its roster rather than stopping on its own
1016
+ * clock reserve. ⚠️ `false` is normal under load: the next hourly tick
1017
+ * resumes, and the 72-hour window spans many ticks.
1018
+ */
1019
+ complete: boolean;
1020
+ }
971
1021
  /**
972
1022
  * The channel one `POST /marketing/copy` request generates for.
973
1023
  *
@@ -1204,6 +1254,25 @@ export declare const CART_APPLICABLE_PROMOTION_TYPES: readonly ["buyXGetY", "fre
1204
1254
  * not assume `lines.length <= ` this value.
1205
1255
  */
1206
1256
  export declare const ABANDONED_CART_SNAPSHOT_MAX_LINES = 5;
1257
+ /**
1258
+ * The smallest `delayMinutes` an `'ABANDONED_CART'` rule may carry.
1259
+ *
1260
+ * `POST /automation-rules` refuses a lower value with `400` at `delayMinutes`,
1261
+ * on create and on an update that would leave the rule below it. A rule stored
1262
+ * before the floor existed is READ as this value by the recovery cron and
1263
+ * never rewritten. An hour is also the cron's own cadence: a shorter delay
1264
+ * could not be honoured more precisely than one tick anyway.
1265
+ */
1266
+ export declare const ABANDONED_CART_MIN_DELAY_MINUTES = 60;
1267
+ /**
1268
+ * The longest delay an `ABANDONED_CART` rule may set, in minutes: 71 hours.
1269
+ * The recovery cron only considers carts whose last change is within the
1270
+ * last 72 hours, so a delay of 72 hours or more leaves no cart it could ever
1271
+ * arm. One hour below that keeps at least one hourly tick inside the window.
1272
+ * Refused above this on create and update; a rule stored above it is READ as
1273
+ * this value by the cron and never rewritten.
1274
+ */
1275
+ export declare const ABANDONED_CART_MAX_DELAY_MINUTES: number;
1207
1276
  /**
1208
1277
  * How many characters of a product NAME the snapshot keeps.
1209
1278
  *
package/dist/marketing.js CHANGED
@@ -126,6 +126,25 @@ export const CART_APPLICABLE_PROMOTION_TYPES = [
126
126
  * not assume `lines.length <= ` this value.
127
127
  */
128
128
  export const ABANDONED_CART_SNAPSHOT_MAX_LINES = 5;
129
+ /**
130
+ * The smallest `delayMinutes` an `'ABANDONED_CART'` rule may carry.
131
+ *
132
+ * `POST /automation-rules` refuses a lower value with `400` at `delayMinutes`,
133
+ * on create and on an update that would leave the rule below it. A rule stored
134
+ * before the floor existed is READ as this value by the recovery cron and
135
+ * never rewritten. An hour is also the cron's own cadence: a shorter delay
136
+ * could not be honoured more precisely than one tick anyway.
137
+ */
138
+ export const ABANDONED_CART_MIN_DELAY_MINUTES = 60;
139
+ /**
140
+ * The longest delay an `ABANDONED_CART` rule may set, in minutes: 71 hours.
141
+ * The recovery cron only considers carts whose last change is within the
142
+ * last 72 hours, so a delay of 72 hours or more leaves no cart it could ever
143
+ * arm. One hour below that keeps at least one hourly tick inside the window.
144
+ * Refused above this on create and update; a rule stored above it is READ as
145
+ * this value by the cron and never rewritten.
146
+ */
147
+ export const ABANDONED_CART_MAX_DELAY_MINUTES = 71 * 60;
129
148
  /**
130
149
  * How many characters of a product NAME the snapshot keeps.
131
150
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.848",
3
+ "version": "1.10.850",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",