@knowledge-stack/ksapi 1.19.4 → 1.20.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 +1 -0
  2. package/README.md +2 -2
  3. package/dist/apis/DocumentVersionsApi.d.ts +30 -1
  4. package/dist/apis/DocumentVersionsApi.js +32 -0
  5. package/dist/apis/DocumentsApi.d.ts +2 -2
  6. package/dist/apis/DocumentsApi.js +4 -4
  7. package/dist/esm/apis/DocumentVersionsApi.d.ts +30 -1
  8. package/dist/esm/apis/DocumentVersionsApi.js +33 -1
  9. package/dist/esm/apis/DocumentsApi.d.ts +2 -2
  10. package/dist/esm/apis/DocumentsApi.js +4 -4
  11. package/dist/esm/models/ChunkMetadataInput.d.ts +6 -0
  12. package/dist/esm/models/ChunkMetadataInput.js +2 -0
  13. package/dist/esm/models/ChunkMetadataOutput.d.ts +6 -0
  14. package/dist/esm/models/ChunkMetadataOutput.js +2 -0
  15. package/dist/esm/models/ClearVersionContentsResponse.d.ts +47 -0
  16. package/dist/esm/models/ClearVersionContentsResponse.js +44 -0
  17. package/dist/esm/models/DocumentType.d.ts +1 -0
  18. package/dist/esm/models/DocumentType.js +1 -0
  19. package/dist/esm/models/index.d.ts +1 -0
  20. package/dist/esm/models/index.js +1 -0
  21. package/dist/models/ChunkMetadataInput.d.ts +6 -0
  22. package/dist/models/ChunkMetadataInput.js +2 -0
  23. package/dist/models/ChunkMetadataOutput.d.ts +6 -0
  24. package/dist/models/ChunkMetadataOutput.js +2 -0
  25. package/dist/models/ClearVersionContentsResponse.d.ts +47 -0
  26. package/dist/models/ClearVersionContentsResponse.js +52 -0
  27. package/dist/models/DocumentType.d.ts +1 -0
  28. package/dist/models/DocumentType.js +1 -0
  29. package/dist/models/index.d.ts +1 -0
  30. package/dist/models/index.js +1 -0
  31. package/package.json +1 -1
  32. package/src/apis/DocumentVersionsApi.ts +64 -0
  33. package/src/apis/DocumentsApi.ts +7 -7
  34. package/src/models/ChunkMetadataInput.ts +8 -0
  35. package/src/models/ChunkMetadataOutput.ts +8 -0
  36. package/src/models/ClearVersionContentsResponse.ts +83 -0
  37. package/src/models/DocumentType.ts +1 -0
  38. package/src/models/index.ts +1 -0
@@ -28,6 +28,7 @@ src/models/ChunkMetadataOutput.ts
28
28
  src/models/ChunkResponse.ts
29
29
  src/models/ChunkSearchRequest.ts
30
30
  src/models/ChunkType.ts
31
+ src/models/ClearVersionContentsResponse.ts
31
32
  src/models/CreateChunkLineageRequest.ts
32
33
  src/models/CreateChunkRequest.ts
33
34
  src/models/CreateDocumentRequest.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @knowledge-stack/ksapi@1.19.4
