@marlinjai/mail-sdk 0.3.0 → 0.4.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
@@ -354,7 +354,7 @@ declare function createNamespaces(config: CoreConfig): {
354
354
  id: string;
355
355
  details: Record<string, unknown>;
356
356
  created_at: string;
357
- action: "workspace.created" | "workspace.updated" | "workspace.company_changed" | "member.added" | "member.role_changed" | "member.removed" | "member.invited" | "invite.revoked" | "api_key.created" | "api_key.revoked" | "provider.created" | "provider.updated" | "provider.deleted" | "provider.events_registered" | "provider.events_secret_set" | "provider.bounces_halted" | "provider.anomaly_cleared" | "topic.created" | "topic.updated" | "template.created" | "template.updated" | "template.deleted" | "saved_section.created" | "saved_section.updated" | "saved_section.deleted" | "asset.uploaded" | "asset.imported" | "contact.erased" | "suppression.created" | "suppression.deleted" | "mailing.created" | "mailing.sent" | "mailing.paused" | "mailing.resumed" | "mailing.cancelled" | "mailing.retried" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.secret_rotated" | "webhook.redelivered" | "contact.unsubscribed" | "tag.created" | "tag.deleted" | "tag.assigned" | "tag.unassigned" | "contact_property.created" | "contact_property.deleted" | "segment.created" | "segment.updated" | "segment.deleted" | "signup_form.created" | "signup_form.updated" | "signup_form.deleted" | "contact.subscribed" | "import.created" | "import.mapped" | "import.committed" | "import.cancelled" | "import.finished" | "mailing.scheduled" | "mailing.unscheduled" | "mailing.schedule_failed" | "mailing.ab_test_updated" | "mailing.ab_winner_selected" | "tracking.updated" | "billing.checkout_started" | "billing.subscription_changed" | "billing.exemption_changed" | "automation.created" | "automation.updated" | "automation.published" | "automation.paused" | "automation.resumed" | "automation.archived" | "automation.deleted" | "automation.duplicated" | "automation.enrolled" | "automation.run_ended" | "event.recorded";
357
+ action: "workspace.created" | "workspace.updated" | "workspace.company_changed" | "member.added" | "member.role_changed" | "member.removed" | "member.invited" | "invite.revoked" | "api_key.created" | "api_key.revoked" | "provider.created" | "provider.updated" | "provider.deleted" | "provider.events_registered" | "provider.events_secret_set" | "provider.bounces_halted" | "provider.anomaly_cleared" | "topic.created" | "topic.updated" | "topic.deleted" | "template.created" | "template.updated" | "template.deleted" | "saved_section.created" | "saved_section.updated" | "saved_section.deleted" | "asset.uploaded" | "asset.imported" | "contact.erased" | "suppression.created" | "suppression.deleted" | "mailing.created" | "mailing.sent" | "mailing.paused" | "mailing.resumed" | "mailing.cancelled" | "mailing.retried" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.secret_rotated" | "webhook.redelivered" | "contact.unsubscribed" | "tag.created" | "tag.deleted" | "tag.assigned" | "tag.unassigned" | "contact_property.created" | "contact_property.deleted" | "segment.created" | "segment.updated" | "segment.deleted" | "signup_form.created" | "signup_form.updated" | "signup_form.deleted" | "contact.subscribed" | "import.created" | "import.mapped" | "import.committed" | "import.cancelled" | "import.finished" | "mailing.scheduled" | "mailing.unscheduled" | "mailing.schedule_failed" | "mailing.ab_test_updated" | "mailing.ab_winner_selected" | "tracking.updated" | "billing.checkout_started" | "billing.subscription_changed" | "billing.exemption_changed" | "automation.created" | "automation.updated" | "automation.published" | "automation.paused" | "automation.resumed" | "automation.archived" | "automation.deleted" | "automation.duplicated" | "automation.enrolled" | "automation.run_ended" | "event.recorded";
358
358
  actor: {
359
359
  type: "member";
360
360
  subject: string;
@@ -1150,6 +1150,10 @@ declare function createNamespaces(config: CoreConfig): {
1150
1150
  description: string | null;
1151
1151
  }>;
1152
1152
  }>;
1153
+ /** Refused with `conflict` while a mailing or an automation step still uses the topic. */
1154
+ delete: (id: string, opts?: RequestOpts) => Promise<{
1155
+ ok: true;
1156
+ }>;
1153
1157
  };
