@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "1.142.2",
3
+ "version": "1.144.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -28,6 +28,7 @@ import type {
28
28
  PathPartResponse,
29
29
  PathPartTagsResponse,
30
30
  PermissionCapability,
31
+ ReorderPathPartRequest,
31
32
  SortDirection,
32
33
  SubtreeChunksResponse,
33
34
  TransferOwnerRequest,
@@ -60,6 +61,8 @@ import {
60
61
  PathPartTagsResponseToJSON,
61
62
  PermissionCapabilityFromJSON,
62
63
  PermissionCapabilityToJSON,
64
+ ReorderPathPartRequestFromJSON,
65
+ ReorderPathPartRequestToJSON,
63
66
  SortDirectionFromJSON,
64
67
  SortDirectionToJSON,
65
68
  SubtreeChunksResponseFromJSON,
@@ -126,6 +129,11 @@ export interface ListPathPartsRequest {
126
129
  updatedBefore?: Date | null;
127
130
  }
128
131
 
132
+ export interface ReorderPathPartOperationRequest {
133
+ pathPartId: string;
134
+ reorderPathPartRequest: ReorderPathPartRequest;
135
+ }
136
+
129
137
  export interface SetPathPartTagsRequest {
130
138
  pathPartId: string;
131
139
  bulkTagRequest: BulkTagRequest;
@@ -399,6 +407,32 @@ export interface PathPartsApiInterface {
399
407
  */
400
408
  listPathParts(requestParameters: ListPathPartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponsePathPartResponse>;
401
409
 
410
+ /**
411
+ * Creates request options for reorderPathPart without sending the request
412
+ * @param {string} pathPartId
413
+ * @param {ReorderPathPartRequest} reorderPathPartRequest
414
+ * @throws {RequiredError}
415
+ * @memberof PathPartsApiInterface
416
+ */
417
+ reorderPathPartRequestOpts(requestParameters: ReorderPathPartOperationRequest): Promise<runtime.RequestOpts>;
418
+
419
+ /**
420
+ * 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.
421
+ * @summary Reorder Path Part Handler
422
+ * @param {string} pathPartId
423
+ * @param {ReorderPathPartRequest} reorderPathPartRequest
424
+ * @param {*} [options] Override http request option.
425
+ * @throws {RequiredError}
426
+ * @memberof PathPartsApiInterface
427
+ */
428
+ reorderPathPartRaw(requestParameters: ReorderPathPartOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartResponse>>;
429
+
430
+ /**
431
+ * 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.
432
+ * Reorder Path Part Handler
433
+ */
434
+ reorderPathPart(requestParameters: ReorderPathPartOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartResponse>;
435
+
402
436
  /**
403
437
  * Creates request options for setPathPartTags without sending the request
404
438
  * @param {string} pathPartId
@@ -1048,6 +1082,71 @@ export class PathPartsApi extends runtime.BaseAPI implements PathPartsApiInterfa
1048
1082
  return await response.value();
1049
1083
  }
1050
1084
 
1085
+ /**
1086
+ * Creates request options for reorderPathPart without sending the request
1087
+ */
1088
+ async reorderPathPartRequestOpts(requestParameters: ReorderPathPartOperationRequest): Promise<runtime.RequestOpts> {
1089
+ if (requestParameters['pathPartId'] == null) {
1090
+ throw new runtime.RequiredError(
1091
+ 'pathPartId',
1092
+ 'Required parameter "pathPartId" was null or undefined when calling reorderPathPart().'
1093
+ );
1094
+ }
1095
+
1096
+ if (requestParameters['reorderPathPartRequest'] == null) {
1097
+ throw new runtime.RequiredError(
1098
+ 'reorderPathPartRequest',
1099
+ 'Required parameter "reorderPathPartRequest" was null or undefined when calling reorderPathPart().'
1100
+ );
1101
+ }
1102
+
1103
+ const queryParameters: any = {};
1104
+
1105
+ const headerParameters: runtime.HTTPHeaders = {};
1106
+
1107
+ headerParameters['Content-Type'] = 'application/json';
1108
+
1109
+ if (this.configuration && this.configuration.accessToken) {
1110
+ const token = this.configuration.accessToken;
1111
+ const tokenString = await token("bearerAuth", []);
1112
+
1113
+ if (tokenString) {
1114
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1115
+ }
1116
+ }
1117
+
1118
+ let urlPath = `/v1/path-parts/{path_part_id}/reorder`;
1119
+ urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
1120
+
1121
+ return {
1122
+ path: urlPath,
1123
+ method: 'POST',
1124
+ headers: headerParameters,
1125
+ query: queryParameters,
1126
+ body: ReorderPathPartRequestToJSON(requestParameters['reorderPathPartRequest']),
1127
+ };
1128
+ }
1129
+
1130
+ /**
1131
+ * 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.
1132
+ * Reorder Path Part Handler
1133
+ */
1134
+ async reorderPathPartRaw(requestParameters: ReorderPathPartOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartResponse>> {
1135
+ const requestOptions = await this.reorderPathPartRequestOpts(requestParameters);
1136
+ const response = await this.request(requestOptions, initOverrides);
1137
+
1138
+ return new runtime.JSONApiResponse(response, (jsonValue) => PathPartResponseFromJSON(jsonValue));
1139
+ }
1140
+
1141
+ /**
1142
+ * 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.
1143
+ * Reorder Path Part Handler
1144
+ */
1145
+ async reorderPathPart(requestParameters: ReorderPathPartOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartResponse> {
1146
+ const response = await this.reorderPathPartRaw(requestParameters, initOverrides);
1147
+ return await response.value();
1148
+ }
1149
+
1051
1150
  /**
1052
1151
  * Creates request options for setPathPartTags without sending the request
1053
1152
  */
@@ -20,13 +20,21 @@ import {
20
20
  UserInfoToJSON,
21
21
  UserInfoToJSONTyped,
22
22
  } from './UserInfo';
23
+ import type { ResolvedRef } from './ResolvedRef';
24
+ import {
25
+ ResolvedRefFromJSON,
26
+ ResolvedRefFromJSONTyped,
27
+ ResolvedRefToJSON,
28
+ ResolvedRefToJSONTyped,
29
+ } from './ResolvedRef';
23
30
 
24
31
  /**
25
32
  * One event row, anchored to a path_part subject.
26
33
  *
27
34
  * ``kind`` is namespaced ``domain.action`` (e.g. ``workflow.approval``,
28
35
  * ``document.created``). ``payload`` is the domain-specific structured
29
- * JSON associated with the event.
36
+ * JSON associated with the event, stored verbatim and never rewritten —
37
+ * the human-readable resolution lives alongside it in ``references``.
30
38
  * @export
31
39
  * @interface EventResponse
32
40
  */
@@ -73,6 +81,36 @@ export interface EventResponse {
73
81
  * @memberof EventResponse
74
82
  */
75
83
  actor?: UserInfo | null;
84
+ /**
85
+ *
86
+ * @type {string}
87
+ * @memberof EventResponse
88
+ */
89
+ subjectName?: string | null;
90
+ /**
91
+ *
92
+ * @type {string}
93
+ * @memberof EventResponse
94
+ */
95
+ subjectPath?: string | null;
96
+ /**
97
+ *
98
+ * @type {string}
99
+ * @memberof EventResponse
100
+ */
101
+ subjectObjectId?: string | null;
102
+ /**
103
+ *
104
+ * @type {string}
105
+ * @memberof EventResponse
106
+ */
107
+ subjectPartType?: string | null;
108
+ /**
109
+ *
110
+ * @type {{ [key: string]: ResolvedRef; }}
111
+ * @memberof EventResponse
112
+ */
113
+ references?: { [key: string]: ResolvedRef; };
76
114
  }
77
115
  export const EventResponsePropertyValidationAttributesMap: {
78
116
  [property: string]: {
@@ -122,6 +160,11 @@ export function EventResponseFromJSONTyped(json: any, ignoreDiscriminator: boole
122
160
  'actorUserId': json['actor_user_id'],
123
161
  'payload': json['payload'],
124
162
  'actor': json['actor'] == null ? undefined : UserInfoFromJSON(json['actor']),
163
+ 'subjectName': json['subject_name'] == null ? undefined : json['subject_name'],
164
+ 'subjectPath': json['subject_path'] == null ? undefined : json['subject_path'],
165
+ 'subjectObjectId': json['subject_object_id'] == null ? undefined : json['subject_object_id'],
166
+ 'subjectPartType': json['subject_part_type'] == null ? undefined : json['subject_part_type'],
167
+ 'references': json['references'] == null ? undefined : (mapValues(json['references'], ResolvedRefFromJSON)),
125
168
  };
126
169
  }
127
170
 
@@ -143,6 +186,11 @@ export function EventResponseToJSONTyped(value?: EventResponse | null, ignoreDis
143
186
  'actor_user_id': value['actorUserId'],
144
187
  'payload': value['payload'],
145
188
  'actor': UserInfoToJSON(value['actor']),
189
+ 'subject_name': value['subjectName'],
190
+ 'subject_path': value['subjectPath'],
191
+ 'subject_object_id': value['subjectObjectId'],
192
+ 'subject_part_type': value['subjectPartType'],
193
+ 'references': value['references'] == null ? undefined : (mapValues(value['references'], ResolvedRefToJSON)),
146
194
  };
147
195
  }
148
196
 
@@ -0,0 +1,90 @@
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
+ * Reorder a path part within its sibling list.
18
+ * @export
19
+ * @interface ReorderPathPartRequest
20
+ */
21
+ export interface ReorderPathPartRequest {
22
+ /**
23
+ * 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.
24
+ * @type {string}
25
+ * @memberof ReorderPathPartRequest
26
+ */
27
+ prevSiblingPathId?: string | null;
28
+ /**
29
+ * Move this node to the head of its sibling list.
30
+ * @type {boolean}
31
+ * @memberof ReorderPathPartRequest
32
+ */
33
+ moveToHead?: boolean;
34
+ }
35
+ export const ReorderPathPartRequestPropertyValidationAttributesMap: {
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 ReorderPathPartRequest interface.
55
+ */
56
+ export function instanceOfReorderPathPartRequest(value: object): value is ReorderPathPartRequest {
57
+ return true;
58
+ }
59
+
60
+ export function ReorderPathPartRequestFromJSON(json: any): ReorderPathPartRequest {
61
+ return ReorderPathPartRequestFromJSONTyped(json, false);
62
+ }
63
+
64
+ export function ReorderPathPartRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReorderPathPartRequest {
65
+ if (json == null) {
66
+ return json;
67
+ }
68
+ return {
69
+
70
+ 'prevSiblingPathId': json['prev_sibling_path_id'] == null ? undefined : json['prev_sibling_path_id'],
71
+ 'moveToHead': json['move_to_head'] == null ? undefined : json['move_to_head'],
72
+ };
73
+ }
74
+
75
+ export function ReorderPathPartRequestToJSON(json: any): ReorderPathPartRequest {
76
+ return ReorderPathPartRequestToJSONTyped(json, false);
77
+ }
78
+
79
+ export function ReorderPathPartRequestToJSONTyped(value?: ReorderPathPartRequest | null, ignoreDiscriminator: boolean = false): any {
80
+ if (value == null) {
81
+ return value;
82
+ }
83
+
84
+ return {
85
+
86
+ 'prev_sibling_path_id': value['prevSiblingPathId'],
87
+ 'move_to_head': value['moveToHead'],
88
+ };
89
+ }
90
+
@@ -0,0 +1,125 @@
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 id resolved to a human-readable, linkable entity.
18
+ *
19
+ * Every UUID that appears in an event (its subject, its actor, and any id
20
+ * inside the payload) resolves to one of these so the frontend can render a
21
+ * name and a link instead of a bare UUID. ``object_id`` is what the frontend
22
+ * routes on: a PDO id for a path_part (never the internal path_part_id), or
23
+ * the user id for a user.
24
+ * @export
25
+ * @interface ResolvedRef
26
+ */
27
+ export interface ResolvedRef {
28
+ /**
29
+ *
30
+ * @type {ResolvedRefEntityTypeEnum}
31
+ * @memberof ResolvedRef
32
+ */
33
+ entityType: ResolvedRefEntityTypeEnum;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof ResolvedRef
38
+ */
39
+ objectId: string;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof ResolvedRef
44
+ */
45
+ displayName?: string | null;
46
+ /**
47
+ *
48
+ * @type {string}
49
+ * @memberof ResolvedRef
50
+ */
51
+ partType?: string | null;
52
+ }
53
+
54
+
55
+ /**
56
+ * @export
57
+ */
58
+ export const ResolvedRefEntityTypeEnum = {
59
+ PathPart: 'path_part',
60
+ User: 'user'
61
+ } as const;
62
+ export type ResolvedRefEntityTypeEnum = typeof ResolvedRefEntityTypeEnum[keyof typeof ResolvedRefEntityTypeEnum];
63
+
64
+ export const ResolvedRefPropertyValidationAttributesMap: {
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
+ }
80
+
81
+
82
+ /**
83
+ * Check if a given object implements the ResolvedRef interface.
84
+ */
85
+ export function instanceOfResolvedRef(value: object): value is ResolvedRef {
86
+ if (!('entityType' in value) || value['entityType'] === undefined) return false;
87
+ if (!('objectId' in value) || value['objectId'] === undefined) return false;
88
+ return true;
89
+ }
90
+
91
+ export function ResolvedRefFromJSON(json: any): ResolvedRef {
92
+ return ResolvedRefFromJSONTyped(json, false);
93
+ }
94
+
95
+ export function ResolvedRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResolvedRef {
96
+ if (json == null) {
97
+ return json;
98
+ }
99
+ return {
100
+
101
+ 'entityType': json['entity_type'],
102
+ 'objectId': json['object_id'],
103
+ 'displayName': json['display_name'] == null ? undefined : json['display_name'],
104
+ 'partType': json['part_type'] == null ? undefined : json['part_type'],
105
+ };
106
+ }
107
+
108
+ export function ResolvedRefToJSON(json: any): ResolvedRef {
109
+ return ResolvedRefToJSONTyped(json, false);
110
+ }
111
+
112
+ export function ResolvedRefToJSONTyped(value?: ResolvedRef | null, ignoreDiscriminator: boolean = false): any {
113
+ if (value == null) {
114
+ return value;
115
+ }
116
+
117
+ return {
118
+
119
+ 'entity_type': value['entityType'],
120
+ 'object_id': value['objectId'],
121
+ 'display_name': value['displayName'],
122
+ 'part_type': value['partType'],
123
+ };
124
+ }
125
+
@@ -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';