agentmail 0.0.73 → 0.0.75
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 +21 -21
- 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 +24 -7
- package/dist/cjs/api/resources/domains/client/Client.js +187 -76
- package/dist/cjs/api/resources/domains/types/Domain.d.ts +0 -1
- 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/drafts/types/CreateDraftRequest.d.ts +1 -0
- package/dist/cjs/api/resources/drafts/types/Draft.d.ts +1 -0
- package/dist/cjs/api/resources/drafts/types/DraftClientId.d.ts +7 -0
- package/dist/cjs/api/resources/drafts/types/DraftClientId.js +5 -0
- package/dist/cjs/api/resources/drafts/types/UpdateDraftRequest.d.ts +14 -0
- package/dist/cjs/api/resources/drafts/types/UpdateDraftRequest.js +5 -0
- package/dist/cjs/api/resources/drafts/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/drafts/types/index.js +2 -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 +26 -2
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +161 -84
- 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/index.d.ts +0 -2
- package/dist/cjs/core/index.js +0 -2
- package/dist/cjs/serialization/resources/domains/types/Domain.d.ts +0 -2
- package/dist/cjs/serialization/resources/domains/types/Domain.js +0 -2
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.d.ts +2 -0
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.js +2 -0
- package/dist/cjs/serialization/resources/drafts/types/Draft.d.ts +2 -0
- package/dist/cjs/serialization/resources/drafts/types/Draft.js +2 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftClientId.d.ts +10 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftClientId.js +41 -0
- package/dist/cjs/serialization/resources/drafts/types/UpdateDraftRequest.d.ts +27 -0
- package/dist/cjs/serialization/resources/drafts/types/UpdateDraftRequest.js +58 -0
- package/dist/cjs/serialization/resources/drafts/types/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/drafts/types/index.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 +24 -7
- package/dist/esm/api/resources/domains/client/Client.mjs +187 -76
- package/dist/esm/api/resources/domains/types/Domain.d.mts +0 -1
- 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/drafts/types/CreateDraftRequest.d.mts +1 -0
- package/dist/esm/api/resources/drafts/types/Draft.d.mts +1 -0
- package/dist/esm/api/resources/drafts/types/DraftClientId.d.mts +7 -0
- package/dist/esm/api/resources/drafts/types/DraftClientId.mjs +4 -0
- package/dist/esm/api/resources/drafts/types/UpdateDraftRequest.d.mts +14 -0
- package/dist/esm/api/resources/drafts/types/UpdateDraftRequest.mjs +4 -0
- package/dist/esm/api/resources/drafts/types/index.d.mts +2 -0
- package/dist/esm/api/resources/drafts/types/index.mjs +2 -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 +26 -2
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +161 -84
- 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/index.d.mts +0 -2
- package/dist/esm/core/index.mjs +0 -2
- package/dist/esm/serialization/resources/domains/types/Domain.d.mts +0 -2
- package/dist/esm/serialization/resources/domains/types/Domain.mjs +0 -2
- package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.d.mts +2 -0
- package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.mjs +2 -0
- package/dist/esm/serialization/resources/drafts/types/Draft.d.mts +2 -0
- package/dist/esm/serialization/resources/drafts/types/Draft.mjs +2 -0
- package/dist/esm/serialization/resources/drafts/types/DraftClientId.d.mts +10 -0
- package/dist/esm/serialization/resources/drafts/types/DraftClientId.mjs +5 -0
- package/dist/esm/serialization/resources/drafts/types/UpdateDraftRequest.d.mts +27 -0
- package/dist/esm/serialization/resources/drafts/types/UpdateDraftRequest.mjs +22 -0
- package/dist/esm/serialization/resources/drafts/types/index.d.mts +2 -0
- package/dist/esm/serialization/resources/drafts/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms-full.txt +6644 -669
- package/dist/llms.txt +27 -9
- package/package.json +1 -1
- package/reference.md +204 -160
- 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
|
@@ -27,94 +27,84 @@ export class Domains {
|
|
|
27
27
|
* @example
|
|
28
28
|
* await client.domains.list()
|
|
29
29
|
*/
|
|
30
|
-
list() {
|
|
30
|
+
list(request = {}, requestOptions) {
|
|
31
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
32
|
+
}
|
|
33
|
+
__list() {
|
|
31
34
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
var _a, _b, _c;
|
|
36
|
+
const { limit, pageToken } = request;
|
|
37
|
+
const _queryParams = {};
|
|
38
|
+
if (limit != null) {
|
|
39
|
+
_queryParams["limit"] = limit.toString();
|
|
40
|
+
}
|
|
41
|
+
if (pageToken != null) {
|
|
42
|
+
_queryParams["page_token"] = pageToken;
|
|
43
|
+
}
|
|
44
|
+
let _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);
|
|
45
|
+
const _response = yield core.fetcher({
|
|
46
|
+
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/domains"),
|
|
47
|
+
method: "GET",
|
|
48
|
+
headers: _headers,
|
|
49
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
50
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
51
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
52
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
53
|
+
});
|
|
54
|
+
if (_response.ok) {
|
|
55
|
+
return {
|
|
56
|
+
data: serializers.ListDomainsResponse.parseOrThrow(_response.body, {
|
|
57
|
+
unrecognizedObjectKeys: "passthrough",
|
|
58
|
+
allowUnrecognizedUnionMembers: true,
|
|
59
|
+
allowUnrecognizedEnumValues: true,
|
|
60
|
+
skipValidation: true,
|
|
61
|
+
breadcrumbsPrefix: ["response"],
|
|
62
|
+
}),
|
|
63
|
+
rawResponse: _response.rawResponse,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (_response.error.reason === "status-code") {
|
|
67
|
+
throw new errors.AgentMailError({
|
|
68
|
+
statusCode: _response.error.statusCode,
|
|
69
|
+
body: _response.error.body,
|
|
70
|
+
rawResponse: _response.rawResponse,
|
|
51
71
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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") {
|
|
72
|
+
}
|
|
73
|
+
switch (_response.error.reason) {
|
|
74
|
+
case "non-json":
|
|
65
75
|
throw new errors.AgentMailError({
|
|
66
76
|
statusCode: _response.error.statusCode,
|
|
67
|
-
body: _response.error.
|
|
77
|
+
body: _response.error.rawBody,
|
|
68
78
|
rawResponse: _response.rawResponse,
|
|
69
79
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
case "timeout":
|
|
79
|
-
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/domains.");
|
|
80
|
-
case "unknown":
|
|
81
|
-
throw new errors.AgentMailError({
|
|
82
|
-
message: _response.error.errorMessage,
|
|
83
|
-
rawResponse: _response.rawResponse,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}));
|
|
87
|
-
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
88
|
-
return new core.Pageable({
|
|
89
|
-
response: dataWithRawResponse.data,
|
|
90
|
-
rawResponse: dataWithRawResponse.rawResponse,
|
|
91
|
-
hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
|
|
92
|
-
!(typeof (response === null || response === void 0 ? void 0 : response.nextPageToken) === "string" && (response === null || response === void 0 ? void 0 : response.nextPageToken) === ""),
|
|
93
|
-
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.domains) !== null && _a !== void 0 ? _a : []; },
|
|
94
|
-
loadPage: (response) => {
|
|
95
|
-
return list(core.setObjectProperty(request, "pageToken", response === null || response === void 0 ? void 0 : response.nextPageToken));
|
|
96
|
-
},
|
|
97
|
-
});
|
|
80
|
+
case "timeout":
|
|
81
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/domains.");
|
|
82
|
+
case "unknown":
|
|
83
|
+
throw new errors.AgentMailError({
|
|
84
|
+
message: _response.error.errorMessage,
|
|
85
|
+
rawResponse: _response.rawResponse,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
98
88
|
});
|
|
99
89
|
}
|
|
100
90
|
/**
|
|
101
|
-
* @param {AgentMail.DomainId}
|
|
91
|
+
* @param {AgentMail.DomainId} domainId
|
|
102
92
|
* @param {Domains.RequestOptions} requestOptions - Request-specific configuration.
|
|
103
93
|
*
|
|
104
94
|
* @throws {@link AgentMail.NotFoundError}
|
|
105
95
|
*
|
|
106
96
|
* @example
|
|
107
|
-
* await client.domains.get("
|
|
97
|
+
* await client.domains.get("domain_id")
|
|
108
98
|
*/
|
|
109
|
-
get(
|
|
110
|
-
return core.HttpResponsePromise.fromPromise(this.__get(
|
|
99
|
+
get(domainId, requestOptions) {
|
|
100
|
+
return core.HttpResponsePromise.fromPromise(this.__get(domainId, requestOptions));
|
|
111
101
|
}
|
|
112
|
-
__get(
|
|
102
|
+
__get(domainId, requestOptions) {
|
|
113
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
114
104
|
var _a, _b, _c;
|
|
115
105
|
let _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);
|
|
116
106
|
const _response = yield core.fetcher({
|
|
117
|
-
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/domains/${encodeURIComponent(serializers.DomainId.jsonOrThrow(
|
|
107
|
+
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/domains/${encodeURIComponent(serializers.DomainId.jsonOrThrow(domainId, { omitUndefined: true }))}`),
|
|
118
108
|
method: "GET",
|
|
119
109
|
headers: _headers,
|
|
120
110
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -160,7 +150,65 @@ export class Domains {
|
|
|
160
150
|
rawResponse: _response.rawResponse,
|
|
161
151
|
});
|
|
162
152
|
case "timeout":
|
|
163
|
-
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/domains/{
|
|
153
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/domains/{domain_id}.");
|
|
154
|
+
case "unknown":
|
|
155
|
+
throw new errors.AgentMailError({
|
|
156
|
+
message: _response.error.errorMessage,
|
|
157
|
+
rawResponse: _response.rawResponse,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
164
|
+
*/
|
|
165
|
+
getZoneFile(domainId, requestOptions) {
|
|
166
|
+
return core.HttpResponsePromise.fromPromise(this.__getZoneFile(domainId, requestOptions));
|
|
167
|
+
}
|
|
168
|
+
__getZoneFile(domainId, requestOptions) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
var _a, _b, _c;
|
|
171
|
+
let _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);
|
|
172
|
+
const _response = yield core.fetcher({
|
|
173
|
+
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/domains/${encodeURIComponent(serializers.DomainId.jsonOrThrow(domainId, { omitUndefined: true }))}/zone-file`),
|
|
174
|
+
method: "GET",
|
|
175
|
+
headers: _headers,
|
|
176
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
177
|
+
responseType: "binary-response",
|
|
178
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
179
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
180
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
181
|
+
});
|
|
182
|
+
if (_response.ok) {
|
|
183
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
184
|
+
}
|
|
185
|
+
if (_response.error.reason === "status-code") {
|
|
186
|
+
switch (_response.error.statusCode) {
|
|
187
|
+
case 404:
|
|
188
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
189
|
+
unrecognizedObjectKeys: "passthrough",
|
|
190
|
+
allowUnrecognizedUnionMembers: true,
|
|
191
|
+
allowUnrecognizedEnumValues: true,
|
|
192
|
+
skipValidation: true,
|
|
193
|
+
breadcrumbsPrefix: ["response"],
|
|
194
|
+
}), _response.rawResponse);
|
|
195
|
+
default:
|
|
196
|
+
throw new errors.AgentMailError({
|
|
197
|
+
statusCode: _response.error.statusCode,
|
|
198
|
+
body: _response.error.body,
|
|
199
|
+
rawResponse: _response.rawResponse,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
switch (_response.error.reason) {
|
|
204
|
+
case "non-json":
|
|
205
|
+
throw new errors.AgentMailError({
|
|
206
|
+
statusCode: _response.error.statusCode,
|
|
207
|
+
body: _response.error.rawBody,
|
|
208
|
+
rawResponse: _response.rawResponse,
|
|
209
|
+
});
|
|
210
|
+
case "timeout":
|
|
211
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/domains/{domain_id}/zone-file.");
|
|
164
212
|
case "unknown":
|
|
165
213
|
throw new errors.AgentMailError({
|
|
166
214
|
message: _response.error.errorMessage,
|
|
@@ -251,23 +299,23 @@ export class Domains {
|
|
|
251
299
|
});
|
|
252
300
|
}
|
|
253
301
|
/**
|
|
254
|
-
* @param {AgentMail.DomainId}
|
|
302
|
+
* @param {AgentMail.DomainId} domainId
|
|
255
303
|
* @param {Domains.RequestOptions} requestOptions - Request-specific configuration.
|
|
256
304
|
*
|
|
257
305
|
* @throws {@link AgentMail.NotFoundError}
|
|
258
306
|
*
|
|
259
307
|
* @example
|
|
260
|
-
* await client.domains.delete("
|
|
308
|
+
* await client.domains.delete("domain_id")
|
|
261
309
|
*/
|
|
262
|
-
delete(
|
|
263
|
-
return core.HttpResponsePromise.fromPromise(this.__delete(
|
|
310
|
+
delete(domainId, requestOptions) {
|
|
311
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(domainId, requestOptions));
|
|
264
312
|
}
|
|
265
|
-
__delete(
|
|
313
|
+
__delete(domainId, requestOptions) {
|
|
266
314
|
return __awaiter(this, void 0, void 0, function* () {
|
|
267
315
|
var _a, _b, _c;
|
|
268
316
|
let _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);
|
|
269
317
|
const _response = yield core.fetcher({
|
|
270
|
-
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/domains/${encodeURIComponent(serializers.DomainId.jsonOrThrow(
|
|
318
|
+
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/domains/${encodeURIComponent(serializers.DomainId.jsonOrThrow(domainId, { omitUndefined: true }))}`),
|
|
271
319
|
method: "DELETE",
|
|
272
320
|
headers: _headers,
|
|
273
321
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -304,7 +352,70 @@ export class Domains {
|
|
|
304
352
|
rawResponse: _response.rawResponse,
|
|
305
353
|
});
|
|
306
354
|
case "timeout":
|
|
307
|
-
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling DELETE /v0/domains/{
|
|
355
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling DELETE /v0/domains/{domain_id}.");
|
|
356
|
+
case "unknown":
|
|
357
|
+
throw new errors.AgentMailError({
|
|
358
|
+
message: _response.error.errorMessage,
|
|
359
|
+
rawResponse: _response.rawResponse,
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* @param {AgentMail.DomainId} domainId
|
|
366
|
+
* @param {Domains.RequestOptions} requestOptions - Request-specific configuration.
|
|
367
|
+
*
|
|
368
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
369
|
+
*
|
|
370
|
+
* @example
|
|
371
|
+
* await client.domains.verify("domain_id")
|
|
372
|
+
*/
|
|
373
|
+
verify(domainId, requestOptions) {
|
|
374
|
+
return core.HttpResponsePromise.fromPromise(this.__verify(domainId, requestOptions));
|
|
375
|
+
}
|
|
376
|
+
__verify(domainId, requestOptions) {
|
|
377
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
378
|
+
var _a, _b, _c;
|
|
379
|
+
let _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);
|
|
380
|
+
const _response = yield core.fetcher({
|
|
381
|
+
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/domains/${encodeURIComponent(serializers.DomainId.jsonOrThrow(domainId, { omitUndefined: true }))}/verify`),
|
|
382
|
+
method: "POST",
|
|
383
|
+
headers: _headers,
|
|
384
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
385
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
386
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
387
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
388
|
+
});
|
|
389
|
+
if (_response.ok) {
|
|
390
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
391
|
+
}
|
|
392
|
+
if (_response.error.reason === "status-code") {
|
|
393
|
+
switch (_response.error.statusCode) {
|
|
394
|
+
case 404:
|
|
395
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
396
|
+
unrecognizedObjectKeys: "passthrough",
|
|
397
|
+
allowUnrecognizedUnionMembers: true,
|
|
398
|
+
allowUnrecognizedEnumValues: true,
|
|
399
|
+
skipValidation: true,
|
|
400
|
+
breadcrumbsPrefix: ["response"],
|
|
401
|
+
}), _response.rawResponse);
|
|
402
|
+
default:
|
|
403
|
+
throw new errors.AgentMailError({
|
|
404
|
+
statusCode: _response.error.statusCode,
|
|
405
|
+
body: _response.error.body,
|
|
406
|
+
rawResponse: _response.rawResponse,
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
switch (_response.error.reason) {
|
|
411
|
+
case "non-json":
|
|
412
|
+
throw new errors.AgentMailError({
|
|
413
|
+
statusCode: _response.error.statusCode,
|
|
414
|
+
body: _response.error.rawBody,
|
|
415
|
+
rawResponse: _response.rawResponse,
|
|
416
|
+
});
|
|
417
|
+
case "timeout":
|
|
418
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling POST /v0/domains/{domain_id}/verify.");
|
|
308
419
|
case "unknown":
|
|
309
420
|
throw new errors.AgentMailError({
|
|
310
421
|
message: _response.error.errorMessage,
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import * as AgentMail from "../../../index.mjs";
|
|
5
5
|
export interface Domain {
|
|
6
6
|
domainId: AgentMail.DomainId;
|
|
7
|
-
domain: AgentMail.DomainName;
|
|
8
7
|
/** The verification status of the domain. */
|
|
9
8
|
status: AgentMail.VerificationStatus;
|
|
10
9
|
feedbackEnabled: AgentMail.FeedbackEnabled;
|
|
@@ -38,7 +38,8 @@ export declare class Drafts {
|
|
|
38
38
|
* @example
|
|
39
39
|
* await client.drafts.list()
|
|
40
40
|
*/
|
|
41
|
-
list(request?: AgentMail.ListDraftsRequest, requestOptions?: Drafts.RequestOptions):
|
|
41
|
+
list(request?: AgentMail.ListDraftsRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise<AgentMail.ListDraftsResponse>;
|
|
42
|
+
private __list;
|
|
42
43
|
/**
|
|
43
44
|
* @param {AgentMail.DraftId} draftId
|
|
44
45
|
* @param {Drafts.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -30,100 +30,87 @@ export class Drafts {
|
|
|
30
30
|
* @example
|
|
31
31
|
* await client.drafts.list()
|
|
32
32
|
*/
|
|
33
|
-
list() {
|
|
33
|
+
list(request = {}, requestOptions) {
|
|
34
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
35
|
+
}
|
|
36
|
+
__list() {
|
|
34
37
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
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
|
-
|
|
72
|
-
|
|
38
|
+
var _a, _b, _c;
|
|
39
|
+
const { limit, pageToken, labels, before, after, ascending } = request;
|
|
40
|
+
const _queryParams = {};
|
|
41
|
+
if (limit != null) {
|
|
42
|
+
_queryParams["limit"] = limit.toString();
|
|
43
|
+
}
|
|
44
|
+
if (pageToken != null) {
|
|
45
|
+
_queryParams["page_token"] = pageToken;
|
|
46
|
+
}
|
|
47
|
+
if (labels != null) {
|
|
48
|
+
_queryParams["labels"] = toJson(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip", omitUndefined: true }));
|
|
49
|
+
}
|
|
50
|
+
if (before != null) {
|
|
51
|
+
_queryParams["before"] = before.toISOString();
|
|
52
|
+
}
|
|
53
|
+
if (after != null) {
|
|
54
|
+
_queryParams["after"] = after.toISOString();
|
|
55
|
+
}
|
|
56
|
+
if (ascending != null) {
|
|
57
|
+
_queryParams["ascending"] = ascending.toString();
|
|
58
|
+
}
|
|
59
|
+
let _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);
|
|
60
|
+
const _response = yield core.fetcher({
|
|
61
|
+
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/drafts"),
|
|
62
|
+
method: "GET",
|
|
63
|
+
headers: _headers,
|
|
64
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
65
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
66
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
67
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
68
|
+
});
|
|
69
|
+
if (_response.ok) {
|
|
70
|
+
return {
|
|
71
|
+
data: serializers.ListDraftsResponse.parseOrThrow(_response.body, {
|
|
72
|
+
unrecognizedObjectKeys: "passthrough",
|
|
73
|
+
allowUnrecognizedUnionMembers: true,
|
|
74
|
+
allowUnrecognizedEnumValues: true,
|
|
75
|
+
skipValidation: true,
|
|
76
|
+
breadcrumbsPrefix: ["response"],
|
|
77
|
+
}),
|
|
78
|
+
rawResponse: _response.rawResponse,
|
|
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, {
|
|
73
85
|
unrecognizedObjectKeys: "passthrough",
|
|
74
86
|
allowUnrecognizedUnionMembers: true,
|
|
75
87
|
allowUnrecognizedEnumValues: true,
|
|
76
88
|
skipValidation: true,
|
|
77
89
|
breadcrumbsPrefix: ["response"],
|
|
78
|
-
}),
|
|
79
|
-
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
if (_response.error.reason === "status-code") {
|
|
83
|
-
switch (_response.error.statusCode) {
|
|
84
|
-
case 404:
|
|
85
|
-
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
86
|
-
unrecognizedObjectKeys: "passthrough",
|
|
87
|
-
allowUnrecognizedUnionMembers: true,
|
|
88
|
-
allowUnrecognizedEnumValues: true,
|
|
89
|
-
skipValidation: true,
|
|
90
|
-
breadcrumbsPrefix: ["response"],
|
|
91
|
-
}), _response.rawResponse);
|
|
92
|
-
default:
|
|
93
|
-
throw new errors.AgentMailError({
|
|
94
|
-
statusCode: _response.error.statusCode,
|
|
95
|
-
body: _response.error.body,
|
|
96
|
-
rawResponse: _response.rawResponse,
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
switch (_response.error.reason) {
|
|
101
|
-
case "non-json":
|
|
90
|
+
}), _response.rawResponse);
|
|
91
|
+
default:
|
|
102
92
|
throw new errors.AgentMailError({
|
|
103
93
|
statusCode: _response.error.statusCode,
|
|
104
|
-
body: _response.error.
|
|
105
|
-
rawResponse: _response.rawResponse,
|
|
106
|
-
});
|
|
107
|
-
case "timeout":
|
|
108
|
-
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/drafts.");
|
|
109
|
-
case "unknown":
|
|
110
|
-
throw new errors.AgentMailError({
|
|
111
|
-
message: _response.error.errorMessage,
|
|
94
|
+
body: _response.error.body,
|
|
112
95
|
rawResponse: _response.rawResponse,
|
|
113
96
|
});
|
|
114
97
|
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
98
|
+
}
|
|
99
|
+
switch (_response.error.reason) {
|
|
100
|
+
case "non-json":
|
|
101
|
+
throw new errors.AgentMailError({
|
|
102
|
+
statusCode: _response.error.statusCode,
|
|
103
|
+
body: _response.error.rawBody,
|
|
104
|
+
rawResponse: _response.rawResponse,
|
|
105
|
+
});
|
|
106
|
+
case "timeout":
|
|
107
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/drafts.");
|
|
108
|
+
case "unknown":
|
|
109
|
+
throw new errors.AgentMailError({
|
|
110
|
+
message: _response.error.errorMessage,
|
|
111
|
+
rawResponse: _response.rawResponse,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
127
114
|
});
|
|
128
115
|
}
|
|
129
116
|
/**
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as AgentMail from "../../../index.mjs";
|
|
5
|
+
export interface UpdateDraftRequest {
|
|
6
|
+
replyTo?: AgentMail.DraftReplyTo;
|
|
7
|
+
to?: AgentMail.DraftTo;
|
|
8
|
+
cc?: AgentMail.DraftCc;
|
|
9
|
+
bcc?: AgentMail.DraftBcc;
|
|
10
|
+
subject?: AgentMail.DraftSubject;
|
|
11
|
+
text?: AgentMail.DraftText;
|
|
12
|
+
html?: AgentMail.DraftHtml;
|
|
13
|
+
sendAt?: AgentMail.DraftSendAt;
|
|
14
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./DraftId.mjs";
|
|
2
|
+
export * from "./DraftClientId.mjs";
|
|
2
3
|
export * from "./DraftLabels.mjs";
|
|
3
4
|
export * from "./DraftReplyTo.mjs";
|
|
4
5
|
export * from "./DraftTo.mjs";
|
|
@@ -17,3 +18,4 @@ export * from "./DraftItem.mjs";
|
|
|
17
18
|
export * from "./Draft.mjs";
|
|
18
19
|
export * from "./ListDraftsResponse.mjs";
|
|
19
20
|
export * from "./CreateDraftRequest.mjs";
|
|
21
|
+
export * from "./UpdateDraftRequest.mjs";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./DraftId.mjs";
|
|
2
|
+
export * from "./DraftClientId.mjs";
|
|
2
3
|
export * from "./DraftLabels.mjs";
|
|
3
4
|
export * from "./DraftReplyTo.mjs";
|
|
4
5
|
export * from "./DraftTo.mjs";
|
|
@@ -17,3 +18,4 @@ export * from "./DraftItem.mjs";
|
|
|
17
18
|
export * from "./Draft.mjs";
|
|
18
19
|
export * from "./ListDraftsResponse.mjs";
|
|
19
20
|
export * from "./CreateDraftRequest.mjs";
|
|
21
|
+
export * from "./UpdateDraftRequest.mjs";
|
|
@@ -48,7 +48,8 @@ export declare class Inboxes {
|
|
|
48
48
|
* @example
|
|
49
49
|
* await client.inboxes.list()
|
|
50
50
|
*/
|
|
51
|
-
list(request?: AgentMail.inboxes.ListInboxesRequest, requestOptions?: Inboxes.RequestOptions):
|
|
51
|
+
list(request?: AgentMail.inboxes.ListInboxesRequest, requestOptions?: Inboxes.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.ListInboxesResponse>;
|
|
52
|
+
private __list;
|
|
52
53
|
/**
|
|
53
54
|
* @param {AgentMail.inboxes.InboxId} inboxId
|
|
54
55
|
* @param {Inboxes.RequestOptions} requestOptions - Request-specific configuration.
|