@marlinjai/mail-sdk 0.10.0 → 0.12.0

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/README.md CHANGED
@@ -157,6 +157,15 @@ What each piece does, and why:
157
157
  recorded as a miss (`matched: false` in `insertions` on `message.sent`, and in
158
158
  `mailings.languages`), so a drift between your form and the template shows up
159
159
  instead of passing silently.
160
+ - **Values for this one letter** go in `merge` on `mailings.create` (or
161
+ `mailings.update` while it is a draft): the same for everyone who gets the
162
+ mailing, above the contact's stored values and the workspace's defaults,
163
+ below a recipient's own. On a letter it may hold the reader's `first_name`
164
+ and `last_name`. `mail.mailings.resolve(id, { recipients })` is a dry run:
165
+ it answers what each recipient would be sent (every value's text and where
166
+ it comes from) without adding anybody, and `blocking` lists what would
167
+ refuse the send. A send in which a value inside a link's address is empty
168
+ for a recipient is refused with `unfilled_link` (422).
160
169
  - **The provider** (`provider_id`, required) is the sending account the
161
170
  workspace has set up: find its id with `mail.providers.list()` or on the
162
171
  dashboard's Providers page, and keep it in configuration next to the
package/dist/index.d.mts CHANGED
@@ -359,6 +359,7 @@ declare function createNamespaces(config: CoreConfig): {
359
359
  type: "member";
360
360
  subject: string;
361
361
  member_id: string;
362
+ app?: "booking" | undefined;
362
363
  } | {
363
364
  type: "api_key";
364
365
  api_key_id: string;
@@ -1238,10 +1239,10 @@ declare function createNamespaces(config: CoreConfig): {
1238
1239
  anomaly: {
1239
1240
  at: string;
1240
1241
  reason: string;
1242
+ blocking: boolean;
1241
1243
  mailing_id: string | null;
1242
1244
  sample: string;
1243
1245
  scope: "mailing" | "provider";
1244
- blocking: boolean;
1245
1246
  } | null;
1246
1247
  };
1247
1248
  from_name: string;
@@ -1267,10 +1268,10 @@ declare function createNamespaces(config: CoreConfig): {
1267
1268
  anomaly: {
1268
1269
  at: string;
1269
1270
  reason: string;
1271
+ blocking: boolean;
1270
1272
  mailing_id: string | null;
1271
1273
  sample: string;
1272
1274
  scope: "mailing" | "provider";
1273
- blocking: boolean;
1274
1275
  } | null;
1275
1276
  };
1276
1277
  from_name: string;
@@ -1311,10 +1312,10 @@ declare function createNamespaces(config: CoreConfig): {
1311
1312
  anomaly: {
1312
1313
  at: string;
1313
1314
  reason: string;
1315
+ blocking: boolean;
1314
1316
  mailing_id: string | null;
1315
1317
  sample: string;
1316
1318
  scope: "mailing" | "provider";
1317
- blocking: boolean;
1318
1319
  } | null;
1319
1320
  };
1320
1321
  from_name: string;
@@ -1340,10 +1341,10 @@ declare function createNamespaces(config: CoreConfig): {
1340
1341
  anomaly: {
1341
1342
  at: string;
1342
1343
  reason: string;
1344
+ blocking: boolean;
1343
1345
  mailing_id: string | null;
1344
1346
  sample: string;
1345
1347
  scope: "mailing" | "provider";
1346
- blocking: boolean;
1347
1348
  } | null;
1348
1349
  };
1349
1350
  from_name: string;
@@ -1382,10 +1383,10 @@ declare function createNamespaces(config: CoreConfig): {
1382
1383
  anomaly: {
1383
1384
  at: string;
1384
1385
  reason: string;
1386
+ blocking: boolean;
1385
1387
  mailing_id: string | null;
1386
1388
  sample: string;
1387
1389
  scope: "mailing" | "provider";
1388
- blocking: boolean;
1389
1390
  } | null;
1390
1391
  };
1391
1392
  from_name: string;
@@ -1411,10 +1412,10 @@ declare function createNamespaces(config: CoreConfig): {
1411
1412
  anomaly: {
1412
1413
  at: string;
1413
1414
  reason: string;
1415
+ blocking: boolean;
1414
1416
  mailing_id: string | null;
1415
1417
  sample: string;
1416
1418
  scope: "mailing" | "provider";
1417
- blocking: boolean;
1418
1419
  } | null;
1419
1420
  };
1420
1421
  from_name: string;
@@ -1453,10 +1454,10 @@ declare function createNamespaces(config: CoreConfig): {
1453
1454
  anomaly: {
1454
1455
  at: string;
1455
1456
  reason: string;
1457
+ blocking: boolean;
1456
1458
  mailing_id: string | null;
1457
1459
  sample: string;
1458
1460
  scope: "mailing" | "provider";
1459
- blocking: boolean;
1460
1461
  } | null;
1461
1462
  };
1462
1463
  from_name: string;
@@ -1482,10 +1483,10 @@ declare function createNamespaces(config: CoreConfig): {
1482
1483
  anomaly: {
1483
1484
  at: string;
1484
1485
  reason: string;
1486
+ blocking: boolean;
1485
1487
  mailing_id: string | null;
1486
1488
  sample: string;
1487
1489
  scope: "mailing" | "provider";
1488
- blocking: boolean;
1489
1490
  } | null;
1490
1491
  };
1491
1492
  from_name: string;
@@ -1538,10 +1539,10 @@ declare function createNamespaces(config: CoreConfig): {
1538
1539
  anomaly: {
1539
1540
  at: string;
1540
1541
  reason: string;
1542
+ blocking: boolean;
1541
1543
  mailing_id: string | null;
1542
1544
  sample: string;
1543
1545
  scope: "mailing" | "provider";
1544
- blocking: boolean;
1545
1546
  } | null;
1546
1547
  };
1547
1548
  from_name: string;
@@ -1567,10 +1568,10 @@ declare function createNamespaces(config: CoreConfig): {
1567
1568
  anomaly: {
1568
1569
  at: string;
1569
1570
  reason: string;
1571
+ blocking: boolean;
1570
1572
  mailing_id: string | null;
1571
1573
  sample: string;
1572
1574
  scope: "mailing" | "provider";
1573
- blocking: boolean;
1574
1575
  } | null;
1575
1576
  };
1576
1577
  from_name: string;
@@ -1610,10 +1611,10 @@ declare function createNamespaces(config: CoreConfig): {
1610
1611
  anomaly: {
1611
1612
  at: string;
1612
1613
  reason: string;
1614
+ blocking: boolean;
1613
1615
  mailing_id: string | null;
1614
1616
  sample: string;
1615
1617
  scope: "mailing" | "provider";
1616
- blocking: boolean;
1617
1618
  } | null;
1618
1619
  };
1619
1620
  from_name: string;
@@ -1639,10 +1640,10 @@ declare function createNamespaces(config: CoreConfig): {
1639
1640
  anomaly: {
1640
1641
  at: string;
1641
1642
  reason: string;
1643
+ blocking: boolean;
1642
1644
  mailing_id: string | null;
1643
1645
  sample: string;
1644
1646
  scope: "mailing" | "provider";
1645
- blocking: boolean;
1646
1647
  } | null;
1647
1648
  };
1648
1649
  from_name: string;
@@ -1764,6 +1765,10 @@ declare function createNamespaces(config: CoreConfig): {
1764
1765
  }>;
1765
1766
  messages: (id: string, query?: RouteQuery<"contacts.messages">, opts?: RequestOpts) => Promise<{
1766
1767
  data: {
1768
+ values: Record<string, {
1769
+ text: string;
1770
+ layer: "contact" | "recipient" | "mailing" | "workspace" | "fallback" | "empty";
1771
+ }> | null;
1767
1772
  id: string;
1768
1773
  error: string | null;
1769
1774
  subject: string;
@@ -1774,11 +1779,11 @@ declare function createNamespaces(config: CoreConfig): {
1774
1779
  }> | null;
1775
1780
  locale: string | null;
1776
1781
  created_at: string;
1782
+ contact_id: string | null;
1777
1783
  provider_id: string;
1778
1784
  to: string;
1779
1785
  provider_message_id: string | null;
1780
1786
  mailing_id: string | null;
1781
- contact_id: string | null;
1782
1787
  recipient_id: string | null;
1783
1788
  outcome: "sent" | "failed";
1784
1789
  is_test: boolean;
@@ -1793,13 +1798,13 @@ declare function createNamespaces(config: CoreConfig): {
1793
1798
  id: string;
1794
1799
  email: string;
1795
1800
  version: number;
1801
+ contact_id: string;
1796
1802
  automation: {
1797
1803
  status: "draft" | "archived" | "paused" | "active";
1798
1804
  id: string;
1799
1805
  name: string;
1800
1806
  };
1801
1807
  automation_id: string;
1802
- contact_id: string;
1803
1808
  last_error: string | null;
1804
1809
  external_id: string | null;
1805
1810
  current_step_id: string | null;
@@ -1843,6 +1848,7 @@ declare function createNamespaces(config: CoreConfig): {
1843
1848
  data: {
1844
1849
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
1845
1850
  id: string;
1851
+ merge: Record<string, string | number | boolean>;
1846
1852
  name: string | null;
1847
1853
  kind: "broadcast" | "automation" | "notification";
1848
1854
  template_id: string | null;
@@ -1889,6 +1895,7 @@ declare function createNamespaces(config: CoreConfig): {
1889
1895
  create: (body: RouteBody<"mailings.create">, opts?: RequestOpts) => Promise<{
1890
1896
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
1891
1897
  id: string;
1898
+ merge: Record<string, string | number | boolean>;
1892
1899
  name: string | null;
1893
1900
  kind: "broadcast" | "automation" | "notification";
1894
1901
  template_id: string | null;
@@ -1940,6 +1947,7 @@ declare function createNamespaces(config: CoreConfig): {
1940
1947
  get: (id: string, opts?: RequestOpts) => Promise<{
1941
1948
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
1942
1949
  id: string;
1950
+ merge: Record<string, string | number | boolean>;
1943
1951
  name: string | null;
1944
1952
  kind: "broadcast" | "automation" | "notification";
1945
1953
  template_id: string | null;
@@ -1993,6 +2001,7 @@ declare function createNamespaces(config: CoreConfig): {
1993
2001
  update: (id: string, body: RouteBody<"mailings.update">, opts?: RequestOpts) => Promise<{
1994
2002
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
1995
2003
  id: string;
2004
+ merge: Record<string, string | number | boolean>;
1996
2005
  name: string | null;
1997
2006
  kind: "broadcast" | "automation" | "notification";
1998
2007
  template_id: string | null;
@@ -2057,9 +2066,9 @@ declare function createNamespaces(config: CoreConfig): {
2057
2066
  merge: Record<string, _marlinjai_mail_contract.JsonValue>;
2058
2067
  created_at: string;
2059
2068
  updated_at: string;
2069
+ contact_id: string | null;
2060
2070
  message_id: string | null;
2061
2071
  mailing_id: string;
2062
- contact_id: string | null;
2063
2072
  skip_reason: "cancelled" | "suppressed" | "not_subscribed" | "contact_erased" | "outcome_unknown" | null;
2064
2073
  attempts: number;
2065
2074
  last_error: string | null;
@@ -2070,9 +2079,50 @@ declare function createNamespaces(config: CoreConfig): {
2070
2079
  message_id: string;
2071
2080
  provider_message_id: string | null;
2072
2081
  }>;
2082
+ /**
2083
+ * A dry run: what each given recipient would be sent (every value's text
2084
+ * and the layer it comes from, each insertion's choice, the problems
2085
+ * found), without adding anybody. Without recipients: a reader with
2086
+ * nothing of their own.
2087
+ */
2088
+ resolve: (id: string, body?: RouteBody<"mailings.resolve">, opts?: RequestOpts) => Promise<{
2089
+ recipients: {
2090
+ values: Record<string, {
2091
+ text: string;
2092
+ layer: "contact" | "recipient" | "mailing" | "workspace" | "fallback" | "empty";
2093
+ }>;
2094
+ email: string | null;
2095
+ subject: string;
2096
+ insertions: Record<string, {
2097
+ value: string | null;
2098
+ chosen: string;
2099
+ matched: boolean;
2100
+ }> | null;
2101
+ locale: string;
2102
+ index: number | null;
2103
+ contact_id: string | null;
2104
+ problems: {
2105
+ value: string;
2106
+ message: string;
2107
+ kind: "unfilled_link" | "empty_value" | "insertion_miss";
2108
+ severity: "note" | "blocking";
2109
+ }[];
2110
+ }[];
2111
+ blocking: {
2112
+ value: string;
2113
+ recipients: number;
2114
+ }[];
2115
+ rejected: {
2116
+ reason: "unknown_contact" | "duplicate_in_batch";
2117
+ index: number;
2118
+ }[];
2119
+ names: string[];
2120
+ link_values: string[];
2121
+ }>;
2073
2122
  send: (id: string, opts?: RequestOpts) => Promise<{
2074
2123
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2075
2124
  id: string;
2125
+ merge: Record<string, string | number | boolean>;
2076
2126
  name: string | null;
2077
2127
  kind: "broadcast" | "automation" | "notification";
2078
2128
  template_id: string | null;
@@ -2124,6 +2174,7 @@ declare function createNamespaces(config: CoreConfig): {
2124
2174
  pause: (id: string, opts?: RequestOpts) => Promise<{
2125
2175
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2126
2176
  id: string;
2177
+ merge: Record<string, string | number | boolean>;
2127
2178
  name: string | null;
2128
2179
  kind: "broadcast" | "automation" | "notification";
2129
2180
  template_id: string | null;
@@ -2175,6 +2226,7 @@ declare function createNamespaces(config: CoreConfig): {
2175
2226
  resume: (id: string, opts?: RequestOpts) => Promise<{
2176
2227
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2177
2228
  id: string;
2229
+ merge: Record<string, string | number | boolean>;
2178
2230
  name: string | null;
2179
2231
  kind: "broadcast" | "automation" | "notification";
2180
2232
  template_id: string | null;
@@ -2226,6 +2278,7 @@ declare function createNamespaces(config: CoreConfig): {
2226
2278
  cancel: (id: string, opts?: RequestOpts) => Promise<{
2227
2279
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2228
2280
  id: string;
2281
+ merge: Record<string, string | number | boolean>;
2229
2282
  name: string | null;
2230
2283
  kind: "broadcast" | "automation" | "notification";
2231
2284
  template_id: string | null;
@@ -2277,6 +2330,7 @@ declare function createNamespaces(config: CoreConfig): {
2277
2330
  retryFailed: (id: string, body?: RouteBody<"mailings.retryFailed">, opts?: RequestOpts) => Promise<{
2278
2331
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2279
2332
  id: string;
2333
+ merge: Record<string, string | number | boolean>;
2280
2334
  name: string | null;
2281
2335
  kind: "broadcast" | "automation" | "notification";
2282
2336
  template_id: string | null;
@@ -2328,6 +2382,7 @@ declare function createNamespaces(config: CoreConfig): {
2328
2382
  duplicate: (id: string, opts?: RequestOpts) => Promise<{
2329
2383
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2330
2384
  id: string;
2385
+ merge: Record<string, string | number | boolean>;
2331
2386
  name: string | null;
2332
2387
  kind: "broadcast" | "automation" | "notification";
2333
2388
  template_id: string | null;
@@ -2387,6 +2442,7 @@ declare function createNamespaces(config: CoreConfig): {
2387
2442
  schedule: (id: string, body: RouteBody<"mailings.schedule">, opts?: RequestOpts) => Promise<{
2388
2443
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2389
2444
  id: string;
2445
+ merge: Record<string, string | number | boolean>;
2390
2446
  name: string | null;
2391
2447
  kind: "broadcast" | "automation" | "notification";
2392
2448
  template_id: string | null;
@@ -2438,6 +2494,7 @@ declare function createNamespaces(config: CoreConfig): {
2438
2494
  unschedule: (id: string, opts?: RequestOpts) => Promise<{
2439
2495
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2440
2496
  id: string;
2497
+ merge: Record<string, string | number | boolean>;
2441
2498
  name: string | null;
2442
2499
  kind: "broadcast" | "automation" | "notification";
2443
2500
  template_id: string | null;
@@ -2489,6 +2546,7 @@ declare function createNamespaces(config: CoreConfig): {
2489
2546
  setAbTest: (id: string, body: RouteBody<"mailings.setAbTest">, opts?: RequestOpts) => Promise<{
2490
2547
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2491
2548
  id: string;
2549
+ merge: Record<string, string | number | boolean>;
2492
2550
  name: string | null;
2493
2551
  kind: "broadcast" | "automation" | "notification";
2494
2552
  template_id: string | null;
@@ -2540,6 +2598,7 @@ declare function createNamespaces(config: CoreConfig): {
2540
2598
  clearAbTest: (id: string, opts?: RequestOpts) => Promise<{
2541
2599
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2542
2600
  id: string;
2601
+ merge: Record<string, string | number | boolean>;
2543
2602
  name: string | null;
2544
2603
  kind: "broadcast" | "automation" | "notification";
2545
2604
  template_id: string | null;
@@ -2591,6 +2650,7 @@ declare function createNamespaces(config: CoreConfig): {
2591
2650
  pickAbWinner: (id: string, body: RouteBody<"mailings.pickAbWinner">, opts?: RequestOpts) => Promise<{
2592
2651
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2593
2652
  id: string;
2653
+ merge: Record<string, string | number | boolean>;
2594
2654
  name: string | null;
2595
2655
  kind: "broadcast" | "automation" | "notification";
2596
2656
  template_id: string | null;
@@ -2679,12 +2739,12 @@ declare function createNamespaces(config: CoreConfig): {
2679
2739
  sent: number;
2680
2740
  planned: number;
2681
2741
  }[];
2682
- send_locale: string | null;
2683
- main_locale: string;
2684
2742
  fallback: {
2685
2743
  planned: number;
2686
2744
  wanted: string;
2687
2745
  }[];
2746
+ send_locale: string | null;
2747
+ main_locale: string;
2688
2748
  no_language: number;
2689
2749
  insertion_misses: {
2690
2750
  value: string;
@@ -2697,6 +2757,10 @@ declare function createNamespaces(config: CoreConfig): {
2697
2757
  messages: {
2698
2758
  list: (query?: RouteQuery<"messages.list">, opts?: RequestOpts) => Promise<{
2699
2759
  data: {
2760
+ values: Record<string, {
2761
+ text: string;
2762
+ layer: "contact" | "recipient" | "mailing" | "workspace" | "fallback" | "empty";
2763
+ }> | null;
2700
2764
  id: string;
2701
2765
  error: string | null;
2702
2766
  subject: string;
@@ -2707,11 +2771,11 @@ declare function createNamespaces(config: CoreConfig): {
2707
2771
  }> | null;
2708
2772
  locale: string | null;
2709
2773
  created_at: string;
2774
+ contact_id: string | null;
2710
2775
  provider_id: string;
2711
2776
  to: string;
2712
2777
  provider_message_id: string | null;
2713
2778
  mailing_id: string | null;
2714
- contact_id: string | null;
2715
2779
  recipient_id: string | null;
2716
2780
  outcome: "sent" | "failed";
2717
2781
  is_test: boolean;
@@ -2720,6 +2784,10 @@ declare function createNamespaces(config: CoreConfig): {
2720
2784
  next_cursor: string | null;
2721
2785
  }>;
2722
2786
  get: (id: string, opts?: RequestOpts) => Promise<{
2787
+ values: Record<string, {
2788
+ text: string;
2789
+ layer: "contact" | "recipient" | "mailing" | "workspace" | "fallback" | "empty";
2790
+ }> | null;
2723
2791
  id: string;
2724
2792
  error: string | null;
2725
2793
  subject: string;
@@ -2731,11 +2799,11 @@ declare function createNamespaces(config: CoreConfig): {
2731
2799
  locale: string | null;
2732
2800
  created_at: string;
2733
2801
  html: string;
2802
+ contact_id: string | null;
2734
2803
  provider_id: string;
2735
2804
  to: string;
2736
2805
  provider_message_id: string | null;
2737
2806
  mailing_id: string | null;
2738
- contact_id: string | null;
2739
2807
  recipient_id: string | null;
2740
2808
  outcome: "sent" | "failed";
2741
2809
  is_test: boolean;
@@ -5083,7 +5151,7 @@ declare function createNamespaces(config: CoreConfig): {
5083
5151
  entered: number;
5084
5152
  refused: number;
5085
5153
  results: {
5086
- reason: "suppressed" | "not_subscribed" | "unknown_contact" | "already_inside" | "re_entry_off" | "in_cooldown" | "excluded" | "not_active" | null;
5154
+ reason: "unknown_contact" | "suppressed" | "not_subscribed" | "already_inside" | "re_entry_off" | "in_cooldown" | "excluded" | "not_active" | null;
5087
5155
  email: string | null;
5088
5156
  contact_id: string | null;
5089
5157
  external_id: string | null;
@@ -5101,8 +5169,8 @@ declare function createNamespaces(config: CoreConfig): {
5101
5169
  id: string;
5102
5170
  email: string;
5103
5171
  version: number;
5104
- automation_id: string;
5105
5172
  contact_id: string;
5173
+ automation_id: string;
5106
5174
  last_error: string | null;
5107
5175
  external_id: string | null;
5108
5176
  current_step_id: string | null;
@@ -5129,8 +5197,8 @@ declare function createNamespaces(config: CoreConfig): {
5129
5197
  id: string;
5130
5198
  email: string;
5131
5199
  version: number;
5132
- automation_id: string;
5133
5200
  contact_id: string;
5201
+ automation_id: string;
5134
5202
  last_error: string | null;
5135
5203
  external_id: string | null;
5136
5204
  current_step_id: string | null;
@@ -5146,8 +5214,8 @@ declare function createNamespaces(config: CoreConfig): {
5146
5214
  id: string;
5147
5215
  email: string;
5148
5216
  version: number;
5149
- automation_id: string;
5150
5217
  contact_id: string;
5218
+ automation_id: string;
5151
5219
  last_error: string | null;
5152
5220
  external_id: string | null;
5153
5221
  current_step_id: string | null;
package/dist/index.d.ts CHANGED
@@ -359,6 +359,7 @@ declare function createNamespaces(config: CoreConfig): {
359
359
  type: "member";
360
360
  subject: string;
361
361
  member_id: string;
362
+ app?: "booking" | undefined;
362
363
  } | {
363
364
  type: "api_key";
364
365
  api_key_id: string;
@@ -1238,10 +1239,10 @@ declare function createNamespaces(config: CoreConfig): {
1238
1239
  anomaly: {
1239
1240
  at: string;
1240
1241
  reason: string;
1242
+ blocking: boolean;
1241
1243
  mailing_id: string | null;
1242
1244
  sample: string;
1243
1245
  scope: "mailing" | "provider";
1244
- blocking: boolean;
1245
1246
  } | null;
1246
1247
  };
1247
1248
  from_name: string;
@@ -1267,10 +1268,10 @@ declare function createNamespaces(config: CoreConfig): {
1267
1268
  anomaly: {
1268
1269
  at: string;
1269
1270
  reason: string;
1271
+ blocking: boolean;
1270
1272
  mailing_id: string | null;
1271
1273
  sample: string;
1272
1274
  scope: "mailing" | "provider";
1273
- blocking: boolean;
1274
1275
  } | null;
1275
1276
  };
1276
1277
  from_name: string;
@@ -1311,10 +1312,10 @@ declare function createNamespaces(config: CoreConfig): {
1311
1312
  anomaly: {
1312
1313
  at: string;
1313
1314
  reason: string;
1315
+ blocking: boolean;
1314
1316
  mailing_id: string | null;
1315
1317
  sample: string;
1316
1318
  scope: "mailing" | "provider";
1317
- blocking: boolean;
1318
1319
  } | null;
1319
1320
  };
1320
1321
  from_name: string;
@@ -1340,10 +1341,10 @@ declare function createNamespaces(config: CoreConfig): {
1340
1341
  anomaly: {
1341
1342
  at: string;
1342
1343
  reason: string;
1344
+ blocking: boolean;
1343
1345
  mailing_id: string | null;
1344
1346
  sample: string;
1345
1347
  scope: "mailing" | "provider";
1346
- blocking: boolean;
1347
1348
  } | null;
1348
1349
  };
1349
1350
  from_name: string;
@@ -1382,10 +1383,10 @@ declare function createNamespaces(config: CoreConfig): {
1382
1383
  anomaly: {
1383
1384
  at: string;
1384
1385
  reason: string;
1386
+ blocking: boolean;
1385
1387
  mailing_id: string | null;
1386
1388
  sample: string;
1387
1389
  scope: "mailing" | "provider";
1388
- blocking: boolean;
1389
1390
  } | null;
1390
1391
  };
1391
1392
  from_name: string;
@@ -1411,10 +1412,10 @@ declare function createNamespaces(config: CoreConfig): {
1411
1412
  anomaly: {
1412
1413
  at: string;
1413
1414
  reason: string;
1415
+ blocking: boolean;
1414
1416
  mailing_id: string | null;
1415
1417
  sample: string;
1416
1418
  scope: "mailing" | "provider";
1417
- blocking: boolean;
1418
1419
  } | null;
1419
1420
  };
1420
1421
  from_name: string;
@@ -1453,10 +1454,10 @@ declare function createNamespaces(config: CoreConfig): {
1453
1454
  anomaly: {
1454
1455
  at: string;
1455
1456
  reason: string;
1457
+ blocking: boolean;
1456
1458
  mailing_id: string | null;
1457
1459
  sample: string;
1458
1460
  scope: "mailing" | "provider";
1459
- blocking: boolean;
1460
1461
  } | null;
1461
1462
  };
1462
1463
  from_name: string;
@@ -1482,10 +1483,10 @@ declare function createNamespaces(config: CoreConfig): {
1482
1483
  anomaly: {
1483
1484
  at: string;
1484
1485
  reason: string;
1486
+ blocking: boolean;
1485
1487
  mailing_id: string | null;
1486
1488
  sample: string;
1487
1489
  scope: "mailing" | "provider";
1488
- blocking: boolean;
1489
1490
  } | null;
1490
1491
  };
1491
1492
  from_name: string;
@@ -1538,10 +1539,10 @@ declare function createNamespaces(config: CoreConfig): {
1538
1539
  anomaly: {
1539
1540
  at: string;
1540
1541
  reason: string;
1542
+ blocking: boolean;
1541
1543
  mailing_id: string | null;
1542
1544
  sample: string;
1543
1545
  scope: "mailing" | "provider";
1544
- blocking: boolean;
1545
1546
  } | null;
1546
1547
  };
1547
1548
  from_name: string;
@@ -1567,10 +1568,10 @@ declare function createNamespaces(config: CoreConfig): {
1567
1568
  anomaly: {
1568
1569
  at: string;
1569
1570
  reason: string;
1571
+ blocking: boolean;
1570
1572
  mailing_id: string | null;
1571
1573
  sample: string;
1572
1574
  scope: "mailing" | "provider";
1573
- blocking: boolean;
1574
1575
  } | null;
1575
1576
  };
1576
1577
  from_name: string;
@@ -1610,10 +1611,10 @@ declare function createNamespaces(config: CoreConfig): {
1610
1611
  anomaly: {
1611
1612
  at: string;
1612
1613
  reason: string;
1614
+ blocking: boolean;
1613
1615
  mailing_id: string | null;
1614
1616
  sample: string;
1615
1617
  scope: "mailing" | "provider";
1616
- blocking: boolean;
1617
1618
  } | null;
1618
1619
  };
1619
1620
  from_name: string;
@@ -1639,10 +1640,10 @@ declare function createNamespaces(config: CoreConfig): {
1639
1640
  anomaly: {
1640
1641
  at: string;
1641
1642
  reason: string;
1643
+ blocking: boolean;
1642
1644
  mailing_id: string | null;
1643
1645
  sample: string;
1644
1646
  scope: "mailing" | "provider";
1645
- blocking: boolean;
1646
1647
  } | null;
1647
1648
  };
1648
1649
  from_name: string;
@@ -1764,6 +1765,10 @@ declare function createNamespaces(config: CoreConfig): {
1764
1765
  }>;
1765
1766
  messages: (id: string, query?: RouteQuery<"contacts.messages">, opts?: RequestOpts) => Promise<{
1766
1767
  data: {
1768
+ values: Record<string, {
1769
+ text: string;
1770
+ layer: "contact" | "recipient" | "mailing" | "workspace" | "fallback" | "empty";
1771
+ }> | null;
1767
1772
  id: string;
1768
1773
  error: string | null;
1769
1774
  subject: string;
@@ -1774,11 +1779,11 @@ declare function createNamespaces(config: CoreConfig): {
1774
1779
  }> | null;
1775
1780
  locale: string | null;
1776
1781
  created_at: string;
1782
+ contact_id: string | null;
1777
1783
  provider_id: string;
1778
1784
  to: string;
1779
1785
  provider_message_id: string | null;
1780
1786
  mailing_id: string | null;
1781
- contact_id: string | null;
1782
1787
  recipient_id: string | null;
1783
1788
  outcome: "sent" | "failed";
1784
1789
  is_test: boolean;
@@ -1793,13 +1798,13 @@ declare function createNamespaces(config: CoreConfig): {
1793
1798
  id: string;
1794
1799
  email: string;
1795
1800
  version: number;
1801
+ contact_id: string;
1796
1802
  automation: {
1797
1803
  status: "draft" | "archived" | "paused" | "active";
1798
1804
  id: string;
1799
1805
  name: string;
1800
1806
  };
1801
1807
  automation_id: string;
1802
- contact_id: string;
1803
1808
  last_error: string | null;
1804
1809
  external_id: string | null;
1805
1810
  current_step_id: string | null;
@@ -1843,6 +1848,7 @@ declare function createNamespaces(config: CoreConfig): {
1843
1848
  data: {
1844
1849
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
1845
1850
  id: string;
1851
+ merge: Record<string, string | number | boolean>;
1846
1852
  name: string | null;
1847
1853
  kind: "broadcast" | "automation" | "notification";
1848
1854
  template_id: string | null;
@@ -1889,6 +1895,7 @@ declare function createNamespaces(config: CoreConfig): {
1889
1895
  create: (body: RouteBody<"mailings.create">, opts?: RequestOpts) => Promise<{
1890
1896
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
1891
1897
  id: string;
1898
+ merge: Record<string, string | number | boolean>;
1892
1899
  name: string | null;
1893
1900
  kind: "broadcast" | "automation" | "notification";
1894
1901
  template_id: string | null;
@@ -1940,6 +1947,7 @@ declare function createNamespaces(config: CoreConfig): {
1940
1947
  get: (id: string, opts?: RequestOpts) => Promise<{
1941
1948
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
1942
1949
  id: string;
1950
+ merge: Record<string, string | number | boolean>;
1943
1951
  name: string | null;
1944
1952
  kind: "broadcast" | "automation" | "notification";
1945
1953
  template_id: string | null;
@@ -1993,6 +2001,7 @@ declare function createNamespaces(config: CoreConfig): {
1993
2001
  update: (id: string, body: RouteBody<"mailings.update">, opts?: RequestOpts) => Promise<{
1994
2002
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
1995
2003
  id: string;
2004
+ merge: Record<string, string | number | boolean>;
1996
2005
  name: string | null;
1997
2006
  kind: "broadcast" | "automation" | "notification";
1998
2007
  template_id: string | null;
@@ -2057,9 +2066,9 @@ declare function createNamespaces(config: CoreConfig): {
2057
2066
  merge: Record<string, _marlinjai_mail_contract.JsonValue>;
2058
2067
  created_at: string;
2059
2068
  updated_at: string;
2069
+ contact_id: string | null;
2060
2070
  message_id: string | null;
2061
2071
  mailing_id: string;
2062
- contact_id: string | null;
2063
2072
  skip_reason: "cancelled" | "suppressed" | "not_subscribed" | "contact_erased" | "outcome_unknown" | null;
2064
2073
  attempts: number;
2065
2074
  last_error: string | null;
@@ -2070,9 +2079,50 @@ declare function createNamespaces(config: CoreConfig): {
2070
2079
  message_id: string;
2071
2080
  provider_message_id: string | null;
2072
2081
  }>;
2082
+ /**
2083
+ * A dry run: what each given recipient would be sent (every value's text
2084
+ * and the layer it comes from, each insertion's choice, the problems
2085
+ * found), without adding anybody. Without recipients: a reader with
2086
+ * nothing of their own.
2087
+ */
2088
+ resolve: (id: string, body?: RouteBody<"mailings.resolve">, opts?: RequestOpts) => Promise<{
2089
+ recipients: {
2090
+ values: Record<string, {
2091
+ text: string;
2092
+ layer: "contact" | "recipient" | "mailing" | "workspace" | "fallback" | "empty";
2093
+ }>;
2094
+ email: string | null;
2095
+ subject: string;
2096
+ insertions: Record<string, {
2097
+ value: string | null;
2098
+ chosen: string;
2099
+ matched: boolean;
2100
+ }> | null;
2101
+ locale: string;
2102
+ index: number | null;
2103
+ contact_id: string | null;
2104
+ problems: {
2105
+ value: string;
2106
+ message: string;
2107
+ kind: "unfilled_link" | "empty_value" | "insertion_miss";
2108
+ severity: "note" | "blocking";
2109
+ }[];
2110
+ }[];
2111
+ blocking: {
2112
+ value: string;
2113
+ recipients: number;
2114
+ }[];
2115
+ rejected: {
2116
+ reason: "unknown_contact" | "duplicate_in_batch";
2117
+ index: number;
2118
+ }[];
2119
+ names: string[];
2120
+ link_values: string[];
2121
+ }>;
2073
2122
  send: (id: string, opts?: RequestOpts) => Promise<{
2074
2123
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2075
2124
  id: string;
2125
+ merge: Record<string, string | number | boolean>;
2076
2126
  name: string | null;
2077
2127
  kind: "broadcast" | "automation" | "notification";
2078
2128
  template_id: string | null;
@@ -2124,6 +2174,7 @@ declare function createNamespaces(config: CoreConfig): {
2124
2174
  pause: (id: string, opts?: RequestOpts) => Promise<{
2125
2175
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2126
2176
  id: string;
2177
+ merge: Record<string, string | number | boolean>;
2127
2178
  name: string | null;
2128
2179
  kind: "broadcast" | "automation" | "notification";
2129
2180
  template_id: string | null;
@@ -2175,6 +2226,7 @@ declare function createNamespaces(config: CoreConfig): {
2175
2226
  resume: (id: string, opts?: RequestOpts) => Promise<{
2176
2227
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2177
2228
  id: string;
2229
+ merge: Record<string, string | number | boolean>;
2178
2230
  name: string | null;
2179
2231
  kind: "broadcast" | "automation" | "notification";
2180
2232
  template_id: string | null;
@@ -2226,6 +2278,7 @@ declare function createNamespaces(config: CoreConfig): {
2226
2278
  cancel: (id: string, opts?: RequestOpts) => Promise<{
2227
2279
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2228
2280
  id: string;
2281
+ merge: Record<string, string | number | boolean>;
2229
2282
  name: string | null;
2230
2283
  kind: "broadcast" | "automation" | "notification";
2231
2284
  template_id: string | null;
@@ -2277,6 +2330,7 @@ declare function createNamespaces(config: CoreConfig): {
2277
2330
  retryFailed: (id: string, body?: RouteBody<"mailings.retryFailed">, opts?: RequestOpts) => Promise<{
2278
2331
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2279
2332
  id: string;
2333
+ merge: Record<string, string | number | boolean>;
2280
2334
  name: string | null;
2281
2335
  kind: "broadcast" | "automation" | "notification";
2282
2336
  template_id: string | null;
@@ -2328,6 +2382,7 @@ declare function createNamespaces(config: CoreConfig): {
2328
2382
  duplicate: (id: string, opts?: RequestOpts) => Promise<{
2329
2383
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2330
2384
  id: string;
2385
+ merge: Record<string, string | number | boolean>;
2331
2386
  name: string | null;
2332
2387
  kind: "broadcast" | "automation" | "notification";
2333
2388
  template_id: string | null;
@@ -2387,6 +2442,7 @@ declare function createNamespaces(config: CoreConfig): {
2387
2442
  schedule: (id: string, body: RouteBody<"mailings.schedule">, opts?: RequestOpts) => Promise<{
2388
2443
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2389
2444
  id: string;
2445
+ merge: Record<string, string | number | boolean>;
2390
2446
  name: string | null;
2391
2447
  kind: "broadcast" | "automation" | "notification";
2392
2448
  template_id: string | null;
@@ -2438,6 +2494,7 @@ declare function createNamespaces(config: CoreConfig): {
2438
2494
  unschedule: (id: string, opts?: RequestOpts) => Promise<{
2439
2495
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2440
2496
  id: string;
2497
+ merge: Record<string, string | number | boolean>;
2441
2498
  name: string | null;
2442
2499
  kind: "broadcast" | "automation" | "notification";
2443
2500
  template_id: string | null;
@@ -2489,6 +2546,7 @@ declare function createNamespaces(config: CoreConfig): {
2489
2546
  setAbTest: (id: string, body: RouteBody<"mailings.setAbTest">, opts?: RequestOpts) => Promise<{
2490
2547
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2491
2548
  id: string;
2549
+ merge: Record<string, string | number | boolean>;
2492
2550
  name: string | null;
2493
2551
  kind: "broadcast" | "automation" | "notification";
2494
2552
  template_id: string | null;
@@ -2540,6 +2598,7 @@ declare function createNamespaces(config: CoreConfig): {
2540
2598
  clearAbTest: (id: string, opts?: RequestOpts) => Promise<{
2541
2599
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2542
2600
  id: string;
2601
+ merge: Record<string, string | number | boolean>;
2543
2602
  name: string | null;
2544
2603
  kind: "broadcast" | "automation" | "notification";
2545
2604
  template_id: string | null;
@@ -2591,6 +2650,7 @@ declare function createNamespaces(config: CoreConfig): {
2591
2650
  pickAbWinner: (id: string, body: RouteBody<"mailings.pickAbWinner">, opts?: RequestOpts) => Promise<{
2592
2651
  status: "draft" | "scheduled" | "sending" | "paused" | "sent" | "partially_failed" | "cancelled";
2593
2652
  id: string;
2653
+ merge: Record<string, string | number | boolean>;
2594
2654
  name: string | null;
2595
2655
  kind: "broadcast" | "automation" | "notification";
2596
2656
  template_id: string | null;
@@ -2679,12 +2739,12 @@ declare function createNamespaces(config: CoreConfig): {
2679
2739
  sent: number;
2680
2740
  planned: number;
2681
2741
  }[];
2682
- send_locale: string | null;
2683
- main_locale: string;
2684
2742
  fallback: {
2685
2743
  planned: number;
2686
2744
  wanted: string;
2687
2745
  }[];
2746
+ send_locale: string | null;
2747
+ main_locale: string;
2688
2748
  no_language: number;
2689
2749
  insertion_misses: {
2690
2750
  value: string;
@@ -2697,6 +2757,10 @@ declare function createNamespaces(config: CoreConfig): {
2697
2757
  messages: {
2698
2758
  list: (query?: RouteQuery<"messages.list">, opts?: RequestOpts) => Promise<{
2699
2759
  data: {
2760
+ values: Record<string, {
2761
+ text: string;
2762
+ layer: "contact" | "recipient" | "mailing" | "workspace" | "fallback" | "empty";
2763
+ }> | null;
2700
2764
  id: string;
2701
2765
  error: string | null;
2702
2766
  subject: string;
@@ -2707,11 +2771,11 @@ declare function createNamespaces(config: CoreConfig): {
2707
2771
  }> | null;
2708
2772
  locale: string | null;
2709
2773
  created_at: string;
2774
+ contact_id: string | null;
2710
2775
  provider_id: string;
2711
2776
  to: string;
2712
2777
  provider_message_id: string | null;
2713
2778
  mailing_id: string | null;
2714
- contact_id: string | null;
2715
2779
  recipient_id: string | null;
2716
2780
  outcome: "sent" | "failed";
2717
2781
  is_test: boolean;
@@ -2720,6 +2784,10 @@ declare function createNamespaces(config: CoreConfig): {
2720
2784
  next_cursor: string | null;
2721
2785
  }>;
2722
2786
  get: (id: string, opts?: RequestOpts) => Promise<{
2787
+ values: Record<string, {
2788
+ text: string;
2789
+ layer: "contact" | "recipient" | "mailing" | "workspace" | "fallback" | "empty";
2790
+ }> | null;
2723
2791
  id: string;
2724
2792
  error: string | null;
2725
2793
  subject: string;
@@ -2731,11 +2799,11 @@ declare function createNamespaces(config: CoreConfig): {
2731
2799
  locale: string | null;
2732
2800
  created_at: string;
2733
2801
  html: string;
2802
+ contact_id: string | null;
2734
2803
  provider_id: string;
2735
2804
  to: string;
2736
2805
  provider_message_id: string | null;
2737
2806
  mailing_id: string | null;
2738
- contact_id: string | null;
2739
2807
  recipient_id: string | null;
2740
2808
  outcome: "sent" | "failed";
2741
2809
  is_test: boolean;
@@ -5083,7 +5151,7 @@ declare function createNamespaces(config: CoreConfig): {
5083
5151
  entered: number;
5084
5152
  refused: number;
5085
5153
  results: {
5086
- reason: "suppressed" | "not_subscribed" | "unknown_contact" | "already_inside" | "re_entry_off" | "in_cooldown" | "excluded" | "not_active" | null;
5154
+ reason: "unknown_contact" | "suppressed" | "not_subscribed" | "already_inside" | "re_entry_off" | "in_cooldown" | "excluded" | "not_active" | null;
5087
5155
  email: string | null;
5088
5156
  contact_id: string | null;
5089
5157
  external_id: string | null;
@@ -5101,8 +5169,8 @@ declare function createNamespaces(config: CoreConfig): {
5101
5169
  id: string;
5102
5170
  email: string;
5103
5171
  version: number;
5104
- automation_id: string;
5105
5172
  contact_id: string;
5173
+ automation_id: string;
5106
5174
  last_error: string | null;
5107
5175
  external_id: string | null;
5108
5176
  current_step_id: string | null;
@@ -5129,8 +5197,8 @@ declare function createNamespaces(config: CoreConfig): {
5129
5197
  id: string;
5130
5198
  email: string;
5131
5199
  version: number;
5132
- automation_id: string;
5133
5200
  contact_id: string;
5201
+ automation_id: string;
5134
5202
  last_error: string | null;
5135
5203
  external_id: string | null;
5136
5204
  current_step_id: string | null;
@@ -5146,8 +5214,8 @@ declare function createNamespaces(config: CoreConfig): {
5146
5214
  id: string;
5147
5215
  email: string;
5148
5216
  version: number;
5149
- automation_id: string;
5150
5217
  contact_id: string;
5218
+ automation_id: string;
5151
5219
  last_error: string | null;
5152
5220
  external_id: string | null;
5153
5221
  current_step_id: string | null;
package/dist/index.js CHANGED
@@ -559,6 +559,13 @@ function createNamespaces(config) {
559
559
  addRecipients: (id, body, opts) => execute(config, "mailings.addRecipients", { params: { id }, body }, opts),
560
560
  listRecipients: (id, query, opts) => execute(config, "mailings.listRecipients", { params: { id }, query }, opts),
561
561
  test: (id, body, opts) => execute(config, "mailings.test", { params: { id }, body }, opts),
562
+ /**
563
+ * A dry run: what each given recipient would be sent (every value's text
564
+ * and the layer it comes from, each insertion's choice, the problems
565
+ * found), without adding anybody. Without recipients: a reader with
566
+ * nothing of their own.
567
+ */
568
+ resolve: (id, body = {}, opts) => execute(config, "mailings.resolve", { params: { id }, body }, opts),
562
569
  send: (id, opts) => execute(config, "mailings.send", { params: { id }, body: {} }, opts),
563
570
  pause: (id, opts) => execute(config, "mailings.pause", { params: { id }, body: {} }, opts),
564
571
  resume: (id, opts) => execute(config, "mailings.resume", { params: { id }, body: {} }, opts),
package/dist/index.mjs CHANGED
@@ -543,6 +543,13 @@ function createNamespaces(config) {
543
543
  addRecipients: (id, body, opts) => execute(config, "mailings.addRecipients", { params: { id }, body }, opts),
544
544
  listRecipients: (id, query, opts) => execute(config, "mailings.listRecipients", { params: { id }, query }, opts),
545
545
  test: (id, body, opts) => execute(config, "mailings.test", { params: { id }, body }, opts),
546
+ /**
547
+ * A dry run: what each given recipient would be sent (every value's text
548
+ * and the layer it comes from, each insertion's choice, the problems
549
+ * found), without adding anybody. Without recipients: a reader with
550
+ * nothing of their own.
551
+ */
552
+ resolve: (id, body = {}, opts) => execute(config, "mailings.resolve", { params: { id }, body }, opts),
546
553
  send: (id, opts) => execute(config, "mailings.send", { params: { id }, body: {} }, opts),
547
554
  pause: (id, opts) => execute(config, "mailings.pause", { params: { id }, body: {} }, opts),
548
555
  resume: (id, opts) => execute(config, "mailings.resume", { params: { id }, body: {} }, opts),
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.10.0",
6
+ "version": "0.12.0",
7
7
  "description": "Typed client for the Lumitra Mail v1 API: Node and edge runtimes, retries with idempotency, cursor pagination, webhook verification",
8
8
  "license": "MIT",
9
9
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "LICENSE"
33
33
  ],
34
34
  "dependencies": {
35
- "@marlinjai/mail-contract": "^0.10.0"
35
+ "@marlinjai/mail-contract": "^0.12.0"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "zod": "^3.25.0"