@trycourier/courier 7.11.0 → 7.19.1
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 +114 -0
- package/README.md +1 -0
- package/client.d.mts +10 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +10 -4
- package/client.d.ts.map +1 -1
- package/client.js +15 -1
- package/client.js.map +1 -1
- package/client.mjs +15 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/audiences.d.mts +5 -2
- package/resources/audiences.d.mts.map +1 -1
- package/resources/audiences.d.ts +5 -2
- package/resources/audiences.d.ts.map +1 -1
- package/resources/brands.d.mts +35 -2
- package/resources/brands.d.mts.map +1 -1
- package/resources/brands.d.ts +35 -2
- package/resources/brands.d.ts.map +1 -1
- package/resources/brands.js +34 -1
- package/resources/brands.js.map +1 -1
- package/resources/brands.mjs +34 -1
- package/resources/brands.mjs.map +1 -1
- package/resources/digests/digests.d.mts +94 -0
- package/resources/digests/digests.d.mts.map +1 -0
- package/resources/digests/digests.d.ts +94 -0
- package/resources/digests/digests.d.ts.map +1 -0
- package/resources/digests/digests.js +17 -0
- package/resources/digests/digests.js.map +1 -0
- package/resources/digests/digests.mjs +12 -0
- package/resources/digests/digests.mjs.map +1 -0
- package/resources/digests/index.d.mts +3 -0
- package/resources/digests/index.d.mts.map +1 -0
- package/resources/digests/index.d.ts +3 -0
- package/resources/digests/index.d.ts.map +1 -0
- package/resources/digests/index.js +9 -0
- package/resources/digests/index.js.map +1 -0
- package/resources/digests/index.mjs +4 -0
- package/resources/digests/index.mjs.map +1 -0
- package/resources/digests/schedules.d.mts +32 -0
- package/resources/digests/schedules.d.mts.map +1 -0
- package/resources/digests/schedules.d.ts +32 -0
- package/resources/digests/schedules.d.ts.map +1 -0
- package/resources/digests/schedules.js +29 -0
- package/resources/digests/schedules.js.map +1 -0
- package/resources/digests/schedules.mjs +25 -0
- package/resources/digests/schedules.mjs.map +1 -0
- package/resources/digests.d.mts +2 -0
- package/resources/digests.d.mts.map +1 -0
- package/resources/digests.d.ts +2 -0
- package/resources/digests.d.ts.map +1 -0
- package/resources/digests.js +6 -0
- package/resources/digests.js.map +1 -0
- package/resources/digests.mjs +3 -0
- package/resources/digests.mjs.map +1 -0
- package/resources/index.d.mts +4 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/journeys/index.d.mts +2 -2
- package/resources/journeys/index.d.mts.map +1 -1
- package/resources/journeys/index.d.ts +2 -2
- package/resources/journeys/index.d.ts.map +1 -1
- package/resources/journeys/index.js.map +1 -1
- package/resources/journeys/index.mjs.map +1 -1
- package/resources/journeys/journeys.d.mts +198 -7
- package/resources/journeys/journeys.d.mts.map +1 -1
- package/resources/journeys/journeys.d.ts +198 -7
- package/resources/journeys/journeys.d.ts.map +1 -1
- package/resources/journeys/journeys.js +18 -0
- package/resources/journeys/journeys.js.map +1 -1
- package/resources/journeys/journeys.mjs +18 -0
- package/resources/journeys/journeys.mjs.map +1 -1
- package/resources/journeys/templates.d.mts +120 -1
- package/resources/journeys/templates.d.mts.map +1 -1
- package/resources/journeys/templates.d.ts +120 -1
- package/resources/journeys/templates.d.ts.map +1 -1
- package/resources/journeys/templates.js +71 -0
- package/resources/journeys/templates.js.map +1 -1
- package/resources/journeys/templates.mjs +71 -0
- package/resources/journeys/templates.mjs.map +1 -1
- package/resources/messages.d.mts +16 -1
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +16 -1
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +10 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +10 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/notifications/checks.d.mts +3 -3
- package/resources/notifications/checks.d.ts +3 -3
- package/resources/notifications/checks.js +3 -3
- package/resources/notifications/checks.mjs +3 -3
- package/resources/shared.d.mts +6 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +6 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/users/index.d.mts +1 -1
- package/resources/users/index.d.mts.map +1 -1
- package/resources/users/index.d.ts +1 -1
- package/resources/users/index.d.ts.map +1 -1
- package/resources/users/index.js.map +1 -1
- package/resources/users/index.mjs.map +1 -1
- package/resources/users/preferences.d.mts +211 -1
- package/resources/users/preferences.d.mts.map +1 -1
- package/resources/users/preferences.d.ts +211 -1
- package/resources/users/preferences.d.ts.map +1 -1
- package/resources/users/preferences.js +105 -0
- package/resources/users/preferences.js.map +1 -1
- package/resources/users/preferences.mjs +105 -0
- package/resources/users/preferences.mjs.map +1 -1
- package/resources/users/users.d.mts +2 -2
- package/resources/users/users.d.mts.map +1 -1
- package/resources/users/users.d.ts +2 -2
- package/resources/users/users.d.ts.map +1 -1
- package/resources/users/users.js.map +1 -1
- package/resources/users/users.mjs.map +1 -1
- package/resources/workspace-preferences/index.d.mts +3 -0
- package/resources/workspace-preferences/index.d.mts.map +1 -0
- package/resources/workspace-preferences/index.d.ts +3 -0
- package/resources/workspace-preferences/index.d.ts.map +1 -0
- package/resources/workspace-preferences/index.js +9 -0
- package/resources/workspace-preferences/index.js.map +1 -0
- package/resources/workspace-preferences/index.mjs +4 -0
- package/resources/workspace-preferences/index.mjs.map +1 -0
- package/resources/workspace-preferences/topics.d.mts +168 -0
- package/resources/workspace-preferences/topics.d.mts.map +1 -0
- package/resources/workspace-preferences/topics.d.ts +168 -0
- package/resources/workspace-preferences/topics.d.ts.map +1 -0
- package/resources/workspace-preferences/topics.js +103 -0
- package/resources/workspace-preferences/topics.js.map +1 -0
- package/resources/workspace-preferences/topics.mjs +99 -0
- package/resources/workspace-preferences/topics.mjs.map +1 -0
- package/resources/workspace-preferences/workspace-preferences.d.mts +410 -0
- package/resources/workspace-preferences/workspace-preferences.d.mts.map +1 -0
- package/resources/workspace-preferences/workspace-preferences.d.ts +410 -0
- package/resources/workspace-preferences/workspace-preferences.d.ts.map +1 -0
- package/resources/workspace-preferences/workspace-preferences.js +104 -0
- package/resources/workspace-preferences/workspace-preferences.js.map +1 -0
- package/resources/workspace-preferences/workspace-preferences.mjs +99 -0
- package/resources/workspace-preferences/workspace-preferences.mjs.map +1 -0
- package/resources/workspace-preferences.d.mts +2 -0
- package/resources/workspace-preferences.d.mts.map +1 -0
- package/resources/workspace-preferences.d.ts +2 -0
- package/resources/workspace-preferences.d.ts.map +1 -0
- package/resources/workspace-preferences.js +6 -0
- package/resources/workspace-preferences.js.map +1 -0
- package/resources/workspace-preferences.mjs +3 -0
- package/resources/workspace-preferences.mjs.map +1 -0
- package/src/client.ts +71 -1
- package/src/resources/audiences.ts +5 -2
- package/src/resources/brands.ts +36 -3
- package/src/resources/digests/digests.ts +120 -0
- package/src/resources/digests/index.ts +9 -0
- package/src/resources/digests/schedules.ts +51 -0
- package/src/resources/digests.ts +3 -0
- package/src/resources/index.ts +28 -0
- package/src/resources/journeys/index.ts +8 -0
- package/src/resources/journeys/journeys.ts +246 -4
- package/src/resources/journeys/templates.ts +168 -0
- package/src/resources/messages.ts +20 -0
- package/src/resources/notifications/checks.ts +3 -3
- package/src/resources/shared.ts +7 -0
- package/src/resources/users/index.ts +6 -0
- package/src/resources/users/preferences.ts +269 -0
- package/src/resources/users/users.ts +12 -0
- package/src/resources/workspace-preferences/index.ts +25 -0
- package/src/resources/workspace-preferences/topics.ts +229 -0
- package/src/resources/workspace-preferences/workspace-preferences.ts +534 -0
- package/src/resources/workspace-preferences.ts +3 -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
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as Shared from "../shared.mjs";
|
|
3
|
+
import * as WorkspacePreferencesAPI from "./workspace-preferences.mjs";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
5
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
6
|
+
export declare class Topics extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Create a subscription preference topic inside a workspace preference. Fails with
|
|
9
|
+
* 404 if the workspace preference does not exist. The topic id is generated and
|
|
10
|
+
* returned.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const workspacePreferenceTopicGetResponse =
|
|
15
|
+
* await client.workspacePreferences.topics.create(
|
|
16
|
+
* 'section_id',
|
|
17
|
+
* { default_status: 'OPTED_OUT', name: 'Marketing' },
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(sectionID: string, body: TopicCreateParams, options?: RequestOptions): APIPromise<WorkspacePreferencesAPI.WorkspacePreferenceTopicGetResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve a topic within a workspace preference. Returns 404 if the workspace
|
|
24
|
+
* preference does not exist, the topic does not exist, or the topic belongs to a
|
|
25
|
+
* different workspace preference.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const workspacePreferenceTopicGetResponse =
|
|
30
|
+
* await client.workspacePreferences.topics.retrieve(
|
|
31
|
+
* 'topic_id',
|
|
32
|
+
* { section_id: 'section_id' },
|
|
33
|
+
* );
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
retrieve(topicID: string, params: TopicRetrieveParams, options?: RequestOptions): APIPromise<WorkspacePreferencesAPI.WorkspacePreferenceTopicGetResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* List the topics in a workspace preference.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const workspacePreferenceTopicListResponse =
|
|
43
|
+
* await client.workspacePreferences.topics.list(
|
|
44
|
+
* 'section_id',
|
|
45
|
+
* );
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
list(sectionID: string, options?: RequestOptions): APIPromise<WorkspacePreferencesAPI.WorkspacePreferenceTopicListResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* Archive a topic and remove it from its workspace preference. Same 404 rules as
|
|
51
|
+
* GET.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* await client.workspacePreferences.topics.archive(
|
|
56
|
+
* 'topic_id',
|
|
57
|
+
* { section_id: 'section_id' },
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
archive(topicID: string, params: TopicArchiveParams, options?: RequestOptions): APIPromise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Replace a topic within a workspace preference. Full document replacement;
|
|
64
|
+
* missing optional fields are cleared. Same 404 rules as GET.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const workspacePreferenceTopicGetResponse =
|
|
69
|
+
* await client.workspacePreferences.topics.replace(
|
|
70
|
+
* 'topic_id',
|
|
71
|
+
* {
|
|
72
|
+
* section_id: 'section_id',
|
|
73
|
+
* default_status: 'OPTED_OUT',
|
|
74
|
+
* name: 'name',
|
|
75
|
+
* },
|
|
76
|
+
* );
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
replace(topicID: string, params: TopicReplaceParams, options?: RequestOptions): APIPromise<WorkspacePreferencesAPI.WorkspacePreferenceTopicGetResponse>;
|
|
80
|
+
}
|
|
81
|
+
export interface TopicCreateParams {
|
|
82
|
+
/**
|
|
83
|
+
* The default subscription status applied when a recipient has not set their own.
|
|
84
|
+
*/
|
|
85
|
+
default_status: 'OPTED_OUT' | 'OPTED_IN' | 'REQUIRED';
|
|
86
|
+
/**
|
|
87
|
+
* Human-readable name for the preference topic.
|
|
88
|
+
*/
|
|
89
|
+
name: string;
|
|
90
|
+
/**
|
|
91
|
+
* Preference controls a recipient may customize for this topic. Defaults to empty
|
|
92
|
+
* if omitted.
|
|
93
|
+
*/
|
|
94
|
+
allowed_preferences?: Array<'snooze' | 'channel_preferences'> | null;
|
|
95
|
+
/**
|
|
96
|
+
* Optional description shown under the topic on the hosted preferences page.
|
|
97
|
+
*/
|
|
98
|
+
description?: string | null;
|
|
99
|
+
/**
|
|
100
|
+
* Whether to include a list-unsubscribe header on emails for this topic.
|
|
101
|
+
*/
|
|
102
|
+
include_unsubscribe_header?: boolean | null;
|
|
103
|
+
/**
|
|
104
|
+
* Default channels delivered for this topic. Defaults to empty if omitted.
|
|
105
|
+
*/
|
|
106
|
+
routing_options?: Array<Shared.ChannelClassification> | null;
|
|
107
|
+
/**
|
|
108
|
+
* Arbitrary metadata associated with the topic.
|
|
109
|
+
*/
|
|
110
|
+
topic_data?: {
|
|
111
|
+
[key: string]: unknown;
|
|
112
|
+
} | null;
|
|
113
|
+
}
|
|
114
|
+
export interface TopicRetrieveParams {
|
|
115
|
+
/**
|
|
116
|
+
* Id of the workspace preference.
|
|
117
|
+
*/
|
|
118
|
+
section_id: string;
|
|
119
|
+
}
|
|
120
|
+
export interface TopicArchiveParams {
|
|
121
|
+
/**
|
|
122
|
+
* Id of the workspace preference.
|
|
123
|
+
*/
|
|
124
|
+
section_id: string;
|
|
125
|
+
}
|
|
126
|
+
export interface TopicReplaceParams {
|
|
127
|
+
/**
|
|
128
|
+
* Path param: Id of the workspace preference.
|
|
129
|
+
*/
|
|
130
|
+
section_id: string;
|
|
131
|
+
/**
|
|
132
|
+
* Body param: The default subscription status applied when a recipient has not set
|
|
133
|
+
* their own.
|
|
134
|
+
*/
|
|
135
|
+
default_status: 'OPTED_OUT' | 'OPTED_IN' | 'REQUIRED';
|
|
136
|
+
/**
|
|
137
|
+
* Body param: Human-readable name for the preference topic.
|
|
138
|
+
*/
|
|
139
|
+
name: string;
|
|
140
|
+
/**
|
|
141
|
+
* Body param: Preference controls a recipient may customize. Omit to clear.
|
|
142
|
+
*/
|
|
143
|
+
allowed_preferences?: Array<'snooze' | 'channel_preferences'> | null;
|
|
144
|
+
/**
|
|
145
|
+
* Body param: Optional description shown under the topic on the hosted preferences
|
|
146
|
+
* page. Omit to clear.
|
|
147
|
+
*/
|
|
148
|
+
description?: string | null;
|
|
149
|
+
/**
|
|
150
|
+
* Body param: Whether to include a list-unsubscribe header on emails for this
|
|
151
|
+
* topic.
|
|
152
|
+
*/
|
|
153
|
+
include_unsubscribe_header?: boolean | null;
|
|
154
|
+
/**
|
|
155
|
+
* Body param: Default channels delivered for this topic. Omit to clear.
|
|
156
|
+
*/
|
|
157
|
+
routing_options?: Array<Shared.ChannelClassification> | null;
|
|
158
|
+
/**
|
|
159
|
+
* Body param: Arbitrary metadata associated with the topic. Omit to clear.
|
|
160
|
+
*/
|
|
161
|
+
topic_data?: {
|
|
162
|
+
[key: string]: unknown;
|
|
163
|
+
} | null;
|
|
164
|
+
}
|
|
165
|
+
export declare namespace Topics {
|
|
166
|
+
export { type TopicCreateParams as TopicCreateParams, type TopicRetrieveParams as TopicRetrieveParams, type TopicArchiveParams as TopicArchiveParams, type TopicReplaceParams as TopicReplaceParams, };
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=topics.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topics.d.mts","sourceRoot":"","sources":["../../src/resources/workspace-preferences/topics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,MAAM,sBAAkB;AACpC,OAAO,KAAK,uBAAuB,oCAAgC;AACnE,OAAO,EAAE,UAAU,EAAE,mCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,iBAAiB,EACvB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,uBAAuB,CAAC,mCAAmC,CAAC;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,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,UAAU,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;;;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,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as Shared from "../shared.js";
|
|
3
|
+
import * as WorkspacePreferencesAPI from "./workspace-preferences.js";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
5
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
6
|
+
export declare class Topics extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Create a subscription preference topic inside a workspace preference. Fails with
|
|
9
|
+
* 404 if the workspace preference does not exist. The topic id is generated and
|
|
10
|
+
* returned.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const workspacePreferenceTopicGetResponse =
|
|
15
|
+
* await client.workspacePreferences.topics.create(
|
|
16
|
+
* 'section_id',
|
|
17
|
+
* { default_status: 'OPTED_OUT', name: 'Marketing' },
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(sectionID: string, body: TopicCreateParams, options?: RequestOptions): APIPromise<WorkspacePreferencesAPI.WorkspacePreferenceTopicGetResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve a topic within a workspace preference. Returns 404 if the workspace
|
|
24
|
+
* preference does not exist, the topic does not exist, or the topic belongs to a
|
|
25
|
+
* different workspace preference.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const workspacePreferenceTopicGetResponse =
|
|
30
|
+
* await client.workspacePreferences.topics.retrieve(
|
|
31
|
+
* 'topic_id',
|
|
32
|
+
* { section_id: 'section_id' },
|
|
33
|
+
* );
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
retrieve(topicID: string, params: TopicRetrieveParams, options?: RequestOptions): APIPromise<WorkspacePreferencesAPI.WorkspacePreferenceTopicGetResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* List the topics in a workspace preference.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const workspacePreferenceTopicListResponse =
|
|
43
|
+
* await client.workspacePreferences.topics.list(
|
|
44
|
+
* 'section_id',
|
|
45
|
+
* );
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
list(sectionID: string, options?: RequestOptions): APIPromise<WorkspacePreferencesAPI.WorkspacePreferenceTopicListResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* Archive a topic and remove it from its workspace preference. Same 404 rules as
|
|
51
|
+
* GET.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* await client.workspacePreferences.topics.archive(
|
|
56
|
+
* 'topic_id',
|
|
57
|
+
* { section_id: 'section_id' },
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
archive(topicID: string, params: TopicArchiveParams, options?: RequestOptions): APIPromise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Replace a topic within a workspace preference. Full document replacement;
|
|
64
|
+
* missing optional fields are cleared. Same 404 rules as GET.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const workspacePreferenceTopicGetResponse =
|
|
69
|
+
* await client.workspacePreferences.topics.replace(
|
|
70
|
+
* 'topic_id',
|
|
71
|
+
* {
|
|
72
|
+
* section_id: 'section_id',
|
|
73
|
+
* default_status: 'OPTED_OUT',
|
|
74
|
+
* name: 'name',
|
|
75
|
+
* },
|
|
76
|
+
* );
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
replace(topicID: string, params: TopicReplaceParams, options?: RequestOptions): APIPromise<WorkspacePreferencesAPI.WorkspacePreferenceTopicGetResponse>;
|
|
80
|
+
}
|
|
81
|
+
export interface TopicCreateParams {
|
|
82
|
+
/**
|
|
83
|
+
* The default subscription status applied when a recipient has not set their own.
|
|
84
|
+
*/
|
|
85
|
+
default_status: 'OPTED_OUT' | 'OPTED_IN' | 'REQUIRED';
|
|
86
|
+
/**
|
|
87
|
+
* Human-readable name for the preference topic.
|
|
88
|
+
*/
|
|
89
|
+
name: string;
|
|
90
|
+
/**
|
|
91
|
+
* Preference controls a recipient may customize for this topic. Defaults to empty
|
|
92
|
+
* if omitted.
|
|
93
|
+
*/
|
|
94
|
+
allowed_preferences?: Array<'snooze' | 'channel_preferences'> | null;
|
|
95
|
+
/**
|
|
96
|
+
* Optional description shown under the topic on the hosted preferences page.
|
|
97
|
+
*/
|
|
98
|
+
description?: string | null;
|
|
99
|
+
/**
|
|
100
|
+
* Whether to include a list-unsubscribe header on emails for this topic.
|
|
101
|
+
*/
|
|
102
|
+
include_unsubscribe_header?: boolean | null;
|
|
103
|
+
/**
|
|
104
|
+
* Default channels delivered for this topic. Defaults to empty if omitted.
|
|
105
|
+
*/
|
|
106
|
+
routing_options?: Array<Shared.ChannelClassification> | null;
|
|
107
|
+
/**
|
|
108
|
+
* Arbitrary metadata associated with the topic.
|
|
109
|
+
*/
|
|
110
|
+
topic_data?: {
|
|
111
|
+
[key: string]: unknown;
|
|
112
|
+
} | null;
|
|
113
|
+
}
|
|
114
|
+
export interface TopicRetrieveParams {
|
|
115
|
+
/**
|
|
116
|
+
* Id of the workspace preference.
|
|
117
|
+
*/
|
|
118
|
+
section_id: string;
|
|
119
|
+
}
|
|
120
|
+
export interface TopicArchiveParams {
|
|
121
|
+
/**
|
|
122
|
+
* Id of the workspace preference.
|
|
123
|
+
*/
|
|
124
|
+
section_id: string;
|
|
125
|
+
}
|
|
126
|
+
export interface TopicReplaceParams {
|
|
127
|
+
/**
|
|
128
|
+
* Path param: Id of the workspace preference.
|
|
129
|
+
*/
|
|
130
|
+
section_id: string;
|
|
131
|
+
/**
|
|
132
|
+
* Body param: The default subscription status applied when a recipient has not set
|
|
133
|
+
* their own.
|
|
134
|
+
*/
|
|
135
|
+
default_status: 'OPTED_OUT' | 'OPTED_IN' | 'REQUIRED';
|
|
136
|
+
/**
|
|
137
|
+
* Body param: Human-readable name for the preference topic.
|
|
138
|
+
*/
|
|
139
|
+
name: string;
|
|
140
|
+
/**
|
|
141
|
+
* Body param: Preference controls a recipient may customize. Omit to clear.
|
|
142
|
+
*/
|
|
143
|
+
allowed_preferences?: Array<'snooze' | 'channel_preferences'> | null;
|
|
144
|
+
/**
|
|
145
|
+
* Body param: Optional description shown under the topic on the hosted preferences
|
|
146
|
+
* page. Omit to clear.
|
|
147
|
+
*/
|
|
148
|
+
description?: string | null;
|
|
149
|
+
/**
|
|
150
|
+
* Body param: Whether to include a list-unsubscribe header on emails for this
|
|
151
|
+
* topic.
|
|
152
|
+
*/
|
|
153
|
+
include_unsubscribe_header?: boolean | null;
|
|
154
|
+
/**
|
|
155
|
+
* Body param: Default channels delivered for this topic. Omit to clear.
|
|
156
|
+
*/
|
|
157
|
+
routing_options?: Array<Shared.ChannelClassification> | null;
|
|
158
|
+
/**
|
|
159
|
+
* Body param: Arbitrary metadata associated with the topic. Omit to clear.
|
|
160
|
+
*/
|
|
161
|
+
topic_data?: {
|
|
162
|
+
[key: string]: unknown;
|
|
163
|
+
} | null;
|
|
164
|
+
}
|
|
165
|
+
export declare namespace Topics {
|
|
166
|
+
export { type TopicCreateParams as TopicCreateParams, type TopicRetrieveParams as TopicRetrieveParams, type TopicArchiveParams as TopicArchiveParams, type TopicReplaceParams as TopicReplaceParams, };
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=topics.d.ts.map
|
|
@@ -0,0 +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,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,iBAAiB,EACvB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,uBAAuB,CAAC,mCAAmC,CAAC;IAI1E;;;;;;;;;;;;;OAaG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,uBAAuB,CAAC,mCAAmC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,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;;;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,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Topics = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const headers_1 = require("../../internal/headers.js");
|
|
7
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
8
|
+
class Topics extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Create a subscription preference topic inside a workspace preference. Fails with
|
|
11
|
+
* 404 if the workspace preference does not exist. The topic id is generated and
|
|
12
|
+
* returned.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const workspacePreferenceTopicGetResponse =
|
|
17
|
+
* await client.workspacePreferences.topics.create(
|
|
18
|
+
* 'section_id',
|
|
19
|
+
* { default_status: 'OPTED_OUT', name: 'Marketing' },
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
create(sectionID, body, options) {
|
|
24
|
+
return this._client.post((0, path_1.path) `/preferences/sections/${sectionID}/topics`, { body, ...options });
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Retrieve a topic within a workspace preference. Returns 404 if the workspace
|
|
28
|
+
* preference does not exist, the topic does not exist, or the topic belongs to a
|
|
29
|
+
* different workspace preference.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const workspacePreferenceTopicGetResponse =
|
|
34
|
+
* await client.workspacePreferences.topics.retrieve(
|
|
35
|
+
* 'topic_id',
|
|
36
|
+
* { section_id: 'section_id' },
|
|
37
|
+
* );
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
retrieve(topicID, params, options) {
|
|
41
|
+
const { section_id } = params;
|
|
42
|
+
return this._client.get((0, path_1.path) `/preferences/sections/${section_id}/topics/${topicID}`, options);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* List the topics in a workspace preference.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const workspacePreferenceTopicListResponse =
|
|
50
|
+
* await client.workspacePreferences.topics.list(
|
|
51
|
+
* 'section_id',
|
|
52
|
+
* );
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
list(sectionID, options) {
|
|
56
|
+
return this._client.get((0, path_1.path) `/preferences/sections/${sectionID}/topics`, options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Archive a topic and remove it from its workspace preference. Same 404 rules as
|
|
60
|
+
* GET.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* await client.workspacePreferences.topics.archive(
|
|
65
|
+
* 'topic_id',
|
|
66
|
+
* { section_id: 'section_id' },
|
|
67
|
+
* );
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
archive(topicID, params, options) {
|
|
71
|
+
const { section_id } = params;
|
|
72
|
+
return this._client.delete((0, path_1.path) `/preferences/sections/${section_id}/topics/${topicID}`, {
|
|
73
|
+
...options,
|
|
74
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Replace a topic within a workspace preference. Full document replacement;
|
|
79
|
+
* missing optional fields are cleared. Same 404 rules as GET.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const workspacePreferenceTopicGetResponse =
|
|
84
|
+
* await client.workspacePreferences.topics.replace(
|
|
85
|
+
* 'topic_id',
|
|
86
|
+
* {
|
|
87
|
+
* section_id: 'section_id',
|
|
88
|
+
* default_status: 'OPTED_OUT',
|
|
89
|
+
* name: 'name',
|
|
90
|
+
* },
|
|
91
|
+
* );
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
replace(topicID, params, options) {
|
|
95
|
+
const { section_id, ...body } = params;
|
|
96
|
+
return this._client.put((0, path_1.path) `/preferences/sections/${section_id}/topics/${topicID}`, {
|
|
97
|
+
body,
|
|
98
|
+
...options,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.Topics = Topics;
|
|
103
|
+
//# sourceMappingURL=topics.js.map
|
|
@@ -0,0 +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,MAAa,MAAO,SAA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OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,yBAAyB,UAAU,WAAW,OAAO,EAAE,EAAE;YACnF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAhHD,wBAgHC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
4
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
5
|
+
export class Topics extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Create a subscription preference topic inside a workspace preference. Fails with
|
|
8
|
+
* 404 if the workspace preference does not exist. The topic id is generated and
|
|
9
|
+
* returned.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const workspacePreferenceTopicGetResponse =
|
|
14
|
+
* await client.workspacePreferences.topics.create(
|
|
15
|
+
* 'section_id',
|
|
16
|
+
* { default_status: 'OPTED_OUT', name: 'Marketing' },
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
create(sectionID, body, options) {
|
|
21
|
+
return this._client.post(path `/preferences/sections/${sectionID}/topics`, { body, ...options });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Retrieve a topic within a workspace preference. Returns 404 if the workspace
|
|
25
|
+
* preference does not exist, the topic does not exist, or the topic belongs to a
|
|
26
|
+
* different workspace preference.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const workspacePreferenceTopicGetResponse =
|
|
31
|
+
* await client.workspacePreferences.topics.retrieve(
|
|
32
|
+
* 'topic_id',
|
|
33
|
+
* { section_id: 'section_id' },
|
|
34
|
+
* );
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
retrieve(topicID, params, options) {
|
|
38
|
+
const { section_id } = params;
|
|
39
|
+
return this._client.get(path `/preferences/sections/${section_id}/topics/${topicID}`, options);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* List the topics in a workspace preference.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const workspacePreferenceTopicListResponse =
|
|
47
|
+
* await client.workspacePreferences.topics.list(
|
|
48
|
+
* 'section_id',
|
|
49
|
+
* );
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
list(sectionID, options) {
|
|
53
|
+
return this._client.get(path `/preferences/sections/${sectionID}/topics`, options);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Archive a topic and remove it from its workspace preference. Same 404 rules as
|
|
57
|
+
* GET.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* await client.workspacePreferences.topics.archive(
|
|
62
|
+
* 'topic_id',
|
|
63
|
+
* { section_id: 'section_id' },
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
archive(topicID, params, options) {
|
|
68
|
+
const { section_id } = params;
|
|
69
|
+
return this._client.delete(path `/preferences/sections/${section_id}/topics/${topicID}`, {
|
|
70
|
+
...options,
|
|
71
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Replace a topic within a workspace preference. Full document replacement;
|
|
76
|
+
* missing optional fields are cleared. Same 404 rules as GET.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const workspacePreferenceTopicGetResponse =
|
|
81
|
+
* await client.workspacePreferences.topics.replace(
|
|
82
|
+
* 'topic_id',
|
|
83
|
+
* {
|
|
84
|
+
* section_id: 'section_id',
|
|
85
|
+
* default_status: 'OPTED_OUT',
|
|
86
|
+
* name: 'name',
|
|
87
|
+
* },
|
|
88
|
+
* );
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
replace(topicID, params, options) {
|
|
92
|
+
const { section_id, ...body } = params;
|
|
93
|
+
return this._client.put(path `/preferences/sections/${section_id}/topics/${topicID}`, {
|
|
94
|
+
body,
|
|
95
|
+
...options,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=topics.mjs.map
|
|
@@ -0,0 +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,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,SAAiB,EACjB,IAAuB,EACvB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,yBAAyB,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,QAAQ,CACN,OAAe,EACf,MAA2B,EAC3B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,yBAAyB,UAAU,WAAW,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAChG,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,SAAiB,EACjB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,yBAAyB,SAAS,SAAS,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,OAAO,C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