@knowledge-stack/ksapi 1.7.0 → 1.9.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 +14 -0
- package/README.md +2 -2
- package/dist/apis/ChunksApi.d.ts +175 -0
- package/dist/apis/ChunksApi.js +203 -0
- package/dist/apis/DocumentVersionsApi.d.ts +36 -1
- package/dist/apis/DocumentVersionsApi.js +41 -0
- package/dist/apis/FoldersApi.d.ts +38 -1
- package/dist/apis/FoldersApi.js +44 -0
- package/dist/apis/PathPartsApi.d.ts +4 -6
- package/dist/apis/PathPartsApi.js +2 -5
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/ChunksApi.d.ts +175 -0
- package/dist/esm/apis/ChunksApi.js +199 -0
- package/dist/esm/apis/DocumentVersionsApi.d.ts +36 -1
- package/dist/esm/apis/DocumentVersionsApi.js +42 -1
- package/dist/esm/apis/FoldersApi.d.ts +38 -1
- package/dist/esm/apis/FoldersApi.js +45 -1
- package/dist/esm/apis/PathPartsApi.d.ts +4 -6
- package/dist/esm/apis/PathPartsApi.js +2 -5
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/ChunkMetadataInput.d.ts +48 -0
- package/dist/esm/models/ChunkMetadataInput.js +43 -0
- package/dist/esm/models/ChunkMetadataOutput.d.ts +48 -0
- package/dist/esm/models/ChunkMetadataOutput.js +43 -0
- package/dist/esm/models/ChunkResponse.d.ts +115 -0
- package/dist/esm/models/ChunkResponse.js +86 -0
- package/dist/esm/models/ChunkType.d.ts +27 -0
- package/dist/esm/models/ChunkType.js +45 -0
- package/dist/esm/models/CreateChunkRequest.d.ts +73 -0
- package/dist/esm/models/CreateChunkRequest.js +64 -0
- package/dist/esm/models/DocumentContentPathPart.d.ts +119 -0
- package/dist/esm/models/DocumentContentPathPart.js +83 -0
- package/dist/esm/models/FolderDocumentResponse.d.ts +138 -0
- package/dist/esm/models/FolderDocumentResponse.js +88 -0
- package/dist/esm/models/PaginatedResponseDocumentContentPathPart.d.ts +66 -0
- package/dist/esm/models/PaginatedResponseDocumentContentPathPart.js +70 -0
- package/dist/esm/models/PaginatedResponseFolderDocumentResponse.d.ts +66 -0
- package/dist/esm/models/PaginatedResponseFolderDocumentResponse.js +70 -0
- package/dist/esm/models/PasswordResetWithTokenRequest.d.ts +2 -8
- package/dist/esm/models/PasswordResetWithTokenRequest.js +3 -7
- package/dist/esm/models/Polygon.d.ts +65 -0
- package/dist/esm/models/Polygon.js +56 -0
- package/dist/esm/models/PolygonReference.d.ts +54 -0
- package/dist/esm/models/PolygonReference.js +49 -0
- package/dist/esm/models/UpdateChunkContentRequest.d.ts +54 -0
- package/dist/esm/models/UpdateChunkContentRequest.js +51 -0
- package/dist/esm/models/UpdateChunkMetadataRequest.d.ts +48 -0
- package/dist/esm/models/UpdateChunkMetadataRequest.js +45 -0
- package/dist/esm/models/index.d.ts +13 -0
- package/dist/esm/models/index.js +13 -0
- package/dist/models/ChunkMetadataInput.d.ts +48 -0
- package/dist/models/ChunkMetadataInput.js +51 -0
- package/dist/models/ChunkMetadataOutput.d.ts +48 -0
- package/dist/models/ChunkMetadataOutput.js +51 -0
- package/dist/models/ChunkResponse.d.ts +115 -0
- package/dist/models/ChunkResponse.js +94 -0
- package/dist/models/ChunkType.d.ts +27 -0
- package/dist/models/ChunkType.js +53 -0
- package/dist/models/CreateChunkRequest.d.ts +73 -0
- package/dist/models/CreateChunkRequest.js +72 -0
- package/dist/models/DocumentContentPathPart.d.ts +119 -0
- package/dist/models/DocumentContentPathPart.js +91 -0
- package/dist/models/FolderDocumentResponse.d.ts +138 -0
- package/dist/models/FolderDocumentResponse.js +96 -0
- package/dist/models/PaginatedResponseDocumentContentPathPart.d.ts +66 -0
- package/dist/models/PaginatedResponseDocumentContentPathPart.js +78 -0
- package/dist/models/PaginatedResponseFolderDocumentResponse.d.ts +66 -0
- package/dist/models/PaginatedResponseFolderDocumentResponse.js +78 -0
- package/dist/models/PasswordResetWithTokenRequest.d.ts +2 -8
- package/dist/models/PasswordResetWithTokenRequest.js +3 -7
- package/dist/models/Polygon.d.ts +65 -0
- package/dist/models/Polygon.js +64 -0
- package/dist/models/PolygonReference.d.ts +54 -0
- package/dist/models/PolygonReference.js +57 -0
- package/dist/models/UpdateChunkContentRequest.d.ts +54 -0
- package/dist/models/UpdateChunkContentRequest.js +59 -0
- package/dist/models/UpdateChunkMetadataRequest.d.ts +48 -0
- package/dist/models/UpdateChunkMetadataRequest.js +53 -0
- package/dist/models/index.d.ts +13 -0
- package/dist/models/index.js +13 -0
- package/package.json +1 -1
- package/src/apis/ChunksApi.ts +381 -0
- package/src/apis/DocumentVersionsApi.ts +82 -0
- package/src/apis/FoldersApi.ts +88 -0
- package/src/apis/PathPartsApi.ts +4 -10
- package/src/apis/index.ts +1 -0
- package/src/models/ChunkMetadataInput.ts +90 -0
- package/src/models/ChunkMetadataOutput.ts +90 -0
- package/src/models/ChunkResponse.ts +197 -0
- package/src/models/ChunkType.ts +55 -0
- package/src/models/CreateChunkRequest.ts +138 -0
- package/src/models/DocumentContentPathPart.ts +205 -0
- package/src/models/FolderDocumentResponse.ts +234 -0
- package/src/models/PaginatedResponseDocumentContentPathPart.ts +130 -0
- package/src/models/PaginatedResponseFolderDocumentResponse.ts +130 -0
- package/src/models/PasswordResetWithTokenRequest.ts +5 -14
- package/src/models/Polygon.ts +110 -0
- package/src/models/PolygonReference.ts +100 -0
- package/src/models/UpdateChunkContentRequest.ts +104 -0
- package/src/models/UpdateChunkMetadataRequest.ts +91 -0
- package/src/models/index.ts +13 -0
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* Type of chunk content.
|
|
18
|
+
* @export
|
|
19
|
+
*/
|
|
20
|
+
export const ChunkType = {
|
|
21
|
+
Text: 'TEXT',
|
|
22
|
+
Table: 'TABLE',
|
|
23
|
+
Image: 'IMAGE',
|
|
24
|
+
Unknown: 'UNKNOWN'
|
|
25
|
+
} as const;
|
|
26
|
+
export type ChunkType = typeof ChunkType[keyof typeof ChunkType];
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
export function instanceOfChunkType(value: any): boolean {
|
|
30
|
+
for (const key in ChunkType) {
|
|
31
|
+
if (Object.prototype.hasOwnProperty.call(ChunkType, key)) {
|
|
32
|
+
if (ChunkType[key as keyof typeof ChunkType] === value) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function ChunkTypeFromJSON(json: any): ChunkType {
|
|
41
|
+
return ChunkTypeFromJSONTyped(json, false);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function ChunkTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkType {
|
|
45
|
+
return json as ChunkType;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function ChunkTypeToJSON(value?: ChunkType | null): any {
|
|
49
|
+
return value as any;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function ChunkTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): ChunkType {
|
|
53
|
+
return value as ChunkType;
|
|
54
|
+
}
|
|
55
|
+
|
|
@@ -0,0 +1,138 @@
|
|
|
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
|
+
import type { ChunkMetadataInput } from './ChunkMetadataInput';
|
|
17
|
+
import {
|
|
18
|
+
ChunkMetadataInputFromJSON,
|
|
19
|
+
ChunkMetadataInputFromJSONTyped,
|
|
20
|
+
ChunkMetadataInputToJSON,
|
|
21
|
+
ChunkMetadataInputToJSONTyped,
|
|
22
|
+
} from './ChunkMetadataInput';
|
|
23
|
+
import type { ChunkType } from './ChunkType';
|
|
24
|
+
import {
|
|
25
|
+
ChunkTypeFromJSON,
|
|
26
|
+
ChunkTypeFromJSONTyped,
|
|
27
|
+
ChunkTypeToJSON,
|
|
28
|
+
ChunkTypeToJSONTyped,
|
|
29
|
+
} from './ChunkType';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Request to create a new chunk.
|
|
33
|
+
* @export
|
|
34
|
+
* @interface CreateChunkRequest
|
|
35
|
+
*/
|
|
36
|
+
export interface CreateChunkRequest {
|
|
37
|
+
/**
|
|
38
|
+
* Parent PathPart ID (must be DOCUMENT_VERSION or SECTION)
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @memberof CreateChunkRequest
|
|
41
|
+
*/
|
|
42
|
+
parentPathId: string;
|
|
43
|
+
/**
|
|
44
|
+
* Chunk text content
|
|
45
|
+
* @type {string}
|
|
46
|
+
* @memberof CreateChunkRequest
|
|
47
|
+
*/
|
|
48
|
+
content: string;
|
|
49
|
+
/**
|
|
50
|
+
* Type of chunk content (TEXT, TABLE, IMAGE, UNKNOWN)
|
|
51
|
+
* @type {ChunkType}
|
|
52
|
+
* @memberof CreateChunkRequest
|
|
53
|
+
*/
|
|
54
|
+
chunkType: ChunkType;
|
|
55
|
+
/**
|
|
56
|
+
* Chunk metadata as JSON (title, description, etc.)
|
|
57
|
+
* @type {ChunkMetadataInput}
|
|
58
|
+
* @memberof CreateChunkRequest
|
|
59
|
+
*/
|
|
60
|
+
chunkMetadata: ChunkMetadataInput;
|
|
61
|
+
/**
|
|
62
|
+
* PathPart ID to insert after (null = append to tail)
|
|
63
|
+
* @type {string}
|
|
64
|
+
* @memberof CreateChunkRequest
|
|
65
|
+
*/
|
|
66
|
+
prevSiblingPathId?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Check if a given object implements the CreateChunkRequest interface.
|
|
73
|
+
*/
|
|
74
|
+
export function instanceOfCreateChunkRequest(value: object): value is CreateChunkRequest {
|
|
75
|
+
if (!('parentPathId' in value) || value['parentPathId'] === undefined) return false;
|
|
76
|
+
if (!('content' in value) || value['content'] === undefined) return false;
|
|
77
|
+
if (!('chunkType' in value) || value['chunkType'] === undefined) return false;
|
|
78
|
+
if (!('chunkMetadata' in value) || value['chunkMetadata'] === undefined) return false;
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function CreateChunkRequestFromJSON(json: any): CreateChunkRequest {
|
|
83
|
+
return CreateChunkRequestFromJSONTyped(json, false);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function CreateChunkRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateChunkRequest {
|
|
87
|
+
if (json == null) {
|
|
88
|
+
return json;
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
|
|
92
|
+
'parentPathId': json['parent_path_id'],
|
|
93
|
+
'content': json['content'],
|
|
94
|
+
'chunkType': ChunkTypeFromJSON(json['chunk_type']),
|
|
95
|
+
'chunkMetadata': ChunkMetadataInputFromJSON(json['chunk_metadata']),
|
|
96
|
+
'prevSiblingPathId': json['prev_sibling_path_id'] == null ? undefined : json['prev_sibling_path_id'],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function CreateChunkRequestToJSON(json: any): CreateChunkRequest {
|
|
101
|
+
return CreateChunkRequestToJSONTyped(json, false);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function CreateChunkRequestToJSONTyped(value?: CreateChunkRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
105
|
+
if (value == null) {
|
|
106
|
+
return value;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
|
|
111
|
+
'parent_path_id': value['parentPathId'],
|
|
112
|
+
'content': value['content'],
|
|
113
|
+
'chunk_type': ChunkTypeToJSON(value['chunkType']),
|
|
114
|
+
'chunk_metadata': ChunkMetadataInputToJSON(value['chunkMetadata']),
|
|
115
|
+
'prev_sibling_path_id': value['prevSiblingPathId'],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const CreateChunkRequestPropertyValidationAttributesMap: {
|
|
120
|
+
[property: string]: {
|
|
121
|
+
maxLength?: number,
|
|
122
|
+
minLength?: number,
|
|
123
|
+
pattern?: string,
|
|
124
|
+
maximum?: number,
|
|
125
|
+
exclusiveMaximum?: boolean,
|
|
126
|
+
minimum?: number,
|
|
127
|
+
exclusiveMinimum?: boolean,
|
|
128
|
+
multipleOf?: number,
|
|
129
|
+
maxItems?: number,
|
|
130
|
+
minItems?: number,
|
|
131
|
+
uniqueItems?: boolean
|
|
132
|
+
}
|
|
133
|
+
} = {
|
|
134
|
+
content: {
|
|
135
|
+
minLength: 1,
|
|
136
|
+
},
|
|
137
|
+
}
|
|
138
|
+
|
|
@@ -0,0 +1,205 @@
|
|
|
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
|
+
import type { PartType } from './PartType';
|
|
17
|
+
import {
|
|
18
|
+
PartTypeFromJSON,
|
|
19
|
+
PartTypeFromJSONTyped,
|
|
20
|
+
PartTypeToJSON,
|
|
21
|
+
PartTypeToJSONTyped,
|
|
22
|
+
} from './PartType';
|
|
23
|
+
import type { ChunkMetadataOutput } from './ChunkMetadataOutput';
|
|
24
|
+
import {
|
|
25
|
+
ChunkMetadataOutputFromJSON,
|
|
26
|
+
ChunkMetadataOutputFromJSONTyped,
|
|
27
|
+
ChunkMetadataOutputToJSON,
|
|
28
|
+
ChunkMetadataOutputToJSONTyped,
|
|
29
|
+
} from './ChunkMetadataOutput';
|
|
30
|
+
import type { ChunkType } from './ChunkType';
|
|
31
|
+
import {
|
|
32
|
+
ChunkTypeFromJSON,
|
|
33
|
+
ChunkTypeFromJSONTyped,
|
|
34
|
+
ChunkTypeToJSON,
|
|
35
|
+
ChunkTypeToJSONTyped,
|
|
36
|
+
} from './ChunkType';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Response model for a single item in the document version contents list.
|
|
40
|
+
*
|
|
41
|
+
* Represents a section or chunk with enriched data (content, metadata)
|
|
42
|
+
* returned in depth-first logical order.
|
|
43
|
+
* @export
|
|
44
|
+
* @interface DocumentContentPathPart
|
|
45
|
+
*/
|
|
46
|
+
export interface DocumentContentPathPart {
|
|
47
|
+
/**
|
|
48
|
+
* PathPart ID
|
|
49
|
+
* @type {string}
|
|
50
|
+
* @memberof DocumentContentPathPart
|
|
51
|
+
*/
|
|
52
|
+
pathPartId: string;
|
|
53
|
+
/**
|
|
54
|
+
* PathPart name
|
|
55
|
+
* @type {string}
|
|
56
|
+
* @memberof DocumentContentPathPart
|
|
57
|
+
*/
|
|
58
|
+
name: string;
|
|
59
|
+
/**
|
|
60
|
+
* SECTION or CHUNK
|
|
61
|
+
* @type {PartType}
|
|
62
|
+
* @memberof DocumentContentPathPart
|
|
63
|
+
*/
|
|
64
|
+
partType: PartType;
|
|
65
|
+
/**
|
|
66
|
+
* Parent PathPart ID
|
|
67
|
+
* @type {string}
|
|
68
|
+
* @memberof DocumentContentPathPart
|
|
69
|
+
*/
|
|
70
|
+
parentId: string;
|
|
71
|
+
/**
|
|
72
|
+
* Section ID or Chunk ID
|
|
73
|
+
* @type {string}
|
|
74
|
+
* @memberof DocumentContentPathPart
|
|
75
|
+
*/
|
|
76
|
+
metadataObjId: string;
|
|
77
|
+
/**
|
|
78
|
+
* Depth relative to document version root
|
|
79
|
+
* @type {number}
|
|
80
|
+
* @memberof DocumentContentPathPart
|
|
81
|
+
*/
|
|
82
|
+
depth: number;
|
|
83
|
+
/**
|
|
84
|
+
* Chunk content (None for sections)
|
|
85
|
+
* @type {string}
|
|
86
|
+
* @memberof DocumentContentPathPart
|
|
87
|
+
*/
|
|
88
|
+
content?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Chunk type (None for sections)
|
|
91
|
+
* @type {ChunkType}
|
|
92
|
+
* @memberof DocumentContentPathPart
|
|
93
|
+
*/
|
|
94
|
+
chunkType?: ChunkType;
|
|
95
|
+
/**
|
|
96
|
+
* Chunk metadata (None for sections)
|
|
97
|
+
* @type {ChunkMetadataOutput}
|
|
98
|
+
* @memberof DocumentContentPathPart
|
|
99
|
+
*/
|
|
100
|
+
chunkMetadata?: ChunkMetadataOutput;
|
|
101
|
+
/**
|
|
102
|
+
* Section page number (None for chunks)
|
|
103
|
+
* @type {number}
|
|
104
|
+
* @memberof DocumentContentPathPart
|
|
105
|
+
*/
|
|
106
|
+
pageNumber?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Creation timestamp
|
|
109
|
+
* @type {Date}
|
|
110
|
+
* @memberof DocumentContentPathPart
|
|
111
|
+
*/
|
|
112
|
+
createdAt: Date;
|
|
113
|
+
/**
|
|
114
|
+
* Last update timestamp
|
|
115
|
+
* @type {Date}
|
|
116
|
+
* @memberof DocumentContentPathPart
|
|
117
|
+
*/
|
|
118
|
+
updatedAt: Date;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Check if a given object implements the DocumentContentPathPart interface.
|
|
125
|
+
*/
|
|
126
|
+
export function instanceOfDocumentContentPathPart(value: object): value is DocumentContentPathPart {
|
|
127
|
+
if (!('pathPartId' in value) || value['pathPartId'] === undefined) return false;
|
|
128
|
+
if (!('name' in value) || value['name'] === undefined) return false;
|
|
129
|
+
if (!('partType' in value) || value['partType'] === undefined) return false;
|
|
130
|
+
if (!('parentId' in value) || value['parentId'] === undefined) return false;
|
|
131
|
+
if (!('metadataObjId' in value) || value['metadataObjId'] === undefined) return false;
|
|
132
|
+
if (!('depth' in value) || value['depth'] === undefined) return false;
|
|
133
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
134
|
+
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function DocumentContentPathPartFromJSON(json: any): DocumentContentPathPart {
|
|
139
|
+
return DocumentContentPathPartFromJSONTyped(json, false);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function DocumentContentPathPartFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentContentPathPart {
|
|
143
|
+
if (json == null) {
|
|
144
|
+
return json;
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
|
|
148
|
+
'pathPartId': json['path_part_id'],
|
|
149
|
+
'name': json['name'],
|
|
150
|
+
'partType': PartTypeFromJSON(json['part_type']),
|
|
151
|
+
'parentId': json['parent_id'],
|
|
152
|
+
'metadataObjId': json['metadata_obj_id'],
|
|
153
|
+
'depth': json['depth'],
|
|
154
|
+
'content': json['content'] == null ? undefined : json['content'],
|
|
155
|
+
'chunkType': json['chunk_type'] == null ? undefined : ChunkTypeFromJSON(json['chunk_type']),
|
|
156
|
+
'chunkMetadata': json['chunk_metadata'] == null ? undefined : ChunkMetadataOutputFromJSON(json['chunk_metadata']),
|
|
157
|
+
'pageNumber': json['page_number'] == null ? undefined : json['page_number'],
|
|
158
|
+
'createdAt': (new Date(json['created_at'])),
|
|
159
|
+
'updatedAt': (new Date(json['updated_at'])),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export function DocumentContentPathPartToJSON(json: any): DocumentContentPathPart {
|
|
164
|
+
return DocumentContentPathPartToJSONTyped(json, false);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function DocumentContentPathPartToJSONTyped(value?: DocumentContentPathPart | null, ignoreDiscriminator: boolean = false): any {
|
|
168
|
+
if (value == null) {
|
|
169
|
+
return value;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return {
|
|
173
|
+
|
|
174
|
+
'path_part_id': value['pathPartId'],
|
|
175
|
+
'name': value['name'],
|
|
176
|
+
'part_type': PartTypeToJSON(value['partType']),
|
|
177
|
+
'parent_id': value['parentId'],
|
|
178
|
+
'metadata_obj_id': value['metadataObjId'],
|
|
179
|
+
'depth': value['depth'],
|
|
180
|
+
'content': value['content'],
|
|
181
|
+
'chunk_type': ChunkTypeToJSON(value['chunkType']),
|
|
182
|
+
'chunk_metadata': ChunkMetadataOutputToJSON(value['chunkMetadata']),
|
|
183
|
+
'page_number': value['pageNumber'],
|
|
184
|
+
'created_at': value['createdAt'].toISOString(),
|
|
185
|
+
'updated_at': value['updatedAt'].toISOString(),
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export const DocumentContentPathPartPropertyValidationAttributesMap: {
|
|
190
|
+
[property: string]: {
|
|
191
|
+
maxLength?: number,
|
|
192
|
+
minLength?: number,
|
|
193
|
+
pattern?: string,
|
|
194
|
+
maximum?: number,
|
|
195
|
+
exclusiveMaximum?: boolean,
|
|
196
|
+
minimum?: number,
|
|
197
|
+
exclusiveMinimum?: boolean,
|
|
198
|
+
multipleOf?: number,
|
|
199
|
+
maxItems?: number,
|
|
200
|
+
minItems?: number,
|
|
201
|
+
uniqueItems?: boolean
|
|
202
|
+
}
|
|
203
|
+
} = {
|
|
204
|
+
}
|
|
205
|
+
|
|
@@ -0,0 +1,234 @@
|
|
|
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
|
+
import type { DocumentOrigin } from './DocumentOrigin';
|
|
17
|
+
import {
|
|
18
|
+
DocumentOriginFromJSON,
|
|
19
|
+
DocumentOriginFromJSONTyped,
|
|
20
|
+
DocumentOriginToJSON,
|
|
21
|
+
DocumentOriginToJSONTyped,
|
|
22
|
+
} from './DocumentOrigin';
|
|
23
|
+
import type { PartType } from './PartType';
|
|
24
|
+
import {
|
|
25
|
+
PartTypeFromJSON,
|
|
26
|
+
PartTypeFromJSONTyped,
|
|
27
|
+
PartTypeToJSON,
|
|
28
|
+
PartTypeToJSONTyped,
|
|
29
|
+
} from './PartType';
|
|
30
|
+
import type { DocumentType } from './DocumentType';
|
|
31
|
+
import {
|
|
32
|
+
DocumentTypeFromJSON,
|
|
33
|
+
DocumentTypeFromJSONTyped,
|
|
34
|
+
DocumentTypeToJSON,
|
|
35
|
+
DocumentTypeToJSONTyped,
|
|
36
|
+
} from './DocumentType';
|
|
37
|
+
import type { DocumentVersionResponse } from './DocumentVersionResponse';
|
|
38
|
+
import {
|
|
39
|
+
DocumentVersionResponseFromJSON,
|
|
40
|
+
DocumentVersionResponseFromJSONTyped,
|
|
41
|
+
DocumentVersionResponseToJSON,
|
|
42
|
+
DocumentVersionResponseToJSONTyped,
|
|
43
|
+
} from './DocumentVersionResponse';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Response for folder contents - can be either a Folder or a Document.
|
|
47
|
+
*
|
|
48
|
+
* Inherits PathPart fields from PathPartResponse and adds type-specific fields.
|
|
49
|
+
*
|
|
50
|
+
* Discriminated union based on part_type:
|
|
51
|
+
* - FOLDER: folder_id is set, document fields are None
|
|
52
|
+
* - DOCUMENT: document_id and document fields are set, folder_id is None
|
|
53
|
+
*
|
|
54
|
+
* Inherited fields from PathPartResponse:
|
|
55
|
+
* - path_part_id, name, part_type, parent_id, metadata_obj_id, created_at, updated_at
|
|
56
|
+
* @export
|
|
57
|
+
* @interface FolderDocumentResponse
|
|
58
|
+
*/
|
|
59
|
+
export interface FolderDocumentResponse {
|
|
60
|
+
/**
|
|
61
|
+
* PathPart ID
|
|
62
|
+
* @type {string}
|
|
63
|
+
* @memberof FolderDocumentResponse
|
|
64
|
+
*/
|
|
65
|
+
pathPartId: string;
|
|
66
|
+
/**
|
|
67
|
+
* Item name
|
|
68
|
+
* @type {string}
|
|
69
|
+
* @memberof FolderDocumentResponse
|
|
70
|
+
*/
|
|
71
|
+
name: string;
|
|
72
|
+
/**
|
|
73
|
+
* Type (FOLDER, DOCUMENT, etc.)
|
|
74
|
+
* @type {PartType}
|
|
75
|
+
* @memberof FolderDocumentResponse
|
|
76
|
+
*/
|
|
77
|
+
partType: PartType;
|
|
78
|
+
/**
|
|
79
|
+
* Parent PathPart ID
|
|
80
|
+
* @type {string}
|
|
81
|
+
* @memberof FolderDocumentResponse
|
|
82
|
+
*/
|
|
83
|
+
parentId: string;
|
|
84
|
+
/**
|
|
85
|
+
* ID of the underlying object
|
|
86
|
+
* @type {string}
|
|
87
|
+
* @memberof FolderDocumentResponse
|
|
88
|
+
*/
|
|
89
|
+
metadataObjId: string;
|
|
90
|
+
/**
|
|
91
|
+
* Creation timestamp
|
|
92
|
+
* @type {Date}
|
|
93
|
+
* @memberof FolderDocumentResponse
|
|
94
|
+
*/
|
|
95
|
+
createdAt: Date;
|
|
96
|
+
/**
|
|
97
|
+
* Last update timestamp
|
|
98
|
+
* @type {Date}
|
|
99
|
+
* @memberof FolderDocumentResponse
|
|
100
|
+
*/
|
|
101
|
+
updatedAt: Date;
|
|
102
|
+
/**
|
|
103
|
+
* Folder ID (present for folders)
|
|
104
|
+
* @type {string}
|
|
105
|
+
* @memberof FolderDocumentResponse
|
|
106
|
+
*/
|
|
107
|
+
folderId?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Document ID (present for documents)
|
|
110
|
+
* @type {string}
|
|
111
|
+
* @memberof FolderDocumentResponse
|
|
112
|
+
*/
|
|
113
|
+
documentId?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Document type (present for documents)
|
|
116
|
+
* @type {DocumentType}
|
|
117
|
+
* @memberof FolderDocumentResponse
|
|
118
|
+
*/
|
|
119
|
+
documentType?: DocumentType;
|
|
120
|
+
/**
|
|
121
|
+
* Document origin (present for documents)
|
|
122
|
+
* @type {DocumentOrigin}
|
|
123
|
+
* @memberof FolderDocumentResponse
|
|
124
|
+
*/
|
|
125
|
+
documentOrigin?: DocumentOrigin;
|
|
126
|
+
/**
|
|
127
|
+
* Active version ID (present for documents)
|
|
128
|
+
* @type {string}
|
|
129
|
+
* @memberof FolderDocumentResponse
|
|
130
|
+
*/
|
|
131
|
+
activeVersionId?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Active version details (present for documents)
|
|
134
|
+
* @type {DocumentVersionResponse}
|
|
135
|
+
* @memberof FolderDocumentResponse
|
|
136
|
+
*/
|
|
137
|
+
activeVersion?: DocumentVersionResponse;
|
|
138
|
+
/**
|
|
139
|
+
* Tenant ID
|
|
140
|
+
* @type {string}
|
|
141
|
+
* @memberof FolderDocumentResponse
|
|
142
|
+
*/
|
|
143
|
+
tenantId: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Check if a given object implements the FolderDocumentResponse interface.
|
|
150
|
+
*/
|
|
151
|
+
export function instanceOfFolderDocumentResponse(value: object): value is FolderDocumentResponse {
|
|
152
|
+
if (!('pathPartId' in value) || value['pathPartId'] === undefined) return false;
|
|
153
|
+
if (!('name' in value) || value['name'] === undefined) return false;
|
|
154
|
+
if (!('partType' in value) || value['partType'] === undefined) return false;
|
|
155
|
+
if (!('parentId' in value) || value['parentId'] === undefined) return false;
|
|
156
|
+
if (!('metadataObjId' in value) || value['metadataObjId'] === undefined) return false;
|
|
157
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
158
|
+
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
|
|
159
|
+
if (!('tenantId' in value) || value['tenantId'] === undefined) return false;
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export function FolderDocumentResponseFromJSON(json: any): FolderDocumentResponse {
|
|
164
|
+
return FolderDocumentResponseFromJSONTyped(json, false);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function FolderDocumentResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FolderDocumentResponse {
|
|
168
|
+
if (json == null) {
|
|
169
|
+
return json;
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
|
|
173
|
+
'pathPartId': json['path_part_id'],
|
|
174
|
+
'name': json['name'],
|
|
175
|
+
'partType': PartTypeFromJSON(json['part_type']),
|
|
176
|
+
'parentId': json['parent_id'],
|
|
177
|
+
'metadataObjId': json['metadata_obj_id'],
|
|
178
|
+
'createdAt': (new Date(json['created_at'])),
|
|
179
|
+
'updatedAt': (new Date(json['updated_at'])),
|
|
180
|
+
'folderId': json['folder_id'] == null ? undefined : json['folder_id'],
|
|
181
|
+
'documentId': json['document_id'] == null ? undefined : json['document_id'],
|
|
182
|
+
'documentType': json['document_type'] == null ? undefined : DocumentTypeFromJSON(json['document_type']),
|
|
183
|
+
'documentOrigin': json['document_origin'] == null ? undefined : DocumentOriginFromJSON(json['document_origin']),
|
|
184
|
+
'activeVersionId': json['active_version_id'] == null ? undefined : json['active_version_id'],
|
|
185
|
+
'activeVersion': json['active_version'] == null ? undefined : DocumentVersionResponseFromJSON(json['active_version']),
|
|
186
|
+
'tenantId': json['tenant_id'],
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export function FolderDocumentResponseToJSON(json: any): FolderDocumentResponse {
|
|
191
|
+
return FolderDocumentResponseToJSONTyped(json, false);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function FolderDocumentResponseToJSONTyped(value?: FolderDocumentResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
195
|
+
if (value == null) {
|
|
196
|
+
return value;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return {
|
|
200
|
+
|
|
201
|
+
'path_part_id': value['pathPartId'],
|
|
202
|
+
'name': value['name'],
|
|
203
|
+
'part_type': PartTypeToJSON(value['partType']),
|
|
204
|
+
'parent_id': value['parentId'],
|
|
205
|
+
'metadata_obj_id': value['metadataObjId'],
|
|
206
|
+
'created_at': value['createdAt'].toISOString(),
|
|
207
|
+
'updated_at': value['updatedAt'].toISOString(),
|
|
208
|
+
'folder_id': value['folderId'],
|
|
209
|
+
'document_id': value['documentId'],
|
|
210
|
+
'document_type': DocumentTypeToJSON(value['documentType']),
|
|
211
|
+
'document_origin': DocumentOriginToJSON(value['documentOrigin']),
|
|
212
|
+
'active_version_id': value['activeVersionId'],
|
|
213
|
+
'active_version': DocumentVersionResponseToJSON(value['activeVersion']),
|
|
214
|
+
'tenant_id': value['tenantId'],
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export const FolderDocumentResponsePropertyValidationAttributesMap: {
|
|
219
|
+
[property: string]: {
|
|
220
|
+
maxLength?: number,
|
|
221
|
+
minLength?: number,
|
|
222
|
+
pattern?: string,
|
|
223
|
+
maximum?: number,
|
|
224
|
+
exclusiveMaximum?: boolean,
|
|
225
|
+
minimum?: number,
|
|
226
|
+
exclusiveMinimum?: boolean,
|
|
227
|
+
multipleOf?: number,
|
|
228
|
+
maxItems?: number,
|
|
229
|
+
minItems?: number,
|
|
230
|
+
uniqueItems?: boolean
|
|
231
|
+
}
|
|
232
|
+
} = {
|
|
233
|
+
}
|
|
234
|
+
|