samva 0.1.1 → 0.2.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.
Files changed (35) hide show
  1. package/dist/client/sdk.gen.d.ts +120 -184
  2. package/dist/client/types.gen.d.ts +811 -418
  3. package/dist/{client-DVALvDUe.js → client-BqkU-sFv.js} +937 -576
  4. package/dist/effect/api-keys.js +1 -1
  5. package/dist/effect/campaigns.d.ts +98 -7
  6. package/dist/effect/campaigns.js +1 -1
  7. package/dist/effect/client.js +1 -1
  8. package/dist/effect/contacts.d.ts +16 -94
  9. package/dist/effect/contacts.js +1 -1
  10. package/dist/effect/conversations.d.ts +65 -50
  11. package/dist/effect/conversations.js +1 -1
  12. package/dist/effect/design.js +1 -1
  13. package/dist/effect/email.d.ts +107 -67
  14. package/dist/effect/email.js +20 -18
  15. package/dist/effect/generated.d.ts +11823 -11603
  16. package/dist/effect/index.js +1 -1
  17. package/dist/effect/messages.js +1 -1
  18. package/dist/effect/operations.d.ts +3 -3
  19. package/dist/effect/operations.js +1 -1
  20. package/dist/effect/organizations.d.ts +1 -1
  21. package/dist/effect/organizations.js +1 -1
  22. package/dist/effect/scheduled-messages.d.ts +0 -48
  23. package/dist/effect/scheduled-messages.js +1 -1
  24. package/dist/effect/templates.d.ts +262 -1018
  25. package/dist/effect/templates.js +26 -18
  26. package/dist/effect/webhooks.d.ts +6 -6
  27. package/dist/effect/webhooks.js +2 -2
  28. package/dist/index.js +1 -1
  29. package/dist/{operation-UtKNITtG.js → operation-Ccqh_yxb.js} +48 -25
  30. package/dist/promises/index.d.ts +3 -1
  31. package/dist/promises/index.js +1 -1
  32. package/dist/promises/types.gen.d.ts +1 -1
  33. package/dist/{promises-QxEfMTho.js → promises-Dgv8UmCC.js} +319 -153
  34. package/dist/service-map.d.ts +66 -40
  35. package/package.json +4 -4
@@ -1550,64 +1550,36 @@ var Email = class {
1550
1550
  });
1551
1551
  }
1552
1552
  /**
1553
- * Provision a sending domain
1553
+ * Get domain verification
1554
1554
  *
1555
- * Accepts durable provisioning for a sending domain. Repeating an identical request with the same Idempotency-Key returns the same organization-scoped operation.
1555
+ * Returns the stored DNS and provider lifecycle snapshot without calling a provider or mutating state.
1556
1556
  */
