@athenaintel/sdk 4.3.2243 → 4.3.2245

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 (62) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/assets/client/Client.d.ts +1 -1
  3. package/dist/cjs/api/resources/assets/client/Client.js +1 -1
  4. package/dist/cjs/api/resources/assets/client/requests/CreateAssetRequestIn.d.ts +2 -0
  5. package/dist/cjs/api/resources/computer/client/Client.d.ts +30 -2
  6. package/dist/cjs/api/resources/computer/client/Client.js +100 -2
  7. package/dist/cjs/api/resources/computer/client/requests/GetStatusComputerRequest.d.ts +9 -0
  8. package/dist/cjs/api/resources/computer/client/requests/GetStatusComputerRequest.js +3 -0
  9. package/dist/cjs/api/resources/computer/client/requests/index.d.ts +1 -0
  10. package/dist/cjs/api/resources/databases/client/Client.d.ts +77 -4
  11. package/dist/cjs/api/resources/databases/client/Client.js +296 -4
  12. package/dist/cjs/api/resources/databases/client/requests/DatabaseComputeSettingsUpdateRequestIn.d.ts +12 -0
  13. package/dist/cjs/api/resources/databases/client/requests/DatabaseComputeSettingsUpdateRequestIn.js +3 -0
  14. package/dist/cjs/api/resources/databases/client/requests/GetSettingsDatabasesRequest.d.ts +9 -0
  15. package/dist/cjs/api/resources/databases/client/requests/GetSettingsDatabasesRequest.js +3 -0
  16. package/dist/cjs/api/resources/databases/client/requests/WakeDatabasesRequest.d.ts +9 -0
  17. package/dist/cjs/api/resources/databases/client/requests/WakeDatabasesRequest.js +3 -0
  18. package/dist/cjs/api/resources/databases/client/requests/index.d.ts +3 -0
  19. package/dist/cjs/api/resources/tools/resources/sheets/client/requests/UpdateSheetCellRequest.d.ts +3 -0
  20. package/dist/cjs/api/types/ComputerStatusResponseOut.d.ts +33 -0
  21. package/dist/cjs/api/types/ComputerStatusResponseOut.js +19 -0
  22. package/dist/cjs/api/types/DatabaseComputeSettingsResponseOut.d.ts +9 -0
  23. package/dist/cjs/api/types/DatabaseComputeSettingsResponseOut.js +3 -0
  24. package/dist/cjs/api/types/DatabaseStatusResponse.d.ts +2 -0
  25. package/dist/cjs/api/types/DatabaseWakeResponseOut.d.ts +19 -0
  26. package/dist/cjs/api/types/DatabaseWakeResponseOut.js +12 -0
  27. package/dist/cjs/api/types/index.d.ts +3 -0
  28. package/dist/cjs/api/types/index.js +3 -0
  29. package/dist/cjs/version.d.ts +1 -1
  30. package/dist/cjs/version.js +1 -1
  31. package/dist/esm/BaseClient.mjs +2 -2
  32. package/dist/esm/api/resources/assets/client/Client.d.mts +1 -1
  33. package/dist/esm/api/resources/assets/client/Client.mjs +1 -1
  34. package/dist/esm/api/resources/assets/client/requests/CreateAssetRequestIn.d.mts +2 -0
  35. package/dist/esm/api/resources/computer/client/Client.d.mts +30 -2
  36. package/dist/esm/api/resources/computer/client/Client.mjs +100 -2
  37. package/dist/esm/api/resources/computer/client/requests/GetStatusComputerRequest.d.mts +9 -0
  38. package/dist/esm/api/resources/computer/client/requests/GetStatusComputerRequest.mjs +2 -0
  39. package/dist/esm/api/resources/computer/client/requests/index.d.mts +1 -0
  40. package/dist/esm/api/resources/databases/client/Client.d.mts +77 -4
  41. package/dist/esm/api/resources/databases/client/Client.mjs +296 -4
  42. package/dist/esm/api/resources/databases/client/requests/DatabaseComputeSettingsUpdateRequestIn.d.mts +12 -0
  43. package/dist/esm/api/resources/databases/client/requests/DatabaseComputeSettingsUpdateRequestIn.mjs +2 -0
  44. package/dist/esm/api/resources/databases/client/requests/GetSettingsDatabasesRequest.d.mts +9 -0
  45. package/dist/esm/api/resources/databases/client/requests/GetSettingsDatabasesRequest.mjs +2 -0
  46. package/dist/esm/api/resources/databases/client/requests/WakeDatabasesRequest.d.mts +9 -0
  47. package/dist/esm/api/resources/databases/client/requests/WakeDatabasesRequest.mjs +2 -0
  48. package/dist/esm/api/resources/databases/client/requests/index.d.mts +3 -0
  49. package/dist/esm/api/resources/tools/resources/sheets/client/requests/UpdateSheetCellRequest.d.mts +3 -0
  50. package/dist/esm/api/types/ComputerStatusResponseOut.d.mts +33 -0
  51. package/dist/esm/api/types/ComputerStatusResponseOut.mjs +16 -0
  52. package/dist/esm/api/types/DatabaseComputeSettingsResponseOut.d.mts +9 -0
  53. package/dist/esm/api/types/DatabaseComputeSettingsResponseOut.mjs +2 -0
  54. package/dist/esm/api/types/DatabaseStatusResponse.d.mts +2 -0
  55. package/dist/esm/api/types/DatabaseWakeResponseOut.d.mts +19 -0
  56. package/dist/esm/api/types/DatabaseWakeResponseOut.mjs +9 -0
  57. package/dist/esm/api/types/index.d.mts +3 -0
  58. package/dist/esm/api/types/index.mjs +3 -0
  59. package/dist/esm/version.d.mts +1 -1
  60. package/dist/esm/version.mjs +1 -1
  61. package/package.json +1 -1
  62. package/reference.md +285 -7
