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
Expand Up @@ -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.2",
version: "0.0.3",
type: "action",
props: {
microsoftOutlook,
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.9",
version: "0.0.10",
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.9",
version: "0.0.10",
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.9",
version: "0.0.10",
name: "Find Contacts",
description: "Finds contacts with given search string",
props: {
Expand Down
37 changes: 37 additions & 0 deletions components/microsoft_outlook/actions/find-email/find-email.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import microsoftOutlook from "../../microsoft_outlook.app.mjs";

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",
type: "action",
props: {
microsoftOutlook,
filter: {
type: "string",
label: "Filter",
description: "Filters results. For example, `contains(subject, 'meet for lunch?')` will include messages whose subject contains ‘meet for lunch?’. [See documentation](https://learn.microsoft.com/en-us/graph/filter-query-parameter) for the full list of operations.",
optional: true,
},
maxResults: {
type: "integer",
label: "Max Results",
description: "The maximum number of results to return",
optional: true,
},
},
async run({ $ }) {
const { value } = await this.microsoftOutlook.listMessages({
$,
params: {
"$filter": this.filter,
"$top": this.maxResults,
},
});
$.export("$summary", `Successfully retrieved ${value.length} message${value.length != 1
? "s"
: ""}.`);
return value;
},
};
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.9",
version: "0.0.10",
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
21 changes: 21 additions & 0 deletions components/microsoft_outlook/actions/list-folders/list-folders.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import microsoftOutlook from "../../microsoft_outlook.app.mjs";

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",
type: "action",
props: {
microsoftOutlook,
},
async run({ $ }) {
const { value } = await this.microsoftOutlook.listFolders({
$,
});
$.export("$summary", `Successfully retrieved ${value.length} folder${value.length != 1
? "s"
: ""}.`);
return value;
},
};
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.2",
version: "0.0.3",
type: "action",
props: {
microsoftOutlook,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import microsoftOutlook from "../../microsoft_outlook.app.mjs";

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",
type: "action",
props: {
microsoftOutlook,
messageId: {
propDefinition: [
microsoftOutlook,
"messageId",
],
},
folderId: {
propDefinition: [
microsoftOutlook,
"folderIds",
],
type: "string",
label: "Folder ID",
description: "The identifier of the folder to move the selected message to",
},
},
async run({ $ }) {
const response = await this.microsoftOutlook.moveMessage({
$,
messageId: this.messageId,
data: {
destinationId: this.folderId,
},
});
$.export("$summary", `Successfully moved email to folder with ID: ${this.folderId}`);
return response;
},
};
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.2",
version: "0.0.3",
type: "action",
props: {
microsoftOutlook,
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.10",
version: "0.0.11",
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.9",
version: "0.0.10",
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
29 changes: 29 additions & 0 deletions components/microsoft_outlook/microsoft_outlook.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,20 @@ export default {
})) || [];
},
},
folderIds: {
type: "string[]",
label: "Folder IDs to Monitor",
description: "Specify the folder IDs or names in Outlook that you want to monitor for new emails. Leave empty to monitor all folders (excluding \"Sent Items\" and \"Drafts\").",
async options() {
const { value: folders } = await this.listFolders();
return folders?.map(({
id: value, displayName: label,
}) => ({
value,
label,
})) || [];
},
},
},
methods: {
_getUrl(path) {
Expand Down Expand Up @@ -335,6 +349,21 @@ export default {
...args,
});
},
listFolders(args = {}) {
return this._makeRequest({
path: "/me/mailFolders",
...args,
});
},
moveMessage({
messageId, ...args
}) {
return this._makeRequest({
method: "POST",
path: `/me/messages/${messageId}/move`,
...args,
});
},
updateMessage({
messageId, ...args
}) {
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.1",
"version": "1.2.0",
"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.10",
version: "0.0.11",
type: "source",
hooks: {
...common.hooks,
Expand Down
25 changes: 6 additions & 19 deletions components/microsoft_outlook/sources/new-email/new-email.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,17 @@ 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.13",
version: "0.0.14",
type: "source",
dedupe: "unique",
props: {
...common.props,
folderIds: {
type: "string[]",
label: "Folder IDs to Monitor",
description: "Specify the folder IDs or names in Outlook that you want to monitor for new emails. Leave empty to monitor all folders (excluding \"Sent Items\" and \"Drafts\").",
propDefinition: [
common.props.microsoftOutlook,
"folderIds",
],
optional: true,
async options() {
const { value: folders } = await this.listFolders();
return folders?.map(({
id: value, displayName: label,
}) => ({
value,
label,
})) || [];
},
},
},
hooks: {
Expand Down Expand Up @@ -56,13 +48,8 @@ export default {
},
methods: {
...common.methods,
listFolders() {
return this.microsoftOutlook._makeRequest({
path: "/me/mailFolders",
});
},
async getFolderIdByName(name) {
const { value: folders } = await this.listFolders();
const { value: folders } = await this.microsoftOutlook.listFolders();
const folder = folders.find(({ displayName }) => displayName === name);
return folder?.id;
},
Expand Down
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

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

Loading