@trycourier/courier 7.10.1 → 7.11.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 (328) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/api-promise.d.mts +1 -0
  3. package/api-promise.d.mts.map +1 -1
  4. package/api-promise.d.ts +1 -0
  5. package/api-promise.d.ts.map +1 -1
  6. package/api-promise.mjs +1 -0
  7. package/api-promise.mjs.map +1 -1
  8. package/client.d.mts +4 -4
  9. package/client.d.mts.map +1 -1
  10. package/client.d.ts +4 -4
  11. package/client.d.ts.map +1 -1
  12. package/client.js +12 -1
  13. package/client.js.map +1 -1
  14. package/client.mjs +12 -1
  15. package/client.mjs.map +1 -1
  16. package/core/api-promise.d.mts.map +1 -1
  17. package/core/api-promise.d.ts.map +1 -1
  18. package/core/api-promise.mjs.map +1 -1
  19. package/core/error.mjs.map +1 -1
  20. package/core/resource.d.mts.map +1 -1
  21. package/core/resource.d.ts.map +1 -1
  22. package/core/uploads.d.mts.map +1 -1
  23. package/core/uploads.d.ts.map +1 -1
  24. package/core/uploads.mjs.map +1 -1
  25. package/error.d.mts +1 -0
  26. package/error.d.mts.map +1 -1
  27. package/error.d.ts +1 -0
  28. package/error.d.ts.map +1 -1
  29. package/error.mjs +1 -0
  30. package/error.mjs.map +1 -1
  31. package/index.d.mts.map +1 -1
  32. package/index.d.ts.map +1 -1
  33. package/index.mjs.map +1 -1
  34. package/internal/detect-platform.mjs.map +1 -1
  35. package/internal/headers.mjs.map +1 -1
  36. package/internal/parse.d.mts.map +1 -1
  37. package/internal/parse.d.ts.map +1 -1
  38. package/internal/parse.mjs.map +1 -1
  39. package/internal/qs/formats.d.mts.map +1 -1
  40. package/internal/qs/formats.d.ts.map +1 -1
  41. package/internal/qs/index.d.mts +2 -2
  42. package/internal/qs/index.d.mts.map +1 -1
  43. package/internal/qs/index.d.ts +2 -2
  44. package/internal/qs/index.d.ts.map +1 -1
  45. package/internal/qs/index.mjs.map +1 -1
  46. package/internal/qs/stringify.d.mts.map +1 -1
  47. package/internal/qs/stringify.d.ts.map +1 -1
  48. package/internal/qs/stringify.mjs.map +1 -1
  49. package/internal/qs/utils.d.mts.map +1 -1
  50. package/internal/qs/utils.d.ts.map +1 -1
  51. package/internal/qs/utils.mjs.map +1 -1
  52. package/internal/request-options.d.mts.map +1 -1
  53. package/internal/request-options.d.ts.map +1 -1
  54. package/internal/shims.d.mts +6 -0
  55. package/internal/shims.d.mts.map +1 -1
  56. package/internal/shims.d.ts +6 -0
  57. package/internal/shims.d.ts.map +1 -1
  58. package/internal/to-file.d.mts.map +1 -1
  59. package/internal/to-file.d.ts.map +1 -1
  60. package/internal/to-file.mjs.map +1 -1
  61. package/internal/types.d.mts +10 -10
  62. package/internal/types.d.mts.map +1 -1
  63. package/internal/types.d.ts +10 -10
  64. package/internal/types.d.ts.map +1 -1
  65. package/internal/uploads.d.mts.map +1 -1
  66. package/internal/uploads.d.ts.map +1 -1
  67. package/internal/uploads.mjs.map +1 -1
  68. package/internal/utils/base64.mjs.map +1 -1
  69. package/internal/utils/log.d.mts.map +1 -1
  70. package/internal/utils/log.d.ts.map +1 -1
  71. package/internal/utils/log.js +2 -0
  72. package/internal/utils/log.js.map +1 -1
  73. package/internal/utils/log.mjs +2 -0
  74. package/internal/utils/log.mjs.map +1 -1
  75. package/internal/utils/path.mjs.map +1 -1
  76. package/internal/utils/query.mjs.map +1 -1
  77. package/internal/utils/values.mjs.map +1 -1
  78. package/internal/utils.d.mts.map +1 -1
  79. package/internal/utils.d.ts.map +1 -1
  80. package/internal/utils.mjs.map +1 -1
  81. package/package.json +1 -1
  82. package/resource.d.mts +1 -0
  83. package/resource.d.mts.map +1 -1
  84. package/resource.d.ts +1 -0
  85. package/resource.d.ts.map +1 -1
  86. package/resource.mjs +1 -0
  87. package/resource.mjs.map +1 -1
  88. package/resources/audiences.d.mts.map +1 -1
  89. package/resources/audiences.d.ts.map +1 -1
  90. package/resources/audiences.mjs.map +1 -1
  91. package/resources/audit-events.d.mts.map +1 -1
  92. package/resources/audit-events.d.ts.map +1 -1
  93. package/resources/audit-events.mjs.map +1 -1
  94. package/resources/auth.d.mts.map +1 -1
  95. package/resources/auth.d.ts.map +1 -1
  96. package/resources/auth.mjs.map +1 -1
  97. package/resources/automations/automations.d.mts.map +1 -1
  98. package/resources/automations/automations.d.ts.map +1 -1
  99. package/resources/automations/automations.mjs.map +1 -1
  100. package/resources/automations/index.d.mts.map +1 -1
  101. package/resources/automations/index.d.ts.map +1 -1
  102. package/resources/automations/index.mjs.map +1 -1
  103. package/resources/automations/invoke.d.mts.map +1 -1
  104. package/resources/automations/invoke.d.ts.map +1 -1
  105. package/resources/automations/invoke.mjs.map +1 -1
  106. package/resources/automations.d.mts.map +1 -1
  107. package/resources/automations.d.ts.map +1 -1
  108. package/resources/automations.mjs.map +1 -1
  109. package/resources/brands.d.mts.map +1 -1
  110. package/resources/brands.d.ts.map +1 -1
  111. package/resources/brands.mjs.map +1 -1
  112. package/resources/bulk.d.mts.map +1 -1
  113. package/resources/bulk.d.ts.map +1 -1
  114. package/resources/bulk.mjs.map +1 -1
  115. package/resources/inbound.d.mts.map +1 -1
  116. package/resources/inbound.d.ts.map +1 -1
  117. package/resources/inbound.mjs.map +1 -1
  118. package/resources/index.d.mts +2 -2
  119. package/resources/index.d.mts.map +1 -1
  120. package/resources/index.d.ts +2 -2
  121. package/resources/index.d.ts.map +1 -1
  122. package/resources/index.js +1 -1
  123. package/resources/index.js.map +1 -1
  124. package/resources/index.mjs +1 -1
  125. package/resources/index.mjs.map +1 -1
  126. package/resources/journeys/index.d.mts +3 -0
  127. package/resources/journeys/index.d.mts.map +1 -0
  128. package/resources/journeys/index.d.ts +3 -0
  129. package/resources/journeys/index.d.ts.map +1 -0
  130. package/resources/journeys/index.js +9 -0
  131. package/resources/journeys/index.js.map +1 -0
  132. package/resources/journeys/index.mjs +4 -0
  133. package/resources/journeys/index.mjs.map +1 -0
  134. package/resources/journeys/journeys.d.mts +752 -0
  135. package/resources/journeys/journeys.d.mts.map +1 -0
  136. package/resources/journeys/journeys.d.ts +752 -0
  137. package/resources/journeys/journeys.d.ts.map +1 -0
  138. package/resources/journeys/journeys.js +148 -0
  139. package/resources/journeys/journeys.js.map +1 -0
  140. package/resources/journeys/journeys.mjs +143 -0
  141. package/resources/journeys/journeys.mjs.map +1 -0
  142. package/resources/journeys/templates.d.mts +219 -0
  143. package/resources/journeys/templates.d.mts.map +1 -0
  144. package/resources/journeys/templates.d.ts +219 -0
  145. package/resources/journeys/templates.d.ts.map +1 -0
  146. package/resources/journeys/templates.js +142 -0
  147. package/resources/journeys/templates.js.map +1 -0
  148. package/resources/journeys/templates.mjs +138 -0
  149. package/resources/journeys/templates.mjs.map +1 -0
  150. package/resources/journeys.d.mts +1 -142
  151. package/resources/journeys.d.mts.map +1 -1
  152. package/resources/journeys.d.ts +1 -142
  153. package/resources/journeys.d.ts.map +1 -1
  154. package/resources/journeys.js +2 -34
  155. package/resources/journeys.js.map +1 -1
  156. package/resources/journeys.mjs +1 -32
  157. package/resources/journeys.mjs.map +1 -1
  158. package/resources/lists/index.d.mts.map +1 -1
  159. package/resources/lists/index.d.ts.map +1 -1
  160. package/resources/lists/index.mjs.map +1 -1
  161. package/resources/lists/lists.d.mts.map +1 -1
  162. package/resources/lists/lists.d.ts.map +1 -1
  163. package/resources/lists/lists.mjs.map +1 -1
  164. package/resources/lists/subscriptions.d.mts.map +1 -1
  165. package/resources/lists/subscriptions.d.ts.map +1 -1
  166. package/resources/lists/subscriptions.mjs.map +1 -1
  167. package/resources/lists.d.mts.map +1 -1
  168. package/resources/lists.d.ts.map +1 -1
  169. package/resources/lists.mjs.map +1 -1
  170. package/resources/messages.d.mts.map +1 -1
  171. package/resources/messages.d.ts.map +1 -1
  172. package/resources/messages.mjs.map +1 -1
  173. package/resources/notifications/checks.d.mts +13 -1
  174. package/resources/notifications/checks.d.mts.map +1 -1
  175. package/resources/notifications/checks.d.ts +13 -1
  176. package/resources/notifications/checks.d.ts.map +1 -1
  177. package/resources/notifications/checks.js +6 -0
  178. package/resources/notifications/checks.js.map +1 -1
  179. package/resources/notifications/checks.mjs +6 -0
  180. package/resources/notifications/checks.mjs.map +1 -1
  181. package/resources/notifications/index.d.mts +1 -1
  182. package/resources/notifications/index.d.mts.map +1 -1
  183. package/resources/notifications/index.d.ts +1 -1
  184. package/resources/notifications/index.d.ts.map +1 -1
  185. package/resources/notifications/index.mjs.map +1 -1
  186. package/resources/notifications/notifications.d.mts +48 -62
  187. package/resources/notifications/notifications.d.mts.map +1 -1
  188. package/resources/notifications/notifications.d.ts +48 -62
  189. package/resources/notifications/notifications.d.ts.map +1 -1
  190. package/resources/notifications/notifications.js +3 -3
  191. package/resources/notifications/notifications.js.map +1 -1
  192. package/resources/notifications/notifications.mjs +3 -3
  193. package/resources/notifications/notifications.mjs.map +1 -1
  194. package/resources/notifications.d.mts.map +1 -1
  195. package/resources/notifications.d.ts.map +1 -1
  196. package/resources/notifications.mjs.map +1 -1
  197. package/resources/profiles/index.d.mts.map +1 -1
  198. package/resources/profiles/index.d.ts.map +1 -1
  199. package/resources/profiles/index.mjs.map +1 -1
  200. package/resources/profiles/lists.d.mts.map +1 -1
  201. package/resources/profiles/lists.d.ts.map +1 -1
  202. package/resources/profiles/lists.mjs.map +1 -1
  203. package/resources/profiles/profiles.d.mts.map +1 -1
  204. package/resources/profiles/profiles.d.ts.map +1 -1
  205. package/resources/profiles/profiles.mjs.map +1 -1
  206. package/resources/profiles.d.mts.map +1 -1
  207. package/resources/profiles.d.ts.map +1 -1
  208. package/resources/profiles.mjs.map +1 -1
  209. package/resources/providers/catalog.d.mts.map +1 -1
  210. package/resources/providers/catalog.d.ts.map +1 -1
  211. package/resources/providers/catalog.mjs.map +1 -1
  212. package/resources/providers/index.d.mts.map +1 -1
  213. package/resources/providers/index.d.ts.map +1 -1
  214. package/resources/providers/index.mjs.map +1 -1
  215. package/resources/providers/providers.d.mts.map +1 -1
  216. package/resources/providers/providers.d.ts.map +1 -1
  217. package/resources/providers/providers.mjs.map +1 -1
  218. package/resources/providers.d.mts.map +1 -1
  219. package/resources/providers.d.ts.map +1 -1
  220. package/resources/providers.mjs.map +1 -1
  221. package/resources/requests.d.mts.map +1 -1
  222. package/resources/requests.d.ts.map +1 -1
  223. package/resources/requests.mjs.map +1 -1
  224. package/resources/routing-strategies.d.mts.map +1 -1
  225. package/resources/routing-strategies.d.ts.map +1 -1
  226. package/resources/routing-strategies.mjs.map +1 -1
  227. package/resources/send.d.mts.map +1 -1
  228. package/resources/send.d.ts.map +1 -1
  229. package/resources/send.mjs.map +1 -1
  230. package/resources/shared.d.mts.map +1 -1
  231. package/resources/shared.d.ts.map +1 -1
  232. package/resources/tenants/index.d.mts +1 -1
  233. package/resources/tenants/index.d.mts.map +1 -1
  234. package/resources/tenants/index.d.ts +1 -1
  235. package/resources/tenants/index.d.ts.map +1 -1
  236. package/resources/tenants/index.js.map +1 -1
  237. package/resources/tenants/index.mjs.map +1 -1
  238. package/resources/tenants/preferences/index.d.mts.map +1 -1
  239. package/resources/tenants/preferences/index.d.ts.map +1 -1
  240. package/resources/tenants/preferences/index.mjs.map +1 -1
  241. package/resources/tenants/preferences/items.d.mts.map +1 -1
  242. package/resources/tenants/preferences/items.d.ts.map +1 -1
  243. package/resources/tenants/preferences/items.mjs.map +1 -1
  244. package/resources/tenants/preferences/preferences.d.mts.map +1 -1
  245. package/resources/tenants/preferences/preferences.d.ts.map +1 -1
  246. package/resources/tenants/preferences/preferences.mjs.map +1 -1
  247. package/resources/tenants/preferences.d.mts.map +1 -1
  248. package/resources/tenants/preferences.d.ts.map +1 -1
  249. package/resources/tenants/preferences.mjs.map +1 -1
  250. package/resources/tenants/templates/index.d.mts +1 -1
  251. package/resources/tenants/templates/index.d.mts.map +1 -1
  252. package/resources/tenants/templates/index.d.ts +1 -1
  253. package/resources/tenants/templates/index.d.ts.map +1 -1
  254. package/resources/tenants/templates/index.js.map +1 -1
  255. package/resources/tenants/templates/index.mjs.map +1 -1
  256. package/resources/tenants/templates/templates.d.mts +23 -1
  257. package/resources/tenants/templates/templates.d.mts.map +1 -1
  258. package/resources/tenants/templates/templates.d.ts +23 -1
  259. package/resources/tenants/templates/templates.d.ts.map +1 -1
  260. package/resources/tenants/templates/templates.js +23 -0
  261. package/resources/tenants/templates/templates.js.map +1 -1
  262. package/resources/tenants/templates/templates.mjs +23 -0
  263. package/resources/tenants/templates/templates.mjs.map +1 -1
  264. package/resources/tenants/templates/versions.d.mts.map +1 -1
  265. package/resources/tenants/templates/versions.d.ts.map +1 -1
  266. package/resources/tenants/templates/versions.mjs.map +1 -1
  267. package/resources/tenants/templates.d.mts.map +1 -1
  268. package/resources/tenants/templates.d.ts.map +1 -1
  269. package/resources/tenants/templates.mjs.map +1 -1
  270. package/resources/tenants/tenants.d.mts +2 -2
  271. package/resources/tenants/tenants.d.mts.map +1 -1
  272. package/resources/tenants/tenants.d.ts +2 -2
  273. package/resources/tenants/tenants.d.ts.map +1 -1
  274. package/resources/tenants/tenants.js.map +1 -1
  275. package/resources/tenants/tenants.mjs.map +1 -1
  276. package/resources/tenants.d.mts.map +1 -1
  277. package/resources/tenants.d.ts.map +1 -1
  278. package/resources/tenants.mjs.map +1 -1
  279. package/resources/translations.d.mts.map +1 -1
  280. package/resources/translations.d.ts.map +1 -1
  281. package/resources/translations.mjs.map +1 -1
  282. package/resources/users/index.d.mts.map +1 -1
  283. package/resources/users/index.d.ts.map +1 -1
  284. package/resources/users/index.mjs.map +1 -1
  285. package/resources/users/preferences.d.mts.map +1 -1
  286. package/resources/users/preferences.d.ts.map +1 -1
  287. package/resources/users/preferences.mjs.map +1 -1
  288. package/resources/users/tenants.d.mts.map +1 -1
  289. package/resources/users/tenants.d.ts.map +1 -1
  290. package/resources/users/tenants.mjs.map +1 -1
  291. package/resources/users/tokens.d.mts.map +1 -1
  292. package/resources/users/tokens.d.ts.map +1 -1
  293. package/resources/users/tokens.mjs.map +1 -1
  294. package/resources/users/users.d.mts.map +1 -1
  295. package/resources/users/users.d.ts.map +1 -1
  296. package/resources/users/users.mjs.map +1 -1
  297. package/resources/users.d.mts.map +1 -1
  298. package/resources/users.d.ts.map +1 -1
  299. package/resources/users.mjs.map +1 -1
  300. package/resources.d.mts.map +1 -1
  301. package/resources.d.ts.map +1 -1
  302. package/resources.mjs.map +1 -1
  303. package/src/client.ts +89 -11
  304. package/src/internal/types.ts +6 -8
  305. package/src/internal/utils/log.ts +2 -0
  306. package/src/resources/index.ts +35 -2
  307. package/src/resources/journeys/index.ts +54 -0
  308. package/src/resources/journeys/journeys.ts +1047 -0
  309. package/src/resources/journeys/templates.ts +318 -0
  310. package/src/resources/journeys.ts +1 -172
  311. package/src/resources/notifications/checks.ts +13 -1
  312. package/src/resources/notifications/index.ts +1 -1
  313. package/src/resources/notifications/notifications.ts +55 -73
  314. package/src/resources/tenants/index.ts +1 -0
  315. package/src/resources/tenants/templates/index.ts +1 -0
  316. package/src/resources/tenants/templates/templates.ts +32 -0
  317. package/src/resources/tenants/tenants.ts +2 -0
  318. package/src/version.ts +1 -1
  319. package/uploads.d.mts +1 -0
  320. package/uploads.d.mts.map +1 -1
  321. package/uploads.d.ts +1 -0
  322. package/uploads.d.ts.map +1 -1
  323. package/uploads.mjs +1 -0
  324. package/uploads.mjs.map +1 -1
  325. package/version.d.mts +1 -1
  326. package/version.d.ts +1 -1
  327. package/version.js +1 -1
  328. package/version.mjs +1 -1
