@knowledge-stack/ksapi 1.61.0 → 1.61.1
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 +2 -0
- package/README.md +4 -2
- package/dist/apis/ChunksApi.d.ts +54 -1
- package/dist/apis/ChunksApi.js +53 -0
- package/dist/esm/apis/ChunksApi.d.ts +54 -1
- package/dist/esm/apis/ChunksApi.js +54 -1
- package/dist/esm/models/ChunkNeighborsResponse.d.ts +57 -0
- package/dist/esm/models/ChunkNeighborsResponse.js +49 -0
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.js +1 -0
- package/dist/models/ChunkNeighborsResponse.d.ts +57 -0
- package/dist/models/ChunkNeighborsResponse.js +57 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/docs/ChunkNeighborsResponse.md +37 -0
- package/docs/ChunksApi.md +84 -0
- package/package.json +1 -1
- package/src/apis/ChunksApi.ts +109 -0
- package/src/models/ChunkNeighborsResponse.ts +103 -0
- package/src/models/index.ts +1 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -18,6 +18,7 @@ docs/ChunkLineageResponse.md
|
|
|
18
18
|
docs/ChunkLineagesApi.md
|
|
19
19
|
docs/ChunkMetadataInput.md
|
|
20
20
|
docs/ChunkMetadataOutput.md
|
|
21
|
+
docs/ChunkNeighborsResponse.md
|
|
21
22
|
docs/ChunkResponse.md
|
|
22
23
|
docs/ChunkSearchRequest.md
|
|
23
24
|
docs/ChunkType.md
|
|
@@ -204,6 +205,7 @@ src/models/ChunkDocumentVersionResponse.ts
|
|
|
204
205
|
src/models/ChunkLineageResponse.ts
|
|
205
206
|
src/models/ChunkMetadataInput.ts
|
|
206
207
|
src/models/ChunkMetadataOutput.ts
|
|
208
|
+
src/models/ChunkNeighborsResponse.ts
|
|
207
209
|
src/models/ChunkResponse.ts
|
|
208
210
|
src/models/ChunkSearchRequest.ts
|
|
209
211
|
src/models/ChunkType.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @knowledge-stack/ksapi@1.61.
|
|
1
|
+
# @knowledge-stack/ksapi@1.61.1
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the localhost API.
|
|
4
4
|
|
|
@@ -72,6 +72,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
72
72
|
*ChunksApi* | [**createChunk**](docs/ChunksApi.md#createchunkoperation) | **POST** /v1/chunks | Create Chunk Handler
|
|
73
73
|
*ChunksApi* | [**deleteChunk**](docs/ChunksApi.md#deletechunk) | **DELETE** /v1/chunks/{chunk_id} | Delete Chunk Handler
|
|
74
74
|
*ChunksApi* | [**getChunk**](docs/ChunksApi.md#getchunk) | **GET** /v1/chunks/{chunk_id} | Get Chunk Handler
|
|
75
|
+
*ChunksApi* | [**getChunkNeighbors**](docs/ChunksApi.md#getchunkneighbors) | **GET** /v1/chunks/{chunk_id}/neighbors | Get Chunk Neighbors Handler
|
|
75
76
|
*ChunksApi* | [**getChunksBulk**](docs/ChunksApi.md#getchunksbulk) | **GET** /v1/chunks/bulk | Get Chunks Bulk Handler
|
|
76
77
|
*ChunksApi* | [**getVersionChunkIds**](docs/ChunksApi.md#getversionchunkids) | **GET** /v1/chunks/version-chunk-ids | Get Version Chunk Ids Handler
|
|
77
78
|
*ChunksApi* | [**searchChunks**](docs/ChunksApi.md#searchchunks) | **POST** /v1/chunks/search | Search Chunks Handler
|
|
@@ -173,6 +174,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
173
174
|
- [ChunkLineageResponse](docs/ChunkLineageResponse.md)
|
|
174
175
|
- [ChunkMetadataInput](docs/ChunkMetadataInput.md)
|
|
175
176
|
- [ChunkMetadataOutput](docs/ChunkMetadataOutput.md)
|
|
177
|
+
- [ChunkNeighborsResponse](docs/ChunkNeighborsResponse.md)
|
|
176
178
|
- [ChunkResponse](docs/ChunkResponse.md)
|
|
177
179
|
- [ChunkSearchRequest](docs/ChunkSearchRequest.md)
|
|
178
180
|
- [ChunkType](docs/ChunkType.md)
|
|
@@ -321,7 +323,7 @@ and is automatically generated by the
|
|
|
321
323
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
322
324
|
|
|
323
325
|
- API version: `0.1.0`
|
|
324
|
-
- Package version: `1.61.
|
|
326
|
+
- Package version: `1.61.1`
|
|
325
327
|
- Generator version: `7.20.0`
|
|
326
328
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
327
329
|
|
package/dist/apis/ChunksApi.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { ChunkBulkResponse, ChunkResponse, ChunkSearchRequest, CreateChunkRequest, ScoredChunkResponse, UpdateChunkContentRequest, UpdateChunkMetadataRequest, VersionChunkIdsResponse } from '../models/index';
|
|
13
|
+
import type { ChunkBulkResponse, ChunkNeighborsResponse, ChunkResponse, ChunkSearchRequest, CreateChunkRequest, ScoredChunkResponse, UpdateChunkContentRequest, UpdateChunkMetadataRequest, VersionChunkIdsResponse } from '../models/index';
|
|
14
14
|
export interface CreateChunkOperationRequest {
|
|
15
15
|
createChunkRequest: CreateChunkRequest;
|
|
16
16
|
authorization?: string | null;
|
|
@@ -27,6 +27,14 @@ export interface GetChunkRequest {
|
|
|
27
27
|
authorization?: string | null;
|
|
28
28
|
ksUat?: string | null;
|
|
29
29
|
}
|
|
30
|
+
export interface GetChunkNeighborsRequest {
|
|
31
|
+
chunkId: string;
|
|
32
|
+
prev?: number;
|
|
33
|
+
next?: number;
|
|
34
|
+
chunksOnly?: boolean;
|
|
35
|
+
authorization?: string | null;
|
|
36
|
+
ksUat?: string | null;
|
|
37
|
+
}
|
|
30
38
|
export interface GetChunksBulkRequest {
|
|
31
39
|
chunkIds?: Array<string> | null;
|
|
32
40
|
authorization?: string | null;
|
|
@@ -138,6 +146,37 @@ export interface ChunksApiInterface {
|
|
|
138
146
|
* Get Chunk Handler
|
|
139
147
|
*/
|
|
140
148
|
getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
|
|
149
|
+
/**
|
|
150
|
+
* Creates request options for getChunkNeighbors without sending the request
|
|
151
|
+
* @param {string} chunkId
|
|
152
|
+
* @param {number} [prev] Number of preceding siblings to include
|
|
153
|
+
* @param {number} [next] Number of succeeding siblings to include
|
|
154
|
+
* @param {boolean} [chunksOnly] When true, stop traversal at non-CHUNK siblings (default: false)
|
|
155
|
+
* @param {string} [authorization]
|
|
156
|
+
* @param {string} [ksUat]
|
|
157
|
+
* @throws {RequiredError}
|
|
158
|
+
* @memberof ChunksApiInterface
|
|
159
|
+
*/
|
|
160
|
+
getChunkNeighborsRequestOpts(requestParameters: GetChunkNeighborsRequest): Promise<runtime.RequestOpts>;
|
|
161
|
+
/**
|
|
162
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
163
|
+
* @summary Get Chunk Neighbors Handler
|
|
164
|
+
* @param {string} chunkId
|
|
165
|
+
* @param {number} [prev] Number of preceding siblings to include
|
|
166
|
+
* @param {number} [next] Number of succeeding siblings to include
|
|
167
|
+
* @param {boolean} [chunksOnly] When true, stop traversal at non-CHUNK siblings (default: false)
|
|
168
|
+
* @param {string} [authorization]
|
|
169
|
+
* @param {string} [ksUat]
|
|
170
|
+
* @param {*} [options] Override http request option.
|
|
171
|
+
* @throws {RequiredError}
|
|
172
|
+
* @memberof ChunksApiInterface
|
|
173
|
+
*/
|
|
174
|
+
getChunkNeighborsRaw(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkNeighborsResponse>>;
|
|
175
|
+
/**
|
|
176
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
177
|
+
* Get Chunk Neighbors Handler
|
|
178
|
+
*/
|
|
179
|
+
getChunkNeighbors(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkNeighborsResponse>;
|
|
141
180
|
/**
|
|
142
181
|
* Creates request options for getChunksBulk without sending the request
|
|
143
182
|
* @param {Array<string>} [chunkIds] Chunk IDs to resolve (max 200)
|
|
@@ -314,6 +353,20 @@ export declare class ChunksApi extends runtime.BaseAPI implements ChunksApiInter
|
|
|
314
353
|
* Get Chunk Handler
|
|
315
354
|
*/
|
|
316
355
|
getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
|
|
356
|
+
/**
|
|
357
|
+
* Creates request options for getChunkNeighbors without sending the request
|
|
358
|
+
*/
|
|
359
|
+
getChunkNeighborsRequestOpts(requestParameters: GetChunkNeighborsRequest): Promise<runtime.RequestOpts>;
|
|
360
|
+
/**
|
|
361
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
362
|
+
* Get Chunk Neighbors Handler
|
|
363
|
+
*/
|
|
364
|
+
getChunkNeighborsRaw(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkNeighborsResponse>>;
|
|
365
|
+
/**
|
|
366
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
367
|
+
* Get Chunk Neighbors Handler
|
|
368
|
+
*/
|
|
369
|
+
getChunkNeighbors(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkNeighborsResponse>;
|
|
317
370
|
/**
|
|
318
371
|
* Creates request options for getChunksBulk without sending the request
|
|
319
372
|
*/
|
package/dist/apis/ChunksApi.js
CHANGED
|
@@ -164,6 +164,59 @@ class ChunksApi extends runtime.BaseAPI {
|
|
|
164
164
|
return yield response.value();
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Creates request options for getChunkNeighbors without sending the request
|
|
169
|
+
*/
|
|
170
|
+
getChunkNeighborsRequestOpts(requestParameters) {
|
|
171
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
+
if (requestParameters['chunkId'] == null) {
|
|
173
|
+
throw new runtime.RequiredError('chunkId', 'Required parameter "chunkId" was null or undefined when calling getChunkNeighbors().');
|
|
174
|
+
}
|
|
175
|
+
const queryParameters = {};
|
|
176
|
+
if (requestParameters['prev'] != null) {
|
|
177
|
+
queryParameters['prev'] = requestParameters['prev'];
|
|
178
|
+
}
|
|
179
|
+
if (requestParameters['next'] != null) {
|
|
180
|
+
queryParameters['next'] = requestParameters['next'];
|
|
181
|
+
}
|
|
182
|
+
if (requestParameters['chunksOnly'] != null) {
|
|
183
|
+
queryParameters['chunks_only'] = requestParameters['chunksOnly'];
|
|
184
|
+
}
|
|
185
|
+
const headerParameters = {};
|
|
186
|
+
if (requestParameters['authorization'] != null) {
|
|
187
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
188
|
+
}
|
|
189
|
+
let urlPath = `/v1/chunks/{chunk_id}/neighbors`;
|
|
190
|
+
urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
|
|
191
|
+
return {
|
|
192
|
+
path: urlPath,
|
|
193
|
+
method: 'GET',
|
|
194
|
+
headers: headerParameters,
|
|
195
|
+
query: queryParameters,
|
|
196
|
+
};
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
201
|
+
* Get Chunk Neighbors Handler
|
|
202
|
+
*/
|
|
203
|
+
getChunkNeighborsRaw(requestParameters, initOverrides) {
|
|
204
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
205
|
+
const requestOptions = yield this.getChunkNeighborsRequestOpts(requestParameters);
|
|
206
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
207
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ChunkNeighborsResponseFromJSON)(jsonValue));
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
212
|
+
* Get Chunk Neighbors Handler
|
|
213
|
+
*/
|
|
214
|
+
getChunkNeighbors(requestParameters, initOverrides) {
|
|
215
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
const response = yield this.getChunkNeighborsRaw(requestParameters, initOverrides);
|
|
217
|
+
return yield response.value();
|
|
218
|
+
});
|
|
219
|
+
}
|
|
167
220
|
/**
|
|
168
221
|
* Creates request options for getChunksBulk without sending the request
|
|
169
222
|
*/
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { ChunkBulkResponse, ChunkResponse, ChunkSearchRequest, CreateChunkRequest, ScoredChunkResponse, UpdateChunkContentRequest, UpdateChunkMetadataRequest, VersionChunkIdsResponse } from '../models/index';
|
|
13
|
+
import type { ChunkBulkResponse, ChunkNeighborsResponse, ChunkResponse, ChunkSearchRequest, CreateChunkRequest, ScoredChunkResponse, UpdateChunkContentRequest, UpdateChunkMetadataRequest, VersionChunkIdsResponse } from '../models/index';
|
|
14
14
|
export interface CreateChunkOperationRequest {
|
|
15
15
|
createChunkRequest: CreateChunkRequest;
|
|
16
16
|
authorization?: string | null;
|
|
@@ -27,6 +27,14 @@ export interface GetChunkRequest {
|
|
|
27
27
|
authorization?: string | null;
|
|
28
28
|
ksUat?: string | null;
|
|
29
29
|
}
|
|
30
|
+
export interface GetChunkNeighborsRequest {
|
|
31
|
+
chunkId: string;
|
|
32
|
+
prev?: number;
|
|
33
|
+
next?: number;
|
|
34
|
+
chunksOnly?: boolean;
|
|
35
|
+
authorization?: string | null;
|
|
36
|
+
ksUat?: string | null;
|
|
37
|
+
}
|
|
30
38
|
export interface GetChunksBulkRequest {
|
|
31
39
|
chunkIds?: Array<string> | null;
|
|
32
40
|
authorization?: string | null;
|
|
@@ -138,6 +146,37 @@ export interface ChunksApiInterface {
|
|
|
138
146
|
* Get Chunk Handler
|
|
139
147
|
*/
|
|
140
148
|
getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
|
|
149
|
+
/**
|
|
150
|
+
* Creates request options for getChunkNeighbors without sending the request
|
|
151
|
+
* @param {string} chunkId
|
|
152
|
+
* @param {number} [prev] Number of preceding siblings to include
|
|
153
|
+
* @param {number} [next] Number of succeeding siblings to include
|
|
154
|
+
* @param {boolean} [chunksOnly] When true, stop traversal at non-CHUNK siblings (default: false)
|
|
155
|
+
* @param {string} [authorization]
|
|
156
|
+
* @param {string} [ksUat]
|
|
157
|
+
* @throws {RequiredError}
|
|
158
|
+
* @memberof ChunksApiInterface
|
|
159
|
+
*/
|
|
160
|
+
getChunkNeighborsRequestOpts(requestParameters: GetChunkNeighborsRequest): Promise<runtime.RequestOpts>;
|
|
161
|
+
/**
|
|
162
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
163
|
+
* @summary Get Chunk Neighbors Handler
|
|
164
|
+
* @param {string} chunkId
|
|
165
|
+
* @param {number} [prev] Number of preceding siblings to include
|
|
166
|
+
* @param {number} [next] Number of succeeding siblings to include
|
|
167
|
+
* @param {boolean} [chunksOnly] When true, stop traversal at non-CHUNK siblings (default: false)
|
|
168
|
+
* @param {string} [authorization]
|
|
169
|
+
* @param {string} [ksUat]
|
|
170
|
+
* @param {*} [options] Override http request option.
|
|
171
|
+
* @throws {RequiredError}
|
|
172
|
+
* @memberof ChunksApiInterface
|
|
173
|
+
*/
|
|
174
|
+
getChunkNeighborsRaw(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkNeighborsResponse>>;
|
|
175
|
+
/**
|
|
176
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
177
|
+
* Get Chunk Neighbors Handler
|
|
178
|
+
*/
|
|
179
|
+
getChunkNeighbors(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkNeighborsResponse>;
|
|
141
180
|
/**
|
|
142
181
|
* Creates request options for getChunksBulk without sending the request
|
|
143
182
|
* @param {Array<string>} [chunkIds] Chunk IDs to resolve (max 200)
|
|
@@ -314,6 +353,20 @@ export declare class ChunksApi extends runtime.BaseAPI implements ChunksApiInter
|
|
|
314
353
|
* Get Chunk Handler
|
|
315
354
|
*/
|
|
316
355
|
getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
|
|
356
|
+
/**
|
|
357
|
+
* Creates request options for getChunkNeighbors without sending the request
|
|
358
|
+
*/
|
|
359
|
+
getChunkNeighborsRequestOpts(requestParameters: GetChunkNeighborsRequest): Promise<runtime.RequestOpts>;
|
|
360
|
+
/**
|
|
361
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
362
|
+
* Get Chunk Neighbors Handler
|
|
363
|
+
*/
|
|
364
|
+
getChunkNeighborsRaw(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkNeighborsResponse>>;
|
|
365
|
+
/**
|
|
366
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
367
|
+
* Get Chunk Neighbors Handler
|
|
368
|
+
*/
|
|
369
|
+
getChunkNeighbors(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkNeighborsResponse>;
|
|
317
370
|
/**
|
|
318
371
|
* Creates request options for getChunksBulk without sending the request
|
|
319
372
|
*/
|
|
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
import * as runtime from '../runtime';
|
|
24
|
-
import { ChunkBulkResponseFromJSON, ChunkResponseFromJSON, ChunkSearchRequestToJSON, CreateChunkRequestToJSON, ScoredChunkResponseFromJSON, UpdateChunkContentRequestToJSON, UpdateChunkMetadataRequestToJSON, VersionChunkIdsResponseFromJSON, } from '../models/index';
|
|
24
|
+
import { ChunkBulkResponseFromJSON, ChunkNeighborsResponseFromJSON, ChunkResponseFromJSON, ChunkSearchRequestToJSON, CreateChunkRequestToJSON, ScoredChunkResponseFromJSON, UpdateChunkContentRequestToJSON, UpdateChunkMetadataRequestToJSON, VersionChunkIdsResponseFromJSON, } from '../models/index';
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
@@ -161,6 +161,59 @@ export class ChunksApi extends runtime.BaseAPI {
|
|
|
161
161
|
return yield response.value();
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Creates request options for getChunkNeighbors without sending the request
|
|
166
|
+
*/
|
|
167
|
+
getChunkNeighborsRequestOpts(requestParameters) {
|
|
168
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
169
|
+
if (requestParameters['chunkId'] == null) {
|
|
170
|
+
throw new runtime.RequiredError('chunkId', 'Required parameter "chunkId" was null or undefined when calling getChunkNeighbors().');
|
|
171
|
+
}
|
|
172
|
+
const queryParameters = {};
|
|
173
|
+
if (requestParameters['prev'] != null) {
|
|
174
|
+
queryParameters['prev'] = requestParameters['prev'];
|
|
175
|
+
}
|
|
176
|
+
if (requestParameters['next'] != null) {
|
|
177
|
+
queryParameters['next'] = requestParameters['next'];
|
|
178
|
+
}
|
|
179
|
+
if (requestParameters['chunksOnly'] != null) {
|
|
180
|
+
queryParameters['chunks_only'] = requestParameters['chunksOnly'];
|
|
181
|
+
}
|
|
182
|
+
const headerParameters = {};
|
|
183
|
+
if (requestParameters['authorization'] != null) {
|
|
184
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
185
|
+
}
|
|
186
|
+
let urlPath = `/v1/chunks/{chunk_id}/neighbors`;
|
|
187
|
+
urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
|
|
188
|
+
return {
|
|
189
|
+
path: urlPath,
|
|
190
|
+
method: 'GET',
|
|
191
|
+
headers: headerParameters,
|
|
192
|
+
query: queryParameters,
|
|
193
|
+
};
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
198
|
+
* Get Chunk Neighbors Handler
|
|
199
|
+
*/
|
|
200
|
+
getChunkNeighborsRaw(requestParameters, initOverrides) {
|
|
201
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
202
|
+
const requestOptions = yield this.getChunkNeighborsRequestOpts(requestParameters);
|
|
203
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
204
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ChunkNeighborsResponseFromJSON(jsonValue));
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
209
|
+
* Get Chunk Neighbors Handler
|
|
210
|
+
*/
|
|
211
|
+
getChunkNeighbors(requestParameters, initOverrides) {
|
|
212
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
const response = yield this.getChunkNeighborsRaw(requestParameters, initOverrides);
|
|
214
|
+
return yield response.value();
|
|
215
|
+
});
|
|
216
|
+
}
|
|
164
217
|
/**
|
|
165
218
|
* Creates request options for getChunksBulk without sending the request
|
|
166
219
|
*/
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { SectionContentItemOrChunkContentItem } from './SectionContentItemOrChunkContentItem';
|
|
13
|
+
/**
|
|
14
|
+
* Response for chunk neighbor traversal.
|
|
15
|
+
*
|
|
16
|
+
* Returns items in the same ``SectionOrChunkItem`` discriminated union
|
|
17
|
+
* format used by the document version contents endpoint.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface ChunkNeighborsResponse
|
|
20
|
+
*/
|
|
21
|
+
export interface ChunkNeighborsResponse {
|
|
22
|
+
/**
|
|
23
|
+
* Ordered siblings: preceding → anchor → succeeding
|
|
24
|
+
* @type {Array<SectionContentItemOrChunkContentItem>}
|
|
25
|
+
* @memberof ChunkNeighborsResponse
|
|
26
|
+
*/
|
|
27
|
+
items: Array<SectionContentItemOrChunkContentItem>;
|
|
28
|
+
/**
|
|
29
|
+
* Index of the anchor chunk in items
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @memberof ChunkNeighborsResponse
|
|
32
|
+
*/
|
|
33
|
+
anchorIndex: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Check if a given object implements the ChunkNeighborsResponse interface.
|
|
37
|
+
*/
|
|
38
|
+
export declare function instanceOfChunkNeighborsResponse(value: object): value is ChunkNeighborsResponse;
|
|
39
|
+
export declare function ChunkNeighborsResponseFromJSON(json: any): ChunkNeighborsResponse;
|
|
40
|
+
export declare function ChunkNeighborsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkNeighborsResponse;
|
|
41
|
+
export declare function ChunkNeighborsResponseToJSON(json: any): ChunkNeighborsResponse;
|
|
42
|
+
export declare function ChunkNeighborsResponseToJSONTyped(value?: ChunkNeighborsResponse | null, ignoreDiscriminator?: boolean): any;
|
|
43
|
+
export declare const ChunkNeighborsResponsePropertyValidationAttributesMap: {
|
|
44
|
+
[property: string]: {
|
|
45
|
+
maxLength?: number;
|
|
46
|
+
minLength?: number;
|
|
47
|
+
pattern?: string;
|
|
48
|
+
maximum?: number;
|
|
49
|
+
exclusiveMaximum?: boolean;
|
|
50
|
+
minimum?: number;
|
|
51
|
+
exclusiveMinimum?: boolean;
|
|
52
|
+
multipleOf?: number;
|
|
53
|
+
maxItems?: number;
|
|
54
|
+
minItems?: number;
|
|
55
|
+
uniqueItems?: boolean;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { SectionContentItemOrChunkContentItemFromJSON, SectionContentItemOrChunkContentItemToJSON, } from './SectionContentItemOrChunkContentItem';
|
|
15
|
+
/**
|
|
16
|
+
* Check if a given object implements the ChunkNeighborsResponse interface.
|
|
17
|
+
*/
|
|
18
|
+
export function instanceOfChunkNeighborsResponse(value) {
|
|
19
|
+
if (!('items' in value) || value['items'] === undefined)
|
|
20
|
+
return false;
|
|
21
|
+
if (!('anchorIndex' in value) || value['anchorIndex'] === undefined)
|
|
22
|
+
return false;
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
export function ChunkNeighborsResponseFromJSON(json) {
|
|
26
|
+
return ChunkNeighborsResponseFromJSONTyped(json, false);
|
|
27
|
+
}
|
|
28
|
+
export function ChunkNeighborsResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
29
|
+
if (json == null) {
|
|
30
|
+
return json;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
'items': (json['items'].map(SectionContentItemOrChunkContentItemFromJSON)),
|
|
34
|
+
'anchorIndex': json['anchor_index'],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function ChunkNeighborsResponseToJSON(json) {
|
|
38
|
+
return ChunkNeighborsResponseToJSONTyped(json, false);
|
|
39
|
+
}
|
|
40
|
+
export function ChunkNeighborsResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
41
|
+
if (value == null) {
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
'items': (value['items'].map(SectionContentItemOrChunkContentItemToJSON)),
|
|
46
|
+
'anchor_index': value['anchorIndex'],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export const ChunkNeighborsResponsePropertyValidationAttributesMap = {};
|
|
@@ -11,6 +11,7 @@ export * from './ChunkDocumentVersionResponse';
|
|
|
11
11
|
export * from './ChunkLineageResponse';
|
|
12
12
|
export * from './ChunkMetadataInput';
|
|
13
13
|
export * from './ChunkMetadataOutput';
|
|
14
|
+
export * from './ChunkNeighborsResponse';
|
|
14
15
|
export * from './ChunkResponse';
|
|
15
16
|
export * from './ChunkSearchRequest';
|
|
16
17
|
export * from './ChunkType';
|
package/dist/esm/models/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export * from './ChunkDocumentVersionResponse';
|
|
|
13
13
|
export * from './ChunkLineageResponse';
|
|
14
14
|
export * from './ChunkMetadataInput';
|
|
15
15
|
export * from './ChunkMetadataOutput';
|
|
16
|
+
export * from './ChunkNeighborsResponse';
|
|
16
17
|
export * from './ChunkResponse';
|
|
17
18
|
export * from './ChunkSearchRequest';
|
|
18
19
|
export * from './ChunkType';
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { SectionContentItemOrChunkContentItem } from './SectionContentItemOrChunkContentItem';
|
|
13
|
+
/**
|
|
14
|
+
* Response for chunk neighbor traversal.
|
|
15
|
+
*
|
|
16
|
+
* Returns items in the same ``SectionOrChunkItem`` discriminated union
|
|
17
|
+
* format used by the document version contents endpoint.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface ChunkNeighborsResponse
|
|
20
|
+
*/
|
|
21
|
+
export interface ChunkNeighborsResponse {
|
|
22
|
+
/**
|
|
23
|
+
* Ordered siblings: preceding → anchor → succeeding
|
|
24
|
+
* @type {Array<SectionContentItemOrChunkContentItem>}
|
|
25
|
+
* @memberof ChunkNeighborsResponse
|
|
26
|
+
*/
|
|
27
|
+
items: Array<SectionContentItemOrChunkContentItem>;
|
|
28
|
+
/**
|
|
29
|
+
* Index of the anchor chunk in items
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @memberof ChunkNeighborsResponse
|
|
32
|
+
*/
|
|
33
|
+
anchorIndex: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Check if a given object implements the ChunkNeighborsResponse interface.
|
|
37
|
+
*/
|
|
38
|
+
export declare function instanceOfChunkNeighborsResponse(value: object): value is ChunkNeighborsResponse;
|
|
39
|
+
export declare function ChunkNeighborsResponseFromJSON(json: any): ChunkNeighborsResponse;
|
|
40
|
+
export declare function ChunkNeighborsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkNeighborsResponse;
|
|
41
|
+
export declare function ChunkNeighborsResponseToJSON(json: any): ChunkNeighborsResponse;
|
|
42
|
+
export declare function ChunkNeighborsResponseToJSONTyped(value?: ChunkNeighborsResponse | null, ignoreDiscriminator?: boolean): any;
|
|
43
|
+
export declare const ChunkNeighborsResponsePropertyValidationAttributesMap: {
|
|
44
|
+
[property: string]: {
|
|
45
|
+
maxLength?: number;
|
|
46
|
+
minLength?: number;
|
|
47
|
+
pattern?: string;
|
|
48
|
+
maximum?: number;
|
|
49
|
+
exclusiveMaximum?: boolean;
|
|
50
|
+
minimum?: number;
|
|
51
|
+
exclusiveMinimum?: boolean;
|
|
52
|
+
multipleOf?: number;
|
|
53
|
+
maxItems?: number;
|
|
54
|
+
minItems?: number;
|
|
55
|
+
uniqueItems?: boolean;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
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.ChunkNeighborsResponsePropertyValidationAttributesMap = void 0;
|
|
17
|
+
exports.instanceOfChunkNeighborsResponse = instanceOfChunkNeighborsResponse;
|
|
18
|
+
exports.ChunkNeighborsResponseFromJSON = ChunkNeighborsResponseFromJSON;
|
|
19
|
+
exports.ChunkNeighborsResponseFromJSONTyped = ChunkNeighborsResponseFromJSONTyped;
|
|
20
|
+
exports.ChunkNeighborsResponseToJSON = ChunkNeighborsResponseToJSON;
|
|
21
|
+
exports.ChunkNeighborsResponseToJSONTyped = ChunkNeighborsResponseToJSONTyped;
|
|
22
|
+
const SectionContentItemOrChunkContentItem_1 = require("./SectionContentItemOrChunkContentItem");
|
|
23
|
+
/**
|
|
24
|
+
* Check if a given object implements the ChunkNeighborsResponse interface.
|
|
25
|
+
*/
|
|
26
|
+
function instanceOfChunkNeighborsResponse(value) {
|
|
27
|
+
if (!('items' in value) || value['items'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
if (!('anchorIndex' in value) || value['anchorIndex'] === undefined)
|
|
30
|
+
return false;
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
function ChunkNeighborsResponseFromJSON(json) {
|
|
34
|
+
return ChunkNeighborsResponseFromJSONTyped(json, false);
|
|
35
|
+
}
|
|
36
|
+
function ChunkNeighborsResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
37
|
+
if (json == null) {
|
|
38
|
+
return json;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
'items': (json['items'].map(SectionContentItemOrChunkContentItem_1.SectionContentItemOrChunkContentItemFromJSON)),
|
|
42
|
+
'anchorIndex': json['anchor_index'],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function ChunkNeighborsResponseToJSON(json) {
|
|
46
|
+
return ChunkNeighborsResponseToJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
function ChunkNeighborsResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
49
|
+
if (value == null) {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
'items': (value['items'].map(SectionContentItemOrChunkContentItem_1.SectionContentItemOrChunkContentItemToJSON)),
|
|
54
|
+
'anchor_index': value['anchorIndex'],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
exports.ChunkNeighborsResponsePropertyValidationAttributesMap = {};
|
package/dist/models/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './ChunkDocumentVersionResponse';
|
|
|
11
11
|
export * from './ChunkLineageResponse';
|
|
12
12
|
export * from './ChunkMetadataInput';
|
|
13
13
|
export * from './ChunkMetadataOutput';
|
|
14
|
+
export * from './ChunkNeighborsResponse';
|
|
14
15
|
export * from './ChunkResponse';
|
|
15
16
|
export * from './ChunkSearchRequest';
|
|
16
17
|
export * from './ChunkType';
|
package/dist/models/index.js
CHANGED
|
@@ -29,6 +29,7 @@ __exportStar(require("./ChunkDocumentVersionResponse"), exports);
|
|
|
29
29
|
__exportStar(require("./ChunkLineageResponse"), exports);
|
|
30
30
|
__exportStar(require("./ChunkMetadataInput"), exports);
|
|
31
31
|
__exportStar(require("./ChunkMetadataOutput"), exports);
|
|
32
|
+
__exportStar(require("./ChunkNeighborsResponse"), exports);
|
|
32
33
|
__exportStar(require("./ChunkResponse"), exports);
|
|
33
34
|
__exportStar(require("./ChunkSearchRequest"), exports);
|
|
34
35
|
__exportStar(require("./ChunkType"), exports);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# ChunkNeighborsResponse
|
|
3
|
+
|
|
4
|
+
Response for chunk neighbor traversal. Returns items in the same ``SectionOrChunkItem`` discriminated union format used by the document version contents endpoint.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`items` | [Array<SectionContentItemOrChunkContentItem>](SectionContentItemOrChunkContentItem.md)
|
|
11
|
+
`anchorIndex` | number
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ChunkNeighborsResponse } from '@knowledge-stack/ksapi'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"items": null,
|
|
21
|
+
"anchorIndex": null,
|
|
22
|
+
} satisfies ChunkNeighborsResponse
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChunkNeighborsResponse
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
package/docs/ChunksApi.md
CHANGED
|
@@ -7,6 +7,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
7
7
|
| [**createChunk**](ChunksApi.md#createchunkoperation) | **POST** /v1/chunks | Create Chunk Handler |
|
|
8
8
|
| [**deleteChunk**](ChunksApi.md#deletechunk) | **DELETE** /v1/chunks/{chunk_id} | Delete Chunk Handler |
|
|
9
9
|
| [**getChunk**](ChunksApi.md#getchunk) | **GET** /v1/chunks/{chunk_id} | Get Chunk Handler |
|
|
10
|
+
| [**getChunkNeighbors**](ChunksApi.md#getchunkneighbors) | **GET** /v1/chunks/{chunk_id}/neighbors | Get Chunk Neighbors Handler |
|
|
10
11
|
| [**getChunksBulk**](ChunksApi.md#getchunksbulk) | **GET** /v1/chunks/bulk | Get Chunks Bulk Handler |
|
|
11
12
|
| [**getVersionChunkIds**](ChunksApi.md#getversionchunkids) | **GET** /v1/chunks/version-chunk-ids | Get Version Chunk Ids Handler |
|
|
12
13
|
| [**searchChunks**](ChunksApi.md#searchchunks) | **POST** /v1/chunks/search | Search Chunks Handler |
|
|
@@ -240,6 +241,89 @@ No authorization required
|
|
|
240
241
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
241
242
|
|
|
242
243
|
|
|
244
|
+
## getChunkNeighbors
|
|
245
|
+
|
|
246
|
+
> ChunkNeighborsResponse getChunkNeighbors(chunkId, prev, next, chunksOnly, authorization, ksUat)
|
|
247
|
+
|
|
248
|
+
Get Chunk Neighbors Handler
|
|
249
|
+
|
|
250
|
+
Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
251
|
+
|
|
252
|
+
### Example
|
|
253
|
+
|
|
254
|
+
```ts
|
|
255
|
+
import {
|
|
256
|
+
Configuration,
|
|
257
|
+
ChunksApi,
|
|
258
|
+
} from '@knowledge-stack/ksapi';
|
|
259
|
+
import type { GetChunkNeighborsRequest } from '@knowledge-stack/ksapi';
|
|
260
|
+
|
|
261
|
+
async function example() {
|
|
262
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
263
|
+
const api = new ChunksApi();
|
|
264
|
+
|
|
265
|
+
const body = {
|
|
266
|
+
// string
|
|
267
|
+
chunkId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
268
|
+
// number | Number of preceding siblings to include (optional)
|
|
269
|
+
prev: 56,
|
|
270
|
+
// number | Number of succeeding siblings to include (optional)
|
|
271
|
+
next: 56,
|
|
272
|
+
// boolean | When true, stop traversal at non-CHUNK siblings (default: false) (optional)
|
|
273
|
+
chunksOnly: true,
|
|
274
|
+
// string (optional)
|
|
275
|
+
authorization: authorization_example,
|
|
276
|
+
// string (optional)
|
|
277
|
+
ksUat: ksUat_example,
|
|
278
|
+
} satisfies GetChunkNeighborsRequest;
|
|
279
|
+
|
|
280
|
+
try {
|
|
281
|
+
const data = await api.getChunkNeighbors(body);
|
|
282
|
+
console.log(data);
|
|
283
|
+
} catch (error) {
|
|
284
|
+
console.error(error);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// Run the test
|
|
289
|
+
example().catch(console.error);
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Parameters
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
| Name | Type | Description | Notes |
|
|
296
|
+
|------------- | ------------- | ------------- | -------------|
|
|
297
|
+
| **chunkId** | `string` | | [Defaults to `undefined`] |
|
|
298
|
+
| **prev** | `number` | Number of preceding siblings to include | [Optional] [Defaults to `1`] |
|
|
299
|
+
| **next** | `number` | Number of succeeding siblings to include | [Optional] [Defaults to `1`] |
|
|
300
|
+
| **chunksOnly** | `boolean` | When true, stop traversal at non-CHUNK siblings (default: false) | [Optional] [Defaults to `false`] |
|
|
301
|
+
| **authorization** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
302
|
+
| **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
303
|
+
|
|
304
|
+
### Return type
|
|
305
|
+
|
|
306
|
+
[**ChunkNeighborsResponse**](ChunkNeighborsResponse.md)
|
|
307
|
+
|
|
308
|
+
### Authorization
|
|
309
|
+
|
|
310
|
+
No authorization required
|
|
311
|
+
|
|
312
|
+
### HTTP request headers
|
|
313
|
+
|
|
314
|
+
- **Content-Type**: Not defined
|
|
315
|
+
- **Accept**: `application/json`
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
### HTTP response details
|
|
319
|
+
| Status code | Description | Response headers |
|
|
320
|
+
|-------------|-------------|------------------|
|
|
321
|
+
| **200** | Successful Response | - |
|
|
322
|
+
| **422** | Validation Error | - |
|
|
323
|
+
|
|
324
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
325
|
+
|
|
326
|
+
|
|
243
327
|
## getChunksBulk
|
|
244
328
|
|
|
245
329
|
> Array<ChunkBulkResponse> getChunksBulk(chunkIds, authorization, ksUat)
|
package/package.json
CHANGED
package/src/apis/ChunksApi.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
ChunkBulkResponse,
|
|
19
|
+
ChunkNeighborsResponse,
|
|
19
20
|
ChunkResponse,
|
|
20
21
|
ChunkSearchRequest,
|
|
21
22
|
CreateChunkRequest,
|
|
@@ -28,6 +29,8 @@ import type {
|
|
|
28
29
|
import {
|
|
29
30
|
ChunkBulkResponseFromJSON,
|
|
30
31
|
ChunkBulkResponseToJSON,
|
|
32
|
+
ChunkNeighborsResponseFromJSON,
|
|
33
|
+
ChunkNeighborsResponseToJSON,
|
|
31
34
|
ChunkResponseFromJSON,
|
|
32
35
|
ChunkResponseToJSON,
|
|
33
36
|
ChunkSearchRequestFromJSON,
|
|
@@ -65,6 +68,15 @@ export interface GetChunkRequest {
|
|
|
65
68
|
ksUat?: string | null;
|
|
66
69
|
}
|
|
67
70
|
|
|
71
|
+
export interface GetChunkNeighborsRequest {
|
|
72
|
+
chunkId: string;
|
|
73
|
+
prev?: number;
|
|
74
|
+
next?: number;
|
|
75
|
+
chunksOnly?: boolean;
|
|
76
|
+
authorization?: string | null;
|
|
77
|
+
ksUat?: string | null;
|
|
78
|
+
}
|
|
79
|
+
|
|
68
80
|
export interface GetChunksBulkRequest {
|
|
69
81
|
chunkIds?: Array<string> | null;
|
|
70
82
|
authorization?: string | null;
|
|
@@ -190,6 +202,40 @@ export interface ChunksApiInterface {
|
|
|
190
202
|
*/
|
|
191
203
|
getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
|
|
192
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Creates request options for getChunkNeighbors without sending the request
|
|
207
|
+
* @param {string} chunkId
|
|
208
|
+
* @param {number} [prev] Number of preceding siblings to include
|
|
209
|
+
* @param {number} [next] Number of succeeding siblings to include
|
|
210
|
+
* @param {boolean} [chunksOnly] When true, stop traversal at non-CHUNK siblings (default: false)
|
|
211
|
+
* @param {string} [authorization]
|
|
212
|
+
* @param {string} [ksUat]
|
|
213
|
+
* @throws {RequiredError}
|
|
214
|
+
* @memberof ChunksApiInterface
|
|
215
|
+
*/
|
|
216
|
+
getChunkNeighborsRequestOpts(requestParameters: GetChunkNeighborsRequest): Promise<runtime.RequestOpts>;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
220
|
+
* @summary Get Chunk Neighbors Handler
|
|
221
|
+
* @param {string} chunkId
|
|
222
|
+
* @param {number} [prev] Number of preceding siblings to include
|
|
223
|
+
* @param {number} [next] Number of succeeding siblings to include
|
|
224
|
+
* @param {boolean} [chunksOnly] When true, stop traversal at non-CHUNK siblings (default: false)
|
|
225
|
+
* @param {string} [authorization]
|
|
226
|
+
* @param {string} [ksUat]
|
|
227
|
+
* @param {*} [options] Override http request option.
|
|
228
|
+
* @throws {RequiredError}
|
|
229
|
+
* @memberof ChunksApiInterface
|
|
230
|
+
*/
|
|
231
|
+
getChunkNeighborsRaw(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkNeighborsResponse>>;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
235
|
+
* Get Chunk Neighbors Handler
|
|
236
|
+
*/
|
|
237
|
+
getChunkNeighbors(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkNeighborsResponse>;
|
|
238
|
+
|
|
193
239
|
/**
|
|
194
240
|
* Creates request options for getChunksBulk without sending the request
|
|
195
241
|
* @param {Array<string>} [chunkIds] Chunk IDs to resolve (max 200)
|
|
@@ -499,6 +545,69 @@ export class ChunksApi extends runtime.BaseAPI implements ChunksApiInterface {
|
|
|
499
545
|
return await response.value();
|
|
500
546
|
}
|
|
501
547
|
|
|
548
|
+
/**
|
|
549
|
+
* Creates request options for getChunkNeighbors without sending the request
|
|
550
|
+
*/
|
|
551
|
+
async getChunkNeighborsRequestOpts(requestParameters: GetChunkNeighborsRequest): Promise<runtime.RequestOpts> {
|
|
552
|
+
if (requestParameters['chunkId'] == null) {
|
|
553
|
+
throw new runtime.RequiredError(
|
|
554
|
+
'chunkId',
|
|
555
|
+
'Required parameter "chunkId" was null or undefined when calling getChunkNeighbors().'
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
const queryParameters: any = {};
|
|
560
|
+
|
|
561
|
+
if (requestParameters['prev'] != null) {
|
|
562
|
+
queryParameters['prev'] = requestParameters['prev'];
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
if (requestParameters['next'] != null) {
|
|
566
|
+
queryParameters['next'] = requestParameters['next'];
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
if (requestParameters['chunksOnly'] != null) {
|
|
570
|
+
queryParameters['chunks_only'] = requestParameters['chunksOnly'];
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
574
|
+
|
|
575
|
+
if (requestParameters['authorization'] != null) {
|
|
576
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
let urlPath = `/v1/chunks/{chunk_id}/neighbors`;
|
|
581
|
+
urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
|
|
582
|
+
|
|
583
|
+
return {
|
|
584
|
+
path: urlPath,
|
|
585
|
+
method: 'GET',
|
|
586
|
+
headers: headerParameters,
|
|
587
|
+
query: queryParameters,
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
593
|
+
* Get Chunk Neighbors Handler
|
|
594
|
+
*/
|
|
595
|
+
async getChunkNeighborsRaw(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkNeighborsResponse>> {
|
|
596
|
+
const requestOptions = await this.getChunkNeighborsRequestOpts(requestParameters);
|
|
597
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
598
|
+
|
|
599
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ChunkNeighborsResponseFromJSON(jsonValue));
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
604
|
+
* Get Chunk Neighbors Handler
|
|
605
|
+
*/
|
|
606
|
+
async getChunkNeighbors(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkNeighborsResponse> {
|
|
607
|
+
const response = await this.getChunkNeighborsRaw(requestParameters, initOverrides);
|
|
608
|
+
return await response.value();
|
|
609
|
+
}
|
|
610
|
+
|
|
502
611
|
/**
|
|
503
612
|
* Creates request options for getChunksBulk without sending the request
|
|
504
613
|
*/
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { SectionContentItemOrChunkContentItem } from './SectionContentItemOrChunkContentItem';
|
|
17
|
+
import {
|
|
18
|
+
SectionContentItemOrChunkContentItemFromJSON,
|
|
19
|
+
SectionContentItemOrChunkContentItemFromJSONTyped,
|
|
20
|
+
SectionContentItemOrChunkContentItemToJSON,
|
|
21
|
+
SectionContentItemOrChunkContentItemToJSONTyped,
|
|
22
|
+
} from './SectionContentItemOrChunkContentItem';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Response for chunk neighbor traversal.
|
|
26
|
+
*
|
|
27
|
+
* Returns items in the same ``SectionOrChunkItem`` discriminated union
|
|
28
|
+
* format used by the document version contents endpoint.
|
|
29
|
+
* @export
|
|
30
|
+
* @interface ChunkNeighborsResponse
|
|
31
|
+
*/
|
|
32
|
+
export interface ChunkNeighborsResponse {
|
|
33
|
+
/**
|
|
34
|
+
* Ordered siblings: preceding → anchor → succeeding
|
|
35
|
+
* @type {Array<SectionContentItemOrChunkContentItem>}
|
|
36
|
+
* @memberof ChunkNeighborsResponse
|
|
37
|
+
*/
|
|
38
|
+
items: Array<SectionContentItemOrChunkContentItem>;
|
|
39
|
+
/**
|
|
40
|
+
* Index of the anchor chunk in items
|
|
41
|
+
* @type {number}
|
|
42
|
+
* @memberof ChunkNeighborsResponse
|
|
43
|
+
*/
|
|
44
|
+
anchorIndex: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Check if a given object implements the ChunkNeighborsResponse interface.
|
|
49
|
+
*/
|
|
50
|
+
export function instanceOfChunkNeighborsResponse(value: object): value is ChunkNeighborsResponse {
|
|
51
|
+
if (!('items' in value) || value['items'] === undefined) return false;
|
|
52
|
+
if (!('anchorIndex' in value) || value['anchorIndex'] === undefined) return false;
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function ChunkNeighborsResponseFromJSON(json: any): ChunkNeighborsResponse {
|
|
57
|
+
return ChunkNeighborsResponseFromJSONTyped(json, false);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function ChunkNeighborsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkNeighborsResponse {
|
|
61
|
+
if (json == null) {
|
|
62
|
+
return json;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
|
|
66
|
+
'items': ((json['items'] as Array<any>).map(SectionContentItemOrChunkContentItemFromJSON)),
|
|
67
|
+
'anchorIndex': json['anchor_index'],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function ChunkNeighborsResponseToJSON(json: any): ChunkNeighborsResponse {
|
|
72
|
+
return ChunkNeighborsResponseToJSONTyped(json, false);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function ChunkNeighborsResponseToJSONTyped(value?: ChunkNeighborsResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
76
|
+
if (value == null) {
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
|
|
82
|
+
'items': ((value['items'] as Array<any>).map(SectionContentItemOrChunkContentItemToJSON)),
|
|
83
|
+
'anchor_index': value['anchorIndex'],
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const ChunkNeighborsResponsePropertyValidationAttributesMap: {
|
|
88
|
+
[property: string]: {
|
|
89
|
+
maxLength?: number,
|
|
90
|
+
minLength?: number,
|
|
91
|
+
pattern?: string,
|
|
92
|
+
maximum?: number,
|
|
93
|
+
exclusiveMaximum?: boolean,
|
|
94
|
+
minimum?: number,
|
|
95
|
+
exclusiveMinimum?: boolean,
|
|
96
|
+
multipleOf?: number,
|
|
97
|
+
maxItems?: number,
|
|
98
|
+
minItems?: number,
|
|
99
|
+
uniqueItems?: boolean
|
|
100
|
+
}
|
|
101
|
+
} = {
|
|
102
|
+
}
|
|
103
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './ChunkDocumentVersionResponse';
|
|
|
13
13
|
export * from './ChunkLineageResponse';
|
|
14
14
|
export * from './ChunkMetadataInput';
|
|
15
15
|
export * from './ChunkMetadataOutput';
|
|
16
|
+
export * from './ChunkNeighborsResponse';
|
|
16
17
|
export * from './ChunkResponse';
|
|
17
18
|
export * from './ChunkSearchRequest';
|
|
18
19
|
export * from './ChunkType';
|