@trycourier/courier 6.0.7 → 6.1.0

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 (117) 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 +2 -1
  16. package/api/resources/lists/client/Client.js +41 -50
  17. package/api/resources/lists/client/requests/index.d.ts +0 -1
  18. package/api/resources/lists/types/index.d.ts +0 -5
  19. package/api/resources/lists/types/index.js +0 -5
  20. package/api/resources/messages/client/Client.d.ts +1 -0
  21. package/api/resources/messages/client/Client.js +24 -24
  22. package/api/resources/notifications/client/Client.d.ts +1 -0
  23. package/api/resources/notifications/client/Client.js +32 -32
  24. package/api/resources/profiles/client/Client.d.ts +1 -0
  25. package/api/resources/profiles/client/Client.js +28 -28
  26. package/api/resources/templates/client/Client.d.ts +1 -0
  27. package/api/resources/templates/client/Client.js +4 -4
  28. package/api/resources/tenants/client/Client.d.ts +3 -2
  29. package/api/resources/tenants/client/Client.js +40 -22
  30. package/api/resources/tenants/client/requests/ListTenantParams.d.ts +14 -0
  31. package/api/resources/tenants/client/requests/ListUsersForTenantParams.d.ts +14 -0
  32. package/api/resources/tenants/client/requests/index.d.ts +2 -0
  33. package/api/resources/tenants/types/ListUsersForTenantResponse.d.ts +1 -1
  34. package/api/resources/translations/client/Client.d.ts +1 -0
  35. package/api/resources/translations/client/Client.js +8 -8
  36. package/api/resources/users/client/Client.d.ts +1 -0
  37. package/api/resources/users/resources/preferences/client/Client.d.ts +1 -0
  38. package/api/resources/users/resources/preferences/client/Client.js +12 -12
  39. package/api/resources/users/resources/tenants/client/Client.d.ts +5 -0
  40. package/api/resources/users/resources/tenants/client/Client.js +62 -19
  41. package/api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.d.ts +2 -2
  42. package/api/resources/users/resources/tenants/types/ListTenantsForUserResponse.d.ts +1 -1
  43. package/api/resources/users/resources/tokens/client/Client.d.ts +1 -0
  44. package/api/resources/users/resources/tokens/client/Client.js +20 -20
  45. package/core/fetcher/Fetcher.js +3 -5
  46. package/dist/Client.d.ts +1 -0
  47. package/dist/Client.js +4 -4
  48. package/dist/api/resources/audiences/client/Client.d.ts +1 -0
  49. package/dist/api/resources/audiences/client/Client.js +20 -20
  50. package/dist/api/resources/auditEvents/client/Client.d.ts +1 -0
  51. package/dist/api/resources/auditEvents/client/Client.js +8 -8
  52. package/dist/api/resources/authTokens/client/Client.d.ts +1 -0
  53. package/dist/api/resources/authTokens/client/Client.js +4 -4
  54. package/dist/api/resources/automations/client/Client.d.ts +1 -0
  55. package/dist/api/resources/automations/client/Client.js +8 -8
  56. package/dist/api/resources/brands/client/Client.d.ts +1 -0
  57. package/dist/api/resources/brands/client/Client.js +20 -20
  58. package/dist/api/resources/bulk/client/Client.d.ts +1 -0
  59. package/dist/api/resources/bulk/client/Client.js +20 -20
  60. package/dist/api/resources/lists/client/Client.d.ts +2 -1
  61. package/dist/api/resources/lists/client/Client.js +41 -50
  62. package/dist/api/resources/lists/client/requests/index.d.ts +0 -1
  63. package/dist/api/resources/lists/types/index.d.ts +0 -5
  64. package/dist/api/resources/lists/types/index.js +0 -5
  65. package/dist/api/resources/messages/client/Client.d.ts +1 -0
  66. package/dist/api/resources/messages/client/Client.js +24 -24
  67. package/dist/api/resources/notifications/client/Client.d.ts +1 -0
  68. package/dist/api/resources/notifications/client/Client.js +32 -32
  69. package/dist/api/resources/profiles/client/Client.d.ts +1 -0
  70. package/dist/api/resources/profiles/client/Client.js +28 -28
  71. package/dist/api/resources/templates/client/Client.d.ts +1 -0
  72. package/dist/api/resources/templates/client/Client.js +4 -4
  73. package/dist/api/resources/tenants/client/Client.d.ts +3 -2
  74. package/dist/api/resources/tenants/client/Client.js +40 -22
  75. package/dist/api/resources/tenants/client/requests/ListTenantParams.d.ts +14 -0
  76. package/dist/api/resources/tenants/client/requests/ListUsersForTenantParams.d.ts +14 -0
  77. package/dist/api/resources/tenants/client/requests/index.d.ts +2 -0
  78. package/dist/api/resources/tenants/types/ListUsersForTenantResponse.d.ts +1 -1
  79. package/dist/api/resources/translations/client/Client.d.ts +1 -0
  80. package/dist/api/resources/translations/client/Client.js +8 -8
  81. package/dist/api/resources/users/client/Client.d.ts +1 -0
  82. package/dist/api/resources/users/resources/preferences/client/Client.d.ts +1 -0
  83. package/dist/api/resources/users/resources/preferences/client/Client.js +12 -12
  84. package/dist/api/resources/users/resources/tenants/client/Client.d.ts +5 -0
  85. package/dist/api/resources/users/resources/tenants/client/Client.js +62 -19
  86. package/dist/api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.d.ts +2 -2
  87. package/dist/api/resources/users/resources/tenants/types/ListTenantsForUserResponse.d.ts +1 -1
  88. package/dist/api/resources/users/resources/tokens/client/Client.d.ts +1 -0
  89. package/dist/api/resources/users/resources/tokens/client/Client.js +20 -20
  90. package/dist/core/fetcher/Fetcher.js +3 -5
  91. package/jest.config.js +5 -0
  92. package/package.json +6 -2
  93. package/tests/client.test.ts +11 -0
  94. package/api/resources/lists/client/requests/GetListRequest.d.ts +0 -13
  95. package/api/resources/lists/types/ListFindByRecipientIdParams.d.ts +0 -6
  96. package/api/resources/lists/types/ListFindByRecipientIdResponse.d.ts +0 -8
  97. package/api/resources/lists/types/ListGetAllParams.d.ts +0 -7
  98. package/api/resources/lists/types/ListGetSubscriptionsParams.d.ts +0 -6
  99. package/api/resources/lists/types/ListGetSubscriptionsParams.js +0 -5
  100. package/api/resources/lists/types/RecipientSubscriptionsResponse.d.ts +0 -8
  101. package/api/resources/lists/types/RecipientSubscriptionsResponse.js +0 -5
  102. package/dist/api/resources/lists/client/requests/GetListRequest.d.ts +0 -13
  103. package/dist/api/resources/lists/client/requests/GetListRequest.js +0 -5
  104. package/dist/api/resources/lists/types/ListFindByRecipientIdParams.d.ts +0 -6
  105. package/dist/api/resources/lists/types/ListFindByRecipientIdParams.js +0 -5
  106. package/dist/api/resources/lists/types/ListFindByRecipientIdResponse.d.ts +0 -8
  107. package/dist/api/resources/lists/types/ListFindByRecipientIdResponse.js +0 -5
  108. package/dist/api/resources/lists/types/ListGetAllParams.d.ts +0 -7
  109. package/dist/api/resources/lists/types/ListGetAllParams.js +0 -5
  110. package/dist/api/resources/lists/types/ListGetSubscriptionsParams.d.ts +0 -6
  111. package/dist/api/resources/lists/types/ListGetSubscriptionsParams.js +0 -5
  112. package/dist/api/resources/lists/types/RecipientSubscriptionsResponse.d.ts +0 -8
  113. package/dist/api/resources/lists/types/RecipientSubscriptionsResponse.js +0 -5
  114. /package/api/resources/{lists/client/requests/GetListRequest.js → tenants/client/requests/ListTenantParams.js} +0 -0
  115. /package/api/resources/{lists/types/ListFindByRecipientIdParams.js → tenants/client/requests/ListUsersForTenantParams.js} +0 -0
  116. /package/{api/resources/lists/types/ListFindByRecipientIdResponse.js → dist/api/resources/tenants/client/requests/ListTenantParams.js} +0 -0
  117. /package/{api/resources/lists/types/ListGetAllParams.js → dist/api/resources/tenants/client/requests/ListUsersForTenantParams.js} +0 -0
