From b089d9a3ddf4ea11a1a44a7d49d009866a36c8bc Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 9 Jan 2025 16:47:53 -0500 Subject: [PATCH 1/9] new components --- components/messagebird/.gitignore | 3 - .../actions/create-contact/create-contact.mjs | 65 ++++++ .../messagebird/actions/send-sms/send-sms.mjs | 74 ++++++ .../send-voice-message/send-voice-message.mjs | 69 ++++++ components/messagebird/app/messagebird.app.ts | 13 -- components/messagebird/messagebird.app.mjs | 218 ++++++++++++++++++ components/messagebird/package.json | 8 +- .../new-message-received.mjs | 97 ++++++++ .../new-message-received/test-event.mjs | 44 ++++ 9 files changed, 572 insertions(+), 19 deletions(-) delete mode 100644 components/messagebird/.gitignore create mode 100644 components/messagebird/actions/create-contact/create-contact.mjs create mode 100644 components/messagebird/actions/send-sms/send-sms.mjs create mode 100644 components/messagebird/actions/send-voice-message/send-voice-message.mjs delete mode 100644 components/messagebird/app/messagebird.app.ts create mode 100644 components/messagebird/messagebird.app.mjs create mode 100644 components/messagebird/sources/new-message-received/new-message-received.mjs create mode 100644 components/messagebird/sources/new-message-received/test-event.mjs diff --git a/components/messagebird/.gitignore b/components/messagebird/.gitignore deleted file mode 100644 index ec761ccab7595..0000000000000 --- a/components/messagebird/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.js -*.mjs -dist \ No newline at end of file diff --git a/components/messagebird/actions/create-contact/create-contact.mjs b/components/messagebird/actions/create-contact/create-contact.mjs new file mode 100644 index 0000000000000..df57bca1e64c8 --- /dev/null +++ b/components/messagebird/actions/create-contact/create-contact.mjs @@ -0,0 +1,65 @@ +import messagebird from "../../messagebird.app.mjs"; + +export default { + key: "messagebird-create-contact", + name: "Create Contact", + description: "Creates a new contact. [See the documentation](https://docs.bird.com/api/contacts-api/api-reference/manage-workspace-contacts/create-a-contact)", + version: "0.0.1", + type: "action", + props: { + messagebird, + organizationId: { + propDefinition: [ + messagebird, + "organizationId", + ], + }, + workspaceId: { + propDefinition: [ + messagebird, + "workspaceId", + (c) => ({ + organizationId: c.organizationId, + }), + ], + }, + displayName: { + type: "string", + label: "Display Name", + description: "The display name for the contact", + }, + email: { + type: "string", + label: "Email", + description: "The email address of the contact", + optional: true, + }, + listIds: { + propDefinition: [ + messagebird, + "listIds", + (c) => ({ + workspaceId: c.workspaceId, + }), + ], + }, + }, + async run({ $ }) { + const response = await this.messagebird.createContact({ + $, + workspaceId: this.workspaceId, + data: { + displayName: this.displayName, + identifiers: this.email && [ + { + key: "emailaddress", + value: this.email, + }, + ], + listIds: this.listIds, + }, + }); + $.export("$summary", `Successfully created contact with ID: ${response.id}`); + return response; + }, +}; diff --git a/components/messagebird/actions/send-sms/send-sms.mjs b/components/messagebird/actions/send-sms/send-sms.mjs new file mode 100644 index 0000000000000..54a25cf6983c6 --- /dev/null +++ b/components/messagebird/actions/send-sms/send-sms.mjs @@ -0,0 +1,74 @@ +import messagebird from "../../messagebird.app.mjs"; + +export default { + key: "messagebird-send-sms", + name: "Send SMS", + description: "Sends an SMS message. [See the documentation](https://docs.bird.com/api/channels-api/supported-channels/programmable-sms/sending-sms-messages)", + version: "0.0.1", + type: "action", + props: { + messagebird, + organizationId: { + propDefinition: [ + messagebird, + "organizationId", + ], + }, + workspaceId: { + propDefinition: [ + messagebird, + "workspaceId", + (c) => ({ + organizationId: c.organizationId, + }), + ], + }, + channelId: { + propDefinition: [ + messagebird, + "channelId", + (c) => ({ + workspaceId: c.workspaceId, + }), + ], + }, + contactId: { + propDefinition: [ + messagebird, + "contactId", + (c) => ({ + workspaceId: c.workspaceId, + }), + ], + }, + message: { + type: "string", + label: "Message", + description: "The message text to send", + }, + }, + async run({ $ }) { + const response = await this.messagebird.sendSmsMessage({ + $, + workspaceId: this.workspaceId, + channelId: this.channelId, + data: { + receiver: { + contacts: [ + { + id: this.contactId, + }, + ], + }, + body: { + type: "text", + text: { + text: this.message, + }, + }, + }, + }); + $.export("$summary", `Successfully sent SMS message with ID: ${response.id}`); + return response; + }, +}; diff --git a/components/messagebird/actions/send-voice-message/send-voice-message.mjs b/components/messagebird/actions/send-voice-message/send-voice-message.mjs new file mode 100644 index 0000000000000..d4da215baf670 --- /dev/null +++ b/components/messagebird/actions/send-voice-message/send-voice-message.mjs @@ -0,0 +1,69 @@ +import messagebird from "../../messagebird.app.mjs"; + +export default { + key: "messagebird-send-voice-message", + name: "Send Voice Message", + description: "Send a voice message to any phone number globally. [See the documentation](https://docs.bird.com/api/voice-api/voice-calls-api/initiate-an-outbound-call)", + version: "0.0.1", + type: "action", + props: { + messagebird, + organizationId: { + propDefinition: [ + messagebird, + "organizationId", + ], + }, + workspaceId: { + propDefinition: [ + messagebird, + "workspaceId", + (c) => ({ + organizationId: c.organizationId, + }), + ], + }, + channelId: { + propDefinition: [ + messagebird, + "channelId", + (c) => ({ + workspaceId: c.workspaceId, + }), + ], + }, + recipientNumber: { + type: "string", + label: "Recipient Number", + description: "The phone number to send the message to. Example: `+351000000000`", + }, + message: { + type: "string", + label: "Message", + description: "The message to send as a voice message", + }, + }, + async run({ $ }) { + const response = await this.messagebird.sendVoiceMessage({ + $, + workspaceId: this.workspaceId, + channelId: this.channelId, + data: { + to: this.recipientNumber, + callFlow: [ + { + options: { + text: this.message, + }, + command: "say", + }, + { + command: "hangup", + }, + ], + }, + }); + $.export("$summary", `Successfully sent voice message with ID: ${response.id}`); + return response; + }, +}; diff --git a/components/messagebird/app/messagebird.app.ts b/components/messagebird/app/messagebird.app.ts deleted file mode 100644 index 5d564cb3bc9a5..0000000000000 --- a/components/messagebird/app/messagebird.app.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineApp } from "@pipedream/types"; - -export default defineApp({ - type: "app", - app: "messagebird", - propDefinitions: {}, - methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); - }, - }, -}); \ No newline at end of file diff --git a/components/messagebird/messagebird.app.mjs b/components/messagebird/messagebird.app.mjs new file mode 100644 index 0000000000000..ac40c8ca36f42 --- /dev/null +++ b/components/messagebird/messagebird.app.mjs @@ -0,0 +1,218 @@ +import { axios } from "@pipedream/platform"; + +export default { + type: "app", + app: "messagebird", + propDefinitions: { + organizationId: { + type: "string", + label: "Organization ID", + description: "The unique identifier of an organization. Found in Organization Settings", + }, + workspaceId: { + type: "string", + label: "Workspace ID", + description: "The unique identifier of a workspace", + async options({ + organizationId, prevContext, + }) { + const { next: pageToken } = prevContext; + const { + results, nextPageToken, + } = await this.listWorkspaces({ + organizationId, + params: pageToken + ? { + pageToken, + } + : {}, + }); + return { + options: results?.map(({ + id: value, name: label, + }) => ({ + value, + label, + })) || [], + context: { + next: nextPageToken, + }, + }; + }, + }, + channelId: { + type: "string", + label: "Channel ID", + description: "The unique identifier of a channel", + async options({ + workspaceId, prevContext, + }) { + const { next: pageToken } = prevContext; + const { + results, nextPageToken, + } = await this.listChannels({ + workspaceId, + params: pageToken + ? { + pageToken, + } + : {}, + }); + return { + options: results?.map(({ + id: value, name: label, + }) => ({ + value, + label, + })) || [], + context: { + next: nextPageToken, + }, + }; + }, + }, + contactId: { + type: "string", + label: "Contact ID", + description: "The contact to send the message to", + async options({ + workspaceId, prevContext, + }) { + const { next: pageToken } = prevContext; + const { + results, nextPageToken, + } = await this.listContacts({ + workspaceId, + params: pageToken + ? { + pageToken, + } + : {}, + }); + return { + options: results?.map(({ + id: value, computedDisplayName: label, + }) => ({ + value, + label, + })) || [], + context: { + next: nextPageToken, + }, + }; + }, + }, + listIds: { + type: "string[]", + label: "List IDs", + description: "An array of unique list identifiers to add the contact to", + optional: true, + async options({ workspaceId }) { + const { results } = await this.listLists({ + workspaceId, + }); + return results?.map(({ + id: value, name: label, + }) => ({ + value, + label, + })) || []; + }, + }, + }, + methods: { + _baseUrl() { + return "https://api.bird.com"; + }, + _makeRequest({ + $ = this, + path, + ...otherOpts + }) { + return axios($, { + url: `${this._baseUrl()}${path}`, + headers: { + "Authorization": `AccessKey ${this.$auth.api_key}`, + }, + ...otherOpts, + }); + }, + createWebhook({ + organizationId, workspaceId, ...opts + }) { + return this._makeRequest({ + method: "POST", + path: `/organizations/${organizationId}/workspaces/${workspaceId}/webhook-subscriptions`, + ...opts, + }); + }, + deleteWebhook({ + organizationId, workspaceId, hookId, ...opts + }) { + return this._makeRequest({ + method: "DELETE", + path: `/organizations/${organizationId}/workspaces/${workspaceId}/webhook-subscriptions/${hookId}`, + ...opts, + }); + }, + listWorkspaces({ + organizationId, ...opts + }) { + return this._makeRequest({ + path: `/organizations/${organizationId}/workspaces`, + ...opts, + }); + }, + listChannels({ + workspaceId, ...opts + }) { + return this._makeRequest({ + path: `/workspaces/${workspaceId}/channels`, + ...opts, + }); + }, + listLists({ + workspaceId, ...opts + }) { + return this._makeRequest({ + path: `/workspaces/${workspaceId}/lists`, + ...opts, + }); + }, + listContacts({ + workspaceId, ...opts + }) { + return this._makeRequest({ + path: `/workspaces/${workspaceId}/contacts`, + ...opts, + }); + }, + createContact({ + workspaceId, ...opts + }) { + return this._makeRequest({ + method: "POST", + path: `/workspaces/${workspaceId}/contacts`, + ...opts, + }); + }, + sendVoiceMessage({ + workspaceId, channelId, ...opts + }) { + return this._makeRequest({ + method: "POST", + path: `/workspaces/${workspaceId}/channels/${channelId}/calls`, + ...opts, + }); + }, + sendSmsMessage({ + workspaceId, channelId, ...opts + }) { + return this._makeRequest({ + method: "POST", + path: `/workspaces/${workspaceId}/channels/${channelId}/messages`, + ...opts, + }); + }, + }, +}; diff --git a/components/messagebird/package.json b/components/messagebird/package.json index 0d01bddd480fb..d310b2d0704ae 100644 --- a/components/messagebird/package.json +++ b/components/messagebird/package.json @@ -1,16 +1,18 @@ { "name": "@pipedream/messagebird", - "version": "0.0.2", + "version": "0.1.0", "description": "Pipedream MessageBird Components", - "main": "dist/app/messagebird.app.mjs", + "main": "/messagebird.app.mjs", "keywords": [ "pipedream", "messagebird" ], - "files": ["dist"], "homepage": "https://pipedream.com/apps/messagebird", "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.0.3" } } diff --git a/components/messagebird/sources/new-message-received/new-message-received.mjs b/components/messagebird/sources/new-message-received/new-message-received.mjs new file mode 100644 index 0000000000000..c453b47cb3b60 --- /dev/null +++ b/components/messagebird/sources/new-message-received/new-message-received.mjs @@ -0,0 +1,97 @@ +import messagebird from "../../messagebird.app.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + key: "messagebird-new-message-received", + name: "New Message Received (Instant)", + description: "Emit new event for each new message received. [See the documentation](https://docs.bird.com/api/notifications-api/api-reference/webhook-subscriptions/create-a-webhook-subscription)", + version: "0.0.1", + dedupe: "unique", + type: "source", + props: { + messagebird, + http: "$.interface.http", + db: "$.service.db", + organizationId: { + propDefinition: [ + messagebird, + "organizationId", + ], + }, + workspaceId: { + propDefinition: [ + messagebird, + "workspaceId", + (c) => ({ + organizationId: c.organizationId, + }), + ], + }, + platform: { + type: "string", + label: "Platform", + description: "The type of inbound message to watch for", + options: [ + "sms", + "whatsapp", + "email", + "line", + "instagram", + "facebook", + "line", + "viber", + "linkedin", + "tiktok", + "telegram", + ], + }, + }, + hooks: { + async activate() { + const { id } = await this.messagebird.createWebhook({ + organizationId: this.organizationId, + workspaceId: this.workspaceId, + data: { + service: "channels", + event: `${this.platform}.inbound`, + url: this.http.endpoint, + }, + }); + this._setHookId(id); + }, + async deactivate() { + const hookId = this._getHookId(); + if (hookId) { + await this.messagebird.deleteWebhook({ + organizationId: this.organizationId, + workspaceId: this.workspaceId, + hookId, + }); + } + }, + }, + methods: { + _getHookId() { + return this.db.get("hookId"); + }, + _setHookId(hookId) { + this.db.set("hookId", hookId); + }, + generateMeta(event) { + return { + id: event.payload.id, + summary: `New Message ID: ${event.payload.id}`, + ts: Date.parse(event.createdAt), + }; + }, + }, + async run(event) { + const { body } = event; + if (!body) { + return; + } + const meta = this.generateMeta(body); + this.$emit(body, meta); + }, + sampleEmit, +}; diff --git a/components/messagebird/sources/new-message-received/test-event.mjs b/components/messagebird/sources/new-message-received/test-event.mjs new file mode 100644 index 0000000000000..c86ec5b5ee366 --- /dev/null +++ b/components/messagebird/sources/new-message-received/test-event.mjs @@ -0,0 +1,44 @@ +export default { + "service": "channels", + "event": "whatsapp.inbound", + "payload": { + "id": "404544c5-9920-45f1-8990-0855634ab7ac", + "channelId": "52ad151f-f7b4-46f9-a5c6-d3318e650c84", + "sender": { + "contact": { + "id": "d4e8935a-5f48-45a5-95a5-ee7ba1e2c5b4", + "identifierKey": "phonenumber", + "identifierValue": "+3511111111" + } + }, + "receiver": { + "connector": { + "id": "60bf59d6-fc6f-4511-89c4-75d9127d7a7c", + "identifierValue": "" + } + }, + "body": { + "type": "text", + "text": { + "text": "Test" + } + }, + "meta": { + "extraInformation": { + "timestamp": "1702496037" + } + }, + "reference": "", + "parts": [ + { + "platformReference": "wamid.HBgMMzUxOTE0MjYyNTM1FQIAEhggQUMzODQyNUY1MDlDQkU1QjJGNTM3RDlENjg0OTJGMDgA" + } + ], + "status": "delivered", + "reason": "", + "direction": "incoming", + "lastStatusAt": "2023-12-13T19:34:01.858Z", + "createdAt": "2023-12-13T19:34:01.858Z", + "updatedAt": "2023-12-13T19:34:02.063Z" + } +} \ No newline at end of file From 80c5b73e87ba80b8a887d8257495289d62dd5663 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 9 Jan 2025 16:50:20 -0500 Subject: [PATCH 2/9] pnpm-lock.yaml --- pnpm-lock.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 62627ea2c59d7..33e5170d1f522 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6357,7 +6357,11 @@ importers: specifier: ^3.0.0 version: 3.0.3 - components/messagebird: {} + components/messagebird: + dependencies: + '@pipedream/platform': + specifier: ^3.0.3 + version: 3.0.3 components/metabase: {} From 9765ed1f34c9ad7476d6fb090c2b41c47feeb56d Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Thu, 9 Jan 2025 17:01:15 -0500 Subject: [PATCH 3/9] updates --- components/messagebird/package.json | 2 +- .../sources/new-message-received/new-message-received.mjs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/components/messagebird/package.json b/components/messagebird/package.json index d310b2d0704ae..2c188834d5cd3 100644 --- a/components/messagebird/package.json +++ b/components/messagebird/package.json @@ -2,7 +2,7 @@ "name": "@pipedream/messagebird", "version": "0.1.0", "description": "Pipedream MessageBird Components", - "main": "/messagebird.app.mjs", + "main": "messagebird.app.mjs", "keywords": [ "pipedream", "messagebird" diff --git a/components/messagebird/sources/new-message-received/new-message-received.mjs b/components/messagebird/sources/new-message-received/new-message-received.mjs index c453b47cb3b60..6f0afd11c50a3 100644 --- a/components/messagebird/sources/new-message-received/new-message-received.mjs +++ b/components/messagebird/sources/new-message-received/new-message-received.mjs @@ -38,7 +38,6 @@ export default { "line", "instagram", "facebook", - "line", "viber", "linkedin", "tiktok", From aac32d30fd615529e799b24d945643c1bab6e317 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Fri, 10 Jan 2025 11:59:22 -0500 Subject: [PATCH 4/9] update async options --- components/messagebird/messagebird.app.mjs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/messagebird/messagebird.app.mjs b/components/messagebird/messagebird.app.mjs index ac40c8ca36f42..0c2f5f29ab348 100644 --- a/components/messagebird/messagebird.app.mjs +++ b/components/messagebird/messagebird.app.mjs @@ -16,6 +16,9 @@ export default { async options({ organizationId, prevContext, }) { + if (!organizationId) { + return []; + } const { next: pageToken } = prevContext; const { results, nextPageToken, @@ -47,6 +50,9 @@ export default { async options({ workspaceId, prevContext, }) { + if (!workspaceId) { + return []; + } const { next: pageToken } = prevContext; const { results, nextPageToken, @@ -78,6 +84,9 @@ export default { async options({ workspaceId, prevContext, }) { + if (!workspaceId) { + return []; + } const { next: pageToken } = prevContext; const { results, nextPageToken, @@ -108,6 +117,9 @@ export default { description: "An array of unique list identifiers to add the contact to", optional: true, async options({ workspaceId }) { + if (!workspaceId) { + return []; + } const { results } = await this.listLists({ workspaceId, }); From 4875d01d3a4984cc812cdde69d13d22858eedf7f Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Mon, 13 Jan 2025 15:06:36 -0500 Subject: [PATCH 5/9] new components --- .../actions/create-contact/create-contact.mjs | 41 ++++++++++++ .../actions/send-sms/send-sms.mjs | 45 +++++++++++++ .../send-voice-message/send-voice-message.mjs | 45 +++++++++++++ components/message_bird/message_bird.app.mjs | 65 +++++++++++++++++-- components/message_bird/package.json | 18 +++++ .../new-sms-message-received.mjs | 62 ++++++++++++++++++ 6 files changed, 272 insertions(+), 4 deletions(-) create mode 100644 components/message_bird/actions/create-contact/create-contact.mjs create mode 100644 components/message_bird/actions/send-sms/send-sms.mjs create mode 100644 components/message_bird/actions/send-voice-message/send-voice-message.mjs create mode 100644 components/message_bird/package.json create mode 100644 components/message_bird/sources/new-sms-message-received/new-sms-message-received.mjs diff --git a/components/message_bird/actions/create-contact/create-contact.mjs b/components/message_bird/actions/create-contact/create-contact.mjs new file mode 100644 index 0000000000000..99c5fb190099d --- /dev/null +++ b/components/message_bird/actions/create-contact/create-contact.mjs @@ -0,0 +1,41 @@ +import messagebird from "../../message_bird.app.mjs"; + +export default { + key: "message_bird-create-contact", + name: "Create Contact", + description: "Creates a new contact. [See the documentation](https://developers.messagebird.com/api/contacts/#create-a-contact)", + version: "0.0.1", + type: "action", + props: { + messagebird, + phone: { + type: "string", + label: "Phone", + description: "The phone number of the contact. Example: `31612345678`", + }, + firstName: { + type: "string", + label: "First Name", + description: "First name of the contact", + optional: true, + }, + lastName: { + type: "string", + label: "Last Name", + description: "Last name of the contact", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.messagebird.createContact({ + $, + data: { + msisdn: this.phone, + firstName: this.firstName, + lastName: this.lastName, + }, + }); + $.export("$summary", `Successfully created contact with ID ${response.id}`); + return response; + }, +}; diff --git a/components/message_bird/actions/send-sms/send-sms.mjs b/components/message_bird/actions/send-sms/send-sms.mjs new file mode 100644 index 0000000000000..72cd578d3268e --- /dev/null +++ b/components/message_bird/actions/send-sms/send-sms.mjs @@ -0,0 +1,45 @@ +import messagebird from "../../message_bird.app.mjs"; + +export default { + key: "message_bird-send-sms", + name: "Send SMS", + description: "Sends an SMS message. [See the documentation](https://developers.messagebird.com/api/sms-messaging/#send-outbound-sms)", + version: "0.0.1", + type: "action", + props: { + messagebird, + originator: { + propDefinition: [ + messagebird, + "originator", + ], + }, + body: { + propDefinition: [ + messagebird, + "body", + ], + }, + recipients: { + propDefinition: [ + messagebird, + "recipients", + ], + }, + }, + async run({ $ }) { + const response = await this.messagebird.sendSMS({ + $, + data: { + originator: this.originator, + body: this.body, + recipients: typeof this.recipients === "string" + ? JSON.parse(this.recipients) + : this.recipients, + type: "sms", + }, + }); + $.export("$summary", `Successfully sent SMS with ID ${response.id}`); + return response; + }, +}; diff --git a/components/message_bird/actions/send-voice-message/send-voice-message.mjs b/components/message_bird/actions/send-voice-message/send-voice-message.mjs new file mode 100644 index 0000000000000..e43c9ab314baf --- /dev/null +++ b/components/message_bird/actions/send-voice-message/send-voice-message.mjs @@ -0,0 +1,45 @@ +import messagebird from "../../message_bird.app.mjs"; + +export default { + key: "message_bird-send-voice-message", + name: "Send Voice Message", + description: "Sends a voice message. [See the documentation](https://developers.messagebird.com/api/voice-messaging/#send-a-voice-message)", + version: "0.0.1", + type: "action", + props: { + messagebird, + body: { + propDefinition: [ + messagebird, + "body", + ], + }, + recipients: { + propDefinition: [ + messagebird, + "recipients", + ], + }, + originator: { + propDefinition: [ + messagebird, + "originator", + ], + optional: true, + }, + }, + async run({ $ }) { + const response = await this.messagebird.sendVoiceMessage({ + $, + data: { + body: this.body, + recipients: typeof this.recipients === "string" + ? JSON.parse(this.recipients) + : this.recipients, + originator: this.originator, + }, + }); + $.export("$summary", `Successfully sent voice message with ID ${response.id}`); + return response; + }, +}; diff --git a/components/message_bird/message_bird.app.mjs b/components/message_bird/message_bird.app.mjs index 16d8c68358749..10b2d1036cad2 100644 --- a/components/message_bird/message_bird.app.mjs +++ b/components/message_bird/message_bird.app.mjs @@ -1,11 +1,68 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "message_bird", - propDefinitions: {}, + propDefinitions: { + originator: { + type: "string", + label: "Originator", + description: "The sender of the message. This can be a telephone number (including country code) or an alphanumeric string. In case of an alphanumeric string, the maximum length is 11 characters.", + }, + body: { + type: "string", + label: "Body", + description: "The body of the message", + }, + recipients: { + type: "string[]", + label: "Recipients", + description: "An array of recipients msisdns (phone numbers)", + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://rest.messagebird.com"; + }, + _makeRequest({ + $ = this, + path, + ...opts + }) { + return axios($, { + url: `${this._baseUrl()}${path}`, + headers: { + "Authorization": `AccessKey ${this.$auth.access_key}`, + }, + ...opts, + }); + }, + listSMSMessages(opts = {}) { + return this._makeRequest({ + path: "/messages", + ...opts, + }); + }, + createContact(opts = {}) { + return this._makeRequest({ + method: "POST", + path: "/contacts", + ...opts, + }); + }, + sendSMS(opts = {}) { + return this._makeRequest({ + method: "POST", + path: "/messages", + ...opts, + }); + }, + sendVoiceMessage(opts = {}) { + return this._makeRequest({ + method: "POST", + path: "/voicemessages", + ...opts, + }); }, }, }; diff --git a/components/message_bird/package.json b/components/message_bird/package.json new file mode 100644 index 0000000000000..65d5b369395af --- /dev/null +++ b/components/message_bird/package.json @@ -0,0 +1,18 @@ +{ + "name": "@pipedream/message_bird", + "version": "0.0.1", + "description": "Pipedream MessageBird Components", + "main": "message_bird.app.mjs", + "keywords": [ + "pipedream", + "message_bird" + ], + "homepage": "https://pipedream.com/apps/message_bird", + "author": "Pipedream (https://pipedream.com/)", + "publishConfig": { + "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.0.3" + } +} diff --git a/components/message_bird/sources/new-sms-message-received/new-sms-message-received.mjs b/components/message_bird/sources/new-sms-message-received/new-sms-message-received.mjs new file mode 100644 index 0000000000000..66cdcc18c7f0e --- /dev/null +++ b/components/message_bird/sources/new-sms-message-received/new-sms-message-received.mjs @@ -0,0 +1,62 @@ +import messagebird from "../../message_bird.app.mjs"; +import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform"; + +export default { + key: "message_bird-new-sms-message-received", + name: "New SMS Message Received", + description: "Emit new event when a new SMS message is received. [See the documentation](https://developers.messagebird.com/api/sms-messaging/#list-messages)", + version: "0.0.1", + dedupe: "unique", + type: "source", + props: { + messagebird, + db: "$.service.db", + timer: { + type: "$.interface.timer", + default: { + intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL, + }, + }, + }, + methods: { + _getLastTs() { + return this.db.get("lastTs"); + }, + _setLastTs(lastTs) { + this.db.set("lastTs", lastTs); + }, + generateMeta(message) { + return { + id: message.id, + summary: `New Message ID: ${message.id}`, + ts: Date.parse(message.createdDatetime), + }; + }, + }, + async run() { + let lastTs = this._getLastTs(); + + const { items } = await this.messagebird.listSMSMessages({ + params: { + direction: "mo", // mt = sent, mo = received + type: "sms", + from: lastTs, + }, + }); + + if (!items?.length) { + return; + } + + for (const message of items) { + const meta = this.generateMeta(message); + this.$emit(message, meta); + + if (Date.parse(message.createdDatetime) > Date.parse(lastTs)) { + lastTs = message.createdDatetime; + } + } + + this._setLastTs(lastTs); + }, +}; From 842404094d7c5a11072736f47ebf9799c1744ed1 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Mon, 13 Jan 2025 15:08:40 -0500 Subject: [PATCH 6/9] pnpm-lock.yaml --- pnpm-lock.yaml | 151 +++++++++++++++++++++---------------------------- 1 file changed, 63 insertions(+), 88 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 33e5170d1f522..8c9ead879542d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6357,6 +6357,12 @@ importers: specifier: ^3.0.0 version: 3.0.3 + components/message_bird: + dependencies: + '@pipedream/platform': + specifier: ^3.0.3 + version: 3.0.3 + components/messagebird: dependencies: '@pipedream/platform': @@ -12372,10 +12378,10 @@ importers: version: 14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) nextra: specifier: latest - version: 3.3.1(@types/react@18.3.12)(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3) + version: 4.0.0(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3) nextra-theme-docs: specifier: latest - version: 3.3.1(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(nextra@3.3.1(@types/react@18.3.12)(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 4.0.0(@types/react@18.3.12)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(nextra@4.0.0(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: specifier: ^18.3.1 version: 18.3.1 @@ -14701,12 +14707,6 @@ packages: '@mdx-js/mdx@3.1.0': resolution: {integrity: sha512-/QxEhPAvGwbQmy1Px8F899L5Uc2KZ6JtXwlCgJmjSTBedwOZkByYcBG4GceIGPXRDsmfxhHazuS+hlOShRLeDw==} - '@mdx-js/react@3.1.0': - resolution: {integrity: sha512-QjHtSaoameoalGnKDT3FoIl4+9RwyTmo9ZJGBdLOks/YOiWHoRDI3PUwEzOE7kEmGcV3AFcp9K6dYu9rEuKLAQ==} - peerDependencies: - '@types/react': '>=16' - react: '>=16' - '@memberstack/admin@1.3.1': resolution: {integrity: sha512-ulRCIpt6k/3RIag+YyU2eW+b0Ik1pF+gXx2b+hYI3Mk6/NxwzZWTVC+YJw3BO3tRUq9TOFy7IaPMfm8wQTJYIA==} @@ -16776,8 +16776,8 @@ packages: '@tediousjs/connection-string@0.5.0': resolution: {integrity: sha512-7qSgZbincDDDFyRweCIEvZULFAw5iz/DeunhvuxpL31nfntX3P4Yd4HkHBRg9H8CdqY1e5WFN1PZIz/REL9MVQ==} - '@theguild/remark-mermaid@0.1.3': - resolution: {integrity: sha512-2FjVlaaKXK7Zj7UJAgOVTyaahn/3/EAfqYhyXg0BfDBVUl+lXcoIWRaxzqfnDr2rv8ax6GsC5mNh6hAaT86PDw==} + '@theguild/remark-mermaid@0.2.0': + resolution: {integrity: sha512-o8n57TJy0OI4PCrNw8z6S+vpHtrwoQZzTA5Y3fL0U1NDRIoMg/78duWgEBFsCZcWM1G6zjE91yg1aKCsDwgE2Q==} peerDependencies: react: ^18.2.0 @@ -19648,10 +19648,6 @@ packages: ext@1.7.0: resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} - extend-shallow@2.0.1: - resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==} - engines: {node: '>=0.10.0'} - extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} @@ -19900,9 +19896,6 @@ packages: resolution: {integrity: sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg==} deprecated: flatten is deprecated in favor of utility frameworks such as lodash. - flexsearch@0.7.43: - resolution: {integrity: sha512-c5o/+Um8aqCSOXGcZoqZOm+NqtVwNsvVpWv6lfmSclU954O3wvQKxxK8zj74fPaSJbXpSLTs4PRhh+wnoCXnKg==} - flush-write-stream@2.0.0: resolution: {integrity: sha512-uXClqPxT4xW0lcdSBheb2ObVU+kuqUk3Jk64EwieirEXZx9XUrVwp/JuBfKAWaM4T5Td/VL7QLDWPXp/MvGm/g==} @@ -20388,10 +20381,6 @@ packages: resolution: {integrity: sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} - gray-matter@4.0.3: - resolution: {integrity: sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==} - engines: {node: '>=6.0'} - gtoken@5.3.2: resolution: {integrity: sha512-gkvEKREW7dXWF8NV8pVrKfW7WqReAmjjkMBh6lNCCGOM4ucS0r0YyXXl0r/9Yj8wcW/32ISkfc8h5mPTDbtifQ==} engines: {node: '>=10'} @@ -20864,10 +20853,6 @@ packages: is-electron@2.2.2: resolution: {integrity: sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==} - is-extendable@0.1.1: - resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} - engines: {node: '>=0.10.0'} - is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -22587,19 +22572,19 @@ packages: sass: optional: true - nextra-theme-docs@3.3.1: - resolution: {integrity: sha512-P305m2UcW2IDyQhjrcAu0qpdPArikofinABslUCAyixYShsmcdDRUhIMd4QBHYru4gQuVjGWX9PhWZZCbNvzDQ==} + nextra-theme-docs@4.0.0: + resolution: {integrity: sha512-IgX73GjkSLureZtP9gxanm3/N5hmznyXH4VCuDFZEk1DnX/PDyN77oXoaRYqDY8XaNwZ1EPGvYGd7RcMUiiGWw==} peerDependencies: - next: '>=13' - nextra: 3.3.1 + next: '>=14' + nextra: 4.0.0 react: '>=18' react-dom: '>=18' - nextra@3.3.1: - resolution: {integrity: sha512-jiwj+LfUPHHeAxJAEqFuglxnbjFgzAOnDWFsjv7iv3BWiX8OksDwd3I2Sv3j2zba00iIBDEPdNeylfzTtTLZVg==} + nextra@4.0.0: + resolution: {integrity: sha512-qcJ4cudhl7ooMWaqCtrpfkq93/OqtLzkQn98MncuHTZbjhAuqXQQz4rQqc5AI0GUX97cF//OhDgYjSEVpSRWEg==} engines: {node: '>=18'} peerDependencies: - next: '>=13' + next: '>=14' react: '>=18' react-dom: '>=18' @@ -22949,10 +22934,6 @@ packages: resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - p-limit@6.1.0: - resolution: {integrity: sha512-H0jc0q1vOzlEk0TqAKXKZxdl7kX3OFUzCnNVUnq5Pc3DGo0kpeaMuPqxQn235HibwBEb0/pm9dgKTjXy66fBkg==} - engines: {node: '>=18'} - p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} @@ -23618,6 +23599,11 @@ packages: resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} engines: {node: '>= 0.8'} + react-compiler-runtime@0.0.0-experimental-22c6e49-20241219: + resolution: {integrity: sha512-bOAGaRL1ldfIIpbDsl+uV025Ta6RS6/cOjvvh8r2Vo7KtqB+RSvihVYRsWQz7ECKNPWdq5MClS845acwAwieDw==} + peerDependencies: + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom@18.3.1: resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} peerDependencies: @@ -24153,10 +24139,6 @@ packages: search-insights@2.17.3: resolution: {integrity: sha512-RQPdCYTa8A68uM2jwxoY842xDhvx3E5LFL1LxvxCNMev4o5mLuokczhzjAgGwUZBAmOKZknArSxLKmXtIi2AxQ==} - section-matter@1.0.0: - resolution: {integrity: sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==} - engines: {node: '>=4'} - selderee@0.11.0: resolution: {integrity: sha512-5TF+l7p4+OsnP8BCCvSyZiSPc4x4//p5uPwK8TCnVPJYRmU2aYKMpOXvw8zM5a5JvuuCGN1jmsMwuU2W02ukfA==} @@ -24598,10 +24580,6 @@ packages: resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} engines: {node: '>=12'} - strip-bom-string@1.0.0: - resolution: {integrity: sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==} - engines: {node: '>=0.10.0'} - strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} @@ -25966,6 +25944,24 @@ packages: zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} + zustand@5.0.3: + resolution: {integrity: sha512-14fwWQtU3pH4dE0dOpdMiWjddcH+QzKIgk1cl8epwSE7yag43k/AD/m4L6+K7DytAOr9gGBe3/EXj9g7cdostg==} + engines: {node: '>=12.20.0'} + peerDependencies: + '@types/react': '>=18.0.0' + immer: '>=9.0.6' + react: '>=18.0.0' + use-sync-external-store: '>=1.2.0' + peerDependenciesMeta: + '@types/react': + optional: true + immer: + optional: true + react: + optional: true + use-sync-external-store: + optional: true + zwitch@1.0.5: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} @@ -29909,12 +29905,6 @@ snapshots: - acorn - supports-color - '@mdx-js/react@3.1.0(@types/react@18.3.12)(react@18.3.1)': - dependencies: - '@types/mdx': 2.0.13 - '@types/react': 18.3.12 - react: 18.3.1 - '@memberstack/admin@1.3.1': dependencies: axios: 1.6.8 @@ -32350,7 +32340,7 @@ snapshots: '@tediousjs/connection-string@0.5.0': {} - '@theguild/remark-mermaid@0.1.3(react@18.3.1)': + '@theguild/remark-mermaid@0.2.0(react@18.3.1)': dependencies: mermaid: 11.4.1 react: 18.3.1 @@ -35849,10 +35839,6 @@ snapshots: dependencies: type: 2.7.3 - extend-shallow@2.0.1: - dependencies: - is-extendable: 0.1.1 - extend@3.0.2: {} external-editor@3.1.0: @@ -36136,8 +36122,6 @@ snapshots: flatten@1.0.3: {} - flexsearch@0.7.43: {} - flush-write-stream@2.0.0: dependencies: inherits: 2.0.4 @@ -36878,13 +36862,6 @@ snapshots: graphql@16.9.0: {} - gray-matter@4.0.3: - dependencies: - js-yaml: 3.14.1 - kind-of: 6.0.3 - section-matter: 1.0.0 - strip-bom-string: 1.0.0 - gtoken@5.3.2: dependencies: gaxios: 4.3.3 @@ -37476,8 +37453,6 @@ snapshots: is-electron@2.2.2: {} - is-extendable@0.1.1: {} - is-extglob@2.1.1: {} is-finalizationregistry@1.0.2: @@ -39911,37 +39886,40 @@ snapshots: - '@babel/core' - babel-plugin-macros - nextra-theme-docs@3.3.1(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(nextra@3.3.1(@types/react@18.3.12)(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + nextra-theme-docs@4.0.0(@types/react@18.3.12)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(nextra@4.0.0(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@headlessui/react': 2.2.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) clsx: 2.1.1 - escape-string-regexp: 5.0.0 - flexsearch: 0.7.43 next: 14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) next-themes: 0.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - nextra: 3.3.1(@types/react@18.3.12)(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3) + nextra: 4.0.0(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3) react: 18.3.1 + react-compiler-runtime: 0.0.0-experimental-22c6e49-20241219(react@18.3.1) react-dom: 18.3.1(react@18.3.1) scroll-into-view-if-needed: 3.1.0 zod: 3.23.8 + zod-validation-error: 3.4.0(zod@3.23.8) + zustand: 5.0.3(@types/react@18.3.12)(react@18.3.1) + transitivePeerDependencies: + - '@types/react' + - immer + - use-sync-external-store - nextra@3.3.1(@types/react@18.3.12)(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3): + nextra@4.0.0(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3): dependencies: '@formatjs/intl-localematcher': 0.5.8 '@headlessui/react': 2.2.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mdx-js/mdx': 3.1.0(acorn@8.14.0) - '@mdx-js/react': 3.1.0(@types/react@18.3.12)(react@18.3.1) '@napi-rs/simple-git': 0.1.19 '@shikijs/twoslash': 1.24.0(typescript@5.6.3) - '@theguild/remark-mermaid': 0.1.3(react@18.3.1) + '@theguild/remark-mermaid': 0.2.0(react@18.3.1) '@theguild/remark-npm2yarn': 0.3.3 better-react-mathjax: 2.0.3(react@18.3.1) clsx: 2.1.1 estree-util-to-js: 2.0.0 estree-util-value-to-estree: 3.2.1 + fast-glob: 3.3.2 github-slugger: 2.0.0 - graceful-fs: 4.2.11 - gray-matter: 4.0.3 hast-util-to-estree: 3.1.0 katex: 0.16.11 mdast-util-from-markdown: 2.0.2 @@ -39949,8 +39927,8 @@ snapshots: mdast-util-to-hast: 13.2.0 negotiator: 1.0.0 next: 14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - p-limit: 6.1.0 react: 18.3.1 + react-compiler-runtime: 0.0.0-experimental-22c6e49-20241219(react@18.3.1) react-dom: 18.3.1(react@18.3.1) react-medium-image-zoom: 5.2.12(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rehype-katex: 7.0.1 @@ -39970,7 +39948,6 @@ snapshots: zod: 3.23.8 zod-validation-error: 3.4.0(zod@3.23.8) transitivePeerDependencies: - - '@types/react' - acorn - supports-color - typescript @@ -40389,10 +40366,6 @@ snapshots: dependencies: yocto-queue: 1.1.1 - p-limit@6.1.0: - dependencies: - yocto-queue: 1.1.1 - p-locate@4.1.0: dependencies: p-limit: 2.3.0 @@ -41307,6 +41280,10 @@ snapshots: iconv-lite: 0.4.24 unpipe: 1.0.0 + react-compiler-runtime@0.0.0-experimental-22c6e49-20241219(react@18.3.1): + dependencies: + react: 18.3.1 + react-dom@18.3.1(react@18.3.1): dependencies: loose-envify: 1.4.0 @@ -42212,11 +42189,6 @@ snapshots: search-insights@2.17.3: {} - section-matter@1.0.0: - dependencies: - extend-shallow: 2.0.1 - kind-of: 6.0.3 - selderee@0.11.0: dependencies: parseley: 0.12.1 @@ -42766,8 +42738,6 @@ snapshots: dependencies: ansi-regex: 6.1.0 - strip-bom-string@1.0.0: {} - strip-bom@3.0.0: {} strip-bom@4.0.0: {} @@ -44335,6 +44305,11 @@ snapshots: zod@3.23.8: {} + zustand@5.0.3(@types/react@18.3.12)(react@18.3.1): + optionalDependencies: + '@types/react': 18.3.12 + react: 18.3.1 + zwitch@1.0.5: {} zwitch@2.0.4: {} From 800df0a356fdfb8af1d50c5015d89b77968a0b79 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Mon, 13 Jan 2025 15:17:27 -0500 Subject: [PATCH 7/9] update --- .../new-sms-message-received/new-sms-message-received.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/message_bird/sources/new-sms-message-received/new-sms-message-received.mjs b/components/message_bird/sources/new-sms-message-received/new-sms-message-received.mjs index 66cdcc18c7f0e..24c4ced16e7c7 100644 --- a/components/message_bird/sources/new-sms-message-received/new-sms-message-received.mjs +++ b/components/message_bird/sources/new-sms-message-received/new-sms-message-received.mjs @@ -52,7 +52,7 @@ export default { const meta = this.generateMeta(message); this.$emit(message, meta); - if (Date.parse(message.createdDatetime) > Date.parse(lastTs)) { + if (!lastTs || Date.parse(message.createdDatetime) > Date.parse(lastTs)) { lastTs = message.createdDatetime; } } From 043f81c25ab42843cbbe79d754cdc1d04c04a7fc Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Tue, 14 Jan 2025 13:26:21 -0500 Subject: [PATCH 8/9] pnpm-lock.yaml --- pnpm-lock.yaml | 134 ++++++++++++++++++++++++++++++------------------- 1 file changed, 81 insertions(+), 53 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b9bd0d8146360..d9e629cbb96da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12431,11 +12431,11 @@ importers: specifier: ^14.2.5 version: 14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) nextra: - specifier: latest - version: 4.0.0(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3) + specifier: ^3 + version: 3.3.1(@types/react@18.3.12)(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3) nextra-theme-docs: - specifier: latest - version: 4.0.0(@types/react@18.3.12)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(nextra@4.0.0(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^3 + version: 3.3.1(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(nextra@3.3.1(@types/react@18.3.12)(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: specifier: ^18.3.1 version: 18.3.1 @@ -14761,6 +14761,12 @@ packages: '@mdx-js/mdx@3.1.0': resolution: {integrity: sha512-/QxEhPAvGwbQmy1Px8F899L5Uc2KZ6JtXwlCgJmjSTBedwOZkByYcBG4GceIGPXRDsmfxhHazuS+hlOShRLeDw==} + '@mdx-js/react@3.1.0': + resolution: {integrity: sha512-QjHtSaoameoalGnKDT3FoIl4+9RwyTmo9ZJGBdLOks/YOiWHoRDI3PUwEzOE7kEmGcV3AFcp9K6dYu9rEuKLAQ==} + peerDependencies: + '@types/react': '>=16' + react: '>=16' + '@memberstack/admin@1.3.1': resolution: {integrity: sha512-ulRCIpt6k/3RIag+YyU2eW+b0Ik1pF+gXx2b+hYI3Mk6/NxwzZWTVC+YJw3BO3tRUq9TOFy7IaPMfm8wQTJYIA==} @@ -16830,8 +16836,8 @@ packages: '@tediousjs/connection-string@0.5.0': resolution: {integrity: sha512-7qSgZbincDDDFyRweCIEvZULFAw5iz/DeunhvuxpL31nfntX3P4Yd4HkHBRg9H8CdqY1e5WFN1PZIz/REL9MVQ==} - '@theguild/remark-mermaid@0.2.0': - resolution: {integrity: sha512-o8n57TJy0OI4PCrNw8z6S+vpHtrwoQZzTA5Y3fL0U1NDRIoMg/78duWgEBFsCZcWM1G6zjE91yg1aKCsDwgE2Q==} + '@theguild/remark-mermaid@0.1.3': + resolution: {integrity: sha512-2FjVlaaKXK7Zj7UJAgOVTyaahn/3/EAfqYhyXg0BfDBVUl+lXcoIWRaxzqfnDr2rv8ax6GsC5mNh6hAaT86PDw==} peerDependencies: react: ^18.2.0 @@ -19705,6 +19711,10 @@ packages: ext@1.7.0: resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} + extend-shallow@2.0.1: + resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==} + engines: {node: '>=0.10.0'} + extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} @@ -19953,6 +19963,9 @@ packages: resolution: {integrity: sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg==} deprecated: flatten is deprecated in favor of utility frameworks such as lodash. + flexsearch@0.7.43: + resolution: {integrity: sha512-c5o/+Um8aqCSOXGcZoqZOm+NqtVwNsvVpWv6lfmSclU954O3wvQKxxK8zj74fPaSJbXpSLTs4PRhh+wnoCXnKg==} + flush-write-stream@2.0.0: resolution: {integrity: sha512-uXClqPxT4xW0lcdSBheb2ObVU+kuqUk3Jk64EwieirEXZx9XUrVwp/JuBfKAWaM4T5Td/VL7QLDWPXp/MvGm/g==} @@ -20438,6 +20451,10 @@ packages: resolution: {integrity: sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} + gray-matter@4.0.3: + resolution: {integrity: sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==} + engines: {node: '>=6.0'} + gtoken@5.3.2: resolution: {integrity: sha512-gkvEKREW7dXWF8NV8pVrKfW7WqReAmjjkMBh6lNCCGOM4ucS0r0YyXXl0r/9Yj8wcW/32ISkfc8h5mPTDbtifQ==} engines: {node: '>=10'} @@ -20910,6 +20927,10 @@ packages: is-electron@2.2.2: resolution: {integrity: sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==} + is-extendable@0.1.1: + resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} + engines: {node: '>=0.10.0'} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -22632,19 +22653,19 @@ packages: sass: optional: true - nextra-theme-docs@4.0.0: - resolution: {integrity: sha512-IgX73GjkSLureZtP9gxanm3/N5hmznyXH4VCuDFZEk1DnX/PDyN77oXoaRYqDY8XaNwZ1EPGvYGd7RcMUiiGWw==} + nextra-theme-docs@3.3.1: + resolution: {integrity: sha512-P305m2UcW2IDyQhjrcAu0qpdPArikofinABslUCAyixYShsmcdDRUhIMd4QBHYru4gQuVjGWX9PhWZZCbNvzDQ==} peerDependencies: - next: '>=14' - nextra: 4.0.0 + next: '>=13' + nextra: 3.3.1 react: '>=18' react-dom: '>=18' - nextra@4.0.0: - resolution: {integrity: sha512-qcJ4cudhl7ooMWaqCtrpfkq93/OqtLzkQn98MncuHTZbjhAuqXQQz4rQqc5AI0GUX97cF//OhDgYjSEVpSRWEg==} + nextra@3.3.1: + resolution: {integrity: sha512-jiwj+LfUPHHeAxJAEqFuglxnbjFgzAOnDWFsjv7iv3BWiX8OksDwd3I2Sv3j2zba00iIBDEPdNeylfzTtTLZVg==} engines: {node: '>=18'} peerDependencies: - next: '>=14' + next: '>=13' react: '>=18' react-dom: '>=18' @@ -23663,11 +23684,6 @@ packages: resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} engines: {node: '>= 0.8'} - react-compiler-runtime@0.0.0-experimental-22c6e49-20241219: - resolution: {integrity: sha512-bOAGaRL1ldfIIpbDsl+uV025Ta6RS6/cOjvvh8r2Vo7KtqB+RSvihVYRsWQz7ECKNPWdq5MClS845acwAwieDw==} - peerDependencies: - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - react-dom@18.3.1: resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} peerDependencies: @@ -24203,6 +24219,10 @@ packages: search-insights@2.17.3: resolution: {integrity: sha512-RQPdCYTa8A68uM2jwxoY842xDhvx3E5LFL1LxvxCNMev4o5mLuokczhzjAgGwUZBAmOKZknArSxLKmXtIi2AxQ==} + section-matter@1.0.0: + resolution: {integrity: sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==} + engines: {node: '>=4'} + selderee@0.11.0: resolution: {integrity: sha512-5TF+l7p4+OsnP8BCCvSyZiSPc4x4//p5uPwK8TCnVPJYRmU2aYKMpOXvw8zM5a5JvuuCGN1jmsMwuU2W02ukfA==} @@ -24644,6 +24664,10 @@ packages: resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} engines: {node: '>=12'} + strip-bom-string@1.0.0: + resolution: {integrity: sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==} + engines: {node: '>=0.10.0'} + strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} @@ -26013,24 +26037,6 @@ packages: zod@3.24.1: resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==} - zustand@5.0.3: - resolution: {integrity: sha512-14fwWQtU3pH4dE0dOpdMiWjddcH+QzKIgk1cl8epwSE7yag43k/AD/m4L6+K7DytAOr9gGBe3/EXj9g7cdostg==} - engines: {node: '>=12.20.0'} - peerDependencies: - '@types/react': '>=18.0.0' - immer: '>=9.0.6' - react: '>=18.0.0' - use-sync-external-store: '>=1.2.0' - peerDependenciesMeta: - '@types/react': - optional: true - immer: - optional: true - react: - optional: true - use-sync-external-store: - optional: true - zwitch@1.0.5: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} @@ -29974,6 +29980,12 @@ snapshots: - acorn - supports-color + '@mdx-js/react@3.1.0(@types/react@18.3.12)(react@18.3.1)': + dependencies: + '@types/mdx': 2.0.13 + '@types/react': 18.3.12 + react: 18.3.1 + '@memberstack/admin@1.3.1': dependencies: axios: 1.6.8 @@ -32409,7 +32421,7 @@ snapshots: '@tediousjs/connection-string@0.5.0': {} - '@theguild/remark-mermaid@0.2.0(react@18.3.1)': + '@theguild/remark-mermaid@0.1.3(react@18.3.1)': dependencies: mermaid: 11.4.1 react: 18.3.1 @@ -35916,6 +35928,10 @@ snapshots: dependencies: type: 2.7.3 + extend-shallow@2.0.1: + dependencies: + is-extendable: 0.1.1 + extend@3.0.2: {} external-editor@3.1.0: @@ -36199,6 +36215,8 @@ snapshots: flatten@1.0.3: {} + flexsearch@0.7.43: {} + flush-write-stream@2.0.0: dependencies: inherits: 2.0.4 @@ -36939,6 +36957,13 @@ snapshots: graphql@16.9.0: {} + gray-matter@4.0.3: + dependencies: + js-yaml: 3.14.1 + kind-of: 6.0.3 + section-matter: 1.0.0 + strip-bom-string: 1.0.0 + gtoken@5.3.2: dependencies: gaxios: 4.3.3 @@ -37530,6 +37555,8 @@ snapshots: is-electron@2.2.2: {} + is-extendable@0.1.1: {} + is-extglob@2.1.1: {} is-finalizationregistry@1.0.2: @@ -39971,34 +39998,37 @@ snapshots: - '@babel/core' - babel-plugin-macros - nextra-theme-docs@4.0.0(@types/react@18.3.12)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(nextra@4.0.0(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + nextra-theme-docs@3.3.1(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(nextra@3.3.1(@types/react@18.3.12)(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@headlessui/react': 2.2.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) clsx: 2.1.1 + escape-string-regexp: 5.0.0 + flexsearch: 0.7.43 next: 14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) next-themes: 0.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - nextra: 4.0.0(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3) + nextra: 3.3.1(@types/react@18.3.12)(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3) react: 18.3.1 - react-compiler-runtime: 0.0.0-experimental-22c6e49-20241219(react@18.3.1) react-dom: 18.3.1(react@18.3.1) scroll-into-view-if-needed: 3.1.0 zod: 3.24.1 - nextra@4.0.0(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3): + nextra@3.3.1(@types/react@18.3.12)(acorn@8.14.0)(next@14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3): dependencies: '@formatjs/intl-localematcher': 0.5.8 '@headlessui/react': 2.2.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mdx-js/mdx': 3.1.0(acorn@8.14.0) + '@mdx-js/react': 3.1.0(@types/react@18.3.12)(react@18.3.1) '@napi-rs/simple-git': 0.1.19 '@shikijs/twoslash': 1.24.0(typescript@5.6.3) - '@theguild/remark-mermaid': 0.2.0(react@18.3.1) + '@theguild/remark-mermaid': 0.1.3(react@18.3.1) '@theguild/remark-npm2yarn': 0.3.3 better-react-mathjax: 2.0.3(react@18.3.1) clsx: 2.1.1 estree-util-to-js: 2.0.0 estree-util-value-to-estree: 3.2.1 - fast-glob: 3.3.2 github-slugger: 2.0.0 + graceful-fs: 4.2.11 + gray-matter: 4.0.3 hast-util-to-estree: 3.1.0 katex: 0.16.11 mdast-util-from-markdown: 2.0.2 @@ -40008,7 +40038,6 @@ snapshots: next: 14.2.19(@babel/core@8.0.0-alpha.13)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) p-limit: 6.2.0 react: 18.3.1 - react-compiler-runtime: 0.0.0-experimental-22c6e49-20241219(react@18.3.1) react-dom: 18.3.1(react@18.3.1) react-medium-image-zoom: 5.2.12(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rehype-katex: 7.0.1 @@ -40028,6 +40057,7 @@ snapshots: zod: 3.24.1 zod-validation-error: 3.4.0(zod@3.24.1) transitivePeerDependencies: + - '@types/react' - acorn - supports-color - typescript @@ -41364,10 +41394,6 @@ snapshots: iconv-lite: 0.4.24 unpipe: 1.0.0 - react-compiler-runtime@0.0.0-experimental-22c6e49-20241219(react@18.3.1): - dependencies: - react: 18.3.1 - react-dom@18.3.1(react@18.3.1): dependencies: loose-envify: 1.4.0 @@ -42273,6 +42299,11 @@ snapshots: search-insights@2.17.3: {} + section-matter@1.0.0: + dependencies: + extend-shallow: 2.0.1 + kind-of: 6.0.3 + selderee@0.11.0: dependencies: parseley: 0.12.1 @@ -42822,6 +42853,8 @@ snapshots: dependencies: ansi-regex: 6.1.0 + strip-bom-string@1.0.0: {} + strip-bom@3.0.0: {} strip-bom@4.0.0: {} @@ -44393,11 +44426,6 @@ snapshots: zod@3.24.1: {} - zustand@5.0.3(@types/react@18.3.12)(react@18.3.1): - optionalDependencies: - '@types/react': 18.3.12 - react: 18.3.1 - zwitch@1.0.5: {} zwitch@2.0.4: {} From 9b44fb4bb1b25137a9825523225b62013b90a5c2 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Wed, 15 Jan 2025 12:42:45 -0500 Subject: [PATCH 9/9] use $auth organization_id --- .../actions/create-contact/create-contact.mjs | 9 ------ .../messagebird/actions/send-sms/send-sms.mjs | 9 ------ .../send-voice-message/send-voice-message.mjs | 9 ------ components/messagebird/messagebird.app.mjs | 31 +++++++------------ .../new-message-received.mjs | 11 ------- 5 files changed, 11 insertions(+), 58 deletions(-) diff --git a/components/messagebird/actions/create-contact/create-contact.mjs b/components/messagebird/actions/create-contact/create-contact.mjs index df57bca1e64c8..603a503d22f73 100644 --- a/components/messagebird/actions/create-contact/create-contact.mjs +++ b/components/messagebird/actions/create-contact/create-contact.mjs @@ -8,19 +8,10 @@ export default { type: "action", props: { messagebird, - organizationId: { - propDefinition: [ - messagebird, - "organizationId", - ], - }, workspaceId: { propDefinition: [ messagebird, "workspaceId", - (c) => ({ - organizationId: c.organizationId, - }), ], }, displayName: { diff --git a/components/messagebird/actions/send-sms/send-sms.mjs b/components/messagebird/actions/send-sms/send-sms.mjs index 54a25cf6983c6..87c83a0c81adc 100644 --- a/components/messagebird/actions/send-sms/send-sms.mjs +++ b/components/messagebird/actions/send-sms/send-sms.mjs @@ -8,19 +8,10 @@ export default { type: "action", props: { messagebird, - organizationId: { - propDefinition: [ - messagebird, - "organizationId", - ], - }, workspaceId: { propDefinition: [ messagebird, "workspaceId", - (c) => ({ - organizationId: c.organizationId, - }), ], }, channelId: { diff --git a/components/messagebird/actions/send-voice-message/send-voice-message.mjs b/components/messagebird/actions/send-voice-message/send-voice-message.mjs index d4da215baf670..d01ee564985a9 100644 --- a/components/messagebird/actions/send-voice-message/send-voice-message.mjs +++ b/components/messagebird/actions/send-voice-message/send-voice-message.mjs @@ -8,19 +8,10 @@ export default { type: "action", props: { messagebird, - organizationId: { - propDefinition: [ - messagebird, - "organizationId", - ], - }, workspaceId: { propDefinition: [ messagebird, "workspaceId", - (c) => ({ - organizationId: c.organizationId, - }), ], }, channelId: { diff --git a/components/messagebird/messagebird.app.mjs b/components/messagebird/messagebird.app.mjs index 0c2f5f29ab348..6b4f3e23c7039 100644 --- a/components/messagebird/messagebird.app.mjs +++ b/components/messagebird/messagebird.app.mjs @@ -4,26 +4,16 @@ export default { type: "app", app: "messagebird", propDefinitions: { - organizationId: { - type: "string", - label: "Organization ID", - description: "The unique identifier of an organization. Found in Organization Settings", - }, workspaceId: { type: "string", label: "Workspace ID", description: "The unique identifier of a workspace", - async options({ - organizationId, prevContext, - }) { - if (!organizationId) { - return []; - } + async options({ prevContext }) { const { next: pageToken } = prevContext; const { results, nextPageToken, } = await this.listWorkspaces({ - organizationId, + organizationId: this._organizationId(), params: pageToken ? { pageToken, @@ -136,6 +126,9 @@ export default { _baseUrl() { return "https://api.bird.com"; }, + _organizationId() { + return this.$auth.organization_id; + }, _makeRequest({ $ = this, path, @@ -150,28 +143,26 @@ export default { }); }, createWebhook({ - organizationId, workspaceId, ...opts + workspaceId, ...opts }) { return this._makeRequest({ method: "POST", - path: `/organizations/${organizationId}/workspaces/${workspaceId}/webhook-subscriptions`, + path: `/organizations/${this._organizationId()}/workspaces/${workspaceId}/webhook-subscriptions`, ...opts, }); }, deleteWebhook({ - organizationId, workspaceId, hookId, ...opts + workspaceId, hookId, ...opts }) { return this._makeRequest({ method: "DELETE", - path: `/organizations/${organizationId}/workspaces/${workspaceId}/webhook-subscriptions/${hookId}`, + path: `/organizations/${this._organizationId()}/workspaces/${workspaceId}/webhook-subscriptions/${hookId}`, ...opts, }); }, - listWorkspaces({ - organizationId, ...opts - }) { + listWorkspaces(opts = {}) { return this._makeRequest({ - path: `/organizations/${organizationId}/workspaces`, + path: `/organizations/${this._organizationId()}/workspaces`, ...opts, }); }, diff --git a/components/messagebird/sources/new-message-received/new-message-received.mjs b/components/messagebird/sources/new-message-received/new-message-received.mjs index 6f0afd11c50a3..bed0f49addaa7 100644 --- a/components/messagebird/sources/new-message-received/new-message-received.mjs +++ b/components/messagebird/sources/new-message-received/new-message-received.mjs @@ -12,19 +12,10 @@ export default { messagebird, http: "$.interface.http", db: "$.service.db", - organizationId: { - propDefinition: [ - messagebird, - "organizationId", - ], - }, workspaceId: { propDefinition: [ messagebird, "workspaceId", - (c) => ({ - organizationId: c.organizationId, - }), ], }, platform: { @@ -48,7 +39,6 @@ export default { hooks: { async activate() { const { id } = await this.messagebird.createWebhook({ - organizationId: this.organizationId, workspaceId: this.workspaceId, data: { service: "channels", @@ -62,7 +52,6 @@ export default { const hookId = this._getHookId(); if (hookId) { await this.messagebird.deleteWebhook({ - organizationId: this.organizationId, workspaceId: this.workspaceId, hookId, });