@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
package/LICENSE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2024 Composable Prompts
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# @vertesia/client
|
|
2
|
+
|
|
3
|
+
Official TypeScript/JavaScript client for the Vertesia API. Works in both Node.js and browser environments.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @vertesia/client
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @vertesia/client
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### Basic Setup
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { VertesiaClient } from "@vertesia/client";
|
|
19
|
+
|
|
20
|
+
// Using an API key
|
|
21
|
+
const client = new VertesiaClient({
|
|
22
|
+
site: "api.vertesia.io",
|
|
23
|
+
// API key for authentication
|
|
24
|
+
apikey: "sk-your-api-key",
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Configuration Options
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
const client = new VertesiaClient({
|
|
32
|
+
// The Vertesia site to connect to
|
|
33
|
+
site: "api.vertesia.io", // or "api-preview.vertesia.io", "api-staging.vertesia.io"
|
|
34
|
+
|
|
35
|
+
// Or use custom URLs
|
|
36
|
+
serverUrl: "https://custom-api.example.com",
|
|
37
|
+
storeUrl: "https://custom-store.example.com",
|
|
38
|
+
|
|
39
|
+
// API key for authentication
|
|
40
|
+
apikey: "sk-your-api-key",
|
|
41
|
+
|
|
42
|
+
// Optional session tags
|
|
43
|
+
sessionTags: ["tag1", "tag2"],
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Available APIs
|
|
48
|
+
|
|
49
|
+
The client provides access to several API endpoints:
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
// Projects
|
|
53
|
+
const projects = await client.projects.list();
|
|
54
|
+
|
|
55
|
+
// Interactions
|
|
56
|
+
const interaction = await client.interactions.retrieve("interaction-id");
|
|
57
|
+
|
|
58
|
+
// Prompts
|
|
59
|
+
const prompts = await client.prompts.list();
|
|
60
|
+
|
|
61
|
+
// Runs
|
|
62
|
+
const runs = await client.runs.list();
|
|
63
|
+
|
|
64
|
+
// Store (Objects, Files, Types, Workflows)
|
|
65
|
+
const objects = await client.objects.list();
|
|
66
|
+
const files = await client.files.list();
|
|
67
|
+
const types = await client.types.list();
|
|
68
|
+
const workflows = await client.workflows.list();
|
|
69
|
+
|
|
70
|
+
// And more: accounts, apikeys, analytics, training, users, iam, refs, commands, apps
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Uploading Files
|
|
74
|
+
|
|
75
|
+
In browser environments, you can upload files directly using the `File` object:
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
const file = new File([content], "document.pdf", { type: "application/pdf" });
|
|
79
|
+
const fileId = await client.files.uploadFile(file);
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
In Node.js, use `NodeStreamSource` from the `/node` subpath to upload from streams:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { NodeStreamSource } from "@vertesia/client/node";
|
|
86
|
+
import { createReadStream } from "fs";
|
|
87
|
+
|
|
88
|
+
// Upload a file from disk
|
|
89
|
+
const stream = createReadStream("/path/to/file.pdf");
|
|
90
|
+
const source = new NodeStreamSource(stream, "document.pdf", "application/pdf");
|
|
91
|
+
const fileId = await client.files.uploadFile(source);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
You can also use `StreamSource` directly with web `ReadableStream`:
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
import { StreamSource } from "@vertesia/client";
|
|
98
|
+
|
|
99
|
+
const webStream = /* your ReadableStream */;
|
|
100
|
+
const source = new StreamSource(webStream, "filename.txt", "text/plain");
|
|
101
|
+
const fileId = await client.files.uploadFile(source);
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## API Reference
|
|
105
|
+
|
|
106
|
+
For detailed API documentation, visit [docs.vertesiahq.com](https://docs.vertesiahq.com).
|
|
107
|
+
|
|
108
|
+
## License
|
|
109
|
+
|
|
110
|
+
Apache-2.0
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
4
|
+
class AccountApi extends api_fetch_client_1.ApiTopic {
|
|
5
|
+
constructor(parent) {
|
|
6
|
+
super(parent, "/api/v1/account");
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve all account information for current account
|
|
10
|
+
* @returns Account[]
|
|
11
|
+
*/
|
|
12
|
+
info() {
|
|
13
|
+
return this.get('/');
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Update account information
|
|
17
|
+
* @returns Account
|
|
18
|
+
*/
|
|
19
|
+
update(payload) {
|
|
20
|
+
return this.put('/', { payload });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get all projects for account
|
|
24
|
+
*/
|
|
25
|
+
projects() {
|
|
26
|
+
return this.get('/projects').then(res => res.data);
|
|
27
|
+
}
|
|
28
|
+
members() {
|
|
29
|
+
return this.get('/members');
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Invite User to account
|
|
33
|
+
*/
|
|
34
|
+
inviteUser(payload) {
|
|
35
|
+
return this.post('/invites', { payload });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Fetch Invites for Principal
|
|
39
|
+
* @returns UserInviteTokenData[]
|
|
40
|
+
* */
|
|
41
|
+
listInvites() {
|
|
42
|
+
return this.get('/invites');
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Fetch Invites for specific account or project
|
|
46
|
+
* @param type Filter for the type of invitation, either "project" or "account"
|
|
47
|
+
* @returns UserInviteTokenData[]
|
|
48
|
+
* */
|
|
49
|
+
listInvitation(type = "project") {
|
|
50
|
+
return this.get(`/invites/${type}`);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Accept Invite for account
|
|
54
|
+
* @returns UserInviteTokenData
|
|
55
|
+
* */
|
|
56
|
+
acceptInvite(id) {
|
|
57
|
+
return this.put(`/invites/${id}`);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Delete Invite for account
|
|
61
|
+
* @returns UserInviteTokenData
|
|
62
|
+
* */
|
|
63
|
+
rejectInvite(id) {
|
|
64
|
+
return this.delete(`/invites/${id}`);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get Onboarding Progress for account
|
|
68
|
+
*/
|
|
69
|
+
onboardingProgress() {
|
|
70
|
+
return this.get('/onboarding');
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get a google auth token for the current project.
|
|
74
|
+
* This token can be used to access exposed google cloud services
|
|
75
|
+
* @returns
|
|
76
|
+
*/
|
|
77
|
+
getGoogleToken() {
|
|
78
|
+
return this.get('/google-token');
|
|
79
|
+
}
|
|
80
|
+
getStripeBillingStatus() {
|
|
81
|
+
return this.get('/stripe-billing-status');
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.default = AccountApi;
|
|
85
|
+
//# sourceMappingURL=AccountApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountApi.js","sourceRoot":"","sources":["../../src/AccountApi.ts"],"names":[],"mappings":";;AAAA,iEAAkE;AAGlE,MAAqB,UAAW,SAAQ,2BAAQ;IAE5C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IACpC,CAAC;IAED;;;OAGG;IACH,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,OAA6B;QAChC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACtC,CAAC;IAED;;MAEE;IACF,QAAQ;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IAC/B,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,OAAiC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED;;;SAGK;IACL,WAAW;QACP,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;IACD;;;;SAIK;IACL,cAAc,CAAC,OAA8B,SAAS;QAClD,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;IACxC,CAAC;IAED;;;SAGK;IACL,YAAY,CAAC,EAAU;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC;IAED;;;SAGK;IACL,YAAY,CAAC,EAAU;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,kBAAkB;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,cAAc;QACV,OAAO,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACrC,CAAC;IAED,sBAAsB;QAClB,OAAO,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA;IAC7C,CAAC;CAEJ;AA5FD,6BA4FC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
4
|
+
class AccountsApi extends api_fetch_client_1.ApiTopic {
|
|
5
|
+
constructor(parent) {
|
|
6
|
+
super(parent, "/api/v1/accounts");
|
|
7
|
+
}
|
|
8
|
+
create(name) {
|
|
9
|
+
return this.post('/', { payload: { name } });
|
|
10
|
+
}
|
|
11
|
+
list() {
|
|
12
|
+
return this.get('/');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.default = AccountsApi;
|
|
16
|
+
//# sourceMappingURL=AccountsApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountsApi.js","sourceRoot":"","sources":["../../src/AccountsApi.ts"],"names":[],"mappings":";;AACA,iEAAkE;AAElE,MAAqB,WAAY,SAAQ,2BAAQ;IAE7C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;IACrC,CAAC;IAED,MAAM,CAAC,IAAY;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CAMJ;AAlBD,8BAkBC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
4
|
+
class AnalyticsApi extends api_fetch_client_1.ApiTopic {
|
|
5
|
+
constructor(parent) {
|
|
6
|
+
super(parent, "/api/v1/analytics");
|
|
7
|
+
}
|
|
8
|
+
runsSummary(query, environmentId) {
|
|
9
|
+
const params = new URLSearchParams();
|
|
10
|
+
if (query?.start)
|
|
11
|
+
params.set('start', query.start);
|
|
12
|
+
if (query?.end)
|
|
13
|
+
params.set('end', query.end);
|
|
14
|
+
if (environmentId)
|
|
15
|
+
params.set('environment', environmentId);
|
|
16
|
+
const qs = params.toString();
|
|
17
|
+
return this.get('/runs/summary' + (qs ? '?' + qs : ''));
|
|
18
|
+
}
|
|
19
|
+
runsTimeSeries(query, environmentId) {
|
|
20
|
+
const params = new URLSearchParams();
|
|
21
|
+
if (query?.start)
|
|
22
|
+
params.set('start', query.start);
|
|
23
|
+
if (query?.end)
|
|
24
|
+
params.set('end', query.end);
|
|
25
|
+
if (environmentId)
|
|
26
|
+
params.set('environment', environmentId);
|
|
27
|
+
const qs = params.toString();
|
|
28
|
+
return this.get('/runs/time-series' + (qs ? '?' + qs : ''));
|
|
29
|
+
}
|
|
30
|
+
runsTokenUsage(query) {
|
|
31
|
+
const params = new URLSearchParams();
|
|
32
|
+
if (query?.start)
|
|
33
|
+
params.set('start', query.start);
|
|
34
|
+
if (query?.end)
|
|
35
|
+
params.set('end', query.end);
|
|
36
|
+
const qs = params.toString();
|
|
37
|
+
return this.get('/runs/token-usage' + (qs ? '?' + qs : ''));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = AnalyticsApi;
|
|
41
|
+
//# sourceMappingURL=AnalyticsApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsApi.js","sourceRoot":"","sources":["../../src/AnalyticsApi.ts"],"names":[],"mappings":";;AAAA,iEAAkE;AAGlE,MAAqB,YAAa,SAAQ,2BAAQ;IAE9C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;IACtC,CAAC;IAED,WAAW,CAAC,KAAsB,EAAE,aAAsB;QACtD,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,KAAK,EAAE,KAAK;YAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACnD,IAAI,KAAK,EAAE,GAAG;YAAE,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,aAAa;YAAE,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;QAC5D,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,GAAG,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,cAAc,CAAC,KAAsB,EAAE,aAAsB;QACzD,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,KAAK,EAAE,KAAK;YAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACnD,IAAI,KAAK,EAAE,GAAG;YAAE,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,aAAa;YAAE,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;QAC5D,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,GAAG,CAAC,mBAAmB,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,cAAc,CAAC,KAAsB;QACjC,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,KAAK,EAAE,KAAK;YAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACnD,IAAI,KAAK,EAAE,GAAG;YAAE,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7C,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,GAAG,CAAC,mBAAmB,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC;CAEJ;AAhCD,+BAgCC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiKeysApi = void 0;
|
|
4
|
+
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
5
|
+
class ApiKeysApi extends api_fetch_client_1.ApiTopic {
|
|
6
|
+
constructor(parent) {
|
|
7
|
+
super(parent, "/api/v1/apikeys");
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* List all keys for account without values
|
|
11
|
+
* @returns ApiKey[]
|
|
12
|
+
*/
|
|
13
|
+
list(level = 'account') {
|
|
14
|
+
return this.get('/', { query: { level } });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create an new ApiKey for account
|
|
18
|
+
* BE VERY CAREFUL USING THIS API
|
|
19
|
+
* ALL REQUESTS ARE LOGGED IN SECURITY AUDIT LOG
|
|
20
|
+
* @returns ApiKeyWithValue
|
|
21
|
+
*/
|
|
22
|
+
create(payload) {
|
|
23
|
+
return this.post('/', { payload });
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Update an existing ApiKey for account
|
|
27
|
+
* @returns ApiKey
|
|
28
|
+
*/
|
|
29
|
+
update(id, payload) {
|
|
30
|
+
return this.put(`/${id}`, { payload });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Retrieve an ApiKey and its value
|
|
34
|
+
* BE VERY CAREFUL USING THIS API AS IT EXPOSE THE API KEY VALUE
|
|
35
|
+
* ALL REQUESTS ARE LOGGED IN SECURITY AUDIT LOG
|
|
36
|
+
* @returns ApiKeyWithValue
|
|
37
|
+
* */
|
|
38
|
+
retrieve(id, withValue = false) {
|
|
39
|
+
if (withValue) {
|
|
40
|
+
return this.get(`/${id}`, { query: { withValue: true } });
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return this.get(`/${id}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* get or create a temporary public key which can be used from browser to browse and execute interactions.
|
|
48
|
+
* If a public key already exists for the given project (or for the current organization) then it is returned, otherwise a new one is created.
|
|
49
|
+
* The payload object can contain the following properties:
|
|
50
|
+
* - name: the name of the public key. If not specified a random name is generated.
|
|
51
|
+
* - projectId: the id of the project to which the public key will be associated.
|
|
52
|
+
* If not specified the key is associated with the current organization. (i.e. account).
|
|
53
|
+
* - ttl: the time to live of the public key in seconds.
|
|
54
|
+
* The ttl defaults to 1h.
|
|
55
|
+
* @param opts
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
58
|
+
requestPublicKey(payload = {}) {
|
|
59
|
+
return this.get('/pk', { query: payload });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.ApiKeysApi = ApiKeysApi;
|
|
63
|
+
//# sourceMappingURL=ApiKeysApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiKeysApi.js","sourceRoot":"","sources":["../../src/ApiKeysApi.ts"],"names":[],"mappings":";;;AACA,iEAAkE;AAElE,MAAa,UAAW,SAAQ,2BAAQ;IAGpC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IACpC,CAAC;IAGD;;;OAGG;IACH,IAAI,CAAC,QAA+B,SAAS;QACzC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,OAAoC;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,EAAU,EAAE,OAAoC;QACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;SAKK;IACL,QAAQ,CAAC,EAAU,EAAE,YAAqB,KAAK;QAC3C,IAAI,SAAS,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9D,CAAC;aAAM,CAAC;YACJ,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9B,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,UAAkC,EAAE;QACjD,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAA0C,EAAE,CAAC,CAAC;IAClF,CAAC;CACJ;AA/DD,gCA+DC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
4
|
+
class AppsApi extends api_fetch_client_1.ApiTopic {
|
|
5
|
+
constructor(parent) {
|
|
6
|
+
super(parent, "/api/v1/apps");
|
|
7
|
+
}
|
|
8
|
+
create(manifest) {
|
|
9
|
+
return this.post('/', { payload: manifest });
|
|
10
|
+
}
|
|
11
|
+
update(id, manifest) {
|
|
12
|
+
return this.put(`/${id}`, { payload: manifest });
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get the list if tools provided by the given app.
|
|
16
|
+
* @param appId
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
listAppInstallationTools(appInstallId) {
|
|
20
|
+
return this.get(`/installations/${appInstallId}/tools`);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @param ids - ids to filter by
|
|
24
|
+
* @returns the app manifests but without the agent.tool property which can be big.
|
|
25
|
+
*/
|
|
26
|
+
list() {
|
|
27
|
+
return this.get('/');
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Install the app with the given id in the current project.
|
|
31
|
+
* @param appId - the id of the app to install
|
|
32
|
+
*/
|
|
33
|
+
install(appId, settings) {
|
|
34
|
+
return this.post(`/install`, {
|
|
35
|
+
payload: {
|
|
36
|
+
app_id: appId,
|
|
37
|
+
settings
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Remove the given app from the current project.
|
|
43
|
+
* @param installationId - the id of the app installation
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
uninstall(installationId) {
|
|
47
|
+
return this.del(`/install/${installationId}`);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* get an app unstallation given its name or null if the app is not installed
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
getAppInstallationByName(appName) {
|
|
54
|
+
return this.get(`/installations/name/${appName}`).catch((err) => {
|
|
55
|
+
if (err.status === 404) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
throw err;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get the project refs where the application is visible by the current user.
|
|
65
|
+
* The application is specified either by id or by name.
|
|
66
|
+
* @param param0
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
69
|
+
getAppInstallationProjects(app) {
|
|
70
|
+
if (!app.id && !app.name) {
|
|
71
|
+
throw new Error("Invalid arguments: appId or appName must be specified");
|
|
72
|
+
}
|
|
73
|
+
const query = app.id ? {
|
|
74
|
+
id: app.id
|
|
75
|
+
} : {
|
|
76
|
+
name: app.name
|
|
77
|
+
};
|
|
78
|
+
return this.get("/installations/projects", {
|
|
79
|
+
query
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get the apps installed for the current authenticated project
|
|
84
|
+
* @param kind - the kind of app installations to filter by (e.g., 'agent', 'tool', etc.)
|
|
85
|
+
*/
|
|
86
|
+
getInstalledApps(kind) {
|
|
87
|
+
return this.get('/installations', {
|
|
88
|
+
query: {
|
|
89
|
+
kind,
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* This operation will return an array of all the found AppInstallations in the current project
|
|
95
|
+
* including orphaned installations
|
|
96
|
+
* This requires project admin since access is not checked on the insytallations.
|
|
97
|
+
* For a user level list of available installations (with user permission check) use getInstalledApps
|
|
98
|
+
* @returns
|
|
99
|
+
*/
|
|
100
|
+
getAllAppInstallations() {
|
|
101
|
+
return this.get('/installations/all');
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* List the app installations of the current project.
|
|
105
|
+
*/
|
|
106
|
+
listInstallations() {
|
|
107
|
+
return this.get('/installations/refs');
|
|
108
|
+
}
|
|
109
|
+
updateInstallationSettings(settingsPayload) {
|
|
110
|
+
return this.put(`/installations/settings/${settingsPayload.app_id}`, {
|
|
111
|
+
payload: {
|
|
112
|
+
app_id: settingsPayload.app_id,
|
|
113
|
+
settings: settingsPayload.settings
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.default = AppsApi;
|
|
119
|
+
//# sourceMappingURL=AppsApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppsApi.js","sourceRoot":"","sources":["../../src/AppsApi.ts"],"names":[],"mappings":";;AAAA,iEAA+E;AAO/E,MAAqB,OAAQ,SAAQ,2BAAQ;IAEzC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IACjC,CAAC;IAED,MAAM,CAAC,QAAyB;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,QAAyB;QACxC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACH,wBAAwB,CAAC,YAAoB;QACzC,OAAO,IAAI,CAAC,GAAG,CAAC,kBAAkB,YAAY,QAAQ,CAAC,CAAA;IAC3D,CAAC;IAED;;;OAGG;IACH,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,OAAO,CAAC,KAAa,EAAE,QAA8B;QACjD,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACzB,OAAO,EAAE;gBACL,MAAM,EAAE,KAAK;gBACb,QAAQ;aACsB;SACrC,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,cAAsB;QAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,cAAc,EAAE,CAAC,CAAC;IAClD,CAAC;IAED;;;OAGG;IACH,wBAAwB,CAAC,OAAe;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,uBAAuB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAgB,EAAE,EAAE;YACzE,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACrB,OAAO,IAAI,CAAC;YAChB,CAAC;iBAAM,CAAC;gBACJ,MAAM,GAAG,CAAC;YACd,CAAC;QACL,CAAC,CAAC,CAAA;IACN,CAAC;IAED;;;;;OAKG;IACH,0BAA0B,CAAC,GAAqE;QAC5F,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;QAC7E,CAAC;QACD,MAAM,KAAK,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;YACnB,EAAE,EAAE,GAAG,CAAC,EAAE;SACb,CAAC,CAAC,CAAC;YACA,IAAI,EAAE,GAAG,CAAC,IAAI;SACjB,CAAA;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,yBAAyB,EAAE;YACvC,KAAK;SACR,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACH,gBAAgB,CAAC,IAA0B;QACvC,OAAO,IAAI,CAAC,GAAG,CAAC,gBAAgB,EAAE;YAC9B,KAAK,EAAE;gBACH,IAAI;aACP;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;;;;OAMG;IACH,sBAAsB;QAClB,OAAO,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,iBAAiB;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAC3C,CAAC;IAED,0BAA0B,CAAC,eAAuC;QAC9D,OAAO,IAAI,CAAC,GAAG,CAAC,2BAA2B,eAAe,CAAC,MAAM,EAAE,EAAE;YACjE,OAAO,EAAE;gBACL,MAAM,EAAE,eAAe,CAAC,MAAM;gBAC9B,QAAQ,EAAE,eAAe,CAAC,QAAQ;aACJ;SACrC,CAAC,CAAC;IACP,CAAC;CAEJ;AA9HD,0BA8HC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
4
|
+
/**
|
|
5
|
+
* Various utility commands
|
|
6
|
+
*/
|
|
7
|
+
class CommandsApi extends api_fetch_client_1.ApiTopic {
|
|
8
|
+
constructor(parent) {
|
|
9
|
+
super(parent, "/api/v1/commands");
|
|
10
|
+
}
|
|
11
|
+
async isNamespaceAvailable(name) {
|
|
12
|
+
return this.get(`/namespaces/${name}/is_available`).then((response) => response.available);
|
|
13
|
+
}
|
|
14
|
+
async initSamples() {
|
|
15
|
+
return this.post("/onboarding/init-samples");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = CommandsApi;
|
|
19
|
+
//# sourceMappingURL=CommandsApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandsApi.js","sourceRoot":"","sources":["../../src/CommandsApi.ts"],"names":[],"mappings":";;AAAA,iEAAkE;AAIlE;;GAEG;AAEH,MAAqB,WAAY,SAAQ,2BAAQ;IAE7C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;IACrC,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,IAAY;QACnC,OAAO,IAAI,CAAC,GAAG,CAAC,eAAe,IAAI,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC/F,CAAC;IAED,KAAK,CAAC,WAAW;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IACjD,CAAC;CAEJ;AAdD,8BAcC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
4
|
+
class EnvironmentsApi extends api_fetch_client_1.ApiTopic {
|
|
5
|
+
constructor(parent) {
|
|
6
|
+
super(parent, "/api/v1/environments");
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* List all environments for the current project
|
|
10
|
+
* @param all if true, list all environments, otherwise only the ones for the current project
|
|
11
|
+
*/
|
|
12
|
+
list(all = false) {
|
|
13
|
+
const query = all ? { all: true } : undefined;
|
|
14
|
+
return this.get('/', { query });
|
|
15
|
+
}
|
|
16
|
+
create(payload) {
|
|
17
|
+
return this.post('/', {
|
|
18
|
+
payload
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
retrieve(id) {
|
|
22
|
+
return this.get('/' + id);
|
|
23
|
+
}
|
|
24
|
+
update(id, payload) {
|
|
25
|
+
return this.put('/' + id, {
|
|
26
|
+
payload
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Update enabled models and / or config. If enabled_models is not provided, the existing enabled models will not change.
|
|
31
|
+
* Same, if config is not provided the exiting config is not changed.
|
|
32
|
+
* If the config is provided then it will be updated without removing fields that are not provided.
|
|
33
|
+
*
|
|
34
|
+
* @param id
|
|
35
|
+
* @param payload
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
updateConfig(id, payload) {
|
|
39
|
+
return this.put('/' + id + '/config', {
|
|
40
|
+
payload
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
listModels(id, payload) {
|
|
44
|
+
return this.get('/' + id + '/models', {
|
|
45
|
+
query: payload ? { ...payload } : undefined
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
listTrainableModels(id) {
|
|
49
|
+
return this.get(`/${id}/trainable-models`);
|
|
50
|
+
}
|
|
51
|
+
embeddings(id, payload) {
|
|
52
|
+
return this.post('/' + id + '/embeddings', {
|
|
53
|
+
payload
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Batch update the LLM Environment for multiple Interactions, including the model used and the
|
|
58
|
+
* Environment that they belong to.
|
|
59
|
+
*
|
|
60
|
+
* It only updates Interactions that are in draft status.
|
|
61
|
+
*
|
|
62
|
+
* @param payload - The migration payload containing modelId and interactionIds
|
|
63
|
+
* @returns The count of matched and modified interactions
|
|
64
|
+
*/
|
|
65
|
+
migrateInteractions(payload) {
|
|
66
|
+
return this.post(`/migrate-interactions`, {
|
|
67
|
+
payload
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.default = EnvironmentsApi;
|
|
72
|
+
//# sourceMappingURL=EnvironmentsApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnvironmentsApi.js","sourceRoot":"","sources":["../../src/EnvironmentsApi.ts"],"names":[],"mappings":";;AACA,iEAAkE;AAYlE,MAAqB,eAAgB,SAAQ,2BAAQ;IACjD,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,MAAe,KAAK;QACrB,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAE9C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,OAA0C;QAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAClB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,QAAQ,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,OAA0C;QACzD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE;YACtB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAU,EAAE,OAGxB;QACG,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,SAAS,EAAE;YAClC,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,UAAU,CAAC,EAAU,EAAE,OAA4B;QAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,SAAS,EAAE;YAClC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS;SAC9C,CAAC,CAAC;IACP,CAAC;IAED,mBAAmB,CAAC,EAAU;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAC/C,CAAC;IAED,UAAU,CAAC,EAAU,EAAE,OAA2B;QAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,GAAG,aAAa,EAAE;YACvC,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;OAQG;IACH,mBAAmB,CAAC,OAAmC;QACnD,OAAO,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE;YACtC,OAAO;SACV,CAAC,CAAC;IACP,CAAC;CAEJ;AAhFD,kCAgFC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupsApi = void 0;
|
|
4
|
+
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
5
|
+
class GroupsApi extends api_fetch_client_1.ApiTopic {
|
|
6
|
+
constructor(parent) {
|
|
7
|
+
super(parent, "/groups");
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* List all groups in the current account
|
|
11
|
+
* @param options Query options for filtering and pagination
|
|
12
|
+
* @returns Array of UserGroup objects
|
|
13
|
+
*/
|
|
14
|
+
list(options) {
|
|
15
|
+
return this.get('/', { query: options });
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a new group
|
|
19
|
+
* @param payload The group data to create
|
|
20
|
+
* @returns The created UserGroup object
|
|
21
|
+
*/
|
|
22
|
+
create(payload) {
|
|
23
|
+
return this.post('/', { payload });
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Retrieve a specific group by ID
|
|
27
|
+
* @param groupId The ID of the group to retrieve
|
|
28
|
+
* @returns The UserGroup object
|
|
29
|
+
*/
|
|
30
|
+
retrieve(groupId) {
|
|
31
|
+
return this.get('/' + groupId);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Update a group
|
|
35
|
+
* @param groupId The ID of the group to update
|
|
36
|
+
* @param payload The group data to update
|
|
37
|
+
* @returns The updated UserGroup object
|
|
38
|
+
*/
|
|
39
|
+
update(groupId, payload) {
|
|
40
|
+
return this.put('/' + groupId, { payload });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Delete a group
|
|
44
|
+
* @param groupId The ID of the group to delete
|
|
45
|
+
* @returns Object with the deleted group ID
|
|
46
|
+
*/
|
|
47
|
+
delete(groupId) {
|
|
48
|
+
return this.del('/' + groupId);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* List members of a group
|
|
52
|
+
* @param groupId The ID of the group
|
|
53
|
+
* @returns Array of UserRef objects representing group members
|
|
54
|
+
*/
|
|
55
|
+
listMembers(groupId) {
|
|
56
|
+
return this.get('/' + groupId + '/members');
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Add a member to a group
|
|
60
|
+
* @param groupId The ID of the group
|
|
61
|
+
* @param userId The ID of the user to add
|
|
62
|
+
* @returns The updated UserGroup object
|
|
63
|
+
*/
|
|
64
|
+
addMember(groupId, userId) {
|
|
65
|
+
return this.post('/' + groupId + '/members/' + userId);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Remove a member from a group
|
|
69
|
+
* @param groupId The ID of the group
|
|
70
|
+
* @param userId The ID of the user to remove
|
|
71
|
+
* @returns The updated UserGroup object
|
|
72
|
+
*/
|
|
73
|
+
removeMember(groupId, userId) {
|
|
74
|
+
return this.del('/' + groupId + '/members/' + userId);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.GroupsApi = GroupsApi;
|
|
78
|
+
//# sourceMappingURL=GroupsApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupsApi.js","sourceRoot":"","sources":["../../src/GroupsApi.ts"],"names":[],"mappings":";;;AACA,iEAAkE;AAUlE,MAAa,SAAU,SAAQ,2BAAQ;IAEnC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,OAA4B;QAC7B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAA2B;QAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,OAAe;QACpB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,OAAe,EAAE,OAA2B;QAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAe;QAClB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,OAAe;QACvB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;IAChD,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,OAAe,EAAE,MAAc;QACrC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;OAKG;IACH,YAAY,CAAC,OAAe,EAAE,MAAc;QACxC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,CAAC,CAAC;IAC1D,CAAC;CACJ;AAhFD,8BAgFC"}
|