@amigo-ai/platform-sdk 0.46.0 → 0.47.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/api.md +13 -0
- package/dist/index.cjs +77 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +77 -0
- package/dist/index.mjs.map +3 -3
- package/dist/resources/workspace-database.js +60 -0
- package/dist/resources/workspace-database.js.map +1 -0
- package/dist/types/generated/api.d.ts +906 -13
- package/dist/types/generated/api.d.ts.map +1 -1
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/resources/functions.d.ts.map +1 -1
- package/dist/types/resources/intake.d.ts.map +1 -1
- package/dist/types/resources/metrics.d.ts.map +1 -1
- package/dist/types/resources/operators.d.ts.map +1 -1
- package/dist/types/resources/settings.d.ts.map +1 -1
- package/dist/types/resources/surfaces.d.ts.map +1 -1
- package/dist/types/resources/workspace-database.d.ts +93 -0
- package/dist/types/resources/workspace-database.d.ts.map +1 -0
- package/package.json +1 -1
package/api.md
CHANGED
|
@@ -629,4 +629,17 @@ All workspace-scoped resources also expose `withOptions(options)`.
|
|
|
629
629
|
- `listActive`
|
|
630
630
|
- `inject`
|
|
631
631
|
|
|
632
|
+
### `workspaceDatabase`
|
|
633
|
+
|
|
634
|
+
- `getFork`
|
|
635
|
+
- `createFork`
|
|
636
|
+
- `deleteFork`
|
|
637
|
+
- `executeQuery`
|
|
638
|
+
- `listQueryTools`
|
|
639
|
+
- `listQueryToolsAutoPaging`
|
|
640
|
+
- `createQueryTool`
|
|
641
|
+
- `updateQueryTool`
|
|
642
|
+
- `deleteQueryTool`
|
|
643
|
+
- `testQueryTool`
|
|
644
|
+
|
|
632
645
|
### `api`
|
package/dist/index.cjs
CHANGED
|
@@ -5680,6 +5680,80 @@ var SessionsResource = class extends WorkspaceScopedResource {
|
|
|
5680
5680
|
}
|
|
5681
5681
|
};
|
|
5682
5682
|
|
|
5683
|
+
// src/resources/workspace-database.ts
|
|
5684
|
+
var WorkspaceDatabaseResource = class extends WorkspaceScopedResource {
|
|
5685
|
+
// -- Fork lifecycle -------------------------------------------------------
|
|
5686
|
+
async getFork() {
|
|
5687
|
+
return extractData(
|
|
5688
|
+
await this.client.GET("/v1/{workspace_id}/fork", {
|
|
5689
|
+
params: { path: { workspace_id: this.workspaceId } }
|
|
5690
|
+
})
|
|
5691
|
+
);
|
|
5692
|
+
}
|
|
5693
|
+
async createFork(body) {
|
|
5694
|
+
return extractData(
|
|
5695
|
+
await this.client.POST("/v1/{workspace_id}/fork", {
|
|
5696
|
+
params: { path: { workspace_id: this.workspaceId } },
|
|
5697
|
+
body
|
|
5698
|
+
})
|
|
5699
|
+
);
|
|
5700
|
+
}
|
|
5701
|
+
async deleteFork() {
|
|
5702
|
+
await this.client.DELETE("/v1/{workspace_id}/fork", {
|
|
5703
|
+
params: { path: { workspace_id: this.workspaceId } }
|
|
5704
|
+
});
|
|
5705
|
+
}
|
|
5706
|
+
// -- Query execution ------------------------------------------------------
|
|
5707
|
+
async executeQuery(body) {
|
|
5708
|
+
return extractData(
|
|
5709
|
+
await this.client.POST("/v1/{workspace_id}/lakebase/query", {
|
|
5710
|
+
params: { path: { workspace_id: this.workspaceId } },
|
|
5711
|
+
body
|
|
5712
|
+
})
|
|
5713
|
+
);
|
|
5714
|
+
}
|
|
5715
|
+
// -- Query tool CRUD ------------------------------------------------------
|
|
5716
|
+
async listQueryTools(params) {
|
|
5717
|
+
return extractData(
|
|
5718
|
+
await this.client.GET("/v1/{workspace_id}/query-tools", {
|
|
5719
|
+
params: { path: { workspace_id: this.workspaceId }, query: params }
|
|
5720
|
+
})
|
|
5721
|
+
);
|
|
5722
|
+
}
|
|
5723
|
+
listQueryToolsAutoPaging(params) {
|
|
5724
|
+
return this.iteratePaginatedList((pageParams) => this.listQueryTools(pageParams), params);
|
|
5725
|
+
}
|
|
5726
|
+
async createQueryTool(body) {
|
|
5727
|
+
return extractData(
|
|
5728
|
+
await this.client.POST("/v1/{workspace_id}/query-tools", {
|
|
5729
|
+
params: { path: { workspace_id: this.workspaceId } },
|
|
5730
|
+
body
|
|
5731
|
+
})
|
|
5732
|
+
);
|
|
5733
|
+
}
|
|
5734
|
+
async updateQueryTool(toolId, body) {
|
|
5735
|
+
return extractData(
|
|
5736
|
+
await this.client.PATCH("/v1/{workspace_id}/query-tools/{tool_id}", {
|
|
5737
|
+
params: { path: { workspace_id: this.workspaceId, tool_id: toolId } },
|
|
5738
|
+
body
|
|
5739
|
+
})
|
|
5740
|
+
);
|
|
5741
|
+
}
|
|
5742
|
+
async deleteQueryTool(toolId) {
|
|
5743
|
+
await this.client.DELETE("/v1/{workspace_id}/query-tools/{tool_id}", {
|
|
5744
|
+
params: { path: { workspace_id: this.workspaceId, tool_id: toolId } }
|
|
5745
|
+
});
|
|
5746
|
+
}
|
|
5747
|
+
async testQueryTool(toolId, body) {
|
|
5748
|
+
return extractData(
|
|
5749
|
+
await this.client.POST("/v1/{workspace_id}/query-tools/{tool_id}/test", {
|
|
5750
|
+
params: { path: { workspace_id: this.workspaceId, tool_id: toolId } },
|
|
5751
|
+
body
|
|
5752
|
+
})
|
|
5753
|
+
);
|
|
5754
|
+
}
|
|
5755
|
+
};
|
|
5756
|
+
|
|
5683
5757
|
// src/core/branded-types.ts
|
|
5684
5758
|
var workspaceId = (id) => id;
|
|
5685
5759
|
var apiKeyId = (id) => id;
|
|
@@ -6386,6 +6460,8 @@ var AmigoClient = class _AmigoClient {
|
|
|
6386
6460
|
surfaces;
|
|
6387
6461
|
/** Live agent sessions — list active calls + inject mid-call directives */
|
|
6388
6462
|
sessions;
|
|
6463
|
+
/** Workspace database — Lakebase fork lifecycle, SQL query execution, query tool CRUD */
|
|
6464
|
+
workspaceDatabase;
|
|
6389
6465
|
/** @internal — exposed for path-level type inference in GET/POST/PUT/etc. */
|
|
6390
6466
|
api;
|
|
6391
6467
|
constructor(config) {
|
|
@@ -6507,6 +6583,7 @@ var AmigoClient = class _AmigoClient {
|
|
|
6507
6583
|
mutable.tools = new ToolsResource(client, workspaceId2);
|
|
6508
6584
|
mutable.surfaces = new SurfacesResource(client, workspaceId2);
|
|
6509
6585
|
mutable.sessions = new SessionsResource(client, workspaceId2);
|
|
6586
|
+
mutable.workspaceDatabase = new WorkspaceDatabaseResource(client, workspaceId2);
|
|
6510
6587
|
}
|
|
6511
6588
|
async resolveApiRequest(path, method, init) {
|
|
6512
6589
|
const { baseClient, options } = resolveScopedPlatformClient(this.api);
|