@agent-comm/piece-agent-comms 0.1.0 → 0.1.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-comm/piece-agent-comms",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Agent Comms — voice-agent communications. Triggers on calls, appointments and chats; place outbound calls, upsert contacts and send SMS.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const makeOutboundCall: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
assistant_id: import("@activepieces/pieces-framework").
|
|
2
|
+
assistant_id: import("@activepieces/pieces-framework").DropdownProperty<any, true, import("@activepieces/pieces-framework").PieceAuthProperty | import("@activepieces/pieces-framework").PieceAuthProperty[]>;
|
|
3
3
|
to_number: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
4
|
}>;
|
|
@@ -13,10 +13,27 @@ exports.makeOutboundCall = (0, pieces_framework_1.createAction)({
|
|
|
13
13
|
displayName: 'Make Outbound Call',
|
|
14
14
|
description: 'Have a Bellvox assistant place an outbound phone call.',
|
|
15
15
|
props: {
|
|
16
|
-
assistant_id: pieces_framework_1.Property.
|
|
17
|
-
displayName: '
|
|
18
|
-
description: 'The
|
|
16
|
+
assistant_id: pieces_framework_1.Property.Dropdown({
|
|
17
|
+
displayName: 'Agent',
|
|
18
|
+
description: 'The agent that should place the call.',
|
|
19
19
|
required: true,
|
|
20
|
+
refreshers: [],
|
|
21
|
+
options: async ({ auth }) => {
|
|
22
|
+
if (!auth)
|
|
23
|
+
return { disabled: true, placeholder: 'Connect your account first', options: [] };
|
|
24
|
+
try {
|
|
25
|
+
const res = await pieces_common_1.httpClient.sendRequest({
|
|
26
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
27
|
+
url: `${common_1.BELLVOX_API}/ap-actions?do=list_assistants`,
|
|
28
|
+
headers: { 'x-bellvox-key': (0, common_1.authKey)(auth) },
|
|
29
|
+
});
|
|
30
|
+
const list = res.body?.assistants ?? [];
|
|
31
|
+
return { options: list.map((a) => ({ label: a.name || a.id, value: a.id })) };
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
return { disabled: true, placeholder: 'Could not load agents — check the connection', options: [] };
|
|
35
|
+
}
|
|
36
|
+
},
|
|
20
37
|
}),
|
|
21
38
|
to_number: pieces_framework_1.Property.ShortText({
|
|
22
39
|
displayName: 'To Number',
|
|
@@ -11,10 +11,25 @@ export const makeOutboundCall = createAction({
|
|
|
11
11
|
displayName: 'Make Outbound Call',
|
|
12
12
|
description: 'Have a Bellvox assistant place an outbound phone call.',
|
|
13
13
|
props: {
|
|
14
|
-
assistant_id: Property.
|
|
15
|
-
displayName: '
|
|
16
|
-
description: 'The
|
|
14
|
+
assistant_id: Property.Dropdown({
|
|
15
|
+
displayName: 'Agent',
|
|
16
|
+
description: 'The agent that should place the call.',
|
|
17
17
|
required: true,
|
|
18
|
+
refreshers: [],
|
|
19
|
+
options: async ({ auth }) => {
|
|
20
|
+
if (!auth) return { disabled: true, placeholder: 'Connect your account first', options: [] };
|
|
21
|
+
try {
|
|
22
|
+
const res = await httpClient.sendRequest<{ assistants?: { id: string; name: string }[] }>({
|
|
23
|
+
method: HttpMethod.POST,
|
|
24
|
+
url: `${BELLVOX_API}/ap-actions?do=list_assistants`,
|
|
25
|
+
headers: { 'x-bellvox-key': authKey(auth) },
|
|
26
|
+
});
|
|
27
|
+
const list = res.body?.assistants ?? [];
|
|
28
|
+
return { options: list.map((a) => ({ label: a.name || a.id, value: a.id })) };
|
|
29
|
+
} catch (e) {
|
|
30
|
+
return { disabled: true, placeholder: 'Could not load agents — check the connection', options: [] };
|
|
31
|
+
}
|
|
32
|
+
},
|
|
18
33
|
}),
|
|
19
34
|
to_number: Property.ShortText({
|
|
20
35
|
displayName: 'To Number',
|