Skip to content

Commit 1999db2

Browse files
authored
Merge branch 'master' into danny/connect-react/adding-pagination
2 parents 818ab71 + 311d74e commit 1999db2

File tree

49 files changed

+1371
-63
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1371
-63
lines changed

components/microsoft_outlook/actions/add-label-to-email/add-label-to-email.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "microsoft_outlook-add-label-to-email",
66
name: "Add Label to Email",
77
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.11",
8+
version: "0.0.12",
99
annotations: {
1010
destructiveHint: true,
1111
openWorldHint: true,

components/microsoft_outlook/actions/approve-workflow/approve-workflow.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "microsoft_outlook-approve-workflow",
55
name: "Approve Workflow",
66
description: "Suspend the workflow until approved by email. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)",
7-
version: "0.0.9",
7+
version: "0.0.10",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/microsoft_outlook/actions/create-contact/create-contact.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
33
export default {
44
type: "action",
55
key: "microsoft_outlook-create-contact",
6-
version: "0.0.18",
6+
version: "0.0.19",
77
annotations: {
88
destructiveHint: false,
99
openWorldHint: true,

components/microsoft_outlook/actions/create-draft-email/create-draft-email.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
44
export default {
55
type: "action",
66
key: "microsoft_outlook-create-draft-email",
7-
version: "0.0.18",
7+
version: "0.0.19",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/microsoft_outlook/actions/download-attachment/download-attachment.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "microsoft_outlook-download-attachment",
77
name: "Download Attachment",
88
description: "Downloads an attachment to the /tmp directory. [See the documentation](https://learn.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-1.0&tabs=http)",
9-
version: "0.0.6",
9+
version: "0.0.7",
1010
annotations: {
1111
destructiveHint: false,
1212
openWorldHint: true,

components/microsoft_outlook/actions/find-contacts/find-contacts.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
33
export default {
44
type: "action",
55
key: "microsoft_outlook-find-contacts",
6-
version: "0.0.18",
6+
version: "0.0.19",
77
annotations: {
88
destructiveHint: false,
99
openWorldHint: true,

components/microsoft_outlook/actions/find-email/find-email.mjs

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "microsoft_outlook-find-email",
55
name: "Find Email",
66
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.12",
7+
version: "0.0.13",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,
@@ -43,23 +43,44 @@ export default {
4343
],
4444
},
4545
},
46+
methods: {
47+
ensureQuotes(str) {
48+
str = str.trim();
49+
str = str.replace(/^['"]?/, "").replace(/['"]?$/, "");
50+
return `"${str}"`;
51+
},
52+
},
4653
async run({ $ }) {
47-
const items = this.microsoftOutlook.paginate({
48-
fn: this.microsoftOutlook.listMessages,
49-
args: {
54+
let emails = [];
55+
56+
if (!this.search) {
57+
const items = this.microsoftOutlook.paginate({
58+
fn: this.microsoftOutlook.listMessages,
59+
args: {
60+
$,
61+
params: {
62+
"$filter": this.filter,
63+
"$orderby": this.orderBy,
64+
},
65+
},
66+
max: this.maxResults,
67+
});
68+
69+
for await (const item of items) {
70+
emails.push(item);
71+
}
72+
} else {
73+
const { value } = await this.microsoftOutlook.listMessages({
5074
$,
5175
params: {
52-
"$search": this.search,
5376
"$filter": this.filter,
5477
"$orderby": this.orderBy,
78+
"$search": this.ensureQuotes(this.search),
79+
"$top": this.maxResults,
5580
},
56-
},
57-
max: this.maxResults,
58-
});
81+
});
5982

60-
const emails = [];
61-
for await (const item of items) {
62-
emails.push(item);
83+
emails = value;
6384
}
6485

6586
$.export("$summary", `Successfully retrieved ${emails.length} message${emails.length != 1

components/microsoft_outlook/actions/find-shared-folder-email/find-shared-folder-email.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "microsoft_outlook-find-shared-folder-email",
55
name: "Find Shared Folder Email",
66
description: "Search for an email in a shared folder in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-messages)",
7-
version: "0.0.3",
7+
version: "0.0.4",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/microsoft_outlook/actions/list-contacts/list-contacts.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
33
export default {
44
type: "action",
55
key: "microsoft_outlook-list-contacts",
6-
version: "0.0.18",
6+
version: "0.0.19",
77
annotations: {
88
destructiveHint: false,
99
openWorldHint: true,

components/microsoft_outlook/actions/list-folders/list-folders.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "microsoft_outlook-list-folders",
55
name: "List Folders",
66
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.9",
7+
version: "0.0.10",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

0 commit comments

Comments
 (0)