@trycourier/courier 9.5.0 → 9.6.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 +13 -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/broadcasts.d.mts +1 -1
- package/resources/broadcasts.d.ts +1 -1
- package/resources/broadcasts.js +1 -1
- package/resources/broadcasts.mjs +1 -1
- package/resources/digests/digests.d.mts +59 -1
- package/resources/digests/digests.d.mts.map +1 -1
- package/resources/digests/digests.d.ts +59 -1
- package/resources/digests/digests.d.ts.map +1 -1
- package/resources/digests/digests.js.map +1 -1
- package/resources/digests/digests.mjs.map +1 -1
- package/resources/digests/index.d.mts +1 -1
- package/resources/digests/index.d.mts.map +1 -1
- package/resources/digests/index.d.ts +1 -1
- package/resources/digests/index.d.ts.map +1 -1
- package/resources/digests/index.js.map +1 -1
- package/resources/digests/index.mjs.map +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/journeys/journeys.d.mts +21 -2
- package/resources/journeys/journeys.d.mts.map +1 -1
- package/resources/journeys/journeys.d.ts +21 -2
- package/resources/journeys/journeys.d.ts.map +1 -1
- package/resources/journeys/journeys.js.map +1 -1
- package/resources/journeys/journeys.mjs.map +1 -1
- package/resources/users/preferences.d.mts +15 -0
- package/resources/users/preferences.d.mts.map +1 -1
- package/resources/users/preferences.d.ts +15 -0
- package/resources/users/preferences.d.ts.map +1 -1
- package/resources/workspace-preferences/index.d.mts +2 -2
- package/resources/workspace-preferences/index.d.mts.map +1 -1
- package/resources/workspace-preferences/index.d.ts +2 -2
- package/resources/workspace-preferences/index.d.ts.map +1 -1
- package/resources/workspace-preferences/index.js.map +1 -1
- package/resources/workspace-preferences/index.mjs.map +1 -1
- package/resources/workspace-preferences/topics.d.mts +82 -4
- package/resources/workspace-preferences/topics.d.mts.map +1 -1
- package/resources/workspace-preferences/topics.d.ts +82 -4
- package/resources/workspace-preferences/topics.d.ts.map +1 -1
- package/resources/workspace-preferences/topics.js +48 -3
- package/resources/workspace-preferences/topics.js.map +1 -1
- package/resources/workspace-preferences/topics.mjs +48 -3
- package/resources/workspace-preferences/topics.mjs.map +1 -1
- package/resources/workspace-preferences/workspace-preferences.d.mts +193 -3
- package/resources/workspace-preferences/workspace-preferences.d.mts.map +1 -1
- package/resources/workspace-preferences/workspace-preferences.d.ts +193 -3
- package/resources/workspace-preferences/workspace-preferences.d.ts.map +1 -1
- package/resources/workspace-preferences/workspace-preferences.js.map +1 -1
- package/resources/workspace-preferences/workspace-preferences.mjs.map +1 -1
- package/src/client.ts +16 -0
- package/src/resources/broadcasts.ts +1 -1
- package/src/resources/digests/digests.ts +81 -0
- package/src/resources/digests/index.ts +3 -0
- package/src/resources/index.ts +8 -0
- package/src/resources/journeys/journeys.ts +21 -2
- package/src/resources/users/preferences.ts +17 -0
- package/src/resources/workspace-preferences/index.ts +7 -0
- package/src/resources/workspace-preferences/topics.ts +108 -3
- package/src/resources/workspace-preferences/workspace-preferences.ts +229 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -26,6 +26,24 @@ export interface DigestCategory {
|
|
|
26
26
|
sort_key?: string;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* A day of the week. Accepted case-insensitively, returned lowercase.
|
|
31
|
+
*/
|
|
32
|
+
export type DigestDayOfWeek =
|
|
33
|
+
| 'sunday'
|
|
34
|
+
| 'monday'
|
|
35
|
+
| 'tuesday'
|
|
36
|
+
| 'wednesday'
|
|
37
|
+
| 'thursday'
|
|
38
|
+
| 'friday'
|
|
39
|
+
| 'saturday';
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* How often a digest is delivered. `instant` delivers immediately without
|
|
43
|
+
* batching, and is the one value that takes no `time`.
|
|
44
|
+
*/
|
|
45
|
+
export type DigestFrequency = 'instant' | 'daily' | 'weekdays' | 'weekly' | 'custom_days' | 'monthly';
|
|
46
|
+
|
|
29
47
|
export interface DigestInstance {
|
|
30
48
|
/**
|
|
31
49
|
* A unique identifier for the digest instance.
|
|
@@ -107,13 +125,76 @@ export interface DigestInstanceListResponse {
|
|
|
107
125
|
url?: string;
|
|
108
126
|
}
|
|
109
127
|
|
|
128
|
+
/**
|
|
129
|
+
* A delivery cadence for a topic's digest, with its assigned id.
|
|
130
|
+
*/
|
|
131
|
+
export interface TopicDigestScheduleResponse {
|
|
132
|
+
/**
|
|
133
|
+
* The schedule's identifier, assigned by the server. This is the value the
|
|
134
|
+
* `/digests/schedules/{schedule_id}` endpoints are keyed by.
|
|
135
|
+
*/
|
|
136
|
+
schedule_id: string;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* ISO-8601 timestamp of when the schedule was created.
|
|
140
|
+
*/
|
|
141
|
+
created?: string;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Day of the month, 1-31.
|
|
145
|
+
*/
|
|
146
|
+
day_of_month?: number;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* A day of the week. Accepted case-insensitively, returned lowercase.
|
|
150
|
+
*/
|
|
151
|
+
day_of_week?: DigestDayOfWeek;
|
|
152
|
+
|
|
153
|
+
days_of_week?: Array<DigestDayOfWeek>;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Whether the schedule is disabled.
|
|
157
|
+
*/
|
|
158
|
+
disabled?: boolean;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Omitted for a stored schedule this enum cannot express. Those schedules never
|
|
162
|
+
* fire, but their `schedule_id` is still returned so the `/digests/*` endpoints
|
|
163
|
+
* remain reachable for them.
|
|
164
|
+
*/
|
|
165
|
+
frequency?: DigestFrequency;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Whether this is the schedule recipients are placed on by default.
|
|
169
|
+
*/
|
|
170
|
+
is_default?: boolean;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 24-hour local delivery time, `HH:MM`.
|
|
174
|
+
*/
|
|
175
|
+
time?: string;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* IANA timezone the schedule is expressed in. Absent means UTC.
|
|
179
|
+
*/
|
|
180
|
+
timezone?: string;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* ISO-8601 timestamp of the last update.
|
|
184
|
+
*/
|
|
185
|
+
updated?: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
110
188
|
Digests.Schedules = Schedules;
|
|
111
189
|
|
|
112
190
|
export declare namespace Digests {
|
|
113
191
|
export {
|
|
114
192
|
type DigestCategory as DigestCategory,
|
|
193
|
+
type DigestDayOfWeek as DigestDayOfWeek,
|
|
194
|
+
type DigestFrequency as DigestFrequency,
|
|
115
195
|
type DigestInstance as DigestInstance,
|
|
116
196
|
type DigestInstanceListResponse as DigestInstanceListResponse,
|
|
197
|
+
type TopicDigestScheduleResponse as TopicDigestScheduleResponse,
|
|
117
198
|
};
|
|
118
199
|
|
|
119
200
|
export { Schedules as Schedules, type ScheduleListInstancesParams as ScheduleListInstancesParams };
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
export {
|
|
4
4
|
Digests,
|
|
5
5
|
type DigestCategory,
|
|
6
|
+
type DigestDayOfWeek,
|
|
7
|
+
type DigestFrequency,
|
|
6
8
|
type DigestInstance,
|
|
7
9
|
type DigestInstanceListResponse,
|
|
10
|
+
type TopicDigestScheduleResponse,
|
|
8
11
|
} from './digests';
|
|
9
12
|
export { Schedules, type ScheduleListInstancesParams } from './schedules';
|
package/src/resources/index.ts
CHANGED
|
@@ -81,8 +81,11 @@ export {
|
|
|
81
81
|
export {
|
|
82
82
|
Digests,
|
|
83
83
|
type DigestCategory,
|
|
84
|
+
type DigestDayOfWeek,
|
|
85
|
+
type DigestFrequency,
|
|
84
86
|
type DigestInstance,
|
|
85
87
|
type DigestInstanceListResponse,
|
|
88
|
+
type TopicDigestScheduleResponse,
|
|
86
89
|
} from './digests/digests';
|
|
87
90
|
export { Inbound, type InboundTrackEventResponse, type InboundTrackEventParams } from './inbound';
|
|
88
91
|
export {
|
|
@@ -265,6 +268,11 @@ export {
|
|
|
265
268
|
WorkspacePreferences,
|
|
266
269
|
type PublishPreferencesRequest,
|
|
267
270
|
type PublishPreferencesResponse,
|
|
271
|
+
type TopicDigestCategory,
|
|
272
|
+
type TopicDigestReleaseRequest,
|
|
273
|
+
type TopicDigestRequest,
|
|
274
|
+
type TopicDigestResponse,
|
|
275
|
+
type TopicDigestScheduleRequest,
|
|
268
276
|
type WorkspacePreferenceCreateRequest,
|
|
269
277
|
type WorkspacePreferenceGetResponse,
|
|
270
278
|
type WorkspacePreferenceListResponse,
|
|
@@ -446,10 +446,18 @@ export interface JourneyAudienceTriggerNode {
|
|
|
446
446
|
* - Binary form (3 elements): `[path, operator, value]` where `operator` is one of
|
|
447
447
|
* `is equal`, `is not equal`, `contains`, `does not contain`, `starts with`,
|
|
448
448
|
* `ends with`, `greater than`, `greater than or equal`, `less than`,
|
|
449
|
-
* `less than or equal`.
|
|
449
|
+
* `less than or equal`, `was`, `was not`.
|
|
450
450
|
*
|
|
451
451
|
* Example: `["user.tier", "is equal", "gold"]`.
|
|
452
452
|
*
|
|
453
|
+
* `was` / `was not` compare a `send_status.<nodeId>` path (referencing an
|
|
454
|
+
* earlier send node's node id) against one of `SENT`, `DELIVERED`, `OPENED`,
|
|
455
|
+
* `CLICKED`, `UNDELIVERABLE`. The first four are cumulative and ordered
|
|
456
|
+
* `SENT < DELIVERED < OPENED < CLICKED`, so `was DELIVERED` is true once the
|
|
457
|
+
* message has reached DELIVERED, OPENED, or CLICKED. `UNDELIVERABLE` is an exact
|
|
458
|
+
* match only and is never part of that ordering, in either direction. Example:
|
|
459
|
+
* `["send_status.P9Z3VCRJG647M7QNJZR3548HW741", "was", "DELIVERED"]`.
|
|
460
|
+
*
|
|
453
461
|
* - Unary form (2 elements): `[path, operator]` where `operator` is one of
|
|
454
462
|
* `exists`, `does not exist`.
|
|
455
463
|
*
|
|
@@ -769,7 +777,18 @@ export namespace JourneyNode {
|
|
|
769
777
|
/**
|
|
770
778
|
* Add the current event to a digest keyed by the given subscription topic. The
|
|
771
779
|
* digest accumulates events and releases them on the schedule configured for the
|
|
772
|
-
* topic.
|
|
780
|
+
* topic, using the notification template configured on that topic. This node's
|
|
781
|
+
* `type` value is `add-to-digest`.
|
|
782
|
+
*
|
|
783
|
+
* **The topic must have a template configured.** If the topic has no template when
|
|
784
|
+
* the first event reaches this node, the journey run fails immediately: the run is
|
|
785
|
+
* marked `ERROR`, no digest instance is created, and the journey does not continue
|
|
786
|
+
* past this node. Configure the topic's template before using the topic in a
|
|
787
|
+
* journey.
|
|
788
|
+
*
|
|
789
|
+
* If the journey run is scoped to a tenant, digests are kept separate per tenant:
|
|
790
|
+
* two runs for the same user under different tenants accumulate and release as
|
|
791
|
+
* separate digests, even on the same topic.
|
|
773
792
|
*/
|
|
774
793
|
export interface JourneyAddToDigestNode {
|
|
775
794
|
/**
|
|
@@ -239,6 +239,14 @@ export interface TopicPreference {
|
|
|
239
239
|
*/
|
|
240
240
|
custom_routing?: Array<Shared.ChannelClassification> | null;
|
|
241
241
|
|
|
242
|
+
/**
|
|
243
|
+
* The digest schedule this recipient is on for the topic. Omitted rather than null
|
|
244
|
+
* when they have not chosen one, in which case the topic's default schedule
|
|
245
|
+
* applies. Ids come from the topic's digest configuration or from
|
|
246
|
+
* `GET /digests/schedules`.
|
|
247
|
+
*/
|
|
248
|
+
digest_schedule_id?: string;
|
|
249
|
+
|
|
242
250
|
/**
|
|
243
251
|
* Whether the user has chosen specific delivery channels for this topic (listed in
|
|
244
252
|
* custom_routing) rather than the topic's default routing.
|
|
@@ -477,6 +485,15 @@ export namespace PreferenceUpdateOrCreateTopicParams {
|
|
|
477
485
|
*/
|
|
478
486
|
custom_routing?: Array<Shared.ChannelClassification> | null;
|
|
479
487
|
|
|
488
|
+
/**
|
|
489
|
+
* Put this recipient on one of the topic's digest schedules. Send `null` to clear
|
|
490
|
+
* the choice and return them to the topic's default. Omit to leave an existing
|
|
491
|
+
* choice alone, unlike the routing fields, which this endpoint replaces. An id
|
|
492
|
+
* that is not an active schedule on the topic is rejected with a `400` before
|
|
493
|
+
* anything is written.
|
|
494
|
+
*/
|
|
495
|
+
digest_schedule_id?: string | null;
|
|
496
|
+
|
|
480
497
|
/**
|
|
481
498
|
* Set to true to route this topic to the channels in custom_routing instead of the
|
|
482
499
|
* topic's default routing.
|
|
@@ -5,12 +5,19 @@ export {
|
|
|
5
5
|
type TopicCreateParams,
|
|
6
6
|
type TopicRetrieveParams,
|
|
7
7
|
type TopicArchiveParams,
|
|
8
|
+
type TopicDeleteDigestParams,
|
|
9
|
+
type TopicReleaseDigestParams,
|
|
8
10
|
type TopicReplaceParams,
|
|
9
11
|
} from './topics';
|
|
10
12
|
export {
|
|
11
13
|
WorkspacePreferences,
|
|
12
14
|
type PublishPreferencesRequest,
|
|
13
15
|
type PublishPreferencesResponse,
|
|
16
|
+
type TopicDigestCategory,
|
|
17
|
+
type TopicDigestReleaseRequest,
|
|
18
|
+
type TopicDigestRequest,
|
|
19
|
+
type TopicDigestResponse,
|
|
20
|
+
type TopicDigestScheduleRequest,
|
|
14
21
|
type WorkspacePreferenceCreateRequest,
|
|
15
22
|
type WorkspacePreferenceGetResponse,
|
|
16
23
|
type WorkspacePreferenceListResponse,
|
|
@@ -8,9 +8,6 @@ import { buildHeaders } from '../../internal/headers';
|
|
|
8
8
|
import { RequestOptions } from '../../internal/request-options';
|
|
9
9
|
import { path } from '../../internal/utils/path';
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* Manage the workspace catalog of subscription topics, the sections that group them, and publishing the preference page.
|
|
13
|
-
*/
|
|
14
11
|
export class Topics extends APIResource {
|
|
15
12
|
/**
|
|
16
13
|
* Creates a subscription topic inside a workspace preference. The default status
|
|
@@ -111,6 +108,60 @@ export class Topics extends APIResource {
|
|
|
111
108
|
});
|
|
112
109
|
}
|
|
113
110
|
|
|
111
|
+
/**
|
|
112
|
+
* Turn off a topic's digest, leaving the topic itself in place. The template is
|
|
113
|
+
* unlinked and the digest's schedules are removed along with their delivery rules.
|
|
114
|
+
* Equivalent to sending `digest: null` on a topic replace.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* await client.workspacePreferences.topics.deleteDigest(
|
|
119
|
+
* 'topic_id',
|
|
120
|
+
* { section_id: 'section_id' },
|
|
121
|
+
* );
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
deleteDigest(topicID: string, params: TopicDeleteDigestParams, options?: RequestOptions): APIPromise<void> {
|
|
125
|
+
const { section_id } = params;
|
|
126
|
+
return this._client.delete(path`/preferences/sections/${section_id}/topics/${topicID}/digest`, {
|
|
127
|
+
...options,
|
|
128
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Send one recipient's held digest now, instead of waiting for its schedule. Use
|
|
134
|
+
* it to preview what a digest will look like, or to let someone flush their own.
|
|
135
|
+
*
|
|
136
|
+
* Keyed on the topic because that is how a held digest is stored: one per
|
|
137
|
+
* recipient per topic, with the schedule recorded on it rather than part of its
|
|
138
|
+
* identity. To flush every recipient on a schedule instead, use
|
|
139
|
+
* `POST /digests/schedules/{schedule_id}/trigger`.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* await client.workspacePreferences.topics.releaseDigest(
|
|
144
|
+
* 'topic_id',
|
|
145
|
+
* {
|
|
146
|
+
* section_id: 'section_id',
|
|
147
|
+
* user_id: 'user_01h1p2c3d4e5f6g7h8',
|
|
148
|
+
* },
|
|
149
|
+
* );
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
releaseDigest(
|
|
153
|
+
topicID: string,
|
|
154
|
+
params: TopicReleaseDigestParams,
|
|
155
|
+
options?: RequestOptions,
|
|
156
|
+
): APIPromise<void> {
|
|
157
|
+
const { section_id, ...body } = params;
|
|
158
|
+
return this._client.post(path`/preferences/sections/${section_id}/topics/${topicID}/digest/release`, {
|
|
159
|
+
body,
|
|
160
|
+
...options,
|
|
161
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
114
165
|
/**
|
|
115
166
|
* Replace a topic within a workspace preference. Full document replacement;
|
|
116
167
|
* missing optional fields are cleared. Same 404 rules as GET.
|
|
@@ -168,6 +219,17 @@ export interface TopicCreateParams {
|
|
|
168
219
|
*/
|
|
169
220
|
description?: string | null;
|
|
170
221
|
|
|
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.
|
|
225
|
+
*
|
|
226
|
+
* Send `null` for the whole object to turn a digest off, which unlinks the
|
|
227
|
+
* template and removes its schedules. There is no `enabled` flag, and
|
|
228
|
+
* `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
229
|
+
* merely off.
|
|
230
|
+
*/
|
|
231
|
+
digest?: WorkspacePreferencesAPI.TopicDigestRequest | null;
|
|
232
|
+
|
|
171
233
|
/**
|
|
172
234
|
* Body param: Whether to include a list-unsubscribe header on emails for this
|
|
173
235
|
* topic.
|
|
@@ -218,6 +280,36 @@ export interface TopicArchiveParams {
|
|
|
218
280
|
section_id: string;
|
|
219
281
|
}
|
|
220
282
|
|
|
283
|
+
export interface TopicDeleteDigestParams {
|
|
284
|
+
/**
|
|
285
|
+
* The preference section containing the topic.
|
|
286
|
+
*/
|
|
287
|
+
section_id: string;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface TopicReleaseDigestParams {
|
|
291
|
+
/**
|
|
292
|
+
* Path param: The preference section containing the topic.
|
|
293
|
+
*/
|
|
294
|
+
section_id: string;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Body param: The recipient whose digest to release. Required: there is no
|
|
298
|
+
* "release everyone on this topic" form, because a whole-schedule flush already
|
|
299
|
+
* has its own endpoint and a body-shaped difference between one recipient and all
|
|
300
|
+
* of them is too easy to get wrong.
|
|
301
|
+
*/
|
|
302
|
+
user_id: string;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Body param: The recipient's tenant, when they were sent to as part of one -- the
|
|
306
|
+
* same value returned as `tenant_id` on a digest instance and sent as
|
|
307
|
+
* `message.context.tenant_id`. It is part of the held digest's key, so a tenanted
|
|
308
|
+
* recipient cannot be found without it. Omit for an ordinary recipient.
|
|
309
|
+
*/
|
|
310
|
+
tenant_id?: string;
|
|
311
|
+
}
|
|
312
|
+
|
|
221
313
|
export interface TopicReplaceParams {
|
|
222
314
|
/**
|
|
223
315
|
* Path param: Id of the workspace preference.
|
|
@@ -246,6 +338,17 @@ export interface TopicReplaceParams {
|
|
|
246
338
|
*/
|
|
247
339
|
description?: string | null;
|
|
248
340
|
|
|
341
|
+
/**
|
|
342
|
+
* Body param: A topic's digest configuration: the template that renders it, the
|
|
343
|
+
* cadences it delivers on, and how collected events are retained.
|
|
344
|
+
*
|
|
345
|
+
* Send `null` for the whole object to turn a digest off, which unlinks the
|
|
346
|
+
* template and removes its schedules. There is no `enabled` flag, and
|
|
347
|
+
* `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
348
|
+
* merely off.
|
|
349
|
+
*/
|
|
350
|
+
digest?: WorkspacePreferencesAPI.TopicDigestRequest | null;
|
|
351
|
+
|
|
249
352
|
/**
|
|
250
353
|
* Body param: Whether to include a list-unsubscribe header on emails for this
|
|
251
354
|
* topic.
|
|
@@ -268,6 +371,8 @@ export declare namespace Topics {
|
|
|
268
371
|
type TopicCreateParams as TopicCreateParams,
|
|
269
372
|
type TopicRetrieveParams as TopicRetrieveParams,
|
|
270
373
|
type TopicArchiveParams as TopicArchiveParams,
|
|
374
|
+
type TopicDeleteDigestParams as TopicDeleteDigestParams,
|
|
375
|
+
type TopicReleaseDigestParams as TopicReleaseDigestParams,
|
|
271
376
|
type TopicReplaceParams as TopicReplaceParams,
|
|
272
377
|
};
|
|
273
378
|
}
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as Shared from '../shared';
|
|
5
|
+
import * as DigestsAPI from '../digests/digests';
|
|
5
6
|
import * as TopicsAPI from './topics';
|
|
6
7
|
import {
|
|
7
8
|
TopicArchiveParams,
|
|
8
9
|
TopicCreateParams,
|
|
10
|
+
TopicDeleteDigestParams,
|
|
11
|
+
TopicReleaseDigestParams,
|
|
9
12
|
TopicReplaceParams,
|
|
10
13
|
TopicRetrieveParams,
|
|
11
14
|
Topics,
|
|
@@ -215,6 +218,198 @@ export interface PublishPreferencesResponse {
|
|
|
215
218
|
published_by?: string | null;
|
|
216
219
|
}
|
|
217
220
|
|
|
221
|
+
/**
|
|
222
|
+
* How events collected under a category key are retained when a digest holds more
|
|
223
|
+
* than it will render.
|
|
224
|
+
*/
|
|
225
|
+
export interface TopicDigestCategory {
|
|
226
|
+
/**
|
|
227
|
+
* The key that identifies the category within the digest.
|
|
228
|
+
*/
|
|
229
|
+
category_key: string;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* How many collected events are carried into the rendered digest. Defaults to 10.
|
|
233
|
+
*
|
|
234
|
+
* Events beyond the limit are discarded, not held back for the next digest: the
|
|
235
|
+
* release consumes everything collected so far and only `limit` of them appear.
|
|
236
|
+
* `retain` decides which ones those are.
|
|
237
|
+
*/
|
|
238
|
+
limit?: number;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Which collected events survive the `limit`. `FIRST` and `LOWEST` keep the
|
|
242
|
+
* earliest or smallest; `LAST` and `HIGHEST` keep the latest or largest. Accepted
|
|
243
|
+
* case-insensitively, returned uppercase.
|
|
244
|
+
*/
|
|
245
|
+
retain?: 'FIRST' | 'LAST' | 'HIGHEST' | 'LOWEST' | 'NONE';
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* The data key used to rank events. Required when `retain` is `HIGHEST` or
|
|
249
|
+
* `LOWEST`.
|
|
250
|
+
*/
|
|
251
|
+
sort_key?: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Which recipient's held digest to release.
|
|
256
|
+
*/
|
|
257
|
+
export interface TopicDigestReleaseRequest {
|
|
258
|
+
/**
|
|
259
|
+
* The recipient whose digest to release. Required: there is no "release everyone
|
|
260
|
+
* on this topic" form, because a whole-schedule flush already has its own endpoint
|
|
261
|
+
* and a body-shaped difference between one recipient and all of them is too easy
|
|
262
|
+
* to get wrong.
|
|
263
|
+
*/
|
|
264
|
+
user_id: string;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* The recipient's tenant, when they were sent to as part of one -- the same value
|
|
268
|
+
* returned as `tenant_id` on a digest instance and sent as
|
|
269
|
+
* `message.context.tenant_id`. It is part of the held digest's key, so a tenanted
|
|
270
|
+
* recipient cannot be found without it. Omit for an ordinary recipient.
|
|
271
|
+
*/
|
|
272
|
+
tenant_id?: string;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* A topic's digest configuration: the template that renders it, the cadences it
|
|
277
|
+
* delivers on, and how collected events are retained.
|
|
278
|
+
*
|
|
279
|
+
* Send `null` for the whole object to turn a digest off, which unlinks the
|
|
280
|
+
* template and removes its schedules. There is no `enabled` flag, and
|
|
281
|
+
* `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
282
|
+
* merely off.
|
|
283
|
+
*/
|
|
284
|
+
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
|
+
/**
|
|
293
|
+
* The notification template that renders the digest. A digest with no template
|
|
294
|
+
* collects nothing, so this is required.
|
|
295
|
+
*/
|
|
296
|
+
template_id: string;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Optional audience the digest is scoped to.
|
|
300
|
+
*/
|
|
301
|
+
audience_id?: string;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Retention rules per category key. Defaults to a single `digest` category
|
|
305
|
+
* retaining `FIRST`.
|
|
306
|
+
*/
|
|
307
|
+
categories?: Array<TopicDigestCategory>;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Whether to deliver the digest even when nothing was collected.
|
|
311
|
+
*/
|
|
312
|
+
trigger_empty?: boolean;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* A topic's digest configuration.
|
|
317
|
+
*/
|
|
318
|
+
export interface TopicDigestResponse {
|
|
319
|
+
/**
|
|
320
|
+
* Retention rules per category key.
|
|
321
|
+
*/
|
|
322
|
+
categories: Array<TopicDigestCategory>;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* The digest's delivery cadences, each with its server-assigned `schedule_id`.
|
|
326
|
+
*/
|
|
327
|
+
schedules: Array<DigestsAPI.TopicDigestScheduleResponse>;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* The notification template that renders the digest.
|
|
331
|
+
*/
|
|
332
|
+
template_id: string;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* The audience the digest is scoped to, when set.
|
|
336
|
+
*/
|
|
337
|
+
audience_id?: string;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* ISO-8601 timestamp of when the digest was configured.
|
|
341
|
+
*/
|
|
342
|
+
created?: string;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Whether the digest is delivered even when nothing was collected.
|
|
346
|
+
*/
|
|
347
|
+
trigger_empty?: boolean;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* ISO-8601 timestamp of the last update.
|
|
351
|
+
*/
|
|
352
|
+
updated?: string;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* One delivery cadence for a topic's digest. Supply `schedule_id` to update an
|
|
357
|
+
* existing schedule in place; omit it and one is assigned and returned. The
|
|
358
|
+
* `schedules` array is a full replacement, so a stored schedule absent from it is
|
|
359
|
+
* deleted along with its delivery rule.
|
|
360
|
+
*/
|
|
361
|
+
export interface TopicDigestScheduleRequest {
|
|
362
|
+
/**
|
|
363
|
+
* How often a digest is delivered. `instant` delivers immediately without
|
|
364
|
+
* batching, and is the one value that takes no `time`.
|
|
365
|
+
*/
|
|
366
|
+
frequency: DigestsAPI.DigestFrequency;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Required when `frequency` is `monthly`.
|
|
370
|
+
*/
|
|
371
|
+
day_of_month?: number;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Required when `frequency` is `weekly`.
|
|
375
|
+
*/
|
|
376
|
+
day_of_week?: DigestsAPI.DigestDayOfWeek;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Required when `frequency` is `custom_days`.
|
|
380
|
+
*/
|
|
381
|
+
days_of_week?: Array<DigestsAPI.DigestDayOfWeek>;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Whether the schedule is disabled.
|
|
385
|
+
*/
|
|
386
|
+
disabled?: boolean;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* The schedule recipients are placed on when they have not chosen one. Set this
|
|
390
|
+
* explicitly rather than relying on array position.
|
|
391
|
+
*/
|
|
392
|
+
is_default?: boolean;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Identifier of an existing schedule to update. Omit when creating a new one.
|
|
396
|
+
*/
|
|
397
|
+
schedule_id?: string;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* 24-hour local delivery time, `HH:MM`. Required for every frequency except
|
|
401
|
+
* `instant`.
|
|
402
|
+
*/
|
|
403
|
+
time?: string;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* IANA timezone the `time` and day fields are expressed in, e.g.
|
|
407
|
+
* `America/New_York`. Absent means UTC. Delivery follows the same local wall-clock
|
|
408
|
+
* across daylight-saving changes.
|
|
409
|
+
*/
|
|
410
|
+
timezone?: string;
|
|
411
|
+
}
|
|
412
|
+
|
|
218
413
|
/**
|
|
219
414
|
* Request body for creating a workspace preference.
|
|
220
415
|
*/
|
|
@@ -354,6 +549,17 @@ export interface WorkspacePreferenceTopicCreateRequest {
|
|
|
354
549
|
*/
|
|
355
550
|
description?: string | null;
|
|
356
551
|
|
|
552
|
+
/**
|
|
553
|
+
* A topic's digest configuration: the template that renders it, the cadences it
|
|
554
|
+
* delivers on, and how collected events are retained.
|
|
555
|
+
*
|
|
556
|
+
* Send `null` for the whole object to turn a digest off, which unlinks the
|
|
557
|
+
* template and removes its schedules. There is no `enabled` flag, and
|
|
558
|
+
* `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
559
|
+
* merely off.
|
|
560
|
+
*/
|
|
561
|
+
digest?: TopicDigestRequest | null;
|
|
562
|
+
|
|
357
563
|
/**
|
|
358
564
|
* Whether to include a list-unsubscribe header on emails for this topic.
|
|
359
565
|
*/
|
|
@@ -429,6 +635,11 @@ export interface WorkspacePreferenceTopicGetResponse {
|
|
|
429
635
|
*/
|
|
430
636
|
description?: string | null;
|
|
431
637
|
|
|
638
|
+
/**
|
|
639
|
+
* A topic's digest configuration.
|
|
640
|
+
*/
|
|
641
|
+
digest?: TopicDigestResponse | null;
|
|
642
|
+
|
|
432
643
|
/**
|
|
433
644
|
* Id of the last updater.
|
|
434
645
|
*/
|
|
@@ -468,6 +679,17 @@ export interface WorkspacePreferenceTopicReplaceRequest {
|
|
|
468
679
|
*/
|
|
469
680
|
description?: string | null;
|
|
470
681
|
|
|
682
|
+
/**
|
|
683
|
+
* A topic's digest configuration: the template that renders it, the cadences it
|
|
684
|
+
* delivers on, and how collected events are retained.
|
|
685
|
+
*
|
|
686
|
+
* Send `null` for the whole object to turn a digest off, which unlinks the
|
|
687
|
+
* template and removes its schedules. There is no `enabled` flag, and
|
|
688
|
+
* `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
689
|
+
* merely off.
|
|
690
|
+
*/
|
|
691
|
+
digest?: TopicDigestRequest | null;
|
|
692
|
+
|
|
471
693
|
/**
|
|
472
694
|
* Whether to include a list-unsubscribe header on emails for this topic.
|
|
473
695
|
*/
|
|
@@ -592,6 +814,11 @@ export declare namespace WorkspacePreferences {
|
|
|
592
814
|
export {
|
|
593
815
|
type PublishPreferencesRequest as PublishPreferencesRequest,
|
|
594
816
|
type PublishPreferencesResponse as PublishPreferencesResponse,
|
|
817
|
+
type TopicDigestCategory as TopicDigestCategory,
|
|
818
|
+
type TopicDigestReleaseRequest as TopicDigestReleaseRequest,
|
|
819
|
+
type TopicDigestRequest as TopicDigestRequest,
|
|
820
|
+
type TopicDigestResponse as TopicDigestResponse,
|
|
821
|
+
type TopicDigestScheduleRequest as TopicDigestScheduleRequest,
|
|
595
822
|
type WorkspacePreferenceCreateRequest as WorkspacePreferenceCreateRequest,
|
|
596
823
|
type WorkspacePreferenceGetResponse as WorkspacePreferenceGetResponse,
|
|
597
824
|
type WorkspacePreferenceListResponse as WorkspacePreferenceListResponse,
|
|
@@ -610,6 +837,8 @@ export declare namespace WorkspacePreferences {
|
|
|
610
837
|
type TopicCreateParams as TopicCreateParams,
|
|
611
838
|
type TopicRetrieveParams as TopicRetrieveParams,
|
|
612
839
|
type TopicArchiveParams as TopicArchiveParams,
|
|
840
|
+
type TopicDeleteDigestParams as TopicDeleteDigestParams,
|
|
841
|
+
type TopicReleaseDigestParams as TopicReleaseDigestParams,
|
|
613
842
|
type TopicReplaceParams as TopicReplaceParams,
|
|
614
843
|
};
|
|
615
844
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '9.
|
|
1
|
+
export const VERSION = '9.6.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "9.
|
|
1
|
+
export declare const VERSION = "9.6.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "9.
|
|
1
|
+
export declare const VERSION = "9.6.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '9.
|
|
1
|
+
export const VERSION = '9.6.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|