@knowledge-stack/ksapi 1.142.2 → 1.144.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 +4 -0
- package/README.md +5 -2
- package/dist/apis/PathPartsApi.d.ts +42 -1
- package/dist/apis/PathPartsApi.js +53 -0
- package/dist/esm/apis/PathPartsApi.d.ts +42 -1
- package/dist/esm/apis/PathPartsApi.js +54 -1
- package/dist/esm/models/EventResponse.d.ts +35 -1
- package/dist/esm/models/EventResponse.js +12 -0
- package/dist/esm/models/ReorderPathPartRequest.d.ts +53 -0
- package/dist/esm/models/ReorderPathPartRequest.js +44 -0
- package/dist/esm/models/ResolvedRef.d.ts +79 -0
- package/dist/esm/models/ResolvedRef.js +59 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +2 -0
- package/dist/models/EventResponse.d.ts +35 -1
- package/dist/models/EventResponse.js +12 -0
- package/dist/models/ReorderPathPartRequest.d.ts +53 -0
- package/dist/models/ReorderPathPartRequest.js +52 -0
- package/dist/models/ResolvedRef.d.ts +79 -0
- package/dist/models/ResolvedRef.js +67 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/docs/EventResponse.md +11 -1
- package/docs/PathPartsApi.md +79 -0
- package/docs/ReorderPathPartRequest.md +37 -0
- package/docs/ResolvedRef.md +41 -0
- package/package.json +1 -1
- package/src/apis/PathPartsApi.ts +99 -0
- package/src/models/EventResponse.ts +49 -1
- package/src/models/ReorderPathPartRequest.ts +90 -0
- package/src/models/ResolvedRef.ts +125 -0
- package/src/models/index.ts +2 -0
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
* @export
|
|
16
|
+
*/
|
|
17
|
+
export const ResolvedRefEntityTypeEnum = {
|
|
18
|
+
PathPart: 'path_part',
|
|
19
|
+
User: 'user'
|
|
20
|
+
};
|
|
21
|
+
export const ResolvedRefPropertyValidationAttributesMap = {};
|
|
22
|
+
/**
|
|
23
|
+
* Check if a given object implements the ResolvedRef interface.
|
|
24
|
+
*/
|
|
25
|
+
export function instanceOfResolvedRef(value) {
|
|
26
|
+
if (!('entityType' in value) || value['entityType'] === undefined)
|
|
27
|
+
return false;
|
|
28
|
+
if (!('objectId' in value) || value['objectId'] === undefined)
|
|
29
|
+
return false;
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
export function ResolvedRefFromJSON(json) {
|
|
33
|
+
return ResolvedRefFromJSONTyped(json, false);
|
|
34
|
+
}
|
|
35
|
+
export function ResolvedRefFromJSONTyped(json, ignoreDiscriminator) {
|
|
36
|
+
if (json == null) {
|
|
37
|
+
return json;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
'entityType': json['entity_type'],
|
|
41
|
+
'objectId': json['object_id'],
|
|
42
|
+
'displayName': json['display_name'] == null ? undefined : json['display_name'],
|
|
43
|
+
'partType': json['part_type'] == null ? undefined : json['part_type'],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export function ResolvedRefToJSON(json) {
|
|
47
|
+
return ResolvedRefToJSONTyped(json, false);
|
|
48
|
+
}
|
|
49
|
+
export function ResolvedRefToJSONTyped(value, ignoreDiscriminator = false) {
|
|
50
|
+
if (value == null) {
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
'entity_type': value['entityType'],
|
|
55
|
+
'object_id': value['objectId'],
|
|
56
|
+
'display_name': value['displayName'],
|
|
57
|
+
'part_type': value['partType'],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -225,7 +225,9 @@ export * from './ProposeMemoryChunkRequest';
|
|
|
225
225
|
export * from './ProposedMemoryChunkResponse';
|
|
226
226
|
export * from './ReasoningPart';
|
|
227
227
|
export * from './ReferenceType';
|
|
228
|
+
export * from './ReorderPathPartRequest';
|
|
228
229
|
export * from './RequestPhoneChangeRequest';
|
|
230
|
+
export * from './ResolvedRef';
|
|
229
231
|
export * from './ResolvedReferenceInput';
|
|
230
232
|
export * from './ResolvedReferenceOutput';
|
|
231
233
|
export * from './ResponseSendPwResetEmail';
|
package/dist/esm/models/index.js
CHANGED
|
@@ -227,7 +227,9 @@ export * from './ProposeMemoryChunkRequest';
|
|
|
227
227
|
export * from './ProposedMemoryChunkResponse';
|
|
228
228
|
export * from './ReasoningPart';
|
|
229
229
|
export * from './ReferenceType';
|
|
230
|
+
export * from './ReorderPathPartRequest';
|
|
230
231
|
export * from './RequestPhoneChangeRequest';
|
|
232
|
+
export * from './ResolvedRef';
|
|
231
233
|
export * from './ResolvedReferenceInput';
|
|
232
234
|
export * from './ResolvedReferenceOutput';
|
|
233
235
|
export * from './ResponseSendPwResetEmail';
|
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import type { UserInfo } from './UserInfo';
|
|
13
|
+
import type { ResolvedRef } from './ResolvedRef';
|
|
13
14
|
/**
|
|
14
15
|
* One event row, anchored to a path_part subject.
|
|
15
16
|
*
|
|
16
17
|
* ``kind`` is namespaced ``domain.action`` (e.g. ``workflow.approval``,
|
|
17
18
|
* ``document.created``). ``payload`` is the domain-specific structured
|
|
18
|
-
* JSON associated with the event
|
|
19
|
+
* JSON associated with the event, stored verbatim and never rewritten —
|
|
20
|
+
* the human-readable resolution lives alongside it in ``references``.
|
|
19
21
|
* @export
|
|
20
22
|
* @interface EventResponse
|
|
21
23
|
*/
|
|
@@ -64,6 +66,38 @@ export interface EventResponse {
|
|
|
64
66
|
* @memberof EventResponse
|
|
65
67
|
*/
|
|
66
68
|
actor?: UserInfo | null;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @type {string}
|
|
72
|
+
* @memberof EventResponse
|
|
73
|
+
*/
|
|
74
|
+
subjectName?: string | null;
|
|
75
|
+
/**
|
|
76
|
+
*
|
|
77
|
+
* @type {string}
|
|
78
|
+
* @memberof EventResponse
|
|
79
|
+
*/
|
|
80
|
+
subjectPath?: string | null;
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
* @type {string}
|
|
84
|
+
* @memberof EventResponse
|
|
85
|
+
*/
|
|
86
|
+
subjectObjectId?: string | null;
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* @type {string}
|
|
90
|
+
* @memberof EventResponse
|
|
91
|
+
*/
|
|
92
|
+
subjectPartType?: string | null;
|
|
93
|
+
/**
|
|
94
|
+
*
|
|
95
|
+
* @type {{ [key: string]: ResolvedRef; }}
|
|
96
|
+
* @memberof EventResponse
|
|
97
|
+
*/
|
|
98
|
+
references?: {
|
|
99
|
+
[key: string]: ResolvedRef;
|
|
100
|
+
};
|
|
67
101
|
}
|
|
68
102
|
export declare const EventResponsePropertyValidationAttributesMap: {
|
|
69
103
|
[property: string]: {
|
|
@@ -19,7 +19,9 @@ exports.EventResponseFromJSON = EventResponseFromJSON;
|
|
|
19
19
|
exports.EventResponseFromJSONTyped = EventResponseFromJSONTyped;
|
|
20
20
|
exports.EventResponseToJSON = EventResponseToJSON;
|
|
21
21
|
exports.EventResponseToJSONTyped = EventResponseToJSONTyped;
|
|
22
|
+
const runtime_1 = require("../runtime");
|
|
22
23
|
const UserInfo_1 = require("./UserInfo");
|
|
24
|
+
const ResolvedRef_1 = require("./ResolvedRef");
|
|
23
25
|
exports.EventResponsePropertyValidationAttributesMap = {};
|
|
24
26
|
/**
|
|
25
27
|
* Check if a given object implements the EventResponse interface.
|
|
@@ -54,6 +56,11 @@ function EventResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
54
56
|
'actorUserId': json['actor_user_id'],
|
|
55
57
|
'payload': json['payload'],
|
|
56
58
|
'actor': json['actor'] == null ? undefined : (0, UserInfo_1.UserInfoFromJSON)(json['actor']),
|
|
59
|
+
'subjectName': json['subject_name'] == null ? undefined : json['subject_name'],
|
|
60
|
+
'subjectPath': json['subject_path'] == null ? undefined : json['subject_path'],
|
|
61
|
+
'subjectObjectId': json['subject_object_id'] == null ? undefined : json['subject_object_id'],
|
|
62
|
+
'subjectPartType': json['subject_part_type'] == null ? undefined : json['subject_part_type'],
|
|
63
|
+
'references': json['references'] == null ? undefined : ((0, runtime_1.mapValues)(json['references'], ResolvedRef_1.ResolvedRefFromJSON)),
|
|
57
64
|
};
|
|
58
65
|
}
|
|
59
66
|
function EventResponseToJSON(json) {
|
|
@@ -71,5 +78,10 @@ function EventResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
71
78
|
'actor_user_id': value['actorUserId'],
|
|
72
79
|
'payload': value['payload'],
|
|
73
80
|
'actor': (0, UserInfo_1.UserInfoToJSON)(value['actor']),
|
|
81
|
+
'subject_name': value['subjectName'],
|
|
82
|
+
'subject_path': value['subjectPath'],
|
|
83
|
+
'subject_object_id': value['subjectObjectId'],
|
|
84
|
+
'subject_part_type': value['subjectPartType'],
|
|
85
|
+
'references': value['references'] == null ? undefined : ((0, runtime_1.mapValues)(value['references'], ResolvedRef_1.ResolvedRefToJSON)),
|
|
74
86
|
};
|
|
75
87
|
}
|
|
@@ -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
|
+
* Reorder a path part within its sibling list.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface ReorderPathPartRequest
|
|
16
|
+
*/
|
|
17
|
+
export interface ReorderPathPartRequest {
|
|
18
|
+
/**
|
|
19
|
+
* Place this node immediately after the given sibling PathPart id (must share the same parent). Pass the current tail's id to move to the end. Requires move_to_head=false.
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof ReorderPathPartRequest
|
|
22
|
+
*/
|
|
23
|
+
prevSiblingPathId?: string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Move this node to the head of its sibling list.
|
|
26
|
+
* @type {boolean}
|
|
27
|
+
* @memberof ReorderPathPartRequest
|
|
28
|
+
*/
|
|
29
|
+
moveToHead?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare const ReorderPathPartRequestPropertyValidationAttributesMap: {
|
|
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 ReorderPathPartRequest interface.
|
|
48
|
+
*/
|
|
49
|
+
export declare function instanceOfReorderPathPartRequest(value: object): value is ReorderPathPartRequest;
|
|
50
|
+
export declare function ReorderPathPartRequestFromJSON(json: any): ReorderPathPartRequest;
|
|
51
|
+
export declare function ReorderPathPartRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReorderPathPartRequest;
|
|
52
|
+
export declare function ReorderPathPartRequestToJSON(json: any): ReorderPathPartRequest;
|
|
53
|
+
export declare function ReorderPathPartRequestToJSONTyped(value?: ReorderPathPartRequest | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Knowledge Stack API
|
|
6
|
+
* 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.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.ReorderPathPartRequestPropertyValidationAttributesMap = void 0;
|
|
17
|
+
exports.instanceOfReorderPathPartRequest = instanceOfReorderPathPartRequest;
|
|
18
|
+
exports.ReorderPathPartRequestFromJSON = ReorderPathPartRequestFromJSON;
|
|
19
|
+
exports.ReorderPathPartRequestFromJSONTyped = ReorderPathPartRequestFromJSONTyped;
|
|
20
|
+
exports.ReorderPathPartRequestToJSON = ReorderPathPartRequestToJSON;
|
|
21
|
+
exports.ReorderPathPartRequestToJSONTyped = ReorderPathPartRequestToJSONTyped;
|
|
22
|
+
exports.ReorderPathPartRequestPropertyValidationAttributesMap = {};
|
|
23
|
+
/**
|
|
24
|
+
* Check if a given object implements the ReorderPathPartRequest interface.
|
|
25
|
+
*/
|
|
26
|
+
function instanceOfReorderPathPartRequest(value) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
function ReorderPathPartRequestFromJSON(json) {
|
|
30
|
+
return ReorderPathPartRequestFromJSONTyped(json, false);
|
|
31
|
+
}
|
|
32
|
+
function ReorderPathPartRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
33
|
+
if (json == null) {
|
|
34
|
+
return json;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
'prevSiblingPathId': json['prev_sibling_path_id'] == null ? undefined : json['prev_sibling_path_id'],
|
|
38
|
+
'moveToHead': json['move_to_head'] == null ? undefined : json['move_to_head'],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function ReorderPathPartRequestToJSON(json) {
|
|
42
|
+
return ReorderPathPartRequestToJSONTyped(json, false);
|
|
43
|
+
}
|
|
44
|
+
function ReorderPathPartRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
45
|
+
if (value == null) {
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
'prev_sibling_path_id': value['prevSiblingPathId'],
|
|
50
|
+
'move_to_head': value['moveToHead'],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
* One id resolved to a human-readable, linkable entity.
|
|
14
|
+
*
|
|
15
|
+
* Every UUID that appears in an event (its subject, its actor, and any id
|
|
16
|
+
* inside the payload) resolves to one of these so the frontend can render a
|
|
17
|
+
* name and a link instead of a bare UUID. ``object_id`` is what the frontend
|
|
18
|
+
* routes on: a PDO id for a path_part (never the internal path_part_id), or
|
|
19
|
+
* the user id for a user.
|
|
20
|
+
* @export
|
|
21
|
+
* @interface ResolvedRef
|
|
22
|
+
*/
|
|
23
|
+
export interface ResolvedRef {
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {ResolvedRefEntityTypeEnum}
|
|
27
|
+
* @memberof ResolvedRef
|
|
28
|
+
*/
|
|
29
|
+
entityType: ResolvedRefEntityTypeEnum;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof ResolvedRef
|
|
34
|
+
*/
|
|
35
|
+
objectId: string;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof ResolvedRef
|
|
40
|
+
*/
|
|
41
|
+
displayName?: string | null;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof ResolvedRef
|
|
46
|
+
*/
|
|
47
|
+
partType?: string | null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @export
|
|
51
|
+
*/
|
|
52
|
+
export declare const ResolvedRefEntityTypeEnum: {
|
|
53
|
+
readonly PathPart: 'path_part';
|
|
54
|
+
readonly User: 'user';
|
|
55
|
+
};
|
|
56
|
+
export type ResolvedRefEntityTypeEnum = typeof ResolvedRefEntityTypeEnum[keyof typeof ResolvedRefEntityTypeEnum];
|
|
57
|
+
export declare const ResolvedRefPropertyValidationAttributesMap: {
|
|
58
|
+
[property: string]: {
|
|
59
|
+
maxLength?: number;
|
|
60
|
+
minLength?: number;
|
|
61
|
+
pattern?: string;
|
|
62
|
+
maximum?: number;
|
|
63
|
+
exclusiveMaximum?: boolean;
|
|
64
|
+
minimum?: number;
|
|
65
|
+
exclusiveMinimum?: boolean;
|
|
66
|
+
multipleOf?: number;
|
|
67
|
+
maxItems?: number;
|
|
68
|
+
minItems?: number;
|
|
69
|
+
uniqueItems?: boolean;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Check if a given object implements the ResolvedRef interface.
|
|
74
|
+
*/
|
|
75
|
+
export declare function instanceOfResolvedRef(value: object): value is ResolvedRef;
|
|
76
|
+
export declare function ResolvedRefFromJSON(json: any): ResolvedRef;
|
|
77
|
+
export declare function ResolvedRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResolvedRef;
|
|
78
|
+
export declare function ResolvedRefToJSON(json: any): ResolvedRef;
|
|
79
|
+
export declare function ResolvedRefToJSONTyped(value?: ResolvedRef | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Knowledge Stack API
|
|
6
|
+
* 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.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.ResolvedRefPropertyValidationAttributesMap = exports.ResolvedRefEntityTypeEnum = void 0;
|
|
17
|
+
exports.instanceOfResolvedRef = instanceOfResolvedRef;
|
|
18
|
+
exports.ResolvedRefFromJSON = ResolvedRefFromJSON;
|
|
19
|
+
exports.ResolvedRefFromJSONTyped = ResolvedRefFromJSONTyped;
|
|
20
|
+
exports.ResolvedRefToJSON = ResolvedRefToJSON;
|
|
21
|
+
exports.ResolvedRefToJSONTyped = ResolvedRefToJSONTyped;
|
|
22
|
+
/**
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
exports.ResolvedRefEntityTypeEnum = {
|
|
26
|
+
PathPart: 'path_part',
|
|
27
|
+
User: 'user'
|
|
28
|
+
};
|
|
29
|
+
exports.ResolvedRefPropertyValidationAttributesMap = {};
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the ResolvedRef interface.
|
|
32
|
+
*/
|
|
33
|
+
function instanceOfResolvedRef(value) {
|
|
34
|
+
if (!('entityType' in value) || value['entityType'] === undefined)
|
|
35
|
+
return false;
|
|
36
|
+
if (!('objectId' in value) || value['objectId'] === undefined)
|
|
37
|
+
return false;
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
function ResolvedRefFromJSON(json) {
|
|
41
|
+
return ResolvedRefFromJSONTyped(json, false);
|
|
42
|
+
}
|
|
43
|
+
function ResolvedRefFromJSONTyped(json, ignoreDiscriminator) {
|
|
44
|
+
if (json == null) {
|
|
45
|
+
return json;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
'entityType': json['entity_type'],
|
|
49
|
+
'objectId': json['object_id'],
|
|
50
|
+
'displayName': json['display_name'] == null ? undefined : json['display_name'],
|
|
51
|
+
'partType': json['part_type'] == null ? undefined : json['part_type'],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function ResolvedRefToJSON(json) {
|
|
55
|
+
return ResolvedRefToJSONTyped(json, false);
|
|
56
|
+
}
|
|
57
|
+
function ResolvedRefToJSONTyped(value, ignoreDiscriminator = false) {
|
|
58
|
+
if (value == null) {
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
'entity_type': value['entityType'],
|
|
63
|
+
'object_id': value['objectId'],
|
|
64
|
+
'display_name': value['displayName'],
|
|
65
|
+
'part_type': value['partType'],
|
|
66
|
+
};
|
|
67
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -225,7 +225,9 @@ export * from './ProposeMemoryChunkRequest';
|
|
|
225
225
|
export * from './ProposedMemoryChunkResponse';
|
|
226
226
|
export * from './ReasoningPart';
|
|
227
227
|
export * from './ReferenceType';
|
|
228
|
+
export * from './ReorderPathPartRequest';
|
|
228
229
|
export * from './RequestPhoneChangeRequest';
|
|
230
|
+
export * from './ResolvedRef';
|
|
229
231
|
export * from './ResolvedReferenceInput';
|
|
230
232
|
export * from './ResolvedReferenceOutput';
|
|
231
233
|
export * from './ResponseSendPwResetEmail';
|
package/dist/models/index.js
CHANGED
|
@@ -243,7 +243,9 @@ __exportStar(require("./ProposeMemoryChunkRequest"), exports);
|
|
|
243
243
|
__exportStar(require("./ProposedMemoryChunkResponse"), exports);
|
|
244
244
|
__exportStar(require("./ReasoningPart"), exports);
|
|
245
245
|
__exportStar(require("./ReferenceType"), exports);
|
|
246
|
+
__exportStar(require("./ReorderPathPartRequest"), exports);
|
|
246
247
|
__exportStar(require("./RequestPhoneChangeRequest"), exports);
|
|
248
|
+
__exportStar(require("./ResolvedRef"), exports);
|
|
247
249
|
__exportStar(require("./ResolvedReferenceInput"), exports);
|
|
248
250
|
__exportStar(require("./ResolvedReferenceOutput"), exports);
|
|
249
251
|
__exportStar(require("./ResponseSendPwResetEmail"), exports);
|
package/docs/EventResponse.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
# EventResponse
|
|
3
3
|
|
|
4
|
-
One event row, anchored to a path_part subject. ``kind`` is namespaced ``domain.action`` (e.g. ``workflow.approval``, ``document.created``). ``payload`` is the domain-specific structured JSON associated with the event
|
|
4
|
+
One event row, anchored to a path_part subject. ``kind`` is namespaced ``domain.action`` (e.g. ``workflow.approval``, ``document.created``). ``payload`` is the domain-specific structured JSON associated with the event, stored verbatim and never rewritten — the human-readable resolution lives alongside it in ``references``.
|
|
5
5
|
|
|
6
6
|
## Properties
|
|
7
7
|
|
|
@@ -14,6 +14,11 @@ Name | Type
|
|
|
14
14
|
`actorUserId` | string
|
|
15
15
|
`payload` | { [key: string]: any; }
|
|
16
16
|
`actor` | [UserInfo](UserInfo.md)
|
|
17
|
+
`subjectName` | string
|
|
18
|
+
`subjectPath` | string
|
|
19
|
+
`subjectObjectId` | string
|
|
20
|
+
`subjectPartType` | string
|
|
21
|
+
`references` | [{ [key: string]: ResolvedRef; }](ResolvedRef.md)
|
|
17
22
|
|
|
18
23
|
## Example
|
|
19
24
|
|
|
@@ -29,6 +34,11 @@ const example = {
|
|
|
29
34
|
"actorUserId": null,
|
|
30
35
|
"payload": null,
|
|
31
36
|
"actor": null,
|
|
37
|
+
"subjectName": null,
|
|
38
|
+
"subjectPath": null,
|
|
39
|
+
"subjectObjectId": null,
|
|
40
|
+
"subjectPartType": null,
|
|
41
|
+
"references": null,
|
|
32
42
|
} satisfies EventResponse
|
|
33
43
|
|
|
34
44
|
console.log(example)
|
package/docs/PathPartsApi.md
CHANGED
|
@@ -13,6 +13,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
13
13
|
| [**getPathPartTags**](PathPartsApi.md#getpathparttags) | **GET** /v1/path-parts/{path_part_id}/tags | Get Path Part Tags Handler |
|
|
14
14
|
| [**listPathPartEvents**](PathPartsApi.md#listpathpartevents) | **GET** /v1/path-parts/{path_part_id}/events | List Path Part Events Handler |
|
|
15
15
|
| [**listPathParts**](PathPartsApi.md#listpathparts) | **GET** /v1/path-parts | List Path Parts Handler |
|
|
16
|
+
| [**reorderPathPart**](PathPartsApi.md#reorderpathpartoperation) | **POST** /v1/path-parts/{path_part_id}/reorder | Reorder Path Part Handler |
|
|
16
17
|
| [**setPathPartTags**](PathPartsApi.md#setpathparttags) | **POST** /v1/path-parts/{path_part_id}/tags | Set Path Part Tags Handler |
|
|
17
18
|
| [**transferPathPartOwner**](PathPartsApi.md#transferpathpartowner) | **PUT** /v1/path-parts/{path_part_id}/owner | Transfer Path Part Owner Handler |
|
|
18
19
|
|
|
@@ -753,6 +754,84 @@ example().catch(console.error);
|
|
|
753
754
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
754
755
|
|
|
755
756
|
|
|
757
|
+
## reorderPathPart
|
|
758
|
+
|
|
759
|
+
> PathPartResponse reorderPathPart(pathPartId, reorderPathPartRequest)
|
|
760
|
+
|
|
761
|
+
Reorder Path Part Handler
|
|
762
|
+
|
|
763
|
+
Reorder a path part within its sibling list. The left-nav order follows the path_part sibling linked list: one per-parent chain shared by everyone in the tenant. Moving is confined to the node\'s current parent; use the folder/document move endpoints to change parents.
|
|
764
|
+
|
|
765
|
+
### Example
|
|
766
|
+
|
|
767
|
+
```ts
|
|
768
|
+
import {
|
|
769
|
+
Configuration,
|
|
770
|
+
PathPartsApi,
|
|
771
|
+
} from '@knowledge-stack/ksapi';
|
|
772
|
+
import type { ReorderPathPartOperationRequest } from '@knowledge-stack/ksapi';
|
|
773
|
+
|
|
774
|
+
async function example() {
|
|
775
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
776
|
+
const config = new Configuration({
|
|
777
|
+
// To configure API key authorization: cookieAuth
|
|
778
|
+
apiKey: "YOUR API KEY",
|
|
779
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
780
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
781
|
+
});
|
|
782
|
+
const api = new PathPartsApi(config);
|
|
783
|
+
|
|
784
|
+
const body = {
|
|
785
|
+
// string
|
|
786
|
+
pathPartId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
787
|
+
// ReorderPathPartRequest
|
|
788
|
+
reorderPathPartRequest: ...,
|
|
789
|
+
} satisfies ReorderPathPartOperationRequest;
|
|
790
|
+
|
|
791
|
+
try {
|
|
792
|
+
const data = await api.reorderPathPart(body);
|
|
793
|
+
console.log(data);
|
|
794
|
+
} catch (error) {
|
|
795
|
+
console.error(error);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// Run the test
|
|
800
|
+
example().catch(console.error);
|
|
801
|
+
```
|
|
802
|
+
|
|
803
|
+
### Parameters
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
| Name | Type | Description | Notes |
|
|
807
|
+
|------------- | ------------- | ------------- | -------------|
|
|
808
|
+
| **pathPartId** | `string` | | [Defaults to `undefined`] |
|
|
809
|
+
| **reorderPathPartRequest** | [ReorderPathPartRequest](ReorderPathPartRequest.md) | | |
|
|
810
|
+
|
|
811
|
+
### Return type
|
|
812
|
+
|
|
813
|
+
[**PathPartResponse**](PathPartResponse.md)
|
|
814
|
+
|
|
815
|
+
### Authorization
|
|
816
|
+
|
|
817
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
818
|
+
|
|
819
|
+
### HTTP request headers
|
|
820
|
+
|
|
821
|
+
- **Content-Type**: `application/json`
|
|
822
|
+
- **Accept**: `application/json`
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
### HTTP response details
|
|
826
|
+
| Status code | Description | Response headers |
|
|
827
|
+
|-------------|-------------|------------------|
|
|
828
|
+
| **200** | Successful Response | - |
|
|
829
|
+
| **422** | Validation Error | - |
|
|
830
|
+
| **0** | Error response. | - |
|
|
831
|
+
|
|
832
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
833
|
+
|
|
834
|
+
|
|
756
835
|
## setPathPartTags
|
|
757
836
|
|
|
758
837
|
> PathPartTagsResponse setPathPartTags(pathPartId, bulkTagRequest)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# ReorderPathPartRequest
|
|
3
|
+
|
|
4
|
+
Reorder a path part within its sibling list.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`prevSiblingPathId` | string
|
|
11
|
+
`moveToHead` | boolean
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ReorderPathPartRequest } from '@knowledge-stack/ksapi'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"prevSiblingPathId": null,
|
|
21
|
+
"moveToHead": null,
|
|
22
|
+
} satisfies ReorderPathPartRequest
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as ReorderPathPartRequest
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
# ResolvedRef
|
|
3
|
+
|
|
4
|
+
One id resolved to a human-readable, linkable entity. Every UUID that appears in an event (its subject, its actor, and any id inside the payload) resolves to one of these so the frontend can render a name and a link instead of a bare UUID. ``object_id`` is what the frontend routes on: a PDO id for a path_part (never the internal path_part_id), or the user id for a user.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`entityType` | string
|
|
11
|
+
`objectId` | string
|
|
12
|
+
`displayName` | string
|
|
13
|
+
`partType` | string
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type { ResolvedRef } from '@knowledge-stack/ksapi'
|
|
19
|
+
|
|
20
|
+
// TODO: Update the object below with actual values
|
|
21
|
+
const example = {
|
|
22
|
+
"entityType": null,
|
|
23
|
+
"objectId": null,
|
|
24
|
+
"displayName": null,
|
|
25
|
+
"partType": null,
|
|
26
|
+
} satisfies ResolvedRef
|
|
27
|
+
|
|
28
|
+
console.log(example)
|
|
29
|
+
|
|
30
|
+
// Convert the instance to a JSON string
|
|
31
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
32
|
+
console.log(exampleJSON)
|
|
33
|
+
|
|
34
|
+
// Parse the JSON string back to an object
|
|
35
|
+
const exampleParsed = JSON.parse(exampleJSON) as ResolvedRef
|
|
36
|
+
console.log(exampleParsed)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
40
|
+
|
|
41
|
+
|