@amigo-ai/platform-sdk 0.41.0 → 0.43.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 +90 -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 +90 -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/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/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 */
|
|
@@ -6232,6 +6320,7 @@ var AmigoClient = class _AmigoClient {
|
|
|
6232
6320
|
world;
|
|
6233
6321
|
calls;
|
|
6234
6322
|
conversations;
|
|
6323
|
+
channels;
|
|
6235
6324
|
phoneNumbers;
|
|
6236
6325
|
integrations;
|
|
6237
6326
|
analytics;
|
|
@@ -6374,6 +6463,7 @@ var AmigoClient = class _AmigoClient {
|
|
|
6374
6463
|
mutable.world = new WorldResource(client, workspaceId2);
|
|
6375
6464
|
mutable.calls = new CallsResource(client, workspaceId2);
|
|
6376
6465
|
mutable.conversations = new ConversationsResource(client, workspaceId2, agentBaseUrl);
|
|
6466
|
+
mutable.channels = new ChannelsResource(client, workspaceId2);
|
|
6377
6467
|
mutable.phoneNumbers = new PhoneNumbersResource(client, workspaceId2);
|
|
6378
6468
|
mutable.integrations = new IntegrationsResource(client, workspaceId2);
|
|
6379
6469
|
mutable.analytics = new AnalyticsResource(client, workspaceId2);
|