platform-types 1.10.849 → 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
  *
@@ -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.849",
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",