@trycourier/courier 9.1.0 → 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +7 -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/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/index.d.mts +1 -1
  10. package/resources/index.d.mts.map +1 -1
  11. package/resources/index.d.ts +1 -1
  12. package/resources/index.d.ts.map +1 -1
  13. package/resources/index.js.map +1 -1
  14. package/resources/index.mjs.map +1 -1
  15. package/resources/notifications/index.d.mts +1 -1
  16. package/resources/notifications/index.d.mts.map +1 -1
  17. package/resources/notifications/index.d.ts +1 -1
  18. package/resources/notifications/index.d.ts.map +1 -1
  19. package/resources/notifications/index.js.map +1 -1
  20. package/resources/notifications/index.mjs.map +1 -1
  21. package/resources/notifications/notifications.d.mts +133 -1
  22. package/resources/notifications/notifications.d.mts.map +1 -1
  23. package/resources/notifications/notifications.d.ts +133 -1
  24. package/resources/notifications/notifications.d.ts.map +1 -1
  25. package/resources/notifications/notifications.js +31 -0
  26. package/resources/notifications/notifications.js.map +1 -1
  27. package/resources/notifications/notifications.mjs +31 -0
  28. package/resources/notifications/notifications.mjs.map +1 -1
  29. package/src/client.ts +4 -0
  30. package/src/resources/index.ts +2 -0
  31. package/src/resources/notifications/index.ts +2 -0
  32. package/src/resources/notifications/notifications.ts +160 -0
  33. package/src/version.ts +1 -1
  34. package/version.d.mts +1 -1
  35. package/version.d.ts +1 -1
  36. package/version.js +1 -1
  37. package/version.mjs +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.mjs","sourceRoot":"","sources":["../../src/resources/notifications/notifications.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,KA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,CAAC,IAAI,CAAA,kBAAkB,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF;AAuwBD,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC"}
