@knowledge-stack/ksapi 1.8.0 → 1.10.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.
Files changed (98) hide show
  1. package/.openapi-generator/FILES +14 -0
  2. package/README.md +2 -2
  3. package/dist/apis/DocumentVersionsApi.d.ts +36 -1
  4. package/dist/apis/DocumentVersionsApi.js +41 -0
  5. package/dist/apis/FoldersApi.d.ts +38 -1
  6. package/dist/apis/FoldersApi.js +44 -0
  7. package/dist/apis/PathPartsApi.d.ts +4 -6
  8. package/dist/apis/PathPartsApi.js +2 -5
  9. package/dist/apis/ThreadMessagesApi.d.ts +123 -0
  10. package/dist/apis/ThreadMessagesApi.js +147 -0
  11. package/dist/apis/ThreadsApi.d.ts +177 -0
  12. package/dist/apis/ThreadsApi.js +203 -0
  13. package/dist/apis/index.d.ts +2 -0
  14. package/dist/apis/index.js +2 -0
  15. package/dist/esm/apis/DocumentVersionsApi.d.ts +36 -1
  16. package/dist/esm/apis/DocumentVersionsApi.js +42 -1
  17. package/dist/esm/apis/FoldersApi.d.ts +38 -1
  18. package/dist/esm/apis/FoldersApi.js +45 -1
  19. package/dist/esm/apis/PathPartsApi.d.ts +4 -6
  20. package/dist/esm/apis/PathPartsApi.js +2 -5
  21. package/dist/esm/apis/ThreadMessagesApi.d.ts +123 -0
  22. package/dist/esm/apis/ThreadMessagesApi.js +143 -0
  23. package/dist/esm/apis/ThreadsApi.d.ts +177 -0
  24. package/dist/esm/apis/ThreadsApi.js +199 -0
  25. package/dist/esm/apis/index.d.ts +2 -0
  26. package/dist/esm/apis/index.js +2 -0
  27. package/dist/esm/models/CreateThreadMessageRequest.d.ts +58 -0
  28. package/dist/esm/models/CreateThreadMessageRequest.js +50 -0
  29. package/dist/esm/models/CreateThreadRequest.d.ts +53 -0
  30. package/dist/esm/models/CreateThreadRequest.js +49 -0
  31. package/dist/esm/models/DocumentContentPathPart.d.ts +119 -0
  32. package/dist/esm/models/DocumentContentPathPart.js +83 -0
  33. package/dist/esm/models/FolderDocumentResponse.d.ts +138 -0
  34. package/dist/esm/models/FolderDocumentResponse.js +88 -0
  35. package/dist/esm/models/MessageRole.d.ts +26 -0
  36. package/dist/esm/models/MessageRole.js +44 -0
  37. package/dist/esm/models/PaginatedResponseDocumentContentPathPart.d.ts +66 -0
  38. package/dist/esm/models/PaginatedResponseDocumentContentPathPart.js +70 -0
  39. package/dist/esm/models/PaginatedResponseFolderDocumentResponse.d.ts +66 -0
  40. package/dist/esm/models/PaginatedResponseFolderDocumentResponse.js +70 -0
  41. package/dist/esm/models/PaginatedResponseThreadMessageResponse.d.ts +66 -0
  42. package/dist/esm/models/PaginatedResponseThreadMessageResponse.js +70 -0
  43. package/dist/esm/models/PaginatedResponseThreadResponse.d.ts +66 -0
  44. package/dist/esm/models/PaginatedResponseThreadResponse.js +70 -0
  45. package/dist/esm/models/ThreadMessageResponse.d.ts +100 -0
  46. package/dist/esm/models/ThreadMessageResponse.js +78 -0
  47. package/dist/esm/models/ThreadResponse.d.ts +83 -0
  48. package/dist/esm/models/ThreadResponse.js +66 -0
  49. package/dist/esm/models/UpdateThreadRequest.d.ts +53 -0
  50. package/dist/esm/models/UpdateThreadRequest.js +49 -0
  51. package/dist/esm/models/index.d.ts +12 -0
  52. package/dist/esm/models/index.js +12 -0
  53. package/dist/models/CreateThreadMessageRequest.d.ts +58 -0
  54. package/dist/models/CreateThreadMessageRequest.js +58 -0
  55. package/dist/models/CreateThreadRequest.d.ts +53 -0
  56. package/dist/models/CreateThreadRequest.js +57 -0
  57. package/dist/models/DocumentContentPathPart.d.ts +119 -0
  58. package/dist/models/DocumentContentPathPart.js +91 -0
  59. package/dist/models/FolderDocumentResponse.d.ts +138 -0
  60. package/dist/models/FolderDocumentResponse.js +96 -0
  61. package/dist/models/MessageRole.d.ts +26 -0
  62. package/dist/models/MessageRole.js +52 -0
  63. package/dist/models/PaginatedResponseDocumentContentPathPart.d.ts +66 -0
  64. package/dist/models/PaginatedResponseDocumentContentPathPart.js +78 -0
  65. package/dist/models/PaginatedResponseFolderDocumentResponse.d.ts +66 -0
  66. package/dist/models/PaginatedResponseFolderDocumentResponse.js +78 -0
  67. package/dist/models/PaginatedResponseThreadMessageResponse.d.ts +66 -0
  68. package/dist/models/PaginatedResponseThreadMessageResponse.js +78 -0
  69. package/dist/models/PaginatedResponseThreadResponse.d.ts +66 -0
  70. package/dist/models/PaginatedResponseThreadResponse.js +78 -0
  71. package/dist/models/ThreadMessageResponse.d.ts +100 -0
  72. package/dist/models/ThreadMessageResponse.js +86 -0
  73. package/dist/models/ThreadResponse.d.ts +83 -0
  74. package/dist/models/ThreadResponse.js +74 -0
  75. package/dist/models/UpdateThreadRequest.d.ts +53 -0
  76. package/dist/models/UpdateThreadRequest.js +57 -0
  77. package/dist/models/index.d.ts +12 -0
  78. package/dist/models/index.js +12 -0
  79. package/package.json +1 -1
  80. package/src/apis/DocumentVersionsApi.ts +82 -0
  81. package/src/apis/FoldersApi.ts +88 -0
  82. package/src/apis/PathPartsApi.ts +4 -10
  83. package/src/apis/ThreadMessagesApi.ts +271 -0
  84. package/src/apis/ThreadsApi.ts +377 -0
  85. package/src/apis/index.ts +2 -0
  86. package/src/models/CreateThreadMessageRequest.ts +105 -0
  87. package/src/models/CreateThreadRequest.ts +94 -0
  88. package/src/models/DocumentContentPathPart.ts +205 -0
  89. package/src/models/FolderDocumentResponse.ts +234 -0
  90. package/src/models/MessageRole.ts +54 -0
  91. package/src/models/PaginatedResponseDocumentContentPathPart.ts +130 -0
  92. package/src/models/PaginatedResponseFolderDocumentResponse.ts +130 -0
  93. package/src/models/PaginatedResponseThreadMessageResponse.ts +130 -0
  94. package/src/models/PaginatedResponseThreadResponse.ts +130 -0
  95. package/src/models/ThreadMessageResponse.ts +168 -0
  96. package/src/models/ThreadResponse.ts +136 -0
  97. package/src/models/UpdateThreadRequest.ts +94 -0
  98. package/src/models/index.ts +12 -0
