@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.
Files changed (103) hide show
  1. package/.openapi-generator/FILES +14 -0
  2. package/README.md +2 -2
  3. package/dist/apis/ChunksApi.d.ts +175 -0
  4. package/dist/apis/ChunksApi.js +203 -0
  5. package/dist/apis/DocumentVersionsApi.d.ts +36 -1
  6. package/dist/apis/DocumentVersionsApi.js +41 -0
  7. package/dist/apis/FoldersApi.d.ts +38 -1
  8. package/dist/apis/FoldersApi.js +44 -0
  9. package/dist/apis/PathPartsApi.d.ts +4 -6
  10. package/dist/apis/PathPartsApi.js +2 -5
  11. package/dist/apis/index.d.ts +1 -0
  12. package/dist/apis/index.js +1 -0
  13. package/dist/esm/apis/ChunksApi.d.ts +175 -0
  14. package/dist/esm/apis/ChunksApi.js +199 -0
  15. package/dist/esm/apis/DocumentVersionsApi.d.ts +36 -1
  16. package/dist/esm/apis/DocumentVersionsApi.js +42 -1
  17. package/dist/esm/apis/FoldersApi.d.ts +38 -1
  18. package/dist/esm/apis/FoldersApi.js +45 -1
  19. package/dist/esm/apis/PathPartsApi.d.ts +4 -6
  20. package/dist/esm/apis/PathPartsApi.js +2 -5
  21. package/dist/esm/apis/index.d.ts +1 -0
  22. package/dist/esm/apis/index.js +1 -0
  23. package/dist/esm/models/ChunkMetadataInput.d.ts +48 -0
  24. package/dist/esm/models/ChunkMetadataInput.js +43 -0
  25. package/dist/esm/models/ChunkMetadataOutput.d.ts +48 -0
  26. package/dist/esm/models/ChunkMetadataOutput.js +43 -0
  27. package/dist/esm/models/ChunkResponse.d.ts +115 -0
  28. package/dist/esm/models/ChunkResponse.js +86 -0
  29. package/dist/esm/models/ChunkType.d.ts +27 -0
  30. package/dist/esm/models/ChunkType.js +45 -0
  31. package/dist/esm/models/CreateChunkRequest.d.ts +73 -0
  32. package/dist/esm/models/CreateChunkRequest.js +64 -0
  33. package/dist/esm/models/DocumentContentPathPart.d.ts +119 -0
  34. package/dist/esm/models/DocumentContentPathPart.js +83 -0
  35. package/dist/esm/models/FolderDocumentResponse.d.ts +138 -0
  36. package/dist/esm/models/FolderDocumentResponse.js +88 -0
  37. package/dist/esm/models/PaginatedResponseDocumentContentPathPart.d.ts +66 -0
  38. package/dist/esm/models/PaginatedResponseDocumentContentPathPart.js +70 -0
  39. package/dist/esm/models/PaginatedResponseFolderDocumentResponse.d.ts +66 -0
  40. package/dist/esm/models/PaginatedResponseFolderDocumentResponse.js +70 -0
  41. package/dist/esm/models/PasswordResetWithTokenRequest.d.ts +2 -8
  42. package/dist/esm/models/PasswordResetWithTokenRequest.js +3 -7
  43. package/dist/esm/models/Polygon.d.ts +65 -0
  44. package/dist/esm/models/Polygon.js +56 -0
  45. package/dist/esm/models/PolygonReference.d.ts +54 -0
  46. package/dist/esm/models/PolygonReference.js +49 -0
  47. package/dist/esm/models/UpdateChunkContentRequest.d.ts +54 -0
  48. package/dist/esm/models/UpdateChunkContentRequest.js +51 -0
  49. package/dist/esm/models/UpdateChunkMetadataRequest.d.ts +48 -0
  50. package/dist/esm/models/UpdateChunkMetadataRequest.js +45 -0
  51. package/dist/esm/models/index.d.ts +13 -0
  52. package/dist/esm/models/index.js +13 -0
  53. package/dist/models/ChunkMetadataInput.d.ts +48 -0
  54. package/dist/models/ChunkMetadataInput.js +51 -0
  55. package/dist/models/ChunkMetadataOutput.d.ts +48 -0
  56. package/dist/models/ChunkMetadataOutput.js +51 -0
  57. package/dist/models/ChunkResponse.d.ts +115 -0
  58. package/dist/models/ChunkResponse.js +94 -0
  59. package/dist/models/ChunkType.d.ts +27 -0
  60. package/dist/models/ChunkType.js +53 -0
  61. package/dist/models/CreateChunkRequest.d.ts +73 -0
  62. package/dist/models/CreateChunkRequest.js +72 -0
  63. package/dist/models/DocumentContentPathPart.d.ts +119 -0
  64. package/dist/models/DocumentContentPathPart.js +91 -0
  65. package/dist/models/FolderDocumentResponse.d.ts +138 -0
  66. package/dist/models/FolderDocumentResponse.js +96 -0
  67. package/dist/models/PaginatedResponseDocumentContentPathPart.d.ts +66 -0
  68. package/dist/models/PaginatedResponseDocumentContentPathPart.js +78 -0
  69. package/dist/models/PaginatedResponseFolderDocumentResponse.d.ts +66 -0
  70. package/dist/models/PaginatedResponseFolderDocumentResponse.js +78 -0
  71. package/dist/models/PasswordResetWithTokenRequest.d.ts +2 -8
  72. package/dist/models/PasswordResetWithTokenRequest.js +3 -7
  73. package/dist/models/Polygon.d.ts +65 -0
  74. package/dist/models/Polygon.js +64 -0
  75. package/dist/models/PolygonReference.d.ts +54 -0
  76. package/dist/models/PolygonReference.js +57 -0
  77. package/dist/models/UpdateChunkContentRequest.d.ts +54 -0
  78. package/dist/models/UpdateChunkContentRequest.js +59 -0
  79. package/dist/models/UpdateChunkMetadataRequest.d.ts +48 -0
  80. package/dist/models/UpdateChunkMetadataRequest.js +53 -0
  81. package/dist/models/index.d.ts +13 -0
  82. package/dist/models/index.js +13 -0
  83. package/package.json +1 -1
  84. package/src/apis/ChunksApi.ts +381 -0
  85. package/src/apis/DocumentVersionsApi.ts +82 -0
  86. package/src/apis/FoldersApi.ts +88 -0
  87. package/src/apis/PathPartsApi.ts +4 -10
  88. package/src/apis/index.ts +1 -0
  89. package/src/models/ChunkMetadataInput.ts +90 -0
  90. package/src/models/ChunkMetadataOutput.ts +90 -0
  91. package/src/models/ChunkResponse.ts +197 -0
  92. package/src/models/ChunkType.ts +55 -0
  93. package/src/models/CreateChunkRequest.ts +138 -0
  94. package/src/models/DocumentContentPathPart.ts +205 -0
  95. package/src/models/FolderDocumentResponse.ts +234 -0
  96. package/src/models/PaginatedResponseDocumentContentPathPart.ts +130 -0
  97. package/src/models/PaginatedResponseFolderDocumentResponse.ts +130 -0
  98. package/src/models/PasswordResetWithTokenRequest.ts +5 -14
  99. package/src/models/Polygon.ts +110 -0
  100. package/src/models/PolygonReference.ts +100 -0
  101. package/src/models/UpdateChunkContentRequest.ts +104 -0
  102. package/src/models/UpdateChunkMetadataRequest.ts +91 -0
  103. package/src/models/index.ts +13 -0
