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
|
@@ -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.Page({
|
|
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
|
/**
|
|
@@ -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";
|
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.3";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.1.
|
|
1
|
+
export const SDK_VERSION = "0.1.3";
|