@pipedream/microsoft_outlook 1.5.2 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions/add-label-to-email/add-label-to-email.mjs +1 -1
- package/actions/approve-workflow/approve-workflow.mjs +1 -1
- package/actions/create-contact/create-contact.mjs +1 -1
- package/actions/create-draft-email/create-draft-email.mjs +4 -3
- package/actions/find-contacts/find-contacts.mjs +1 -1
- package/actions/find-email/find-email.mjs +20 -1
- package/actions/list-contacts/list-contacts.mjs +1 -1
- package/actions/list-folders/list-folders.mjs +1 -1
- package/actions/list-labels/list-labels.mjs +1 -1
- package/actions/move-email-to-folder/move-email-to-folder.mjs +1 -1
- package/actions/remove-label-from-email/remove-label-from-email.mjs +1 -1
- package/actions/reply-to-email/reply-to-email.mjs +1 -1
- package/actions/send-email/send-email.mjs +3 -2
- package/actions/update-contact/update-contact.mjs +1 -1
- package/common/utils.mjs +29 -0
- package/microsoft_outlook.app.mjs +6 -6
- package/package.json +1 -1
- package/sources/new-attachment-received/new-attachment-received.mjs +1 -1
- package/sources/new-contact/new-contact.mjs +1 -1
- package/sources/new-email/new-email.mjs +1 -1
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "microsoft_outlook-add-label-to-email",
|
|
6
6
|
name: "Add Label to Email",
|
|
7
7
|
description: "Adds a label/category to an email in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/message-update)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.8",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
microsoftOutlook,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "microsoft_outlook-approve-workflow",
|
|
5
5
|
name: "Approve Workflow",
|
|
6
6
|
description: "Suspend the workflow until approved by email. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.6",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftOutlook,
|
|
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
type: "action",
|
|
5
5
|
key: "microsoft_outlook-create-contact",
|
|
6
|
-
version: "0.0.
|
|
6
|
+
version: "0.0.15",
|
|
7
7
|
name: "Create Contact",
|
|
8
8
|
description: "Add a contact to the root Contacts folder, [See the documentation](https://docs.microsoft.com/en-us/graph/api/user-post-contacts)",
|
|
9
9
|
props: {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import microsoftOutlook from "../../microsoft_outlook.app.mjs";
|
|
2
|
+
import { parseObject } from "../../common/utils.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
type: "action",
|
|
5
6
|
key: "microsoft_outlook-create-draft-email",
|
|
6
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.15",
|
|
7
8
|
name: "Create Draft Email",
|
|
8
9
|
description: "Create a draft email, [See the documentation](https://docs.microsoft.com/en-us/graph/api/user-post-messages)",
|
|
9
10
|
props: {
|
|
@@ -62,8 +63,8 @@ export default {
|
|
|
62
63
|
const response = await this.microsoftOutlook.createDraft({
|
|
63
64
|
$,
|
|
64
65
|
data: {
|
|
65
|
-
...this.microsoftOutlook.prepareMessageBody(this),
|
|
66
|
-
...this.expand,
|
|
66
|
+
...await this.microsoftOutlook.prepareMessageBody(this),
|
|
67
|
+
...parseObject(this.expand),
|
|
67
68
|
},
|
|
68
69
|
});
|
|
69
70
|
$.export("$summary", "Email draft has been created.");
|
|
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
type: "action",
|
|
5
5
|
key: "microsoft_outlook-find-contacts",
|
|
6
|
-
version: "0.0.
|
|
6
|
+
version: "0.0.15",
|
|
7
7
|
name: "Find Contacts",
|
|
8
8
|
description: "Finds contacts with the given search string. [See the documentation](https://docs.microsoft.com/en-us/graph/api/user-list-contacts)",
|
|
9
9
|
props: {
|
|
@@ -4,16 +4,33 @@ export default {
|
|
|
4
4
|
key: "microsoft_outlook-find-email",
|
|
5
5
|
name: "Find Email",
|
|
6
6
|
description: "Search for an email in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-messages)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftOutlook,
|
|
11
|
+
info: {
|
|
12
|
+
type: "alert",
|
|
13
|
+
alertType: "info",
|
|
14
|
+
content: "When you specify `$filter`, the service infers a sort order for the results. If you use both `$orderby` and `$filter` to get messages, because the server always infers a sort order for the results of a `$filter`, you must [specify properties in certain ways](https://learn.microsoft.com/en-us/graph/api/user-list-messages#using-filter-and-orderby-in-the-same-query).",
|
|
15
|
+
},
|
|
16
|
+
search: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "Search",
|
|
19
|
+
description: "Search for an email in Microsoft Outlook. Can search for specific message properties such as `to:example@example.com` or `subject:example`. If the property is excluded, the search targets the default propertes `from`, `subject`, and `body`. For example, `pizza` will search for messages with the word `pizza` in the subject, body, or from address, but `to:example@example.com` will only search for messages to `example@example.com`.",
|
|
20
|
+
optional: true,
|
|
21
|
+
},
|
|
11
22
|
filter: {
|
|
12
23
|
type: "string",
|
|
13
24
|
label: "Filter",
|
|
14
25
|
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.",
|
|
15
26
|
optional: true,
|
|
16
27
|
},
|
|
28
|
+
orderBy: {
|
|
29
|
+
type: "string",
|
|
30
|
+
label: "Order By",
|
|
31
|
+
description: "Order results by a property. For example, `receivedDateTime desc` will order messages by the received date in descending order.",
|
|
32
|
+
optional: true,
|
|
33
|
+
},
|
|
17
34
|
maxResults: {
|
|
18
35
|
propDefinition: [
|
|
19
36
|
microsoftOutlook,
|
|
@@ -27,7 +44,9 @@ export default {
|
|
|
27
44
|
args: {
|
|
28
45
|
$,
|
|
29
46
|
params: {
|
|
47
|
+
"$search": this.search,
|
|
30
48
|
"$filter": this.filter,
|
|
49
|
+
"$orderby": this.orderBy,
|
|
31
50
|
},
|
|
32
51
|
},
|
|
33
52
|
max: this.maxResults,
|
|
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
type: "action",
|
|
5
5
|
key: "microsoft_outlook-list-contacts",
|
|
6
|
-
version: "0.0.
|
|
6
|
+
version: "0.0.15",
|
|
7
7
|
name: "List Contacts",
|
|
8
8
|
description: "Get a contact collection from the default contacts folder, [See the documentation](https://docs.microsoft.com/en-us/graph/api/user-list-contacts)",
|
|
9
9
|
props: {
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "microsoft_outlook-list-folders",
|
|
5
5
|
name: "List Folders",
|
|
6
6
|
description: "Retrieves a list of all folders in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-mailfolders)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.6",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftOutlook,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "microsoft_outlook-list-labels",
|
|
5
5
|
name: "List Labels",
|
|
6
6
|
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)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftOutlook,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "microsoft_outlook-move-email-to-folder",
|
|
5
5
|
name: "Move Email to Folder",
|
|
6
6
|
description: "Moves an email to the specified folder in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/message-move)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.6",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftOutlook,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "microsoft_outlook-remove-label-from-email",
|
|
5
5
|
name: "Remove Label from Email",
|
|
6
6
|
description: "Removes a label/category from an email in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/message-update)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftOutlook,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "microsoft_outlook-reply-to-email",
|
|
5
5
|
name: "Reply to Email",
|
|
6
6
|
description: "Reply to an email in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/message-reply)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftOutlook,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import microsoftOutlook from "../../microsoft_outlook.app.mjs";
|
|
2
|
+
import { parseObject } from "../../common/utils.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
type: "action",
|
|
5
6
|
key: "microsoft_outlook-send-email",
|
|
6
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.16",
|
|
7
8
|
name: "Send Email",
|
|
8
9
|
description: "Send an email to one or multiple recipients, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-sendmail)",
|
|
9
10
|
props: {
|
|
@@ -64,7 +65,7 @@ export default {
|
|
|
64
65
|
data: {
|
|
65
66
|
message: {
|
|
66
67
|
...await this.microsoftOutlook.prepareMessageBody(this),
|
|
67
|
-
...this.expand,
|
|
68
|
+
...parseObject(this.expand),
|
|
68
69
|
},
|
|
69
70
|
},
|
|
70
71
|
});
|
|
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
type: "action",
|
|
5
5
|
key: "microsoft_outlook-update-contact",
|
|
6
|
-
version: "0.0.
|
|
6
|
+
version: "0.0.15",
|
|
7
7
|
name: "Update Contact",
|
|
8
8
|
description: "Add a contact to the root Contacts folder, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-post-contacts)",
|
|
9
9
|
props: {
|
package/common/utils.mjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const parseObject = (obj) => {
|
|
2
|
+
if (!obj) {
|
|
3
|
+
return {};
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
if (typeof obj === "string") {
|
|
7
|
+
try {
|
|
8
|
+
return JSON.parse(obj);
|
|
9
|
+
} catch {
|
|
10
|
+
return obj;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (Array.isArray(obj)) {
|
|
15
|
+
return obj.map(parseObject);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (typeof obj === "object") {
|
|
19
|
+
return Object.fromEntries(Object.entries(obj).map(([
|
|
20
|
+
key,
|
|
21
|
+
value,
|
|
22
|
+
]) => [
|
|
23
|
+
key,
|
|
24
|
+
parseObject(value),
|
|
25
|
+
]));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return obj;
|
|
29
|
+
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
axios,
|
|
2
|
+
axios, getFileStreamAndMetadata,
|
|
3
3
|
} from "@pipedream/platform";
|
|
4
|
-
import path from "path";
|
|
5
|
-
import mime from "mime-types";
|
|
6
4
|
const DEFAULT_LIMIT = 50;
|
|
7
5
|
|
|
8
6
|
export default {
|
|
@@ -297,12 +295,14 @@ export default {
|
|
|
297
295
|
|
|
298
296
|
const attachments = [];
|
|
299
297
|
for (let i = 0; self.files && i < self.files.length; i++) {
|
|
300
|
-
const
|
|
298
|
+
const {
|
|
299
|
+
stream, metadata,
|
|
300
|
+
} = await getFileStreamAndMetadata(self.files[i]);
|
|
301
301
|
const base64 = await this.streamToBase64(stream);
|
|
302
302
|
attachments.push({
|
|
303
303
|
"@odata.type": "#microsoft.graph.fileAttachment",
|
|
304
|
-
"name":
|
|
305
|
-
"contentType":
|
|
304
|
+
"name": metadata.name,
|
|
305
|
+
"contentType": metadata.contentType,
|
|
306
306
|
"contentBytes": base64,
|
|
307
307
|
});
|
|
308
308
|
}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "microsoft_outlook-new-attachment-received",
|
|
6
6
|
name: "New Attachment Received (Instant)",
|
|
7
7
|
description: "Emit new event when a new email containing one or more attachments arrives in a specified Microsoft Outlook folder.",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.3",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
methods: {
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "microsoft_outlook-new-email",
|
|
8
8
|
name: "New Email Event (Instant)",
|
|
9
9
|
description: "Emit new event when an email is received in specified folders.",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.19",
|
|
11
11
|
type: "source",
|
|
12
12
|
dedupe: "unique",
|
|
13
13
|
methods: {
|