@@ -4,6 +4,7 @@
4
4
  README.md
5
5
  package.json
6
6
  src/apis/AuthApi.ts
7
+ src/apis/ChunksApi.ts
7
8
  src/apis/DefaultApi.ts
8
9
  src/apis/DocumentVersionsApi.ts
9
10
  src/apis/DocumentsApi.ts
@@ -15,17 +16,24 @@ src/apis/TenantsApi.ts
15
16
  src/apis/UsersApi.ts
16
17
  src/apis/index.ts
17
18
  src/index.ts
19
+ src/models/ChunkMetadataInput.ts
20
+ src/models/ChunkMetadataOutput.ts
21
+ src/models/ChunkResponse.ts
22
+ src/models/ChunkType.ts
23
+ src/models/CreateChunkRequest.ts
18
24
  src/models/CreateDocumentRequest.ts
19
25
  src/models/CreateFolderRequest.ts
20
26
  src/models/CreatePasswordUserRequest.ts
21
27
  src/models/CreateSectionRequest.ts
22
28
  src/models/CreateTenantRequest.ts
29
+ src/models/DocumentContentPathPart.ts
23
30
  src/models/DocumentOrigin.ts
24
31
  src/models/DocumentResponse.ts
25
32
  src/models/DocumentType.ts
26
33
  src/models/DocumentVersionResponse.ts
