@knowledge-stack/ksapi 1.139.1 → 1.140.1
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.
- package/.openapi-generator/FILES +28 -0
- package/README.md +25 -11
- package/dist/apis/AdminKbApi.d.ts +109 -0
- package/dist/apis/AdminKbApi.js +172 -0
- package/dist/apis/AdminWorkflowsApi.d.ts +252 -0
- package/dist/apis/AdminWorkflowsApi.js +337 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +2 -0
- package/dist/esm/apis/AdminKbApi.d.ts +109 -0
- package/dist/esm/apis/AdminKbApi.js +135 -0
- package/dist/esm/apis/AdminWorkflowsApi.d.ts +252 -0
- package/dist/esm/apis/AdminWorkflowsApi.js +300 -0
- package/dist/esm/apis/index.d.ts +2 -0
- package/dist/esm/apis/index.js +2 -0
- package/dist/esm/models/CitedChunk.d.ts +6 -4
- package/dist/esm/models/DefinitionOutputStat.d.ts +65 -0
- package/dist/esm/models/DefinitionOutputStat.js +56 -0
- package/dist/esm/models/HourHistogramResponse.d.ts +53 -0
- package/dist/esm/models/HourHistogramResponse.js +54 -0
- package/dist/esm/models/KbMetric.d.ts +26 -0
- package/dist/esm/models/KbMetric.js +44 -0
- package/dist/esm/models/KbSummaryResponse.d.ts +152 -0
- package/dist/esm/models/KbSummaryResponse.js +109 -0
- package/dist/esm/models/KbTimeseriesResponse.d.ts +71 -0
- package/dist/esm/models/KbTimeseriesResponse.js +57 -0
- package/dist/esm/models/LabeledSeries.d.ts +54 -0
- package/dist/esm/models/LabeledSeries.js +47 -0
- package/dist/esm/models/LeaderboardEntry.d.ts +59 -0
- package/dist/esm/models/LeaderboardEntry.js +52 -0
- package/dist/esm/models/RunTimeseriesResponse.d.ts +61 -0
- package/dist/esm/models/RunTimeseriesResponse.js +52 -0
- package/dist/esm/models/TimeBucket.d.ts +27 -0
- package/dist/esm/models/TimeBucket.js +45 -0
- package/dist/esm/models/TimeseriesPoint.d.ts +53 -0
- package/dist/esm/models/TimeseriesPoint.js +48 -0
- package/dist/esm/models/WorkflowLeaderboardResponse.d.ts +54 -0
- package/dist/esm/models/WorkflowLeaderboardResponse.js +45 -0
- package/dist/esm/models/WorkflowOutputStatsResponse.d.ts +54 -0
- package/dist/esm/models/WorkflowOutputStatsResponse.js +47 -0
- package/dist/esm/models/index.d.ts +12 -0
- package/dist/esm/models/index.js +12 -0
- package/dist/models/CitedChunk.d.ts +6 -4
- package/dist/models/DefinitionOutputStat.d.ts +65 -0
- package/dist/models/DefinitionOutputStat.js +64 -0
- package/dist/models/HourHistogramResponse.d.ts +53 -0
- package/dist/models/HourHistogramResponse.js +62 -0
- package/dist/models/KbMetric.d.ts +26 -0
- package/dist/models/KbMetric.js +52 -0
- package/dist/models/KbSummaryResponse.d.ts +152 -0
- package/dist/models/KbSummaryResponse.js +117 -0
- package/dist/models/KbTimeseriesResponse.d.ts +71 -0
- package/dist/models/KbTimeseriesResponse.js +65 -0
- package/dist/models/LabeledSeries.d.ts +54 -0
- package/dist/models/LabeledSeries.js +55 -0
- package/dist/models/LeaderboardEntry.d.ts +59 -0
- package/dist/models/LeaderboardEntry.js +60 -0
- package/dist/models/RunTimeseriesResponse.d.ts +61 -0
- package/dist/models/RunTimeseriesResponse.js +60 -0
- package/dist/models/TimeBucket.d.ts +27 -0
- package/dist/models/TimeBucket.js +53 -0
- package/dist/models/TimeseriesPoint.d.ts +53 -0
- package/dist/models/TimeseriesPoint.js +56 -0
- package/dist/models/WorkflowLeaderboardResponse.d.ts +54 -0
- package/dist/models/WorkflowLeaderboardResponse.js +53 -0
- package/dist/models/WorkflowOutputStatsResponse.d.ts +54 -0
- package/dist/models/WorkflowOutputStatsResponse.js +55 -0
- package/dist/models/index.d.ts +12 -0
- package/dist/models/index.js +12 -0
- package/docs/AdminKbApi.md +163 -0
- package/docs/AdminWorkflowsApi.md +424 -0
- package/docs/CitedChunk.md +1 -1
- package/docs/DefinitionOutputStat.md +41 -0
- package/docs/HourHistogramResponse.md +37 -0
- package/docs/KbMetric.md +33 -0
- package/docs/KbSummaryResponse.md +67 -0
- package/docs/KbTimeseriesResponse.md +41 -0
- package/docs/LabeledSeries.md +37 -0
- package/docs/LeaderboardEntry.md +39 -0
- package/docs/RunTimeseriesResponse.md +39 -0
- package/docs/TimeBucket.md +33 -0
- package/docs/TimeseriesPoint.md +37 -0
- package/docs/WorkflowLeaderboardResponse.md +37 -0
- package/docs/WorkflowOutputStatsResponse.md +37 -0
- package/package.json +1 -1
- package/src/apis/AdminKbApi.ts +237 -0
- package/src/apis/AdminWorkflowsApi.ts +539 -0
- package/src/apis/index.ts +2 -0
- package/src/models/CitedChunk.ts +6 -4
- package/src/models/DefinitionOutputStat.ts +110 -0
- package/src/models/HourHistogramResponse.ts +97 -0
- package/src/models/KbMetric.ts +54 -0
- package/src/models/KbSummaryResponse.ts +235 -0
- package/src/models/KbTimeseriesResponse.ts +136 -0
- package/src/models/LabeledSeries.ts +99 -0
- package/src/models/LeaderboardEntry.ts +101 -0
- package/src/models/RunTimeseriesResponse.ts +117 -0
- package/src/models/TimeBucket.ts +55 -0
- package/src/models/TimeseriesPoint.ts +92 -0
- package/src/models/WorkflowLeaderboardResponse.ts +98 -0
- package/src/models/WorkflowOutputStatsResponse.ts +99 -0
- package/src/models/index.ts +12 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
import * as runtime from '../runtime';
|
|
24
|
+
import { HourHistogramResponseFromJSON, RunTimeseriesResponseFromJSON, WorkflowLeaderboardResponseFromJSON, WorkflowOutputStatsResponseFromJSON, WorkflowRunSummaryResponseFromJSON, } from '../models/index';
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class AdminWorkflowsApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Creates request options for getAdminWorkflowByHour without sending the request
|
|
31
|
+
*/
|
|
32
|
+
getAdminWorkflowByHourRequestOpts(requestParameters) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const queryParameters = {};
|
|
35
|
+
if (requestParameters['since'] != null) {
|
|
36
|
+
queryParameters['since'] = requestParameters['since'].toISOString();
|
|
37
|
+
}
|
|
38
|
+
if (requestParameters['until'] != null) {
|
|
39
|
+
queryParameters['until'] = requestParameters['until'].toISOString();
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['timezone'] != null) {
|
|
42
|
+
queryParameters['timezone'] = requestParameters['timezone'];
|
|
43
|
+
}
|
|
44
|
+
if (requestParameters['definitionId'] != null) {
|
|
45
|
+
queryParameters['definition_id'] = requestParameters['definitionId'];
|
|
46
|
+
}
|
|
47
|
+
const headerParameters = {};
|
|
48
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
49
|
+
const token = this.configuration.accessToken;
|
|
50
|
+
const tokenString = yield token("bearerAuth", []);
|
|
51
|
+
if (tokenString) {
|
|
52
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
let urlPath = `/v1/admin/workflows/by-hour`;
|
|
56
|
+
return {
|
|
57
|
+
path: urlPath,
|
|
58
|
+
method: 'GET',
|
|
59
|
+
headers: headerParameters,
|
|
60
|
+
query: queryParameters,
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Runs per hour-of-day (0-23) in the resolved timezone.
|
|
66
|
+
* Get Admin Workflow By Hour Handler
|
|
67
|
+
*/
|
|
68
|
+
getAdminWorkflowByHourRaw(requestParameters, initOverrides) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const requestOptions = yield this.getAdminWorkflowByHourRequestOpts(requestParameters);
|
|
71
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
72
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => HourHistogramResponseFromJSON(jsonValue));
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Runs per hour-of-day (0-23) in the resolved timezone.
|
|
77
|
+
* Get Admin Workflow By Hour Handler
|
|
78
|
+
*/
|
|
79
|
+
getAdminWorkflowByHour() {
|
|
80
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
81
|
+
const response = yield this.getAdminWorkflowByHourRaw(requestParameters, initOverrides);
|
|
82
|
+
return yield response.value();
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Creates request options for getAdminWorkflowLeaderboard without sending the request
|
|
87
|
+
*/
|
|
88
|
+
getAdminWorkflowLeaderboardRequestOpts(requestParameters) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
const queryParameters = {};
|
|
91
|
+
if (requestParameters['since'] != null) {
|
|
92
|
+
queryParameters['since'] = requestParameters['since'].toISOString();
|
|
93
|
+
}
|
|
94
|
+
if (requestParameters['until'] != null) {
|
|
95
|
+
queryParameters['until'] = requestParameters['until'].toISOString();
|
|
96
|
+
}
|
|
97
|
+
if (requestParameters['limit'] != null) {
|
|
98
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
99
|
+
}
|
|
100
|
+
const headerParameters = {};
|
|
101
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
102
|
+
const token = this.configuration.accessToken;
|
|
103
|
+
const tokenString = yield token("bearerAuth", []);
|
|
104
|
+
if (tokenString) {
|
|
105
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
let urlPath = `/v1/admin/workflows/leaderboard`;
|
|
109
|
+
return {
|
|
110
|
+
path: urlPath,
|
|
111
|
+
method: 'GET',
|
|
112
|
+
headers: headerParameters,
|
|
113
|
+
query: queryParameters,
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Top workflows and top run owners by run count.
|
|
119
|
+
* Get Admin Workflow Leaderboard Handler
|
|
120
|
+
*/
|
|
121
|
+
getAdminWorkflowLeaderboardRaw(requestParameters, initOverrides) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
const requestOptions = yield this.getAdminWorkflowLeaderboardRequestOpts(requestParameters);
|
|
124
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
125
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WorkflowLeaderboardResponseFromJSON(jsonValue));
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Top workflows and top run owners by run count.
|
|
130
|
+
* Get Admin Workflow Leaderboard Handler
|
|
131
|
+
*/
|
|
132
|
+
getAdminWorkflowLeaderboard() {
|
|
133
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
134
|
+
const response = yield this.getAdminWorkflowLeaderboardRaw(requestParameters, initOverrides);
|
|
135
|
+
return yield response.value();
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Creates request options for getAdminWorkflowOutputStats without sending the request
|
|
140
|
+
*/
|
|
141
|
+
getAdminWorkflowOutputStatsRequestOpts(requestParameters) {
|
|
142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
const queryParameters = {};
|
|
144
|
+
if (requestParameters['since'] != null) {
|
|
145
|
+
queryParameters['since'] = requestParameters['since'].toISOString();
|
|
146
|
+
}
|
|
147
|
+
if (requestParameters['until'] != null) {
|
|
148
|
+
queryParameters['until'] = requestParameters['until'].toISOString();
|
|
149
|
+
}
|
|
150
|
+
const headerParameters = {};
|
|
151
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
152
|
+
const token = this.configuration.accessToken;
|
|
153
|
+
const tokenString = yield token("bearerAuth", []);
|
|
154
|
+
if (tokenString) {
|
|
155
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
let urlPath = `/v1/admin/workflows/output-stats`;
|
|
159
|
+
return {
|
|
160
|
+
path: urlPath,
|
|
161
|
+
method: 'GET',
|
|
162
|
+
headers: headerParameters,
|
|
163
|
+
query: queryParameters,
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Average output DOCUMENTs generated per workflow definition (completed runs).
|
|
169
|
+
* Get Admin Workflow Output Stats Handler
|
|
170
|
+
*/
|
|
171
|
+
getAdminWorkflowOutputStatsRaw(requestParameters, initOverrides) {
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
const requestOptions = yield this.getAdminWorkflowOutputStatsRequestOpts(requestParameters);
|
|
174
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
175
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WorkflowOutputStatsResponseFromJSON(jsonValue));
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Average output DOCUMENTs generated per workflow definition (completed runs).
|
|
180
|
+
* Get Admin Workflow Output Stats Handler
|
|
181
|
+
*/
|
|
182
|
+
getAdminWorkflowOutputStats() {
|
|
183
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
184
|
+
const response = yield this.getAdminWorkflowOutputStatsRaw(requestParameters, initOverrides);
|
|
185
|
+
return yield response.value();
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Creates request options for getAdminWorkflowSummary without sending the request
|
|
190
|
+
*/
|
|
191
|
+
getAdminWorkflowSummaryRequestOpts(requestParameters) {
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
const queryParameters = {};
|
|
194
|
+
if (requestParameters['since'] != null) {
|
|
195
|
+
queryParameters['since'] = requestParameters['since'].toISOString();
|
|
196
|
+
}
|
|
197
|
+
if (requestParameters['until'] != null) {
|
|
198
|
+
queryParameters['until'] = requestParameters['until'].toISOString();
|
|
199
|
+
}
|
|
200
|
+
if (requestParameters['definitionId'] != null) {
|
|
201
|
+
queryParameters['definition_id'] = requestParameters['definitionId'];
|
|
202
|
+
}
|
|
203
|
+
const headerParameters = {};
|
|
204
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
205
|
+
const token = this.configuration.accessToken;
|
|
206
|
+
const tokenString = yield token("bearerAuth", []);
|
|
207
|
+
if (tokenString) {
|
|
208
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
let urlPath = `/v1/admin/workflows/summary`;
|
|
212
|
+
return {
|
|
213
|
+
path: urlPath,
|
|
214
|
+
method: 'GET',
|
|
215
|
+
headers: headerParameters,
|
|
216
|
+
query: queryParameters,
|
|
217
|
+
};
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Tenant-wide run health: counts, failure rate, durations, approval backlog.
|
|
222
|
+
* Get Admin Workflow Summary Handler
|
|
223
|
+
*/
|
|
224
|
+
getAdminWorkflowSummaryRaw(requestParameters, initOverrides) {
|
|
225
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
226
|
+
const requestOptions = yield this.getAdminWorkflowSummaryRequestOpts(requestParameters);
|
|
227
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
228
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WorkflowRunSummaryResponseFromJSON(jsonValue));
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Tenant-wide run health: counts, failure rate, durations, approval backlog.
|
|
233
|
+
* Get Admin Workflow Summary Handler
|
|
234
|
+
*/
|
|
235
|
+
getAdminWorkflowSummary() {
|
|
236
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
237
|
+
const response = yield this.getAdminWorkflowSummaryRaw(requestParameters, initOverrides);
|
|
238
|
+
return yield response.value();
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Creates request options for getAdminWorkflowTimeseries without sending the request
|
|
243
|
+
*/
|
|
244
|
+
getAdminWorkflowTimeseriesRequestOpts(requestParameters) {
|
|
245
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
246
|
+
const queryParameters = {};
|
|
247
|
+
if (requestParameters['since'] != null) {
|
|
248
|
+
queryParameters['since'] = requestParameters['since'].toISOString();
|
|
249
|
+
}
|
|
250
|
+
if (requestParameters['until'] != null) {
|
|
251
|
+
queryParameters['until'] = requestParameters['until'].toISOString();
|
|
252
|
+
}
|
|
253
|
+
if (requestParameters['bucket'] != null) {
|
|
254
|
+
queryParameters['bucket'] = requestParameters['bucket'];
|
|
255
|
+
}
|
|
256
|
+
if (requestParameters['timezone'] != null) {
|
|
257
|
+
queryParameters['timezone'] = requestParameters['timezone'];
|
|
258
|
+
}
|
|
259
|
+
if (requestParameters['definitionId'] != null) {
|
|
260
|
+
queryParameters['definition_id'] = requestParameters['definitionId'];
|
|
261
|
+
}
|
|
262
|
+
const headerParameters = {};
|
|
263
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
264
|
+
const token = this.configuration.accessToken;
|
|
265
|
+
const tokenString = yield token("bearerAuth", []);
|
|
266
|
+
if (tokenString) {
|
|
267
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
let urlPath = `/v1/admin/workflows/timeseries`;
|
|
271
|
+
return {
|
|
272
|
+
path: urlPath,
|
|
273
|
+
method: 'GET',
|
|
274
|
+
headers: headerParameters,
|
|
275
|
+
query: queryParameters,
|
|
276
|
+
};
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Run counts bucketed over time, in the resolved timezone.
|
|
281
|
+
* Get Admin Workflow Timeseries Handler
|
|
282
|
+
*/
|
|
283
|
+
getAdminWorkflowTimeseriesRaw(requestParameters, initOverrides) {
|
|
284
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
285
|
+
const requestOptions = yield this.getAdminWorkflowTimeseriesRequestOpts(requestParameters);
|
|
286
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
287
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RunTimeseriesResponseFromJSON(jsonValue));
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Run counts bucketed over time, in the resolved timezone.
|
|
292
|
+
* Get Admin Workflow Timeseries Handler
|
|
293
|
+
*/
|
|
294
|
+
getAdminWorkflowTimeseries() {
|
|
295
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
296
|
+
const response = yield this.getAdminWorkflowTimeseriesRaw(requestParameters, initOverrides);
|
|
297
|
+
return yield response.value();
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}
|
package/dist/esm/apis/index.d.ts
CHANGED
package/dist/esm/apis/index.js
CHANGED
|
@@ -16,10 +16,12 @@ import type { DocumentType } from './DocumentType';
|
|
|
16
16
|
* ``chunk_id`` is the load-bearing field — every reader can use it via
|
|
17
17
|
* ``/v1/chunks/bulk``. The document fields are populated by
|
|
18
18
|
* ``ks_upload_from_sandbox`` when it resolves each chunk through the KS API at
|
|
19
|
-
* save time; they stay ``None`` only when
|
|
20
|
-
* (
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* save time; they stay ``None`` only when a *transient* resolve failure
|
|
20
|
+
* (network, 5xx) left the chunk unenriched. A chunk that no longer exists
|
|
21
|
+
* (a definitive 404) is dropped at save time rather than persisted with a
|
|
22
|
+
* bare id, so a dead citation never reaches the FE. The doc-info snapshot is
|
|
23
|
+
* captured at save time; later renames or replacements of the source document
|
|
24
|
+
* do not update it.
|
|
23
25
|
* @export
|
|
24
26
|
* @interface CitedChunk
|
|
25
27
|
*/
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge Stack API
|
|
3
|
+
* Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Average output-document count for one workflow definition.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface DefinitionOutputStat
|
|
16
|
+
*/
|
|
17
|
+
export interface DefinitionOutputStat {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof DefinitionOutputStat
|
|
22
|
+
*/
|
|
23
|
+
definitionId: string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof DefinitionOutputStat
|
|
28
|
+
*/
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* COMPLETED runs in the window.
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof DefinitionOutputStat
|
|
34
|
+
*/
|
|
35
|
+
completedRuns: number;
|
|
36
|
+
/**
|
|
37
|
+
* Mean output DOCUMENTs generated per completed run.
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof DefinitionOutputStat
|
|
40
|
+
*/
|
|
41
|
+
avgDocuments: number;
|
|
42
|
+
}
|
|
43
|
+
export declare const DefinitionOutputStatPropertyValidationAttributesMap: {
|
|
44
|
+
[property: string]: {
|
|
45
|
+
maxLength?: number;
|
|
46
|
+
minLength?: number;
|
|
47
|
+
pattern?: string;
|
|
48
|
+
maximum?: number;
|
|
49
|
+
exclusiveMaximum?: boolean;
|
|
50
|
+
minimum?: number;
|
|
51
|
+
exclusiveMinimum?: boolean;
|
|
52
|
+
multipleOf?: number;
|
|
53
|
+
maxItems?: number;
|
|
54
|
+
minItems?: number;
|
|
55
|
+
uniqueItems?: boolean;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Check if a given object implements the DefinitionOutputStat interface.
|
|
60
|
+
*/
|
|
61
|
+
export declare function instanceOfDefinitionOutputStat(value: object): value is DefinitionOutputStat;
|
|
62
|
+
export declare function DefinitionOutputStatFromJSON(json: any): DefinitionOutputStat;
|
|
63
|
+
export declare function DefinitionOutputStatFromJSONTyped(json: any, ignoreDiscriminator: boolean): DefinitionOutputStat;
|
|
64
|
+
export declare function DefinitionOutputStatToJSON(json: any): DefinitionOutputStat;
|
|
65
|
+
export declare function DefinitionOutputStatToJSONTyped(value?: DefinitionOutputStat | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
export const DefinitionOutputStatPropertyValidationAttributesMap = {};
|
|
15
|
+
/**
|
|
16
|
+
* Check if a given object implements the DefinitionOutputStat interface.
|
|
17
|
+
*/
|
|
18
|
+
export function instanceOfDefinitionOutputStat(value) {
|
|
19
|
+
if (!('definitionId' in value) || value['definitionId'] === undefined)
|
|
20
|
+
return false;
|
|
21
|
+
if (!('name' in value) || value['name'] === undefined)
|
|
22
|
+
return false;
|
|
23
|
+
if (!('completedRuns' in value) || value['completedRuns'] === undefined)
|
|
24
|
+
return false;
|
|
25
|
+
if (!('avgDocuments' in value) || value['avgDocuments'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
export function DefinitionOutputStatFromJSON(json) {
|
|
30
|
+
return DefinitionOutputStatFromJSONTyped(json, false);
|
|
31
|
+
}
|
|
32
|
+
export function DefinitionOutputStatFromJSONTyped(json, ignoreDiscriminator) {
|
|
33
|
+
if (json == null) {
|
|
34
|
+
return json;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
'definitionId': json['definition_id'],
|
|
38
|
+
'name': json['name'],
|
|
39
|
+
'completedRuns': json['completed_runs'],
|
|
40
|
+
'avgDocuments': json['avg_documents'],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function DefinitionOutputStatToJSON(json) {
|
|
44
|
+
return DefinitionOutputStatToJSONTyped(json, false);
|
|
45
|
+
}
|
|
46
|
+
export function DefinitionOutputStatToJSONTyped(value, ignoreDiscriminator = false) {
|
|
47
|
+
if (value == null) {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
'definition_id': value['definitionId'],
|
|
52
|
+
'name': value['name'],
|
|
53
|
+
'completed_runs': value['completedRuns'],
|
|
54
|
+
'avg_documents': value['avgDocuments'],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge Stack API
|
|
3
|
+
* Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Workflow runs by hour-of-day (0-23) in the resolved timezone.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface HourHistogramResponse
|
|
16
|
+
*/
|
|
17
|
+
export interface HourHistogramResponse {
|
|
18
|
+
/**
|
|
19
|
+
* IANA timezone the hours are in.
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof HourHistogramResponse
|
|
22
|
+
*/
|
|
23
|
+
timezone: string;
|
|
24
|
+
/**
|
|
25
|
+
* Exactly 24 entries; index i is the run count for hour i.
|
|
26
|
+
* @type {Array<number>}
|
|
27
|
+
* @memberof HourHistogramResponse
|
|
28
|
+
*/
|
|
29
|
+
countsByHour: Array<number>;
|
|
30
|
+
}
|
|
31
|
+
export declare const HourHistogramResponsePropertyValidationAttributesMap: {
|
|
32
|
+
[property: string]: {
|
|
33
|
+
maxLength?: number;
|
|
34
|
+
minLength?: number;
|
|
35
|
+
pattern?: string;
|
|
36
|
+
maximum?: number;
|
|
37
|
+
exclusiveMaximum?: boolean;
|
|
38
|
+
minimum?: number;
|
|
39
|
+
exclusiveMinimum?: boolean;
|
|
40
|
+
multipleOf?: number;
|
|
41
|
+
maxItems?: number;
|
|
42
|
+
minItems?: number;
|
|
43
|
+
uniqueItems?: boolean;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Check if a given object implements the HourHistogramResponse interface.
|
|
48
|
+
*/
|
|
49
|
+
export declare function instanceOfHourHistogramResponse(value: object): value is HourHistogramResponse;
|
|
50
|
+
export declare function HourHistogramResponseFromJSON(json: any): HourHistogramResponse;
|
|
51
|
+
export declare function HourHistogramResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): HourHistogramResponse;
|
|
52
|
+
export declare function HourHistogramResponseToJSON(json: any): HourHistogramResponse;
|
|
53
|
+
export declare function HourHistogramResponseToJSONTyped(value?: HourHistogramResponse | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
export const HourHistogramResponsePropertyValidationAttributesMap = {
|
|
15
|
+
countsByHour: {
|
|
16
|
+
maxItems: 24,
|
|
17
|
+
minItems: 24,
|
|
18
|
+
uniqueItems: false,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the HourHistogramResponse interface.
|
|
23
|
+
*/
|
|
24
|
+
export function instanceOfHourHistogramResponse(value) {
|
|
25
|
+
if (!('timezone' in value) || value['timezone'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('countsByHour' in value) || value['countsByHour'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
export function HourHistogramResponseFromJSON(json) {
|
|
32
|
+
return HourHistogramResponseFromJSONTyped(json, false);
|
|
33
|
+
}
|
|
34
|
+
export function HourHistogramResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
35
|
+
if (json == null) {
|
|
36
|
+
return json;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
'timezone': json['timezone'],
|
|
40
|
+
'countsByHour': json['counts_by_hour'],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function HourHistogramResponseToJSON(json) {
|
|
44
|
+
return HourHistogramResponseToJSONTyped(json, false);
|
|
45
|
+
}
|
|
46
|
+
export function HourHistogramResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
47
|
+
if (value == null) {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
'timezone': value['timezone'],
|
|
52
|
+
'counts_by_hour': value['countsByHour'],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge Stack API
|
|
3
|
+
* Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* A knowledge-base time series the dashboard can request.
|
|
14
|
+
* @export
|
|
15
|
+
*/
|
|
16
|
+
export declare const KbMetric: {
|
|
17
|
+
readonly DocumentUploads: 'document_uploads';
|
|
18
|
+
readonly IngestionCompleted: 'ingestion_completed';
|
|
19
|
+
readonly IngestionFailed: 'ingestion_failed';
|
|
20
|
+
};
|
|
21
|
+
export type KbMetric = typeof KbMetric[keyof typeof KbMetric];
|
|
22
|
+
export declare function instanceOfKbMetric(value: any): boolean;
|
|
23
|
+
export declare function KbMetricFromJSON(json: any): KbMetric;
|
|
24
|
+
export declare function KbMetricFromJSONTyped(json: any, ignoreDiscriminator: boolean): KbMetric;
|
|
25
|
+
export declare function KbMetricToJSON(value?: KbMetric | null): any;
|
|
26
|
+
export declare function KbMetricToJSONTyped(value: any, ignoreDiscriminator: boolean): KbMetric;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* A knowledge-base time series the dashboard can request.
|
|
16
|
+
* @export
|
|
17
|
+
*/
|
|
18
|
+
export const KbMetric = {
|
|
19
|
+
DocumentUploads: 'document_uploads',
|
|
20
|
+
IngestionCompleted: 'ingestion_completed',
|
|
21
|
+
IngestionFailed: 'ingestion_failed'
|
|
22
|
+
};
|
|
23
|
+
export function instanceOfKbMetric(value) {
|
|
24
|
+
for (const key in KbMetric) {
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(KbMetric, key)) {
|
|
26
|
+
if (KbMetric[key] === value) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
export function KbMetricFromJSON(json) {
|
|
34
|
+
return KbMetricFromJSONTyped(json, false);
|
|
35
|
+
}
|
|
36
|
+
export function KbMetricFromJSONTyped(json, ignoreDiscriminator) {
|
|
37
|
+
return json;
|
|
38
|
+
}
|
|
39
|
+
export function KbMetricToJSON(value) {
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
export function KbMetricToJSONTyped(value, ignoreDiscriminator) {
|
|
43
|
+
return value;
|
|
44
|
+
}
|