@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.
Files changed (101) hide show
  1. package/.openapi-generator/FILES +28 -0
  2. package/README.md +25 -11
  3. package/dist/apis/AdminKbApi.d.ts +109 -0
  4. package/dist/apis/AdminKbApi.js +172 -0
  5. package/dist/apis/AdminWorkflowsApi.d.ts +252 -0
  6. package/dist/apis/AdminWorkflowsApi.js +337 -0
  7. package/dist/apis/index.d.ts +2 -0
  8. package/dist/apis/index.js +2 -0
  9. package/dist/esm/apis/AdminKbApi.d.ts +109 -0
  10. package/dist/esm/apis/AdminKbApi.js +135 -0
  11. package/dist/esm/apis/AdminWorkflowsApi.d.ts +252 -0
  12. package/dist/esm/apis/AdminWorkflowsApi.js +300 -0
  13. package/dist/esm/apis/index.d.ts +2 -0
  14. package/dist/esm/apis/index.js +2 -0
  15. package/dist/esm/models/CitedChunk.d.ts +6 -4
  16. package/dist/esm/models/DefinitionOutputStat.d.ts +65 -0
  17. package/dist/esm/models/DefinitionOutputStat.js +56 -0
  18. package/dist/esm/models/HourHistogramResponse.d.ts +53 -0
  19. package/dist/esm/models/HourHistogramResponse.js +54 -0
  20. package/dist/esm/models/KbMetric.d.ts +26 -0
  21. package/dist/esm/models/KbMetric.js +44 -0
  22. package/dist/esm/models/KbSummaryResponse.d.ts +152 -0
  23. package/dist/esm/models/KbSummaryResponse.js +109 -0
  24. package/dist/esm/models/KbTimeseriesResponse.d.ts +71 -0
  25. package/dist/esm/models/KbTimeseriesResponse.js +57 -0
  26. package/dist/esm/models/LabeledSeries.d.ts +54 -0
  27. package/dist/esm/models/LabeledSeries.js +47 -0
  28. package/dist/esm/models/LeaderboardEntry.d.ts +59 -0
  29. package/dist/esm/models/LeaderboardEntry.js +52 -0
  30. package/dist/esm/models/RunTimeseriesResponse.d.ts +61 -0
  31. package/dist/esm/models/RunTimeseriesResponse.js +52 -0
  32. package/dist/esm/models/TimeBucket.d.ts +27 -0
  33. package/dist/esm/models/TimeBucket.js +45 -0
  34. package/dist/esm/models/TimeseriesPoint.d.ts +53 -0
  35. package/dist/esm/models/TimeseriesPoint.js +48 -0
  36. package/dist/esm/models/WorkflowLeaderboardResponse.d.ts +54 -0
  37. package/dist/esm/models/WorkflowLeaderboardResponse.js +45 -0
  38. package/dist/esm/models/WorkflowOutputStatsResponse.d.ts +54 -0
  39. package/dist/esm/models/WorkflowOutputStatsResponse.js +47 -0
  40. package/dist/esm/models/index.d.ts +12 -0
  41. package/dist/esm/models/index.js +12 -0
  42. package/dist/models/CitedChunk.d.ts +6 -4
  43. package/dist/models/DefinitionOutputStat.d.ts +65 -0
  44. package/dist/models/DefinitionOutputStat.js +64 -0
  45. package/dist/models/HourHistogramResponse.d.ts +53 -0
  46. package/dist/models/HourHistogramResponse.js +62 -0
  47. package/dist/models/KbMetric.d.ts +26 -0
  48. package/dist/models/KbMetric.js +52 -0
  49. package/dist/models/KbSummaryResponse.d.ts +152 -0
  50. package/dist/models/KbSummaryResponse.js +117 -0
  51. package/dist/models/KbTimeseriesResponse.d.ts +71 -0
  52. package/dist/models/KbTimeseriesResponse.js +65 -0
  53. package/dist/models/LabeledSeries.d.ts +54 -0
  54. package/dist/models/LabeledSeries.js +55 -0
  55. package/dist/models/LeaderboardEntry.d.ts +59 -0
  56. package/dist/models/LeaderboardEntry.js +60 -0
  57. package/dist/models/RunTimeseriesResponse.d.ts +61 -0
  58. package/dist/models/RunTimeseriesResponse.js +60 -0
  59. package/dist/models/TimeBucket.d.ts +27 -0
  60. package/dist/models/TimeBucket.js +53 -0
  61. package/dist/models/TimeseriesPoint.d.ts +53 -0
  62. package/dist/models/TimeseriesPoint.js +56 -0
  63. package/dist/models/WorkflowLeaderboardResponse.d.ts +54 -0
  64. package/dist/models/WorkflowLeaderboardResponse.js +53 -0
  65. package/dist/models/WorkflowOutputStatsResponse.d.ts +54 -0
  66. package/dist/models/WorkflowOutputStatsResponse.js +55 -0
  67. package/dist/models/index.d.ts +12 -0
  68. package/dist/models/index.js +12 -0
  69. package/docs/AdminKbApi.md +163 -0
  70. package/docs/AdminWorkflowsApi.md +424 -0
  71. package/docs/CitedChunk.md +1 -1
  72. package/docs/DefinitionOutputStat.md +41 -0
  73. package/docs/HourHistogramResponse.md +37 -0
  74. package/docs/KbMetric.md +33 -0
  75. package/docs/KbSummaryResponse.md +67 -0
  76. package/docs/KbTimeseriesResponse.md +41 -0
  77. package/docs/LabeledSeries.md +37 -0
  78. package/docs/LeaderboardEntry.md +39 -0
  79. package/docs/RunTimeseriesResponse.md +39 -0
  80. package/docs/TimeBucket.md +33 -0
  81. package/docs/TimeseriesPoint.md +37 -0
  82. package/docs/WorkflowLeaderboardResponse.md +37 -0
  83. package/docs/WorkflowOutputStatsResponse.md +37 -0
  84. package/package.json +1 -1
  85. package/src/apis/AdminKbApi.ts +237 -0
  86. package/src/apis/AdminWorkflowsApi.ts +539 -0
  87. package/src/apis/index.ts +2 -0
  88. package/src/models/CitedChunk.ts +6 -4
  89. package/src/models/DefinitionOutputStat.ts +110 -0
  90. package/src/models/HourHistogramResponse.ts +97 -0
  91. package/src/models/KbMetric.ts +54 -0
  92. package/src/models/KbSummaryResponse.ts +235 -0
  93. package/src/models/KbTimeseriesResponse.ts +136 -0
  94. package/src/models/LabeledSeries.ts +99 -0
  95. package/src/models/LeaderboardEntry.ts +101 -0
  96. package/src/models/RunTimeseriesResponse.ts +117 -0
  97. package/src/models/TimeBucket.ts +55 -0
  98. package/src/models/TimeseriesPoint.ts +92 -0
  99. package/src/models/WorkflowLeaderboardResponse.ts +98 -0
  100. package/src/models/WorkflowOutputStatsResponse.ts +99 -0
  101. package/src/models/index.ts +12 -0