1
+ ## @knowledge-stack/ksapi@1.20.0
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @knowledge-stack/ksapi@1.19.4 --save
39
+ npm install @knowledge-stack/ksapi@1.20.0 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -10,7 +10,11 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { DocumentVersionMetadataUpdate, DocumentVersionResponse, PaginatedResponseDocumentContentPathPart, PaginatedResponseDocumentVersionResponse } from '../models/index';
13
+ import type { ClearVersionContentsResponse, DocumentVersionMetadataUpdate, DocumentVersionResponse, PaginatedResponseDocumentContentPathPart, PaginatedResponseDocumentVersionResponse } from '../models/index';
14
+ export interface ClearDocumentVersionContentsRequest {
15
+ versionId: string;
16
+ ksUat?: string;
17
+ }
14
18
  export interface CreateDocumentVersionRequest {
15
19
  documentId: string;
16
20
  ksUat?: string;
@@ -48,6 +52,21 @@ export interface UpdateDocumentVersionMetadataRequest {
48
52
  * @interface DocumentVersionsApiInterface
49
53
  */
50
54
  export interface DocumentVersionsApiInterface {
55
+ /**
56
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
57
+ * @summary Clear Document Version Contents Handler
58
+ * @param {string} versionId DocumentVersion ID
59
+ * @param {string} [ksUat]
60
+ * @param {*} [options] Override http request option.
61
+ * @throws {RequiredError}
62
+ * @memberof DocumentVersionsApiInterface
63
+ */
64
+ clearDocumentVersionContentsRaw(requestParameters: ClearDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ClearVersionContentsResponse>>;
65
+ /**
66
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
67
+ * Clear Document Version Contents Handler
68
+ */
69
+ clearDocumentVersionContents(requestParameters: ClearDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClearVersionContentsResponse>;
51
70
  /**
52
71
  * Create a new version for a document. The version number is automatically incremented from the highest existing version.
53
72
  * @summary Create Document Version Handler
@@ -149,6 +168,16 @@ export interface DocumentVersionsApiInterface {
149
168
  *
150
169
  */
151
170
  export declare class DocumentVersionsApi extends runtime.BaseAPI implements DocumentVersionsApiInterface {
171
+ /**
172
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
173
+ * Clear Document Version Contents Handler
174
+ */
175
+ clearDocumentVersionContentsRaw(requestParameters: ClearDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ClearVersionContentsResponse>>;
176
+ /**
177
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
178
+ * Clear Document Version Contents Handler
179
+ */
180
+ clearDocumentVersionContents(requestParameters: ClearDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClearVersionContentsResponse>;
152
181
  /**
153
182
  * Create a new version for a document. The version number is automatically incremented from the highest existing version.
154
183
  * Create Document Version Handler
@@ -29,6 +29,38 @@ const index_1 = require("../models/index");
29
29
  *
30
30
  */
31
31
  class DocumentVersionsApi extends runtime.BaseAPI {
32
+ /**
33
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
34
+ * Clear Document Version Contents Handler
35
+ */
36
+ clearDocumentVersionContentsRaw(requestParameters, initOverrides) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (requestParameters['versionId'] == null) {
39
+ throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling clearDocumentVersionContents().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ let urlPath = `/v1/document_versions/{version_id}/contents`;
44
+ urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
45
+ const response = yield this.request({
46
+ path: urlPath,
47
+ method: 'DELETE',
48
+ headers: headerParameters,
49
+ query: queryParameters,
50
+ }, initOverrides);
51
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ClearVersionContentsResponseFromJSON)(jsonValue));
52
+ });
53
+ }
54
+ /**
55
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
56
+ * Clear Document Version Contents Handler
57
+ */
58
+ clearDocumentVersionContents(requestParameters, initOverrides) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ const response = yield this.clearDocumentVersionContentsRaw(requestParameters, initOverrides);
61
+ return yield response.value();
62
+ });
63
+ }
32
64
  /**
33
65
  * Create a new version for a document. The version number is automatically incremented from the highest existing version.
34
66
  * Create Document Version Handler
@@ -25,7 +25,7 @@ export interface GetDocumentRequest {
25
25
  }
26
26
  export interface IngestDocumentRequest {
27
27
  file: Blob;
28
- folderId: string;
28
+ pathPartId: string;
29
29
  ksUat?: string;
30
30
  name?: string;
31
31
  }
@@ -97,7 +97,7 @@ export interface DocumentsApiInterface {
97
97
  * Upload a file, create document + version, and trigger ingestion workflow. Returns 201 with the Temporal workflow ID. Design decision — S3 upload happens *before* the DB write: We pre-generate document and version UUIDs, upload the source file to S3, and only then persist the DB records. If the DB write fails, an orphaned S3 object is left behind (acceptable storage cost cleaned up by the S3 deletion cronjob). The reverse — a committed DB record pointing to a missing S3 object — would crash downstream pipeline activities that expect the file to exist.
98
98
  * @summary Ingest Document Handler
99
99
  * @param {Blob} file
100
- * @param {string} folderId Parent folder ID
100
+ * @param {string} pathPartId Parent path part ID (must be a FOLDER type)
101
101
  * @param {string} [ksUat]
102
102
  * @param {string} [name] Document name (defaults to filename)
103
103
  * @param {*} [options] Override http request option.
@@ -134,8 +134,8 @@ class DocumentsApi extends runtime.BaseAPI {
134
134
  if (requestParameters['file'] == null) {
135
135
  throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling ingestDocument().');
136
136
  }
137
- if (requestParameters['folderId'] == null) {
138
- throw new runtime.RequiredError('folderId', 'Required parameter "folderId" was null or undefined when calling ingestDocument().');
137
+ if (requestParameters['pathPartId'] == null) {
138
+ throw new runtime.RequiredError('pathPartId', 'Required parameter "pathPartId" was null or undefined when calling ingestDocument().');
139
139
  }
140
140
  const queryParameters = {};
141
141
  const headerParameters = {};
@@ -157,8 +157,8 @@ class DocumentsApi extends runtime.BaseAPI {
157
157
  if (requestParameters['file'] != null) {
158
158
  formParams.append('file', requestParameters['file']);
159
159
  }
160
- if (requestParameters['folderId'] != null) {
161
- formParams.append('folder_id', requestParameters['folderId']);
160
+ if (requestParameters['pathPartId'] != null) {
161
+ formParams.append('path_part_id', requestParameters['pathPartId']);
162
162
  }
163
163
  if (requestParameters['name'] != null) {
164
164
  formParams.append('name', requestParameters['name']);
@@ -10,7 +10,11 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { DocumentVersionMetadataUpdate, DocumentVersionResponse, PaginatedResponseDocumentContentPathPart, PaginatedResponseDocumentVersionResponse } from '../models/index';
13
+ import type { ClearVersionContentsResponse, DocumentVersionMetadataUpdate, DocumentVersionResponse, PaginatedResponseDocumentContentPathPart, PaginatedResponseDocumentVersionResponse } from '../models/index';
14
+ export interface ClearDocumentVersionContentsRequest {
15
+ versionId: string;
16
+ ksUat?: string;
17
+ }
14
18
  export interface CreateDocumentVersionRequest {
15
19
  documentId: string;
16
20
  ksUat?: string;
@@ -48,6 +52,21 @@ export interface UpdateDocumentVersionMetadataRequest {
48
52
  * @interface DocumentVersionsApiInterface
49
53
  */
50
54
  export interface DocumentVersionsApiInterface {
55
+ /**
56
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
57
+ * @summary Clear Document Version Contents Handler
58
+ * @param {string} versionId DocumentVersion ID
59
+ * @param {string} [ksUat]
60
+ * @param {*} [options] Override http request option.
61
+ * @throws {RequiredError}
62
+ * @memberof DocumentVersionsApiInterface
63
+ */
64
+ clearDocumentVersionContentsRaw(requestParameters: ClearDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ClearVersionContentsResponse>>;
65
+ /**
66
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
67
+ * Clear Document Version Contents Handler
68
+ */
69
+ clearDocumentVersionContents(requestParameters: ClearDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClearVersionContentsResponse>;
51
70
  /**
52
71
  * Create a new version for a document. The version number is automatically incremented from the highest existing version.
53
72
  * @summary Create Document Version Handler
@@ -149,6 +168,16 @@ export interface DocumentVersionsApiInterface {
149
168
  *
150
169
  */
151
170
  export declare class DocumentVersionsApi extends runtime.BaseAPI implements DocumentVersionsApiInterface {
171
+ /**
172
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
173
+ * Clear Document Version Contents Handler
174
+ */
175
+ clearDocumentVersionContentsRaw(requestParameters: ClearDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ClearVersionContentsResponse>>;
176
+ /**
177
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
178
+ * Clear Document Version Contents Handler
179
+ */
180
+ clearDocumentVersionContents(requestParameters: ClearDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClearVersionContentsResponse>;
152
181
  /**
153
182
  * Create a new version for a document. The version number is automatically incremented from the highest existing version.
154
183
  * Create Document Version Handler
@@ -21,11 +21,43 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { DocumentVersionMetadataUpdateToJSON, DocumentVersionResponseFromJSON, PaginatedResponseDocumentContentPathPartFromJSON, PaginatedResponseDocumentVersionResponseFromJSON, } from '../models/index';
24
+ import { ClearVersionContentsResponseFromJSON, DocumentVersionMetadataUpdateToJSON, DocumentVersionResponseFromJSON, PaginatedResponseDocumentContentPathPartFromJSON, PaginatedResponseDocumentVersionResponseFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
28
28
  export class DocumentVersionsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
31
+ * Clear Document Version Contents Handler
32
+ */
33
+ clearDocumentVersionContentsRaw(requestParameters, initOverrides) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (requestParameters['versionId'] == null) {
36
+ throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling clearDocumentVersionContents().');
37
+ }
38
+ const queryParameters = {};
39
+ const headerParameters = {};
40
+ let urlPath = `/v1/document_versions/{version_id}/contents`;
41
+ urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
42
+ const response = yield this.request({
43
+ path: urlPath,
44
+ method: 'DELETE',
45
+ headers: headerParameters,
46
+ query: queryParameters,
47
+ }, initOverrides);
48
+ return new runtime.JSONApiResponse(response, (jsonValue) => ClearVersionContentsResponseFromJSON(jsonValue));
49
+ });
50
+ }
51
+ /**
52
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
53
+ * Clear Document Version Contents Handler
54
+ */
55
+ clearDocumentVersionContents(requestParameters, initOverrides) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const response = yield this.clearDocumentVersionContentsRaw(requestParameters, initOverrides);
58
+ return yield response.value();
59
+ });
60
+ }
29
61
  /**
30
62
  * Create a new version for a document. The version number is automatically incremented from the highest existing version.
31
63
  * Create Document Version Handler
@@ -25,7 +25,7 @@ export interface GetDocumentRequest {
25
25
  }
26
26
  export interface IngestDocumentRequest {
27
27
  file: Blob;
28
- folderId: string;
28
+ pathPartId: string;
29
29
  ksUat?: string;
30
30
  name?: string;
31
31
  }
@@ -97,7 +97,7 @@ export interface DocumentsApiInterface {
97
97
  * Upload a file, create document + version, and trigger ingestion workflow. Returns 201 with the Temporal workflow ID. Design decision — S3 upload happens *before* the DB write: We pre-generate document and version UUIDs, upload the source file to S3, and only then persist the DB records. If the DB write fails, an orphaned S3 object is left behind (acceptable storage cost cleaned up by the S3 deletion cronjob). The reverse — a committed DB record pointing to a missing S3 object — would crash downstream pipeline activities that expect the file to exist.
98
98
  * @summary Ingest Document Handler
99
99
  * @param {Blob} file
100
- * @param {string} folderId Parent folder ID
100
+ * @param {string} pathPartId Parent path part ID (must be a FOLDER type)
101
101
  * @param {string} [ksUat]
102
102
  * @param {string} [name] Document name (defaults to filename)
103
103
  * @param {*} [options] Override http request option.
@@ -131,8 +131,8 @@ export class DocumentsApi extends runtime.BaseAPI {
131
131
  if (requestParameters['file'] == null) {
132
132
  throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling ingestDocument().');
133
133
  }
134
- if (requestParameters['folderId'] == null) {
135
- throw new runtime.RequiredError('folderId', 'Required parameter "folderId" was null or undefined when calling ingestDocument().');
134
+ if (requestParameters['pathPartId'] == null) {
135
+ throw new runtime.RequiredError('pathPartId', 'Required parameter "pathPartId" was null or undefined when calling ingestDocument().');
136
136
  }
137
137
  const queryParameters = {};
138
138
  const headerParameters = {};
@@ -154,8 +154,8 @@ export class DocumentsApi extends runtime.BaseAPI {
154
154
  if (requestParameters['file'] != null) {
155
155
  formParams.append('file', requestParameters['file']);
156
156
  }
157
- if (requestParameters['folderId'] != null) {
158
- formParams.append('folder_id', requestParameters['folderId']);
157
+ if (requestParameters['pathPartId'] != null) {
158
+ formParams.append('path_part_id', requestParameters['pathPartId']);
159
159
  }
160
160
  if (requestParameters['name'] != null) {
161
161
  formParams.append('name', requestParameters['name']);
@@ -22,6 +22,12 @@ export interface ChunkMetadataInput {
22
22
  * @memberof ChunkMetadataInput
23
23
  */
24
24
  polygons?: Array<PolygonReference>;
25
+ /**
26
+ * Full s3:// URI to the visual asset for this chunk. Set for IMAGE and TABLE chunks.
27
+ * @type {string}
28
+ * @memberof ChunkMetadataInput
29
+ */
30
+ s3Url?: string;
25
31
  }
26
32
  /**
27
33
  * Check if a given object implements the ChunkMetadataInput interface.
@@ -27,6 +27,7 @@ export function ChunkMetadataInputFromJSONTyped(json, ignoreDiscriminator) {
27
27
  }
28
28
  return {
29
29
  'polygons': json['polygons'] == null ? undefined : (json['polygons'].map(PolygonReferenceFromJSON)),
30
+ 's3Url': json['s3_url'] == null ? undefined : json['s3_url'],
30
31
  };
31
32
  }
32
33
  export function ChunkMetadataInputToJSON(json) {
@@ -38,6 +39,7 @@ export function ChunkMetadataInputToJSONTyped(value, ignoreDiscriminator = false
38
39
  }
39
40
  return {
40
41
  'polygons': value['polygons'] == null ? undefined : (value['polygons'].map(PolygonReferenceToJSON)),
42
+ 's3_url': value['s3Url'],
41
43
  };
42
44
  }
43
45
  export const ChunkMetadataInputPropertyValidationAttributesMap = {};
@@ -22,6 +22,12 @@ export interface ChunkMetadataOutput {
22
22
  * @memberof ChunkMetadataOutput
23
23
  */
24
24
  polygons?: Array<PolygonReference>;
25
+ /**
26
+ * Full s3:// URI to the visual asset for this chunk. Set for IMAGE and TABLE chunks.
27
+ * @type {string}
28
+ * @memberof ChunkMetadataOutput
29
+ */
30
+ s3Url?: string;
25
31
  }
