diff --git a/components/openphone/actions/create-contact/create-contact.mjs b/components/openphone/actions/create-contact/create-contact.mjs index 92e53131c67f7..0a0ace90672f9 100644 --- a/components/openphone/actions/create-contact/create-contact.mjs +++ b/components/openphone/actions/create-contact/create-contact.mjs @@ -5,7 +5,7 @@ export default { key: "openphone-create-contact", name: "Create Contact", description: "Create a new contact in OpenPhone. [See the documentation](https://www.openphone.com/docs/api-reference/contacts/create-a-contact)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { openphone, diff --git a/components/openphone/actions/list-phone-numbers/list-phone-numbers.mjs b/components/openphone/actions/list-phone-numbers/list-phone-numbers.mjs index f367b9d487b21..bc7130fbbd0cc 100644 --- a/components/openphone/actions/list-phone-numbers/list-phone-numbers.mjs +++ b/components/openphone/actions/list-phone-numbers/list-phone-numbers.mjs @@ -4,7 +4,7 @@ export default { key: "openphone-list-phone-numbers", name: "List Phone Numbers", 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)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { openphone, diff --git a/components/openphone/actions/send-message/send-message.mjs b/components/openphone/actions/send-message/send-message.mjs index 66916fcef0f45..8e3c9d316d078 100644 --- a/components/openphone/actions/send-message/send-message.mjs +++ b/components/openphone/actions/send-message/send-message.mjs @@ -4,7 +4,7 @@ export default { key: "openphone-send-message", name: "Send a Text Message", 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)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { openphone, diff --git a/components/openphone/actions/update-contact/update-contact.mjs b/components/openphone/actions/update-contact/update-contact.mjs index 0410016856b23..72a943cfaa299 100644 --- a/components/openphone/actions/update-contact/update-contact.mjs +++ b/components/openphone/actions/update-contact/update-contact.mjs @@ -5,7 +5,7 @@ export default { key: "openphone-update-contact", name: "Update Contact", description: "Update an existing contact on OpenPhone. [See the documentation](https://www.openphone.com/docs/api-reference/contacts/update-a-contact-by-id)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { openphone, diff --git a/components/openphone/openphone.app.mjs b/components/openphone/openphone.app.mjs index 8f7538b73e0c8..621878df1d62d 100644 --- a/components/openphone/openphone.app.mjs +++ b/components/openphone/openphone.app.mjs @@ -99,10 +99,12 @@ export default { ...opts, }); }, - createWebhook(opts = {}) { + createWebhook({ + webhookType, ...opts + }) { return this._makeRequest({ method: "POST", - path: "/webhooks/calls", + path: `/webhooks/${webhookType}`, ...opts, }); }, diff --git a/components/openphone/package.json b/components/openphone/package.json index 5235cef538c7e..d17d641bcdf23 100644 --- a/components/openphone/package.json +++ b/components/openphone/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/openphone", - "version": "0.2.0", + "version": "0.3.0", "description": "Pipedream OpenPhone Components", "main": "openphone.app.mjs", "keywords": [ diff --git a/components/openphone/sources/common/base.mjs b/components/openphone/sources/common/base.mjs index e2ccb526111f3..fb016471e5fd0 100644 --- a/components/openphone/sources/common/base.mjs +++ b/components/openphone/sources/common/base.mjs @@ -32,6 +32,9 @@ export default { getEventFilter() { return true; }, + getWebhookType() { + return "calls"; + }, }, hooks: { async activate() { @@ -42,6 +45,7 @@ export default { resourceIds: this.resourceIds, label: this.label, }, + webhookType: this.getWebhookType(), }); this._setHookId(response.data.id); }, diff --git a/components/openphone/sources/new-call-recording-completed-instant/new-call-recording-completed-instant.mjs b/components/openphone/sources/new-call-recording-completed-instant/new-call-recording-completed-instant.mjs index 38039a2e0abec..52044853ab412 100644 --- a/components/openphone/sources/new-call-recording-completed-instant/new-call-recording-completed-instant.mjs +++ b/components/openphone/sources/new-call-recording-completed-instant/new-call-recording-completed-instant.mjs @@ -6,7 +6,7 @@ export default { key: "openphone-new-call-recording-completed-instant", name: "New Call Recording Completed (Instant)", description: "Emit new event when a call recording has finished.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", methods: { @@ -16,7 +16,7 @@ export default { "call.recording.completed", ]; }, - getEmit(body) { + getSummary(body) { return `New call recording completed for call ID: ${body.data.object.id}`; }, }, diff --git a/components/openphone/sources/new-incoming-call-completed-instant/new-incoming-call-completed-instant.mjs b/components/openphone/sources/new-incoming-call-completed-instant/new-incoming-call-completed-instant.mjs index b2d89a156a77a..3153581dce458 100644 --- a/components/openphone/sources/new-incoming-call-completed-instant/new-incoming-call-completed-instant.mjs +++ b/components/openphone/sources/new-incoming-call-completed-instant/new-incoming-call-completed-instant.mjs @@ -6,7 +6,7 @@ export default { key: "openphone-new-incoming-call-completed-instant", name: "New Incoming Call Completed (Instant)", description: "Emit new event when an incoming call is completed, including calls not picked up or voicemails left.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", methods: { diff --git a/components/openphone/sources/new-message-received-instant/new-message-received-instant.mjs b/components/openphone/sources/new-message-received-instant/new-message-received-instant.mjs new file mode 100644 index 0000000000000..23aa629f81db4 --- /dev/null +++ b/components/openphone/sources/new-message-received-instant/new-message-received-instant.mjs @@ -0,0 +1,27 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "openphone-new-message-received-instant", + name: "New Message Received (Instant)", + description: "Emit new event when a new message is received", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getEvent() { + return [ + "message.received", + ]; + }, + getSummary() { + return "New Message Received"; + }, + getWebhookType() { + return "messages"; + }, + }, + sampleEmit, +}; diff --git a/components/openphone/sources/new-message-received-instant/test-event.mjs b/components/openphone/sources/new-message-received-instant/test-event.mjs new file mode 100644 index 0000000000000..48ce992270b2a --- /dev/null +++ b/components/openphone/sources/new-message-received-instant/test-event.mjs @@ -0,0 +1,21 @@ +export default { + "id": "", + "object": "event", + "apiVersion": "v4", + "createdAt": "2025-04-10T21:41:01.247Z", + "type": "message.received", + "data": { + "object": { + "id": "", + "object": "message", + "from": "", + "to": "", + "direction": "incoming", + "text": "test", + "status": "received", + "createdAt": "2025-04-10T21:41:00.983Z", + "userId": "", + "phoneNumberId": "" + } + } +} \ No newline at end of file diff --git a/components/openphone/sources/new-outgoing-call-completed-instant/new-outgoing-call-completed-instant.mjs b/components/openphone/sources/new-outgoing-call-completed-instant/new-outgoing-call-completed-instant.mjs index bf9ca6bfd754c..d9a57a575f4ce 100644 --- a/components/openphone/sources/new-outgoing-call-completed-instant/new-outgoing-call-completed-instant.mjs +++ b/components/openphone/sources/new-outgoing-call-completed-instant/new-outgoing-call-completed-instant.mjs @@ -6,7 +6,7 @@ export default { key: "openphone-new-outgoing-call-completed-instant", name: "New Outgoing Call Completed (Instant)", description: "Emit new event when an outgoing call has ended.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", methods: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2a1a4bb091b81..3d45fabab79c8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4308,8 +4308,7 @@ importers: components/facebook_conversions: {} - components/facebook_graph_api: - specifiers: {} + components/facebook_graph_api: {} components/facebook_groups: dependencies: @@ -4929,8 +4928,7 @@ importers: components/gatekeeper: {} - components/gather: - specifiers: {} + components/gather: {} components/gatherup: dependencies: @@ -11991,8 +11989,7 @@ importers: components/smartengage: {} - components/smartlead: - specifiers: {} + components/smartlead: {} components/smartproxy: {}