@trycourier/courier 9.5.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.
- package/CHANGELOG.md +25 -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 +67 -1
- package/resources/digests/digests.d.mts.map +1 -1
- package/resources/digests/digests.d.ts +67 -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 +51 -2
- package/resources/journeys/journeys.d.mts.map +1 -1
- package/resources/journeys/journeys.d.ts +51 -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 +20 -0
- package/resources/users/preferences.d.mts.map +1 -1
- package/resources/users/preferences.d.ts +20 -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 +141 -4
- package/resources/workspace-preferences/topics.d.mts.map +1 -1
- package/resources/workspace-preferences/topics.d.ts +141 -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 +271 -3
- package/resources/workspace-preferences/workspace-preferences.d.mts.map +1 -1
- package/resources/workspace-preferences/workspace-preferences.d.ts +271 -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 +89 -0
- package/src/resources/digests/index.ts +3 -0
- package/src/resources/index.ts +8 -0
- package/src/resources/journeys/journeys.ts +55 -2
- package/src/resources/users/preferences.ts +22 -0
- package/src/resources/workspace-preferences/index.ts +7 -0
- package/src/resources/workspace-preferences/topics.ts +172 -3
- package/src/resources/workspace-preferences/workspace-preferences.ts +312 -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
|
@@ -3,9 +3,6 @@ import * as Shared from "../shared.js";
|
|
|
3
3
|
import * as WorkspacePreferencesAPI from "./workspace-preferences.js";
|
|
4
4
|
import { APIPromise } from "../../core/api-promise.js";
|
|
5
5
|
import { RequestOptions } from "../../internal/request-options.js";
|
|
6
|
-
/**
|
|
7
|
-
* Manage the workspace catalog of subscription topics, the sections that group them, and publishing the preference page.
|
|
8
|
-
*/
|
|
9
6
|
export declare class Topics extends APIResource {
|
|
10
7
|
/**
|
|
11
8
|
* Creates a subscription topic inside a workspace preference. The default status
|
|
@@ -61,6 +58,41 @@ export declare class Topics extends APIResource {
|
|
|
61
58
|
* ```
|
|
62
59
|
*/
|
|
63
60
|
archive(topicID: string, params: TopicArchiveParams, options?: RequestOptions): APIPromise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Turn off a topic's digest, leaving the topic itself in place. The template is
|
|
63
|
+
* unlinked and the digest's schedules are removed along with their delivery rules.
|
|
64
|
+
* Equivalent to sending `digest: null` on a topic replace.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* await client.workspacePreferences.topics.deleteDigest(
|
|
69
|
+
* 'topic_id',
|
|
70
|
+
* { section_id: 'section_id' },
|
|
71
|
+
* );
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
deleteDigest(topicID: string, params: TopicDeleteDigestParams, options?: RequestOptions): APIPromise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Send one recipient's held digest now, instead of waiting for its schedule. Use
|
|
77
|
+
* it to preview what a digest will look like, or to let someone flush their own.
|
|
78
|
+
*
|
|
79
|
+
* Keyed on the topic because that is how a held digest is stored: one per
|
|
80
|
+
* recipient per topic, with the schedule recorded on it rather than part of its
|
|
81
|
+
* identity. To flush every recipient on a schedule instead, use
|
|
82
|
+
* `POST /digests/schedules/{schedule_id}/trigger`.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* await client.workspacePreferences.topics.releaseDigest(
|
|
87
|
+
* 'topic_id',
|
|
88
|
+
* {
|
|
89
|
+
* section_id: 'section_id',
|
|
90
|
+
* user_id: 'user_01h1p2c3d4e5f6g7h8',
|
|
91
|
+
* },
|
|
92
|
+
* );
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
releaseDigest(topicID: string, params: TopicReleaseDigestParams, options?: RequestOptions): APIPromise<void>;
|
|
64
96
|
/**
|
|
65
97
|
* Replace a topic within a workspace preference. Full document replacement;
|
|
66
98
|
* missing optional fields are cleared. Same 404 rules as GET.
|
|
@@ -103,6 +135,21 @@ export interface TopicCreateParams {
|
|
|
103
135
|
* page.
|
|
104
136
|
*/
|
|
105
137
|
description?: string | null;
|
|
138
|
+
/**
|
|
139
|
+
* Body param: A topic's digest, as supplied when the topic itself is created: the
|
|
140
|
+
* template that renders it, the cadences it delivers on, and how collected events
|
|
141
|
+
* are retained.
|
|
142
|
+
*
|
|
143
|
+
* Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
|
|
144
|
+
* is required — a topic being created has no stored schedules for an absent key to
|
|
145
|
+
* leave alone.
|
|
146
|
+
*
|
|
147
|
+
* Send `null` for the whole object to turn a digest off, which unlinks the
|
|
148
|
+
* template and removes its schedules. There is no `enabled` flag, and
|
|
149
|
+
* `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
150
|
+
* merely off.
|
|
151
|
+
*/
|
|
152
|
+
digest?: TopicCreateParams.Digest | null;
|
|
106
153
|
/**
|
|
107
154
|
* Body param: Whether to include a list-unsubscribe header on emails for this
|
|
108
155
|
* topic.
|
|
@@ -136,6 +183,60 @@ export interface TopicCreateParams {
|
|
|
136
183
|
*/
|
|
137
184
|
'x-idempotency-expiration'?: string;
|
|
138
185
|
}
|
|
186
|
+
export declare namespace TopicCreateParams {
|
|
187
|
+
/**
|
|
188
|
+
* A topic's digest, as supplied when the topic itself is created: the template
|
|
189
|
+
* that renders it, the cadences it delivers on, and how collected events are
|
|
190
|
+
* retained.
|
|
191
|
+
*
|
|
192
|
+
* Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
|
|
193
|
+
* is required — a topic being created has no stored schedules for an absent key to
|
|
194
|
+
* leave alone.
|
|
195
|
+
*
|
|
196
|
+
* Send `null` for the whole object to turn a digest off, which unlinks the
|
|
197
|
+
* template and removes its schedules. There is no `enabled` flag, and
|
|
198
|
+
* `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
199
|
+
* merely off.
|
|
200
|
+
*/
|
|
201
|
+
interface Digest {
|
|
202
|
+
/**
|
|
203
|
+
* The cadences this digest delivers on.
|
|
204
|
+
*
|
|
205
|
+
* The array replaces the stored schedules wholesale, so a schedule you leave out
|
|
206
|
+
* of it is deleted along with its delivery rule. Omit the key entirely to leave
|
|
207
|
+
* the stored schedules untouched — useful for changing `template_id` or
|
|
208
|
+
* `categories` without restating every schedule.
|
|
209
|
+
*
|
|
210
|
+
* A digest must end up with at least one schedule, because one with none collects
|
|
211
|
+
* events into an instance that can never fire. So sending `[]` is always a `400`,
|
|
212
|
+
* and so is omitting the key on a topic that has no schedules stored yet.
|
|
213
|
+
*
|
|
214
|
+
* On **create** the key is required outright: a topic being created has nothing
|
|
215
|
+
* stored to leave alone, and the topic row is written before its digest, so
|
|
216
|
+
* rejecting it any later would leave the topic behind and let a retry duplicate
|
|
217
|
+
* it.
|
|
218
|
+
*/
|
|
219
|
+
schedules: Array<WorkspacePreferencesAPI.TopicDigestScheduleRequest>;
|
|
220
|
+
/**
|
|
221
|
+
* The notification template that renders the digest. A digest with no template
|
|
222
|
+
* collects nothing, so this is required.
|
|
223
|
+
*/
|
|
224
|
+
template_id: string;
|
|
225
|
+
/**
|
|
226
|
+
* Optional audience the digest is scoped to.
|
|
227
|
+
*/
|
|
228
|
+
audience_id?: string;
|
|
229
|
+
/**
|
|
230
|
+
* Retention rules per category key. Defaults to a single `digest` category
|
|
231
|
+
* retaining `FIRST`.
|
|
232
|
+
*/
|
|
233
|
+
categories?: Array<WorkspacePreferencesAPI.TopicDigestCategory>;
|
|
234
|
+
/**
|
|
235
|
+
* Whether to deliver the digest even when nothing was collected.
|
|
236
|
+
*/
|
|
237
|
+
trigger_empty?: boolean;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
139
240
|
export interface TopicRetrieveParams {
|
|
140
241
|
/**
|
|
141
242
|
* Id of the workspace preference.
|
|
@@ -148,6 +249,32 @@ export interface TopicArchiveParams {
|
|
|
148
249
|
*/
|
|
149
250
|
section_id: string;
|
|
150
251
|
}
|
|
252
|
+
export interface TopicDeleteDigestParams {
|
|
253
|
+
/**
|
|
254
|
+
* The preference section containing the topic.
|
|
255
|
+
*/
|
|
256
|
+
section_id: string;
|
|
257
|
+
}
|
|
258
|
+
export interface TopicReleaseDigestParams {
|
|
259
|
+
/**
|
|
260
|
+
* Path param: The preference section containing the topic.
|
|
261
|
+
*/
|
|
262
|
+
section_id: string;
|
|
263
|
+
/**
|
|
264
|
+
* Body param: The recipient whose digest to release. Required: there is no
|
|
265
|
+
* "release everyone on this topic" form, because a whole-schedule flush already
|
|
266
|
+
* has its own endpoint and a body-shaped difference between one recipient and all
|
|
267
|
+
* of them is too easy to get wrong.
|
|
268
|
+
*/
|
|
269
|
+
user_id: string;
|
|
270
|
+
/**
|
|
271
|
+
* Body param: The recipient's tenant, when they were sent to as part of one -- the
|
|
272
|
+
* same value returned as `tenant_id` on a digest instance and sent as
|
|
273
|
+
* `message.context.tenant_id`. It is part of the held digest's key, so a tenanted
|
|
274
|
+
* recipient cannot be found without it. Omit for an ordinary recipient.
|
|
275
|
+
*/
|
|
276
|
+
tenant_id?: string;
|
|
277
|
+
}
|
|
151
278
|
export interface TopicReplaceParams {
|
|
152
279
|
/**
|
|
153
280
|
* Path param: Id of the workspace preference.
|
|
@@ -171,6 +298,16 @@ export interface TopicReplaceParams {
|
|
|
171
298
|
* page. Omit to clear.
|
|
172
299
|
*/
|
|
173
300
|
description?: string | null;
|
|
301
|
+
/**
|
|
302
|
+
* Body param: A topic's digest configuration: the template that renders it, the
|
|
303
|
+
* cadences it delivers on, and how collected events are retained.
|
|
304
|
+
*
|
|
305
|
+
* Send `null` for the whole object to turn a digest off, which unlinks the
|
|
306
|
+
* template and removes its schedules. There is no `enabled` flag, and
|
|
307
|
+
* `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
308
|
+
* merely off.
|
|
309
|
+
*/
|
|
310
|
+
digest?: WorkspacePreferencesAPI.TopicDigestRequest | null;
|
|
174
311
|
/**
|
|
175
312
|
* Body param: Whether to include a list-unsubscribe header on emails for this
|
|
176
313
|
* topic.
|
|
@@ -188,6 +325,6 @@ export interface TopicReplaceParams {
|
|
|
188
325
|
} | null;
|
|
189
326
|
}
|
|
190
327
|
export declare namespace Topics {
|
|
191
|
-
export { type TopicCreateParams as TopicCreateParams, type TopicRetrieveParams as TopicRetrieveParams, type TopicArchiveParams as TopicArchiveParams, type TopicReplaceParams as TopicReplaceParams, };
|
|
328
|
+
export { type TopicCreateParams as TopicCreateParams, type TopicRetrieveParams as TopicRetrieveParams, type TopicArchiveParams as TopicArchiveParams, type TopicDeleteDigestParams as TopicDeleteDigestParams, type TopicReleaseDigestParams as TopicReleaseDigestParams, type TopicReplaceParams as TopicReplaceParams, };
|
|
192
329
|
}
|
|
193
330
|
//# sourceMappingURL=topics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topics.d.ts","sourceRoot":"","sources":["../../src/resources/workspace-preferences/topics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,uBAAuB,mCAAgC;AACnE,OAAO,EAAE,UAAU,EAAE,kCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE
|
|
1
|
+
{"version":3,"file":"topics.d.ts","sourceRoot":"","sources":["../../src/resources/workspace-preferences/topics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,uBAAuB,mCAAgC;AACnE,OAAO,EAAE,UAAU,EAAE,kCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,iBAAiB,EACzB,OAAO,CAAC,EAAE,cAAc,GAC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OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,cAAc,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC;IAEtD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,mBAAmB,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,qBAAqB,CAAC,GAAG,IAAI,CAAC;IAErE;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,uBAAuB,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAE3D;;;OAGG;IACH,0BAA0B,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAE5C;;OAEG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAAC;IAE7D;;OAEG;IACH,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CAChD;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -5,9 +5,6 @@ exports.Topics = void 0;
|
|
|
5
5
|
const resource_1 = require("../../core/resource.js");
|
|
6
6
|
const headers_1 = require("../../internal/headers.js");
|
|
7
7
|
const path_1 = require("../../internal/utils/path.js");
|
|
8
|
-
/**
|
|
9
|
-
* Manage the workspace catalog of subscription topics, the sections that group them, and publishing the preference page.
|
|
10
|
-
*/
|
|
11
8
|
class Topics extends resource_1.APIResource {
|
|
12
9
|
/**
|
|
13
10
|
* Creates a subscription topic inside a workspace preference. The default status
|
|
@@ -89,6 +86,54 @@ class Topics extends resource_1.APIResource {
|
|
|
89
86
|
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
90
87
|
});
|
|
91
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Turn off a topic's digest, leaving the topic itself in place. The template is
|
|
91
|
+
* unlinked and the digest's schedules are removed along with their delivery rules.
|
|
92
|
+
* Equivalent to sending `digest: null` on a topic replace.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts
|
|
96
|
+
* await client.workspacePreferences.topics.deleteDigest(
|
|
97
|
+
* 'topic_id',
|
|
98
|
+
* { section_id: 'section_id' },
|
|
99
|
+
* );
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
deleteDigest(topicID, params, options) {
|
|
103
|
+
const { section_id } = params;
|
|
104
|
+
return this._client.delete((0, path_1.path) `/preferences/sections/${section_id}/topics/${topicID}/digest`, {
|
|
105
|
+
...options,
|
|
106
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Send one recipient's held digest now, instead of waiting for its schedule. Use
|
|
111
|
+
* it to preview what a digest will look like, or to let someone flush their own.
|
|
112
|
+
*
|
|
113
|
+
* Keyed on the topic because that is how a held digest is stored: one per
|
|
114
|
+
* recipient per topic, with the schedule recorded on it rather than part of its
|
|
115
|
+
* identity. To flush every recipient on a schedule instead, use
|
|
116
|
+
* `POST /digests/schedules/{schedule_id}/trigger`.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* await client.workspacePreferences.topics.releaseDigest(
|
|
121
|
+
* 'topic_id',
|
|
122
|
+
* {
|
|
123
|
+
* section_id: 'section_id',
|
|
124
|
+
* user_id: 'user_01h1p2c3d4e5f6g7h8',
|
|
125
|
+
* },
|
|
126
|
+
* );
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
releaseDigest(topicID, params, options) {
|
|
130
|
+
const { section_id, ...body } = params;
|
|
131
|
+
return this._client.post((0, path_1.path) `/preferences/sections/${section_id}/topics/${topicID}/digest/release`, {
|
|
132
|
+
body,
|
|
133
|
+
...options,
|
|
134
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
135
|
+
});
|
|
136
|
+
}
|
|
92
137
|
/**
|
|
93
138
|
* Replace a topic within a workspace preference. Full document replacement;
|
|
94
139
|
* missing optional fields are cleared. Same 404 rules as GET.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topics.js","sourceRoot":"","sources":["../../src/resources/workspace-preferences/topics.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,uDAAsD;AAEtD,uDAAiD;AAEjD
|
|
1
|
+
{"version":3,"file":"topics.js","sourceRoot":"","sources":["../../src/resources/workspace-preferences/topics.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,SAAiB,EACjB,MAAyB,EACzB,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,IAAA,WAAI,EAAA,yBAAyB,SAAS,SAAS,EAAE;YACxE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB;oBACE,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,GAAG,MAAM,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,yBAAyB,UAAU,WAAW,OAAO,SAAS,EAAE;YAC7F,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,aAAa,CACX,OAAe,EACf,MAAgC,EAChC,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,yBAAyB,UAAU,WAAW,OAAO,iBAAiB,EAAE;YACnG,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CACL,OAAe,EACf,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,yBAAyB,UAAU,WAAW,OAAO,EAAE,EAAE;YACnF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAzLD,wBAyLC"}
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
3
|
import { buildHeaders } from "../../internal/headers.mjs";
|
|
4
4
|
import { path } from "../../internal/utils/path.mjs";
|
|
5
|
-
/**
|
|
6
|
-
* Manage the workspace catalog of subscription topics, the sections that group them, and publishing the preference page.
|
|
7
|
-
*/
|
|
8
5
|
export class Topics extends APIResource {
|
|
9
6
|
/**
|
|
10
7
|
* Creates a subscription topic inside a workspace preference. The default status
|
|
@@ -86,6 +83,54 @@ export class Topics extends APIResource {
|
|
|
86
83
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
87
84
|
});
|
|
88
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Turn off a topic's digest, leaving the topic itself in place. The template is
|
|
88
|
+
* unlinked and the digest's schedules are removed along with their delivery rules.
|
|
89
|
+
* Equivalent to sending `digest: null` on a topic replace.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* await client.workspacePreferences.topics.deleteDigest(
|
|
94
|
+
* 'topic_id',
|
|
95
|
+
* { section_id: 'section_id' },
|
|
96
|
+
* );
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
deleteDigest(topicID, params, options) {
|
|
100
|
+
const { section_id } = params;
|
|
101
|
+
return this._client.delete(path `/preferences/sections/${section_id}/topics/${topicID}/digest`, {
|
|
102
|
+
...options,
|
|
103
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Send one recipient's held digest now, instead of waiting for its schedule. Use
|
|
108
|
+
* it to preview what a digest will look like, or to let someone flush their own.
|
|
109
|
+
*
|
|
110
|
+
* Keyed on the topic because that is how a held digest is stored: one per
|
|
111
|
+
* recipient per topic, with the schedule recorded on it rather than part of its
|
|
112
|
+
* identity. To flush every recipient on a schedule instead, use
|
|
113
|
+
* `POST /digests/schedules/{schedule_id}/trigger`.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* await client.workspacePreferences.topics.releaseDigest(
|
|
118
|
+
* 'topic_id',
|
|
119
|
+
* {
|
|
120
|
+
* section_id: 'section_id',
|
|
121
|
+
* user_id: 'user_01h1p2c3d4e5f6g7h8',
|
|
122
|
+
* },
|
|
123
|
+
* );
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
releaseDigest(topicID, params, options) {
|
|
127
|
+
const { section_id, ...body } = params;
|
|
128
|
+
return this._client.post(path `/preferences/sections/${section_id}/topics/${topicID}/digest/release`, {
|
|
129
|
+
body,
|
|
130
|
+
...options,
|
|
131
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
132
|
+
});
|
|
133
|
+
}
|
|
89
134
|
/**
|
|
90
135
|
* Replace a topic within a workspace preference. Full document replacement;
|
|
91
136
|
* missing optional fields are cleared. Same 404 rules as GET.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topics.mjs","sourceRoot":"","sources":["../../src/resources/workspace-preferences/topics.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAIlD,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD
|
|
1
|
+
{"version":3,"file":"topics.mjs","sourceRoot":"","sources":["../../src/resources/workspace-preferences/topics.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAIlD,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,SAAiB,EACjB,MAAyB,EACzB,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,IAAI,CAAA,yBAAyB,SAAS,SAAS,EAAE;YACxE,IAAI;YACJ,GAAG,OAAO;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