Skip to content

Commit f1a0f20

Browse files
authored
OpenPhone — new message received trigger (#16257)
* new-message-received-instant trigger * pnpm-lock.yaml * version
1 parent 943fec5 commit f1a0f20

File tree

12 files changed

+65
-11
lines changed

12 files changed

+65
-11
lines changed

components/openphone/actions/create-contact/create-contact.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "openphone-create-contact",
66
name: "Create Contact",
77
description: "Create a new contact in OpenPhone. [See the documentation](https://www.openphone.com/docs/api-reference/contacts/create-a-contact)",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
type: "action",
1010
props: {
1111
openphone,

components/openphone/actions/list-phone-numbers/list-phone-numbers.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "openphone-list-phone-numbers",
55
name: "List Phone Numbers",
66
description: "Retrieve the list of phone numbers and users associated with your OpenPhone workspace. [See the documentation](https://www.openphone.com/docs/mdx/api-reference/phone-numbers/list-phone-numbers)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
openphone,

components/openphone/actions/send-message/send-message.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "openphone-send-message",
55
name: "Send a Text Message",
66
description: "Send a text message from your OpenPhone number to a recipient. [See the documentation](https://www.openphone.com/docs/api-reference/messages/send-a-text-message)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
type: "action",
99
props: {
1010
openphone,

components/openphone/actions/update-contact/update-contact.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "openphone-update-contact",
66
name: "Update Contact",
77
description: "Update an existing contact on OpenPhone. [See the documentation](https://www.openphone.com/docs/api-reference/contacts/update-a-contact-by-id)",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
type: "action",
1010
props: {
1111
openphone,

components/openphone/openphone.app.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,12 @@ export default {
9999
...opts,
100100
});
101101
},
102-
createWebhook(opts = {}) {
102+
createWebhook({
103+
webhookType, ...opts
104+
}) {
103105
return this._makeRequest({
104106
method: "POST",
105-
path: "/webhooks/calls",
107+
path: `/webhooks/${webhookType}`,
106108
...opts,
107109
});
108110
},

components/openphone/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/openphone",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "Pipedream OpenPhone Components",
55
"main": "openphone.app.mjs",
66
"keywords": [

components/openphone/sources/common/base.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export default {
3232
getEventFilter() {
3333
return true;
3434
},
35+
getWebhookType() {
36+
return "calls";
37+
},
3538
},
3639
hooks: {
3740
async activate() {
@@ -42,6 +45,7 @@ export default {
4245
resourceIds: this.resourceIds,
4346
label: this.label,
4447
},
48+
webhookType: this.getWebhookType(),
4549
});
4650
this._setHookId(response.data.id);
4751
},

components/openphone/sources/new-call-recording-completed-instant/new-call-recording-completed-instant.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "openphone-new-call-recording-completed-instant",
77
name: "New Call Recording Completed (Instant)",
88
description: "Emit new event when a call recording has finished.",
9-
version: "0.0.2",
9+
version: "0.0.3",
1010
type: "source",
1111
dedupe: "unique",
1212
methods: {
@@ -16,7 +16,7 @@ export default {
1616
"call.recording.completed",
1717
];
1818
},
19-
getEmit(body) {
19+
getSummary(body) {
2020
return `New call recording completed for call ID: ${body.data.object.id}`;
2121
},
2222
},

components/openphone/sources/new-incoming-call-completed-instant/new-incoming-call-completed-instant.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "openphone-new-incoming-call-completed-instant",
77
name: "New Incoming Call Completed (Instant)",
88
description: "Emit new event when an incoming call is completed, including calls not picked up or voicemails left.",
9-
version: "0.0.2",
9+
version: "0.0.3",
1010
type: "source",
1111
dedupe: "unique",
1212
methods: {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import common from "../common/base.mjs";
2+
import sampleEmit from "./test-event.mjs";
3+
4+
export default {
5+
...common,
6+
key: "openphone-new-message-received-instant",
7+
name: "New Message Received (Instant)",
8+
description: "Emit new event when a new message is received",
9+
version: "0.0.1",
10+
type: "source",
11+
dedupe: "unique",
12+
methods: {
13+
...common.methods,
14+
getEvent() {
15+
return [
16+
"message.received",
17+
];
18+
},
19+
getSummary() {
20+
return "New Message Received";
21+
},
22+
getWebhookType() {
23+
return "messages";
24+
},
25+
},
26+
sampleEmit,
27+
};

0 commit comments

Comments
 (0)