@trycourier/courier 6.2.2 → 6.3.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 (91) hide show
  1. package/Client.d.ts +72 -11
  2. package/Client.js +73 -12
  3. package/api/client/requests/SendMessageRequest.d.ts +72 -11
  4. package/api/resources/audiences/client/Client.js +5 -5
  5. package/api/resources/auditEvents/client/Client.js +2 -2
  6. package/api/resources/authTokens/client/Client.js +1 -1
  7. package/api/resources/automations/client/Client.js +2 -2
  8. package/api/resources/brands/client/Client.d.ts +38 -4
  9. package/api/resources/brands/client/Client.js +43 -9
  10. package/api/resources/brands/client/requests/BrandUpdateParameters.d.ts +13 -2
  11. package/api/resources/bulk/client/Client.d.ts +92 -3
  12. package/api/resources/bulk/client/Client.js +97 -8
  13. package/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +71 -1
  14. package/api/resources/inbound/client/Client.js +1 -1
  15. package/api/resources/lists/client/Client.d.ts +8 -96
  16. package/api/resources/lists/client/Client.js +18 -106
  17. package/api/resources/lists/client/requests/AddSubscribersToList.d.ts +2 -24
  18. package/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +2 -24
  19. package/api/resources/lists/client/requests/SubscribeUsersToListRequest.d.ts +2 -24
  20. package/api/resources/messages/client/Client.js +6 -6
  21. package/api/resources/notifications/client/Client.js +6 -6
  22. package/api/resources/profiles/client/Client.d.ts +20 -1
  23. package/api/resources/profiles/client/Client.js +69 -8
  24. package/api/resources/profiles/types/UserProfilePatch.d.ts +11 -0
  25. package/api/resources/profiles/types/UserProfilePatch.js +5 -0
  26. package/api/resources/profiles/types/index.d.ts +1 -0
  27. package/api/resources/profiles/types/index.js +1 -0
  28. package/api/resources/send/types/BaseMessage.d.ts +1 -1
  29. package/api/resources/send/types/Delay.d.ts +3 -1
  30. package/api/resources/templates/client/Client.js +1 -1
  31. package/api/resources/tenants/client/Client.d.ts +6 -1
  32. package/api/resources/tenants/client/Client.js +13 -8
  33. package/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts +6 -1
  34. package/api/resources/translations/client/Client.js +2 -2
  35. package/api/resources/users/resources/preferences/client/Client.d.ts +10 -4
  36. package/api/resources/users/resources/preferences/client/Client.js +43 -8
  37. package/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.d.ts +15 -0
  38. package/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.js +5 -0
  39. package/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.d.ts +15 -0
  40. package/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.js +5 -0
  41. package/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +4 -0
  42. package/api/resources/users/resources/preferences/client/requests/index.d.ts +2 -0
  43. package/api/resources/users/resources/tenants/client/Client.js +5 -5
  44. package/api/resources/users/resources/tokens/client/Client.d.ts +5 -1
  45. package/api/resources/users/resources/tokens/client/Client.js +11 -7
  46. package/dist/Client.d.ts +72 -11
  47. package/dist/Client.js +73 -12
  48. package/dist/api/client/requests/SendMessageRequest.d.ts +72 -11
  49. package/dist/api/resources/audiences/client/Client.js +5 -5
  50. package/dist/api/resources/auditEvents/client/Client.js +2 -2
  51. package/dist/api/resources/authTokens/client/Client.js +1 -1
  52. package/dist/api/resources/automations/client/Client.js +2 -2
  53. package/dist/api/resources/brands/client/Client.d.ts +38 -4
  54. package/dist/api/resources/brands/client/Client.js +43 -9
  55. package/dist/api/resources/brands/client/requests/BrandUpdateParameters.d.ts +13 -2
  56. package/dist/api/resources/bulk/client/Client.d.ts +92 -3
  57. package/dist/api/resources/bulk/client/Client.js +97 -8
  58. package/dist/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +71 -1
  59. package/dist/api/resources/inbound/client/Client.js +1 -1
  60. package/dist/api/resources/lists/client/Client.d.ts +8 -96
  61. package/dist/api/resources/lists/client/Client.js +18 -106
  62. package/dist/api/resources/lists/client/requests/AddSubscribersToList.d.ts +2 -24
  63. package/dist/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +2 -24
  64. package/dist/api/resources/lists/client/requests/SubscribeUsersToListRequest.d.ts +2 -24
  65. package/dist/api/resources/messages/client/Client.js +6 -6
  66. package/dist/api/resources/notifications/client/Client.js +6 -6
  67. package/dist/api/resources/profiles/client/Client.d.ts +20 -1
  68. package/dist/api/resources/profiles/client/Client.js +69 -8
  69. package/dist/api/resources/profiles/types/UserProfilePatch.d.ts +11 -0
  70. package/dist/api/resources/profiles/types/UserProfilePatch.js +5 -0
  71. package/dist/api/resources/profiles/types/index.d.ts +1 -0
  72. package/dist/api/resources/profiles/types/index.js +1 -0
  73. package/dist/api/resources/send/types/BaseMessage.d.ts +1 -1
  74. package/dist/api/resources/send/types/Delay.d.ts +3 -1
  75. package/dist/api/resources/templates/client/Client.js +1 -1
  76. package/dist/api/resources/tenants/client/Client.d.ts +6 -1
  77. package/dist/api/resources/tenants/client/Client.js +13 -8
  78. package/dist/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts +6 -1
  79. package/dist/api/resources/translations/client/Client.js +2 -2
  80. package/dist/api/resources/users/resources/preferences/client/Client.d.ts +10 -4
  81. package/dist/api/resources/users/resources/preferences/client/Client.js +43 -8
  82. package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.d.ts +15 -0
  83. package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.js +5 -0
  84. package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.d.ts +15 -0
  85. package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.js +5 -0
  86. package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +4 -0
  87. package/dist/api/resources/users/resources/preferences/client/requests/index.d.ts +2 -0
  88. package/dist/api/resources/users/resources/tenants/client/Client.js +5 -5
  89. package/dist/api/resources/users/resources/tokens/client/Client.d.ts +5 -1
  90. package/dist/api/resources/users/resources/tokens/client/Client.js +11 -7
  91. package/package.json +1 -1
