@vertesia/client 1.0.0-dev.20260203.130115Z → 1.0.0-dev.20260227.104700Z
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 +96 -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 +93 -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 +34 -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 +6 -6
- package/src/AuditTrailApi.ts +25 -0
- package/src/ProjectsApi.ts +31 -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
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { ApiTopic } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { canGenerateRendition, ContentObjectApiHeaders, getSupportedRenditionFormats, supportsVisualRendition } from "@vertesia/common";
|
|
3
|
+
// Re-export rendition utilities for consumers
|
|
4
|
+
export { canGenerateRendition, getSupportedRenditionFormats, supportsVisualRendition };
|
|
5
|
+
import { StreamSource } from "../StreamSource.js";
|
|
6
|
+
import { AnalyzeDocApi } from "./AnalyzeDocApi.js";
|
|
7
|
+
export class ObjectsApi extends ApiTopic {
|
|
8
|
+
constructor(parent) {
|
|
9
|
+
super(parent, "/api/v1/objects");
|
|
10
|
+
}
|
|
11
|
+
analyze(objectId) {
|
|
12
|
+
return new AnalyzeDocApi(this, objectId);
|
|
13
|
+
}
|
|
14
|
+
getUploadUrl(payload) {
|
|
15
|
+
return this.post("/upload-url", {
|
|
16
|
+
payload,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
getDownloadUrl(fileUri, name, disposition) {
|
|
20
|
+
return this.post("/download-url", {
|
|
21
|
+
payload: { file: fileUri, name, disposition },
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
getDownloadUrlWithOptions(payload) {
|
|
25
|
+
return this.post("/download-url", { payload });
|
|
26
|
+
}
|
|
27
|
+
getContentSource(objectId) {
|
|
28
|
+
return this.get(`/${objectId}/content-source`);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* List objects with revision filtering options
|
|
32
|
+
*
|
|
33
|
+
* @param payload Search/filter parameters
|
|
34
|
+
* @returns Matching content objects
|
|
35
|
+
*/
|
|
36
|
+
list(payload = {}) {
|
|
37
|
+
const limit = payload.limit || 100;
|
|
38
|
+
const offset = payload.offset || 0;
|
|
39
|
+
const query = payload.query || {};
|
|
40
|
+
return this.get("/", {
|
|
41
|
+
query: {
|
|
42
|
+
limit,
|
|
43
|
+
offset,
|
|
44
|
+
...query,
|
|
45
|
+
all_revisions: payload.all_revisions,
|
|
46
|
+
from_root: payload.from_root || undefined,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
computeFacets(query) {
|
|
51
|
+
return this.post("/facets", {
|
|
52
|
+
payload: query,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
listFolders(path = "/") {
|
|
56
|
+
path; //TODO
|
|
57
|
+
}
|
|
58
|
+
/** Find object based on query */
|
|
59
|
+
find(payload) {
|
|
60
|
+
return this.post("/find", {
|
|
61
|
+
payload,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/** Count number of objects matching this query */
|
|
65
|
+
count(payload) {
|
|
66
|
+
return this.post("/count", {
|
|
67
|
+
payload,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/** Search object — different from find because allow full text search */
|
|
71
|
+
search(payload) {
|
|
72
|
+
return this.post("/search", {
|
|
73
|
+
payload,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
retrieve(id, select) {
|
|
77
|
+
return this.get(`/${id}`, {
|
|
78
|
+
query: {
|
|
79
|
+
select,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
getObjectText(id) {
|
|
84
|
+
return this.get(`/${id}/text`);
|
|
85
|
+
}
|
|
86
|
+
async upload(source) {
|
|
87
|
+
const isStream = source instanceof StreamSource;
|
|
88
|
+
// get a signed URL to upload the file a computed mimeType and the file object id.
|
|
89
|
+
const { url, id, mime_type } = await this.getUploadUrl({
|
|
90
|
+
id: isStream ? source.id : undefined,
|
|
91
|
+
name: source.name,
|
|
92
|
+
mime_type: source.type,
|
|
93
|
+
});
|
|
94
|
+
const sourceMimeType = source.type || mime_type;
|
|
95
|
+
// upload the file content to the signed URL
|
|
96
|
+
/*const res = await this.fetch(url, {
|
|
97
|
+
method: 'PUT',
|
|
98
|
+
//@ts-ignore: duplex is not in the types. See https://github.com/node-fetch/node-fetch/issues/1769
|
|
99
|
+
duplex: isStream ? "half" : undefined,
|
|
100
|
+
body: isStream ? source.stream : source,
|
|
101
|
+
headers: {
|
|
102
|
+
'Content-Type': mime_type || 'application/octet-stream'
|
|
103
|
+
}
|
|
104
|
+
}).then((res: Response) => {
|
|
105
|
+
if (res.ok) {
|
|
106
|
+
return res;
|
|
107
|
+
} else {
|
|
108
|
+
console.log(res);
|
|
109
|
+
throw new Error(`Failed to upload file: ${res.statusText}`);
|
|
110
|
+
}
|
|
111
|
+
});*/
|
|
112
|
+
const res = await fetch(url, {
|
|
113
|
+
method: "PUT",
|
|
114
|
+
body: isStream ? source.stream : source,
|
|
115
|
+
//@ts-ignore: duplex is not in the types. See https://github.com/node-fetch/node-fetch/issues/1769
|
|
116
|
+
duplex: isStream ? "half" : undefined,
|
|
117
|
+
headers: sourceMimeType ? { "Content-Type": sourceMimeType } : undefined,
|
|
118
|
+
})
|
|
119
|
+
.then((res) => {
|
|
120
|
+
if (res.ok) {
|
|
121
|
+
return res;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
console.log(res);
|
|
125
|
+
throw new Error(`Failed to upload file: ${res.statusText}`);
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
.catch((err) => {
|
|
129
|
+
console.error("Failed to upload file", err);
|
|
130
|
+
throw err;
|
|
131
|
+
});
|
|
132
|
+
//Etag need to be unquoted
|
|
133
|
+
//When a server returns an ETag header, it includes the quotes around the actual hash value.
|
|
134
|
+
//This is part of the HTTP specification (RFC 7232), which states that ETags should be
|
|
135
|
+
//enclosed in double quotes.
|
|
136
|
+
const etag = res.headers.get("etag")?.replace(/^"(.*)"$/, "$1");
|
|
137
|
+
return {
|
|
138
|
+
source: id,
|
|
139
|
+
name: source.name,
|
|
140
|
+
type: sourceMimeType,
|
|
141
|
+
etag,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
async create(payload, options) {
|
|
145
|
+
const createPayload = {
|
|
146
|
+
...payload,
|
|
147
|
+
};
|
|
148
|
+
if (payload.content instanceof StreamSource ||
|
|
149
|
+
payload.content instanceof File) {
|
|
150
|
+
createPayload.content = await this.upload(payload.content);
|
|
151
|
+
}
|
|
152
|
+
const headers = {};
|
|
153
|
+
if (options?.processing_priority) {
|
|
154
|
+
headers[ContentObjectApiHeaders.PROCESSING_PRIORITY] = options.processing_priority;
|
|
155
|
+
}
|
|
156
|
+
if (options?.collection_id) {
|
|
157
|
+
headers[ContentObjectApiHeaders.COLLECTION_ID] = options.collection_id;
|
|
158
|
+
}
|
|
159
|
+
return await this.post("/", {
|
|
160
|
+
payload: createPayload,
|
|
161
|
+
headers: headers,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Create an object which holds a reference to an external blob (i.e. not in the project bucket)
|
|
166
|
+
* The uri should starts either with gs:// or s3://. Not other protocols are supported yet.
|
|
167
|
+
* For the s3 blobs you must use a hash with the blob #region. Ex: s3://bucket/path/to/file#us-east-1
|
|
168
|
+
* @param uri
|
|
169
|
+
* @param payload
|
|
170
|
+
* @param options
|
|
171
|
+
* @returns
|
|
172
|
+
*/
|
|
173
|
+
async createFromExternalSource(uri, payload = {}, options) {
|
|
174
|
+
const metadata = await this.client.files.getMetadata(uri);
|
|
175
|
+
const createPayload = {
|
|
176
|
+
...payload,
|
|
177
|
+
content: {
|
|
178
|
+
source: uri,
|
|
179
|
+
name: metadata.name,
|
|
180
|
+
type: metadata.contentType,
|
|
181
|
+
etag: metadata.etag,
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
const headers = {};
|
|
185
|
+
if (options?.processing_priority) {
|
|
186
|
+
headers[ContentObjectApiHeaders.PROCESSING_PRIORITY] = options.processing_priority;
|
|
187
|
+
}
|
|
188
|
+
if (options?.collection_id) {
|
|
189
|
+
headers[ContentObjectApiHeaders.COLLECTION_ID] = options.collection_id;
|
|
190
|
+
}
|
|
191
|
+
return await this.post("/", {
|
|
192
|
+
payload: createPayload,
|
|
193
|
+
headers: headers,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Updates an existing object or creates a new revision
|
|
198
|
+
* Handles file uploads similar to the create method
|
|
199
|
+
*
|
|
200
|
+
* @param id The ID of the object to update
|
|
201
|
+
* @param payload The changes to apply
|
|
202
|
+
* @param options Additional options
|
|
203
|
+
* @param options.createRevision Whether to create a new revision instead of updating in place
|
|
204
|
+
* @param options.revisionLabel Optional label for the revision (e.g., "v1.2")
|
|
205
|
+
* @param options.suppressWorkflows When true, prevents this update from triggering workflow rules
|
|
206
|
+
* @returns The updated object or newly created revision
|
|
207
|
+
*/
|
|
208
|
+
async update(id, payload, options) {
|
|
209
|
+
const updatePayload = {
|
|
210
|
+
...payload,
|
|
211
|
+
};
|
|
212
|
+
// Handle file upload if content is provided as File or StreamSource
|
|
213
|
+
if (payload.content instanceof StreamSource ||
|
|
214
|
+
payload.content instanceof File) {
|
|
215
|
+
updatePayload.content = await this.upload(payload.content);
|
|
216
|
+
}
|
|
217
|
+
const headers = {};
|
|
218
|
+
if (options?.ifMatch) {
|
|
219
|
+
headers['if-match'] = options.ifMatch;
|
|
220
|
+
}
|
|
221
|
+
if (options?.processing_priority) {
|
|
222
|
+
headers[ContentObjectApiHeaders.PROCESSING_PRIORITY] = options.processing_priority;
|
|
223
|
+
}
|
|
224
|
+
if (options?.createRevision) {
|
|
225
|
+
headers[ContentObjectApiHeaders.CREATE_REVISION] = "true";
|
|
226
|
+
if (options.revisionLabel) {
|
|
227
|
+
headers[ContentObjectApiHeaders.REVISION_LABEL] = options.revisionLabel;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
if (options?.suppressWorkflows) {
|
|
231
|
+
headers[ContentObjectApiHeaders.SUPPRESS_WORKFLOWS] = "true";
|
|
232
|
+
}
|
|
233
|
+
return this.put(`/${id}`, {
|
|
234
|
+
payload: updatePayload,
|
|
235
|
+
headers,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Retrieves all revisions of a content object
|
|
240
|
+
*
|
|
241
|
+
* @param id The ID of any revision in the object's history
|
|
242
|
+
* @returns Array of all revisions sharing the same root
|
|
243
|
+
*/
|
|
244
|
+
getRevisions(id) {
|
|
245
|
+
return this.get(`/${id}/revisions`);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Retrieves all collections that contain a specific object
|
|
249
|
+
*
|
|
250
|
+
* @param id The ID of the object
|
|
251
|
+
* @returns Array of collections containing this object (both static and dynamic)
|
|
252
|
+
*/
|
|
253
|
+
getCollections(id) {
|
|
254
|
+
return this.get(`/${id}/collections`);
|
|
255
|
+
}
|
|
256
|
+
delete(id) {
|
|
257
|
+
return this.del(`/${id}`);
|
|
258
|
+
}
|
|
259
|
+
listWorkflowRuns(documentId) {
|
|
260
|
+
return this.get(`/${documentId}/workflow-runs`);
|
|
261
|
+
}
|
|
262
|
+
listRenditions(documentId) {
|
|
263
|
+
return this.get(`/${documentId}/renditions`);
|
|
264
|
+
}
|
|
265
|
+
getRendition(documentId, options) {
|
|
266
|
+
const query = {
|
|
267
|
+
max_hw: options.max_hw,
|
|
268
|
+
generate_if_missing: options.generate_if_missing,
|
|
269
|
+
sign_url: options.sign_url,
|
|
270
|
+
block_on_generation: options.block_on_generation,
|
|
271
|
+
};
|
|
272
|
+
return this.get(`/${documentId}/renditions/${options.format}`, {
|
|
273
|
+
query,
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Get rendition with pre-validation of content type compatibility.
|
|
278
|
+
* Returns null instead of throwing if the format is not supported for the content type.
|
|
279
|
+
*
|
|
280
|
+
* @param documentId - The document ID
|
|
281
|
+
* @param contentType - The content type of the document (e.g., 'image/png', 'text/markdown')
|
|
282
|
+
* @param options - Rendition options including format
|
|
283
|
+
* @returns The rendition response, or null if format is not supported for the content type
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* const rendition = await client.objects.getRenditionSafe(docId, doc.content?.type, {
|
|
287
|
+
* format: ImageRenditionFormat.jpeg,
|
|
288
|
+
* generate_if_missing: true
|
|
289
|
+
* });
|
|
290
|
+
* if (!rendition) {
|
|
291
|
+
* console.log('Document does not support JPEG renditions');
|
|
292
|
+
* }
|
|
293
|
+
*/
|
|
294
|
+
getRenditionSafe(documentId, contentType, options) {
|
|
295
|
+
if (!canGenerateRendition(contentType, options.format)) {
|
|
296
|
+
return Promise.resolve(null);
|
|
297
|
+
}
|
|
298
|
+
return this.getRendition(documentId, options);
|
|
299
|
+
}
|
|
300
|
+
exportProperties(payload) {
|
|
301
|
+
return this.post("/export", {
|
|
302
|
+
payload,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
setEmbedding(id, type, payload) {
|
|
306
|
+
return this.put(`/${id}/embeddings/${type}`, {
|
|
307
|
+
payload,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
//# sourceMappingURL=ObjectsApi.js.map
|
|
@@ -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MAAM;YACtB,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;YAChD,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;SACnD,CAAC;QAEF,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,UAAU,eAAe,OAAO,CAAC,MAAM,EAAE,EAAE;YAC3D,KAAK;SACR,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,gBAAgB,CACZ,UAAkB,EAClB,WAA+B,EAC/B,OAA2B;QAE3B,IAAI,CAAC,oBAAoB,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACrD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,gBAAgB,CACZ,OAAgC;QAEhC,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACxB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,YAAY,CACR,EAAU,EACV,IAA6B,EAC7B,OAAkB;QAElB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,IAAI,EAAE,EAAE;YACzC,OAAO;SACV,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ApiTopic } from "@vertesia/api-fetch-client";
|
|
2
|
+
/**
|
|
3
|
+
* Pending Asks API for tracking ask_user requests.
|
|
4
|
+
* Handles registration, resolution, and listing of pending asks.
|
|
5
|
+
*/
|
|
6
|
+
export class PendingAsksApi extends ApiTopic {
|
|
7
|
+
constructor(parent) {
|
|
8
|
+
super(parent, "/api/v1/pending-asks");
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Register a new pending ask.
|
|
12
|
+
* Called when an agent calls ask_user.
|
|
13
|
+
* Stores in Redis and sends webhook if configured.
|
|
14
|
+
*/
|
|
15
|
+
register(request) {
|
|
16
|
+
return this.post("/", { payload: request });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolve a pending ask with the user's response.
|
|
20
|
+
* Called when a user responds to an ask.
|
|
21
|
+
* Updates Redis and sends webhook if configured.
|
|
22
|
+
*/
|
|
23
|
+
resolve(askId, request) {
|
|
24
|
+
return this.post(`/${askId}/resolve`, { payload: request });
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* List all pending asks for the current project.
|
|
28
|
+
*/
|
|
29
|
+
list() {
|
|
30
|
+
return this.get("/");
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get a specific pending ask by ID.
|
|
34
|
+
*/
|
|
35
|
+
retrieve(askId) {
|
|
36
|
+
return this.get(`/${askId}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=PendingAsksApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PendingAsksApi.js","sourceRoot":"","sources":["../../../src/store/PendingAsksApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAyDlE;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,QAAQ;IACxC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,OAAkC;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAC,KAAa,EAAE,OAAiC;QACpD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,KAAa;QAClB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IACjC,CAAC;CACJ"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ApiTopic } from "@vertesia/api-fetch-client";
|
|
2
|
+
/**
|
|
3
|
+
* API for querying documents using SQL, ES|QL, or raw Elasticsearch DSL.
|
|
4
|
+
* All queries are automatically filtered based on the authenticated user's permissions.
|
|
5
|
+
*/
|
|
6
|
+
export class QueryApi extends ApiTopic {
|
|
7
|
+
constructor(parent, basePath = "/api/v1/query") {
|
|
8
|
+
super(parent, basePath);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Execute a query against the project's document index
|
|
12
|
+
*
|
|
13
|
+
* @param payload - Query payload with sql, esql, or dsl
|
|
14
|
+
* @returns Query result with columns/rows or hits/aggregations
|
|
15
|
+
*
|
|
16
|
+
* @example SQL query
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const result = await client.query.execute({
|
|
19
|
+
* sql: "SELECT name, status FROM content WHERE status = 'published' LIMIT 10"
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example ES|QL query
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const result = await client.query.execute({
|
|
26
|
+
* esql: "FROM content | WHERE status == 'published' | STATS count = COUNT(*) BY type.name"
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example DSL query with aggregations
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const result = await client.query.execute({
|
|
33
|
+
* dsl: {
|
|
34
|
+
* query: { match: { text: "machine learning" } },
|
|
35
|
+
* aggs: { by_type: { terms: { field: "type.name" } } },
|
|
36
|
+
* size: 10
|
|
37
|
+
* }
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
async execute(payload) {
|
|
42
|
+
return this.post("/", { payload });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Execute a SQL query
|
|
46
|
+
*/
|
|
47
|
+
async sql(query) {
|
|
48
|
+
return this.execute({ sql: query });
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Execute an ES|QL query
|
|
52
|
+
*/
|
|
53
|
+
async esql(query) {
|
|
54
|
+
return this.execute({ esql: query });
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Execute a DSL query
|
|
58
|
+
*/
|
|
59
|
+
async dsl(query) {
|
|
60
|
+
return this.execute({ dsl: query });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=QueryApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryApi.js","sourceRoot":"","sources":["../../../src/store/QueryApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AA4ClE;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,QAAQ;IAElC,YAAY,MAAkB,EAAE,WAAmB,eAAe;QAC9D,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,KAAK,CAAC,OAAO,CAAC,OAAqB;QAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,KAAa;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,KAAa;QACpB,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,KAA0B;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IACxC,CAAC;CACJ"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ApiTopic } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { isWorkflowTerminalStatus, WorkflowExecutionStatus, } from "@vertesia/common";
|
|
3
|
+
/**
|
|
4
|
+
* API for rendering markdown documents to PDF or DOCX.
|
|
5
|
+
* Rendering is performed on workflow workers (not on the API server).
|
|
6
|
+
*/
|
|
7
|
+
export class RenderingApi extends ApiTopic {
|
|
8
|
+
constructor(parent) {
|
|
9
|
+
super(parent, "/api/v1/rendering");
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Render markdown content to PDF or DOCX.
|
|
13
|
+
*
|
|
14
|
+
* @param payload - Rendering options including format and either object_id or inline content
|
|
15
|
+
* @returns Rendering result with download URL
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // Render an existing markdown document
|
|
19
|
+
* const result = await client.rendering.render({
|
|
20
|
+
* format: MarkdownRenditionFormat.pdf,
|
|
21
|
+
* object_id: "doc-123"
|
|
22
|
+
* });
|
|
23
|
+
* // Download from result.download_url
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Render inline markdown content
|
|
27
|
+
* const result = await client.rendering.render({
|
|
28
|
+
* format: MarkdownRenditionFormat.docx,
|
|
29
|
+
* content: "# My Report\n\nContent here...",
|
|
30
|
+
* title: "My Report"
|
|
31
|
+
* });
|
|
32
|
+
*/
|
|
33
|
+
start(payload) {
|
|
34
|
+
return this.post("/jobs", { payload });
|
|
35
|
+
}
|
|
36
|
+
getStatus(workflowId, workflowRunId) {
|
|
37
|
+
return this.get("/jobs/status", {
|
|
38
|
+
query: {
|
|
39
|
+
workflow_id: workflowId,
|
|
40
|
+
workflow_run_id: workflowRunId,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async render(payload, options = {}) {
|
|
45
|
+
const pollIntervalMs = options.pollIntervalMs ?? 1500;
|
|
46
|
+
const timeoutMs = options.timeoutMs ?? 10 * 60 * 1000;
|
|
47
|
+
const started = await this.start(payload);
|
|
48
|
+
if (!started.workflow_id || !started.workflow_run_id) {
|
|
49
|
+
throw new Error("Failed to start rendering workflow");
|
|
50
|
+
}
|
|
51
|
+
const startTime = Date.now();
|
|
52
|
+
// Poll until workflow reaches terminal state.
|
|
53
|
+
while (true) {
|
|
54
|
+
const status = await this.getStatus(started.workflow_id, started.workflow_run_id);
|
|
55
|
+
if (status.status === WorkflowExecutionStatus.COMPLETED) {
|
|
56
|
+
if (!status.download_url && !status.file_uri) {
|
|
57
|
+
throw new Error(status.error || "Rendering completed but no output file was produced");
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
status: "success",
|
|
61
|
+
format: payload.format,
|
|
62
|
+
download_url: status.download_url,
|
|
63
|
+
file_uri: status.file_uri,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (isWorkflowTerminalStatus(status.status)) {
|
|
67
|
+
const statusLabel = WorkflowExecutionStatus[status.status] || String(status.status);
|
|
68
|
+
throw new Error(status.error || `Rendering failed with status: ${statusLabel}`);
|
|
69
|
+
}
|
|
70
|
+
if (Date.now() - startTime >= timeoutMs) {
|
|
71
|
+
throw new Error(`Rendering timed out after ${timeoutMs}ms`);
|
|
72
|
+
}
|
|
73
|
+
await sleep(pollIntervalMs);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function sleep(ms) {
|
|
78
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=RenderingApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderingApi.js","sourceRoot":"","sources":["../../../src/store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recurring basis using cron expressions.
|
|
6
|
+
*/
|
|
7
|
+
export class SchedulesApi extends ApiTopic {
|
|
8
|
+
constructor(parent) {
|
|
9
|
+
super(parent, "/api/v1/schedules");
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* List all schedules in the project.
|
|
13
|
+
*/
|
|
14
|
+
list() {
|
|
15
|
+
return this.get("/");
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Retrieve a schedule by ID.
|
|
19
|
+
* Includes Temporal execution info if available.
|
|
20
|
+
*/
|
|
21
|
+
retrieve(id) {
|
|
22
|
+
return this.get(`/${id}`);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create a new schedule.
|
|
26
|
+
*
|
|
27
|
+
* @param payload - Schedule configuration including name, interaction, and cron expression
|
|
28
|
+
* @returns The created schedule
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const schedule = await client.schedules.create({
|
|
33
|
+
* name: 'Weekly Report',
|
|
34
|
+
* interaction: 'WeeklyReportAgent',
|
|
35
|
+
* cron_expression: '0 9 * * MON', // Every Monday at 9am
|
|
36
|
+
* timezone: 'America/New_York',
|
|
37
|
+
* vars: { reportType: 'summary' }
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
create(payload) {
|
|
42
|
+
return this.post("/", { payload });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Update an existing schedule.
|
|
46
|
+
*
|
|
47
|
+
* @param id - Schedule ID
|
|
48
|
+
* @param payload - Fields to update
|
|
49
|
+
* @returns The updated schedule
|
|
50
|
+
*/
|
|
51
|
+
update(id, payload) {
|
|
52
|
+
return this.put(`/${id}`, { payload });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Delete a schedule.
|
|
56
|
+
*
|
|
57
|
+
* This also removes the corresponding Temporal schedule.
|
|
58
|
+
*
|
|
59
|
+
* @param id - Schedule ID
|
|
60
|
+
* @returns Object with the deleted schedule ID
|
|
61
|
+
*/
|
|
62
|
+
delete(id) {
|
|
63
|
+
return this.del(`/${id}`);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Trigger an immediate execution of the scheduled agent.
|
|
67
|
+
*
|
|
68
|
+
* This runs the agent immediately without waiting for the next scheduled time.
|
|
69
|
+
*
|
|
70
|
+
* @param id - Schedule ID
|
|
71
|
+
* @returns Success message
|
|
72
|
+
*/
|
|
73
|
+
trigger(id) {
|
|
74
|
+
return this.post(`/${id}/trigger`, {});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Pause a schedule.
|
|
78
|
+
*
|
|
79
|
+
* The schedule will not run until resumed.
|
|
80
|
+
*
|
|
81
|
+
* @param id - Schedule ID
|
|
82
|
+
* @param note - Optional note explaining why the schedule was paused
|
|
83
|
+
* @returns Success message
|
|
84
|
+
*/
|
|
85
|
+
pause(id, note) {
|
|
86
|
+
return this.post(`/${id}/pause`, { payload: { note } });
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Resume a paused schedule.
|
|
90
|
+
*
|
|
91
|
+
* @param id - Schedule ID
|
|
92
|
+
* @param note - Optional note explaining why the schedule was resumed
|
|
93
|
+
* @returns Success message
|
|
94
|
+
*/
|
|
95
|
+
resume(id, note) {
|
|
96
|
+
return this.post(`/${id}/resume`, { payload: { note } });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=SchedulesApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchedulesApi.js","sourceRoot":"","sources":["../../../src/store/SchedulesApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AASlE;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,QAAQ;IACtC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IACvC,C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API for accessing the builtin tools catalog
|
|
4
|
+
*/
|
|
5
|
+
export class ToolsApi extends ApiTopic {
|
|
6
|
+
constructor(parent) {
|
|
7
|
+
super(parent, "/api/v1/tools");
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get the builtin tools catalog
|
|
11
|
+
* @returns List of all available builtin tools with their descriptions and parameter schemas
|
|
12
|
+
*/
|
|
13
|
+
getBuiltinCatalog() {
|
|
14
|
+
return this.get('/');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ToolsApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolsApi.js","sourceRoot":"","sources":["../../../src/store/ToolsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAGlE;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,QAAQ;IAClC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,iBAAiB;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CACJ"}
|