@athenaintel/sdk 4.3.972 → 4.3.973

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.
@@ -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.972",
47
- "User-Agent": "@athenaintel/sdk/4.3.972",
46
+ "X-Fern-SDK-Version": "4.3.973",
47
+ "User-Agent": "@athenaintel/sdk/4.3.973",
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);
@@ -11,6 +11,30 @@ export declare namespace DatabasesClient {
11
11
  export declare class DatabasesClient {
12
12
  protected readonly _options: NormalizedClientOptionsWithAuth<DatabasesClient.Options>;
13
13
  constructor(options: DatabasesClient.Options);
14
+ /**
15
+ * Check if a database is running, suspended, or starting up. Poll this endpoint to determine when a serverless database is ready.
16
+ *
17
+ * **Status Values:**
18
+ * - `running` - Database is active and accepting connections
19
+ * - `suspended` - Database is suspended (scale-to-zero), will auto-resume on first query
20
+ * - `starting` - Database is waking up
21
+ * - `failed` - Database failed to start
22
+ * - `unknown` - Status could not be determined
23
+ *
24
+ * @param {string} asset_id
25
+ * @param {DatabasesClient.RequestOptions} requestOptions - Request-specific configuration.
26
+ *
27
+ * @throws {@link AthenaIntelligence.BadRequestError}
28
+ * @throws {@link AthenaIntelligence.ForbiddenError}
29
+ * @throws {@link AthenaIntelligence.NotFoundError}
30
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
31
+ * @throws {@link AthenaIntelligence.NotImplementedError}
32
+ *
33
+ * @example
34
+ * await client.databases.getStatus("asset_id")
35
+ */
36
+ getStatus(asset_id: string, requestOptions?: DatabasesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.DatabaseStatusResponse>;
37
+ private __getStatus;
14
38
  /**
15
39
  * Get a list of all tables in the database with optional row counts.
16
40
  *
@@ -213,28 +237,4 @@ export declare class DatabasesClient {
213
237
  */
214
238
  executeSql(asset_id: string, request: AthenaIntelligence.DatabaseSqlRequest, requestOptions?: DatabasesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.DatabaseSqlResponse>;
215
239
  private __executeSql;
216
- /**
217
- * Check if a database is running, suspended, or starting up. Poll this endpoint to determine when a serverless database is ready.
218
- *
219
- * **Status Values:**
220
- * - `running` - Database is active and accepting connections
221
- * - `suspended` - Database is suspended (scale-to-zero), will auto-resume on first query
222
- * - `starting` - Database is waking up
223
- * - `failed` - Database failed to start
224
- * - `unknown` - Status could not be determined
225
- *
226
- * @param {string} asset_id
227
- * @param {DatabasesClient.RequestOptions} requestOptions - Request-specific configuration.
228
- *
229
- * @throws {@link AthenaIntelligence.BadRequestError}
230
- * @throws {@link AthenaIntelligence.ForbiddenError}
231
- * @throws {@link AthenaIntelligence.NotFoundError}
232
- * @throws {@link AthenaIntelligence.UnprocessableEntityError}
233
- * @throws {@link AthenaIntelligence.NotImplementedError}
234
- *
235
- * @example
236
- * await client.databases.getStatus("asset_id")
237
- */
238
- getStatus(asset_id: string, requestOptions?: DatabasesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.DatabaseStatusResponse>;
239
- private __getStatus;
240
240
  }
@@ -65,6 +65,95 @@ class DatabasesClient {
65
65
  constructor(options) {
66
66
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
67
67
  }
68
+ /**
69
+ * Check if a database is running, suspended, or starting up. Poll this endpoint to determine when a serverless database is ready.
70
+ *
71
+ * **Status Values:**
72
+ * - `running` - Database is active and accepting connections
73
+ * - `suspended` - Database is suspended (scale-to-zero), will auto-resume on first query
74
+ * - `starting` - Database is waking up
75
+ * - `failed` - Database failed to start
76
+ * - `unknown` - Status could not be determined
77
+ *
78
+ * @param {string} asset_id
79
+ * @param {DatabasesClient.RequestOptions} requestOptions - Request-specific configuration.
80
+ *
81
+ * @throws {@link AthenaIntelligence.BadRequestError}
82
+ * @throws {@link AthenaIntelligence.ForbiddenError}
83
+ * @throws {@link AthenaIntelligence.NotFoundError}
84
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
85
+ * @throws {@link AthenaIntelligence.NotImplementedError}
86
+ *
87
+ * @example
88
+ * await client.databases.getStatus("asset_id")
89
+ */
90
+ getStatus(asset_id, requestOptions) {
91
+ return core.HttpResponsePromise.fromPromise(this.__getStatus(asset_id, requestOptions));
92
+ }
93
+ __getStatus(asset_id, requestOptions) {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
96
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
97
+ 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);
98
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
99
+ 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/databases/${core.url.encodePathParam(asset_id)}/compute-status`),
100
+ method: "GET",
101
+ headers: _headers,
102
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
103
+ 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,
104
+ 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,
105
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
106
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
107
+ logging: this._options.logging,
108
+ });
109
+ if (_response.ok) {
110
+ return {
111
+ data: _response.body,
112
+ rawResponse: _response.rawResponse,
113
+ };
114
+ }
115
+ if (_response.error.reason === "status-code") {
116
+ switch (_response.error.statusCode) {
117
+ case 400:
118
+ throw new AthenaIntelligence.BadRequestError(_response.error.body, _response.rawResponse);
119
+ case 403:
120
+ throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
121
+ case 404:
122
+ throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
123
+ case 422:
124
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
125
+ case 501:
126
+ throw new AthenaIntelligence.NotImplementedError(_response.error.body, _response.rawResponse);
127
+ default:
128
+ throw new errors.AthenaIntelligenceError({
129
+ statusCode: _response.error.statusCode,
130
+ body: _response.error.body,
131
+ rawResponse: _response.rawResponse,
132
+ });
133
+ }
134
+ }
135
+ switch (_response.error.reason) {
136
+ case "non-json":
137
+ throw new errors.AthenaIntelligenceError({
138
+ statusCode: _response.error.statusCode,
139
+ body: _response.error.rawBody,
140
+ rawResponse: _response.rawResponse,
141
+ });
142
+ case "body-is-null":
143
+ throw new errors.AthenaIntelligenceError({
144
+ statusCode: _response.error.statusCode,
145
+ rawResponse: _response.rawResponse,
146
+ });
147
+ case "timeout":
148
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling GET /api/v0/databases/{asset_id}/compute-status.");
149
+ case "unknown":
150
+ throw new errors.AthenaIntelligenceError({
151
+ message: _response.error.errorMessage,
152
+ rawResponse: _response.rawResponse,
153
+ });
154
+ }
155
+ });
156
+ }
68
157
  /**
69
158
  * Get a list of all tables in the database with optional row counts.
70
159
  *
@@ -774,94 +863,5 @@ class DatabasesClient {
774
863
  }
775
864
  });
776
865
  }
777
- /**
778
- * Check if a database is running, suspended, or starting up. Poll this endpoint to determine when a serverless database is ready.
779
- *
780
- * **Status Values:**
781
- * - `running` - Database is active and accepting connections
782
- * - `suspended` - Database is suspended (scale-to-zero), will auto-resume on first query
783
- * - `starting` - Database is waking up
784
- * - `failed` - Database failed to start
785
- * - `unknown` - Status could not be determined
786
- *
787
- * @param {string} asset_id
788
- * @param {DatabasesClient.RequestOptions} requestOptions - Request-specific configuration.
789
- *
790
- * @throws {@link AthenaIntelligence.BadRequestError}
791
- * @throws {@link AthenaIntelligence.ForbiddenError}
792
- * @throws {@link AthenaIntelligence.NotFoundError}
793
- * @throws {@link AthenaIntelligence.UnprocessableEntityError}
794
- * @throws {@link AthenaIntelligence.NotImplementedError}
795
- *
796
- * @example
797
- * await client.databases.getStatus("asset_id")
798
- */
799
- getStatus(asset_id, requestOptions) {
800
- return core.HttpResponsePromise.fromPromise(this.__getStatus(asset_id, requestOptions));
801
- }
802
- __getStatus(asset_id, requestOptions) {
803
- return __awaiter(this, void 0, void 0, function* () {
804
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
805
- const _authRequest = yield this._options.authProvider.getAuthRequest();
806
- 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);
807
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
808
- 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/databases/${core.url.encodePathParam(asset_id)}/status`),
809
- method: "GET",
810
- headers: _headers,
811
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
812
- 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,
813
- 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,
814
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
815
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
816
- logging: this._options.logging,
817
- });
818
- if (_response.ok) {
819
- return {
820
- data: _response.body,
821
- rawResponse: _response.rawResponse,
822
- };
823
- }
824
- if (_response.error.reason === "status-code") {
825
- switch (_response.error.statusCode) {
826
- case 400:
827
- throw new AthenaIntelligence.BadRequestError(_response.error.body, _response.rawResponse);
828
- case 403:
829
- throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
830
- case 404:
831
- throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
832
- case 422:
833
- throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
834
- case 501:
835
- throw new AthenaIntelligence.NotImplementedError(_response.error.body, _response.rawResponse);
836
- default:
837
- throw new errors.AthenaIntelligenceError({
838
- statusCode: _response.error.statusCode,
839
- body: _response.error.body,
840
- rawResponse: _response.rawResponse,
841
- });
842
- }
843
- }
844
- switch (_response.error.reason) {
845
- case "non-json":
846
- throw new errors.AthenaIntelligenceError({
847
- statusCode: _response.error.statusCode,
848
- body: _response.error.rawBody,
849
- rawResponse: _response.rawResponse,
850
- });
851
- case "body-is-null":
852
- throw new errors.AthenaIntelligenceError({
853
- statusCode: _response.error.statusCode,
854
- rawResponse: _response.rawResponse,
855
- });
856
- case "timeout":
857
- throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling GET /api/v0/databases/{asset_id}/status.");
858
- case "unknown":
859
- throw new errors.AthenaIntelligenceError({
860
- message: _response.error.errorMessage,
861
- rawResponse: _response.rawResponse,
862
- });
863
- }
864
- });
865
- }
866
866
  }
