@knowledge-stack/ksapi 1.6.0 → 1.7.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 (38) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/README.md +2 -2
  3. package/dist/apis/PathPartsApi.d.ts +30 -1
  4. package/dist/apis/PathPartsApi.js +32 -0
  5. package/dist/apis/SectionsApi.d.ts +144 -0
  6. package/dist/apis/SectionsApi.js +166 -0
  7. package/dist/apis/index.d.ts +1 -0
  8. package/dist/apis/index.js +1 -0
  9. package/dist/esm/apis/PathPartsApi.d.ts +30 -1
  10. package/dist/esm/apis/PathPartsApi.js +33 -1
  11. package/dist/esm/apis/SectionsApi.d.ts +144 -0
  12. package/dist/esm/apis/SectionsApi.js +162 -0
  13. package/dist/esm/apis/index.d.ts +1 -0
  14. package/dist/esm/apis/index.js +1 -0
  15. package/dist/esm/models/CreateSectionRequest.d.ts +65 -0
  16. package/dist/esm/models/CreateSectionRequest.js +57 -0
  17. package/dist/esm/models/SectionResponse.d.ts +101 -0
  18. package/dist/esm/models/SectionResponse.js +74 -0
  19. package/dist/esm/models/UpdateSectionRequest.d.ts +65 -0
  20. package/dist/esm/models/UpdateSectionRequest.js +53 -0
  21. package/dist/esm/models/index.d.ts +3 -0
  22. package/dist/esm/models/index.js +3 -0
  23. package/dist/models/CreateSectionRequest.d.ts +65 -0
  24. package/dist/models/CreateSectionRequest.js +65 -0
  25. package/dist/models/SectionResponse.d.ts +101 -0
  26. package/dist/models/SectionResponse.js +82 -0
  27. package/dist/models/UpdateSectionRequest.d.ts +65 -0
  28. package/dist/models/UpdateSectionRequest.js +61 -0
  29. package/dist/models/index.d.ts +3 -0
  30. package/dist/models/index.js +3 -0
  31. package/package.json +1 -1
  32. package/src/apis/PathPartsApi.ts +64 -0
  33. package/src/apis/SectionsApi.ts +305 -0
  34. package/src/apis/index.ts +1 -0
  35. package/src/models/CreateSectionRequest.ts +112 -0
  36. package/src/models/SectionResponse.ts +161 -0
  37. package/src/models/UpdateSectionRequest.ts +110 -0
  38. package/src/models/index.ts +3 -0
@@ -18,6 +18,7 @@ import type {
18
18
  HTTPValidationError,
19
19
  PaginatedResponsePathPartResponse,
20
20
  PathOrder,
21
+ PathPartResponse,
21
22
  } from '../models/index';
