@amigo-ai/platform-sdk 0.41.0 → 0.44.0
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 +98 -0
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +98 -0
- package/dist/index.mjs.map +4 -4
- package/dist/resources/channels/index.js +27 -0
- package/dist/resources/channels/index.js.map +1 -0
- package/dist/resources/channels/ses-setup.js +79 -0
- package/dist/resources/channels/ses-setup.js.map +1 -0
- package/dist/resources/functions.js +8 -0
- package/dist/resources/functions.js.map +1 -1
- package/dist/types/generated/api.d.ts +57 -1
- package/dist/types/generated/api.d.ts.map +1 -1
- package/dist/types/index.d.cts +4 -0
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/resources/channels/index.d.ts +26 -0
- package/dist/types/resources/channels/index.d.ts.map +1 -0
- package/dist/types/resources/channels/ses-setup.d.ts +61 -0
- package/dist/types/resources/channels/ses-setup.d.ts.map +1 -0
- package/dist/types/resources/functions.d.ts +9 -6
- 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/package.json +1 -1
package/api.md
CHANGED
|
@@ -256,6 +256,17 @@ All workspace-scoped resources also expose `withOptions(options)`.
|
|
|
256
256
|
- `textStreamUrl`
|
|
257
257
|
- `sessionConnectUrl`
|
|
258
258
|
|
|
259
|
+
### `channels`
|
|
260
|
+
|
|
261
|
+
**`channels.sesSetup`**
|
|
262
|
+
|
|
263
|
+
- `create`
|
|
264
|
+
- `list`
|
|
265
|
+
- `listAutoPaging`
|
|
266
|
+
- `get`
|
|
267
|
+
- `verify`
|
|
268
|
+
- `delete`
|
|
269
|
+
|
|
259
270
|
### `phoneNumbers`
|
|
260
271
|
|
|
261
272
|
- `provision`
|
|
@@ -451,6 +462,8 @@ All workspace-scoped resources also expose `withOptions(options)`.
|
|
|
451
462
|
|
|
452
463
|
### `events`
|
|
453
464
|
|
|
465
|
+
- `subscribeToWorkspace`
|
|
466
|
+
|
|
454
467
|
### `functions`
|
|
455
468
|
|
|
456
469
|
- `list`
|
package/dist/index.cjs
CHANGED
|
@@ -34,6 +34,7 @@ __export(index_exports, {
|
|
|
34
34
|
AmigoError: () => AmigoError,
|
|
35
35
|
AuthenticationError: () => AuthenticationError,
|
|
36
36
|
BadRequestError: () => BadRequestError,
|
|
37
|
+
ChannelsResource: () => ChannelsResource,
|
|
37
38
|
ConfigurationError: () => ConfigurationError,
|
|
38
39
|
ConflictError: () => ConflictError,
|
|
39
40
|
DEFAULT_BASE_URL: () => DEFAULT_BASE_URL,
|
|
@@ -53,6 +54,7 @@ __export(index_exports, {
|
|
|
53
54
|
RequestTimeoutError: () => RequestTimeoutError,
|
|
54
55
|
ServerError: () => ServerError,
|
|
55
56
|
ServiceUnavailableError: () => ServiceUnavailableError,
|
|
57
|
+
SesSetupResource: () => SesSetupResource,
|
|
56
58
|
TokenManager: () => TokenManager,
|
|
57
59
|
ValidationError: () => ValidationError,
|
|
58
60
|
WebhookVerificationError: () => WebhookVerificationError,
|
|
@@ -2561,6 +2563,92 @@ function parseTurnStreamFrame(eventName, dataJson) {
|
|
|
2561
2563
|
return { ...payload, event: eventName };
|
|
2562
2564
|
}
|
|
2563
2565
|
|
|
2566
|
+
// src/resources/channels/ses-setup.ts
|
|
2567
|
+
var SesSetupResource = class extends WorkspaceScopedResource {
|
|
2568
|
+
/**
|
|
2569
|
+
* Create an SES tenant + verified domain identity for this workspace.
|
|
2570
|
+
*
|
|
2571
|
+
* Returns the DNS records the customer must publish at their DNS provider.
|
|
2572
|
+
* The setup is unusable for sending until every record's ``verified`` flag
|
|
2573
|
+
* flips to ``true`` (call ``verify`` after publishing DNS to refresh).
|
|
2574
|
+
*/
|
|
2575
|
+
async create(body) {
|
|
2576
|
+
return extractData(
|
|
2577
|
+
await this.client.POST("/v1/{workspace_id}/channels/ses-setup", {
|
|
2578
|
+
params: { path: { workspace_id: this.workspaceId } },
|
|
2579
|
+
body
|
|
2580
|
+
})
|
|
2581
|
+
);
|
|
2582
|
+
}
|
|
2583
|
+
/**
|
|
2584
|
+
* List SES setups owned by this workspace.
|
|
2585
|
+
*
|
|
2586
|
+
* Each item carries the cached ``dns_verified`` aggregate; call ``get``
|
|
2587
|
+
* for per-record DNS detail.
|
|
2588
|
+
*/
|
|
2589
|
+
async list(params) {
|
|
2590
|
+
return extractData(
|
|
2591
|
+
await this.client.GET("/v1/{workspace_id}/channels/ses-setup", {
|
|
2592
|
+
params: { path: { workspace_id: this.workspaceId }, query: params }
|
|
2593
|
+
})
|
|
2594
|
+
);
|
|
2595
|
+
}
|
|
2596
|
+
/** Auto-paginating async iterable over every SES setup in the workspace. */
|
|
2597
|
+
listAutoPaging(params) {
|
|
2598
|
+
return this.iteratePaginatedList((pageParams) => this.list(pageParams), params);
|
|
2599
|
+
}
|
|
2600
|
+
/**
|
|
2601
|
+
* Get an SES setup with a live DNS verification refresh.
|
|
2602
|
+
*
|
|
2603
|
+
* Channel-manager re-runs ``GetEmailIdentity`` + DMARC/MX resolvers on
|
|
2604
|
+
* every call, so each ``get`` is a live check rather than a cache read.
|
|
2605
|
+
*/
|
|
2606
|
+
async get(setupId) {
|
|
2607
|
+
return extractData(
|
|
2608
|
+
await this.client.GET("/v1/{workspace_id}/channels/ses-setup/{setup_id}", {
|
|
2609
|
+
params: { path: { workspace_id: this.workspaceId, setup_id: setupId } }
|
|
2610
|
+
})
|
|
2611
|
+
);
|
|
2612
|
+
}
|
|
2613
|
+
/**
|
|
2614
|
+
* Explicit DNS refresh — equivalent to ``get`` but exposed as a POST so UI
|
|
2615
|
+
* "Verify now" actions read as actions rather than reads.
|
|
2616
|
+
*/
|
|
2617
|
+
async verify(setupId) {
|
|
2618
|
+
return extractData(
|
|
2619
|
+
await this.client.POST("/v1/{workspace_id}/channels/ses-setup/{setup_id}/verify", {
|
|
2620
|
+
params: { path: { workspace_id: this.workspaceId, setup_id: setupId } }
|
|
2621
|
+
})
|
|
2622
|
+
);
|
|
2623
|
+
}
|
|
2624
|
+
/**
|
|
2625
|
+
* Tear down the upstream SES tenant + identity and soft-delete the
|
|
2626
|
+
* workspace binding. Throws ``ConflictError`` (HTTP 409) if any use case
|
|
2627
|
+
* still references the setup — delete those use cases first.
|
|
2628
|
+
*
|
|
2629
|
+
* Routed through ``extractData`` so 4xx/5xx responses surface as typed
|
|
2630
|
+
* SDK errors (matching every other resource's ``delete``); the
|
|
2631
|
+
* ``ConflictError`` mapping fires here instead of relying on the
|
|
2632
|
+
* underlying client's accidental throw.
|
|
2633
|
+
*/
|
|
2634
|
+
async delete(setupId) {
|
|
2635
|
+
return extractData(
|
|
2636
|
+
await this.client.DELETE("/v1/{workspace_id}/channels/ses-setup/{setup_id}", {
|
|
2637
|
+
params: { path: { workspace_id: this.workspaceId, setup_id: setupId } }
|
|
2638
|
+
})
|
|
2639
|
+
);
|
|
2640
|
+
}
|
|
2641
|
+
};
|
|
2642
|
+
|
|
2643
|
+
// src/resources/channels/index.ts
|
|
2644
|
+
var ChannelsResource = class extends WorkspaceScopedResource {
|
|
2645
|
+
sesSetup;
|
|
2646
|
+
constructor(client, workspaceId2) {
|
|
2647
|
+
super(client, workspaceId2);
|
|
2648
|
+
this.sesSetup = new SesSetupResource(client, workspaceId2);
|
|
2649
|
+
}
|
|
2650
|
+
};
|
|
2651
|
+
|
|
2564
2652
|
// src/resources/phone-numbers.ts
|
|
2565
2653
|
var PhoneNumbersResource = class extends WorkspaceScopedResource {
|
|
2566
2654
|
/** Create a new phone number */
|
|
@@ -4301,6 +4389,14 @@ var FunctionsResource = class extends WorkspaceScopedResource {
|
|
|
4301
4389
|
* Test invoke — same as ``invoke`` plus persists ``last_test_*``
|
|
4302
4390
|
* telemetry on the version row so the DC tool list can show
|
|
4303
4391
|
* health without re-running.
|
|
4392
|
+
*
|
|
4393
|
+
* Returns :type:`TestInvokeResponse` (superset of `InvokeResponse`)
|
|
4394
|
+
* so callers can read ``status`` / ``error`` / ``test_duration_ms``
|
|
4395
|
+
* directly off the response. The platform-api route catches
|
|
4396
|
+
* ``ServiceUnavailableError`` and converts it into ``status='fail'``
|
|
4397
|
+
* with the executor's error string in ``error`` — so even on a
|
|
4398
|
+
* blown-up SQL execution the response is a 200 with the failure
|
|
4399
|
+
* detail surfaced to the caller.
|
|
4304
4400
|
*/
|
|
4305
4401
|
async testV2(functionName, body) {
|
|
4306
4402
|
return extractData(
|
|
@@ -6232,6 +6328,7 @@ var AmigoClient = class _AmigoClient {
|
|
|
6232
6328
|
world;
|
|
6233
6329
|
calls;
|
|
6234
6330
|
conversations;
|
|
6331
|
+
channels;
|
|
6235
6332
|
phoneNumbers;
|
|
6236
6333
|
integrations;
|
|
6237
6334
|
analytics;
|
|
@@ -6374,6 +6471,7 @@ var AmigoClient = class _AmigoClient {
|
|
|
6374
6471
|
mutable.world = new WorldResource(client, workspaceId2);
|
|
6375
6472
|
mutable.calls = new CallsResource(client, workspaceId2);
|
|
6376
6473
|
mutable.conversations = new ConversationsResource(client, workspaceId2, agentBaseUrl);
|
|
6474
|
+
mutable.channels = new ChannelsResource(client, workspaceId2);
|
|
6377
6475
|
mutable.phoneNumbers = new PhoneNumbersResource(client, workspaceId2);
|
|
6378
6476
|
mutable.integrations = new IntegrationsResource(client, workspaceId2);
|
|
6379
6477
|
mutable.analytics = new AnalyticsResource(client, workspaceId2);
|