agentmail 0.1.14 → 0.1.16

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.
Files changed (69) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +13 -8
  4. package/dist/cjs/api/resources/domains/types/RecordStatus.d.ts +2 -1
  5. package/dist/cjs/api/resources/domains/types/RecordStatus.js +2 -1
  6. package/dist/cjs/api/resources/domains/types/VerificationStatus.d.ts +4 -1
  7. package/dist/cjs/api/resources/domains/types/VerificationStatus.js +4 -1
  8. package/dist/cjs/api/resources/index.d.ts +2 -0
  9. package/dist/cjs/api/resources/index.js +3 -1
  10. package/dist/cjs/api/resources/organizations/client/Client.d.ts +24 -0
  11. package/dist/cjs/api/resources/organizations/client/Client.js +121 -0
  12. package/dist/cjs/api/resources/organizations/client/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/organizations/client/index.js +2 -0
  14. package/dist/cjs/api/resources/organizations/index.d.ts +2 -0
  15. package/dist/cjs/api/resources/organizations/index.js +18 -0
  16. package/dist/cjs/api/resources/organizations/types/Organization.d.ts +19 -0
  17. package/dist/cjs/api/resources/organizations/types/Organization.js +3 -0
  18. package/dist/cjs/api/resources/organizations/types/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/organizations/types/index.js +17 -0
  20. package/dist/cjs/serialization/resources/domains/types/RecordStatus.d.ts +1 -1
  21. package/dist/cjs/serialization/resources/domains/types/RecordStatus.js +1 -1
  22. package/dist/cjs/serialization/resources/domains/types/VerificationStatus.d.ts +1 -1
  23. package/dist/cjs/serialization/resources/domains/types/VerificationStatus.js +1 -1
  24. package/dist/cjs/serialization/resources/index.d.ts +2 -0
  25. package/dist/cjs/serialization/resources/index.js +3 -1
  26. package/dist/cjs/serialization/resources/organizations/index.d.ts +1 -0
  27. package/dist/cjs/serialization/resources/organizations/index.js +17 -0
  28. package/dist/cjs/serialization/resources/organizations/types/Organization.d.ts +16 -0
  29. package/dist/cjs/serialization/resources/organizations/types/Organization.js +48 -0
  30. package/dist/cjs/serialization/resources/organizations/types/index.d.ts +1 -0
  31. package/dist/cjs/serialization/resources/organizations/types/index.js +17 -0
  32. package/dist/cjs/version.d.ts +1 -1
  33. package/dist/cjs/version.js +1 -1
  34. package/dist/esm/BaseClient.mjs +2 -2
  35. package/dist/esm/Client.d.mts +3 -0
  36. package/dist/esm/Client.mjs +5 -0
  37. package/dist/esm/api/resources/domains/types/RecordStatus.d.mts +2 -1
  38. package/dist/esm/api/resources/domains/types/RecordStatus.mjs +2 -1
  39. package/dist/esm/api/resources/domains/types/VerificationStatus.d.mts +4 -1
  40. package/dist/esm/api/resources/domains/types/VerificationStatus.mjs +4 -1
  41. package/dist/esm/api/resources/index.d.mts +2 -0
  42. package/dist/esm/api/resources/index.mjs +2 -0
  43. package/dist/esm/api/resources/organizations/client/Client.d.mts +24 -0
  44. package/dist/esm/api/resources/organizations/client/Client.mjs +84 -0
  45. package/dist/esm/api/resources/organizations/client/index.d.mts +1 -0
  46. package/dist/esm/api/resources/organizations/client/index.mjs +1 -0
  47. package/dist/esm/api/resources/organizations/index.d.mts +2 -0
  48. package/dist/esm/api/resources/organizations/index.mjs +2 -0
  49. package/dist/esm/api/resources/organizations/types/Organization.d.mts +19 -0
  50. package/dist/esm/api/resources/organizations/types/Organization.mjs +2 -0
  51. package/dist/esm/api/resources/organizations/types/index.d.mts +1 -0
  52. package/dist/esm/api/resources/organizations/types/index.mjs +1 -0
  53. package/dist/esm/serialization/resources/domains/types/RecordStatus.d.mts +1 -1
  54. package/dist/esm/serialization/resources/domains/types/RecordStatus.mjs +1 -1
  55. package/dist/esm/serialization/resources/domains/types/VerificationStatus.d.mts +1 -1
  56. package/dist/esm/serialization/resources/domains/types/VerificationStatus.mjs +1 -1
  57. package/dist/esm/serialization/resources/index.d.mts +2 -0
  58. package/dist/esm/serialization/resources/index.mjs +2 -0
  59. package/dist/esm/serialization/resources/organizations/index.d.mts +1 -0
  60. package/dist/esm/serialization/resources/organizations/index.mjs +1 -0
  61. package/dist/esm/serialization/resources/organizations/types/Organization.d.mts +16 -0
  62. package/dist/esm/serialization/resources/organizations/types/Organization.mjs +12 -0
  63. package/dist/esm/serialization/resources/organizations/types/index.d.mts +1 -0
  64. package/dist/esm/serialization/resources/organizations/types/index.mjs +1 -0
  65. package/dist/esm/version.d.mts +1 -1
  66. package/dist/esm/version.mjs +1 -1
  67. package/dist/llms-full.txt +87 -51
  68. package/package.json +1 -1
  69. package/reference.md +56 -0
@@ -1,5 +1,6 @@
1
1
  export declare const RecordStatus: {
2
2
  readonly Missing: "MISSING";
3
- readonly Verified: "VERIFIED";
3
+ readonly Invalid: "INVALID";
4
+ readonly Valid: "VALID";
4
5
  };
5
6
  export type RecordStatus = (typeof RecordStatus)[keyof typeof RecordStatus];
@@ -1,5 +1,6 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  export const RecordStatus = {
3
3
  Missing: "MISSING",
4
- Verified: "VERIFIED",
4
+ Invalid: "INVALID",
5
+ Valid: "VALID",
5
6
  };
@@ -1,6 +1,9 @@
1
1
  export declare const VerificationStatus: {
2
+ readonly NotStarted: "NOT_STARTED";
2
3
  readonly Pending: "PENDING";
4
+ readonly Invalid: "INVALID";
5
+ readonly Failed: "FAILED";
3
6
  readonly Verifying: "VERIFYING";
4
- readonly Ready: "READY";
7
+ readonly Verified: "VERIFIED";
5
8
  };
6
9
  export type VerificationStatus = (typeof VerificationStatus)[keyof typeof VerificationStatus];
@@ -1,6 +1,9 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  export const VerificationStatus = {
3
+ NotStarted: "NOT_STARTED",
3
4
  Pending: "PENDING",
5
+ Invalid: "INVALID",
6
+ Failed: "FAILED",
4
7
  Verifying: "VERIFYING",
5
- Ready: "READY",
8
+ Verified: "VERIFIED",
6
9
  };
@@ -18,6 +18,8 @@ export * from "./messages/types/index.mjs";
18
18
  export * from "./metrics/client/requests/index.mjs";
19
19
  export * as metrics from "./metrics/index.mjs";
20
20
  export * from "./metrics/types/index.mjs";
21
+ export * as organizations from "./organizations/index.mjs";
22
+ export * from "./organizations/types/index.mjs";
21
23
  export * as pods from "./pods/index.mjs";
22
24
  export * from "./threads/client/requests/index.mjs";
23
25
  export * as threads from "./threads/index.mjs";
@@ -18,6 +18,8 @@ export * from "./messages/types/index.mjs";
18
18
  export * from "./metrics/client/requests/index.mjs";
19
19
  export * as metrics from "./metrics/index.mjs";
20
20
  export * from "./metrics/types/index.mjs";
21
+ export * as organizations from "./organizations/index.mjs";
22
+ export * from "./organizations/types/index.mjs";
21
23
  export * as pods from "./pods/index.mjs";
22
24
  export * from "./threads/client/requests/index.mjs";
23
25
  export * as threads from "./threads/index.mjs";