22
23
  import {
23
24
  HTTPValidationErrorFromJSON,
@@ -26,8 +27,15 @@ import {
26
27
  PaginatedResponsePathPartResponseToJSON,
27
28
  PathOrderFromJSON,
28
29
  PathOrderToJSON,
30
+ PathPartResponseFromJSON,
31
+ PathPartResponseToJSON,
29
32
  } from '../models/index';
30
33
 
34
+ export interface GetPathPartRequest {
35
+ pathPartId: string;
36
+ ksUat?: string;
37
+ }
38
+
31
39
  export interface ListPathPartsRequest {
32
40
  parentId?: string;
33
41
  includeDocuments?: boolean;
@@ -45,6 +53,23 @@ export interface ListPathPartsRequest {
45
53
  * @interface PathPartsApiInterface
46
54
  */
47
55
  export interface PathPartsApiInterface {
56
+ /**
57
+ * Get a path part by its ID. Returns the path part if it exists and belongs to the user\'s tenant.
58
+ * @summary Get Path Part Handler
59
+ * @param {string} pathPartId
60
+ * @param {string} [ksUat]
61
+ * @param {*} [options] Override http request option.
62
+ * @throws {RequiredError}
63
+ * @memberof PathPartsApiInterface
64
+ */
65
+ getPathPartRaw(requestParameters: GetPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartResponse>>;
66
+
67
+ /**
68
+ * Get a path part by its ID. Returns the path part if it exists and belongs to the user\'s tenant.
69
+ * Get Path Part Handler
70
+ */
71
+ getPathPart(requestParameters: GetPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartResponse>;
72
+
48
73
  /**
49
74
  * List path parts under a parent with flexible filtering and traversal. This is a generic endpoint for traversing the path hierarchy. It can return folders, documents, or both depending on the filters provided. - If parent_id is not provided, lists contents of the root folder. - If include_documents is True, includes both FOLDER and DOCUMENT types. Documents act as traversal boundaries (their children are not traversed). - max_depth controls how deep to traverse (1 = direct children only). - sort_order controls the ordering: LOGICAL (linked-list), NAME, UPDATED_AT, CREATED_AT.
50
75
  * @summary List Path Parts Handler
@@ -74,6 +99,45 @@ export interface PathPartsApiInterface {
74
99
  */
75
100
  export class PathPartsApi extends runtime.BaseAPI implements PathPartsApiInterface {
76
101
 
102
+ /**
103
+ * Get a path part by its ID. Returns the path part if it exists and belongs to the user\'s tenant.
104
+ * Get Path Part Handler
105
+ */
106
+ async getPathPartRaw(requestParameters: GetPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartResponse>> {
107
+ if (requestParameters['pathPartId'] == null) {
108
+ throw new runtime.RequiredError(
109
+ 'pathPartId',
110
+ 'Required parameter "pathPartId" was null or undefined when calling getPathPart().'
111
+ );
112
+ }
113
+
114
+ const queryParameters: any = {};
115
+
116
+ const headerParameters: runtime.HTTPHeaders = {};
117
+
118
+
119
+ let urlPath = `/v1/path-parts/{path_part_id}`;
120
+ urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
121
+
122
+ const response = await this.request({
123
+ path: urlPath,
124
+ method: 'GET',
125
+ headers: headerParameters,
126
+ query: queryParameters,
127
+ }, initOverrides);
128
+
129
+ return new runtime.JSONApiResponse(response, (jsonValue) => PathPartResponseFromJSON(jsonValue));
130
+ }
131
+
132
+ /**
133
+ * Get a path part by its ID. Returns the path part if it exists and belongs to the user\'s tenant.
134
+ * Get Path Part Handler
135
+ */
136
+ async getPathPart(requestParameters: GetPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartResponse> {
137
+ const response = await this.getPathPartRaw(requestParameters, initOverrides);
138
+ return await response.value();
139
+ }
140
+
77
141
  /**
78
142
  * List path parts under a parent with flexible filtering and traversal. This is a generic endpoint for traversing the path hierarchy. It can return folders, documents, or both depending on the filters provided. - If parent_id is not provided, lists contents of the root folder. - If include_documents is True, includes both FOLDER and DOCUMENT types. Documents act as traversal boundaries (their children are not traversed). - max_depth controls how deep to traverse (1 = direct children only). - sort_order controls the ordering: LOGICAL (linked-list), NAME, UPDATED_AT, CREATED_AT.
79
143
  * List Path Parts Handler
@@ -0,0 +1,305 @@
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
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ CreateSectionRequest,
19
+ HTTPValidationError,
20
+ SectionResponse,
21
+ UpdateSectionRequest,
22
+ } from '../models/index';
23
+ import {
24
+ CreateSectionRequestFromJSON,
25
+ CreateSectionRequestToJSON,
26
+ HTTPValidationErrorFromJSON,
27
+ HTTPValidationErrorToJSON,
28
+ SectionResponseFromJSON,
29
+ SectionResponseToJSON,
30
+ UpdateSectionRequestFromJSON,
31
+ UpdateSectionRequestToJSON,
32
+ } from '../models/index';
33
+
34
+ export interface CreateSectionOperationRequest {
35
+ createSectionRequest: CreateSectionRequest;
36
+ ksUat?: string;
37
+ }
38
+
39
+ export interface DeleteSectionRequest {
40
+ sectionId: string;
41
+ ksUat?: string;
42
+ }
43
+
44
+ export interface GetSectionRequest {
45
+ sectionId: string;
46
+ ksUat?: string;
47
+ }
48
+
49
+ export interface UpdateSectionOperationRequest {
50
+ sectionId: string;
51
+ updateSectionRequest: UpdateSectionRequest;
52
+ ksUat?: string;
53
+ }
54
+
55
+ /**
56
+ * SectionsApi - interface
57
+ *
58
+ * @export
59
+ * @interface SectionsApiInterface
60
+ */
61
+ export interface SectionsApiInterface {
62
+ /**
63
+ * Create a new section. The section is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). If prev_sibling_path_id is provided, the section is inserted after that sibling; otherwise it is appended to the end of the sibling list.
64
+ * @summary Create Section Handler
65
+ * @param {CreateSectionRequest} createSectionRequest
66
+ * @param {string} [ksUat]
67
+ * @param {*} [options] Override http request option.
68
+ * @throws {RequiredError}
69
+ * @memberof SectionsApiInterface
70
+ */
71
+ createSectionRaw(requestParameters: CreateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SectionResponse>>;
72
+
73
+ /**
74
+ * Create a new section. The section is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). If prev_sibling_path_id is provided, the section is inserted after that sibling; otherwise it is appended to the end of the sibling list.
75
+ * Create Section Handler
76
+ */
77
+ createSection(requestParameters: CreateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SectionResponse>;
78
+
79
+ /**
80
+ * Delete a section and all its children. WARNING: This cascades to all child sections due to parent_id ON DELETE CASCADE.
81
+ * @summary Delete Section Handler
82
+ * @param {string} sectionId
83
+ * @param {string} [ksUat]
84
+ * @param {*} [options] Override http request option.
85
+ * @throws {RequiredError}
86
+ * @memberof SectionsApiInterface
87
+ */
88
+ deleteSectionRaw(requestParameters: DeleteSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
89
+
90
+ /**
91
+ * Delete a section and all its children. WARNING: This cascades to all child sections due to parent_id ON DELETE CASCADE.
92
+ * Delete Section Handler
93
+ */
94
+ deleteSection(requestParameters: DeleteSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
95
+
96
+ /**
97
+ * Get a section by its ID.
98
+ * @summary Get Section Handler
99
+ * @param {string} sectionId
100
+ * @param {string} [ksUat]
101
+ * @param {*} [options] Override http request option.
102
+ * @throws {RequiredError}
103
+ * @memberof SectionsApiInterface
104
+ */
105
+ getSectionRaw(requestParameters: GetSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SectionResponse>>;
106
+
107
+ /**
108
+ * Get a section by its ID.
109
+ * Get Section Handler
110
+ */
111
+ getSection(requestParameters: GetSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SectionResponse>;
112
+
113
+ /**
114
+ * Update a section. Can update name, page_number, and/or reorder within siblings. To move: provide prev_sibling_path_id OR move_to_head (not both). Moving is only allowed within the same document version. Note: Section names can contain any characters. The corresponding path_part.name will be automatically normalized by a database trigger.
115
+ * @summary Update Section Handler
116
+ * @param {string} sectionId
117
+ * @param {UpdateSectionRequest} updateSectionRequest
118
+ * @param {string} [ksUat]
119
+ * @param {*} [options] Override http request option.
120
+ * @throws {RequiredError}
121
+ * @memberof SectionsApiInterface
122
+ */
123
+ updateSectionRaw(requestParameters: UpdateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SectionResponse>>;
124
+
125
+ /**
126
+ * Update a section. Can update name, page_number, and/or reorder within siblings. To move: provide prev_sibling_path_id OR move_to_head (not both). Moving is only allowed within the same document version. Note: Section names can contain any characters. The corresponding path_part.name will be automatically normalized by a database trigger.
127
+ * Update Section Handler
128
+ */
129
+ updateSection(requestParameters: UpdateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SectionResponse>;
130
+
131
+ }
132
+
133
+ /**
134
+ *
135
+ */
136
+ export class SectionsApi extends runtime.BaseAPI implements SectionsApiInterface {
137
+
138
+ /**
139
+ * Create a new section. The section is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). If prev_sibling_path_id is provided, the section is inserted after that sibling; otherwise it is appended to the end of the sibling list.
140
+ * Create Section Handler
141
+ */
142
+ async createSectionRaw(requestParameters: CreateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SectionResponse>> {
143
+ if (requestParameters['createSectionRequest'] == null) {
144
+ throw new runtime.RequiredError(
145
+ 'createSectionRequest',
146
+ 'Required parameter "createSectionRequest" was null or undefined when calling createSection().'
147
+ );
148
+ }
149
+
150
+ const queryParameters: any = {};
151
+
152
+ const headerParameters: runtime.HTTPHeaders = {};
153
+
154
+ headerParameters['Content-Type'] = 'application/json';
155
+
156
+
157
+ let urlPath = `/v1/sections`;
158
+
159
+ const response = await this.request({
160
+ path: urlPath,
161
+ method: 'POST',
162
+ headers: headerParameters,
163
+ query: queryParameters,
164
+ body: CreateSectionRequestToJSON(requestParameters['createSectionRequest']),
165
+ }, initOverrides);
166
+
167
+ return new runtime.JSONApiResponse(response, (jsonValue) => SectionResponseFromJSON(jsonValue));
168
+ }
169
+
170
+ /**
171
+ * Create a new section. The section is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). If prev_sibling_path_id is provided, the section is inserted after that sibling; otherwise it is appended to the end of the sibling list.
172
+ * Create Section Handler
173
+ */
174
+ async createSection(requestParameters: CreateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SectionResponse> {
175
+ const response = await this.createSectionRaw(requestParameters, initOverrides);
176
+ return await response.value();
177
+ }
178
+
179
+ /**
180
+ * Delete a section and all its children. WARNING: This cascades to all child sections due to parent_id ON DELETE CASCADE.
181
+ * Delete Section Handler
182
+ */
183
+ async deleteSectionRaw(requestParameters: DeleteSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
184
+ if (requestParameters['sectionId'] == null) {
185
+ throw new runtime.RequiredError(
186
+ 'sectionId',
187
+ 'Required parameter "sectionId" was null or undefined when calling deleteSection().'
188
+ );
189
+ }
190
+
191
+ const queryParameters: any = {};
192
+
193
+ const headerParameters: runtime.HTTPHeaders = {};
194
+
195
+
196
+ let urlPath = `/v1/sections/{section_id}`;
197
+ urlPath = urlPath.replace(`{${"section_id"}}`, encodeURIComponent(String(requestParameters['sectionId'])));
198
+
199
+ const response = await this.request({
200
+ path: urlPath,
201
+ method: 'DELETE',
202
+ headers: headerParameters,
203
+ query: queryParameters,
204
+ }, initOverrides);
205
+
206
+ return new runtime.VoidApiResponse(response);
207
+ }
208
+
209
+ /**
210
+ * Delete a section and all its children. WARNING: This cascades to all child sections due to parent_id ON DELETE CASCADE.
211
+ * Delete Section Handler
212
+ */
213
+ async deleteSection(requestParameters: DeleteSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
214
+ await this.deleteSectionRaw(requestParameters, initOverrides);
215
+ }
216
+
217
+ /**
218
+ * Get a section by its ID.
219
+ * Get Section Handler
220
+ */
221
+ async getSectionRaw(requestParameters: GetSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SectionResponse>> {
222
+ if (requestParameters['sectionId'] == null) {
223
+ throw new runtime.RequiredError(
224
+ 'sectionId',
225
+ 'Required parameter "sectionId" was null or undefined when calling getSection().'
226
+ );
227
+ }
228
+
229
+ const queryParameters: any = {};
230
+
231
+ const headerParameters: runtime.HTTPHeaders = {};
232
+
233
+
234
+ let urlPath = `/v1/sections/{section_id}`;
235
+ urlPath = urlPath.replace(`{${"section_id"}}`, encodeURIComponent(String(requestParameters['sectionId'])));
236
+
237
+ const response = await this.request({
238
+ path: urlPath,
239
+ method: 'GET',
240
+ headers: headerParameters,
241
+ query: queryParameters,
242
+ }, initOverrides);
243
+
244
+ return new runtime.JSONApiResponse(response, (jsonValue) => SectionResponseFromJSON(jsonValue));
245
+ }
246
+
247
+ /**
248
+ * Get a section by its ID.
249
+ * Get Section Handler
250
+ */
251
+ async getSection(requestParameters: GetSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SectionResponse> {
252
+ const response = await this.getSectionRaw(requestParameters, initOverrides);
253
+ return await response.value();
254
+ }
255
+
256
+ /**
257
+ * Update a section. Can update name, page_number, and/or reorder within siblings. To move: provide prev_sibling_path_id OR move_to_head (not both). Moving is only allowed within the same document version. Note: Section names can contain any characters. The corresponding path_part.name will be automatically normalized by a database trigger.
258
+ * Update Section Handler
259
+ */
260
+ async updateSectionRaw(requestParameters: UpdateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SectionResponse>> {
261
+ if (requestParameters['sectionId'] == null) {
262
+ throw new runtime.RequiredError(
263
+ 'sectionId',
264
+ 'Required parameter "sectionId" was null or undefined when calling updateSection().'
265
+ );
266
+ }
267
+
268
+ if (requestParameters['updateSectionRequest'] == null) {
269
+ throw new runtime.RequiredError(
270
+ 'updateSectionRequest',
271
+ 'Required parameter "updateSectionRequest" was null or undefined when calling updateSection().'
272
+ );
273
+ }
274
+
275
+ const queryParameters: any = {};
276
+
277
+ const headerParameters: runtime.HTTPHeaders = {};
278
+
279
+ headerParameters['Content-Type'] = 'application/json';
280
+
281
+
282
+ let urlPath = `/v1/sections/{section_id}`;
283
+ urlPath = urlPath.replace(`{${"section_id"}}`, encodeURIComponent(String(requestParameters['sectionId'])));
284
+
285
+ const response = await this.request({
286
+ path: urlPath,
287
+ method: 'PATCH',
288
+ headers: headerParameters,
289
+ query: queryParameters,
290
+ body: UpdateSectionRequestToJSON(requestParameters['updateSectionRequest']),
291
+ }, initOverrides);
292
+
293
+ return new runtime.JSONApiResponse(response, (jsonValue) => SectionResponseFromJSON(jsonValue));
294
+ }
295
+
296
+ /**
297
+ * Update a section. Can update name, page_number, and/or reorder within siblings. To move: provide prev_sibling_path_id OR move_to_head (not both). Moving is only allowed within the same document version. Note: Section names can contain any characters. The corresponding path_part.name will be automatically normalized by a database trigger.
298
+ * Update Section Handler
299
+ */
300
+ async updateSection(requestParameters: UpdateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SectionResponse> {
301
+ const response = await this.updateSectionRaw(requestParameters, initOverrides);
302
+ return await response.value();
303
+ }
304
+
305
+ }
package/src/apis/index.ts CHANGED
@@ -7,5 +7,6 @@ export * from './DocumentsApi';
7
7
  export * from './FoldersApi';
8
8
  export * from './InvitesApi';
9
9
  export * from './PathPartsApi';
10
+ export * from './SectionsApi';
10
11
  export * from './TenantsApi';
11
12
  export * from './UsersApi';
@@ -0,0 +1,112 @@
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
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * Request to create a new section.
18
+ * @export
19
+ * @interface CreateSectionRequest
20
+ */
21
+ export interface CreateSectionRequest {
22
+ /**
23
+ * Section name (can contain any characters)
24
+ * @type {string}
25
+ * @memberof CreateSectionRequest
26
+ */
27
+ name: string;
28
+ /**
29
+ * Parent PathPart ID (must be DOCUMENT_VERSION or SECTION)
30
+ * @type {string}
31
+ * @memberof CreateSectionRequest
32
+ */
33
+ parentPathId: string;
34
+ /**
35
+ * Page number in source document (must be > 0)
36
+ * @type {number}
37
+ * @memberof CreateSectionRequest
38
+ */
39
+ pageNumber?: number;
40
+ /**
41
+ * PathPart ID to insert after (null = append to tail)
42
+ * @type {string}
43
+ * @memberof CreateSectionRequest
44
+ */
45
+ prevSiblingPathId?: string;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the CreateSectionRequest interface.
50
+ */
51
+ export function instanceOfCreateSectionRequest(value: object): value is CreateSectionRequest {
52
+ if (!('name' in value) || value['name'] === undefined) return false;
53
+ if (!('parentPathId' in value) || value['parentPathId'] === undefined) return false;
54
+ return true;
55
+ }
56
+
57
+ export function CreateSectionRequestFromJSON(json: any): CreateSectionRequest {
58
+ return CreateSectionRequestFromJSONTyped(json, false);
59
+ }
60
+
61
+ export function CreateSectionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateSectionRequest {
62
+ if (json == null) {
63
+ return json;
64
+ }
65
+ return {
66
+
67
+ 'name': json['name'],
68
+ 'parentPathId': json['parent_path_id'],
69
+ 'pageNumber': json['page_number'] == null ? undefined : json['page_number'],
70
+ 'prevSiblingPathId': json['prev_sibling_path_id'] == null ? undefined : json['prev_sibling_path_id'],
71
+ };
72
+ }
73
+
74
+ export function CreateSectionRequestToJSON(json: any): CreateSectionRequest {
75
+ return CreateSectionRequestToJSONTyped(json, false);
76
+ }
77
+
78
+ export function CreateSectionRequestToJSONTyped(value?: CreateSectionRequest | null, ignoreDiscriminator: boolean = false): any {
79
+ if (value == null) {
80
+ return value;
81
+ }
82
+
83
+ return {
84
+
85
+ 'name': value['name'],
86
+ 'parent_path_id': value['parentPathId'],
87
+ 'page_number': value['pageNumber'],
88
+ 'prev_sibling_path_id': value['prevSiblingPathId'],
89
+ };
90
+ }
91
+
92
+ export const CreateSectionRequestPropertyValidationAttributesMap: {
93
+ [property: string]: {
94
+ maxLength?: number,
95
+ minLength?: number,
96
+ pattern?: string,
97
+ maximum?: number,
98
+ exclusiveMaximum?: boolean,
99
+ minimum?: number,
100
+ exclusiveMinimum?: boolean,
101
+ multipleOf?: number,
102
+ maxItems?: number,
103
+ minItems?: number,
104
+ uniqueItems?: boolean
105
+ }
106
+ } = {
107
+ name: {
108
+ maxLength: 255,
109
+ minLength: 1,
110
+ },
111
+ }
112
+
@@ -0,0 +1,161 @@
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
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * Section response model.
18
+ * @export
19
+ * @interface SectionResponse
20
+ */
21
+ export interface SectionResponse {
22
+ /**
23
+ * Section ID
24
+ * @type {string}
25
+ * @memberof SectionResponse
26
+ */
27
+ id: string;
28
+ /**
29
+ * PathPart ID
30
+ * @type {string}
31
+ * @memberof SectionResponse
32
+ */
33
+ pathPartId: string;
34
+ /**
35
+ * Section name
36
+ * @type {string}
37
+ * @memberof SectionResponse
38
+ */
39
+ name: string;
40
+ /**
41
+ * Page number in source document
42
+ * @type {number}
43
+ * @memberof SectionResponse
44
+ */
45
+ pageNumber?: number;
46
+ /**
47
+ * Parent PathPart ID
48
+ * @type {string}
49
+ * @memberof SectionResponse
50
+ */
51
+ parentId: string;
52
+ /**
53
+ * Previous sibling PathPart ID
54
+ * @type {string}
55
+ * @memberof SectionResponse
56
+ */
57
+ prevSiblingPathId?: string;
58
+ /**
59
+ * Next sibling PathPart ID
60
+ * @type {string}
61
+ * @memberof SectionResponse
62
+ */
63
+ nextSiblingId?: string;
64
+ /**
65
+ * Tenant ID
66
+ * @type {string}
67
+ * @memberof SectionResponse
68
+ */
69
+ tenantId: string;
70
+ /**
71
+ * Creation timestamp
72
+ * @type {Date}
73
+ * @memberof SectionResponse
74
+ */
75
+ createdAt: Date;
76
+ /**
77
+ * Last update timestamp
78
+ * @type {Date}
79
+ * @memberof SectionResponse
80
+ */
81
+ updatedAt: Date;
82
+ }
83
+
84
+ /**
85
+ * Check if a given object implements the SectionResponse interface.
86
+ */
87
+ export function instanceOfSectionResponse(value: object): value is SectionResponse {
88
+ if (!('id' in value) || value['id'] === undefined) return false;
89
+ if (!('pathPartId' in value) || value['pathPartId'] === undefined) return false;
90
+ if (!('name' in value) || value['name'] === undefined) return false;
91
+ if (!('parentId' in value) || value['parentId'] === undefined) return false;
92
+ if (!('tenantId' in value) || value['tenantId'] === undefined) return false;
93
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
94
+ if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
95
+ return true;
96
+ }
97
+
98
+ export function SectionResponseFromJSON(json: any): SectionResponse {
99
+ return SectionResponseFromJSONTyped(json, false);
100
+ }
101
+
102
+ export function SectionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SectionResponse {
103
+ if (json == null) {
104
+ return json;
105
+ }
106
+ return {
107
+
108
+ 'id': json['id'],
109
+ 'pathPartId': json['path_part_id'],
110
+ 'name': json['name'],
111
+ 'pageNumber': json['page_number'] == null ? undefined : json['page_number'],
112
+ 'parentId': json['parent_id'],
113
+ 'prevSiblingPathId': json['prev_sibling_path_id'] == null ? undefined : json['prev_sibling_path_id'],
114
+ 'nextSiblingId': json['next_sibling_id'] == null ? undefined : json['next_sibling_id'],
115
+ 'tenantId': json['tenant_id'],
116
+ 'createdAt': (new Date(json['created_at'])),
117
+ 'updatedAt': (new Date(json['updated_at'])),
118
+ };
119
+ }
120
+
121
+ export function SectionResponseToJSON(json: any): SectionResponse {
122
+ return SectionResponseToJSONTyped(json, false);
123
+ }
124
+
125
+ export function SectionResponseToJSONTyped(value?: SectionResponse | null, ignoreDiscriminator: boolean = false): any {
126
+ if (value == null) {
127
+ return value;
128
+ }
129
+
130
+ return {
131
+
132
+ 'id': value['id'],
133
+ 'path_part_id': value['pathPartId'],
134
+ 'name': value['name'],
135
+ 'page_number': value['pageNumber'],
136
+ 'parent_id': value['parentId'],
137
+ 'prev_sibling_path_id': value['prevSiblingPathId'],
138
+ 'next_sibling_id': value['nextSiblingId'],
139
+ 'tenant_id': value['tenantId'],
140
+ 'created_at': value['createdAt'].toISOString(),
141
+ 'updated_at': value['updatedAt'].toISOString(),
142
+ };
143
+ }
144
+
145
+ export const SectionResponsePropertyValidationAttributesMap: {
146
+ [property: string]: {
147
+ maxLength?: number,
148
+ minLength?: number,
149
+ pattern?: string,
150
+ maximum?: number,
151
+ exclusiveMaximum?: boolean,
152
+ minimum?: number,
153
+ exclusiveMinimum?: boolean,
154
+ multipleOf?: number,
155
+ maxItems?: number,
156
+ minItems?: number,
157
+ uniqueItems?: boolean
158
+ }
159
+ } = {
160
+ }
161
+