@trycourier/courier 6.0.7 → 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.
Files changed (71) hide show
  1. package/Client.d.ts +1 -0
  2. package/Client.js +4 -4
  3. package/api/resources/audiences/client/Client.d.ts +1 -0
  4. package/api/resources/audiences/client/Client.js +20 -20
  5. package/api/resources/auditEvents/client/Client.d.ts +1 -0
  6. package/api/resources/auditEvents/client/Client.js +8 -8
  7. package/api/resources/authTokens/client/Client.d.ts +1 -0
  8. package/api/resources/authTokens/client/Client.js +4 -4
  9. package/api/resources/automations/client/Client.d.ts +1 -0
  10. package/api/resources/automations/client/Client.js +8 -8
  11. package/api/resources/brands/client/Client.d.ts +1 -0
  12. package/api/resources/brands/client/Client.js +20 -20
  13. package/api/resources/bulk/client/Client.d.ts +1 -0
  14. package/api/resources/bulk/client/Client.js +20 -20
  15. package/api/resources/lists/client/Client.d.ts +1 -0
  16. package/api/resources/lists/client/Client.js +40 -40
  17. package/api/resources/messages/client/Client.d.ts +1 -0
  18. package/api/resources/messages/client/Client.js +24 -24
  19. package/api/resources/notifications/client/Client.d.ts +1 -0
  20. package/api/resources/notifications/client/Client.js +32 -32
  21. package/api/resources/profiles/client/Client.d.ts +1 -0
  22. package/api/resources/profiles/client/Client.js +28 -28
  23. package/api/resources/templates/client/Client.d.ts +1 -0
  24. package/api/resources/templates/client/Client.js +4 -4
  25. package/api/resources/tenants/client/Client.d.ts +1 -0
  26. package/api/resources/tenants/client/Client.js +20 -20
  27. package/api/resources/translations/client/Client.d.ts +1 -0
  28. package/api/resources/translations/client/Client.js +8 -8
  29. package/api/resources/users/client/Client.d.ts +1 -0
  30. package/api/resources/users/resources/preferences/client/Client.d.ts +1 -0
  31. package/api/resources/users/resources/preferences/client/Client.js +12 -12
  32. package/api/resources/users/resources/tenants/client/Client.d.ts +5 -0
  33. package/api/resources/users/resources/tenants/client/Client.js +59 -16
  34. package/api/resources/users/resources/tokens/client/Client.d.ts +1 -0
  35. package/api/resources/users/resources/tokens/client/Client.js +20 -20
  36. package/dist/Client.d.ts +1 -0
  37. package/dist/Client.js +4 -4
  38. package/dist/api/resources/audiences/client/Client.d.ts +1 -0
  39. package/dist/api/resources/audiences/client/Client.js +20 -20
  40. package/dist/api/resources/auditEvents/client/Client.d.ts +1 -0
  41. package/dist/api/resources/auditEvents/client/Client.js +8 -8
  42. package/dist/api/resources/authTokens/client/Client.d.ts +1 -0
  43. package/dist/api/resources/authTokens/client/Client.js +4 -4
  44. package/dist/api/resources/automations/client/Client.d.ts +1 -0
  45. package/dist/api/resources/automations/client/Client.js +8 -8
  46. package/dist/api/resources/brands/client/Client.d.ts +1 -0
  47. package/dist/api/resources/brands/client/Client.js +20 -20
  48. package/dist/api/resources/bulk/client/Client.d.ts +1 -0
  49. package/dist/api/resources/bulk/client/Client.js +20 -20
  50. package/dist/api/resources/lists/client/Client.d.ts +1 -0
  51. package/dist/api/resources/lists/client/Client.js +40 -40
  52. package/dist/api/resources/messages/client/Client.d.ts +1 -0
  53. package/dist/api/resources/messages/client/Client.js +24 -24
  54. package/dist/api/resources/notifications/client/Client.d.ts +1 -0
  55. package/dist/api/resources/notifications/client/Client.js +32 -32
  56. package/dist/api/resources/profiles/client/Client.d.ts +1 -0
  57. package/dist/api/resources/profiles/client/Client.js +28 -28
  58. package/dist/api/resources/templates/client/Client.d.ts +1 -0
  59. package/dist/api/resources/templates/client/Client.js +4 -4
  60. package/dist/api/resources/tenants/client/Client.d.ts +1 -0
  61. package/dist/api/resources/tenants/client/Client.js +20 -20
  62. package/dist/api/resources/translations/client/Client.d.ts +1 -0
  63. package/dist/api/resources/translations/client/Client.js +8 -8
  64. package/dist/api/resources/users/client/Client.d.ts +1 -0
  65. package/dist/api/resources/users/resources/preferences/client/Client.d.ts +1 -0
  66. package/dist/api/resources/users/resources/preferences/client/Client.js +12 -12
  67. package/dist/api/resources/users/resources/tenants/client/Client.d.ts +5 -0
  68. package/dist/api/resources/users/resources/tenants/client/Client.js +59 -16
  69. package/dist/api/resources/users/resources/tokens/client/Client.d.ts +1 -0
  70. package/dist/api/resources/users/resources/tokens/client/Client.js +20 -20
  71. package/package.json +1 -1