@@ -8,30 +8,8 @@ import * as Courier from "../../../../index";
8
8
  * recipients: [{
9
9
  * recipientId: "string",
10
10
  * preferences: {
11
- * categories: {
12
- * "string": {
13
- * status: Courier.PreferenceStatus.OptedIn,
14
- * rules: [{
15
- * start: "string",
16
- * until: "string"
17
- * }],
18
- * channel_preferences: [{
19
- * channel: Courier.ChannelClassification.DirectMessage
20
- * }]
21
- * }
22
- * },
23
- * notifications: {
24
- * "string": {
25
- * status: Courier.PreferenceStatus.OptedIn,
26
- * rules: [{
27
- * start: "string",
28
- * until: "string"
29
- * }],
30
- * channel_preferences: [{
31
- * channel: Courier.ChannelClassification.DirectMessage
32
- * }]
33
- * }
34
- * }
11
+ * categories: {},
12
+ * notifications: {}
35
13
  * }
36
14
  * }]
37
15
  * }
@@ -141,7 +141,7 @@ class Messages {
141
141
  Authorization: yield this._getAuthorizationHeader(),
142
142
  "X-Fern-Language": "JavaScript",
143
143
  "X-Fern-SDK-Name": "@trycourier/courier",
144
- "X-Fern-SDK-Version": "v6.2.2",
144
+ "X-Fern-SDK-Version": "v6.3.0",
145
145
  "X-Fern-Runtime": core.RUNTIME.type,
146
146
  "X-Fern-Runtime-Version": core.RUNTIME.version,
147
147
  },
@@ -196,7 +196,7 @@ class Messages {
196
196
  Authorization: yield this._getAuthorizationHeader(),
197
197
  "X-Fern-Language": "JavaScript",
198
198
  "X-Fern-SDK-Name": "@trycourier/courier",
199
- "X-Fern-SDK-Version": "v6.2.2",
199
+ "X-Fern-SDK-Version": "v6.3.0",
200
200
  "X-Fern-Runtime": core.RUNTIME.type,
201
201
  "X-Fern-Runtime-Version": core.RUNTIME.version,
202
202
  },
