agentmail 0.5.21 → 0.5.22
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/Client.d.ts +6 -0
- package/dist/cjs/Client.js +36 -26
- package/dist/cjs/api/resources/accounts/client/Client.d.ts +37 -0
- package/dist/cjs/api/resources/accounts/client/Client.js +192 -0
- package/dist/cjs/api/resources/accounts/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/accounts/client/index.js +17 -0
- package/dist/cjs/api/resources/accounts/client/requests/ListAccountsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/accounts/client/requests/ListAccountsRequest.js +3 -0
- package/dist/cjs/api/resources/accounts/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/accounts/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/accounts/exports.d.ts +2 -0
- package/dist/cjs/api/resources/accounts/exports.js +21 -0
- package/dist/cjs/api/resources/accounts/index.d.ts +2 -0
- package/dist/cjs/api/resources/accounts/index.js +18 -0
- package/dist/cjs/api/resources/accounts/types/Account.d.ts +19 -0
- package/dist/cjs/api/resources/accounts/types/Account.js +3 -0
- package/dist/cjs/api/resources/accounts/types/AccountId.d.ts +4 -0
- package/dist/cjs/api/resources/accounts/types/AccountId.js +3 -0
- package/dist/cjs/api/resources/accounts/types/ListAccountsResponse.d.ts +7 -0
- package/dist/cjs/api/resources/accounts/types/ListAccountsResponse.js +3 -0
- package/dist/cjs/api/resources/accounts/types/ProviderId.d.ts +4 -0
- package/dist/cjs/api/resources/accounts/types/ProviderId.js +3 -0
- package/dist/cjs/api/resources/accounts/types/index.d.ts +4 -0
- package/dist/cjs/api/resources/accounts/types/index.js +20 -0
- package/dist/cjs/api/resources/index.d.ts +6 -0
- package/dist/cjs/api/resources/index.js +10 -4
- package/dist/cjs/api/resources/providers/client/Client.d.ts +86 -0
- package/dist/cjs/api/resources/providers/client/Client.js +423 -0
- package/dist/cjs/api/resources/providers/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/providers/client/index.js +17 -0
- package/dist/cjs/api/resources/providers/client/requests/ListProviderAccountsRequest.d.ts +9 -0
- package/dist/cjs/api/resources/providers/client/requests/ListProviderAccountsRequest.js +3 -0
- package/dist/cjs/api/resources/providers/client/requests/ListProvidersRequest.d.ts +9 -0
- package/dist/cjs/api/resources/providers/client/requests/ListProvidersRequest.js +3 -0
- package/dist/cjs/api/resources/providers/client/requests/SearchProvidersRequest.d.ts +12 -0
- package/dist/cjs/api/resources/providers/client/requests/SearchProvidersRequest.js +3 -0
- package/dist/cjs/api/resources/providers/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/providers/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/providers/exports.d.ts +2 -0
- package/dist/cjs/api/resources/providers/exports.js +21 -0
- package/dist/cjs/api/resources/providers/index.d.ts +2 -0
- package/dist/cjs/api/resources/providers/index.js +18 -0
- package/dist/cjs/api/resources/providers/types/ConnectProviderAccepted.d.ts +8 -0
- package/dist/cjs/api/resources/providers/types/ConnectProviderAccepted.js +3 -0
- package/dist/cjs/api/resources/providers/types/ConnectProviderBody.d.ts +7 -0
- package/dist/cjs/api/resources/providers/types/ConnectProviderBody.js +3 -0
- package/dist/cjs/api/resources/providers/types/ListProviderAccountsResponse.d.ts +8 -0
- package/dist/cjs/api/resources/providers/types/ListProviderAccountsResponse.js +3 -0
- package/dist/cjs/api/resources/providers/types/ListProvidersResponse.d.ts +7 -0
- package/dist/cjs/api/resources/providers/types/ListProvidersResponse.js +3 -0
- package/dist/cjs/api/resources/providers/types/Provider.d.ts +14 -0
- package/dist/cjs/api/resources/providers/types/Provider.js +3 -0
- package/dist/cjs/api/resources/providers/types/SearchProvidersResponse.d.ts +6 -0
- package/dist/cjs/api/resources/providers/types/SearchProvidersResponse.js +3 -0
- package/dist/cjs/api/resources/providers/types/index.d.ts +6 -0
- package/dist/cjs/api/resources/providers/types/index.js +22 -0
- package/dist/cjs/serialization/resources/accounts/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/accounts/index.js +17 -0
- package/dist/cjs/serialization/resources/accounts/types/Account.d.ts +22 -0
- package/dist/cjs/serialization/resources/accounts/types/Account.js +54 -0
- package/dist/cjs/serialization/resources/accounts/types/AccountId.d.ts +7 -0
- package/dist/cjs/serialization/resources/accounts/types/AccountId.js +39 -0
- package/dist/cjs/serialization/resources/accounts/types/ListAccountsResponse.d.ts +16 -0
- package/dist/cjs/serialization/resources/accounts/types/ListAccountsResponse.js +48 -0
- package/dist/cjs/serialization/resources/accounts/types/ProviderId.d.ts +7 -0
- package/dist/cjs/serialization/resources/accounts/types/ProviderId.js +39 -0
- package/dist/cjs/serialization/resources/accounts/types/index.d.ts +4 -0
- package/dist/cjs/serialization/resources/accounts/types/index.js +20 -0
- package/dist/cjs/serialization/resources/index.d.ts +4 -0
- package/dist/cjs/serialization/resources/index.js +5 -1
- package/dist/cjs/serialization/resources/providers/client/connect.d.ts +8 -0
- package/dist/cjs/serialization/resources/providers/client/connect.js +6 -0
- package/dist/cjs/serialization/resources/providers/client/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/providers/client/index.js +37 -0
- package/dist/cjs/serialization/resources/providers/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/providers/index.js +18 -0
- package/dist/cjs/serialization/resources/providers/types/ConnectProviderAccepted.d.ts +11 -0
- package/dist/cjs/serialization/resources/providers/types/ConnectProviderAccepted.js +43 -0
- package/dist/cjs/serialization/resources/providers/types/ConnectProviderBody.d.ts +11 -0
- package/dist/cjs/serialization/resources/providers/types/ConnectProviderBody.js +43 -0
- package/dist/cjs/serialization/resources/providers/types/ListProviderAccountsResponse.d.ts +18 -0
- package/dist/cjs/serialization/resources/providers/types/ListProviderAccountsResponse.js +50 -0
- package/dist/cjs/serialization/resources/providers/types/ListProvidersResponse.d.ts +16 -0
- package/dist/cjs/serialization/resources/providers/types/ListProvidersResponse.js +48 -0
- package/dist/cjs/serialization/resources/providers/types/Provider.d.ts +16 -0
- package/dist/cjs/serialization/resources/providers/types/Provider.js +48 -0
- package/dist/cjs/serialization/resources/providers/types/SearchProvidersResponse.d.ts +14 -0
- package/dist/cjs/serialization/resources/providers/types/SearchProvidersResponse.js +46 -0
- package/dist/cjs/serialization/resources/providers/types/index.d.ts +6 -0
- package/dist/cjs/serialization/resources/providers/types/index.js +22 -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/Client.d.mts +6 -0
- package/dist/esm/Client.mjs +10 -0
- package/dist/esm/api/resources/accounts/client/Client.d.mts +37 -0
- package/dist/esm/api/resources/accounts/client/Client.mjs +155 -0
- package/dist/esm/api/resources/accounts/client/index.d.mts +1 -0
- package/dist/esm/api/resources/accounts/client/index.mjs +1 -0
- package/dist/esm/api/resources/accounts/client/requests/ListAccountsRequest.d.mts +10 -0
- package/dist/esm/api/resources/accounts/client/requests/ListAccountsRequest.mjs +2 -0
- package/dist/esm/api/resources/accounts/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/accounts/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/accounts/exports.d.mts +2 -0
- package/dist/esm/api/resources/accounts/exports.mjs +3 -0
- package/dist/esm/api/resources/accounts/index.d.mts +2 -0
- package/dist/esm/api/resources/accounts/index.mjs +2 -0
- package/dist/esm/api/resources/accounts/types/Account.d.mts +19 -0
- package/dist/esm/api/resources/accounts/types/Account.mjs +2 -0
- package/dist/esm/api/resources/accounts/types/AccountId.d.mts +4 -0
- package/dist/esm/api/resources/accounts/types/AccountId.mjs +2 -0
- package/dist/esm/api/resources/accounts/types/ListAccountsResponse.d.mts +7 -0
- package/dist/esm/api/resources/accounts/types/ListAccountsResponse.mjs +2 -0
- package/dist/esm/api/resources/accounts/types/ProviderId.d.mts +4 -0
- package/dist/esm/api/resources/accounts/types/ProviderId.mjs +2 -0
- package/dist/esm/api/resources/accounts/types/index.d.mts +4 -0
- package/dist/esm/api/resources/accounts/types/index.mjs +4 -0
- package/dist/esm/api/resources/index.d.mts +6 -0
- package/dist/esm/api/resources/index.mjs +6 -0
- package/dist/esm/api/resources/providers/client/Client.d.mts +86 -0
- package/dist/esm/api/resources/providers/client/Client.mjs +386 -0
- package/dist/esm/api/resources/providers/client/index.d.mts +1 -0
- package/dist/esm/api/resources/providers/client/index.mjs +1 -0
- package/dist/esm/api/resources/providers/client/requests/ListProviderAccountsRequest.d.mts +9 -0
- package/dist/esm/api/resources/providers/client/requests/ListProviderAccountsRequest.mjs +2 -0
- package/dist/esm/api/resources/providers/client/requests/ListProvidersRequest.d.mts +9 -0
- package/dist/esm/api/resources/providers/client/requests/ListProvidersRequest.mjs +2 -0
- package/dist/esm/api/resources/providers/client/requests/SearchProvidersRequest.d.mts +12 -0
- package/dist/esm/api/resources/providers/client/requests/SearchProvidersRequest.mjs +2 -0
- package/dist/esm/api/resources/providers/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/providers/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/providers/exports.d.mts +2 -0
- package/dist/esm/api/resources/providers/exports.mjs +3 -0
- package/dist/esm/api/resources/providers/index.d.mts +2 -0
- package/dist/esm/api/resources/providers/index.mjs +2 -0
- package/dist/esm/api/resources/providers/types/ConnectProviderAccepted.d.mts +8 -0
- package/dist/esm/api/resources/providers/types/ConnectProviderAccepted.mjs +2 -0
- package/dist/esm/api/resources/providers/types/ConnectProviderBody.d.mts +7 -0
- package/dist/esm/api/resources/providers/types/ConnectProviderBody.mjs +2 -0
- package/dist/esm/api/resources/providers/types/ListProviderAccountsResponse.d.mts +8 -0
- package/dist/esm/api/resources/providers/types/ListProviderAccountsResponse.mjs +2 -0
- package/dist/esm/api/resources/providers/types/ListProvidersResponse.d.mts +7 -0
- package/dist/esm/api/resources/providers/types/ListProvidersResponse.mjs +2 -0
- package/dist/esm/api/resources/providers/types/Provider.d.mts +14 -0
- package/dist/esm/api/resources/providers/types/Provider.mjs +2 -0
- package/dist/esm/api/resources/providers/types/SearchProvidersResponse.d.mts +6 -0
- package/dist/esm/api/resources/providers/types/SearchProvidersResponse.mjs +2 -0
- package/dist/esm/api/resources/providers/types/index.d.mts +6 -0
- package/dist/esm/api/resources/providers/types/index.mjs +6 -0
- package/dist/esm/serialization/resources/accounts/index.d.mts +1 -0
- package/dist/esm/serialization/resources/accounts/index.mjs +1 -0
- package/dist/esm/serialization/resources/accounts/types/Account.d.mts +22 -0
- package/dist/esm/serialization/resources/accounts/types/Account.mjs +18 -0
- package/dist/esm/serialization/resources/accounts/types/AccountId.d.mts +7 -0
- package/dist/esm/serialization/resources/accounts/types/AccountId.mjs +3 -0
- package/dist/esm/serialization/resources/accounts/types/ListAccountsResponse.d.mts +16 -0
- package/dist/esm/serialization/resources/accounts/types/ListAccountsResponse.mjs +12 -0
- package/dist/esm/serialization/resources/accounts/types/ProviderId.d.mts +7 -0
- package/dist/esm/serialization/resources/accounts/types/ProviderId.mjs +3 -0
- package/dist/esm/serialization/resources/accounts/types/index.d.mts +4 -0
- package/dist/esm/serialization/resources/accounts/types/index.mjs +4 -0
- package/dist/esm/serialization/resources/index.d.mts +4 -0
- package/dist/esm/serialization/resources/index.mjs +4 -0
- package/dist/esm/serialization/resources/providers/client/connect.d.mts +8 -0
- package/dist/esm/serialization/resources/providers/client/connect.mjs +3 -0
- package/dist/esm/serialization/resources/providers/client/index.d.mts +1 -0
- package/dist/esm/serialization/resources/providers/client/index.mjs +1 -0
- package/dist/esm/serialization/resources/providers/index.d.mts +2 -0
- package/dist/esm/serialization/resources/providers/index.mjs +2 -0
- package/dist/esm/serialization/resources/providers/types/ConnectProviderAccepted.d.mts +11 -0
- package/dist/esm/serialization/resources/providers/types/ConnectProviderAccepted.mjs +7 -0
- package/dist/esm/serialization/resources/providers/types/ConnectProviderBody.d.mts +11 -0
- package/dist/esm/serialization/resources/providers/types/ConnectProviderBody.mjs +7 -0
- package/dist/esm/serialization/resources/providers/types/ListProviderAccountsResponse.d.mts +18 -0
- package/dist/esm/serialization/resources/providers/types/ListProviderAccountsResponse.mjs +14 -0
- package/dist/esm/serialization/resources/providers/types/ListProvidersResponse.d.mts +16 -0
- package/dist/esm/serialization/resources/providers/types/ListProvidersResponse.mjs +12 -0
- package/dist/esm/serialization/resources/providers/types/Provider.d.mts +16 -0
- package/dist/esm/serialization/resources/providers/types/Provider.mjs +12 -0
- package/dist/esm/serialization/resources/providers/types/SearchProvidersResponse.d.mts +14 -0
- package/dist/esm/serialization/resources/providers/types/SearchProvidersResponse.mjs +10 -0
- package/dist/esm/serialization/resources/providers/types/index.d.mts +6 -0
- package/dist/esm/serialization/resources/providers/types/index.mjs +6 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms.txt +1 -0
- package/package.json +23 -1
- package/reference.md +435 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.ConnectProviderBody = void 0;
|
|
38
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
39
|
+
const InboxId_js_1 = require("../../inboxes/types/InboxId.js");
|
|
40
|
+
exports.ConnectProviderBody = core.serialization.object({
|
|
41
|
+
inboxId: core.serialization.property("inbox_id", InboxId_js_1.InboxId.optional()),
|
|
42
|
+
authorize: core.serialization.boolean().optional(),
|
|
43
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.js";
|
|
2
|
+
import * as core from "../../../../core/index.js";
|
|
3
|
+
import type * as serializers from "../../../index.js";
|
|
4
|
+
import { Count } from "../../../types/Count.js";
|
|
5
|
+
import { Limit } from "../../../types/Limit.js";
|
|
6
|
+
import { PageToken } from "../../../types/PageToken.js";
|
|
7
|
+
import { Account } from "../../accounts/types/Account.js";
|
|
8
|
+
import { Provider } from "./Provider.js";
|
|
9
|
+
export declare const ListProviderAccountsResponse: core.serialization.ObjectSchema<serializers.ListProviderAccountsResponse.Raw, AgentMail.ListProviderAccountsResponse>;
|
|
10
|
+
export declare namespace ListProviderAccountsResponse {
|
|
11
|
+
interface Raw {
|
|
12
|
+
provider?: Provider.Raw | null;
|
|
13
|
+
count: Count.Raw;
|
|
14
|
+
limit: Limit.Raw;
|
|
15
|
+
next_page_token?: PageToken.Raw | null;
|
|
16
|
+
accounts: Account.Raw[];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.ListProviderAccountsResponse = void 0;
|
|
38
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
39
|
+
const Count_js_1 = require("../../../types/Count.js");
|
|
40
|
+
const Limit_js_1 = require("../../../types/Limit.js");
|
|
41
|
+
const PageToken_js_1 = require("../../../types/PageToken.js");
|
|
42
|
+
const Account_js_1 = require("../../accounts/types/Account.js");
|
|
43
|
+
const Provider_js_1 = require("./Provider.js");
|
|
44
|
+
exports.ListProviderAccountsResponse = core.serialization.object({
|
|
45
|
+
provider: Provider_js_1.Provider.optional(),
|
|
46
|
+
count: Count_js_1.Count,
|
|
47
|
+
limit: Limit_js_1.Limit,
|
|
48
|
+
nextPageToken: core.serialization.property("next_page_token", PageToken_js_1.PageToken.optional()),
|
|
49
|
+
accounts: core.serialization.list(Account_js_1.Account),
|
|
50
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.js";
|
|
2
|
+
import * as core from "../../../../core/index.js";
|
|
3
|
+
import type * as serializers from "../../../index.js";
|
|
4
|
+
import { Count } from "../../../types/Count.js";
|
|
5
|
+
import { Limit } from "../../../types/Limit.js";
|
|
6
|
+
import { PageToken } from "../../../types/PageToken.js";
|
|
7
|
+
import { Provider } from "./Provider.js";
|
|
8
|
+
export declare const ListProvidersResponse: core.serialization.ObjectSchema<serializers.ListProvidersResponse.Raw, AgentMail.ListProvidersResponse>;
|
|
9
|
+
export declare namespace ListProvidersResponse {
|
|
10
|
+
interface Raw {
|
|
11
|
+
count: Count.Raw;
|
|
12
|
+
limit: Limit.Raw;
|
|
13
|
+
next_page_token?: PageToken.Raw | null;
|
|
14
|
+
providers: Provider.Raw[];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.ListProvidersResponse = void 0;
|
|
38
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
39
|
+
const Count_js_1 = require("../../../types/Count.js");
|
|
40
|
+
const Limit_js_1 = require("../../../types/Limit.js");
|
|
41
|
+
const PageToken_js_1 = require("../../../types/PageToken.js");
|
|
42
|
+
const Provider_js_1 = require("./Provider.js");
|
|
43
|
+
exports.ListProvidersResponse = core.serialization.object({
|
|
44
|
+
count: Count_js_1.Count,
|
|
45
|
+
limit: Limit_js_1.Limit,
|
|
46
|
+
nextPageToken: core.serialization.property("next_page_token", PageToken_js_1.PageToken.optional()),
|
|
47
|
+
providers: core.serialization.list(Provider_js_1.Provider),
|
|
48
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.js";
|
|
2
|
+
import * as core from "../../../../core/index.js";
|
|
3
|
+
import type * as serializers from "../../../index.js";
|
|
4
|
+
import { ProviderId } from "../../accounts/types/ProviderId.js";
|
|
5
|
+
export declare const Provider: core.serialization.ObjectSchema<serializers.Provider.Raw, AgentMail.Provider>;
|
|
6
|
+
export declare namespace Provider {
|
|
7
|
+
interface Raw {
|
|
8
|
+
provider_id: ProviderId.Raw;
|
|
9
|
+
name?: string | null;
|
|
10
|
+
updated_at?: string | null;
|
|
11
|
+
description?: string | null;
|
|
12
|
+
logo_url?: string | null;
|
|
13
|
+
terms_url?: string | null;
|
|
14
|
+
privacy_url?: string | null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.Provider = void 0;
|
|
38
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
39
|
+
const ProviderId_js_1 = require("../../accounts/types/ProviderId.js");
|
|
40
|
+
exports.Provider = core.serialization.object({
|
|
41
|
+
providerId: core.serialization.property("provider_id", ProviderId_js_1.ProviderId),
|
|
42
|
+
name: core.serialization.string().optional(),
|
|
43
|
+
updatedAt: core.serialization.property("updated_at", core.serialization.date().optional()),
|
|
44
|
+
description: core.serialization.string().optional(),
|
|
45
|
+
logoUrl: core.serialization.property("logo_url", core.serialization.string().optional()),
|
|
46
|
+
termsUrl: core.serialization.property("terms_url", core.serialization.string().optional()),
|
|
47
|
+
privacyUrl: core.serialization.property("privacy_url", core.serialization.string().optional()),
|
|
48
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.js";
|
|
2
|
+
import * as core from "../../../../core/index.js";
|
|
3
|
+
import type * as serializers from "../../../index.js";
|
|
4
|
+
import { Count } from "../../../types/Count.js";
|
|
5
|
+
import { Limit } from "../../../types/Limit.js";
|
|
6
|
+
import { Provider } from "./Provider.js";
|
|
7
|
+
export declare const SearchProvidersResponse: core.serialization.ObjectSchema<serializers.SearchProvidersResponse.Raw, AgentMail.SearchProvidersResponse>;
|
|
8
|
+
export declare namespace SearchProvidersResponse {
|
|
9
|
+
interface Raw {
|
|
10
|
+
count: Count.Raw;
|
|
11
|
+
limit: Limit.Raw;
|
|
12
|
+
providers: Provider.Raw[];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.SearchProvidersResponse = void 0;
|
|
38
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
39
|
+
const Count_js_1 = require("../../../types/Count.js");
|
|
40
|
+
const Limit_js_1 = require("../../../types/Limit.js");
|
|
41
|
+
const Provider_js_1 = require("./Provider.js");
|
|
42
|
+
exports.SearchProvidersResponse = core.serialization.object({
|
|
43
|
+
count: Count_js_1.Count,
|
|
44
|
+
limit: Limit_js_1.Limit,
|
|
45
|
+
providers: core.serialization.list(Provider_js_1.Provider),
|
|
46
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ConnectProviderAccepted.js"), exports);
|
|
18
|
+
__exportStar(require("./ConnectProviderBody.js"), exports);
|
|
19
|
+
__exportStar(require("./ListProviderAccountsResponse.js"), exports);
|
|
20
|
+
__exportStar(require("./ListProvidersResponse.js"), exports);
|
|
21
|
+
__exportStar(require("./Provider.js"), exports);
|
|
22
|
+
__exportStar(require("./SearchProvidersResponse.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.5.
|
|
1
|
+
export declare const SDK_VERSION = "0.5.22";
|
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.5.
|
|
10
|
-
"User-Agent": "agentmail/0.5.
|
|
9
|
+
"X-Fern-SDK-Version": "0.5.22",
|
|
10
|
+
"User-Agent": "agentmail/0.5.22",
|
|
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);
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AccountsClient } from "./api/resources/accounts/client/Client.mjs";
|
|
1
2
|
import { AgentClient } from "./api/resources/agent/client/Client.mjs";
|
|
2
3
|
import { ApiKeysClient } from "./api/resources/apiKeys/client/Client.mjs";
|
|
3
4
|
import { AuthClient } from "./api/resources/auth/client/Client.mjs";
|
|
@@ -8,6 +9,7 @@ import { ListsClient } from "./api/resources/lists/client/Client.mjs";
|
|
|
8
9
|
import { MetricsClient } from "./api/resources/metrics/client/Client.mjs";
|
|
9
10
|
import { OrganizationsClient } from "./api/resources/organizations/client/Client.mjs";
|
|
10
11
|
import { PodsClient } from "./api/resources/pods/client/Client.mjs";
|
|
12
|
+
import { ProvidersClient } from "./api/resources/providers/client/Client.mjs";
|
|
11
13
|
import { ThreadsClient } from "./api/resources/threads/client/Client.mjs";
|
|
12
14
|
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
13
15
|
import { WebsocketsClient } from "./api/resources/websockets/client/Client.mjs";
|
|
@@ -24,6 +26,7 @@ export declare class AgentMailClient {
|
|
|
24
26
|
protected _inboxes: InboxesClient | undefined;
|
|
25
27
|
protected _pods: PodsClient | undefined;
|
|
26
28
|
protected _webhooks: WebhooksClient | undefined;
|
|
29
|
+
protected _accounts: AccountsClient | undefined;
|
|
27
30
|
protected _agent: AgentClient | undefined;
|
|
28
31
|
protected _apiKeys: ApiKeysClient | undefined;
|
|
29
32
|
protected _auth: AuthClient | undefined;
|
|
@@ -32,12 +35,14 @@ export declare class AgentMailClient {
|
|
|
32
35
|
protected _lists: ListsClient | undefined;
|
|
33
36
|
protected _metrics: MetricsClient | undefined;
|
|
34
37
|
protected _organizations: OrganizationsClient | undefined;
|
|
38
|
+
protected _providers: ProvidersClient | undefined;
|
|
35
39
|
protected _threads: ThreadsClient | undefined;
|
|
36
40
|
protected _websockets: WebsocketsClient | undefined;
|
|
37
41
|
constructor(options?: AgentMailClient.Options);
|
|
38
42
|
get inboxes(): InboxesClient;
|
|
39
43
|
get pods(): PodsClient;
|
|
40
44
|
get webhooks(): WebhooksClient;
|
|
45
|
+
get accounts(): AccountsClient;
|
|
41
46
|
get agent(): AgentClient;
|
|
42
47
|
get apiKeys(): ApiKeysClient;
|
|
43
48
|
get auth(): AuthClient;
|
|
@@ -46,6 +51,7 @@ export declare class AgentMailClient {
|
|
|
46
51
|
get lists(): ListsClient;
|
|
47
52
|
get metrics(): MetricsClient;
|
|
48
53
|
get organizations(): OrganizationsClient;
|
|
54
|
+
get providers(): ProvidersClient;
|
|
49
55
|
get threads(): ThreadsClient;
|
|
50
56
|
get websockets(): WebsocketsClient;
|
|
51
57
|
/**
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
import { AccountsClient } from "./api/resources/accounts/client/Client.mjs";
|
|
11
12
|
import { AgentClient } from "./api/resources/agent/client/Client.mjs";
|
|
12
13
|
import { ApiKeysClient } from "./api/resources/apiKeys/client/Client.mjs";
|
|
13
14
|
import { AuthClient } from "./api/resources/auth/client/Client.mjs";
|
|
@@ -18,6 +19,7 @@ import { ListsClient } from "./api/resources/lists/client/Client.mjs";
|
|
|
18
19
|
import { MetricsClient } from "./api/resources/metrics/client/Client.mjs";
|
|
19
20
|
import { OrganizationsClient } from "./api/resources/organizations/client/Client.mjs";
|
|
20
21
|
import { PodsClient } from "./api/resources/pods/client/Client.mjs";
|
|
22
|
+
import { ProvidersClient } from "./api/resources/providers/client/Client.mjs";
|
|
21
23
|
import { ThreadsClient } from "./api/resources/threads/client/Client.mjs";
|
|
22
24
|
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
23
25
|
import { WebsocketsClient } from "./api/resources/websockets/client/Client.mjs";
|
|
@@ -40,6 +42,10 @@ export class AgentMailClient {
|
|
|
40
42
|
var _a;
|
|
41
43
|
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new WebhooksClient(this._options)));
|
|
42
44
|
}
|
|
45
|
+
get accounts() {
|
|
46
|
+
var _a;
|
|
47
|
+
return ((_a = this._accounts) !== null && _a !== void 0 ? _a : (this._accounts = new AccountsClient(this._options)));
|
|
48
|
+
}
|
|
43
49
|
get agent() {
|
|
44
50
|
var _a;
|
|
45
51
|
return ((_a = this._agent) !== null && _a !== void 0 ? _a : (this._agent = new AgentClient(this._options)));
|
|
@@ -72,6 +78,10 @@ export class AgentMailClient {
|
|
|
72
78
|
var _a;
|
|
73
79
|
return ((_a = this._organizations) !== null && _a !== void 0 ? _a : (this._organizations = new OrganizationsClient(this._options)));
|
|
74
80
|
}
|
|
81
|
+
get providers() {
|
|
82
|
+
var _a;
|
|
83
|
+
return ((_a = this._providers) !== null && _a !== void 0 ? _a : (this._providers = new ProvidersClient(this._options)));
|
|
84
|
+
}
|
|
75
85
|
get threads() {
|
|
76
86
|
var _a;
|
|
77
87
|
return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new ThreadsClient(this._options)));
|
|
@@ -0,0 +1,37 @@
|
|
|
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 AccountsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class AccountsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<AccountsClient.Options>;
|
|
12
|
+
constructor(options?: AccountsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Lists accounts across all providers.
|
|
15
|
+
*
|
|
16
|
+
* @param {AgentMail.ListAccountsRequest} request
|
|
17
|
+
* @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link AgentMail.ValidationError}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* await client.accounts.list()
|
|
23
|
+
*/
|
|
24
|
+
list(request?: AgentMail.ListAccountsRequest, requestOptions?: AccountsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListAccountsResponse>;
|
|
25
|
+
private __list;
|
|
26
|
+
/**
|
|
27
|
+
* @param {AgentMail.AccountId} account_id
|
|
28
|
+
* @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
|
+
*
|
|
30
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* await client.accounts.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
|
|
34
|
+
*/
|
|
35
|
+
get(account_id: AgentMail.AccountId, requestOptions?: AccountsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Account>;
|
|
36
|
+
private __get;
|
|
37
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
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 AccountsClient {
|
|
20
|
+
constructor(options = {}) {
|
|
21
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Lists accounts across all providers.
|
|
25
|
+
*
|
|
26
|
+
* @param {AgentMail.ListAccountsRequest} request
|
|
27
|
+
* @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
|
+
*
|
|
29
|
+
* @throws {@link AgentMail.ValidationError}
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* await client.accounts.list()
|
|
33
|
+
*/
|
|
34
|
+
list(request = {}, requestOptions) {
|
|
35
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
36
|
+
}
|
|
37
|
+
__list() {
|
|
38
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
40
|
+
const { limit, pageToken, ascending } = request;
|
|
41
|
+
const _queryParams = {
|
|
42
|
+
limit,
|
|
43
|
+
page_token: pageToken,
|
|
44
|
+
ascending,
|
|
45
|
+
};
|
|
46
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
47
|
+
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);
|
|
48
|
+
const _response = yield core.fetcher({
|
|
49
|
+
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)
|
|
50
|
+
.http, "/v0/accounts"),
|
|
51
|
+
method: "GET",
|
|
52
|
+
headers: _headers,
|
|
53
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
54
|
+
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,
|
|
55
|
+
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,
|
|
56
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
57
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
58
|
+
logging: this._options.logging,
|
|
59
|
+
});
|
|
60
|
+
if (_response.ok) {
|
|
61
|
+
return {
|
|
62
|
+
data: serializers.ListAccountsResponse.parseOrThrow(_response.body, {
|
|
63
|
+
unrecognizedObjectKeys: "passthrough",
|
|
64
|
+
allowUnrecognizedUnionMembers: true,
|
|
65
|
+
allowUnrecognizedEnumValues: true,
|
|
66
|
+
skipValidation: true,
|
|
67
|
+
breadcrumbsPrefix: ["response"],
|
|
68
|
+
}),
|
|
69
|
+
rawResponse: _response.rawResponse,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (_response.error.reason === "status-code") {
|
|
73
|
+
switch (_response.error.statusCode) {
|
|
74
|
+
case 400:
|
|
75
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
76
|
+
unrecognizedObjectKeys: "passthrough",
|
|
77
|
+
allowUnrecognizedUnionMembers: true,
|
|
78
|
+
allowUnrecognizedEnumValues: true,
|
|
79
|
+
skipValidation: true,
|
|
80
|
+
breadcrumbsPrefix: ["response"],
|
|
81
|
+
}), _response.rawResponse);
|
|
82
|
+
default:
|
|
83
|
+
throw new errors.AgentMailError({
|
|
84
|
+
statusCode: _response.error.statusCode,
|
|
85
|
+
body: _response.error.body,
|
|
86
|
+
rawResponse: _response.rawResponse,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/accounts");
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* @param {AgentMail.AccountId} account_id
|
|
95
|
+
* @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
96
|
+
*
|
|
97
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* await client.accounts.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
|
|
101
|
+
*/
|
|
102
|
+
get(account_id, requestOptions) {
|
|
103
|
+
return core.HttpResponsePromise.fromPromise(this.__get(account_id, requestOptions));
|
|
104
|
+
}
|
|
105
|
+
__get(account_id, requestOptions) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
108
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
109
|
+
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);
|
|
110
|
+
const _response = yield core.fetcher({
|
|
111
|
+
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)
|
|
112
|
+
.http, `/v0/accounts/${core.url.encodePathParam(serializers.AccountId.jsonOrThrow(account_id, { omitUndefined: true }))}`),
|
|
113
|
+
method: "GET",
|
|
114
|
+
headers: _headers,
|
|
115
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
116
|
+
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,
|
|
117
|
+
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,
|
|
118
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
119
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
120
|
+
logging: this._options.logging,
|
|
121
|
+
});
|
|
122
|
+
if (_response.ok) {
|
|
123
|
+
return {
|
|
124
|
+
data: serializers.Account.parseOrThrow(_response.body, {
|
|
125
|
+
unrecognizedObjectKeys: "passthrough",
|
|
126
|
+
allowUnrecognizedUnionMembers: true,
|
|
127
|
+
allowUnrecognizedEnumValues: true,
|
|
128
|
+
skipValidation: true,
|
|
129
|
+
breadcrumbsPrefix: ["response"],
|
|
130
|
+
}),
|
|
131
|
+
rawResponse: _response.rawResponse,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
if (_response.error.reason === "status-code") {
|
|
135
|
+
switch (_response.error.statusCode) {
|
|
136
|
+
case 404:
|
|
137
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
138
|
+
unrecognizedObjectKeys: "passthrough",
|
|
139
|
+
allowUnrecognizedUnionMembers: true,
|
|
140
|
+
allowUnrecognizedEnumValues: true,
|
|
141
|
+
skipValidation: true,
|
|
142
|
+
breadcrumbsPrefix: ["response"],
|
|
143
|
+
}), _response.rawResponse);
|
|
144
|
+
default:
|
|
145
|
+
throw new errors.AgentMailError({
|
|
146
|
+
statusCode: _response.error.statusCode,
|
|
147
|
+
body: _response.error.body,
|
|
148
|
+
rawResponse: _response.rawResponse,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/accounts/{account_id}");
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|