-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Microsoft Components #15443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+347
−21
Merged
Microsoft Components #15443
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
components/microsoft_onedrive/actions/get-file-by-id/get-file-by-id.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import onedrive from "../../microsoft_onedrive.app.mjs"; | ||
|
||
export default { | ||
key: "microsoft_onedrive-get-file-by-id", | ||
name: "Get File by ID", | ||
description: "Retrieves a file by ID. [See the documentation](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_get)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
onedrive, | ||
fileId: { | ||
propDefinition: [ | ||
onedrive, | ||
"fileId", | ||
], | ||
description: "The file to retrieve. You can either search for the file here, provide a custom *File ID*.", | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.onedrive.client().api(`/me/drive/items/${this.fileId}`) | ||
.get(); | ||
$.export("$summary", `Successfully retreived file with ID: ${this.fileId}`); | ||
return response; | ||
}, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
components/microsoft_outlook/actions/add-label-to-email/add-label-to-email.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import microsoftOutlook from "../../microsoft_outlook.app.mjs"; | ||
|
||
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", | ||
type: "action", | ||
props: { | ||
microsoftOutlook, | ||
messageId: { | ||
propDefinition: [ | ||
microsoftOutlook, | ||
"messageId", | ||
], | ||
}, | ||
labelId: { | ||
propDefinition: [ | ||
microsoftOutlook, | ||
"labelId", | ||
], | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const message = await this.microsoftOutlook.getMessage({ | ||
$, | ||
messageId: this.messageId, | ||
}); | ||
|
||
const labels = message?.categories; | ||
|
||
const response = await this.microsoftOutlook.updateMessage({ | ||
$, | ||
messageId: this.messageId, | ||
data: { | ||
categories: [ | ||
...labels, | ||
this.labelId, | ||
], | ||
}, | ||
}); | ||
$.export("$summary", "Successfully added label to message."); | ||
return response; | ||
}, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
components/microsoft_outlook/actions/list-labels/list-labels.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-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", | ||
type: "action", | ||
props: { | ||
microsoftOutlook, | ||
}, | ||
async run({ $ }) { | ||
const { value } = await this.microsoftOutlook.listLabels({ | ||
$, | ||
}); | ||
$.export("$summary", `Successfully retrieved ${value.length} label${value.length != 1 | ||
? "s" | ||
: ""}.`); | ||
return value; | ||
}, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; |
47 changes: 47 additions & 0 deletions
47
components/microsoft_outlook/actions/remove-label-from-email/remove-label-from-email.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import microsoftOutlook from "../../microsoft_outlook.app.mjs"; | ||
|
||
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", | ||
type: "action", | ||
props: { | ||
microsoftOutlook, | ||
messageId: { | ||
propDefinition: [ | ||
microsoftOutlook, | ||
"messageId", | ||
], | ||
}, | ||
labelId: { | ||
propDefinition: [ | ||
microsoftOutlook, | ||
"labelId", | ||
], | ||
description: "The identifier of the label/category to remove", | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const message = await this.microsoftOutlook.getMessage({ | ||
$, | ||
messageId: this.messageId, | ||
}); | ||
let labels = message?.categories; | ||
|
||
const index = labels.indexOf(this.labelId); | ||
if (index > -1) { | ||
labels.splice(index, 1); | ||
} | ||
|
||
const response = await this.microsoftOutlook.updateMessage({ | ||
$, | ||
messageId: this.messageId, | ||
data: { | ||
categories: labels, | ||
}, | ||
}); | ||
$.export("$summary", "Successfully removed label from message."); | ||
return response; | ||
}, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@pipedream/microsoft_outlook", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "Pipedream Microsoft Outlook Components", | ||
"main": "microsoft_outlook.app.mjs", | ||
"keywords": [ | ||
|
@@ -12,6 +12,7 @@ | |
"homepage": "https://pipedream.com/apps/microsoft_outlook", | ||
"author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
"dependencies": { | ||
"@pipedream/platform": "^3.0.3", | ||
"axios": "^0.21.1", | ||
"js-base64": "^3.7.2", | ||
"md5": "^2.3.0", | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
components/microsoft_outlook_calendar/actions/get-schedule/get-schedule.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs"; | ||
|
||
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", | ||
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", | ||
}, | ||
start: { | ||
propDefinition: [ | ||
microsoftOutlook, | ||
"start", | ||
], | ||
}, | ||
end: { | ||
propDefinition: [ | ||
microsoftOutlook, | ||
"end", | ||
], | ||
}, | ||
timeZone: { | ||
propDefinition: [ | ||
microsoftOutlook, | ||
"timeZone", | ||
], | ||
}, | ||
availabilityViewInterval: { | ||
type: "integer", | ||
label: "Availability View Interval", | ||
description: "Represents the duration of a time slot in minutes in an availabilityView in the response. The default is 30 minutes, minimum is 5, maximum is 1440.", | ||
optional: true, | ||
}, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
methods: { | ||
getSchedule(opts = {}) { | ||
return this.microsoftOutlook._makeRequest({ | ||
method: "POST", | ||
path: "/me/calendar/getSchedule", | ||
...opts, | ||
}); | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const { value } = await this.getSchedule({ | ||
$, | ||
data: { | ||
schedules: this.schedules, | ||
startTime: { | ||
dateTime: this.start, | ||
timeZone: this.timeZone, | ||
}, | ||
endTime: { | ||
dateTime: this.end, | ||
timeZone: this.timeZone, | ||
}, | ||
availabilityViewInterval: this.availabilityViewInterval, | ||
}, | ||
}); | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
$.export("$summary", `Successfully retrieved schedules for \`${this.schedules.join("`, `")}\``); | ||
|
||
return value; | ||
}, | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.