agentmail 0.1.0 → 0.1.2
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 +5 -2
- 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/events/types/Bounce.d.ts +1 -0
- package/dist/cjs/api/resources/events/types/Complaint.d.ts +1 -0
- package/dist/cjs/api/resources/events/types/Delivery.d.ts +1 -0
- package/dist/cjs/api/resources/events/types/Reject.d.ts +1 -0
- package/dist/cjs/api/resources/events/types/Send.d.ts +1 -0
- 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 +1 -0
- package/dist/cjs/core/exports.js +17 -0
- package/dist/cjs/core/index.d.ts +0 -2
- package/dist/cjs/core/index.js +0 -2
- package/dist/cjs/core/websocket/exports.d.ts +8 -0
- package/dist/cjs/core/websocket/exports.js +2 -0
- package/dist/cjs/exports.d.ts +1 -0
- package/dist/cjs/exports.js +17 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/serialization/resources/events/types/Bounce.d.ts +2 -0
- package/dist/cjs/serialization/resources/events/types/Bounce.js +2 -0
- package/dist/cjs/serialization/resources/events/types/Complaint.d.ts +2 -0
- package/dist/cjs/serialization/resources/events/types/Complaint.js +2 -0
- package/dist/cjs/serialization/resources/events/types/Delivery.d.ts +2 -0
- package/dist/cjs/serialization/resources/events/types/Delivery.js +2 -0
- package/dist/cjs/serialization/resources/events/types/Reject.d.ts +2 -0
- package/dist/cjs/serialization/resources/events/types/Reject.js +2 -0
- package/dist/cjs/serialization/resources/events/types/Send.d.ts +2 -0
- package/dist/cjs/serialization/resources/events/types/Send.js +2 -0
- 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/events/types/Bounce.d.mts +1 -0
- package/dist/esm/api/resources/events/types/Complaint.d.mts +1 -0
- package/dist/esm/api/resources/events/types/Delivery.d.mts +1 -0
- package/dist/esm/api/resources/events/types/Reject.d.mts +1 -0
- package/dist/esm/api/resources/events/types/Send.d.mts +1 -0
- 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 +1 -0
- package/dist/esm/core/exports.mjs +1 -0
- package/dist/esm/core/index.d.mts +0 -2
- package/dist/esm/core/index.mjs +0 -2
- package/dist/esm/core/websocket/exports.d.mts +8 -0
- package/dist/esm/core/websocket/exports.mjs +1 -0
- package/dist/esm/exports.d.mts +1 -0
- package/dist/esm/exports.mjs +1 -0
- package/dist/esm/index.d.mts +1 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/serialization/resources/events/types/Bounce.d.mts +2 -0
- package/dist/esm/serialization/resources/events/types/Bounce.mjs +2 -0
- package/dist/esm/serialization/resources/events/types/Complaint.d.mts +2 -0
- package/dist/esm/serialization/resources/events/types/Complaint.mjs +2 -0
- package/dist/esm/serialization/resources/events/types/Delivery.d.mts +2 -0
- package/dist/esm/serialization/resources/events/types/Delivery.mjs +2 -0
- package/dist/esm/serialization/resources/events/types/Reject.d.mts +2 -0
- package/dist/esm/serialization/resources/events/types/Reject.mjs +2 -0
- package/dist/esm/serialization/resources/events/types/Send.d.mts +2 -0
- package/dist/esm/serialization/resources/events/types/Send.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +28 -154
- package/dist/cjs/core/pagination/Page.d.ts +0 -32
- package/dist/cjs/core/pagination/Page.js +0 -100
- package/dist/cjs/core/pagination/Pageable.d.ts +0 -14
- package/dist/cjs/core/pagination/Pageable.js +0 -10
- package/dist/cjs/core/pagination/index.d.ts +0 -2
- package/dist/cjs/core/pagination/index.js +0 -7
- 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 -32
- package/dist/esm/core/pagination/Page.mjs +0 -96
- package/dist/esm/core/pagination/Pageable.d.mts +0 -14
- package/dist/esm/core/pagination/Pageable.mjs +0 -6
- package/dist/esm/core/pagination/index.d.mts +0 -2
- package/dist/esm/core/pagination/index.mjs +0 -2
- 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
|
@@ -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.
|
|
@@ -25,74 +25,64 @@ export class Webhooks {
|
|
|
25
25
|
* @example
|
|
26
26
|
* await client.webhooks.list()
|
|
27
27
|
*/
|
|
28
|
-
list() {
|
|
28
|
+
list(request = {}, requestOptions) {
|
|
29
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
30
|
+
}
|
|
31
|
+
__list() {
|
|
29
32
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
34
|
+
const { limit, pageToken } = request;
|
|
35
|
+
const _queryParams = {};
|
|
36
|
+
if (limit != null) {
|
|
37
|
+
_queryParams.limit = limit.toString();
|
|
38
|
+
}
|
|
39
|
+
if (pageToken != null) {
|
|
40
|
+
_queryParams.page_token = pageToken;
|
|
41
|
+
}
|
|
42
|
+
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);
|
|
43
|
+
const _response = yield core.fetcher({
|
|
44
|
+
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
|
+
method: "GET",
|
|
46
|
+
headers: _headers,
|
|
47
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
48
|
+
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,
|
|
49
|
+
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,
|
|
50
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
51
|
+
});
|
|
52
|
+
if (_response.ok) {
|
|
53
|
+
return {
|
|
54
|
+
data: serializers.webhooks.ListWebhooksResponse.parseOrThrow(_response.body, {
|
|
55
|
+
unrecognizedObjectKeys: "passthrough",
|
|
56
|
+
allowUnrecognizedUnionMembers: true,
|
|
57
|
+
allowUnrecognizedEnumValues: true,
|
|
58
|
+
skipValidation: true,
|
|
59
|
+
breadcrumbsPrefix: ["response"],
|
|
60
|
+
}),
|
|
61
|
+
rawResponse: _response.rawResponse,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
if (_response.error.reason === "status-code") {
|
|
65
|
+
throw new errors.AgentMailError({
|
|
66
|
+
statusCode: _response.error.statusCode,
|
|
67
|
+
body: _response.error.body,
|
|
68
|
+
rawResponse: _response.rawResponse,
|
|
49
69
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
unrecognizedObjectKeys: "passthrough",
|
|
54
|
-
allowUnrecognizedUnionMembers: true,
|
|
55
|
-
allowUnrecognizedEnumValues: true,
|
|
56
|
-
skipValidation: true,
|
|
57
|
-
breadcrumbsPrefix: ["response"],
|
|
58
|
-
}),
|
|
59
|
-
rawResponse: _response.rawResponse,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
if (_response.error.reason === "status-code") {
|
|
70
|
+
}
|
|
71
|
+
switch (_response.error.reason) {
|
|
72
|
+
case "non-json":
|
|
63
73
|
throw new errors.AgentMailError({
|
|
64
74
|
statusCode: _response.error.statusCode,
|
|
65
|
-
body: _response.error.
|
|
75
|
+
body: _response.error.rawBody,
|
|
66
76
|
rawResponse: _response.rawResponse,
|
|
67
77
|
});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
case "timeout":
|
|
77
|
-
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/webhooks.");
|
|
78
|
-
case "unknown":
|
|
79
|
-
throw new errors.AgentMailError({
|
|
80
|
-
message: _response.error.errorMessage,
|
|
81
|
-
rawResponse: _response.rawResponse,
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
}));
|
|
85
|
-
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
86
|
-
return new core.Pageable({
|
|
87
|
-
response: dataWithRawResponse.data,
|
|
88
|
-
rawResponse: dataWithRawResponse.rawResponse,
|
|
89
|
-
hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
|
|
90
|
-
!(typeof (response === null || response === void 0 ? void 0 : response.nextPageToken) === "string" && (response === null || response === void 0 ? void 0 : response.nextPageToken) === ""),
|
|
91
|
-
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.webhooks) !== null && _a !== void 0 ? _a : []; },
|
|
92
|
-
loadPage: (response) => {
|
|
93
|
-
return list(core.setObjectProperty(request, "pageToken", response === null || response === void 0 ? void 0 : response.nextPageToken));
|
|
94
|
-
},
|
|
95
|
-
});
|
|
78
|
+
case "timeout":
|
|
79
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/webhooks.");
|
|
80
|
+
case "unknown":
|
|
81
|
+
throw new errors.AgentMailError({
|
|
82
|
+
message: _response.error.errorMessage,
|
|
83
|
+
rawResponse: _response.rawResponse,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
96
86
|
});
|
|
97
87
|
}
|
|
98
88
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./websocket/exports.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./websocket/exports.mjs";
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export * from "./auth/index.mjs";
|
|
2
2
|
export * from "./base64.mjs";
|
|
3
3
|
export * from "./fetcher/index.mjs";
|
|
4
|
-
export * from "./pagination/index.mjs";
|
|
5
4
|
export * from "./runtime/index.mjs";
|
|
6
5
|
export * as serialization from "./schemas/index.mjs";
|
|
7
6
|
export * as url from "./url/index.mjs";
|
|
8
|
-
export * from "./utils/index.mjs";
|
|
9
7
|
export * from "./websocket/index.mjs";
|
package/dist/esm/core/index.mjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export * from "./auth/index.mjs";
|
|
2
2
|
export * from "./base64.mjs";
|
|
3
3
|
export * from "./fetcher/index.mjs";
|
|
4
|
-
export * from "./pagination/index.mjs";
|
|
5
4
|
export * from "./runtime/index.mjs";
|
|
6
5
|
export * as serialization from "./schemas/index.mjs";
|
|
7
6
|
export * as url from "./url/index.mjs";
|
|
8
|
-
export * from "./utils/index.mjs";
|
|
9
7
|
export * from "./websocket/index.mjs";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as events from "./events.mjs";
|
|
2
|
+
import type * as ws from "./ws.mjs";
|
|
3
|
+
export type ReconnectingWebSocket = typeof ws.ReconnectingWebSocket;
|
|
4
|
+
export declare namespace ReconnectingWebSocket {
|
|
5
|
+
type Event = events.Event;
|
|
6
|
+
type CloseEvent = events.CloseEvent;
|
|
7
|
+
type ErrorEvent = events.ErrorEvent;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core/exports.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core/exports.mjs";
|
package/dist/esm/index.d.mts
CHANGED
|
@@ -3,4 +3,5 @@ export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
|
3
3
|
export { AgentMailClient } from "./Client.mjs";
|
|
4
4
|
export { AgentMailEnvironment, type AgentMailEnvironmentUrls } from "./environments.mjs";
|
|
5
5
|
export { AgentMailError, AgentMailTimeoutError } from "./errors/index.mjs";
|
|
6
|
+
export * from "./exports.mjs";
|
|
6
7
|
export * as serialization from "./serialization/index.mjs";
|
package/dist/esm/index.mjs
CHANGED
|
@@ -2,4 +2,5 @@ export * as AgentMail from "./api/index.mjs";
|
|
|
2
2
|
export { AgentMailClient } from "./Client.mjs";
|
|
3
3
|
export { AgentMailEnvironment } from "./environments.mjs";
|
|
4
4
|
export { AgentMailError, AgentMailTimeoutError } from "./errors/index.mjs";
|
|
5
|
+
export * from "./exports.mjs";
|
|
5
6
|
export * as serialization from "./serialization/index.mjs";
|
|
@@ -3,12 +3,14 @@ import * as core from "../../../../core/index.mjs";
|
|
|
3
3
|
import type * as serializers from "../../../index.mjs";
|
|
4
4
|
import { InboxId } from "../../inboxes/types/InboxId.mjs";
|
|
5
5
|
import { MessageId } from "../../messages/types/MessageId.mjs";
|
|
6
|
+
import { ThreadId } from "../../threads/types/ThreadId.mjs";
|
|
6
7
|
import { Recipient } from "./Recipient.mjs";
|
|
7
8
|
import { Timestamp } from "./Timestamp.mjs";
|
|
8
9
|
export declare const Bounce: core.serialization.ObjectSchema<serializers.Bounce.Raw, AgentMail.Bounce>;
|
|
9
10
|
export declare namespace Bounce {
|
|
10
11
|
interface Raw {
|
|
11
12
|
inbox_id: InboxId.Raw;
|
|
13
|
+
thread_id: ThreadId.Raw;
|
|
12
14
|
message_id: MessageId.Raw;
|
|
13
15
|
timestamp: Timestamp.Raw;
|
|
14
16
|
type: string;
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import * as core from "../../../../core/index.mjs";
|
|
3
3
|
import { InboxId } from "../../inboxes/types/InboxId.mjs";
|
|
4
4
|
import { MessageId } from "../../messages/types/MessageId.mjs";
|
|
5
|
+
import { ThreadId } from "../../threads/types/ThreadId.mjs";
|
|
5
6
|
import { Recipient } from "./Recipient.mjs";
|
|
6
7
|
import { Timestamp } from "./Timestamp.mjs";
|
|
7
8
|
export const Bounce = core.serialization.object({
|
|
8
9
|
inboxId: core.serialization.property("inbox_id", InboxId),
|
|
10
|
+
threadId: core.serialization.property("thread_id", ThreadId),
|
|
9
11
|
messageId: core.serialization.property("message_id", MessageId),
|
|
10
12
|
timestamp: Timestamp,
|
|
11
13
|
type: core.serialization.string(),
|
|
@@ -3,11 +3,13 @@ import * as core from "../../../../core/index.mjs";
|
|
|
3
3
|
import type * as serializers from "../../../index.mjs";
|
|
4
4
|
import { InboxId } from "../../inboxes/types/InboxId.mjs";
|
|
5
5
|
import { MessageId } from "../../messages/types/MessageId.mjs";
|
|
6
|
+
import { ThreadId } from "../../threads/types/ThreadId.mjs";
|
|
6
7
|
import { Timestamp } from "./Timestamp.mjs";
|
|
7
8
|
export declare const Complaint: core.serialization.ObjectSchema<serializers.Complaint.Raw, AgentMail.Complaint>;
|
|
8
9
|
export declare namespace Complaint {
|
|
9
10
|
interface Raw {
|
|
10
11
|
inbox_id: InboxId.Raw;
|
|
12
|
+
thread_id: ThreadId.Raw;
|
|
11
13
|
message_id: MessageId.Raw;
|
|
12
14
|
timestamp: Timestamp.Raw;
|
|
13
15
|
type: string;
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import * as core from "../../../../core/index.mjs";
|
|
3
3
|
import { InboxId } from "../../inboxes/types/InboxId.mjs";
|
|
4
4
|
import { MessageId } from "../../messages/types/MessageId.mjs";
|
|
5
|
+
import { ThreadId } from "../../threads/types/ThreadId.mjs";
|
|
5
6
|
import { Timestamp } from "./Timestamp.mjs";
|
|
6
7
|
export const Complaint = core.serialization.object({
|
|
7
8
|
inboxId: core.serialization.property("inbox_id", InboxId),
|
|
9
|
+
threadId: core.serialization.property("thread_id", ThreadId),
|
|
8
10
|
messageId: core.serialization.property("message_id", MessageId),
|
|
9
11
|
timestamp: Timestamp,
|
|
10
12
|
type: core.serialization.string(),
|
|
@@ -3,11 +3,13 @@ import * as core from "../../../../core/index.mjs";
|
|
|
3
3
|
import type * as serializers from "../../../index.mjs";
|
|
4
4
|
import { InboxId } from "../../inboxes/types/InboxId.mjs";
|
|
5
5
|
import { MessageId } from "../../messages/types/MessageId.mjs";
|
|
6
|
+
import { ThreadId } from "../../threads/types/ThreadId.mjs";
|
|
6
7
|
import { Timestamp } from "./Timestamp.mjs";
|
|
7
8
|
export declare const Delivery: core.serialization.ObjectSchema<serializers.Delivery.Raw, AgentMail.Delivery>;
|
|
8
9
|
export declare namespace Delivery {
|
|
9
10
|
interface Raw {
|
|
10
11
|
inbox_id: InboxId.Raw;
|
|
12
|
+
thread_id: ThreadId.Raw;
|
|
11
13
|
message_id: MessageId.Raw;
|
|
12
14
|
timestamp: Timestamp.Raw;
|
|
13
15
|
recipients: string[];
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import * as core from "../../../../core/index.mjs";
|
|
3
3
|
import { InboxId } from "../../inboxes/types/InboxId.mjs";
|
|
4
4
|
import { MessageId } from "../../messages/types/MessageId.mjs";
|
|
5
|
+
import { ThreadId } from "../../threads/types/ThreadId.mjs";
|
|
5
6
|
import { Timestamp } from "./Timestamp.mjs";
|
|
6
7
|
export const Delivery = core.serialization.object({
|
|
7
8
|
inboxId: core.serialization.property("inbox_id", InboxId),
|
|
9
|
+
threadId: core.serialization.property("thread_id", ThreadId),
|
|
8
10
|
messageId: core.serialization.property("message_id", MessageId),
|
|
9
11
|
timestamp: Timestamp,
|
|
10
12
|
recipients: core.serialization.list(core.serialization.string()),
|
|
@@ -3,11 +3,13 @@ import * as core from "../../../../core/index.mjs";
|
|
|
3
3
|
import type * as serializers from "../../../index.mjs";
|
|
4
4
|
import { InboxId } from "../../inboxes/types/InboxId.mjs";
|
|
5
5
|
import { MessageId } from "../../messages/types/MessageId.mjs";
|
|
6
|
+
import { ThreadId } from "../../threads/types/ThreadId.mjs";
|
|
6
7
|
import { Timestamp } from "./Timestamp.mjs";
|
|
7
8
|
export declare const Reject: core.serialization.ObjectSchema<serializers.Reject.Raw, AgentMail.Reject>;
|
|
8
9
|
export declare namespace Reject {
|
|
9
10
|
interface Raw {
|
|
10
11
|
inbox_id: InboxId.Raw;
|
|
12
|
+
thread_id: ThreadId.Raw;
|
|
11
13
|
message_id: MessageId.Raw;
|
|
12
14
|
timestamp: Timestamp.Raw;
|
|
13
15
|
reason: string;
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import * as core from "../../../../core/index.mjs";
|
|
3
3
|
import { InboxId } from "../../inboxes/types/InboxId.mjs";
|
|
4
4
|
import { MessageId } from "../../messages/types/MessageId.mjs";
|
|
5
|
+
import { ThreadId } from "../../threads/types/ThreadId.mjs";
|
|
5
6
|
import { Timestamp } from "./Timestamp.mjs";
|
|
6
7
|
export const Reject = core.serialization.object({
|
|
7
8
|
inboxId: core.serialization.property("inbox_id", InboxId),
|
|
9
|
+
threadId: core.serialization.property("thread_id", ThreadId),
|
|
8
10
|
messageId: core.serialization.property("message_id", MessageId),
|
|
9
11
|
timestamp: Timestamp,
|
|
10
12
|
reason: core.serialization.string(),
|
|
@@ -3,11 +3,13 @@ import * as core from "../../../../core/index.mjs";
|
|
|
3
3
|
import type * as serializers from "../../../index.mjs";
|
|
4
4
|
import { InboxId } from "../../inboxes/types/InboxId.mjs";
|
|
5
5
|
import { MessageId } from "../../messages/types/MessageId.mjs";
|
|
6
|
+
import { ThreadId } from "../../threads/types/ThreadId.mjs";
|
|
6
7
|
import { Timestamp } from "./Timestamp.mjs";
|
|
7
8
|
export declare const Send: core.serialization.ObjectSchema<serializers.Send.Raw, AgentMail.Send>;
|
|
8
9
|
export declare namespace Send {
|
|
9
10
|
interface Raw {
|
|
10
11
|
inbox_id: InboxId.Raw;
|
|
12
|
+
thread_id: ThreadId.Raw;
|
|
11
13
|
message_id: MessageId.Raw;
|
|
12
14
|
timestamp: Timestamp.Raw;
|
|
13
15
|
recipients: string[];
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import * as core from "../../../../core/index.mjs";
|
|
3
3
|
import { InboxId } from "../../inboxes/types/InboxId.mjs";
|
|
4
4
|
import { MessageId } from "../../messages/types/MessageId.mjs";
|
|
5
|
+
import { ThreadId } from "../../threads/types/ThreadId.mjs";
|
|
5
6
|
import { Timestamp } from "./Timestamp.mjs";
|
|
6
7
|
export const Send = core.serialization.object({
|
|
7
8
|
inboxId: core.serialization.property("inbox_id", InboxId),
|
|
9
|
+
threadId: core.serialization.property("thread_id", ThreadId),
|
|
8
10
|
messageId: core.serialization.property("message_id", MessageId),
|
|
9
11
|
timestamp: Timestamp,
|
|
10
12
|
recipients: core.serialization.list(core.serialization.string()),
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.1.
|
|
1
|
+
export declare const SDK_VERSION = "0.1.2";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.1.
|
|
1
|
+
export const SDK_VERSION = "0.1.2";
|