roe-typescript 1.1.0 → 1.1.2
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 +49 -34
- package/dist/api/_generated.d.ts +9 -0
- package/dist/api/_generated.js +9 -0
- package/dist/api/agents.d.ts +14 -1
- package/dist/api/agents.js +73 -8
- package/dist/api/connections.d.ts +58 -0
- package/dist/api/connections.js +139 -0
- package/dist/api/connectors.d.ts +18 -0
- package/dist/api/connectors.js +26 -0
- package/dist/api/discovery.d.ts +2 -0
- package/dist/api/discovery.js +6 -0
- package/dist/api/knowledge_base.d.ts +67 -0
- package/dist/api/knowledge_base.js +202 -0
- package/dist/api/policies.d.ts +23 -6
- package/dist/api/policies.js +69 -33
- package/dist/api/tables.d.ts +25 -1
- package/dist/api/tables.js +49 -1
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +3 -3
- package/dist/client.d.ts +2 -2
- package/dist/client.js +1 -1
- package/dist/config.js +3 -1
- package/dist/exceptions.js +3 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +7 -7
- package/dist/models/file.js +5 -3
- package/dist/models/job.d.ts +1 -1
- package/dist/models/job.js +15 -4
- package/dist/utils/dynamicInputs.js +4 -2
- package/dist/utils/fileDetection.js +1 -1
- package/dist/utils/middleware.d.ts +1 -1
- package/dist/utils/middleware.js +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -3,16 +3,15 @@
|
|
|
3
3
|
TypeScript/Node SDK for the [Roe](https://www.roe-ai.com/) API.
|
|
4
4
|
|
|
5
5
|
<!-- ROE-SDK:RELEASE-BANNER:START -->
|
|
6
|
-
> **v1.1.
|
|
7
|
-
>
|
|
8
|
-
>
|
|
6
|
+
> **v1.1.2** - SDK operation coverage is synchronized across Python,
|
|
7
|
+
> TypeScript, and Go. See `SDK_EXAMPLES.md` for copy-ready examples and use
|
|
8
|
+
> cases.
|
|
9
9
|
<!-- ROE-SDK:RELEASE-BANNER:END -->
|
|
10
10
|
|
|
11
|
-
> **v1.0.80**
|
|
12
|
-
>
|
|
13
|
-
>
|
|
14
|
-
>
|
|
15
|
-
> in **[CHANGELOG.md](CHANGELOG.md)**.
|
|
11
|
+
> **v1.0.80** - `RoeHTTPClient`/axios were replaced by an OpenAPI-backed
|
|
12
|
+
> transport behind stable public methods such as `client.agents` and
|
|
13
|
+
> `client.policies`. Highlights and migration notes across releases live in
|
|
14
|
+
> **[CHANGELOG.md](CHANGELOG.md)**.
|
|
16
15
|
|
|
17
16
|
## Installation
|
|
18
17
|
|
|
@@ -108,26 +107,10 @@ result carries `result.status === JobStatus.FAILURE` and
|
|
|
108
107
|
`result.error_message`. Transport / HTTP errors hit the typed hierarchy
|
|
109
108
|
above.
|
|
110
109
|
|
|
111
|
-
## Raw API Access
|
|
112
|
-
|
|
113
|
-
The generated raw client is exposed as `client.raw`:
|
|
114
|
-
|
|
115
|
-
```typescript
|
|
116
|
-
import { RoeClient } from "roe-typescript";
|
|
117
|
-
|
|
118
|
-
const client = new RoeClient({
|
|
119
|
-
apiKey: "your-api-key",
|
|
120
|
-
organizationId: "your-org-uuid",
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
const response = await client.raw.GET("/v1/users/current_user/");
|
|
124
|
-
console.log(response.response.status);
|
|
125
|
-
```
|
|
126
|
-
|
|
127
110
|
<!-- ROE-SDK:GENERATED-FRIENDLY-APIS:START -->
|
|
128
|
-
##
|
|
111
|
+
## SDK Operation Groups
|
|
129
112
|
|
|
130
|
-
|
|
113
|
+
Common operations are available directly on the SDK client.
|
|
131
114
|
|
|
132
115
|
```typescript
|
|
133
116
|
const engines = await client.discovery.listAgentEngineTypes();
|
|
@@ -159,7 +142,7 @@ const agent = await client.agents.create({
|
|
|
159
142
|
],
|
|
160
143
|
engineConfig: {
|
|
161
144
|
url: "${url}",
|
|
162
|
-
model: "gpt-
|
|
145
|
+
model: "gpt-5.5-2026-04-23",
|
|
163
146
|
instruction: "Extract company information from this website.",
|
|
164
147
|
vision_mode: false,
|
|
165
148
|
crawl_config: {
|
|
@@ -201,8 +184,15 @@ await client.agents.delete(agent.id);
|
|
|
201
184
|
```typescript
|
|
202
185
|
client.agents.list() // List agents
|
|
203
186
|
client.agents.retrieve("agent-uuid") // Get agent
|
|
204
|
-
client.agents.create({
|
|
205
|
-
|
|
187
|
+
client.agents.create({
|
|
188
|
+
name: "Agent",
|
|
189
|
+
engineClassId: "ResearchEngine",
|
|
190
|
+
inputDefinitions: [],
|
|
191
|
+
engineConfig: {},
|
|
192
|
+
}) // Create agent
|
|
193
|
+
client.agents.update("agent-uuid", {
|
|
194
|
+
name: "New name",
|
|
195
|
+
}) // Update agent
|
|
206
196
|
client.agents.delete("agent-uuid") // Delete agent
|
|
207
197
|
client.agents.duplicate("agent-uuid") // Duplicate agent
|
|
208
198
|
```
|
|
@@ -226,8 +216,14 @@ client.agents.runVersion({ agentId, versionId, inputs })
|
|
|
226
216
|
client.agents.versions.list(agentId)
|
|
227
217
|
client.agents.versions.retrieve(agentId, versionId)
|
|
228
218
|
client.agents.versions.retrieveCurrent(agentId)
|
|
229
|
-
client.agents.versions.create({
|
|
230
|
-
|
|
219
|
+
client.agents.versions.create({
|
|
220
|
+
agentId,
|
|
221
|
+
inputDefinitions: [],
|
|
222
|
+
engineConfig: {},
|
|
223
|
+
})
|
|
224
|
+
client.agents.versions.update(agentId, versionId, {
|
|
225
|
+
versionName: "v2",
|
|
226
|
+
})
|
|
231
227
|
client.agents.versions.delete(agentId, versionId)
|
|
232
228
|
```
|
|
233
229
|
|
|
@@ -245,8 +241,13 @@ client.agents.jobs.deleteData(jobId)
|
|
|
245
241
|
```typescript
|
|
246
242
|
client.policies.list() // List policies
|
|
247
243
|
client.policies.retrieve("policy-uuid") // Get policy
|
|
248
|
-
client.policies.create({
|
|
249
|
-
|
|
244
|
+
client.policies.create({
|
|
245
|
+
name: "Policy",
|
|
246
|
+
content: {},
|
|
247
|
+
}) // Create policy
|
|
248
|
+
client.policies.update("policy-uuid", {
|
|
249
|
+
name: "New policy name",
|
|
250
|
+
}) // Update policy
|
|
250
251
|
client.policies.delete("policy-uuid") // Delete policy
|
|
251
252
|
```
|
|
252
253
|
|
|
@@ -255,7 +256,11 @@ client.policies.delete("policy-uuid") // Delete policy
|
|
|
255
256
|
```typescript
|
|
256
257
|
client.policies.versions.list(policyId)
|
|
257
258
|
client.policies.versions.retrieve(policyId, versionId)
|
|
258
|
-
client.policies.versions.create({
|
|
259
|
+
client.policies.versions.create({
|
|
260
|
+
policyId,
|
|
261
|
+
content: {},
|
|
262
|
+
versionName: "v2",
|
|
263
|
+
})
|
|
259
264
|
```
|
|
260
265
|
|
|
261
266
|
## Rori Agents (Agentic Workflows)
|
|
@@ -522,6 +527,16 @@ const agent = await client.agents.create({
|
|
|
522
527
|
| AML Investigation | `AMLInvestigationEngine` |
|
|
523
528
|
| Fraud Investigation | `FraudInvestigationEngine` |
|
|
524
529
|
|
|
530
|
+
## Development
|
|
531
|
+
|
|
532
|
+
Before opening a PR, format and lint the codebase by running:
|
|
533
|
+
|
|
534
|
+
```bash
|
|
535
|
+
./roe-cli format
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
CI runs the same checks (`biome ci`) on every pull request and on merges to `main`, and they must pass before a PR can be merged.
|
|
539
|
+
|
|
525
540
|
## Links
|
|
526
541
|
|
|
527
542
|
- [Roe](https://www.roe-ai.com/)
|
package/dist/api/_generated.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import type { RoeConfig } from "../config.js";
|
|
2
2
|
import type { RoeRawClient } from "../generated/client.js";
|
|
3
|
+
import { ConnectionsAPI } from "./connections.js";
|
|
4
|
+
import { ConnectorsAPI } from "./connectors.js";
|
|
3
5
|
import { DiscoveryAPI } from "./discovery.js";
|
|
6
|
+
import { KnowledgeBaseAPI } from "./knowledge_base.js";
|
|
4
7
|
import { TablesAPI } from "./tables.js";
|
|
8
|
+
export { ConnectionsAPI } from "./connections.js";
|
|
9
|
+
export { ConnectorsAPI } from "./connectors.js";
|
|
5
10
|
export { DiscoveryAPI } from "./discovery.js";
|
|
11
|
+
export { KnowledgeBaseAPI } from "./knowledge_base.js";
|
|
6
12
|
export { TablesAPI } from "./tables.js";
|
|
7
13
|
export type GeneratedApis = {
|
|
14
|
+
readonly connections: ConnectionsAPI;
|
|
15
|
+
readonly connectors: ConnectorsAPI;
|
|
8
16
|
readonly discovery: DiscoveryAPI;
|
|
17
|
+
readonly knowledge_base: KnowledgeBaseAPI;
|
|
9
18
|
readonly tables: TablesAPI;
|
|
10
19
|
};
|
|
11
20
|
export declare function createGeneratedApis(config: RoeConfig, raw: RoeRawClient): GeneratedApis;
|
package/dist/api/_generated.js
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
// Auto-generated friendly API facades for the Roe SDK.
|
|
2
2
|
// Generated by scripts/generate-sdk from openapi/wrappers.yml.
|
|
3
3
|
// Do not edit by hand.
|
|
4
|
+
import { ConnectionsAPI } from "./connections.js";
|
|
5
|
+
import { ConnectorsAPI } from "./connectors.js";
|
|
4
6
|
import { DiscoveryAPI } from "./discovery.js";
|
|
7
|
+
import { KnowledgeBaseAPI } from "./knowledge_base.js";
|
|
5
8
|
import { TablesAPI } from "./tables.js";
|
|
9
|
+
export { ConnectionsAPI } from "./connections.js";
|
|
10
|
+
export { ConnectorsAPI } from "./connectors.js";
|
|
6
11
|
export { DiscoveryAPI } from "./discovery.js";
|
|
12
|
+
export { KnowledgeBaseAPI } from "./knowledge_base.js";
|
|
7
13
|
export { TablesAPI } from "./tables.js";
|
|
8
14
|
export function createGeneratedApis(config, raw) {
|
|
9
15
|
return {
|
|
16
|
+
connections: new ConnectionsAPI(config, raw),
|
|
17
|
+
connectors: new ConnectorsAPI(config, raw),
|
|
10
18
|
discovery: new DiscoveryAPI(config, raw),
|
|
19
|
+
knowledge_base: new KnowledgeBaseAPI(config, raw),
|
|
11
20
|
tables: new TablesAPI(config, raw),
|
|
12
21
|
};
|
|
13
22
|
}
|
package/dist/api/agents.d.ts
CHANGED
|
@@ -9,7 +9,10 @@ type AgentJobStatus = components["schemas"]["AgentJobSingleStatus"];
|
|
|
9
9
|
type AgentJobBatchStatus = components["schemas"]["AgentJobStatus"];
|
|
10
10
|
type AgentJobResultItem = components["schemas"]["AgentJobResultItem"];
|
|
11
11
|
type AgentJobDeleteDataResponse = components["schemas"]["AgentJobDeleteDataResponse"];
|
|
12
|
+
type AgentJobCancelAllResponse = components["schemas"]["AgentJobCancelAllResponse"];
|
|
13
|
+
type AgentJobArtifactResult = components["schemas"]["AgentJobArtifactResult"];
|
|
12
14
|
type AgentDatum = components["schemas"]["AgentDatum"];
|
|
15
|
+
type MessageResponse = components["schemas"]["MessageResponse"];
|
|
13
16
|
export declare class AgentVersionsAPI {
|
|
14
17
|
private readonly agentsApi;
|
|
15
18
|
constructor(agentsApi: AgentsAPI);
|
|
@@ -29,6 +32,10 @@ export declare class AgentVersionsAPI {
|
|
|
29
32
|
versionName?: string;
|
|
30
33
|
description?: string;
|
|
31
34
|
}): Promise<void>;
|
|
35
|
+
replace(agentId: string, versionId: string, replacement: {
|
|
36
|
+
versionName?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
}): Promise<MessageResponse>;
|
|
32
39
|
delete(agentId: string, versionId: string): Promise<void>;
|
|
33
40
|
}
|
|
34
41
|
export declare class AgentJobsAPI {
|
|
@@ -43,7 +50,8 @@ export declare class AgentJobsAPI {
|
|
|
43
50
|
retrieveResultMany(jobIds: string[]): Promise<AgentJobResultItem[]>;
|
|
44
51
|
downloadReference(jobId: string, resourceId: string, asAttachment?: boolean): Promise<Buffer>;
|
|
45
52
|
cancel(jobId: string): Promise<void>;
|
|
46
|
-
cancelAll(agentId: string): Promise<
|
|
53
|
+
cancelAll(agentId: string): Promise<AgentJobCancelAllResponse>;
|
|
54
|
+
retrieveArtifact(jobId: string, artifactKey: string): Promise<AgentJobArtifactResult>;
|
|
47
55
|
deleteData(jobId: string): Promise<AgentJobDeleteDataResponse>;
|
|
48
56
|
private iterChunks;
|
|
49
57
|
}
|
|
@@ -72,6 +80,11 @@ export declare class AgentsAPI {
|
|
|
72
80
|
disableCache?: boolean;
|
|
73
81
|
cacheFailedJobs?: boolean;
|
|
74
82
|
}): Promise<BaseAgent>;
|
|
83
|
+
replace(agentId: string, replacement: {
|
|
84
|
+
name?: string;
|
|
85
|
+
disableCache?: boolean;
|
|
86
|
+
cacheFailedJobs?: boolean;
|
|
87
|
+
}): Promise<BaseAgent>;
|
|
75
88
|
delete(agentId: string): Promise<void>;
|
|
76
89
|
duplicate(agentId: string): Promise<AgentVersion>;
|
|
77
90
|
run(params: {
|
package/dist/api/agents.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isUuidString } from "../utils/fileDetection.js";
|
|
2
|
-
import { postDynamicInputs } from "../utils/dynamicInputs.js";
|
|
3
1
|
import { BadRequestError, RoeAPIException } from "../exceptions.js";
|
|
4
2
|
import { Job, JobBatch } from "../models/job.js";
|
|
3
|
+
import { postDynamicInputs } from "../utils/dynamicInputs.js";
|
|
4
|
+
import { isUuidString } from "../utils/fileDetection.js";
|
|
5
5
|
function validateUuid(value, fieldName) {
|
|
6
6
|
if (!isUuidString(value)) {
|
|
7
7
|
throw new BadRequestError(`Invalid ${fieldName}: "${value}" is not a valid UUID`, 400);
|
|
@@ -30,7 +30,9 @@ export class AgentVersionsAPI {
|
|
|
30
30
|
async retrieve(agentId, versionId, getSupportsEval) {
|
|
31
31
|
validateUuid(agentId, "agentId");
|
|
32
32
|
validateUuid(versionId, "versionId");
|
|
33
|
-
const query = {
|
|
33
|
+
const query = {
|
|
34
|
+
organization_id: this.organizationId,
|
|
35
|
+
};
|
|
34
36
|
if (getSupportsEval !== undefined)
|
|
35
37
|
query.get_supports_eval = String(getSupportsEval).toLowerCase();
|
|
36
38
|
const { data } = await this.raw.GET("/v1/agents/{agent_id}/versions/{agent_version_id}/", {
|
|
@@ -90,6 +92,23 @@ export class AgentVersionsAPI {
|
|
|
90
92
|
body,
|
|
91
93
|
});
|
|
92
94
|
}
|
|
95
|
+
async replace(agentId, versionId, replacement) {
|
|
96
|
+
validateUuid(agentId, "agentId");
|
|
97
|
+
validateUuid(versionId, "versionId");
|
|
98
|
+
const body = {};
|
|
99
|
+
if (replacement.versionName !== undefined)
|
|
100
|
+
body.version_name = replacement.versionName;
|
|
101
|
+
if (replacement.description !== undefined)
|
|
102
|
+
body.description = replacement.description;
|
|
103
|
+
const { data } = await this.raw.PUT("/v1/agents/{agent_id}/versions/{agent_version_id}/", {
|
|
104
|
+
params: {
|
|
105
|
+
path: { agent_id: agentId, agent_version_id: versionId },
|
|
106
|
+
query: { organization_id: this.organizationId },
|
|
107
|
+
},
|
|
108
|
+
body,
|
|
109
|
+
});
|
|
110
|
+
return data;
|
|
111
|
+
}
|
|
93
112
|
async delete(agentId, versionId) {
|
|
94
113
|
validateUuid(agentId, "agentId");
|
|
95
114
|
validateUuid(versionId, "versionId");
|
|
@@ -169,7 +188,9 @@ export class AgentJobsAPI {
|
|
|
169
188
|
// The endpoint streams binary; openapi-fetch's typed GET expects a JSON
|
|
170
189
|
// response per the spec, so we use parseAs:"arrayBuffer" to skip JSON
|
|
171
190
|
// parsing and read raw bytes.
|
|
172
|
-
const query = {
|
|
191
|
+
const query = {
|
|
192
|
+
organization_id: this.organizationId,
|
|
193
|
+
};
|
|
173
194
|
if (asAttachment)
|
|
174
195
|
query.download = "true";
|
|
175
196
|
const result = await this.raw.GET("/v1/agents/jobs/{agent_job_id}/references/{resource_id}/", {
|
|
@@ -193,12 +214,26 @@ export class AgentJobsAPI {
|
|
|
193
214
|
}
|
|
194
215
|
async cancelAll(agentId) {
|
|
195
216
|
validateUuid(agentId, "agentId");
|
|
196
|
-
await this.raw.POST("/v1/agents/{agent_id}/jobs/cancel-all/", {
|
|
217
|
+
const { data } = await this.raw.POST("/v1/agents/{agent_id}/jobs/cancel-all/", {
|
|
197
218
|
params: {
|
|
198
219
|
path: { agent_id: agentId },
|
|
199
220
|
query: { organization_id: this.organizationId },
|
|
200
221
|
},
|
|
201
222
|
});
|
|
223
|
+
return data;
|
|
224
|
+
}
|
|
225
|
+
async retrieveArtifact(jobId, artifactKey) {
|
|
226
|
+
validateUuid(jobId, "jobId");
|
|
227
|
+
const { data } = await this.raw.GET("/v1/agents/jobs/{agent_job_id}/artifacts/result/", {
|
|
228
|
+
params: {
|
|
229
|
+
path: { agent_job_id: jobId },
|
|
230
|
+
query: {
|
|
231
|
+
organization_id: this.organizationId,
|
|
232
|
+
artifact_key: artifactKey,
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
return data;
|
|
202
237
|
}
|
|
203
238
|
async deleteData(jobId) {
|
|
204
239
|
validateUuid(jobId, "jobId");
|
|
@@ -282,6 +317,24 @@ export class AgentsAPI {
|
|
|
282
317
|
});
|
|
283
318
|
return data;
|
|
284
319
|
}
|
|
320
|
+
async replace(agentId, replacement) {
|
|
321
|
+
validateUuid(agentId, "agentId");
|
|
322
|
+
const body = {};
|
|
323
|
+
if (replacement.name !== undefined)
|
|
324
|
+
body.name = replacement.name;
|
|
325
|
+
if (replacement.disableCache !== undefined)
|
|
326
|
+
body.disable_cache = replacement.disableCache;
|
|
327
|
+
if (replacement.cacheFailedJobs !== undefined)
|
|
328
|
+
body.cache_failed_jobs = replacement.cacheFailedJobs;
|
|
329
|
+
const { data } = await this.raw.PUT("/v1/agents/{agent_id}/", {
|
|
330
|
+
params: {
|
|
331
|
+
path: { agent_id: agentId },
|
|
332
|
+
query: { organization_id: this.config.organizationId },
|
|
333
|
+
},
|
|
334
|
+
body,
|
|
335
|
+
});
|
|
336
|
+
return data;
|
|
337
|
+
}
|
|
285
338
|
async delete(agentId) {
|
|
286
339
|
validateUuid(agentId, "agentId");
|
|
287
340
|
await this.raw.DELETE("/v1/agents/{agent_id}/", {
|
|
@@ -305,7 +358,11 @@ export class AgentsAPI {
|
|
|
305
358
|
validateUuid(params.agentId, "agentId");
|
|
306
359
|
const response = await postDynamicInputs(this.raw, "/v1/agents/run/{agent_id}/async/", { agent_id: params.agentId }, { organization_id: this.config.organizationId }, params.inputs, params.metadata, this.config.maxRetries);
|
|
307
360
|
const jobId = this.extractJobId(response);
|
|
308
|
-
return new Job({
|
|
361
|
+
return new Job({
|
|
362
|
+
agentsApi: this,
|
|
363
|
+
jobId,
|
|
364
|
+
timeoutSeconds: params.timeoutSeconds,
|
|
365
|
+
});
|
|
309
366
|
}
|
|
310
367
|
async runMany(params) {
|
|
311
368
|
validateUuid(params.agentId, "agentId");
|
|
@@ -328,7 +385,11 @@ export class AgentsAPI {
|
|
|
328
385
|
allJobIds.push(jobId);
|
|
329
386
|
}
|
|
330
387
|
}
|
|
331
|
-
return new JobBatch({
|
|
388
|
+
return new JobBatch({
|
|
389
|
+
agentsApi: this,
|
|
390
|
+
jobIds: allJobIds,
|
|
391
|
+
timeoutSeconds: params.timeoutSeconds,
|
|
392
|
+
});
|
|
332
393
|
}
|
|
333
394
|
async runSync(agentId, inputs, metadata) {
|
|
334
395
|
validateUuid(agentId, "agentId");
|
|
@@ -339,7 +400,11 @@ export class AgentsAPI {
|
|
|
339
400
|
validateUuid(params.versionId, "versionId");
|
|
340
401
|
const response = await postDynamicInputs(this.raw, "/v1/agents/run/{agent_id}/versions/{agent_version_id}/async/", { agent_id: params.agentId, agent_version_id: params.versionId }, { organization_id: this.config.organizationId }, params.inputs, params.metadata, this.config.maxRetries);
|
|
341
402
|
const jobId = this.extractJobId(response);
|
|
342
|
-
return new Job({
|
|
403
|
+
return new Job({
|
|
404
|
+
agentsApi: this,
|
|
405
|
+
jobId,
|
|
406
|
+
timeoutSeconds: params.timeoutSeconds,
|
|
407
|
+
});
|
|
343
408
|
}
|
|
344
409
|
async runVersionSync(agentId, versionId, inputs, metadata) {
|
|
345
410
|
validateUuid(agentId, "agentId");
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { RoeConfig } from "../config.js";
|
|
2
|
+
import type { RoeRawClient } from "../generated/client.js";
|
|
3
|
+
import type { components } from "../generated/schema.js";
|
|
4
|
+
type Connection = components["schemas"]["Connection"];
|
|
5
|
+
type CreateConnectionRequest = components["schemas"]["CreateConnectionRequest"];
|
|
6
|
+
type PaginatedConnectionListList = components["schemas"]["PaginatedConnectionListList"];
|
|
7
|
+
type TestConnection = components["schemas"]["TestConnection"];
|
|
8
|
+
type TestConnectionCredentialsRequest = components["schemas"]["TestConnectionCredentialsRequest"];
|
|
9
|
+
export declare class ConnectionsAPI {
|
|
10
|
+
readonly config: RoeConfig;
|
|
11
|
+
readonly raw: RoeRawClient;
|
|
12
|
+
/** API for managing external data connections. */
|
|
13
|
+
constructor(config: RoeConfig, raw: RoeRawClient);
|
|
14
|
+
protected get rawClient(): RoeRawClient;
|
|
15
|
+
protected get organizationId(): string;
|
|
16
|
+
/** List connections. */
|
|
17
|
+
list(params?: {
|
|
18
|
+
connectorType?: string;
|
|
19
|
+
search?: string;
|
|
20
|
+
page?: number;
|
|
21
|
+
pageSize?: number;
|
|
22
|
+
}): Promise<PaginatedConnectionListList>;
|
|
23
|
+
/** Create a connection. */
|
|
24
|
+
create(params: {
|
|
25
|
+
connectorType: CreateConnectionRequest["connector_type"];
|
|
26
|
+
name: string;
|
|
27
|
+
config: Record<string, unknown>;
|
|
28
|
+
description?: string;
|
|
29
|
+
authConfig?: Record<string, unknown>;
|
|
30
|
+
}): Promise<Connection>;
|
|
31
|
+
/** Test connection credentials without saving a connection. */
|
|
32
|
+
testCredentials(params: {
|
|
33
|
+
connectorType: TestConnectionCredentialsRequest["connector_type"];
|
|
34
|
+
config: Record<string, unknown>;
|
|
35
|
+
authConfig?: Record<string, unknown>;
|
|
36
|
+
}): Promise<TestConnection>;
|
|
37
|
+
/** Retrieve a connection. */
|
|
38
|
+
retrieve(connectionId: string): Promise<Connection>;
|
|
39
|
+
/** Update mutable connection fields. */
|
|
40
|
+
update(connectionId: string, updates: {
|
|
41
|
+
name?: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
config?: Record<string, unknown>;
|
|
44
|
+
authConfig?: Record<string, unknown>;
|
|
45
|
+
}): Promise<Connection>;
|
|
46
|
+
/** Replace a connection. */
|
|
47
|
+
replace(connectionId: string, replacement: {
|
|
48
|
+
name?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
config?: Record<string, unknown>;
|
|
51
|
+
authConfig?: Record<string, unknown>;
|
|
52
|
+
}): Promise<Connection>;
|
|
53
|
+
/** Delete a connection. */
|
|
54
|
+
delete(connectionId: string): Promise<void>;
|
|
55
|
+
/** Test a saved connection. */
|
|
56
|
+
test(connectionId: string): Promise<TestConnection>;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// Auto-generated friendly API facades for the Roe SDK.
|
|
2
|
+
// Generated by scripts/generate-sdk from openapi/wrappers.yml.
|
|
3
|
+
// Do not edit by hand.
|
|
4
|
+
export class ConnectionsAPI {
|
|
5
|
+
/** API for managing external data connections. */
|
|
6
|
+
constructor(config, raw) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
this.raw = raw;
|
|
9
|
+
}
|
|
10
|
+
get rawClient() {
|
|
11
|
+
return this.raw;
|
|
12
|
+
}
|
|
13
|
+
get organizationId() {
|
|
14
|
+
return this.config.organizationId;
|
|
15
|
+
}
|
|
16
|
+
/** List connections. */
|
|
17
|
+
async list(params) {
|
|
18
|
+
const { data } = await this.rawClient.GET("/v1/connections/", {
|
|
19
|
+
params: {
|
|
20
|
+
query: {
|
|
21
|
+
organization_id: this.organizationId,
|
|
22
|
+
...(params?.connectorType !== undefined
|
|
23
|
+
? { connector_type: params?.connectorType }
|
|
24
|
+
: {}),
|
|
25
|
+
...(params?.search !== undefined ? { search: params?.search } : {}),
|
|
26
|
+
...(params?.page !== undefined ? { page: params?.page } : {}),
|
|
27
|
+
...(params?.pageSize !== undefined
|
|
28
|
+
? { page_size: params?.pageSize }
|
|
29
|
+
: {}),
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
/** Create a connection. */
|
|
36
|
+
async create(params) {
|
|
37
|
+
const body = {
|
|
38
|
+
connector_type: params.connectorType,
|
|
39
|
+
name: params.name,
|
|
40
|
+
config: params.config,
|
|
41
|
+
...(params.description !== undefined
|
|
42
|
+
? { description: params.description }
|
|
43
|
+
: {}),
|
|
44
|
+
...(params.authConfig !== undefined
|
|
45
|
+
? { auth_config: params.authConfig }
|
|
46
|
+
: {}),
|
|
47
|
+
};
|
|
48
|
+
const { data } = await this.rawClient.POST("/v1/connections/", {
|
|
49
|
+
params: { query: { organization_id: this.organizationId } },
|
|
50
|
+
body,
|
|
51
|
+
});
|
|
52
|
+
return data;
|
|
53
|
+
}
|
|
54
|
+
/** Test connection credentials without saving a connection. */
|
|
55
|
+
async testCredentials(params) {
|
|
56
|
+
const body = {
|
|
57
|
+
connector_type: params.connectorType,
|
|
58
|
+
config: params.config,
|
|
59
|
+
...(params.authConfig !== undefined
|
|
60
|
+
? { auth_config: params.authConfig }
|
|
61
|
+
: {}),
|
|
62
|
+
};
|
|
63
|
+
const { data } = await this.rawClient.POST("/v1/connections/test-credentials/", { body });
|
|
64
|
+
return data;
|
|
65
|
+
}
|
|
66
|
+
/** Retrieve a connection. */
|
|
67
|
+
async retrieve(connectionId) {
|
|
68
|
+
const { data } = await this.rawClient.GET("/v1/connections/{id}/", {
|
|
69
|
+
params: {
|
|
70
|
+
path: { id: connectionId },
|
|
71
|
+
query: { organization_id: this.organizationId },
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
return data;
|
|
75
|
+
}
|
|
76
|
+
/** Update mutable connection fields. */
|
|
77
|
+
async update(connectionId, updates) {
|
|
78
|
+
const body = {
|
|
79
|
+
...(updates.name !== undefined ? { name: updates.name } : {}),
|
|
80
|
+
...(updates.description !== undefined
|
|
81
|
+
? { description: updates.description }
|
|
82
|
+
: {}),
|
|
83
|
+
...(updates.config !== undefined ? { config: updates.config } : {}),
|
|
84
|
+
...(updates.authConfig !== undefined
|
|
85
|
+
? { auth_config: updates.authConfig }
|
|
86
|
+
: {}),
|
|
87
|
+
};
|
|
88
|
+
const { data } = await this.rawClient.PATCH("/v1/connections/{id}/", {
|
|
89
|
+
params: {
|
|
90
|
+
path: { id: connectionId },
|
|
91
|
+
query: { organization_id: this.organizationId },
|
|
92
|
+
},
|
|
93
|
+
body,
|
|
94
|
+
});
|
|
95
|
+
return data;
|
|
96
|
+
}
|
|
97
|
+
/** Replace a connection. */
|
|
98
|
+
async replace(connectionId, replacement) {
|
|
99
|
+
const body = {
|
|
100
|
+
...(replacement.name !== undefined ? { name: replacement.name } : {}),
|
|
101
|
+
...(replacement.description !== undefined
|
|
102
|
+
? { description: replacement.description }
|
|
103
|
+
: {}),
|
|
104
|
+
...(replacement.config !== undefined
|
|
105
|
+
? { config: replacement.config }
|
|
106
|
+
: {}),
|
|
107
|
+
...(replacement.authConfig !== undefined
|
|
108
|
+
? { auth_config: replacement.authConfig }
|
|
109
|
+
: {}),
|
|
110
|
+
};
|
|
111
|
+
const { data } = await this.rawClient.PUT("/v1/connections/{id}/", {
|
|
112
|
+
params: {
|
|
113
|
+
path: { id: connectionId },
|
|
114
|
+
query: { organization_id: this.organizationId },
|
|
115
|
+
},
|
|
116
|
+
body,
|
|
117
|
+
});
|
|
118
|
+
return data;
|
|
119
|
+
}
|
|
120
|
+
/** Delete a connection. */
|
|
121
|
+
async delete(connectionId) {
|
|
122
|
+
await this.rawClient.DELETE("/v1/connections/{id}/", {
|
|
123
|
+
params: {
|
|
124
|
+
path: { id: connectionId },
|
|
125
|
+
query: { organization_id: this.organizationId },
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/** Test a saved connection. */
|
|
130
|
+
async test(connectionId) {
|
|
131
|
+
const { data } = await this.rawClient.POST("/v1/connections/{id}/test/", {
|
|
132
|
+
params: {
|
|
133
|
+
path: { id: connectionId },
|
|
134
|
+
query: { organization_id: this.organizationId },
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
return data;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RoeConfig } from "../config.js";
|
|
2
|
+
import type { RoeRawClient } from "../generated/client.js";
|
|
3
|
+
import type { components } from "../generated/schema.js";
|
|
4
|
+
type ConnectorListResponse = components["schemas"]["ConnectorListResponse"];
|
|
5
|
+
type ConnectorMetadata = components["schemas"]["ConnectorMetadata"];
|
|
6
|
+
export declare class ConnectorsAPI {
|
|
7
|
+
readonly config: RoeConfig;
|
|
8
|
+
readonly raw: RoeRawClient;
|
|
9
|
+
/** API for discovering available connector types. */
|
|
10
|
+
constructor(config: RoeConfig, raw: RoeRawClient);
|
|
11
|
+
protected get rawClient(): RoeRawClient;
|
|
12
|
+
protected get organizationId(): string;
|
|
13
|
+
/** List available connector types. */
|
|
14
|
+
list(): Promise<ConnectorListResponse>;
|
|
15
|
+
/** Retrieve metadata for a connector type. */
|
|
16
|
+
retrieve(connectorType: string): Promise<ConnectorMetadata>;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Auto-generated friendly API facades for the Roe SDK.
|
|
2
|
+
// Generated by scripts/generate-sdk from openapi/wrappers.yml.
|
|
3
|
+
// Do not edit by hand.
|
|
4
|
+
export class ConnectorsAPI {
|
|
5
|
+
/** API for discovering available connector types. */
|
|
6
|
+
constructor(config, raw) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
this.raw = raw;
|
|
9
|
+
}
|
|
10
|
+
get rawClient() {
|
|
11
|
+
return this.raw;
|
|
12
|
+
}
|
|
13
|
+
get organizationId() {
|
|
14
|
+
return this.config.organizationId;
|
|
15
|
+
}
|
|
16
|
+
/** List available connector types. */
|
|
17
|
+
async list() {
|
|
18
|
+
const { data } = await this.rawClient.GET("/v1/connectors/", {});
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
/** Retrieve metadata for a connector type. */
|
|
22
|
+
async retrieve(connectorType) {
|
|
23
|
+
const { data } = await this.rawClient.GET("/v1/connectors/{connector_type}/", { params: { path: { connector_type: connectorType } } });
|
|
24
|
+
return data;
|
|
25
|
+
}
|
|
26
|
+
}
|
package/dist/api/discovery.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export declare class DiscoveryAPI {
|
|
|
8
8
|
readonly raw: RoeRawClient;
|
|
9
9
|
/** API for discovering valid agent engine types and model IDs. */
|
|
10
10
|
constructor(config: RoeConfig, raw: RoeRawClient);
|
|
11
|
+
protected get rawClient(): RoeRawClient;
|
|
12
|
+
protected get organizationId(): string;
|
|
11
13
|
/** Return production engine_class_id values accepted by agent creation. */
|
|
12
14
|
listAgentEngineTypes(): Promise<AgentEngineTypeList>;
|
|
13
15
|
/** Return non-deprecated model IDs accepted in engine_config.model. */
|
package/dist/api/discovery.js
CHANGED
|
@@ -8,6 +8,12 @@ export class DiscoveryAPI {
|
|
|
8
8
|
this.config = config;
|
|
9
9
|
this.raw = raw;
|
|
10
10
|
}
|
|
11
|
+
get rawClient() {
|
|
12
|
+
return this.raw;
|
|
13
|
+
}
|
|
14
|
+
get organizationId() {
|
|
15
|
+
return this.config.organizationId;
|
|
16
|
+
}
|
|
11
17
|
/** Return production engine_class_id values accepted by agent creation. */
|
|
12
18
|
async listAgentEngineTypes() {
|
|
13
19
|
const result = await this.raw.GET("/v1/agents/types/");
|