@@ -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.2243",
47
- "User-Agent": "@athenaintel/sdk/4.3.2243",
46
+ "X-Fern-SDK-Version": "4.3.2245",
47
+ "User-Agent": "@athenaintel/sdk/4.3.2245",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  "X-Athena-Session-Credential": options === null || options === void 0 ? void 0 : options.sessionCredential,
@@ -50,7 +50,7 @@ export declare class AssetsClient {
50
50
  convertExcelToSheet(request: AthenaIntelligence.ConvertExcelToSheetRequestIn, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ConvertExcelToSheetResponseOut>;
51
51
  private __convertExcelToSheet;
52
52
  /**
53
- * Create a new asset such as a spreadsheet, document, folder, database, computer, user interface, skill, collab agent, or generic doc (admin-only) in your workspace with your current permissions. Computer assets return 202 after durable submission, which commits the asset and initialization delivery intent together. Runtime provisioning continues asynchronously. Inspect the returned asset ID for progress instead of repeating creation. Computers accept the same configuration as the Athena UI's creation dialog: template, provider, cpu, memory (GiB), disk (GiB) and env_vars. Sizes must be offered by the environment's computer resource policy, and only admins may pick a size other than the template default (403 otherwise). In capability enforce mode, computer creation requires computer.create and returns 403 when denied.
53
+ * Create a new asset such as a spreadsheet, document, folder, database, computer, user interface, skill, collab agent, or generic doc (admin-only) in your workspace with your current permissions. Computer assets return 202 after durable submission, which commits the asset and initialization delivery intent together. Runtime provisioning continues asynchronously. Inspect the returned asset ID for progress instead of repeating creation. Computers accept the same configuration as the Athena UI's creation dialog: template, provider, cpu, memory (GiB), disk (GiB) and env_vars. Sizes must be offered by the environment's computer resource policy, and only admins may pick a size other than the template default (403 otherwise). In capability enforce mode, computer creation requires computer.create and returns 403 when denied. Databases accept suspend_timeout_seconds, the auto-suspend window from the database's Settings in Athena: 0 keeps the database running (it never suspends, and keeps using capacity), otherwise 60 to 86400 seconds. A database is provisioned in the background: poll GET /api/v0/databases/{asset_id}/compute-status until it reports running or suspended.
54
54
  *
55
55
  * @param {AthenaIntelligence.CreateAssetRequestIn} request
56
56
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -252,7 +252,7 @@ class AssetsClient {
252
252
  });
253
253
  }
254
254
  /**
255
- * Create a new asset such as a spreadsheet, document, folder, database, computer, user interface, skill, collab agent, or generic doc (admin-only) in your workspace with your current permissions. Computer assets return 202 after durable submission, which commits the asset and initialization delivery intent together. Runtime provisioning continues asynchronously. Inspect the returned asset ID for progress instead of repeating creation. Computers accept the same configuration as the Athena UI's creation dialog: template, provider, cpu, memory (GiB), disk (GiB) and env_vars. Sizes must be offered by the environment's computer resource policy, and only admins may pick a size other than the template default (403 otherwise). In capability enforce mode, computer creation requires computer.create and returns 403 when denied.
255
+ * Create a new asset such as a spreadsheet, document, folder, database, computer, user interface, skill, collab agent, or generic doc (admin-only) in your workspace with your current permissions. Computer assets return 202 after durable submission, which commits the asset and initialization delivery intent together. Runtime provisioning continues asynchronously. Inspect the returned asset ID for progress instead of repeating creation. Computers accept the same configuration as the Athena UI's creation dialog: template, provider, cpu, memory (GiB), disk (GiB) and env_vars. Sizes must be offered by the environment's computer resource policy, and only admins may pick a size other than the template default (403 otherwise). In capability enforce mode, computer creation requires computer.create and returns 403 when denied. Databases accept suspend_timeout_seconds, the auto-suspend window from the database's Settings in Athena: 0 keeps the database running (it never suspends, and keeps using capacity), otherwise 60 to 86400 seconds. A database is provisioned in the background: poll GET /api/v0/databases/{asset_id}/compute-status until it reports running or suspended.
256
256
  *
257
257
  * @param {AthenaIntelligence.CreateAssetRequestIn} request
258
258
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -28,6 +28,8 @@ export interface CreateAssetRequestIn {
28
28
  provider?: string | null;
29
29
  /** skill only. The skill's SKILL.md content. Created as a draft; publish it with POST /api/v0/assets/{asset_id}/publish. */
30
30
  skill_config?: AthenaIntelligence.PublicSkillConfigIn | null;
31
+ /** Database only. Seconds without activity after which the database suspends (scales to zero): 0 means it never suspends (the compute keeps running, and keeps using capacity), otherwise 60 to 86400 (24 hours). Defaults to 1800 (30 minutes). Applied while the database is provisioned; if it cannot be applied, the database is not created and compute-status reports failed. Read or change it later with GET/PATCH /api/v0/databases/{asset_id}/settings. */
32
+ suspend_timeout_seconds?: number | null;
31
33
  /** Computer only. Template key to create the computer from, as picked in the Athena UI's computer creation dialog (e.g. 'default'), or an 'environment:<asset_id>' reference to a saved environment. Defaults to the default template. Also accepted as 'snapshot'. */
32
34
  template?: string | null;
33
35
  /** Title for the new asset */
@@ -69,7 +69,7 @@ export declare class ComputerClient {
69
69
  getSshAccess(request: AthenaIntelligence.GetSshAccessComputerRequest, requestOptions?: ComputerClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.SshAccessInfoOut>;
70
70
  private __getSshAccess;
71
71
  /**
72
- * Generate a time-limited SSH access token for a computer asset. Returns a full SSH command and token that can be used to connect to the computer's underlying VM and run commands. The computer must support SSH access and be in a running state.
72
+ * Generate a time-limited SSH access token for a computer asset. Returns a full SSH command and token that can be used to connect to the computer's underlying VM and run commands. The computer must support SSH access. If it is stopped, this call starts it first and can take as long as `start_computer`; after an explicit Stop it returns 409 until you call `start_computer`. Use `get_status` to see whether the computer is ready.
73
73
  *
74
74
  * @param {AthenaIntelligence.CreateSshAccessRequestIn} request
75
75
  * @param {ComputerClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -147,7 +147,7 @@ export declare class ComputerClient {
147
147
  revokeSshAccessToken(request: AthenaIntelligence.RevokeSshAccessTokenComputerRequest, requestOptions?: ComputerClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.RevokeSshAccessResponseOut>;
148
148
  private __revokeSshAccessToken;
149
149
  /**
150
- * Start a stopped computer's runtime and wait for it to come up — the same operation as the Start button in Athena. Idempotent for a running computer. Returns 409 when the computer's provider does not support lifecycle operations.
150
+ * Start a stopped computer's runtime and wait for it to come up — the same operation as the Start button in Athena. Idempotent for a running computer, and it clears an explicit stop. `state` is `started` once the runtime is up; the guest can need a few more seconds, so poll `get_status` until `ready` is true before you rely on commands or SSH. A proxy in front of the API can end this request after about 60 seconds while the start continues on the server; then poll `get_status`. Returns 409 when the computer's provider does not support lifecycle operations.
151
151
  *
152
152
  * @param {AthenaIntelligence.StartComputerComputerRequest} request
153
153
  * @param {ComputerClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -165,6 +165,34 @@ export declare class ComputerClient {
165
165
  */
166
166
  startComputer(request: AthenaIntelligence.StartComputerComputerRequest, requestOptions?: ComputerClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ComputerLifecycleResponseOut>;
167
167
  private __startComputer;
168
+ /**
169
+ * Read an existing computer's live runtime state and whether it is ready, without starting, waking, or repairing it. Works for every computer, including those created before durable initialization (`get_initialization` reports creation-time progress only). Requires membership in the computer's workspace and VIEW access. This read does not count as activity, so polling it does not keep the computer awake.
170
+ *
171
+ * **Waiting for a computer.** Call `start_computer`, then poll this endpoint every few seconds until `ready` is true; stop polling when `not_ready_reason` is `launcher_outdated`. `start_computer` waits for the computer, but a proxy in front of the API can end a long request (about 60 seconds on Athena's ingress) while the start continues on the server. The server waits up to 210 seconds by default for the computer's runtime to boot before it reports a failure, and Athena alerts its operators when the 90th percentile of starts goes above 3 minutes.
172
+ *
173
+ * **Auto-stop.** A computer stops after its `auto_stop_minutes` of inactivity (60 minutes unless the computer or the deployment sets another value; 0 means it never stops on its own). Activity is work inside the computer — commands, terminal and SSH sessions, file operations — and requests to its deployed URLs. Status reads are not activity.
174
+ *
175
+ * **The asset record's `status`.** The computer's `status` in `GET /assets/{asset_id}` records the last lifecycle change Athena recorded (create, Start, Stop); it is not a live read. It can read `running` while the computer is stopped, for example after an idle auto-stop, or `stopped` after something woke it. Use this endpoint for the live state.
176
+ *
177
+ * Returns 403 when the caller is not a member of the computer's workspace, 409 while the computer is still being created or when its creation failed, 404 when the asset does not exist or its runtime is gone for good (stop polling), and 502 when the runtime could not be read (retry).
178
+ *
179
+ * @param {AthenaIntelligence.GetStatusComputerRequest} request
180
+ * @param {ComputerClient.RequestOptions} requestOptions - Request-specific configuration.
181
+ *
182
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
183
+ * @throws {@link AthenaIntelligence.ForbiddenError}
184
+ * @throws {@link AthenaIntelligence.NotFoundError}
185
+ * @throws {@link AthenaIntelligence.ConflictError}
186
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
187
+ * @throws {@link AthenaIntelligence.BadGatewayError}
188
+ *
189
+ * @example
190
+ * await client.computer.getStatus({
191
+ * asset_id: "asset_id"
192
+ * })
193
+ */
194
+ getStatus(request: AthenaIntelligence.GetStatusComputerRequest, requestOptions?: ComputerClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ComputerStatusResponseOut>;
195
+ private __getStatus;
168
196
  /**
169
197
  * Stop (suspend) a running computer's runtime — the same operation as the Stop button in Athena. The computer's files persist and it can be started again with `start_computer`. Returns 409 when the provider does not support lifecycle operations or when the stop was refused because the workspace could not be saved (the computer is left running; retry).
170
198
  *
@@ -325,7 +325,7 @@ class ComputerClient {
325
325
  });
326
326
  }
327
327
  /**
328
- * Generate a time-limited SSH access token for a computer asset. Returns a full SSH command and token that can be used to connect to the computer's underlying VM and run commands. The computer must support SSH access and be in a running state.
328
+ * Generate a time-limited SSH access token for a computer asset. Returns a full SSH command and token that can be used to connect to the computer's underlying VM and run commands. The computer must support SSH access. If it is stopped, this call starts it first and can take as long as `start_computer`; after an explicit Stop it returns 409 until you call `start_computer`. Use `get_status` to see whether the computer is ready.
329
329
  *
330
330
  * @param {AthenaIntelligence.CreateSshAccessRequestIn} request
331
331
  * @param {ComputerClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -679,7 +679,7 @@ class ComputerClient {
679
679
  });
680
680
  }
681
681
  /**
682
- * Start a stopped computer's runtime and wait for it to come up — the same operation as the Start button in Athena. Idempotent for a running computer. Returns 409 when the computer's provider does not support lifecycle operations.
682
+ * Start a stopped computer's runtime and wait for it to come up — the same operation as the Start button in Athena. Idempotent for a running computer, and it clears an explicit stop. `state` is `started` once the runtime is up; the guest can need a few more seconds, so poll `get_status` until `ready` is true before you rely on commands or SSH. A proxy in front of the API can end this request after about 60 seconds while the start continues on the server; then poll `get_status`. Returns 409 when the computer's provider does not support lifecycle operations.
683
683
  *
684
684
  * @param {AthenaIntelligence.StartComputerComputerRequest} request
685
685
  * @param {ComputerClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -765,6 +765,104 @@ class ComputerClient {
765
765
  }
766
766
  });
767
767
  }
768
+ /**
769
+ * Read an existing computer's live runtime state and whether it is ready, without starting, waking, or repairing it. Works for every computer, including those created before durable initialization (`get_initialization` reports creation-time progress only). Requires membership in the computer's workspace and VIEW access. This read does not count as activity, so polling it does not keep the computer awake.
770
+ *
771
+ * **Waiting for a computer.** Call `start_computer`, then poll this endpoint every few seconds until `ready` is true; stop polling when `not_ready_reason` is `launcher_outdated`. `start_computer` waits for the computer, but a proxy in front of the API can end a long request (about 60 seconds on Athena's ingress) while the start continues on the server. The server waits up to 210 seconds by default for the computer's runtime to boot before it reports a failure, and Athena alerts its operators when the 90th percentile of starts goes above 3 minutes.
772
+ *
773
+ * **Auto-stop.** A computer stops after its `auto_stop_minutes` of inactivity (60 minutes unless the computer or the deployment sets another value; 0 means it never stops on its own). Activity is work inside the computer — commands, terminal and SSH sessions, file operations — and requests to its deployed URLs. Status reads are not activity.
774
+ *
775
+ * **The asset record's `status`.** The computer's `status` in `GET /assets/{asset_id}` records the last lifecycle change Athena recorded (create, Start, Stop); it is not a live read. It can read `running` while the computer is stopped, for example after an idle auto-stop, or `stopped` after something woke it. Use this endpoint for the live state.
776
+ *
777
+ * Returns 403 when the caller is not a member of the computer's workspace, 409 while the computer is still being created or when its creation failed, 404 when the asset does not exist or its runtime is gone for good (stop polling), and 502 when the runtime could not be read (retry).
778
+ *
779
+ * @param {AthenaIntelligence.GetStatusComputerRequest} request
780
+ * @param {ComputerClient.RequestOptions} requestOptions - Request-specific configuration.
781
+ *
782
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
783
+ * @throws {@link AthenaIntelligence.ForbiddenError}
784
+ * @throws {@link AthenaIntelligence.NotFoundError}
785
+ * @throws {@link AthenaIntelligence.ConflictError}
786
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
787
+ * @throws {@link AthenaIntelligence.BadGatewayError}
788
+ *
789
+ * @example
790
+ * await client.computer.getStatus({
791
+ * asset_id: "asset_id"
792
+ * })
793
+ */
794
+ getStatus(request, requestOptions) {
795
+ return core.HttpResponsePromise.fromPromise(this.__getStatus(request, requestOptions));
796
+ }
797
+ __getStatus(request, requestOptions) {
798
+ return __awaiter(this, void 0, void 0, function* () {
799
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
800
+ const { asset_id: assetId } = request;
801
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
802
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
803
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
804
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
805
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
806
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/computer/${core.url.encodePathParam(assetId)}/status`),
807
+ method: "GET",
808
+ headers: _headers,
809
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
810
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
811
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
812
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
813
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
814
+ logging: this._options.logging,
815
+ });
816
+ if (_response.ok) {
817
+ return {
818
+ data: _response.body,
819
+ rawResponse: _response.rawResponse,
820
+ };
821
+ }
822
+ if (_response.error.reason === "status-code") {
823
+ switch (_response.error.statusCode) {
824
+ case 401:
825
+ throw new AthenaIntelligence.UnauthorizedError(_response.error.body, _response.rawResponse);
826
+ case 403:
827
+ throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
828
+ case 404:
829
+ throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
830
+ case 409:
831
+ throw new AthenaIntelligence.ConflictError(_response.error.body, _response.rawResponse);
832
+ case 422:
833
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
834
+ case 502:
835
+ throw new AthenaIntelligence.BadGatewayError(_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/computer/{asset_id}/status.");
858
+ case "unknown":
859
+ throw new errors.AthenaIntelligenceError({
860
+ message: _response.error.errorMessage,
861
+ rawResponse: _response.rawResponse,
862
+ });
863
+ }
864
+ });
865
+ }
768
866
  /**
769
867
  * Stop (suspend) a running computer's runtime — the same operation as the Stop button in Athena. The computer's files persist and it can be started again with `start_computer`. Returns 409 when the provider does not support lifecycle operations or when the stop was refused because the workspace could not be saved (the computer is left running; retry).
770
868
  *
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * asset_id: "asset_id"
5
+ * }
6
+ */
7
+ export interface GetStatusComputerRequest {
8
+ asset_id: string;
9
+ }
@@ -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 });
@@ -2,6 +2,7 @@ export type { CreateSshAccessRequestIn } from "./CreateSshAccessRequestIn.js";
2
2
  export type { DeployComputerRequestIn } from "./DeployComputerRequestIn.js";
3
3
  export type { GetInitializationComputerRequest } from "./GetInitializationComputerRequest.js";
4
4
  export type { GetSshAccessComputerRequest } from "./GetSshAccessComputerRequest.js";
5
+ export type { GetStatusComputerRequest } from "./GetStatusComputerRequest.js";
5
6
  export type { ListSshAccessTokensComputerRequest } from "./ListSshAccessTokensComputerRequest.js";
6
7
  export type { RevokeSshAccessRequestIn } from "./RevokeSshAccessRequestIn.js";
7
8
  export type { RevokeSshAccessTokenComputerRequest } from "./RevokeSshAccessTokenComputerRequest.js";
@@ -16,10 +16,13 @@ export declare class DatabasesClient {
16
16
  *
17
17
  * **Status Values:**
18
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
19
+ * - `suspended` - Database is suspended (scale-to-zero). It wakes on `POST /databases/{asset_id}/wake` or on the first SQL request. When `reason` is `ComputeUnschedulable`, no node could host its compute size: waking it only restarts the same wait
20
+ * - `starting` - Database is waking up, or its compute is being recreated
21
+ * - `creating` - Database is being created; it has no compute yet
22
+ * - `failed` - Database failed to start, or its creation failed (`message` says which)
23
+ * - `unknown` - Status could not be determined (the control plane did not answer); retry
24
+ *
25
+ * A database suspends (scales to zero) after `suspend_timeout_seconds` without activity; `GET`/`PATCH /databases/{asset_id}/settings` read and set that window, and 0 keeps it running. Reading the compute status or the settings never wakes a suspended database. Two things do: `POST /databases/{asset_id}/wake`, which answers at once while the compute starts, or any request that runs SQL on it, such as `POST /databases/{asset_id}/sql`, which waits for the compute up to 120 seconds; if the compute is still starting then, the answer is 503 with `Retry-After` and the statement did not run. A cold start usually takes 30 seconds to 2 minutes.
23
26
  *
24
27
  * @param {AthenaIntelligence.GetStatusDatabasesRequest} request
25
28
  * @param {DatabasesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -217,6 +220,53 @@ export declare class DatabasesClient {
217
220
  */
218
221
  getTableSchema(request: AthenaIntelligence.GetTableSchemaDatabasesRequest, requestOptions?: DatabasesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.DatabaseTableSchemaResponse>;
219
222
  private __getTableSchema;
223
+ /**
224
+ * Read the database's auto-suspend window, the same setting as auto-suspend in the database's Settings in Athena. Reading never wakes the database.
225
+ *
226
+ * A database suspends (scales to zero) after `suspend_timeout_seconds` without activity; `GET`/`PATCH /databases/{asset_id}/settings` read and set that window, and 0 keeps it running. Reading the compute status or the settings never wakes a suspended database. Two things do: `POST /databases/{asset_id}/wake`, which answers at once while the compute starts, or any request that runs SQL on it, such as `POST /databases/{asset_id}/sql`, which waits for the compute up to 120 seconds; if the compute is still starting then, the answer is 503 with `Retry-After` and the statement did not run. A cold start usually takes 30 seconds to 2 minutes.
227
+ *
228
+ * @param {AthenaIntelligence.GetSettingsDatabasesRequest} request
229
+ * @param {DatabasesClient.RequestOptions} requestOptions - Request-specific configuration.
230
+ *
231
+ * @throws {@link AthenaIntelligence.BadRequestError}
232
+ * @throws {@link AthenaIntelligence.ForbiddenError}
233
+ * @throws {@link AthenaIntelligence.NotFoundError}
234
+ * @throws {@link AthenaIntelligence.ConflictError}
235
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
236
+ * @throws {@link AthenaIntelligence.NotImplementedError}
237
+ * @throws {@link AthenaIntelligence.ServiceUnavailableError}
238
+ *
239
+ * @example
240
+ * await client.databases.getSettings({
241
+ * asset_id: "asset_id"
242
+ * })
243
+ */
244
+ getSettings(request: AthenaIntelligence.GetSettingsDatabasesRequest, requestOptions?: DatabasesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.DatabaseComputeSettingsResponseOut>;
245
+ private __getSettings;
246
+ /**
247
+ * Set the database's auto-suspend window: 0 keeps the database running (it never suspends, and keeps using compute capacity), otherwise 60 to 86400 seconds. The same setting, values and edit-access rule as auto-suspend in the database's Settings in Athena; the change applies at once and does not restart or wake the database.
248
+ *
249
+ * A database suspends (scales to zero) after `suspend_timeout_seconds` without activity; `GET`/`PATCH /databases/{asset_id}/settings` read and set that window, and 0 keeps it running. Reading the compute status or the settings never wakes a suspended database. Two things do: `POST /databases/{asset_id}/wake`, which answers at once while the compute starts, or any request that runs SQL on it, such as `POST /databases/{asset_id}/sql`, which waits for the compute up to 120 seconds; if the compute is still starting then, the answer is 503 with `Retry-After` and the statement did not run. A cold start usually takes 30 seconds to 2 minutes.
250
+ *
251
+ * @param {AthenaIntelligence.DatabaseComputeSettingsUpdateRequestIn} request
252
+ * @param {DatabasesClient.RequestOptions} requestOptions - Request-specific configuration.
253
+ *
254
+ * @throws {@link AthenaIntelligence.BadRequestError}
255
+ * @throws {@link AthenaIntelligence.ForbiddenError}
256
+ * @throws {@link AthenaIntelligence.NotFoundError}
257
+ * @throws {@link AthenaIntelligence.ConflictError}
258
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
259
+ * @throws {@link AthenaIntelligence.NotImplementedError}
260
+ * @throws {@link AthenaIntelligence.ServiceUnavailableError}
261
+ *
262
+ * @example
263
+ * await client.databases.updateSettings({
264
+ * asset_id: "asset_id",
265
+ * suspend_timeout_seconds: 3600
266
+ * })
267
+ */
268
+ updateSettings(request: AthenaIntelligence.DatabaseComputeSettingsUpdateRequestIn, requestOptions?: DatabasesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.DatabaseComputeSettingsResponseOut>;
269
+ private __updateSettings;
220
270
  /**
221
271
  * Execute a SQL statement against the database. SELECT queries return columns and rows. Non-SELECT statements (CREATE, INSERT, UPDATE, DELETE, ALTER, DROP, etc.) return execution statuses.
222
272
  *
@@ -239,4 +289,27 @@ export declare class DatabasesClient {
239
289
  */
240
290
  executeSql(request: AthenaIntelligence.DatabaseSqlRequest, requestOptions?: DatabasesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.DatabaseSqlResponse>;
241
291
  private __executeSql;
292
+ /**
293
+ * Start a suspended database's compute and answer at once, without waiting for it to run. Poll `GET /databases/{asset_id}/compute-status` until it reports `running`. Waking a running database resets its idle clock and answers 200 with `running`, so it is safe to call before every batch of work. The same action as Resume Database in Athena; it needs edit access to the database.
294
+ *
295
+ * A database suspends (scales to zero) after `suspend_timeout_seconds` without activity; `GET`/`PATCH /databases/{asset_id}/settings` read and set that window, and 0 keeps it running. Reading the compute status or the settings never wakes a suspended database. Two things do: `POST /databases/{asset_id}/wake`, which answers at once while the compute starts, or any request that runs SQL on it, such as `POST /databases/{asset_id}/sql`, which waits for the compute up to 120 seconds; if the compute is still starting then, the answer is 503 with `Retry-After` and the statement did not run. A cold start usually takes 30 seconds to 2 minutes.
296
+ *
297
+ * @param {AthenaIntelligence.WakeDatabasesRequest} request
298
+ * @param {DatabasesClient.RequestOptions} requestOptions - Request-specific configuration.
299
+ *
300
+ * @throws {@link AthenaIntelligence.BadRequestError}
301
+ * @throws {@link AthenaIntelligence.ForbiddenError}
302
+ * @throws {@link AthenaIntelligence.NotFoundError}
303
+ * @throws {@link AthenaIntelligence.ConflictError}
304
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
305
+ * @throws {@link AthenaIntelligence.NotImplementedError}
306
+ * @throws {@link AthenaIntelligence.ServiceUnavailableError}
307
+ *
308
+ * @example
309
+ * await client.databases.wake({
310
+ * asset_id: "asset_id"
311
+ * })
312
+ */
313
+ wake(request: AthenaIntelligence.WakeDatabasesRequest, requestOptions?: DatabasesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.DatabaseWakeResponseOut>;
314
+ private __wake;
242
315
  }