@amigo-ai/platform-sdk 0.40.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 +18 -0
- package/dist/index.cjs +142 -0
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +142 -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/prompt-logs.js +86 -0
- package/dist/resources/prompt-logs.js.map +1 -0
- package/dist/types/index.d.cts +7 -1
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +7 -1
- 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/prompt-logs.d.ts +76 -0
- package/dist/types/resources/prompt-logs.d.ts.map +1 -0
- package/package.json +1 -1
package/api.md
CHANGED
|
@@ -149,6 +149,11 @@ All workspace-scoped resources also expose `withOptions(options)`.
|
|
|
149
149
|
- `getAuditLog`
|
|
150
150
|
- `getAuditLogAutoPaging`
|
|
151
151
|
|
|
152
|
+
### `promptLogs`
|
|
153
|
+
|
|
154
|
+
- `list`
|
|
155
|
+
- `listAutoPaging`
|
|
156
|
+
|
|
152
157
|
### `triggers`
|
|
153
158
|
|
|
154
159
|
- `list`
|
|
@@ -251,6 +256,17 @@ All workspace-scoped resources also expose `withOptions(options)`.
|
|
|
251
256
|
- `textStreamUrl`
|
|
252
257
|
- `sessionConnectUrl`
|
|
253
258
|
|
|
259
|
+
### `channels`
|
|
260
|
+
|
|
261
|
+
**`channels.sesSetup`**
|
|
262
|
+
|
|
263
|
+
- `create`
|
|
264
|
+
- `list`
|
|
265
|
+
- `listAutoPaging`
|
|
266
|
+
- `get`
|
|
267
|
+
- `verify`
|
|
268
|
+
- `delete`
|
|
269
|
+
|
|
254
270
|
### `phoneNumbers`
|
|
255
271
|
|
|
256
272
|
- `provision`
|
|
@@ -446,6 +462,8 @@ All workspace-scoped resources also expose `withOptions(options)`.
|
|
|
446
462
|
|
|
447
463
|
### `events`
|
|
448
464
|
|
|
465
|
+
- `subscribeToWorkspace`
|
|
466
|
+
|
|
449
467
|
### `functions`
|
|
450
468
|
|
|
451
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,
|
|
@@ -1519,6 +1521,56 @@ var OperatorsResource = class extends WorkspaceScopedResource {
|
|
|
1519
1521
|
}
|
|
1520
1522
|
};
|
|
1521
1523
|
|
|
1524
|
+
// src/resources/prompt-logs.ts
|
|
1525
|
+
var PromptLogsResource = class extends WorkspaceScopedResource {
|
|
1526
|
+
/**
|
|
1527
|
+
* One page of prompt-log entries, newest-first.
|
|
1528
|
+
*
|
|
1529
|
+
* When ``params.conversation_id`` is supplied, the response surfaces
|
|
1530
|
+
* ``resolved_call_sid`` (the call_sid the lookup mapped to) and
|
|
1531
|
+
* ``resolved_conversation_kind`` (``"call"`` for voice/sim/scribe,
|
|
1532
|
+
* ``"conversation"`` for text/sms/whatsapp/email) so you can drill
|
|
1533
|
+
* into per-call surfaces afterward without re-querying
|
|
1534
|
+
* ``world.entities``.
|
|
1535
|
+
*
|
|
1536
|
+
* When no selectivity-bearing filter is supplied (no conversation_id /
|
|
1537
|
+
* call_sid / time range), the query is auto-capped to the last 7 days.
|
|
1538
|
+
* The applied window is reported in ``applied_time_window_days``.
|
|
1539
|
+
*/
|
|
1540
|
+
async list(params) {
|
|
1541
|
+
return extractData(
|
|
1542
|
+
await this.client.GET("/v1/{workspace_id}/prompt-logs", {
|
|
1543
|
+
params: { path: { workspace_id: this.workspaceId }, query: params }
|
|
1544
|
+
})
|
|
1545
|
+
);
|
|
1546
|
+
}
|
|
1547
|
+
/**
|
|
1548
|
+
* Auto-paginating async iterator over prompt-log entries. Walks
|
|
1549
|
+
* ``next_offset`` until ``has_more`` is false, yielding individual
|
|
1550
|
+
* entries. Use this when consuming logs at scale (e.g. nightly
|
|
1551
|
+
* backfills) rather than rendering one page in a UI.
|
|
1552
|
+
*
|
|
1553
|
+
* Bounded by the same per-call hard caps as ``list`` (200 items per
|
|
1554
|
+
* page, 10,000 cumulative offset).
|
|
1555
|
+
*/
|
|
1556
|
+
async *listAutoPaging(params) {
|
|
1557
|
+
let offset = 0;
|
|
1558
|
+
while (true) {
|
|
1559
|
+
const page = await this.list({ ...params, offset });
|
|
1560
|
+
for (const entry of page.items) {
|
|
1561
|
+
yield entry;
|
|
1562
|
+
}
|
|
1563
|
+
if (!page.has_more || page.next_offset == null) {
|
|
1564
|
+
return;
|
|
1565
|
+
}
|
|
1566
|
+
if (page.next_offset === offset) {
|
|
1567
|
+
return;
|
|
1568
|
+
}
|
|
1569
|
+
offset = page.next_offset;
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
};
|
|
1573
|
+
|
|
1522
1574
|
// src/resources/triggers.ts
|
|
1523
1575
|
var TriggersResource = class extends WorkspaceScopedResource {
|
|
1524
1576
|
async list(params) {
|
|
@@ -2511,6 +2563,92 @@ function parseTurnStreamFrame(eventName, dataJson) {
|
|
|
2511
2563
|
return { ...payload, event: eventName };
|
|
2512
2564
|
}
|
|
2513
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
|
+
|
|
2514
2652
|
// src/resources/phone-numbers.ts
|
|
2515
2653
|
var PhoneNumbersResource = class extends WorkspaceScopedResource {
|
|
2516
2654
|
/** Create a new phone number */
|
|
@@ -6174,6 +6312,7 @@ var AmigoClient = class _AmigoClient {
|
|
|
6174
6312
|
skills;
|
|
6175
6313
|
actions;
|
|
6176
6314
|
operators;
|
|
6315
|
+
promptLogs;
|
|
6177
6316
|
triggers;
|
|
6178
6317
|
services;
|
|
6179
6318
|
contextGraphs;
|
|
@@ -6181,6 +6320,7 @@ var AmigoClient = class _AmigoClient {
|
|
|
6181
6320
|
world;
|
|
6182
6321
|
calls;
|
|
6183
6322
|
conversations;
|
|
6323
|
+
channels;
|
|
6184
6324
|
phoneNumbers;
|
|
6185
6325
|
integrations;
|
|
6186
6326
|
analytics;
|
|
@@ -6315,6 +6455,7 @@ var AmigoClient = class _AmigoClient {
|
|
|
6315
6455
|
mutable.skills = new SkillsResource(client, workspaceId2);
|
|
6316
6456
|
mutable.actions = new ActionsResource(client, workspaceId2);
|
|
6317
6457
|
mutable.operators = new OperatorsResource(client, workspaceId2);
|
|
6458
|
+
mutable.promptLogs = new PromptLogsResource(client, workspaceId2);
|
|
6318
6459
|
mutable.triggers = new TriggersResource(client, workspaceId2);
|
|
6319
6460
|
mutable.services = new ServicesResource(client, workspaceId2);
|
|
6320
6461
|
mutable.contextGraphs = new ContextGraphsResource(client, workspaceId2);
|
|
@@ -6322,6 +6463,7 @@ var AmigoClient = class _AmigoClient {
|
|
|
6322
6463
|
mutable.world = new WorldResource(client, workspaceId2);
|
|
6323
6464
|
mutable.calls = new CallsResource(client, workspaceId2);
|
|
6324
6465
|
mutable.conversations = new ConversationsResource(client, workspaceId2, agentBaseUrl);
|
|
6466
|
+
mutable.channels = new ChannelsResource(client, workspaceId2);
|
|
6325
6467
|
mutable.phoneNumbers = new PhoneNumbersResource(client, workspaceId2);
|
|
6326
6468
|
mutable.integrations = new IntegrationsResource(client, workspaceId2);
|
|
6327
6469
|
mutable.analytics = new AnalyticsResource(client, workspaceId2);
|