@trycourier/courier 7.8.0 → 7.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.
Files changed (127) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/client.d.mts +16 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +16 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/index.d.mts +3 -1
  12. package/resources/index.d.mts.map +1 -1
  13. package/resources/index.d.ts +3 -1
  14. package/resources/index.d.ts.map +1 -1
  15. package/resources/index.js +5 -1
  16. package/resources/index.js.map +1 -1
  17. package/resources/index.mjs +2 -0
  18. package/resources/index.mjs.map +1 -1
  19. package/resources/notifications/checks.d.mts +35 -0
  20. package/resources/notifications/checks.d.mts.map +1 -1
  21. package/resources/notifications/checks.d.ts +35 -0
  22. package/resources/notifications/checks.d.ts.map +1 -1
  23. package/resources/notifications/checks.js +35 -0
  24. package/resources/notifications/checks.js.map +1 -1
  25. package/resources/notifications/checks.mjs +35 -0
  26. package/resources/notifications/checks.mjs.map +1 -1
  27. package/resources/notifications/index.d.mts +1 -2
  28. package/resources/notifications/index.d.mts.map +1 -1
  29. package/resources/notifications/index.d.ts +1 -2
  30. package/resources/notifications/index.d.ts.map +1 -1
  31. package/resources/notifications/index.js +1 -3
  32. package/resources/notifications/index.js.map +1 -1
  33. package/resources/notifications/index.mjs +0 -1
  34. package/resources/notifications/index.mjs.map +1 -1
  35. package/resources/notifications/notifications.d.mts +667 -11
  36. package/resources/notifications/notifications.d.mts.map +1 -1
  37. package/resources/notifications/notifications.d.ts +667 -11
  38. package/resources/notifications/notifications.d.ts.map +1 -1
  39. package/resources/notifications/notifications.js +191 -6
  40. package/resources/notifications/notifications.js.map +1 -1
  41. package/resources/notifications/notifications.mjs +191 -6
  42. package/resources/notifications/notifications.mjs.map +1 -1
  43. package/resources/providers/catalog.d.mts +40 -0
  44. package/resources/providers/catalog.d.mts.map +1 -0
  45. package/resources/providers/catalog.d.ts +40 -0
  46. package/resources/providers/catalog.d.ts.map +1 -0
  47. package/resources/providers/catalog.js +18 -0
  48. package/resources/providers/catalog.js.map +1 -0
  49. package/resources/providers/catalog.mjs +14 -0
  50. package/resources/providers/catalog.mjs.map +1 -0
  51. package/resources/providers/index.d.mts +3 -0
  52. package/resources/providers/index.d.mts.map +1 -0
  53. package/resources/providers/index.d.ts +3 -0
  54. package/resources/providers/index.d.ts.map +1 -0
  55. package/resources/providers/index.js +9 -0
  56. package/resources/providers/index.js.map +1 -0
  57. package/resources/providers/index.mjs +4 -0
  58. package/resources/providers/index.mjs.map +1 -0
  59. package/resources/providers/providers.d.mts +182 -0
  60. package/resources/providers/providers.d.mts.map +1 -0
  61. package/resources/providers/providers.d.ts +182 -0
  62. package/resources/providers/providers.d.ts.map +1 -0
  63. package/resources/providers/providers.js +57 -0
  64. package/resources/providers/providers.js.map +1 -0
  65. package/resources/providers/providers.mjs +52 -0
  66. package/resources/providers/providers.mjs.map +1 -0
  67. package/resources/providers.d.mts +2 -0
  68. package/resources/providers.d.mts.map +1 -0
  69. package/resources/providers.d.ts +2 -0
  70. package/resources/providers.d.ts.map +1 -0
  71. package/resources/providers.js +6 -0
  72. package/resources/providers.js.map +1 -0
  73. package/resources/providers.mjs +3 -0
  74. package/resources/providers.mjs.map +1 -0
  75. package/resources/routing-strategies.d.mts +333 -0
  76. package/resources/routing-strategies.d.mts.map +1 -0
  77. package/resources/routing-strategies.d.ts +333 -0
  78. package/resources/routing-strategies.d.ts.map +1 -0
  79. package/resources/routing-strategies.js +107 -0
  80. package/resources/routing-strategies.js.map +1 -0
  81. package/resources/routing-strategies.mjs +103 -0
  82. package/resources/routing-strategies.mjs.map +1 -0
  83. package/resources/send.d.mts +2 -60
  84. package/resources/send.d.mts.map +1 -1
  85. package/resources/send.d.ts +2 -60
  86. package/resources/send.d.ts.map +1 -1
  87. package/resources/shared.d.mts +60 -1
  88. package/resources/shared.d.mts.map +1 -1
  89. package/resources/shared.d.ts +60 -1
  90. package/resources/shared.d.ts.map +1 -1
  91. package/resources/tenants/tenants.d.mts +2 -62
  92. package/resources/tenants/tenants.d.mts.map +1 -1
  93. package/resources/tenants/tenants.d.ts +2 -62
  94. package/resources/tenants/tenants.d.ts.map +1 -1
  95. package/resources/tenants/tenants.js.map +1 -1
  96. package/resources/tenants/tenants.mjs.map +1 -1
  97. package/src/client.ts +112 -0
  98. package/src/resources/index.ts +49 -0
  99. package/src/resources/notifications/checks.ts +35 -0
  100. package/src/resources/notifications/index.ts +26 -1
  101. package/src/resources/notifications/notifications.ts +858 -13
  102. package/src/resources/providers/catalog.ts +53 -0
  103. package/src/resources/providers/index.ts +12 -0
  104. package/src/resources/providers/providers.ts +240 -0
  105. package/src/resources/providers.ts +3 -0
  106. package/src/resources/routing-strategies.ts +436 -0
  107. package/src/resources/send.ts +2 -67
  108. package/src/resources/shared.ts +71 -1
  109. package/src/resources/tenants/tenants.ts +2 -69
  110. package/src/version.ts +1 -1
  111. package/version.d.mts +1 -1
  112. package/version.d.mts.map +1 -1
  113. package/version.d.ts +1 -1
  114. package/version.d.ts.map +1 -1
  115. package/version.js +1 -1
  116. package/version.js.map +1 -1
  117. package/version.mjs +1 -1
  118. package/version.mjs.map +1 -1
  119. package/resources/notifications/draft.d.mts +0 -8
  120. package/resources/notifications/draft.d.mts.map +0 -1
  121. package/resources/notifications/draft.d.ts +0 -8
  122. package/resources/notifications/draft.d.ts.map +0 -1
  123. package/resources/notifications/draft.js +0 -13
  124. package/resources/notifications/draft.js.map +0 -1
  125. package/resources/notifications/draft.mjs +0 -9
  126. package/resources/notifications/draft.mjs.map +0 -1
  127. package/src/resources/notifications/draft.ts +0 -13
