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 91f18e490ff0d..b6a7f53f09d22 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 @@ -1,10 +1,11 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; 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.1", + version: "0.0.2", type: "action", props: { microsoftOutlook, @@ -14,10 +15,14 @@ export default { "messageId", ], }, - labelId: { + label: { propDefinition: [ microsoftOutlook, - "labelId", + "label", + (c) => ({ + messageId: c.messageId, + excludeMessageLabels: true, + }), ], }, }, @@ -29,13 +34,17 @@ export default { const labels = message?.categories; + if (labels.includes(this.label)) { + throw new ConfigurationError(`Message already contains label "${this.label}".`); + } + const response = await this.microsoftOutlook.updateMessage({ $, messageId: this.messageId, data: { categories: [ ...labels, - this.labelId, + this.label, ], }, }); diff --git a/components/microsoft_outlook/actions/create-contact/create-contact.mjs b/components/microsoft_outlook/actions/create-contact/create-contact.mjs index c18142be6ab67..f48497b73c67f 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.8", + version: "0.0.9", 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 08d0f738490d0..39cbb4b432896 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.8", + version: "0.0.9", 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 eaeb4a3344735..a3c95a1921ca2 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.8", + version: "0.0.9", name: "Find Contacts", description: "Finds contacts with given search string", props: { diff --git a/components/microsoft_outlook/actions/list-contacts/list-contacts.mjs b/components/microsoft_outlook/actions/list-contacts/list-contacts.mjs index adef14cfa0363..05fedbf0a169b 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.8", + version: "0.0.9", 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-labels/list-labels.mjs b/components/microsoft_outlook/actions/list-labels/list-labels.mjs index 48db4fc94b851..3fe9aaca57a55 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.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 b4a21dd48370b..c14897e78a5f7 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.1", + version: "0.0.2", type: "action", props: { microsoftOutlook, @@ -14,12 +14,16 @@ export default { "messageId", ], }, - labelId: { + label: { propDefinition: [ microsoftOutlook, - "labelId", + "label", + (c) => ({ + messageId: c.messageId, + onlyMessageLabels: true, + }), ], - description: "The identifier of the label/category to remove", + description: "The name of the label/category to remove", }, }, async run({ $ }) { @@ -29,7 +33,7 @@ export default { }); let labels = message?.categories; - const index = labels.indexOf(this.labelId); + const index = labels.indexOf(this.label); if (index > -1) { labels.splice(index, 1); } diff --git a/components/microsoft_outlook/actions/send-email/send-email.mjs b/components/microsoft_outlook/actions/send-email/send-email.mjs index 873618e0367ae..a115d700b24bc 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.9", + version: "0.0.10", 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 7cfc1a99c3cb7..d794448b3c51b 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.8", + version: "0.0.9", 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 21391edb7ccd0..1edd230f1e5cb 100644 --- a/components/microsoft_outlook/microsoft_outlook.app.mjs +++ b/components/microsoft_outlook/microsoft_outlook.app.mjs @@ -100,18 +100,26 @@ export default { type: "object", optional: true, }, - labelId: { + label: { type: "string", - label: "Label ID", - description: "The identifier of the label/category to add", - async options() { - const { value: labels } = await this.listLabels(); - return labels?.map(({ - id: value, displayName: label, - }) => ({ - value, - label, - })) || []; + label: "Label", + description: "The name of the label/category to add", + async options({ + messageId, excludeMessageLabels, onlyMessageLabels, + }) { + const { value } = await this.listLabels(); + let labels = value; + if (messageId) { + const { categories } = await this.getMessage({ + messageId, + }); + labels = excludeMessageLabels + ? labels.filter(({ displayName }) => !categories.includes(displayName)) + : onlyMessageLabels + ? labels.filter(({ displayName }) => categories.includes(displayName)) + : labels; + } + return labels?.map(({ displayName }) => displayName) || []; }, }, messageId: { diff --git a/components/microsoft_outlook/package.json b/components/microsoft_outlook/package.json index 1a07f608491c5..3db6ebf4d86c3 100644 --- a/components/microsoft_outlook/package.json +++ b/components/microsoft_outlook/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/microsoft_outlook", - "version": "1.1.0", + "version": "1.1.1", "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 45326cdb7d043..83a0490883875 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.9", + version: "0.0.10", 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 785b66a58b0c6..476f8b0af1c84 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.12", + version: "0.0.13", type: "source", dedupe: "unique", props: { diff --git a/components/microsoft_outlook_calendar/actions/get-schedule/get-schedule.mjs b/components/microsoft_outlook_calendar/actions/get-schedule/get-schedule.mjs index 652669db759e5..1538441a0298b 100644 --- a/components/microsoft_outlook_calendar/actions/get-schedule/get-schedule.mjs +++ b/components/microsoft_outlook_calendar/actions/get-schedule/get-schedule.mjs @@ -4,14 +4,14 @@ export default { key: "microsoft_outlook_calendar-get-schedule", name: "Get Free/Busy Schedule", description: "Get the free/busy availability information for a collection of users, distributions lists, or resources (rooms or equipment) for a specified time period. [See the documentation](https://learn.microsoft.com/en-us/graph/api/calendar-getschedule)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { microsoftOutlook, schedules: { type: "string[]", - label: "Schedules", - description: "A collection of SMTP addresses of users, distribution lists, or resources to get availability information for", + label: "Emails", + description: "A list of emails of users, distribution lists, or resources. For example: `[ \"adelev@contoso.com\" , \"meganb@contoso.com\" ]`", }, start: { propDefinition: [ diff --git a/components/microsoft_outlook_calendar/actions/list-events/list-events.mjs b/components/microsoft_outlook_calendar/actions/list-events/list-events.mjs index dc57d15273ecd..6f27f7e43b8b6 100644 --- a/components/microsoft_outlook_calendar/actions/list-events/list-events.mjs +++ b/components/microsoft_outlook_calendar/actions/list-events/list-events.mjs @@ -4,38 +4,21 @@ export default { key: "microsoft_outlook_calendar-list-events", name: "List Events", description: "Get a list of event objects in the user's mailbox. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-events)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { microsoftOutlook, filter: { type: "string", label: "Filter", - description: "Use the `$filter` query parameter to filter events. E.g. `contains(subject, 'my event')` [See the documentation](https://learn.microsoft.com/en-us/graph/filter-query-parameter) for more information about the `$filter` parameter.", + description: "Filters results. For example, `contains(subject, 'meet for lunch?')` will include events whose title contains ‘meet for lunch?’. [See documentation](https://learn.microsoft.com/en-us/graph/filter-query-parameter) for the full list of operations.", optional: true, }, orderBy: { type: "string", label: "Order By", - description: "The field to sort the results by. Default is `createdDateTime`. [See the documentation](https://learn.microsoft.com/en-us/graph/query-parameters?tabs=http#orderby-parameter) for more info about the `$orderby` parameter.", - default: "createdDateTime", - optional: true, - }, - sortOrder: { - type: "string", - label: "Sort Order", - description: "Whether to sort the results in ascending or descending order. Default is `descending`.", - options: [ - { - label: "ascending", - value: "asc", - }, - { - label: "descending", - value: "desc", - }, - ], - default: "desc", + description: "Orders results. For example, `displayName desc` will sort the results by Display Name in decending order.", + default: "createdDateTime desc", optional: true, }, maxResults: { @@ -49,7 +32,7 @@ export default { const { value = [] } = await this.microsoftOutlook.listCalendarEvents({ $, params: { - "$orderby": `${this.orderBy} ${this.sortOrder}`, + "$orderby": this.orderBy, "$filter": this.filter, "$top": this.maxResults, }, diff --git a/components/microsoft_outlook_calendar/package.json b/components/microsoft_outlook_calendar/package.json index c92e035a0afa5..2f8c6d0156821 100644 --- a/components/microsoft_outlook_calendar/package.json +++ b/components/microsoft_outlook_calendar/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/microsoft_outlook_calendar", - "version": "0.3.0", + "version": "0.3.1", "description": "Pipedream Microsoft Outlook Calendar Components", "main": "microsoft_outlook_calendar.app.mjs", "keywords": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index deb9c29567a45..b711ee2c35128 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10304,8 +10304,7 @@ importers: specifier: ^3.0.1 version: 3.0.3 - components/storerocket: - specifiers: {} + components/storerocket: {} components/stormboard: {}