1
+ {"version":3,"file":"notifications.mjs","sourceRoot":"","sources":["../../src/resources/notifications/notifications.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,KAAK,SAAS,qBAAiB;AACtC,OAAO,EAML,MAAM,GACP,qBAAiB;AAElB,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IAA9C;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA4ThE,CAAC;IA1TC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CACJ,MAAgC,EAChC,OAAwB;QAExB,MAAM,EACJ,iBAAiB,EAAE,cAAc,EACjC,0BAA0B,EAAE,sBAAsB,EAClD,GAAG,IAAI,EACR,GAAG,MAAM,CAAC;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACzC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB;oBACE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBAC/E,GAAG,CAAC,sBAAsB,IAAI,IAAI,CAAC,CAAC;wBAClC,EAAE,0BAA0B,EAAE,sBAAsB,EAAE;wBACxD,CAAC,CAAC,SAAS,CAAC;iBACb;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;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E,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,EAAE,YAAY,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,OAAO,CACL,EAAU,EACV,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;;;OAUG;IACH,eAAe,CACb,EAAU,EACV,QAA8D,EAAE,EAChE,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF;AAi4BD,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC"}
package/src/client.ts CHANGED
@@ -207,10 +207,12 @@ import {
207
207
  NotificationCreateParams,
208
208
  NotificationElementPutRequest,
209
209
  NotificationGetContent,
210
+ NotificationGetMetricsParams,
210
211
  NotificationListParams,
211
212
  NotificationListResponse,
212
213
  NotificationListVersionsParams,
213
214
  NotificationLocalePutRequest,
215
+ NotificationMetricsResponse,
214
216
  NotificationPublishParams,
215
217
  NotificationPutContentParams,
216
218
  NotificationPutElementParams,
@@ -1318,6 +1320,7 @@ export declare namespace Courier {
1318
1320
  type NotificationElementPutRequest as NotificationElementPutRequest,
1319
1321
  type NotificationGetContent as NotificationGetContent,
1320
1322
  type NotificationLocalePutRequest as NotificationLocalePutRequest,
1323
+ type NotificationMetricsResponse as NotificationMetricsResponse,
1321
1324
  type NotificationTemplateAlias as NotificationTemplateAlias,
1322
1325
  type NotificationTemplateCreateRequest as NotificationTemplateCreateRequest,
1323
1326
  type NotificationTemplatePayload as NotificationTemplatePayload,
@@ -1334,6 +1337,7 @@ export declare namespace Courier {
1334
1337
  type NotificationCreateParams as NotificationCreateParams,
1335
1338
  type NotificationRetrieveParams as NotificationRetrieveParams,
1336
1339
  type NotificationListParams as NotificationListParams,
1340
+ type NotificationGetMetricsParams as NotificationGetMetricsParams,
1337
1341
  type NotificationListVersionsParams as NotificationListVersionsParams,
1338
1342
  type NotificationPublishParams as NotificationPublishParams,
1339
1343
  type NotificationPutContentParams as NotificationPutContentParams,
@@ -171,6 +171,7 @@ export {
171
171
  type NotificationElementPutRequest,
172
172
  type NotificationGetContent,
173
173
  type NotificationLocalePutRequest,
174
+ type NotificationMetricsResponse,
174
175
  type NotificationTemplateAlias,
175
176
  type NotificationTemplateCreateRequest,
176
177
  type NotificationTemplatePayload,
@@ -187,6 +188,7 @@ export {
187
188
  type NotificationCreateParams,
188
189
  type NotificationRetrieveParams,
189
190
  type NotificationListParams,
191
+ type NotificationGetMetricsParams,
190
192
  type NotificationListVersionsParams,
191
193
  type NotificationPublishParams,
192
194
  type NotificationPutContentParams,
@@ -19,6 +19,7 @@ export {
19
19
  type NotificationElementPutRequest,
20
20
  type NotificationGetContent,
21
21
  type NotificationLocalePutRequest,
22
+ type NotificationMetricsResponse,
22
23
  type NotificationTemplateAlias,
23
24
  type NotificationTemplateCreateRequest,
24
25
  type NotificationTemplatePayload,
@@ -35,6 +36,7 @@ export {
35
36
  type NotificationCreateParams,
36
37
  type NotificationRetrieveParams,
37
38
  type NotificationListParams,
39
+ type NotificationGetMetricsParams,
38
40
  type NotificationListVersionsParams,
39
41
  type NotificationPublishParams,
40
42
  type NotificationPutContentParams,
@@ -124,6 +124,42 @@ export class Notifications extends APIResource {
124
124
  });
125
125
  }
126
126
 
127
+ /**
128
+ * Fetch the delivery funnel for one Notification Template as a time series — sent,
129
+ * delivered, opened, clicked, errors, and undeliverable — broken out per provider
130
+ * and channel inside each bucket. Sum the entries in a bucket for its totals;
131
+ * there is no bucket-level total.
132
+ *
133
+ * Choose the window absolutely with `start` and `end`, or relatively with
134
+ * `lookback` (an ISO 8601 duration). `start` and `end` take precedence when both
135
+ * are supplied, and a request carrying neither defaults to `lookback=P30D`. The
136
+ * window is snapped outwards onto the `granularity` grid so every bucket it
137
+ * overlaps is returned whole, and the snapped boundaries come back as `start` and
138
+ * `end` — align a chart on those rather than on what was requested. Every boundary
139
+ * is UTC; there is no timezone support.
140
+ *
141
+ * Every bucket in the window is returned, including the quiet ones, whose `data`
142
+ * array is empty, so a series is directly plottable with no gap filling
143
+ * client-side. An unknown template id returns `200` with an all-empty series
144
+ * rather than `404`, and messages sent without a Notification Template never
145
+ * appear here.
146
+ *
147
+ * Available in the US region only.
148
+ *
149
+ * @example
150
+ * ```ts
151
+ * const notificationMetricsResponse =
152
+ * await client.notifications.getMetrics('x');
153
+ * ```
154
+ */
155
+ getMetrics(
156
+ id: string,
157
+ query: NotificationGetMetricsParams | null | undefined = {},
158
+ options?: RequestOptions,
159
+ ): APIPromise<NotificationMetricsResponse> {
160
+ return this._client.get(path`/notifications/${id}/metrics`, { query, ...options });
161
+ }
162
+
127
163
  /**
128
164
  * Returns a notification template's published versions, most recent first, for
129
165
  * comparison or rollback. Paged.
@@ -546,6 +582,96 @@ export namespace NotificationLocalePutRequest {
546
582
  }
547
583
  }
548
584
 
585
+ export interface NotificationMetricsResponse {
586
+ /**
587
+ * End of the window actually queried, ceiled onto the granularity grid.
588
+ * Second-precision UTC.
589
+ */
590
+ end: string;
591
+
592
+ /**
593
+ * Bucket size the series was built at.
594
+ */
595
+ granularity: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
596
+
597
+ /**
598
+ * The template the series describes, echoed from the request.
599
+ */
600
+ notificationId: string;
601
+
602
+ /**
603
+ * One entry per bucket between `start` and `end`, oldest first, including buckets
604
+ * with no activity.
605
+ */
606
+ series: Array<NotificationMetricsResponse.Series>;
607
+
608
+ /**
609
+ * Inclusive start of the window actually queried, floored onto the granularity
610
+ * grid. Second-precision UTC.
611
+ */
612
+ start: string;
613
+ }
614
+
615
+ export namespace NotificationMetricsResponse {
616
+ export interface Series {
617
+ /**
618
+ * One entry per provider and channel that handled a message in this bucket. Empty
619
+ * when nothing was sent.
620
+ */
621
+ data: Array<Series.Data>;
622
+
623
+ /**
624
+ * Start of the bucket, second-precision UTC.
625
+ */
626
+ period: string;
627
+ }
628
+
629
+ export namespace Series {
630
+ export interface Data {
631
+ /**
632
+ * Channel the provider delivered on, e.g. `email`.
633
+ */
634
+ channel: string;
635
+
636
+ /**
637
+ * Messages with at least one tracked link click.
638
+ */
639
+ clicked: number;
640
+
641
+ /**
642
+ * Messages the provider confirmed as delivered.
643
+ */
644
+ delivered: number;
645
+
646
+ /**
647
+ * Messages the provider rejected or failed on, including ones a later provider
648
+ * then delivered.
649
+ */
650
+ errors: number;
651
+
652
+ /**
653
+ * Messages opened at least once. Always `0` on channels with no open tracking.
654
+ */
655
+ opened: number;
656
+
657
+ /**
658
+ * Provider that handled the messages, e.g. `sendgrid`.
659
+ */
660
+ provider: string;
661
+
662
+ /**
663
+ * Messages handed to the provider.
664
+ */
665
+ sent: number;
666
+
667
+ /**
668
+ * Messages Courier could not deliver on any provider for the channel.
669
+ */
670
+ undeliverable: number;
671
+ }
672
+ }
673
+ }
674
+
549
675
  /**
550
676
  * A template's send-time alias as returned by a read, omitted entirely when it has
551
677
  * none. Usually a single string; an array for a template that resolves from
@@ -916,6 +1042,38 @@ export interface NotificationListParams {
916
1042
  notes?: boolean | null;
917
1043
  }
918
1044
 
1045
+ export interface NotificationGetMetricsParams {
1046
+ /**
1047
+ * The end of the window, as an ISO 8601 timestamp with an offset. Must be supplied
1048
+ * together with `start`. An `end` in the future is accepted and not clamped — the
1049
+ * trailing buckets come back empty.
1050
+ */
1051
+ end?: string;
1052
+
1053
+ /**
1054
+ * The size of each bucket in the series. Defaults to `DAY`. `WEEK` buckets start
1055
+ * on Sunday. A fine granularity caps the window it can cover: `HOUR` spans at most
1056
+ * 7 days and `DAY` at most 90 days, and a wider window returns `400` — request a
1057
+ * coarser granularity instead. `WEEK` and `MONTH` are uncapped, subject to the
1058
+ * 1000-bucket limit on a single response.
1059
+ */
1060
+ granularity?: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
1061
+
1062
+ /**
1063
+ * The length of the window, counted back from now, as an ISO 8601 duration
1064
+ * (`P30D`, `P12W`, `PT12H`). Defaults to `P30D`, and is ignored when `start` and
1065
+ * `end` are supplied. A malformed or non-positive duration returns `400`.
1066
+ */
1067
+ lookback?: string;
1068
+
1069
+ /**
1070
+ * The inclusive start of the window, as an ISO 8601 timestamp with an offset
1071
+ * (`2026-04-01T00:00:00Z`). Must be supplied together with `end` and be earlier
1072
+ * than it; either one alone returns `400`.
1073
+ */
1074
+ start?: string;
1075
+ }
1076
+
919
1077
  export interface NotificationListVersionsParams {
920
1078
  /**
921
1079
  * Opaque pagination cursor from a previous response. Omit for the first page.
@@ -1088,6 +1246,7 @@ export declare namespace Notifications {
1088
1246
  type NotificationElementPutRequest as NotificationElementPutRequest,
1089
1247
  type NotificationGetContent as NotificationGetContent,
1090
1248
  type NotificationLocalePutRequest as NotificationLocalePutRequest,
1249
+ type NotificationMetricsResponse as NotificationMetricsResponse,
1091
1250
  type NotificationTemplateAlias as NotificationTemplateAlias,
1092
1251
  type NotificationTemplateCreateRequest as NotificationTemplateCreateRequest,
1093
1252
  type NotificationTemplatePayload as NotificationTemplatePayload,
@@ -1104,6 +1263,7 @@ export declare namespace Notifications {
1104
1263
  type NotificationCreateParams as NotificationCreateParams,
1105
1264
  type NotificationRetrieveParams as NotificationRetrieveParams,
1106
1265
  type NotificationListParams as NotificationListParams,
1266
+ type NotificationGetMetricsParams as NotificationGetMetricsParams,
1107
1267
  type NotificationListVersionsParams as NotificationListVersionsParams,
1108
1268
  type NotificationPublishParams as NotificationPublishParams,
1109
1269
  type NotificationPutContentParams as NotificationPutContentParams,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '9.1.0'; // x-release-please-version
1
+ export const VERSION = '9.2.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "9.1.0";
1
+ export declare const VERSION = "9.2.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "9.1.0";
1
+ export declare const VERSION = "9.2.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 = '9.1.0'; // x-release-please-version
4
+ exports.VERSION = '9.2.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '9.1.0'; // x-release-please-version
1
+ export const VERSION = '9.2.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map