867
867
  exports.DatabasesClient = DatabasesClient;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.972";
1
+ export declare const SDK_VERSION = "4.3.973";
@@ -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.972";
4
+ exports.SDK_VERSION = "4.3.973";
@@ -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.972",
10
- "User-Agent": "@athenaintel/sdk/4.3.972",
9
+ "X-Fern-SDK-Version": "4.3.973",
10
+ "User-Agent": "@athenaintel/sdk/4.3.973",
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);
@@ -11,6 +11,30 @@ export declare namespace DatabasesClient {
11
11
  export declare class DatabasesClient {
12
12
  protected readonly _options: NormalizedClientOptionsWithAuth<DatabasesClient.Options>;
13
13
  constructor(options: DatabasesClient.Options);
14
+ /**
15
+ * Check if a database is running, suspended, or starting up. Poll this endpoint to determine when a serverless database is ready.
16
+ *
17
+ * **Status Values:**
18
+ * - `running` - Database is active and accepting connections
19
+ * - `suspended` - Database is suspended (scale-to-zero), will auto-resume on first query
20
+ * - `starting` - Database is waking up
21
+ * - `failed` - Database failed to start
22
+ * - `unknown` - Status could not be determined
23
+ *
24
+ * @param {string} asset_id
25
+ * @param {DatabasesClient.RequestOptions} requestOptions - Request-specific configuration.
26
+ *
27
+ * @throws {@link AthenaIntelligence.BadRequestError}
28
+ * @throws {@link AthenaIntelligence.ForbiddenError}
29
+ * @throws {@link AthenaIntelligence.NotFoundError}
30
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
31
+ * @throws {@link AthenaIntelligence.NotImplementedError}
32
+ *
33
+ * @example
34
+ * await client.databases.getStatus("asset_id")
35
+ */
36
+ getStatus(asset_id: string, requestOptions?: DatabasesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.DatabaseStatusResponse>;
37
+ private __getStatus;
14
38
  /**
15
39
  * Get a list of all tables in the database with optional row counts.
16
40
  *
@@ -213,28 +237,4 @@ export declare class DatabasesClient {
213
237
  */
214
238
  executeSql(asset_id: string, request: AthenaIntelligence.DatabaseSqlRequest, requestOptions?: DatabasesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.DatabaseSqlResponse>;
215
239
  private __executeSql;
216
- /**
217
- * Check if a database is running, suspended, or starting up. Poll this endpoint to determine when a serverless database is ready.
218
- *
219
- * **Status Values:**
220
- * - `running` - Database is active and accepting connections
221
- * - `suspended` - Database is suspended (scale-to-zero), will auto-resume on first query
222
- * - `starting` - Database is waking up
223
- * - `failed` - Database failed to start
224
- * - `unknown` - Status could not be determined
225
- *
226
- * @param {string} asset_id
227
- * @param {DatabasesClient.RequestOptions} requestOptions - Request-specific configuration.
228
- *
229
- * @throws {@link AthenaIntelligence.BadRequestError}
230
- * @throws {@link AthenaIntelligence.ForbiddenError}
231
- * @throws {@link AthenaIntelligence.NotFoundError}
232
- * @throws {@link AthenaIntelligence.UnprocessableEntityError}
233
- * @throws {@link AthenaIntelligence.NotImplementedError}
234
- *
235
- * @example
236
- * await client.databases.getStatus("asset_id")
237
- */
238
- getStatus(asset_id: string, requestOptions?: DatabasesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.DatabaseStatusResponse>;
239
- private __getStatus;
240
240
  }
@@ -29,6 +29,95 @@ export class DatabasesClient {
29
29
  constructor(options) {
30
30
  this._options = normalizeClientOptionsWithAuth(options);
31
31
  }
32
+ /**
33
+ * Check if a database is running, suspended, or starting up. Poll this endpoint to determine when a serverless database is ready.
34
+ *
35
+ * **Status Values:**
36
+ * - `running` - Database is active and accepting connections
37
+ * - `suspended` - Database is suspended (scale-to-zero), will auto-resume on first query
38
+ * - `starting` - Database is waking up
39
+ * - `failed` - Database failed to start
40
+ * - `unknown` - Status could not be determined
41
+ *
42
+ * @param {string} asset_id
43
+ * @param {DatabasesClient.RequestOptions} requestOptions - Request-specific configuration.
44
+ *
45
+ * @throws {@link AthenaIntelligence.BadRequestError}
46
+ * @throws {@link AthenaIntelligence.ForbiddenError}
47
+ * @throws {@link AthenaIntelligence.NotFoundError}
48
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
49
+ * @throws {@link AthenaIntelligence.NotImplementedError}
50
+ *
51
+ * @example
52
+ * await client.databases.getStatus("asset_id")
53
+ */
54
+ getStatus(asset_id, requestOptions) {
55
+ return core.HttpResponsePromise.fromPromise(this.__getStatus(asset_id, requestOptions));
56
+ }
57
+ __getStatus(asset_id, requestOptions) {
58
+ return __awaiter(this, void 0, void 0, function* () {
59
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
60
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
61
+ 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);
62
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
63
+ 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/databases/${core.url.encodePathParam(asset_id)}/compute-status`),
64
+ method: "GET",
65
+ headers: _headers,
66
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
67
+ 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,
68
+ 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,
69
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
70
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
71
+ logging: this._options.logging,
72
+ });
73
+ if (_response.ok) {
74
+ return {
75
+ data: _response.body,
76
+ rawResponse: _response.rawResponse,
77
+ };
78
+ }
79
+ if (_response.error.reason === "status-code") {
80
+ switch (_response.error.statusCode) {
81
+ case 400:
82
+ throw new AthenaIntelligence.BadRequestError(_response.error.body, _response.rawResponse);
83
+ case 403:
84
+ throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
85
+ case 404:
86
+ throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
87
+ case 422:
88
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
89
+ case 501:
90
+ throw new AthenaIntelligence.NotImplementedError(_response.error.body, _response.rawResponse);
91
+ default:
92
+ throw new errors.AthenaIntelligenceError({
93
+ statusCode: _response.error.statusCode,
94
+ body: _response.error.body,
95
+ rawResponse: _response.rawResponse,
96
+ });
97
+ }
98
+ }
99
+ switch (_response.error.reason) {
100
+ case "non-json":
101
+ throw new errors.AthenaIntelligenceError({
102
+ statusCode: _response.error.statusCode,
103
+ body: _response.error.rawBody,
104
+ rawResponse: _response.rawResponse,
105
+ });
106
+ case "body-is-null":
107
+ throw new errors.AthenaIntelligenceError({
108
+ statusCode: _response.error.statusCode,
109
+ rawResponse: _response.rawResponse,
110
+ });
111
+ case "timeout":
112
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling GET /api/v0/databases/{asset_id}/compute-status.");
113
+ case "unknown":
114
+ throw new errors.AthenaIntelligenceError({
115
+ message: _response.error.errorMessage,
116
+ rawResponse: _response.rawResponse,
117
+ });
118
+ }
119
+ });
120
+ }
32
121
  /**
33
122
  * Get a list of all tables in the database with optional row counts.
34
123
  *
@@ -738,93 +827,4 @@ export class DatabasesClient {
738
827
  }
739
828
  });
740
829
  }
741
- /**
742
- * Check if a database is running, suspended, or starting up. Poll this endpoint to determine when a serverless database is ready.
743
- *
744
- * **Status Values:**
745
- * - `running` - Database is active and accepting connections
746
- * - `suspended` - Database is suspended (scale-to-zero), will auto-resume on first query
747
- * - `starting` - Database is waking up
748
- * - `failed` - Database failed to start
749
- * - `unknown` - Status could not be determined
750
- *
751
- * @param {string} asset_id
752
- * @param {DatabasesClient.RequestOptions} requestOptions - Request-specific configuration.
753
- *
754
- * @throws {@link AthenaIntelligence.BadRequestError}
755
- * @throws {@link AthenaIntelligence.ForbiddenError}
756
- * @throws {@link AthenaIntelligence.NotFoundError}
757
- * @throws {@link AthenaIntelligence.UnprocessableEntityError}
758
- * @throws {@link AthenaIntelligence.NotImplementedError}
759
- *
760
- * @example
761
- * await client.databases.getStatus("asset_id")
762
- */
763
- getStatus(asset_id, requestOptions) {
764
- return core.HttpResponsePromise.fromPromise(this.__getStatus(asset_id, requestOptions));
765
- }
766
- __getStatus(asset_id, requestOptions) {
767
- return __awaiter(this, void 0, void 0, function* () {
768
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
769
- const _authRequest = yield this._options.authProvider.getAuthRequest();
770
- 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);
771
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
772
- 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/databases/${core.url.encodePathParam(asset_id)}/status`),
773
- method: "GET",
774
- headers: _headers,
775
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
776
- 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,
777
- 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,
778
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
779
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
780
- logging: this._options.logging,
781
- });
782
- if (_response.ok) {
783
- return {
784
- data: _response.body,
785
- rawResponse: _response.rawResponse,
786
- };
787
- }
788
- if (_response.error.reason === "status-code") {
789
- switch (_response.error.statusCode) {
790
- case 400:
791
- throw new AthenaIntelligence.BadRequestError(_response.error.body, _response.rawResponse);
792
- case 403:
793
- throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
794
- case 404:
795
- throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
796
- case 422:
797
- throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
798
- case 501:
799
- throw new AthenaIntelligence.NotImplementedError(_response.error.body, _response.rawResponse);
800
- default:
801
- throw new errors.AthenaIntelligenceError({
802
- statusCode: _response.error.statusCode,
803
- body: _response.error.body,
804
- rawResponse: _response.rawResponse,
805
- });
806
- }
807
- }
808
- switch (_response.error.reason) {
809
- case "non-json":
810
- throw new errors.AthenaIntelligenceError({
811
- statusCode: _response.error.statusCode,
812
- body: _response.error.rawBody,
813
- rawResponse: _response.rawResponse,
814
- });
815
- case "body-is-null":
816
- throw new errors.AthenaIntelligenceError({
817
- statusCode: _response.error.statusCode,
818
- rawResponse: _response.rawResponse,
819
- });
820
- case "timeout":
821
- throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling GET /api/v0/databases/{asset_id}/status.");
822
- case "unknown":
823
- throw new errors.AthenaIntelligenceError({
824
- message: _response.error.errorMessage,
825
- rawResponse: _response.rawResponse,
826
- });
827
- }
828
- });
829
- }
830
830
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.972";
1
+ export declare const SDK_VERSION = "4.3.973";
@@ -1 +1 @@
1
- export const SDK_VERSION = "4.3.972";
1
+ export const SDK_VERSION = "4.3.973";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athenaintel/sdk",
3
- "version": "4.3.972",
3
+ "version": "4.3.973",
4
4
  "private": false,
5
5
  "repository": "github:Athena-Intel/athena-typescript",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -499,6 +499,76 @@ await client.assets.get("asset_id");
499
499
  </details>
500
500
 
501
501
  ## Databases
502
+ <details><summary><code>client.databases.<a href="/src/api/resources/databases/client/Client.ts">getStatus</a>(asset_id) -> AthenaIntelligence.DatabaseStatusResponse</code></summary>
503
+ <dl>
504
+ <dd>
505
+
506
+ #### 📝 Description
507
+
508
+ <dl>
509
+ <dd>
510
+
511
+ <dl>
512
+ <dd>
513
+
514
+ Check if a database is running, suspended, or starting up. Poll this endpoint to determine when a serverless database is ready.
515
+
516
+ **Status Values:**
517
+ - `running` - Database is active and accepting connections
518
+ - `suspended` - Database is suspended (scale-to-zero), will auto-resume on first query
519
+ - `starting` - Database is waking up
520
+ - `failed` - Database failed to start
521
+ - `unknown` - Status could not be determined
522
+ </dd>
523
+ </dl>
524
+ </dd>
525
+ </dl>
526
+
527
+ #### 🔌 Usage
528
+
529
+ <dl>
530
+ <dd>
531
+
532
+ <dl>
533
+ <dd>
534
+
535
+ ```typescript
536
+ await client.databases.getStatus("asset_id");
537
+
538
+ ```
539
+ </dd>
540
+ </dl>
541
+ </dd>
542
+ </dl>
543
+
544
+ #### ⚙️ Parameters
545
+
546
+ <dl>
547
+ <dd>
548
+
549
+ <dl>
550
+ <dd>
551
+
552
+ **asset_id:** `string`
553
+
554
+ </dd>
555
+ </dl>
556
+
557
+ <dl>
558
+ <dd>
559
+
560
+ **requestOptions:** `DatabasesClient.RequestOptions`
561
+
562
+ </dd>
563
+ </dl>
564
+ </dd>
565
+ </dl>
566
+
567
+
568
+ </dd>
569
+ </dl>
570
+ </details>
571
+
502
572
  <details><summary><code>client.databases.<a href="/src/api/resources/databases/client/Client.ts">listTables</a>(asset_id) -> AthenaIntelligence.DatabaseTablesResponse</code></summary>
503
573
  <dl>
504
574
  <dd>
@@ -1081,76 +1151,6 @@ await client.databases.executeSql("asset_id", {
1081
1151
  </dl>
1082
1152
 
1083
1153
 
1084
- </dd>
1085
- </dl>
1086
- </details>
1087
-
1088
- <details><summary><code>client.databases.<a href="/src/api/resources/databases/client/Client.ts">getStatus</a>(asset_id) -> AthenaIntelligence.DatabaseStatusResponse</code></summary>
1089
- <dl>
1090
- <dd>
1091
-
1092
- #### 📝 Description
1093
-
1094
- <dl>
1095
- <dd>
1096
-
1097
- <dl>
1098
- <dd>
1099
-
1100
- Check if a database is running, suspended, or starting up. Poll this endpoint to determine when a serverless database is ready.
1101
-
1102
- **Status Values:**
1103
- - `running` - Database is active and accepting connections
1104
- - `suspended` - Database is suspended (scale-to-zero), will auto-resume on first query
1105
- - `starting` - Database is waking up
1106
- - `failed` - Database failed to start
1107
- - `unknown` - Status could not be determined
1108
- </dd>
1109
- </dl>
1110
- </dd>
1111
- </dl>
1112
-
1113
- #### 🔌 Usage
1114
-
1115
- <dl>
1116
- <dd>
1117
-
1118
- <dl>
1119
- <dd>
1120
-
1121
- ```typescript
1122
- await client.databases.getStatus("asset_id");
1123
-
1124
- ```
1125
- </dd>
1126
- </dl>
1127
- </dd>
1128
- </dl>
1129
-
1130
- #### ⚙️ Parameters
1131
-
1132
- <dl>
1133
- <dd>
1134
-
1135
- <dl>
1136
- <dd>
1137
-
1138
- **asset_id:** `string`
1139
-
1140
- </dd>
1141
- </dl>
1142
-
1143
- <dl>
1144
- <dd>
1145
-
1146
- **requestOptions:** `DatabasesClient.RequestOptions`
1147
-
1148
- </dd>
1149
- </dl>
1150
- </dd>
1151
- </dl>
1152
-
1153
-
1154
1154
  </dd>
1155
1155
  </dl>
1156
1156
  </details>