26
32
  /**
27
33
  * Check if a given object implements the ChunkMetadataOutput interface.
@@ -27,6 +27,7 @@ export function ChunkMetadataOutputFromJSONTyped(json, ignoreDiscriminator) {
27
27
  }
28
28
  return {
29
29
  'polygons': json['polygons'] == null ? undefined : (json['polygons'].map(PolygonReferenceFromJSON)),
30
+ 's3Url': json['s3_url'] == null ? undefined : json['s3_url'],
30
31
  };
31
32
  }
32
33
  export function ChunkMetadataOutputToJSON(json) {
@@ -38,6 +39,7 @@ export function ChunkMetadataOutputToJSONTyped(value, ignoreDiscriminator = fals
38
39
  }
39
40
  return {
40
41
  'polygons': value['polygons'] == null ? undefined : (value['polygons'].map(PolygonReferenceToJSON)),
42
+ 's3_url': value['s3Url'],
41
43
  };
42
44
  }
43
45
  export const ChunkMetadataOutputPropertyValidationAttributesMap = {};
@@ -0,0 +1,47 @@
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
+ * Response model for the clear version contents endpoint.
14
+ * @export
15
+ * @interface ClearVersionContentsResponse
16
+ */
17
+ export interface ClearVersionContentsResponse {
18
+ /**
19
+ * Number of top-level children deleted
20
+ * @type {number}
21
+ * @memberof ClearVersionContentsResponse
22
+ */
23
+ deleted: number;
24
+ }
25
+ /**
26
+ * Check if a given object implements the ClearVersionContentsResponse interface.
27
+ */
28
+ export declare function instanceOfClearVersionContentsResponse(value: object): value is ClearVersionContentsResponse;
29
+ export declare function ClearVersionContentsResponseFromJSON(json: any): ClearVersionContentsResponse;
30
+ export declare function ClearVersionContentsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClearVersionContentsResponse;
31
+ export declare function ClearVersionContentsResponseToJSON(json: any): ClearVersionContentsResponse;
32
+ export declare function ClearVersionContentsResponseToJSONTyped(value?: ClearVersionContentsResponse | null, ignoreDiscriminator?: boolean): any;
33
+ export declare const ClearVersionContentsResponsePropertyValidationAttributesMap: {
34
+ [property: string]: {
35
+ maxLength?: number;
36
+ minLength?: number;
37
+ pattern?: string;
38
+ maximum?: number;
39
+ exclusiveMaximum?: boolean;
40
+ minimum?: number;
41
+ exclusiveMinimum?: boolean;
42
+ multipleOf?: number;
43
+ maxItems?: number;
44
+ minItems?: number;
45
+ uniqueItems?: boolean;
46
+ };
47
+ };
@@ -0,0 +1,44 @@
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 ClearVersionContentsResponse interface.
16
+ */
17
+ export function instanceOfClearVersionContentsResponse(value) {
18
+ if (!('deleted' in value) || value['deleted'] === undefined)
19
+ return false;
20
+ return true;
21
+ }
22
+ export function ClearVersionContentsResponseFromJSON(json) {
23
+ return ClearVersionContentsResponseFromJSONTyped(json, false);
24
+ }
25
+ export function ClearVersionContentsResponseFromJSONTyped(json, ignoreDiscriminator) {
26
+ if (json == null) {
27
+ return json;
28
+ }
29
+ return {
30
+ 'deleted': json['deleted'],
31
+ };
32
+ }
33
+ export function ClearVersionContentsResponseToJSON(json) {
34
+ return ClearVersionContentsResponseToJSONTyped(json, false);
35
+ }
36
+ export function ClearVersionContentsResponseToJSONTyped(value, ignoreDiscriminator = false) {
37
+ if (value == null) {
38
+ return value;
39
+ }
40
+ return {
41
+ 'deleted': value['deleted'],
42
+ };
43
+ }
44
+ export const ClearVersionContentsResponsePropertyValidationAttributesMap = {};
@@ -15,6 +15,7 @@
15
15
  */
