@marlinjai/mail-sdk 0.8.0 → 0.9.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
  /**
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
  /**
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.0",
6
+ "version": "0.9.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.0"
35
+ "@marlinjai/mail-contract": "^0.9.0"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "zod": "^3.25.0"