diff --git a/components/microsoft_outlook/actions/add-label-to-email/add-label-to-email.mjs b/components/microsoft_outlook/actions/add-label-to-email/add-label-to-email.mjs index f2fe8ce589359..3a9af81066342 100644 --- a/components/microsoft_outlook/actions/add-label-to-email/add-label-to-email.mjs +++ b/components/microsoft_outlook/actions/add-label-to-email/add-label-to-email.mjs @@ -5,7 +5,7 @@ export default { key: "microsoft_outlook-add-label-to-email", name: "Add Label to Email", description: "Adds a label/category to an email in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/message-update)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { microsoftOutlook, diff --git a/components/microsoft_outlook/actions/approve-workflow/approve-workflow.mjs b/components/microsoft_outlook/actions/approve-workflow/approve-workflow.mjs index 61b2771a4d46f..4c72815021825 100644 --- a/components/microsoft_outlook/actions/approve-workflow/approve-workflow.mjs +++ b/components/microsoft_outlook/actions/approve-workflow/approve-workflow.mjs @@ -4,7 +4,7 @@ export default { key: "microsoft_outlook-approve-workflow", name: "Approve Workflow", description: "Suspend the workflow until approved by email. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { microsoftOutlook, diff --git a/components/microsoft_outlook/actions/create-contact/create-contact.mjs b/components/microsoft_outlook/actions/create-contact/create-contact.mjs index eee6d78089425..d2c48e56ee64f 100644 --- a/components/microsoft_outlook/actions/create-contact/create-contact.mjs +++ b/components/microsoft_outlook/actions/create-contact/create-contact.mjs @@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs"; export default { type: "action", key: "microsoft_outlook-create-contact", - version: "0.0.10", + version: "0.0.11", name: "Create Contact", description: "Add a contact to the root Contacts folder, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-post-contacts)", props: { diff --git a/components/microsoft_outlook/actions/create-draft-email/create-draft-email.mjs b/components/microsoft_outlook/actions/create-draft-email/create-draft-email.mjs index d01b0283ede10..bdd2a959de37c 100644 --- a/components/microsoft_outlook/actions/create-draft-email/create-draft-email.mjs +++ b/components/microsoft_outlook/actions/create-draft-email/create-draft-email.mjs @@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs"; export default { type: "action", key: "microsoft_outlook-create-draft-email", - version: "0.0.10", + version: "0.0.11", name: "Create Draft Email", description: "Create a draft email, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-post-messages)", props: { diff --git a/components/microsoft_outlook/actions/find-contacts/find-contacts.mjs b/components/microsoft_outlook/actions/find-contacts/find-contacts.mjs index 63b8aa83f8428..c1f4c263c9f28 100644 --- a/components/microsoft_outlook/actions/find-contacts/find-contacts.mjs +++ b/components/microsoft_outlook/actions/find-contacts/find-contacts.mjs @@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs"; export default { type: "action", key: "microsoft_outlook-find-contacts", - version: "0.0.10", + version: "0.0.11", name: "Find Contacts", description: "Finds contacts with given search string", props: { diff --git a/components/microsoft_outlook/actions/find-email/find-email.mjs b/components/microsoft_outlook/actions/find-email/find-email.mjs index 50d9b821ea507..b467534ae8408 100644 --- a/components/microsoft_outlook/actions/find-email/find-email.mjs +++ b/components/microsoft_outlook/actions/find-email/find-email.mjs @@ -4,7 +4,7 @@ export default { key: "microsoft_outlook-find-email", name: "Find Email", description: "Search for an email in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-messages)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { microsoftOutlook, diff --git a/components/microsoft_outlook/actions/list-contacts/list-contacts.mjs b/components/microsoft_outlook/actions/list-contacts/list-contacts.mjs index 415d6387a04ef..9b8ef94065dd8 100644 --- a/components/microsoft_outlook/actions/list-contacts/list-contacts.mjs +++ b/components/microsoft_outlook/actions/list-contacts/list-contacts.mjs @@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs"; export default { type: "action", key: "microsoft_outlook-list-contacts", - version: "0.0.10", + version: "0.0.11", name: "List Contacts", description: "Get a contact collection from the default contacts folder, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-list-contacts)", props: { diff --git a/components/microsoft_outlook/actions/list-folders/list-folders.mjs b/components/microsoft_outlook/actions/list-folders/list-folders.mjs index 73de1ea228345..8985c862ecb1b 100644 --- a/components/microsoft_outlook/actions/list-folders/list-folders.mjs +++ b/components/microsoft_outlook/actions/list-folders/list-folders.mjs @@ -4,7 +4,7 @@ export default { key: "microsoft_outlook-list-folders", name: "List Folders", description: "Retrieves a list of all folders in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-mailfolders)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { microsoftOutlook, diff --git a/components/microsoft_outlook/actions/list-labels/list-labels.mjs b/components/microsoft_outlook/actions/list-labels/list-labels.mjs index c201c5c2d2571..58e5106665756 100644 --- a/components/microsoft_outlook/actions/list-labels/list-labels.mjs +++ b/components/microsoft_outlook/actions/list-labels/list-labels.mjs @@ -4,7 +4,7 @@ export default { key: "microsoft_outlook-list-labels", name: "List Labels", description: "Get all the labels/categories that have been defined for a user. [See the documentation](https://learn.microsoft.com/en-us/graph/api/outlookuser-list-mastercategories)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { microsoftOutlook, diff --git a/components/microsoft_outlook/actions/move-email-to-folder/move-email-to-folder.mjs b/components/microsoft_outlook/actions/move-email-to-folder/move-email-to-folder.mjs index b0e036542ec2a..893f6ff270340 100644 --- a/components/microsoft_outlook/actions/move-email-to-folder/move-email-to-folder.mjs +++ b/components/microsoft_outlook/actions/move-email-to-folder/move-email-to-folder.mjs @@ -4,7 +4,7 @@ export default { key: "microsoft_outlook-move-email-to-folder", name: "Move Email to Folder", description: "Moves an email to the specified folder in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/message-move)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { microsoftOutlook, diff --git a/components/microsoft_outlook/actions/remove-label-from-email/remove-label-from-email.mjs b/components/microsoft_outlook/actions/remove-label-from-email/remove-label-from-email.mjs index 4a4c00dd64965..cf60aae5f57d4 100644 --- a/components/microsoft_outlook/actions/remove-label-from-email/remove-label-from-email.mjs +++ b/components/microsoft_outlook/actions/remove-label-from-email/remove-label-from-email.mjs @@ -4,7 +4,7 @@ export default { key: "microsoft_outlook-remove-label-from-email", name: "Remove Label from Email", description: "Removes a label/category from an email in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/message-update)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { microsoftOutlook, diff --git a/components/microsoft_outlook/actions/reply-to-email/reply-to-email.mjs b/components/microsoft_outlook/actions/reply-to-email/reply-to-email.mjs new file mode 100644 index 0000000000000..1427326ad7c3d --- /dev/null +++ b/components/microsoft_outlook/actions/reply-to-email/reply-to-email.mjs @@ -0,0 +1,77 @@ +import microsoftOutlook from "../../microsoft_outlook.app.mjs"; + +export default { + key: "microsoft_outlook-reply-to-email", + name: "Reply to Email", + description: "Reply to an email in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/message-reply)", + version: "0.0.1", + type: "action", + props: { + microsoftOutlook, + messageId: { + propDefinition: [ + microsoftOutlook, + "messageId", + ], + description: "The identifier of the message to reply to", + }, + recipients: { + propDefinition: [ + microsoftOutlook, + "recipients", + ], + }, + ccRecipients: { + propDefinition: [ + microsoftOutlook, + "ccRecipients", + ], + }, + bccRecipients: { + propDefinition: [ + microsoftOutlook, + "bccRecipients", + ], + }, + subject: { + propDefinition: [ + microsoftOutlook, + "subject", + ], + }, + comment: { + propDefinition: [ + microsoftOutlook, + "content", + ], + description: "Content of the reply in text format", + }, + files: { + propDefinition: [ + microsoftOutlook, + "files", + ], + }, + expand: { + propDefinition: [ + microsoftOutlook, + "expand", + ], + description: "Additional email details, [See object definition](https://docs.microsoft.com/en-us/graph/api/resources/message)", + }, + }, + async run({ $ }) { + await this.microsoftOutlook.replyToEmail({ + $, + messageId: this.messageId, + data: { + comment: this.comment, + message: { + ...this.microsoftOutlook.prepareMessageBody(this), + ...this.expand, + }, + }, + }); + $.export("$summary", "Email has been replied to."); + }, +}; diff --git a/components/microsoft_outlook/actions/send-email/send-email.mjs b/components/microsoft_outlook/actions/send-email/send-email.mjs index db0d421e58ab5..2d29ea135ff52 100644 --- a/components/microsoft_outlook/actions/send-email/send-email.mjs +++ b/components/microsoft_outlook/actions/send-email/send-email.mjs @@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs"; export default { type: "action", key: "microsoft_outlook-send-email", - version: "0.0.11", + version: "0.0.12", name: "Send Email", description: "Send an email to one or multiple recipients, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-sendmail)", props: { diff --git a/components/microsoft_outlook/actions/update-contact/update-contact.mjs b/components/microsoft_outlook/actions/update-contact/update-contact.mjs index 3e33b9cfbc94e..c1ec99c8fe460 100644 --- a/components/microsoft_outlook/actions/update-contact/update-contact.mjs +++ b/components/microsoft_outlook/actions/update-contact/update-contact.mjs @@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs"; export default { type: "action", key: "microsoft_outlook-update-contact", - version: "0.0.10", + version: "0.0.11", name: "Update Contact", description: "Add a contact to the root Contacts folder, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-post-contacts)", props: { diff --git a/components/microsoft_outlook/microsoft_outlook.app.mjs b/components/microsoft_outlook/microsoft_outlook.app.mjs index 0542d02b3a5f0..408c69c7602b7 100644 --- a/components/microsoft_outlook/microsoft_outlook.app.mjs +++ b/components/microsoft_outlook/microsoft_outlook.app.mjs @@ -255,14 +255,16 @@ export default { } const message = { subject: self.subject, - body: { - content: self.content, - contentType: self.contentType, - }, - toRecipients, attachments, }; + if (self.content) { + message.body = { + content: self.content, + contentType: self.contentType, + }; + } + if (toRecipients.length > 0) message.toRecipients = toRecipients; if (ccRecipients.length > 0) message.ccRecipients = ccRecipients; if (bccRecipients.length > 0) message.bccRecipients = bccRecipients; @@ -275,6 +277,15 @@ export default { ...args, }); }, + async replyToEmail({ + messageId, ...args + }) { + return await this._makeRequest({ + method: "POST", + path: `/me/messages/${messageId}/reply`, + ...args, + }); + }, async createDraft({ ...args } = {}) { return await this._makeRequest({ method: "POST", diff --git a/components/microsoft_outlook/package.json b/components/microsoft_outlook/package.json index 872354b35d81d..9a396a3de3fd8 100644 --- a/components/microsoft_outlook/package.json +++ b/components/microsoft_outlook/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/microsoft_outlook", - "version": "1.3.0", + "version": "1.4.0", "description": "Pipedream Microsoft Outlook Components", "main": "microsoft_outlook.app.mjs", "keywords": [ diff --git a/components/microsoft_outlook/sources/new-contact/new-contact.mjs b/components/microsoft_outlook/sources/new-contact/new-contact.mjs index d1fe6815e160b..dd6fb5eff9ee7 100644 --- a/components/microsoft_outlook/sources/new-contact/new-contact.mjs +++ b/components/microsoft_outlook/sources/new-contact/new-contact.mjs @@ -5,7 +5,7 @@ export default { key: "microsoft_outlook-new-contact", name: "New Contact Event (Instant)", description: "Emit new event when a new Contact is created", - version: "0.0.11", + version: "0.0.12", type: "source", hooks: { ...common.hooks, diff --git a/components/microsoft_outlook/sources/new-email/new-email.mjs b/components/microsoft_outlook/sources/new-email/new-email.mjs index b5eca7cc7064f..acf6f348e7b5a 100644 --- a/components/microsoft_outlook/sources/new-email/new-email.mjs +++ b/components/microsoft_outlook/sources/new-email/new-email.mjs @@ -7,7 +7,7 @@ export default { key: "microsoft_outlook-new-email", name: "New Email Event (Instant)", description: "Emit new event when an email is received in specified folders.", - version: "0.0.14", + version: "0.0.15", type: "source", dedupe: "unique", props: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 78d1153d9e8f4..7d0301d2f4479 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34389,6 +34389,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: