@trycourier/courier 6.1.0 → 6.1.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/Client.js +1 -1
- package/README.md +5 -5
- package/api/resources/audiences/client/Client.js +5 -5
- package/api/resources/auditEvents/client/Client.js +2 -2
- package/api/resources/authTokens/client/Client.js +1 -1
- package/api/resources/automations/client/Client.d.ts +15 -0
- package/api/resources/automations/client/Client.js +17 -2
- package/api/resources/automations/types/AccessorType.d.ts +6 -0
- package/api/resources/automations/types/AccessorType.js +5 -0
- package/api/resources/automations/types/AutomationAddToBatchMaxItemsType.d.ts +4 -0
- package/api/resources/automations/types/AutomationAddToBatchMaxItemsType.js +5 -0
- package/api/resources/automations/types/AutomationAddToBatchRetain.d.ts +34 -0
- package/api/resources/automations/types/AutomationAddToBatchRetain.js +5 -0
- package/api/resources/automations/types/AutomationAddToBatchRetainType.d.ts +10 -0
- package/api/resources/automations/types/AutomationAddToBatchRetainType.js +12 -0
- package/api/resources/automations/types/AutomationAddToBatchScope.d.ts +9 -0
- package/api/resources/automations/types/AutomationAddToBatchScope.js +11 -0
- package/api/resources/automations/types/AutomationAddToBatchStep.d.ts +39 -0
- package/api/resources/automations/types/AutomationAddToBatchStep.js +5 -0
- package/api/resources/automations/types/AutomationAddToDigestStep.d.ts +16 -0
- package/api/resources/automations/types/AutomationAddToDigestStep.js +5 -0
- package/api/resources/automations/types/AutomationDelayStep.d.ts +3 -0
- package/api/resources/automations/types/AutomationFetchDataStep.d.ts +31 -0
- package/api/resources/automations/types/AutomationFetchDataStep.js +5 -0
- package/api/resources/automations/types/AutomationFetchDataWebhook.d.ts +11 -0
- package/api/resources/automations/types/AutomationFetchDataWebhook.js +5 -0
- package/api/resources/automations/types/AutomationFetchDataWebhookMethod.d.ts +8 -0
- package/api/resources/automations/types/AutomationFetchDataWebhookMethod.js +10 -0
- package/api/resources/automations/types/AutomationStepOption.d.ts +1 -1
- package/api/resources/automations/types/AutomationThrottleOnThrottle.d.ts +7 -0
- package/api/resources/automations/types/AutomationThrottleOnThrottle.js +5 -0
- package/api/resources/automations/types/AutomationThrottleScope.d.ts +9 -0
- package/api/resources/automations/types/AutomationThrottleScope.js +11 -0
- package/api/resources/automations/types/AutomationThrottleStep.d.ts +31 -0
- package/api/resources/automations/types/AutomationThrottleStep.js +5 -0
- package/api/resources/automations/types/index.d.ts +13 -1
- package/api/resources/automations/types/index.js +13 -1
- package/api/resources/brands/client/Client.js +5 -5
- package/api/resources/bulk/client/Client.js +5 -5
- package/api/resources/lists/client/Client.js +10 -10
- package/api/resources/messages/client/Client.js +42 -12
- package/api/resources/messages/client/requests/ListMessagesRequest.d.ts +23 -3
- package/api/resources/messages/types/MessageStatus.d.ts +4 -0
- package/api/resources/messages/types/MessageStatus.js +1 -0
- package/api/resources/notifications/client/Client.js +8 -8
- package/api/resources/profiles/client/Client.js +7 -7
- package/api/resources/send/types/BaseMessageSendTo.d.ts +8 -0
- package/api/resources/send/types/BaseMessageSendTo.js +5 -0
- package/api/resources/send/types/ContentMessage.d.ts +1 -3
- package/api/resources/send/types/Recipient.d.ts +1 -1
- package/api/resources/send/types/RecipientData.d.ts +4 -0
- package/api/resources/send/types/RecipientData.js +5 -0
- package/api/resources/send/types/TemplateMessage.d.ts +1 -3
- package/api/resources/send/types/index.d.ts +2 -0
- package/api/resources/send/types/index.js +2 -0
- package/api/resources/templates/client/Client.js +1 -1
- package/api/resources/tenants/client/Client.js +5 -5
- package/api/resources/translations/client/Client.js +2 -2
- package/api/resources/users/resources/preferences/client/Client.d.ts +9 -0
- package/api/resources/users/resources/preferences/client/Client.js +12 -3
- package/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +11 -5
- package/api/resources/users/resources/preferences/types/TopicPreferenceUpdate.d.ts +10 -0
- package/api/resources/users/resources/preferences/types/TopicPreferenceUpdate.js +5 -0
- package/api/resources/users/resources/preferences/types/index.d.ts +1 -0
- package/api/resources/users/resources/preferences/types/index.js +1 -0
- package/api/resources/users/resources/tenants/client/Client.js +5 -5
- package/api/resources/users/resources/tokens/client/Client.js +5 -5
- package/dist/Client.js +1 -1
- package/dist/api/resources/audiences/client/Client.js +5 -5
- package/dist/api/resources/auditEvents/client/Client.js +2 -2
- package/dist/api/resources/authTokens/client/Client.js +1 -1
- package/dist/api/resources/automations/client/Client.d.ts +15 -0
- package/dist/api/resources/automations/client/Client.js +17 -2
- package/dist/api/resources/automations/types/AccessorType.d.ts +6 -0
- package/dist/api/resources/automations/types/AccessorType.js +5 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchMaxItemsType.d.ts +4 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchMaxItemsType.js +5 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchRetain.d.ts +34 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchRetain.js +5 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchRetainType.d.ts +10 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchRetainType.js +12 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchScope.d.ts +9 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchScope.js +11 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchStep.d.ts +39 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchStep.js +5 -0
- package/dist/api/resources/automations/types/AutomationAddToDigestStep.d.ts +16 -0
- package/dist/api/resources/automations/types/AutomationAddToDigestStep.js +5 -0
- package/dist/api/resources/automations/types/AutomationDelayStep.d.ts +3 -0
- package/dist/api/resources/automations/types/AutomationFetchDataStep.d.ts +31 -0
- package/dist/api/resources/automations/types/AutomationFetchDataStep.js +5 -0
- package/dist/api/resources/automations/types/AutomationFetchDataWebhook.d.ts +11 -0
- package/dist/api/resources/automations/types/AutomationFetchDataWebhook.js +5 -0
- package/dist/api/resources/automations/types/AutomationFetchDataWebhookMethod.d.ts +8 -0
- package/dist/api/resources/automations/types/AutomationFetchDataWebhookMethod.js +10 -0
- package/dist/api/resources/automations/types/AutomationStepOption.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationThrottleOnThrottle.d.ts +7 -0
- package/dist/api/resources/automations/types/AutomationThrottleOnThrottle.js +5 -0
- package/dist/api/resources/automations/types/AutomationThrottleScope.d.ts +9 -0
- package/dist/api/resources/automations/types/AutomationThrottleScope.js +11 -0
- package/dist/api/resources/automations/types/AutomationThrottleStep.d.ts +31 -0
- package/dist/api/resources/automations/types/AutomationThrottleStep.js +5 -0
- package/dist/api/resources/automations/types/index.d.ts +13 -1
- package/dist/api/resources/automations/types/index.js +13 -1
- package/dist/api/resources/brands/client/Client.js +5 -5
- package/dist/api/resources/bulk/client/Client.js +5 -5
- package/dist/api/resources/lists/client/Client.js +10 -10
- package/dist/api/resources/messages/client/Client.js +42 -12
- package/dist/api/resources/messages/client/requests/ListMessagesRequest.d.ts +23 -3
- package/dist/api/resources/messages/types/MessageStatus.d.ts +4 -0
- package/dist/api/resources/messages/types/MessageStatus.js +1 -0
- package/dist/api/resources/notifications/client/Client.js +8 -8
- package/dist/api/resources/profiles/client/Client.js +7 -7
- package/dist/api/resources/send/types/BaseMessageSendTo.d.ts +8 -0
- package/dist/api/resources/send/types/BaseMessageSendTo.js +5 -0
- package/dist/api/resources/send/types/ContentMessage.d.ts +1 -3
- package/dist/api/resources/send/types/Recipient.d.ts +1 -1
- package/dist/api/resources/send/types/RecipientData.d.ts +4 -0
- package/dist/api/resources/send/types/RecipientData.js +5 -0
- package/dist/api/resources/send/types/TemplateMessage.d.ts +1 -3
- package/dist/api/resources/send/types/index.d.ts +2 -0
- package/dist/api/resources/send/types/index.js +2 -0
- package/dist/api/resources/templates/client/Client.js +1 -1
- package/dist/api/resources/tenants/client/Client.js +5 -5
- package/dist/api/resources/translations/client/Client.js +2 -2
- package/dist/api/resources/users/resources/preferences/client/Client.d.ts +9 -0
- package/dist/api/resources/users/resources/preferences/client/Client.js +12 -3
- package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +11 -5
- package/dist/api/resources/users/resources/preferences/types/TopicPreferenceUpdate.d.ts +10 -0
- package/dist/api/resources/users/resources/preferences/types/TopicPreferenceUpdate.js +5 -0
- package/dist/api/resources/users/resources/preferences/types/index.d.ts +1 -0
- package/dist/api/resources/users/resources/preferences/types/index.js +1 -0
- package/dist/api/resources/users/resources/tenants/client/Client.js +5 -5
- package/dist/api/resources/users/resources/tokens/client/Client.js +5 -5
- package/package.json +1 -1
- package/api/resources/automations/types/AutomationStepAction.d.ts +0 -12
- package/api/resources/automations/types/AutomationStepAction.js +0 -14
- package/dist/api/resources/automations/types/AutomationStepAction.d.ts +0 -12
- package/dist/api/resources/automations/types/AutomationStepAction.js +0 -14
|
@@ -61,7 +61,7 @@ class Tenants {
|
|
|
61
61
|
Authorization: yield this._getAuthorizationHeader(),
|
|
62
62
|
"X-Fern-Language": "JavaScript",
|
|
63
63
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
64
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
64
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
65
65
|
},
|
|
66
66
|
contentType: "application/json",
|
|
67
67
|
body: request,
|
|
@@ -110,7 +110,7 @@ class Tenants {
|
|
|
110
110
|
Authorization: yield this._getAuthorizationHeader(),
|
|
111
111
|
"X-Fern-Language": "JavaScript",
|
|
112
112
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
113
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
113
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
114
114
|
},
|
|
115
115
|
contentType: "application/json",
|
|
116
116
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -163,7 +163,7 @@ class Tenants {
|
|
|
163
163
|
Authorization: yield this._getAuthorizationHeader(),
|
|
164
164
|
"X-Fern-Language": "JavaScript",
|
|
165
165
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
166
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
166
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
167
167
|
},
|
|
168
168
|
contentType: "application/json",
|
|
169
169
|
queryParameters: _queryParams,
|
|
@@ -204,7 +204,7 @@ class Tenants {
|
|
|
204
204
|
Authorization: yield this._getAuthorizationHeader(),
|
|
205
205
|
"X-Fern-Language": "JavaScript",
|
|
206
206
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
207
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
207
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
208
208
|
},
|
|
209
209
|
contentType: "application/json",
|
|
210
210
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -255,7 +255,7 @@ class Tenants {
|
|
|
255
255
|
Authorization: yield this._getAuthorizationHeader(),
|
|
256
256
|
"X-Fern-Language": "JavaScript",
|
|
257
257
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
258
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
258
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
259
259
|
},
|
|
260
260
|
contentType: "application/json",
|
|
261
261
|
queryParameters: _queryParams,
|
|
@@ -62,7 +62,7 @@ class Translations {
|
|
|
62
62
|
Authorization: yield this._getAuthorizationHeader(),
|
|
63
63
|
"X-Fern-Language": "JavaScript",
|
|
64
64
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
65
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
65
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
66
66
|
},
|
|
67
67
|
contentType: "application/json",
|
|
68
68
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -111,7 +111,7 @@ class Translations {
|
|
|
111
111
|
Authorization: yield this._getAuthorizationHeader(),
|
|
112
112
|
"X-Fern-Language": "JavaScript",
|
|
113
113
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
114
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
114
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
115
115
|
},
|
|
116
116
|
contentType: "application/json",
|
|
117
117
|
body: request,
|
|
@@ -31,6 +31,15 @@ export declare class Preferences {
|
|
|
31
31
|
/**
|
|
32
32
|
* Update or Create user preferences for a specific subscription topic.
|
|
33
33
|
* @throws {@link Courier.BadRequestError}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* await courier.users.preferences.update("abc-123", "74Q4QGFBEX481DP6JRPMV751H4XT", {
|
|
37
|
+
* topic: {
|
|
38
|
+
* status: Courier.PreferenceStatus.OptedIn,
|
|
39
|
+
* has_custom_routing: true,
|
|
40
|
+
* custom_routing: [Courier.ChannelClassification.Inbox, Courier.ChannelClassification.Email]
|
|
41
|
+
* }
|
|
42
|
+
* })
|
|
34
43
|
*/
|
|
35
44
|
update(userId: string, topicId: string, request: Courier.users.UserPreferencesUpdateParams, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesUpdateResponse>;
|
|
36
45
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
@@ -62,7 +62,7 @@ class Preferences {
|
|
|
62
62
|
Authorization: yield this._getAuthorizationHeader(),
|
|
63
63
|
"X-Fern-Language": "JavaScript",
|
|
64
64
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
65
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
65
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
66
66
|
},
|
|
67
67
|
contentType: "application/json",
|
|
68
68
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -111,7 +111,7 @@ class Preferences {
|
|
|
111
111
|
Authorization: yield this._getAuthorizationHeader(),
|
|
112
112
|
"X-Fern-Language": "JavaScript",
|
|
113
113
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
114
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
114
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
115
115
|
},
|
|
116
116
|
contentType: "application/json",
|
|
117
117
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -149,6 +149,15 @@ class Preferences {
|
|
|
149
149
|
/**
|
|
150
150
|
* Update or Create user preferences for a specific subscription topic.
|
|
151
151
|
* @throws {@link Courier.BadRequestError}
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* await courier.users.preferences.update("abc-123", "74Q4QGFBEX481DP6JRPMV751H4XT", {
|
|
155
|
+
* topic: {
|
|
156
|
+
* status: Courier.PreferenceStatus.OptedIn,
|
|
157
|
+
* has_custom_routing: true,
|
|
158
|
+
* custom_routing: [Courier.ChannelClassification.Inbox, Courier.ChannelClassification.Email]
|
|
159
|
+
* }
|
|
160
|
+
* })
|
|
152
161
|
*/
|
|
153
162
|
update(userId, topicId, request, requestOptions) {
|
|
154
163
|
var _a, _b;
|
|
@@ -160,7 +169,7 @@ class Preferences {
|
|
|
160
169
|
Authorization: yield this._getAuthorizationHeader(),
|
|
161
170
|
"X-Fern-Language": "JavaScript",
|
|
162
171
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
163
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
172
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
164
173
|
},
|
|
165
174
|
contentType: "application/json",
|
|
166
175
|
body: request,
|
package/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts
CHANGED
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Courier from "../../../../../..";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* topic: {
|
|
9
|
+
* status: Courier.PreferenceStatus.OptedIn,
|
|
10
|
+
* has_custom_routing: true,
|
|
11
|
+
* custom_routing: [Courier.ChannelClassification.Inbox, Courier.ChannelClassification.Email]
|
|
12
|
+
* }
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
5
15
|
export interface UserPreferencesUpdateParams {
|
|
6
|
-
|
|
7
|
-
/** The Channels a user has chosen to receive notifications through for this topic */
|
|
8
|
-
custom_routing?: Courier.ChannelClassification[];
|
|
9
|
-
default_status: Courier.PreferenceStatus;
|
|
10
|
-
has_custom_routing?: boolean;
|
|
16
|
+
topic: Courier.users.TopicPreferenceUpdate;
|
|
11
17
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Courier from "../../../../..";
|
|
5
|
+
export interface TopicPreferenceUpdate {
|
|
6
|
+
status: Courier.PreferenceStatus;
|
|
7
|
+
/** The Channels a user has chosen to receive notifications through for this topic */
|
|
8
|
+
custom_routing?: Courier.ChannelClassification[];
|
|
9
|
+
has_custom_routing?: boolean;
|
|
10
|
+
}
|
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./UserPreferencesListResponse"), exports);
|
|
18
18
|
__exportStar(require("./UserPreferencesGetResponse"), exports);
|
|
19
19
|
__exportStar(require("./TopicPreference"), exports);
|
|
20
|
+
__exportStar(require("./TopicPreferenceUpdate"), exports);
|
|
20
21
|
__exportStar(require("./UserPreferencesUpdateResponse"), exports);
|
|
@@ -64,7 +64,7 @@ class Tenants {
|
|
|
64
64
|
Authorization: yield this._getAuthorizationHeader(),
|
|
65
65
|
"X-Fern-Language": "JavaScript",
|
|
66
66
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
67
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
67
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
68
68
|
},
|
|
69
69
|
contentType: "application/json",
|
|
70
70
|
body: request,
|
|
@@ -112,7 +112,7 @@ class Tenants {
|
|
|
112
112
|
Authorization: yield this._getAuthorizationHeader(),
|
|
113
113
|
"X-Fern-Language": "JavaScript",
|
|
114
114
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
115
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
115
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
116
116
|
},
|
|
117
117
|
contentType: "application/json",
|
|
118
118
|
body: request,
|
|
@@ -156,7 +156,7 @@ class Tenants {
|
|
|
156
156
|
Authorization: yield this._getAuthorizationHeader(),
|
|
157
157
|
"X-Fern-Language": "JavaScript",
|
|
158
158
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
159
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
159
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
160
160
|
},
|
|
161
161
|
contentType: "application/json",
|
|
162
162
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -199,7 +199,7 @@ class Tenants {
|
|
|
199
199
|
Authorization: yield this._getAuthorizationHeader(),
|
|
200
200
|
"X-Fern-Language": "JavaScript",
|
|
201
201
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
202
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
202
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
203
203
|
},
|
|
204
204
|
contentType: "application/json",
|
|
205
205
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -250,7 +250,7 @@ class Tenants {
|
|
|
250
250
|
Authorization: yield this._getAuthorizationHeader(),
|
|
251
251
|
"X-Fern-Language": "JavaScript",
|
|
252
252
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
253
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
253
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
254
254
|
},
|
|
255
255
|
contentType: "application/json",
|
|
256
256
|
queryParameters: _queryParams,
|
|
@@ -62,7 +62,7 @@ class Tokens {
|
|
|
62
62
|
Authorization: yield this._getAuthorizationHeader(),
|
|
63
63
|
"X-Fern-Language": "JavaScript",
|
|
64
64
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
65
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
65
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
66
66
|
},
|
|
67
67
|
contentType: "application/json",
|
|
68
68
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -111,7 +111,7 @@ class Tokens {
|
|
|
111
111
|
Authorization: yield this._getAuthorizationHeader(),
|
|
112
112
|
"X-Fern-Language": "JavaScript",
|
|
113
113
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
114
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
114
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
115
115
|
},
|
|
116
116
|
contentType: "application/json",
|
|
117
117
|
body: request,
|
|
@@ -161,7 +161,7 @@ class Tokens {
|
|
|
161
161
|
Authorization: yield this._getAuthorizationHeader(),
|
|
162
162
|
"X-Fern-Language": "JavaScript",
|
|
163
163
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
164
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
164
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
165
165
|
},
|
|
166
166
|
contentType: "application/json",
|
|
167
167
|
body: request,
|
|
@@ -211,7 +211,7 @@ class Tokens {
|
|
|
211
211
|
Authorization: yield this._getAuthorizationHeader(),
|
|
212
212
|
"X-Fern-Language": "JavaScript",
|
|
213
213
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
214
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
214
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
215
215
|
},
|
|
216
216
|
contentType: "application/json",
|
|
217
217
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -260,7 +260,7 @@ class Tokens {
|
|
|
260
260
|
Authorization: yield this._getAuthorizationHeader(),
|
|
261
261
|
"X-Fern-Language": "JavaScript",
|
|
262
262
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
263
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
263
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
264
264
|
},
|
|
265
265
|
contentType: "application/json",
|
|
266
266
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
package/dist/Client.js
CHANGED
|
@@ -74,7 +74,7 @@ class CourierClient {
|
|
|
74
74
|
Authorization: yield this._getAuthorizationHeader(),
|
|
75
75
|
"X-Fern-Language": "JavaScript",
|
|
76
76
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
77
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
77
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
78
78
|
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
79
79
|
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
|
|
80
80
|
? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
|
|
@@ -61,7 +61,7 @@ class Audiences {
|
|
|
61
61
|
Authorization: yield this._getAuthorizationHeader(),
|
|
62
62
|
"X-Fern-Language": "JavaScript",
|
|
63
63
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
64
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
64
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
65
65
|
},
|
|
66
66
|
contentType: "application/json",
|
|
67
67
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -104,7 +104,7 @@ class Audiences {
|
|
|
104
104
|
Authorization: yield this._getAuthorizationHeader(),
|
|
105
105
|
"X-Fern-Language": "JavaScript",
|
|
106
106
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
107
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
107
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
108
108
|
},
|
|
109
109
|
contentType: "application/json",
|
|
110
110
|
body: request,
|
|
@@ -148,7 +148,7 @@ class Audiences {
|
|
|
148
148
|
Authorization: yield this._getAuthorizationHeader(),
|
|
149
149
|
"X-Fern-Language": "JavaScript",
|
|
150
150
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
151
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
151
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
152
152
|
},
|
|
153
153
|
contentType: "application/json",
|
|
154
154
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -197,7 +197,7 @@ class Audiences {
|
|
|
197
197
|
Authorization: yield this._getAuthorizationHeader(),
|
|
198
198
|
"X-Fern-Language": "JavaScript",
|
|
199
199
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
200
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
200
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
201
201
|
},
|
|
202
202
|
contentType: "application/json",
|
|
203
203
|
queryParameters: _queryParams,
|
|
@@ -252,7 +252,7 @@ class Audiences {
|
|
|
252
252
|
Authorization: yield this._getAuthorizationHeader(),
|
|
253
253
|
"X-Fern-Language": "JavaScript",
|
|
254
254
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
255
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
255
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
256
256
|
},
|
|
257
257
|
contentType: "application/json",
|
|
258
258
|
queryParameters: _queryParams,
|
|
@@ -65,7 +65,7 @@ class AuditEvents {
|
|
|
65
65
|
Authorization: yield this._getAuthorizationHeader(),
|
|
66
66
|
"X-Fern-Language": "JavaScript",
|
|
67
67
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
68
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
68
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
69
69
|
},
|
|
70
70
|
contentType: "application/json",
|
|
71
71
|
queryParameters: _queryParams,
|
|
@@ -109,7 +109,7 @@ class AuditEvents {
|
|
|
109
109
|
Authorization: yield this._getAuthorizationHeader(),
|
|
110
110
|
"X-Fern-Language": "JavaScript",
|
|
111
111
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
112
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
112
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
113
113
|
},
|
|
114
114
|
contentType: "application/json",
|
|
115
115
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -60,7 +60,7 @@ class AuthTokens {
|
|
|
60
60
|
Authorization: yield this._getAuthorizationHeader(),
|
|
61
61
|
"X-Fern-Language": "JavaScript",
|
|
62
62
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
63
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
63
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
64
64
|
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
65
65
|
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
|
|
66
66
|
? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
|
|
@@ -28,6 +28,21 @@ export declare class Automations {
|
|
|
28
28
|
invokeAutomationTemplate(templateId: string, request: Courier.AutomationInvokeParams, requestOptions?: Automations.IdempotentRequestOptions): Promise<Courier.AutomationInvokeResponse>;
|
|
29
29
|
/**
|
|
30
30
|
* Invoke an ad hoc automation run. This endpoint accepts a JSON payload with a series of automation steps. For information about what steps are available, checkout the ad hoc automation guide [here](https://www.courier.com/docs/automations/steps/).
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* await courier.automations.invokeAdHocAutomation({
|
|
34
|
+
* data: {
|
|
35
|
+
* "name": "Foo"
|
|
36
|
+
* },
|
|
37
|
+
* profile: {
|
|
38
|
+
* "tenant_id": "abc-123"
|
|
39
|
+
* },
|
|
40
|
+
* recipient: "user-yes",
|
|
41
|
+
* automation: {
|
|
42
|
+
* cancelation_token: "delay-send--user-yes--abc-123",
|
|
43
|
+
* steps: []
|
|
44
|
+
* }
|
|
45
|
+
* })
|
|
31
46
|
*/
|
|
32
47
|
invokeAdHocAutomation(request: Courier.AutomationAdHocInvokeParams, requestOptions?: Automations.IdempotentRequestOptions): Promise<Courier.AutomationInvokeResponse>;
|
|
33
48
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
@@ -60,7 +60,7 @@ class Automations {
|
|
|
60
60
|
Authorization: yield this._getAuthorizationHeader(),
|
|
61
61
|
"X-Fern-Language": "JavaScript",
|
|
62
62
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
63
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
63
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
64
64
|
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
65
65
|
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
|
|
66
66
|
? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
|
|
@@ -97,6 +97,21 @@ class Automations {
|
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
99
|
* Invoke an ad hoc automation run. This endpoint accepts a JSON payload with a series of automation steps. For information about what steps are available, checkout the ad hoc automation guide [here](https://www.courier.com/docs/automations/steps/).
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* await courier.automations.invokeAdHocAutomation({
|
|
103
|
+
* data: {
|
|
104
|
+
* "name": "Foo"
|
|
105
|
+
* },
|
|
106
|
+
* profile: {
|
|
107
|
+
* "tenant_id": "abc-123"
|
|
108
|
+
* },
|
|
109
|
+
* recipient: "user-yes",
|
|
110
|
+
* automation: {
|
|
111
|
+
* cancelation_token: "delay-send--user-yes--abc-123",
|
|
112
|
+
* steps: []
|
|
113
|
+
* }
|
|
114
|
+
* })
|
|
100
115
|
*/
|
|
101
116
|
invokeAdHocAutomation(request, requestOptions) {
|
|
102
117
|
var _a, _b;
|
|
@@ -108,7 +123,7 @@ class Automations {
|
|
|
108
123
|
Authorization: yield this._getAuthorizationHeader(),
|
|
109
124
|
"X-Fern-Language": "JavaScript",
|
|
110
125
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
111
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
126
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
112
127
|
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
113
128
|
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
|
|
114
129
|
? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Courier from "../../..";
|
|
5
|
+
/**
|
|
6
|
+
* Defines what items should be retained and passed along to the next steps when the batch is released
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* {
|
|
10
|
+
* type: Courier.AutomationAddToBatchRetainType.Highest,
|
|
11
|
+
* count: 10,
|
|
12
|
+
* sort_key: "refs.data.my_custom_scoring"
|
|
13
|
+
* }
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* {
|
|
17
|
+
* type: Courier.AutomationAddToBatchRetainType.Last,
|
|
18
|
+
* count: 10
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
export interface AutomationAddToBatchRetain {
|
|
22
|
+
/**
|
|
23
|
+
* Keep N number of notifications based on the type. First/Last N based on notification received.
|
|
24
|
+
* highest/lowest based on a scoring key providing in the data accessed by sort_key
|
|
25
|
+
*/
|
|
26
|
+
type: Courier.AutomationAddToBatchRetainType;
|
|
27
|
+
/**
|
|
28
|
+
* The number of records to keep in batch. Default is 10 and only configurable by requesting from support.
|
|
29
|
+
* When configurable minimum is 2 and maximum is 100.
|
|
30
|
+
*/
|
|
31
|
+
count: number;
|
|
32
|
+
/** Defines the data value data[sort_key] that is used to sort the stored items. Required when type is set to highest or lowest. */
|
|
33
|
+
sort_key?: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export declare type AutomationAddToBatchRetainType = "first" | "last" | "highest" | "lowest";
|
|
5
|
+
export declare const AutomationAddToBatchRetainType: {
|
|
6
|
+
readonly First: "first";
|
|
7
|
+
readonly Last: "last";
|
|
8
|
+
readonly Highest: "highest";
|
|
9
|
+
readonly Lowest: "lowest";
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AutomationAddToBatchRetainType = void 0;
|
|
7
|
+
exports.AutomationAddToBatchRetainType = {
|
|
8
|
+
First: "first",
|
|
9
|
+
Last: "last",
|
|
10
|
+
Highest: "highest",
|
|
11
|
+
Lowest: "lowest",
|
|
12
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export declare type AutomationAddToBatchScope = "user" | "global" | "dynamic";
|
|
5
|
+
export declare const AutomationAddToBatchScope: {
|
|
6
|
+
readonly User: "user";
|
|
7
|
+
readonly Global: "global";
|
|
8
|
+
readonly Dynamic: "dynamic";
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AutomationAddToBatchScope = void 0;
|
|
7
|
+
exports.AutomationAddToBatchScope = {
|
|
8
|
+
User: "user",
|
|
9
|
+
Global: "global",
|
|
10
|
+
Dynamic: "dynamic",
|
|
11
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Courier from "../../..";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* action: "add-to-batch",
|
|
9
|
+
* wait_period: "PT5M",
|
|
10
|
+
* max_wait_period: "PT1H",
|
|
11
|
+
* retain: {
|
|
12
|
+
* type: Courier.AutomationAddToBatchRetainType.Highest,
|
|
13
|
+
* count: 10,
|
|
14
|
+
* sort_key: "refs.data.my_custom_scoring"
|
|
15
|
+
* },
|
|
16
|
+
* scope: Courier.AutomationAddToBatchScope.User,
|
|
17
|
+
* category_key: "refs.data.status"
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export interface AutomationAddToBatchStep extends Courier.AutomationStep {
|
|
21
|
+
action: "add-to-batch";
|
|
22
|
+
/** Defines the period of inactivity before the batch is released. Specified as an [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations) */
|
|
23
|
+
wait_period: string;
|
|
24
|
+
/** Defines the maximum wait time before the batch should be released. Must be less than wait period. Maximum of 60 days. Specified as an [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations) */
|
|
25
|
+
max_wait_period: string;
|
|
26
|
+
/** If specified, the batch will release as soon as this number is reached */
|
|
27
|
+
max_items?: Courier.AutomationAddToBatchMaxItemsType;
|
|
28
|
+
retain: Courier.AutomationAddToBatchRetain;
|
|
29
|
+
/**
|
|
30
|
+
* Determine the scope of the batching. If user, chosen in this order: recipient, profile.user_id, data.user_id, data.userId.
|
|
31
|
+
* If dynamic, then specify where the batch_key or a reference to the batch_key
|
|
32
|
+
*/
|
|
33
|
+
scope?: Courier.AutomationAddToBatchScope;
|
|
34
|
+
/** If using scope=dynamic, provide the key or a reference (e.g., refs.data.batch_key) */
|
|
35
|
+
batch_key?: string;
|
|
36
|
+
batch_id?: string;
|
|
37
|
+
/** Defines the field of the data object the batch is set to when complete. Defaults to `batch` */
|
|
38
|
+
category_key?: string;
|
|
39
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Courier from "../../..";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* action: "add-to-digest",
|
|
9
|
+
* subscription_topic_id: "RAJE97CMT04KDJJ88ZDS2TP1690S"
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export interface AutomationAddToDigestStep extends Courier.AutomationStep {
|
|
13
|
+
action: "add-to-digest";
|
|
14
|
+
/** The subscription topic that has digests enabled */
|
|
15
|
+
subscription_topic_id: string;
|
|
16
|
+
}
|
|
@@ -4,5 +4,8 @@
|
|
|
4
4
|
import * as Courier from "../../..";
|
|
5
5
|
export interface AutomationDelayStep extends Courier.AutomationStep {
|
|
6
6
|
action: "delay";
|
|
7
|
+
/** The [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations) string for how long to delay for */
|
|
8
|
+
duration?: string;
|
|
9
|
+
/** The ISO 8601 timestamp for when the delay should end */
|
|
7
10
|
until?: string;
|
|
8
11
|
}
|