@@ -0,0 +1,199 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { CreateThreadRequestToJSON, PaginatedResponseThreadResponseFromJSON, ThreadResponseFromJSON, UpdateThreadRequestToJSON, } from '../models/index';
25
+ /**
26
+ *
27
+ */
28
+ export class ThreadsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Create a new thread. If parent_path_part_id is omitted, the thread is created under the user\'s /users/{user_id}/threads/ folder (auto-provisioned if needed).
31
+ * Create Thread Handler
32
+ */
33
+ createThreadRaw(requestParameters, initOverrides) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (requestParameters['createThreadRequest'] == null) {
36
+ throw new runtime.RequiredError('createThreadRequest', 'Required parameter "createThreadRequest" was null or undefined when calling createThread().');
37
+ }
38
+ const queryParameters = {};
39
+ const headerParameters = {};
40
+ headerParameters['Content-Type'] = 'application/json';
41
+ let urlPath = `/v1/threads`;
42
+ const response = yield this.request({
43
+ path: urlPath,
44
+ method: 'POST',
45
+ headers: headerParameters,
46
+ query: queryParameters,
47
+ body: CreateThreadRequestToJSON(requestParameters['createThreadRequest']),
48
+ }, initOverrides);
49
+ return new runtime.JSONApiResponse(response, (jsonValue) => ThreadResponseFromJSON(jsonValue));
50
+ });
51
+ }
52
+ /**
53
+ * Create a new thread. If parent_path_part_id is omitted, the thread is created under the user\'s /users/{user_id}/threads/ folder (auto-provisioned if needed).
54
+ * Create Thread Handler
55
+ */
56
+ createThread(requestParameters, initOverrides) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ const response = yield this.createThreadRaw(requestParameters, initOverrides);
59
+ return yield response.value();
60
+ });
61
+ }
62
+ /**
63
+ * Delete a thread. Authorization: only conversation threads belonging to the current user (under /users/{user_id}/threads/) can be deleted.
64
+ * Delete Thread Handler
65
+ */
66
+ deleteThreadRaw(requestParameters, initOverrides) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ if (requestParameters['threadId'] == null) {
69
+ throw new runtime.RequiredError('threadId', 'Required parameter "threadId" was null or undefined when calling deleteThread().');
70
+ }
71
+ const queryParameters = {};
72
+ const headerParameters = {};
73
+ let urlPath = `/v1/threads/{thread_id}`;
74
+ urlPath = urlPath.replace(`{${"thread_id"}}`, encodeURIComponent(String(requestParameters['threadId'])));
75
+ const response = yield this.request({
76
+ path: urlPath,
77
+ method: 'DELETE',
78
+ headers: headerParameters,
79
+ query: queryParameters,
80
+ }, initOverrides);
81
+ return new runtime.VoidApiResponse(response);
82
+ });
83
+ }
84
+ /**
85
+ * Delete a thread. Authorization: only conversation threads belonging to the current user (under /users/{user_id}/threads/) can be deleted.
86
+ * Delete Thread Handler
87
+ */
88
+ deleteThread(requestParameters, initOverrides) {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ yield this.deleteThreadRaw(requestParameters, initOverrides);
91
+ });
92
+ }
93
+ /**
94
+ * Get a thread by its thread ID.
95
+ * Get Thread Handler
96
+ */
97
+ getThreadRaw(requestParameters, initOverrides) {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ if (requestParameters['threadId'] == null) {
100
+ throw new runtime.RequiredError('threadId', 'Required parameter "threadId" was null or undefined when calling getThread().');
101
+ }
102
+ const queryParameters = {};
103
+ const headerParameters = {};
104
+ let urlPath = `/v1/threads/{thread_id}`;
105
+ urlPath = urlPath.replace(`{${"thread_id"}}`, encodeURIComponent(String(requestParameters['threadId'])));
106
+ const response = yield this.request({
107
+ path: urlPath,
108
+ method: 'GET',
109
+ headers: headerParameters,
110
+ query: queryParameters,
111
+ }, initOverrides);
112
+ return new runtime.JSONApiResponse(response, (jsonValue) => ThreadResponseFromJSON(jsonValue));
113
+ });
114
+ }
115
+ /**
116
+ * Get a thread by its thread ID.
117
+ * Get Thread Handler
118
+ */
119
+ getThread(requestParameters, initOverrides) {
120
+ return __awaiter(this, void 0, void 0, function* () {
121
+ const response = yield this.getThreadRaw(requestParameters, initOverrides);
122
+ return yield response.value();
123
+ });
124
+ }
125
+ /**
126
+ * List threads under a parent path_part. When parent_path_part_id is omitted, lists the authenticated user\'s conversation threads from /users/{user_id}/threads/.
127
+ * List Threads Handler
128
+ */
129
+ listThreadsRaw(requestParameters, initOverrides) {
130
+ return __awaiter(this, void 0, void 0, function* () {
131
+ const queryParameters = {};
132
+ if (requestParameters['parentPathPartId'] != null) {
133
+ queryParameters['parent_path_part_id'] = requestParameters['parentPathPartId'];
134
+ }
135
+ if (requestParameters['limit'] != null) {
136
+ queryParameters['limit'] = requestParameters['limit'];
137
+ }
138
+ if (requestParameters['offset'] != null) {
139
+ queryParameters['offset'] = requestParameters['offset'];
140
+ }
141
+ const headerParameters = {};
142
+ let urlPath = `/v1/threads`;
143
+ const response = yield this.request({
144
+ path: urlPath,
145
+ method: 'GET',
146
+ headers: headerParameters,
147
+ query: queryParameters,
148
+ }, initOverrides);
149
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseThreadResponseFromJSON(jsonValue));
150
+ });
151
+ }
152
+ /**
153
+ * List threads under a parent path_part. When parent_path_part_id is omitted, lists the authenticated user\'s conversation threads from /users/{user_id}/threads/.
154
+ * List Threads Handler
155
+ */
156
+ listThreads() {
157
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
158
+ const response = yield this.listThreadsRaw(requestParameters, initOverrides);
159
+ return yield response.value();
160
+ });
161
+ }
162
+ /**
163
+ * Update a thread\'s title and/or parent_thread_id.
164
+ * Update Thread Handler
165
+ */
166
+ updateThreadRaw(requestParameters, initOverrides) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ if (requestParameters['threadId'] == null) {
169
+ throw new runtime.RequiredError('threadId', 'Required parameter "threadId" was null or undefined when calling updateThread().');
170
+ }
171
+ if (requestParameters['updateThreadRequest'] == null) {
172
+ throw new runtime.RequiredError('updateThreadRequest', 'Required parameter "updateThreadRequest" was null or undefined when calling updateThread().');
173
+ }
174
+ const queryParameters = {};
175
+ const headerParameters = {};
176
+ headerParameters['Content-Type'] = 'application/json';
177
+ let urlPath = `/v1/threads/{thread_id}`;
178
+ urlPath = urlPath.replace(`{${"thread_id"}}`, encodeURIComponent(String(requestParameters['threadId'])));
179
+ const response = yield this.request({
180
+ path: urlPath,
181
+ method: 'PATCH',
182
+ headers: headerParameters,
183
+ query: queryParameters,
184
+ body: UpdateThreadRequestToJSON(requestParameters['updateThreadRequest']),
185
+ }, initOverrides);
186
+ return new runtime.JSONApiResponse(response, (jsonValue) => ThreadResponseFromJSON(jsonValue));
187
+ });
188
+ }
189
+ /**
190
+ * Update a thread\'s title and/or parent_thread_id.
191
+ * Update Thread Handler
192
+ */
193
+ updateThread(requestParameters, initOverrides) {
194
+ return __awaiter(this, void 0, void 0, function* () {
195
+ const response = yield this.updateThreadRaw(requestParameters, initOverrides);
196
+ return yield response.value();
197
+ });
198
+ }
199
+ }
@@ -8,4 +8,6 @@ export * from './InvitesApi';
8
8
  export * from './PathPartsApi';