@@ -48,21 +48,21 @@ class Notifications {
48
48
  this._options = _options;
49
49
  }
50
50
  list(request = {}, requestOptions) {
51
- var _a;
51
+ var _a, _b;
52
52
  return __awaiter(this, void 0, void 0, function* () {
53
53
  const { cursor } = request;
54
54
  const _queryParams = {};
55
55
  if (cursor != null) {
56
56
  _queryParams["cursor"] = cursor;
57
57
  }
58
- const _response = yield core.fetcher({
59
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, "/notifications"),
58
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
59
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "/notifications"),
60
60
  method: "GET",
61
61
  headers: {
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.0.7",
65
+ "X-Fern-SDK-Version": "v6.0.8",
66
66
  },
67
67
  contentType: "application/json",
68
68
  queryParameters: _queryParams,
@@ -94,16 +94,16 @@ class Notifications {
94
94
  });
95
95
  }
96
96
  getContent(id, requestOptions) {
97
- var _a;
97
+ var _a, _b;
98
98
  return __awaiter(this, void 0, void 0, function* () {
99
- const _response = yield core.fetcher({
100
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/notifications/${id}/content`),
99
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
100
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/notifications/${id}/content`),
101
101
  method: "GET",
102
102
  headers: {
103
103
  Authorization: yield this._getAuthorizationHeader(),
104
104
  "X-Fern-Language": "JavaScript",
105
105
  "X-Fern-SDK-Name": "@trycourier/courier",
106
- "X-Fern-SDK-Version": "v6.0.7",
106
+ "X-Fern-SDK-Version": "v6.0.8",
107
107
  },
108
108
  contentType: "application/json",
109
109
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -134,16 +134,16 @@ class Notifications {
134
134
  });
135
135
  }
136
136
  getDraftContent(id, requestOptions) {
137
- var _a;
137
+ var _a, _b;
138
138
  return __awaiter(this, void 0, void 0, function* () {
139
- const _response = yield core.fetcher({
140
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/notifications/${id}/draft/content`),
139
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
140
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/notifications/${id}/draft/content`),
141
141
  method: "GET",
142
142
  headers: {
143
143
  Authorization: yield this._getAuthorizationHeader(),
144
144
  "X-Fern-Language": "JavaScript",
145
145
  "X-Fern-SDK-Name": "@trycourier/courier",
146
- "X-Fern-SDK-Version": "v6.0.7",
146
+ "X-Fern-SDK-Version": "v6.0.8",
147
147
  },
148
148
  contentType: "application/json",
149
149
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -174,16 +174,16 @@ class Notifications {
174
174
  });
175
175
  }
176
176
  updateVariations(id, request = {}, requestOptions) {
177
- var _a;
177
+ var _a, _b;
178
178
  return __awaiter(this, void 0, void 0, function* () {
179
- const _response = yield core.fetcher({
180
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/notifications/${id}/variations`),
179
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
180
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/notifications/${id}/variations`),
181
181
  method: "POST",
182
182
  headers: {
183
183
  Authorization: yield this._getAuthorizationHeader(),
184
184
  "X-Fern-Language": "JavaScript",
185
185
  "X-Fern-SDK-Name": "@trycourier/courier",
186
- "X-Fern-SDK-Version": "v6.0.7",
186
+ "X-Fern-SDK-Version": "v6.0.8",
187
187
  },
188
188
  contentType: "application/json",
189
189
  body: request,
@@ -215,16 +215,16 @@ class Notifications {
215
215
  });
216
216
  }
217
217
  updateDraftVariations(id, request = {}, requestOptions) {
218
- var _a;
218
+ var _a, _b;
219
219
  return __awaiter(this, void 0, void 0, function* () {
220
- const _response = yield core.fetcher({
221
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/notifications/${id}/draft/variations`),
220
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
221
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/notifications/${id}/draft/variations`),
222
222
  method: "POST",
223
223
  headers: {
224
224
  Authorization: yield this._getAuthorizationHeader(),
225
225
  "X-Fern-Language": "JavaScript",
226
226
  "X-Fern-SDK-Name": "@trycourier/courier",
227
- "X-Fern-SDK-Version": "v6.0.7",
227
+ "X-Fern-SDK-Version": "v6.0.8",
228
228
  },
229
229
  contentType: "application/json",
230
230
  body: request,
@@ -256,16 +256,16 @@ class Notifications {
256
256
  });
257
257
  }
258
258
  getSubmissionChecks(id, submissionId, 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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/notifications/${id}/${submissionId}/checks`),
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, `/notifications/${id}/${submissionId}/checks`),
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.7",
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,
@@ -296,16 +296,16 @@ class Notifications {
296
296
  });
297
297
  }
298
298
  replaceSubmissionChecks(id, submissionId, request, requestOptions) {
299
- var _a;
299
+ var _a, _b;
300
300
  return __awaiter(this, void 0, void 0, function* () {
301
- const _response = yield core.fetcher({
302
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/notifications/${id}/${submissionId}/checks`),
301
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
302
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/notifications/${id}/${submissionId}/checks`),
303
303
  method: "PUT",
304
304
  headers: {
305
305
  Authorization: yield this._getAuthorizationHeader(),
306
306
  "X-Fern-Language": "JavaScript",
307
307
  "X-Fern-SDK-Name": "@trycourier/courier",
308
- "X-Fern-SDK-Version": "v6.0.7",
308
+ "X-Fern-SDK-Version": "v6.0.8",
309
309
  },
310
310
  contentType: "application/json",
311
311
  body: request,
@@ -337,16 +337,16 @@ class Notifications {
337
337
  });
338
338
  }
339
339
  cancelSubmission(id, submissionId, requestOptions) {
340
- var _a;
340
+ var _a, _b;
341
341
  return __awaiter(this, void 0, void 0, function* () {
342
- const _response = yield core.fetcher({
343
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/notifications/${id}/${submissionId}/checks`),
342
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
343
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/notifications/${id}/${submissionId}/checks`),
344
344
  method: "DELETE",
345
345
  headers: {
346
346
  Authorization: yield this._getAuthorizationHeader(),
347
347
  "X-Fern-Language": "JavaScript",
348
348
  "X-Fern-SDK-Name": "@trycourier/courier",
349
- "X-Fern-SDK-Version": "v6.0.7",
349
+ "X-Fern-SDK-Version": "v6.0.8",
350
350
  },
351
351
  contentType: "application/json",
352
352
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -8,6 +8,7 @@ export declare namespace Profiles {
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,16 +53,16 @@ class Profiles {
53
53
  * @throws {@link Courier.BadRequestError}
54
54
  */
55
55
  get(userId, requestOptions) {
56
- var _a;
56
+ var _a, _b;
57
57
  return __awaiter(this, void 0, void 0, function* () {
58
- const _response = yield core.fetcher({
59
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/profiles/${userId}`),
58
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
59
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/profiles/${userId}`),
60
60
  method: "GET",
61
61
  headers: {
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.0.7",
65
+ "X-Fern-SDK-Version": "v6.0.8",
66
66
  },
67
67
  contentType: "application/json",
68
68
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -102,16 +102,16 @@ class Profiles {
102
102
  * @throws {@link Courier.BadRequestError}
103
103
  */
104
104
  create(userId, request, requestOptions) {
105
- var _a;
105
+ var _a, _b;
106
106
  return __awaiter(this, void 0, void 0, function* () {
107
- const _response = yield core.fetcher({
108
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/profiles/${userId}`),
107
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
108
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/profiles/${userId}`),
109
109
  method: "POST",
110
110
  headers: {
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.0.7",
114
+ "X-Fern-SDK-Version": "v6.0.8",
115
115
  "Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
116
116
  "X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
117
117
  ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
@@ -159,16 +159,16 @@ class Profiles {
159
159
  * @throws {@link Courier.BadRequestError}
160
160
  */
161
161
  replace(userId, request, requestOptions) {
162
- var _a;
162
+ var _a, _b;
163
163
  return __awaiter(this, void 0, void 0, function* () {
164
- const _response = yield core.fetcher({
165
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/profiles/${userId}`),
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, `/profiles/${userId}`),
166
166
  method: "PUT",
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.7",
171
+ "X-Fern-SDK-Version": "v6.0.8",
172
172
  },
173
173
  contentType: "application/json",
174
174
  body: request,
@@ -209,16 +209,16 @@ class Profiles {
209
209
  * @throws {@link Courier.BadRequestError}
210
210
  */
211
211
  delete(userId, requestOptions) {
212
- var _a;
212
+ var _a, _b;
213
213
  return __awaiter(this, void 0, void 0, function* () {
214
- const _response = yield core.fetcher({
215
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/profiles/${userId}`),
214
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
215
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/profiles/${userId}`),
216
216
  method: "DELETE",
217
217
  headers: {
218
218
  Authorization: yield this._getAuthorizationHeader(),
219
219
  "X-Fern-Language": "JavaScript",
220
220
  "X-Fern-SDK-Name": "@trycourier/courier",
221
- "X-Fern-SDK-Version": "v6.0.7",
221
+ "X-Fern-SDK-Version": "v6.0.8",
222
222
  },
223
223
  contentType: "application/json",
224
224
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -258,21 +258,21 @@ class Profiles {
258
258
  * @throws {@link Courier.BadRequestError}
259
259
  */
260
260
  getListSubscriptions(userId, request = {}, requestOptions) {
261
- var _a;
261
+ var _a, _b;
262
262
  return __awaiter(this, void 0, void 0, function* () {
263
263
  const { cursor } = request;
264
264
  const _queryParams = {};
265
265
  if (cursor != null) {
266
266
  _queryParams["cursor"] = cursor;
267
267
  }
268
- const _response = yield core.fetcher({
269
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/profiles/${userId}/lists`),
268
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
269
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/profiles/${userId}/lists`),
270
270
  method: "GET",
271
271
  headers: {
272
272
  Authorization: yield this._getAuthorizationHeader(),
273
273
  "X-Fern-Language": "JavaScript",
274
274
  "X-Fern-SDK-Name": "@trycourier/courier",
275
- "X-Fern-SDK-Version": "v6.0.7",
275
+ "X-Fern-SDK-Version": "v6.0.8",
276
276
  },
277
277
  contentType: "application/json",
278
278
  queryParameters: _queryParams,
@@ -313,16 +313,16 @@ class Profiles {
313
313
  * @throws {@link Courier.BadRequestError}
314
314
  */
315
315
  subscribeToLists(userId, request, requestOptions) {
316
- var _a;
316
+ var _a, _b;
317
317
  return __awaiter(this, void 0, void 0, function* () {
318
- const _response = yield core.fetcher({
319
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/profiles/${userId}/lists`),
318
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
319
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/profiles/${userId}/lists`),
320
320
  method: "POST",
321
321
  headers: {
322
322
  Authorization: yield this._getAuthorizationHeader(),
323
323
  "X-Fern-Language": "JavaScript",
324
324
  "X-Fern-SDK-Name": "@trycourier/courier",
325
- "X-Fern-SDK-Version": "v6.0.7",
325
+ "X-Fern-SDK-Version": "v6.0.8",
326
326
  "Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
327
327
  "X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
328
328
  ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
@@ -367,16 +367,16 @@ class Profiles {
367
367
  * @throws {@link Courier.BadRequestError}
368
368
  */
369
369
  deleteListSubscription(userId, requestOptions) {
370
- var _a;
370
+ var _a, _b;
371
371
  return __awaiter(this, void 0, void 0, function* () {
372
- const _response = yield core.fetcher({
373
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/profiles/${userId}/lists`),
372
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
373
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/profiles/${userId}/lists`),
374
374
  method: "DELETE",
375
375
  headers: {
376
376
  Authorization: yield this._getAuthorizationHeader(),
377
377
  "X-Fern-Language": "JavaScript",
378
378
  "X-Fern-SDK-Name": "@trycourier/courier",
379
- "X-Fern-SDK-Version": "v6.0.7",
379
+ "X-Fern-SDK-Version": "v6.0.8",
380
380
  },
381
381
  contentType: "application/json",
382
382
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -8,6 +8,7 @@ export declare namespace Templates {
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 Templates {
51
51
  * Returns a list of notification templates
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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, "/notifications"),
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, "/notifications"),
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.7",
68
+ "X-Fern-SDK-Version": "v6.0.8",
69
69
  },
70
70
  contentType: "application/json",
71
71
  queryParameters: _queryParams,
@@ -8,6 +8,7 @@ export declare namespace Tenants {
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 Tenants {
52
52
  * @throws {@link Courier.BadRequestError}
53
53
  */
54
54
  createOrReplace(tenantId, 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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/tenants/${tenantId}`),
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, `/tenants/${tenantId}`),
59
59
  method: "PUT",
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.7",
64
+ "X-Fern-SDK-Version": "v6.0.8",
65
65
  },
66
66
  contentType: "application/json",
67
67
  body: request,
@@ -101,16 +101,16 @@ class Tenants {
101
101
  * @throws {@link Courier.BadRequestError}
102
102
  */
103
103
  get(tenantId, requestOptions) {
104
- var _a;
104
+ var _a, _b;
105
105
  return __awaiter(this, void 0, void 0, function* () {
106
- const _response = yield core.fetcher({
107
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/tenants/${tenantId}`),
106
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
107
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/tenants/${tenantId}`),
108
108
  method: "GET",
109
109
  headers: {
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.0.7",
113
+ "X-Fern-SDK-Version": "v6.0.8",
114
114
  },
115
115
  contentType: "application/json",
116
116
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -146,16 +146,16 @@ class Tenants {
146
146
  });
147
147
  }
148
148
  list(requestOptions) {
149
- var _a;
149
+ var _a, _b;
150
150
  return __awaiter(this, void 0, void 0, function* () {
151
- const _response = yield core.fetcher({
152
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, "/tenants"),
151
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
152
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "/tenants"),
153
153
  method: "GET",
154
154
  headers: {
155
155
  Authorization: yield this._getAuthorizationHeader(),
156
156
  "X-Fern-Language": "JavaScript",
157
157
  "X-Fern-SDK-Name": "@trycourier/courier",
158
- "X-Fern-SDK-Version": "v6.0.7",
158
+ "X-Fern-SDK-Version": "v6.0.8",
159
159
  },
160
160
  contentType: "application/json",
161
161
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -186,16 +186,16 @@ class Tenants {
186
186
  });
187
187
  }
188
188
  delete(tenantId, requestOptions) {
189
- var _a;
189
+ var _a, _b;
190
190
  return __awaiter(this, void 0, void 0, function* () {
191
- const _response = yield core.fetcher({
192
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/tenants/${tenantId}`),
191
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
192
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/tenants/${tenantId}`),
193
193
  method: "DELETE",
194
194
  headers: {
195
195
  Authorization: yield this._getAuthorizationHeader(),
196
196
  "X-Fern-Language": "JavaScript",
197
197
  "X-Fern-SDK-Name": "@trycourier/courier",
198
- "X-Fern-SDK-Version": "v6.0.7",
198
+ "X-Fern-SDK-Version": "v6.0.8",
199
199
  },
200
200
  contentType: "application/json",
201
201
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -229,16 +229,16 @@ class Tenants {
229
229
  * @throws {@link Courier.BadRequestError}
230
230
  */
231
231
  getUsersByTenant(tenantId, requestOptions) {
232
- var _a;
232
+ var _a, _b;
233
233
  return __awaiter(this, void 0, void 0, function* () {
234
- const _response = yield core.fetcher({
235
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/tenants/${tenantId}/users`),
234
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
235
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/tenants/${tenantId}/users`),
236
236
  method: "GET",
237
237
  headers: {
238
238
  Authorization: yield this._getAuthorizationHeader(),
239
239
  "X-Fern-Language": "JavaScript",
240
240
  "X-Fern-SDK-Name": "@trycourier/courier",
241
- "X-Fern-SDK-Version": "v6.0.7",
241
+ "X-Fern-SDK-Version": "v6.0.8",
242
242
  },
243
243
  contentType: "application/json",
244
244
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -7,6 +7,7 @@ export declare namespace Translations {
7
7
  interface Options {
8
8
  environment?: core.Supplier<environments.CourierEnvironment | string>;
9
9
  authorizationToken?: core.Supplier<core.BearerToken | undefined>;
10
+ fetcher?: core.FetchFunction;
10
11
  }
11
12
  interface RequestOptions {
12
13
  timeoutInSeconds?: number;
@@ -53,16 +53,16 @@ class Translations {
53
53
  * @throws {@link Courier.NotFoundError}
54
54
  */
55
55
  get(domain, locale, requestOptions) {
56
- var _a;
56
+ var _a, _b;
57
57
  return __awaiter(this, void 0, void 0, function* () {
58
- const _response = yield core.fetcher({
59
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/translations/${domain}/${locale}`),
58
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
59
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/translations/${domain}/${locale}`),
60
60
  method: "GET",
61
61
  headers: {
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.0.7",
65
+ "X-Fern-SDK-Version": "v6.0.8",
66
66
  },
67
67
  contentType: "application/json",
68
68
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -102,16 +102,16 @@ class Translations {
102
102
  * @throws {@link Courier.NotFoundError}
103
103
  */
104
104
  update(domain, locale, request, requestOptions) {
105
- var _a;
105
+ var _a, _b;
106
106
  return __awaiter(this, void 0, void 0, function* () {
107
- const _response = yield core.fetcher({
108
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/translations/${domain}/${locale}`),
107
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
108
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/translations/${domain}/${locale}`),
109
109
  method: "PUT",
110
110
  headers: {
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.0.7",
114
+ "X-Fern-SDK-Version": "v6.0.8",
115
115
  },
116
116
  contentType: "application/json",
117
117
  body: request,
@@ -10,6 +10,7 @@ export declare namespace Users {
10
10
  interface Options {
11
11
  environment?: core.Supplier<environments.CourierEnvironment | string>;
12
12
  authorizationToken?: core.Supplier<core.BearerToken | undefined>;
13
+ fetcher?: core.FetchFunction;
13
14
  }
14
15
  interface RequestOptions {
15
16
  timeoutInSeconds?: number;
@@ -8,6 +8,7 @@ export declare namespace Preferences {
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,16 +53,16 @@ class Preferences {
53
53
  * @throws {@link Courier.BadRequestError}
54
54
  */
55
55
  list(userId, requestOptions) {
56
- var _a;
56
+ var _a, _b;
57
57
  return __awaiter(this, void 0, void 0, function* () {
58
- const _response = yield core.fetcher({
59
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/users/${userId}/preferences`),
58
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
59
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${userId}/preferences`),
60
60
  method: "GET",
61
61
  headers: {
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.0.7",
65
+ "X-Fern-SDK-Version": "v6.0.8",
66
66
  },
67
67
  contentType: "application/json",
68
68
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -102,16 +102,16 @@ class Preferences {
102
102
  * @throws {@link Courier.NotFoundError}
103
103
  */
104
104
  get(userId, topicId, requestOptions) {
105
- var _a;
105
+ var _a, _b;
106
106
  return __awaiter(this, void 0, void 0, function* () {
107
- const _response = yield core.fetcher({
108
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/users/${userId}/preferences/${topicId}`),
107
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
108
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${userId}/preferences/${topicId}`),
109
109
  method: "GET",
110
110
  headers: {
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.0.7",
114
+ "X-Fern-SDK-Version": "v6.0.8",
115
115
  },
116
116
  contentType: "application/json",
117
117
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -151,16 +151,16 @@ class Preferences {
151
151
  * @throws {@link Courier.BadRequestError}
152
152
  */
153
153
  update(userId, topicId, request, requestOptions) {
154
- var _a;
154
+ var _a, _b;
155
155
  return __awaiter(this, void 0, void 0, function* () {
156
- const _response = yield core.fetcher({
157
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/users/${userId}/preferences/${topicId}`),
156
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
157
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${userId}/preferences/${topicId}`),
158
158
  method: "PUT",
159
159
  headers: {
160
160
  Authorization: yield this._getAuthorizationHeader(),
161
161
  "X-Fern-Language": "JavaScript",
162
162
  "X-Fern-SDK-Name": "@trycourier/courier",
163
- "X-Fern-SDK-Version": "v6.0.7",
163
+ "X-Fern-SDK-Version": "v6.0.8",
164
164
  },
165
165
  contentType: "application/json",
166
166
  body: request,