@@ -254,7 +254,7 @@ class Messages {
254
254
  Authorization: yield this._getAuthorizationHeader(),
255
255
  "X-Fern-Language": "JavaScript",
256
256
  "X-Fern-SDK-Name": "@trycourier/courier",
257
- "X-Fern-SDK-Version": "v6.2.2",
257
+ "X-Fern-SDK-Version": "v6.3.0",
258
258
  "X-Fern-Runtime": core.RUNTIME.type,
259
259
  "X-Fern-Runtime-Version": core.RUNTIME.version,
260
260
  "Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
@@ -318,7 +318,7 @@ class Messages {
318
318
  Authorization: yield this._getAuthorizationHeader(),
319
319
  "X-Fern-Language": "JavaScript",
320
320
  "X-Fern-SDK-Name": "@trycourier/courier",
321
- "X-Fern-SDK-Version": "v6.2.2",
321
+ "X-Fern-SDK-Version": "v6.3.0",
322
322
  "X-Fern-Runtime": core.RUNTIME.type,
323
323
  "X-Fern-Runtime-Version": core.RUNTIME.version,
324
324
  },
@@ -378,7 +378,7 @@ class Messages {
378
378
  Authorization: yield this._getAuthorizationHeader(),
379
379
  "X-Fern-Language": "JavaScript",
380
380
  "X-Fern-SDK-Name": "@trycourier/courier",
381
- "X-Fern-SDK-Version": "v6.2.2",
381
+ "X-Fern-SDK-Version": "v6.3.0",
382
382
  "X-Fern-Runtime": core.RUNTIME.type,
383
383
  "X-Fern-Runtime-Version": core.RUNTIME.version,
384
384
  },
@@ -434,7 +434,7 @@ class Messages {
434
434
  Authorization: yield this._getAuthorizationHeader(),
435
435
  "X-Fern-Language": "JavaScript",
436
436
  "X-Fern-SDK-Name": "@trycourier/courier",
437
- "X-Fern-SDK-Version": "v6.2.2",
437
+ "X-Fern-SDK-Version": "v6.3.0",
438
438
  "X-Fern-Runtime": core.RUNTIME.type,
439
439
  "X-Fern-Runtime-Version": core.RUNTIME.version,
440
440
  },
@@ -75,7 +75,7 @@ class Notifications {
75
75
  Authorization: yield this._getAuthorizationHeader(),
76
76
  "X-Fern-Language": "JavaScript",
77
77
  "X-Fern-SDK-Name": "@trycourier/courier",
78
- "X-Fern-SDK-Version": "v6.2.2",
78
+ "X-Fern-SDK-Version": "v6.3.0",
79
79
  "X-Fern-Runtime": core.RUNTIME.type,
80
80
  "X-Fern-Runtime-Version": core.RUNTIME.version,
81
81
  },
@@ -125,7 +125,7 @@ class Notifications {
125
125
  Authorization: yield this._getAuthorizationHeader(),
126
126
  "X-Fern-Language": "JavaScript",
127
127
  "X-Fern-SDK-Name": "@trycourier/courier",
128
- "X-Fern-SDK-Version": "v6.2.2",
128
+ "X-Fern-SDK-Version": "v6.3.0",
129
129
  "X-Fern-Runtime": core.RUNTIME.type,
130
130
  "X-Fern-Runtime-Version": core.RUNTIME.version,
131
131
  },
@@ -174,7 +174,7 @@ class Notifications {
174
174
  Authorization: yield this._getAuthorizationHeader(),
175
175
  "X-Fern-Language": "JavaScript",
176
176
  "X-Fern-SDK-Name": "@trycourier/courier",
177
- "X-Fern-SDK-Version": "v6.2.2",
177
+ "X-Fern-SDK-Version": "v6.3.0",
178
178
  "X-Fern-Runtime": core.RUNTIME.type,
179
179
  "X-Fern-Runtime-Version": core.RUNTIME.version,
180
180
  },
@@ -224,7 +224,7 @@ class Notifications {
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.2.2",
227
+ "X-Fern-SDK-Version": "v6.3.0",
228
228
  "X-Fern-Runtime": core.RUNTIME.type,
229
229
  "X-Fern-Runtime-Version": core.RUNTIME.version,
230
230
  },
@@ -281,7 +281,7 @@ class Notifications {
281
281
  Authorization: yield this._getAuthorizationHeader(),
282
282
  "X-Fern-Language": "JavaScript",
283
283
  "X-Fern-SDK-Name": "@trycourier/courier",
284
- "X-Fern-SDK-Version": "v6.2.2",
284
+ "X-Fern-SDK-Version": "v6.3.0",
285
285
  "X-Fern-Runtime": core.RUNTIME.type,
286
286
  "X-Fern-Runtime-Version": core.RUNTIME.version,
287
287
  },
@@ -332,7 +332,7 @@ class Notifications {
332
332
  Authorization: yield this._getAuthorizationHeader(),
333
333
  "X-Fern-Language": "JavaScript",
334
334
  "X-Fern-SDK-Name": "@trycourier/courier",
335
- "X-Fern-SDK-Version": "v6.2.2",
335
+ "X-Fern-SDK-Version": "v6.3.0",
336
336
  "X-Fern-Runtime": core.RUNTIME.type,
337
337
  "X-Fern-Runtime-Version": core.RUNTIME.version,
338
338
  },
@@ -75,6 +75,19 @@ export declare class Profiles {
75
75
  * })
