@trycourier/courier 9.6.0 → 9.7.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 (38) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +1 -1
  3. package/resources/digests/digests.d.mts +8 -0
  4. package/resources/digests/digests.d.mts.map +1 -1
  5. package/resources/digests/digests.d.ts +8 -0
  6. package/resources/digests/digests.d.ts.map +1 -1
  7. package/resources/digests/digests.js.map +1 -1
  8. package/resources/digests/digests.mjs.map +1 -1
  9. package/resources/journeys/journeys.d.mts +30 -0
  10. package/resources/journeys/journeys.d.mts.map +1 -1
  11. package/resources/journeys/journeys.d.ts +30 -0
  12. package/resources/journeys/journeys.d.ts.map +1 -1
  13. package/resources/journeys/journeys.js.map +1 -1
  14. package/resources/journeys/journeys.mjs.map +1 -1
  15. package/resources/users/preferences.d.mts +7 -2
  16. package/resources/users/preferences.d.mts.map +1 -1
  17. package/resources/users/preferences.d.ts +7 -2
  18. package/resources/users/preferences.d.ts.map +1 -1
  19. package/resources/workspace-preferences/topics.d.mts +62 -3
  20. package/resources/workspace-preferences/topics.d.mts.map +1 -1
  21. package/resources/workspace-preferences/topics.d.ts +62 -3
  22. package/resources/workspace-preferences/topics.d.ts.map +1 -1
  23. package/resources/workspace-preferences/workspace-preferences.d.mts +87 -9
  24. package/resources/workspace-preferences/workspace-preferences.d.mts.map +1 -1
  25. package/resources/workspace-preferences/workspace-preferences.d.ts +87 -9
  26. package/resources/workspace-preferences/workspace-preferences.d.ts.map +1 -1
  27. package/resources/workspace-preferences/workspace-preferences.js.map +1 -1
  28. package/resources/workspace-preferences/workspace-preferences.mjs.map +1 -1
  29. package/src/resources/digests/digests.ts +8 -0
  30. package/src/resources/journeys/journeys.ts +34 -0
  31. package/src/resources/users/preferences.ts +7 -2
  32. package/src/resources/workspace-preferences/topics.ts +67 -3
  33. package/src/resources/workspace-preferences/workspace-preferences.ts +93 -10
  34. package/src/version.ts +1 -1
  35. package/version.d.mts +1 -1
  36. package/version.d.ts +1 -1
  37. package/version.js +1 -1
  38. package/version.mjs +1 -1
