@knowledge-stack/ksapi 2.12.0 → 2.13.0
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 +2 -0
- package/README.md +3 -2
- package/dist/apis/FoldersApi.d.ts +10 -10
- package/dist/apis/FoldersApi.js +4 -4
- package/dist/esm/apis/FoldersApi.d.ts +10 -10
- package/dist/esm/apis/FoldersApi.js +5 -5
- package/dist/esm/models/ResolvedReferenceInput.d.ts +7 -0
- package/dist/esm/models/ResolvedReferenceInput.js +3 -0
- package/dist/esm/models/ResolvedReferenceOutput.d.ts +7 -0
- package/dist/esm/models/ResolvedReferenceOutput.js +3 -0
- package/dist/esm/models/SearchItemsResponse.d.ts +77 -0
- package/dist/esm/models/SearchItemsResponse.js +72 -0
- package/dist/esm/models/SearchSortOrder.d.ts +6 -1
- package/dist/esm/models/SearchSortOrder.js +6 -1
- package/dist/esm/models/SearchablePartType.d.ts +1 -0
- package/dist/esm/models/SearchablePartType.js +2 -1
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.js +1 -0
- package/dist/models/ResolvedReferenceInput.d.ts +7 -0
- package/dist/models/ResolvedReferenceInput.js +3 -0
- package/dist/models/ResolvedReferenceOutput.d.ts +7 -0
- package/dist/models/ResolvedReferenceOutput.js +3 -0
- package/dist/models/SearchItemsResponse.d.ts +77 -0
- package/dist/models/SearchItemsResponse.js +80 -0
- package/dist/models/SearchSortOrder.d.ts +6 -1
- package/dist/models/SearchSortOrder.js +6 -1
- package/dist/models/SearchablePartType.d.ts +1 -0
- package/dist/models/SearchablePartType.js +2 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/docs/FoldersApi.md +7 -7
- package/docs/ResolvedReferenceInput.md +2 -0
- package/docs/ResolvedReferenceOutput.md +2 -0
- package/docs/SearchItemsResponse.md +43 -0
- package/docs/SearchSortOrder.md +1 -1
- package/package.json +1 -1
- package/src/apis/FoldersApi.ts +17 -14
- package/src/models/ResolvedReferenceInput.ts +15 -0
- package/src/models/ResolvedReferenceOutput.ts +18 -0
- package/src/models/SearchItemsResponse.ts +141 -0
- package/src/models/SearchSortOrder.ts +6 -1
- package/src/models/SearchablePartType.ts +2 -1
- package/src/models/index.ts +1 -0
|
@@ -0,0 +1,141 @@
|
|
|
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 { FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR } from './FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR';
|
|
17
|
+
import {
|
|
18
|
+
FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaRFromJSON,
|
|
19
|
+
FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaRFromJSONTyped,
|
|
20
|
+
FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaRToJSON,
|
|
21
|
+
FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaRToJSONTyped,
|
|
22
|
+
} from './FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A search page plus how many items of each type the query matched.
|
|
26
|
+
*
|
|
27
|
+
* ``counts_by_type`` ignores any ``part_type`` filter so the filter chips can
|
|
28
|
+
* keep showing every type's count while one of them is selected.
|
|
29
|
+
* @export
|
|
30
|
+
* @interface SearchItemsResponse
|
|
31
|
+
*/
|
|
32
|
+
export interface SearchItemsResponse {
|
|
33
|
+
/**
|
|
34
|
+
* List of items
|
|
35
|
+
* @type {Array<FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR>}
|
|
36
|
+
* @memberof SearchItemsResponse
|
|
37
|
+
*/
|
|
38
|
+
items: Array<FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR>;
|
|
39
|
+
/**
|
|
40
|
+
* Total number of items
|
|
41
|
+
* @type {number}
|
|
42
|
+
* @memberof SearchItemsResponse
|
|
43
|
+
*/
|
|
44
|
+
total: number;
|
|
45
|
+
/**
|
|
46
|
+
* Number of items per page
|
|
47
|
+
* @type {number}
|
|
48
|
+
* @memberof SearchItemsResponse
|
|
49
|
+
*/
|
|
50
|
+
limit: number;
|
|
51
|
+
/**
|
|
52
|
+
* Number of items to skip
|
|
53
|
+
* @type {number}
|
|
54
|
+
* @memberof SearchItemsResponse
|
|
55
|
+
*/
|
|
56
|
+
offset: number;
|
|
57
|
+
/**
|
|
58
|
+
* Matches per item type, keyed by SearchablePartType and unaffected by the part_type filter
|
|
59
|
+
* @type {{ [key: string]: number; }}
|
|
60
|
+
* @memberof SearchItemsResponse
|
|
61
|
+
*/
|
|
62
|
+
countsByType?: { [key: string]: number; };
|
|
63
|
+
}
|
|
64
|
+
export const SearchItemsResponsePropertyValidationAttributesMap: {
|
|
65
|
+
[property: string]: {
|
|
66
|
+
maxLength?: number,
|
|
67
|
+
minLength?: number,
|
|
68
|
+
pattern?: string,
|
|
69
|
+
maximum?: number,
|
|
70
|
+
exclusiveMaximum?: boolean,
|
|
71
|
+
minimum?: number,
|
|
72
|
+
exclusiveMinimum?: boolean,
|
|
73
|
+
multipleOf?: number,
|
|
74
|
+
maxItems?: number,
|
|
75
|
+
minItems?: number,
|
|
76
|
+
uniqueItems?: boolean
|
|
77
|
+
}
|
|
78
|
+
} = {
|
|
79
|
+
total: {
|
|
80
|
+
minimum: 0,
|
|
81
|
+
exclusiveMinimum: false,
|
|
82
|
+
},
|
|
83
|
+
limit: {
|
|
84
|
+
minimum: 1,
|
|
85
|
+
exclusiveMinimum: false,
|
|
86
|
+
},
|
|
87
|
+
offset: {
|
|
88
|
+
minimum: 0,
|
|
89
|
+
exclusiveMinimum: false,
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Check if a given object implements the SearchItemsResponse interface.
|
|
96
|
+
*/
|
|
97
|
+
export function instanceOfSearchItemsResponse(value: object): value is SearchItemsResponse {
|
|
98
|
+
if (!('items' in value) || value['items'] === undefined) return false;
|
|
99
|
+
if (!('total' in value) || value['total'] === undefined) return false;
|
|
100
|
+
if (!('limit' in value) || value['limit'] === undefined) return false;
|
|
101
|
+
if (!('offset' in value) || value['offset'] === undefined) return false;
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function SearchItemsResponseFromJSON(json: any): SearchItemsResponse {
|
|
106
|
+
return SearchItemsResponseFromJSONTyped(json, false);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function SearchItemsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchItemsResponse {
|
|
110
|
+
if (json == null) {
|
|
111
|
+
return json;
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
|
|
115
|
+
'items': ((json['items'] as Array<any>).map(FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaRFromJSON)),
|
|
116
|
+
'total': json['total'],
|
|
117
|
+
'limit': json['limit'],
|
|
118
|
+
'offset': json['offset'],
|
|
119
|
+
'countsByType': json['counts_by_type'] == null ? undefined : json['counts_by_type'],
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function SearchItemsResponseToJSON(json: any): SearchItemsResponse {
|
|
124
|
+
return SearchItemsResponseToJSONTyped(json, false);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function SearchItemsResponseToJSONTyped(value?: SearchItemsResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
128
|
+
if (value == null) {
|
|
129
|
+
return value;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
|
|
134
|
+
'items': ((value['items'] as Array<any>).map(FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaRToJSON)),
|
|
135
|
+
'total': value['total'],
|
|
136
|
+
'limit': value['limit'],
|
|
137
|
+
'offset': value['offset'],
|
|
138
|
+
'counts_by_type': value['countsByType'],
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
@@ -14,10 +14,15 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Ordering for flat name search.
|
|
18
|
+
*
|
|
19
|
+
* RELEVANCE ranks an exact name match first, then names starting with the
|
|
20
|
+
* query, then by how closely the name matches, then shorter names, then
|
|
21
|
+
* alphabetically.
|
|
18
22
|
* @export
|
|
19
23
|
*/
|
|
20
24
|
export const SearchSortOrder = {
|
|
25
|
+
Relevance: 'RELEVANCE',
|
|
21
26
|
Name: 'NAME',
|
|
22
27
|
UpdatedAt: 'UPDATED_AT',
|
|
23
28
|
CreatedAt: 'CREATED_AT'
|
|
@@ -25,7 +25,8 @@ export const SearchablePartType = {
|
|
|
25
25
|
DataSource: 'DATA_SOURCE',
|
|
26
26
|
DataSourceSchema: 'DATA_SOURCE_SCHEMA',
|
|
27
27
|
DataSourceTable: 'DATA_SOURCE_TABLE',
|
|
28
|
-
ApiConnection: 'API_CONNECTION'
|
|
28
|
+
ApiConnection: 'API_CONNECTION',
|
|
29
|
+
Skill: 'SKILL'
|
|
29
30
|
} as const;
|
|
30
31
|
export type SearchablePartType = typeof SearchablePartType[keyof typeof SearchablePartType];
|
|
31
32
|
|
package/src/models/index.ts
CHANGED
|
@@ -265,6 +265,7 @@ export * from './RunTimeseriesResponse';
|
|
|
265
265
|
export * from './SSOInitiateResponse';
|
|
266
266
|
export * from './ScheduleCadence';
|
|
267
267
|
export * from './ScoredChunkResponse';
|
|
268
|
+
export * from './SearchItemsResponse';
|
|
268
269
|
export * from './SearchSkillsRequest';
|
|
269
270
|
export * from './SearchSkillsResponse';
|
|
270
271
|
export * from './SearchSortOrder';
|