@@ -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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, "/brands"),
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.7",
66
+ "X-Fern-SDK-Version": "v6.1.0",
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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/brands/${brandId}`),
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.7",
123
+ "X-Fern-SDK-Version": "v6.1.0",
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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, "/brands"),
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.7",
171
+ "X-Fern-SDK-Version": "v6.1.0",
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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/brands/${brandId}`),
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.7",
216
+ "X-Fern-SDK-Version": "v6.1.0",
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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/brands/${brandId}`),
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.7",
264
+ "X-Fern-SDK-Version": "v6.1.0",
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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, "/bulk"),
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.7",
64
+ "X-Fern-SDK-Version": "v6.1.0",
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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/bulk/${jobId}`),
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.7",
117
+ "X-Fern-SDK-Version": "v6.1.0",
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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/bulk/${jobId}/run`),
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.7",
166
+ "X-Fern-SDK-Version": "v6.1.0",
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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/bulk/${jobId}`),
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.7",
219
+ "X-Fern-SDK-Version": "v6.1.0",
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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/bulk/${jobId}/users`),
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.7",
268
+ "X-Fern-SDK-Version": "v6.1.0",
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;
@@ -30,7 +31,7 @@ export declare class Lists {
30
31
  * Returns a list based on the list ID provided.
31
32
  * @throws {@link Courier.NotFoundError}
32
33
  */
33
- get(listId: string, request?: Courier.GetListRequest, requestOptions?: Lists.RequestOptions): Promise<Courier.List>;
34
+ get(listId: string, requestOptions?: Lists.RequestOptions): Promise<Courier.List>;
34
35
  /**
35
36
  * Create or replace an existing list with the supplied values.
36
37
  */
@@ -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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, "/lists"),
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.7",
73
+ "X-Fern-SDK-Version": "v6.1.0",
74
74
  },
75
75
  contentType: "application/json",
76
76
  queryParameters: _queryParams,
@@ -110,28 +110,19 @@ class Lists {
110
110
  * Returns a list based on the list ID provided.
111
111
  * @throws {@link Courier.NotFoundError}
112
112
  */
113
- get(listId, request = {}, requestOptions) {
114
- var _a;
113
+ get(listId, requestOptions) {
114
+ var _a, _b;
115
115
  return __awaiter(this, void 0, void 0, function* () {
116
- const { cursor, pattern } = request;
117
- const _queryParams = {};
118
- if (cursor != null) {
119
- _queryParams["cursor"] = cursor;
120
- }
121
- if (pattern != null) {
122
- _queryParams["pattern"] = pattern;
123
- }
124
- const _response = yield core.fetcher({
125
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/lists/${listId}`),
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, `/lists/${listId}`),
126
118
  method: "GET",
