@pipedream/twilio 0.3.5 → 0.3.7
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/actions/delete-call/delete-call.mjs +1 -1
- package/actions/delete-message/delete-message.mjs +1 -1
- package/actions/download-recording-media/download-recording-media.mjs +1 -1
- package/actions/get-call/get-call.mjs +1 -1
- package/actions/get-message/get-message.mjs +1 -1
- package/actions/list-calls/list-calls.mjs +1 -1
- package/actions/list-message-media/list-message-media.mjs +1 -1
- package/actions/list-messages/list-messages.mjs +1 -1
- package/actions/list-recording-transcriptions/list-recording-transcriptions.mjs +1 -1
- package/actions/make-phone-call/make-phone-call.mjs +1 -1
- package/actions/send-mms/send-mms.mjs +1 -1
- package/actions/send-sms/send-sms.mjs +1 -1
- package/package.json +2 -1
- package/sources/common-polling.mjs +2 -1
- package/sources/common-webhook.mjs +7 -0
- package/sources/new-call/new-call.mjs +1 -1
- package/sources/new-incoming-sms/new-incoming-sms.mjs +1 -1
- package/sources/new-phone-number/new-phone-number.mjs +1 -1
- package/sources/new-recording/new-recording.mjs +1 -1
- package/sources/new-transcription/new-transcription.mjs +1 -1
- package/twilio.app.mjs +14 -3
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "twilio-delete-call",
|
|
5
5
|
name: "Delete Call",
|
|
6
6
|
description: "Remove a call record from your account. [See the docs](https://www.twilio.com/docs/voice/api/call-resource#delete-a-call-resource) for more information",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.1",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
twilio,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "twilio-delete-message",
|
|
5
5
|
name: "Delete Message",
|
|
6
6
|
description: "Delete a message record from your account. [See the docs](https://www.twilio.com/docs/sms/api/message-resource#delete-a-message-resource) for more information",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.1",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
twilio,
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "twilio-download-recording-media",
|
|
9
9
|
name: "Download Recording Media",
|
|
10
10
|
description: "Download a recording media file. [See the docs](https://www.twilio.com/docs/voice/api/recording#fetch-a-recording-media-file) for more information",
|
|
11
|
-
version: "0.1.
|
|
11
|
+
version: "0.1.1",
|
|
12
12
|
type: "action",
|
|
13
13
|
props: {
|
|
14
14
|
twilio,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "twilio-get-call",
|
|
6
6
|
name: "Get Call",
|
|
7
7
|
description: "Return call resource of an individual call. [See the docs](https://www.twilio.com/docs/voice/api/call-resource#fetch-a-call-resource) for more information",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
twilio,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "twilio-get-message",
|
|
6
6
|
name: "Get Message",
|
|
7
7
|
description: "Return details of a message. [See the docs](https://www.twilio.com/docs/sms/api/message-resource#fetch-a-message-resource) for more information",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
twilio,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "twilio-list-calls",
|
|
6
6
|
name: "List Calls",
|
|
7
7
|
description: "Return a list of calls associated with your account. [See the docs](https://www.twilio.com/docs/voice/api/call-resource#read-multiple-call-resources) for more information",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
twilio,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "twilio-list-message-media",
|
|
6
6
|
name: "List Message Media",
|
|
7
7
|
description: "Return a list of media associated with your message. [See the docs](https://www.twilio.com/docs/sms/api/media-resource#read-multiple-media-resources) for more information",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
twilio,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "twilio-list-messages",
|
|
7
7
|
name: "List Messages",
|
|
8
8
|
description: "Return a list of messages associated with your account. [See the docs](https://www.twilio.com/docs/sms/api/message-resource#read-multiple-message-resources) for more information",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.1",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
twilio,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "twilio-list-recording-transcriptions",
|
|
6
6
|
name: "List Recording Transcriptions",
|
|
7
7
|
description: "Return a set of transcriptions available for a recording. [See the docs](https://www.twilio.com/docs/voice/api/recording#fetch-a-recordings-transcriptions) for more information",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
twilio,
|
|
@@ -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 that Twilio will speak to the recipient of the call. [See the docs](https://www.twilio.com/docs/voice/api/call-resource#create-a-call-resource) for more information",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.1",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
twilio,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "Send MMS",
|
|
8
8
|
description: "Send an SMS with text and media files. [See the docs](https://www.twilio.com/docs/sms/api/message-resource#create-a-message-resource) for more information",
|
|
9
9
|
type: "action",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.1",
|
|
11
11
|
props: {
|
|
12
12
|
twilio,
|
|
13
13
|
from: {
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "Send SMS",
|
|
8
8
|
description: "Send a simple text-only SMS. [See the docs](https://www.twilio.com/docs/sms/api/message-resource#create-a-message-resource) for more information",
|
|
9
9
|
type: "action",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.1",
|
|
11
11
|
props: {
|
|
12
12
|
twilio,
|
|
13
13
|
from: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/twilio",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Pipedream Twilio Components",
|
|
5
5
|
"main": "twilio.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"dependencies": {
|
|
14
|
+
"@pipedream/platform": "^1.2.0",
|
|
14
15
|
"phone": "^3.1.29",
|
|
15
16
|
"twilio": "^3.54.2"
|
|
16
17
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import twilio from "../twilio.app.mjs";
|
|
2
|
+
import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
props: {
|
|
@@ -9,7 +10,7 @@ export default {
|
|
|
9
10
|
description: "Pipedream polls Twilio for events on this schedule.",
|
|
10
11
|
type: "$.interface.timer",
|
|
11
12
|
default: {
|
|
12
|
-
intervalSeconds:
|
|
13
|
+
intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
|
|
13
14
|
},
|
|
14
15
|
},
|
|
15
16
|
},
|
|
@@ -9,6 +9,12 @@ export default {
|
|
|
9
9
|
"incomingPhoneNumber",
|
|
10
10
|
],
|
|
11
11
|
},
|
|
12
|
+
authToken: {
|
|
13
|
+
propDefinition: [
|
|
14
|
+
twilio,
|
|
15
|
+
"authToken",
|
|
16
|
+
],
|
|
17
|
+
},
|
|
12
18
|
http: {
|
|
13
19
|
label: "HTTP Responder",
|
|
14
20
|
description: "Exposes a `respond()` method that lets the source issue HTTP responses",
|
|
@@ -87,6 +93,7 @@ export default {
|
|
|
87
93
|
signature,
|
|
88
94
|
url: `${this.http.endpoint}/`,
|
|
89
95
|
params: body,
|
|
96
|
+
authToken: this.authToken,
|
|
90
97
|
});
|
|
91
98
|
|
|
92
99
|
if (!isRequestValid) {
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "twilio-new-call",
|
|
7
7
|
name: "New Call (Instant)",
|
|
8
8
|
description: "Emit new event each time a call to the phone number is completed. Configures a webhook in Twilio, tied to a phone number.",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.2",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
methods: {
|
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
key: "twilio-new-incoming-sms",
|
|
10
10
|
name: "New Incoming SMS (Instant)",
|
|
11
11
|
description: "Emit new event every time an SMS is sent to the phone number set. Configures a webhook in Twilio, tied to an incoming phone number.",
|
|
12
|
-
version: "0.1.
|
|
12
|
+
version: "0.1.2",
|
|
13
13
|
type: "source",
|
|
14
14
|
dedupe: "unique",
|
|
15
15
|
props: {
|
package/twilio.app.mjs
CHANGED
|
@@ -10,6 +10,13 @@ export default {
|
|
|
10
10
|
type: "app",
|
|
11
11
|
app: "twilio",
|
|
12
12
|
propDefinitions: {
|
|
13
|
+
authToken: {
|
|
14
|
+
type: "string",
|
|
15
|
+
secret: true,
|
|
16
|
+
label: "Twilio Auth Token",
|
|
17
|
+
description:
|
|
18
|
+
"Your Twilio auth token, found [in your Twilio console](https://www.twilio.com/console). Required for validating Twilio events.",
|
|
19
|
+
},
|
|
13
20
|
body: {
|
|
14
21
|
type: "string",
|
|
15
22
|
label: "Message Body",
|
|
@@ -150,18 +157,22 @@ export default {
|
|
|
150
157
|
},
|
|
151
158
|
methods: {
|
|
152
159
|
validateRequest({
|
|
153
|
-
signature, url, params,
|
|
160
|
+
signature, url, params, authToken = this.$auth.authToken,
|
|
154
161
|
} = {}) {
|
|
155
162
|
// See https://www.twilio.com/docs/usage/webhooks/webhooks-security
|
|
156
163
|
return twilio.validateRequest(
|
|
157
|
-
|
|
164
|
+
authToken,
|
|
158
165
|
signature,
|
|
159
166
|
url,
|
|
160
167
|
params,
|
|
161
168
|
);
|
|
162
169
|
},
|
|
163
170
|
getClient() {
|
|
164
|
-
|
|
171
|
+
// Uncomment this line when users are ready to migrate
|
|
172
|
+
// return twilio(this.$auth.accountSid, this.$auth.authToken);
|
|
173
|
+
return twilio(this.$auth.Sid, this.$auth.Secret, {
|
|
174
|
+
accountSid: this.$auth.AccountSid,
|
|
175
|
+
});
|
|
165
176
|
},
|
|
166
177
|
setWebhookURL({
|
|
167
178
|
serviceType = constants.SERVICE_TYPE.SMS, phoneNumberSid, url,
|