9
9
  export * from './SectionsApi';
10
10
  export * from './TenantsApi';
11
+ export * from './ThreadMessagesApi';
12
+ export * from './ThreadsApi';
11
13
  export * from './UsersApi';
@@ -10,4 +10,6 @@ export * from './InvitesApi';
10
10
  export * from './PathPartsApi';
11
11
  export * from './SectionsApi';
12
12
  export * from './TenantsApi';
13
+ export * from './ThreadMessagesApi';
14
+ export * from './ThreadsApi';
13
15
  export * from './UsersApi';
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management
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
+ import type { MessageRole } from './MessageRole';
13
+ /**
14
+ * Request to create a new thread message.
15
+ * @export
16
+ * @interface CreateThreadMessageRequest
17
+ */
18
+ export interface CreateThreadMessageRequest {
19
+ /**
20
+ * Role of the message author (USER, ASSISTANT, SYSTEM)
21
+ * @type {MessageRole}
22
+ * @memberof CreateThreadMessageRequest
23
+ */
24
+ role: MessageRole;
25
+ /**
26
+ * Structured message content (JSONB)
27
+ * @type {object}
28
+ * @memberof CreateThreadMessageRequest
29
+ */
30
+ content: object;
31
+ }
32
+ /**
33
+ * Check if a given object implements the CreateThreadMessageRequest interface.
34
+ */
35
+ export declare function instanceOfCreateThreadMessageRequest(value: object): value is CreateThreadMessageRequest;
36
+ export declare function CreateThreadMessageRequestFromJSON(json: any): CreateThreadMessageRequest;
37
+ export declare function CreateThreadMessageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateThreadMessageRequest;
38
+ export declare function CreateThreadMessageRequestToJSON(json: any): CreateThreadMessageRequest;
39
+ export declare function CreateThreadMessageRequestToJSONTyped(value?: CreateThreadMessageRequest | null, ignoreDiscriminator?: boolean): any;
40
+ export declare const CreateThreadMessageRequestPropertyValidationAttributesMap: {
41
+ [property: string]: {
42
+ maxLength?: number;
43
+ minLength?: number;
44
+ pattern?: string;
45
+ maximum?: number;
46
+ exclusiveMaximum?: boolean;
47
+ minimum?: number;
48
+ exclusiveMinimum?: boolean;
49
+ multipleOf?: number;
50
+ maxItems?: number;
51
+ minItems?: number;
52
+ uniqueItems?: boolean;
53
+ };
54
+ };
55
+ export declare const CreateThreadMessageRequestAdditionalPropertiesValidationAttributes: {
56
+ maxProperties?: number;
57
+ minProperties?: number;
58
+ };
@@ -0,0 +1,50 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management
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
+ import { MessageRoleFromJSON, MessageRoleToJSON, } from './MessageRole';
15
+ /**
16
+ * Check if a given object implements the CreateThreadMessageRequest interface.
17
+ */
18
+ export function instanceOfCreateThreadMessageRequest(value) {
19
+ if (!('role' in value) || value['role'] === undefined)
20
+ return false;
21
+ if (!('content' in value) || value['content'] === undefined)
22
+ return false;
23
+ return true;
24
+ }
25
+ export function CreateThreadMessageRequestFromJSON(json) {
26
+ return CreateThreadMessageRequestFromJSONTyped(json, false);
27
+ }
28
+ export function CreateThreadMessageRequestFromJSONTyped(json, ignoreDiscriminator) {
29
+ if (json == null) {
30
+ return json;
31
+ }
32
+ return {
33
+ 'role': MessageRoleFromJSON(json['role']),
34
+ 'content': json['content'],
35
+ };
36
+ }
37
+ export function CreateThreadMessageRequestToJSON(json) {
38
+ return CreateThreadMessageRequestToJSONTyped(json, false);
39
+ }
40
+ export function CreateThreadMessageRequestToJSONTyped(value, ignoreDiscriminator = false) {
41
+ if (value == null) {
42
+ return value;
43
+ }
44
+ return {
45
+ 'role': MessageRoleToJSON(value['role']),
46
+ 'content': value['content'],
47
+ };
48
+ }
49
+ export const CreateThreadMessageRequestPropertyValidationAttributesMap = {};
50
+ export const CreateThreadMessageRequestAdditionalPropertiesValidationAttributes = {};
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management
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
+ * Request to create a new thread.
14
+ * @export
15
+ * @interface CreateThreadRequest
16
+ */
17
+ export interface CreateThreadRequest {
18
+ /**
19
+ * Parent PathPart ID. When omitted, auto-provisions and uses the user's /users/{user_id}/threads/ folder.
20
+ * @type {string}
21
+ * @memberof CreateThreadRequest
22
+ */
23
+ parentPathPartId?: string;
24
+ /**
25
+ * Thread title
26
+ * @type {string}
27
+ * @memberof CreateThreadRequest
28
+ */
29
+ title?: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the CreateThreadRequest interface.
33
+ */
34
+ export declare function instanceOfCreateThreadRequest(value: object): value is CreateThreadRequest;
35
+ export declare function CreateThreadRequestFromJSON(json: any): CreateThreadRequest;
36
+ export declare function CreateThreadRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateThreadRequest;
37
+ export declare function CreateThreadRequestToJSON(json: any): CreateThreadRequest;
38
+ export declare function CreateThreadRequestToJSONTyped(value?: CreateThreadRequest | null, ignoreDiscriminator?: boolean): any;
39
+ export declare const CreateThreadRequestPropertyValidationAttributesMap: {
40
+ [property: string]: {
41
+ maxLength?: number;
42
+ minLength?: number;
43
+ pattern?: string;
44
+ maximum?: number;
45
+ exclusiveMaximum?: boolean;
46
+ minimum?: number;
47
+ exclusiveMinimum?: boolean;
48
+ multipleOf?: number;
49
+ maxItems?: number;
50
+ minItems?: number;
51
+ uniqueItems?: boolean;
52
+ };
53
+ };
@@ -0,0 +1,49 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management
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
+ * Check if a given object implements the CreateThreadRequest interface.
16
+ */
17
+ export function instanceOfCreateThreadRequest(value) {
18
+ return true;
19
+ }
20
+ export function CreateThreadRequestFromJSON(json) {
21
+ return CreateThreadRequestFromJSONTyped(json, false);
22
+ }
23
+ export function CreateThreadRequestFromJSONTyped(json, ignoreDiscriminator) {
24
+ if (json == null) {
25
+ return json;
26
+ }
27
+ return {
28
+ 'parentPathPartId': json['parent_path_part_id'] == null ? undefined : json['parent_path_part_id'],
29
+ 'title': json['title'] == null ? undefined : json['title'],
30
+ };
31
+ }
32
+ export function CreateThreadRequestToJSON(json) {
33
+ return CreateThreadRequestToJSONTyped(json, false);
34
+ }
35
+ export function CreateThreadRequestToJSONTyped(value, ignoreDiscriminator = false) {
36
+ if (value == null) {
37
+ return value;
38
+ }
39
+ return {
40
+ 'parent_path_part_id': value['parentPathPartId'],
41
+ 'title': value['title'],
42
+ };
43
+ }
44
+ export const CreateThreadRequestPropertyValidationAttributesMap = {
45
+ title: {
46
+ maxLength: 255,
47
+ minLength: 1,
48
+ },
49
+ };
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management
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
+ import type { PartType } from './PartType';
13
+ import type { ChunkMetadataOutput } from './ChunkMetadataOutput';
14
+ import type { ChunkType } from './ChunkType';
15
+ /**
16
+ * Response model for a single item in the document version contents list.
17
+ *
18
+ * Represents a section or chunk with enriched data (content, metadata)
19
+ * returned in depth-first logical order.
20
+ * @export
21
+ * @interface DocumentContentPathPart
22
+ */
23
+ export interface DocumentContentPathPart {
24
+ /**
25
+ * PathPart ID
26
+ * @type {string}
27
+ * @memberof DocumentContentPathPart
28
+ */
29
+ pathPartId: string;
30
+ /**
31
+ * PathPart name
32
+ * @type {string}
33
+ * @memberof DocumentContentPathPart
34
+ */
35
+ name: string;
36
+ /**
37
+ * SECTION or CHUNK
38
+ * @type {PartType}
39
+ * @memberof DocumentContentPathPart
40
+ */
41
+ partType: PartType;
42
+ /**
43
+ * Parent PathPart ID
44
+ * @type {string}
45
+ * @memberof DocumentContentPathPart
46
+ */
47
+ parentId: string;
48
+ /**
49
+ * Section ID or Chunk ID
50
+ * @type {string}
51
+ * @memberof DocumentContentPathPart
52
+ */
53
+ metadataObjId: string;
54
+ /**
55
+ * Depth relative to document version root
56
+ * @type {number}
57
+ * @memberof DocumentContentPathPart
58
+ */
59
+ depth: number;
60
+ /**
61
+ * Chunk content (None for sections)
62
+ * @type {string}
63
+ * @memberof DocumentContentPathPart
64
+ */
65
+ content?: string;
66
+ /**
67
+ * Chunk type (None for sections)
68
+ * @type {ChunkType}
69
+ * @memberof DocumentContentPathPart
70
+ */
71
+ chunkType?: ChunkType;
72
+ /**
73
+ * Chunk metadata (None for sections)
74
+ * @type {ChunkMetadataOutput}
75
+ * @memberof DocumentContentPathPart
76
+ */
77
+ chunkMetadata?: ChunkMetadataOutput;
78
+ /**
79
+ * Section page number (None for chunks)
80
+ * @type {number}
81
+ * @memberof DocumentContentPathPart
82
+ */
83
+ pageNumber?: number;
84
+ /**
85
+ * Creation timestamp
86
+ * @type {Date}
87
+ * @memberof DocumentContentPathPart
88
+ */
89
+ createdAt: Date;
90
+ /**
91
+ * Last update timestamp
92
+ * @type {Date}
93
+ * @memberof DocumentContentPathPart
94
+ */
95
+ updatedAt: Date;
96
+ }
97
+ /**
98
+ * Check if a given object implements the DocumentContentPathPart interface.
99
+ */
100
+ export declare function instanceOfDocumentContentPathPart(value: object): value is DocumentContentPathPart;
101
+ export declare function DocumentContentPathPartFromJSON(json: any): DocumentContentPathPart;
102
+ export declare function DocumentContentPathPartFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentContentPathPart;
103
+ export declare function DocumentContentPathPartToJSON(json: any): DocumentContentPathPart;
104
+ export declare function DocumentContentPathPartToJSONTyped(value?: DocumentContentPathPart | null, ignoreDiscriminator?: boolean): any;
105
+ export declare const DocumentContentPathPartPropertyValidationAttributesMap: {
106
+ [property: string]: {
107
+ maxLength?: number;
108
+ minLength?: number;
109
+ pattern?: string;
110
+ maximum?: number;
111
+ exclusiveMaximum?: boolean;
112
+ minimum?: number;
113
+ exclusiveMinimum?: boolean;
114
+ multipleOf?: number;
115
+ maxItems?: number;
116
+ minItems?: number;
117
+ uniqueItems?: boolean;
118
+ };
119
+ };
@@ -0,0 +1,83 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management
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
+ import { PartTypeFromJSON, PartTypeToJSON, } from './PartType';
15
+ import { ChunkMetadataOutputFromJSON, ChunkMetadataOutputToJSON, } from './ChunkMetadataOutput';
16
+ import { ChunkTypeFromJSON, ChunkTypeToJSON, } from './ChunkType';
17
+ /**
18
+ * Check if a given object implements the DocumentContentPathPart interface.
19
+ */
20
+ export function instanceOfDocumentContentPathPart(value) {
21
+ if (!('pathPartId' in value) || value['pathPartId'] === undefined)
22
+ return false;
23
+ if (!('name' in value) || value['name'] === undefined)
24
+ return false;
25
+ if (!('partType' in value) || value['partType'] === undefined)
26
+ return false;
27
+ if (!('parentId' in value) || value['parentId'] === undefined)
28
+ return false;
29
+ if (!('metadataObjId' in value) || value['metadataObjId'] === undefined)
30
+ return false;
31
+ if (!('depth' in value) || value['depth'] === undefined)
32
+ return false;
33
+ if (!('createdAt' in value) || value['createdAt'] === undefined)
34
+ return false;
35
+ if (!('updatedAt' in value) || value['updatedAt'] === undefined)
36
+ return false;
37
+ return true;
38
+ }
39
+ export function DocumentContentPathPartFromJSON(json) {
40
+ return DocumentContentPathPartFromJSONTyped(json, false);
41
+ }
42
+ export function DocumentContentPathPartFromJSONTyped(json, ignoreDiscriminator) {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+ 'pathPartId': json['path_part_id'],
48
+ 'name': json['name'],
49
+ 'partType': PartTypeFromJSON(json['part_type']),
50
+ 'parentId': json['parent_id'],
51
+ 'metadataObjId': json['metadata_obj_id'],
52
+ 'depth': json['depth'],
53
+ 'content': json['content'] == null ? undefined : json['content'],
54
+ 'chunkType': json['chunk_type'] == null ? undefined : ChunkTypeFromJSON(json['chunk_type']),
55
+ 'chunkMetadata': json['chunk_metadata'] == null ? undefined : ChunkMetadataOutputFromJSON(json['chunk_metadata']),
56
+ 'pageNumber': json['page_number'] == null ? undefined : json['page_number'],
57
+ 'createdAt': (new Date(json['created_at'])),
58
+ 'updatedAt': (new Date(json['updated_at'])),
59
+ };
60
+ }
61
+ export function DocumentContentPathPartToJSON(json) {
62
+ return DocumentContentPathPartToJSONTyped(json, false);
63
+ }
64
+ export function DocumentContentPathPartToJSONTyped(value, ignoreDiscriminator = false) {
65
+ if (value == null) {
66
+ return value;
67
+ }
68
+ return {
69
+ 'path_part_id': value['pathPartId'],
70
+ 'name': value['name'],
71
+ 'part_type': PartTypeToJSON(value['partType']),
72
+ 'parent_id': value['parentId'],
73
+ 'metadata_obj_id': value['metadataObjId'],
74
+ 'depth': value['depth'],
75
+ 'content': value['content'],
76
+ 'chunk_type': ChunkTypeToJSON(value['chunkType']),
77
+ 'chunk_metadata': ChunkMetadataOutputToJSON(value['chunkMetadata']),
78
+ 'page_number': value['pageNumber'],
79
+ 'created_at': value['createdAt'].toISOString(),
80
+ 'updated_at': value['updatedAt'].toISOString(),
81
+ };
82
+ }
83
+ export const DocumentContentPathPartPropertyValidationAttributesMap = {};