agentmail 0.3.9 → 0.4.1
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.js +2 -1
- package/dist/cjs/api/resources/apiKeys/client/requests/ListApiKeysRequest.d.ts +1 -0
- 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/client/Client.js +2 -1
- package/dist/cjs/api/resources/domains/client/requests/ListDomainsRequest.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/client/Client.js +2 -1
- package/dist/cjs/api/resources/inboxes/client/requests/ListInboxesRequest.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/types/InboxId.d.ts +1 -1
- package/dist/cjs/api/resources/pods/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/pods/client/Client.js +17 -11
- package/dist/cjs/api/resources/pods/client/requests/ListPodsRequest.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/Client.d.ts +52 -0
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/Client.js +262 -0
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/index.js +17 -0
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/requests/ListApiKeysRequest.d.ts +9 -0
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/requests/ListApiKeysRequest.js +3 -0
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/pods/resources/apiKeys/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/apiKeys/index.js +17 -0
- package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +2 -1
- package/dist/cjs/api/resources/pods/resources/domains/client/requests/ListDomainsRequest.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +2 -1
- package/dist/cjs/api/resources/pods/resources/inboxes/client/requests/ListInboxesRequest.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/pods/resources/index.js +3 -1
- package/dist/cjs/api/resources/webhooks/client/Client.js +2 -1
- package/dist/cjs/api/resources/webhooks/client/requests/ListWebhooksRequest.d.ts +1 -0
- 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/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.mjs +2 -1
- package/dist/esm/api/resources/apiKeys/client/requests/ListApiKeysRequest.d.mts +1 -0
- 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/client/Client.mjs +2 -1
- package/dist/esm/api/resources/domains/client/requests/ListDomainsRequest.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/client/Client.mjs +2 -1
- package/dist/esm/api/resources/inboxes/client/requests/ListInboxesRequest.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/types/InboxId.d.mts +1 -1
- package/dist/esm/api/resources/pods/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/pods/client/Client.mjs +7 -1
- package/dist/esm/api/resources/pods/client/requests/ListPodsRequest.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/apiKeys/client/Client.d.mts +52 -0
- package/dist/esm/api/resources/pods/resources/apiKeys/client/Client.mjs +225 -0
- package/dist/esm/api/resources/pods/resources/apiKeys/client/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/apiKeys/client/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/apiKeys/client/requests/ListApiKeysRequest.d.mts +9 -0
- package/dist/esm/api/resources/pods/resources/apiKeys/client/requests/ListApiKeysRequest.mjs +2 -0
- package/dist/esm/api/resources/pods/resources/apiKeys/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/apiKeys/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/apiKeys/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/apiKeys/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +2 -1
- package/dist/esm/api/resources/pods/resources/domains/client/requests/ListDomainsRequest.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +2 -1
- package/dist/esm/api/resources/pods/resources/inboxes/client/requests/ListInboxesRequest.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/pods/resources/index.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/Client.mjs +2 -1
- package/dist/esm/api/resources/webhooks/client/requests/ListWebhooksRequest.d.mts +1 -0
- 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/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms-full.txt +1770 -73
- package/dist/llms.txt +4 -2
- package/package.json +1 -1
- package/reference.md +174 -0
|
@@ -36,7 +36,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.threads = exports.lists = exports.inboxes = exports.drafts = exports.domains = void 0;
|
|
39
|
+
exports.threads = exports.lists = exports.inboxes = exports.drafts = exports.domains = exports.apiKeys = void 0;
|
|
40
|
+
__exportStar(require("./apiKeys/client/requests/index.js"), exports);
|
|
41
|
+
exports.apiKeys = __importStar(require("./apiKeys/index.js"));
|
|
40
42
|
__exportStar(require("./domains/client/requests/index.js"), exports);
|
|
41
43
|
exports.domains = __importStar(require("./domains/index.js"));
|
|
42
44
|
__exportStar(require("./drafts/client/requests/index.js"), exports);
|
|
@@ -69,10 +69,11 @@ class WebhooksClient {
|
|
|
69
69
|
__list() {
|
|
70
70
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
71
71
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
72
|
-
const { limit, pageToken } = request;
|
|
72
|
+
const { limit, pageToken, ascending } = request;
|
|
73
73
|
const _queryParams = {
|
|
74
74
|
limit,
|
|
75
75
|
page_token: pageToken,
|
|
76
|
+
ascending,
|
|
76
77
|
};
|
|
77
78
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
78
79
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
@@ -44,6 +44,7 @@ exports.ApiKey = core.serialization.object({
|
|
|
44
44
|
apiKeyId: core.serialization.property("api_key_id", ApiKeyId_js_1.ApiKeyId),
|
|
45
45
|
prefix: Prefix_js_1.Prefix,
|
|
46
46
|
name: Name_js_1.Name,
|
|
47
|
+
podId: core.serialization.property("pod_id", core.serialization.string().optional()),
|
|
47
48
|
usedAt: core.serialization.property("used_at", core.serialization.date().optional()),
|
|
48
49
|
createdAt: core.serialization.property("created_at", CreatedAt_js_1.CreatedAt),
|
|
49
50
|
});
|
|
@@ -45,5 +45,6 @@ exports.CreateApiKeyResponse = core.serialization.object({
|
|
|
45
45
|
apiKey: core.serialization.property("api_key", core.serialization.string()),
|
|
46
46
|
prefix: Prefix_js_1.Prefix,
|
|
47
47
|
name: Name_js_1.Name,
|
|
48
|
+
podId: core.serialization.property("pod_id", core.serialization.string().optional()),
|
|
48
49
|
createdAt: core.serialization.property("created_at", CreatedAt_js_1.CreatedAt),
|
|
49
50
|
});
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.4.1";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "agentmail",
|
|
9
|
-
"X-Fern-SDK-Version": "0.
|
|
10
|
-
"User-Agent": "agentmail/0.
|
|
9
|
+
"X-Fern-SDK-Version": "0.4.1",
|
|
10
|
+
"User-Agent": "agentmail/0.4.1",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -33,10 +33,11 @@ export class ApiKeysClient {
|
|
|
33
33
|
__list() {
|
|
34
34
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
35
35
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
36
|
-
const { limit, pageToken } = request;
|
|
36
|
+
const { limit, pageToken, ascending } = request;
|
|
37
37
|
const _queryParams = {
|
|
38
38
|
limit,
|
|
39
39
|
page_token: pageToken,
|
|
40
|
+
ascending,
|
|
40
41
|
};
|
|
41
42
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
42
43
|
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);
|
|
@@ -3,6 +3,8 @@ export interface ApiKey {
|
|
|
3
3
|
apiKeyId: AgentMail.ApiKeyId;
|
|
4
4
|
prefix: AgentMail.Prefix;
|
|
5
5
|
name: AgentMail.Name;
|
|
6
|
+
/** Pod ID the api key is scoped to. If set, the key can only access resources within this pod. */
|
|
7
|
+
podId?: string;
|
|
6
8
|
/** Time at which api key was last used. */
|
|
7
9
|
usedAt?: Date;
|
|
8
10
|
createdAt: AgentMail.CreatedAt;
|
|
@@ -33,10 +33,11 @@ export class DomainsClient {
|
|
|
33
33
|
__list() {
|
|
34
34
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
35
35
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
36
|
-
const { limit, pageToken } = request;
|
|
36
|
+
const { limit, pageToken, ascending } = request;
|
|
37
37
|
const _queryParams = {
|
|
38
38
|
limit,
|
|
39
39
|
page_token: pageToken,
|
|
40
|
+
ascending,
|
|
40
41
|
};
|
|
41
42
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
42
43
|
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);
|
|
@@ -53,10 +53,11 @@ export class InboxesClient {
|
|
|
53
53
|
__list() {
|
|
54
54
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
55
55
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
56
|
-
const { limit, pageToken } = request;
|
|
56
|
+
const { limit, pageToken, ascending } = request;
|
|
57
57
|
const _queryParams = {
|
|
58
58
|
limit,
|
|
59
59
|
page_token: pageToken,
|
|
60
|
+
ascending,
|
|
60
61
|
};
|
|
61
62
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
62
63
|
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);
|
|
@@ -2,6 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClie
|
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import * as AgentMail from "../../../index.mjs";
|
|
5
|
+
import { ApiKeysClient } from "../resources/apiKeys/client/Client.mjs";
|
|
5
6
|
import { DomainsClient } from "../resources/domains/client/Client.mjs";
|
|
6
7
|
import { DraftsClient } from "../resources/drafts/client/Client.mjs";
|
|
7
8
|
import { InboxesClient } from "../resources/inboxes/client/Client.mjs";
|
|
@@ -19,12 +20,14 @@ export declare class PodsClient {
|
|
|
19
20
|
protected _drafts: DraftsClient | undefined;
|
|
20
21
|
protected _domains: DomainsClient | undefined;
|
|
21
22
|
protected _lists: ListsClient | undefined;
|
|
23
|
+
protected _apiKeys: ApiKeysClient | undefined;
|
|
22
24
|
constructor(options?: PodsClient.Options);
|
|
23
25
|
get inboxes(): InboxesClient;
|
|
24
26
|
get threads(): ThreadsClient;
|
|
25
27
|
get drafts(): DraftsClient;
|
|
26
28
|
get domains(): DomainsClient;
|
|
27
29
|
get lists(): ListsClient;
|
|
30
|
+
get apiKeys(): ApiKeysClient;
|
|
28
31
|
/**
|
|
29
32
|
* @param {AgentMail.pods.ListPodsRequest} request
|
|
30
33
|
* @param {PodsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -16,6 +16,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
16
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
17
|
import * as serializers from "../../../../serialization/index.mjs";
|
|
18
18
|
import * as AgentMail from "../../../index.mjs";
|
|
19
|
+
import { ApiKeysClient } from "../resources/apiKeys/client/Client.mjs";
|
|
19
20
|
import { DomainsClient } from "../resources/domains/client/Client.mjs";
|
|
20
21
|
import { DraftsClient } from "../resources/drafts/client/Client.mjs";
|
|
21
22
|
import { InboxesClient } from "../resources/inboxes/client/Client.mjs";
|
|
@@ -45,6 +46,10 @@ export class PodsClient {
|
|
|
45
46
|
var _a;
|
|
46
47
|
return ((_a = this._lists) !== null && _a !== void 0 ? _a : (this._lists = new ListsClient(this._options)));
|
|
47
48
|
}
|
|
49
|
+
get apiKeys() {
|
|
50
|
+
var _a;
|
|
51
|
+
return ((_a = this._apiKeys) !== null && _a !== void 0 ? _a : (this._apiKeys = new ApiKeysClient(this._options)));
|
|
52
|
+
}
|
|
48
53
|
/**
|
|
49
54
|
* @param {AgentMail.pods.ListPodsRequest} request
|
|
50
55
|
* @param {PodsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -58,10 +63,11 @@ export class PodsClient {
|
|
|
58
63
|
__list() {
|
|
59
64
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
60
65
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
61
|
-
const { limit, pageToken } = request;
|
|
66
|
+
const { limit, pageToken, ascending } = request;
|
|
62
67
|
const _queryParams = {
|
|
63
68
|
limit,
|
|
64
69
|
page_token: pageToken,
|
|
70
|
+
ascending,
|
|
65
71
|
};
|
|
66
72
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
67
73
|
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);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
4
|
+
import * as AgentMail from "../../../../../index.mjs";
|
|
5
|
+
export declare namespace ApiKeysClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class ApiKeysClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ApiKeysClient.Options>;
|
|
12
|
+
constructor(options?: ApiKeysClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
15
|
+
* @param {AgentMail.CreateApiKeyRequest} request
|
|
16
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
|
+
*
|
|
18
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
19
|
+
* @throws {@link AgentMail.ValidationError}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* await client.pods.apiKeys.create("pod_id", {
|
|
23
|
+
* name: "name"
|
|
24
|
+
* })
|
|
25
|
+
*/
|
|
26
|
+
create(pod_id: AgentMail.pods.PodId, request: AgentMail.CreateApiKeyRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<AgentMail.CreateApiKeyResponse>;
|
|
27
|
+
private __create;
|
|
28
|
+
/**
|
|
29
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
30
|
+
* @param {AgentMail.pods.ListApiKeysRequest} request
|
|
31
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
+
*
|
|
33
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* await client.pods.apiKeys.list("pod_id")
|
|
37
|
+
*/
|
|
38
|
+
list(pod_id: AgentMail.pods.PodId, request?: AgentMail.pods.ListApiKeysRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListApiKeysResponse>;
|
|
39
|
+
private __list;
|
|
40
|
+
/**
|
|
41
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
42
|
+
* @param {AgentMail.ApiKeyId} api_key
|
|
43
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
44
|
+
*
|
|
45
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* await client.pods.apiKeys.delete("pod_id", "api_key")
|
|
49
|
+
*/
|
|
50
|
+
delete(pod_id: AgentMail.pods.PodId, api_key: AgentMail.ApiKeyId, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
51
|
+
private __delete;
|
|
52
|
+
}
|
|
@@ -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.pods.PodId} pod_id
|
|
25
|
+
* @param {AgentMail.CreateApiKeyRequest} request
|
|
26
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
29
|
+
* @throws {@link AgentMail.ValidationError}
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* await client.pods.apiKeys.create("pod_id", {
|
|
33
|
+
* name: "name"
|
|
34
|
+
* })
|
|
35
|
+
*/
|
|
36
|
+
create(pod_id, request, requestOptions) {
|
|
37
|
+
return core.HttpResponsePromise.fromPromise(this.__create(pod_id, request, requestOptions));
|
|
38
|
+
}
|
|
39
|
+
__create(pod_id, request, requestOptions) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
42
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
43
|
+
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);
|
|
44
|
+
const _response = yield core.fetcher({
|
|
45
|
+
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)
|
|
46
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/api-keys`),
|
|
47
|
+
method: "POST",
|
|
48
|
+
headers: _headers,
|
|
49
|
+
contentType: "application/json",
|
|
50
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
51
|
+
requestType: "json",
|
|
52
|
+
body: serializers.CreateApiKeyRequest.jsonOrThrow(request, {
|
|
53
|
+
unrecognizedObjectKeys: "strip",
|
|
54
|
+
omitUndefined: true,
|
|
55
|
+
}),
|
|
56
|
+
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,
|
|
57
|
+
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,
|
|
58
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
59
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
60
|
+
logging: this._options.logging,
|
|
61
|
+
});
|
|
62
|
+
if (_response.ok) {
|
|
63
|
+
return {
|
|
64
|
+
data: serializers.CreateApiKeyResponse.parseOrThrow(_response.body, {
|
|
65
|
+
unrecognizedObjectKeys: "passthrough",
|
|
66
|
+
allowUnrecognizedUnionMembers: true,
|
|
67
|
+
allowUnrecognizedEnumValues: true,
|
|
68
|
+
skipValidation: true,
|
|
69
|
+
breadcrumbsPrefix: ["response"],
|
|
70
|
+
}),
|
|
71
|
+
rawResponse: _response.rawResponse,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (_response.error.reason === "status-code") {
|
|
75
|
+
switch (_response.error.statusCode) {
|
|
76
|
+
case 404:
|
|
77
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
78
|
+
unrecognizedObjectKeys: "passthrough",
|
|
79
|
+
allowUnrecognizedUnionMembers: true,
|
|
80
|
+
allowUnrecognizedEnumValues: true,
|
|
81
|
+
skipValidation: true,
|
|
82
|
+
breadcrumbsPrefix: ["response"],
|
|
83
|
+
}), _response.rawResponse);
|
|
84
|
+
case 400:
|
|
85
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.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
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/pods/{pod_id}/api-keys");
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
105
|
+
* @param {AgentMail.pods.ListApiKeysRequest} request
|
|
106
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
107
|
+
*
|
|
108
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* await client.pods.apiKeys.list("pod_id")
|
|
112
|
+
*/
|
|
113
|
+
list(pod_id, request = {}, requestOptions) {
|
|
114
|
+
return core.HttpResponsePromise.fromPromise(this.__list(pod_id, request, requestOptions));
|
|
115
|
+
}
|
|
116
|
+
__list(pod_id_1) {
|
|
117
|
+
return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
|
|
118
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
119
|
+
const { limit, pageToken } = request;
|
|
120
|
+
const _queryParams = {
|
|
121
|
+
limit,
|
|
122
|
+
page_token: pageToken,
|
|
123
|
+
};
|
|
124
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
125
|
+
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);
|
|
126
|
+
const _response = yield core.fetcher({
|
|
127
|
+
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)
|
|
128
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/api-keys`),
|
|
129
|
+
method: "GET",
|
|
130
|
+
headers: _headers,
|
|
131
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
132
|
+
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,
|
|
133
|
+
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,
|
|
134
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
135
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
136
|
+
logging: this._options.logging,
|
|
137
|
+
});
|
|
138
|
+
if (_response.ok) {
|
|
139
|
+
return {
|
|
140
|
+
data: serializers.ListApiKeysResponse.parseOrThrow(_response.body, {
|
|
141
|
+
unrecognizedObjectKeys: "passthrough",
|
|
142
|
+
allowUnrecognizedUnionMembers: true,
|
|
143
|
+
allowUnrecognizedEnumValues: true,
|
|
144
|
+
skipValidation: true,
|
|
145
|
+
breadcrumbsPrefix: ["response"],
|
|
146
|
+
}),
|
|
147
|
+
rawResponse: _response.rawResponse,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
if (_response.error.reason === "status-code") {
|
|
151
|
+
switch (_response.error.statusCode) {
|
|
152
|
+
case 404:
|
|
153
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.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, "GET", "/v0/pods/{pod_id}/api-keys");
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
173
|
+
* @param {AgentMail.ApiKeyId} api_key
|
|
174
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
175
|
+
*
|
|
176
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* await client.pods.apiKeys.delete("pod_id", "api_key")
|
|
180
|
+
*/
|
|
181
|
+
delete(pod_id, api_key, requestOptions) {
|
|
182
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(pod_id, api_key, requestOptions));
|
|
183
|
+
}
|
|
184
|
+
__delete(pod_id, api_key, 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/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/api-keys/${core.url.encodePathParam(serializers.ApiKeyId.jsonOrThrow(api_key, { 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/pods/{pod_id}/api-keys/{api_key}");
|
|
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";
|
|
@@ -36,10 +36,11 @@ export class DomainsClient {
|
|
|
36
36
|
__list(pod_id_1) {
|
|
37
37
|
return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
|
|
38
38
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
39
|
-
const { limit, pageToken } = request;
|
|
39
|
+
const { limit, pageToken, ascending } = request;
|
|
40
40
|
const _queryParams = {
|
|
41
41
|
limit,
|
|
42
42
|
page_token: pageToken,
|
|
43
|
+
ascending,
|
|
43
44
|
};
|
|
44
45
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
45
46
|
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);
|
|
@@ -36,10 +36,11 @@ export class InboxesClient {
|
|
|
36
36
|
__list(pod_id_1) {
|
|
37
37
|
return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
|
|
38
38
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
39
|
-
const { limit, pageToken } = request;
|
|
39
|
+
const { limit, pageToken, ascending } = request;
|
|
40
40
|
const _queryParams = {
|
|
41
41
|
limit,
|
|
42
42
|
page_token: pageToken,
|
|
43
|
+
ascending,
|
|
43
44
|
};
|
|
44
45
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
45
46
|
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);
|
|
@@ -33,10 +33,11 @@ export class WebhooksClient {
|
|
|
33
33
|
__list() {
|
|
34
34
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
35
35
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
36
|
-
const { limit, pageToken } = request;
|
|
36
|
+
const { limit, pageToken, ascending } = request;
|
|
37
37
|
const _queryParams = {
|
|
38
38
|
limit,
|
|
39
39
|
page_token: pageToken,
|
|
40
|
+
ascending,
|
|
40
41
|
};
|
|
41
42
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
42
43
|
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);
|