@marlinjai/mail-sdk 0.8.1 → 0.10.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/dist/index.d.mts CHANGED
@@ -746,7 +746,15 @@ declare function createNamespaces(config: CoreConfig): {
746
746
  created_at: string;
747
747
  updated_at: string;
748
748
  }>;
749
- delete: (id: string, opts?: RequestOpts) => Promise<{
749
+ /**
750
+ * Deletes the template and its history. Pass `base_version` with the
751
+ * request options, the version the person confirmed the deletion
752
+ * against, to delete only while the template is still at it: otherwise
753
+ * `conflict` (409) with `current_version`, and nothing is deleted. One
754
+ * options argument, so `delete(id, { onBehalfOf, signal })` works as it
755
+ * always has.
756
+ */
757
+ delete: (id: string, opts?: RequestOpts & RouteQuery<"templates.delete">) => Promise<{
750
758
  ok: true;
751
759
  }>;
752
760
  /**
@@ -1845,6 +1853,7 @@ declare function createNamespaces(config: CoreConfig): {
1845
1853
  created_at: string;
1846
1854
  updated_at: string;
1847
1855
  send_locale: string | null;
1856
+ template_locale: string | null;
1848
1857
  topic: string | null;
1849
1858
  provider_id: string;
1850
1859
  counts: {
@@ -1897,6 +1906,7 @@ declare function createNamespaces(config: CoreConfig): {
1897
1906
  created_at: string;
1898
1907
  updated_at: string;
1899
1908
  send_locale: string | null;
1909
+ template_locale: string | null;
1900
1910
  topic: string | null;
1901
1911
  provider_id: string;
1902
1912
  counts: {
@@ -1947,6 +1957,7 @@ declare function createNamespaces(config: CoreConfig): {
1947
1957
  created_at: string;
1948
1958
  updated_at: string;
1949
1959
  send_locale: string | null;
1960
+ template_locale: string | null;
1950
1961
  topic: string | null;
1951
1962
  provider_id: string;
1952
1963
  counts: {
@@ -1999,6 +2010,7 @@ declare function createNamespaces(config: CoreConfig): {
1999
2010
  created_at: string;
2000
2011
  updated_at: string;
2001
2012
  send_locale: string | null;
2013
+ template_locale: string | null;
2002
2014
  topic: string | null;
2003
2015
  provider_id: string;
2004
2016
  counts: {
@@ -2078,6 +2090,7 @@ declare function createNamespaces(config: CoreConfig): {
2078
2090
  created_at: string;
2079
2091
  updated_at: string;
2080
2092
  send_locale: string | null;
2093
+ template_locale: string | null;
2081
2094
  topic: string | null;
2082
2095
  provider_id: string;
2083
2096
  counts: {
@@ -2128,6 +2141,7 @@ declare function createNamespaces(config: CoreConfig): {
2128
2141
  created_at: string;
2129
2142
  updated_at: string;
2130
2143
  send_locale: string | null;
2144
+ template_locale: string | null;
2131
2145
  topic: string | null;
2132
2146
  provider_id: string;
2133
2147
  counts: {
@@ -2178,6 +2192,7 @@ declare function createNamespaces(config: CoreConfig): {
2178
2192
  created_at: string;
2179
2193
  updated_at: string;
2180
2194
  send_locale: string | null;
2195
+ template_locale: string | null;
2181
2196
  topic: string | null;
2182
2197
  provider_id: string;
2183
2198
  counts: {
@@ -2228,6 +2243,7 @@ declare function createNamespaces(config: CoreConfig): {
2228
2243
  created_at: string;
2229
2244
  updated_at: string;
2230
2245
  send_locale: string | null;
2246
+ template_locale: string | null;
2231
2247
  topic: string | null;
2232
2248
  provider_id: string;
2233
2249
  counts: {
@@ -2278,6 +2294,7 @@ declare function createNamespaces(config: CoreConfig): {
2278
2294
  created_at: string;
2279
2295
  updated_at: string;
2280
2296
  send_locale: string | null;
2297
+ template_locale: string | null;
2281
2298
  topic: string | null;
2282
2299
  provider_id: string;
2283
2300
  counts: {
@@ -2328,6 +2345,7 @@ declare function createNamespaces(config: CoreConfig): {
2328
2345
  created_at: string;
2329
2346
  updated_at: string;
2330
2347
  send_locale: string | null;
2348
+ template_locale: string | null;
2331
2349
  topic: string | null;
2332
2350
  provider_id: string;
2333
2351
  counts: {
@@ -2386,6 +2404,7 @@ declare function createNamespaces(config: CoreConfig): {
2386
2404
  created_at: string;
2387
2405
  updated_at: string;
2388
2406
  send_locale: string | null;
2407
+ template_locale: string | null;
2389
2408
  topic: string | null;
2390
2409
  provider_id: string;
2391
2410
  counts: {
@@ -2436,6 +2455,7 @@ declare function createNamespaces(config: CoreConfig): {
2436
2455
  created_at: string;
2437
2456
  updated_at: string;
2438
2457
  send_locale: string | null;
2458
+ template_locale: string | null;
2439
2459
  topic: string | null;
2440
2460
  provider_id: string;
2441
2461
  counts: {
@@ -2486,6 +2506,7 @@ declare function createNamespaces(config: CoreConfig): {
2486
2506
  created_at: string;
2487
2507
  updated_at: string;
2488
2508
  send_locale: string | null;
2509
+ template_locale: string | null;
2489
2510
  topic: string | null;
2490
2511
  provider_id: string;
2491
2512
  counts: {
@@ -2536,6 +2557,7 @@ declare function createNamespaces(config: CoreConfig): {
2536
2557
  created_at: string;
2537
2558
  updated_at: string;
2538
2559
  send_locale: string | null;
2560
+ template_locale: string | null;
2539
2561
  topic: string | null;
2540
2562
  provider_id: string;
2541
2563
  counts: {
@@ -2586,6 +2608,7 @@ declare function createNamespaces(config: CoreConfig): {
2586
2608
  created_at: string;
2587
2609
  updated_at: string;
2588
2610
  send_locale: string | null;
2611
+ template_locale: string | null;
2589
2612
  topic: string | null;
2590
2613
  provider_id: string;
2591
2614
  counts: {
package/dist/index.d.ts CHANGED
@@ -746,7 +746,15 @@ declare function createNamespaces(config: CoreConfig): {
746
746
  created_at: string;
747
747
  updated_at: string;
748
748
  }>;
749
- delete: (id: string, opts?: RequestOpts) => Promise<{
749
+ /**
750
+ * Deletes the template and its history. Pass `base_version` with the
751
+ * request options, the version the person confirmed the deletion
752
+ * against, to delete only while the template is still at it: otherwise
753
+ * `conflict` (409) with `current_version`, and nothing is deleted. One
754
+ * options argument, so `delete(id, { onBehalfOf, signal })` works as it
755
+ * always has.
756
+ */
757
+ delete: (id: string, opts?: RequestOpts & RouteQuery<"templates.delete">) => Promise<{
750
758
  ok: true;
751
759
  }>;
752
760
  /**
@@ -1845,6 +1853,7 @@ declare function createNamespaces(config: CoreConfig): {
1845
1853
  created_at: string;
1846
1854
  updated_at: string;
1847
1855
  send_locale: string | null;
1856
+ template_locale: string | null;
1848
1857
  topic: string | null;
1849
1858
  provider_id: string;
1850
1859
  counts: {
@@ -1897,6 +1906,7 @@ declare function createNamespaces(config: CoreConfig): {
1897
1906
  created_at: string;
1898
1907
  updated_at: string;
1899
1908
  send_locale: string | null;
1909
+ template_locale: string | null;
1900
1910
  topic: string | null;
1901
1911
  provider_id: string;
1902
1912
  counts: {
@@ -1947,6 +1957,7 @@ declare function createNamespaces(config: CoreConfig): {
1947
1957
  created_at: string;
1948
1958
  updated_at: string;
1949
1959
  send_locale: string | null;
1960
+ template_locale: string | null;
1950
1961
  topic: string | null;
1951
1962
  provider_id: string;
1952
1963
  counts: {
@@ -1999,6 +2010,7 @@ declare function createNamespaces(config: CoreConfig): {
1999
2010
  created_at: string;
2000
2011
  updated_at: string;
2001
2012
  send_locale: string | null;
2013
+ template_locale: string | null;
2002
2014
  topic: string | null;
2003
2015
  provider_id: string;
2004
2016
  counts: {
@@ -2078,6 +2090,7 @@ declare function createNamespaces(config: CoreConfig): {
2078
2090
  created_at: string;
2079
2091
  updated_at: string;
2080
2092
  send_locale: string | null;
2093
+ template_locale: string | null;
2081
2094
  topic: string | null;
2082
2095
  provider_id: string;
2083
2096
  counts: {
@@ -2128,6 +2141,7 @@ declare function createNamespaces(config: CoreConfig): {
2128
2141
  created_at: string;
2129
2142
  updated_at: string;
2130
2143
  send_locale: string | null;
2144
+ template_locale: string | null;
2131
2145
  topic: string | null;
2132
2146
  provider_id: string;
2133
2147
  counts: {
@@ -2178,6 +2192,7 @@ declare function createNamespaces(config: CoreConfig): {
2178
2192
  created_at: string;
2179
2193
  updated_at: string;
2180
2194
  send_locale: string | null;
2195
+ template_locale: string | null;
2181
2196
  topic: string | null;
2182
2197
  provider_id: string;
2183
2198
  counts: {
@@ -2228,6 +2243,7 @@ declare function createNamespaces(config: CoreConfig): {
2228
2243
  created_at: string;
2229
2244
  updated_at: string;
2230
2245
  send_locale: string | null;
2246
+ template_locale: string | null;
2231
2247
  topic: string | null;
2232
2248
  provider_id: string;
2233
2249
  counts: {
@@ -2278,6 +2294,7 @@ declare function createNamespaces(config: CoreConfig): {
2278
2294
  created_at: string;
2279
2295
  updated_at: string;
2280
2296
  send_locale: string | null;
2297
+ template_locale: string | null;
2281
2298
  topic: string | null;
2282
2299
  provider_id: string;
2283
2300
  counts: {
@@ -2328,6 +2345,7 @@ declare function createNamespaces(config: CoreConfig): {
2328
2345
  created_at: string;
2329
2346
  updated_at: string;
2330
2347
  send_locale: string | null;
2348
+ template_locale: string | null;
2331
2349
  topic: string | null;
2332
2350
  provider_id: string;
2333
2351
  counts: {
@@ -2386,6 +2404,7 @@ declare function createNamespaces(config: CoreConfig): {
2386
2404
  created_at: string;
2387
2405
  updated_at: string;
2388
2406
  send_locale: string | null;
2407
+ template_locale: string | null;
2389
2408
  topic: string | null;
2390
2409
  provider_id: string;
2391
2410
  counts: {
@@ -2436,6 +2455,7 @@ declare function createNamespaces(config: CoreConfig): {
2436
2455
  created_at: string;
2437
2456
  updated_at: string;
2438
2457
  send_locale: string | null;
2458
+ template_locale: string | null;
2439
2459
  topic: string | null;
2440
2460
  provider_id: string;
2441
2461
  counts: {
@@ -2486,6 +2506,7 @@ declare function createNamespaces(config: CoreConfig): {
2486
2506
  created_at: string;
2487
2507
  updated_at: string;
2488
2508
  send_locale: string | null;
2509
+ template_locale: string | null;
2489
2510
  topic: string | null;
2490
2511
  provider_id: string;
2491
2512
  counts: {
@@ -2536,6 +2557,7 @@ declare function createNamespaces(config: CoreConfig): {
2536
2557
  created_at: string;
2537
2558
  updated_at: string;
2538
2559
  send_locale: string | null;
2560
+ template_locale: string | null;
2539
2561
  topic: string | null;
2540
2562
  provider_id: string;
2541
2563
  counts: {
@@ -2586,6 +2608,7 @@ declare function createNamespaces(config: CoreConfig): {
2586
2608
  created_at: string;
2587
2609
  updated_at: string;
2588
2610
  send_locale: string | null;
2611
+ template_locale: string | null;
2589
2612
  topic: string | null;
2590
2613
  provider_id: string;
2591
2614
  counts: {
package/dist/index.js CHANGED
@@ -440,7 +440,23 @@ function createNamespaces(config) {
440
440
  create: (body, opts) => execute(config, "templates.create", { body }, opts),
441
441
  get: (id, opts) => execute(config, "templates.get", { params: { id } }, opts),
442
442
  update: (id, body, opts) => execute(config, "templates.update", { params: { id }, body }, opts),
443
- delete: (id, opts) => execute(config, "templates.delete", { params: { id } }, opts),
443
+ /**
444
+ * Deletes the template and its history. Pass `base_version` with the
445
+ * request options, the version the person confirmed the deletion
446
+ * against, to delete only while the template is still at it: otherwise
447
+ * `conflict` (409) with `current_version`, and nothing is deleted. One
448
+ * options argument, so `delete(id, { onBehalfOf, signal })` works as it
449
+ * always has.
450
+ */
451
+ delete: (id, opts = {}) => {
452
+ const { base_version, ...requestOpts } = opts;
453
+ return execute(
454
+ config,
455
+ "templates.delete",
456
+ { params: { id }, query: base_version === void 0 ? void 0 : { base_version } },
457
+ requestOpts
458
+ );
459
+ },
444
460
  /**
445
461
  * Declares what the template receives from your app: each merge value's
446
462
  * label, where it comes from, its kind and an example. Replaces the
package/dist/index.mjs CHANGED
@@ -424,7 +424,23 @@ function createNamespaces(config) {
424
424
  create: (body, opts) => execute(config, "templates.create", { body }, opts),
425
425
  get: (id, opts) => execute(config, "templates.get", { params: { id } }, opts),
426
426
  update: (id, body, opts) => execute(config, "templates.update", { params: { id }, body }, opts),
427
- delete: (id, opts) => execute(config, "templates.delete", { params: { id } }, opts),
427
+ /**
428
+ * Deletes the template and its history. Pass `base_version` with the
429
+ * request options, the version the person confirmed the deletion
430
+ * against, to delete only while the template is still at it: otherwise
431
+ * `conflict` (409) with `current_version`, and nothing is deleted. One
432
+ * options argument, so `delete(id, { onBehalfOf, signal })` works as it
433
+ * always has.
434
+ */
435
+ delete: (id, opts = {}) => {
436
+ const { base_version, ...requestOpts } = opts;
437
+ return execute(
438
+ config,
439
+ "templates.delete",
440
+ { params: { id }, query: base_version === void 0 ? void 0 : { base_version } },
441
+ requestOpts
442
+ );
443
+ },
428
444
  /**
429
445
  * Declares what the template receives from your app: each merge value's
430
446
  * label, where it comes from, its kind and an example. Replaces the
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.8.1",
6
+ "version": "0.10.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.8.1"
35
+ "@marlinjai/mail-contract": "^0.10.0"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "zod": "^3.25.0"