@@ -1,7 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
- import * as NotificationsAPI from './notifications';
5
4
  import * as Shared from '../shared';
6
5
  import * as ChecksAPI from './checks';
7
6
  import {
@@ -26,7 +25,7 @@ export class Notifications extends APIResource {
26
25
  *
27
26
  * @example
28
27
  * ```ts
29
- * const notificationTemplateGetResponse =
28
+ * const notificationTemplateResponse =
30
29
  * await client.notifications.create({
31
30
  * notification: {
32
31
  * name: 'Welcome Email',
@@ -43,10 +42,7 @@ export class Notifications extends APIResource {
43
42
  * });
44
43
  * ```
45
44
  */
46
- create(
47
- body: NotificationCreateParams,
48
- options?: RequestOptions,
49
- ): APIPromise<NotificationTemplateGetResponse> {
45
+ create(body: NotificationCreateParams, options?: RequestOptions): APIPromise<NotificationTemplateResponse> {
50
46
  return this._client.post('/notifications', { body, ...options });
51
47
  }
52
48
 
@@ -56,7 +52,7 @@ export class Notifications extends APIResource {
56
52
  *
57
53
  * @example
58
54
  * ```ts
59
- * const notificationTemplateGetResponse =
55
+ * const notificationTemplateResponse =
60
56
  * await client.notifications.retrieve('id');
61
57
  * ```
62
58
  */
@@ -64,7 +60,7 @@ export class Notifications extends APIResource {
64
60
  id: string,
65
61
  query: NotificationRetrieveParams | null | undefined = {},
66
62
  options?: RequestOptions,
67
- ): APIPromise<NotificationTemplateGetResponse> {
63
+ ): APIPromise<NotificationTemplateResponse> {
68
64
  return this._client.get(path`/notifications/${id}`, { query, ...options });
69
65
  }
70
66
 
@@ -217,7 +213,7 @@ export class Notifications extends APIResource {
217
213
  *
218
214
  * @example
219
215
  * ```ts
220
- * const notificationTemplateGetResponse =
216
+ * const notificationTemplateResponse =
221
217
  * await client.notifications.replace('id', {
222
218
  * notification: {
223
219
  * name: 'Updated Name',
@@ -238,7 +234,7 @@ export class Notifications extends APIResource {
238
234
  id: string,
239
235
  body: NotificationReplaceParams,
240
236
  options?: RequestOptions,
241
- ): APIPromise<NotificationTemplateGetResponse> {
237
+ ): APIPromise<NotificationTemplateResponse> {
242
238
  return this._client.put(path`/notifications/${id}`, { body, ...options });
243
239
  }
244
240
 
@@ -513,8 +509,8 @@ export namespace NotificationLocalePutRequest {
513
509
  */
514
510
  export interface NotificationTemplateCreateRequest {
515
511
  /**
516
- * Full document shape used in POST and PUT request bodies, and returned inside the
517
- * GET response envelope.
512
+ * Core template fields used in POST and PUT request bodies (nested under a
513
+ * `notification` key) and returned at the top level in responses.
518
514
  */
519
515
  notification: NotificationTemplatePayload;
520
516
 
@@ -526,58 +522,8 @@ export interface NotificationTemplateCreateRequest {
526
522
  }
527
523
 
528
524
  /**
529
- * Envelope response for GET /notifications/{id}. The notification object mirrors
530
- * the POST/PUT input shape. Nullable fields return null when unset.
531
- */
532
- export interface NotificationTemplateGetResponse {
533
- /**
534
- * Epoch milliseconds when the template was created.
535
- */
536
- created: number;
537
-
538
- /**
539
- * User ID of the creator.
540
- */
541
- creator: string;
542
-
543
- /**
544
- * Full document shape used in POST and PUT request bodies, and returned inside the
545
- * GET response envelope.
546
- */
547
- notification: NotificationTemplateGetResponse.Notification;
548
-
549
- /**
550
- * The template state. Always uppercase.
551
- */
552
- state: 'DRAFT' | 'PUBLISHED';
553
-
554
- /**
555
- * Epoch milliseconds of last update.
556
- */
557
- updated?: number;
558
-
559
- /**
560
- * User ID of the last updater.
561
- */
562
- updater?: string;
563
- }
564
-
565
- export namespace NotificationTemplateGetResponse {
566
- /**
567
- * Full document shape used in POST and PUT request bodies, and returned inside the
568
- * GET response envelope.
569
- */
570
- export interface Notification extends NotificationsAPI.NotificationTemplatePayload {
571
- /**
572
- * The template ID.
573
- */
574
- id: string;
575
- }
576
- }
577
-
578
- /**
579
- * Full document shape used in POST and PUT request bodies, and returned inside the
580
- * GET response envelope.
525
+ * Core template fields used in POST and PUT request bodies (nested under a
526
+ * `notification` key) and returned at the top level in responses.
581
527
  */
582
528
  export interface NotificationTemplatePayload {
583
529
  /**
@@ -645,6 +591,42 @@ export interface NotificationTemplatePublishRequest {
645
591
  version?: string;
646
592
  }
647
593
 
594
+ /**
595
+ * Response for GET /notifications/{id}, POST /notifications, and PUT
596
+ * /notifications/{id}. Returns all template fields at the top level.
597
+ */
598
+ export interface NotificationTemplateResponse extends NotificationTemplatePayload {
599
+ /**
600
+ * The template ID.
601
+ */
602
+ id: string;
603
+
604
+ /**
605
+ * Epoch milliseconds when the template was created.
606
+ */
607
+ created: number;
608
+
609
+ /**
610
+ * User ID of the creator.
611
+ */
612
+ creator: string;
613
+
614
+ /**
615
+ * The template state. Always uppercase.
616
+ */
617
+ state: 'DRAFT' | 'PUBLISHED';
618
+
619
+ /**
620
+ * Epoch milliseconds of last update.
621
+ */
622
+ updated?: number;
623
+
624
+ /**
625
+ * User ID of the last updater.
626
+ */
627
+ updater?: string;
628
+ }
629
+
648
630
  /**
649
631
  * Template state. Defaults to `DRAFT`.
650
632
  */
@@ -689,8 +671,8 @@ export interface NotificationTemplateSummary {
689
671
  */
690
672
  export interface NotificationTemplateUpdateRequest {
691
673
  /**
692
- * Full document shape used in POST and PUT request bodies, and returned inside the
693
- * GET response envelope.
674
+ * Core template fields used in POST and PUT request bodies (nested under a
675
+ * `notification` key) and returned at the top level in responses.
694
676
  */
695
677
  notification: NotificationTemplatePayload;
696
678
 
@@ -753,14 +735,14 @@ export namespace NotificationListResponse {
753
735
  */
754
736
  event_ids: Array<string>;
755
737
 
756
- note: string;
757
-
758
738
  routing: Shared.MessageRouting;
759
739
 
760
740
  topic_id: string;
761
741
 
762
742
  updated_at: number;
763
743
 
744
+ note?: string;
745
+
764
746
  tags?: Notification.Tags | null;
765
747
 
766
748
  title?: string | null;
@@ -789,8 +771,8 @@ export type NotificationRetrieveContentResponse = NotificationContentGetResponse
789
771
 
790
772
  export interface NotificationCreateParams {
791
773
  /**
792
- * Full document shape used in POST and PUT request bodies, and returned inside the
793
- * GET response envelope.
774
+ * Core template fields used in POST and PUT request bodies (nested under a
775
+ * `notification` key) and returned at the top level in responses.
794
776
  */
795
777
  notification: NotificationTemplatePayload;
796
778
 
@@ -946,8 +928,8 @@ export namespace NotificationPutLocaleParams {
946
928
 
947
929
  export interface NotificationReplaceParams {
948
930
  /**
949
- * Full document shape used in POST and PUT request bodies, and returned inside the
950
- * GET response envelope.
931
+ * Core template fields used in POST and PUT request bodies (nested under a
932
+ * `notification` key) and returned at the top level in responses.
951
933
  */
952
934
  notification: NotificationTemplatePayload;
953
935
 
@@ -980,9 +962,9 @@ export declare namespace Notifications {
980
962
  type NotificationGetContent as NotificationGetContent,
981
963
  type NotificationLocalePutRequest as NotificationLocalePutRequest,
982
964
  type NotificationTemplateCreateRequest as NotificationTemplateCreateRequest,
983
- type NotificationTemplateGetResponse as NotificationTemplateGetResponse,
984
965
  type NotificationTemplatePayload as NotificationTemplatePayload,
985
966
  type NotificationTemplatePublishRequest as NotificationTemplatePublishRequest,
967
+ type NotificationTemplateResponse as NotificationTemplateResponse,
986
968
  type NotificationTemplateState as NotificationTemplateState,
987
969
  type NotificationTemplateSummary as NotificationTemplateSummary,
988
970
  type NotificationTemplateUpdateRequest as NotificationTemplateUpdateRequest,
@@ -6,6 +6,7 @@ export {
6
6
  type TemplateListResponse,
7
7
  type TemplateRetrieveParams,
8
8
  type TemplateListParams,
9
+ type TemplateDeleteParams,
9
10
  type TemplatePublishParams,
10
11
  type TemplateReplaceParams,
11
12
  } from './templates/index';
@@ -5,6 +5,7 @@ export {
5
5
  type TemplateListResponse,
6
6
  type TemplateRetrieveParams,
7
7
  type TemplateListParams,
8
+ type TemplateDeleteParams,
8
9
  type TemplatePublishParams,
9
10
  type TemplateReplaceParams,
10
11
  } from './templates';
@@ -6,6 +6,7 @@ import * as TenantsAPI from '../tenants';
6
6
  import * as VersionsAPI from './versions';
7
7
  import { VersionRetrieveParams, Versions } from './versions';
8
8
  import { APIPromise } from '../../../core/api-promise';
9
+ import { buildHeaders } from '../../../internal/headers';
9
10
  import { RequestOptions } from '../../../internal/request-options';
10
11
  import { path } from '../../../internal/utils/path';
11
12
 
@@ -50,6 +51,29 @@ export class Templates extends APIResource {
50
51
  return this._client.get(path`/tenants/${tenantID}/templates`, { query, ...options });
51
52
  }
52
53
 
54
+ /**
55
+ * Deletes the tenant's notification template with the given `template_id`.
56
+ *
57
+ * Returns **204 No Content** with an empty body on success.
58
+ *
59
+ * Returns **404** if there is no template with this ID for the tenant, including a
60
+ * second `DELETE` after a successful removal.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * await client.tenants.templates.delete('template_id', {
65
+ * tenant_id: 'tenant_id',
66
+ * });
67
+ * ```
68
+ */
69
+ delete(templateID: string, params: TemplateDeleteParams, options?: RequestOptions): APIPromise<void> {
70
+ const { tenant_id } = params;
71
+ return this._client.delete(path`/tenants/${tenant_id}/templates/${templateID}`, {
72
+ ...options,
73
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
74
+ });
75
+ }
76
+
53
77
  /**
54
78
  * Publishes a specific version of a notification template for a tenant.
55
79
  *
@@ -174,6 +198,13 @@ export interface TemplateListParams {
174
198
  limit?: number | null;
175
199
  }
176
200
 
201
+ export interface TemplateDeleteParams {
202
+ /**
203
+ * Id of the tenant that owns the template.
204
+ */
205
+ tenant_id: string;
206
+ }
207
+
177
208
  export interface TemplatePublishParams {
178
209
  /**
179
210
  * Path param: Id of the tenant that owns the template.
@@ -214,6 +245,7 @@ export declare namespace Templates {
214
245
  type TemplateListResponse as TemplateListResponse,
215
246
  type TemplateRetrieveParams as TemplateRetrieveParams,
216
247
  type TemplateListParams as TemplateListParams,
248
+ type TemplateDeleteParams as TemplateDeleteParams,
217
249
  type TemplatePublishParams as TemplatePublishParams,
218
250
  type TemplateReplaceParams as TemplateReplaceParams,
219
251
  };
@@ -7,6 +7,7 @@ import * as PreferencesAPI from './preferences/preferences';
7
7
  import { Preferences } from './preferences/preferences';
8
8
  import * as TemplatesAPI from './templates/templates';
9
9
  import {
10
+ TemplateDeleteParams,
10
11
  TemplateListParams,
11
12
  TemplateListResponse,
12
13
  TemplatePublishParams,
@@ -463,6 +464,7 @@ export declare namespace Tenants {
463
464
  type TemplateListResponse as TemplateListResponse,
464
465
  type TemplateRetrieveParams as TemplateRetrieveParams,
465
466
  type TemplateListParams as TemplateListParams,
467
+ type TemplateDeleteParams as TemplateDeleteParams,
466
468
  type TemplatePublishParams as TemplatePublishParams,
467
469
  type TemplateReplaceParams as TemplateReplaceParams,
468
470
  };
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '7.10.1'; // x-release-please-version
1
+ export const VERSION = '7.11.0'; // x-release-please-version
package/uploads.d.mts CHANGED
@@ -1,2 +1,3 @@
1
+ /** @deprecated Import from ./core/uploads instead */
1
2
  export * from "./core/uploads.mjs";
2
3
  //# sourceMappingURL=uploads.d.mts.map
package/uploads.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.d.mts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"uploads.d.mts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,mCAA+B"}
package/uploads.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ /** @deprecated Import from ./core/uploads instead */
1
2
  export * from "./core/uploads.js";
2
3
  //# sourceMappingURL=uploads.d.ts.map
package/uploads.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,kCAA+B"}
package/uploads.mjs CHANGED
@@ -1,2 +1,3 @@
1
+ /** @deprecated Import from ./core/uploads instead */
1
2
  export * from "./core/uploads.mjs";
2
3
  //# sourceMappingURL=uploads.mjs.map
package/uploads.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.mjs","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"uploads.mjs","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,mCAA+B"}
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "7.10.1";
1
+ export declare const VERSION = "7.11.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "7.10.1";
1
+ export declare const VERSION = "7.11.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '7.10.1'; // x-release-please-version
4
+ exports.VERSION = '7.11.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '7.10.1'; // x-release-please-version
1
+ export const VERSION = '7.11.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map