agentmail 0.4.8 → 0.4.10
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/BaseClient.js +2 -2
- package/dist/cjs/api/resources/apiKeys/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/apiKeys/client/Client.js +7 -7
- package/dist/cjs/api/resources/apiKeys/types/ApiKey.d.ts +2 -0
- package/dist/cjs/api/resources/apiKeys/types/CreateApiKeyResponse.d.ts +2 -0
- package/dist/cjs/api/resources/domains/types/Domain.d.ts +2 -2
- package/dist/cjs/api/resources/domains/types/DomainId.d.ts +1 -1
- package/dist/cjs/api/resources/domains/types/DomainItem.d.ts +2 -0
- package/dist/cjs/api/resources/domains/types/DomainName.d.ts +1 -1
- package/dist/cjs/api/resources/domains/types/Status.d.ts +5 -0
- package/dist/cjs/api/resources/domains/types/Status.js +3 -0
- package/dist/cjs/api/resources/domains/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/domains/types/index.js +1 -0
- package/dist/cjs/api/resources/inboxes/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/inboxes/client/Client.js +15 -10
- package/dist/cjs/api/resources/inboxes/resources/apiKeys/client/Client.d.ts +52 -0
- package/dist/cjs/api/resources/inboxes/resources/apiKeys/client/Client.js +262 -0
- package/dist/cjs/api/resources/inboxes/resources/apiKeys/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/apiKeys/client/index.js +17 -0
- package/dist/cjs/api/resources/inboxes/resources/apiKeys/client/requests/ListApiKeysRequest.d.ts +9 -0
- package/dist/cjs/api/resources/inboxes/resources/apiKeys/client/requests/ListApiKeysRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/apiKeys/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/apiKeys/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/inboxes/resources/apiKeys/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/apiKeys/index.js +17 -0
- package/dist/cjs/api/resources/inboxes/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/index.js +3 -1
- package/dist/cjs/api/resources/inboxes/types/Email.d.ts +4 -0
- package/dist/cjs/api/resources/inboxes/types/Email.js +3 -0
- package/dist/cjs/api/resources/inboxes/types/Inbox.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/types/index.js +1 -0
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/Client.js +7 -7
- package/dist/cjs/serialization/resources/apiKeys/types/ApiKey.d.ts +1 -0
- package/dist/cjs/serialization/resources/apiKeys/types/ApiKey.js +1 -0
- package/dist/cjs/serialization/resources/apiKeys/types/CreateApiKeyResponse.d.ts +1 -0
- package/dist/cjs/serialization/resources/apiKeys/types/CreateApiKeyResponse.js +1 -0
- package/dist/cjs/serialization/resources/domains/types/Domain.d.ts +4 -2
- package/dist/cjs/serialization/resources/domains/types/Domain.js +4 -2
- package/dist/cjs/serialization/resources/domains/types/DomainItem.d.ts +4 -0
- package/dist/cjs/serialization/resources/domains/types/DomainItem.js +4 -0
- package/dist/cjs/serialization/resources/domains/types/Status.d.ts +8 -0
- package/dist/cjs/serialization/resources/domains/types/Status.js +6 -0
- package/dist/cjs/serialization/resources/domains/types/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/domains/types/index.js +1 -0
- package/dist/cjs/serialization/resources/inboxes/types/Email.d.ts +7 -0
- package/dist/cjs/serialization/resources/inboxes/types/Email.js +39 -0
- package/dist/cjs/serialization/resources/inboxes/types/Inbox.d.ts +2 -0
- package/dist/cjs/serialization/resources/inboxes/types/Inbox.js +2 -0
- package/dist/cjs/serialization/resources/inboxes/types/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/inboxes/types/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/apiKeys/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/apiKeys/client/Client.mjs +7 -7
- package/dist/esm/api/resources/apiKeys/types/ApiKey.d.mts +2 -0
- package/dist/esm/api/resources/apiKeys/types/CreateApiKeyResponse.d.mts +2 -0
- package/dist/esm/api/resources/domains/types/Domain.d.mts +2 -2
- package/dist/esm/api/resources/domains/types/DomainId.d.mts +1 -1
- package/dist/esm/api/resources/domains/types/DomainItem.d.mts +2 -0
- package/dist/esm/api/resources/domains/types/DomainName.d.mts +1 -1
- package/dist/esm/api/resources/domains/types/Status.d.mts +5 -0
- package/dist/esm/api/resources/domains/types/Status.mjs +2 -0
- package/dist/esm/api/resources/domains/types/index.d.mts +1 -0
- package/dist/esm/api/resources/domains/types/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/inboxes/client/Client.mjs +5 -0
- package/dist/esm/api/resources/inboxes/resources/apiKeys/client/Client.d.mts +52 -0
- package/dist/esm/api/resources/inboxes/resources/apiKeys/client/Client.mjs +225 -0
- package/dist/esm/api/resources/inboxes/resources/apiKeys/client/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/apiKeys/client/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/apiKeys/client/requests/ListApiKeysRequest.d.mts +9 -0
- package/dist/esm/api/resources/inboxes/resources/apiKeys/client/requests/ListApiKeysRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/apiKeys/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/apiKeys/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/apiKeys/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/apiKeys/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/index.mjs +2 -0
- package/dist/esm/api/resources/inboxes/types/Email.d.mts +4 -0
- package/dist/esm/api/resources/inboxes/types/Email.mjs +2 -0
- package/dist/esm/api/resources/inboxes/types/Inbox.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/types/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/types/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/apiKeys/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/pods/resources/apiKeys/client/Client.mjs +7 -7
- package/dist/esm/serialization/resources/apiKeys/types/ApiKey.d.mts +1 -0
- package/dist/esm/serialization/resources/apiKeys/types/ApiKey.mjs +1 -0
- package/dist/esm/serialization/resources/apiKeys/types/CreateApiKeyResponse.d.mts +1 -0
- package/dist/esm/serialization/resources/apiKeys/types/CreateApiKeyResponse.mjs +1 -0
- package/dist/esm/serialization/resources/domains/types/Domain.d.mts +4 -2
- package/dist/esm/serialization/resources/domains/types/Domain.mjs +4 -2
- package/dist/esm/serialization/resources/domains/types/DomainItem.d.mts +4 -0
- package/dist/esm/serialization/resources/domains/types/DomainItem.mjs +4 -0
- package/dist/esm/serialization/resources/domains/types/Status.d.mts +8 -0
- package/dist/esm/serialization/resources/domains/types/Status.mjs +3 -0
- package/dist/esm/serialization/resources/domains/types/index.d.mts +1 -0
- package/dist/esm/serialization/resources/domains/types/index.mjs +1 -0
- package/dist/esm/serialization/resources/inboxes/types/Email.d.mts +7 -0
- package/dist/esm/serialization/resources/inboxes/types/Email.mjs +3 -0
- package/dist/esm/serialization/resources/inboxes/types/Inbox.d.mts +2 -0
- package/dist/esm/serialization/resources/inboxes/types/Inbox.mjs +2 -0
- package/dist/esm/serialization/resources/inboxes/types/index.d.mts +1 -0
- package/dist/esm/serialization/resources/inboxes/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms-full.txt +1257 -335
- package/dist/llms.txt +5 -1
- package/package.json +1 -1
- package/reference.md +180 -6
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
17
|
+
import * as serializers from "../../../../../../serialization/index.mjs";
|
|
18
|
+
import * as AgentMail from "../../../../../index.mjs";
|
|
19
|
+
export class ApiKeysClient {
|
|
20
|
+
constructor(options = {}) {
|
|
21
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
25
|
+
* @param {AgentMail.inboxes.ListApiKeysRequest} request
|
|
26
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* await client.inboxes.apiKeys.list("inbox_id")
|
|
32
|
+
*/
|
|
33
|
+
list(inbox_id, request = {}, requestOptions) {
|
|
34
|
+
return core.HttpResponsePromise.fromPromise(this.__list(inbox_id, request, requestOptions));
|
|
35
|
+
}
|
|
36
|
+
__list(inbox_id_1) {
|
|
37
|
+
return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
|
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
39
|
+
const { limit, pageToken } = request;
|
|
40
|
+
const _queryParams = {
|
|
41
|
+
limit,
|
|
42
|
+
page_token: pageToken,
|
|
43
|
+
};
|
|
44
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
45
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
46
|
+
const _response = yield core.fetcher({
|
|
47
|
+
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.Prod)
|
|
48
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/api-keys`),
|
|
49
|
+
method: "GET",
|
|
50
|
+
headers: _headers,
|
|
51
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
52
|
+
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,
|
|
53
|
+
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,
|
|
54
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
55
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
56
|
+
logging: this._options.logging,
|
|
57
|
+
});
|
|
58
|
+
if (_response.ok) {
|
|
59
|
+
return {
|
|
60
|
+
data: serializers.ListApiKeysResponse.parseOrThrow(_response.body, {
|
|
61
|
+
unrecognizedObjectKeys: "passthrough",
|
|
62
|
+
allowUnrecognizedUnionMembers: true,
|
|
63
|
+
allowUnrecognizedEnumValues: true,
|
|
64
|
+
skipValidation: true,
|
|
65
|
+
breadcrumbsPrefix: ["response"],
|
|
66
|
+
}),
|
|
67
|
+
rawResponse: _response.rawResponse,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (_response.error.reason === "status-code") {
|
|
71
|
+
switch (_response.error.statusCode) {
|
|
72
|
+
case 404:
|
|
73
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
74
|
+
unrecognizedObjectKeys: "passthrough",
|
|
75
|
+
allowUnrecognizedUnionMembers: true,
|
|
76
|
+
allowUnrecognizedEnumValues: true,
|
|
77
|
+
skipValidation: true,
|
|
78
|
+
breadcrumbsPrefix: ["response"],
|
|
79
|
+
}), _response.rawResponse);
|
|
80
|
+
default:
|
|
81
|
+
throw new errors.AgentMailError({
|
|
82
|
+
statusCode: _response.error.statusCode,
|
|
83
|
+
body: _response.error.body,
|
|
84
|
+
rawResponse: _response.rawResponse,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/api-keys");
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
93
|
+
* @param {AgentMail.CreateApiKeyRequest} request
|
|
94
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
95
|
+
*
|
|
96
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
97
|
+
* @throws {@link AgentMail.ValidationError}
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* await client.inboxes.apiKeys.create("inbox_id", {
|
|
101
|
+
* name: "name"
|
|
102
|
+
* })
|
|
103
|
+
*/
|
|
104
|
+
create(inbox_id, request, requestOptions) {
|
|
105
|
+
return core.HttpResponsePromise.fromPromise(this.__create(inbox_id, request, requestOptions));
|
|
106
|
+
}
|
|
107
|
+
__create(inbox_id, request, requestOptions) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
110
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
111
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
112
|
+
const _response = yield core.fetcher({
|
|
113
|
+
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.Prod)
|
|
114
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/api-keys`),
|
|
115
|
+
method: "POST",
|
|
116
|
+
headers: _headers,
|
|
117
|
+
contentType: "application/json",
|
|
118
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
119
|
+
requestType: "json",
|
|
120
|
+
body: serializers.CreateApiKeyRequest.jsonOrThrow(request, {
|
|
121
|
+
unrecognizedObjectKeys: "strip",
|
|
122
|
+
omitUndefined: true,
|
|
123
|
+
}),
|
|
124
|
+
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,
|
|
125
|
+
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,
|
|
126
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
127
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
128
|
+
logging: this._options.logging,
|
|
129
|
+
});
|
|
130
|
+
if (_response.ok) {
|
|
131
|
+
return {
|
|
132
|
+
data: serializers.CreateApiKeyResponse.parseOrThrow(_response.body, {
|
|
133
|
+
unrecognizedObjectKeys: "passthrough",
|
|
134
|
+
allowUnrecognizedUnionMembers: true,
|
|
135
|
+
allowUnrecognizedEnumValues: true,
|
|
136
|
+
skipValidation: true,
|
|
137
|
+
breadcrumbsPrefix: ["response"],
|
|
138
|
+
}),
|
|
139
|
+
rawResponse: _response.rawResponse,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
if (_response.error.reason === "status-code") {
|
|
143
|
+
switch (_response.error.statusCode) {
|
|
144
|
+
case 404:
|
|
145
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
146
|
+
unrecognizedObjectKeys: "passthrough",
|
|
147
|
+
allowUnrecognizedUnionMembers: true,
|
|
148
|
+
allowUnrecognizedEnumValues: true,
|
|
149
|
+
skipValidation: true,
|
|
150
|
+
breadcrumbsPrefix: ["response"],
|
|
151
|
+
}), _response.rawResponse);
|
|
152
|
+
case 400:
|
|
153
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
154
|
+
unrecognizedObjectKeys: "passthrough",
|
|
155
|
+
allowUnrecognizedUnionMembers: true,
|
|
156
|
+
allowUnrecognizedEnumValues: true,
|
|
157
|
+
skipValidation: true,
|
|
158
|
+
breadcrumbsPrefix: ["response"],
|
|
159
|
+
}), _response.rawResponse);
|
|
160
|
+
default:
|
|
161
|
+
throw new errors.AgentMailError({
|
|
162
|
+
statusCode: _response.error.statusCode,
|
|
163
|
+
body: _response.error.body,
|
|
164
|
+
rawResponse: _response.rawResponse,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/api-keys");
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
173
|
+
* @param {AgentMail.ApiKeyId} api_key_id
|
|
174
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
175
|
+
*
|
|
176
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* await client.inboxes.apiKeys.delete("inbox_id", "api_key_id")
|
|
180
|
+
*/
|
|
181
|
+
delete(inbox_id, api_key_id, requestOptions) {
|
|
182
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, api_key_id, requestOptions));
|
|
183
|
+
}
|
|
184
|
+
__delete(inbox_id, api_key_id, requestOptions) {
|
|
185
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
187
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
188
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
189
|
+
const _response = yield core.fetcher({
|
|
190
|
+
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.Prod)
|
|
191
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/api-keys/${core.url.encodePathParam(serializers.ApiKeyId.jsonOrThrow(api_key_id, { omitUndefined: true }))}`),
|
|
192
|
+
method: "DELETE",
|
|
193
|
+
headers: _headers,
|
|
194
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
195
|
+
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,
|
|
196
|
+
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,
|
|
197
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
198
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
199
|
+
logging: this._options.logging,
|
|
200
|
+
});
|
|
201
|
+
if (_response.ok) {
|
|
202
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
203
|
+
}
|
|
204
|
+
if (_response.error.reason === "status-code") {
|
|
205
|
+
switch (_response.error.statusCode) {
|
|
206
|
+
case 404:
|
|
207
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
208
|
+
unrecognizedObjectKeys: "passthrough",
|
|
209
|
+
allowUnrecognizedUnionMembers: true,
|
|
210
|
+
allowUnrecognizedEnumValues: true,
|
|
211
|
+
skipValidation: true,
|
|
212
|
+
breadcrumbsPrefix: ["response"],
|
|
213
|
+
}), _response.rawResponse);
|
|
214
|
+
default:
|
|
215
|
+
throw new errors.AgentMailError({
|
|
216
|
+
statusCode: _response.error.statusCode,
|
|
217
|
+
body: _response.error.body,
|
|
218
|
+
rawResponse: _response.rawResponse,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/inboxes/{inbox_id}/api-keys/{api_key_id}");
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ListApiKeysRequest } from "./ListApiKeysRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -2,6 +2,7 @@ import type * as AgentMail from "../../../index.mjs";
|
|
|
2
2
|
export interface Inbox {
|
|
3
3
|
podId: AgentMail.pods.PodId;
|
|
4
4
|
inboxId: AgentMail.inboxes.InboxId;
|
|
5
|
+
email: AgentMail.inboxes.Email;
|
|
5
6
|
displayName?: AgentMail.inboxes.DisplayName;
|
|
6
7
|
clientId?: AgentMail.inboxes.ClientId;
|
|
7
8
|
/** Time at which inbox was last updated. */
|
|
@@ -39,14 +39,14 @@ export declare class ApiKeysClient {
|
|
|
39
39
|
private __create;
|
|
40
40
|
/**
|
|
41
41
|
* @param {AgentMail.pods.PodId} pod_id
|
|
42
|
-
* @param {AgentMail.ApiKeyId}
|
|
42
|
+
* @param {AgentMail.ApiKeyId} api_key_id
|
|
43
43
|
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
44
44
|
*
|
|
45
45
|
* @throws {@link AgentMail.NotFoundError}
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
|
-
* await client.pods.apiKeys.delete("pod_id", "
|
|
48
|
+
* await client.pods.apiKeys.delete("pod_id", "api_key_id")
|
|
49
49
|
*/
|
|
50
|
-
delete(pod_id: AgentMail.pods.PodId,
|
|
50
|
+
delete(pod_id: AgentMail.pods.PodId, api_key_id: AgentMail.ApiKeyId, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
51
51
|
private __delete;
|
|
52
52
|
}
|
|
@@ -170,25 +170,25 @@ export class ApiKeysClient {
|
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* @param {AgentMail.pods.PodId} pod_id
|
|
173
|
-
* @param {AgentMail.ApiKeyId}
|
|
173
|
+
* @param {AgentMail.ApiKeyId} api_key_id
|
|
174
174
|
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
175
175
|
*
|
|
176
176
|
* @throws {@link AgentMail.NotFoundError}
|
|
177
177
|
*
|
|
178
178
|
* @example
|
|
179
|
-
* await client.pods.apiKeys.delete("pod_id", "
|
|
179
|
+
* await client.pods.apiKeys.delete("pod_id", "api_key_id")
|
|
180
180
|
*/
|
|
181
|
-
delete(pod_id,
|
|
182
|
-
return core.HttpResponsePromise.fromPromise(this.__delete(pod_id,
|
|
181
|
+
delete(pod_id, api_key_id, requestOptions) {
|
|
182
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(pod_id, api_key_id, requestOptions));
|
|
183
183
|
}
|
|
184
|
-
__delete(pod_id,
|
|
184
|
+
__delete(pod_id, api_key_id, requestOptions) {
|
|
185
185
|
return __awaiter(this, void 0, void 0, function* () {
|
|
186
186
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
187
187
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
188
188
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
189
189
|
const _response = yield core.fetcher({
|
|
190
190
|
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.Prod)
|
|
191
|
-
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/api-keys/${core.url.encodePathParam(serializers.ApiKeyId.jsonOrThrow(
|
|
191
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/api-keys/${core.url.encodePathParam(serializers.ApiKeyId.jsonOrThrow(api_key_id, { omitUndefined: true }))}`),
|
|
192
192
|
method: "DELETE",
|
|
193
193
|
headers: _headers,
|
|
194
194
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -219,7 +219,7 @@ export class ApiKeysClient {
|
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/pods/{pod_id}/api-keys/{
|
|
222
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/pods/{pod_id}/api-keys/{api_key_id}");
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
}
|
|
@@ -9,6 +9,7 @@ export const ApiKey = core.serialization.object({
|
|
|
9
9
|
prefix: Prefix,
|
|
10
10
|
name: Name,
|
|
11
11
|
podId: core.serialization.property("pod_id", core.serialization.string().optional()),
|
|
12
|
+
inboxId: core.serialization.property("inbox_id", core.serialization.string().optional()),
|
|
12
13
|
usedAt: core.serialization.property("used_at", core.serialization.date().optional()),
|
|
13
14
|
createdAt: core.serialization.property("created_at", CreatedAt),
|
|
14
15
|
});
|
|
@@ -10,5 +10,6 @@ export const CreateApiKeyResponse = core.serialization.object({
|
|
|
10
10
|
prefix: Prefix,
|
|
11
11
|
name: Name,
|
|
12
12
|
podId: core.serialization.property("pod_id", core.serialization.string().optional()),
|
|
13
|
+
inboxId: core.serialization.property("inbox_id", core.serialization.string().optional()),
|
|
13
14
|
createdAt: core.serialization.property("created_at", CreatedAt),
|
|
14
15
|
});
|
|
@@ -4,15 +4,17 @@ import type * as serializers from "../../../index.mjs";
|
|
|
4
4
|
import { PodId } from "../../pods/types/PodId.mjs";
|
|
5
5
|
import { ClientId } from "./ClientId.mjs";
|
|
6
6
|
import { DomainId } from "./DomainId.mjs";
|
|
7
|
+
import { DomainName } from "./DomainName.mjs";
|
|
7
8
|
import { FeedbackEnabled } from "./FeedbackEnabled.mjs";
|
|
9
|
+
import { Status } from "./Status.mjs";
|
|
8
10
|
import { VerificationRecord } from "./VerificationRecord.mjs";
|
|
9
|
-
import { VerificationStatus } from "./VerificationStatus.mjs";
|
|
10
11
|
export declare const Domain: core.serialization.ObjectSchema<serializers.Domain.Raw, AgentMail.Domain>;
|
|
11
12
|
export declare namespace Domain {
|
|
12
13
|
interface Raw {
|
|
13
14
|
pod_id?: PodId.Raw | null;
|
|
14
15
|
domain_id: DomainId.Raw;
|
|
15
|
-
|
|
16
|
+
domain: DomainName.Raw;
|
|
17
|
+
status: Status.Raw;
|
|
16
18
|
feedback_enabled: FeedbackEnabled.Raw;
|
|
17
19
|
records: VerificationRecord.Raw[];
|
|
18
20
|
client_id?: ClientId.Raw | null;
|
|
@@ -3,13 +3,15 @@ import * as core from "../../../../core/index.mjs";
|
|
|
3
3
|
import { PodId } from "../../pods/types/PodId.mjs";
|
|
4
4
|
import { ClientId } from "./ClientId.mjs";
|
|
5
5
|
import { DomainId } from "./DomainId.mjs";
|
|
6
|
+
import { DomainName } from "./DomainName.mjs";
|
|
6
7
|
import { FeedbackEnabled } from "./FeedbackEnabled.mjs";
|
|
8
|
+
import { Status } from "./Status.mjs";
|
|
7
9
|
import { VerificationRecord } from "./VerificationRecord.mjs";
|
|
8
|
-
import { VerificationStatus } from "./VerificationStatus.mjs";
|
|
9
10
|
export const Domain = core.serialization.object({
|
|
10
11
|
podId: core.serialization.property("pod_id", PodId.optional()),
|
|
11
12
|
domainId: core.serialization.property("domain_id", DomainId),
|
|
12
|
-
|
|
13
|
+
domain: DomainName,
|
|
14
|
+
status: Status,
|
|
13
15
|
feedbackEnabled: core.serialization.property("feedback_enabled", FeedbackEnabled),
|
|
14
16
|
records: core.serialization.list(VerificationRecord),
|
|
15
17
|
clientId: core.serialization.property("client_id", ClientId.optional()),
|
|
@@ -4,12 +4,16 @@ import type * as serializers from "../../../index.mjs";
|
|
|
4
4
|
import { PodId } from "../../pods/types/PodId.mjs";
|
|
5
5
|
import { ClientId } from "./ClientId.mjs";
|
|
6
6
|
import { DomainId } from "./DomainId.mjs";
|
|
7
|
+
import { DomainName } from "./DomainName.mjs";
|
|
7
8
|
import { FeedbackEnabled } from "./FeedbackEnabled.mjs";
|
|
9
|
+
import { Status } from "./Status.mjs";
|
|
8
10
|
export declare const DomainItem: core.serialization.ObjectSchema<serializers.DomainItem.Raw, AgentMail.DomainItem>;
|
|
9
11
|
export declare namespace DomainItem {
|
|
10
12
|
interface Raw {
|
|
11
13
|
pod_id?: PodId.Raw | null;
|
|
12
14
|
domain_id: DomainId.Raw;
|
|
15
|
+
domain: DomainName.Raw;
|
|
16
|
+
status: Status.Raw;
|
|
13
17
|
feedback_enabled: FeedbackEnabled.Raw;
|
|
14
18
|
client_id?: ClientId.Raw | null;
|
|
15
19
|
updated_at: string;
|
|
@@ -3,10 +3,14 @@ import * as core from "../../../../core/index.mjs";
|
|
|
3
3
|
import { PodId } from "../../pods/types/PodId.mjs";
|
|
4
4
|
import { ClientId } from "./ClientId.mjs";
|
|
5
5
|
import { DomainId } from "./DomainId.mjs";
|
|
6
|
+
import { DomainName } from "./DomainName.mjs";
|
|
6
7
|
import { FeedbackEnabled } from "./FeedbackEnabled.mjs";
|
|
8
|
+
import { Status } from "./Status.mjs";
|
|
7
9
|
export const DomainItem = core.serialization.object({
|
|
8
10
|
podId: core.serialization.property("pod_id", PodId.optional()),
|
|
9
11
|
domainId: core.serialization.property("domain_id", DomainId),
|
|
12
|
+
domain: DomainName,
|
|
13
|
+
status: Status,
|
|
10
14
|
feedbackEnabled: core.serialization.property("feedback_enabled", FeedbackEnabled),
|
|
11
15
|
clientId: core.serialization.property("client_id", ClientId.optional()),
|
|
12
16
|
updatedAt: core.serialization.property("updated_at", core.serialization.date()),
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.mjs";
|
|
2
|
+
import type * as core from "../../../../core/index.mjs";
|
|
3
|
+
import type * as serializers from "../../../index.mjs";
|
|
4
|
+
import { VerificationStatus } from "./VerificationStatus.mjs";
|
|
5
|
+
export declare const Status: core.serialization.Schema<serializers.Status.Raw, AgentMail.Status>;
|
|
6
|
+
export declare namespace Status {
|
|
7
|
+
type Raw = VerificationStatus.Raw;
|
|
8
|
+
}
|
|
@@ -8,6 +8,7 @@ export * from "./FeedbackEnabled.mjs";
|
|
|
8
8
|
export * from "./ListDomainsResponse.mjs";
|
|
9
9
|
export * from "./RecordStatus.mjs";
|
|
10
10
|
export * from "./RecordType.mjs";
|
|
11
|
+
export * from "./Status.mjs";
|
|
11
12
|
export * from "./UpdateDomainRequest.mjs";
|
|
12
13
|
export * from "./VerificationRecord.mjs";
|
|
13
14
|
export * from "./VerificationStatus.mjs";
|
|
@@ -8,6 +8,7 @@ export * from "./FeedbackEnabled.mjs";
|
|
|
8
8
|
export * from "./ListDomainsResponse.mjs";
|
|
9
9
|
export * from "./RecordStatus.mjs";
|
|
10
10
|
export * from "./RecordType.mjs";
|
|
11
|
+
export * from "./Status.mjs";
|
|
11
12
|
export * from "./UpdateDomainRequest.mjs";
|
|
12
13
|
export * from "./VerificationRecord.mjs";
|
|
13
14
|
export * from "./VerificationStatus.mjs";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.mjs";
|
|
2
|
+
import * as core from "../../../../core/index.mjs";
|
|
3
|
+
import type * as serializers from "../../../index.mjs";
|
|
4
|
+
export declare const Email: core.serialization.Schema<serializers.inboxes.Email.Raw, AgentMail.inboxes.Email>;
|
|
5
|
+
export declare namespace Email {
|
|
6
|
+
type Raw = string;
|
|
7
|
+
}
|
|
@@ -4,12 +4,14 @@ import type * as serializers from "../../../index.mjs";
|
|
|
4
4
|
import { PodId } from "../../pods/types/PodId.mjs";
|
|
5
5
|
import { ClientId } from "./ClientId.mjs";
|
|
6
6
|
import { DisplayName } from "./DisplayName.mjs";
|
|
7
|
+
import { Email } from "./Email.mjs";
|
|
7
8
|
import { InboxId } from "./InboxId.mjs";
|
|
8
9
|
export declare const Inbox: core.serialization.ObjectSchema<serializers.inboxes.Inbox.Raw, AgentMail.inboxes.Inbox>;
|
|
9
10
|
export declare namespace Inbox {
|
|
10
11
|
interface Raw {
|
|
11
12
|
pod_id: PodId.Raw;
|
|
12
13
|
inbox_id: InboxId.Raw;
|
|
14
|
+
email: Email.Raw;
|
|
13
15
|
display_name?: DisplayName.Raw | null;
|
|
14
16
|
client_id?: ClientId.Raw | null;
|
|
15
17
|
updated_at: string;
|
|
@@ -3,10 +3,12 @@ import * as core from "../../../../core/index.mjs";
|
|
|
3
3
|
import { PodId } from "../../pods/types/PodId.mjs";
|
|
4
4
|
import { ClientId } from "./ClientId.mjs";
|
|
5
5
|
import { DisplayName } from "./DisplayName.mjs";
|
|
6
|
+
import { Email } from "./Email.mjs";
|
|
6
7
|
import { InboxId } from "./InboxId.mjs";
|
|
7
8
|
export const Inbox = core.serialization.object({
|
|
8
9
|
podId: core.serialization.property("pod_id", PodId),
|
|
9
10
|
inboxId: core.serialization.property("inbox_id", InboxId),
|
|
11
|
+
email: Email,
|
|
10
12
|
displayName: core.serialization.property("display_name", DisplayName.optional()),
|
|
11
13
|
clientId: core.serialization.property("client_id", ClientId.optional()),
|
|
12
14
|
updatedAt: core.serialization.property("updated_at", core.serialization.date()),
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.4.
|
|
1
|
+
export declare const SDK_VERSION = "0.4.10";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.4.
|
|
1
|
+
export const SDK_VERSION = "0.4.10";
|