@vertesia/client 1.0.0-dev.20260203.130115Z → 1.0.0-dev.20260225.024852Z
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/lib/cjs/AccountApi.js +85 -0
- package/lib/cjs/AccountApi.js.map +1 -0
- package/lib/cjs/AccountsApi.js +16 -0
- package/lib/cjs/AccountsApi.js.map +1 -0
- package/lib/cjs/AnalyticsApi.js +41 -0
- package/lib/cjs/AnalyticsApi.js.map +1 -0
- package/lib/cjs/ApiKeysApi.js +63 -0
- package/lib/cjs/ApiKeysApi.js.map +1 -0
- package/lib/cjs/AppsApi.js +119 -0
- package/lib/cjs/AppsApi.js.map +1 -0
- package/lib/cjs/AuditTrailApi.js +35 -0
- package/lib/cjs/AuditTrailApi.js.map +1 -0
- package/lib/cjs/CommandsApi.js +19 -0
- package/lib/cjs/CommandsApi.js.map +1 -0
- package/lib/cjs/EnvironmentsApi.js +72 -0
- package/lib/cjs/EnvironmentsApi.js.map +1 -0
- package/lib/cjs/GroupsApi.js +78 -0
- package/lib/cjs/GroupsApi.js.map +1 -0
- package/lib/cjs/IamApi.js +53 -0
- package/lib/cjs/IamApi.js.map +1 -0
- package/lib/cjs/InteractionBase.js +44 -0
- package/lib/cjs/InteractionBase.js.map +1 -0
- package/lib/cjs/InteractionCatalogApi.js +64 -0
- package/lib/cjs/InteractionCatalogApi.js.map +1 -0
- package/lib/cjs/InteractionOutput.js +300 -0
- package/lib/cjs/InteractionOutput.js.map +1 -0
- package/lib/cjs/InteractionResult.example.js +57 -0
- package/lib/cjs/InteractionResult.example.js.map +1 -0
- package/lib/cjs/InteractionsApi.js +262 -0
- package/lib/cjs/InteractionsApi.js.map +1 -0
- package/lib/cjs/MCPOAuthApi.js +62 -0
- package/lib/cjs/MCPOAuthApi.js.map +1 -0
- package/lib/cjs/ProjectsApi.js +88 -0
- package/lib/cjs/ProjectsApi.js.map +1 -0
- package/lib/cjs/PromptsApi.js +133 -0
- package/lib/cjs/PromptsApi.js.map +1 -0
- package/lib/cjs/RefsApi.js +14 -0
- package/lib/cjs/RefsApi.js.map +1 -0
- package/lib/cjs/RunsApi.js +108 -0
- package/lib/cjs/RunsApi.js.map +1 -0
- package/lib/cjs/SkillsApi.js +39 -0
- package/lib/cjs/SkillsApi.js.map +1 -0
- package/lib/cjs/StreamSource.js +17 -0
- package/lib/cjs/StreamSource.js.map +1 -0
- package/lib/cjs/TrainingApi.js +54 -0
- package/lib/cjs/TrainingApi.js.map +1 -0
- package/lib/cjs/UsersApi.js +19 -0
- package/lib/cjs/UsersApi.js.map +1 -0
- package/lib/cjs/client.js +362 -0
- package/lib/cjs/client.js.map +1 -0
- package/lib/cjs/execute.js +158 -0
- package/lib/cjs/execute.js.map +1 -0
- package/lib/cjs/index.js +22 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/nodejs/NodeStreamSource.js +45 -0
- package/lib/cjs/nodejs/NodeStreamSource.js.map +1 -0
- package/lib/cjs/nodejs/index.js +18 -0
- package/lib/cjs/nodejs/index.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/store/AnalyzeDocApi.js +56 -0
- package/lib/cjs/store/AnalyzeDocApi.js.map +1 -0
- package/lib/cjs/store/CollectionsApi.js +131 -0
- package/lib/cjs/store/CollectionsApi.js.map +1 -0
- package/lib/cjs/store/CommandsApi.js +17 -0
- package/lib/cjs/store/CommandsApi.js.map +1 -0
- package/lib/cjs/store/DashboardApi.js +182 -0
- package/lib/cjs/store/DashboardApi.js.map +1 -0
- package/lib/cjs/store/DataApi.js +433 -0
- package/lib/cjs/store/DataApi.js.map +1 -0
- package/lib/cjs/store/EmailApi.js +103 -0
- package/lib/cjs/store/EmailApi.js.map +1 -0
- package/lib/cjs/store/EmbeddingsApi.js +29 -0
- package/lib/cjs/store/EmbeddingsApi.js.map +1 -0
- package/lib/cjs/store/FilesApi.js +237 -0
- package/lib/cjs/store/FilesApi.js.map +1 -0
- package/lib/cjs/store/HiveMemoryApi.js +174 -0
- package/lib/cjs/store/HiveMemoryApi.js.map +1 -0
- package/lib/cjs/store/IndexingApi.js +207 -0
- package/lib/cjs/store/IndexingApi.js.map +1 -0
- package/lib/cjs/store/ObjectsApi.js +316 -0
- package/lib/cjs/store/ObjectsApi.js.map +1 -0
- package/lib/cjs/store/PendingAsksApi.js +43 -0
- package/lib/cjs/store/PendingAsksApi.js.map +1 -0
- package/lib/cjs/store/QueryApi.js +67 -0
- package/lib/cjs/store/QueryApi.js.map +1 -0
- package/lib/cjs/store/RenderingApi.js +84 -0
- package/lib/cjs/store/RenderingApi.js.map +1 -0
- package/lib/cjs/store/SchedulesApi.js +103 -0
- package/lib/cjs/store/SchedulesApi.js.map +1 -0
- package/lib/cjs/store/ToolsApi.js +21 -0
- package/lib/cjs/store/ToolsApi.js.map +1 -0
- package/lib/cjs/store/TypeCatalogApi.js +50 -0
- package/lib/cjs/store/TypeCatalogApi.js.map +1 -0
- package/lib/cjs/store/TypesApi.js +60 -0
- package/lib/cjs/store/TypesApi.js.map +1 -0
- package/lib/cjs/store/WorkersApi.js +16 -0
- package/lib/cjs/store/WorkersApi.js.map +1 -0
- package/lib/cjs/store/WorkflowsApi.js +604 -0
- package/lib/cjs/store/WorkflowsApi.js.map +1 -0
- package/lib/cjs/store/client.js +89 -0
- package/lib/cjs/store/client.js.map +1 -0
- package/lib/cjs/store/errors.js +11 -0
- package/lib/cjs/store/errors.js.map +1 -0
- package/lib/cjs/store/index.js +33 -0
- package/lib/cjs/store/index.js.map +1 -0
- package/lib/cjs/store/version.js +6 -0
- package/lib/cjs/store/version.js.map +1 -0
- package/lib/esm/AccountApi.js +82 -0
- package/lib/esm/AccountApi.js.map +1 -0
- package/lib/esm/AccountsApi.js +13 -0
- package/lib/esm/AccountsApi.js.map +1 -0
- package/lib/esm/AnalyticsApi.js +38 -0
- package/lib/esm/AnalyticsApi.js.map +1 -0
- package/lib/esm/ApiKeysApi.js +59 -0
- package/lib/esm/ApiKeysApi.js.map +1 -0
- package/lib/esm/AppsApi.js +116 -0
- package/lib/esm/AppsApi.js.map +1 -0
- package/lib/esm/AuditTrailApi.js +32 -0
- package/lib/esm/AuditTrailApi.js.map +1 -0
- package/lib/esm/CommandsApi.js +16 -0
- package/lib/esm/CommandsApi.js.map +1 -0
- package/lib/esm/EnvironmentsApi.js +69 -0
- package/lib/esm/EnvironmentsApi.js.map +1 -0
- package/lib/esm/GroupsApi.js +74 -0
- package/lib/esm/GroupsApi.js.map +1 -0
- package/lib/esm/IamApi.js +47 -0
- package/lib/esm/IamApi.js.map +1 -0
- package/lib/esm/InteractionBase.js +40 -0
- package/lib/esm/InteractionBase.js.map +1 -0
- package/lib/esm/InteractionCatalogApi.js +60 -0
- package/lib/esm/InteractionCatalogApi.js.map +1 -0
- package/lib/esm/InteractionOutput.js +293 -0
- package/lib/esm/InteractionOutput.js.map +1 -0
- package/lib/esm/InteractionResult.example.js +55 -0
- package/lib/esm/InteractionResult.example.js.map +1 -0
- package/lib/esm/InteractionsApi.js +259 -0
- package/lib/esm/InteractionsApi.js.map +1 -0
- package/lib/esm/MCPOAuthApi.js +59 -0
- package/lib/esm/MCPOAuthApi.js.map +1 -0
- package/lib/esm/ProjectsApi.js +85 -0
- package/lib/esm/ProjectsApi.js.map +1 -0
- package/lib/esm/PromptsApi.js +130 -0
- package/lib/esm/PromptsApi.js.map +1 -0
- package/lib/esm/RefsApi.js +10 -0
- package/lib/esm/RefsApi.js.map +1 -0
- package/lib/esm/RunsApi.js +104 -0
- package/lib/esm/RunsApi.js.map +1 -0
- package/lib/esm/SkillsApi.js +36 -0
- package/lib/esm/SkillsApi.js.map +1 -0
- package/lib/esm/StreamSource.js +13 -0
- package/lib/esm/StreamSource.js.map +1 -0
- package/lib/esm/TrainingApi.js +51 -0
- package/lib/esm/TrainingApi.js.map +1 -0
- package/lib/esm/UsersApi.js +16 -0
- package/lib/esm/UsersApi.js.map +1 -0
- package/lib/esm/client.js +353 -0
- package/lib/esm/client.js.map +1 -0
- package/lib/esm/execute.js +118 -0
- package/lib/esm/execute.js.map +1 -0
- package/lib/esm/index.js +6 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/nodejs/NodeStreamSource.js +41 -0
- package/lib/esm/nodejs/NodeStreamSource.js.map +1 -0
- package/lib/esm/nodejs/index.js +2 -0
- package/lib/esm/nodejs/index.js.map +1 -0
- package/lib/esm/store/AnalyzeDocApi.js +52 -0
- package/lib/esm/store/AnalyzeDocApi.js.map +1 -0
- package/lib/esm/store/CollectionsApi.js +127 -0
- package/lib/esm/store/CollectionsApi.js.map +1 -0
- package/lib/esm/store/CommandsApi.js +13 -0
- package/lib/esm/store/CommandsApi.js.map +1 -0
- package/lib/esm/store/DashboardApi.js +178 -0
- package/lib/esm/store/DashboardApi.js.map +1 -0
- package/lib/esm/store/DataApi.js +429 -0
- package/lib/esm/store/DataApi.js.map +1 -0
- package/lib/esm/store/EmailApi.js +99 -0
- package/lib/esm/store/EmailApi.js.map +1 -0
- package/lib/esm/store/EmbeddingsApi.js +25 -0
- package/lib/esm/store/EmbeddingsApi.js.map +1 -0
- package/lib/esm/store/FilesApi.js +231 -0
- package/lib/esm/store/FilesApi.js.map +1 -0
- package/lib/esm/store/HiveMemoryApi.js +170 -0
- package/lib/esm/store/HiveMemoryApi.js.map +1 -0
- package/lib/esm/store/IndexingApi.js +203 -0
- package/lib/esm/store/IndexingApi.js.map +1 -0
- package/lib/esm/store/ObjectsApi.js +311 -0
- package/lib/esm/store/ObjectsApi.js.map +1 -0
- package/lib/esm/store/PendingAsksApi.js +39 -0
- package/lib/esm/store/PendingAsksApi.js.map +1 -0
- package/lib/esm/store/QueryApi.js +63 -0
- package/lib/esm/store/QueryApi.js.map +1 -0
- package/lib/esm/store/RenderingApi.js +80 -0
- package/lib/esm/store/RenderingApi.js.map +1 -0
- package/lib/esm/store/SchedulesApi.js +99 -0
- package/lib/esm/store/SchedulesApi.js.map +1 -0
- package/lib/esm/store/ToolsApi.js +17 -0
- package/lib/esm/store/ToolsApi.js.map +1 -0
- package/lib/esm/store/TypeCatalogApi.js +46 -0
- package/lib/esm/store/TypeCatalogApi.js.map +1 -0
- package/lib/esm/store/TypesApi.js +56 -0
- package/lib/esm/store/TypesApi.js.map +1 -0
- package/lib/esm/store/WorkersApi.js +12 -0
- package/lib/esm/store/WorkersApi.js.map +1 -0
- package/lib/esm/store/WorkflowsApi.js +598 -0
- package/lib/esm/store/WorkflowsApi.js.map +1 -0
- package/lib/esm/store/client.js +85 -0
- package/lib/esm/store/client.js.map +1 -0
- package/lib/esm/store/errors.js +7 -0
- package/lib/esm/store/errors.js.map +1 -0
- package/lib/esm/store/index.js +17 -0
- package/lib/esm/store/index.js.map +1 -0
- package/lib/esm/store/version.js +3 -0
- package/lib/esm/store/version.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/AccountApi.d.ts +59 -0
- package/lib/types/AccountApi.d.ts.map +1 -0
- package/lib/types/AccountsApi.d.ts +7 -0
- package/lib/types/AccountsApi.d.ts.map +1 -0
- package/lib/types/AnalyticsApi.d.ts +11 -0
- package/lib/types/AnalyticsApi.d.ts.map +1 -0
- package/lib/types/ApiKeysApi.d.ts +42 -0
- package/lib/types/ApiKeysApi.d.ts.map +1 -0
- package/lib/types/AppsApi.d.ts +65 -0
- package/lib/types/AppsApi.d.ts.map +1 -0
- package/lib/types/AuditTrailApi.d.ts +6 -0
- package/lib/types/AuditTrailApi.d.ts.map +1 -0
- package/lib/types/CommandsApi.d.ts +10 -0
- package/lib/types/CommandsApi.d.ts.map +1 -0
- package/lib/types/EnvironmentsApi.d.ts +40 -0
- package/lib/types/EnvironmentsApi.d.ts.map +1 -0
- package/lib/types/GroupsApi.d.ts +65 -0
- package/lib/types/GroupsApi.d.ts.map +1 -0
- package/lib/types/IamApi.d.ts +41 -0
- package/lib/types/IamApi.d.ts.map +1 -0
- package/lib/types/InteractionBase.d.ts +22 -0
- package/lib/types/InteractionBase.d.ts.map +1 -0
- package/lib/types/InteractionCatalogApi.d.ts +36 -0
- package/lib/types/InteractionCatalogApi.d.ts.map +1 -0
- package/lib/types/InteractionOutput.d.ts +174 -0
- package/lib/types/InteractionOutput.d.ts.map +1 -0
- package/lib/types/InteractionResult.example.d.ts +6 -0
- package/lib/types/InteractionResult.example.d.ts.map +1 -0
- package/lib/types/InteractionsApi.d.ts +183 -0
- package/lib/types/InteractionsApi.d.ts.map +1 -0
- package/lib/types/MCPOAuthApi.d.ts +45 -0
- package/lib/types/MCPOAuthApi.d.ts.map +1 -0
- package/lib/types/ProjectsApi.d.ts +32 -0
- package/lib/types/ProjectsApi.d.ts.map +1 -0
- package/lib/types/PromptsApi.d.ts +106 -0
- package/lib/types/PromptsApi.d.ts.map +1 -0
- package/lib/types/RefsApi.d.ts +6 -0
- package/lib/types/RefsApi.d.ts.map +1 -0
- package/lib/types/RunsApi.d.ts +78 -0
- package/lib/types/RunsApi.d.ts.map +1 -0
- package/lib/types/SkillsApi.d.ts +26 -0
- package/lib/types/SkillsApi.d.ts.map +1 -0
- package/lib/types/StreamSource.d.ts +7 -0
- package/lib/types/StreamSource.d.ts.map +1 -0
- package/lib/types/TrainingApi.d.ts +27 -0
- package/lib/types/TrainingApi.d.ts.map +1 -0
- package/lib/types/UsersApi.d.ts +10 -0
- package/lib/types/UsersApi.d.ts.map +1 -0
- package/lib/types/client.d.ts +138 -0
- package/lib/types/client.d.ts.map +1 -0
- package/lib/types/execute.d.ts +37 -0
- package/lib/types/execute.d.ts.map +1 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/nodejs/NodeStreamSource.d.ts +9 -0
- package/lib/types/nodejs/NodeStreamSource.d.ts.map +1 -0
- package/lib/types/nodejs/index.d.ts +1 -0
- package/lib/types/nodejs/index.d.ts.map +1 -0
- package/lib/types/store/AnalyzeDocApi.d.ts +17 -0
- package/lib/types/store/AnalyzeDocApi.d.ts.map +1 -0
- package/lib/types/store/CollectionsApi.d.ts +82 -0
- package/lib/types/store/CollectionsApi.d.ts.map +1 -0
- package/lib/types/store/CommandsApi.d.ts +10 -0
- package/lib/types/store/CommandsApi.d.ts.map +1 -0
- package/lib/types/store/DashboardApi.d.ts +149 -0
- package/lib/types/store/DashboardApi.d.ts.map +1 -0
- package/lib/types/store/DataApi.d.ts +392 -0
- package/lib/types/store/DataApi.d.ts.map +1 -0
- package/lib/types/store/EmailApi.d.ts +185 -0
- package/lib/types/store/EmailApi.d.ts.map +1 -0
- package/lib/types/store/EmbeddingsApi.d.ts +12 -0
- package/lib/types/store/EmbeddingsApi.d.ts.map +1 -0
- package/lib/types/store/FilesApi.d.ts +110 -0
- package/lib/types/store/FilesApi.d.ts.map +1 -0
- package/lib/types/store/HiveMemoryApi.d.ts +160 -0
- package/lib/types/store/HiveMemoryApi.d.ts.map +1 -0
- package/lib/types/store/IndexingApi.d.ts +140 -0
- package/lib/types/store/IndexingApi.d.ts.map +1 -0
- package/lib/types/store/ObjectsApi.d.ts +141 -0
- package/lib/types/store/ObjectsApi.d.ts.map +1 -0
- package/lib/types/store/PendingAsksApi.d.ts +79 -0
- package/lib/types/store/PendingAsksApi.d.ts.map +1 -0
- package/lib/types/store/QueryApi.d.ts +99 -0
- package/lib/types/store/QueryApi.d.ts.map +1 -0
- package/lib/types/store/RenderingApi.d.ts +34 -0
- package/lib/types/store/RenderingApi.d.ts.map +1 -0
- package/lib/types/store/SchedulesApi.d.ts +89 -0
- package/lib/types/store/SchedulesApi.d.ts.map +1 -0
- package/lib/types/store/ToolsApi.d.ts +13 -0
- package/lib/types/store/ToolsApi.d.ts.map +1 -0
- package/lib/types/store/TypeCatalogApi.d.ts +39 -0
- package/lib/types/store/TypeCatalogApi.d.ts.map +1 -0
- package/lib/types/store/TypesApi.d.ts +25 -0
- package/lib/types/store/TypesApi.d.ts.map +1 -0
- package/lib/types/store/WorkersApi.d.ts +6 -0
- package/lib/types/store/WorkersApi.d.ts.map +1 -0
- package/lib/types/store/WorkflowsApi.d.ts +170 -0
- package/lib/types/store/WorkflowsApi.d.ts.map +1 -0
- package/lib/types/store/client.d.ts +53 -0
- package/lib/types/store/client.d.ts.map +1 -0
- package/lib/types/store/errors.d.ts +4 -0
- package/lib/types/store/errors.d.ts.map +1 -0
- package/lib/types/store/index.d.ts +16 -0
- package/lib/types/store/index.d.ts.map +1 -0
- package/lib/types/store/version.d.ts +2 -0
- package/lib/types/store/version.d.ts.map +1 -0
- package/lib/vertesia-client.js +2 -0
- package/lib/vertesia-client.js.map +1 -0
- package/package.json +4 -4
- package/src/AuditTrailApi.ts +25 -0
- package/src/ProjectsApi.ts +21 -1
- package/src/RunsApi.ts +0 -7
- package/src/UsersApi.ts +9 -5
- package/src/client.ts +2 -0
- package/src/store/IndexingApi.ts +190 -2
- package/src/store/ObjectsApi.ts +12 -8
- package/src/store/RenderingApi.ts +105 -0
- package/src/store/TypeCatalogApi.ts +53 -0
- package/src/store/TypesApi.ts +3 -0
- package/src/store/client.ts +3 -3
- package/src/store/index.ts +2 -1
- package/src/store/version.ts +1 -1
- package/src/store/IndexingAdminApi.ts +0 -336
package/src/store/ObjectsApi.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
2
|
import {
|
|
3
3
|
canGenerateRendition,
|
|
4
|
-
ContentObjectApiHeaders,
|
|
5
4
|
ComplexSearchPayload,
|
|
6
5
|
ComputeObjectFacetPayload,
|
|
7
6
|
ContentObject,
|
|
7
|
+
ContentObjectApiHeaders,
|
|
8
8
|
ContentObjectItem,
|
|
9
9
|
ContentObjectProcessingPriority,
|
|
10
10
|
ContentSource,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
ObjectSearchPayload,
|
|
24
24
|
ObjectSearchQuery,
|
|
25
25
|
SupportedEmbeddingTypes,
|
|
26
|
-
supportsVisualRendition
|
|
26
|
+
supportsVisualRendition
|
|
27
27
|
} from "@vertesia/common";
|
|
28
28
|
|
|
29
29
|
// Re-export rendition utilities for consumers
|
|
@@ -151,6 +151,7 @@ export class ObjectsApi extends ApiTopic {
|
|
|
151
151
|
name: source.name,
|
|
152
152
|
mime_type: source.type,
|
|
153
153
|
});
|
|
154
|
+
const sourceMimeType = source.type || mime_type;
|
|
154
155
|
|
|
155
156
|
// upload the file content to the signed URL
|
|
156
157
|
/*const res = await this.fetch(url, {
|
|
@@ -175,9 +176,7 @@ export class ObjectsApi extends ApiTopic {
|
|
|
175
176
|
body: isStream ? source.stream : source,
|
|
176
177
|
//@ts-ignore: duplex is not in the types. See https://github.com/node-fetch/node-fetch/issues/1769
|
|
177
178
|
duplex: isStream ? "half" : undefined,
|
|
178
|
-
headers: {
|
|
179
|
-
"Content-Type": mime_type || "application/octet-stream",
|
|
180
|
-
},
|
|
179
|
+
headers: sourceMimeType ? { "Content-Type": sourceMimeType } : undefined,
|
|
181
180
|
})
|
|
182
181
|
.then((res: Response) => {
|
|
183
182
|
if (res.ok) {
|
|
@@ -201,7 +200,7 @@ export class ObjectsApi extends ApiTopic {
|
|
|
201
200
|
return {
|
|
202
201
|
source: id,
|
|
203
202
|
name: source.name,
|
|
204
|
-
type:
|
|
203
|
+
type: sourceMimeType,
|
|
205
204
|
etag,
|
|
206
205
|
};
|
|
207
206
|
}
|
|
@@ -226,7 +225,7 @@ export class ObjectsApi extends ApiTopic {
|
|
|
226
225
|
const headers: Record<string, string> = {};
|
|
227
226
|
if (options?.processing_priority) {
|
|
228
227
|
headers[ContentObjectApiHeaders.PROCESSING_PRIORITY] = options.processing_priority;
|
|
229
|
-
}
|
|
228
|
+
}
|
|
230
229
|
if (options?.collection_id) {
|
|
231
230
|
headers[ContentObjectApiHeaders.COLLECTION_ID] = options.collection_id;
|
|
232
231
|
}
|
|
@@ -270,7 +269,7 @@ export class ObjectsApi extends ApiTopic {
|
|
|
270
269
|
const headers: Record<string, string> = {};
|
|
271
270
|
if (options?.processing_priority) {
|
|
272
271
|
headers[ContentObjectApiHeaders.PROCESSING_PRIORITY] = options.processing_priority;
|
|
273
|
-
}
|
|
272
|
+
}
|
|
274
273
|
if (options?.collection_id) {
|
|
275
274
|
headers[ContentObjectApiHeaders.COLLECTION_ID] = options.collection_id;
|
|
276
275
|
}
|
|
@@ -301,6 +300,8 @@ export class ObjectsApi extends ApiTopic {
|
|
|
301
300
|
revisionLabel?: string;
|
|
302
301
|
processing_priority?: ContentObjectProcessingPriority;
|
|
303
302
|
suppressWorkflows?: boolean;
|
|
303
|
+
/** If provided, the server will reject the update with 412 if the document's content etag no longer matches. */
|
|
304
|
+
ifMatch?: string;
|
|
304
305
|
},
|
|
305
306
|
): Promise<ContentObject> {
|
|
306
307
|
const updatePayload: Partial<CreateContentObjectPayload> = {
|
|
@@ -316,6 +317,9 @@ export class ObjectsApi extends ApiTopic {
|
|
|
316
317
|
}
|
|
317
318
|
|
|
318
319
|
const headers: Record<string, string> = {};
|
|
320
|
+
if (options?.ifMatch) {
|
|
321
|
+
headers['if-match'] = options.ifMatch;
|
|
322
|
+
}
|
|
319
323
|
if (options?.processing_priority) {
|
|
320
324
|
headers[ContentObjectApiHeaders.PROCESSING_PRIORITY] = options.processing_priority;
|
|
321
325
|
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import {
|
|
3
|
+
isWorkflowTerminalStatus,
|
|
4
|
+
RenderMarkdownPollOptions,
|
|
5
|
+
RenderMarkdownPayload,
|
|
6
|
+
RenderMarkdownStartResponse,
|
|
7
|
+
RenderMarkdownStatusResponse,
|
|
8
|
+
RenderMarkdownResponse,
|
|
9
|
+
WorkflowExecutionStatus,
|
|
10
|
+
} from "@vertesia/common";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* API for rendering markdown documents to PDF or DOCX.
|
|
14
|
+
* Rendering is performed on workflow workers (not on the API server).
|
|
15
|
+
*/
|
|
16
|
+
export class RenderingApi extends ApiTopic {
|
|
17
|
+
constructor(parent: ClientBase) {
|
|
18
|
+
super(parent, "/api/v1/rendering");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Render markdown content to PDF or DOCX.
|
|
23
|
+
*
|
|
24
|
+
* @param payload - Rendering options including format and either object_id or inline content
|
|
25
|
+
* @returns Rendering result with download URL
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Render an existing markdown document
|
|
29
|
+
* const result = await client.rendering.render({
|
|
30
|
+
* format: MarkdownRenditionFormat.pdf,
|
|
31
|
+
* object_id: "doc-123"
|
|
32
|
+
* });
|
|
33
|
+
* // Download from result.download_url
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // Render inline markdown content
|
|
37
|
+
* const result = await client.rendering.render({
|
|
38
|
+
* format: MarkdownRenditionFormat.docx,
|
|
39
|
+
* content: "# My Report\n\nContent here...",
|
|
40
|
+
* title: "My Report"
|
|
41
|
+
* });
|
|
42
|
+
*/
|
|
43
|
+
start(payload: RenderMarkdownPayload): Promise<RenderMarkdownStartResponse> {
|
|
44
|
+
return this.post("/jobs", { payload });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
getStatus(
|
|
48
|
+
workflowId: string,
|
|
49
|
+
workflowRunId: string,
|
|
50
|
+
): Promise<RenderMarkdownStatusResponse> {
|
|
51
|
+
return this.get("/jobs/status", {
|
|
52
|
+
query: {
|
|
53
|
+
workflow_id: workflowId,
|
|
54
|
+
workflow_run_id: workflowRunId,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async render(
|
|
60
|
+
payload: RenderMarkdownPayload,
|
|
61
|
+
options: RenderMarkdownPollOptions = {},
|
|
62
|
+
): Promise<RenderMarkdownResponse> {
|
|
63
|
+
const pollIntervalMs = options.pollIntervalMs ?? 1500;
|
|
64
|
+
const timeoutMs = options.timeoutMs ?? 10 * 60 * 1000;
|
|
65
|
+
|
|
66
|
+
const started = await this.start(payload);
|
|
67
|
+
if (!started.workflow_id || !started.workflow_run_id) {
|
|
68
|
+
throw new Error("Failed to start rendering workflow");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const startTime = Date.now();
|
|
72
|
+
|
|
73
|
+
// Poll until workflow reaches terminal state.
|
|
74
|
+
while (true) {
|
|
75
|
+
const status = await this.getStatus(started.workflow_id, started.workflow_run_id);
|
|
76
|
+
|
|
77
|
+
if (status.status === WorkflowExecutionStatus.COMPLETED) {
|
|
78
|
+
if (!status.download_url && !status.file_uri) {
|
|
79
|
+
throw new Error(status.error || "Rendering completed but no output file was produced");
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
status: "success",
|
|
83
|
+
format: payload.format,
|
|
84
|
+
download_url: status.download_url,
|
|
85
|
+
file_uri: status.file_uri,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (isWorkflowTerminalStatus(status.status)) {
|
|
90
|
+
const statusLabel = WorkflowExecutionStatus[status.status] || String(status.status);
|
|
91
|
+
throw new Error(status.error || `Rendering failed with status: ${statusLabel}`);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (Date.now() - startTime >= timeoutMs) {
|
|
95
|
+
throw new Error(`Rendering timed out after ${timeoutMs}ms`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
await sleep(pollIntervalMs);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function sleep(ms: number): Promise<void> {
|
|
104
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
105
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
+
import { ContentObjectTypeItem, ContentObjectTypeRef } from '@vertesia/common';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export class TypeCatalogApi extends ApiTopic {
|
|
6
|
+
constructor(parent: ClientBase) {
|
|
7
|
+
super(parent, '/api/v1/types/catalog');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* List all content types (system + app + stored)
|
|
12
|
+
*/
|
|
13
|
+
list(query: { tag?: string, limit?: number, offset?: number, layout?: boolean, schema?: boolean } = {}): Promise<ContentObjectTypeItem[]> {
|
|
14
|
+
return this.get('/', { query });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* List system types only
|
|
19
|
+
*/
|
|
20
|
+
listSysTypes(tag?: string): Promise<ContentObjectTypeItem[]> {
|
|
21
|
+
return this.get('/sys', {
|
|
22
|
+
query: { tag }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* List all app types from all installed apps
|
|
28
|
+
*/
|
|
29
|
+
listAppTypes(tag?: string): Promise<ContentObjectTypeItem[]> {
|
|
30
|
+
return this.get('/apps', {
|
|
31
|
+
query: { tag }
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* List stored types only
|
|
37
|
+
*/
|
|
38
|
+
listStoredTypes(query: { tag?: string, limit?: number, offset?: number, layout?: boolean, schema?: boolean } = {}): Promise<ContentObjectTypeItem[]> {
|
|
39
|
+
return this.get('/stored', {
|
|
40
|
+
query
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Resolve a type to its full definition.
|
|
46
|
+
* Accepts a string (type ID or code) or a ContentObjectTypeRef (extracts code or id automatically).
|
|
47
|
+
* @param typeOrRef Type identifier string, or a ContentObjectTypeRef from a content object
|
|
48
|
+
*/
|
|
49
|
+
resolve(typeOrRef: string | ContentObjectTypeRef): Promise<ContentObjectTypeItem> {
|
|
50
|
+
const typeId = typeof typeOrRef === 'string' ? typeOrRef : (typeOrRef.code || typeOrRef.id!);
|
|
51
|
+
return this.get(`/resolve/${typeId}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
package/src/store/TypesApi.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { ContentObjectType, ContentObjectTypeItem, CreateContentObjectTypePayload, FindPayload, ObjectTypeSearchQuery, ObjectTypeSearchPayload } from "@vertesia/common";
|
|
2
2
|
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
3
|
+
import { TypeCatalogApi } from "./TypeCatalogApi.js";
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
export class TypesApi extends ApiTopic {
|
|
7
|
+
catalog: TypeCatalogApi;
|
|
6
8
|
|
|
7
9
|
constructor(parent: ClientBase) {
|
|
8
10
|
super(parent, "/api/v1/types");
|
|
11
|
+
this.catalog = new TypeCatalogApi(parent);
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
/**
|
package/src/store/client.ts
CHANGED
|
@@ -4,21 +4,21 @@ import { CollectionsApi } from "./CollectionsApi.js";
|
|
|
4
4
|
import { CommandsApi } from "./CommandsApi.js";
|
|
5
5
|
import { DataApi } from "./DataApi.js";
|
|
6
6
|
import { EmailApi } from "./EmailApi.js";
|
|
7
|
-
import { IndexingAdminApi } from "./IndexingAdminApi.js";
|
|
8
7
|
import { IndexingApi } from "./IndexingApi.js";
|
|
9
8
|
import { EmbeddingsApi } from "./EmbeddingsApi.js";
|
|
10
9
|
import { ZenoClientNotFoundError } from "./errors.js";
|
|
11
10
|
import { FilesApi } from "./FilesApi.js";
|
|
11
|
+
import { HiveMemoryApi } from "./HiveMemoryApi.js";
|
|
12
12
|
import { ObjectsApi } from "./ObjectsApi.js";
|
|
13
13
|
import { PendingAsksApi } from "./PendingAsksApi.js";
|
|
14
14
|
import { QueryApi } from "./QueryApi.js";
|
|
15
|
+
import { RenderingApi } from "./RenderingApi.js";
|
|
15
16
|
import { SchedulesApi } from "./SchedulesApi.js";
|
|
16
17
|
import { ToolsApi } from "./ToolsApi.js";
|
|
17
18
|
import { TypesApi } from "./TypesApi.js";
|
|
18
19
|
import { VERSION, VERSION_HEADER } from "./version.js";
|
|
19
20
|
import { WorkersApi } from "./WorkersApi.js";
|
|
20
21
|
import { WorkflowsApi } from "./WorkflowsApi.js";
|
|
21
|
-
import { HiveMemoryApi } from "./HiveMemoryApi.js";
|
|
22
22
|
|
|
23
23
|
export interface ZenoClientProps {
|
|
24
24
|
serverUrl?: string;
|
|
@@ -98,6 +98,6 @@ export class ZenoClient extends AbstractFetchClient<ZenoClient> {
|
|
|
98
98
|
tools = new ToolsApi(this);
|
|
99
99
|
indexing = new IndexingApi(this);
|
|
100
100
|
query = new QueryApi(this);
|
|
101
|
-
indexingAdmin = new IndexingAdminApi(this);
|
|
102
101
|
hiveMemory = new HiveMemoryApi(this);
|
|
102
|
+
rendering = new RenderingApi(this);
|
|
103
103
|
}
|
package/src/store/index.ts
CHANGED
|
@@ -5,12 +5,13 @@ export * from "./EmailApi.js";
|
|
|
5
5
|
export * from "./errors.js";
|
|
6
6
|
export * from "./FilesApi.js";
|
|
7
7
|
export * from "./HiveMemoryApi.js";
|
|
8
|
-
export * from "./IndexingAdminApi.js";
|
|
9
8
|
export * from "./IndexingApi.js";
|
|
10
9
|
export * from "./ObjectsApi.js";
|
|
11
10
|
export * from "./PendingAsksApi.js";
|
|
12
11
|
export * from "./QueryApi.js";
|
|
12
|
+
export * from "./RenderingApi.js";
|
|
13
13
|
export * from "./SchedulesApi.js";
|
|
14
|
+
export * from "./TypeCatalogApi.js";
|
|
14
15
|
export * from "./TypesApi.js";
|
|
15
16
|
export * from "./WorkflowsApi.js";
|
|
16
17
|
|
package/src/store/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '
|
|
1
|
+
export const VERSION = '20260210' // YYYYMMDD, client versioning for API endpoints. Increment manually for breaking changes
|
|
2
2
|
export const VERSION_HEADER = 'x-api-version';
|
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Document data structure for Elasticsearch indexing
|
|
5
|
-
*/
|
|
6
|
-
export interface ElasticsearchDocumentData {
|
|
7
|
-
name?: string;
|
|
8
|
-
text?: string;
|
|
9
|
-
properties?: Record<string, unknown>;
|
|
10
|
-
status?: string;
|
|
11
|
-
type?: {
|
|
12
|
-
id?: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
};
|
|
15
|
-
security?: {
|
|
16
|
-
'content:read'?: string[];
|
|
17
|
-
'content:write'?: string[];
|
|
18
|
-
'content:delete'?: string[];
|
|
19
|
-
};
|
|
20
|
-
revision?: {
|
|
21
|
-
head?: boolean;
|
|
22
|
-
root?: string;
|
|
23
|
-
};
|
|
24
|
-
embeddings_text?: number[];
|
|
25
|
-
embeddings_image?: number[];
|
|
26
|
-
embeddings_properties?: number[];
|
|
27
|
-
created_at?: Date | string;
|
|
28
|
-
updated_at?: Date | string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Result from bulk indexing
|
|
33
|
-
*/
|
|
34
|
-
export interface BulkIndexResult {
|
|
35
|
-
successful: number;
|
|
36
|
-
failed: number;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Result from creating a reindex target
|
|
41
|
-
*/
|
|
42
|
-
export interface CreateReindexTargetResult {
|
|
43
|
-
created: boolean;
|
|
44
|
-
indexName: string;
|
|
45
|
-
aliasName: string;
|
|
46
|
-
version: number;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Result from getting reindex range
|
|
51
|
-
*/
|
|
52
|
-
export interface ReindexRangeResult {
|
|
53
|
-
first: string | null;
|
|
54
|
-
last: string | null;
|
|
55
|
-
count: number;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Result from fetching a batch
|
|
60
|
-
*/
|
|
61
|
-
export interface FetchBatchResult {
|
|
62
|
-
documents: Array<{
|
|
63
|
-
id: string;
|
|
64
|
-
document: ElasticsearchDocumentData;
|
|
65
|
-
}>;
|
|
66
|
-
nextCursor: string | null;
|
|
67
|
-
done: boolean;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Result from indexing a batch
|
|
72
|
-
*/
|
|
73
|
-
export interface IndexBatchResult {
|
|
74
|
-
successful: number;
|
|
75
|
-
failed: number;
|
|
76
|
-
processed: number;
|
|
77
|
-
nextCursor: string | null;
|
|
78
|
-
done: boolean;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Result from triggering a reindex
|
|
83
|
-
*/
|
|
84
|
-
export interface TriggerReindexResult {
|
|
85
|
-
status: string;
|
|
86
|
-
workflow?: string;
|
|
87
|
-
workflowId?: string;
|
|
88
|
-
runId?: string;
|
|
89
|
-
objectCount?: number;
|
|
90
|
-
reason?: string;
|
|
91
|
-
enabled?: boolean;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Elasticsearch index statistics
|
|
96
|
-
*/
|
|
97
|
-
export interface ElasticsearchIndexStats {
|
|
98
|
-
enabled: boolean;
|
|
99
|
-
exists?: boolean;
|
|
100
|
-
documentCount?: number;
|
|
101
|
-
sizeInBytes?: number;
|
|
102
|
-
indexName?: string;
|
|
103
|
-
aliasName?: string;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Embedding configuration for a single type
|
|
108
|
-
*/
|
|
109
|
-
export interface EmbeddingTypeConfig {
|
|
110
|
-
environment?: string;
|
|
111
|
-
dimensions?: number;
|
|
112
|
-
model?: string;
|
|
113
|
-
provider?: string;
|
|
114
|
-
enabled?: boolean;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Detailed index configuration
|
|
119
|
-
*/
|
|
120
|
-
export interface IndexConfiguration {
|
|
121
|
-
enabled: boolean;
|
|
122
|
-
exists?: boolean;
|
|
123
|
-
indexName?: string;
|
|
124
|
-
aliasName?: string;
|
|
125
|
-
version?: number;
|
|
126
|
-
documentCount?: number;
|
|
127
|
-
sizeInBytes?: number;
|
|
128
|
-
embeddingDimensions?: {
|
|
129
|
-
text?: number;
|
|
130
|
-
image?: number;
|
|
131
|
-
properties?: number;
|
|
132
|
-
};
|
|
133
|
-
fieldMappings?: Record<string, unknown>;
|
|
134
|
-
projectEmbeddingsConfig?: {
|
|
135
|
-
text?: EmbeddingTypeConfig;
|
|
136
|
-
image?: EmbeddingTypeConfig;
|
|
137
|
-
properties?: EmbeddingTypeConfig;
|
|
138
|
-
};
|
|
139
|
-
createdAt?: Date | null;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Result from fetching documents by IDs
|
|
144
|
-
*/
|
|
145
|
-
export interface FetchDocumentsByIdsResult {
|
|
146
|
-
documents: Array<{
|
|
147
|
-
id: string;
|
|
148
|
-
document: ElasticsearchDocumentData;
|
|
149
|
-
}>;
|
|
150
|
-
notFound: string[];
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Result from bulk delete
|
|
155
|
-
*/
|
|
156
|
-
export interface BulkDeleteResult {
|
|
157
|
-
successful: number;
|
|
158
|
-
failed: number;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Admin API for Elasticsearch operations
|
|
163
|
-
*
|
|
164
|
-
* These methods are called by Temporal workflow activities to perform
|
|
165
|
-
* Elasticsearch operations. They require content admin permissions.
|
|
166
|
-
*/
|
|
167
|
-
export class IndexingAdminApi extends ApiTopic {
|
|
168
|
-
|
|
169
|
-
constructor(parent: ClientBase, basePath: string = "/admin/elasticsearch") {
|
|
170
|
-
super(parent, basePath);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Index a single document to Elasticsearch
|
|
175
|
-
*/
|
|
176
|
-
index(objectId: string, document: ElasticsearchDocumentData): Promise<{ status: string; objectId: string }> {
|
|
177
|
-
return this.post("/index", {
|
|
178
|
-
payload: { objectId, document },
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Delete a document from Elasticsearch
|
|
184
|
-
*/
|
|
185
|
-
delete(objectId: string): Promise<{ status: string; objectId: string }> {
|
|
186
|
-
return this.post("/delete", {
|
|
187
|
-
payload: { objectId },
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Bulk index multiple documents to Elasticsearch
|
|
193
|
-
*
|
|
194
|
-
* @param documents Array of documents to index
|
|
195
|
-
* @param targetIndex Optional explicit index name for zero-downtime reindexing
|
|
196
|
-
*/
|
|
197
|
-
bulkIndex(
|
|
198
|
-
documents: Array<{ id: string; document: ElasticsearchDocumentData }>,
|
|
199
|
-
targetIndex?: string
|
|
200
|
-
): Promise<BulkIndexResult> {
|
|
201
|
-
return this.post("/bulk-index", {
|
|
202
|
-
payload: { documents, targetIndex },
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Ensure Elasticsearch index exists for the project
|
|
208
|
-
*
|
|
209
|
-
* @param recreate If true, drops and recreates the index
|
|
210
|
-
*/
|
|
211
|
-
ensureIndex(recreate?: boolean): Promise<{ created: boolean; recreated?: boolean; existed?: boolean }> {
|
|
212
|
-
return this.post("/ensure-index", {
|
|
213
|
-
payload: { recreate },
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Create a new versioned index for reindexing (without alias)
|
|
219
|
-
* The alias will be swapped after reindexing completes via swapAlias
|
|
220
|
-
*/
|
|
221
|
-
createReindexTarget(): Promise<CreateReindexTargetResult> {
|
|
222
|
-
return this.post("/create-reindex-target", {
|
|
223
|
-
payload: {},
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Atomically swap the alias from old index to new index
|
|
229
|
-
*
|
|
230
|
-
* @param newIndexName The new index to point the alias to
|
|
231
|
-
* @param deleteOld If true, deletes the old index after swapping
|
|
232
|
-
*/
|
|
233
|
-
swapAlias(newIndexName: string, deleteOld?: boolean): Promise<{ swapped: boolean; aliasName?: string; newIndexName?: string }> {
|
|
234
|
-
return this.post("/swap-alias", {
|
|
235
|
-
payload: { newIndexName, deleteOld },
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Get Elasticsearch index statistics for the project
|
|
241
|
-
*/
|
|
242
|
-
getStats(): Promise<ElasticsearchIndexStats> {
|
|
243
|
-
return this.post("/stats", {
|
|
244
|
-
payload: {},
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Get the _id range for reindexing (first, last, count)
|
|
250
|
-
* Used by workflow to set up cursor-based pagination
|
|
251
|
-
*/
|
|
252
|
-
getReindexRange(): Promise<ReindexRangeResult> {
|
|
253
|
-
return this.post("/reindex-range", {
|
|
254
|
-
payload: {},
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Fetch a batch of documents from MongoDB (without indexing)
|
|
260
|
-
* Used by pipeline approach: fetch next batch while indexing current
|
|
261
|
-
*
|
|
262
|
-
* @param cursor Cursor from previous batch (null for first batch)
|
|
263
|
-
* @param limit Maximum documents to fetch (default: 500)
|
|
264
|
-
*/
|
|
265
|
-
fetchBatch(cursor?: string | null, limit?: number): Promise<FetchBatchResult> {
|
|
266
|
-
return this.post("/fetch-batch", {
|
|
267
|
-
payload: { cursor, limit },
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Fetch and index a batch of documents (server-side)
|
|
273
|
-
* Uses cursor-based pagination for reliability
|
|
274
|
-
*
|
|
275
|
-
* @param cursor Cursor from previous batch (null for first batch)
|
|
276
|
-
* @param limit Maximum documents to process (default: 500)
|
|
277
|
-
* @param targetIndex Optional explicit index name for zero-downtime reindexing
|
|
278
|
-
*/
|
|
279
|
-
indexBatch(cursor?: string | null, limit?: number, targetIndex?: string): Promise<IndexBatchResult> {
|
|
280
|
-
return this.post("/index-batch", {
|
|
281
|
-
payload: { cursor, limit, targetIndex },
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Trigger a reindex operation via Temporal workflow
|
|
287
|
-
*
|
|
288
|
-
* @param fullReindex If true, reindexes all documents in the project
|
|
289
|
-
* @param objectIds Specific object IDs to reindex (if not fullReindex)
|
|
290
|
-
* @param recreateIndex If true, recreates the index before reindexing
|
|
291
|
-
*/
|
|
292
|
-
triggerReindex(options?: {
|
|
293
|
-
fullReindex?: boolean;
|
|
294
|
-
objectIds?: string[];
|
|
295
|
-
recreateIndex?: boolean;
|
|
296
|
-
}): Promise<TriggerReindexResult> {
|
|
297
|
-
return this.post("/reindex", {
|
|
298
|
-
payload: options ?? {},
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Fetch documents by their IDs from MongoDB (for retry workflow)
|
|
304
|
-
* Returns documents ready for bulk indexing
|
|
305
|
-
*
|
|
306
|
-
* @param objectIds Array of object IDs to fetch
|
|
307
|
-
*/
|
|
308
|
-
fetchDocumentsByIds(objectIds: string[]): Promise<FetchDocumentsByIdsResult> {
|
|
309
|
-
return this.post("/fetch-by-ids", {
|
|
310
|
-
payload: { objectIds },
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Bulk delete documents from Elasticsearch
|
|
316
|
-
*
|
|
317
|
-
* @param objectIds Array of object IDs to delete
|
|
318
|
-
*/
|
|
319
|
-
bulkDelete(objectIds: string[]): Promise<BulkDeleteResult> {
|
|
320
|
-
return this.post("/bulk-delete", {
|
|
321
|
-
payload: { objectIds },
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Get detailed index configuration for the project
|
|
327
|
-
*
|
|
328
|
-
* Returns comprehensive information about the Elasticsearch index including
|
|
329
|
-
* status, embedding dimensions, field mappings, and project configuration.
|
|
330
|
-
*/
|
|
331
|
-
getConfiguration(): Promise<IndexConfiguration> {
|
|
332
|
-
return this.post("/configuration", {
|
|
333
|
-
payload: {},
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
}
|