agentmail 0.0.73 → 0.0.74
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 +19 -7
- package/dist/cjs/api/resources/domains/client/Client.js +129 -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 +19 -7
- package/dist/esm/api/resources/domains/client/Client.mjs +129 -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 +4855 -371
- package/dist/llms.txt +19 -2
- package/package.json +1 -1
- package/reference.md +156 -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,74 +27,64 @@ export class ApiKeys {
|
|
|
27
27
|
* @example
|
|
28
28
|
* await client.apiKeys.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/api-keys"),
|
|
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.ListApiKeysResponse.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/api-keys.");
|
|
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.apiKeys) !== 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/api-keys.");
|
|
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
|
/**
|
|
@@ -36,17 +36,18 @@ export declare class Domains {
|
|
|
36
36
|
* @example
|
|
37
37
|
* await client.domains.list()
|
|
38
38
|
*/
|
|
39
|
-
list(request?: AgentMail.ListDomainsRequest, requestOptions?: Domains.RequestOptions):
|
|
39
|
+
list(request?: AgentMail.ListDomainsRequest, requestOptions?: Domains.RequestOptions): core.HttpResponsePromise<AgentMail.ListDomainsResponse>;
|
|
40
|
+
private __list;
|
|
40
41
|
/**
|
|
41
|
-
* @param {AgentMail.DomainId}
|
|
42
|
+
* @param {AgentMail.DomainId} domainId
|
|
42
43
|
* @param {Domains.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
44
|
*
|
|
44
45
|
* @throws {@link AgentMail.NotFoundError}
|
|
45
46
|
*
|
|
46
47
|
* @example
|
|
47
|
-
* await client.domains.get("
|
|
48
|
+
* await client.domains.get("domain_id")
|
|
48
49
|
*/
|
|
49
|
-
get(
|
|
50
|
+
get(domainId: AgentMail.DomainId, requestOptions?: Domains.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
|
|
50
51
|
private __get;
|
|
51
52
|
/**
|
|
52
53
|
* @param {AgentMail.CreateDomainRequest} request
|
|
@@ -63,15 +64,26 @@ export declare class Domains {
|
|
|
63
64
|
create(request: AgentMail.CreateDomainRequest, requestOptions?: Domains.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
|
|
64
65
|
private __create;
|
|
65
66
|
/**
|
|
66
|
-
* @param {AgentMail.DomainId}
|
|
67
|
+
* @param {AgentMail.DomainId} domainId
|
|
67
68
|
* @param {Domains.RequestOptions} requestOptions - Request-specific configuration.
|
|
68
69
|
*
|
|
69
70
|
* @throws {@link AgentMail.NotFoundError}
|
|
70
71
|
*
|
|
71
72
|
* @example
|
|
72
|
-
* await client.domains.delete("
|
|
73
|
+
* await client.domains.delete("domain_id")
|
|
73
74
|
*/
|
|
74
|
-
delete(
|
|
75
|
+
delete(domainId: AgentMail.DomainId, requestOptions?: Domains.RequestOptions): core.HttpResponsePromise<void>;
|
|
75
76
|
private __delete;
|
|
77
|
+
/**
|
|
78
|
+
* @param {AgentMail.DomainId} domainId
|
|
79
|
+
* @param {Domains.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
|
+
*
|
|
81
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* await client.domains.verify("domain_id")
|
|
85
|
+
*/
|
|
86
|
+
verify(domainId: AgentMail.DomainId, requestOptions?: Domains.RequestOptions): core.HttpResponsePromise<void>;
|
|
87
|
+
private __verify;
|
|
76
88
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
77
89
|
}
|
|
@@ -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,7 @@ 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}.");
|
|
164
154
|
case "unknown":
|
|
165
155
|
throw new errors.AgentMailError({
|
|
166
156
|
message: _response.error.errorMessage,
|
|
@@ -251,23 +241,23 @@ export class Domains {
|
|
|
251
241
|
});
|
|
252
242
|
}
|
|
253
243
|
/**
|
|
254
|
-
* @param {AgentMail.DomainId}
|
|
244
|
+
* @param {AgentMail.DomainId} domainId
|
|
255
245
|
* @param {Domains.RequestOptions} requestOptions - Request-specific configuration.
|
|
256
246
|
*
|
|
257
247
|
* @throws {@link AgentMail.NotFoundError}
|
|
258
248
|
*
|
|
259
249
|
* @example
|
|
260
|
-
* await client.domains.delete("
|
|
250
|
+
* await client.domains.delete("domain_id")
|
|
261
251
|
*/
|
|
262
|
-
delete(
|
|
263
|
-
return core.HttpResponsePromise.fromPromise(this.__delete(
|
|
252
|
+
delete(domainId, requestOptions) {
|
|
253
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(domainId, requestOptions));
|
|
264
254
|
}
|
|
265
|
-
__delete(
|
|
255
|
+
__delete(domainId, requestOptions) {
|
|
266
256
|
return __awaiter(this, void 0, void 0, function* () {
|
|
267
257
|
var _a, _b, _c;
|
|
268
258
|
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
259
|
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(
|
|
260
|
+
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
261
|
method: "DELETE",
|
|
272
262
|
headers: _headers,
|
|
273
263
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -304,7 +294,70 @@ export class Domains {
|
|
|
304
294
|
rawResponse: _response.rawResponse,
|
|
305
295
|
});
|
|
306
296
|
case "timeout":
|
|
307
|
-
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling DELETE /v0/domains/{
|
|
297
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling DELETE /v0/domains/{domain_id}.");
|
|
298
|
+
case "unknown":
|
|
299
|
+
throw new errors.AgentMailError({
|
|
300
|
+
message: _response.error.errorMessage,
|
|
301
|
+
rawResponse: _response.rawResponse,
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* @param {AgentMail.DomainId} domainId
|
|
308
|
+
* @param {Domains.RequestOptions} requestOptions - Request-specific configuration.
|
|
309
|
+
*
|
|
310
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
311
|
+
*
|
|
312
|
+
* @example
|
|
313
|
+
* await client.domains.verify("domain_id")
|
|
314
|
+
*/
|
|
315
|
+
verify(domainId, requestOptions) {
|
|
316
|
+
return core.HttpResponsePromise.fromPromise(this.__verify(domainId, requestOptions));
|
|
317
|
+
}
|
|
318
|
+
__verify(domainId, requestOptions) {
|
|
319
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
320
|
+
var _a, _b, _c;
|
|
321
|
+
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);
|
|
322
|
+
const _response = yield core.fetcher({
|
|
323
|
+
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`),
|
|
324
|
+
method: "POST",
|
|
325
|
+
headers: _headers,
|
|
326
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
327
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
328
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
329
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
330
|
+
});
|
|
331
|
+
if (_response.ok) {
|
|
332
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
333
|
+
}
|
|
334
|
+
if (_response.error.reason === "status-code") {
|
|
335
|
+
switch (_response.error.statusCode) {
|
|
336
|
+
case 404:
|
|
337
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
338
|
+
unrecognizedObjectKeys: "passthrough",
|
|
339
|
+
allowUnrecognizedUnionMembers: true,
|
|
340
|
+
allowUnrecognizedEnumValues: true,
|
|
341
|
+
skipValidation: true,
|
|
342
|
+
breadcrumbsPrefix: ["response"],
|
|
343
|
+
}), _response.rawResponse);
|
|
344
|
+
default:
|
|
345
|
+
throw new errors.AgentMailError({
|
|
346
|
+
statusCode: _response.error.statusCode,
|
|
347
|
+
body: _response.error.body,
|
|
348
|
+
rawResponse: _response.rawResponse,
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
switch (_response.error.reason) {
|
|
353
|
+
case "non-json":
|
|
354
|
+
throw new errors.AgentMailError({
|
|
355
|
+
statusCode: _response.error.statusCode,
|
|
356
|
+
body: _response.error.rawBody,
|
|
357
|
+
rawResponse: _response.rawResponse,
|
|
358
|
+
});
|
|
359
|
+
case "timeout":
|
|
360
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling POST /v0/domains/{domain_id}/verify.");
|
|
308
361
|
case "unknown":
|
|
309
362
|
throw new errors.AgentMailError({
|
|
310
363
|
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.
|