@pipedream/twilio 0.7.0 → 0.8.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.
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import twilio from "../../twilio.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "twilio-list-transcript-sids-options",
|
|
5
|
+
name: "List Transcript SIDs Options",
|
|
6
|
+
description: "Retrieves available options for the Transcript SIDs field.",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
twilio,
|
|
16
|
+
page: {
|
|
17
|
+
type: "integer",
|
|
18
|
+
label: "Page",
|
|
19
|
+
description: "The page of results to retrieve.",
|
|
20
|
+
min: 0,
|
|
21
|
+
default: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const options = await twilio.propDefinitions.transcriptSids.options.call(this.twilio, {
|
|
26
|
+
page: this.page,
|
|
27
|
+
});
|
|
28
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${options.length === 1
|
|
29
|
+
? ""
|
|
30
|
+
: "s"}`);
|
|
31
|
+
return options;
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "twilio-make-phone-call",
|
|
7
7
|
name: "Make a Phone Call",
|
|
8
8
|
description: "Make a phone call passing text, a URL, or an application that Twilio will use to handle the call. [See the documentation](https://www.twilio.com/docs/voice/api/call-resource#create-a-call-resource)",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "1.0.0",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -27,44 +27,25 @@ export default {
|
|
|
27
27
|
"to",
|
|
28
28
|
],
|
|
29
29
|
},
|
|
30
|
-
callType: {
|
|
31
|
-
type: "string",
|
|
32
|
-
label: "Call Type",
|
|
33
|
-
description: "Whether to use `text`, a `URL`, or an `application` to handle the call",
|
|
34
|
-
options: [
|
|
35
|
-
{
|
|
36
|
-
label: "Enter text for Twilio to speak when the user picks up the phone",
|
|
37
|
-
value: "text",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
label: "Enter a URL that returns the TwiML instructions for the call",
|
|
41
|
-
value: "url",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
label: "Enter the SID of an Application resource that will handle the call",
|
|
45
|
-
value: "application",
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
reloadProps: true,
|
|
49
|
-
},
|
|
50
30
|
text: {
|
|
51
31
|
label: "Text",
|
|
52
32
|
type: "string",
|
|
53
|
-
description: "
|
|
54
|
-
|
|
33
|
+
description: "Plain text for Twilio to speak when the user picks up the phone. For TwiML or SSML, use the **URL** field instead. Provide exactly **one** of **Text**, **URL**, or **Application SID**.",
|
|
34
|
+
optional: true,
|
|
55
35
|
},
|
|
56
36
|
url: {
|
|
57
37
|
type: "string",
|
|
58
38
|
label: "URL",
|
|
59
|
-
description: "The absolute URL that returns the TwiML instructions for the call",
|
|
60
|
-
|
|
39
|
+
description: "The absolute URL that returns the TwiML instructions for the call. Provide exactly **one** of **Text**, **URL**, or **Application SID**.",
|
|
40
|
+
optional: true,
|
|
61
41
|
},
|
|
62
42
|
applicationSid: {
|
|
63
43
|
propDefinition: [
|
|
64
44
|
twilio,
|
|
65
45
|
"applicationSid",
|
|
66
46
|
],
|
|
67
|
-
|
|
47
|
+
description: "The SID of an Application resource that will handle the call. You can use **List Application SID Options** to get a list of available options. Provide exactly **one** of **Text**, **URL**, or **Application SID**.",
|
|
48
|
+
optional: true,
|
|
68
49
|
},
|
|
69
50
|
timeout: {
|
|
70
51
|
type: "integer",
|
|
@@ -77,46 +58,46 @@ export default {
|
|
|
77
58
|
label: "Record",
|
|
78
59
|
description: "Whether to record the call",
|
|
79
60
|
optional: true,
|
|
80
|
-
reloadProps: true,
|
|
81
61
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
};
|
|
110
|
-
props.recordingCallbackUrl = {
|
|
111
|
-
type: "string",
|
|
112
|
-
label: "Recording Callback URL",
|
|
113
|
-
description: "The URL that we call when the recording is available to be accessed",
|
|
114
|
-
optional: true,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
return props;
|
|
62
|
+
trim: {
|
|
63
|
+
type: "string",
|
|
64
|
+
label: "Trim",
|
|
65
|
+
description: "Whether to trim any leading and trailing silence from the recording. Only applies when **Record** is enabled.",
|
|
66
|
+
options: [
|
|
67
|
+
"trim-silence",
|
|
68
|
+
"do-not-trim",
|
|
69
|
+
],
|
|
70
|
+
optional: true,
|
|
71
|
+
},
|
|
72
|
+
recordingTrack: {
|
|
73
|
+
type: "string",
|
|
74
|
+
label: "Recording Track",
|
|
75
|
+
description: "The audio track to record for the call. Default is `both`. Only applies when **Record** is enabled.",
|
|
76
|
+
options: [
|
|
77
|
+
"inbound",
|
|
78
|
+
"outbound",
|
|
79
|
+
"both",
|
|
80
|
+
],
|
|
81
|
+
optional: true,
|
|
82
|
+
},
|
|
83
|
+
recordingCallbackUrl: {
|
|
84
|
+
type: "string",
|
|
85
|
+
label: "Recording Callback URL",
|
|
86
|
+
description: "The URL that we call when the recording is available to be accessed. Only applies when **Record** is enabled.",
|
|
87
|
+
optional: true,
|
|
88
|
+
},
|
|
118
89
|
},
|
|
119
90
|
async run({ $ }) {
|
|
91
|
+
// Exactly one of the call handlers (text, URL, or application) must be provided
|
|
92
|
+
const handlers = [
|
|
93
|
+
this.text,
|
|
94
|
+
this.url,
|
|
95
|
+
this.applicationSid,
|
|
96
|
+
].filter((handler) => handler != null && handler !== "");
|
|
97
|
+
if (handlers.length !== 1) {
|
|
98
|
+
throw new Error("You must provide exactly one of **Text**, **URL**, or **Application SID** to handle the call.");
|
|
99
|
+
}
|
|
100
|
+
|
|
120
101
|
// Parse the given number into its E.164 equivalent
|
|
121
102
|
// The E.164 phone number will be included in the first element
|
|
122
103
|
// of the array, but the array will be empty if parsing fails.
|