Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -14,10 +15,14 @@ export default {
"messageId",
],
},
labelId: {
label: {
propDefinition: [
microsoftOutlook,
"labelId",
"label",
(c) => ({
messageId: c.messageId,
excludeMessageLabels: true,
}),
],
},
},
Expand All @@ -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,
],
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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({ $ }) {
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
30 changes: 19 additions & 11 deletions components/microsoft_outlook/microsoft_outlook.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion components/microsoft_outlook/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: `[ \"[email protected]\" , \"[email protected]\" ]`",
},
start: {
propDefinition: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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,
},
Expand Down
2 changes: 1 addition & 1 deletion components/microsoft_outlook_calendar/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
3 changes: 1 addition & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading