@athenaintel/sdk 4.3.397 → 4.3.398

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 (36) 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 +5 -0
  4. package/dist/cjs/api/resources/index.d.ts +1 -0
  5. package/dist/cjs/api/resources/index.js +2 -1
  6. package/dist/cjs/api/resources/users/client/Client.d.ts +24 -0
  7. package/dist/cjs/api/resources/users/client/Client.js +116 -0
  8. package/dist/cjs/api/resources/users/client/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/users/client/index.js +2 -0
  10. package/dist/cjs/api/resources/users/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/users/index.js +17 -0
  12. package/dist/cjs/api/types/UserInfoOut.d.ts +8 -0
  13. package/dist/cjs/api/types/UserInfoOut.js +3 -0
  14. package/dist/cjs/api/types/index.d.ts +1 -0
  15. package/dist/cjs/api/types/index.js +1 -0
  16. package/dist/cjs/version.d.ts +1 -1
  17. package/dist/cjs/version.js +1 -1
  18. package/dist/esm/BaseClient.mjs +2 -2
  19. package/dist/esm/Client.d.mts +3 -0
  20. package/dist/esm/Client.mjs +5 -0
  21. package/dist/esm/api/resources/index.d.mts +1 -0
  22. package/dist/esm/api/resources/index.mjs +1 -0
  23. package/dist/esm/api/resources/users/client/Client.d.mts +24 -0
  24. package/dist/esm/api/resources/users/client/Client.mjs +79 -0
  25. package/dist/esm/api/resources/users/client/index.d.mts +1 -0
  26. package/dist/esm/api/resources/users/client/index.mjs +1 -0
  27. package/dist/esm/api/resources/users/index.d.mts +1 -0
  28. package/dist/esm/api/resources/users/index.mjs +1 -0
  29. package/dist/esm/api/types/UserInfoOut.d.mts +8 -0
  30. package/dist/esm/api/types/UserInfoOut.mjs +2 -0
  31. package/dist/esm/api/types/index.d.mts +1 -0
  32. package/dist/esm/api/types/index.mjs +1 -0
  33. package/dist/esm/version.d.mts +1 -1
  34. package/dist/esm/version.mjs +1 -1
  35. package/package.json +1 -1
  36. package/reference.md +56 -0
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@athenaintel/sdk",
46
- "X-Fern-SDK-Version": "4.3.397",
47
- "User-Agent": "@athenaintel/sdk/4.3.397",
46
+ "X-Fern-SDK-Version": "4.3.398",
47
+ "User-Agent": "@athenaintel/sdk/4.3.398",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -5,6 +5,7 @@ import { DatabasesClient } from "./api/resources/databases/client/Client.js";
5
5
  import { QueryClient } from "./api/resources/query/client/Client.js";
6
6
  import { ThreadsClient } from "./api/resources/threads/client/Client.js";
7
7
  import { ToolsClient } from "./api/resources/tools/client/Client.js";
8
+ import { UsersClient } from "./api/resources/users/client/Client.js";
8
9
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
9
10
  import { type NormalizedClientOptionsWithAuth } from "./BaseClient.js";
