agentmail 0.1.1 → 0.1.3
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/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/apiKeys/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/apiKeys/client/Client.js +52 -62
- package/dist/cjs/api/resources/domains/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/domains/client/Client.js +52 -62
- package/dist/cjs/api/resources/drafts/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/drafts/client/Client.js +70 -83
- package/dist/cjs/api/resources/inboxes/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/inboxes/client/Client.js +52 -62
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +70 -83
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +70 -83
- package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +70 -83
- package/dist/cjs/api/resources/pods/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/pods/client/Client.js +52 -62
- package/dist/cjs/api/resources/pods/resources/domains/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +70 -83
- package/dist/cjs/api/resources/pods/resources/drafts/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/pods/resources/drafts/client/Client.js +70 -83
- package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +70 -83
- package/dist/cjs/api/resources/pods/resources/threads/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +70 -83
- package/dist/cjs/api/resources/threads/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/threads/client/Client.js +70 -83
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/webhooks/client/Client.js +52 -62
- package/dist/cjs/core/exports.d.ts +0 -1
- package/dist/cjs/core/exports.js +0 -1
- package/dist/cjs/core/index.d.ts +0 -2
- package/dist/cjs/core/index.js +0 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/apiKeys/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/apiKeys/client/Client.mjs +52 -62
- package/dist/esm/api/resources/domains/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/domains/client/Client.mjs +52 -62
- package/dist/esm/api/resources/drafts/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/drafts/client/Client.mjs +70 -83
- package/dist/esm/api/resources/inboxes/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/inboxes/client/Client.mjs +52 -62
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +70 -83
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +70 -83
- package/dist/esm/api/resources/inboxes/resources/threads/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +70 -83
- package/dist/esm/api/resources/pods/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/pods/client/Client.mjs +52 -62
- package/dist/esm/api/resources/pods/resources/domains/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +70 -83
- package/dist/esm/api/resources/pods/resources/drafts/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/pods/resources/drafts/client/Client.mjs +70 -83
- package/dist/esm/api/resources/pods/resources/inboxes/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +70 -83
- package/dist/esm/api/resources/pods/resources/threads/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +70 -83
- package/dist/esm/api/resources/threads/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/threads/client/Client.mjs +70 -83
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/webhooks/client/Client.mjs +52 -62
- package/dist/esm/core/exports.d.mts +0 -1
- package/dist/esm/core/exports.mjs +0 -1
- package/dist/esm/core/index.d.mts +0 -2
- package/dist/esm/core/index.mjs +0 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms-full.txt +21118 -0
- package/dist/llms.txt +101 -0
- package/package.json +2 -2
- package/reference.md +28 -196
- package/dist/cjs/core/pagination/Page.d.ts +0 -33
- package/dist/cjs/core/pagination/Page.js +0 -101
- package/dist/cjs/core/pagination/exports.d.ts +0 -1
- package/dist/cjs/core/pagination/exports.js +0 -2
- package/dist/cjs/core/pagination/index.d.ts +0 -1
- package/dist/cjs/core/pagination/index.js +0 -5
- package/dist/cjs/core/utils/index.d.ts +0 -1
- package/dist/cjs/core/utils/index.js +0 -5
- package/dist/cjs/core/utils/setObjectProperty.d.ts +0 -11
- package/dist/cjs/core/utils/setObjectProperty.js +0 -42
- package/dist/esm/core/pagination/Page.d.mts +0 -33
- package/dist/esm/core/pagination/Page.mjs +0 -97
- package/dist/esm/core/pagination/exports.d.mts +0 -1
- package/dist/esm/core/pagination/exports.mjs +0 -1
- package/dist/esm/core/pagination/index.d.mts +0 -1
- package/dist/esm/core/pagination/index.mjs +0 -1
- package/dist/esm/core/utils/index.d.mts +0 -1
- package/dist/esm/core/utils/index.mjs +0 -1
- package/dist/esm/core/utils/setObjectProperty.d.mts +0 -11
- package/dist/esm/core/utils/setObjectProperty.mjs +0 -39
|
@@ -29,100 +29,87 @@ export class Inboxes {
|
|
|
29
29
|
* @example
|
|
30
30
|
* await client.pods.inboxes.list("pod_id")
|
|
31
31
|
*/
|
|
32
|
-
list(
|
|
32
|
+
list(podId, request = {}, requestOptions) {
|
|
33
|
+
return core.HttpResponsePromise.fromPromise(this.__list(podId, request, requestOptions));
|
|
34
|
+
}
|
|
35
|
+
__list(podId_1) {
|
|
33
36
|
return __awaiter(this, arguments, void 0, function* (podId, request = {}, requestOptions) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
37
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
38
|
+
const { limit, pageToken, labels, before, after, ascending } = request;
|
|
39
|
+
const _queryParams = {};
|
|
40
|
+
if (limit != null) {
|
|
41
|
+
_queryParams.limit = limit.toString();
|
|
42
|
+
}
|
|
43
|
+
if (pageToken != null) {
|
|
44
|
+
_queryParams.page_token = pageToken;
|
|
45
|
+
}
|
|
46
|
+
if (labels != null) {
|
|
47
|
+
_queryParams.labels = toJson(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip", omitUndefined: true }));
|
|
48
|
+
}
|
|
49
|
+
if (before != null) {
|
|
50
|
+
_queryParams.before = before.toISOString();
|
|
51
|
+
}
|
|
52
|
+
if (after != null) {
|
|
53
|
+
_queryParams.after = after.toISOString();
|
|
54
|
+
}
|
|
55
|
+
if (ascending != null) {
|
|
56
|
+
_queryParams.ascending = ascending.toString();
|
|
57
|
+
}
|
|
58
|
+
const _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);
|
|
59
|
+
const _response = yield core.fetcher({
|
|
60
|
+
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/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(podId, { omitUndefined: true }))}/inboxes`),
|
|
61
|
+
method: "GET",
|
|
62
|
+
headers: _headers,
|
|
63
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
64
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
65
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
66
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
67
|
+
});
|
|
68
|
+
if (_response.ok) {
|
|
69
|
+
return {
|
|
70
|
+
data: serializers.inboxes.ListInboxesResponse.parseOrThrow(_response.body, {
|
|
71
|
+
unrecognizedObjectKeys: "passthrough",
|
|
72
|
+
allowUnrecognizedUnionMembers: true,
|
|
73
|
+
allowUnrecognizedEnumValues: true,
|
|
74
|
+
skipValidation: true,
|
|
75
|
+
breadcrumbsPrefix: ["response"],
|
|
76
|
+
}),
|
|
77
|
+
rawResponse: _response.rawResponse,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
if (_response.error.reason === "status-code") {
|
|
81
|
+
switch (_response.error.statusCode) {
|
|
82
|
+
case 404:
|
|
83
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
72
84
|
unrecognizedObjectKeys: "passthrough",
|
|
73
85
|
allowUnrecognizedUnionMembers: true,
|
|
74
86
|
allowUnrecognizedEnumValues: true,
|
|
75
87
|
skipValidation: true,
|
|
76
88
|
breadcrumbsPrefix: ["response"],
|
|
77
|
-
}),
|
|
78
|
-
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
if (_response.error.reason === "status-code") {
|
|
82
|
-
switch (_response.error.statusCode) {
|
|
83
|
-
case 404:
|
|
84
|
-
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
85
|
-
unrecognizedObjectKeys: "passthrough",
|
|
86
|
-
allowUnrecognizedUnionMembers: true,
|
|
87
|
-
allowUnrecognizedEnumValues: true,
|
|
88
|
-
skipValidation: true,
|
|
89
|
-
breadcrumbsPrefix: ["response"],
|
|
90
|
-
}), _response.rawResponse);
|
|
91
|
-
default:
|
|
92
|
-
throw new errors.AgentMailError({
|
|
93
|
-
statusCode: _response.error.statusCode,
|
|
94
|
-
body: _response.error.body,
|
|
95
|
-
rawResponse: _response.rawResponse,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
switch (_response.error.reason) {
|
|
100
|
-
case "non-json":
|
|
89
|
+
}), _response.rawResponse);
|
|
90
|
+
default:
|
|
101
91
|
throw new errors.AgentMailError({
|
|
102
92
|
statusCode: _response.error.statusCode,
|
|
103
|
-
body: _response.error.
|
|
104
|
-
rawResponse: _response.rawResponse,
|
|
105
|
-
});
|
|
106
|
-
case "timeout":
|
|
107
|
-
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/pods/{pod_id}/inboxes.");
|
|
108
|
-
case "unknown":
|
|
109
|
-
throw new errors.AgentMailError({
|
|
110
|
-
message: _response.error.errorMessage,
|
|
93
|
+
body: _response.error.body,
|
|
111
94
|
rawResponse: _response.rawResponse,
|
|
112
95
|
});
|
|
113
96
|
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
97
|
+
}
|
|
98
|
+
switch (_response.error.reason) {
|
|
99
|
+
case "non-json":
|
|
100
|
+
throw new errors.AgentMailError({
|
|
101
|
+
statusCode: _response.error.statusCode,
|
|
102
|
+
body: _response.error.rawBody,
|
|
103
|
+
rawResponse: _response.rawResponse,
|
|
104
|
+
});
|
|
105
|
+
case "timeout":
|
|
106
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/pods/{pod_id}/inboxes.");
|
|
107
|
+
case "unknown":
|
|
108
|
+
throw new errors.AgentMailError({
|
|
109
|
+
message: _response.error.errorMessage,
|
|
110
|
+
rawResponse: _response.rawResponse,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
126
113
|
});
|
|
127
114
|
}
|
|
128
115
|
/**
|
|
@@ -20,7 +20,8 @@ export declare class Threads {
|
|
|
20
20
|
* @example
|
|
21
21
|
* await client.pods.threads.list("pod_id")
|
|
22
22
|
*/
|
|
23
|
-
list(podId: AgentMail.pods.PodId, request?: AgentMail.pods.ListThreadsRequest, requestOptions?: Threads.RequestOptions):
|
|
23
|
+
list(podId: AgentMail.pods.PodId, request?: AgentMail.pods.ListThreadsRequest, requestOptions?: Threads.RequestOptions): core.HttpResponsePromise<AgentMail.ListThreadsResponse>;
|
|
24
|
+
private __list;
|
|
24
25
|
/**
|
|
25
26
|
* @param {AgentMail.pods.PodId} podId
|
|
26
27
|
* @param {AgentMail.ThreadId} threadId
|
|
@@ -29,100 +29,87 @@ export class Threads {
|
|
|
29
29
|
* @example
|
|
30
30
|
* await client.pods.threads.list("pod_id")
|
|
31
31
|
*/
|
|
32
|
-
list(
|
|
32
|
+
list(podId, request = {}, requestOptions) {
|
|
33
|
+
return core.HttpResponsePromise.fromPromise(this.__list(podId, request, requestOptions));
|
|
34
|
+
}
|
|
35
|
+
__list(podId_1) {
|
|
33
36
|
return __awaiter(this, arguments, void 0, function* (podId, request = {}, requestOptions) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
37
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
38
|
+
const { limit, pageToken, labels, before, after, ascending } = request;
|
|
39
|
+
const _queryParams = {};
|
|
40
|
+
if (limit != null) {
|
|
41
|
+
_queryParams.limit = limit.toString();
|
|
42
|
+
}
|
|
43
|
+
if (pageToken != null) {
|
|
44
|
+
_queryParams.page_token = pageToken;
|
|
45
|
+
}
|
|
46
|
+
if (labels != null) {
|
|
47
|
+
_queryParams.labels = toJson(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip", omitUndefined: true }));
|
|
48
|
+
}
|
|
49
|
+
if (before != null) {
|
|
50
|
+
_queryParams.before = before.toISOString();
|
|
51
|
+
}
|
|
52
|
+
if (after != null) {
|
|
53
|
+
_queryParams.after = after.toISOString();
|
|
54
|
+
}
|
|
55
|
+
if (ascending != null) {
|
|
56
|
+
_queryParams.ascending = ascending.toString();
|
|
57
|
+
}
|
|
58
|
+
const _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);
|
|
59
|
+
const _response = yield core.fetcher({
|
|
60
|
+
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/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(podId, { omitUndefined: true }))}/threads`),
|
|
61
|
+
method: "GET",
|
|
62
|
+
headers: _headers,
|
|
63
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
64
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
65
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
66
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
67
|
+
});
|
|
68
|
+
if (_response.ok) {
|
|
69
|
+
return {
|
|
70
|
+
data: serializers.ListThreadsResponse.parseOrThrow(_response.body, {
|
|
71
|
+
unrecognizedObjectKeys: "passthrough",
|
|
72
|
+
allowUnrecognizedUnionMembers: true,
|
|
73
|
+
allowUnrecognizedEnumValues: true,
|
|
74
|
+
skipValidation: true,
|
|
75
|
+
breadcrumbsPrefix: ["response"],
|
|
76
|
+
}),
|
|
77
|
+
rawResponse: _response.rawResponse,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
if (_response.error.reason === "status-code") {
|
|
81
|
+
switch (_response.error.statusCode) {
|
|
82
|
+
case 404:
|
|
83
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
72
84
|
unrecognizedObjectKeys: "passthrough",
|
|
73
85
|
allowUnrecognizedUnionMembers: true,
|
|
74
86
|
allowUnrecognizedEnumValues: true,
|
|
75
87
|
skipValidation: true,
|
|
76
88
|
breadcrumbsPrefix: ["response"],
|
|
77
|
-
}),
|
|
78
|
-
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
if (_response.error.reason === "status-code") {
|
|
82
|
-
switch (_response.error.statusCode) {
|
|
83
|
-
case 404:
|
|
84
|
-
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
85
|
-
unrecognizedObjectKeys: "passthrough",
|
|
86
|
-
allowUnrecognizedUnionMembers: true,
|
|
87
|
-
allowUnrecognizedEnumValues: true,
|
|
88
|
-
skipValidation: true,
|
|
89
|
-
breadcrumbsPrefix: ["response"],
|
|
90
|
-
}), _response.rawResponse);
|
|
91
|
-
default:
|
|
92
|
-
throw new errors.AgentMailError({
|
|
93
|
-
statusCode: _response.error.statusCode,
|
|
94
|
-
body: _response.error.body,
|
|
95
|
-
rawResponse: _response.rawResponse,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
switch (_response.error.reason) {
|
|
100
|
-
case "non-json":
|
|
89
|
+
}), _response.rawResponse);
|
|
90
|
+
default:
|
|
101
91
|
throw new errors.AgentMailError({
|
|
102
92
|
statusCode: _response.error.statusCode,
|
|
103
|
-
body: _response.error.
|
|
104
|
-
rawResponse: _response.rawResponse,
|
|
105
|
-
});
|
|
106
|
-
case "timeout":
|
|
107
|
-
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/pods/{pod_id}/threads.");
|
|
108
|
-
case "unknown":
|
|
109
|
-
throw new errors.AgentMailError({
|
|
110
|
-
message: _response.error.errorMessage,
|
|
93
|
+
body: _response.error.body,
|
|
111
94
|
rawResponse: _response.rawResponse,
|
|
112
95
|
});
|
|
113
96
|
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
97
|
+
}
|
|
98
|
+
switch (_response.error.reason) {
|
|
99
|
+
case "non-json":
|
|
100
|
+
throw new errors.AgentMailError({
|
|
101
|
+
statusCode: _response.error.statusCode,
|
|
102
|
+
body: _response.error.rawBody,
|
|
103
|
+
rawResponse: _response.rawResponse,
|
|
104
|
+
});
|
|
105
|
+
case "timeout":
|
|
106
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/pods/{pod_id}/threads.");
|
|
107
|
+
case "unknown":
|
|
108
|
+
throw new errors.AgentMailError({
|
|
109
|
+
message: _response.error.errorMessage,
|
|
110
|
+
rawResponse: _response.rawResponse,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
126
113
|
});
|
|
127
114
|
}
|
|
128
115
|
/**
|
|
@@ -19,7 +19,8 @@ export declare class Threads {
|
|
|
19
19
|
* @example
|
|
20
20
|
* await client.threads.list()
|
|
21
21
|
*/
|
|
22
|
-
list(request?: AgentMail.ListThreadsRequest, requestOptions?: Threads.RequestOptions):
|
|
22
|
+
list(request?: AgentMail.ListThreadsRequest, requestOptions?: Threads.RequestOptions): core.HttpResponsePromise<AgentMail.ListThreadsResponse>;
|
|
23
|
+
private __list;
|
|
23
24
|
/**
|
|
24
25
|
* @param {AgentMail.ThreadId} threadId
|
|
25
26
|
* @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -28,100 +28,87 @@ export class Threads {
|
|
|
28
28
|
* @example
|
|
29
29
|
* await client.threads.list()
|
|
30
30
|
*/
|
|
31
|
-
list() {
|
|
31
|
+
list(request = {}, requestOptions) {
|
|
32
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
33
|
+
}
|
|
34
|
+
__list() {
|
|
32
35
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
36
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
37
|
+
const { limit, pageToken, labels, before, after, ascending } = request;
|
|
38
|
+
const _queryParams = {};
|
|
39
|
+
if (limit != null) {
|
|
40
|
+
_queryParams.limit = limit.toString();
|
|
41
|
+
}
|
|
42
|
+
if (pageToken != null) {
|
|
43
|
+
_queryParams.page_token = pageToken;
|
|
44
|
+
}
|
|
45
|
+
if (labels != null) {
|
|
46
|
+
_queryParams.labels = toJson(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip", omitUndefined: true }));
|
|
47
|
+
}
|
|
48
|
+
if (before != null) {
|
|
49
|
+
_queryParams.before = before.toISOString();
|
|
50
|
+
}
|
|
51
|
+
if (after != null) {
|
|
52
|
+
_queryParams.after = after.toISOString();
|
|
53
|
+
}
|
|
54
|
+
if (ascending != null) {
|
|
55
|
+
_queryParams.ascending = ascending.toString();
|
|
56
|
+
}
|
|
57
|
+
const _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);
|
|
58
|
+
const _response = yield core.fetcher({
|
|
59
|
+
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"),
|
|
60
|
+
method: "GET",
|
|
61
|
+
headers: _headers,
|
|
62
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
63
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
64
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
65
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
66
|
+
});
|
|
67
|
+
if (_response.ok) {
|
|
68
|
+
return {
|
|
69
|
+
data: serializers.ListThreadsResponse.parseOrThrow(_response.body, {
|
|
70
|
+
unrecognizedObjectKeys: "passthrough",
|
|
71
|
+
allowUnrecognizedUnionMembers: true,
|
|
72
|
+
allowUnrecognizedEnumValues: true,
|
|
73
|
+
skipValidation: true,
|
|
74
|
+
breadcrumbsPrefix: ["response"],
|
|
75
|
+
}),
|
|
76
|
+
rawResponse: _response.rawResponse,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
if (_response.error.reason === "status-code") {
|
|
80
|
+
switch (_response.error.statusCode) {
|
|
81
|
+
case 404:
|
|
82
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
71
83
|
unrecognizedObjectKeys: "passthrough",
|
|
72
84
|
allowUnrecognizedUnionMembers: true,
|
|
73
85
|
allowUnrecognizedEnumValues: true,
|
|
74
86
|
skipValidation: true,
|
|
75
87
|
breadcrumbsPrefix: ["response"],
|
|
76
|
-
}),
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
if (_response.error.reason === "status-code") {
|
|
81
|
-
switch (_response.error.statusCode) {
|
|
82
|
-
case 404:
|
|
83
|
-
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
84
|
-
unrecognizedObjectKeys: "passthrough",
|
|
85
|
-
allowUnrecognizedUnionMembers: true,
|
|
86
|
-
allowUnrecognizedEnumValues: true,
|
|
87
|
-
skipValidation: true,
|
|
88
|
-
breadcrumbsPrefix: ["response"],
|
|
89
|
-
}), _response.rawResponse);
|
|
90
|
-
default:
|
|
91
|
-
throw new errors.AgentMailError({
|
|
92
|
-
statusCode: _response.error.statusCode,
|
|
93
|
-
body: _response.error.body,
|
|
94
|
-
rawResponse: _response.rawResponse,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
switch (_response.error.reason) {
|
|
99
|
-
case "non-json":
|
|
88
|
+
}), _response.rawResponse);
|
|
89
|
+
default:
|
|
100
90
|
throw new errors.AgentMailError({
|
|
101
91
|
statusCode: _response.error.statusCode,
|
|
102
|
-
body: _response.error.
|
|
103
|
-
rawResponse: _response.rawResponse,
|
|
104
|
-
});
|
|
105
|
-
case "timeout":
|
|
106
|
-
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/threads.");
|
|
107
|
-
case "unknown":
|
|
108
|
-
throw new errors.AgentMailError({
|
|
109
|
-
message: _response.error.errorMessage,
|
|
92
|
+
body: _response.error.body,
|
|
110
93
|
rawResponse: _response.rawResponse,
|
|
111
94
|
});
|
|
112
95
|
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
96
|
+
}
|
|
97
|
+
switch (_response.error.reason) {
|
|
98
|
+
case "non-json":
|
|
99
|
+
throw new errors.AgentMailError({
|
|
100
|
+
statusCode: _response.error.statusCode,
|
|
101
|
+
body: _response.error.rawBody,
|
|
102
|
+
rawResponse: _response.rawResponse,
|
|
103
|
+
});
|
|
104
|
+
case "timeout":
|
|
105
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/threads.");
|
|
106
|
+
case "unknown":
|
|
107
|
+
throw new errors.AgentMailError({
|
|
108
|
+
message: _response.error.errorMessage,
|
|
109
|
+
rawResponse: _response.rawResponse,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
125
112
|
});
|
|
126
113
|
}
|
|
127
114
|
/**
|
|
@@ -17,7 +17,8 @@ export declare class Webhooks {
|
|
|
17
17
|
* @example
|
|
18
18
|
* await client.webhooks.list()
|
|
19
19
|
*/
|
|
20
|
-
list(request?: AgentMail.webhooks.ListWebhooksRequest, requestOptions?: Webhooks.RequestOptions):
|
|
20
|
+
list(request?: AgentMail.webhooks.ListWebhooksRequest, requestOptions?: Webhooks.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.ListWebhooksResponse>;
|
|
21
|
+
private __list;
|
|
21
22
|
/**
|
|
22
23
|
* @param {AgentMail.webhooks.WebhookId} webhookId
|
|
23
24
|
* @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
|