27
34
  src/models/EmailSentResponse.ts
28
35
  src/models/EmailVerificationRequest.ts
36
+ src/models/FolderDocumentResponse.ts
29
37
  src/models/FolderResponse.ts
30
38
  src/models/HTTPValidationError.ts
31
39
  src/models/HealthCheckResponse.ts
@@ -34,8 +42,10 @@ src/models/InviteResponse.ts
34
42
  src/models/InviteStatus.ts
35
43
  src/models/InviteUserRequest.ts
36
44
  src/models/OAuth2Config.ts
45
+ src/models/PaginatedResponseDocumentContentPathPart.ts
37
46
  src/models/PaginatedResponseDocumentResponse.ts
38
47
  src/models/PaginatedResponseDocumentVersionResponse.ts
48
+ src/models/PaginatedResponseFolderDocumentResponse.ts
39
49
  src/models/PaginatedResponseFolderResponse.ts
40
50
  src/models/PaginatedResponseInviteResponse.ts
41
51
  src/models/PaginatedResponsePathPartResponse.ts
@@ -46,12 +56,16 @@ src/models/PasswordResetRequest.ts
46
56
  src/models/PasswordResetWithTokenRequest.ts
47
57
  src/models/PathOrder.ts
48
58
  src/models/PathPartResponse.ts
59
+ src/models/Polygon.ts
60
+ src/models/PolygonReference.ts
49
61
  src/models/RootResponse.ts
50
62
  src/models/SectionResponse.ts
51
63
  src/models/SignInRequest.ts
52
64
  src/models/TenantResponse.ts
53
65
  src/models/TenantUserInTenantResponse.ts
54
66
  src/models/TenantUserRole.ts
67
+ src/models/UpdateChunkContentRequest.ts
68
+ src/models/UpdateChunkMetadataRequest.ts
55
69
  src/models/UpdateDocumentRequest.ts
56
70
  src/models/UpdateFolderRequest.ts
57
71
  src/models/UpdateSectionRequest.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @knowledge-stack/ksapi@1.7.0