1154
1158
  contacts: {
1155
1159
  upsert: (body: RouteBody<"contacts.upsert">, opts?: RequestOpts) => Promise<{
@@ -1289,7 +1293,7 @@ declare function createNamespaces(config: CoreConfig): {
1289
1293
  subject: string;
1290
1294
  kind: "broadcast" | "automation" | "notification";
1291
1295
  preheader: string | null;
1292
- topic: string;
1296
+ topic: string | null;
1293
1297
  provider_id: string;
1294
1298
  counts: {
1295
1299
  sending: number;
@@ -1339,7 +1343,7 @@ declare function createNamespaces(config: CoreConfig): {
1339
1343
  subject: string;
1340
1344
  kind: "broadcast" | "automation" | "notification";
1341
1345
  preheader: string | null;
1342
- topic: string;
1346
+ topic: string | null;
1343
1347
  provider_id: string;
1344
1348
  counts: {
1345
1349
  sending: number;
@@ -1387,7 +1391,7 @@ declare function createNamespaces(config: CoreConfig): {
1387
1391
  subject: string;
1388
1392
  kind: "broadcast" | "automation" | "notification";
1389
1393
  preheader: string | null;
1390
- topic: string;
1394
+ topic: string | null;
1391
1395
  provider_id: string;
1392
1396
  counts: {
1393
1397
  sending: number;
@@ -1437,7 +1441,7 @@ declare function createNamespaces(config: CoreConfig): {
1437
1441
  subject: string;
1438
1442
  kind: "broadcast" | "automation" | "notification";
1439
1443
  preheader: string | null;
1440
- topic: string;
1444
+ topic: string | null;
1441
1445
  provider_id: string;
1442
1446
  counts: {
1443
1447
  sending: number;
@@ -1514,7 +1518,7 @@ declare function createNamespaces(config: CoreConfig): {
1514
1518
  subject: string;
1515
1519
  kind: "broadcast" | "automation" | "notification";
1516
1520
  preheader: string | null;
1517
- topic: string;
1521
+ topic: string | null;
1518
1522
  provider_id: string;
1519
1523
  counts: {
1520
1524
  sending: number;
@@ -1562,7 +1566,7 @@ declare function createNamespaces(config: CoreConfig): {
1562
1566
  subject: string;
1563
1567
  kind: "broadcast" | "automation" | "notification";
1564
1568
  preheader: string | null;
1565
- topic: string;
1569
+ topic: string | null;
1566
1570
  provider_id: string;
1567
1571
  counts: {
1568
1572
  sending: number;
@@ -1610,7 +1614,7 @@ declare function createNamespaces(config: CoreConfig): {
1610
1614
  subject: string;
1611
1615
  kind: "broadcast" | "automation" | "notification";
1612
1616
  preheader: string | null;
1613
- topic: string;
1617
+ topic: string | null;
1614
1618
  provider_id: string;
1615
1619
  counts: {
1616
1620
  sending: number;
@@ -1658,7 +1662,7 @@ declare function createNamespaces(config: CoreConfig): {
1658
1662
  subject: string;
1659
1663
  kind: "broadcast" | "automation" | "notification";
1660
1664
  preheader: string | null;
1661
- topic: string;
1665
+ topic: string | null;
1662
1666
  provider_id: string;
1663
1667
  counts: {
1664
1668
  sending: number;
@@ -1706,7 +1710,7 @@ declare function createNamespaces(config: CoreConfig): {
1706
1710
  subject: string;
1707
1711
  kind: "broadcast" | "automation" | "notification";
1708
1712
  preheader: string | null;
1709
- topic: string;
1713
+ topic: string | null;
1710
1714
  provider_id: string;
1711
1715
  counts: {
1712
1716
  sending: number;
@@ -1754,7 +1758,7 @@ declare function createNamespaces(config: CoreConfig): {
1754
1758
  subject: string;
1755
1759
  kind: "broadcast" | "automation" | "notification";
1756
1760
  preheader: string | null;
1757
- topic: string;
1761
+ topic: string | null;
1758
1762
  provider_id: string;
1759
1763
  counts: {
1760
1764
  sending: number;
@@ -1810,7 +1814,7 @@ declare function createNamespaces(config: CoreConfig): {
1810
1814
  subject: string;
1811
1815
  kind: "broadcast" | "automation" | "notification";
1812
1816
  preheader: string | null;
1813
- topic: string;
1817
+ topic: string | null;
1814
1818
  provider_id: string;
1815
1819
  counts: {
1816
1820
  sending: number;
@@ -1858,7 +1862,7 @@ declare function createNamespaces(config: CoreConfig): {
1858
1862
  subject: string;
1859
1863
  kind: "broadcast" | "automation" | "notification";
1860
1864
  preheader: string | null;
1861
- topic: string;
1865
+ topic: string | null;
1862
1866
  provider_id: string;
1863
1867
  counts: {
1864
1868
  sending: number;
@@ -1906,7 +1910,7 @@ declare function createNamespaces(config: CoreConfig): {
1906
1910
  subject: string;
1907
1911
  kind: "broadcast" | "automation" | "notification";
1908
1912
  preheader: string | null;
1909
- topic: string;
1913
+ topic: string | null;
1910
1914
  provider_id: string;
1911
1915
  counts: {
1912
1916
  sending: number;
@@ -1954,7 +1958,7 @@ declare function createNamespaces(config: CoreConfig): {
1954
1958
  subject: string;
1955
1959
  kind: "broadcast" | "automation" | "notification";
1956
1960
  preheader: string | null;
1957
- topic: string;
1961
+ topic: string | null;
1958
1962
  provider_id: string;
1959
1963
  counts: {
1960
1964
  sending: number;
@@ -2002,7 +2006,7 @@ declare function createNamespaces(config: CoreConfig): {
2002
2006
  subject: string;
2003
2007
  kind: "broadcast" | "automation" | "notification";
2004
2008
  preheader: string | null;
2005
- topic: string;
2009
+ topic: string | null;
2006
2010
  provider_id: string;
2007
2011
  counts: {
2008
2012
  sending: number;
package/dist/index.d.ts CHANGED
@@ -354,7 +354,7 @@ declare function createNamespaces(config: CoreConfig): {
354
354
  id: string;
355
355
  details: Record<string, unknown>;
356
356
  created_at: string;
357
- action: "workspace.created" | "workspace.updated" | "workspace.company_changed" | "member.added" | "member.role_changed" | "member.removed" | "member.invited" | "invite.revoked" | "api_key.created" | "api_key.revoked" | "provider.created" | "provider.updated" | "provider.deleted" | "provider.events_registered" | "provider.events_secret_set" | "provider.bounces_halted" | "provider.anomaly_cleared" | "topic.created" | "topic.updated" | "template.created" | "template.updated" | "template.deleted" | "saved_section.created" | "saved_section.updated" | "saved_section.deleted" | "asset.uploaded" | "asset.imported" | "contact.erased" | "suppression.created" | "suppression.deleted" | "mailing.created" | "mailing.sent" | "mailing.paused" | "mailing.resumed" | "mailing.cancelled" | "mailing.retried" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.secret_rotated" | "webhook.redelivered" | "contact.unsubscribed" | "tag.created" | "tag.deleted" | "tag.assigned" | "tag.unassigned" | "contact_property.created" | "contact_property.deleted" | "segment.created" | "segment.updated" | "segment.deleted" | "signup_form.created" | "signup_form.updated" | "signup_form.deleted" | "contact.subscribed" | "import.created" | "import.mapped" | "import.committed" | "import.cancelled" | "import.finished" | "mailing.scheduled" | "mailing.unscheduled" | "mailing.schedule_failed" | "mailing.ab_test_updated" | "mailing.ab_winner_selected" | "tracking.updated" | "billing.checkout_started" | "billing.subscription_changed" | "billing.exemption_changed" | "automation.created" | "automation.updated" | "automation.published" | "automation.paused" | "automation.resumed" | "automation.archived" | "automation.deleted" | "automation.duplicated" | "automation.enrolled" | "automation.run_ended" | "event.recorded";
357
+ action: "workspace.created" | "workspace.updated" | "workspace.company_changed" | "member.added" | "member.role_changed" | "member.removed" | "member.invited" | "invite.revoked" | "api_key.created" | "api_key.revoked" | "provider.created" | "provider.updated" | "provider.deleted" | "provider.events_registered" | "provider.events_secret_set" | "provider.bounces_halted" | "provider.anomaly_cleared" | "topic.created" | "topic.updated" | "topic.deleted" | "template.created" | "template.updated" | "template.deleted" | "saved_section.created" | "saved_section.updated" | "saved_section.deleted" | "asset.uploaded" | "asset.imported" | "contact.erased" | "suppression.created" | "suppression.deleted" | "mailing.created" | "mailing.sent" | "mailing.paused" | "mailing.resumed" | "mailing.cancelled" | "mailing.retried" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.secret_rotated" | "webhook.redelivered" | "contact.unsubscribed" | "tag.created" | "tag.deleted" | "tag.assigned" | "tag.unassigned" | "contact_property.created" | "contact_property.deleted" | "segment.created" | "segment.updated" | "segment.deleted" | "signup_form.created" | "signup_form.updated" | "signup_form.deleted" | "contact.subscribed" | "import.created" | "import.mapped" | "import.committed" | "import.cancelled" | "import.finished" | "mailing.scheduled" | "mailing.unscheduled" | "mailing.schedule_failed" | "mailing.ab_test_updated" | "mailing.ab_winner_selected" | "tracking.updated" | "billing.checkout_started" | "billing.subscription_changed" | "billing.exemption_changed" | "automation.created" | "automation.updated" | "automation.published" | "automation.paused" | "automation.resumed" | "automation.archived" | "automation.deleted" | "automation.duplicated" | "automation.enrolled" | "automation.run_ended" | "event.recorded";
358
358
  actor: {
359
359
  type: "member";
360
360
  subject: string;
@@ -1150,6 +1150,10 @@ declare function createNamespaces(config: CoreConfig): {
1150
1150
  description: string | null;
1151
1151
  }>;
1152
1152
  }>;
1153
+ /** Refused with `conflict` while a mailing or an automation step still uses the topic. */
1154
+ delete: (id: string, opts?: RequestOpts) => Promise<{
1155
+ ok: true;
1156
+ }>;
1153
1157
  };
1154
1158
  contacts: {
1155
1159
  upsert: (body: RouteBody<"contacts.upsert">, opts?: RequestOpts) => Promise<{
@@ -1289,7 +1293,7 @@ declare function createNamespaces(config: CoreConfig): {
1289
1293
  subject: string;
1290
1294
  kind: "broadcast" | "automation" | "notification";
1291
1295
  preheader: string | null;
1292
- topic: string;
1296
+ topic: string | null;
1293
1297
  provider_id: string;
1294
1298
  counts: {
1295
1299
  sending: number;
@@ -1339,7 +1343,7 @@ declare function createNamespaces(config: CoreConfig): {
1339
1343
  subject: string;
1340
1344
  kind: "broadcast" | "automation" | "notification";
1341
1345
  preheader: string | null;
1342
- topic: string;
1346
+ topic: string | null;
1343
1347
  provider_id: string;
1344
1348
  counts: {
1345
1349
  sending: number;
@@ -1387,7 +1391,7 @@ declare function createNamespaces(config: CoreConfig): {
1387
1391
  subject: string;
1388
1392
  kind: "broadcast" | "automation" | "notification";
1389
1393
  preheader: string | null;
1390
- topic: string;
1394
+ topic: string | null;
1391
1395
  provider_id: string;
1392
1396
  counts: {
1393
1397
  sending: number;
@@ -1437,7 +1441,7 @@ declare function createNamespaces(config: CoreConfig): {
1437
1441
  subject: string;
1438
1442
  kind: "broadcast" | "automation" | "notification";
1439
1443
  preheader: string | null;
1440
- topic: string;
1444
+ topic: string | null;
1441
1445
  provider_id: string;
1442
1446
  counts: {
1443
1447
  sending: number;
@@ -1514,7 +1518,7 @@ declare function createNamespaces(config: CoreConfig): {
1514
1518
  subject: string;
1515
1519
  kind: "broadcast" | "automation" | "notification";
1516
1520
  preheader: string | null;
1517
- topic: string;
1521
+ topic: string | null;
1518
1522
  provider_id: string;
1519
1523
  counts: {
1520
1524
  sending: number;
@@ -1562,7 +1566,7 @@ declare function createNamespaces(config: CoreConfig): {
1562
1566
  subject: string;
1563
1567
  kind: "broadcast" | "automation" | "notification";
1564
1568
  preheader: string | null;
1565
- topic: string;
1569
+ topic: string | null;
1566
1570
  provider_id: string;
1567
1571
  counts: {
1568
1572
  sending: number;
@@ -1610,7 +1614,7 @@ declare function createNamespaces(config: CoreConfig): {
1610
1614
  subject: string;
1611
1615
  kind: "broadcast" | "automation" | "notification";
1612
1616
  preheader: string | null;
1613
- topic: string;
1617
+ topic: string | null;
1614
1618
  provider_id: string;
1615
1619
  counts: {
1616
1620
  sending: number;
@@ -1658,7 +1662,7 @@ declare function createNamespaces(config: CoreConfig): {
1658
1662
  subject: string;
1659
1663
  kind: "broadcast" | "automation" | "notification";
1660
1664
  preheader: string | null;
1661
- topic: string;
1665
+ topic: string | null;
1662
1666
  provider_id: string;
1663
1667
  counts: {
1664
1668
  sending: number;
@@ -1706,7 +1710,7 @@ declare function createNamespaces(config: CoreConfig): {
1706
1710
  subject: string;
1707
1711
  kind: "broadcast" | "automation" | "notification";
1708
1712
  preheader: string | null;
1709
- topic: string;
1713
+ topic: string | null;
1710
1714
  provider_id: string;
1711
1715
  counts: {
1712
1716
  sending: number;
@@ -1754,7 +1758,7 @@ declare function createNamespaces(config: CoreConfig): {
1754
1758
  subject: string;
1755
1759
  kind: "broadcast" | "automation" | "notification";
1756
1760
  preheader: string | null;
1757
- topic: string;
1761
+ topic: string | null;
1758
1762
  provider_id: string;
1759
1763
  counts: {
1760
1764
  sending: number;
@@ -1810,7 +1814,7 @@ declare function createNamespaces(config: CoreConfig): {
1810
1814
  subject: string;
1811
1815
  kind: "broadcast" | "automation" | "notification";
1812
1816
  preheader: string | null;
1813
- topic: string;
1817
+ topic: string | null;
1814
1818
  provider_id: string;
1815
1819
  counts: {
1816
1820
  sending: number;
@@ -1858,7 +1862,7 @@ declare function createNamespaces(config: CoreConfig): {
1858
1862
  subject: string;
1859
1863
  kind: "broadcast" | "automation" | "notification";
1860
1864
  preheader: string | null;
1861
- topic: string;
1865
+ topic: string | null;
1862
1866
  provider_id: string;
1863
1867
  counts: {
1864
1868
  sending: number;
@@ -1906,7 +1910,7 @@ declare function createNamespaces(config: CoreConfig): {
1906
1910
  subject: string;
1907
1911
  kind: "broadcast" | "automation" | "notification";
1908
1912
  preheader: string | null;
1909
- topic: string;
1913
+ topic: string | null;
1910
1914
  provider_id: string;
1911
1915
  counts: {
1912
1916
  sending: number;
@@ -1954,7 +1958,7 @@ declare function createNamespaces(config: CoreConfig): {
1954
1958
  subject: string;
1955
1959
  kind: "broadcast" | "automation" | "notification";
1956
1960
  preheader: string | null;
1957
- topic: string;
1961
+ topic: string | null;
1958
1962
  provider_id: string;
1959
1963
  counts: {
1960
1964
  sending: number;
@@ -2002,7 +2006,7 @@ declare function createNamespaces(config: CoreConfig): {
2002
2006
  subject: string;
2003
2007
  kind: "broadcast" | "automation" | "notification";
2004
2008
  preheader: string | null;
2005
- topic: string;
2009
+ topic: string | null;
2006
2010
  provider_id: string;
2007
2011
  counts: {
2008
2012
  sending: number;
package/dist/index.js CHANGED
@@ -505,7 +505,9 @@ function createNamespaces(config) {
505
505
  topics: {
506
506
  list: (query, opts) => execute(config, "topics.list", { query }, opts),
507
507
  create: (body, opts) => execute(config, "topics.create", { body }, opts),
508
- update: (id, body, opts) => execute(config, "topics.update", { params: { id }, body }, opts)
508
+ update: (id, body, opts) => execute(config, "topics.update", { params: { id }, body }, opts),
509
+ /** Refused with `conflict` while a mailing or an automation step still uses the topic. */
510
+ delete: (id, opts) => execute(config, "topics.delete", { params: { id } }, opts)
509
511
  },
510
512
  contacts: {
511
513
  upsert: (body, opts) => execute(config, "contacts.upsert", { body }, opts),
package/dist/index.mjs CHANGED
@@ -489,7 +489,9 @@ function createNamespaces(config) {
489
489
  topics: {
490
490
  list: (query, opts) => execute(config, "topics.list", { query }, opts),
491
491
  create: (body, opts) => execute(config, "topics.create", { body }, opts),
492
- update: (id, body, opts) => execute(config, "topics.update", { params: { id }, body }, opts)
492
+ update: (id, body, opts) => execute(config, "topics.update", { params: { id }, body }, opts),
493
+ /** Refused with `conflict` while a mailing or an automation step still uses the topic. */
494
+ delete: (id, opts) => execute(config, "topics.delete", { params: { id } }, opts)
493
495
  },
494
496
  contacts: {
495
497
  upsert: (body, opts) => execute(config, "contacts.upsert", { body }, opts),
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.3.0",
6
+ "version": "0.4.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.3.0"
35
+ "@marlinjai/mail-contract": "^0.4.0"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "zod": "^3.25.0"