@@ -1,16 +1,175 @@
1
1
  import { APIResource } from "../../core/resource.js";
2
+ import * as NotificationsAPI from "./notifications.js";
2
3
  import * as Shared from "../shared.js";
3
4
  import * as ChecksAPI from "./checks.js";
4
5
  import { CheckDeleteParams, CheckListParams, CheckListResponse, CheckUpdateParams, CheckUpdateResponse, Checks } from "./checks.js";
5
- import * as DraftAPI from "./draft.js";
6
- import { Draft } from "./draft.js";
7
6
  import { APIPromise } from "../../core/api-promise.js";
8
7
  import { RequestOptions } from "../../internal/request-options.js";
9
8
  export declare class Notifications extends APIResource {
10
- draft: DraftAPI.Draft;
11
9
  checks: ChecksAPI.Checks;
10
+ /**
11
+ * Create a notification template. Requires all fields in the notification object.
12
+ * Templates are created in draft state by default.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const notificationTemplateMutationResponse =
17
+ * await client.notifications.create({
18
+ * notification: {
19
+ * name: 'Welcome Email',
20
+ * tags: ['onboarding', 'welcome'],
21
+ * brand: { id: 'brand_abc' },
22
+ * subscription: { topic_id: 'marketing' },
23
+ * routing: { strategy_id: 'rs_123' },
24
+ * content: {
25
+ * version: '2022-01-01',
26
+ * elements: [{ type: 'channel' }],
27
+ * },
28
+ * },
29
+ * state: 'DRAFT',
30
+ * });
31
+ * ```
32
+ */
33
+ create(body: NotificationCreateParams, options?: RequestOptions): APIPromise<NotificationTemplateMutationResponse>;
34
+ /**
35
+ * Retrieve a notification template by ID. Returns the published version by
36
+ * default. Pass version=draft to retrieve an unpublished template.
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const notificationTemplateGetResponse =
41
+ * await client.notifications.retrieve('id');
42
+ * ```
43
+ */
44
+ retrieve(id: string, query?: NotificationRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<NotificationTemplateGetResponse>;
45
+ /**
46
+ * List notification templates in your workspace.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const notifications = await client.notifications.list();
51
+ * ```
52
+ */
12
53
  list(query?: NotificationListParams | null | undefined, options?: RequestOptions): APIPromise<NotificationListResponse>;
13
- retrieveContent(id: string, options?: RequestOptions): APIPromise<NotificationGetContent>;
54
+ /**
55
+ * Archive a notification template.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * await client.notifications.archive('id');
60
+ * ```
61
+ */
62
+ archive(id: string, options?: RequestOptions): APIPromise<void>;
63
+ /**
64
+ * List versions of a notification template.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const notificationTemplateVersionListResponse =
69
+ * await client.notifications.listVersions('id');
70
+ * ```
71
+ */
72
+ listVersions(id: string, query?: NotificationListVersionsParams | null | undefined, options?: RequestOptions): APIPromise<NotificationTemplateVersionListResponse>;
73
+ /**
74
+ * Publish a notification template. Publishes the current draft by default. Pass a
75
+ * version in the request body to publish a specific historical version.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * await client.notifications.publish('id');
80
+ * ```
81
+ */
82
+ publish(id: string, body?: NotificationPublishParams | null | undefined, options?: RequestOptions): APIPromise<void>;
83
+ /**
84
+ * Replace the elemental content of a notification template. Overwrites all
85
+ * elements in the template with the provided content. Only supported for V2
86
+ * (elemental) templates.
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * const notificationContentMutationResponse =
91
+ * await client.notifications.putContent('id', {
92
+ * content: {
93
+ * version: '2022-01-01',
94
+ * elements: [{ type: 'channel' }],
95
+ * },
96
+ * state: 'DRAFT',
97
+ * });
98
+ * ```
99
+ */
100
+ putContent(id: string, body: NotificationPutContentParams, options?: RequestOptions): APIPromise<NotificationContentMutationResponse>;
101
+ /**
102
+ * Update a single element within a notification template. Only supported for V2
103
+ * (elemental) templates.
104
+ *
105
+ * @example
106
+ * ```ts
107
+ * const notificationContentMutationResponse =
108
+ * await client.notifications.putElement('elementId', {
109
+ * id: 'id',
110
+ * type: 'text',
111
+ * data: { content: 'Updated text content' },
112
+ * state: 'DRAFT',
113
+ * });
114
+ * ```
115
+ */
116
+ putElement(elementID: string, params: NotificationPutElementParams, options?: RequestOptions): APIPromise<NotificationContentMutationResponse>;
117
+ /**
118
+ * Set locale-specific content overrides for a notification template. Each element
119
+ * override must reference an existing element by ID. Only supported for V2
120
+ * (elemental) templates.
121
+ *
122
+ * @example
123
+ * ```ts
124
+ * const notificationContentMutationResponse =
125
+ * await client.notifications.putLocale('localeId', {
126
+ * id: 'id',
127
+ * elements: [
128
+ * { id: 'elem_1', content: 'Hola {{data.name}}.' },
129
+ * { id: 'elem_2', title: 'Bienvenido!' },
130
+ * ],
131
+ * state: 'DRAFT',
132
+ * });
133
+ * ```
134
+ */
135
+ putLocale(localeID: string, params: NotificationPutLocaleParams, options?: RequestOptions): APIPromise<NotificationContentMutationResponse>;
136
+ /**
137
+ * Replace a notification template. All fields are required.
138
+ *
139
+ * @example
140
+ * ```ts
141
+ * const notificationTemplateMutationResponse =
142
+ * await client.notifications.replace('id', {
143
+ * notification: {
144
+ * name: 'Updated Name',
145
+ * tags: ['updated'],
146
+ * brand: null,
147
+ * subscription: null,
148
+ * routing: null,
149
+ * content: {
150
+ * version: '2022-01-01',
151
+ * elements: [{ type: 'channel' }],
152
+ * },
153
+ * },
154
+ * state: 'PUBLISHED',
155
+ * });
156
+ * ```
157
+ */
158
+ replace(id: string, body: NotificationReplaceParams, options?: RequestOptions): APIPromise<NotificationTemplateMutationResponse>;
159
+ /**
160
+ * Retrieve the content of a notification template. The response shape depends on
161
+ * whether the template uses V1 (blocks/channels) or V2 (elemental) content. Use
162
+ * the `version` query parameter to select draft, published, or a specific
163
+ * historical version.
164
+ *
165
+ * @example
166
+ * ```ts
167
+ * const response = await client.notifications.retrieveContent(
168
+ * 'id',
169
+ * );
170
+ * ```
171
+ */
172
+ retrieveContent(id: string, query?: NotificationRetrieveContentParams | null | undefined, options?: RequestOptions): APIPromise<NotificationRetrieveContentResponse>;
14
173
  }
15
174
  export interface BaseCheck {
16
175
  id: string;
@@ -20,6 +179,122 @@ export interface BaseCheck {
20
179
  export interface Check extends BaseCheck {
21
180
  updated: number;
22
181
  }
182
+ /**
183
+ * An element with its content checksum and optional nested elements and locale
184
+ * checksums.
185
+ */
186
+ export interface ElementWithChecksums {
187
+ /**
188
+ * MD5 hash of translatable content.
189
+ */
190
+ checksum: string;
191
+ /**
192
+ * Element type (text, meta, action, etc.).
193
+ */
194
+ type: string;
195
+ id?: string;
196
+ /**
197
+ * Nested child elements (for group-type elements).
198
+ */
199
+ elements?: Array<ElementWithChecksums>;
200
+ /**
201
+ * Locale-specific content with checksums.
202
+ */
203
+ locales?: {
204
+ [key: string]: ElementWithChecksums.Locales;
205
+ };
206
+ [k: string]: unknown;
207
+ }
208
+ export declare namespace ElementWithChecksums {
209
+ interface Locales {
210
+ checksum: string;
211
+ }
212
+ }
213
+ /**
214
+ * Elemental content response for V2 templates. Contains versioned elements with
215
+ * content checksums.
216
+ */
217
+ export interface NotificationContentGetResponse {
218
+ elements: Array<ElementWithChecksums>;
219
+ /**
220
+ * Content version identifier.
221
+ */
222
+ version: string;
223
+ }
224
+ /**
225
+ * Shared mutation response for `PUT` content, `PUT` element, and `PUT` locale
226
+ * operations. Contains the template ID, content version, per-element checksums,
227
+ * and resulting state.
228
+ */
229
+ export interface NotificationContentMutationResponse {
230
+ /**
231
+ * Template ID.
232
+ */
233
+ id: string;
234
+ elements: Array<NotificationContentMutationResponse.Element>;
235
+ /**
236
+ * Template state. Defaults to `DRAFT`.
237
+ */
238
+ state: NotificationTemplateState;
239
+ /**
240
+ * Content version identifier.
241
+ */
242
+ version: string;
243
+ }
244
+ export declare namespace NotificationContentMutationResponse {
245
+ interface Element {
246
+ id: string;
247
+ checksum: string;
248
+ }
249
+ }
250
+ /**
251
+ * Request body for replacing the elemental content of a notification template.
252
+ */
253
+ export interface NotificationContentPutRequest {
254
+ /**
255
+ * Elemental content payload. The server defaults `version` when omitted.
256
+ */
257
+ content: NotificationContentPutRequest.Content;
258
+ /**
259
+ * Template state. Defaults to `DRAFT`.
260
+ */
261
+ state?: NotificationTemplateState;
262
+ }
263
+ export declare namespace NotificationContentPutRequest {
264
+ /**
265
+ * Elemental content payload. The server defaults `version` when omitted.
266
+ */
267
+ interface Content {
268
+ elements: Array<Shared.ElementalNode>;
269
+ /**
270
+ * Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
271
+ * omitted.
272
+ */
273
+ version?: string;
274
+ }
275
+ }
276
+ /**
277
+ * Request body for updating a single element. Additional type-specific fields are
278
+ * allowed.
279
+ */
280
+ export interface NotificationElementPutRequest {
281
+ /**
282
+ * Element type (text, meta, action, image, etc.).
283
+ */
284
+ type: string;
285
+ channels?: Array<string>;
286
+ data?: {
287
+ [key: string]: unknown;
288
+ };
289
+ if?: string;
290
+ loop?: string;
291
+ ref?: string;
292
+ /**
293
+ * Template state. Defaults to `DRAFT`.
294
+ */
295
+ state?: NotificationTemplateState;
296
+ [k: string]: unknown;
297
+ }
23
298
  export interface NotificationGetContent {
24
299
  blocks?: Array<NotificationGetContent.Block> | null;
25
300
  channels?: Array<NotificationGetContent.Channel> | null;
@@ -67,12 +342,245 @@ export declare namespace NotificationGetContent {
67
342
  }
68
343
  }
69
344
  }
345
+ /**
346
+ * Request body for setting locale-specific content overrides. Each element
347
+ * override must include the target element ID.
348
+ */
349
+ export interface NotificationLocalePutRequest {
350
+ /**
351
+ * Elements with locale-specific content overrides.
352
+ */
353
+ elements: Array<NotificationLocalePutRequest.Element>;
354
+ /**
355
+ * Template state. Defaults to `DRAFT`.
356
+ */
357
+ state?: NotificationTemplateState;
358
+ }
359
+ export declare namespace NotificationLocalePutRequest {
360
+ interface Element {
361
+ /**
362
+ * Target element ID.
363
+ */
364
+ id: string;
365
+ [k: string]: unknown;
366
+ }
367
+ }
368
+ /**
369
+ * Request body for creating a notification template.
370
+ */
371
+ export interface NotificationTemplateCreateRequest {
372
+ /**
373
+ * Full document shape used in POST and PUT request bodies, and returned inside the
374
+ * GET response envelope.
375
+ */
376
+ notification: NotificationTemplatePayload;
377
+ /**
378
+ * Template state after creation. Case-insensitive input, normalized to uppercase
379
+ * in the response. Defaults to "DRAFT".
380
+ */
381
+ state?: 'DRAFT' | 'PUBLISHED';
382
+ }
383
+ /**
384
+ * Envelope response for GET /notifications/{id}. The notification object mirrors
385
+ * the POST/PUT input shape. Nullable fields return null when unset.
386
+ */
387
+ export interface NotificationTemplateGetResponse {
388
+ /**
389
+ * Epoch milliseconds when the template was created.
390
+ */
391
+ created: number;
392
+ /**
393
+ * User ID of the creator.
394
+ */
395
+ creator: string;
396
+ /**
397
+ * Full document shape used in POST and PUT request bodies, and returned inside the
398
+ * GET response envelope.
399
+ */
400
+ notification: NotificationTemplateGetResponse.Notification;
401
+ /**
402
+ * The template state. Always uppercase.
403
+ */
404
+ state: 'DRAFT' | 'PUBLISHED';
405
+ /**
406
+ * Epoch milliseconds of last update.
407
+ */
408
+ updated?: number;
409
+ /**
410
+ * User ID of the last updater.
411
+ */
412
+ updater?: string;
413
+ }
414
+ export declare namespace NotificationTemplateGetResponse {
415
+ /**
416
+ * Full document shape used in POST and PUT request bodies, and returned inside the
417
+ * GET response envelope.
418
+ */
419
+ interface Notification extends NotificationsAPI.NotificationTemplatePayload {
420
+ /**
421
+ * The template ID.
422
+ */
423
+ id: string;
424
+ }
425
+ }
426
+ /**
427
+ * Response returned by POST and PUT operations.
428
+ */
429
+ export interface NotificationTemplateMutationResponse {
430
+ notification: NotificationTemplateMutationResponse.Notification;
431
+ /**
432
+ * The template state after the operation. Always uppercase.
433
+ */
434
+ state: 'DRAFT' | 'PUBLISHED';
435
+ }
436
+ export declare namespace NotificationTemplateMutationResponse {
437
+ interface Notification {
438
+ /**
439
+ * The ID of the created or updated template.
440
+ */
441
+ id: string;
442
+ }
443
+ }
444
+ /**
445
+ * Full document shape used in POST and PUT request bodies, and returned inside the
446
+ * GET response envelope.
447
+ */
448
+ export interface NotificationTemplatePayload {
449
+ /**
450
+ * Brand reference, or null for no brand.
451
+ */
452
+ brand: NotificationTemplatePayload.Brand | null;
453
+ /**
454
+ * Elemental content definition.
455
+ */
456
+ content: Shared.ElementalContent;
457
+ /**
458
+ * Display name for the template.
459
+ */
460
+ name: string;
461
+ /**
462
+ * Routing strategy reference, or null for none.
463
+ */
464
+ routing: NotificationTemplatePayload.Routing | null;
465
+ /**
466
+ * Subscription topic reference, or null for none.
467
+ */
468
+ subscription: NotificationTemplatePayload.Subscription | null;
469
+ /**
470
+ * Tags for categorization. Send empty array for none.
471
+ */
472
+ tags: Array<string>;
473
+ }
474
+ export declare namespace NotificationTemplatePayload {
475
+ /**
476
+ * Brand reference, or null for no brand.
477
+ */
478
+ interface Brand {
479
+ id: string;
480
+ }
481
+ /**
482
+ * Routing strategy reference, or null for none.
483
+ */
484
+ interface Routing {
485
+ strategy_id: string;
486
+ }
487
+ /**
488
+ * Subscription topic reference, or null for none.
489
+ */
490
+ interface Subscription {
491
+ topic_id: string;
492
+ }
493
+ }
494
+ /**
495
+ * Optional request body for publishing a notification template. Omit or send an
496
+ * empty object to publish the current draft.
497
+ */
498
+ export interface NotificationTemplatePublishRequest {
499
+ /**
500
+ * Historical version to publish (e.g. "v001"). Omit to publish the current draft.
501
+ */
502
+ version?: string;
503
+ }
504
+ /**
505
+ * Template state. Defaults to `DRAFT`.
506
+ */
507
+ export type NotificationTemplateState = 'DRAFT' | 'PUBLISHED';
508
+ /**
509
+ * V2 (CDS) template summary returned in list responses.
510
+ */
511
+ export interface NotificationTemplateSummary {
512
+ id: string;
513
+ /**
514
+ * Epoch milliseconds when the template was created.
515
+ */
516
+ created: number;
517
+ /**
518
+ * User ID of the creator.
519
+ */
520
+ creator: string;
521
+ name: string;
522
+ state: 'DRAFT' | 'PUBLISHED';
523
+ tags: Array<string>;
524
+ /**
525
+ * Epoch milliseconds of last update.
526
+ */
527
+ updated?: number;
528
+ /**
529
+ * User ID of the last updater.
530
+ */
531
+ updater?: string;
532
+ }
533
+ /**
534
+ * Request body for replacing a notification template. Same shape as create. All
535
+ * fields required (PUT = full replacement).
536
+ */
537
+ export interface NotificationTemplateUpdateRequest {
538
+ /**
539
+ * Full document shape used in POST and PUT request bodies, and returned inside the
540
+ * GET response envelope.
541
+ */
542
+ notification: NotificationTemplatePayload;
543
+ /**
544
+ * Template state after update. Case-insensitive input, normalized to uppercase in
545
+ * the response. Defaults to "DRAFT".
546
+ */
547
+ state?: 'DRAFT' | 'PUBLISHED';
548
+ }
549
+ export interface NotificationTemplateVersionListResponse {
550
+ paging: Shared.Paging;
551
+ versions: Array<VersionNode>;
552
+ }
553
+ /**
554
+ * A version entry for a notification template.
555
+ */
556
+ export interface VersionNode {
557
+ /**
558
+ * Epoch milliseconds when this version was created.
559
+ */
560
+ created: number;
561
+ /**
562
+ * User ID of the version creator.
563
+ */
564
+ creator: string;
565
+ /**
566
+ * Version identifier. One of "draft", "published:vNNN" (current published
567
+ * version), or "vNNN" (historical version).
568
+ */
569
+ version: string;
570
+ /**
571
+ * Whether the draft has unpublished changes. Only present on the draft version.
572
+ */
573
+ has_changes?: boolean;
574
+ }
70
575
  export interface NotificationListResponse {
71
576
  paging: Shared.Paging;
72
- results: Array<NotificationListResponse.Result>;
577
+ /**
578
+ * Notification templates in this workspace.
579
+ */
580
+ results: Array<NotificationListResponse.Notification | NotificationTemplateSummary>;
73
581
  }
74
582
  export declare namespace NotificationListResponse {
75
- interface Result {
583
+ interface Notification {
76
584
  id: string;
77
585
  created_at: number;
78
586
  /**
@@ -83,10 +591,10 @@ export declare namespace NotificationListResponse {
83
591
  routing: Shared.MessageRouting;
84
592
  topic_id: string;
85
593
  updated_at: number;
86
- tags?: Result.Tags | null;
594
+ tags?: Notification.Tags | null;
87
595
  title?: string | null;
88
596
  }
89
- namespace Result {
597
+ namespace Notification {
90
598
  interface Tags {
91
599
  data: Array<Tags.Data>;
92
600
  }
@@ -98,16 +606,164 @@ export declare namespace NotificationListResponse {
98
606
  }
99
607
  }
100
608
  }
609
+ /**
610
+ * Elemental content response for V2 templates. Contains versioned elements with
611
+ * content checksums.
612
+ */
613
+ export type NotificationRetrieveContentResponse = NotificationContentGetResponse | NotificationGetContent;
614
+ export interface NotificationCreateParams {
615
+ /**
616
+ * Full document shape used in POST and PUT request bodies, and returned inside the
617
+ * GET response envelope.
618
+ */
619
+ notification: NotificationTemplatePayload;
620
+ /**
621
+ * Template state after creation. Case-insensitive input, normalized to uppercase
622
+ * in the response. Defaults to "DRAFT".
623
+ */
624
+ state?: 'DRAFT' | 'PUBLISHED';
625
+ }
626
+ export interface NotificationRetrieveParams {
627
+ /**
628
+ * Version to retrieve. One of "draft", "published", or a version string like
629
+ * "v001". Defaults to "published".
630
+ */
631
+ version?: string;
632
+ }
101
633
  export interface NotificationListParams {
634
+ /**
635
+ * Opaque pagination cursor from a previous response. Omit for the first page.
636
+ */
102
637
  cursor?: string | null;
103
638
  /**
104
- * Retrieve the notes from the Notification template settings.
639
+ * Filter to templates linked to this event map ID.
640
+ */
641
+ event_id?: string;
642
+ /**
643
+ * Include template notes in the response. Only applies to legacy templates.
105
644
  */
106
645
  notes?: boolean | null;
107
646
  }
647
+ export interface NotificationListVersionsParams {
648
+ /**
649
+ * Opaque pagination cursor from a previous response. Omit for the first page.
650
+ */
651
+ cursor?: string;
652
+ /**
653
+ * Maximum number of versions to return per page. Default 10, max 10.
654
+ */
655
+ limit?: number;
656
+ }
657
+ export interface NotificationPublishParams {
658
+ /**
659
+ * Historical version to publish (e.g. "v001"). Omit to publish the current draft.
660
+ */
661
+ version?: string;
662
+ }
663
+ export interface NotificationPutContentParams {
664
+ /**
665
+ * Elemental content payload. The server defaults `version` when omitted.
666
+ */
667
+ content: NotificationPutContentParams.Content;
668
+ /**
669
+ * Template state. Defaults to `DRAFT`.
670
+ */
671
+ state?: NotificationTemplateState;
672
+ }
673
+ export declare namespace NotificationPutContentParams {
674
+ /**
675
+ * Elemental content payload. The server defaults `version` when omitted.
676
+ */
677
+ interface Content {
678
+ elements: Array<Shared.ElementalNode>;
679
+ /**
680
+ * Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
681
+ * omitted.
682
+ */
683
+ version?: string;
684
+ }
685
+ }
686
+ export interface NotificationPutElementParams {
687
+ /**
688
+ * Path param: Notification template ID (`nt_` prefix).
689
+ */
690
+ id: string;
691
+ /**
692
+ * Body param: Element type (text, meta, action, image, etc.).
693
+ */
694
+ type: string;
695
+ /**
696
+ * Body param
697
+ */
698
+ channels?: Array<string>;
699
+ /**
700
+ * Body param
701
+ */
702
+ data?: {
703
+ [key: string]: unknown;
704
+ };
705
+ /**
706
+ * Body param
707
+ */
708
+ if?: string;
709
+ /**
710
+ * Body param
711
+ */
712
+ loop?: string;
713
+ /**
714
+ * Body param
715
+ */
716
+ ref?: string;
717
+ /**
718
+ * Body param: Template state. Defaults to `DRAFT`.
719
+ */
720
+ state?: NotificationTemplateState;
721
+ [k: string]: unknown;
722
+ }
723
+ export interface NotificationPutLocaleParams {
724
+ /**
725
+ * Path param: Notification template ID (`nt_` prefix).
726
+ */
727
+ id: string;
728
+ /**
729
+ * Body param: Elements with locale-specific content overrides.
730
+ */
731
+ elements: Array<NotificationPutLocaleParams.Element>;
732
+ /**
733
+ * Body param: Template state. Defaults to `DRAFT`.
734
+ */
735
+ state?: NotificationTemplateState;
736
+ }
737
+ export declare namespace NotificationPutLocaleParams {
738
+ interface Element {
739
+ /**
740
+ * Target element ID.
741
+ */
742
+ id: string;
743
+ [k: string]: unknown;
744
+ }
745
+ }
746
+ export interface NotificationReplaceParams {
747
+ /**
748
+ * Full document shape used in POST and PUT request bodies, and returned inside the
749
+ * GET response envelope.
750
+ */
751
+ notification: NotificationTemplatePayload;
752
+ /**
753
+ * Template state after update. Case-insensitive input, normalized to uppercase in
754
+ * the response. Defaults to "DRAFT".
755
+ */
756
+ state?: 'DRAFT' | 'PUBLISHED';
757
+ }
758
+ export interface NotificationRetrieveContentParams {
759
+ /**
760
+ * Accepts `draft`, `published`, or a version string (e.g., `v001`). Defaults to
761
+ * `published`.
762
+ */
763
+ version?: string;
764
+ }
108
765
  export declare namespace Notifications {
109
- export { type BaseCheck as BaseCheck, type Check as Check, type NotificationGetContent as NotificationGetContent, type NotificationListResponse as NotificationListResponse, type NotificationListParams as NotificationListParams, };
110
- export { Draft as Draft };
766
+ export { type BaseCheck as BaseCheck, type Check as Check, type ElementWithChecksums as ElementWithChecksums, type NotificationContentGetResponse as NotificationContentGetResponse, type NotificationContentMutationResponse as NotificationContentMutationResponse, type NotificationContentPutRequest as NotificationContentPutRequest, type NotificationElementPutRequest as NotificationElementPutRequest, type NotificationGetContent as NotificationGetContent, type NotificationLocalePutRequest as NotificationLocalePutRequest, type NotificationTemplateCreateRequest as NotificationTemplateCreateRequest, type NotificationTemplateGetResponse as NotificationTemplateGetResponse, type NotificationTemplateMutationResponse as NotificationTemplateMutationResponse, type NotificationTemplatePayload as NotificationTemplatePayload, type NotificationTemplatePublishRequest as NotificationTemplatePublishRequest, type NotificationTemplateState as NotificationTemplateState, type NotificationTemplateSummary as NotificationTemplateSummary, type NotificationTemplateUpdateRequest as NotificationTemplateUpdateRequest, type NotificationTemplateVersionListResponse as NotificationTemplateVersionListResponse, type VersionNode as VersionNode, type NotificationListResponse as NotificationListResponse, type NotificationRetrieveContentResponse as NotificationRetrieveContentResponse, type NotificationCreateParams as NotificationCreateParams, type NotificationRetrieveParams as NotificationRetrieveParams, type NotificationListParams as NotificationListParams, type NotificationListVersionsParams as NotificationListVersionsParams, type NotificationPublishParams as NotificationPublishParams, type NotificationPutContentParams as NotificationPutContentParams, type NotificationPutElementParams as NotificationPutElementParams, type NotificationPutLocaleParams as NotificationPutLocaleParams, type NotificationReplaceParams as NotificationReplaceParams, type NotificationRetrieveContentParams as NotificationRetrieveContentParams, };
111
767
  export { Checks as Checks, type CheckUpdateResponse as CheckUpdateResponse, type CheckListResponse as CheckListResponse, type CheckUpdateParams as CheckUpdateParams, type CheckListParams as CheckListParams, type CheckDeleteParams as CheckDeleteParams, };
112
768
  }
113
769
  //# sourceMappingURL=notifications.d.ts.map