@@ -0,0 +1,101 @@
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
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * One ranked entry (a workflow definition or a user).
18
+ * @export
19
+ * @interface LeaderboardEntry
20
+ */
21
+ export interface LeaderboardEntry {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof LeaderboardEntry
26
+ */
27
+ id: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof LeaderboardEntry
32
+ */
33
+ name: string;
34
+ /**
35
+ * Run count.
36
+ * @type {number}
37
+ * @memberof LeaderboardEntry
38
+ */
39
+ count: number;
40
+ }
41
+ export const LeaderboardEntryPropertyValidationAttributesMap: {
42
+ [property: string]: {
43
+ maxLength?: number,
44
+ minLength?: number,
45
+ pattern?: string,
46
+ maximum?: number,
47
+ exclusiveMaximum?: boolean,
48
+ minimum?: number,
49
+ exclusiveMinimum?: boolean,
50
+ multipleOf?: number,
51
+ maxItems?: number,
52
+ minItems?: number,
53
+ uniqueItems?: boolean
54
+ }
55
+ } = {
56
+ }
57
+
58
+
59
+ /**
60
+ * Check if a given object implements the LeaderboardEntry interface.
61
+ */
62
+ export function instanceOfLeaderboardEntry(value: object): value is LeaderboardEntry {
63
+ if (!('id' in value) || value['id'] === undefined) return false;
64
+ if (!('name' in value) || value['name'] === undefined) return false;
65
+ if (!('count' in value) || value['count'] === undefined) return false;
66
+ return true;
67
+ }
68
+
69
+ export function LeaderboardEntryFromJSON(json: any): LeaderboardEntry {
70
+ return LeaderboardEntryFromJSONTyped(json, false);
71
+ }
72
+
73
+ export function LeaderboardEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): LeaderboardEntry {
74
+ if (json == null) {
75
+ return json;
76
+ }
77
+ return {
78
+
79
+ 'id': json['id'],
80
+ 'name': json['name'],
81
+ 'count': json['count'],
82
+ };
83
+ }
84
+
85
+ export function LeaderboardEntryToJSON(json: any): LeaderboardEntry {
86
+ return LeaderboardEntryToJSONTyped(json, false);
87
+ }
88
+
89
+ export function LeaderboardEntryToJSONTyped(value?: LeaderboardEntry | null, ignoreDiscriminator: boolean = false): any {
90
+ if (value == null) {
91
+ return value;
92
+ }
93
+
94
+ return {
95
+
96
+ 'id': value['id'],
97
+ 'name': value['name'],
98
+ 'count': value['count'],
99
+ };
100
+ }
101
+
@@ -0,0 +1,117 @@
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
+ import { mapValues } from '../runtime';
16
+ import type { TimeseriesPoint } from './TimeseriesPoint';
17
+ import {
18
+ TimeseriesPointFromJSON,
19
+ TimeseriesPointFromJSONTyped,
20
+ TimeseriesPointToJSON,
21
+ TimeseriesPointToJSONTyped,
22
+ } from './TimeseriesPoint';
23
+ import type { TimeBucket } from './TimeBucket';
24
+ import {
25
+ TimeBucketFromJSON,
26
+ TimeBucketFromJSONTyped,
27
+ TimeBucketToJSON,
28
+ TimeBucketToJSONTyped,
29
+ } from './TimeBucket';
30
+
31
+ /**
32
+ * Workflow runs bucketed over time.
33
+ * @export
34
+ * @interface RunTimeseriesResponse
35
+ */
36
+ export interface RunTimeseriesResponse {
37
+ /**
38
+ * IANA timezone the buckets are in.
39
+ * @type {string}
40
+ * @memberof RunTimeseriesResponse
41
+ */
42
+ timezone: string;
43
+ /**
44
+ *
45
+ * @type {TimeBucket}
46
+ * @memberof RunTimeseriesResponse
47
+ */
48
+ bucket: TimeBucket;
49
+ /**
50
+ *
51
+ * @type {Array<TimeseriesPoint>}
52
+ * @memberof RunTimeseriesResponse
53
+ */
54
+ points?: Array<TimeseriesPoint>;
55
+ }
56
+
57
+
58
+ export const RunTimeseriesResponsePropertyValidationAttributesMap: {
59
+ [property: string]: {
60
+ maxLength?: number,
61
+ minLength?: number,
62
+ pattern?: string,
63
+ maximum?: number,
64
+ exclusiveMaximum?: boolean,
65
+ minimum?: number,
66
+ exclusiveMinimum?: boolean,
67
+ multipleOf?: number,
68
+ maxItems?: number,
69
+ minItems?: number,
70
+ uniqueItems?: boolean
71
+ }
72
+ } = {
73
+ }
74
+
75
+
76
+ /**
77
+ * Check if a given object implements the RunTimeseriesResponse interface.
78
+ */
79
+ export function instanceOfRunTimeseriesResponse(value: object): value is RunTimeseriesResponse {
80
+ if (!('timezone' in value) || value['timezone'] === undefined) return false;
81
+ if (!('bucket' in value) || value['bucket'] === undefined) return false;
82
+ return true;
83
+ }
84
+
85
+ export function RunTimeseriesResponseFromJSON(json: any): RunTimeseriesResponse {
86
+ return RunTimeseriesResponseFromJSONTyped(json, false);
87
+ }
88
+
89
+ export function RunTimeseriesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RunTimeseriesResponse {
90
+ if (json == null) {
91
+ return json;
92
+ }
93
+ return {
94
+
95
+ 'timezone': json['timezone'],
96
+ 'bucket': TimeBucketFromJSON(json['bucket']),
97
+ 'points': json['points'] == null ? undefined : ((json['points'] as Array<any>).map(TimeseriesPointFromJSON)),
98
+ };
99
+ }
100
+
101
+ export function RunTimeseriesResponseToJSON(json: any): RunTimeseriesResponse {
102
+ return RunTimeseriesResponseToJSONTyped(json, false);
103
+ }
104
+
105
+ export function RunTimeseriesResponseToJSONTyped(value?: RunTimeseriesResponse | null, ignoreDiscriminator: boolean = false): any {
106
+ if (value == null) {
107
+ return value;
108
+ }
109
+
110
+ return {
111
+
112
+ 'timezone': value['timezone'],
113
+ 'bucket': TimeBucketToJSON(value['bucket']),
114
+ 'points': value['points'] == null ? undefined : ((value['points'] as Array<any>).map(TimeseriesPointToJSON)),
115
+ };
116
+ }
117
+
@@ -0,0 +1,55 @@
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
+
16
+ /**
17
+ * Granularity for a bucketed time series.
18
+ * @export
19
+ */
20
+ export const TimeBucket = {
21
+ Hour: 'hour',
22
+ Day: 'day',
23
+ Week: 'week',
24
+ Month: 'month'
25
+ } as const;
26
+ export type TimeBucket = typeof TimeBucket[keyof typeof TimeBucket];
27
+
28
+
29
+ export function instanceOfTimeBucket(value: any): boolean {
30
+ for (const key in TimeBucket) {
31
+ if (Object.prototype.hasOwnProperty.call(TimeBucket, key)) {
32
+ if (TimeBucket[key as keyof typeof TimeBucket] === value) {
33
+ return true;
34
+ }
35
+ }
36
+ }
37
+ return false;
38
+ }
39
+
40
+ export function TimeBucketFromJSON(json: any): TimeBucket {
41
+ return TimeBucketFromJSONTyped(json, false);
42
+ }
43
+
44
+ export function TimeBucketFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeBucket {
45
+ return json as TimeBucket;
46
+ }
47
+
48
+ export function TimeBucketToJSON(value?: TimeBucket | null): any {
49
+ return value as any;
50
+ }
51
+
52
+ export function TimeBucketToJSONTyped(value: any, ignoreDiscriminator: boolean): TimeBucket {
53
+ return value as TimeBucket;
54
+ }
55
+
@@ -0,0 +1,92 @@
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
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * One bucket of a time series.
18
+ * @export
19
+ * @interface TimeseriesPoint
20
+ */
21
+ export interface TimeseriesPoint {
22
+ /**
23
+ * Start of the bucket, in the resolved timezone.
24
+ * @type {Date}
25
+ * @memberof TimeseriesPoint
26
+ */
27
+ bucketStart: Date;
28
+ /**
29
+ * Row count in this bucket.
30
+ * @type {number}
31
+ * @memberof TimeseriesPoint
32
+ */
33
+ count: number;
34
+ }
35
+ export const TimeseriesPointPropertyValidationAttributesMap: {
36
+ [property: string]: {
37
+ maxLength?: number,
38
+ minLength?: number,
39
+ pattern?: string,
40
+ maximum?: number,
41
+ exclusiveMaximum?: boolean,
42
+ minimum?: number,
43
+ exclusiveMinimum?: boolean,
44
+ multipleOf?: number,
45
+ maxItems?: number,
46
+ minItems?: number,
47
+ uniqueItems?: boolean
48
+ }
49
+ } = {
50
+ }
51
+
52
+
53
+ /**
54
+ * Check if a given object implements the TimeseriesPoint interface.
55
+ */
56
+ export function instanceOfTimeseriesPoint(value: object): value is TimeseriesPoint {
57
+ if (!('bucketStart' in value) || value['bucketStart'] === undefined) return false;
58
+ if (!('count' in value) || value['count'] === undefined) return false;
59
+ return true;
60
+ }
61
+
62
+ export function TimeseriesPointFromJSON(json: any): TimeseriesPoint {
63
+ return TimeseriesPointFromJSONTyped(json, false);
64
+ }
65
+
66
+ export function TimeseriesPointFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeseriesPoint {
67
+ if (json == null) {
68
+ return json;
69
+ }
70
+ return {
71
+
72
+ 'bucketStart': (new Date(json['bucket_start'])),
73
+ 'count': json['count'],
74
+ };
75
+ }
76
+
77
+ export function TimeseriesPointToJSON(json: any): TimeseriesPoint {
78
+ return TimeseriesPointToJSONTyped(json, false);
79
+ }
80
+
81
+ export function TimeseriesPointToJSONTyped(value?: TimeseriesPoint | null, ignoreDiscriminator: boolean = false): any {
82
+ if (value == null) {
83
+ return value;
84
+ }
85
+
86
+ return {
87
+
88
+ 'bucket_start': value['bucketStart'].toISOString(),
89
+ 'count': value['count'],
90
+ };
91
+ }
92
+
@@ -0,0 +1,98 @@
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
+ import { mapValues } from '../runtime';
16
+ import type { LeaderboardEntry } from './LeaderboardEntry';
17
+ import {
18
+ LeaderboardEntryFromJSON,
19
+ LeaderboardEntryFromJSONTyped,
20
+ LeaderboardEntryToJSON,
21
+ LeaderboardEntryToJSONTyped,
22
+ } from './LeaderboardEntry';
23
+
24
+ /**
25
+ * Top workflows and top users by run count over a window.
26
+ * @export
27
+ * @interface WorkflowLeaderboardResponse
28
+ */
29
+ export interface WorkflowLeaderboardResponse {
30
+ /**
31
+ *
32
+ * @type {Array<LeaderboardEntry>}
33
+ * @memberof WorkflowLeaderboardResponse
34
+ */
35
+ topWorkflows?: Array<LeaderboardEntry>;
36
+ /**
37
+ *
38
+ * @type {Array<LeaderboardEntry>}
39
+ * @memberof WorkflowLeaderboardResponse
40
+ */
41
+ topUsers?: Array<LeaderboardEntry>;
42
+ }
43
+ export const WorkflowLeaderboardResponsePropertyValidationAttributesMap: {
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
+
60
+
61
+ /**
62
+ * Check if a given object implements the WorkflowLeaderboardResponse interface.
63
+ */
64
+ export function instanceOfWorkflowLeaderboardResponse(value: object): value is WorkflowLeaderboardResponse {
65
+ return true;
66
+ }
67
+
68
+ export function WorkflowLeaderboardResponseFromJSON(json: any): WorkflowLeaderboardResponse {
69
+ return WorkflowLeaderboardResponseFromJSONTyped(json, false);
70
+ }
71
+
72
+ export function WorkflowLeaderboardResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): WorkflowLeaderboardResponse {
73
+ if (json == null) {
74
+ return json;
75
+ }
76
+ return {
77
+
78
+ 'topWorkflows': json['top_workflows'] == null ? undefined : ((json['top_workflows'] as Array<any>).map(LeaderboardEntryFromJSON)),
79
+ 'topUsers': json['top_users'] == null ? undefined : ((json['top_users'] as Array<any>).map(LeaderboardEntryFromJSON)),
80
+ };
81
+ }
82
+
83
+ export function WorkflowLeaderboardResponseToJSON(json: any): WorkflowLeaderboardResponse {
84
+ return WorkflowLeaderboardResponseToJSONTyped(json, false);
85
+ }
86
+
87
+ export function WorkflowLeaderboardResponseToJSONTyped(value?: WorkflowLeaderboardResponse | null, ignoreDiscriminator: boolean = false): any {
88
+ if (value == null) {
89
+ return value;
90
+ }
91
+
92
+ return {
93
+
94
+ 'top_workflows': value['topWorkflows'] == null ? undefined : ((value['topWorkflows'] as Array<any>).map(LeaderboardEntryToJSON)),
95
+ 'top_users': value['topUsers'] == null ? undefined : ((value['topUsers'] as Array<any>).map(LeaderboardEntryToJSON)),
96
+ };
97
+ }
98
+
@@ -0,0 +1,99 @@
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
+ import { mapValues } from '../runtime';
16
+ import type { DefinitionOutputStat } from './DefinitionOutputStat';
17
+ import {
18
+ DefinitionOutputStatFromJSON,
19
+ DefinitionOutputStatFromJSONTyped,
20
+ DefinitionOutputStatToJSON,
21
+ DefinitionOutputStatToJSONTyped,
22
+ } from './DefinitionOutputStat';
23
+
24
+ /**
25
+ * Avg documents generated per workflow definition (completed runs).
26
+ * @export
27
+ * @interface WorkflowOutputStatsResponse
28
+ */
29
+ export interface WorkflowOutputStatsResponse {
30
+ /**
31
+ *
32
+ * @type {Array<DefinitionOutputStat>}
33
+ * @memberof WorkflowOutputStatsResponse
34
+ */
35
+ perDefinition?: Array<DefinitionOutputStat>;
36
+ /**
37
+ * Mean output DOCUMENTs across all completed runs; null when none.
38
+ * @type {number}
39
+ * @memberof WorkflowOutputStatsResponse
40
+ */
41
+ overallAvg: number | null;
42
+ }
43
+ export const WorkflowOutputStatsResponsePropertyValidationAttributesMap: {
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
+
60
+
61
+ /**
62
+ * Check if a given object implements the WorkflowOutputStatsResponse interface.
63
+ */
64
+ export function instanceOfWorkflowOutputStatsResponse(value: object): value is WorkflowOutputStatsResponse {
65
+ if (!('overallAvg' in value) || value['overallAvg'] === undefined) return false;
66
+ return true;
67
+ }
68
+
69
+ export function WorkflowOutputStatsResponseFromJSON(json: any): WorkflowOutputStatsResponse {
70
+ return WorkflowOutputStatsResponseFromJSONTyped(json, false);
71
+ }
72
+
73
+ export function WorkflowOutputStatsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): WorkflowOutputStatsResponse {
74
+ if (json == null) {
75
+ return json;
76
+ }
77
+ return {
78
+
79
+ 'perDefinition': json['per_definition'] == null ? undefined : ((json['per_definition'] as Array<any>).map(DefinitionOutputStatFromJSON)),
80
+ 'overallAvg': json['overall_avg'],
81
+ };
82
+ }
83
+
84
+ export function WorkflowOutputStatsResponseToJSON(json: any): WorkflowOutputStatsResponse {
85
+ return WorkflowOutputStatsResponseToJSONTyped(json, false);
86
+ }
87
+
88
+ export function WorkflowOutputStatsResponseToJSONTyped(value?: WorkflowOutputStatsResponse | null, ignoreDiscriminator: boolean = false): any {
89
+ if (value == null) {
90
+ return value;
91
+ }
92
+
93
+ return {
94
+
95
+ 'per_definition': value['perDefinition'] == null ? undefined : ((value['perDefinition'] as Array<any>).map(DefinitionOutputStatToJSON)),
96
+ 'overall_avg': value['overallAvg'],
97
+ };
98
+ }
99
+
@@ -82,6 +82,7 @@ export * from './DataSourceSchemaListResponse';
82
82
  export * from './DataSourceSchemaResponse';
