@pipedream/microsoft_outlook 1.3.0 → 1.4.1
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 +2 -2
- package/actions/create-draft-email/create-draft-email.mjs +2 -2
- package/actions/find-contacts/find-contacts.mjs +32 -13
- package/actions/find-email/find-email.mjs +21 -12
- package/actions/list-contacts/list-contacts.mjs +24 -8
- package/actions/list-folders/list-folders.mjs +21 -5
- 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 +77 -0
- package/actions/send-email/send-email.mjs +1 -1
- package/actions/update-contact/update-contact.mjs +1 -1
- package/microsoft_outlook.app.mjs +70 -15
- package/package.json +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.5",
|
|
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.3",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftOutlook,
|
|
@@ -3,9 +3,9 @@ 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.12",
|
|
7
7
|
name: "Create Contact",
|
|
8
|
-
description: "Add a contact to the root Contacts folder, [See the
|
|
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: {
|
|
10
10
|
microsoftOutlook,
|
|
11
11
|
givenName: {
|
|
@@ -3,9 +3,9 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
type: "action",
|
|
5
5
|
key: "microsoft_outlook-create-draft-email",
|
|
6
|
-
version: "0.0.
|
|
6
|
+
version: "0.0.12",
|
|
7
7
|
name: "Create Draft Email",
|
|
8
|
-
description: "Create a draft email, [See the
|
|
8
|
+
description: "Create a draft email, [See the documentation](https://docs.microsoft.com/en-us/graph/api/user-post-messages)",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftOutlook,
|
|
11
11
|
recipients: {
|
|
@@ -3,9 +3,9 @@ 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.12",
|
|
7
7
|
name: "Find Contacts",
|
|
8
|
-
description: "Finds contacts with given search string",
|
|
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: {
|
|
10
10
|
microsoftOutlook,
|
|
11
11
|
searchString: {
|
|
@@ -13,21 +13,40 @@ export default {
|
|
|
13
13
|
description: "Provide email address, given name, surname or display name (case sensitive)",
|
|
14
14
|
type: "string",
|
|
15
15
|
},
|
|
16
|
+
maxResults: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
microsoftOutlook,
|
|
19
|
+
"maxResults",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
16
22
|
},
|
|
17
23
|
async run({ $ }) {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
c.givenName.includes(this.searchString) ||
|
|
24
|
-
c.surname.includes(this.searchString) ||
|
|
25
|
-
c.emailAddresses.find((e) =>
|
|
26
|
-
e.address == this.searchString ||
|
|
27
|
-
e.name.includes(this.searchString));
|
|
24
|
+
const contacts = this.microsoftOutlook.paginate({
|
|
25
|
+
fn: this.microsoftOutlook.listContacts,
|
|
26
|
+
args: {
|
|
27
|
+
$,
|
|
28
|
+
},
|
|
28
29
|
});
|
|
30
|
+
|
|
31
|
+
const relatedContacts = [];
|
|
32
|
+
for await (const contact of contacts) {
|
|
33
|
+
if (
|
|
34
|
+
contact?.displayName?.includes(this.searchString) ||
|
|
35
|
+
contact?.givenName?.includes(this.searchString) ||
|
|
36
|
+
contact?.surname?.includes(this.searchString) ||
|
|
37
|
+
contact?.emailAddresses?.find(
|
|
38
|
+
(e) => e?.address == this.searchString || e?.name?.includes(this.searchString),
|
|
39
|
+
)
|
|
40
|
+
) {
|
|
41
|
+
relatedContacts.push(contact);
|
|
42
|
+
if (this.maxResults && relatedContacts.length >= this.maxResults) {
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
29
48
|
// eslint-disable-next-line multiline-ternary
|
|
30
|
-
$.export("$summary", `${relatedContacts.length} contact${relatedContacts.length != 1 ? "s" : ""}
|
|
49
|
+
$.export("$summary", `${relatedContacts.length} matching contact${relatedContacts.length != 1 ? "s" : ""} found`);
|
|
31
50
|
return relatedContacts;
|
|
32
51
|
},
|
|
33
52
|
};
|
|
@@ -4,7 +4,7 @@ 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.3",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftOutlook,
|
|
@@ -15,23 +15,32 @@ export default {
|
|
|
15
15
|
optional: true,
|
|
16
16
|
},
|
|
17
17
|
maxResults: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
propDefinition: [
|
|
19
|
+
microsoftOutlook,
|
|
20
|
+
"maxResults",
|
|
21
|
+
],
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
async run({ $ }) {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const items = this.microsoftOutlook.paginate({
|
|
26
|
+
fn: this.microsoftOutlook.listMessages,
|
|
27
|
+
args: {
|
|
28
|
+
$,
|
|
29
|
+
params: {
|
|
30
|
+
"$filter": this.filter,
|
|
31
|
+
},
|
|
30
32
|
},
|
|
33
|
+
max: this.maxResults,
|
|
31
34
|
});
|
|
32
|
-
|
|
35
|
+
|
|
36
|
+
const emails = [];
|
|
37
|
+
for await (const item of items) {
|
|
38
|
+
emails.push(item);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
$.export("$summary", `Successfully retrieved ${emails.length} message${emails.length != 1
|
|
33
42
|
? "s"
|
|
34
43
|
: ""}.`);
|
|
35
|
-
return
|
|
44
|
+
return emails;
|
|
36
45
|
},
|
|
37
46
|
};
|
|
@@ -3,25 +3,41 @@ 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.12",
|
|
7
7
|
name: "List Contacts",
|
|
8
|
-
description: "Get a contact collection from the default contacts folder, [See the
|
|
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: {
|
|
10
10
|
microsoftOutlook,
|
|
11
11
|
filterAddress: {
|
|
12
|
-
label: "Email
|
|
12
|
+
label: "Email Address",
|
|
13
13
|
description: "If this is given, only contacts with the given address will be retrieved.",
|
|
14
14
|
type: "string",
|
|
15
15
|
optional: true,
|
|
16
16
|
},
|
|
17
|
+
maxResults: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
microsoftOutlook,
|
|
20
|
+
"maxResults",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
17
23
|
},
|
|
18
24
|
async run({ $ }) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
const items = this.microsoftOutlook.paginate({
|
|
26
|
+
fn: this.microsoftOutlook.listContacts,
|
|
27
|
+
args: {
|
|
28
|
+
$,
|
|
29
|
+
filterAddress: this.filterAddress,
|
|
30
|
+
},
|
|
31
|
+
max: this.maxResults,
|
|
22
32
|
});
|
|
33
|
+
|
|
34
|
+
const contacts = [];
|
|
35
|
+
for await (const item of items) {
|
|
36
|
+
contacts.push(item);
|
|
37
|
+
}
|
|
38
|
+
|
|
23
39
|
// eslint-disable-next-line multiline-ternary
|
|
24
|
-
$.export("$summary", `${
|
|
25
|
-
return
|
|
40
|
+
$.export("$summary", `${contacts.length} contact${contacts.length != 1 ? "s" : ""} retrieved.`);
|
|
41
|
+
return contacts;
|
|
26
42
|
},
|
|
27
43
|
};
|
|
@@ -4,18 +4,34 @@ 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.3",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftOutlook,
|
|
11
|
+
maxResults: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
microsoftOutlook,
|
|
14
|
+
"maxResults",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
11
17
|
},
|
|
12
18
|
async run({ $ }) {
|
|
13
|
-
const
|
|
14
|
-
|
|
19
|
+
const items = this.microsoftOutlook.paginate({
|
|
20
|
+
fn: this.microsoftOutlook.listFolders,
|
|
21
|
+
args: {
|
|
22
|
+
$,
|
|
23
|
+
},
|
|
24
|
+
max: this.maxResults,
|
|
15
25
|
});
|
|
16
|
-
|
|
26
|
+
|
|
27
|
+
const folders = [];
|
|
28
|
+
for await (const item of items) {
|
|
29
|
+
folders.push(item);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
$.export("$summary", `Successfully retrieved ${folders.length} folder${folders.length != 1
|
|
17
33
|
? "s"
|
|
18
34
|
: ""}.`);
|
|
19
|
-
return
|
|
35
|
+
return folders;
|
|
20
36
|
},
|
|
21
37
|
};
|
|
@@ -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.5",
|
|
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.3",
|
|
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.5",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
microsoftOutlook,
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import microsoftOutlook from "../../microsoft_outlook.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "microsoft_outlook-reply-to-email",
|
|
5
|
+
name: "Reply to Email",
|
|
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.2",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
microsoftOutlook,
|
|
11
|
+
messageId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
microsoftOutlook,
|
|
14
|
+
"messageId",
|
|
15
|
+
],
|
|
16
|
+
description: "The identifier of the message to reply to",
|
|
17
|
+
},
|
|
18
|
+
recipients: {
|
|
19
|
+
propDefinition: [
|
|
20
|
+
microsoftOutlook,
|
|
21
|
+
"recipients",
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
ccRecipients: {
|
|
25
|
+
propDefinition: [
|
|
26
|
+
microsoftOutlook,
|
|
27
|
+
"ccRecipients",
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
bccRecipients: {
|
|
31
|
+
propDefinition: [
|
|
32
|
+
microsoftOutlook,
|
|
33
|
+
"bccRecipients",
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
subject: {
|
|
37
|
+
propDefinition: [
|
|
38
|
+
microsoftOutlook,
|
|
39
|
+
"subject",
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
comment: {
|
|
43
|
+
propDefinition: [
|
|
44
|
+
microsoftOutlook,
|
|
45
|
+
"content",
|
|
46
|
+
],
|
|
47
|
+
description: "Content of the reply in text format",
|
|
48
|
+
},
|
|
49
|
+
files: {
|
|
50
|
+
propDefinition: [
|
|
51
|
+
microsoftOutlook,
|
|
52
|
+
"files",
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
expand: {
|
|
56
|
+
propDefinition: [
|
|
57
|
+
microsoftOutlook,
|
|
58
|
+
"expand",
|
|
59
|
+
],
|
|
60
|
+
description: "Additional email details, [See object definition](https://docs.microsoft.com/en-us/graph/api/resources/message)",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
async run({ $ }) {
|
|
64
|
+
await this.microsoftOutlook.replyToEmail({
|
|
65
|
+
$,
|
|
66
|
+
messageId: this.messageId,
|
|
67
|
+
data: {
|
|
68
|
+
comment: this.comment,
|
|
69
|
+
message: {
|
|
70
|
+
...this.microsoftOutlook.prepareMessageBody(this),
|
|
71
|
+
...this.expand,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
$.export("$summary", "Email has been replied to.");
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
type: "action",
|
|
5
5
|
key: "microsoft_outlook-send-email",
|
|
6
|
-
version: "0.0.
|
|
6
|
+
version: "0.0.13",
|
|
7
7
|
name: "Send Email",
|
|
8
8
|
description: "Send an email to one or multiple recipients, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-sendmail)",
|
|
9
9
|
props: {
|
|
@@ -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.12",
|
|
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: {
|
|
@@ -3,6 +3,7 @@ import fs from "fs";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { encode } from "js-base64";
|
|
5
5
|
import mime from "mime-types";
|
|
6
|
+
const DEFAULT_LIMIT = 50;
|
|
6
7
|
|
|
7
8
|
export default {
|
|
8
9
|
type: "app",
|
|
@@ -62,8 +63,14 @@ export default {
|
|
|
62
63
|
label: "Contact",
|
|
63
64
|
description: "The contact to be updated",
|
|
64
65
|
type: "string",
|
|
65
|
-
async options() {
|
|
66
|
-
const
|
|
66
|
+
async options({ page }) {
|
|
67
|
+
const limit = DEFAULT_LIMIT;
|
|
68
|
+
const contactResponse = await this.listContacts({
|
|
69
|
+
params: {
|
|
70
|
+
$top: limit,
|
|
71
|
+
$skip: limit * page,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
67
74
|
return contactResponse.value.map((co) => ({
|
|
68
75
|
label: co.displayName,
|
|
69
76
|
value: co.id,
|
|
@@ -127,7 +134,7 @@ export default {
|
|
|
127
134
|
label: "Message ID",
|
|
128
135
|
description: "The identifier of the message to update",
|
|
129
136
|
async options({ page }) {
|
|
130
|
-
const limit =
|
|
137
|
+
const limit = DEFAULT_LIMIT;
|
|
131
138
|
const { value } = await this.listMessages({
|
|
132
139
|
params: {
|
|
133
140
|
$top: limit,
|
|
@@ -147,8 +154,14 @@ export default {
|
|
|
147
154
|
type: "string[]",
|
|
148
155
|
label: "Folder IDs to Monitor",
|
|
149
156
|
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\").",
|
|
150
|
-
async options() {
|
|
151
|
-
const
|
|
157
|
+
async options({ page }) {
|
|
158
|
+
const limit = DEFAULT_LIMIT;
|
|
159
|
+
const { value: folders } = await this.listFolders({
|
|
160
|
+
params: {
|
|
161
|
+
$top: limit,
|
|
162
|
+
$skip: limit * page,
|
|
163
|
+
},
|
|
164
|
+
});
|
|
152
165
|
return folders?.map(({
|
|
153
166
|
id: value, displayName: label,
|
|
154
167
|
}) => ({
|
|
@@ -157,6 +170,13 @@ export default {
|
|
|
157
170
|
})) || [];
|
|
158
171
|
},
|
|
159
172
|
},
|
|
173
|
+
maxResults: {
|
|
174
|
+
type: "integer",
|
|
175
|
+
label: "Max Results",
|
|
176
|
+
description: "The maximum number of results to return",
|
|
177
|
+
default: 100,
|
|
178
|
+
optional: true,
|
|
179
|
+
},
|
|
160
180
|
},
|
|
161
181
|
methods: {
|
|
162
182
|
_getUrl(path) {
|
|
@@ -255,14 +275,16 @@ export default {
|
|
|
255
275
|
}
|
|
256
276
|
const message = {
|
|
257
277
|
subject: self.subject,
|
|
258
|
-
body: {
|
|
259
|
-
content: self.content,
|
|
260
|
-
contentType: self.contentType,
|
|
261
|
-
},
|
|
262
|
-
toRecipients,
|
|
263
278
|
attachments,
|
|
264
279
|
};
|
|
265
280
|
|
|
281
|
+
if (self.content) {
|
|
282
|
+
message.body = {
|
|
283
|
+
content: self.content,
|
|
284
|
+
contentType: self.contentType,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
if (toRecipients.length > 0) message.toRecipients = toRecipients;
|
|
266
288
|
if (ccRecipients.length > 0) message.ccRecipients = ccRecipients;
|
|
267
289
|
if (bccRecipients.length > 0) message.bccRecipients = bccRecipients;
|
|
268
290
|
|
|
@@ -275,6 +297,15 @@ export default {
|
|
|
275
297
|
...args,
|
|
276
298
|
});
|
|
277
299
|
},
|
|
300
|
+
async replyToEmail({
|
|
301
|
+
messageId, ...args
|
|
302
|
+
}) {
|
|
303
|
+
return await this._makeRequest({
|
|
304
|
+
method: "POST",
|
|
305
|
+
path: `/me/messages/${messageId}/reply`,
|
|
306
|
+
...args,
|
|
307
|
+
});
|
|
308
|
+
},
|
|
278
309
|
async createDraft({ ...args } = {}) {
|
|
279
310
|
return await this._makeRequest({
|
|
280
311
|
method: "POST",
|
|
@@ -293,16 +324,15 @@ export default {
|
|
|
293
324
|
filterAddress,
|
|
294
325
|
...args
|
|
295
326
|
} = {}) {
|
|
296
|
-
|
|
327
|
+
args.params = {
|
|
328
|
+
...args?.params,
|
|
329
|
+
};
|
|
297
330
|
if (filterAddress) {
|
|
298
|
-
|
|
299
|
-
"$filter": `emailAddresses/any(a:a/address eq '${filterAddress}')`,
|
|
300
|
-
};
|
|
331
|
+
args.params["$filter"] = `emailAddresses/any(a:a/address eq '${filterAddress}')`;
|
|
301
332
|
}
|
|
302
333
|
return await this._makeRequest({
|
|
303
334
|
method: "GET",
|
|
304
335
|
path: "/me/contacts",
|
|
305
|
-
...paramsContainer,
|
|
306
336
|
...args,
|
|
307
337
|
});
|
|
308
338
|
},
|
|
@@ -373,5 +403,30 @@ export default {
|
|
|
373
403
|
...args,
|
|
374
404
|
});
|
|
375
405
|
},
|
|
406
|
+
async *paginate({
|
|
407
|
+
fn, args = {}, max,
|
|
408
|
+
}) {
|
|
409
|
+
const limit = DEFAULT_LIMIT;
|
|
410
|
+
args = {
|
|
411
|
+
...args,
|
|
412
|
+
params: {
|
|
413
|
+
...args?.params,
|
|
414
|
+
$top: limit,
|
|
415
|
+
$skip: 0,
|
|
416
|
+
},
|
|
417
|
+
};
|
|
418
|
+
let total, count = 0;
|
|
419
|
+
do {
|
|
420
|
+
const { value } = await fn(args);
|
|
421
|
+
for (const item of value) {
|
|
422
|
+
yield item;
|
|
423
|
+
if (max && ++count >= max) {
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
total = value?.length;
|
|
428
|
+
args.params["$skip"] += limit;
|
|
429
|
+
} while (total);
|
|
430
|
+
},
|
|
376
431
|
},
|
|
377
432
|
};
|
package/package.json
CHANGED
|
@@ -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.16",
|
|
11
11
|
type: "source",
|
|
12
12
|
dedupe: "unique",
|
|
13
13
|
props: {
|