76
76
  */
77
77
  replace(userId: string, request: Courier.ReplaceProfileRequest, requestOptions?: Profiles.RequestOptions): Promise<Courier.ReplaceProfileResponse>;
78
+ /**
79
+ * @param {string} userId - A unique identifier representing the user associated with the requested profile.
80
+ * @param {Courier.UserProfilePatch[]} request
81
+ * @param {Profiles.RequestOptions} requestOptions - Request-specific configuration.
82
+ *
83
+ * @example
84
+ * await courier.profiles.mergeProfile("string", [{
85
+ * op: "string",
86
+ * path: "string",
87
+ * value: "string"
88
+ * }])
89
+ */
90
+ mergeProfile(userId: string, request: Courier.UserProfilePatch[], requestOptions?: Profiles.RequestOptions): Promise<void>;
78
91
  /**
79
92
  * Deletes the specified user profile.
80
93
  *
@@ -113,7 +126,13 @@ export declare class Profiles {
113
126
  *
114
127
  * @example
115
128
  * await courier.profiles.subscribeToLists("string", {
116
- * lists: [{}]
129
+ * lists: [{
130
+ * listId: "string",
131
+ * preferences: {
132
+ * categories: {},
133
+ * notifications: {}
134
+ * }
135
+ * }]
117
136
  * })
118
137
  */
119
138
  subscribeToLists(userId: string, request: Courier.SubscribeToListsRequest, requestOptions?: Profiles.IdempotentRequestOptions): Promise<Courier.SubscribeToListsResponse>;
@@ -69,7 +69,7 @@ class Profiles {
69
69
  Authorization: yield this._getAuthorizationHeader(),
70
70
  "X-Fern-Language": "JavaScript",
71
71
  "X-Fern-SDK-Name": "@trycourier/courier",
72
- "X-Fern-SDK-Version": "v6.2.2",
72
+ "X-Fern-SDK-Version": "v6.3.0",
73
73
  "X-Fern-Runtime": core.RUNTIME.type,
74
74
  "X-Fern-Runtime-Version": core.RUNTIME.version,
75
75
  },
