@trycourier/courier 6.0.8 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.js +1 -1
- package/README.md +5 -5
- package/api/resources/audiences/client/Client.js +5 -5
- package/api/resources/auditEvents/client/Client.js +2 -2
- package/api/resources/authTokens/client/Client.js +1 -1
- package/api/resources/automations/client/Client.d.ts +15 -0
- package/api/resources/automations/client/Client.js +17 -2
- package/{dist/api/resources/lists/types/ListGetSubscriptionsParams.d.ts → api/resources/automations/types/AccessorType.d.ts} +2 -2
- package/api/resources/automations/types/AutomationAddToBatchMaxItemsType.d.ts +4 -0
- package/api/resources/automations/types/AutomationAddToBatchRetain.d.ts +34 -0
- package/api/resources/automations/types/AutomationAddToBatchRetainType.d.ts +10 -0
- package/api/resources/automations/types/AutomationAddToBatchRetainType.js +12 -0
- package/api/resources/automations/types/AutomationAddToBatchScope.d.ts +9 -0
- package/api/resources/automations/types/AutomationAddToBatchScope.js +11 -0
- package/api/resources/automations/types/AutomationAddToBatchStep.d.ts +39 -0
- package/api/resources/automations/types/AutomationAddToDigestStep.d.ts +16 -0
- package/api/resources/automations/types/AutomationDelayStep.d.ts +3 -0
- package/api/resources/automations/types/AutomationFetchDataStep.d.ts +31 -0
- package/api/resources/automations/types/AutomationFetchDataWebhook.d.ts +11 -0
- package/api/resources/automations/types/AutomationFetchDataWebhookMethod.d.ts +8 -0
- package/api/resources/automations/types/AutomationFetchDataWebhookMethod.js +10 -0
- package/api/resources/automations/types/AutomationStepOption.d.ts +1 -1
- package/api/resources/automations/types/AutomationThrottleOnThrottle.d.ts +7 -0
- package/api/resources/automations/types/AutomationThrottleScope.d.ts +9 -0
- package/api/resources/automations/types/AutomationThrottleScope.js +11 -0
- package/api/resources/automations/types/AutomationThrottleStep.d.ts +31 -0
- package/api/resources/automations/types/index.d.ts +13 -1
- package/api/resources/automations/types/index.js +13 -1
- package/api/resources/brands/client/Client.js +5 -5
- package/api/resources/bulk/client/Client.js +5 -5
- package/api/resources/lists/client/Client.d.ts +1 -1
- package/api/resources/lists/client/Client.js +11 -20
- package/api/resources/lists/client/requests/index.d.ts +0 -1
- package/api/resources/lists/types/index.d.ts +0 -5
- package/api/resources/lists/types/index.js +0 -5
- package/api/resources/messages/client/Client.js +42 -12
- package/api/resources/messages/client/requests/ListMessagesRequest.d.ts +23 -3
- package/api/resources/messages/types/MessageStatus.d.ts +4 -0
- package/api/resources/messages/types/MessageStatus.js +1 -0
- package/api/resources/notifications/client/Client.js +8 -8
- package/api/resources/profiles/client/Client.js +7 -7
- package/api/resources/send/types/BaseMessageSendTo.d.ts +8 -0
- package/api/resources/send/types/ContentMessage.d.ts +1 -3
- package/api/resources/send/types/Recipient.d.ts +1 -1
- package/api/resources/{lists/types/ListFindByRecipientIdParams.d.ts → send/types/RecipientData.d.ts} +1 -3
- package/api/resources/send/types/TemplateMessage.d.ts +1 -3
- package/api/resources/send/types/index.d.ts +2 -0
- package/api/resources/send/types/index.js +2 -0
- package/api/resources/templates/client/Client.js +1 -1
- package/api/resources/tenants/client/Client.d.ts +2 -2
- package/api/resources/tenants/client/Client.js +25 -7
- package/api/resources/tenants/client/requests/ListTenantParams.d.ts +14 -0
- package/api/resources/tenants/client/requests/ListUsersForTenantParams.d.ts +14 -0
- package/api/resources/tenants/client/requests/ListUsersForTenantParams.js +5 -0
- package/api/resources/tenants/client/requests/index.d.ts +2 -0
- package/api/resources/tenants/types/ListUsersForTenantResponse.d.ts +1 -1
- package/api/resources/translations/client/Client.js +2 -2
- package/api/resources/users/resources/preferences/client/Client.d.ts +9 -0
- package/api/resources/users/resources/preferences/client/Client.js +12 -3
- package/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +11 -5
- package/api/resources/users/resources/preferences/types/TopicPreferenceUpdate.d.ts +10 -0
- package/api/resources/users/resources/preferences/types/TopicPreferenceUpdate.js +5 -0
- package/api/resources/users/resources/preferences/types/index.d.ts +1 -0
- package/api/resources/users/resources/preferences/types/index.js +1 -0
- package/api/resources/users/resources/tenants/client/Client.js +8 -8
- package/api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.d.ts +2 -2
- package/api/resources/users/resources/tenants/types/ListTenantsForUserResponse.d.ts +1 -1
- package/api/resources/users/resources/tokens/client/Client.js +5 -5
- package/core/fetcher/Fetcher.js +3 -5
- package/dist/Client.js +1 -1
- package/dist/api/resources/audiences/client/Client.js +5 -5
- package/dist/api/resources/auditEvents/client/Client.js +2 -2
- package/dist/api/resources/authTokens/client/Client.js +1 -1
- package/dist/api/resources/automations/client/Client.d.ts +15 -0
- package/dist/api/resources/automations/client/Client.js +17 -2
- package/{api/resources/lists/types/ListGetSubscriptionsParams.d.ts → dist/api/resources/automations/types/AccessorType.d.ts} +2 -2
- package/dist/api/resources/automations/types/AccessorType.js +5 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchMaxItemsType.d.ts +4 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchMaxItemsType.js +5 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchRetain.d.ts +34 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchRetain.js +5 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchRetainType.d.ts +10 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchRetainType.js +12 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchScope.d.ts +9 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchScope.js +11 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchStep.d.ts +39 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchStep.js +5 -0
- package/dist/api/resources/automations/types/AutomationAddToDigestStep.d.ts +16 -0
- package/dist/api/resources/automations/types/AutomationAddToDigestStep.js +5 -0
- package/dist/api/resources/automations/types/AutomationDelayStep.d.ts +3 -0
- package/dist/api/resources/automations/types/AutomationFetchDataStep.d.ts +31 -0
- package/dist/api/resources/automations/types/AutomationFetchDataStep.js +5 -0
- package/dist/api/resources/automations/types/AutomationFetchDataWebhook.d.ts +11 -0
- package/dist/api/resources/automations/types/AutomationFetchDataWebhook.js +5 -0
- package/dist/api/resources/automations/types/AutomationFetchDataWebhookMethod.d.ts +8 -0
- package/dist/api/resources/automations/types/AutomationFetchDataWebhookMethod.js +10 -0
- package/dist/api/resources/automations/types/AutomationStepOption.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationThrottleOnThrottle.d.ts +7 -0
- package/dist/api/resources/automations/types/AutomationThrottleOnThrottle.js +5 -0
- package/dist/api/resources/automations/types/AutomationThrottleScope.d.ts +9 -0
- package/dist/api/resources/automations/types/AutomationThrottleScope.js +11 -0
- package/dist/api/resources/automations/types/AutomationThrottleStep.d.ts +31 -0
- package/dist/api/resources/automations/types/AutomationThrottleStep.js +5 -0
- package/dist/api/resources/automations/types/index.d.ts +13 -1
- package/dist/api/resources/automations/types/index.js +13 -1
- package/dist/api/resources/brands/client/Client.js +5 -5
- package/dist/api/resources/bulk/client/Client.js +5 -5
- package/dist/api/resources/lists/client/Client.d.ts +1 -1
- package/dist/api/resources/lists/client/Client.js +11 -20
- package/dist/api/resources/lists/client/requests/index.d.ts +0 -1
- package/dist/api/resources/lists/types/index.d.ts +0 -5
- package/dist/api/resources/lists/types/index.js +0 -5
- package/dist/api/resources/messages/client/Client.js +42 -12
- package/dist/api/resources/messages/client/requests/ListMessagesRequest.d.ts +23 -3
- package/dist/api/resources/messages/types/MessageStatus.d.ts +4 -0
- package/dist/api/resources/messages/types/MessageStatus.js +1 -0
- package/dist/api/resources/notifications/client/Client.js +8 -8
- package/dist/api/resources/profiles/client/Client.js +7 -7
- package/dist/api/resources/send/types/BaseMessageSendTo.d.ts +8 -0
- package/dist/api/resources/send/types/BaseMessageSendTo.js +5 -0
- package/dist/api/resources/send/types/ContentMessage.d.ts +1 -3
- package/dist/api/resources/send/types/Recipient.d.ts +1 -1
- package/dist/api/resources/{lists/types/ListFindByRecipientIdParams.d.ts → send/types/RecipientData.d.ts} +1 -3
- package/dist/api/resources/send/types/RecipientData.js +5 -0
- package/dist/api/resources/send/types/TemplateMessage.d.ts +1 -3
- package/dist/api/resources/send/types/index.d.ts +2 -0
- package/dist/api/resources/send/types/index.js +2 -0
- package/dist/api/resources/templates/client/Client.js +1 -1
- package/dist/api/resources/tenants/client/Client.d.ts +2 -2
- package/dist/api/resources/tenants/client/Client.js +25 -7
- package/dist/api/resources/tenants/client/requests/ListTenantParams.d.ts +14 -0
- package/dist/api/resources/tenants/client/requests/ListTenantParams.js +5 -0
- package/dist/api/resources/tenants/client/requests/ListUsersForTenantParams.d.ts +14 -0
- package/dist/api/resources/tenants/client/requests/ListUsersForTenantParams.js +5 -0
- package/dist/api/resources/tenants/client/requests/index.d.ts +2 -0
- package/dist/api/resources/tenants/types/ListUsersForTenantResponse.d.ts +1 -1
- package/dist/api/resources/translations/client/Client.js +2 -2
- package/dist/api/resources/users/resources/preferences/client/Client.d.ts +9 -0
- package/dist/api/resources/users/resources/preferences/client/Client.js +12 -3
- package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +11 -5
- package/dist/api/resources/users/resources/preferences/types/TopicPreferenceUpdate.d.ts +10 -0
- package/dist/api/resources/users/resources/preferences/types/TopicPreferenceUpdate.js +5 -0
- package/dist/api/resources/users/resources/preferences/types/index.d.ts +1 -0
- package/dist/api/resources/users/resources/preferences/types/index.js +1 -0
- package/dist/api/resources/users/resources/tenants/client/Client.js +8 -8
- package/dist/api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.d.ts +2 -2
- package/dist/api/resources/users/resources/tenants/types/ListTenantsForUserResponse.d.ts +1 -1
- package/dist/api/resources/users/resources/tokens/client/Client.js +5 -5
- package/dist/core/fetcher/Fetcher.js +3 -5
- package/jest.config.js +5 -0
- package/package.json +6 -2
- package/tests/client.test.ts +11 -0
- package/api/resources/automations/types/AutomationStepAction.d.ts +0 -12
- package/api/resources/automations/types/AutomationStepAction.js +0 -14
- package/api/resources/lists/client/requests/GetListRequest.d.ts +0 -13
- package/api/resources/lists/types/ListFindByRecipientIdResponse.d.ts +0 -8
- package/api/resources/lists/types/ListGetAllParams.d.ts +0 -7
- package/api/resources/lists/types/RecipientSubscriptionsResponse.d.ts +0 -8
- package/dist/api/resources/automations/types/AutomationStepAction.d.ts +0 -12
- package/dist/api/resources/automations/types/AutomationStepAction.js +0 -14
- package/dist/api/resources/lists/client/requests/GetListRequest.d.ts +0 -13
- package/dist/api/resources/lists/types/ListFindByRecipientIdResponse.d.ts +0 -8
- package/dist/api/resources/lists/types/ListGetAllParams.d.ts +0 -7
- package/dist/api/resources/lists/types/RecipientSubscriptionsResponse.d.ts +0 -8
- /package/api/resources/{lists/client/requests/GetListRequest.js → automations/types/AccessorType.js} +0 -0
- /package/api/resources/{lists/types/ListFindByRecipientIdParams.js → automations/types/AutomationAddToBatchMaxItemsType.js} +0 -0
- /package/api/resources/{lists/types/ListFindByRecipientIdResponse.js → automations/types/AutomationAddToBatchRetain.js} +0 -0
- /package/api/resources/{lists/types/ListGetAllParams.js → automations/types/AutomationAddToBatchStep.js} +0 -0
- /package/api/resources/{lists/types/ListGetSubscriptionsParams.js → automations/types/AutomationAddToDigestStep.js} +0 -0
- /package/api/resources/{lists/types/RecipientSubscriptionsResponse.js → automations/types/AutomationFetchDataStep.js} +0 -0
- /package/{dist/api/resources/lists/client/requests/GetListRequest.js → api/resources/automations/types/AutomationFetchDataWebhook.js} +0 -0
- /package/{dist/api/resources/lists/types/ListFindByRecipientIdParams.js → api/resources/automations/types/AutomationThrottleOnThrottle.js} +0 -0
- /package/{dist/api/resources/lists/types/ListFindByRecipientIdResponse.js → api/resources/automations/types/AutomationThrottleStep.js} +0 -0
- /package/{dist/api/resources/lists/types/ListGetAllParams.js → api/resources/send/types/BaseMessageSendTo.js} +0 -0
- /package/{dist/api/resources/lists/types/ListGetSubscriptionsParams.js → api/resources/send/types/RecipientData.js} +0 -0
- /package/{dist/api/resources/lists/types/RecipientSubscriptionsResponse.js → api/resources/tenants/client/requests/ListTenantParams.js} +0 -0
|
@@ -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);
|
|
@@ -54,7 +54,7 @@ class Messages {
|
|
|
54
54
|
list(request = {}, requestOptions) {
|
|
55
55
|
var _a, _b;
|
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
const { archived, cursor, event, list, messageId, notification, recipient, status, tags, enqueued_after: enqueuedAfter, traceId, } = request;
|
|
57
|
+
const { archived, cursor, event, list, message_id: messageId, messageId: messageId_, notification, provider, recipient, status, tag, tags, tenant_id: tenantId, enqueued_after: enqueuedAfter, trace_id: traceId, traceId: traceId_, } = request;
|
|
58
58
|
const _queryParams = {};
|
|
59
59
|
if (archived != null) {
|
|
60
60
|
_queryParams["archived"] = archived.toString();
|
|
@@ -68,26 +68,56 @@ class Messages {
|
|
|
68
68
|
if (list != null) {
|
|
69
69
|
_queryParams["list"] = list;
|
|
70
70
|
}
|
|
71
|
-
if (
|
|
72
|
-
_queryParams["
|
|
71
|
+
if (messageId_ != null) {
|
|
72
|
+
_queryParams["message_id"] = messageId_;
|
|
73
|
+
}
|
|
74
|
+
if (messageId_ != null) {
|
|
75
|
+
_queryParams["messageId"] = messageId_;
|
|
73
76
|
}
|
|
74
77
|
if (notification != null) {
|
|
75
78
|
_queryParams["notification"] = notification;
|
|
76
79
|
}
|
|
80
|
+
if (provider != null) {
|
|
81
|
+
if (Array.isArray(provider)) {
|
|
82
|
+
_queryParams["provider"] = provider.map((item) => item);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
_queryParams["provider"] = provider;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
77
88
|
if (recipient != null) {
|
|
78
89
|
_queryParams["recipient"] = recipient;
|
|
79
90
|
}
|
|
80
91
|
if (status != null) {
|
|
81
|
-
|
|
92
|
+
if (Array.isArray(status)) {
|
|
93
|
+
_queryParams["status"] = status.map((item) => item);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
_queryParams["status"] = status;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (tag != null) {
|
|
100
|
+
if (Array.isArray(tag)) {
|
|
101
|
+
_queryParams["tag"] = tag.map((item) => item);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
_queryParams["tag"] = tag;
|
|
105
|
+
}
|
|
82
106
|
}
|
|
83
107
|
if (tags != null) {
|
|
84
108
|
_queryParams["tags"] = tags;
|
|
85
109
|
}
|
|
110
|
+
if (tenantId != null) {
|
|
111
|
+
_queryParams["tenant_id"] = tenantId;
|
|
112
|
+
}
|
|
86
113
|
if (enqueuedAfter != null) {
|
|
87
114
|
_queryParams["enqueued_after"] = enqueuedAfter;
|
|
88
115
|
}
|
|
89
|
-
if (
|
|
90
|
-
_queryParams["
|
|
116
|
+
if (traceId_ != null) {
|
|
117
|
+
_queryParams["trace_id"] = traceId_;
|
|
118
|
+
}
|
|
119
|
+
if (traceId_ != null) {
|
|
120
|
+
_queryParams["traceId"] = traceId_;
|
|
91
121
|
}
|
|
92
122
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
93
123
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "messages"),
|
|
@@ -96,7 +126,7 @@ class Messages {
|
|
|
96
126
|
Authorization: yield this._getAuthorizationHeader(),
|
|
97
127
|
"X-Fern-Language": "JavaScript",
|
|
98
128
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
99
|
-
"X-Fern-SDK-Version": "v6.
|
|
129
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
100
130
|
},
|
|
101
131
|
contentType: "application/json",
|
|
102
132
|
queryParameters: _queryParams,
|
|
@@ -142,7 +172,7 @@ class Messages {
|
|
|
142
172
|
Authorization: yield this._getAuthorizationHeader(),
|
|
143
173
|
"X-Fern-Language": "JavaScript",
|
|
144
174
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
145
|
-
"X-Fern-SDK-Version": "v6.
|
|
175
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
146
176
|
},
|
|
147
177
|
contentType: "application/json",
|
|
148
178
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -192,7 +222,7 @@ class Messages {
|
|
|
192
222
|
Authorization: yield this._getAuthorizationHeader(),
|
|
193
223
|
"X-Fern-Language": "JavaScript",
|
|
194
224
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
195
|
-
"X-Fern-SDK-Version": "v6.
|
|
225
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
196
226
|
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
197
227
|
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null
|
|
198
228
|
? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry.toString()
|
|
@@ -246,7 +276,7 @@ class Messages {
|
|
|
246
276
|
Authorization: yield this._getAuthorizationHeader(),
|
|
247
277
|
"X-Fern-Language": "JavaScript",
|
|
248
278
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
249
|
-
"X-Fern-SDK-Version": "v6.
|
|
279
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
250
280
|
},
|
|
251
281
|
contentType: "application/json",
|
|
252
282
|
queryParameters: _queryParams,
|
|
@@ -298,7 +328,7 @@ class Messages {
|
|
|
298
328
|
Authorization: yield this._getAuthorizationHeader(),
|
|
299
329
|
"X-Fern-Language": "JavaScript",
|
|
300
330
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
301
|
-
"X-Fern-SDK-Version": "v6.
|
|
331
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
302
332
|
},
|
|
303
333
|
contentType: "application/json",
|
|
304
334
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -345,7 +375,7 @@ class Messages {
|
|
|
345
375
|
Authorization: yield this._getAuthorizationHeader(),
|
|
346
376
|
"X-Fern-Language": "JavaScript",
|
|
347
377
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
348
|
-
"X-Fern-SDK-Version": "v6.
|
|
378
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
349
379
|
},
|
|
350
380
|
contentType: "application/json",
|
|
351
381
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -7,7 +7,7 @@ export interface ListMessagesRequest {
|
|
|
7
7
|
*/
|
|
8
8
|
archived?: boolean;
|
|
9
9
|
/**
|
|
10
|
-
* A unique identifier that allows for fetching the next set of
|
|
10
|
+
* A unique identifier that allows for fetching the next set of messages.
|
|
11
11
|
*/
|
|
12
12
|
cursor?: string;
|
|
13
13
|
/**
|
|
@@ -18,6 +18,10 @@ export interface ListMessagesRequest {
|
|
|
18
18
|
* A unique identifier representing the list the message was sent to.
|
|
19
19
|
*/
|
|
20
20
|
list?: string;
|
|
21
|
+
/**
|
|
22
|
+
* A unique identifier representing the message_id returned from either /send or /send/list.
|
|
23
|
+
*/
|
|
24
|
+
message_id?: string;
|
|
21
25
|
/**
|
|
22
26
|
* A unique identifier representing the message_id returned from either /send or /send/list.
|
|
23
27
|
*/
|
|
@@ -26,22 +30,38 @@ export interface ListMessagesRequest {
|
|
|
26
30
|
* A unique identifier representing the notification that was used to send the event.
|
|
27
31
|
*/
|
|
28
32
|
notification?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The key assocated to the provider you want to filter on. E.g., sendgrid, inbox, twilio, slack, msteams, etc. Allows multiple values to be set in query parameters.
|
|
35
|
+
*/
|
|
36
|
+
provider?: string | string[];
|
|
29
37
|
/**
|
|
30
38
|
* A unique identifier representing the recipient associated with the requested profile.
|
|
31
39
|
*/
|
|
32
40
|
recipient?: string;
|
|
33
41
|
/**
|
|
34
|
-
* An indicator of the current status of the message.
|
|
42
|
+
* An indicator of the current status of the message. Allows multiple values to be set in query parameters.
|
|
43
|
+
*/
|
|
44
|
+
status?: string | string[];
|
|
45
|
+
/**
|
|
46
|
+
* A tag placed in the metadata.tags during a notification send. Allows multiple values to be set in query parameters.
|
|
35
47
|
*/
|
|
36
|
-
|
|
48
|
+
tag?: string | string[];
|
|
37
49
|
/**
|
|
38
50
|
* A comma delimited list of 'tags'. Messages will be returned if they match any of the tags passed in.
|
|
39
51
|
*/
|
|
40
52
|
tags?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Messages sent with the context of a Tenant
|
|
55
|
+
*/
|
|
56
|
+
tenant_id?: string;
|
|
41
57
|
/**
|
|
42
58
|
* The enqueued datetime of a message to filter out messages received before.
|
|
43
59
|
*/
|
|
44
60
|
enqueued_after?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The unique identifier used to trace the requests
|
|
63
|
+
*/
|
|
64
|
+
trace_id?: string;
|
|
45
65
|
/**
|
|
46
66
|
* The unique identifier used to trace the requests
|
|
47
67
|
*/
|
|
@@ -20,6 +20,9 @@ export declare type MessageStatus =
|
|
|
20
20
|
/**
|
|
21
21
|
* The message has been accepted by the provider. */
|
|
22
22
|
| "SENT"
|
|
23
|
+
/**
|
|
24
|
+
* The message was throttled by Courier. */
|
|
25
|
+
| "THROTTLED"
|
|
23
26
|
/**
|
|
24
27
|
* The message could not be delivered to at least one provider, or the provider could not deliver the message to the recipient. This can happen for multiple reasons: an error, insufficient profile data, invalid notification setup, invalid integration configuration, etc. */
|
|
25
28
|
| "UNDELIVERABLE"
|
|
@@ -36,6 +39,7 @@ export declare const MessageStatus: {
|
|
|
36
39
|
readonly Opened: "OPENED";
|
|
37
40
|
readonly Canceled: "CANCELED";
|
|
38
41
|
readonly Sent: "SENT";
|
|
42
|
+
readonly Throttled: "THROTTLED";
|
|
39
43
|
readonly Undeliverable: "UNDELIVERABLE";
|
|
40
44
|
readonly Unmapped: "UNMAPPED";
|
|
41
45
|
readonly Unroutable: "UNROUTABLE";
|
|
@@ -62,7 +62,7 @@ class Notifications {
|
|
|
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.
|
|
65
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
66
66
|
},
|
|
67
67
|
contentType: "application/json",
|
|
68
68
|
queryParameters: _queryParams,
|
|
@@ -103,7 +103,7 @@ class Notifications {
|
|
|
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.
|
|
106
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
107
107
|
},
|
|
108
108
|
contentType: "application/json",
|
|
109
109
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -143,7 +143,7 @@ class Notifications {
|
|
|
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.
|
|
146
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
147
147
|
},
|
|
148
148
|
contentType: "application/json",
|
|
149
149
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -183,7 +183,7 @@ class Notifications {
|
|
|
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.
|
|
186
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
187
187
|
},
|
|
188
188
|
contentType: "application/json",
|
|
189
189
|
body: request,
|
|
@@ -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.
|
|
227
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
228
228
|
},
|
|
229
229
|
contentType: "application/json",
|
|
230
230
|
body: request,
|
|
@@ -265,7 +265,7 @@ class Notifications {
|
|
|
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.
|
|
268
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
269
269
|
},
|
|
270
270
|
contentType: "application/json",
|
|
271
271
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -305,7 +305,7 @@ class Notifications {
|
|
|
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.
|
|
308
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
309
309
|
},
|
|
310
310
|
contentType: "application/json",
|
|
311
311
|
body: request,
|
|
@@ -346,7 +346,7 @@ class Notifications {
|
|
|
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.
|
|
349
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
350
350
|
},
|
|
351
351
|
contentType: "application/json",
|
|
352
352
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -62,7 +62,7 @@ class Profiles {
|
|
|
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.
|
|
65
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
66
66
|
},
|
|
67
67
|
contentType: "application/json",
|
|
68
68
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -111,7 +111,7 @@ class Profiles {
|
|
|
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.
|
|
114
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
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()
|
|
@@ -168,7 +168,7 @@ class Profiles {
|
|
|
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.
|
|
171
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
172
172
|
},
|
|
173
173
|
contentType: "application/json",
|
|
174
174
|
body: request,
|
|
@@ -218,7 +218,7 @@ class Profiles {
|
|
|
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.
|
|
221
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
222
222
|
},
|
|
223
223
|
contentType: "application/json",
|
|
224
224
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -272,7 +272,7 @@ class Profiles {
|
|
|
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.
|
|
275
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
276
276
|
},
|
|
277
277
|
contentType: "application/json",
|
|
278
278
|
queryParameters: _queryParams,
|
|
@@ -322,7 +322,7 @@ class Profiles {
|
|
|
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.
|
|
325
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
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()
|
|
@@ -376,7 +376,7 @@ class Profiles {
|
|
|
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.
|
|
379
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
380
380
|
},
|
|
381
381
|
contentType: "application/json",
|
|
382
382
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -6,12 +6,10 @@ import * as Courier from "../../..";
|
|
|
6
6
|
* The message property has the following primary top-level properties. They define the destination and content of the message.
|
|
7
7
|
* Additional advanced configuration fields [are defined below](https://www.courier.com/docs/reference/send/message/#other-message-properties).
|
|
8
8
|
*/
|
|
9
|
-
export interface ContentMessage extends Courier.BaseMessage {
|
|
9
|
+
export interface ContentMessage extends Courier.BaseMessage, Courier.BaseMessageSendTo {
|
|
10
10
|
/**
|
|
11
11
|
* Describes the content of the message in a way that will work for email, push,
|
|
12
12
|
* chat, or any channel. Either this or template must be specified.
|
|
13
13
|
*/
|
|
14
14
|
content: Courier.Content;
|
|
15
|
-
/** The recipient or a list of recipients of the message */
|
|
16
|
-
to: Courier.MessageRecipient;
|
|
17
15
|
}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Courier from "../../..";
|
|
5
|
-
export declare type Recipient = Courier.AudienceRecipient | Courier.ListRecipient | Courier.ListPatternRecipient | Courier.UserRecipient | Courier.SlackRecipient | Courier.MsTeamsRecipient;
|
|
5
|
+
export declare type Recipient = Courier.AudienceRecipient | Courier.ListRecipient | Courier.ListPatternRecipient | Courier.UserRecipient | Courier.SlackRecipient | Courier.MsTeamsRecipient | Courier.RecipientData;
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Courier from "../../..";
|
|
5
|
-
export interface TemplateMessage extends Courier.BaseMessage {
|
|
5
|
+
export interface TemplateMessage extends Courier.BaseMessage, Courier.BaseMessageSendTo {
|
|
6
6
|
/**
|
|
7
7
|
* The id of the notification template to be rendered and sent to the recipient(s).
|
|
8
8
|
* This field or the content field must be supplied.
|
|
9
9
|
*/
|
|
10
10
|
template: string;
|
|
11
|
-
/** The recipient or a list of recipients of the message */
|
|
12
|
-
to: Courier.MessageRecipient;
|
|
13
11
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./Message";
|
|
2
2
|
export * from "./TemplateMessage";
|
|
3
3
|
export * from "./ContentMessage";
|
|
4
|
+
export * from "./BaseMessageSendTo";
|
|
4
5
|
export * from "./BaseMessage";
|
|
5
6
|
export * from "./MessageRecipient";
|
|
6
7
|
export * from "./Recipient";
|
|
@@ -17,6 +18,7 @@ export * from "./InvalidUserRecipient";
|
|
|
17
18
|
export * from "./UserRecipientType";
|
|
18
19
|
export * from "./UserRecipient";
|
|
19
20
|
export * from "./MessageData";
|
|
21
|
+
export * from "./RecipientData";
|
|
20
22
|
export * from "./AudienceFilter";
|
|
21
23
|
export * from "./MessageContext";
|
|
22
24
|
export * from "./ListFilter";
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./Message"), exports);
|
|
18
18
|
__exportStar(require("./TemplateMessage"), exports);
|
|
19
19
|
__exportStar(require("./ContentMessage"), exports);
|
|
20
|
+
__exportStar(require("./BaseMessageSendTo"), exports);
|
|
20
21
|
__exportStar(require("./BaseMessage"), exports);
|
|
21
22
|
__exportStar(require("./MessageRecipient"), exports);
|
|
22
23
|
__exportStar(require("./Recipient"), exports);
|
|
@@ -33,6 +34,7 @@ __exportStar(require("./InvalidUserRecipient"), exports);
|
|
|
33
34
|
__exportStar(require("./UserRecipientType"), exports);
|
|
34
35
|
__exportStar(require("./UserRecipient"), exports);
|
|
35
36
|
__exportStar(require("./MessageData"), exports);
|
|
37
|
+
__exportStar(require("./RecipientData"), exports);
|
|
36
38
|
__exportStar(require("./AudienceFilter"), exports);
|
|
37
39
|
__exportStar(require("./MessageContext"), exports);
|
|
38
40
|
__exportStar(require("./ListFilter"), exports);
|
|
@@ -65,7 +65,7 @@ class Templates {
|
|
|
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.
|
|
68
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
69
69
|
},
|
|
70
70
|
contentType: "application/json",
|
|
71
71
|
queryParameters: _queryParams,
|
|
@@ -26,11 +26,11 @@ export declare class Tenants {
|
|
|
26
26
|
* @throws {@link Courier.BadRequestError}
|
|
27
27
|
*/
|
|
28
28
|
get(tenantId: string, requestOptions?: Tenants.RequestOptions): Promise<Courier.Tenant>;
|
|
29
|
-
list(requestOptions?: Tenants.RequestOptions): Promise<Courier.TenantListResponse>;
|
|
29
|
+
list(request?: Courier.ListTenantParams, requestOptions?: Tenants.RequestOptions): Promise<Courier.TenantListResponse>;
|
|
30
30
|
delete(tenantId: string, requestOptions?: Tenants.RequestOptions): Promise<void>;
|
|
31
31
|
/**
|
|
32
32
|
* @throws {@link Courier.BadRequestError}
|
|
33
33
|
*/
|
|
34
|
-
getUsersByTenant(tenantId: string, requestOptions?: Tenants.RequestOptions): Promise<Courier.ListUsersForTenantResponse>;
|
|
34
|
+
getUsersByTenant(tenantId: string, request?: Courier.ListUsersForTenantParams, requestOptions?: Tenants.RequestOptions): Promise<Courier.ListUsersForTenantResponse>;
|
|
35
35
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
36
36
|
}
|
|
@@ -61,7 +61,7 @@ class Tenants {
|
|
|
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.
|
|
64
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
65
65
|
},
|
|
66
66
|
contentType: "application/json",
|
|
67
67
|
body: request,
|
|
@@ -110,7 +110,7 @@ class Tenants {
|
|
|
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.
|
|
113
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
114
114
|
},
|
|
115
115
|
contentType: "application/json",
|
|
116
116
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -145,9 +145,17 @@ class Tenants {
|
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
list(requestOptions) {
|
|
148
|
+
list(request = {}, requestOptions) {
|
|
149
149
|
var _a, _b;
|
|
150
150
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
const { limit, cursor } = request;
|
|
152
|
+
const _queryParams = {};
|
|
153
|
+
if (limit != null) {
|
|
154
|
+
_queryParams["limit"] = limit.toString();
|
|
155
|
+
}
|
|
156
|
+
if (cursor != null) {
|
|
157
|
+
_queryParams["cursor"] = cursor;
|
|
158
|
+
}
|
|
151
159
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
152
160
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, "/tenants"),
|
|
153
161
|
method: "GET",
|
|
@@ -155,9 +163,10 @@ class Tenants {
|
|
|
155
163
|
Authorization: yield this._getAuthorizationHeader(),
|
|
156
164
|
"X-Fern-Language": "JavaScript",
|
|
157
165
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
158
|
-
"X-Fern-SDK-Version": "v6.
|
|
166
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
159
167
|
},
|
|
160
168
|
contentType: "application/json",
|
|
169
|
+
queryParameters: _queryParams,
|
|
161
170
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
162
171
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
163
172
|
});
|
|
@@ -195,7 +204,7 @@ class Tenants {
|
|
|
195
204
|
Authorization: yield this._getAuthorizationHeader(),
|
|
196
205
|
"X-Fern-Language": "JavaScript",
|
|
197
206
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
198
|
-
"X-Fern-SDK-Version": "v6.
|
|
207
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
199
208
|
},
|
|
200
209
|
contentType: "application/json",
|
|
201
210
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -228,9 +237,17 @@ class Tenants {
|
|
|
228
237
|
/**
|
|
229
238
|
* @throws {@link Courier.BadRequestError}
|
|
230
239
|
*/
|
|
231
|
-
getUsersByTenant(tenantId, requestOptions) {
|
|
240
|
+
getUsersByTenant(tenantId, request = {}, requestOptions) {
|
|
232
241
|
var _a, _b;
|
|
233
242
|
return __awaiter(this, void 0, void 0, function* () {
|
|
243
|
+
const { limit, cursor } = request;
|
|
244
|
+
const _queryParams = {};
|
|
245
|
+
if (limit != null) {
|
|
246
|
+
_queryParams["limit"] = limit.toString();
|
|
247
|
+
}
|
|
248
|
+
if (cursor != null) {
|
|
249
|
+
_queryParams["cursor"] = cursor;
|
|
250
|
+
}
|
|
234
251
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
235
252
|
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
253
|
method: "GET",
|
|
@@ -238,9 +255,10 @@ class Tenants {
|
|
|
238
255
|
Authorization: yield this._getAuthorizationHeader(),
|
|
239
256
|
"X-Fern-Language": "JavaScript",
|
|
240
257
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
241
|
-
"X-Fern-SDK-Version": "v6.
|
|
258
|
+
"X-Fern-SDK-Version": "v6.1.1",
|
|
242
259
|
},
|
|
243
260
|
contentType: "application/json",
|
|
261
|
+
queryParameters: _queryParams,
|
|
244
262
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
245
263
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
246
264
|
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface ListTenantParams {
|
|
5
|
+
/**
|
|
6
|
+
* The number of accousnts to return
|
|
7
|
+
* (defaults to 20, maximum value of 100)
|
|
8
|
+
*/
|
|
9
|
+
limit?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Continue the pagination with the next cursor
|
|
12
|
+
*/
|
|
13
|
+
cursor?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface ListUsersForTenantParams {
|
|
5
|
+
/**
|
|
6
|
+
* The number of accounts to return
|
|
7
|
+
* (defaults to 20, maximum value of 100)
|
|
8
|
+
*/
|
|
9
|
+
limit?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Continue the pagination with the next cursor
|
|
12
|
+
*/
|
|
13
|
+
cursor?: string;
|
|
14
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as Courier from "../../..";
|
|
5
5
|
export interface ListUsersForTenantResponse {
|
|
6
|
-
items?: Courier.UserTenantAssociation;
|
|
6
|
+
items?: Courier.UserTenantAssociation[];
|
|
7
7
|
/** Set to true when there are more pages that can be retrieved. */
|
|
8
8
|
has_more: boolean;
|
|
9
9
|
/** A url that may be used to generate these results. */
|