@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
|
@@ -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;
|
|
@@ -53,7 +53,7 @@ class Lists {
|
|
|
53
53
|
* @throws {@link Courier.BadRequestError}
|
|
54
54
|
*/
|
|
55
55
|
list(request = {}, requestOptions) {
|
|
56
|
-
var _a;
|
|
56
|
+
var _a, _b;
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
58
|
const { cursor, pattern } = request;
|
|
59
59
|
const _queryParams = {};
|
|
@@ -63,14 +63,14 @@ class Lists {
|
|
|
63
63
|
if (pattern != null) {
|
|
64
64
|
_queryParams["pattern"] = pattern;
|
|
65
65
|
}
|
|
66
|
-
const _response = yield core.fetcher({
|
|
67
|
-
url: (0, url_join_1.default)((
|
|
66
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
67
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "/lists"),
|
|
68
68
|
method: "GET",
|
|
69
69
|
headers: {
|
|
70
70
|
Authorization: yield this._getAuthorizationHeader(),
|
|
71
71
|
"X-Fern-Language": "JavaScript",
|
|
72
72
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
73
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
73
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
74
74
|
},
|
|
75
75
|
contentType: "application/json",
|
|
76
76
|
queryParameters: _queryParams,
|
|
@@ -111,7 +111,7 @@ class Lists {
|
|
|
111
111
|
* @throws {@link Courier.NotFoundError}
|
|
112
112
|
*/
|
|
113
113
|
get(listId, request = {}, requestOptions) {
|
|
114
|
-
var _a;
|
|
114
|
+
var _a, _b;
|
|
115
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
116
116
|
const { cursor, pattern } = request;
|
|
117
117
|
const _queryParams = {};
|
|
@@ -121,14 +121,14 @@ class Lists {
|
|
|
121
121
|
if (pattern != null) {
|
|
122
122
|
_queryParams["pattern"] = pattern;
|
|
123
123
|
}
|
|
124
|
-
const _response = yield core.fetcher({
|
|
125
|
-
url: (0, url_join_1.default)((
|
|
124
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
125
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/lists/${listId}`),
|
|
126
126
|
method: "GET",
|
|
127
127
|
headers: {
|
|
128
128
|
Authorization: yield this._getAuthorizationHeader(),
|
|
129
129
|
"X-Fern-Language": "JavaScript",
|
|
130
130
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
131
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
131
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
132
132
|
},
|
|
133
133
|
contentType: "application/json",
|
|
134
134
|
queryParameters: _queryParams,
|
|
@@ -168,16 +168,16 @@ class Lists {
|
|
|
168
168
|
* Create or replace an existing list with the supplied values.
|
|
169
169
|
*/
|
|
170
170
|
update(listId, request, requestOptions) {
|
|
171
|
-
var _a;
|
|
171
|
+
var _a, _b;
|
|
172
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
-
const _response = yield core.fetcher({
|
|
174
|
-
url: (0, url_join_1.default)((
|
|
173
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
174
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/lists/${listId}`),
|
|
175
175
|
method: "PUT",
|
|
176
176
|
headers: {
|
|
177
177
|
Authorization: yield this._getAuthorizationHeader(),
|
|
178
178
|
"X-Fern-Language": "JavaScript",
|
|
179
179
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
180
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
180
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
181
181
|
},
|
|
182
182
|
contentType: "application/json",
|
|
183
183
|
body: request,
|
|
@@ -212,16 +212,16 @@ class Lists {
|
|
|
212
212
|
* Delete a list by list ID.
|
|
213
213
|
*/
|
|
214
214
|
delete(listId, requestOptions) {
|
|
215
|
-
var _a;
|
|
215
|
+
var _a, _b;
|
|
216
216
|
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
-
const _response = yield core.fetcher({
|
|
218
|
-
url: (0, url_join_1.default)((
|
|
217
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
218
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/lists/${listId}`),
|
|
219
219
|
method: "DELETE",
|
|
220
220
|
headers: {
|
|
221
221
|
Authorization: yield this._getAuthorizationHeader(),
|
|
222
222
|
"X-Fern-Language": "JavaScript",
|
|
223
223
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
224
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
224
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
225
225
|
},
|
|
226
226
|
contentType: "application/json",
|
|
227
227
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -255,16 +255,16 @@ class Lists {
|
|
|
255
255
|
* Restore a previously deleted list.
|
|
256
256
|
*/
|
|
257
257
|
restore(listId, requestOptions) {
|
|
258
|
-
var _a;
|
|
258
|
+
var _a, _b;
|
|
259
259
|
return __awaiter(this, void 0, void 0, function* () {
|
|
260
|
-
const _response = yield core.fetcher({
|
|
261
|
-
url: (0, url_join_1.default)((
|
|
260
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
261
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/lists/${listId}/restore`),
|
|
262
262
|
method: "PUT",
|
|
263
263
|
headers: {
|
|
264
264
|
Authorization: yield this._getAuthorizationHeader(),
|
|
265
265
|
"X-Fern-Language": "JavaScript",
|
|
266
266
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
267
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
267
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
268
268
|
},
|
|
269
269
|
contentType: "application/json",
|
|
270
270
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -299,21 +299,21 @@ class Lists {
|
|
|
299
299
|
* @throws {@link Courier.NotFoundError}
|
|
300
300
|
*/
|
|
301
301
|
getSubscribers(listId, request = {}, requestOptions) {
|
|
302
|
-
var _a;
|
|
302
|
+
var _a, _b;
|
|
303
303
|
return __awaiter(this, void 0, void 0, function* () {
|
|
304
304
|
const { cursor } = request;
|
|
305
305
|
const _queryParams = {};
|
|
306
306
|
if (cursor != null) {
|
|
307
307
|
_queryParams["cursor"] = cursor;
|
|
308
308
|
}
|
|
309
|
-
const _response = yield core.fetcher({
|
|
310
|
-
url: (0, url_join_1.default)((
|
|
309
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
310
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/lists/${listId}/subscriptions`),
|
|
311
311
|
method: "GET",
|
|
312
312
|
headers: {
|
|
313
313
|
Authorization: yield this._getAuthorizationHeader(),
|
|
314
314
|
"X-Fern-Language": "JavaScript",
|
|
315
315
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
316
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
316
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
317
317
|
},
|
|
318
318
|
contentType: "application/json",
|
|
319
319
|
queryParameters: _queryParams,
|
|
@@ -354,16 +354,16 @@ class Lists {
|
|
|
354
354
|
* @throws {@link Courier.BadRequestError}
|
|
355
355
|
*/
|
|
356
356
|
updateSubscribers(listId, request, requestOptions) {
|
|
357
|
-
var _a;
|
|
357
|
+
var _a, _b;
|
|
358
358
|
return __awaiter(this, void 0, void 0, function* () {
|
|
359
|
-
const _response = yield core.fetcher({
|
|
360
|
-
url: (0, url_join_1.default)((
|
|
359
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
360
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/lists/${listId}/subscriptions`),
|
|
361
361
|
method: "PUT",
|
|
362
362
|
headers: {
|
|
363
363
|
Authorization: yield this._getAuthorizationHeader(),
|
|
364
364
|
"X-Fern-Language": "JavaScript",
|
|
365
365
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
366
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
366
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
367
367
|
},
|
|
368
368
|
contentType: "application/json",
|
|
369
369
|
body: request,
|
|
@@ -404,16 +404,16 @@ class Lists {
|
|
|
404
404
|
* @throws {@link Courier.BadRequestError}
|
|
405
405
|
*/
|
|
406
406
|
addSubscribers(listId, request, requestOptions) {
|
|
407
|
-
var _a;
|
|
407
|
+
var _a, _b;
|
|
408
408
|
return __awaiter(this, void 0, void 0, function* () {
|
|
409
|
-
const _response = yield core.fetcher({
|
|
410
|
-
url: (0, url_join_1.default)((
|
|
409
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
410
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/lists/${listId}/subscriptions`),
|
|
411
411
|
method: "POST",
|
|
412
412
|
headers: {
|
|
413
413
|
Authorization: yield this._getAuthorizationHeader(),
|
|
414
414
|
"X-Fern-Language": "JavaScript",
|
|
415
415
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
416
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
416
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
417
417
|
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
418
418
|
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
|
|
419
419
|
? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
|
|
@@ -457,16 +457,16 @@ class Lists {
|
|
|
457
457
|
* Subscribe a user to an existing list (note: if the List does not exist, it will be automatically created).
|
|
458
458
|
*/
|
|
459
459
|
subscribe(listId, userId, request = {}, requestOptions) {
|
|
460
|
-
var _a;
|
|
460
|
+
var _a, _b;
|
|
461
461
|
return __awaiter(this, void 0, void 0, function* () {
|
|
462
|
-
const _response = yield core.fetcher({
|
|
463
|
-
url: (0, url_join_1.default)((
|
|
462
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
463
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/lists/${listId}/subscriptions/${userId}`),
|
|
464
464
|
method: "PUT",
|
|
465
465
|
headers: {
|
|
466
466
|
Authorization: yield this._getAuthorizationHeader(),
|
|
467
467
|
"X-Fern-Language": "JavaScript",
|
|
468
468
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
469
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
469
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
470
470
|
},
|
|
471
471
|
contentType: "application/json",
|
|
472
472
|
body: request,
|
|
@@ -502,16 +502,16 @@ class Lists {
|
|
|
502
502
|
* @throws {@link Courier.NotFoundError}
|
|
503
503
|
*/
|
|
504
504
|
unsubscribe(listId, userId, requestOptions) {
|
|
505
|
-
var _a;
|
|
505
|
+
var _a, _b;
|
|
506
506
|
return __awaiter(this, void 0, void 0, function* () {
|
|
507
|
-
const _response = yield core.fetcher({
|
|
508
|
-
url: (0, url_join_1.default)((
|
|
507
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
508
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/lists/${listId}/subscriptions/${userId}`),
|
|
509
509
|
method: "DELETE",
|
|
510
510
|
headers: {
|
|
511
511
|
Authorization: yield this._getAuthorizationHeader(),
|
|
512
512
|
"X-Fern-Language": "JavaScript",
|
|
513
513
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
514
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
514
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
515
515
|
},
|
|
516
516
|
contentType: "application/json",
|
|
517
517
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -8,6 +8,7 @@ export declare namespace Messages {
|
|
|
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,7 +52,7 @@ class Messages {
|
|
|
52
52
|
* Fetch the statuses of messages you've previously sent.
|
|
53
53
|
*/
|
|
54
54
|
list(request = {}, requestOptions) {
|
|
55
|
-
var _a;
|
|
55
|
+
var _a, _b;
|
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
57
|
const { archived, cursor, event, list, messageId, notification, recipient, status, tags, enqueued_after: enqueuedAfter, traceId, } = request;
|
|
58
58
|
const _queryParams = {};
|
|
@@ -89,14 +89,14 @@ class Messages {
|
|
|
89
89
|
if (traceId != null) {
|
|
90
90
|
_queryParams["traceId"] = traceId;
|
|
91
91
|
}
|
|
92
|
-
const _response = yield core.fetcher({
|
|
93
|
-
url: (0, url_join_1.default)((
|
|
92
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
93
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "messages"),
|
|
94
94
|
method: "GET",
|
|
95
95
|
headers: {
|
|
96
96
|
Authorization: yield this._getAuthorizationHeader(),
|
|
97
97
|
"X-Fern-Language": "JavaScript",
|
|
98
98
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
99
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
99
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
100
100
|
},
|
|
101
101
|
contentType: "application/json",
|
|
102
102
|
queryParameters: _queryParams,
|
|
@@ -133,16 +133,16 @@ class Messages {
|
|
|
133
133
|
* @throws {@link Courier.MessageNotFoundError}
|
|
134
134
|
*/
|
|
135
135
|
get(messageId, requestOptions) {
|
|
136
|
-
var _a;
|
|
136
|
+
var _a, _b;
|
|
137
137
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
-
const _response = yield core.fetcher({
|
|
139
|
-
url: (0, url_join_1.default)((
|
|
138
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
139
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `messages/${messageId}`),
|
|
140
140
|
method: "GET",
|
|
141
141
|
headers: {
|
|
142
142
|
Authorization: yield this._getAuthorizationHeader(),
|
|
143
143
|
"X-Fern-Language": "JavaScript",
|
|
144
144
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
145
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
145
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
146
146
|
},
|
|
147
147
|
contentType: "application/json",
|
|
148
148
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -183,16 +183,16 @@ class Messages {
|
|
|
183
183
|
* Cancel a message that is currently in the process of being delivered. A well-formatted API call to the cancel message API will return either `200` status code for a successful cancellation or `409` status code for an unsuccessful cancellation. Both cases will include the actual message record in the response body (see details below).
|
|
184
184
|
*/
|
|
185
185
|
cancel(messageId, requestOptions) {
|
|
186
|
-
var _a;
|
|
186
|
+
var _a, _b;
|
|
187
187
|
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
-
const _response = yield core.fetcher({
|
|
189
|
-
url: (0, url_join_1.default)((
|
|
188
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
189
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `messages/${messageId}/cancel`),
|
|
190
190
|
method: "POST",
|
|
191
191
|
headers: {
|
|
192
192
|
Authorization: yield this._getAuthorizationHeader(),
|
|
193
193
|
"X-Fern-Language": "JavaScript",
|
|
194
194
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
195
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
195
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
196
196
|
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
197
197
|
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
|
|
198
198
|
? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
|
|
@@ -232,21 +232,21 @@ class Messages {
|
|
|
232
232
|
* @throws {@link Courier.MessageNotFoundError}
|
|
233
233
|
*/
|
|
234
234
|
getHistory(messageId, request = {}, requestOptions) {
|
|
235
|
-
var _a;
|
|
235
|
+
var _a, _b;
|
|
236
236
|
return __awaiter(this, void 0, void 0, function* () {
|
|
237
237
|
const { type: type_ } = request;
|
|
238
238
|
const _queryParams = {};
|
|
239
239
|
if (type_ != null) {
|
|
240
240
|
_queryParams["type"] = type_;
|
|
241
241
|
}
|
|
242
|
-
const _response = yield core.fetcher({
|
|
243
|
-
url: (0, url_join_1.default)((
|
|
242
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
243
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `messages/${messageId}/history`),
|
|
244
244
|
method: "GET",
|
|
245
245
|
headers: {
|
|
246
246
|
Authorization: yield this._getAuthorizationHeader(),
|
|
247
247
|
"X-Fern-Language": "JavaScript",
|
|
248
248
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
249
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
249
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
250
250
|
},
|
|
251
251
|
contentType: "application/json",
|
|
252
252
|
queryParameters: _queryParams,
|
|
@@ -289,16 +289,16 @@ class Messages {
|
|
|
289
289
|
* @throws {@link Courier.MessageNotFoundError}
|
|
290
290
|
*/
|
|
291
291
|
getContent(messageId, requestOptions) {
|
|
292
|
-
var _a;
|
|
292
|
+
var _a, _b;
|
|
293
293
|
return __awaiter(this, void 0, void 0, function* () {
|
|
294
|
-
const _response = yield core.fetcher({
|
|
295
|
-
url: (0, url_join_1.default)((
|
|
294
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
295
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `messages/${messageId}/output`),
|
|
296
296
|
method: "GET",
|
|
297
297
|
headers: {
|
|
298
298
|
Authorization: yield this._getAuthorizationHeader(),
|
|
299
299
|
"X-Fern-Language": "JavaScript",
|
|
300
300
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
301
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
301
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
302
302
|
},
|
|
303
303
|
contentType: "application/json",
|
|
304
304
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -336,16 +336,16 @@ class Messages {
|
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
archive(requestId, requestOptions) {
|
|
339
|
-
var _a;
|
|
339
|
+
var _a, _b;
|
|
340
340
|
return __awaiter(this, void 0, void 0, function* () {
|
|
341
|
-
const _response = yield core.fetcher({
|
|
342
|
-
url: (0, url_join_1.default)((
|
|
341
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
342
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `requests/${requestId}/archive`),
|
|
343
343
|
method: "PUT",
|
|
344
344
|
headers: {
|
|
345
345
|
Authorization: yield this._getAuthorizationHeader(),
|
|
346
346
|
"X-Fern-Language": "JavaScript",
|
|
347
347
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
348
|
-
"X-Fern-SDK-Version": "v6.0.
|
|
348
|
+
"X-Fern-SDK-Version": "v6.0.8",
|
|
349
349
|
},
|
|
350
350
|
contentType: "application/json",
|
|
351
351
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -8,6 +8,7 @@ export declare namespace Notifications {
|
|
|
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;
|