@@ -220,15 +220,20 @@ export interface TopicCreateParams {
220
220
  description?: string | null;
221
221
 
222
222
  /**
223
- * Body param: A topic's digest configuration: the template that renders it, the
224
- * cadences it delivers on, and how collected events are retained.
223
+ * Body param: A topic's digest, as supplied when the topic itself is created: the
224
+ * template that renders it, the cadences it delivers on, and how collected events
225
+ * are retained.
226
+ *
227
+ * Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
228
+ * is required — a topic being created has no stored schedules for an absent key to
229
+ * leave alone.
225
230
  *
226
231
  * Send `null` for the whole object to turn a digest off, which unlinks the
227
232
  * template and removes its schedules. There is no `enabled` flag, and
228
233
  * `schedules: []` is rejected, because both states are un-deliverable rather than
229
234
  * merely off.
230
235
  */
231
- digest?: WorkspacePreferencesAPI.TopicDigestRequest | null;
236
+ digest?: TopicCreateParams.Digest | null;
232
237
 
233
238
  /**
234
239
  * Body param: Whether to include a list-unsubscribe header on emails for this
@@ -266,6 +271,65 @@ export interface TopicCreateParams {
266
271
  'x-idempotency-expiration'?: string;
267
272
  }
268
273
 
274
+ export namespace TopicCreateParams {
275
+ /**
276
+ * A topic's digest, as supplied when the topic itself is created: the template
277
+ * that renders it, the cadences it delivers on, and how collected events are
278
+ * retained.
279
+ *
280
+ * Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
281
+ * is required — a topic being created has no stored schedules for an absent key to
282
+ * leave alone.
283
+ *
284
+ * Send `null` for the whole object to turn a digest off, which unlinks the
285
+ * template and removes its schedules. There is no `enabled` flag, and
286
+ * `schedules: []` is rejected, because both states are un-deliverable rather than
287
+ * merely off.
288
+ */
289
+ export interface Digest {
290
+ /**
291
+ * The cadences this digest delivers on.
292
+ *
293
+ * The array replaces the stored schedules wholesale, so a schedule you leave out
294
+ * of it is deleted along with its delivery rule. Omit the key entirely to leave
295
+ * the stored schedules untouched — useful for changing `template_id` or
296
+ * `categories` without restating every schedule.
297
+ *
298
+ * A digest must end up with at least one schedule, because one with none collects
299
+ * events into an instance that can never fire. So sending `[]` is always a `400`,
300
+ * and so is omitting the key on a topic that has no schedules stored yet.
301
+ *
302
+ * On **create** the key is required outright: a topic being created has nothing
303
+ * stored to leave alone, and the topic row is written before its digest, so
304
+ * rejecting it any later would leave the topic behind and let a retry duplicate
305
+ * it.
306
+ */
307
+ schedules: Array<WorkspacePreferencesAPI.TopicDigestScheduleRequest>;
308
+
309
+ /**
310
+ * The notification template that renders the digest. A digest with no template
311
+ * collects nothing, so this is required.
312
+ */
313
+ template_id: string;
314
+
315
+ /**
316
+ * Optional audience the digest is scoped to.
317
+ */
318
+ audience_id?: string;
319
+
320
+ /**
321
+ * Retention rules per category key. Defaults to a single `digest` category
322
+ * retaining `FIRST`.
323
+ */
324
+ categories?: Array<WorkspacePreferencesAPI.TopicDigestCategory>;
325
+
326
+ /**
327
+ * Whether to deliver the digest even when nothing was collected.
328
+ */
329
+ trigger_empty?: boolean;
330
+ }
331
+ }
332
+
269
333
  export interface TopicRetrieveParams {
270
334
  /**
271
335
  * Id of the workspace preference.
@@ -1,6 +1,7 @@
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 WorkspacePreferencesAPI from './workspace-preferences';
4
5
  import * as Shared from '../shared';
5
6
  import * as DigestsAPI from '../digests/digests';
6
7
  import * as TopicsAPI from './topics';
@@ -282,13 +283,6 @@ export interface TopicDigestReleaseRequest {
282
283
  * merely off.
283
284
  */
284
285
  export interface TopicDigestRequest {
285
- /**
286
- * The cadences this digest delivers on. At least one is required: a digest with no
287
- * schedule collects events into an instance that can never fire. Omitting the key
288
- * on a replace leaves stored schedules untouched; sending `[]` is a `400`.
289
- */
290
- schedules: Array<TopicDigestScheduleRequest>;
291
-
292
286
  /**
293
287
  * The notification template that renders the digest. A digest with no template
294
288
  * collects nothing, so this is required.
@@ -306,6 +300,25 @@ export interface TopicDigestRequest {
306
300
  */
307
301
  categories?: Array<TopicDigestCategory>;
308
302
 
303
+ /**
304
+ * The cadences this digest delivers on.
305
+ *
306
+ * The array replaces the stored schedules wholesale, so a schedule you leave out
307
+ * of it is deleted along with its delivery rule. Omit the key entirely to leave
308
+ * the stored schedules untouched — useful for changing `template_id` or
309
+ * `categories` without restating every schedule.
310
+ *
311
+ * A digest must end up with at least one schedule, because one with none collects
312
+ * events into an instance that can never fire. So sending `[]` is always a `400`,
313
+ * and so is omitting the key on a topic that has no schedules stored yet.
314
+ *
315
+ * On **create** the key is required outright: a topic being created has nothing
316
+ * stored to leave alone, and the topic row is written before its digest, so
317
+ * rejecting it any later would leave the topic behind and let a retry duplicate
318
+ * it.
319
+ */
320
+ schedules?: Array<TopicDigestScheduleRequest>;
321
+
309
322
  /**
310
323
  * Whether to deliver the digest even when nothing was collected.
311
324
  */
@@ -357,6 +370,12 @@ export interface TopicDigestResponse {
357
370
  * existing schedule in place; omit it and one is assigned and returned. The
358
371
  * `schedules` array is a full replacement, so a stored schedule absent from it is
359
372
  * deleted along with its delivery rule.
373
+ *
374
+ * Updating by `schedule_id` replaces that schedule rather than merging into it:
375
+ * any field you leave out is cleared. Two of those change delivery silently — an
376
+ * omitted `timezone` reverts the schedule to UTC, and an omitted `is_default` can
377
+ * leave the topic with no default schedule, which is what recipients who have not
378
+ * chosen one fall back to. Restate every field you want to keep.
360
379
  */
361
380
  export interface TopicDigestScheduleRequest {
362
381
  /**
@@ -550,15 +569,20 @@ export interface WorkspacePreferenceTopicCreateRequest {
550
569
  description?: string | null;
551
570
 
552
571
  /**
553
- * A topic's digest configuration: the template that renders it, the cadences it
554
- * delivers on, and how collected events are retained.
572
+ * A topic's digest, as supplied when the topic itself is created: the template
573
+ * that renders it, the cadences it delivers on, and how collected events are
574
+ * retained.
575
+ *
576
+ * Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
577
+ * is required — a topic being created has no stored schedules for an absent key to
578
+ * leave alone.
555
579
  *
556
580
  * Send `null` for the whole object to turn a digest off, which unlinks the
557
581
  * template and removes its schedules. There is no `enabled` flag, and
558
582
  * `schedules: []` is rejected, because both states are un-deliverable rather than
559
583
  * merely off.
560
584
  */
561
- digest?: TopicDigestRequest | null;
585
+ digest?: WorkspacePreferenceTopicCreateRequest.Digest | null;
562
586
 
563
587
  /**
564
588
  * Whether to include a list-unsubscribe header on emails for this topic.
@@ -576,6 +600,65 @@ export interface WorkspacePreferenceTopicCreateRequest {
576
600
  topic_data?: { [key: string]: unknown } | null;
577
601
  }
578
602
 
603
+ export namespace WorkspacePreferenceTopicCreateRequest {
604
+ /**
605
+ * A topic's digest, as supplied when the topic itself is created: the template
606
+ * that renders it, the cadences it delivers on, and how collected events are
607
+ * retained.
608
+ *
609
+ * Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
610
+ * is required — a topic being created has no stored schedules for an absent key to
611
+ * leave alone.
612
+ *
613
+ * Send `null` for the whole object to turn a digest off, which unlinks the
614
+ * template and removes its schedules. There is no `enabled` flag, and
615
+ * `schedules: []` is rejected, because both states are un-deliverable rather than
616
+ * merely off.
617
+ */
618
+ export interface Digest {
619
+ /**
620
+ * The cadences this digest delivers on.
621
+ *
622
+ * The array replaces the stored schedules wholesale, so a schedule you leave out
623
+ * of it is deleted along with its delivery rule. Omit the key entirely to leave
624
+ * the stored schedules untouched — useful for changing `template_id` or
625
+ * `categories` without restating every schedule.
626
+ *
627
+ * A digest must end up with at least one schedule, because one with none collects
628
+ * events into an instance that can never fire. So sending `[]` is always a `400`,
629
+ * and so is omitting the key on a topic that has no schedules stored yet.
630
+ *
631
+ * On **create** the key is required outright: a topic being created has nothing
632
+ * stored to leave alone, and the topic row is written before its digest, so
633
+ * rejecting it any later would leave the topic behind and let a retry duplicate
634
+ * it.
635
+ */
636
+ schedules: Array<WorkspacePreferencesAPI.TopicDigestScheduleRequest>;
637
+
638
+ /**
639
+ * The notification template that renders the digest. A digest with no template
640
+ * collects nothing, so this is required.
641
+ */
642
+ template_id: string;
643
+
644
+ /**
645
+ * Optional audience the digest is scoped to.
646
+ */
647
+ audience_id?: string;
648
+
649
+ /**
650
+ * Retention rules per category key. Defaults to a single `digest` category
651
+ * retaining `FIRST`.
652
+ */
653
+ categories?: Array<WorkspacePreferencesAPI.TopicDigestCategory>;
654
+
655
+ /**
656
+ * Whether to deliver the digest even when nothing was collected.
657
+ */
658
+ trigger_empty?: boolean;
659
+ }
660
+ }
661
+
579
662
  /**
580
663
  * A subscription preference topic in your workspace.
581
664
  */
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '9.6.0'; // x-release-please-version
1
+ export const VERSION = '9.7.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "9.6.0";
1
+ export declare const VERSION = "9.7.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "9.6.0";
1
+ export declare const VERSION = "9.7.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.6.0'; // x-release-please-version
4
+ exports.VERSION = '9.7.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '9.6.0'; // x-release-please-version
1
+ export const VERSION = '9.7.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map