@knowledge-stack/ksapi 1.7.0 → 1.8.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 +10 -0
- package/README.md +2 -2
- package/dist/apis/ChunksApi.d.ts +175 -0
- package/dist/apis/ChunksApi.js +203 -0
- 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/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/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 +9 -0
- package/dist/esm/models/index.js +9 -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/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 +9 -0
- package/dist/models/index.js +9 -0
- package/package.json +1 -1
- package/src/apis/ChunksApi.ts +381 -0
- 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/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 +9 -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 { ChunkResponseFromJSON, CreateChunkRequestToJSON, UpdateChunkContentRequestToJSON, UpdateChunkMetadataRequestToJSON, } from '../models/index';
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class ChunksApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Create a new chunk with content. The chunk is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). Content is deduplicated by SHA256 hash.
|
|
31
|
+
* Create Chunk Handler
|
|
32
|
+
*/
|
|
33
|
+
createChunkRaw(requestParameters, initOverrides) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
if (requestParameters['createChunkRequest'] == null) {
|
|
36
|
+
throw new runtime.RequiredError('createChunkRequest', 'Required parameter "createChunkRequest" was null or undefined when calling createChunk().');
|
|
37
|
+
}
|
|
38
|
+
const queryParameters = {};
|
|
39
|
+
const headerParameters = {};
|
|
40
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
41
|
+
let urlPath = `/v1/chunks`;
|
|
42
|
+
const response = yield this.request({
|
|
43
|
+
path: urlPath,
|
|
44
|
+
method: 'POST',
|
|
45
|
+
headers: headerParameters,
|
|
46
|
+
query: queryParameters,
|
|
47
|
+
body: CreateChunkRequestToJSON(requestParameters['createChunkRequest']),
|
|
48
|
+
}, initOverrides);
|
|
49
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ChunkResponseFromJSON(jsonValue));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Create a new chunk with content. The chunk is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). Content is deduplicated by SHA256 hash.
|
|
54
|
+
* Create Chunk Handler
|
|
55
|
+
*/
|
|
56
|
+
createChunk(requestParameters, initOverrides) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const response = yield this.createChunkRaw(requestParameters, initOverrides);
|
|
59
|
+
return yield response.value();
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Delete a chunk. The chunk is deleted via its PathPart (cascading delete). The associated ChunkContent may remain if shared by other chunks.
|
|
64
|
+
* Delete Chunk Handler
|
|
65
|
+
*/
|
|
66
|
+
deleteChunkRaw(requestParameters, initOverrides) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
if (requestParameters['chunkId'] == null) {
|
|
69
|
+
throw new runtime.RequiredError('chunkId', 'Required parameter "chunkId" was null or undefined when calling deleteChunk().');
|
|
70
|
+
}
|
|
71
|
+
const queryParameters = {};
|
|
72
|
+
const headerParameters = {};
|
|
73
|
+
let urlPath = `/v1/chunks/{chunk_id}`;
|
|
74
|
+
urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
|
|
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 chunk. The chunk is deleted via its PathPart (cascading delete). The associated ChunkContent may remain if shared by other chunks.
|
|
86
|
+
* Delete Chunk Handler
|
|
87
|
+
*/
|
|
88
|
+
deleteChunk(requestParameters, initOverrides) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
yield this.deleteChunkRaw(requestParameters, initOverrides);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get a chunk by its ID, including content.
|
|
95
|
+
* Get Chunk Handler
|
|
96
|
+
*/
|
|
97
|
+
getChunkRaw(requestParameters, initOverrides) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
if (requestParameters['chunkId'] == null) {
|
|
100
|
+
throw new runtime.RequiredError('chunkId', 'Required parameter "chunkId" was null or undefined when calling getChunk().');
|
|
101
|
+
}
|
|
102
|
+
const queryParameters = {};
|
|
103
|
+
const headerParameters = {};
|
|
104
|
+
let urlPath = `/v1/chunks/{chunk_id}`;
|
|
105
|
+
urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
|
|
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) => ChunkResponseFromJSON(jsonValue));
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Get a chunk by its ID, including content.
|
|
117
|
+
* Get Chunk Handler
|
|
118
|
+
*/
|
|
119
|
+
getChunk(requestParameters, initOverrides) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
const response = yield this.getChunkRaw(requestParameters, initOverrides);
|
|
122
|
+
return yield response.value();
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Update chunk content by creating a new content row. The old content row is preserved (not deleted). If the new content matches an existing content hash, it will be deduplicated.
|
|
127
|
+
* Update Chunk Content Handler
|
|
128
|
+
*/
|
|
129
|
+
updateChunkContentRaw(requestParameters, initOverrides) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
if (requestParameters['chunkId'] == null) {
|
|
132
|
+
throw new runtime.RequiredError('chunkId', 'Required parameter "chunkId" was null or undefined when calling updateChunkContent().');
|
|
133
|
+
}
|
|
134
|
+
if (requestParameters['updateChunkContentRequest'] == null) {
|
|
135
|
+
throw new runtime.RequiredError('updateChunkContentRequest', 'Required parameter "updateChunkContentRequest" was null or undefined when calling updateChunkContent().');
|
|
136
|
+
}
|
|
137
|
+
const queryParameters = {};
|
|
138
|
+
const headerParameters = {};
|
|
139
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
140
|
+
let urlPath = `/v1/chunks/{chunk_id}/content`;
|
|
141
|
+
urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
|
|
142
|
+
const response = yield this.request({
|
|
143
|
+
path: urlPath,
|
|
144
|
+
method: 'PATCH',
|
|
145
|
+
headers: headerParameters,
|
|
146
|
+
query: queryParameters,
|
|
147
|
+
body: UpdateChunkContentRequestToJSON(requestParameters['updateChunkContentRequest']),
|
|
148
|
+
}, initOverrides);
|
|
149
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ChunkResponseFromJSON(jsonValue));
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Update chunk content by creating a new content row. The old content row is preserved (not deleted). If the new content matches an existing content hash, it will be deduplicated.
|
|
154
|
+
* Update Chunk Content Handler
|
|
155
|
+
*/
|
|
156
|
+
updateChunkContent(requestParameters, initOverrides) {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
const response = yield this.updateChunkContentRaw(requestParameters, initOverrides);
|
|
159
|
+
return yield response.value();
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Update chunk metadata by merging with existing metadata. The provided metadata is shallow-merged into the existing chunk_metadata.
|
|
164
|
+
* Update Chunk Metadata Handler
|
|
165
|
+
*/
|
|
166
|
+
updateChunkMetadataRaw(requestParameters, initOverrides) {
|
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
if (requestParameters['chunkId'] == null) {
|
|
169
|
+
throw new runtime.RequiredError('chunkId', 'Required parameter "chunkId" was null or undefined when calling updateChunkMetadata().');
|
|
170
|
+
}
|
|
171
|
+
if (requestParameters['updateChunkMetadataRequest'] == null) {
|
|
172
|
+
throw new runtime.RequiredError('updateChunkMetadataRequest', 'Required parameter "updateChunkMetadataRequest" was null or undefined when calling updateChunkMetadata().');
|
|
173
|
+
}
|
|
174
|
+
const queryParameters = {};
|
|
175
|
+
const headerParameters = {};
|
|
176
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
177
|
+
let urlPath = `/v1/chunks/{chunk_id}/metadata`;
|
|
178
|
+
urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
|
|
179
|
+
const response = yield this.request({
|
|
180
|
+
path: urlPath,
|
|
181
|
+
method: 'PATCH',
|
|
182
|
+
headers: headerParameters,
|
|
183
|
+
query: queryParameters,
|
|
184
|
+
body: UpdateChunkMetadataRequestToJSON(requestParameters['updateChunkMetadataRequest']),
|
|
185
|
+
}, initOverrides);
|
|
186
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ChunkResponseFromJSON(jsonValue));
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Update chunk metadata by merging with existing metadata. The provided metadata is shallow-merged into the existing chunk_metadata.
|
|
191
|
+
* Update Chunk Metadata Handler
|
|
192
|
+
*/
|
|
193
|
+
updateChunkMetadata(requestParameters, initOverrides) {
|
|
194
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
195
|
+
const response = yield this.updateChunkMetadataRaw(requestParameters, initOverrides);
|
|
196
|
+
return yield response.value();
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
package/dist/esm/apis/index.d.ts
CHANGED
package/dist/esm/apis/index.js
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
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 { PolygonReference } from './PolygonReference';
|
|
13
|
+
/**
|
|
14
|
+
* Metadata for a chunk including source document references.
|
|
15
|
+
* @export
|
|
16
|
+
* @interface ChunkMetadataInput
|
|
17
|
+
*/
|
|
18
|
+
export interface ChunkMetadataInput {
|
|
19
|
+
/**
|
|
20
|
+
* List of bounding boxes in the source document for the chunk, potentially from multiple areas of multiple pages.
|
|
21
|
+
* @type {Array<PolygonReference>}
|
|
22
|
+
* @memberof ChunkMetadataInput
|
|
23
|
+
*/
|
|
24
|
+
polygons?: Array<PolygonReference>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Check if a given object implements the ChunkMetadataInput interface.
|
|
28
|
+
*/
|
|
29
|
+
export declare function instanceOfChunkMetadataInput(value: object): value is ChunkMetadataInput;
|
|
30
|
+
export declare function ChunkMetadataInputFromJSON(json: any): ChunkMetadataInput;
|
|
31
|
+
export declare function ChunkMetadataInputFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkMetadataInput;
|
|
32
|
+
export declare function ChunkMetadataInputToJSON(json: any): ChunkMetadataInput;
|
|
33
|
+
export declare function ChunkMetadataInputToJSONTyped(value?: ChunkMetadataInput | null, ignoreDiscriminator?: boolean): any;
|
|
34
|
+
export declare const ChunkMetadataInputPropertyValidationAttributesMap: {
|
|
35
|
+
[property: string]: {
|
|
36
|
+
maxLength?: number;
|
|
37
|
+
minLength?: number;
|
|
38
|
+
pattern?: string;
|
|
39
|
+
maximum?: number;
|
|
40
|
+
exclusiveMaximum?: boolean;
|
|
41
|
+
minimum?: number;
|
|
42
|
+
exclusiveMinimum?: boolean;
|
|
43
|
+
multipleOf?: number;
|
|
44
|
+
maxItems?: number;
|
|
45
|
+
minItems?: number;
|
|
46
|
+
uniqueItems?: boolean;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { PolygonReferenceFromJSON, PolygonReferenceToJSON, } from './PolygonReference';
|
|
15
|
+
/**
|
|
16
|
+
* Check if a given object implements the ChunkMetadataInput interface.
|
|
17
|
+
*/
|
|
18
|
+
export function instanceOfChunkMetadataInput(value) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
export function ChunkMetadataInputFromJSON(json) {
|
|
22
|
+
return ChunkMetadataInputFromJSONTyped(json, false);
|
|
23
|
+
}
|
|
24
|
+
export function ChunkMetadataInputFromJSONTyped(json, ignoreDiscriminator) {
|
|
25
|
+
if (json == null) {
|
|
26
|
+
return json;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
'polygons': json['polygons'] == null ? undefined : (json['polygons'].map(PolygonReferenceFromJSON)),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function ChunkMetadataInputToJSON(json) {
|
|
33
|
+
return ChunkMetadataInputToJSONTyped(json, false);
|
|
34
|
+
}
|
|
35
|
+
export function ChunkMetadataInputToJSONTyped(value, ignoreDiscriminator = false) {
|
|
36
|
+
if (value == null) {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
'polygons': value['polygons'] == null ? undefined : (value['polygons'].map(PolygonReferenceToJSON)),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export const ChunkMetadataInputPropertyValidationAttributesMap = {};
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { PolygonReference } from './PolygonReference';
|
|
13
|
+
/**
|
|
14
|
+
* Metadata for a chunk including source document references.
|
|
15
|
+
* @export
|
|
16
|
+
* @interface ChunkMetadataOutput
|
|
17
|
+
*/
|
|
18
|
+
export interface ChunkMetadataOutput {
|
|
19
|
+
/**
|
|
20
|
+
* List of bounding boxes in the source document for the chunk, potentially from multiple areas of multiple pages.
|
|
21
|
+
* @type {Array<PolygonReference>}
|
|
22
|
+
* @memberof ChunkMetadataOutput
|
|
23
|
+
*/
|
|
24
|
+
polygons?: Array<PolygonReference>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Check if a given object implements the ChunkMetadataOutput interface.
|
|
28
|
+
*/
|
|
29
|
+
export declare function instanceOfChunkMetadataOutput(value: object): value is ChunkMetadataOutput;
|
|
30
|
+
export declare function ChunkMetadataOutputFromJSON(json: any): ChunkMetadataOutput;
|
|
31
|
+
export declare function ChunkMetadataOutputFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkMetadataOutput;
|
|
32
|
+
export declare function ChunkMetadataOutputToJSON(json: any): ChunkMetadataOutput;
|
|
33
|
+
export declare function ChunkMetadataOutputToJSONTyped(value?: ChunkMetadataOutput | null, ignoreDiscriminator?: boolean): any;
|
|
34
|
+
export declare const ChunkMetadataOutputPropertyValidationAttributesMap: {
|
|
35
|
+
[property: string]: {
|
|
36
|
+
maxLength?: number;
|
|
37
|
+
minLength?: number;
|
|
38
|
+
pattern?: string;
|
|
39
|
+
maximum?: number;
|
|
40
|
+
exclusiveMaximum?: boolean;
|
|
41
|
+
minimum?: number;
|
|
42
|
+
exclusiveMinimum?: boolean;
|
|
43
|
+
multipleOf?: number;
|
|
44
|
+
maxItems?: number;
|
|
45
|
+
minItems?: number;
|
|
46
|
+
uniqueItems?: boolean;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { PolygonReferenceFromJSON, PolygonReferenceToJSON, } from './PolygonReference';
|
|
15
|
+
/**
|
|
16
|
+
* Check if a given object implements the ChunkMetadataOutput interface.
|
|
17
|
+
*/
|
|
18
|
+
export function instanceOfChunkMetadataOutput(value) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
export function ChunkMetadataOutputFromJSON(json) {
|
|
22
|
+
return ChunkMetadataOutputFromJSONTyped(json, false);
|
|
23
|
+
}
|
|
24
|
+
export function ChunkMetadataOutputFromJSONTyped(json, ignoreDiscriminator) {
|
|
25
|
+
if (json == null) {
|
|
26
|
+
return json;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
'polygons': json['polygons'] == null ? undefined : (json['polygons'].map(PolygonReferenceFromJSON)),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function ChunkMetadataOutputToJSON(json) {
|
|
33
|
+
return ChunkMetadataOutputToJSONTyped(json, false);
|
|
34
|
+
}
|
|
35
|
+
export function ChunkMetadataOutputToJSONTyped(value, ignoreDiscriminator = false) {
|
|
36
|
+
if (value == null) {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
'polygons': value['polygons'] == null ? undefined : (value['polygons'].map(PolygonReferenceToJSON)),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export const ChunkMetadataOutputPropertyValidationAttributesMap = {};
|
|
@@ -0,0 +1,115 @@
|
|
|
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 { ChunkMetadataOutput } from './ChunkMetadataOutput';
|
|
13
|
+
import type { ChunkType } from './ChunkType';
|
|
14
|
+
/**
|
|
15
|
+
* Chunk response model.
|
|
16
|
+
* @export
|
|
17
|
+
* @interface ChunkResponse
|
|
18
|
+
*/
|
|
19
|
+
export interface ChunkResponse {
|
|
20
|
+
/**
|
|
21
|
+
* Chunk ID
|
|
22
|
+
* @type {string}
|
|
23
|
+
* @memberof ChunkResponse
|
|
24
|
+
*/
|
|
25
|
+
id: string;
|
|
26
|
+
/**
|
|
27
|
+
* PathPart ID
|
|
28
|
+
* @type {string}
|
|
29
|
+
* @memberof ChunkResponse
|
|
30
|
+
*/
|
|
31
|
+
pathPartId: string;
|
|
32
|
+
/**
|
|
33
|
+
* ChunkContent ID
|
|
34
|
+
* @type {string}
|
|
35
|
+
* @memberof ChunkResponse
|
|
36
|
+
*/
|
|
37
|
+
contentId: string;
|
|
38
|
+
/**
|
|
39
|
+
* Chunk text content
|
|
40
|
+
* @type {string}
|
|
41
|
+
* @memberof ChunkResponse
|
|
42
|
+
*/
|
|
43
|
+
content: string;
|
|
44
|
+
/**
|
|
45
|
+
* Type of chunk content
|
|
46
|
+
* @type {ChunkType}
|
|
47
|
+
* @memberof ChunkResponse
|
|
48
|
+
*/
|
|
49
|
+
chunkType: ChunkType;
|
|
50
|
+
/**
|
|
51
|
+
* Chunk metadata
|
|
52
|
+
* @type {ChunkMetadataOutput}
|
|
53
|
+
* @memberof ChunkResponse
|
|
54
|
+
*/
|
|
55
|
+
chunkMetadata: ChunkMetadataOutput;
|
|
56
|
+
/**
|
|
57
|
+
* Parent PathPart ID
|
|
58
|
+
* @type {string}
|
|
59
|
+
* @memberof ChunkResponse
|
|
60
|
+
*/
|
|
61
|
+
parentId: string;
|
|
62
|
+
/**
|
|
63
|
+
* Previous sibling PathPart ID
|
|
64
|
+
* @type {string}
|
|
65
|
+
* @memberof ChunkResponse
|
|
66
|
+
*/
|
|
67
|
+
prevSiblingPathId?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Next sibling PathPart ID
|
|
70
|
+
* @type {string}
|
|
71
|
+
* @memberof ChunkResponse
|
|
72
|
+
*/
|
|
73
|
+
nextSiblingId?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Tenant ID
|
|
76
|
+
* @type {string}
|
|
77
|
+
* @memberof ChunkResponse
|
|
78
|
+
*/
|
|
79
|
+
tenantId: string;
|
|
80
|
+
/**
|
|
81
|
+
* Creation timestamp
|
|
82
|
+
* @type {Date}
|
|
83
|
+
* @memberof ChunkResponse
|
|
84
|
+
*/
|
|
85
|
+
createdAt: Date;
|
|
86
|
+
/**
|
|
87
|
+
* Last update timestamp
|
|
88
|
+
* @type {Date}
|
|
89
|
+
* @memberof ChunkResponse
|
|
90
|
+
*/
|
|
91
|
+
updatedAt: Date;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Check if a given object implements the ChunkResponse interface.
|
|
95
|
+
*/
|
|
96
|
+
export declare function instanceOfChunkResponse(value: object): value is ChunkResponse;
|
|
97
|
+
export declare function ChunkResponseFromJSON(json: any): ChunkResponse;
|
|
98
|
+
export declare function ChunkResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkResponse;
|
|
99
|
+
export declare function ChunkResponseToJSON(json: any): ChunkResponse;
|
|
100
|
+
export declare function ChunkResponseToJSONTyped(value?: ChunkResponse | null, ignoreDiscriminator?: boolean): any;
|
|
101
|
+
export declare const ChunkResponsePropertyValidationAttributesMap: {
|
|
102
|
+
[property: string]: {
|
|
103
|
+
maxLength?: number;
|
|
104
|
+
minLength?: number;
|
|
105
|
+
pattern?: string;
|
|
106
|
+
maximum?: number;
|
|
107
|
+
exclusiveMaximum?: boolean;
|
|
108
|
+
minimum?: number;
|
|
109
|
+
exclusiveMinimum?: boolean;
|
|
110
|
+
multipleOf?: number;
|
|
111
|
+
maxItems?: number;
|
|
112
|
+
minItems?: number;
|
|
113
|
+
uniqueItems?: boolean;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
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 { ChunkMetadataOutputFromJSON, ChunkMetadataOutputToJSON, } from './ChunkMetadataOutput';
|
|
15
|
+
import { ChunkTypeFromJSON, ChunkTypeToJSON, } from './ChunkType';
|
|
16
|
+
/**
|
|
17
|
+
* Check if a given object implements the ChunkResponse interface.
|
|
18
|
+
*/
|
|
19
|
+
export function instanceOfChunkResponse(value) {
|
|
20
|
+
if (!('id' in value) || value['id'] === undefined)
|
|
21
|
+
return false;
|
|
22
|
+
if (!('pathPartId' in value) || value['pathPartId'] === undefined)
|
|
23
|
+
return false;
|
|
24
|
+
if (!('contentId' in value) || value['contentId'] === undefined)
|
|
25
|
+
return false;
|
|
26
|
+
if (!('content' in value) || value['content'] === undefined)
|
|
27
|
+
return false;
|
|
28
|
+
if (!('chunkType' in value) || value['chunkType'] === undefined)
|
|
29
|
+
return false;
|
|
30
|
+
if (!('chunkMetadata' in value) || value['chunkMetadata'] === undefined)
|
|
31
|
+
return false;
|
|
32
|
+
if (!('parentId' in value) || value['parentId'] === undefined)
|
|
33
|
+
return false;
|
|
34
|
+
if (!('tenantId' in value) || value['tenantId'] === undefined)
|
|
35
|
+
return false;
|
|
36
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined)
|
|
37
|
+
return false;
|
|
38
|
+
if (!('updatedAt' in value) || value['updatedAt'] === undefined)
|
|
39
|
+
return false;
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
export function ChunkResponseFromJSON(json) {
|
|
43
|
+
return ChunkResponseFromJSONTyped(json, false);
|
|
44
|
+
}
|
|
45
|
+
export function ChunkResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
46
|
+
if (json == null) {
|
|
47
|
+
return json;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
'id': json['id'],
|
|
51
|
+
'pathPartId': json['path_part_id'],
|
|
52
|
+
'contentId': json['content_id'],
|
|
53
|
+
'content': json['content'],
|
|
54
|
+
'chunkType': ChunkTypeFromJSON(json['chunk_type']),
|
|
55
|
+
'chunkMetadata': ChunkMetadataOutputFromJSON(json['chunk_metadata']),
|
|
56
|
+
'parentId': json['parent_id'],
|
|
57
|
+
'prevSiblingPathId': json['prev_sibling_path_id'] == null ? undefined : json['prev_sibling_path_id'],
|
|
58
|
+
'nextSiblingId': json['next_sibling_id'] == null ? undefined : json['next_sibling_id'],
|
|
59
|
+
'tenantId': json['tenant_id'],
|
|
60
|
+
'createdAt': (new Date(json['created_at'])),
|
|
61
|
+
'updatedAt': (new Date(json['updated_at'])),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export function ChunkResponseToJSON(json) {
|
|
65
|
+
return ChunkResponseToJSONTyped(json, false);
|
|
66
|
+
}
|
|
67
|
+
export function ChunkResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
68
|
+
if (value == null) {
|
|
69
|
+
return value;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
'id': value['id'],
|
|
73
|
+
'path_part_id': value['pathPartId'],
|
|
74
|
+
'content_id': value['contentId'],
|
|
75
|
+
'content': value['content'],
|
|
76
|
+
'chunk_type': ChunkTypeToJSON(value['chunkType']),
|
|
77
|
+
'chunk_metadata': ChunkMetadataOutputToJSON(value['chunkMetadata']),
|
|
78
|
+
'parent_id': value['parentId'],
|
|
79
|
+
'prev_sibling_path_id': value['prevSiblingPathId'],
|
|
80
|
+
'next_sibling_id': value['nextSiblingId'],
|
|
81
|
+
'tenant_id': value['tenantId'],
|
|
82
|
+
'created_at': value['createdAt'].toISOString(),
|
|
83
|
+
'updated_at': value['updatedAt'].toISOString(),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export const ChunkResponsePropertyValidationAttributesMap = {};
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
* Type of chunk content.
|
|
14
|
+
* @export
|
|
15
|
+
*/
|
|
16
|
+
export declare const ChunkType: {
|
|
17
|
+
readonly Text: "TEXT";
|
|
18
|
+
readonly Table: "TABLE";
|
|
19
|
+
readonly Image: "IMAGE";
|
|
20
|
+
readonly Unknown: "UNKNOWN";
|
|
21
|
+
};
|
|
22
|
+
export type ChunkType = typeof ChunkType[keyof typeof ChunkType];
|
|
23
|
+
export declare function instanceOfChunkType(value: any): boolean;
|
|
24
|
+
export declare function ChunkTypeFromJSON(json: any): ChunkType;
|
|
25
|
+
export declare function ChunkTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkType;
|
|
26
|
+
export declare function ChunkTypeToJSON(value?: ChunkType | null): any;
|
|
27
|
+
export declare function ChunkTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): ChunkType;
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
* Type of chunk content.
|
|
16
|
+
* @export
|
|
17
|
+
*/
|
|
18
|
+
export const ChunkType = {
|
|
19
|
+
Text: 'TEXT',
|
|
20
|
+
Table: 'TABLE',
|
|
21
|
+
Image: 'IMAGE',
|
|
22
|
+
Unknown: 'UNKNOWN'
|
|
23
|
+
};
|
|
24
|
+
export function instanceOfChunkType(value) {
|
|
25
|
+
for (const key in ChunkType) {
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(ChunkType, key)) {
|
|
27
|
+
if (ChunkType[key] === value) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
export function ChunkTypeFromJSON(json) {
|
|
35
|
+
return ChunkTypeFromJSONTyped(json, false);
|
|
36
|
+
}
|
|
37
|
+
export function ChunkTypeFromJSONTyped(json, ignoreDiscriminator) {
|
|
38
|
+
return json;
|
|
39
|
+
}
|
|
40
|
+
export function ChunkTypeToJSON(value) {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
export function ChunkTypeToJSONTyped(value, ignoreDiscriminator) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|