agentmail 0.0.50 → 0.0.51
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/README.md +13 -2
- package/dist/cjs/Client.d.ts +2 -0
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/domains/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/domains/client/Client.js +16 -9
- package/dist/cjs/api/resources/drafts/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/drafts/client/Client.js +8 -5
- package/dist/cjs/api/resources/inboxes/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/client/Client.js +12 -7
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +20 -11
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +28 -15
- package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.js +4 -3
- package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +12 -7
- package/dist/cjs/api/resources/metrics/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/metrics/client/Client.js +4 -3
- package/dist/cjs/api/resources/threads/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/threads/client/Client.js +12 -7
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/webhooks/client/Client.js +16 -9
- package/dist/cjs/core/auth/AuthProvider.d.ts +4 -0
- package/dist/cjs/core/auth/AuthProvider.js +2 -0
- package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
- package/dist/cjs/core/auth/AuthRequest.js +2 -0
- package/dist/cjs/core/auth/index.d.ts +2 -0
- package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -1
- package/dist/cjs/core/fetcher/Fetcher.js +2 -2
- package/dist/cjs/core/fetcher/index.d.ts +5 -5
- package/dist/cjs/core/fetcher/index.js +5 -5
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +2 -0
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/domains/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/domains/client/Client.mjs +16 -9
- package/dist/esm/api/resources/drafts/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/drafts/client/Client.mjs +8 -5
- package/dist/esm/api/resources/inboxes/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/client/Client.mjs +12 -7
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +20 -11
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +28 -15
- package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.mjs +4 -3
- package/dist/esm/api/resources/inboxes/resources/threads/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +12 -7
- package/dist/esm/api/resources/metrics/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/metrics/client/Client.mjs +4 -3
- package/dist/esm/api/resources/threads/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/threads/client/Client.mjs +12 -7
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/webhooks/client/Client.mjs +16 -9
- package/dist/esm/core/auth/AuthProvider.d.mts +4 -0
- package/dist/esm/core/auth/AuthProvider.mjs +1 -0
- package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
- package/dist/esm/core/auth/AuthRequest.mjs +1 -0
- package/dist/esm/core/auth/index.d.mts +2 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +1 -1
- package/dist/esm/core/fetcher/Fetcher.mjs +2 -2
- package/dist/esm/core/fetcher/index.d.mts +5 -5
- package/dist/esm/core/fetcher/index.mjs +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -50,11 +50,12 @@ export class Messages {
|
|
|
50
50
|
if (ascending != null) {
|
|
51
51
|
_queryParams["ascending"] = ascending.toString();
|
|
52
52
|
}
|
|
53
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
53
54
|
const _response = yield core.fetcher({
|
|
54
|
-
url: core.url.join((
|
|
55
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${encodeURIComponent(inboxId)}/messages`),
|
|
55
56
|
method: "GET",
|
|
56
|
-
headers:
|
|
57
|
-
queryParameters: _queryParams,
|
|
57
|
+
headers: _headers,
|
|
58
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
58
59
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
59
60
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
60
61
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -107,10 +108,12 @@ export class Messages {
|
|
|
107
108
|
__get(inboxId, messageId, requestOptions) {
|
|
108
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
110
|
var _a, _b, _c;
|
|
111
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
110
112
|
const _response = yield core.fetcher({
|
|
111
|
-
url: core.url.join((
|
|
113
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${encodeURIComponent(inboxId)}/messages/${encodeURIComponent(messageId)}`),
|
|
112
114
|
method: "GET",
|
|
113
|
-
headers:
|
|
115
|
+
headers: _headers,
|
|
116
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
114
117
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
115
118
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
116
119
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -156,10 +159,12 @@ export class Messages {
|
|
|
156
159
|
__getAttachment(inboxId, messageId, attachmentId, requestOptions) {
|
|
157
160
|
return __awaiter(this, void 0, void 0, function* () {
|
|
158
161
|
var _a, _b, _c;
|
|
162
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
159
163
|
const _response = yield core.fetcher({
|
|
160
|
-
url: core.url.join((
|
|
164
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${encodeURIComponent(inboxId)}/messages/${encodeURIComponent(messageId)}/attachments/${encodeURIComponent(attachmentId)}`),
|
|
161
165
|
method: "GET",
|
|
162
|
-
headers:
|
|
166
|
+
headers: _headers,
|
|
167
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
163
168
|
responseType: "binary-response",
|
|
164
169
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
165
170
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -206,10 +211,12 @@ export class Messages {
|
|
|
206
211
|
__getRaw(inboxId, messageId, requestOptions) {
|
|
207
212
|
return __awaiter(this, void 0, void 0, function* () {
|
|
208
213
|
var _a, _b, _c;
|
|
214
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
209
215
|
const _response = yield core.fetcher({
|
|
210
|
-
url: core.url.join((
|
|
216
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${encodeURIComponent(inboxId)}/messages/${encodeURIComponent(messageId)}/raw`),
|
|
211
217
|
method: "GET",
|
|
212
|
-
headers:
|
|
218
|
+
headers: _headers,
|
|
219
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
213
220
|
responseType: "binary-response",
|
|
214
221
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
215
222
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -275,11 +282,13 @@ export class Messages {
|
|
|
275
282
|
__send(inboxId, request, requestOptions) {
|
|
276
283
|
return __awaiter(this, void 0, void 0, function* () {
|
|
277
284
|
var _a, _b, _c;
|
|
285
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
278
286
|
const _response = yield core.fetcher({
|
|
279
|
-
url: core.url.join((
|
|
287
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${encodeURIComponent(inboxId)}/messages/send`),
|
|
280
288
|
method: "POST",
|
|
281
|
-
headers:
|
|
289
|
+
headers: _headers,
|
|
282
290
|
contentType: "application/json",
|
|
291
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
283
292
|
requestType: "json",
|
|
284
293
|
body: request,
|
|
285
294
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -350,11 +359,13 @@ export class Messages {
|
|
|
350
359
|
__reply(inboxId, messageId, request, requestOptions) {
|
|
351
360
|
return __awaiter(this, void 0, void 0, function* () {
|
|
352
361
|
var _a, _b, _c;
|
|
362
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
353
363
|
const _response = yield core.fetcher({
|
|
354
|
-
url: core.url.join((
|
|
364
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${encodeURIComponent(inboxId)}/messages/${encodeURIComponent(messageId)}/reply`),
|
|
355
365
|
method: "POST",
|
|
356
|
-
headers:
|
|
366
|
+
headers: _headers,
|
|
357
367
|
contentType: "application/json",
|
|
368
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
358
369
|
requestType: "json",
|
|
359
370
|
body: request,
|
|
360
371
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -418,11 +429,13 @@ export class Messages {
|
|
|
418
429
|
__update(inboxId, messageId, request, requestOptions) {
|
|
419
430
|
return __awaiter(this, void 0, void 0, function* () {
|
|
420
431
|
var _a, _b, _c;
|
|
432
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
421
433
|
const _response = yield core.fetcher({
|
|
422
|
-
url: core.url.join((
|
|
434
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${encodeURIComponent(inboxId)}/messages/${encodeURIComponent(messageId)}`),
|
|
423
435
|
method: "PATCH",
|
|
424
|
-
headers:
|
|
436
|
+
headers: _headers,
|
|
425
437
|
contentType: "application/json",
|
|
438
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
426
439
|
requestType: "json",
|
|
427
440
|
body: request,
|
|
428
441
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -20,6 +20,8 @@ export declare namespace Metrics {
|
|
|
20
20
|
maxRetries?: number;
|
|
21
21
|
/** A hook to abort the request. */
|
|
22
22
|
abortSignal?: AbortSignal;
|
|
23
|
+
/** Additional query string parameters to include in the request. */
|
|
24
|
+
queryParams?: Record<string, unknown>;
|
|
23
25
|
/** Additional headers to include in the request. */
|
|
24
26
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
25
27
|
}
|
|
@@ -47,11 +47,12 @@ export class Metrics {
|
|
|
47
47
|
}
|
|
48
48
|
_queryParams["start_timestamp"] = startTimestamp;
|
|
49
49
|
_queryParams["end_timestamp"] = endTimestamp;
|
|
50
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
50
51
|
const _response = yield core.fetcher({
|
|
51
|
-
url: core.url.join((
|
|
52
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${encodeURIComponent(inboxId)}/metrics`),
|
|
52
53
|
method: "GET",
|
|
53
|
-
headers:
|
|
54
|
-
queryParameters: _queryParams,
|
|
54
|
+
headers: _headers,
|
|
55
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
55
56
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
56
57
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
57
58
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -20,6 +20,8 @@ export declare namespace Threads {
|
|
|
20
20
|
maxRetries?: number;
|
|
21
21
|
/** A hook to abort the request. */
|
|
22
22
|
abortSignal?: AbortSignal;
|
|
23
|
+
/** Additional query string parameters to include in the request. */
|
|
24
|
+
queryParams?: Record<string, unknown>;
|
|
23
25
|
/** Additional headers to include in the request. */
|
|
24
26
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
25
27
|
}
|
|
@@ -50,11 +50,12 @@ export class Threads {
|
|
|
50
50
|
if (ascending != null) {
|
|
51
51
|
_queryParams["ascending"] = ascending.toString();
|
|
52
52
|
}
|
|
53
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
53
54
|
const _response = yield core.fetcher({
|
|
54
|
-
url: core.url.join((
|
|
55
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${encodeURIComponent(inboxId)}/threads`),
|
|
55
56
|
method: "GET",
|
|
56
|
-
headers:
|
|
57
|
-
queryParameters: _queryParams,
|
|
57
|
+
headers: _headers,
|
|
58
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
58
59
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
59
60
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
60
61
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -107,10 +108,12 @@ export class Threads {
|
|
|
107
108
|
__get(inboxId, threadId, requestOptions) {
|
|
108
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
110
|
var _a, _b, _c;
|
|
111
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
110
112
|
const _response = yield core.fetcher({
|
|
111
|
-
url: core.url.join((
|
|
113
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${encodeURIComponent(inboxId)}/threads/${encodeURIComponent(threadId)}`),
|
|
112
114
|
method: "GET",
|
|
113
|
-
headers:
|
|
115
|
+
headers: _headers,
|
|
116
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
114
117
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
115
118
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
116
119
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -156,10 +159,12 @@ export class Threads {
|
|
|
156
159
|
__getAttachment(inboxId, threadId, attachmentId, requestOptions) {
|
|
157
160
|
return __awaiter(this, void 0, void 0, function* () {
|
|
158
161
|
var _a, _b, _c;
|
|
162
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
159
163
|
const _response = yield core.fetcher({
|
|
160
|
-
url: core.url.join((
|
|
164
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${encodeURIComponent(inboxId)}/threads/${encodeURIComponent(threadId)}/attachments/${encodeURIComponent(attachmentId)}`),
|
|
161
165
|
method: "GET",
|
|
162
|
-
headers:
|
|
166
|
+
headers: _headers,
|
|
167
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
163
168
|
responseType: "binary-response",
|
|
164
169
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
165
170
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -20,6 +20,8 @@ export declare namespace Metrics {
|
|
|
20
20
|
maxRetries?: number;
|
|
21
21
|
/** A hook to abort the request. */
|
|
22
22
|
abortSignal?: AbortSignal;
|
|
23
|
+
/** Additional query string parameters to include in the request. */
|
|
24
|
+
queryParams?: Record<string, unknown>;
|
|
23
25
|
/** Additional headers to include in the request. */
|
|
24
26
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
25
27
|
}
|
|
@@ -45,11 +45,12 @@ export class Metrics {
|
|
|
45
45
|
}
|
|
46
46
|
_queryParams["start_timestamp"] = startTimestamp;
|
|
47
47
|
_queryParams["end_timestamp"] = endTimestamp;
|
|
48
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
48
49
|
const _response = yield core.fetcher({
|
|
49
|
-
url: core.url.join((
|
|
50
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, "/v0/metrics"),
|
|
50
51
|
method: "GET",
|
|
51
|
-
headers:
|
|
52
|
-
queryParameters: _queryParams,
|
|
52
|
+
headers: _headers,
|
|
53
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
53
54
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
54
55
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
55
56
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -20,6 +20,8 @@ export declare namespace Threads {
|
|
|
20
20
|
maxRetries?: number;
|
|
21
21
|
/** A hook to abort the request. */
|
|
22
22
|
abortSignal?: AbortSignal;
|
|
23
|
+
/** Additional query string parameters to include in the request. */
|
|
24
|
+
queryParams?: Record<string, unknown>;
|
|
23
25
|
/** Additional headers to include in the request. */
|
|
24
26
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
25
27
|
}
|
|
@@ -49,11 +49,12 @@ export class Threads {
|
|
|
49
49
|
if (ascending != null) {
|
|
50
50
|
_queryParams["ascending"] = ascending.toString();
|
|
51
51
|
}
|
|
52
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
52
53
|
const _response = yield core.fetcher({
|
|
53
|
-
url: core.url.join((
|
|
54
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, "/v0/threads"),
|
|
54
55
|
method: "GET",
|
|
55
|
-
headers:
|
|
56
|
-
queryParameters: _queryParams,
|
|
56
|
+
headers: _headers,
|
|
57
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
57
58
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
58
59
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
59
60
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -105,10 +106,12 @@ export class Threads {
|
|
|
105
106
|
__get(threadId, requestOptions) {
|
|
106
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
108
|
var _a, _b, _c;
|
|
109
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
108
110
|
const _response = yield core.fetcher({
|
|
109
|
-
url: core.url.join((
|
|
111
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/threads/${encodeURIComponent(threadId)}`),
|
|
110
112
|
method: "GET",
|
|
111
|
-
headers:
|
|
113
|
+
headers: _headers,
|
|
114
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
112
115
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
113
116
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
114
117
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -154,10 +157,12 @@ export class Threads {
|
|
|
154
157
|
__getAttachment(threadId, attachmentId, requestOptions) {
|
|
155
158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
156
159
|
var _a, _b, _c;
|
|
160
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
157
161
|
const _response = yield core.fetcher({
|
|
158
|
-
url: core.url.join((
|
|
162
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/threads/${encodeURIComponent(threadId)}/attachments/${encodeURIComponent(attachmentId)}`),
|
|
159
163
|
method: "GET",
|
|
160
|
-
headers:
|
|
164
|
+
headers: _headers,
|
|
165
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
161
166
|
responseType: "binary-response",
|
|
162
167
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
163
168
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -20,6 +20,8 @@ export declare namespace Webhooks {
|
|
|
20
20
|
maxRetries?: number;
|
|
21
21
|
/** A hook to abort the request. */
|
|
22
22
|
abortSignal?: AbortSignal;
|
|
23
|
+
/** Additional query string parameters to include in the request. */
|
|
24
|
+
queryParams?: Record<string, unknown>;
|
|
23
25
|
/** Additional headers to include in the request. */
|
|
24
26
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
25
27
|
}
|
|
@@ -40,11 +40,12 @@ export class Webhooks {
|
|
|
40
40
|
if (pageToken != null) {
|
|
41
41
|
_queryParams["page_token"] = pageToken;
|
|
42
42
|
}
|
|
43
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
43
44
|
const _response = yield core.fetcher({
|
|
44
|
-
url: core.url.join((
|
|
45
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, "/v0/webhooks"),
|
|
45
46
|
method: "GET",
|
|
46
|
-
headers:
|
|
47
|
-
queryParameters: _queryParams,
|
|
47
|
+
headers: _headers,
|
|
48
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
48
49
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
49
50
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
50
51
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -94,10 +95,12 @@ export class Webhooks {
|
|
|
94
95
|
__get(webhookId, requestOptions) {
|
|
95
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
96
97
|
var _a, _b, _c;
|
|
98
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
97
99
|
const _response = yield core.fetcher({
|
|
98
|
-
url: core.url.join((
|
|
100
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/webhooks/${encodeURIComponent(webhookId)}`),
|
|
99
101
|
method: "GET",
|
|
100
|
-
headers:
|
|
102
|
+
headers: _headers,
|
|
103
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
101
104
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
102
105
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
103
106
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -154,11 +157,13 @@ export class Webhooks {
|
|
|
154
157
|
__create(request, requestOptions) {
|
|
155
158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
156
159
|
var _a, _b, _c;
|
|
160
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
157
161
|
const _response = yield core.fetcher({
|
|
158
|
-
url: core.url.join((
|
|
162
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, "/v0/webhooks"),
|
|
159
163
|
method: "POST",
|
|
160
|
-
headers:
|
|
164
|
+
headers: _headers,
|
|
161
165
|
contentType: "application/json",
|
|
166
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
162
167
|
requestType: "json",
|
|
163
168
|
body: request,
|
|
164
169
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -212,10 +217,12 @@ export class Webhooks {
|
|
|
212
217
|
__delete(webhookId, requestOptions) {
|
|
213
218
|
return __awaiter(this, void 0, void 0, function* () {
|
|
214
219
|
var _a, _b, _c;
|
|
220
|
+
var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
215
221
|
const _response = yield core.fetcher({
|
|
216
|
-
url: core.url.join((
|
|
222
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/webhooks/${encodeURIComponent(webhookId)}`),
|
|
217
223
|
method: "DELETE",
|
|
218
|
-
headers:
|
|
224
|
+
headers: _headers,
|
|
225
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
219
226
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
220
227
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
221
228
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,7 +7,7 @@ export declare namespace Fetcher {
|
|
|
7
7
|
method: string;
|
|
8
8
|
contentType?: string;
|
|
9
9
|
headers?: Record<string, string | Supplier<string | undefined> | undefined>;
|
|
10
|
-
queryParameters?: Record<string,
|
|
10
|
+
queryParameters?: Record<string, unknown>;
|
|
11
11
|
body?: unknown;
|
|
12
12
|
timeoutMs?: number;
|
|
13
13
|
maxRetries?: number;
|
|
@@ -8,15 +8,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { toJson } from "../json.mjs";
|
|
11
|
-
import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
12
|
-
import { Supplier } from "./Supplier.mjs";
|
|
13
11
|
import { createRequestUrl } from "./createRequestUrl.mjs";
|
|
14
12
|
import { getErrorResponseBody } from "./getErrorResponseBody.mjs";
|
|
15
13
|
import { getFetchFn } from "./getFetchFn.mjs";
|
|
16
14
|
import { getRequestBody } from "./getRequestBody.mjs";
|
|
17
15
|
import { getResponseBody } from "./getResponseBody.mjs";
|
|
18
16
|
import { makeRequest } from "./makeRequest.mjs";
|
|
17
|
+
import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
19
18
|
import { requestWithRetries } from "./requestWithRetries.mjs";
|
|
19
|
+
import { Supplier } from "./Supplier.mjs";
|
|
20
20
|
function getHeaders(args) {
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
22
|
const newHeaders = {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type { APIResponse } from "./APIResponse.mjs";
|
|
2
|
-
export {
|
|
2
|
+
export type { BinaryResponse } from "./BinaryResponse.mjs";
|
|
3
3
|
export type { Fetcher, FetchFunction } from "./Fetcher.mjs";
|
|
4
|
+
export { fetcher } from "./Fetcher.mjs";
|
|
4
5
|
export { getHeader } from "./getHeader.mjs";
|
|
5
|
-
export { Supplier } from "./Supplier.mjs";
|
|
6
|
-
export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
7
|
-
export type { RawResponse, WithRawResponse } from "./RawResponse.mjs";
|
|
8
6
|
export { HttpResponsePromise } from "./HttpResponsePromise.mjs";
|
|
9
|
-
export {
|
|
7
|
+
export type { RawResponse, WithRawResponse } from "./RawResponse.mjs";
|
|
8
|
+
export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
9
|
+
export { Supplier } from "./Supplier.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { fetcher } from "./Fetcher.mjs";
|
|
2
2
|
export { getHeader } from "./getHeader.mjs";
|
|
3
|
-
export { Supplier } from "./Supplier.mjs";
|
|
4
|
-
export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
5
3
|
export { HttpResponsePromise } from "./HttpResponsePromise.mjs";
|
|
4
|
+
export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
5
|
+
export { Supplier } from "./Supplier.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.51";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.51";
|