1557
- static provisionDomain(parameters, options) {
1558
- const params = buildClientParams([parameters], [{ args: [{
1559
- in: "headers",
1560
- key: "idempotency-key"
1561
- }, {
1562
- in: "body",
1563
- key: "domain"
1564
- }] }]);
1565
- return (options?.client ?? client).post({
1566
- security: [{
1567
- name: "x-api-key",
1568
- type: "apiKey"
1569
- }],
1570
- url: "/v1/email/domain-operations",
1571
- ...options,
1572
- ...params,
1573
- headers: {
1574
- "Content-Type": "application/json",
1575
- ...options?.headers,
1576
- ...params.headers
1577
- }
1578
- });
1579
- }
1580
- /**
1581
- * Verify a sending domain
1582
- *
1583
- * Initiates verification of a sending domain with the email provider and stores the DNS records needed to complete it.
1584
- */
1585
- static verifyDomain(parameters, options) {
1557
+ static getDomainVerification(parameters, options) {
1586
1558
  const params = buildClientParams([parameters], [{ args: [{
1587
1559
  in: "path",
1588
1560
  key: "id"
1589
1561
  }] }]);
1590
- return (options?.client ?? client).post({
1562
+ return (options?.client ?? client).get({
1591
1563
  security: [{
1592
1564
  name: "x-api-key",
1593
1565
  type: "apiKey"
1594
1566
  }],
1595
- url: "/v1/email/domains/{id}/verify",
1567
+ url: "/v1/email/domains/{id}/verification",
1596
1568
  ...options,
1597
1569
  ...params
1598
1570
  });
1599
1571
  }
1600
1572
  /**
1601
- * Check domain verification status
1573
+ * Advance domain verification
1602
1574
  *
1603
- * Re-checks a sending domain's verification live with the email provider and updates the stored status once it is verified.
1575
+ * Observes the required DNS records and, once they match, idempotently starts provider provisioning for the staged domain.
1604
1576
  */
1605
- static checkDomainVerification(parameters, options) {
1577
+ static advanceDomainVerification(parameters, options) {
1606
1578
  const params = buildClientParams([parameters], [{ args: [{
1607
1579
  in: "path",
1608
1580
  key: "id"
1609
1581
  }] }]);
1610
- return (options?.client ?? client).get({
1582
+ return (options?.client ?? client).post({
1611
1583
  security: [{
1612
1584
  name: "x-api-key",
1613
1585
  type: "apiKey"
@@ -1694,6 +1666,9 @@ var Email = class {
1694
1666
  const params = buildClientParams([parameters], [{ args: [{
1695
1667
  in: "path",
1696
1668
  key: "id"
1669
+ }, {
1670
+ in: "query",
1671
+ key: "mode"
1697
1672
  }] }]);
1698
1673
  return (options?.client ?? client).get({
1699
1674
  security: [{
@@ -1708,7 +1683,7 @@ var Email = class {
1708
1683
  /**
1709
1684
  * Build a one-click DNS apply URL
1710
1685
  *
1711
- * Builds the signed Domain Connect apply URL that sends the customer to their DNS provider to apply Samva's sending records in one click. Pass inbound to also request the receiving MX records.
1686
+ * Builds the signed Domain Connect apply URL for the selected sending-only or sending-and-receiving service. Manual DNS remains available for either mode.
1712
1687
  */
1713
1688
  static buildDomainConnectApplyUrl(parameters, options) {
1714
1689
  const params = buildClientParams([parameters], [{ args: [{
@@ -1716,7 +1691,7 @@ var Email = class {
1716
1691
  key: "id"
1717
1692
  }, {
1718
1693
  in: "body",
1719
- key: "inbound"
1694
+ key: "mode"
1720
1695
  }] }]);
1721
1696
  return (options?.client ?? client).post({
1722
1697
  security: [{
@@ -1812,26 +1787,6 @@ var Email = class {
1812
1787
  });
1813
1788
  }
1814
1789
  /**
1815
- * Get sending domain status
1816
- *
1817
- * Returns the stored verification status of a sending domain without contacting the email provider.
1818
- */
1819
- static getDomainStatus(parameters, options) {
1820
- const params = buildClientParams([parameters], [{ args: [{
1821
- in: "path",
1822
- key: "id"
1823
- }] }]);
1824
- return (options?.client ?? client).get({
1825
- security: [{
1826
- name: "x-api-key",
1827
- type: "apiKey"
1828
- }],
1829
- url: "/v1/email/domains/{id}/status",
1830
- ...options,
1831
- ...params
1832
- });
1833
- }
1834
- /**
1835
1790
  * Set the default sending domain
1836
1791
  *
1837
1792
  * Marks a verified domain as the organization's default sending domain, atomically clearing any previous default. Omitted-`from` sends resolve through the default domain's default sender.
@@ -1947,11 +1902,11 @@ var Email = class {
1947
1902
  });
1948
1903
  }
1949
1904
  /**
1950
- * Disable a branded tracking domain
1905
+ * Disable a custom tracking domain
1951
1906
  *
1952
- * Tears down a domain's branded tracking and its managed resources. Sends immediately revert to the shared tracking host. Existing branded links in already-delivered mail stop working.
1907
+ * Tears down a domain's custom tracking and its managed resources. Sends immediately revert to the shared tracking host. Existing custom links in already-delivered mail stop working.
1953
1908
  */
1954
- static disableBrandedTracking(parameters, options) {
1909
+ static disableCustomTracking(parameters, options) {
1955
1910
  const params = buildClientParams([parameters], [{ args: [{
1956
1911
  in: "path",
1957
1912
  key: "id"
@@ -1961,17 +1916,17 @@ var Email = class {
1961
1916
  name: "x-api-key",
1962
1917
  type: "apiKey"
1963
1918
  }],
1964
- url: "/v1/email/domains/{id}/branded-tracking",
1919
+ url: "/v1/email/domains/{id}/custom-tracking",
1965
1920
  ...options,
1966
1921
  ...params
1967
1922
  });
1968
1923
  }
1969
1924
  /**
1970
- * Get branded tracking status
1925
+ * Get custom tracking status
1971
1926
  *
1972
- * Returns the branded tracking state for a sending domain: lifecycle status, the required DNS records, certificate and CAA readiness, and any scheduled teardown. `enabled` is false when no branded tracking domain is provisioned.
1927
+ * Returns the custom tracking state for a sending domain: lifecycle status, the required DNS records, certificate and CAA readiness, and any scheduled teardown. `enabled` is false when no custom tracking domain is provisioned.
1973
1928
  */
1974
- static getBrandedTracking(parameters, options) {
1929
+ static getCustomTracking(parameters, options) {
1975
1930
  const params = buildClientParams([parameters], [{ args: [{
1976
1931
  in: "path",
1977
1932
  key: "id"
@@ -1981,17 +1936,17 @@ var Email = class {
1981
1936
  name: "x-api-key",
1982
1937
  type: "apiKey"
1983
1938
  }],
1984
- url: "/v1/email/domains/{id}/branded-tracking",
1939
+ url: "/v1/email/domains/{id}/custom-tracking",
1985
1940
  ...options,
1986
1941
  ...params
1987
1942
  });
1988
1943
  }
1989
1944
  /**
1990
- * Enable a branded tracking domain
1945
+ * Enable a custom tracking domain
1991
1946
  *
1992
- * Provisions a branded tracking domain (default label `track`) for a verified sending domain so open/click links redirect through the customer's own subdomain. Requires the branded_tracking entitlement. Returns the resulting state including the two DNS records the customer must create.
1947
+ * Provisions a custom tracking domain (default label `track`) for a verified sending domain so open/click links redirect through the customer's own subdomain. Requires the custom_tracking_domain entitlement. Returns the resulting state including the two DNS records the customer must create.
1993
1948
  */
1994
- static enableBrandedTracking(parameters, options) {
1949
+ static enableCustomTracking(parameters, options) {
1995
1950
  const params = buildClientParams([parameters], [{ args: [{
1996
1951
  in: "path",
1997
1952
  key: "id"
@@ -2004,7 +1959,82 @@ var Email = class {
2004
1959
  name: "x-api-key",
2005
1960
  type: "apiKey"
2006
1961
  }],
2007
- url: "/v1/email/domains/{id}/branded-tracking",
1962
+ url: "/v1/email/domains/{id}/custom-tracking",
1963
+ ...options,
1964
+ ...params,
1965
+ headers: {
1966
+ "Content-Type": "application/json",
1967
+ ...options?.headers,
1968
+ ...params.headers
1969
+ }
1970
+ });
1971
+ }
1972
+ /**
1973
+ * Check automatic Custom Tracking Domain setup eligibility
1974
+ *
1975
+ * Reports whether the domain's DNS provider supports Domain Connect for its current Custom Tracking Domain. Ineligible is a normal result and the exact manual CNAME records remain available.
1976
+ */
1977
+ static getCustomTrackingDomainConnect(parameters, options) {
1978
+ const params = buildClientParams([parameters], [{ args: [{
1979
+ in: "path",
1980
+ key: "id"
1981
+ }] }]);
1982
+ return (options?.client ?? client).get({
1983
+ security: [{
1984
+ name: "x-api-key",
1985
+ type: "apiKey"
1986
+ }],
1987
+ url: "/v1/email/domains/{id}/custom-tracking/domain-connect",
1988
+ ...options,
1989
+ ...params
1990
+ });
1991
+ }
1992
+ /**
1993
+ * Build an automatic Custom Tracking Domain apply URL
1994
+ *
1995
+ * Builds the signed Domain Connect URL for the current customer-selected tracking host. The server derives the host and Cloudflare DCV UUID; exact manual CNAME records remain available.
1996
+ */
1997
+ static buildCustomTrackingDomainConnectApplyUrl(parameters, options) {
1998
+ const params = buildClientParams([parameters], [{ args: [{
1999
+ in: "path",
2000
+ key: "id"
2001
+ }] }]);
2002
+ return (options?.client ?? client).post({
2003
+ security: [{
2004
+ name: "x-api-key",
2005
+ type: "apiKey"
2006
+ }],
2007
+ url: "/v1/email/domains/{id}/custom-tracking/domain-connect/apply-url",
2008
+ ...options,
2009
+ ...params
2010
+ });
2011
+ }
2012
+ /**
2013
+ * Complete an automatic Custom Tracking Domain return
2014
+ *
2015
+ * Validates the purpose- and revision-bound registrar state, then re-kicks the existing readiness reconciliation. The callback never declares the host ready or changes email tracking selection.
2016
+ */
2017
+ static completeCustomTrackingDomainConnect(parameters, options) {
2018
+ const params = buildClientParams([parameters], [{ args: [
2019
+ {
2020
+ in: "path",
2021
+ key: "id"
2022
+ },
2023
+ {
2024
+ in: "body",
2025
+ key: "state"
2026
+ },
2027
+ {
2028
+ in: "body",
2029
+ key: "error"
2030
+ }
2031
+ ] }]);
2032
+ return (options?.client ?? client).post({
2033
+ security: [{
2034
+ name: "x-api-key",
2035
+ type: "apiKey"
2036
+ }],
2037
+ url: "/v1/email/domains/{id}/custom-tracking/domain-connect/complete",
2008
2038
  ...options,
2009
2039
  ...params,
2010
2040
  headers: {
@@ -3255,10 +3285,6 @@ var Contacts = class {
3255
3285
  in: "body",
3256
3286
  key: "tags"
3257
3287
  },
3258
- {
3259
- in: "body",
3260
- key: "engagement"
3261
- },
3262
3288
  {
3263
3289
  in: "body",
3264
3290
  key: "accessLevel"
@@ -3480,10 +3506,6 @@ var Contacts = class {
3480
3506
  in: "body",
3481
3507
  key: "tags"
3482
3508
  },
3483
- {
3484
- in: "body",
3485
- key: "engagement"
3486
- },
3487
3509
  {
3488
3510
  in: "body",
3489
3511
  key: "accessLevel"
@@ -4140,7 +4162,7 @@ var Templates = class {
4140
4162
  /**
4141
4163
  * Get a template
4142
4164
  *
4143
- * Returns a single template by ID, including its SML source and compiled channel content.
4165
+ * Returns template metadata and compiled channel content. Read live SML through the template-document API.
4144
4166
  */
4145
4167
  static getById(parameters, options) {
4146
4168
  const params = buildClientParams([parameters], [{ args: [{
@@ -4160,7 +4182,7 @@ var Templates = class {
4160
4182
  /**
4161
4183
  * Update a template
4162
4184
  *
4163
- * Updates a template's metadata or SML source; a new source's root tag must match the template's existing channel. Returns the updated template.
4185
+ * Updates template metadata. Source changes use the template-document revision API.
4164
4186
  */
4165
4187
  static update(parameters, options) {
4166
4188
  const params = buildClientParams([parameters], [{ args: [{
@@ -4213,25 +4235,19 @@ var Templates = class {
4213
4235
  }
4214
4236
  });
4215
4237
  }
4216
- /**
4217
- * Render a template
4218
- *
4219
- * Renders a template with the provided variables and returns a channel-specific preview, along with any missing variables and errors. No message is sent.
4220
- */
4221
- static render(parameters, options) {
4238
+ };
4239
+ var TemplateDocuments = class {
4240
+ static bootstrap(parameters, options) {
4222
4241
  const params = buildClientParams([parameters], [{ args: [{
4223
- in: "path",
4224
- key: "id"
4225
- }, {
4226
4242
  in: "body",
4227
- key: "data"
4243
+ key: "templateId"
4228
4244
  }] }]);
4229
4245
  return (options?.client ?? client).post({
4230
4246
  security: [{
4231
4247
  name: "x-api-key",
4232
4248
  type: "apiKey"
4233
4249
  }],
4234
- url: "/v1/templates/{id}/render",
4250
+ url: "/v1/template-documents/bootstrap",
4235
4251
  ...options,
4236
4252
  ...params,
4237
4253
  headers: {
@@ -4241,125 +4257,272 @@ var Templates = class {
4241
4257
  }
4242
4258
  });
4243
4259
  }
4244
- /**
4245
- * Duplicate a template
4246
- *
4247
- * Creates a copy of the template as a new draft template with a fresh slug. Returns the new template with status 201.
4248
- */
4249
- static duplicate(parameters, options) {
4260
+ static get(parameters, options) {
4250
4261
  const params = buildClientParams([parameters], [{ args: [{
4251
4262
  in: "path",
4252
- key: "id"
4263
+ key: "templateId"
4253
4264
  }] }]);
4254
- return (options?.client ?? client).post({
4265
+ return (options?.client ?? client).get({
4255
4266
  security: [{
4256
4267
  name: "x-api-key",
4257
4268
  type: "apiKey"
4258
4269
  }],
4259
- url: "/v1/templates/{id}/duplicate",
4270
+ url: "/v1/template-documents/{templateId}",
4260
4271
  ...options,
4261
4272
  ...params
4262
4273
  });
4263
4274
  }
4264
- /**
4265
- * Publish a template
4266
- *
4267
- * Compiles the template's current source and creates a new published version snapshot, recording the publisher. Returns the updated template.
4268
- */
4269
- static publish(parameters, options) {
4270
- const params = buildClientParams([parameters], [{ args: [{
4271
- in: "path",
4272
- key: "id"
4273
- }] }]);
4275
+ static replace(parameters, options) {
4276
+ const params = buildClientParams([parameters], [{ args: [
4277
+ {
4278
+ in: "path",
4279
+ key: "templateId"
4280
+ },
4281
+ {
4282
+ in: "body",
4283
+ key: "expectedRevision"
4284
+ },
4285
+ {
4286
+ in: "body",
4287
+ key: "source"
4288
+ }
4289
+ ] }]);
4274
4290
  return (options?.client ?? client).post({
4275
4291
  security: [{
4276
4292
  name: "x-api-key",
4277
4293
  type: "apiKey"
4278
4294
  }],
4279
- url: "/v1/templates/{id}/publish",
4295
+ url: "/v1/template-documents/{templateId}/source",
4280
4296
  ...options,
4281
- ...params
4297
+ ...params,
4298
+ headers: {
4299
+ "Content-Type": "application/json",
4300
+ ...options?.headers,
4301
+ ...params.headers
4302
+ }
4282
4303
  });
4283
4304
  }
4284
- /**
4285
- * Unpublish a template
4286
- *
4287
- * Reverts a published template by creating a new draft version from its current source. Returns the updated template.
4288
- */
4289
- static unpublish(parameters, options) {
4305
+ static save(parameters, options) {
4290
4306
  const params = buildClientParams([parameters], [{ args: [{
4291
4307
  in: "path",
4292
- key: "id"
4308
+ key: "templateId"
4309
+ }, {
4310
+ in: "body",
4311
+ key: "revision"
4293
4312
  }] }]);
4294
4313
  return (options?.client ?? client).post({
4295
4314
  security: [{
4296
4315
  name: "x-api-key",
4297
4316
  type: "apiKey"
4298
4317
  }],
4299
- url: "/v1/templates/{id}/unpublish",
4318
+ url: "/v1/template-documents/{templateId}/save",
4300
4319
  ...options,
4301
- ...params
4320
+ ...params,
4321
+ headers: {
4322
+ "Content-Type": "application/json",
4323
+ ...options?.headers,
4324
+ ...params.headers
4325
+ }
4302
4326
  });
4303
4327
  }
4304
- /**
4305
- * List template versions
4306
- *
4307
- * Returns the template's version history, listing each source version with its status and publish metadata.
4308
- */
4309
- static versionHistory(parameters, options) {
4328
+ static render(parameters, options) {
4329
+ const params = buildClientParams([parameters], [{ args: [
4330
+ {
4331
+ in: "path",
4332
+ key: "templateId"
4333
+ },
4334
+ {
4335
+ in: "body",
4336
+ key: "revision"
4337
+ },
4338
+ {
4339
+ in: "body",
4340
+ key: "variables"
4341
+ }
4342
+ ] }]);
4343
+ return (options?.client ?? client).post({
4344
+ security: [{
4345
+ name: "x-api-key",
4346
+ type: "apiKey"
4347
+ }],
4348
+ url: "/v1/template-documents/{templateId}/render",
4349
+ ...options,
4350
+ ...params,
4351
+ headers: {
4352
+ "Content-Type": "application/json",
4353
+ ...options?.headers,
4354
+ ...params.headers
4355
+ }
4356
+ });
4357
+ }
4358
+ static spamCheck(parameters, options) {
4359
+ const params = buildClientParams([parameters], [{ args: [
4360
+ {
4361
+ in: "path",
4362
+ key: "templateId"
4363
+ },
4364
+ {
4365
+ in: "body",
4366
+ key: "revision"
4367
+ },
4368
+ {
4369
+ in: "body",
4370
+ key: "variables"
4371
+ }
4372
+ ] }]);
4373
+ return (options?.client ?? client).post({
4374
+ security: [{
4375
+ name: "x-api-key",
4376
+ type: "apiKey"
4377
+ }],
4378
+ url: "/v1/template-documents/{templateId}/spam-check",
4379
+ ...options,
4380
+ ...params,
4381
+ headers: {
4382
+ "Content-Type": "application/json",
4383
+ ...options?.headers,
4384
+ ...params.headers
4385
+ }
4386
+ });
4387
+ }
4388
+ static testSend(parameters, options) {
4389
+ const params = buildClientParams([parameters], [{ args: [
4390
+ {
4391
+ in: "path",
4392
+ key: "templateId"
4393
+ },
4394
+ {
4395
+ in: "body",
4396
+ key: "revision"
4397
+ },
4398
+ {
4399
+ in: "body",
4400
+ key: "to"
4401
+ },
4402
+ {
4403
+ in: "body",
4404
+ key: "variables"
4405
+ }
4406
+ ] }]);
4407
+ return (options?.client ?? client).post({
4408
+ security: [{
4409
+ name: "x-api-key",
4410
+ type: "apiKey"
4411
+ }],
4412
+ url: "/v1/template-documents/{templateId}/send-test",
4413
+ ...options,
4414
+ ...params,
4415
+ headers: {
4416
+ "Content-Type": "application/json",
4417
+ ...options?.headers,
4418
+ ...params.headers
4419
+ }
4420
+ });
4421
+ }
4422
+ static send(parameters, options) {
4423
+ const params = buildClientParams([parameters], [{ args: [
4424
+ {
4425
+ in: "path",
4426
+ key: "templateId"
4427
+ },
4428
+ {
4429
+ in: "body",
4430
+ key: "revision"
4431
+ },
4432
+ {
4433
+ in: "body",
4434
+ key: "to"
4435
+ },
4436
+ {
4437
+ in: "body",
4438
+ key: "variables"
4439
+ },
4440
+ {
4441
+ in: "body",
4442
+ key: "schedule"
4443
+ }
4444
+ ] }]);
4445
+ return (options?.client ?? client).post({
4446
+ security: [{
4447
+ name: "x-api-key",
4448
+ type: "apiKey"
4449
+ }],
4450
+ url: "/v1/template-documents/{templateId}/send",
4451
+ ...options,
4452
+ ...params,
4453
+ headers: {
4454
+ "Content-Type": "application/json",
4455
+ ...options?.headers,
4456
+ ...params.headers
4457
+ }
4458
+ });
4459
+ }
4460
+ static versions(parameters, options) {
4310
4461
  const params = buildClientParams([parameters], [{ args: [{
4311
4462
  in: "path",
4312
- key: "id"
4463
+ key: "templateId"
4313
4464
  }] }]);
4314
4465
  return (options?.client ?? client).get({
4315
4466
  security: [{
4316
4467
  name: "x-api-key",
4317
4468
  type: "apiKey"
4318
4469
  }],
4319
- url: "/v1/templates/{id}/versions",
4470
+ url: "/v1/template-documents/{templateId}/versions",
4320
4471
  ...options,
4321
4472
  ...params
4322
4473
  });
4323
4474
  }
4324
- /**
4325
- * Restore a template version
4326
- *
4327
- * Recompiles an older version's source and restores it as a new draft version. Fails if the source no longer compiles or its channel differs.
4328
- */
4329
- static restoreVersion(parameters, options) {
4475
+ static publish(parameters, options) {
4330
4476
  const params = buildClientParams([parameters], [{ args: [{
4331
4477
  in: "path",
4332
- key: "id"
4333
- }, {
4334
- in: "path",
4335
- key: "versionId"
4478
+ key: "templateId"
4336
4479
  }] }]);
4337
4480
  return (options?.client ?? client).post({
4338
4481
  security: [{
4339
4482
  name: "x-api-key",
4340
4483
  type: "apiKey"
4341
4484
  }],
4342
- url: "/v1/templates/{id}/versions/{versionId}/restore",
4485
+ url: "/v1/template-documents/{templateId}/publish",
4343
4486
  ...options,
4344
4487
  ...params
4345
4488
  });
4346
4489
  }
4347
- /**
4348
- * Spam-check a template or email content
4349
- *
4350
- * Scores email content for spam risk, from either a stored email template or raw subject, HTML, and text. Returns a score, severity, issues, and recommendations.
4351
- */
4352
- static spamCheck(parameters, options) {
4490
+ static unpublish(parameters, options) {
4353
4491
  const params = buildClientParams([parameters], [{ args: [{
4354
- key: "body",
4355
- map: "body"
4492
+ in: "path",
4493
+ key: "templateId"
4356
4494
  }] }]);
4357
4495
  return (options?.client ?? client).post({
4358
4496
  security: [{
4359
4497
  name: "x-api-key",
4360
4498
  type: "apiKey"
4361
4499
  }],
4362
- url: "/v1/templates/spam-check",
4500
+ url: "/v1/template-documents/{templateId}/unpublish",
4501
+ ...options,
4502
+ ...params
4503
+ });
4504
+ }
4505
+ static restore(parameters, options) {
4506
+ const params = buildClientParams([parameters], [{ args: [
4507
+ {
4508
+ in: "path",
4509
+ key: "templateId"
4510
+ },
4511
+ {
4512
+ in: "path",
4513
+ key: "versionId"
4514
+ },
4515
+ {
4516
+ in: "body",
4517
+ key: "expectedRevision"
4518
+ }
4519
+ ] }]);
4520
+ return (options?.client ?? client).post({
4521
+ security: [{
4522
+ name: "x-api-key",
4523
+ type: "apiKey"
4524
+ }],
4525
+ url: "/v1/template-documents/{templateId}/versions/{versionId}/restore",
4363
4526
  ...options,
4364
4527
  ...params,
4365
4528
  headers: {
@@ -5127,6 +5290,7 @@ var ApiKeys = class {
5127
5290
  };
5128
5291
  //#endregion
5129
5292
  //#region src/promises/errors.gen.ts
5293
+ const redactRequest = (request) => request === void 0 ? void 0 : new Request(request.url, { method: request.method });
5130
5294
  /** Base class for failures declared by the public Samva OpenAPI contract. */
5131
5295
  var SamvaApiError = class extends Error {
5132
5296
  request;
@@ -5135,7 +5299,7 @@ var SamvaApiError = class extends Error {
5135
5299
  constructor(message, context = {}) {
5136
5300
  super(message);
5137
5301
  this.name = new.target.name;
5138
- this.request = context.request;
5302
+ this.request = redactRequest(context.request);
5139
5303
  this.response = context.response;
5140
5304
  this.status = context.response?.status;
5141
5305
  }
@@ -5151,7 +5315,7 @@ var SamvaTransportError = class extends Error {
5151
5315
  super(cause instanceof Error ? cause.message : "Samva request failed", { cause });
5152
5316
  this.name = "SamvaTransportError";
5153
5317
  this.cause = cause;
5154
- this.request = context.request;
5318
+ this.request = redactRequest(context.request);
5155
5319
  this.response = context.response;
5156
5320
  this.status = context.response?.status;
5157
5321
  }
@@ -5713,6 +5877,7 @@ function createClient(config) {
5713
5877
  campaigns: createBoundService(Campaigns, clientInstance),
5714
5878
  email: createBoundService(Email, clientInstance),
5715
5879
  templates: createBoundService(Templates, clientInstance),
5880
+ templateDocuments: createBoundService(TemplateDocuments, clientInstance),
5716
5881
  contacts: createBoundService(Contacts, clientInstance),
5717
5882
  conversations: createBoundService(Conversations, clientInstance),
5718
5883
  design: createBoundService(Design, clientInstance),
@@ -5730,6 +5895,7 @@ function createClient(config) {
5730
5895
  campaigns: createDirectService(raw.campaigns),
5731
5896
  email: createDirectService(promiseEmail),
5732
5897
  templates: createDirectService(raw.templates),
5898
+ templateDocuments: createDirectService(raw.templateDocuments),
5733
5899
  contacts: createDirectService(raw.contacts),
5734
5900
  conversations: createDirectService(raw.conversations),
5735
5901
  design: createDirectService(raw.design),
@@ -5742,4 +5908,4 @@ function createClient(config) {
5742
5908
  //#endregion
5743
5909
  export { fromApiError as _, ExternalServiceError as a, InternalError as c, ResourceNotFoundError as d, SamvaApiError as f, WebhookEnqueueError as g, ValidationError as h, EmailChannelError as i, PaymentRequiredError as l, UnauthorizedError as m, BillingProviderError as n, FlagDisabledError as o, SamvaTransportError as p, ConflictError as r, ForbiddenError as s, createClient as t, RateLimitedError as u };
5744
5910
 
5745
- //# sourceMappingURL=promises-QxEfMTho.js.map
5911
+ //# sourceMappingURL=promises-Dgv8UmCC.js.map