@amigo-ai/platform-sdk 0.85.0 → 0.85.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 CHANGED
@@ -570,4 +570,15 @@ All workspace-scoped resources also expose `withOptions(options)`.
570
570
  - `delete`
571
571
  - `invoke`
572
572
 
573
+ ### `useCases`
574
+
575
+ - `list`
576
+ - `listOwned`
577
+ - `getOwnership`
578
+ - `assignOwnership`
579
+ - `releaseOwnership`
580
+ - `getServiceBinding`
581
+ - `bindToService`
582
+ - `unbindFromService`
583
+
573
584
  ### `api`
package/dist/index.cjs CHANGED
@@ -60,6 +60,7 @@ __export(index_exports, {
60
60
  TTS_PROVIDERS: () => TTS_PROVIDERS,
61
61
  TokenManager: () => TokenManager,
62
62
  TokensResource: () => TokensResource,
63
+ UseCasesResource: () => UseCasesResource,
63
64
  VOICE_SESSION_PROVIDERS: () => VOICE_SESSION_PROVIDERS,
64
65
  ValidationError: () => ValidationError,
65
66
  WebhookVerificationError: () => WebhookVerificationError,
@@ -5447,6 +5448,71 @@ var WorkspaceDataQueriesResource = class extends WorkspaceScopedResource {
5447
5448
  }
5448
5449
  };
5449
5450
 
5451
+ // src/resources/use-cases.ts
5452
+ var UseCasesResource = class extends WorkspaceScopedResource {
5453
+ /** List use cases in the workspace, optionally filtered by entity/channel/setup. */
5454
+ async list(params) {
5455
+ return extractData(
5456
+ await this.client.GET("/v1/{workspace_id}/use-cases", {
5457
+ params: { path: { workspace_id: this.workspaceId }, query: params }
5458
+ })
5459
+ );
5460
+ }
5461
+ /** List channel-manager use case IDs owned by the current workspace. */
5462
+ async listOwned() {
5463
+ return extractData(
5464
+ await this.client.GET("/v1/{workspace_id}/use-cases/ownership", {
5465
+ params: { path: { workspace_id: this.workspaceId } }
5466
+ })
5467
+ );
5468
+ }
5469
+ /** Return this workspace's ownership record for a use case. Throws NotFoundError if unowned. */
5470
+ async getOwnership(useCaseId) {
5471
+ return extractData(
5472
+ await this.client.GET("/v1/{workspace_id}/use-cases/{use_case_id}/ownership", {
5473
+ params: { path: { workspace_id: this.workspaceId, use_case_id: useCaseId } }
5474
+ })
5475
+ );
5476
+ }
5477
+ /** Claim ownership of a channel-manager use case for this workspace. */
5478
+ async assignOwnership(useCaseId) {
5479
+ return extractData(
5480
+ await this.client.PUT("/v1/{workspace_id}/use-cases/{use_case_id}/ownership", {
5481
+ params: { path: { workspace_id: this.workspaceId, use_case_id: useCaseId } }
5482
+ })
5483
+ );
5484
+ }
5485
+ /** Release this workspace's ownership of a use case after unbinding services. */
5486
+ async releaseOwnership(useCaseId) {
5487
+ await this.client.DELETE("/v1/{workspace_id}/use-cases/{use_case_id}/ownership", {
5488
+ params: { path: { workspace_id: this.workspaceId, use_case_id: useCaseId } }
5489
+ });
5490
+ }
5491
+ /** Return the service currently bound to a use case. Throws NotFoundError if unbound. */
5492
+ async getServiceBinding(useCaseId) {
5493
+ return extractData(
5494
+ await this.client.GET("/v1/{workspace_id}/use-cases/{use_case_id}/service-binding", {
5495
+ params: { path: { workspace_id: this.workspaceId, use_case_id: useCaseId } }
5496
+ })
5497
+ );
5498
+ }
5499
+ /** Bind or rebind a use case to the platform service that should handle its traffic. */
5500
+ async bindToService(useCaseId, body) {
5501
+ return extractData(
5502
+ await this.client.PUT("/v1/{workspace_id}/use-cases/{use_case_id}/service-binding", {
5503
+ params: { path: { workspace_id: this.workspaceId, use_case_id: useCaseId } },
5504
+ body
5505
+ })
5506
+ );
5507
+ }
5508
+ /** Release a use case from its currently bound platform service. */
5509
+ async unbindFromService(useCaseId) {
5510
+ await this.client.DELETE("/v1/{workspace_id}/use-cases/{use_case_id}/service-binding", {
5511
+ params: { path: { workspace_id: this.workspaceId, use_case_id: useCaseId } }
5512
+ });
5513
+ }
5514
+ };
5515
+
5450
5516
  // src/core/branded-types.ts
5451
5517
  var workspaceId = (id) => id;
5452
5518
  var apiKeyId = (id) => id;
@@ -6173,6 +6239,8 @@ var AmigoClient = class _AmigoClient {
6173
6239
  workspaceDatabase;
6174
6240
  /** Workspace data queries — Lakebase-backed query tool registry */
6175
6241
  workspaceDataQueries;
6242
+ /** Channel use cases and service bindings */
6243
+ useCases;
6176
6244
  /** @internal — exposed for path-level type inference in GET/POST/PUT/etc. */
6177
6245
  api;
6178
6246
  constructor(config) {
@@ -6289,6 +6357,7 @@ var AmigoClient = class _AmigoClient {
6289
6357
  mutable.sessions = new SessionsResource(client, workspaceId2);
6290
6358
  mutable.workspaceDatabase = new WorkspaceDatabaseResource(client, workspaceId2);
6291
6359
  mutable.workspaceDataQueries = new WorkspaceDataQueriesResource(client, workspaceId2);
6360
+ mutable.useCases = new UseCasesResource(client, workspaceId2);
6292
6361
  }
6293
6362
  async resolveApiRequest(path, method, init) {
6294
6363
  const { baseClient, options } = resolveScopedPlatformClient(this.api);