1
+ ## @knowledge-stack/ksapi@1.9.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.7.0 --save
39
+ npm install @knowledge-stack/ksapi@1.9.0 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -0,0 +1,175 @@
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 * as runtime from '../runtime';
13
+ import type { ChunkResponse, CreateChunkRequest, UpdateChunkContentRequest, UpdateChunkMetadataRequest } from '../models/index';
14
+ export interface CreateChunkOperationRequest {
15
+ createChunkRequest: CreateChunkRequest;
16
+ ksUat?: string;
17
+ }
18
+ export interface DeleteChunkRequest {
19
+ chunkId: string;
20
+ ksUat?: string;
21
+ }
22
+ export interface GetChunkRequest {
23
+ chunkId: string;
24
+ ksUat?: string;
25
+ }
26
+ export interface UpdateChunkContentOperationRequest {
27
+ chunkId: string;
28
+ updateChunkContentRequest: UpdateChunkContentRequest;
29
+ ksUat?: string;
30
+ }
31
+ export interface UpdateChunkMetadataOperationRequest {
32
+ chunkId: string;
33
+ updateChunkMetadataRequest: UpdateChunkMetadataRequest;
34
+ ksUat?: string;
35
+ }
36
+ /**
37
+ * ChunksApi - interface
38
+ *
39
+ * @export
40
+ * @interface ChunksApiInterface
41
+ */
42
+ export interface ChunksApiInterface {
43
+ /**
44
+ * 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.
45
+ * @summary Create Chunk Handler
46
+ * @param {CreateChunkRequest} createChunkRequest
47
+ * @param {string} [ksUat]
48
+ * @param {*} [options] Override http request option.
49
+ * @throws {RequiredError}
50
+ * @memberof ChunksApiInterface
51
+ */
52
+ createChunkRaw(requestParameters: CreateChunkOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>>;
53
+ /**
54
+ * 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.
55
+ * Create Chunk Handler
56
+ */
57
+ createChunk(requestParameters: CreateChunkOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
58
+ /**
59
+ * Delete a chunk. The chunk is deleted via its PathPart (cascading delete). The associated ChunkContent may remain if shared by other chunks.
60
+ * @summary Delete Chunk Handler
61
+ * @param {string} chunkId
62
+ * @param {string} [ksUat]
63
+ * @param {*} [options] Override http request option.
64
+ * @throws {RequiredError}
65
+ * @memberof ChunksApiInterface
66
+ */
67
+ deleteChunkRaw(requestParameters: DeleteChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
68
+ /**
69
+ * Delete a chunk. The chunk is deleted via its PathPart (cascading delete). The associated ChunkContent may remain if shared by other chunks.
70
+ * Delete Chunk Handler
71
+ */
72
+ deleteChunk(requestParameters: DeleteChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
73
+ /**
74
+ * Get a chunk by its ID, including content.
75
+ * @summary Get Chunk Handler
76
+ * @param {string} chunkId
77
+ * @param {string} [ksUat]
78
+ * @param {*} [options] Override http request option.
79
+ * @throws {RequiredError}
80
+ * @memberof ChunksApiInterface
81
+ */
82
+ getChunkRaw(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>>;
83
+ /**
84
+ * Get a chunk by its ID, including content.
85
+ * Get Chunk Handler
86
+ */
87
+ getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
88
+ /**
89
+ * 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.
90
+ * @summary Update Chunk Content Handler
91
+ * @param {string} chunkId
92
+ * @param {UpdateChunkContentRequest} updateChunkContentRequest
93
+ * @param {string} [ksUat]
94
+ * @param {*} [options] Override http request option.
95
+ * @throws {RequiredError}
96
+ * @memberof ChunksApiInterface
97
+ */
98
+ updateChunkContentRaw(requestParameters: UpdateChunkContentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>>;
99
+ /**
100
+ * 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.
101
+ * Update Chunk Content Handler
102
+ */
103
+ updateChunkContent(requestParameters: UpdateChunkContentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
104
+ /**
105
+ * Update chunk metadata by merging with existing metadata. The provided metadata is shallow-merged into the existing chunk_metadata.
106
+ * @summary Update Chunk Metadata Handler
107
+ * @param {string} chunkId
108
+ * @param {UpdateChunkMetadataRequest} updateChunkMetadataRequest
109
+ * @param {string} [ksUat]
110
+ * @param {*} [options] Override http request option.
111
+ * @throws {RequiredError}
112
+ * @memberof ChunksApiInterface
113
+ */
114
+ updateChunkMetadataRaw(requestParameters: UpdateChunkMetadataOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>>;
115
+ /**
116
+ * Update chunk metadata by merging with existing metadata. The provided metadata is shallow-merged into the existing chunk_metadata.
117
+ * Update Chunk Metadata Handler
118
+ */
119
+ updateChunkMetadata(requestParameters: UpdateChunkMetadataOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
120
+ }
121
+ /**
122
+ *
123
+ */
124
+ export declare class ChunksApi extends runtime.BaseAPI implements ChunksApiInterface {
125
+ /**
126
+ * 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.
127
+ * Create Chunk Handler
128
+ */
129
+ createChunkRaw(requestParameters: CreateChunkOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>>;
130
+ /**
131
+ * 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.
132
+ * Create Chunk Handler
133
+ */
134
+ createChunk(requestParameters: CreateChunkOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
135
+ /**
136
+ * Delete a chunk. The chunk is deleted via its PathPart (cascading delete). The associated ChunkContent may remain if shared by other chunks.
137
+ * Delete Chunk Handler
138
+ */
139
+ deleteChunkRaw(requestParameters: DeleteChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
140
+ /**
141
+ * Delete a chunk. The chunk is deleted via its PathPart (cascading delete). The associated ChunkContent may remain if shared by other chunks.
142
+ * Delete Chunk Handler
143
+ */
144
+ deleteChunk(requestParameters: DeleteChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
145
+ /**
146
+ * Get a chunk by its ID, including content.
147
+ * Get Chunk Handler
148
+ */
149
+ getChunkRaw(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>>;
150
+ /**
151
+ * Get a chunk by its ID, including content.
152
+ * Get Chunk Handler
153
+ */
154
+ getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
155
+ /**
156
+ * 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.
157
+ * Update Chunk Content Handler
158
+ */
159
+ updateChunkContentRaw(requestParameters: UpdateChunkContentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>>;
160
+ /**
161
+ * 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.
162
+ * Update Chunk Content Handler
163
+ */
164
+ updateChunkContent(requestParameters: UpdateChunkContentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
165
+ /**
166
+ * Update chunk metadata by merging with existing metadata. The provided metadata is shallow-merged into the existing chunk_metadata.
167
+ * Update Chunk Metadata Handler
168
+ */
169
+ updateChunkMetadataRaw(requestParameters: UpdateChunkMetadataOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>>;
170
+ /**
171
+ * Update chunk metadata by merging with existing metadata. The provided metadata is shallow-merged into the existing chunk_metadata.
172
+ * Update Chunk Metadata Handler
173
+ */
174
+ updateChunkMetadata(requestParameters: UpdateChunkMetadataOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
175
+ }
@@ -0,0 +1,203 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.ChunksApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const index_1 = require("../models/index");
28
+ /**
29
+ *
30
+ */
31
+ class ChunksApi extends runtime.BaseAPI {
32
+ /**
33
+ * 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.
34
+ * Create Chunk Handler
35
+ */
36
+ createChunkRaw(requestParameters, initOverrides) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (requestParameters['createChunkRequest'] == null) {
39
+ throw new runtime.RequiredError('createChunkRequest', 'Required parameter "createChunkRequest" was null or undefined when calling createChunk().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ headerParameters['Content-Type'] = 'application/json';
44
+ let urlPath = `/v1/chunks`;
45
+ const response = yield this.request({
46
+ path: urlPath,
47
+ method: 'POST',
48
+ headers: headerParameters,
49
+ query: queryParameters,
50
+ body: (0, index_1.CreateChunkRequestToJSON)(requestParameters['createChunkRequest']),
51
+ }, initOverrides);
52
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ChunkResponseFromJSON)(jsonValue));
53
+ });
54
+ }
55
+ /**
56
+ * 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.
57
+ * Create Chunk Handler
58
+ */
59
+ createChunk(requestParameters, initOverrides) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ const response = yield this.createChunkRaw(requestParameters, initOverrides);
62
+ return yield response.value();
63
+ });
64
+ }
65
+ /**
66
+ * Delete a chunk. The chunk is deleted via its PathPart (cascading delete). The associated ChunkContent may remain if shared by other chunks.
67
+ * Delete Chunk Handler
68
+ */
69
+ deleteChunkRaw(requestParameters, initOverrides) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ if (requestParameters['chunkId'] == null) {
72
+ throw new runtime.RequiredError('chunkId', 'Required parameter "chunkId" was null or undefined when calling deleteChunk().');
73
+ }
74
+ const queryParameters = {};
75
+ const headerParameters = {};
76
+ let urlPath = `/v1/chunks/{chunk_id}`;
77
+ urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
78
+ const response = yield this.request({
79
+ path: urlPath,
80
+ method: 'DELETE',
81
+ headers: headerParameters,
82
+ query: queryParameters,
83
+ }, initOverrides);
84
+ return new runtime.VoidApiResponse(response);
85
+ });
86
+ }
87
+ /**
88
+ * Delete a chunk. The chunk is deleted via its PathPart (cascading delete). The associated ChunkContent may remain if shared by other chunks.
89
+ * Delete Chunk Handler
90
+ */
91
+ deleteChunk(requestParameters, initOverrides) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ yield this.deleteChunkRaw(requestParameters, initOverrides);
94
+ });
95
+ }
96
+ /**
97
+ * Get a chunk by its ID, including content.
98
+ * Get Chunk Handler
99
+ */
100
+ getChunkRaw(requestParameters, initOverrides) {
101
+ return __awaiter(this, void 0, void 0, function* () {
102
+ if (requestParameters['chunkId'] == null) {
103
+ throw new runtime.RequiredError('chunkId', 'Required parameter "chunkId" was null or undefined when calling getChunk().');
104
+ }
105
+ const queryParameters = {};
106
+ const headerParameters = {};
107
+ let urlPath = `/v1/chunks/{chunk_id}`;
108
+ urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
109
+ const response = yield this.request({
110
+ path: urlPath,
111
+ method: 'GET',
112
+ headers: headerParameters,
113
+ query: queryParameters,
114
+ }, initOverrides);
115
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ChunkResponseFromJSON)(jsonValue));
116
+ });
117
+ }
118
+ /**
119
+ * Get a chunk by its ID, including content.
120
+ * Get Chunk Handler
121
+ */
122
+ getChunk(requestParameters, initOverrides) {
123
+ return __awaiter(this, void 0, void 0, function* () {
124
+ const response = yield this.getChunkRaw(requestParameters, initOverrides);
125
+ return yield response.value();
126
+ });
127
+ }
128
+ /**
129
+ * 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.
130
+ * Update Chunk Content Handler
131
+ */
132
+ updateChunkContentRaw(requestParameters, initOverrides) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ if (requestParameters['chunkId'] == null) {
135
+ throw new runtime.RequiredError('chunkId', 'Required parameter "chunkId" was null or undefined when calling updateChunkContent().');
136
+ }
137
+ if (requestParameters['updateChunkContentRequest'] == null) {
138
+ throw new runtime.RequiredError('updateChunkContentRequest', 'Required parameter "updateChunkContentRequest" was null or undefined when calling updateChunkContent().');
139
+ }
140
+ const queryParameters = {};
141
+ const headerParameters = {};
142
+ headerParameters['Content-Type'] = 'application/json';
143
+ let urlPath = `/v1/chunks/{chunk_id}/content`;
144
+ urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
145
+ const response = yield this.request({
146
+ path: urlPath,
147
+ method: 'PATCH',
148
+ headers: headerParameters,
149
+ query: queryParameters,
150
+ body: (0, index_1.UpdateChunkContentRequestToJSON)(requestParameters['updateChunkContentRequest']),
151
+ }, initOverrides);
152
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ChunkResponseFromJSON)(jsonValue));
153
+ });
154
+ }
155
+ /**
156
+ * 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.
157
+ * Update Chunk Content Handler
158
+ */
159
+ updateChunkContent(requestParameters, initOverrides) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ const response = yield this.updateChunkContentRaw(requestParameters, initOverrides);
162
+ return yield response.value();
163
+ });
164
+ }
165
+ /**
166
+ * Update chunk metadata by merging with existing metadata. The provided metadata is shallow-merged into the existing chunk_metadata.
167
+ * Update Chunk Metadata Handler
168
+ */
169
+ updateChunkMetadataRaw(requestParameters, initOverrides) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ if (requestParameters['chunkId'] == null) {
172
+ throw new runtime.RequiredError('chunkId', 'Required parameter "chunkId" was null or undefined when calling updateChunkMetadata().');
173
+ }
174
+ if (requestParameters['updateChunkMetadataRequest'] == null) {
175
+ throw new runtime.RequiredError('updateChunkMetadataRequest', 'Required parameter "updateChunkMetadataRequest" was null or undefined when calling updateChunkMetadata().');
176
+ }
177
+ const queryParameters = {};
178
+ const headerParameters = {};
179
+ headerParameters['Content-Type'] = 'application/json';
180
+ let urlPath = `/v1/chunks/{chunk_id}/metadata`;
181
+ urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
182
+ const response = yield this.request({
183
+ path: urlPath,
184
+ method: 'PATCH',
185
+ headers: headerParameters,
186
+ query: queryParameters,
187
+ body: (0, index_1.UpdateChunkMetadataRequestToJSON)(requestParameters['updateChunkMetadataRequest']),
188
+ }, initOverrides);
189
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ChunkResponseFromJSON)(jsonValue));
190
+ });
191
+ }
192
+ /**
193
+ * Update chunk metadata by merging with existing metadata. The provided metadata is shallow-merged into the existing chunk_metadata.
194
+ * Update Chunk Metadata Handler
195
+ */
196
+ updateChunkMetadata(requestParameters, initOverrides) {
197
+ return __awaiter(this, void 0, void 0, function* () {
198
+ const response = yield this.updateChunkMetadataRaw(requestParameters, initOverrides);
199
+ return yield response.value();
200
+ });
201
+ }
202
+ }
203
+ exports.ChunksApi = ChunksApi;
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { DocumentVersionResponse, PaginatedResponseDocumentVersionResponse } from '../models/index';
13
+ import type { DocumentVersionResponse, PaginatedResponseDocumentContentPathPart, PaginatedResponseDocumentVersionResponse } from '../models/index';
14
14
  export interface CreateDocumentVersionRequest {
15
15
  documentId: string;
16
16
  ksUat?: string;
@@ -23,6 +23,13 @@ export interface GetDocumentVersionRequest {
23
23
  versionId: string;
24
24
  ksUat?: string;
25
25
  }
26
+ export interface GetDocumentVersionContentsRequest {
27
+ versionId: string;
28
+ sectionId?: string;
29
+ limit?: number;
30
+ offset?: number;
31
+ ksUat?: string;
32
+ }
26
33
  export interface ListDocumentVersionsRequest {
27
34
  documentId: string;
28
35
  limit?: number;
@@ -81,6 +88,24 @@ export interface DocumentVersionsApiInterface {
81
88
  * Get Document Version Handler
82
89
  */
83
90
  getDocumentVersion(requestParameters: GetDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
91
+ /**
92
+ * List all sections and chunks for a document version in depth-first logical order. Returns a flat paginated list that can be used to reconstruct the section/chunk hierarchy with content. Sections include page_number; chunks include content, chunk_type, and chunk_metadata.
93
+ * @summary Get Document Version Contents Handler
94
+ * @param {string} versionId DocumentVersion ID
95
+ * @param {string} [sectionId] Optional section ID to scope traversal to a subtree
96
+ * @param {number} [limit] Number of items per page
97
+ * @param {number} [offset] Number of items to skip
98
+ * @param {string} [ksUat]
99
+ * @param {*} [options] Override http request option.
100
+ * @throws {RequiredError}
101
+ * @memberof DocumentVersionsApiInterface
102
+ */
103
+ getDocumentVersionContentsRaw(requestParameters: GetDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentContentPathPart>>;
104
+ /**
105
+ * List all sections and chunks for a document version in depth-first logical order. Returns a flat paginated list that can be used to reconstruct the section/chunk hierarchy with content. Sections include page_number; chunks include content, chunk_type, and chunk_metadata.
106
+ * Get Document Version Contents Handler
107
+ */
108
+ getDocumentVersionContents(requestParameters: GetDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentContentPathPart>;
84
109
  /**
85
110
  * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
86
111
  * @summary List Document Versions Handler
@@ -133,6 +158,16 @@ export declare class DocumentVersionsApi extends runtime.BaseAPI implements Docu
133
158
  * Get Document Version Handler
134
159
  */
135
160
  getDocumentVersion(requestParameters: GetDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
161
+ /**
162
+ * List all sections and chunks for a document version in depth-first logical order. Returns a flat paginated list that can be used to reconstruct the section/chunk hierarchy with content. Sections include page_number; chunks include content, chunk_type, and chunk_metadata.
163
+ * Get Document Version Contents Handler
164
+ */
165
+ getDocumentVersionContentsRaw(requestParameters: GetDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentContentPathPart>>;
166
+ /**
167
+ * List all sections and chunks for a document version in depth-first logical order. Returns a flat paginated list that can be used to reconstruct the section/chunk hierarchy with content. Sections include page_number; chunks include content, chunk_type, and chunk_metadata.
168
+ * Get Document Version Contents Handler
169
+ */
170
+ getDocumentVersionContents(requestParameters: GetDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentContentPathPart>;
136
171
  /**
137
172
  * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
138
173
  * List Document Versions Handler
@@ -124,6 +124,47 @@ class DocumentVersionsApi extends runtime.BaseAPI {
124
124
  return yield response.value();
125
125
  });
126
126
  }
127
+ /**
128
+ * List all sections and chunks for a document version in depth-first logical order. Returns a flat paginated list that can be used to reconstruct the section/chunk hierarchy with content. Sections include page_number; chunks include content, chunk_type, and chunk_metadata.
129
+ * Get Document Version Contents Handler
130
+ */
131
+ getDocumentVersionContentsRaw(requestParameters, initOverrides) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ if (requestParameters['versionId'] == null) {
134
+ throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling getDocumentVersionContents().');
135
+ }
136
+ const queryParameters = {};
137
+ if (requestParameters['sectionId'] != null) {
138
+ queryParameters['section_id'] = requestParameters['sectionId'];
139
+ }
140
+ if (requestParameters['limit'] != null) {
141
+ queryParameters['limit'] = requestParameters['limit'];
142
+ }
143
+ if (requestParameters['offset'] != null) {
144
+ queryParameters['offset'] = requestParameters['offset'];
145
+ }
146
+ const headerParameters = {};
147
+ let urlPath = `/v1/document_versions/{version_id}/contents`;
148
+ urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
149
+ const response = yield this.request({
150
+ path: urlPath,
151
+ method: 'GET',
152
+ headers: headerParameters,
153
+ query: queryParameters,
154
+ }, initOverrides);
155
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedResponseDocumentContentPathPartFromJSON)(jsonValue));
156
+ });
157
+ }
158
+ /**
159
+ * List all sections and chunks for a document version in depth-first logical order. Returns a flat paginated list that can be used to reconstruct the section/chunk hierarchy with content. Sections include page_number; chunks include content, chunk_type, and chunk_metadata.
160
+ * Get Document Version Contents Handler
161
+ */
162
+ getDocumentVersionContents(requestParameters, initOverrides) {
163
+ return __awaiter(this, void 0, void 0, function* () {
164
+ const response = yield this.getDocumentVersionContentsRaw(requestParameters, initOverrides);
165
+ return yield response.value();
166
+ });
167
+ }
127
168
  /**
128
169
  * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
129
170
  * List Document Versions Handler
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { CreateFolderRequest, FolderResponse, PaginatedResponseFolderResponse, PathOrder, UpdateFolderRequest } from '../models/index';
13
+ import type { CreateFolderRequest, FolderResponse, PaginatedResponseFolderDocumentResponse, PaginatedResponseFolderResponse, PathOrder, UpdateFolderRequest } from '../models/index';
14
14
  export interface CreateFolderOperationRequest {
15
15
  createFolderRequest: CreateFolderRequest;
16
16
  ksUat?: string;
@@ -23,6 +23,14 @@ export interface GetFolderRequest {
23
23
  folderId: string;
24
24
  ksUat?: string;
25
25
  }
26
+ export interface ListFolderContentsRequest {
27
+ folderId: string;
28
+ maxDepth?: number;
29
+ sortOrder?: PathOrder;
30
+ limit?: number;
31
+ offset?: number;
32
+ ksUat?: string;
33
+ }
26
34
  export interface ListFoldersRequest {
27
35
  parentId?: string;
28
36
  sortOrder?: PathOrder;
@@ -87,6 +95,25 @@ export interface FoldersApiInterface {
87
95
  * Get Folder Handler
88
96
  */
89
97
  getFolder(requestParameters: GetFolderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FolderResponse>;
98
+ /**
99
+ * List all contents (folders and documents) under a folder. Returns enriched responses with: - Folders: basic folder metadata - Documents: full document metadata including document_type, document_origin, active_version This is the preferred way to list folder contents when you need document metadata. For generic path traversal of folders only, use GET /path-parts.
100
+ * @summary List Folder Contents Handler
101
+ * @param {string} folderId
102
+ * @param {number} [maxDepth] Maximum depth to traverse (1&#x3D;direct children, default: 1)
103
+ * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
104
+ * @param {number} [limit] Number of items per page
105
+ * @param {number} [offset] Number of items to skip
106
+ * @param {string} [ksUat]
107
+ * @param {*} [options] Override http request option.
108
+ * @throws {RequiredError}
109
+ * @memberof FoldersApiInterface
110
+ */
111
+ listFolderContentsRaw(requestParameters: ListFolderContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseFolderDocumentResponse>>;
112
+ /**
113
+ * List all contents (folders and documents) under a folder. Returns enriched responses with: - Folders: basic folder metadata - Documents: full document metadata including document_type, document_origin, active_version This is the preferred way to list folder contents when you need document metadata. For generic path traversal of folders only, use GET /path-parts.
114
+ * List Folder Contents Handler
115
+ */
116
+ listFolderContents(requestParameters: ListFolderContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseFolderDocumentResponse>;
90
117
  /**
91
118
  * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_id is not provided, lists folders in the root folder.
92
119
  * @summary List Folders Handler
@@ -156,6 +183,16 @@ export declare class FoldersApi extends runtime.BaseAPI implements FoldersApiInt
156
183
  * Get Folder Handler
157
184
  */
158
185
  getFolder(requestParameters: GetFolderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FolderResponse>;
186
+ /**
187
+ * List all contents (folders and documents) under a folder. Returns enriched responses with: - Folders: basic folder metadata - Documents: full document metadata including document_type, document_origin, active_version This is the preferred way to list folder contents when you need document metadata. For generic path traversal of folders only, use GET /path-parts.
188
+ * List Folder Contents Handler
189
+ */
190
+ listFolderContentsRaw(requestParameters: ListFolderContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseFolderDocumentResponse>>;
191
+ /**
192
+ * List all contents (folders and documents) under a folder. Returns enriched responses with: - Folders: basic folder metadata - Documents: full document metadata including document_type, document_origin, active_version This is the preferred way to list folder contents when you need document metadata. For generic path traversal of folders only, use GET /path-parts.
193
+ * List Folder Contents Handler
194
+ */
195
+ listFolderContents(requestParameters: ListFolderContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseFolderDocumentResponse>;
159
196
  /**
160
197
  * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_id is not provided, lists folders in the root folder.
161
198
  * List Folders Handler