@athenaintel/sdk 4.3.364 → 4.3.366

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.364",
47
- "User-Agent": "@athenaintel/sdk/4.3.364",
46
+ "X-Fern-SDK-Version": "4.3.366",
47
+ "User-Agent": "@athenaintel/sdk/4.3.366",
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,40 @@ export declare namespace ThreadsClient {
11
11
  export declare class ThreadsClient {
12
12
  protected readonly _options: NormalizedClientOptionsWithAuth<ThreadsClient.Options>;
13
13
  constructor(options: ThreadsClient.Options);
14
+ /**
15
+ * Stop multiple running thread executions by asset ID in a single request. This is useful for stopping many AOP executions at once from the UI. Each thread is stopped independently - failures for individual threads do not affect other threads in the batch.
16
+ *
17
+ * @param {AthenaIntelligence.ThreadBatchStopRequest} request
18
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
19
+ *
20
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
21
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
22
+ * @throws {@link AthenaIntelligence.InternalServerError}
23
+ *
24
+ * @example
25
+ * await client.threads.batchStopByAssetId({
26
+ * thread_ids: ["thread_ids"]
27
+ * })
28
+ */
29
+ batchStopByAssetId(request: AthenaIntelligence.ThreadBatchStopRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ThreadBatchStopResponseOut>;
30
+ private __batchStopByAssetId;
31
+ /**
32
+ * Stop multiple running thread executions in a single request. This endpoint accepts thread IDs (the same IDs used with the single-thread stop endpoint). Each thread is stopped independently - failures for individual threads do not affect other threads in the batch.
33
+ *
34
+ * @param {AthenaIntelligence.ThreadBatchStopRequest} request
35
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
36
+ *
37
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
38
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
39
+ * @throws {@link AthenaIntelligence.InternalServerError}
40
+ *
41
+ * @example
42
+ * await client.threads.batchStop({
43
+ * thread_ids: ["thread_ids"]
44
+ * })
45
+ */
46
+ batchStop(request: AthenaIntelligence.ThreadBatchStopRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ThreadBatchStopResponseOut>;
47
+ private __batchStop;
14
48
  /**
15
49
  * Check the status of a thread execution by thread ID. Returns thread status and associated conversation asset information for tracking progress.
16
50
  *
@@ -54,6 +54,168 @@ class ThreadsClient {
54
54
  constructor(options) {
55
55
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
56
56
  }
57
+ /**
58
+ * Stop multiple running thread executions by asset ID in a single request. This is useful for stopping many AOP executions at once from the UI. Each thread is stopped independently - failures for individual threads do not affect other threads in the batch.
59
+ *
60
+ * @param {AthenaIntelligence.ThreadBatchStopRequest} request
61
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
62
+ *
63
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
64
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
65
+ * @throws {@link AthenaIntelligence.InternalServerError}
66
+ *
67
+ * @example
68
+ * await client.threads.batchStopByAssetId({
69
+ * thread_ids: ["thread_ids"]
70
+ * })
71
+ */
72
+ batchStopByAssetId(request, requestOptions) {
73
+ return core.HttpResponsePromise.fromPromise(this.__batchStopByAssetId(request, requestOptions));
74
+ }
75
+ __batchStopByAssetId(request, requestOptions) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
78
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
79
+ 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);
80
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
81
+ 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/threads/batch-stop"),
82
+ method: "POST",
83
+ headers: _headers,
84
+ contentType: "application/json",
85
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
86
+ requestType: "json",
87
+ body: request,
88
+ 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,
89
+ 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,
90
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
91
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
92
+ logging: this._options.logging,
93
+ });
94
+ if (_response.ok) {
95
+ return {
96
+ data: _response.body,
97
+ rawResponse: _response.rawResponse,
98
+ };
99
+ }
100
+ if (_response.error.reason === "status-code") {
101
+ switch (_response.error.statusCode) {
102
+ case 401:
103
+ throw new AthenaIntelligence.UnauthorizedError(_response.error.body, _response.rawResponse);
104
+ case 422:
105
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
106
+ case 500:
107
+ throw new AthenaIntelligence.InternalServerError(_response.error.body, _response.rawResponse);
108
+ default:
109
+ throw new errors.AthenaIntelligenceError({
110
+ statusCode: _response.error.statusCode,
111
+ body: _response.error.body,
112
+ rawResponse: _response.rawResponse,
113
+ });
114
+ }
115
+ }
116
+ switch (_response.error.reason) {
117
+ case "non-json":
118
+ throw new errors.AthenaIntelligenceError({
119
+ statusCode: _response.error.statusCode,
120
+ body: _response.error.rawBody,
121
+ rawResponse: _response.rawResponse,
122
+ });
123
+ case "body-is-null":
124
+ throw new errors.AthenaIntelligenceError({
125
+ statusCode: _response.error.statusCode,
126
+ rawResponse: _response.rawResponse,
127
+ });
128
+ case "timeout":
129
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/threads/batch-stop.");
130
+ case "unknown":
131
+ throw new errors.AthenaIntelligenceError({
132
+ message: _response.error.errorMessage,
133
+ rawResponse: _response.rawResponse,
134
+ });
135
+ }
136
+ });
137
+ }
138
+ /**
139
+ * Stop multiple running thread executions in a single request. This endpoint accepts thread IDs (the same IDs used with the single-thread stop endpoint). Each thread is stopped independently - failures for individual threads do not affect other threads in the batch.
140
+ *
141
+ * @param {AthenaIntelligence.ThreadBatchStopRequest} request
142
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
143
+ *
144
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
145
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
146
+ * @throws {@link AthenaIntelligence.InternalServerError}
147
+ *
148
+ * @example
149
+ * await client.threads.batchStop({
150
+ * thread_ids: ["thread_ids"]
151
+ * })
152
+ */
153
+ batchStop(request, requestOptions) {
154
+ return core.HttpResponsePromise.fromPromise(this.__batchStop(request, requestOptions));
155
+ }
156
+ __batchStop(request, requestOptions) {
157
+ return __awaiter(this, void 0, void 0, function* () {
158
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
159
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
160
+ 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);
161
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
162
+ 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/threads/stop"),
163
+ method: "POST",
164
+ headers: _headers,
165
+ contentType: "application/json",
166
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
167
+ requestType: "json",
168
+ body: request,
169
+ 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,
170
+ 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,
171
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
172
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
173
+ logging: this._options.logging,
174
+ });
175
+ if (_response.ok) {
176
+ return {
177
+ data: _response.body,
178
+ rawResponse: _response.rawResponse,
179
+ };
180
+ }
181
+ if (_response.error.reason === "status-code") {
182
+ switch (_response.error.statusCode) {
183
+ case 401:
184
+ throw new AthenaIntelligence.UnauthorizedError(_response.error.body, _response.rawResponse);
185
+ case 422:
186
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
187
+ case 500:
188
+ throw new AthenaIntelligence.InternalServerError(_response.error.body, _response.rawResponse);
189
+ default:
190
+ throw new errors.AthenaIntelligenceError({
191
+ statusCode: _response.error.statusCode,
192
+ body: _response.error.body,
193
+ rawResponse: _response.rawResponse,
194
+ });
195
+ }
196
+ }
197
+ switch (_response.error.reason) {
198
+ case "non-json":
199
+ throw new errors.AthenaIntelligenceError({
200
+ statusCode: _response.error.statusCode,
201
+ body: _response.error.rawBody,
202
+ rawResponse: _response.rawResponse,
203
+ });
204
+ case "body-is-null":
205
+ throw new errors.AthenaIntelligenceError({
206
+ statusCode: _response.error.statusCode,
207
+ rawResponse: _response.rawResponse,
208
+ });
209
+ case "timeout":
210
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/threads/stop.");
211
+ case "unknown":
212
+ throw new errors.AthenaIntelligenceError({
213
+ message: _response.error.errorMessage,
214
+ rawResponse: _response.rawResponse,
215
+ });
216
+ }
217
+ });
218
+ }
57
219
  /**
58
220
  * Check the status of a thread execution by thread ID. Returns thread status and associated conversation asset information for tracking progress.
59
221
  *
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Request model for batch thread stop.
3
+ */
4
+ export interface ThreadBatchStopRequest {
5
+ /** List of thread IDs to stop */
6
+ thread_ids: string[];
7
+ }
@@ -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 });
@@ -0,0 +1,14 @@
1
+ import type * as AthenaIntelligence from "../index.js";
2
+ /**
3
+ * Response model for batch thread stop.
4
+ */
5
+ export interface ThreadBatchStopResponseOut {
6
+ /** Number of threads that failed to stop */
7
+ failed_count: number;
8
+ /** Detailed results for each thread */
9
+ results: AthenaIntelligence.ThreadBatchStopResultItem[];
10
+ /** Number of threads successfully stopped */
11
+ stopped_count: number;
12
+ /** Total number of threads requested to stop */
13
+ total_requested: number;
14
+ }
@@ -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 });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Result for a single thread in batch stop operation.
3
+ */
4
+ export interface ThreadBatchStopResultItem {
5
+ /** Error message if stop failed */
6
+ error?: string;
7
+ /** Whether the stop was successful */
8
+ success: boolean;
9
+ /** The thread ID */
10
+ thread_id: string;
11
+ }
@@ -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 });
@@ -58,6 +58,9 @@ export * from "./TableRowData.js";
58
58
  export * from "./TextContent.js";