16
16
  export declare const DocumentType: {
17
17
  readonly Pdf: "PDF";
18
+ readonly Docx: "DOCX";
18
19
  readonly Unknown: "UNKNOWN";
19
20
  };
20
21
  export type DocumentType = typeof DocumentType[keyof typeof DocumentType];
@@ -17,6 +17,7 @@
17
17
  */
18
18
  export const DocumentType = {
19
19
  Pdf: 'PDF',
20
+ Docx: 'DOCX',
20
21
  Unknown: 'UNKNOWN'
21
22
  };
22
23
  export function instanceOfDocumentType(value) {
@@ -4,6 +4,7 @@ export * from './ChunkMetadataOutput';
4
4
  export * from './ChunkResponse';
5
5
  export * from './ChunkSearchRequest';
6
6
  export * from './ChunkType';
7
+ export * from './ClearVersionContentsResponse';
7
8
  export * from './CreateChunkLineageRequest';
8
9
  export * from './CreateChunkRequest';
9
10
  export * from './CreateDocumentRequest';
@@ -6,6 +6,7 @@ export * from './ChunkMetadataOutput';
6
6
  export * from './ChunkResponse';
7
7
  export * from './ChunkSearchRequest';
8
8
  export * from './ChunkType';
9
+ export * from './ClearVersionContentsResponse';
9
10
  export * from './CreateChunkLineageRequest';
10
11
  export * from './CreateChunkRequest';
11
12
  export * from './CreateDocumentRequest';
@@ -22,6 +22,12 @@ export interface ChunkMetadataInput {
22
22
  * @memberof ChunkMetadataInput
23
23
  */
24
24
  polygons?: Array<PolygonReference>;
25
+ /**
26
+ * Full s3:// URI to the visual asset for this chunk. Set for IMAGE and TABLE chunks.
27
+ * @type {string}
28
+ * @memberof ChunkMetadataInput
29
+ */
30
+ s3Url?: string;
25
31
  }
26
32
  /**
27
33
  * Check if a given object implements the ChunkMetadataInput interface.
@@ -35,6 +35,7 @@ function ChunkMetadataInputFromJSONTyped(json, ignoreDiscriminator) {
35
35
  }
36
36
  return {
37
37
  'polygons': json['polygons'] == null ? undefined : (json['polygons'].map(PolygonReference_1.PolygonReferenceFromJSON)),
38
+ 's3Url': json['s3_url'] == null ? undefined : json['s3_url'],
38
39
  };
39
40
  }
40
41
  function ChunkMetadataInputToJSON(json) {
@@ -46,6 +47,7 @@ function ChunkMetadataInputToJSONTyped(value, ignoreDiscriminator = false) {
46
47
  }
47
48
  return {
48
49
  'polygons': value['polygons'] == null ? undefined : (value['polygons'].map(PolygonReference_1.PolygonReferenceToJSON)),
50
+ 's3_url': value['s3Url'],
49
51
  };
50
52
  }
51
53
  exports.ChunkMetadataInputPropertyValidationAttributesMap = {};
@@ -22,6 +22,12 @@ export interface ChunkMetadataOutput {
22
22
  * @memberof ChunkMetadataOutput
23
23
  */
24
24
  polygons?: Array<PolygonReference>;
25
+ /**
26
+ * Full s3:// URI to the visual asset for this chunk. Set for IMAGE and TABLE chunks.
27
+ * @type {string}
28
+ * @memberof ChunkMetadataOutput
29
+ */
30
+ s3Url?: string;
25
31
  }