127
119
  headers: {
128
120
  Authorization: yield this._getAuthorizationHeader(),
129
121
  "X-Fern-Language": "JavaScript",
130
122
  "X-Fern-SDK-Name": "@trycourier/courier",
131
- "X-Fern-SDK-Version": "v6.0.7",
123
+ "X-Fern-SDK-Version": "v6.1.0",
132
124
  },
133
125
  contentType: "application/json",
134
- queryParameters: _queryParams,
135
126
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
136
127
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
137
128
  });
@@ -168,16 +159,16 @@ class Lists {
168
159
  * Create or replace an existing list with the supplied values.
169
160
  */
170
161
  update(listId, request, requestOptions) {
171
- var _a;
162
+ var _a, _b;
172
163
  return __awaiter(this, void 0, void 0, function* () {
173
- const _response = yield core.fetcher({
174
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/lists/${listId}`),
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, `/lists/${listId}`),
175
166
  method: "PUT",
176
167
  headers: {
177
168
  Authorization: yield this._getAuthorizationHeader(),
178
169
  "X-Fern-Language": "JavaScript",
179
170
  "X-Fern-SDK-Name": "@trycourier/courier",
180
- "X-Fern-SDK-Version": "v6.0.7",
171
+ "X-Fern-SDK-Version": "v6.1.0",
181
172
  },
182
173
  contentType: "application/json",
183
174
  body: request,
@@ -212,16 +203,16 @@ class Lists {
212
203
  * Delete a list by list ID.
213
204
  */
214
205
  delete(listId, requestOptions) {
215
- var _a;
206
+ var _a, _b;
216
207
  return __awaiter(this, void 0, void 0, function* () {
217
- const _response = yield core.fetcher({
218
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/lists/${listId}`),
208
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
209
+ 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
210
  method: "DELETE",
220
211
  headers: {
221
212
  Authorization: yield this._getAuthorizationHeader(),
222
213
  "X-Fern-Language": "JavaScript",
223
214
  "X-Fern-SDK-Name": "@trycourier/courier",
224
- "X-Fern-SDK-Version": "v6.0.7",
215
+ "X-Fern-SDK-Version": "v6.1.0",
225
216
  },
226
217
  contentType: "application/json",
227
218
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -255,16 +246,16 @@ class Lists {
255
246
  * Restore a previously deleted list.
256
247
  */
257
248
  restore(listId, requestOptions) {
258
- var _a;
249
+ var _a, _b;
259
250
  return __awaiter(this, void 0, void 0, function* () {
260
- const _response = yield core.fetcher({
261
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/lists/${listId}/restore`),
251
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
252
+ 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
253
  method: "PUT",
263
254
  headers: {
264
255
  Authorization: yield this._getAuthorizationHeader(),
265
256
  "X-Fern-Language": "JavaScript",
266
257
  "X-Fern-SDK-Name": "@trycourier/courier",
267
- "X-Fern-SDK-Version": "v6.0.7",
258
+ "X-Fern-SDK-Version": "v6.1.0",
268
259
  },
269
260
  contentType: "application/json",
270
261
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -299,21 +290,21 @@ class Lists {
299
290
  * @throws {@link Courier.NotFoundError}
300
291
  */
301
292
  getSubscribers(listId, request = {}, requestOptions) {
302
- var _a;
293
+ var _a, _b;
303
294
  return __awaiter(this, void 0, void 0, function* () {
304
295
  const { cursor } = request;
305
296
  const _queryParams = {};
306
297
  if (cursor != null) {
307
298
  _queryParams["cursor"] = cursor;
308
299
  }
309
- const _response = yield core.fetcher({
310
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/lists/${listId}/subscriptions`),
300
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
301
+ 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
302
  method: "GET",
312
303
  headers: {
313
304
  Authorization: yield this._getAuthorizationHeader(),
314
305
  "X-Fern-Language": "JavaScript",
315
306
  "X-Fern-SDK-Name": "@trycourier/courier",
316
- "X-Fern-SDK-Version": "v6.0.7",
307
+ "X-Fern-SDK-Version": "v6.1.0",
317
308
  },
318
309
  contentType: "application/json",
319
310
  queryParameters: _queryParams,
@@ -354,16 +345,16 @@ class Lists {
354
345
  * @throws {@link Courier.BadRequestError}
355
346
  */
356
347
  updateSubscribers(listId, request, requestOptions) {
357
- var _a;
348
+ var _a, _b;
358
349
  return __awaiter(this, void 0, void 0, function* () {
359
- const _response = yield core.fetcher({
360
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/lists/${listId}/subscriptions`),
350
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
351
+ 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
352
  method: "PUT",
362
353
  headers: {
363
354
  Authorization: yield this._getAuthorizationHeader(),
364
355
  "X-Fern-Language": "JavaScript",
365
356
  "X-Fern-SDK-Name": "@trycourier/courier",
366
- "X-Fern-SDK-Version": "v6.0.7",
357
+ "X-Fern-SDK-Version": "v6.1.0",
367
358
  },
368
359
  contentType: "application/json",
369
360
  body: request,
@@ -404,16 +395,16 @@ class Lists {
404
395
  * @throws {@link Courier.BadRequestError}
405
396
  */
406
397
  addSubscribers(listId, request, requestOptions) {
407
- var _a;
398
+ var _a, _b;
408
399
  return __awaiter(this, void 0, void 0, function* () {
409
- const _response = yield core.fetcher({
410
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/lists/${listId}/subscriptions`),
400
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
401
+ 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
402
  method: "POST",
412
403
  headers: {
413
404
  Authorization: yield this._getAuthorizationHeader(),
414
405
  "X-Fern-Language": "JavaScript",
415
406
  "X-Fern-SDK-Name": "@trycourier/courier",
416
- "X-Fern-SDK-Version": "v6.0.7",
407
+ "X-Fern-SDK-Version": "v6.1.0",
417
408
  "Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
418
409
  "X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
419
410
  ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
@@ -457,16 +448,16 @@ class Lists {
457
448
  * Subscribe a user to an existing list (note: if the List does not exist, it will be automatically created).
458
449
  */
459
450
  subscribe(listId, userId, request = {}, requestOptions) {
460
- var _a;
451
+ var _a, _b;
461
452
  return __awaiter(this, void 0, void 0, function* () {
462
- const _response = yield core.fetcher({
463
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/lists/${listId}/subscriptions/${userId}`),
453
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
454
+ 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
455
  method: "PUT",
465
456
  headers: {
466
457
  Authorization: yield this._getAuthorizationHeader(),
467
458
  "X-Fern-Language": "JavaScript",
468
459
  "X-Fern-SDK-Name": "@trycourier/courier",
469
- "X-Fern-SDK-Version": "v6.0.7",
460
+ "X-Fern-SDK-Version": "v6.1.0",
470
461
  },
471
462
  contentType: "application/json",
472
463
  body: request,
@@ -502,16 +493,16 @@ class Lists {
502
493
  * @throws {@link Courier.NotFoundError}
503
494
  */
504
495
  unsubscribe(listId, userId, requestOptions) {
505
- var _a;
496
+ var _a, _b;
506
497
  return __awaiter(this, void 0, void 0, function* () {
507
- const _response = yield core.fetcher({
508
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/lists/${listId}/subscriptions/${userId}`),
498
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
499
+ 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
500
  method: "DELETE",
510
501
  headers: {
511
502
  Authorization: yield this._getAuthorizationHeader(),
512
503
  "X-Fern-Language": "JavaScript",
513
504
  "X-Fern-SDK-Name": "@trycourier/courier",
514
- "X-Fern-SDK-Version": "v6.0.7",
505
+ "X-Fern-SDK-Version": "v6.1.0",
515
506
  },
516
507
  contentType: "application/json",
517
508
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -1,4 +1,3 @@
1
1
  export { GetAllListsRequest } from "./GetAllListsRequest";
2
- export { GetListRequest } from "./GetListRequest";
3
2
  export { GetSubscriptionForListRequest } from "./GetSubscriptionForListRequest";
4
3
  export { SubscribeUserToListRequest } from "./SubscribeUserToListRequest";
@@ -1,11 +1,6 @@
1
1
  export * from "./List";
2
- export * from "./RecipientSubscriptionsResponse";
3
2
  export * from "./ListPutParams";
4
- export * from "./ListGetAllParams";
5
3
  export * from "./ListGetAllResponse";
6
- export * from "./ListGetSubscriptionsParams";
7
4
  export * from "./ListSubscriptionRecipient";
8
5
  export * from "./ListGetSubscriptionsResponse";
9
- export * from "./ListFindByRecipientIdParams";
10
- export * from "./ListFindByRecipientIdResponse";
11
6
  export * from "./PutSubscriptionsRecipient";
@@ -15,13 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./List"), exports);
18
- __exportStar(require("./RecipientSubscriptionsResponse"), exports);
19
18
  __exportStar(require("./ListPutParams"), exports);
20
- __exportStar(require("./ListGetAllParams"), exports);
21
19
  __exportStar(require("./ListGetAllResponse"), exports);
22
- __exportStar(require("./ListGetSubscriptionsParams"), exports);
23
20
  __exportStar(require("./ListSubscriptionRecipient"), exports);
24
21
  __exportStar(require("./ListGetSubscriptionsResponse"), exports);
25
- __exportStar(require("./ListFindByRecipientIdParams"), exports);
26
- __exportStar(require("./ListFindByRecipientIdResponse"), exports);
27
22
  __exportStar(require("./PutSubscriptionsRecipient"), exports);
@@ -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;