59
59
  export * from "./TextFormatModel.js";
60
60
  export * from "./ThemeColor.js";
61
+ export * from "./ThreadBatchStopRequest.js";
62
+ export * from "./ThreadBatchStopResponseOut.js";
63
+ export * from "./ThreadBatchStopResultItem.js";
61
64
  export * from "./ThreadStatusResponseOut.js";
62
65
  export * from "./ThreadStopResponseOut.js";
63
66
  export * from "./WrapStrategy.js";
@@ -74,6 +74,9 @@ __exportStar(require("./TableRowData.js"), exports);
74
74
  __exportStar(require("./TextContent.js"), exports);
75
75
  __exportStar(require("./TextFormatModel.js"), exports);
76
76
  __exportStar(require("./ThemeColor.js"), exports);
77
+ __exportStar(require("./ThreadBatchStopRequest.js"), exports);
78
+ __exportStar(require("./ThreadBatchStopResponseOut.js"), exports);
79
+ __exportStar(require("./ThreadBatchStopResultItem.js"), exports);
77
80
  __exportStar(require("./ThreadStatusResponseOut.js"), exports);
78
81
  __exportStar(require("./ThreadStopResponseOut.js"), exports);
79
82
  __exportStar(require("./WrapStrategy.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.364";
1
+ export declare const SDK_VERSION = "4.3.366";
@@ -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.364";
4
+ exports.SDK_VERSION = "4.3.366";
@@ -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.364",
10
- "User-Agent": "@athenaintel/sdk/4.3.364",
9
+ "X-Fern-SDK-Version": "4.3.366",
10
+ "User-Agent": "@athenaintel/sdk/4.3.366",
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,40 @@ export declare namespace ThreadsClient {
11
11
  export declare class ThreadsClient {
12
12
  protected readonly _options: NormalizedClientOptionsWithAuth<ThreadsClient.Options>;
13
13
  constructor(options: ThreadsClient.Options);
14
+ /**
15
+ * Stop multiple running thread executions by asset ID in a single request. This is useful for stopping many AOP executions at once from the UI. Each thread is stopped independently - failures for individual threads do not affect other threads in the batch.
16
+ *
17
+ * @param {AthenaIntelligence.ThreadBatchStopRequest} request
18
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
19
+ *
20
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
21
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
22
+ * @throws {@link AthenaIntelligence.InternalServerError}
23
+ *
24
+ * @example
25
+ * await client.threads.batchStopByAssetId({
26
+ * thread_ids: ["thread_ids"]
27
+ * })
28
+ */
29
+ batchStopByAssetId(request: AthenaIntelligence.ThreadBatchStopRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ThreadBatchStopResponseOut>;
30
+ private __batchStopByAssetId;
31
+ /**
32
+ * Stop multiple running thread executions in a single request. This endpoint accepts thread IDs (the same IDs used with the single-thread stop endpoint). Each thread is stopped independently - failures for individual threads do not affect other threads in the batch.
33
+ *
34
+ * @param {AthenaIntelligence.ThreadBatchStopRequest} request
35
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
36
+ *
37
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
38
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
39
+ * @throws {@link AthenaIntelligence.InternalServerError}
40
+ *
41
+ * @example
42
+ * await client.threads.batchStop({
43
+ * thread_ids: ["thread_ids"]
44
+ * })
45
+ */
46
+ batchStop(request: AthenaIntelligence.ThreadBatchStopRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ThreadBatchStopResponseOut>;
47
+ private __batchStop;
14
48
  /**
15
49
  * Check the status of a thread execution by thread ID. Returns thread status and associated conversation asset information for tracking progress.
16
50
  *
@@ -18,6 +18,168 @@ export class ThreadsClient {
18
18
  constructor(options) {
19
19
  this._options = normalizeClientOptionsWithAuth(options);
20
20
  }
21
+ /**
22
+ * Stop multiple running thread executions by asset ID in a single request. This is useful for stopping many AOP executions at once from the UI. Each thread is stopped independently - failures for individual threads do not affect other threads in the batch.
23
+ *
24
+ * @param {AthenaIntelligence.ThreadBatchStopRequest} request
25
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
26
+ *
27
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
28
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
29
+ * @throws {@link AthenaIntelligence.InternalServerError}
30
+ *
31
+ * @example
32
+ * await client.threads.batchStopByAssetId({
33
+ * thread_ids: ["thread_ids"]
34
+ * })
35
+ */
36
+ batchStopByAssetId(request, requestOptions) {
37
+ return core.HttpResponsePromise.fromPromise(this.__batchStopByAssetId(request, requestOptions));
38
+ }
39
+ __batchStopByAssetId(request, requestOptions) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
42
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
43
+ 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);
44
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
45
+ 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/threads/batch-stop"),
46
+ method: "POST",
47
+ headers: _headers,
48
+ contentType: "application/json",
49
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
50
+ requestType: "json",
51
+ body: request,
52
+ 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,
53
+ 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,
54
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
55
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
56
+ logging: this._options.logging,
57
+ });
58
+ if (_response.ok) {
59
+ return {
60
+ data: _response.body,
61
+ rawResponse: _response.rawResponse,
62
+ };
63
+ }
64
+ if (_response.error.reason === "status-code") {
65
+ switch (_response.error.statusCode) {
66
+ case 401:
67
+ throw new AthenaIntelligence.UnauthorizedError(_response.error.body, _response.rawResponse);
68
+ case 422:
69
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
70
+ case 500:
71
+ throw new AthenaIntelligence.InternalServerError(_response.error.body, _response.rawResponse);
72
+ default:
73
+ throw new errors.AthenaIntelligenceError({
74
+ statusCode: _response.error.statusCode,
75
+ body: _response.error.body,
76
+ rawResponse: _response.rawResponse,
77
+ });
78
+ }
79
+ }
80
+ switch (_response.error.reason) {
81
+ case "non-json":
82
+ throw new errors.AthenaIntelligenceError({
83
+ statusCode: _response.error.statusCode,
84
+ body: _response.error.rawBody,
85
+ rawResponse: _response.rawResponse,
86
+ });
87
+ case "body-is-null":
88
+ throw new errors.AthenaIntelligenceError({
89
+ statusCode: _response.error.statusCode,
90
+ rawResponse: _response.rawResponse,
91
+ });
92
+ case "timeout":
93
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/threads/batch-stop.");
94
+ case "unknown":
95
+ throw new errors.AthenaIntelligenceError({
96
+ message: _response.error.errorMessage,
97
+ rawResponse: _response.rawResponse,
98
+ });
99
+ }
100
+ });
101
+ }
102
+ /**
103
+ * Stop multiple running thread executions in a single request. This endpoint accepts thread IDs (the same IDs used with the single-thread stop endpoint). Each thread is stopped independently - failures for individual threads do not affect other threads in the batch.
104
+ *
105
+ * @param {AthenaIntelligence.ThreadBatchStopRequest} request
106
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
107
+ *
108
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
109
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
110
+ * @throws {@link AthenaIntelligence.InternalServerError}
111
+ *
112
+ * @example
113
+ * await client.threads.batchStop({
114
+ * thread_ids: ["thread_ids"]
115
+ * })
116
+ */
117
+ batchStop(request, requestOptions) {
118
+ return core.HttpResponsePromise.fromPromise(this.__batchStop(request, requestOptions));
119
+ }
120
+ __batchStop(request, requestOptions) {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
123
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
124
+ 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);
125
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
126
+ 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/threads/stop"),
127
+ method: "POST",
128
+ headers: _headers,
129
+ contentType: "application/json",
130
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
131
+ requestType: "json",
132
+ body: request,
133
+ 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,
134
+ 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,
135
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
136
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
137
+ logging: this._options.logging,
138
+ });
139
+ if (_response.ok) {
140
+ return {
141
+ data: _response.body,
142
+ rawResponse: _response.rawResponse,
143
+ };
144
+ }
145
+ if (_response.error.reason === "status-code") {
146
+ switch (_response.error.statusCode) {
147
+ case 401:
148
+ throw new AthenaIntelligence.UnauthorizedError(_response.error.body, _response.rawResponse);
149
+ case 422:
150
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
151
+ case 500:
152
+ throw new AthenaIntelligence.InternalServerError(_response.error.body, _response.rawResponse);
153
+ default:
154
+ throw new errors.AthenaIntelligenceError({
155
+ statusCode: _response.error.statusCode,
156
+ body: _response.error.body,
157
+ rawResponse: _response.rawResponse,
158
+ });
159
+ }
160
+ }
161
+ switch (_response.error.reason) {
162
+ case "non-json":
163
+ throw new errors.AthenaIntelligenceError({
164
+ statusCode: _response.error.statusCode,
165
+ body: _response.error.rawBody,
166
+ rawResponse: _response.rawResponse,
167
+ });
168
+ case "body-is-null":
169
+ throw new errors.AthenaIntelligenceError({
170
+ statusCode: _response.error.statusCode,
171
+ rawResponse: _response.rawResponse,
172
+ });
173
+ case "timeout":
174
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/threads/stop.");
175
+ case "unknown":
176
+ throw new errors.AthenaIntelligenceError({
177
+ message: _response.error.errorMessage,
178
+ rawResponse: _response.rawResponse,
179
+ });
180
+ }
181
+ });
182
+ }
21
183
  /**
22
184
  * Check the status of a thread execution by thread ID. Returns thread status and associated conversation asset information for tracking progress.
23
185
  *
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Request model for batch thread stop.
3
+ */
4
+ export interface ThreadBatchStopRequest {
5
+ /** List of thread IDs to stop */
6
+ thread_ids: string[];
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,14 @@
1
+ import type * as AthenaIntelligence from "../index.mjs";
2
+ /**
3
+ * Response model for batch thread stop.
4
+ */
5
+ export interface ThreadBatchStopResponseOut {
6
+ /** Number of threads that failed to stop */
7
+ failed_count: number;
8
+ /** Detailed results for each thread */
9
+ results: AthenaIntelligence.ThreadBatchStopResultItem[];
10
+ /** Number of threads successfully stopped */
11
+ stopped_count: number;
12
+ /** Total number of threads requested to stop */
13
+ total_requested: number;
14
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Result for a single thread in batch stop operation.
3
+ */
4
+ export interface ThreadBatchStopResultItem {
5
+ /** Error message if stop failed */
6
+ error?: string;
7
+ /** Whether the stop was successful */
8
+ success: boolean;
9
+ /** The thread ID */
10
+ thread_id: string;
11
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -58,6 +58,9 @@ export * from "./TableRowData.mjs";
58
58
  export * from "./TextContent.mjs";
59
59
  export * from "./TextFormatModel.mjs";
60
60
  export * from "./ThemeColor.mjs";
61
+ export * from "./ThreadBatchStopRequest.mjs";
62
+ export * from "./ThreadBatchStopResponseOut.mjs";
63
+ export * from "./ThreadBatchStopResultItem.mjs";
61
64
  export * from "./ThreadStatusResponseOut.mjs";
62
65
  export * from "./ThreadStopResponseOut.mjs";
63
66
  export * from "./WrapStrategy.mjs";
@@ -58,6 +58,9 @@ export * from "./TableRowData.mjs";
58
58
  export * from "./TextContent.mjs";
59
59
  export * from "./TextFormatModel.mjs";
60
60
  export * from "./ThemeColor.mjs";
61
+ export * from "./ThreadBatchStopRequest.mjs";
62
+ export * from "./ThreadBatchStopResponseOut.mjs";
63
+ export * from "./ThreadBatchStopResultItem.mjs";
61
64
  export * from "./ThreadStatusResponseOut.mjs";
62
65
  export * from "./ThreadStopResponseOut.mjs";
63
66
  export * from "./WrapStrategy.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.364";
1
+ export declare const SDK_VERSION = "4.3.366";
@@ -1 +1 @@
1
- export const SDK_VERSION = "4.3.364";
1
+ export const SDK_VERSION = "4.3.366";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athenaintel/sdk",
3
- "version": "4.3.364",
3
+ "version": "4.3.366",
4
4
  "private": false,
5
5
  "repository": "github:Athena-Intel/athena-typescript",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -1215,6 +1215,136 @@ await client.query.executeSnippet({
1215
1215
  </details>
1216
1216
 
1217
1217
  ## Threads
1218
+ <details><summary><code>client.threads.<a href="/src/api/resources/threads/client/Client.ts">batchStopByAssetId</a>({ ...params }) -> AthenaIntelligence.ThreadBatchStopResponseOut</code></summary>
1219
+ <dl>
1220
+ <dd>
1221
+
1222
+ #### 📝 Description
1223
+
1224
+ <dl>
1225
+ <dd>
1226
+
1227
+ <dl>
1228
+ <dd>
1229
+
1230
+ Stop multiple running thread executions by asset ID in a single request. This is useful for stopping many AOP executions at once from the UI. Each thread is stopped independently - failures for individual threads do not affect other threads in the batch.
1231
+ </dd>
1232
+ </dl>
1233
+ </dd>
1234
+ </dl>
1235
+
1236
+ #### 🔌 Usage
1237
+
1238
+ <dl>
1239
+ <dd>
1240
+
1241
+ <dl>
1242
+ <dd>
1243
+
1244
+ ```typescript
1245
+ await client.threads.batchStopByAssetId({
1246
+ thread_ids: ["thread_ids"]
1247
+ });
1248
+
1249
+ ```
1250
+ </dd>
1251
+ </dl>
1252
+ </dd>
1253
+ </dl>
1254
+
1255
+ #### ⚙️ Parameters
1256
+
1257
+ <dl>
1258
+ <dd>
1259
+
1260
+ <dl>
1261
+ <dd>
1262
+
1263
+ **request:** `AthenaIntelligence.ThreadBatchStopRequest`
1264
+
1265
+ </dd>
1266
+ </dl>
1267
+
1268
+ <dl>
1269
+ <dd>
1270
+
1271
+ **requestOptions:** `ThreadsClient.RequestOptions`
1272
+
1273
+ </dd>
1274
+ </dl>
1275
+ </dd>
1276
+ </dl>
1277
+
1278
+
1279
+ </dd>
1280
+ </dl>
1281
+ </details>
1282
+
1283
+ <details><summary><code>client.threads.<a href="/src/api/resources/threads/client/Client.ts">batchStop</a>({ ...params }) -> AthenaIntelligence.ThreadBatchStopResponseOut</code></summary>
1284
+ <dl>
1285
+ <dd>
1286
+
1287
+ #### 📝 Description
1288
+
1289
+ <dl>
1290
+ <dd>
1291
+
1292
+ <dl>
1293
+ <dd>
1294
+
1295
+ Stop multiple running thread executions in a single request. This endpoint accepts thread IDs (the same IDs used with the single-thread stop endpoint). Each thread is stopped independently - failures for individual threads do not affect other threads in the batch.
1296
+ </dd>
1297
+ </dl>
1298
+ </dd>
1299
+ </dl>
1300
+
1301
+ #### 🔌 Usage
1302
+
1303
+ <dl>
1304
+ <dd>
1305
+
1306
+ <dl>
1307
+ <dd>
1308
+
1309
+ ```typescript
1310
+ await client.threads.batchStop({
1311
+ thread_ids: ["thread_ids"]
1312
+ });
1313
+
1314
+ ```
1315
+ </dd>
1316
+ </dl>
1317
+ </dd>
1318
+ </dl>
1319
+
1320
+ #### ⚙️ Parameters
1321
+
1322
+ <dl>
1323
+ <dd>
1324
+
1325
+ <dl>
1326
+ <dd>
1327
+
1328
+ **request:** `AthenaIntelligence.ThreadBatchStopRequest`
1329
+
1330
+ </dd>
1331
+ </dl>
1332
+
1333
+ <dl>
1334
+ <dd>
1335
+
1336
+ **requestOptions:** `ThreadsClient.RequestOptions`
1337
+
1338
+ </dd>
1339
+ </dl>
1340
+ </dd>
1341
+ </dl>
1342
+
1343
+
1344
+ </dd>
1345
+ </dl>
1346
+ </details>
1347
+
1218
1348
  <details><summary><code>client.threads.<a href="/src/api/resources/threads/client/Client.ts">getStatus</a>(thread_id) -> AthenaIntelligence.ThreadStatusResponseOut</code></summary>
1219
1349
  <dl>
1220
1350
  <dd>