10
11
  export declare namespace AthenaIntelligenceClient {
@@ -19,6 +20,7 @@ export declare class AthenaIntelligenceClient {
19
20
  protected _aop: AopClient | undefined;
20
21
  protected _assets: AssetsClient | undefined;
21
22
  protected _databases: DatabasesClient | undefined;
23
+ protected _users: UsersClient | undefined;
22
24
  protected _query: QueryClient | undefined;
23
25
  protected _threads: ThreadsClient | undefined;
24
26
  protected _tools: ToolsClient | undefined;
@@ -27,6 +29,7 @@ export declare class AthenaIntelligenceClient {
27
29
  get aop(): AopClient;
28
30
  get assets(): AssetsClient;
29
31
  get databases(): DatabasesClient;
32
+ get users(): UsersClient;
30
33
  get query(): QueryClient;
31
34
  get threads(): ThreadsClient;
32
35
  get tools(): ToolsClient;
@@ -9,6 +9,7 @@ const Client_js_4 = require("./api/resources/databases/client/Client.js");
9
9
  const Client_js_5 = require("./api/resources/query/client/Client.js");
10
10
  const Client_js_6 = require("./api/resources/threads/client/Client.js");
11
11
  const Client_js_7 = require("./api/resources/tools/client/Client.js");
12
+ const Client_js_8 = require("./api/resources/users/client/Client.js");
12
13
  const BaseClient_js_1 = require("./BaseClient.js");
13
14
  class AthenaIntelligenceClient {
14
15
  constructor(options) {
@@ -30,6 +31,10 @@ class AthenaIntelligenceClient {
30
31
  var _a;
31
32
  return ((_a = this._databases) !== null && _a !== void 0 ? _a : (this._databases = new Client_js_4.DatabasesClient(this._options)));
32
33
  }
34
+ get users() {
35
+ var _a;
36
+ return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_8.UsersClient(this._options)));
37
+ }
33
38
  get query() {
34
39
  var _a;
35
40
  return ((_a = this._query) !== null && _a !== void 0 ? _a : (this._query = new Client_js_5.QueryClient(this._options)));
@@ -12,3 +12,4 @@ export * as threads from "./threads/index.js";
12
12
  export * from "./tools/client/requests/index.js";
13
13
  export * as tools from "./tools/index.js";
14
14
  export * from "./tools/types/index.js";
15
+ export * as users from "./users/index.js";
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.tools = exports.threads = exports.query = exports.databases = exports.assets = exports.aop = exports.agents = void 0;
39
+ exports.users = exports.tools = exports.threads = exports.query = exports.databases = exports.assets = exports.aop = exports.agents = void 0;
40
40
  __exportStar(require("./agents/client/requests/index.js"), exports);
41
41
  exports.agents = __importStar(require("./agents/index.js"));
42
42
  exports.aop = __importStar(require("./aop/index.js"));
@@ -51,3 +51,4 @@ exports.threads = __importStar(require("./threads/index.js"));
51
51
  __exportStar(require("./tools/client/requests/index.js"), exports);
52
52
  exports.tools = __importStar(require("./tools/index.js"));
53
53
  __exportStar(require("./tools/types/index.js"), exports);
54
+ exports.users = __importStar(require("./users/index.js"));
@@ -0,0 +1,24 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import type * as AthenaIntelligence from "../../../index.js";
5
+ export declare namespace UsersClient {
6
+ interface Options extends BaseClientOptions {
7
+ }
8
+ interface RequestOptions extends BaseRequestOptions {
9
+ }
10
+ }
11
+ export declare class UsersClient {
12
+ protected readonly _options: NormalizedClientOptionsWithAuth<UsersClient.Options>;
13
+ constructor(options: UsersClient.Options);
14
+ /**
15
+ * Returns basic information about the authenticated user including name, email, and workspace details.
16
+ *
17
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @example
20
+ * await client.users.me()
21
+ */
22
+ me(requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.UserInfoOut>;
23
+ private __me;
24
+ }
@@ -0,0 +1,116 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.UsersClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
48
+ const headers_js_1 = require("../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../core/index.js"));
50
+ const environments = __importStar(require("../../../../environments.js"));
51
+ const errors = __importStar(require("../../../../errors/index.js"));
52
+ class UsersClient {
53
+ constructor(options) {
54
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
55
+ }
56
+ /**
57
+ * Returns basic information about the authenticated user including name, email, and workspace details.
58
+ *
59
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
60
+ *
61
+ * @example
62
+ * await client.users.me()
63
+ */
64
+ me(requestOptions) {
65
+ return core.HttpResponsePromise.fromPromise(this.__me(requestOptions));
66
+ }
67
+ __me(requestOptions) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
70
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
71
+ 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);
72
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
73
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, "api/v0/me"),
74
+ method: "GET",
75
+ headers: _headers,
76
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
77
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
78
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
79
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
80
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
81
+ logging: this._options.logging,
82
+ });
83
+ if (_response.ok) {
84
+ return { data: _response.body, rawResponse: _response.rawResponse };
85
+ }
86
+ if (_response.error.reason === "status-code") {
87
+ throw new errors.AthenaIntelligenceError({
88
+ statusCode: _response.error.statusCode,
89
+ body: _response.error.body,
90
+ rawResponse: _response.rawResponse,
91
+ });
92
+ }
93
+ switch (_response.error.reason) {
94
+ case "non-json":
95
+ throw new errors.AthenaIntelligenceError({
96
+ statusCode: _response.error.statusCode,
97
+ body: _response.error.rawBody,
98
+ rawResponse: _response.rawResponse,
99
+ });
100
+ case "body-is-null":
101
+ throw new errors.AthenaIntelligenceError({
102
+ statusCode: _response.error.statusCode,
103
+ rawResponse: _response.rawResponse,
104
+ });
105
+ case "timeout":
106
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling GET /api/v0/me.");
107
+ case "unknown":
108
+ throw new errors.AthenaIntelligenceError({
109
+ message: _response.error.errorMessage,
110
+ rawResponse: _response.rawResponse,
111
+ });
112
+ }
113
+ });
114
+ }
115
+ }
116
+ exports.UsersClient = UsersClient;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
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("./client/index.js"), exports);
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Response model for user information.
3
+ */
4
+ export interface UserInfoOut {
5
+ email: string;
6
+ first_name?: string;
7
+ last_name?: string;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -63,4 +63,5 @@ export * from "./ThreadBatchStopResponseOut.js";
63
63
  export * from "./ThreadBatchStopResultItem.js";
64
64
  export * from "./ThreadStatusResponseOut.js";
65
65
  export * from "./ThreadStopResponseOut.js";
66
+ export * from "./UserInfoOut.js";
66
67
  export * from "./WrapStrategy.js";
@@ -79,4 +79,5 @@ __exportStar(require("./ThreadBatchStopResponseOut.js"), exports);
79
79
  __exportStar(require("./ThreadBatchStopResultItem.js"), exports);
80
80
  __exportStar(require("./ThreadStatusResponseOut.js"), exports);
81
81
  __exportStar(require("./ThreadStopResponseOut.js"), exports);
82
+ __exportStar(require("./UserInfoOut.js"), exports);
82
83
  __exportStar(require("./WrapStrategy.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.397";
1
+ export declare const SDK_VERSION = "4.3.398";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "4.3.397";
4
+ exports.SDK_VERSION = "4.3.398";
@@ -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": "@athenaintel/sdk",
9
- "X-Fern-SDK-Version": "4.3.397",
10
- "User-Agent": "@athenaintel/sdk/4.3.397",
9
+ "X-Fern-SDK-Version": "4.3.398",
10
+ "User-Agent": "@athenaintel/sdk/4.3.398",
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);
@@ -5,6 +5,7 @@ import { DatabasesClient } from "./api/resources/databases/client/Client.mjs";
5
5
  import { QueryClient } from "./api/resources/query/client/Client.mjs";
6
6
  import { ThreadsClient } from "./api/resources/threads/client/Client.mjs";
7
7
  import { ToolsClient } from "./api/resources/tools/client/Client.mjs";
8
+ import { UsersClient } from "./api/resources/users/client/Client.mjs";
8
9
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
9
10
  import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
10
11
  export declare namespace AthenaIntelligenceClient {
@@ -19,6 +20,7 @@ export declare class AthenaIntelligenceClient {
19
20
  protected _aop: AopClient | undefined;
20
21
  protected _assets: AssetsClient | undefined;
21
22
  protected _databases: DatabasesClient | undefined;
23
+ protected _users: UsersClient | undefined;
22
24
  protected _query: QueryClient | undefined;
23
25
  protected _threads: ThreadsClient | undefined;
24
26
  protected _tools: ToolsClient | undefined;
@@ -27,6 +29,7 @@ export declare class AthenaIntelligenceClient {
27
29
  get aop(): AopClient;
28
30
  get assets(): AssetsClient;
29
31
  get databases(): DatabasesClient;
32
+ get users(): UsersClient;
30
33
  get query(): QueryClient;
31
34
  get threads(): ThreadsClient;
32
35
  get tools(): ToolsClient;
@@ -6,6 +6,7 @@ import { DatabasesClient } from "./api/resources/databases/client/Client.mjs";
6
6
  import { QueryClient } from "./api/resources/query/client/Client.mjs";
7
7
  import { ThreadsClient } from "./api/resources/threads/client/Client.mjs";
8
8
  import { ToolsClient } from "./api/resources/tools/client/Client.mjs";
9
+ import { UsersClient } from "./api/resources/users/client/Client.mjs";
9
10
  import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
10
11
  export class AthenaIntelligenceClient {
11
12
  constructor(options) {
@@ -27,6 +28,10 @@ export class AthenaIntelligenceClient {
27
28
  var _a;
28
29
  return ((_a = this._databases) !== null && _a !== void 0 ? _a : (this._databases = new DatabasesClient(this._options)));
29
30
  }
31
+ get users() {
32
+ var _a;
33
+ return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new UsersClient(this._options)));
34
+ }
30
35
  get query() {
31
36
  var _a;
32
37
  return ((_a = this._query) !== null && _a !== void 0 ? _a : (this._query = new QueryClient(this._options)));
@@ -12,3 +12,4 @@ export * as threads from "./threads/index.mjs";
12
12
  export * from "./tools/client/requests/index.mjs";
13
13
  export * as tools from "./tools/index.mjs";
14
14
  export * from "./tools/types/index.mjs";
15
+ export * as users from "./users/index.mjs";
@@ -12,3 +12,4 @@ export * as threads from "./threads/index.mjs";
12
12
  export * from "./tools/client/requests/index.mjs";
13
13
  export * as tools from "./tools/index.mjs";
14
14
  export * from "./tools/types/index.mjs";
15
+ export * as users from "./users/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 AthenaIntelligence from "../../../index.mjs";
5
+ export declare namespace UsersClient {
6
+ interface Options extends BaseClientOptions {
7
+ }
8
+ interface RequestOptions extends BaseRequestOptions {
9
+ }
10
+ }
11
+ export declare class UsersClient {
12
+ protected readonly _options: NormalizedClientOptionsWithAuth<UsersClient.Options>;
13
+ constructor(options: UsersClient.Options);
14
+ /**
15
+ * Returns basic information about the authenticated user including name, email, and workspace details.
16
+ *
17
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @example
20
+ * await client.users.me()
21
+ */
22
+ me(requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.UserInfoOut>;
23
+ private __me;
24
+ }
@@ -0,0 +1,79 @@
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
+ export class UsersClient {
17
+ constructor(options) {
18
+ this._options = normalizeClientOptionsWithAuth(options);
19
+ }
20
+ /**
21
+ * Returns basic information about the authenticated user including name, email, and workspace details.
22
+ *
23
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
24
+ *
25
+ * @example
26
+ * await client.users.me()
27
+ */
28
+ me(requestOptions) {
29
+ return core.HttpResponsePromise.fromPromise(this.__me(requestOptions));
30
+ }
31
+ __me(requestOptions) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
34
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
35
+ 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
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
37
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, "api/v0/me"),
38
+ method: "GET",
39
+ headers: _headers,
40
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
41
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
42
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
43
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
44
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
45
+ logging: this._options.logging,
46
+ });
47
+ if (_response.ok) {
48
+ return { data: _response.body, rawResponse: _response.rawResponse };
49
+ }
50
+ if (_response.error.reason === "status-code") {
51
+ throw new errors.AthenaIntelligenceError({
52
+ statusCode: _response.error.statusCode,
53
+ body: _response.error.body,
54
+ rawResponse: _response.rawResponse,
55
+ });
56
+ }
57
+ switch (_response.error.reason) {
58
+ case "non-json":
59
+ throw new errors.AthenaIntelligenceError({
60
+ statusCode: _response.error.statusCode,
61
+ body: _response.error.rawBody,
62
+ rawResponse: _response.rawResponse,
63
+ });
64
+ case "body-is-null":
65
+ throw new errors.AthenaIntelligenceError({
66
+ statusCode: _response.error.statusCode,
67
+ rawResponse: _response.rawResponse,
68
+ });
69
+ case "timeout":
70
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling GET /api/v0/me.");
71
+ case "unknown":
72
+ throw new errors.AthenaIntelligenceError({
73
+ message: _response.error.errorMessage,
74
+ rawResponse: _response.rawResponse,
75
+ });
76
+ }
77
+ });
78
+ }
79
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Response model for user information.
3
+ */
4
+ export interface UserInfoOut {
5
+ email: string;
6
+ first_name?: string;
7
+ last_name?: string;
8
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -63,4 +63,5 @@ export * from "./ThreadBatchStopResponseOut.mjs";
63
63
  export * from "./ThreadBatchStopResultItem.mjs";
64
64
  export * from "./ThreadStatusResponseOut.mjs";
65
65
  export * from "./ThreadStopResponseOut.mjs";
66
+ export * from "./UserInfoOut.mjs";
66
67
  export * from "./WrapStrategy.mjs";
@@ -63,4 +63,5 @@ export * from "./ThreadBatchStopResponseOut.mjs";
63
63
  export * from "./ThreadBatchStopResultItem.mjs";
64
64
  export * from "./ThreadStatusResponseOut.mjs";
65
65
  export * from "./ThreadStopResponseOut.mjs";
66
+ export * from "./UserInfoOut.mjs";
66
67
  export * from "./WrapStrategy.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.397";
1
+ export declare const SDK_VERSION = "4.3.398";
@@ -1 +1 @@
1
- export const SDK_VERSION = "4.3.397";
1
+ export const SDK_VERSION = "4.3.398";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athenaintel/sdk",
3
- "version": "4.3.397",
3
+ "version": "4.3.398",
4
4
  "private": false,
5
5
  "repository": "github:Athena-Intel/athena-typescript",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -1078,6 +1078,62 @@ await client.databases.getStatus("asset_id");
1078
1078
  </dl>
1079
1079
 
1080
1080
 
1081
+ </dd>
1082
+ </dl>
1083
+ </details>
1084
+
1085
+ ## Users
1086
+ <details><summary><code>client.users.<a href="/src/api/resources/users/client/Client.ts">me</a>() -> AthenaIntelligence.UserInfoOut</code></summary>
1087
+ <dl>
1088
+ <dd>
1089
+
1090
+ #### 📝 Description
1091
+
1092
+ <dl>
1093
+ <dd>
1094
+
1095
+ <dl>
1096
+ <dd>
1097
+
1098
+ Returns basic information about the authenticated user including name, email, and workspace details.
1099
+ </dd>
1100
+ </dl>
1101
+ </dd>
1102
+ </dl>
1103
+
1104
+ #### 🔌 Usage
1105
+
1106
+ <dl>
1107
+ <dd>
1108
+
1109
+ <dl>
1110
+ <dd>
1111
+
1112
+ ```typescript
1113
+ await client.users.me();
1114
+
1115
+ ```
1116
+ </dd>
1117
+ </dl>
1118
+ </dd>
1119
+ </dl>
1120
+
1121
+ #### ⚙️ Parameters
1122
+
1123
+ <dl>
1124
+ <dd>
1125
+
1126
+ <dl>
1127
+ <dd>
1128
+
1129
+ **requestOptions:** `UsersClient.RequestOptions`
1130
+
1131
+ </dd>
1132
+ </dl>
1133
+ </dd>
1134
+ </dl>
1135
+
1136
+
1081
1137
  </dd>
1082
1138
  </dl>
1083
1139
  </details>