@trycourier/courier 6.0.6 → 6.0.8
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.d.ts +1 -0
- package/Client.js +4 -4
- package/api/resources/audiences/client/Client.d.ts +1 -0
- package/api/resources/audiences/client/Client.js +20 -20
- package/api/resources/auditEvents/client/Client.d.ts +1 -0
- package/api/resources/auditEvents/client/Client.js +8 -8
- package/api/resources/authTokens/client/Client.d.ts +1 -0
- package/api/resources/authTokens/client/Client.js +4 -4
- package/api/resources/automations/client/Client.d.ts +1 -0
- package/api/resources/automations/client/Client.js +8 -8
- package/api/resources/brands/client/Client.d.ts +1 -0
- package/api/resources/brands/client/Client.js +20 -20
- package/api/resources/bulk/client/Client.d.ts +1 -0
- package/api/resources/bulk/client/Client.js +20 -20
- package/api/resources/lists/client/Client.d.ts +1 -0
- package/api/resources/lists/client/Client.js +40 -40
- package/api/resources/messages/client/Client.d.ts +1 -0
- package/api/resources/messages/client/Client.js +24 -24
- package/api/resources/notifications/client/Client.d.ts +1 -0
- package/api/resources/notifications/client/Client.js +32 -32
- package/api/resources/profiles/client/Client.d.ts +1 -0
- package/api/resources/profiles/client/Client.js +28 -28
- package/api/resources/send/types/MsTeamsRecipient.d.ts +7 -0
- package/api/resources/send/types/MsTeamsRecipient.js +5 -0
- package/api/resources/send/types/Recipient.d.ts +1 -1
- package/api/resources/send/types/SlackRecipient.d.ts +7 -0
- package/api/resources/send/types/SlackRecipient.js +5 -0
- 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.d.ts +1 -0
- package/api/resources/templates/client/Client.js +4 -4
- package/api/resources/tenants/client/Client.d.ts +1 -0
- package/api/resources/tenants/client/Client.js +20 -20
- package/api/resources/translations/client/Client.d.ts +1 -0
- package/api/resources/translations/client/Client.js +8 -8
- package/api/resources/users/client/Client.d.ts +1 -0
- package/api/resources/users/resources/preferences/client/Client.d.ts +1 -0
- package/api/resources/users/resources/preferences/client/Client.js +12 -12
- package/api/resources/users/resources/tenants/client/Client.d.ts +5 -0
- package/api/resources/users/resources/tenants/client/Client.js +59 -16
- package/api/resources/users/resources/tokens/client/Client.d.ts +1 -0
- package/api/resources/users/resources/tokens/client/Client.js +20 -20
- package/dist/Client.d.ts +1 -0
- package/dist/Client.js +4 -4
- package/dist/api/resources/audiences/client/Client.d.ts +1 -0
- package/dist/api/resources/audiences/client/Client.js +20 -20
- package/dist/api/resources/auditEvents/client/Client.d.ts +1 -0
- package/dist/api/resources/auditEvents/client/Client.js +8 -8
- package/dist/api/resources/authTokens/client/Client.d.ts +1 -0
- package/dist/api/resources/authTokens/client/Client.js +4 -4
- package/dist/api/resources/automations/client/Client.d.ts +1 -0
- package/dist/api/resources/automations/client/Client.js +8 -8
- package/dist/api/resources/brands/client/Client.d.ts +1 -0
- package/dist/api/resources/brands/client/Client.js +20 -20
- package/dist/api/resources/bulk/client/Client.d.ts +1 -0
- package/dist/api/resources/bulk/client/Client.js +20 -20
- package/dist/api/resources/lists/client/Client.d.ts +1 -0
- package/dist/api/resources/lists/client/Client.js +40 -40
- package/dist/api/resources/messages/client/Client.d.ts +1 -0
- package/dist/api/resources/messages/client/Client.js +24 -24
- package/dist/api/resources/notifications/client/Client.d.ts +1 -0
- package/dist/api/resources/notifications/client/Client.js +32 -32
- package/dist/api/resources/profiles/client/Client.d.ts +1 -0
- package/dist/api/resources/profiles/client/Client.js +28 -28
- package/dist/api/resources/send/types/MsTeamsRecipient.d.ts +7 -0
- package/dist/api/resources/send/types/MsTeamsRecipient.js +5 -0
- package/dist/api/resources/send/types/Recipient.d.ts +1 -1
- package/dist/api/resources/send/types/SlackRecipient.d.ts +7 -0
- package/dist/api/resources/send/types/SlackRecipient.js +5 -0
- 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.d.ts +1 -0
- package/dist/api/resources/templates/client/Client.js +4 -4
- package/dist/api/resources/tenants/client/Client.d.ts +1 -0
- package/dist/api/resources/tenants/client/Client.js +20 -20
- package/dist/api/resources/translations/client/Client.d.ts +1 -0
- package/dist/api/resources/translations/client/Client.js +8 -8
- package/dist/api/resources/users/client/Client.d.ts +1 -0
- package/dist/api/resources/users/resources/preferences/client/Client.d.ts +1 -0
- package/dist/api/resources/users/resources/preferences/client/Client.js +12 -12
- package/dist/api/resources/users/resources/tenants/client/Client.d.ts +5 -0
- package/dist/api/resources/users/resources/tenants/client/Client.js +59 -16
- package/dist/api/resources/users/resources/tokens/client/Client.d.ts +1 -0
- package/dist/api/resources/users/resources/tokens/client/Client.js +20 -20
- package/package.json +1 -1
package/Client.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare namespace CourierClient {
|
|
|
22
22
|
interface Options {
|
|
23
23
|
environment?: core.Supplier<environments.CourierEnvironment | string>;
|
|
24
24
|
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
|
|
25
|
+
fetcher?: core.FetchFunction;
|
|
25
26
|
}
|
|
26
27
|
interface RequestOptions {
|
|
27
28
|
timeoutInSeconds?: number;
|
package/Client.js
CHANGED
|
@@ -65,16 +65,16 @@ class CourierClient {
|
|
|
65
65
|
* Use the send API to send a message to one or more recipients.
|
|
66
66
|
*/
|
|
67
67
|
send(request, requestOptions) {
|
|
68
|
-
var _a;
|
|
68
|
+
var _a, _b;
|
|
69
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
const _response = yield core.fetcher({
|
|
71
|
-
url: (0, url_join_1.default)((
|
|
70
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
71
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "/send"),
|
|
72
72
|
method: "POST",
|
|
73
73
|
headers: {
|
|
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.0.
|
|
77
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
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()
|
|
@@ -8,6 +8,7 @@ export declare namespace Audiences {
|
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.CourierEnvironment | string>;
|
|
10
10
|
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
12
13
|
interface RequestOptions {
|
|
13
14
|
timeoutInSeconds?: number;
|
|
@@ -52,16 +52,16 @@ class Audiences {
|
|
|
52
52
|
* Returns the specified audience by id.
|
|
53
53
|
*/
|
|
54
54
|
get(audienceId, requestOptions) {
|
|
55
|
-
var _a;
|
|
55
|
+
var _a, _b;
|
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
const _response = yield core.fetcher({
|
|
58
|
-
url: (0, url_join_1.default)((
|
|
57
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
58
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/audiences/${audienceId}`),
|
|
59
59
|
method: "GET",
|
|
60
60
|
headers: {
|
|
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.0.
|
|
64
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
65
65
|
},
|
|
66
66
|
contentType: "application/json",
|
|
67
67
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -95,16 +95,16 @@ class Audiences {
|
|
|
95
95
|
* Creates or updates audience.
|
|
96
96
|
*/
|
|
97
97
|
update(audienceId, request = {}, requestOptions) {
|
|
98
|
-
var _a;
|
|
98
|
+
var _a, _b;
|
|
99
99
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
const _response = yield core.fetcher({
|
|
101
|
-
url: (0, url_join_1.default)((
|
|
100
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
101
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/audiences/${audienceId}`),
|
|
102
102
|
method: "PUT",
|
|
103
103
|
headers: {
|
|
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.0.
|
|
107
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
108
108
|
},
|
|
109
109
|
contentType: "application/json",
|
|
110
110
|
body: request,
|
|
@@ -139,16 +139,16 @@ class Audiences {
|
|
|
139
139
|
* Deletes the specified audience.
|
|
140
140
|
*/
|
|
141
141
|
delete(audienceId, requestOptions) {
|
|
142
|
-
var _a;
|
|
142
|
+
var _a, _b;
|
|
143
143
|
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
-
const _response = yield core.fetcher({
|
|
145
|
-
url: (0, url_join_1.default)((
|
|
144
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
145
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/audiences/${audienceId}`),
|
|
146
146
|
method: "DELETE",
|
|
147
147
|
headers: {
|
|
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.0.
|
|
151
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
152
152
|
},
|
|
153
153
|
contentType: "application/json",
|
|
154
154
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -183,21 +183,21 @@ class Audiences {
|
|
|
183
183
|
* @throws {@link Courier.BadRequestError}
|
|
184
184
|
*/
|
|
185
185
|
listMembers(audienceId, request = {}, requestOptions) {
|
|
186
|
-
var _a;
|
|
186
|
+
var _a, _b;
|
|
187
187
|
return __awaiter(this, void 0, void 0, function* () {
|
|
188
188
|
const { cursor } = request;
|
|
189
189
|
const _queryParams = {};
|
|
190
190
|
if (cursor != null) {
|
|
191
191
|
_queryParams["cursor"] = cursor;
|
|
192
192
|
}
|
|
193
|
-
const _response = yield core.fetcher({
|
|
194
|
-
url: (0, url_join_1.default)((
|
|
193
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
194
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/audiences/${audienceId}/members`),
|
|
195
195
|
method: "GET",
|
|
196
196
|
headers: {
|
|
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.0.
|
|
200
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
201
201
|
},
|
|
202
202
|
contentType: "application/json",
|
|
203
203
|
queryParameters: _queryParams,
|
|
@@ -238,21 +238,21 @@ class Audiences {
|
|
|
238
238
|
* @throws {@link Courier.BadRequestError}
|
|
239
239
|
*/
|
|
240
240
|
listAudiences(request = {}, requestOptions) {
|
|
241
|
-
var _a;
|
|
241
|
+
var _a, _b;
|
|
242
242
|
return __awaiter(this, void 0, void 0, function* () {
|
|
243
243
|
const { cursor } = request;
|
|
244
244
|
const _queryParams = {};
|
|
245
245
|
if (cursor != null) {
|
|
246
246
|
_queryParams["cursor"] = cursor;
|
|
247
247
|
}
|
|
248
|
-
const _response = yield core.fetcher({
|
|
249
|
-
url: (0, url_join_1.default)((
|
|
248
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
249
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "/audiences"),
|
|
250
250
|
method: "GET",
|
|
251
251
|
headers: {
|
|
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.0.
|
|
255
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
256
256
|
},
|
|
257
257
|
contentType: "application/json",
|
|
258
258
|
queryParameters: _queryParams,
|
|
@@ -8,6 +8,7 @@ export declare namespace AuditEvents {
|
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.CourierEnvironment | string>;
|
|
10
10
|
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
12
13
|
interface RequestOptions {
|
|
13
14
|
timeoutInSeconds?: number;
|
|
@@ -51,21 +51,21 @@ class AuditEvents {
|
|
|
51
51
|
* Fetch the list of audit events
|
|
52
52
|
*/
|
|
53
53
|
list(request = {}, requestOptions) {
|
|
54
|
-
var _a;
|
|
54
|
+
var _a, _b;
|
|
55
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
56
|
const { cursor } = request;
|
|
57
57
|
const _queryParams = {};
|
|
58
58
|
if (cursor != null) {
|
|
59
59
|
_queryParams["cursor"] = cursor;
|
|
60
60
|
}
|
|
61
|
-
const _response = yield core.fetcher({
|
|
62
|
-
url: (0, url_join_1.default)((
|
|
61
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
62
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "/audit-events"),
|
|
63
63
|
method: "GET",
|
|
64
64
|
headers: {
|
|
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.0.
|
|
68
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
69
69
|
},
|
|
70
70
|
contentType: "application/json",
|
|
71
71
|
queryParameters: _queryParams,
|
|
@@ -100,16 +100,16 @@ class AuditEvents {
|
|
|
100
100
|
* Fetch a specific audit event by ID.
|
|
101
101
|
*/
|
|
102
102
|
get(auditEventId, requestOptions) {
|
|
103
|
-
var _a;
|
|
103
|
+
var _a, _b;
|
|
104
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
-
const _response = yield core.fetcher({
|
|
106
|
-
url: (0, url_join_1.default)((
|
|
105
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
106
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/audit-events/${auditEventId}`),
|
|
107
107
|
method: "GET",
|
|
108
108
|
headers: {
|
|
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.0.
|
|
112
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
113
113
|
},
|
|
114
114
|
contentType: "application/json",
|
|
115
115
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -8,6 +8,7 @@ export declare namespace AuthTokens {
|
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.CourierEnvironment | string>;
|
|
10
10
|
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
12
13
|
interface RequestOptions {
|
|
13
14
|
timeoutInSeconds?: number;
|
|
@@ -51,16 +51,16 @@ class AuthTokens {
|
|
|
51
51
|
* Returns a new access token.
|
|
52
52
|
*/
|
|
53
53
|
issueToken(request, requestOptions) {
|
|
54
|
-
var _a;
|
|
54
|
+
var _a, _b;
|
|
55
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
const _response = yield core.fetcher({
|
|
57
|
-
url: (0, url_join_1.default)((
|
|
56
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
57
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "/auth/issue-token"),
|
|
58
58
|
method: "POST",
|
|
59
59
|
headers: {
|
|
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.0.
|
|
63
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
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()
|
|
@@ -8,6 +8,7 @@ export declare namespace Automations {
|
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.CourierEnvironment | string>;
|
|
10
10
|
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
12
13
|
interface RequestOptions {
|
|
13
14
|
timeoutInSeconds?: number;
|
|
@@ -51,16 +51,16 @@ class Automations {
|
|
|
51
51
|
* Invoke an automation run from an automation template.
|
|
52
52
|
*/
|
|
53
53
|
invokeAutomationTemplate(templateId, request, requestOptions) {
|
|
54
|
-
var _a;
|
|
54
|
+
var _a, _b;
|
|
55
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
const _response = yield core.fetcher({
|
|
57
|
-
url: (0, url_join_1.default)((
|
|
56
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
57
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/automations/${templateId}/invoke`),
|
|
58
58
|
method: "POST",
|
|
59
59
|
headers: {
|
|
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.0.
|
|
63
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
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()
|
|
@@ -99,16 +99,16 @@ class Automations {
|
|
|
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
100
|
*/
|
|
101
101
|
invokeAdHocAutomation(request, requestOptions) {
|
|
102
|
-
var _a;
|
|
102
|
+
var _a, _b;
|
|
103
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
-
const _response = yield core.fetcher({
|
|
105
|
-
url: (0, url_join_1.default)((
|
|
104
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
105
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "/automations/invoke"),
|
|
106
106
|
method: "POST",
|
|
107
107
|
headers: {
|
|
108
108
|
Authorization: yield this._getAuthorizationHeader(),
|
|
109
109
|
"X-Fern-Language": "JavaScript",
|
|
110
110
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
111
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
111
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
112
112
|
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
113
113
|
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
|
|
114
114
|
? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
|
|
@@ -8,6 +8,7 @@ export declare namespace Brands {
|
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.CourierEnvironment | string>;
|
|
10
10
|
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
12
13
|
interface RequestOptions {
|
|
13
14
|
timeoutInSeconds?: number;
|
|
@@ -54,16 +54,16 @@ class Brands {
|
|
|
54
54
|
* @throws {@link Courier.AlreadyExistsError}
|
|
55
55
|
*/
|
|
56
56
|
create(request, requestOptions) {
|
|
57
|
-
var _a;
|
|
57
|
+
var _a, _b;
|
|
58
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
const _response = yield core.fetcher({
|
|
60
|
-
url: (0, url_join_1.default)((
|
|
59
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
60
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "/brands"),
|
|
61
61
|
method: "POST",
|
|
62
62
|
headers: {
|
|
63
63
|
Authorization: yield this._getAuthorizationHeader(),
|
|
64
64
|
"X-Fern-Language": "JavaScript",
|
|
65
65
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
66
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
66
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
67
67
|
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
68
68
|
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
|
|
69
69
|
? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
|
|
@@ -111,16 +111,16 @@ class Brands {
|
|
|
111
111
|
* Fetch a specific brand by brand ID.
|
|
112
112
|
*/
|
|
113
113
|
get(brandId, requestOptions) {
|
|
114
|
-
var _a;
|
|
114
|
+
var _a, _b;
|
|
115
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
-
const _response = yield core.fetcher({
|
|
117
|
-
url: (0, url_join_1.default)((
|
|
116
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
117
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/brands/${brandId}`),
|
|
118
118
|
method: "GET",
|
|
119
119
|
headers: {
|
|
120
120
|
Authorization: yield this._getAuthorizationHeader(),
|
|
121
121
|
"X-Fern-Language": "JavaScript",
|
|
122
122
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
123
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
123
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
124
124
|
},
|
|
125
125
|
contentType: "application/json",
|
|
126
126
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -154,21 +154,21 @@ class Brands {
|
|
|
154
154
|
* Get the list of brands.
|
|
155
155
|
*/
|
|
156
156
|
list(request = {}, requestOptions) {
|
|
157
|
-
var _a;
|
|
157
|
+
var _a, _b;
|
|
158
158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
159
159
|
const { cursor } = request;
|
|
160
160
|
const _queryParams = {};
|
|
161
161
|
if (cursor != null) {
|
|
162
162
|
_queryParams["cursor"] = cursor;
|
|
163
163
|
}
|
|
164
|
-
const _response = yield core.fetcher({
|
|
165
|
-
url: (0, url_join_1.default)((
|
|
164
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
165
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "/brands"),
|
|
166
166
|
method: "GET",
|
|
167
167
|
headers: {
|
|
168
168
|
Authorization: yield this._getAuthorizationHeader(),
|
|
169
169
|
"X-Fern-Language": "JavaScript",
|
|
170
170
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
171
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
171
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
172
172
|
},
|
|
173
173
|
contentType: "application/json",
|
|
174
174
|
queryParameters: _queryParams,
|
|
@@ -204,16 +204,16 @@ class Brands {
|
|
|
204
204
|
* @throws {@link Courier.ConflictError}
|
|
205
205
|
*/
|
|
206
206
|
delete(brandId, requestOptions) {
|
|
207
|
-
var _a;
|
|
207
|
+
var _a, _b;
|
|
208
208
|
return __awaiter(this, void 0, void 0, function* () {
|
|
209
|
-
const _response = yield core.fetcher({
|
|
210
|
-
url: (0, url_join_1.default)((
|
|
209
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
210
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/brands/${brandId}`),
|
|
211
211
|
method: "DELETE",
|
|
212
212
|
headers: {
|
|
213
213
|
Authorization: yield this._getAuthorizationHeader(),
|
|
214
214
|
"X-Fern-Language": "JavaScript",
|
|
215
215
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
216
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
216
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
217
217
|
},
|
|
218
218
|
contentType: "application/json",
|
|
219
219
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -252,16 +252,16 @@ class Brands {
|
|
|
252
252
|
* Replace an existing brand with the supplied values.
|
|
253
253
|
*/
|
|
254
254
|
replace(brandId, request, requestOptions) {
|
|
255
|
-
var _a;
|
|
255
|
+
var _a, _b;
|
|
256
256
|
return __awaiter(this, void 0, void 0, function* () {
|
|
257
|
-
const _response = yield core.fetcher({
|
|
258
|
-
url: (0, url_join_1.default)((
|
|
257
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
258
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/brands/${brandId}`),
|
|
259
259
|
method: "PUT",
|
|
260
260
|
headers: {
|
|
261
261
|
Authorization: yield this._getAuthorizationHeader(),
|
|
262
262
|
"X-Fern-Language": "JavaScript",
|
|
263
263
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
264
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
264
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
265
265
|
},
|
|
266
266
|
contentType: "application/json",
|
|
267
267
|
body: request,
|
|
@@ -8,6 +8,7 @@ export declare namespace Bulk {
|
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.CourierEnvironment | string>;
|
|
10
10
|
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
12
13
|
interface RequestOptions {
|
|
13
14
|
timeoutInSeconds?: number;
|
|
@@ -52,16 +52,16 @@ class Bulk {
|
|
|
52
52
|
* @throws {@link Courier.BadRequestError}
|
|
53
53
|
*/
|
|
54
54
|
createJob(request, requestOptions) {
|
|
55
|
-
var _a;
|
|
55
|
+
var _a, _b;
|
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
const _response = yield core.fetcher({
|
|
58
|
-
url: (0, url_join_1.default)((
|
|
57
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
58
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "/bulk"),
|
|
59
59
|
method: "POST",
|
|
60
60
|
headers: {
|
|
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.0.
|
|
64
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
65
65
|
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
66
66
|
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
|
|
67
67
|
? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
|
|
@@ -105,16 +105,16 @@ class Bulk {
|
|
|
105
105
|
* Ingest user data into a Bulk Job
|
|
106
106
|
*/
|
|
107
107
|
ingestUsers(jobId, request, requestOptions) {
|
|
108
|
-
var _a;
|
|
108
|
+
var _a, _b;
|
|
109
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
const _response = yield core.fetcher({
|
|
111
|
-
url: (0, url_join_1.default)((
|
|
110
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
111
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/bulk/${jobId}`),
|
|
112
112
|
method: "POST",
|
|
113
113
|
headers: {
|
|
114
114
|
Authorization: yield this._getAuthorizationHeader(),
|
|
115
115
|
"X-Fern-Language": "JavaScript",
|
|
116
116
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
117
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
117
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
118
118
|
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
119
119
|
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
|
|
120
120
|
? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
|
|
@@ -154,16 +154,16 @@ class Bulk {
|
|
|
154
154
|
* @throws {@link Courier.BadRequestError}
|
|
155
155
|
*/
|
|
156
156
|
runJob(jobId, requestOptions) {
|
|
157
|
-
var _a;
|
|
157
|
+
var _a, _b;
|
|
158
158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
159
|
-
const _response = yield core.fetcher({
|
|
160
|
-
url: (0, url_join_1.default)((
|
|
159
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
160
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/bulk/${jobId}/run`),
|
|
161
161
|
method: "POST",
|
|
162
162
|
headers: {
|
|
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.0.
|
|
166
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
167
167
|
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
168
168
|
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
|
|
169
169
|
? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
|
|
@@ -207,16 +207,16 @@ class Bulk {
|
|
|
207
207
|
* @throws {@link Courier.BadRequestError}
|
|
208
208
|
*/
|
|
209
209
|
getJob(jobId, requestOptions) {
|
|
210
|
-
var _a;
|
|
210
|
+
var _a, _b;
|
|
211
211
|
return __awaiter(this, void 0, void 0, function* () {
|
|
212
|
-
const _response = yield core.fetcher({
|
|
213
|
-
url: (0, url_join_1.default)((
|
|
212
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
213
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/bulk/${jobId}`),
|
|
214
214
|
method: "GET",
|
|
215
215
|
headers: {
|
|
216
216
|
Authorization: yield this._getAuthorizationHeader(),
|
|
217
217
|
"X-Fern-Language": "JavaScript",
|
|
218
218
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
219
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
219
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
220
220
|
},
|
|
221
221
|
contentType: "application/json",
|
|
222
222
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -256,16 +256,16 @@ class Bulk {
|
|
|
256
256
|
* @throws {@link Courier.BadRequestError}
|
|
257
257
|
*/
|
|
258
258
|
getUsers(jobId, requestOptions) {
|
|
259
|
-
var _a;
|
|
259
|
+
var _a, _b;
|
|
260
260
|
return __awaiter(this, void 0, void 0, function* () {
|
|
261
|
-
const _response = yield core.fetcher({
|
|
262
|
-
url: (0, url_join_1.default)((
|
|
261
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
262
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/bulk/${jobId}/users`),
|
|
263
263
|
method: "GET",
|
|
264
264
|
headers: {
|
|
265
265
|
Authorization: yield this._getAuthorizationHeader(),
|
|
266
266
|
"X-Fern-Language": "JavaScript",
|
|
267
267
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
268
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
268
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
269
269
|
},
|
|
270
270
|
contentType: "application/json",
|
|
271
271
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -8,6 +8,7 @@ export declare namespace Lists {
|
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.CourierEnvironment | string>;
|
|
10
10
|
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
12
13
|
interface RequestOptions {
|
|
13
14
|
timeoutInSeconds?: number;
|