@@ -134,7 +134,7 @@ class Profiles {
134
134
  Authorization: yield this._getAuthorizationHeader(),
135
135
  "X-Fern-Language": "JavaScript",
136
136
  "X-Fern-SDK-Name": "@trycourier/courier",
137
- "X-Fern-SDK-Version": "v6.2.2",
137
+ "X-Fern-SDK-Version": "v6.3.0",
138
138
  "X-Fern-Runtime": core.RUNTIME.type,
139
139
  "X-Fern-Runtime-Version": core.RUNTIME.version,
140
140
  "Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
@@ -205,7 +205,7 @@ class Profiles {
205
205
  Authorization: yield this._getAuthorizationHeader(),
206
206
  "X-Fern-Language": "JavaScript",
207
207
  "X-Fern-SDK-Name": "@trycourier/courier",
208
- "X-Fern-SDK-Version": "v6.2.2",
208
+ "X-Fern-SDK-Version": "v6.3.0",
209
209
  "X-Fern-Runtime": core.RUNTIME.type,
210
210
  "X-Fern-Runtime-Version": core.RUNTIME.version,
211
211
  },
@@ -243,6 +243,61 @@ class Profiles {
243
243
  }
244
244
  });
245
245
  }
246
+ /**
247
+ * @param {string} userId - A unique identifier representing the user associated with the requested profile.
248
+ * @param {Courier.UserProfilePatch[]} request
249
+ * @param {Profiles.RequestOptions} requestOptions - Request-specific configuration.
250
+ *
251
+ * @example
252
+ * await courier.profiles.mergeProfile("string", [{
253
+ * op: "string",
254
+ * path: "string",
255
+ * value: "string"
256
+ * }])
257
+ */
258
+ mergeProfile(userId, request, requestOptions) {
259
+ var _a, _b;
260
+ return __awaiter(this, void 0, void 0, function* () {
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, `/profiles/${encodeURIComponent(userId)}`),
263
+ method: "PATCH",
264
+ headers: {
265
+ Authorization: yield this._getAuthorizationHeader(),
266
+ "X-Fern-Language": "JavaScript",
267
+ "X-Fern-SDK-Name": "@trycourier/courier",
268
+ "X-Fern-SDK-Version": "v6.3.0",
269
+ "X-Fern-Runtime": core.RUNTIME.type,
270
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
271
+ },
272
+ contentType: "application/json",
273
+ body: request,
274
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
275
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
276
+ });
277
+ if (_response.ok) {
278
+ return;
279
+ }
280
+ if (_response.error.reason === "status-code") {
281
+ throw new errors.CourierError({
282
+ statusCode: _response.error.statusCode,
283
+ body: _response.error.body,
284
+ });
285
+ }
286
+ switch (_response.error.reason) {
287
+ case "non-json":
288
+ throw new errors.CourierError({
289
+ statusCode: _response.error.statusCode,
290
+ body: _response.error.rawBody,
291
+ });
292
+ case "timeout":
293
+ throw new errors.CourierTimeoutError();
294
+ case "unknown":
295
+ throw new errors.CourierError({
296
+ message: _response.error.errorMessage,
297
+ });
298
+ }
299
+ });
300
+ }
246
301
  /**
247
302
  * Deletes the specified user profile.
248
303
  *
@@ -264,7 +319,7 @@ class Profiles {
264
319
  Authorization: yield this._getAuthorizationHeader(),
265
320
  "X-Fern-Language": "JavaScript",
266
321
  "X-Fern-SDK-Name": "@trycourier/courier",
267
- "X-Fern-SDK-Version": "v6.2.2",
322
+ "X-Fern-SDK-Version": "v6.3.0",
268
323
  "X-Fern-Runtime": core.RUNTIME.type,
269
324
  "X-Fern-Runtime-Version": core.RUNTIME.version,
270
325
  },
@@ -330,7 +385,7 @@ class Profiles {
330
385
  Authorization: yield this._getAuthorizationHeader(),
331
386
  "X-Fern-Language": "JavaScript",
332
387
  "X-Fern-SDK-Name": "@trycourier/courier",
333
- "X-Fern-SDK-Version": "v6.2.2",
388
+ "X-Fern-SDK-Version": "v6.3.0",
334
389
  "X-Fern-Runtime": core.RUNTIME.type,
335
390
  "X-Fern-Runtime-Version": core.RUNTIME.version,
336
391
  },
@@ -379,7 +434,13 @@ class Profiles {
379
434
  *
380
435
  * @example
381
436
  * await courier.profiles.subscribeToLists("string", {
382
- * lists: [{}]
437
+ * lists: [{
438
+ * listId: "string",
439
+ * preferences: {
440
+ * categories: {},
441
+ * notifications: {}
442
+ * }
443
+ * }]
383
444
  * })
384
445
  */
