@vertesia/client 0.80.0-dev.20251121 → 0.80.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +110 -0
- package/package.json +13 -4
- package/src/InteractionsApi.ts +14 -1
- package/src/SkillsApi.ts +46 -0
- package/src/client.test.ts +3 -0
- package/src/client.ts +11 -7
- package/src/store/FilesApi.ts +93 -0
- package/src/store/ObjectsApi.ts +1 -0
- package/src/store/WorkersApi.ts +17 -0
- package/src/store/client.ts +2 -2
- package/src/store/index.ts +1 -0
- package/lib/cjs/AccountApi.js +0 -85
- package/lib/cjs/AccountApi.js.map +0 -1
- package/lib/cjs/AccountsApi.js +0 -16
- package/lib/cjs/AccountsApi.js.map +0 -1
- package/lib/cjs/AnalyticsApi.js +0 -13
- package/lib/cjs/AnalyticsApi.js.map +0 -1
- package/lib/cjs/ApiKeysApi.js +0 -63
- package/lib/cjs/ApiKeysApi.js.map +0 -1
- package/lib/cjs/AppsApi.js +0 -119
- package/lib/cjs/AppsApi.js.map +0 -1
- package/lib/cjs/CommandsApi.js +0 -19
- package/lib/cjs/CommandsApi.js.map +0 -1
- package/lib/cjs/EnvironmentsApi.js +0 -58
- package/lib/cjs/EnvironmentsApi.js.map +0 -1
- package/lib/cjs/GroupsApi.js +0 -78
- package/lib/cjs/GroupsApi.js.map +0 -1
- package/lib/cjs/IamApi.js +0 -53
- package/lib/cjs/IamApi.js.map +0 -1
- package/lib/cjs/InteractionBase.js +0 -44
- package/lib/cjs/InteractionBase.js.map +0 -1
- package/lib/cjs/InteractionCatalogApi.js +0 -64
- package/lib/cjs/InteractionCatalogApi.js.map +0 -1
- package/lib/cjs/InteractionOutput.js +0 -300
- package/lib/cjs/InteractionOutput.js.map +0 -1
- package/lib/cjs/InteractionResult.example.js +0 -57
- package/lib/cjs/InteractionResult.example.js.map +0 -1
- package/lib/cjs/InteractionsApi.js +0 -231
- package/lib/cjs/InteractionsApi.js.map +0 -1
- package/lib/cjs/ProjectsApi.js +0 -53
- package/lib/cjs/ProjectsApi.js.map +0 -1
- package/lib/cjs/PromptsApi.js +0 -133
- package/lib/cjs/PromptsApi.js.map +0 -1
- package/lib/cjs/RefsApi.js +0 -14
- package/lib/cjs/RefsApi.js.map +0 -1
- package/lib/cjs/RunsApi.js +0 -113
- package/lib/cjs/RunsApi.js.map +0 -1
- package/lib/cjs/StreamSource.js +0 -17
- package/lib/cjs/StreamSource.js.map +0 -1
- package/lib/cjs/TrainingApi.js +0 -54
- package/lib/cjs/TrainingApi.js.map +0 -1
- package/lib/cjs/UsersApi.js +0 -13
- package/lib/cjs/UsersApi.js.map +0 -1
- package/lib/cjs/client.js +0 -346
- package/lib/cjs/client.js.map +0 -1
- package/lib/cjs/execute.js +0 -158
- package/lib/cjs/execute.js.map +0 -1
- package/lib/cjs/index.js +0 -22
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/nodejs/NodeStreamSource.js +0 -45
- package/lib/cjs/nodejs/NodeStreamSource.js.map +0 -1
- package/lib/cjs/nodejs/index.js +0 -18
- package/lib/cjs/nodejs/index.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/store/AgentsApi.js +0 -16
- package/lib/cjs/store/AgentsApi.js.map +0 -1
- package/lib/cjs/store/AnalyzeDocApi.js +0 -56
- package/lib/cjs/store/AnalyzeDocApi.js.map +0 -1
- package/lib/cjs/store/CollectionsApi.js +0 -131
- package/lib/cjs/store/CollectionsApi.js.map +0 -1
- package/lib/cjs/store/CommandsApi.js +0 -17
- package/lib/cjs/store/CommandsApi.js.map +0 -1
- package/lib/cjs/store/EmbeddingsApi.js +0 -29
- package/lib/cjs/store/EmbeddingsApi.js.map +0 -1
- package/lib/cjs/store/FilesApi.js +0 -148
- package/lib/cjs/store/FilesApi.js.map +0 -1
- package/lib/cjs/store/ObjectsApi.js +0 -282
- package/lib/cjs/store/ObjectsApi.js.map +0 -1
- package/lib/cjs/store/TypesApi.js +0 -57
- package/lib/cjs/store/TypesApi.js.map +0 -1
- package/lib/cjs/store/WorkflowsApi.js +0 -414
- package/lib/cjs/store/WorkflowsApi.js.map +0 -1
- package/lib/cjs/store/client.js +0 -71
- package/lib/cjs/store/client.js.map +0 -1
- package/lib/cjs/store/errors.js +0 -11
- package/lib/cjs/store/errors.js.map +0 -1
- package/lib/cjs/store/index.js +0 -22
- package/lib/cjs/store/index.js.map +0 -1
- package/lib/cjs/store/version.js +0 -6
- package/lib/cjs/store/version.js.map +0 -1
- package/lib/esm/AccountApi.js +0 -82
- package/lib/esm/AccountApi.js.map +0 -1
- package/lib/esm/AccountsApi.js +0 -13
- package/lib/esm/AccountsApi.js.map +0 -1
- package/lib/esm/AnalyticsApi.js +0 -10
- package/lib/esm/AnalyticsApi.js.map +0 -1
- package/lib/esm/ApiKeysApi.js +0 -59
- package/lib/esm/ApiKeysApi.js.map +0 -1
- package/lib/esm/AppsApi.js +0 -116
- package/lib/esm/AppsApi.js.map +0 -1
- package/lib/esm/CommandsApi.js +0 -16
- package/lib/esm/CommandsApi.js.map +0 -1
- package/lib/esm/EnvironmentsApi.js +0 -55
- package/lib/esm/EnvironmentsApi.js.map +0 -1
- package/lib/esm/GroupsApi.js +0 -74
- package/lib/esm/GroupsApi.js.map +0 -1
- package/lib/esm/IamApi.js +0 -47
- package/lib/esm/IamApi.js.map +0 -1
- package/lib/esm/InteractionBase.js +0 -40
- package/lib/esm/InteractionBase.js.map +0 -1
- package/lib/esm/InteractionCatalogApi.js +0 -60
- package/lib/esm/InteractionCatalogApi.js.map +0 -1
- package/lib/esm/InteractionOutput.js +0 -293
- package/lib/esm/InteractionOutput.js.map +0 -1
- package/lib/esm/InteractionResult.example.js +0 -55
- package/lib/esm/InteractionResult.example.js.map +0 -1
- package/lib/esm/InteractionsApi.js +0 -228
- package/lib/esm/InteractionsApi.js.map +0 -1
- package/lib/esm/ProjectsApi.js +0 -50
- package/lib/esm/ProjectsApi.js.map +0 -1
- package/lib/esm/PromptsApi.js +0 -130
- package/lib/esm/PromptsApi.js.map +0 -1
- package/lib/esm/RefsApi.js +0 -10
- package/lib/esm/RefsApi.js.map +0 -1
- package/lib/esm/RunsApi.js +0 -109
- package/lib/esm/RunsApi.js.map +0 -1
- package/lib/esm/StreamSource.js +0 -13
- package/lib/esm/StreamSource.js.map +0 -1
- package/lib/esm/TrainingApi.js +0 -51
- package/lib/esm/TrainingApi.js.map +0 -1
- package/lib/esm/UsersApi.js +0 -10
- package/lib/esm/UsersApi.js.map +0 -1
- package/lib/esm/client.js +0 -337
- package/lib/esm/client.js.map +0 -1
- package/lib/esm/execute.js +0 -118
- package/lib/esm/execute.js.map +0 -1
- package/lib/esm/index.js +0 -6
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/nodejs/NodeStreamSource.js +0 -41
- package/lib/esm/nodejs/NodeStreamSource.js.map +0 -1
- package/lib/esm/nodejs/index.js +0 -2
- package/lib/esm/nodejs/index.js.map +0 -1
- package/lib/esm/store/AgentsApi.js +0 -12
- package/lib/esm/store/AgentsApi.js.map +0 -1
- package/lib/esm/store/AnalyzeDocApi.js +0 -52
- package/lib/esm/store/AnalyzeDocApi.js.map +0 -1
- package/lib/esm/store/CollectionsApi.js +0 -127
- package/lib/esm/store/CollectionsApi.js.map +0 -1
- package/lib/esm/store/CommandsApi.js +0 -13
- package/lib/esm/store/CommandsApi.js.map +0 -1
- package/lib/esm/store/EmbeddingsApi.js +0 -25
- package/lib/esm/store/EmbeddingsApi.js.map +0 -1
- package/lib/esm/store/FilesApi.js +0 -143
- package/lib/esm/store/FilesApi.js.map +0 -1
- package/lib/esm/store/ObjectsApi.js +0 -278
- package/lib/esm/store/ObjectsApi.js.map +0 -1
- package/lib/esm/store/TypesApi.js +0 -53
- package/lib/esm/store/TypesApi.js.map +0 -1
- package/lib/esm/store/WorkflowsApi.js +0 -408
- package/lib/esm/store/WorkflowsApi.js.map +0 -1
- package/lib/esm/store/client.js +0 -67
- package/lib/esm/store/client.js.map +0 -1
- package/lib/esm/store/errors.js +0 -7
- package/lib/esm/store/errors.js.map +0 -1
- package/lib/esm/store/index.js +0 -6
- package/lib/esm/store/index.js.map +0 -1
- package/lib/esm/store/version.js +0 -3
- package/lib/esm/store/version.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/types/AccountApi.d.ts +0 -59
- package/lib/types/AccountApi.d.ts.map +0 -1
- package/lib/types/AccountsApi.d.ts +0 -7
- package/lib/types/AccountsApi.d.ts.map +0 -1
- package/lib/types/AnalyticsApi.d.ts +0 -6
- package/lib/types/AnalyticsApi.d.ts.map +0 -1
- package/lib/types/ApiKeysApi.d.ts +0 -42
- package/lib/types/ApiKeysApi.d.ts.map +0 -1
- package/lib/types/AppsApi.d.ts +0 -65
- package/lib/types/AppsApi.d.ts.map +0 -1
- package/lib/types/CommandsApi.d.ts +0 -10
- package/lib/types/CommandsApi.d.ts.map +0 -1
- package/lib/types/EnvironmentsApi.d.ts +0 -30
- package/lib/types/EnvironmentsApi.d.ts.map +0 -1
- package/lib/types/GroupsApi.d.ts +0 -65
- package/lib/types/GroupsApi.d.ts.map +0 -1
- package/lib/types/IamApi.d.ts +0 -41
- package/lib/types/IamApi.d.ts.map +0 -1
- package/lib/types/InteractionBase.d.ts +0 -22
- package/lib/types/InteractionBase.d.ts.map +0 -1
- package/lib/types/InteractionCatalogApi.d.ts +0 -36
- package/lib/types/InteractionCatalogApi.d.ts.map +0 -1
- package/lib/types/InteractionOutput.d.ts +0 -174
- package/lib/types/InteractionOutput.d.ts.map +0 -1
- package/lib/types/InteractionResult.example.d.ts +0 -6
- package/lib/types/InteractionResult.example.d.ts.map +0 -1
- package/lib/types/InteractionsApi.d.ts +0 -159
- package/lib/types/InteractionsApi.d.ts.map +0 -1
- package/lib/types/ProjectsApi.d.ts +0 -18
- package/lib/types/ProjectsApi.d.ts.map +0 -1
- package/lib/types/PromptsApi.d.ts +0 -106
- package/lib/types/PromptsApi.d.ts.map +0 -1
- package/lib/types/RefsApi.d.ts +0 -6
- package/lib/types/RefsApi.d.ts.map +0 -1
- package/lib/types/RunsApi.d.ts +0 -79
- package/lib/types/RunsApi.d.ts.map +0 -1
- package/lib/types/StreamSource.d.ts +0 -7
- package/lib/types/StreamSource.d.ts.map +0 -1
- package/lib/types/TrainingApi.d.ts +0 -27
- package/lib/types/TrainingApi.d.ts.map +0 -1
- package/lib/types/UsersApi.d.ts +0 -6
- package/lib/types/UsersApi.d.ts.map +0 -1
- package/lib/types/client.d.ts +0 -123
- package/lib/types/client.d.ts.map +0 -1
- package/lib/types/execute.d.ts +0 -37
- package/lib/types/execute.d.ts.map +0 -1
- package/lib/types/index.d.ts +0 -10
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/nodejs/NodeStreamSource.d.ts +0 -9
- package/lib/types/nodejs/NodeStreamSource.d.ts.map +0 -1
- package/lib/types/nodejs/index.d.ts +0 -1
- package/lib/types/nodejs/index.d.ts.map +0 -1
- package/lib/types/store/AgentsApi.d.ts +0 -6
- package/lib/types/store/AgentsApi.d.ts.map +0 -1
- package/lib/types/store/AnalyzeDocApi.d.ts +0 -17
- package/lib/types/store/AnalyzeDocApi.d.ts.map +0 -1
- package/lib/types/store/CollectionsApi.d.ts +0 -82
- package/lib/types/store/CollectionsApi.d.ts.map +0 -1
- package/lib/types/store/CommandsApi.d.ts +0 -10
- package/lib/types/store/CommandsApi.d.ts.map +0 -1
- package/lib/types/store/EmbeddingsApi.d.ts +0 -12
- package/lib/types/store/EmbeddingsApi.d.ts.map +0 -1
- package/lib/types/store/FilesApi.d.ts +0 -48
- package/lib/types/store/FilesApi.d.ts.map +0 -1
- package/lib/types/store/ObjectsApi.d.ts +0 -117
- package/lib/types/store/ObjectsApi.d.ts.map +0 -1
- package/lib/types/store/TypesApi.d.ts +0 -23
- package/lib/types/store/TypesApi.d.ts.map +0 -1
- package/lib/types/store/WorkflowsApi.d.ts +0 -62
- package/lib/types/store/WorkflowsApi.d.ts.map +0 -1
- package/lib/types/store/client.d.ts +0 -35
- package/lib/types/store/client.d.ts.map +0 -1
- package/lib/types/store/errors.d.ts +0 -4
- package/lib/types/store/errors.d.ts.map +0 -1
- package/lib/types/store/index.d.ts +0 -5
- package/lib/types/store/index.d.ts.map +0 -1
- package/lib/types/store/version.d.ts +0 -2
- package/lib/types/store/version.d.ts.map +0 -1
- package/lib/vertesia-client.js +0 -2
- package/lib/vertesia-client.js.map +0 -1
- package/src/store/AgentsApi.ts +0 -17
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertesia/client",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./lib/types/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"eventsource": "^3.0.6",
|
|
25
|
-
"@llumiverse/common": "0.23.0
|
|
26
|
-
"@vertesia/
|
|
27
|
-
"@vertesia/
|
|
25
|
+
"@llumiverse/common": "0.23.0",
|
|
26
|
+
"@vertesia/common": "0.80.1",
|
|
27
|
+
"@vertesia/api-fetch-client": "0.80.1"
|
|
28
28
|
},
|
|
29
29
|
"ts_dual_module": {
|
|
30
30
|
"outDir": "lib"
|
|
@@ -46,6 +46,15 @@
|
|
|
46
46
|
"url": "https://github.com/vertesia/composableai.git",
|
|
47
47
|
"directory": "packages/client"
|
|
48
48
|
},
|
|
49
|
+
"keywords": [
|
|
50
|
+
"vertesia",
|
|
51
|
+
"client",
|
|
52
|
+
"api",
|
|
53
|
+
"sdk",
|
|
54
|
+
"llm",
|
|
55
|
+
"ai",
|
|
56
|
+
"typescript"
|
|
57
|
+
],
|
|
49
58
|
"typesVersions": {
|
|
50
59
|
"*": {
|
|
51
60
|
"node": [
|
package/src/InteractionsApi.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
Interaction, InteractionCreatePayload, InteractionEndpoint, InteractionEndpointQuery,
|
|
6
6
|
InteractionExecutionPayload, InteractionForkPayload,
|
|
7
7
|
InteractionPublishPayload, InteractionRef, InteractionRefWithSchema, InteractionSearchPayload, InteractionSearchQuery,
|
|
8
|
-
InteractionsExportPayload, InteractionUpdatePayload,
|
|
8
|
+
InteractionsExportPayload, InteractionTags, InteractionUpdatePayload,
|
|
9
9
|
RateLimitRequestPayload, RateLimitRequestResponse
|
|
10
10
|
} from "@vertesia/common";
|
|
11
11
|
import { VertesiaClient } from "./client.js";
|
|
@@ -63,6 +63,19 @@ export default class InteractionsApi extends ApiTopic {
|
|
|
63
63
|
return this.get(`/versions/${name}`);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Get the list of all interaction tags in the current project
|
|
68
|
+
* @param query optional query parameters to filter the tags
|
|
69
|
+
* @returns InteractionTags[]
|
|
70
|
+
**/
|
|
71
|
+
listTags(query?: InteractionSearchQuery): Promise<InteractionTags[]> {
|
|
72
|
+
return this.get("/tags", {
|
|
73
|
+
query: {
|
|
74
|
+
...query
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
66
79
|
/**
|
|
67
80
|
* Get the list of all interactions facets
|
|
68
81
|
* @param payload query payload to filter facet search
|
package/src/SkillsApi.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import {
|
|
3
|
+
FindRelevantSkillsPayload,
|
|
4
|
+
InjectedSkill,
|
|
5
|
+
SkillContext,
|
|
6
|
+
} from "@vertesia/common";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* API client for skill operations.
|
|
10
|
+
* Skills are interactions with agent_runner_options.is_skill = true.
|
|
11
|
+
* They provide contextual instructions to agents by executing/rendering
|
|
12
|
+
* the interaction and returning the result.
|
|
13
|
+
*/
|
|
14
|
+
export default class SkillsApi extends ApiTopic {
|
|
15
|
+
constructor(parent: ClientBase) {
|
|
16
|
+
super(parent, "/api/v1/skills");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Find skills relevant to a given context.
|
|
21
|
+
* This is the core skill matching API for auto-injection.
|
|
22
|
+
* @param context The context to match against
|
|
23
|
+
* @param limit Maximum number of skills to return (default: 5)
|
|
24
|
+
* @returns Array of injected skills with match scores
|
|
25
|
+
*/
|
|
26
|
+
findRelevant(context: SkillContext, limit?: number): Promise<InjectedSkill[]> {
|
|
27
|
+
const payload: FindRelevantSkillsPayload = { context, limit };
|
|
28
|
+
return this.post("/find-relevant", { payload });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Convenience method to find relevant skills by task description
|
|
33
|
+
* @param taskDescription The task or prompt to match
|
|
34
|
+
* @param toolNames Optional list of tools being used
|
|
35
|
+
* @returns Array of injected skills
|
|
36
|
+
*/
|
|
37
|
+
findRelevantForTask(
|
|
38
|
+
taskDescription: string,
|
|
39
|
+
toolNames?: string[]
|
|
40
|
+
): Promise<InjectedSkill[]> {
|
|
41
|
+
return this.findRelevant({
|
|
42
|
+
task_description: taskDescription,
|
|
43
|
+
tool_names: toolNames,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
package/src/client.test.ts
CHANGED
|
@@ -48,6 +48,7 @@ describe('Test Vertesia Client', () => {
|
|
|
48
48
|
expect(client).toBeDefined();
|
|
49
49
|
expect(client.baseUrl).toBe('https://api.vertesia.io');
|
|
50
50
|
expect(client.storeUrl).toBe('https://api.vertesia.io');
|
|
51
|
+
expect(client.tokenServerUrl).toBe('https://sts.vertesia.io');
|
|
51
52
|
});
|
|
52
53
|
|
|
53
54
|
test('Initialization with site api-preview.vertesia.io', () => {
|
|
@@ -58,6 +59,7 @@ describe('Test Vertesia Client', () => {
|
|
|
58
59
|
expect(client).toBeDefined();
|
|
59
60
|
expect(client.baseUrl).toBe('https://api-preview.vertesia.io');
|
|
60
61
|
expect(client.storeUrl).toBe('https://api-preview.vertesia.io');
|
|
62
|
+
expect(client.tokenServerUrl).toBe('https://sts.vertesia.io');
|
|
61
63
|
});
|
|
62
64
|
|
|
63
65
|
test('Initialization with site api-staging.vertesia.io', () => {
|
|
@@ -68,6 +70,7 @@ describe('Test Vertesia Client', () => {
|
|
|
68
70
|
expect(client).toBeDefined();
|
|
69
71
|
expect(client.baseUrl).toBe('https://api-staging.vertesia.io');
|
|
70
72
|
expect(client.storeUrl).toBe('https://api-staging.vertesia.io');
|
|
73
|
+
expect(client.tokenServerUrl).toBe('https://sts-staging.vertesia.io');
|
|
71
74
|
});
|
|
72
75
|
|
|
73
76
|
test('Initialization with site localhost', () => {
|
package/src/client.ts
CHANGED
|
@@ -10,6 +10,7 @@ import EnvironmentsApi from "./EnvironmentsApi.js";
|
|
|
10
10
|
import { IamApi } from "./IamApi.js";
|
|
11
11
|
import InteractionsApi from "./InteractionsApi.js";
|
|
12
12
|
import ProjectsApi from "./ProjectsApi.js";
|
|
13
|
+
import SkillsApi from "./SkillsApi.js";
|
|
13
14
|
import PromptsApi from "./PromptsApi.js";
|
|
14
15
|
import { RefsApi } from "./RefsApi.js";
|
|
15
16
|
import { RunsApi } from "./RunsApi.js";
|
|
@@ -127,7 +128,12 @@ export class VertesiaClient extends AbstractFetchClient<VertesiaClient> {
|
|
|
127
128
|
if (opts.tokenServerUrl) {
|
|
128
129
|
this.tokenServerUrl = opts.tokenServerUrl;
|
|
129
130
|
} else if (opts.site) {
|
|
130
|
-
|
|
131
|
+
// Preview uses production STS, staging uses its own STS
|
|
132
|
+
if (opts.site === "api-preview.vertesia.io" || opts.site === "api.vertesia.io") {
|
|
133
|
+
this.tokenServerUrl = "https://sts.vertesia.io";
|
|
134
|
+
} else {
|
|
135
|
+
this.tokenServerUrl = `https://${opts.site.replace(/^api/, "sts")}`;
|
|
136
|
+
}
|
|
131
137
|
} else if (opts.serverUrl || opts.storeUrl) {
|
|
132
138
|
// Determine STS URL based on environment in serverUrl or storeUrl
|
|
133
139
|
const urlToCheck = opts.serverUrl || opts.storeUrl || "";
|
|
@@ -138,16 +144,13 @@ export class VertesiaClient extends AbstractFetchClient<VertesiaClient> {
|
|
|
138
144
|
// zeno-server-production.api.vertesia.io -> sts.vertesia.io
|
|
139
145
|
this.tokenServerUrl = "https://sts.vertesia.io";
|
|
140
146
|
} else if (url.hostname.includes("-preview.")) {
|
|
141
|
-
// zeno-server-preview.api.vertesia.io -> sts
|
|
142
|
-
this.tokenServerUrl = "https://sts
|
|
147
|
+
// zeno-server-preview.api.vertesia.io -> sts.vertesia.io
|
|
148
|
+
this.tokenServerUrl = "https://sts.vertesia.io";
|
|
143
149
|
} else if (url.hostname === "api.vertesia.io") {
|
|
144
|
-
// api.vertesia.io -> sts.vertesia.io
|
|
145
150
|
this.tokenServerUrl = "https://sts.vertesia.io";
|
|
146
151
|
} else if (url.hostname === "api-preview.vertesia.io") {
|
|
147
|
-
|
|
148
|
-
this.tokenServerUrl = "https://sts-preview.vertesia.io";
|
|
152
|
+
this.tokenServerUrl = "https://sts.vertesia.io";
|
|
149
153
|
} else if (url.hostname === "api-staging.vertesia.io") {
|
|
150
|
-
// api-staging.vertesia.io -> sts-staging.vertesia.io
|
|
151
154
|
this.tokenServerUrl = "https://sts-staging.vertesia.io";
|
|
152
155
|
} else if (url.hostname.startsWith("api")) {
|
|
153
156
|
// Generic api.* pattern replacement
|
|
@@ -310,6 +313,7 @@ export class VertesiaClient extends AbstractFetchClient<VertesiaClient> {
|
|
|
310
313
|
projects = new ProjectsApi(this);
|
|
311
314
|
environments = new EnvironmentsApi(this);
|
|
312
315
|
interactions = new InteractionsApi(this);
|
|
316
|
+
skills = new SkillsApi(this);
|
|
313
317
|
prompts = new PromptsApi(this);
|
|
314
318
|
runs = new RunsApi(this);
|
|
315
319
|
account = new AccountApi(this);
|
package/src/store/FilesApi.ts
CHANGED
|
@@ -3,16 +3,27 @@ import {
|
|
|
3
3
|
GetFileUrlPayload,
|
|
4
4
|
GetFileUrlResponse,
|
|
5
5
|
GetUploadUrlPayload,
|
|
6
|
+
SetFileMetadataPayload,
|
|
6
7
|
} from "@vertesia/common";
|
|
7
8
|
import { StreamSource } from "../StreamSource.js";
|
|
8
9
|
|
|
9
10
|
export const MEMORIES_PREFIX = "memories";
|
|
11
|
+
export const ARTIFACTS_PREFIX = "agents";
|
|
10
12
|
|
|
11
13
|
export function getMemoryFilePath(name: string) {
|
|
12
14
|
const nameWithExt = name.endsWith(".tar.gz") ? name : name + ".tar.gz";
|
|
13
15
|
return `${MEMORIES_PREFIX}/${nameWithExt}`;
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Build the storage path for an agent artifact
|
|
20
|
+
* @param runId - The workflow run ID
|
|
21
|
+
* @param name - The artifact filename
|
|
22
|
+
*/
|
|
23
|
+
export function getAgentArtifactPath(runId: string, name: string): string {
|
|
24
|
+
return `${ARTIFACTS_PREFIX}/${runId}/${name}`;
|
|
25
|
+
}
|
|
26
|
+
|
|
16
27
|
export class FilesApi extends ApiTopic {
|
|
17
28
|
constructor(parent: ClientBase) {
|
|
18
29
|
super(parent, "/api/v1/files");
|
|
@@ -36,6 +47,7 @@ export class FilesApi extends ApiTopic {
|
|
|
36
47
|
contentType: string;
|
|
37
48
|
contentDisposition?: string;
|
|
38
49
|
etag?: string;
|
|
50
|
+
customMetadata?: Record<string, string>;
|
|
39
51
|
}> {
|
|
40
52
|
return this.get("/metadata", {
|
|
41
53
|
query: {
|
|
@@ -44,6 +56,17 @@ export class FilesApi extends ApiTopic {
|
|
|
44
56
|
});
|
|
45
57
|
}
|
|
46
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Set custom metadata on a file
|
|
61
|
+
* @param file - The file path or URI
|
|
62
|
+
* @param metadata - Custom metadata key-value pairs
|
|
63
|
+
* @returns Success status
|
|
64
|
+
*/
|
|
65
|
+
setFileMetadata(file: string, metadata: Record<string, string>): Promise<{ success: boolean; file: string }> {
|
|
66
|
+
const payload: SetFileMetadataPayload = { file, metadata };
|
|
67
|
+
return this.put("/metadata", { payload });
|
|
68
|
+
}
|
|
69
|
+
|
|
47
70
|
/**
|
|
48
71
|
* Get or create a bucket for the project. If the bucket already exists, it does nothing.
|
|
49
72
|
* The bucket URI is returned.
|
|
@@ -179,4 +202,74 @@ export class FilesApi extends ApiTopic {
|
|
|
179
202
|
}
|
|
180
203
|
return stream;
|
|
181
204
|
}
|
|
205
|
+
|
|
206
|
+
// ==================== Agent Artifact Methods ====================
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* List files by prefix
|
|
210
|
+
* @param prefix - Path prefix to filter files
|
|
211
|
+
* @returns Array of file paths matching the prefix
|
|
212
|
+
*/
|
|
213
|
+
listByPrefix(prefix: string): Promise<{ files: string[] }> {
|
|
214
|
+
return this.get("/list", { query: { prefix } });
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Upload an artifact for an agent run
|
|
219
|
+
* @param runId - The workflow run ID
|
|
220
|
+
* @param name - Artifact name (e.g., "output.json")
|
|
221
|
+
* @param source - File content source
|
|
222
|
+
* @returns The full path of the uploaded artifact
|
|
223
|
+
*/
|
|
224
|
+
async uploadArtifact(runId: string, name: string, source: StreamSource | File): Promise<string> {
|
|
225
|
+
const artifactPath = getAgentArtifactPath(runId, name);
|
|
226
|
+
if (source instanceof File) {
|
|
227
|
+
const file = source as File;
|
|
228
|
+
return this.uploadFile(
|
|
229
|
+
new StreamSource(file.stream(), name, file.type, artifactPath)
|
|
230
|
+
);
|
|
231
|
+
} else {
|
|
232
|
+
return this.uploadFile(
|
|
233
|
+
new StreamSource(source.stream, name, source.type, artifactPath)
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Download an artifact from an agent run
|
|
240
|
+
* @param runId - The workflow run ID
|
|
241
|
+
* @param name - Artifact name
|
|
242
|
+
* @returns ReadableStream of the artifact content
|
|
243
|
+
*/
|
|
244
|
+
async downloadArtifact(runId: string, name: string): Promise<ReadableStream<Uint8Array>> {
|
|
245
|
+
const artifactPath = getAgentArtifactPath(runId, name);
|
|
246
|
+
return this.downloadFile(artifactPath);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Get download URL for an artifact
|
|
251
|
+
* @param runId - The workflow run ID
|
|
252
|
+
* @param name - Artifact name
|
|
253
|
+
* @param disposition - Content disposition (inline or attachment)
|
|
254
|
+
* @returns Signed URL response
|
|
255
|
+
*/
|
|
256
|
+
getArtifactDownloadUrl(
|
|
257
|
+
runId: string,
|
|
258
|
+
name: string,
|
|
259
|
+
disposition?: "inline" | "attachment"
|
|
260
|
+
): Promise<GetFileUrlResponse> {
|
|
261
|
+
const artifactPath = getAgentArtifactPath(runId, name);
|
|
262
|
+
return this.getDownloadUrl(artifactPath, name, disposition);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* List artifacts for an agent run
|
|
267
|
+
* @param runId - The workflow run ID
|
|
268
|
+
* @returns Array of artifact file paths
|
|
269
|
+
*/
|
|
270
|
+
async listArtifacts(runId: string): Promise<string[]> {
|
|
271
|
+
const prefix = `${ARTIFACTS_PREFIX}/${runId}/`;
|
|
272
|
+
const result = await this.listByPrefix(prefix);
|
|
273
|
+
return result.files;
|
|
274
|
+
}
|
|
182
275
|
}
|
package/src/store/ObjectsApi.ts
CHANGED
|
@@ -364,6 +364,7 @@ export class ObjectsApi extends ApiTopic {
|
|
|
364
364
|
max_hw: options.max_hw,
|
|
365
365
|
generate_if_missing: options.generate_if_missing,
|
|
366
366
|
sign_url: options.sign_url,
|
|
367
|
+
block_on_generation: options.block_on_generation,
|
|
367
368
|
};
|
|
368
369
|
|
|
369
370
|
return this.get(`/${documentId}/renditions/${options.format}`, {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { CreateWorkerDeploymentRequest } from "@vertesia/common";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export class WorkersApi extends ApiTopic {
|
|
6
|
+
|
|
7
|
+
constructor(parent: ClientBase) {
|
|
8
|
+
super(parent, "/api/v1/workers");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async deploy(payload: CreateWorkerDeploymentRequest): Promise<void> {
|
|
12
|
+
return this.post('/', {
|
|
13
|
+
payload
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
package/src/store/client.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AbstractFetchClient, RequestError } from "@vertesia/api-fetch-client";
|
|
2
2
|
import { BulkOperationPayload, BulkOperationResult } from "@vertesia/common";
|
|
3
|
-
import { AgentsApi } from "./AgentsApi.js";
|
|
4
3
|
import { CollectionsApi } from "./CollectionsApi.js";
|
|
5
4
|
import { CommandsApi } from "./CommandsApi.js";
|
|
6
5
|
import { EmbeddingsApi } from "./EmbeddingsApi.js";
|
|
@@ -9,6 +8,7 @@ import { FilesApi } from "./FilesApi.js";
|
|
|
9
8
|
import { ObjectsApi } from "./ObjectsApi.js";
|
|
10
9
|
import { TypesApi } from "./TypesApi.js";
|
|
11
10
|
import { VERSION, VERSION_HEADER } from "./version.js";
|
|
11
|
+
import { WorkersApi } from "./WorkersApi.js";
|
|
12
12
|
import { WorkflowsApi } from "./WorkflowsApi.js";
|
|
13
13
|
|
|
14
14
|
export interface ZenoClientProps {
|
|
@@ -79,7 +79,7 @@ export class ZenoClient extends AbstractFetchClient<ZenoClient> {
|
|
|
79
79
|
workflows = new WorkflowsApi(this);
|
|
80
80
|
files = new FilesApi(this);
|
|
81
81
|
commands = new CommandsApi(this);
|
|
82
|
-
|
|
82
|
+
workers = new WorkersApi(this);
|
|
83
83
|
collections = new CollectionsApi(this);
|
|
84
84
|
embeddings = new EmbeddingsApi(this);
|
|
85
85
|
}
|
package/src/store/index.ts
CHANGED
package/lib/cjs/AccountApi.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/lib/cjs/AccountsApi.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/lib/cjs/AnalyticsApi.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
runs(params) {
|
|
9
|
-
return this.post('/runs', { payload: params });
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.default = AnalyticsApi;
|
|
13
|
-
//# sourceMappingURL=AnalyticsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsApi.js","sourceRoot":"","sources":["../../src/AnalyticsApi.ts"],"names":[],"mappings":";;AACA,iEAAkE;AAKlE,MAAqB,YAAa,SAAQ,2BAAQ;IAE9C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;IACtC,CAAC;IAED,IAAI,CAAC,MAAyB;QAE1B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAEnD,CAAC;CAGJ;AAbD,+BAaC"}
|
package/lib/cjs/ApiKeysApi.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
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
|