26
32
  /**
27
33
  * Check if a given object implements the ChunkMetadataOutput interface.
@@ -35,6 +35,7 @@ function ChunkMetadataOutputFromJSONTyped(json, ignoreDiscriminator) {
35
35
  }
36
36
  return {
37
37
  'polygons': json['polygons'] == null ? undefined : (json['polygons'].map(PolygonReference_1.PolygonReferenceFromJSON)),
38
+ 's3Url': json['s3_url'] == null ? undefined : json['s3_url'],
38
39
  };
39
40
  }
40
41
  function ChunkMetadataOutputToJSON(json) {
@@ -46,6 +47,7 @@ function ChunkMetadataOutputToJSONTyped(value, ignoreDiscriminator = false) {
46
47
  }
47
48
  return {
48
49
  'polygons': value['polygons'] == null ? undefined : (value['polygons'].map(PolygonReference_1.PolygonReferenceToJSON)),
50
+ 's3_url': value['s3Url'],
49
51
  };
50
52
  }
51
53
  exports.ChunkMetadataOutputPropertyValidationAttributesMap = {};
@@ -0,0 +1,47 @@
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
+ * Response model for the clear version contents endpoint.
14
+ * @export
15
+ * @interface ClearVersionContentsResponse
16
+ */
17
+ export interface ClearVersionContentsResponse {
18
+ /**
19
+ * Number of top-level children deleted
20
+ * @type {number}
21
+ * @memberof ClearVersionContentsResponse
22
+ */
23
+ deleted: number;
24
+ }
25
+ /**
26
+ * Check if a given object implements the ClearVersionContentsResponse interface.
27
+ */
28
+ export declare function instanceOfClearVersionContentsResponse(value: object): value is ClearVersionContentsResponse;
29
+ export declare function ClearVersionContentsResponseFromJSON(json: any): ClearVersionContentsResponse;
30
+ export declare function ClearVersionContentsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClearVersionContentsResponse;
31
+ export declare function ClearVersionContentsResponseToJSON(json: any): ClearVersionContentsResponse;
32
+ export declare function ClearVersionContentsResponseToJSONTyped(value?: ClearVersionContentsResponse | null, ignoreDiscriminator?: boolean): any;
33
+ export declare const ClearVersionContentsResponsePropertyValidationAttributesMap: {
34
+ [property: string]: {
35
+ maxLength?: number;
36
+ minLength?: number;
37
+ pattern?: string;
38
+ maximum?: number;
39
+ exclusiveMaximum?: boolean;
40
+ minimum?: number;
41
+ exclusiveMinimum?: boolean;
42
+ multipleOf?: number;
43
+ maxItems?: number;
44
+ minItems?: number;
45
+ uniqueItems?: boolean;
46
+ };
47
+ };
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Knowledge Stack API
6
+ * Knowledge Stack backend API for authentication and knowledge management
7
+ *
8
+ * The version of the OpenAPI document: 0.1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ClearVersionContentsResponsePropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfClearVersionContentsResponse = instanceOfClearVersionContentsResponse;
18
+ exports.ClearVersionContentsResponseFromJSON = ClearVersionContentsResponseFromJSON;
19
+ exports.ClearVersionContentsResponseFromJSONTyped = ClearVersionContentsResponseFromJSONTyped;
20
+ exports.ClearVersionContentsResponseToJSON = ClearVersionContentsResponseToJSON;
21
+ exports.ClearVersionContentsResponseToJSONTyped = ClearVersionContentsResponseToJSONTyped;
22
+ /**
23
+ * Check if a given object implements the ClearVersionContentsResponse interface.
24
+ */
25
+ function instanceOfClearVersionContentsResponse(value) {
26
+ if (!('deleted' in value) || value['deleted'] === undefined)
27
+ return false;
28
+ return true;
29
+ }
30
+ function ClearVersionContentsResponseFromJSON(json) {
31
+ return ClearVersionContentsResponseFromJSONTyped(json, false);
32
+ }
33
+ function ClearVersionContentsResponseFromJSONTyped(json, ignoreDiscriminator) {
34
+ if (json == null) {
35
+ return json;
36
+ }
37
+ return {
38
+ 'deleted': json['deleted'],
39
+ };
40
+ }
41
+ function ClearVersionContentsResponseToJSON(json) {
42
+ return ClearVersionContentsResponseToJSONTyped(json, false);
43
+ }
44
+ function ClearVersionContentsResponseToJSONTyped(value, ignoreDiscriminator = false) {
45
+ if (value == null) {
46
+ return value;
47
+ }
48
+ return {
49
+ 'deleted': value['deleted'],
50
+ };
51
+ }
52
+ exports.ClearVersionContentsResponsePropertyValidationAttributesMap = {};
@@ -15,6 +15,7 @@
15
15
  */