385
446
  subscribeToLists(userId, request, requestOptions) {
@@ -392,7 +453,7 @@ class Profiles {
392
453
  Authorization: yield this._getAuthorizationHeader(),
393
454
  "X-Fern-Language": "JavaScript",
394
455
  "X-Fern-SDK-Name": "@trycourier/courier",
395
- "X-Fern-SDK-Version": "v6.2.2",
456
+ "X-Fern-SDK-Version": "v6.3.0",
396
457
  "X-Fern-Runtime": core.RUNTIME.type,
397
458
  "X-Fern-Runtime-Version": core.RUNTIME.version,
398
459
  "Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
@@ -453,7 +514,7 @@ class Profiles {
453
514
  Authorization: yield this._getAuthorizationHeader(),
454
515
  "X-Fern-Language": "JavaScript",
455
516
  "X-Fern-SDK-Name": "@trycourier/courier",
456
- "X-Fern-SDK-Version": "v6.2.2",
517
+ "X-Fern-SDK-Version": "v6.3.0",
457
518
  "X-Fern-Runtime": core.RUNTIME.type,
458
519
  "X-Fern-Runtime-Version": core.RUNTIME.version,
459
520
  },
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface UserProfilePatch {
5
+ /** The operation to perform. */
6
+ op: string;
7
+ /** The JSON path specifying the part of the profile to operate on. */
8
+ path: string;
9
+ /** The value for the operation. */
10
+ value: string;
11
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -42,3 +42,4 @@ export * from "./WebhookMethod";
42
42
  export * from "./WebhookAuthentication";
43
43
  export * from "./WebhookAuthMode";
44
44
  export * from "./WebhookProfileType";
45
+ export * from "./UserProfilePatch";
@@ -58,3 +58,4 @@ __exportStar(require("./WebhookMethod"), exports);
58
58
  __exportStar(require("./WebhookAuthentication"), exports);
59
59
  __exportStar(require("./WebhookAuthMode"), exports);
60
60
  __exportStar(require("./WebhookProfileType"), exports);
61
+ __exportStar(require("./UserProfilePatch"), exports);
@@ -21,7 +21,7 @@ export interface BaseMessage {
21
21
  routing?: Courier.Routing;
22
22
  /** Time in ms to attempt the channel before failing over to the next available channel. */
23
23
  timeout?: Courier.Timeout;
24
- /** Defines the time to wait before delivering the message. */
24
+ /** Defines the time to wait before delivering the message. You can specify one of the following options. Duration with the number of milliseconds to delay. Until with an ISO 8601 timestamp that specifies when it should be delivered. Until with an OpenStreetMap opening_hours-like format that specifies the [Delivery Window](https://www.courier.com/docs/platform/sending/failover/#delivery-window) (e.g., 'Mo-Fr 08:00-18:00pm') */
25
25
  delay?: Courier.Delay;
26
26
  /**
27
27
  * "Expiry allows you to set an absolute or relative time in which a message expires.
@@ -3,5 +3,7 @@
3
3
  */
4
4
  export interface Delay {
5
5
  /** The duration of the delay in milliseconds. */
6
- duration: number;
6
+ duration?: number;
7
+ /** An ISO 8601 timestamp that specifies when it should be delivered or an OpenStreetMap opening_hours-like format that specifies the [Delivery Window](https://www.courier.com/docs/platform/sending/failover/#delivery-window) (e.g., 'Mo-Fr 08:00-18:00pm') */
8
+ until?: string;
7
9
  }
@@ -73,7 +73,7 @@ class Templates {
73
73
  Authorization: yield this._getAuthorizationHeader(),
74
74
  "X-Fern-Language": "JavaScript",
75
75
  "X-Fern-SDK-Name": "@trycourier/courier",
76
- "X-Fern-SDK-Version": "v6.2.2",
76
+ "X-Fern-SDK-Version": "v6.3.0",
77
77
  "X-Fern-Runtime": core.RUNTIME.type,
78
78
  "X-Fern-Runtime-Version": core.RUNTIME.version,
79
79
  },
@@ -30,7 +30,12 @@ export declare class Tenants {
30
30
  * name: "string",
31
31
  * parent_tenant_id: "string",
32
32
  * default_preferences: {
33
- * items: [{}]
33
+ * items: [{
34
+ * id: "string",
35
+ * status: Courier.SubscriptionTopicStatus.OptedOut,
36
+ * has_custom_routing: undefined,
37
+ * custom_routing: undefined
38
+ * }]
34
39
  * },
35
40
  * properties: {
36
41
  * "string": {
@@ -60,7 +60,12 @@ class Tenants {
60
60
  * name: "string",
61
61
  * parent_tenant_id: "string",
62
62
  * default_preferences: {
63
- * items: [{}]
63
+ * items: [{
64
+ * id: "string",
65
+ * status: Courier.SubscriptionTopicStatus.OptedOut,
66
+ * has_custom_routing: undefined,
67
+ * custom_routing: undefined
68
+ * }]
64
69
  * },
65
70
  * properties: {
66
71
  * "string": {
@@ -85,7 +90,7 @@ class Tenants {
85
90
  Authorization: yield this._getAuthorizationHeader(),
86
91
  "X-Fern-Language": "JavaScript",
87
92
  "X-Fern-SDK-Name": "@trycourier/courier",
88
- "X-Fern-SDK-Version": "v6.2.2",
93
+ "X-Fern-SDK-Version": "v6.3.0",
89
94
  "X-Fern-Runtime": core.RUNTIME.type,
90
95
  "X-Fern-Runtime-Version": core.RUNTIME.version,
91
96
  },
@@ -142,7 +147,7 @@ class Tenants {
142
147
  Authorization: yield this._getAuthorizationHeader(),
143
148
  "X-Fern-Language": "JavaScript",
144
149
  "X-Fern-SDK-Name": "@trycourier/courier",
145
- "X-Fern-SDK-Version": "v6.2.2",
150
+ "X-Fern-SDK-Version": "v6.3.0",
146
151
  "X-Fern-Runtime": core.RUNTIME.type,
147
152
  "X-Fern-Runtime-Version": core.RUNTIME.version,
148
153
  },
@@ -211,7 +216,7 @@ class Tenants {
211
216
  Authorization: yield this._getAuthorizationHeader(),
212
217
  "X-Fern-Language": "JavaScript",
213
218
  "X-Fern-SDK-Name": "@trycourier/courier",
214
- "X-Fern-SDK-Version": "v6.2.2",
219
+ "X-Fern-SDK-Version": "v6.3.0",
215
220
  "X-Fern-Runtime": core.RUNTIME.type,
216
221
  "X-Fern-Runtime-Version": core.RUNTIME.version,
217
222
  },
@@ -261,7 +266,7 @@ class Tenants {
261
266
  Authorization: yield this._getAuthorizationHeader(),
262
267
  "X-Fern-Language": "JavaScript",
263
268
  "X-Fern-SDK-Name": "@trycourier/courier",
264
- "X-Fern-SDK-Version": "v6.2.2",
269
+ "X-Fern-SDK-Version": "v6.3.0",
265
270
  "X-Fern-Runtime": core.RUNTIME.type,
266
271
  "X-Fern-Runtime-Version": core.RUNTIME.version,
267
272
  },
@@ -324,7 +329,7 @@ class Tenants {
324
329
  Authorization: yield this._getAuthorizationHeader(),
325
330
  "X-Fern-Language": "JavaScript",
326
331
  "X-Fern-SDK-Name": "@trycourier/courier",
327
- "X-Fern-SDK-Version": "v6.2.2",
332
+ "X-Fern-SDK-Version": "v6.3.0",
328
333
  "X-Fern-Runtime": core.RUNTIME.type,
329
334
  "X-Fern-Runtime-Version": core.RUNTIME.version,
330
335
  },
@@ -385,7 +390,7 @@ class Tenants {
385
390
  Authorization: yield this._getAuthorizationHeader(),
386
391
  "X-Fern-Language": "JavaScript",
387
392
  "X-Fern-SDK-Name": "@trycourier/courier",
388
- "X-Fern-SDK-Version": "v6.2.2",
393
+ "X-Fern-SDK-Version": "v6.3.0",
389
394
  "X-Fern-Runtime": core.RUNTIME.type,
390
395
  "X-Fern-Runtime-Version": core.RUNTIME.version,
391
396
  },
@@ -436,7 +441,7 @@ class Tenants {
436
441
  Authorization: yield this._getAuthorizationHeader(),
437
442
  "X-Fern-Language": "JavaScript",
438
443
  "X-Fern-SDK-Name": "@trycourier/courier",
439
- "X-Fern-SDK-Version": "v6.2.2",
444
+ "X-Fern-SDK-Version": "v6.3.0",
440
445
  "X-Fern-Runtime": core.RUNTIME.type,
441
446
  "X-Fern-Runtime-Version": core.RUNTIME.version,
442
447
  },
@@ -8,7 +8,12 @@ import * as Courier from "../../../../index";
8
8
  * name: "string",
9
9
  * parent_tenant_id: "string",
10
10
  * default_preferences: {
11
- * items: [{}]
11
+ * items: [{
12
+ * id: "string",
13
+ * status: Courier.SubscriptionTopicStatus.OptedOut,
14
+ * has_custom_routing: undefined,
15
+ * custom_routing: undefined
16
+ * }]
12
17
  * },
13
18
  * properties: {
14
19
  * "string": {
@@ -70,7 +70,7 @@ class Translations {
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.2.2",
73
+ "X-Fern-SDK-Version": "v6.3.0",
74
74
  "X-Fern-Runtime": core.RUNTIME.type,
75
75
  "X-Fern-Runtime-Version": core.RUNTIME.version,
76
76
  },
@@ -130,7 +130,7 @@ class Translations {
130
130
  Authorization: yield this._getAuthorizationHeader(),
131
131
  "X-Fern-Language": "JavaScript",
132
132
  "X-Fern-SDK-Name": "@trycourier/courier",
133
- "X-Fern-SDK-Version": "v6.2.2",
133
+ "X-Fern-SDK-Version": "v6.3.0",
134
134
  "X-Fern-Runtime": core.RUNTIME.type,
135
135
  "X-Fern-Runtime-Version": core.RUNTIME.version,
136
136
  },
@@ -22,27 +22,33 @@ export declare class Preferences {
22
22
  * Fetch all user preferences.
23
23
  *
24
24
  * @param {string} userId - A unique identifier associated with the user whose preferences you wish to retrieve.
25
+ * @param {Courier.users.UserPreferencesParams} request
25
26
  * @param {Preferences.RequestOptions} requestOptions - Request-specific configuration.
26
27
  *
27
28
  * @throws {@link Courier.BadRequestError}
28
29
  *
29
30
  * @example
30
- * await courier.users.preferences.list("string")
31
+ * await courier.users.preferences.list("string", {
32
+ * tenant_id: "string"
33
+ * })
31
34
  */
32
- list(userId: string, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesListResponse>;
35
+ list(userId: string, request?: Courier.users.UserPreferencesParams, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesListResponse>;
33
36
  /**
34
37
  * Fetch user preferences for a specific subscription topic.
35
38
  *
36
39
  * @param {string} userId - A unique identifier associated with the user whose preferences you wish to retrieve.
37
40
  * @param {string} topicId - A unique identifier associated with a subscription topic.
41
+ * @param {Courier.users.UserPreferencesTopicParams} request
38
42
  * @param {Preferences.RequestOptions} requestOptions - Request-specific configuration.
39
43
  *
40
44
  * @throws {@link Courier.NotFoundError}
41
45
  *
42
46
  * @example
43
- * await courier.users.preferences.get("string", "string")
47
+ * await courier.users.preferences.get("string", "string", {
48
+ * tenant_id: "string"
49
+ * })
44
50
  */
45
- get(userId: string, topicId: string, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesGetResponse>;
51
+ get(userId: string, topicId: string, request?: Courier.users.UserPreferencesTopicParams, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesGetResponse>;
46
52
  /**
47
53
  * Update or Create user preferences for a specific subscription topic.
48
54
  *