@trycourier/courier 7.9.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.
- package/CHANGELOG.md +9 -0
- package/client.d.mts +4 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -4
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/notifications/index.d.mts +1 -2
- package/resources/notifications/index.d.mts.map +1 -1
- package/resources/notifications/index.d.ts +1 -2
- package/resources/notifications/index.d.ts.map +1 -1
- package/resources/notifications/index.js +1 -3
- package/resources/notifications/index.js.map +1 -1
- package/resources/notifications/index.mjs +0 -1
- package/resources/notifications/index.mjs.map +1 -1
- package/resources/notifications/notifications.d.mts +301 -8
- package/resources/notifications/notifications.d.mts.map +1 -1
- package/resources/notifications/notifications.d.ts +301 -8
- package/resources/notifications/notifications.d.ts.map +1 -1
- package/resources/notifications/notifications.js +71 -8
- package/resources/notifications/notifications.js.map +1 -1
- package/resources/notifications/notifications.mjs +71 -8
- package/resources/notifications/notifications.mjs.map +1 -1
- package/resources/routing-strategies.d.mts +30 -1
- package/resources/routing-strategies.d.mts.map +1 -1
- package/resources/routing-strategies.d.ts +30 -1
- package/resources/routing-strategies.d.ts.map +1 -1
- package/resources/routing-strategies.js +13 -0
- package/resources/routing-strategies.js.map +1 -1
- package/resources/routing-strategies.mjs +13 -0
- package/resources/routing-strategies.mjs.map +1 -1
- package/src/client.ts +28 -0
- package/src/resources/index.ts +14 -0
- package/src/resources/notifications/index.ts +12 -1
- package/src/resources/notifications/notifications.ts +386 -10
- package/src/resources/routing-strategies.ts +42 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/notifications/draft.d.mts +0 -15
- package/resources/notifications/draft.d.mts.map +0 -1
- package/resources/notifications/draft.d.ts +0 -15
- package/resources/notifications/draft.d.ts.map +0 -1
- package/resources/notifications/draft.js +0 -20
- package/resources/notifications/draft.js.map +0 -1
- package/resources/notifications/draft.mjs +0 -16
- package/resources/notifications/draft.mjs.map +0 -1
- package/src/resources/notifications/draft.ts +0 -20
|
@@ -12,15 +12,12 @@ import {
|
|
|
12
12
|
CheckUpdateResponse,
|
|
13
13
|
Checks,
|
|
14
14
|
} from './checks';
|
|
15
|
-
import * as DraftAPI from './draft';
|
|
16
|
-
import { Draft } from './draft';
|
|
17
15
|
import { APIPromise } from '../../core/api-promise';
|
|
18
16
|
import { buildHeaders } from '../../internal/headers';
|
|
19
17
|
import { RequestOptions } from '../../internal/request-options';
|
|
20
18
|
import { path } from '../../internal/utils/path';
|
|
21
19
|
|
|
22
20
|
export class Notifications extends APIResource {
|
|
23
|
-
draft: DraftAPI.Draft = new DraftAPI.Draft(this._client);
|
|
24
21
|
checks: ChecksAPI.Checks = new ChecksAPI.Checks(this._client);
|
|
25
22
|
|
|
26
23
|
/**
|
|
@@ -139,6 +136,82 @@ export class Notifications extends APIResource {
|
|
|
139
136
|
});
|
|
140
137
|
}
|
|
141
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Replace the elemental content of a notification template. Overwrites all
|
|
141
|
+
* elements in the template with the provided content. Only supported for V2
|
|
142
|
+
* (elemental) templates.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```ts
|
|
146
|
+
* const notificationContentMutationResponse =
|
|
147
|
+
* await client.notifications.putContent('id', {
|
|
148
|
+
* content: {
|
|
149
|
+
* version: '2022-01-01',
|
|
150
|
+
* elements: [{ type: 'channel' }],
|
|
151
|
+
* },
|
|
152
|
+
* state: 'DRAFT',
|
|
153
|
+
* });
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
putContent(
|
|
157
|
+
id: string,
|
|
158
|
+
body: NotificationPutContentParams,
|
|
159
|
+
options?: RequestOptions,
|
|
160
|
+
): APIPromise<NotificationContentMutationResponse> {
|
|
161
|
+
return this._client.put(path`/notifications/${id}/content`, { body, ...options });
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Update a single element within a notification template. Only supported for V2
|
|
166
|
+
* (elemental) templates.
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```ts
|
|
170
|
+
* const notificationContentMutationResponse =
|
|
171
|
+
* await client.notifications.putElement('elementId', {
|
|
172
|
+
* id: 'id',
|
|
173
|
+
* type: 'text',
|
|
174
|
+
* data: { content: 'Updated text content' },
|
|
175
|
+
* state: 'DRAFT',
|
|
176
|
+
* });
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
putElement(
|
|
180
|
+
elementID: string,
|
|
181
|
+
params: NotificationPutElementParams,
|
|
182
|
+
options?: RequestOptions,
|
|
183
|
+
): APIPromise<NotificationContentMutationResponse> {
|
|
184
|
+
const { id, ...body } = params;
|
|
185
|
+
return this._client.put(path`/notifications/${id}/elements/${elementID}`, { body, ...options });
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Set locale-specific content overrides for a notification template. Each element
|
|
190
|
+
* override must reference an existing element by ID. Only supported for V2
|
|
191
|
+
* (elemental) templates.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```ts
|
|
195
|
+
* const notificationContentMutationResponse =
|
|
196
|
+
* await client.notifications.putLocale('localeId', {
|
|
197
|
+
* id: 'id',
|
|
198
|
+
* elements: [
|
|
199
|
+
* { id: 'elem_1', content: 'Hola {{data.name}}.' },
|
|
200
|
+
* { id: 'elem_2', title: 'Bienvenido!' },
|
|
201
|
+
* ],
|
|
202
|
+
* state: 'DRAFT',
|
|
203
|
+
* });
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
putLocale(
|
|
207
|
+
localeID: string,
|
|
208
|
+
params: NotificationPutLocaleParams,
|
|
209
|
+
options?: RequestOptions,
|
|
210
|
+
): APIPromise<NotificationContentMutationResponse> {
|
|
211
|
+
const { id, ...body } = params;
|
|
212
|
+
return this._client.put(path`/notifications/${id}/locales/${localeID}`, { body, ...options });
|
|
213
|
+
}
|
|
214
|
+
|
|
142
215
|
/**
|
|
143
216
|
* Replace a notification template. All fields are required.
|
|
144
217
|
*
|
|
@@ -170,14 +243,24 @@ export class Notifications extends APIResource {
|
|
|
170
243
|
}
|
|
171
244
|
|
|
172
245
|
/**
|
|
246
|
+
* Retrieve the content of a notification template. The response shape depends on
|
|
247
|
+
* whether the template uses V1 (blocks/channels) or V2 (elemental) content. Use
|
|
248
|
+
* the `version` query parameter to select draft, published, or a specific
|
|
249
|
+
* historical version.
|
|
250
|
+
*
|
|
173
251
|
* @example
|
|
174
252
|
* ```ts
|
|
175
|
-
* const
|
|
176
|
-
*
|
|
253
|
+
* const response = await client.notifications.retrieveContent(
|
|
254
|
+
* 'id',
|
|
255
|
+
* );
|
|
177
256
|
* ```
|
|
178
257
|
*/
|
|
179
|
-
retrieveContent(
|
|
180
|
-
|
|
258
|
+
retrieveContent(
|
|
259
|
+
id: string,
|
|
260
|
+
query: NotificationRetrieveContentParams | null | undefined = {},
|
|
261
|
+
options?: RequestOptions,
|
|
262
|
+
): APIPromise<NotificationRetrieveContentResponse> {
|
|
263
|
+
return this._client.get(path`/notifications/${id}/content`, { query, ...options });
|
|
181
264
|
}
|
|
182
265
|
}
|
|
183
266
|
|
|
@@ -193,6 +276,145 @@ export interface Check extends BaseCheck {
|
|
|
193
276
|
updated: number;
|
|
194
277
|
}
|
|
195
278
|
|
|
279
|
+
/**
|
|
280
|
+
* An element with its content checksum and optional nested elements and locale
|
|
281
|
+
* checksums.
|
|
282
|
+
*/
|
|
283
|
+
export interface ElementWithChecksums {
|
|
284
|
+
/**
|
|
285
|
+
* MD5 hash of translatable content.
|
|
286
|
+
*/
|
|
287
|
+
checksum: string;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Element type (text, meta, action, etc.).
|
|
291
|
+
*/
|
|
292
|
+
type: string;
|
|
293
|
+
|
|
294
|
+
id?: string;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Nested child elements (for group-type elements).
|
|
298
|
+
*/
|
|
299
|
+
elements?: Array<ElementWithChecksums>;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Locale-specific content with checksums.
|
|
303
|
+
*/
|
|
304
|
+
locales?: { [key: string]: ElementWithChecksums.Locales };
|
|
305
|
+
|
|
306
|
+
[k: string]: unknown;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export namespace ElementWithChecksums {
|
|
310
|
+
export interface Locales {
|
|
311
|
+
checksum: string;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Elemental content response for V2 templates. Contains versioned elements with
|
|
317
|
+
* content checksums.
|
|
318
|
+
*/
|
|
319
|
+
export interface NotificationContentGetResponse {
|
|
320
|
+
elements: Array<ElementWithChecksums>;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Content version identifier.
|
|
324
|
+
*/
|
|
325
|
+
version: string;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Shared mutation response for `PUT` content, `PUT` element, and `PUT` locale
|
|
330
|
+
* operations. Contains the template ID, content version, per-element checksums,
|
|
331
|
+
* and resulting state.
|
|
332
|
+
*/
|
|
333
|
+
export interface NotificationContentMutationResponse {
|
|
334
|
+
/**
|
|
335
|
+
* Template ID.
|
|
336
|
+
*/
|
|
337
|
+
id: string;
|
|
338
|
+
|
|
339
|
+
elements: Array<NotificationContentMutationResponse.Element>;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Template state. Defaults to `DRAFT`.
|
|
343
|
+
*/
|
|
344
|
+
state: NotificationTemplateState;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Content version identifier.
|
|
348
|
+
*/
|
|
349
|
+
version: string;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export namespace NotificationContentMutationResponse {
|
|
353
|
+
export interface Element {
|
|
354
|
+
id: string;
|
|
355
|
+
|
|
356
|
+
checksum: string;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Request body for replacing the elemental content of a notification template.
|
|
362
|
+
*/
|
|
363
|
+
export interface NotificationContentPutRequest {
|
|
364
|
+
/**
|
|
365
|
+
* Elemental content payload. The server defaults `version` when omitted.
|
|
366
|
+
*/
|
|
367
|
+
content: NotificationContentPutRequest.Content;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Template state. Defaults to `DRAFT`.
|
|
371
|
+
*/
|
|
372
|
+
state?: NotificationTemplateState;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export namespace NotificationContentPutRequest {
|
|
376
|
+
/**
|
|
377
|
+
* Elemental content payload. The server defaults `version` when omitted.
|
|
378
|
+
*/
|
|
379
|
+
export interface Content {
|
|
380
|
+
elements: Array<Shared.ElementalNode>;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
|
|
384
|
+
* omitted.
|
|
385
|
+
*/
|
|
386
|
+
version?: string;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Request body for updating a single element. Additional type-specific fields are
|
|
392
|
+
* allowed.
|
|
393
|
+
*/
|
|
394
|
+
export interface NotificationElementPutRequest {
|
|
395
|
+
/**
|
|
396
|
+
* Element type (text, meta, action, image, etc.).
|
|
397
|
+
*/
|
|
398
|
+
type: string;
|
|
399
|
+
|
|
400
|
+
channels?: Array<string>;
|
|
401
|
+
|
|
402
|
+
data?: { [key: string]: unknown };
|
|
403
|
+
|
|
404
|
+
if?: string;
|
|
405
|
+
|
|
406
|
+
loop?: string;
|
|
407
|
+
|
|
408
|
+
ref?: string;
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Template state. Defaults to `DRAFT`.
|
|
412
|
+
*/
|
|
413
|
+
state?: NotificationTemplateState;
|
|
414
|
+
|
|
415
|
+
[k: string]: unknown;
|
|
416
|
+
}
|
|
417
|
+
|
|
196
418
|
export interface NotificationGetContent {
|
|
197
419
|
blocks?: Array<NotificationGetContent.Block> | null;
|
|
198
420
|
|
|
@@ -259,6 +481,33 @@ export namespace NotificationGetContent {
|
|
|
259
481
|
}
|
|
260
482
|
}
|
|
261
483
|
|
|
484
|
+
/**
|
|
485
|
+
* Request body for setting locale-specific content overrides. Each element
|
|
486
|
+
* override must include the target element ID.
|
|
487
|
+
*/
|
|
488
|
+
export interface NotificationLocalePutRequest {
|
|
489
|
+
/**
|
|
490
|
+
* Elements with locale-specific content overrides.
|
|
491
|
+
*/
|
|
492
|
+
elements: Array<NotificationLocalePutRequest.Element>;
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Template state. Defaults to `DRAFT`.
|
|
496
|
+
*/
|
|
497
|
+
state?: NotificationTemplateState;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
export namespace NotificationLocalePutRequest {
|
|
501
|
+
export interface Element {
|
|
502
|
+
/**
|
|
503
|
+
* Target element ID.
|
|
504
|
+
*/
|
|
505
|
+
id: string;
|
|
506
|
+
|
|
507
|
+
[k: string]: unknown;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
262
511
|
/**
|
|
263
512
|
* Request body for creating a notification template.
|
|
264
513
|
*/
|
|
@@ -417,6 +666,11 @@ export interface NotificationTemplatePublishRequest {
|
|
|
417
666
|
version?: string;
|
|
418
667
|
}
|
|
419
668
|
|
|
669
|
+
/**
|
|
670
|
+
* Template state. Defaults to `DRAFT`.
|
|
671
|
+
*/
|
|
672
|
+
export type NotificationTemplateState = 'DRAFT' | 'PUBLISHED';
|
|
673
|
+
|
|
420
674
|
/**
|
|
421
675
|
* V2 (CDS) template summary returned in list responses.
|
|
422
676
|
*/
|
|
@@ -548,6 +802,12 @@ export namespace NotificationListResponse {
|
|
|
548
802
|
}
|
|
549
803
|
}
|
|
550
804
|
|
|
805
|
+
/**
|
|
806
|
+
* Elemental content response for V2 templates. Contains versioned elements with
|
|
807
|
+
* content checksums.
|
|
808
|
+
*/
|
|
809
|
+
export type NotificationRetrieveContentResponse = NotificationContentGetResponse | NotificationGetContent;
|
|
810
|
+
|
|
551
811
|
export interface NotificationCreateParams {
|
|
552
812
|
/**
|
|
553
813
|
* Full document shape used in POST and PUT request bodies, and returned inside the
|
|
@@ -606,6 +866,105 @@ export interface NotificationPublishParams {
|
|
|
606
866
|
version?: string;
|
|
607
867
|
}
|
|
608
868
|
|
|
869
|
+
export interface NotificationPutContentParams {
|
|
870
|
+
/**
|
|
871
|
+
* Elemental content payload. The server defaults `version` when omitted.
|
|
872
|
+
*/
|
|
873
|
+
content: NotificationPutContentParams.Content;
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Template state. Defaults to `DRAFT`.
|
|
877
|
+
*/
|
|
878
|
+
state?: NotificationTemplateState;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
export namespace NotificationPutContentParams {
|
|
882
|
+
/**
|
|
883
|
+
* Elemental content payload. The server defaults `version` when omitted.
|
|
884
|
+
*/
|
|
885
|
+
export interface Content {
|
|
886
|
+
elements: Array<Shared.ElementalNode>;
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
|
|
890
|
+
* omitted.
|
|
891
|
+
*/
|
|
892
|
+
version?: string;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
export interface NotificationPutElementParams {
|
|
897
|
+
/**
|
|
898
|
+
* Path param: Notification template ID (`nt_` prefix).
|
|
899
|
+
*/
|
|
900
|
+
id: string;
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* Body param: Element type (text, meta, action, image, etc.).
|
|
904
|
+
*/
|
|
905
|
+
type: string;
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* Body param
|
|
909
|
+
*/
|
|
910
|
+
channels?: Array<string>;
|
|
911
|
+
|
|
912
|
+
/**
|
|
913
|
+
* Body param
|
|
914
|
+
*/
|
|
915
|
+
data?: { [key: string]: unknown };
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Body param
|
|
919
|
+
*/
|
|
920
|
+
if?: string;
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Body param
|
|
924
|
+
*/
|
|
925
|
+
loop?: string;
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Body param
|
|
929
|
+
*/
|
|
930
|
+
ref?: string;
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Body param: Template state. Defaults to `DRAFT`.
|
|
934
|
+
*/
|
|
935
|
+
state?: NotificationTemplateState;
|
|
936
|
+
|
|
937
|
+
[k: string]: unknown;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
export interface NotificationPutLocaleParams {
|
|
941
|
+
/**
|
|
942
|
+
* Path param: Notification template ID (`nt_` prefix).
|
|
943
|
+
*/
|
|
944
|
+
id: string;
|
|
945
|
+
|
|
946
|
+
/**
|
|
947
|
+
* Body param: Elements with locale-specific content overrides.
|
|
948
|
+
*/
|
|
949
|
+
elements: Array<NotificationPutLocaleParams.Element>;
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Body param: Template state. Defaults to `DRAFT`.
|
|
953
|
+
*/
|
|
954
|
+
state?: NotificationTemplateState;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
export namespace NotificationPutLocaleParams {
|
|
958
|
+
export interface Element {
|
|
959
|
+
/**
|
|
960
|
+
* Target element ID.
|
|
961
|
+
*/
|
|
962
|
+
id: string;
|
|
963
|
+
|
|
964
|
+
[k: string]: unknown;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
|
|
609
968
|
export interface NotificationReplaceParams {
|
|
610
969
|
/**
|
|
611
970
|
* Full document shape used in POST and PUT request bodies, and returned inside the
|
|
@@ -620,34 +979,51 @@ export interface NotificationReplaceParams {
|
|
|
620
979
|
state?: 'DRAFT' | 'PUBLISHED';
|
|
621
980
|
}
|
|
622
981
|
|
|
623
|
-
|
|
982
|
+
export interface NotificationRetrieveContentParams {
|
|
983
|
+
/**
|
|
984
|
+
* Accepts `draft`, `published`, or a version string (e.g., `v001`). Defaults to
|
|
985
|
+
* `published`.
|
|
986
|
+
*/
|
|
987
|
+
version?: string;
|
|
988
|
+
}
|
|
989
|
+
|
|
624
990
|
Notifications.Checks = Checks;
|
|
625
991
|
|
|
626
992
|
export declare namespace Notifications {
|
|
627
993
|
export {
|
|
628
994
|
type BaseCheck as BaseCheck,
|
|
629
995
|
type Check as Check,
|
|
996
|
+
type ElementWithChecksums as ElementWithChecksums,
|
|
997
|
+
type NotificationContentGetResponse as NotificationContentGetResponse,
|
|
998
|
+
type NotificationContentMutationResponse as NotificationContentMutationResponse,
|
|
999
|
+
type NotificationContentPutRequest as NotificationContentPutRequest,
|
|
1000
|
+
type NotificationElementPutRequest as NotificationElementPutRequest,
|
|
630
1001
|
type NotificationGetContent as NotificationGetContent,
|
|
1002
|
+
type NotificationLocalePutRequest as NotificationLocalePutRequest,
|
|
631
1003
|
type NotificationTemplateCreateRequest as NotificationTemplateCreateRequest,
|
|
632
1004
|
type NotificationTemplateGetResponse as NotificationTemplateGetResponse,
|
|
633
1005
|
type NotificationTemplateMutationResponse as NotificationTemplateMutationResponse,
|
|
634
1006
|
type NotificationTemplatePayload as NotificationTemplatePayload,
|
|
635
1007
|
type NotificationTemplatePublishRequest as NotificationTemplatePublishRequest,
|
|
1008
|
+
type NotificationTemplateState as NotificationTemplateState,
|
|
636
1009
|
type NotificationTemplateSummary as NotificationTemplateSummary,
|
|
637
1010
|
type NotificationTemplateUpdateRequest as NotificationTemplateUpdateRequest,
|
|
638
1011
|
type NotificationTemplateVersionListResponse as NotificationTemplateVersionListResponse,
|
|
639
1012
|
type VersionNode as VersionNode,
|
|
640
1013
|
type NotificationListResponse as NotificationListResponse,
|
|
1014
|
+
type NotificationRetrieveContentResponse as NotificationRetrieveContentResponse,
|
|
641
1015
|
type NotificationCreateParams as NotificationCreateParams,
|
|
642
1016
|
type NotificationRetrieveParams as NotificationRetrieveParams,
|
|
643
1017
|
type NotificationListParams as NotificationListParams,
|
|
644
1018
|
type NotificationListVersionsParams as NotificationListVersionsParams,
|
|
645
1019
|
type NotificationPublishParams as NotificationPublishParams,
|
|
1020
|
+
type NotificationPutContentParams as NotificationPutContentParams,
|
|
1021
|
+
type NotificationPutElementParams as NotificationPutElementParams,
|
|
1022
|
+
type NotificationPutLocaleParams as NotificationPutLocaleParams,
|
|
646
1023
|
type NotificationReplaceParams as NotificationReplaceParams,
|
|
1024
|
+
type NotificationRetrieveContentParams as NotificationRetrieveContentParams,
|
|
647
1025
|
};
|
|
648
1026
|
|
|
649
|
-
export { Draft as Draft };
|
|
650
|
-
|
|
651
1027
|
export {
|
|
652
1028
|
Checks as Checks,
|
|
653
1029
|
type CheckUpdateResponse as CheckUpdateResponse,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import * as Shared from './shared';
|
|
5
|
+
import * as NotificationsAPI from './notifications/notifications';
|
|
5
6
|
import { APIPromise } from '../core/api-promise';
|
|
6
7
|
import { buildHeaders } from '../internal/headers';
|
|
7
8
|
import { RequestOptions } from '../internal/request-options';
|
|
@@ -81,6 +82,24 @@ export class RoutingStrategies extends APIResource {
|
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
|
|
85
|
+
/**
|
|
86
|
+
* List notification templates associated with a routing strategy. Includes
|
|
87
|
+
* template metadata only, not full content.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* const associatedNotificationListResponse =
|
|
92
|
+
* await client.routingStrategies.listNotifications('id');
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
listNotifications(
|
|
96
|
+
id: string,
|
|
97
|
+
query: RoutingStrategyListNotificationsParams | null | undefined = {},
|
|
98
|
+
options?: RequestOptions,
|
|
99
|
+
): APIPromise<AssociatedNotificationListResponse> {
|
|
100
|
+
return this._client.get(path`/routing-strategies/${id}/notifications`, { query, ...options });
|
|
101
|
+
}
|
|
102
|
+
|
|
84
103
|
/**
|
|
85
104
|
* Replace a routing strategy. Full document replacement; the caller must send the
|
|
86
105
|
* complete desired state. Missing optional fields are cleared.
|
|
@@ -107,6 +126,15 @@ export class RoutingStrategies extends APIResource {
|
|
|
107
126
|
}
|
|
108
127
|
}
|
|
109
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Paginated list of notification templates associated with a routing strategy.
|
|
131
|
+
*/
|
|
132
|
+
export interface AssociatedNotificationListResponse {
|
|
133
|
+
paging: Shared.Paging;
|
|
134
|
+
|
|
135
|
+
results: Array<NotificationsAPI.NotificationTemplateSummary>;
|
|
136
|
+
}
|
|
137
|
+
|
|
110
138
|
/**
|
|
111
139
|
* Request body for creating a routing strategy.
|
|
112
140
|
*/
|
|
@@ -347,6 +375,18 @@ export interface RoutingStrategyListParams {
|
|
|
347
375
|
limit?: number;
|
|
348
376
|
}
|
|
349
377
|
|
|
378
|
+
export interface RoutingStrategyListNotificationsParams {
|
|
379
|
+
/**
|
|
380
|
+
* Opaque pagination cursor from a previous response. Omit for the first page.
|
|
381
|
+
*/
|
|
382
|
+
cursor?: string | null;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Maximum number of results per page. Default 20, max 100.
|
|
386
|
+
*/
|
|
387
|
+
limit?: number;
|
|
388
|
+
}
|
|
389
|
+
|
|
350
390
|
export interface RoutingStrategyReplaceParams {
|
|
351
391
|
/**
|
|
352
392
|
* Human-readable name for the routing strategy.
|
|
@@ -381,6 +421,7 @@ export interface RoutingStrategyReplaceParams {
|
|
|
381
421
|
|
|
382
422
|
export declare namespace RoutingStrategies {
|
|
383
423
|
export {
|
|
424
|
+
type AssociatedNotificationListResponse as AssociatedNotificationListResponse,
|
|
384
425
|
type RoutingStrategyCreateRequest as RoutingStrategyCreateRequest,
|
|
385
426
|
type RoutingStrategyGetResponse as RoutingStrategyGetResponse,
|
|
386
427
|
type RoutingStrategyListResponse as RoutingStrategyListResponse,
|
|
@@ -389,6 +430,7 @@ export declare namespace RoutingStrategies {
|
|
|
389
430
|
type RoutingStrategySummary as RoutingStrategySummary,
|
|
390
431
|
type RoutingStrategyCreateParams as RoutingStrategyCreateParams,
|
|
391
432
|
type RoutingStrategyListParams as RoutingStrategyListParams,
|
|
433
|
+
type RoutingStrategyListNotificationsParams as RoutingStrategyListNotificationsParams,
|
|
392
434
|
type RoutingStrategyReplaceParams as RoutingStrategyReplaceParams,
|
|
393
435
|
};
|
|
394
436
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '7.
|
|
1
|
+
export const VERSION = '7.10.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "7.
|
|
1
|
+
export declare const VERSION = "7.10.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "7.
|
|
1
|
+
export declare const VERSION = "7.10.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
|
package/version.js
CHANGED
package/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '7.
|
|
1
|
+
export const VERSION = '7.10.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
-
import * as NotificationsAPI from "./notifications.mjs";
|
|
3
|
-
import { APIPromise } from "../../core/api-promise.mjs";
|
|
4
|
-
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
5
|
-
export declare class Draft extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* @example
|
|
8
|
-
* ```ts
|
|
9
|
-
* const notificationGetContent =
|
|
10
|
-
* await client.notifications.draft.retrieveContent('id');
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
retrieveContent(id: string, options?: RequestOptions): APIPromise<NotificationsAPI.NotificationGetContent>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=draft.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"draft.d.mts","sourceRoot":"","sources":["../../src/resources/notifications/draft.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,gBAAgB;OACrB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,gBAAgB,CAAC,sBAAsB,CAAC;CAG3G"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../core/resource.js";
|
|
2
|
-
import * as NotificationsAPI from "./notifications.js";
|
|
3
|
-
import { APIPromise } from "../../core/api-promise.js";
|
|
4
|
-
import { RequestOptions } from "../../internal/request-options.js";
|
|
5
|
-
export declare class Draft extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* @example
|
|
8
|
-
* ```ts
|
|
9
|
-
* const notificationGetContent =
|
|
10
|
-
* await client.notifications.draft.retrieveContent('id');
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
retrieveContent(id: string, options?: RequestOptions): APIPromise<NotificationsAPI.NotificationGetContent>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=draft.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../src/resources/notifications/draft.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,gBAAgB;OACrB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,gBAAgB,CAAC,sBAAsB,CAAC;CAG3G"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Draft = void 0;
|
|
5
|
-
const resource_1 = require("../../core/resource.js");
|
|
6
|
-
const path_1 = require("../../internal/utils/path.js");
|
|
7
|
-
class Draft extends resource_1.APIResource {
|
|
8
|
-
/**
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* const notificationGetContent =
|
|
12
|
-
* await client.notifications.draft.retrieveContent('id');
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
retrieveContent(id, options) {
|
|
16
|
-
return this._client.get((0, path_1.path) `/notifications/${id}/draft/content`, options);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.Draft = Draft;
|
|
20
|
-
//# sourceMappingURL=draft.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"draft.js","sourceRoot":"","sources":["../../src/resources/notifications/draft.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;OAMG;IACH,eAAe,CAAC,EAAU,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,kBAAkB,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;CACF;AAXD,sBAWC"}
|