@trycourier/courier 7.10.1 → 7.10.2

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 (40) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/package.json +1 -1
  7. package/resources/index.d.mts +1 -1
  8. package/resources/index.d.mts.map +1 -1
  9. package/resources/index.d.ts +1 -1
  10. package/resources/index.d.ts.map +1 -1
  11. package/resources/notifications/checks.d.mts +13 -1
  12. package/resources/notifications/checks.d.mts.map +1 -1
  13. package/resources/notifications/checks.d.ts +13 -1
  14. package/resources/notifications/checks.d.ts.map +1 -1
  15. package/resources/notifications/checks.js +6 -0
  16. package/resources/notifications/checks.js.map +1 -1
  17. package/resources/notifications/checks.mjs +6 -0
  18. package/resources/notifications/checks.mjs.map +1 -1
  19. package/resources/notifications/index.d.mts +1 -1
  20. package/resources/notifications/index.d.mts.map +1 -1
  21. package/resources/notifications/index.d.ts +1 -1
  22. package/resources/notifications/index.d.ts.map +1 -1
  23. package/resources/notifications/notifications.d.mts +48 -62
  24. package/resources/notifications/notifications.d.mts.map +1 -1
  25. package/resources/notifications/notifications.d.ts +48 -62
  26. package/resources/notifications/notifications.d.ts.map +1 -1
  27. package/resources/notifications/notifications.js +3 -3
  28. package/resources/notifications/notifications.js.map +1 -1
  29. package/resources/notifications/notifications.mjs +3 -3
  30. package/resources/notifications/notifications.mjs.map +1 -1
  31. package/src/client.ts +2 -2
  32. package/src/resources/index.ts +1 -1
  33. package/src/resources/notifications/checks.ts +13 -1
  34. package/src/resources/notifications/index.ts +1 -1
  35. package/src/resources/notifications/notifications.ts +55 -73
  36. package/src/version.ts +1 -1
  37. package/version.d.mts +1 -1
  38. package/version.d.ts +1 -1
  39. package/version.js +1 -1
  40. package/version.mjs +1 -1
@@ -98,9 +98,9 @@ export {
98
98
  type NotificationGetContent,
99
99
  type NotificationLocalePutRequest,
100
100
  type NotificationTemplateCreateRequest,
101
- type NotificationTemplateGetResponse,
102
101
  type NotificationTemplatePayload,
103
102
  type NotificationTemplatePublishRequest,
103
+ type NotificationTemplateResponse,
104
104
  type NotificationTemplateState,
105
105
  type NotificationTemplateSummary,
106
106
  type NotificationTemplateUpdateRequest,
@@ -9,6 +9,8 @@ import { path } from '../../internal/utils/path';
9
9
 
10
10
  export class Checks extends APIResource {
11
11
  /**
12
+ * Replace the checks for a notification template submission.
13
+ *
12
14
  * @example
13
15
  * ```ts
14
16
  * const check = await client.notifications.checks.update(
@@ -36,6 +38,8 @@ export class Checks extends APIResource {
36
38
  }
37
39
 
38
40
  /**
41
+ * Retrieve the checks for a notification template submission.
42
+ *
39
43
  * @example
40
44
  * ```ts
41
45
  * const checks = await client.notifications.checks.list(
@@ -54,6 +58,8 @@ export class Checks extends APIResource {
54
58
  }
55
59
 
56
60
  /**
61
+ * Cancel a notification template submission.
62
+ *
57
63
  * @example
58
64
  * ```ts
59
65
  * await client.notifications.checks.delete('submissionId', {
@@ -80,7 +86,7 @@ export interface CheckListResponse {
80
86
 
81
87
  export interface CheckUpdateParams {
82
88
  /**
83
- * Path param
89
+ * Path param: Notification template ID.
84
90
  */
85
91
  id: string;
86
92
 
@@ -91,10 +97,16 @@ export interface CheckUpdateParams {
91
97
  }
92
98
 
93
99
  export interface CheckListParams {
100
+ /**
101
+ * Notification template ID.
102
+ */
94
103
  id: string;
95
104
  }
96
105
 
97
106
  export interface CheckDeleteParams {
107
+ /**
108
+ * Notification template ID.
109
+ */
98
110
  id: string;
99
111
  }
100
112
 
@@ -20,9 +20,9 @@ export {
20
20
  type NotificationGetContent,
21
21
  type NotificationLocalePutRequest,
22
22
  type NotificationTemplateCreateRequest,
23
- type NotificationTemplateGetResponse,
24
23
  type NotificationTemplatePayload,
25
24
  type NotificationTemplatePublishRequest,
25
+ type NotificationTemplateResponse,
26
26
  type NotificationTemplateState,
27
27
  type NotificationTemplateSummary,
28
28
  type NotificationTemplateUpdateRequest,
@@ -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,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '7.10.1'; // x-release-please-version
1
+ export const VERSION = '7.10.2'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "7.10.1";
1
+ export declare const VERSION = "7.10.2";
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.10.2";
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.10.2'; // 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.10.2'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map