@vertesia/client 0.24.0-dev.202601221707
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/LICENSE +13 -0
- package/README.md +110 -0
- 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/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 +72 -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 +113 -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 +13 -0
- package/lib/cjs/UsersApi.js.map +1 -0
- package/lib/cjs/client.js +360 -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/ObjectsApi.js +314 -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/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/TypesApi.js +57 -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 +596 -0
- package/lib/cjs/store/WorkflowsApi.js.map +1 -0
- package/lib/cjs/store/client.js +81 -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 +27 -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/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 +69 -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 +109 -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 +10 -0
- package/lib/esm/UsersApi.js.map +1 -0
- package/lib/esm/client.js +351 -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/ObjectsApi.js +309 -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/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/TypesApi.js +53 -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 +590 -0
- package/lib/esm/store/WorkflowsApi.js.map +1 -0
- package/lib/esm/store/client.js +77 -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 +11 -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/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 +28 -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 +79 -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 +6 -0
- package/lib/types/UsersApi.d.ts.map +1 -0
- package/lib/types/client.d.ts +136 -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/ObjectsApi.d.ts +139 -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/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/TypesApi.d.ts +23 -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 +167 -0
- package/lib/types/store/WorkflowsApi.d.ts.map +1 -0
- package/lib/types/store/client.d.ts +45 -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 +10 -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 +71 -0
- package/src/AccountApi.ts +96 -0
- package/src/AccountsApi.ts +22 -0
- package/src/AnalyticsApi.ts +36 -0
- package/src/ApiKeysApi.ts +67 -0
- package/src/AppsApi.ts +134 -0
- package/src/CommandsApi.ts +23 -0
- package/src/EnvironmentsApi.ts +94 -0
- package/src/GroupsApi.ts +92 -0
- package/src/IamApi.ts +70 -0
- package/src/InteractionBase.ts +44 -0
- package/src/InteractionCatalogApi.ts +72 -0
- package/src/InteractionOutput.test.ts +305 -0
- package/src/InteractionOutput.ts +328 -0
- package/src/InteractionResult.example.ts +72 -0
- package/src/InteractionsApi.ts +308 -0
- package/src/MCPOAuthApi.ts +67 -0
- package/src/ProjectsApi.ts +85 -0
- package/src/PromptsApi.ts +160 -0
- package/src/RefsApi.ts +18 -0
- package/src/RunsApi.ts +151 -0
- package/src/SkillsApi.ts +46 -0
- package/src/StreamSource.ts +3 -0
- package/src/TrainingApi.ts +71 -0
- package/src/UsersApi.ts +18 -0
- package/src/client.test.ts +99 -0
- package/src/client.ts +419 -0
- package/src/execute.ts +126 -0
- package/src/index.ts +10 -0
- package/src/nodejs/NodeStreamSource.ts +43 -0
- package/src/nodejs/index.ts +1 -0
- package/src/store/AnalyzeDocApi.ts +61 -0
- package/src/store/CollectionsApi.ts +166 -0
- package/src/store/CommandsApi.ts +15 -0
- package/src/store/DashboardApi.ts +216 -0
- package/src/store/DataApi.ts +516 -0
- package/src/store/EmailApi.ts +211 -0
- package/src/store/EmbeddingsApi.ts +39 -0
- package/src/store/FilesApi.ts +288 -0
- package/src/store/ObjectsApi.ts +432 -0
- package/src/store/PendingAsksApi.ts +98 -0
- package/src/store/SchedulesApi.ts +114 -0
- package/src/store/ToolsApi.ts +19 -0
- package/src/store/TypesApi.ts +65 -0
- package/src/store/WorkersApi.ts +17 -0
- package/src/store/WorkflowsApi.ts +752 -0
- package/src/store/client.ts +95 -0
- package/src/store/errors.ts +7 -0
- package/src/store/index.ts +11 -0
- package/src/store/version.ts +2 -0
- package/tsconfig.dist.json +20 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.EventSourceProvider = EventSourceProvider;
|
|
37
|
+
exports.executeInteraction = executeInteraction;
|
|
38
|
+
exports.executeInteractionByName = executeInteractionByName;
|
|
39
|
+
exports.executeInteractionAsync = executeInteractionAsync;
|
|
40
|
+
exports.checkRateLimit = checkRateLimit;
|
|
41
|
+
const common_1 = require("@vertesia/common");
|
|
42
|
+
async function EventSourceProvider() {
|
|
43
|
+
if (typeof globalThis.EventSource === 'function') {
|
|
44
|
+
return globalThis.EventSource;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return (await Promise.resolve().then(() => __importStar(require('eventsource')))).EventSource;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* Execute an interaction and return a promise which will be resolved with the executed run when
|
|
53
|
+
* the run completes or fails.
|
|
54
|
+
* If the onChunk callback is passed then the streaming of the result is enabled.
|
|
55
|
+
* The onChunk callback with be called with the next chunk of the result as soon as it is available.
|
|
56
|
+
* When all chunks are received the function will return the resolved promise
|
|
57
|
+
* @param id of the interaction to execute
|
|
58
|
+
* @param payload InteractionExecutionPayload
|
|
59
|
+
* @param onChunk callback to be called when the next chunk of the response is available
|
|
60
|
+
*/
|
|
61
|
+
async function executeInteraction(client, interactionId, payload = {}, onChunk) {
|
|
62
|
+
const stream = !!onChunk;
|
|
63
|
+
const response = await client.runs.create({
|
|
64
|
+
...payload, interaction: interactionId, stream
|
|
65
|
+
});
|
|
66
|
+
if (stream) {
|
|
67
|
+
if (response.status === common_1.ExecutionRunStatus.failed) {
|
|
68
|
+
return response;
|
|
69
|
+
}
|
|
70
|
+
await handleStreaming(client, response.id, onChunk);
|
|
71
|
+
}
|
|
72
|
+
return response;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Same as executeInteraction but uses the interaction name selector instead of the id.
|
|
76
|
+
* A name selector is the interaction endpoint name suffixed with an optional tag or version which is starting with a `@` character.
|
|
77
|
+
* The special `draft` tag is used to select the draft version of the interaction. If no tag or version is specified then the latest version is selected.
|
|
78
|
+
* Examples of selectors:
|
|
79
|
+
* - `ReviewContract` - select the latest version of the ReviewContract interaction
|
|
80
|
+
* - `ReviewContract@1` - select the version 1 of the ReviewContract interaction
|
|
81
|
+
* - `ReviewContract@draft` - select the draft version of the ReviewContract interaction
|
|
82
|
+
* - `ReviewContract@fixed` - select the ReviewContract interaction which is tagged with 'fixed' tag.
|
|
83
|
+
*
|
|
84
|
+
* @param client
|
|
85
|
+
* @param interaction
|
|
86
|
+
* @param payload
|
|
87
|
+
* @param onChunk
|
|
88
|
+
* @returns
|
|
89
|
+
*/
|
|
90
|
+
async function executeInteractionByName(client, interaction, payload = {}, onChunk) {
|
|
91
|
+
const stream = !!onChunk;
|
|
92
|
+
const response = await client.post('/api/v1/execute', {
|
|
93
|
+
payload: {
|
|
94
|
+
...payload,
|
|
95
|
+
interaction,
|
|
96
|
+
stream
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
if (stream) {
|
|
100
|
+
if (response.status === common_1.ExecutionRunStatus.failed) {
|
|
101
|
+
return response;
|
|
102
|
+
}
|
|
103
|
+
await handleStreaming(client, response.id, onChunk);
|
|
104
|
+
}
|
|
105
|
+
return response;
|
|
106
|
+
}
|
|
107
|
+
function handleStreaming(client, runId, onChunk) {
|
|
108
|
+
return new Promise(async (resolve, reject) => {
|
|
109
|
+
try {
|
|
110
|
+
const EventSourceImpl = await EventSourceProvider();
|
|
111
|
+
const streamUrl = new URL(client.runs.baseUrl + '/' + runId + '/stream');
|
|
112
|
+
const bearerToken = client._auth ? await client._auth() : undefined;
|
|
113
|
+
if (bearerToken) {
|
|
114
|
+
const token = bearerToken.split(' ')[1];
|
|
115
|
+
streamUrl.searchParams.set('access_token', token);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
throw new Error('No auth token available');
|
|
119
|
+
}
|
|
120
|
+
const sse = new EventSourceImpl(streamUrl.href);
|
|
121
|
+
sse.addEventListener("message", ev => {
|
|
122
|
+
try {
|
|
123
|
+
const data = JSON.parse(ev.data);
|
|
124
|
+
if (data) {
|
|
125
|
+
onChunk && onChunk(data);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
reject(err);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
sse.addEventListener("close", (ev) => {
|
|
133
|
+
try {
|
|
134
|
+
sse.close();
|
|
135
|
+
const msg = JSON.parse(ev.data);
|
|
136
|
+
resolve(msg);
|
|
137
|
+
}
|
|
138
|
+
catch (err) {
|
|
139
|
+
reject(err);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
catch (err) {
|
|
144
|
+
reject(err);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
async function executeInteractionAsync(client, payload) {
|
|
149
|
+
return await client.post('/api/v1/execute/async', {
|
|
150
|
+
payload,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
async function checkRateLimit(client, payload) {
|
|
154
|
+
return await client.post('/api/v1/execute/rate-limit/request', {
|
|
155
|
+
payload
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../src/execute.ts"],"names":[],"mappings":"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"}
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client.js"), exports);
|
|
18
|
+
__exportStar(require("./InteractionBase.js"), exports);
|
|
19
|
+
__exportStar(require("./InteractionOutput.js"), exports);
|
|
20
|
+
__exportStar(require("./store/index.js"), exports);
|
|
21
|
+
__exportStar(require("./StreamSource.js"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,8CAA4B;AAE5B,uDAAqC;AACrC,yDAAuC;AAIvC,mDAAiC;AACjC,oDAAkC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NodeStreamSource = void 0;
|
|
4
|
+
const web_1 = require("node:stream/web");
|
|
5
|
+
const StreamSource_js_1 = require("../StreamSource.js");
|
|
6
|
+
/**
|
|
7
|
+
* A stream source that wraps a Node.js Readable stream.
|
|
8
|
+
* This class is only works in Node.js environments.
|
|
9
|
+
*/
|
|
10
|
+
class NodeStreamSource extends StreamSource_js_1.StreamSource {
|
|
11
|
+
constructor(stream, name, type, id) {
|
|
12
|
+
super(readableToWebStream(stream), name, type, id);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.NodeStreamSource = NodeStreamSource;
|
|
16
|
+
function readableToWebStream(stream) {
|
|
17
|
+
if (web_1.ReadableStream.from) {
|
|
18
|
+
return web_1.ReadableStream.from(stream);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return readableToWebStream_BUN(stream);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Bun implementation since bun is not yet supporting NodeReadableStream.from
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
function readableToWebStream_BUN(stream) {
|
|
29
|
+
const it = stream[Symbol.asyncIterator]();
|
|
30
|
+
return new ReadableStream({
|
|
31
|
+
async pull(controller) {
|
|
32
|
+
const { value, done } = await it.next();
|
|
33
|
+
if (done) {
|
|
34
|
+
controller.close();
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
controller.enqueue(value);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
cancel() {
|
|
41
|
+
it.return?.();
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=NodeStreamSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeStreamSource.js","sourceRoot":"","sources":["../../../src/nodejs/NodeStreamSource.ts"],"names":[],"mappings":";;;AACA,yCAAuE;AACvE,wDAAkD;AAGlD;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,8BAAY;IAC9C,YAAY,MAAgB,EAAE,IAAY,EAAE,IAAa,EAAE,EAAW;QAClE,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzE,CAAC;CACJ;AAJD,4CAIC;AAED,SAAS,mBAAmB,CAAsB,MAAgB;IAC9D,IAAI,oBAAkB,CAAC,IAAI,EAAE,CAAC;QAC1B,OAAO,oBAAkB,CAAC,IAAI,CAAC,MAAM,CAAsB,CAAC;IAChE,CAAC;SAAM,CAAC;QACJ,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAS,uBAAuB,CAAsB,MAAgB;IAClE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;IAC1C,OAAO,IAAI,cAAc,CAAI;QACzB,KAAK,CAAC,IAAI,CAAC,UAAU;YACjB,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;YACxC,IAAI,IAAI,EAAE,CAAC;gBACP,UAAU,CAAC,KAAK,EAAE,CAAC;YACvB,CAAC;iBAAM,CAAC;gBACJ,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC;QACL,CAAC;QACD,MAAM;YACF,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;QAClB,CAAC;KACJ,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./NodeStreamSource.js"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nodejs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnalyzeDocApi = void 0;
|
|
4
|
+
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
5
|
+
class AnalyzeDocApi extends api_fetch_client_1.ApiTopic {
|
|
6
|
+
objectId;
|
|
7
|
+
constructor(parent, objectId) {
|
|
8
|
+
super(parent, `/${objectId}/analyze`);
|
|
9
|
+
this.objectId = objectId;
|
|
10
|
+
}
|
|
11
|
+
async start(payload) {
|
|
12
|
+
return this.post("/", { payload });
|
|
13
|
+
}
|
|
14
|
+
async getStatus() {
|
|
15
|
+
return this.get("/status");
|
|
16
|
+
}
|
|
17
|
+
async getResults() {
|
|
18
|
+
return this.get("/results");
|
|
19
|
+
}
|
|
20
|
+
async adaptTables(payload) {
|
|
21
|
+
return this.post("/adapt_tables", { payload });
|
|
22
|
+
}
|
|
23
|
+
async getAdaptedTables(runId, query) {
|
|
24
|
+
const path = runId ? `/adapt_tables/${runId}` : "/adapt_tables";
|
|
25
|
+
// Build query parameters
|
|
26
|
+
const queryParams = {};
|
|
27
|
+
if (query?.format)
|
|
28
|
+
queryParams.format = query.format;
|
|
29
|
+
if (query?.raw !== undefined)
|
|
30
|
+
queryParams.raw = query.raw;
|
|
31
|
+
// If format is CSV, set response type to text to avoid automatic JSON parsing
|
|
32
|
+
const options = { query: queryParams };
|
|
33
|
+
if (query?.format === 'csv') {
|
|
34
|
+
options.responseType = 'text';
|
|
35
|
+
}
|
|
36
|
+
return this.get(path, options);
|
|
37
|
+
}
|
|
38
|
+
async getXml() {
|
|
39
|
+
return this.get("/xml");
|
|
40
|
+
}
|
|
41
|
+
async getTables(format) {
|
|
42
|
+
const options = {};
|
|
43
|
+
if (format) {
|
|
44
|
+
options.query = { format: format };
|
|
45
|
+
}
|
|
46
|
+
return this.get("/tables", options);
|
|
47
|
+
}
|
|
48
|
+
async getImages() {
|
|
49
|
+
return this.get("/images");
|
|
50
|
+
}
|
|
51
|
+
async getAnnotated() {
|
|
52
|
+
return this.get("/annotated");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.AnalyzeDocApi = AnalyzeDocApi;
|
|
56
|
+
//# sourceMappingURL=AnalyzeDocApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyzeDocApi.js","sourceRoot":"","sources":["../../../src/store/AnalyzeDocApi.ts"],"names":[],"mappings":";;;AAAA,iEAAkE;AAGlE,MAAa,aAAc,SAAQ,2BAAQ;IACA;IAAvC,YAAY,MAAkB,EAAS,QAAgB;QACnD,KAAK,CAAC,MAAM,EAAE,IAAI,QAAQ,UAAU,CAAC,CAAC;QADH,aAAQ,GAAR,QAAQ,CAAQ;IAEvD,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAA6B;QACrC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,SAAS;QACX,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,UAAU;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAA2B;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,KAAc,EAAE,KAAoC;QACvE,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,iBAAiB,KAAK,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC;QAEhE,yBAAyB;QACzB,MAAM,WAAW,GAAQ,EAAE,CAAC;QAC5B,IAAI,KAAK,EAAE,MAAM;YAAE,WAAW,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QACrD,IAAI,KAAK,EAAE,GAAG,KAAK,SAAS;YAAE,WAAW,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;QAE1D,8EAA8E;QAC9E,MAAM,OAAO,GAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QAC5C,IAAI,KAAK,EAAE,MAAM,KAAK,KAAK,EAAE,CAAC;YAC1B,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC;QAClC,CAAC;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,MAAM;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,MAA2B;QACvC,MAAM,OAAO,GAAQ,EAAE,CAAC;QACxB,IAAI,MAAM,EAAE,CAAC;YACT,OAAO,CAAC,KAAK,GAAG,EAAC,MAAM,EAAE,MAAM,EAAC,CAAA;QACpC,CAAC;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,SAAS;QACX,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,YAAY;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;CACJ;AAzDD,sCAyDC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CollectionsApi = void 0;
|
|
4
|
+
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
5
|
+
class CollectionsApi extends api_fetch_client_1.ApiTopic {
|
|
6
|
+
constructor(parent) {
|
|
7
|
+
super(parent, "/api/v1/collections");
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* List collections
|
|
11
|
+
* @param payload: CollectionSearchPayload
|
|
12
|
+
* @returns Collection[] list of collections
|
|
13
|
+
**/
|
|
14
|
+
search(payload) {
|
|
15
|
+
return this.post("/search", { payload });
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Compute facets for List collections
|
|
19
|
+
* @param query: ComputeCollectionFacetPayload
|
|
20
|
+
* @returns ComputeFacetsResponse list of facets
|
|
21
|
+
**/
|
|
22
|
+
computeListFacets(query) {
|
|
23
|
+
return this.post("/facets", {
|
|
24
|
+
payload: query
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get the collection data without members
|
|
29
|
+
* @param collectionId
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
retrieve(collectionId) {
|
|
33
|
+
return this.get(`/${collectionId}`);
|
|
34
|
+
}
|
|
35
|
+
create(payload) {
|
|
36
|
+
return this.post(`/`, {
|
|
37
|
+
payload
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
update(collectionId, payload) {
|
|
41
|
+
return this.put(`/${collectionId}`, {
|
|
42
|
+
payload
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
addMembers(collectionId, members) {
|
|
46
|
+
return this.post(`/${collectionId}/members`, {
|
|
47
|
+
payload: {
|
|
48
|
+
action: 'add',
|
|
49
|
+
members
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
listMembers(collectionId, payload) {
|
|
54
|
+
return this.get(`/${collectionId}/members`, {
|
|
55
|
+
query: {
|
|
56
|
+
...payload
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
computeFacets(collectionId, query) {
|
|
61
|
+
return this.post(`/${collectionId}/facets`, {
|
|
62
|
+
payload: query
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
searchMembers(collectionId, payload) {
|
|
66
|
+
return this.post(`/${collectionId}/search`, { payload });
|
|
67
|
+
}
|
|
68
|
+
deleteMembers(collectionId, members) {
|
|
69
|
+
return this.post(`/${collectionId}/members`, {
|
|
70
|
+
payload: {
|
|
71
|
+
action: 'delete',
|
|
72
|
+
members
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
addChildren(collectionId, children) {
|
|
77
|
+
return this.post(`/${collectionId}/children`, {
|
|
78
|
+
payload: {
|
|
79
|
+
action: 'add',
|
|
80
|
+
children
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
deleteChildren(collectionId, children) {
|
|
85
|
+
return this.post(`/${collectionId}/children`, {
|
|
86
|
+
payload: {
|
|
87
|
+
action: 'delete',
|
|
88
|
+
children
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
searchChildren(collectionId, query = {}) {
|
|
93
|
+
return this.post(`/${collectionId}/children/search`, {
|
|
94
|
+
payload: query
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
delete(id) {
|
|
98
|
+
return this.del(`/${id}`);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Update collection permissions and propagate to member objects
|
|
102
|
+
* @param collectionId - The collection ID
|
|
103
|
+
* @param permissions - Map of permission types to principal arrays
|
|
104
|
+
* @returns Object with collection id, updated security, and number of objects updated
|
|
105
|
+
*/
|
|
106
|
+
updatePermissions(collectionId, permissions) {
|
|
107
|
+
return this.put(`/${collectionId}/permissions`, {
|
|
108
|
+
payload: permissions
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Manually trigger permission propagation from collection to member objects
|
|
113
|
+
* Useful for debugging and fixing permission issues
|
|
114
|
+
* @param collectionId - The collection ID
|
|
115
|
+
* @returns Object with collection id, message, and number of objects updated
|
|
116
|
+
*/
|
|
117
|
+
propagatePermissions(collectionId) {
|
|
118
|
+
return this.post(`/${collectionId}/propagate-permissions`);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Manually trigger shared properties propagation from collection to member objects
|
|
122
|
+
* Useful for debugging and fixing shared properties issues
|
|
123
|
+
* @param collectionId - The collection ID
|
|
124
|
+
* @returns Object with collection id, message, and number of objects updated
|
|
125
|
+
*/
|
|
126
|
+
propagateSharedProperties(collectionId) {
|
|
127
|
+
return this.post(`/${collectionId}/propagate-shared-props`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.CollectionsApi = CollectionsApi;
|
|
131
|
+
//# sourceMappingURL=CollectionsApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionsApi.js","sourceRoot":"","sources":["../../../src/store/CollectionsApi.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandsApi = void 0;
|
|
4
|
+
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
5
|
+
const EmbeddingsApi_js_1 = require("./EmbeddingsApi.js");
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated use EmbeddingsApi instead
|
|
8
|
+
* @see EmbeddingsApi
|
|
9
|
+
*/
|
|
10
|
+
class CommandsApi extends api_fetch_client_1.ApiTopic {
|
|
11
|
+
constructor(parent) {
|
|
12
|
+
super(parent, "/api/v1/commands");
|
|
13
|
+
}
|
|
14
|
+
embeddings = new EmbeddingsApi_js_1.EmbeddingsApi(this, "/embeddings");
|
|
15
|
+
}
|
|
16
|
+
exports.CommandsApi = CommandsApi;
|
|
17
|
+
//# sourceMappingURL=CommandsApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandsApi.js","sourceRoot":"","sources":["../../../src/store/CommandsApi.ts"],"names":[],"mappings":";;;AAAA,iEAAkE;AAClE,yDAAmD;AAEnD;;;GAGG;AACH,MAAa,WAAY,SAAQ,2BAAQ;IAErC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACtC,CAAC;IAED,UAAU,GAAG,IAAI,gCAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;CACvD;AAPD,kCAOC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DashboardApi = void 0;
|
|
4
|
+
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
5
|
+
const common_1 = require("@vertesia/common");
|
|
6
|
+
/**
|
|
7
|
+
* Client API for managing Vega-based dashboards linked to data stores.
|
|
8
|
+
*
|
|
9
|
+
* Dashboards provide:
|
|
10
|
+
* - Multi-panel Vega/Vega-Lite visualizations
|
|
11
|
+
* - SQL-backed data sources via named queries
|
|
12
|
+
*
|
|
13
|
+
* Note: Rendering is handled by the tools (data_preview_dashboard, data_render_dashboard).
|
|
14
|
+
*/
|
|
15
|
+
class DashboardApi extends api_fetch_client_1.ApiTopic {
|
|
16
|
+
storeId;
|
|
17
|
+
constructor(parent, storeId) {
|
|
18
|
+
super(parent, `/api/v1/data/${storeId}/dashboards`);
|
|
19
|
+
this.storeId = storeId;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Create headers with data store ID for Cloud Run session affinity.
|
|
23
|
+
*/
|
|
24
|
+
storeHeaders() {
|
|
25
|
+
return { [common_1.DataStoreApiHeaders.DATA_STORE_ID]: this.storeId };
|
|
26
|
+
}
|
|
27
|
+
// ============================================================
|
|
28
|
+
// Dashboard Operations
|
|
29
|
+
// ============================================================
|
|
30
|
+
/**
|
|
31
|
+
* List all dashboards for the data store.
|
|
32
|
+
*
|
|
33
|
+
* @param status - Filter by status (default: 'active')
|
|
34
|
+
* @returns List of dashboards
|
|
35
|
+
*/
|
|
36
|
+
list(status) {
|
|
37
|
+
const query = status ? `?status=${status}` : '';
|
|
38
|
+
return this.get(`/${query}`, { headers: this.storeHeaders() });
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Create a new dashboard.
|
|
42
|
+
*
|
|
43
|
+
* @param payload - Dashboard configuration with queries and panels
|
|
44
|
+
* @returns The created dashboard
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const dashboard = await client.data.dashboards(storeId).create({
|
|
49
|
+
* name: 'Sales Overview',
|
|
50
|
+
* queries: [
|
|
51
|
+
* { name: 'revenue', sql: 'SELECT month, SUM(amount) FROM sales GROUP BY month' }
|
|
52
|
+
* ],
|
|
53
|
+
* panels: [
|
|
54
|
+
* {
|
|
55
|
+
* title: 'Monthly Revenue',
|
|
56
|
+
* dataSources: ['revenue'],
|
|
57
|
+
* position: { row: 0, col: 0 },
|
|
58
|
+
* spec: {
|
|
59
|
+
* mark: 'bar',
|
|
60
|
+
* encoding: {
|
|
61
|
+
* x: { field: 'month', type: 'ordinal' },
|
|
62
|
+
* y: { field: 'sum_amount', type: 'quantitative' }
|
|
63
|
+
* }
|
|
64
|
+
* }
|
|
65
|
+
* }
|
|
66
|
+
* ]
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
create(payload) {
|
|
71
|
+
return this.post("/", { payload, headers: this.storeHeaders() });
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Get a dashboard by ID.
|
|
75
|
+
*
|
|
76
|
+
* @param id - Dashboard ID
|
|
77
|
+
* @returns The dashboard with all details
|
|
78
|
+
*/
|
|
79
|
+
retrieve(id) {
|
|
80
|
+
return this.get(`/${id}`, { headers: this.storeHeaders() });
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Update an existing dashboard.
|
|
84
|
+
*
|
|
85
|
+
* @param id - Dashboard ID
|
|
86
|
+
* @param payload - Fields to update
|
|
87
|
+
* @returns The updated dashboard
|
|
88
|
+
*/
|
|
89
|
+
update(id, payload) {
|
|
90
|
+
return this.put(`/${id}`, { payload, headers: this.storeHeaders() });
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Archive (soft delete) a dashboard.
|
|
94
|
+
*
|
|
95
|
+
* @param id - Dashboard ID
|
|
96
|
+
* @returns Object with the archived dashboard ID
|
|
97
|
+
*/
|
|
98
|
+
delete(id) {
|
|
99
|
+
return this.del(`/${id}`, { headers: this.storeHeaders() });
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Archive (soft delete) multiple dashboards.
|
|
103
|
+
*
|
|
104
|
+
* @param ids - Array of dashboard IDs
|
|
105
|
+
* @returns Object with counts of archived and failed dashboards
|
|
106
|
+
*/
|
|
107
|
+
bulkArchive(ids) {
|
|
108
|
+
return this.post('/bulk/archive', { payload: { ids }, headers: this.storeHeaders() });
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Permanently delete multiple dashboards.
|
|
112
|
+
*
|
|
113
|
+
* @param ids - Array of dashboard IDs
|
|
114
|
+
* @returns Object with counts of deleted and failed dashboards
|
|
115
|
+
*/
|
|
116
|
+
bulkDelete(ids) {
|
|
117
|
+
return this.post('/bulk/delete', { payload: { ids }, headers: this.storeHeaders() });
|
|
118
|
+
}
|
|
119
|
+
// ============================================================
|
|
120
|
+
// Version Operations
|
|
121
|
+
// ============================================================
|
|
122
|
+
/**
|
|
123
|
+
* List versions for a dashboard.
|
|
124
|
+
*
|
|
125
|
+
* @param dashboardId - Dashboard ID
|
|
126
|
+
* @param options - Filter options
|
|
127
|
+
* @returns List of version summaries
|
|
128
|
+
*/
|
|
129
|
+
listVersions(dashboardId, options) {
|
|
130
|
+
const params = new URLSearchParams();
|
|
131
|
+
if (options?.snapshotsOnly)
|
|
132
|
+
params.set('snapshots_only', 'true');
|
|
133
|
+
if (options?.limit)
|
|
134
|
+
params.set('limit', String(options.limit));
|
|
135
|
+
const query = params.toString() ? `?${params}` : '';
|
|
136
|
+
return this.get(`/${dashboardId}/versions${query}`, { headers: this.storeHeaders() });
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Get a specific version with full content.
|
|
140
|
+
*
|
|
141
|
+
* @param dashboardId - Dashboard ID
|
|
142
|
+
* @param versionId - Version ID
|
|
143
|
+
* @returns The version with full content
|
|
144
|
+
*/
|
|
145
|
+
getVersion(dashboardId, versionId) {
|
|
146
|
+
return this.get(`/${dashboardId}/versions/${versionId}`, { headers: this.storeHeaders() });
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Create a named snapshot from current dashboard state.
|
|
150
|
+
*
|
|
151
|
+
* @param dashboardId - Dashboard ID
|
|
152
|
+
* @param payload - Snapshot name and message
|
|
153
|
+
* @returns The created snapshot version
|
|
154
|
+
*/
|
|
155
|
+
createSnapshot(dashboardId, payload) {
|
|
156
|
+
return this.post(`/${dashboardId}/versions`, { payload, headers: this.storeHeaders() });
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Promote a version to be the current/active one.
|
|
160
|
+
* This restores the version's content to the dashboard.
|
|
161
|
+
*
|
|
162
|
+
* @param dashboardId - Dashboard ID
|
|
163
|
+
* @param versionId - Version ID to promote
|
|
164
|
+
* @param payload - Optional promotion message
|
|
165
|
+
* @returns The updated dashboard
|
|
166
|
+
*/
|
|
167
|
+
promoteVersion(dashboardId, versionId, payload) {
|
|
168
|
+
return this.post(`/${dashboardId}/versions/${versionId}/promote`, { payload: payload || {}, headers: this.storeHeaders() });
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Enable or disable versioning for a dashboard.
|
|
172
|
+
*
|
|
173
|
+
* @param dashboardId - Dashboard ID
|
|
174
|
+
* @param enabled - Whether versioning should be enabled
|
|
175
|
+
* @returns The updated versioning state
|
|
176
|
+
*/
|
|
177
|
+
setVersioningEnabled(dashboardId, enabled) {
|
|
178
|
+
return this.put(`/${dashboardId}/versioning`, { payload: { enabled }, headers: this.storeHeaders() });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
exports.DashboardApi = DashboardApi;
|
|
182
|
+
//# sourceMappingURL=DashboardApi.js.map
|