@@ -0,0 +1,24 @@
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 type * as AgentMail from "../../../index.mjs";
5
+ export declare namespace OrganizationsClient {
6
+ interface Options extends BaseClientOptions {
7
+ }
8
+ interface RequestOptions extends BaseRequestOptions {
9
+ }
10
+ }
11
+ export declare class OrganizationsClient {
12
+ protected readonly _options: NormalizedClientOptionsWithAuth<OrganizationsClient.Options>;
13
+ constructor(options?: OrganizationsClient.Options);
14
+ /**
15
+ * Get the current organization.
16
+ *
17
+ * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @example
20
+ * await client.organizations.get()
21
+ */
22
+ get(requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Organization>;
23
+ private __get;
24
+ }
@@ -0,0 +1,84 @@
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 * as errors from "../../../../errors/index.mjs";
16
+ import * as serializers from "../../../../serialization/index.mjs";
17
+ export class OrganizationsClient {
18
+ constructor(options = {}) {
19
+ this._options = normalizeClientOptionsWithAuth(options);
20
+ }
21
+ /**
22
+ * Get the current organization.
23
+ *
24
+ * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
25
+ *
26
+ * @example
27
+ * await client.organizations.get()
28
+ */
29
+ get(requestOptions) {
30
+ return core.HttpResponsePromise.fromPromise(this.__get(requestOptions));
31
+ }
32
+ __get(requestOptions) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
35
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
36
+ 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);
37
+ const _response = yield core.fetcher({
38
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, "/v0/organizations"),
39
+ method: "GET",
40
+ headers: _headers,
41
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
42
+ 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,
43
+ 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,
44
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
45
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
46
+ logging: this._options.logging,
47
+ });
48
+ if (_response.ok) {
49
+ return {
50
+ data: serializers.Organization.parseOrThrow(_response.body, {
51
+ unrecognizedObjectKeys: "passthrough",
52
+ allowUnrecognizedUnionMembers: true,
53
+ allowUnrecognizedEnumValues: true,
54
+ skipValidation: true,
55
+ breadcrumbsPrefix: ["response"],
56
+ }),
57
+ rawResponse: _response.rawResponse,
58
+ };
59
+ }
60
+ if (_response.error.reason === "status-code") {
61
+ throw new errors.AgentMailError({
62
+ statusCode: _response.error.statusCode,
63
+ body: _response.error.body,
64
+ rawResponse: _response.rawResponse,
65
+ });
66
+ }
67
+ switch (_response.error.reason) {
68
+ case "non-json":
69
+ throw new errors.AgentMailError({
70
+ statusCode: _response.error.statusCode,
71
+ body: _response.error.rawBody,
72
+ rawResponse: _response.rawResponse,
73
+ });
74
+ case "timeout":
75
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/organizations.");
76
+ case "unknown":
77
+ throw new errors.AgentMailError({
78
+ message: _response.error.errorMessage,
79
+ rawResponse: _response.rawResponse,
80
+ });
81
+ }
82
+ });
83
+ }
84
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,19 @@
1
+ import type * as AgentMail from "../../../index.mjs";
2
+ /**
3
+ * Organization details with usage limits and counts.
4
+ */
5
+ export interface Organization {
6
+ organizationId: AgentMail.OrganizationId;
7
+ /** Current number of inboxes. */
8
+ inboxCount: number;
9
+ /** Current number of domains. */
10
+ domainCount: number;
11
+ /** Maximum number of inboxes allowed. */
12
+ inboxLimit?: number;
13
+ /** Maximum number of domains allowed. */
14
+ domainLimit?: number;
15
+ /** Time at which organization was last updated. */
16
+ updatedAt: Date;
17
+ /** Time at which organization was created. */
18
+ createdAt: Date;
19
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./Organization.mjs";
@@ -0,0 +1 @@
1
+ export * from "./Organization.mjs";
@@ -3,5 +3,5 @@ import * as core from "../../../../core/index.mjs";
3
3
  import type * as serializers from "../../../index.mjs";
4
4
  export declare const RecordStatus: core.serialization.Schema<serializers.RecordStatus.Raw, AgentMail.RecordStatus>;
5
5
  export declare namespace RecordStatus {
6
- type Raw = "MISSING" | "VERIFIED";
6
+ type Raw = "MISSING" | "INVALID" | "VALID";
7
7
  }
@@ -1,3 +1,3 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  import * as core from "../../../../core/index.mjs";
3
- export const RecordStatus = core.serialization.enum_(["MISSING", "VERIFIED"]);
3
+ export const RecordStatus = core.serialization.enum_(["MISSING", "INVALID", "VALID"]);
@@ -3,5 +3,5 @@ import * as core from "../../../../core/index.mjs";
3
3
  import type * as serializers from "../../../index.mjs";
4
4
  export declare const VerificationStatus: core.serialization.Schema<serializers.VerificationStatus.Raw, AgentMail.VerificationStatus>;
5
5
  export declare namespace VerificationStatus {
6
- type Raw = "PENDING" | "VERIFYING" | "READY";
6
+ type Raw = "NOT_STARTED" | "PENDING" | "INVALID" | "FAILED" | "VERIFYING" | "VERIFIED";
7
7
  }
@@ -1,3 +1,3 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  import * as core from "../../../../core/index.mjs";
3
- export const VerificationStatus = core.serialization.enum_(["PENDING", "VERIFYING", "READY"]);
3
+ export const VerificationStatus = core.serialization.enum_(["NOT_STARTED", "PENDING", "INVALID", "FAILED", "VERIFYING", "VERIFIED"]);
@@ -13,6 +13,8 @@ export * as messages from "./messages/index.mjs";
13
13
  export * from "./messages/types/index.mjs";
14
14
  export * as metrics from "./metrics/index.mjs";
15
15
  export * from "./metrics/types/index.mjs";
16
+ export * as organizations from "./organizations/index.mjs";
17
+ export * from "./organizations/types/index.mjs";
16
18
  export * as pods from "./pods/index.mjs";
17
19
  export * as threads from "./threads/index.mjs";
18
20
  export * from "./threads/types/index.mjs";
@@ -13,6 +13,8 @@ export * as messages from "./messages/index.mjs";
13
13
  export * from "./messages/types/index.mjs";
14
14
  export * as metrics from "./metrics/index.mjs";
15
15
  export * from "./metrics/types/index.mjs";
16
+ export * as organizations from "./organizations/index.mjs";
17
+ export * from "./organizations/types/index.mjs";
16
18
  export * as pods from "./pods/index.mjs";
17
19
  export * as threads from "./threads/index.mjs";
18
20
  export * from "./threads/types/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./types/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./types/index.mjs";
@@ -0,0 +1,16 @@
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
+ import { OrganizationId } from "../../../types/OrganizationId.mjs";
5
+ export declare const Organization: core.serialization.ObjectSchema<serializers.Organization.Raw, AgentMail.Organization>;
6
+ export declare namespace Organization {
7
+ interface Raw {
8
+ organization_id: OrganizationId.Raw;
9
+ inbox_count: number;
10
+ domain_count: number;
11
+ inbox_limit?: number | null;
12
+ domain_limit?: number | null;
13
+ updated_at: string;
14
+ created_at: string;
15
+ }
16
+ }
@@ -0,0 +1,12 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as core from "../../../../core/index.mjs";
3
+ import { OrganizationId } from "../../../types/OrganizationId.mjs";
4
+ export const Organization = core.serialization.object({
5
+ organizationId: core.serialization.property("organization_id", OrganizationId),
6
+ inboxCount: core.serialization.property("inbox_count", core.serialization.number()),
7
+ domainCount: core.serialization.property("domain_count", core.serialization.number()),
8
+ inboxLimit: core.serialization.property("inbox_limit", core.serialization.number().optional()),
9
+ domainLimit: core.serialization.property("domain_limit", core.serialization.number().optional()),
10
+ updatedAt: core.serialization.property("updated_at", core.serialization.date()),
11
+ createdAt: core.serialization.property("created_at", core.serialization.date()),
12
+ });
@@ -0,0 +1 @@
1
+ export * from "./Organization.mjs";
@@ -0,0 +1 @@
1
+ export * from "./Organization.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.14";
1
+ export declare const SDK_VERSION = "0.1.16";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.1.14";
1
+ export const SDK_VERSION = "0.1.16";