83
83
  export * from './DataSourceSyncResponse';
84
84
  export * from './DataSourceTableResponse';
85
+ export * from './DefinitionOutputStat';
85
86
  export * from './DiffFormat';
86
87
  export * from './DiffRow';
87
88
  export * from './DiffRowType';
@@ -133,6 +134,7 @@ export * from './GroupPermissionResponse';
133
134
  export * from './GroupResponse';
134
135
  export * from './HTTPValidationError';
135
136
  export * from './HealthCheckResponse';
137
+ export * from './HourHistogramResponse';
136
138
  export * from './HybridSearchProfile';
137
139
  export * from './IdpConfig';
138
140
  export * from './IdpType';
@@ -152,6 +154,11 @@ export * from './InviteResponse';
152
154
  export * from './InviteStatus';
153
155
  export * from './InviteUserRequest';
154
156
  export * from './ItemPermissions';
157
+ export * from './KbMetric';
158
+ export * from './KbSummaryResponse';
159
+ export * from './KbTimeseriesResponse';
160
+ export * from './LabeledSeries';
161
+ export * from './LeaderboardEntry';
155
162
  export * from './LineageEdgeResponse';
156
163
  export * from './LineageGraphResponse';
157
164
  export * from './LineageNodeResponse';
@@ -228,6 +235,7 @@ export * from './RevisionEdit';
228
235
  export * from './RootResponse';
229
236
  export * from './RunFolder';
230
237
  export * from './RunFolderRef';
238
+ export * from './RunTimeseriesResponse';
231
239
  export * from './SSOInitiateResponse';
232
240
  export * from './ScoredChunkResponse';
233
241
  export * from './SearchSkillsRequest';
@@ -291,6 +299,8 @@ export * from './ThreadMessageDetails';
291
299
  export * from './ThreadMessageResponse';
292
300
  export * from './ThreadOrder';
293
301
  export * from './ThreadResponse';
302
+ export * from './TimeBucket';
303
+ export * from './TimeseriesPoint';
294
304
  export * from './ToolDisplayType';
295
305
  export * from './ToolPart';
296
306
  export * from './ToolStatus';
@@ -334,6 +344,8 @@ export * from './WorkflowDefinitionOrder';
334
344
  export * from './WorkflowDefinitionResponse';
335
345
  export * from './WorkflowDetailResponse';
336
346
  export * from './WorkflowExecutionState';
347
+ export * from './WorkflowLeaderboardResponse';
348
+ export * from './WorkflowOutputStatsResponse';
337
349
  export * from './WorkflowRunAsset';
338
350
  export * from './WorkflowRunCallbackRequest';
339
351
  export * from './WorkflowRunOrder';