16
16
  export declare const DocumentType: {
17
17
  readonly Pdf: "PDF";
18
+ readonly Docx: "DOCX";
18
19
  readonly Unknown: "UNKNOWN";
19
20
  };
20
21
  export type DocumentType = typeof DocumentType[keyof typeof DocumentType];
@@ -25,6 +25,7 @@ exports.DocumentTypeToJSONTyped = DocumentTypeToJSONTyped;
25
25
  */
26
26
  exports.DocumentType = {
27
27
  Pdf: 'PDF',
28
+ Docx: 'DOCX',
28
29
  Unknown: 'UNKNOWN'
29
30
  };
30
31
  function instanceOfDocumentType(value) {
@@ -4,6 +4,7 @@ export * from './ChunkMetadataOutput';
4
4
  export * from './ChunkResponse';
5
5
  export * from './ChunkSearchRequest';
6
6
  export * from './ChunkType';
7
+ export * from './ClearVersionContentsResponse';
7
8
  export * from './CreateChunkLineageRequest';
8
9
  export * from './CreateChunkRequest';
9
10
  export * from './CreateDocumentRequest';
@@ -22,6 +22,7 @@ __exportStar(require("./ChunkMetadataOutput"), exports);
22
22
  __exportStar(require("./ChunkResponse"), exports);
23
23
  __exportStar(require("./ChunkSearchRequest"), exports);
24
24
  __exportStar(require("./ChunkType"), exports);
25
+ __exportStar(require("./ClearVersionContentsResponse"), exports);
25
26
  __exportStar(require("./CreateChunkLineageRequest"), exports);
26
27
  __exportStar(require("./CreateChunkRequest"), exports);
27
28
  __exportStar(require("./CreateDocumentRequest"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "1.19.4",
3
+ "version": "1.20.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -15,6 +15,7 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ ClearVersionContentsResponse,
18
19
  DocumentVersionMetadataUpdate,
19
20
  DocumentVersionResponse,
20
21
  HTTPValidationError,
@@ -22,6 +23,8 @@ import type {
22
23
  PaginatedResponseDocumentVersionResponse,
23
24
  } from '../models/index';
24
25
  import {
26
+ ClearVersionContentsResponseFromJSON,
27
+ ClearVersionContentsResponseToJSON,
25
28
  DocumentVersionMetadataUpdateFromJSON,
26
29
  DocumentVersionMetadataUpdateToJSON,
27
30
  DocumentVersionResponseFromJSON,
@@ -34,6 +37,11 @@ import {
34
37
  PaginatedResponseDocumentVersionResponseToJSON,
35
38
  } from '../models/index';
36
39
 
40
+ export interface ClearDocumentVersionContentsRequest {
41
+ versionId: string;
42
+ ksUat?: string;
43
+ }
44
+
37
45
  export interface CreateDocumentVersionRequest {
38
46
  documentId: string;
39
47
  ksUat?: string;
@@ -77,6 +85,23 @@ export interface UpdateDocumentVersionMetadataRequest {
77
85
  * @interface DocumentVersionsApiInterface
78
86
  */
79
87
  export interface DocumentVersionsApiInterface {
88
+ /**
89
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
90
+ * @summary Clear Document Version Contents Handler
91
+ * @param {string} versionId DocumentVersion ID
92
+ * @param {string} [ksUat]
93
+ * @param {*} [options] Override http request option.
94
+ * @throws {RequiredError}
95
+ * @memberof DocumentVersionsApiInterface
96
+ */
97
+ clearDocumentVersionContentsRaw(requestParameters: ClearDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ClearVersionContentsResponse>>;
98
+
99
+ /**
100
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
101
+ * Clear Document Version Contents Handler
102
+ */
103
+ clearDocumentVersionContents(requestParameters: ClearDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClearVersionContentsResponse>;
104
+
80
105
  /**
81
106
  * Create a new version for a document. The version number is automatically incremented from the highest existing version.
82
107
  * @summary Create Document Version Handler
@@ -192,6 +217,45 @@ export interface DocumentVersionsApiInterface {
192
217
  */
193
218
  export class DocumentVersionsApi extends runtime.BaseAPI implements DocumentVersionsApiInterface {
194
219
 
220
+ /**
221
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
222
+ * Clear Document Version Contents Handler
223
+ */
224
+ async clearDocumentVersionContentsRaw(requestParameters: ClearDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ClearVersionContentsResponse>> {
225
+ if (requestParameters['versionId'] == null) {
226
+ throw new runtime.RequiredError(
227
+ 'versionId',
228
+ 'Required parameter "versionId" was null or undefined when calling clearDocumentVersionContents().'
229
+ );
230
+ }
231
+
232
+ const queryParameters: any = {};
233
+
234
+ const headerParameters: runtime.HTTPHeaders = {};
235
+
236
+
237
+ let urlPath = `/v1/document_versions/{version_id}/contents`;
238
+ urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
239
+
240
+ const response = await this.request({
241
+ path: urlPath,
242
+ method: 'DELETE',
243
+ headers: headerParameters,
244
+ query: queryParameters,
245
+ }, initOverrides);
246
+
247
+ return new runtime.JSONApiResponse(response, (jsonValue) => ClearVersionContentsResponseFromJSON(jsonValue));
248
+ }
249
+
250
+ /**
251
+ * Delete all sections and chunks under a document version. Removes all content (sections and chunks) from the version while keeping the version itself intact. Used by the ingestion pipeline for idempotent re-processing.
252
+ * Clear Document Version Contents Handler
253
+ */
254
+ async clearDocumentVersionContents(requestParameters: ClearDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClearVersionContentsResponse> {
255
+ const response = await this.clearDocumentVersionContentsRaw(requestParameters, initOverrides);
256
+ return await response.value();
257
+ }
258
+
195
259
  /**
196
260
  * Create a new version for a document. The version number is automatically incremented from the highest existing version.
197
261
  * Create Document Version Handler
@@ -57,7 +57,7 @@ export interface GetDocumentRequest {
57
57
 
58
58
  export interface IngestDocumentRequest {
59
59
  file: Blob;
60
- folderId: string;
60
+ pathPartId: string;
61
61
  ksUat?: string;
62
62
  name?: string;
63
63
  }
@@ -138,7 +138,7 @@ export interface DocumentsApiInterface {
138
138
  * Upload a file, create document + version, and trigger ingestion workflow. Returns 201 with the Temporal workflow ID. Design decision — S3 upload happens *before* the DB write: We pre-generate document and version UUIDs, upload the source file to S3, and only then persist the DB records. If the DB write fails, an orphaned S3 object is left behind (acceptable storage cost cleaned up by the S3 deletion cronjob). The reverse — a committed DB record pointing to a missing S3 object — would crash downstream pipeline activities that expect the file to exist.
139
139
  * @summary Ingest Document Handler
140
140
  * @param {Blob} file
141
- * @param {string} folderId Parent folder ID
141
+ * @param {string} pathPartId Parent path part ID (must be a FOLDER type)
142
142
  * @param {string} [ksUat]
143
143
  * @param {string} [name] Document name (defaults to filename)
144
144
  * @param {*} [options] Override http request option.
@@ -328,10 +328,10 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
328
328
  );
329
329
  }
330
330
 
331
- if (requestParameters['folderId'] == null) {
331
+ if (requestParameters['pathPartId'] == null) {
332
332
  throw new runtime.RequiredError(
333
- 'folderId',
334
- 'Required parameter "folderId" was null or undefined when calling ingestDocument().'
333
+ 'pathPartId',
334
+ 'Required parameter "pathPartId" was null or undefined when calling ingestDocument().'
335
335
  );
336
336
  }
337
337
 
@@ -359,8 +359,8 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
359
359
  formParams.append('file', requestParameters['file'] as any);
360
360
  }
361
361
 
362
- if (requestParameters['folderId'] != null) {
363
- formParams.append('folder_id', requestParameters['folderId'] as any);
362
+ if (requestParameters['pathPartId'] != null) {
363
+ formParams.append('path_part_id', requestParameters['pathPartId'] as any);
364
364
  }
365
365
 
366
366
  if (requestParameters['name'] != null) {
@@ -33,6 +33,12 @@ export interface ChunkMetadataInput {
33
33
  * @memberof ChunkMetadataInput
34
34
  */
35
35
  polygons?: Array<PolygonReference>;
36
+ /**
37
+ * Full s3:// URI to the visual asset for this chunk. Set for IMAGE and TABLE chunks.
38
+ * @type {string}
39
+ * @memberof ChunkMetadataInput
40
+ */
41
+ s3Url?: string;
36
42
  }
37
43
 
38
44
  /**
@@ -53,6 +59,7 @@ export function ChunkMetadataInputFromJSONTyped(json: any, ignoreDiscriminator:
53
59
  return {
54
60
 
55
61
  'polygons': json['polygons'] == null ? undefined : ((json['polygons'] as Array<any>).map(PolygonReferenceFromJSON)),
62
+ 's3Url': json['s3_url'] == null ? undefined : json['s3_url'],
56
63
  };
57
64
  }
58
65
 
@@ -68,6 +75,7 @@ export function ChunkMetadataInputToJSONTyped(value?: ChunkMetadataInput | null,
68
75
  return {
69
76
 
70
77
  'polygons': value['polygons'] == null ? undefined : ((value['polygons'] as Array<any>).map(PolygonReferenceToJSON)),
78
+ 's3_url': value['s3Url'],
71
79
  };
72
80
  }
73
81
 
@@ -33,6 +33,12 @@ export interface ChunkMetadataOutput {
33
33
  * @memberof ChunkMetadataOutput
34
34
  */
35
35
  polygons?: Array<PolygonReference>;
36
+ /**
37
+ * Full s3:// URI to the visual asset for this chunk. Set for IMAGE and TABLE chunks.
38
+ * @type {string}
39
+ * @memberof ChunkMetadataOutput
40
+ */
41
+ s3Url?: string;
36
42
  }
37
43
 
38
44
  /**
@@ -53,6 +59,7 @@ export function ChunkMetadataOutputFromJSONTyped(json: any, ignoreDiscriminator:
53
59
  return {
54
60
 
55
61
  'polygons': json['polygons'] == null ? undefined : ((json['polygons'] as Array<any>).map(PolygonReferenceFromJSON)),
62
+ 's3Url': json['s3_url'] == null ? undefined : json['s3_url'],
56
63
  };
57
64
  }
58
65
 
@@ -68,6 +75,7 @@ export function ChunkMetadataOutputToJSONTyped(value?: ChunkMetadataOutput | nul
68
75
  return {
69
76
 
70
77
  'polygons': value['polygons'] == null ? undefined : ((value['polygons'] as Array<any>).map(PolygonReferenceToJSON)),
78
+ 's3_url': value['s3Url'],
71
79
  };
72
80
  }
73
81
 
@@ -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
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * Response model for the clear version contents endpoint.
18
+ * @export
19
+ * @interface ClearVersionContentsResponse
20
+ */
21
+ export interface ClearVersionContentsResponse {
22
+ /**
23
+ * Number of top-level children deleted
24
+ * @type {number}
25
+ * @memberof ClearVersionContentsResponse
26
+ */
27
+ deleted: number;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the ClearVersionContentsResponse interface.
32
+ */
33
+ export function instanceOfClearVersionContentsResponse(value: object): value is ClearVersionContentsResponse {
34
+ if (!('deleted' in value) || value['deleted'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function ClearVersionContentsResponseFromJSON(json: any): ClearVersionContentsResponse {
39
+ return ClearVersionContentsResponseFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function ClearVersionContentsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClearVersionContentsResponse {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'deleted': json['deleted'],
49
+ };
50
+ }
51
+
52
+ export function ClearVersionContentsResponseToJSON(json: any): ClearVersionContentsResponse {
53
+ return ClearVersionContentsResponseToJSONTyped(json, false);
54
+ }
55
+
56
+ export function ClearVersionContentsResponseToJSONTyped(value?: ClearVersionContentsResponse | null, ignoreDiscriminator: boolean = false): any {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+
61
+ return {
62
+
63
+ 'deleted': value['deleted'],
64
+ };
65
+ }
66
+
67
+ export const ClearVersionContentsResponsePropertyValidationAttributesMap: {
68
+ [property: string]: {
69
+ maxLength?: number,
70
+ minLength?: number,
71
+ pattern?: string,
72
+ maximum?: number,
73
+ exclusiveMaximum?: boolean,
74
+ minimum?: number,
75
+ exclusiveMinimum?: boolean,
76
+ multipleOf?: number,
77
+ maxItems?: number,
78
+ minItems?: number,
79
+ uniqueItems?: boolean
80
+ }
81
+ } = {
82
+ }
83
+
@@ -19,6 +19,7 @@
19
19
  */
20
20
  export const DocumentType = {
21
21
  Pdf: 'PDF',
22
+ Docx: 'DOCX',
22
23
  Unknown: 'UNKNOWN'
23
24
  } as const;
24
25
  export type DocumentType = typeof DocumentType[keyof typeof DocumentType];
@@ -6,6 +6,7 @@ export * from './ChunkMetadataOutput';
6
6
  export * from './ChunkResponse';
7
7
  export * from './ChunkSearchRequest';
8
8
  export * from './ChunkType';
9
+ export * from './ClearVersionContentsResponse';
9
10
  export * from './CreateChunkLineageRequest';
10
11
  export * from './CreateChunkRequest';
11
12
  export * from './CreateDocumentRequest';