@trycourier/courier 9.4.4 → 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 +20 -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/brands.d.mts +39 -1
- package/resources/brands.d.mts.map +1 -1
- package/resources/brands.d.ts +39 -1
- package/resources/brands.d.ts.map +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/users/tokens.d.mts +18 -6
- package/resources/users/tokens.d.mts.map +1 -1
- package/resources/users/tokens.d.ts +18 -6
- package/resources/users/tokens.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/brands.ts +51 -2
- 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/users/tokens.ts +16 -6
- 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
package/src/resources/brands.ts
CHANGED
|
@@ -208,9 +208,58 @@ export interface BrandTemplate {
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
export interface EmailFooter {
|
|
211
|
-
content?: string | null;
|
|
212
|
-
|
|
213
211
|
inheritDefault?: boolean | null;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* The footer body, as markdown. This is the field the API returns and accepts; it
|
|
215
|
+
* is omitted entirely when no footer body is set. Sending null is accepted and
|
|
216
|
+
* treated as no footer body.
|
|
217
|
+
*/
|
|
218
|
+
markdown?: string | null;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Social links rendered in the email footer.
|
|
222
|
+
*/
|
|
223
|
+
social?: EmailFooter.Social | null;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export namespace EmailFooter {
|
|
227
|
+
/**
|
|
228
|
+
* Social links rendered in the email footer.
|
|
229
|
+
*/
|
|
230
|
+
export interface Social {
|
|
231
|
+
facebook?: Social.Facebook | null;
|
|
232
|
+
|
|
233
|
+
instagram?: Social.Instagram | null;
|
|
234
|
+
|
|
235
|
+
linkedin?: Social.Linkedin | null;
|
|
236
|
+
|
|
237
|
+
medium?: Social.Medium | null;
|
|
238
|
+
|
|
239
|
+
twitter?: Social.Twitter | null;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export namespace Social {
|
|
243
|
+
export interface Facebook {
|
|
244
|
+
url?: string | null;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export interface Instagram {
|
|
248
|
+
url?: string | null;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface Linkedin {
|
|
252
|
+
url?: string | null;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export interface Medium {
|
|
256
|
+
url?: string | null;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface Twitter {
|
|
260
|
+
url?: string | null;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
214
263
|
}
|
|
215
264
|
|
|
216
265
|
export interface EmailHead {
|
|
@@ -173,7 +173,7 @@ export class Broadcasts extends APIResource {
|
|
|
173
173
|
* const broadcast = await client.broadcasts.schedule(
|
|
174
174
|
* 'broadcastId',
|
|
175
175
|
* {
|
|
176
|
-
* recipient_id: '
|
|
176
|
+
* recipient_id: 'active-business-users',
|
|
177
177
|
* recipient_type: 'audience',
|
|
178
178
|
* scheduled_to: '2026-08-01T15:00:00',
|
|
179
179
|
* timezone: 'America/New_York',
|
|
@@ -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.
|
|
@@ -142,8 +142,12 @@ export interface UserToken {
|
|
|
142
142
|
device?: UserToken.Device | null;
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
145
|
+
* When the token expires. Accepts a date, or the boolean `false` to disable
|
|
146
|
+
* expiration entirely. ISO 8601 is recommended (for example
|
|
147
|
+
* `2026-10-25T00:00:00.000Z`). A value that cannot be parsed as a date is
|
|
148
|
+
* rejected; it is not treated as "no expiration" and does not fall back to the
|
|
149
|
+
* default. `true` is not a supported value. Omit the field to use the default,
|
|
150
|
+
* which expires a token that has not been re-registered for 60 days.
|
|
147
151
|
*/
|
|
148
152
|
expiry_date?: string | boolean | null;
|
|
149
153
|
|
|
@@ -268,9 +272,11 @@ export namespace TokenUpdateParams {
|
|
|
268
272
|
path: string;
|
|
269
273
|
|
|
270
274
|
/**
|
|
271
|
-
* The value for the operation.
|
|
275
|
+
* The value for the operation. A string for most fields; boolean `false` when
|
|
276
|
+
* disabling token expiration via `expiry_date`, which cannot be expressed as a
|
|
277
|
+
* string.
|
|
272
278
|
*/
|
|
273
|
-
value?: string | null;
|
|
279
|
+
value?: string | boolean | { [key: string]: unknown } | null;
|
|
274
280
|
}
|
|
275
281
|
}
|
|
276
282
|
|
|
@@ -298,8 +304,12 @@ export interface TokenAddSingleParams {
|
|
|
298
304
|
device?: TokenAddSingleParams.Device | null;
|
|
299
305
|
|
|
300
306
|
/**
|
|
301
|
-
* Body param:
|
|
302
|
-
*
|
|
307
|
+
* Body param: When the token expires. Accepts a date, or the boolean `false` to
|
|
308
|
+
* disable expiration entirely. ISO 8601 is recommended (for example
|
|
309
|
+
* `2026-10-25T00:00:00.000Z`). A value that cannot be parsed as a date is
|
|
310
|
+
* rejected; it is not treated as "no expiration" and does not fall back to the
|
|
311
|
+
* default. `true` is not a supported value. Omit the field to use the default,
|
|
312
|
+
* which expires a token that has not been re-registered for 60 days.
|
|
303
313
|
*/
|
|
304
314
|
expiry_date?: string | boolean | null;
|
|
305
315
|
|
|
@@ -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
|
}
|