@pipedream/microsoft_outlook 1.1.1 → 1.3.0

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.
@@ -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.2",
8
+ version: "0.0.3",
9
9
  type: "action",
10
10
  props: {
11
11
  microsoftOutlook,
@@ -0,0 +1,47 @@
1
+ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
2
+
3
+ export default {
4
+ key: "microsoft_outlook-approve-workflow",
5
+ name: "Approve Workflow",
6
+ description: "Suspend the workflow until approved by email. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ microsoftOutlook,
11
+ recipients: {
12
+ propDefinition: [
13
+ microsoftOutlook,
14
+ "recipients",
15
+ ],
16
+ optional: false,
17
+ },
18
+ subject: {
19
+ propDefinition: [
20
+ microsoftOutlook,
21
+ "subject",
22
+ ],
23
+ optional: false,
24
+ },
25
+ },
26
+ async run({ $ }) {
27
+ const {
28
+ resume_url, cancel_url,
29
+ } = $.flow.suspend();
30
+ const opts = {
31
+ content: `Click here to approve the workflow: ${resume_url}, \nand cancel here: ${cancel_url}`,
32
+ ccRecipients: [],
33
+ bccRecipients: [],
34
+ ...this,
35
+ };
36
+ const response = await this.microsoftOutlook.sendEmail({
37
+ $,
38
+ data: {
39
+ message: {
40
+ ...this.microsoftOutlook.prepareMessageBody(opts),
41
+ },
42
+ },
43
+ });
44
+ $.export("$summary", "Email has been sent.");
45
+ return response;
46
+ },
47
+ };
@@ -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.9",
6
+ version: "0.0.10",
7
7
  name: "Create 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,7 +3,7 @@ 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.9",
6
+ version: "0.0.10",
7
7
  name: "Create Draft Email",
8
8
  description: "Create a draft email, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-post-messages)",
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-find-contacts",
6
- version: "0.0.9",
6
+ version: "0.0.10",
7
7
  name: "Find Contacts",
8
8
  description: "Finds contacts with given search string",
9
9
  props: {
@@ -0,0 +1,37 @@
1
+ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
2
+
3
+ export default {
4
+ key: "microsoft_outlook-find-email",
5
+ name: "Find Email",
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.1",
8
+ type: "action",
9
+ props: {
10
+ microsoftOutlook,
11
+ filter: {
12
+ type: "string",
13
+ label: "Filter",
14
+ 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
+ optional: true,
16
+ },
17
+ maxResults: {
18
+ type: "integer",
19
+ label: "Max Results",
20
+ description: "The maximum number of results to return",
21
+ optional: true,
22
+ },
23
+ },
24
+ async run({ $ }) {
25
+ const { value } = await this.microsoftOutlook.listMessages({
26
+ $,
27
+ params: {
28
+ "$filter": this.filter,
29
+ "$top": this.maxResults,
30
+ },
31
+ });
32
+ $.export("$summary", `Successfully retrieved ${value.length} message${value.length != 1
33
+ ? "s"
34
+ : ""}.`);
35
+ return value;
36
+ },
37
+ };
@@ -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.9",
6
+ version: "0.0.10",
7
7
  name: "List Contacts",
8
8
  description: "Get a contact collection from the default contacts folder, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-list-contacts)",
9
9
  props: {
@@ -0,0 +1,21 @@
1
+ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
2
+
3
+ export default {
4
+ key: "microsoft_outlook-list-folders",
5
+ name: "List Folders",
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.1",
8
+ type: "action",
9
+ props: {
10
+ microsoftOutlook,
11
+ },
12
+ async run({ $ }) {
13
+ const { value } = await this.microsoftOutlook.listFolders({
14
+ $,
15
+ });
16
+ $.export("$summary", `Successfully retrieved ${value.length} folder${value.length != 1
17
+ ? "s"
18
+ : ""}.`);
19
+ return value;
20
+ },
21
+ };
@@ -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.2",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  props: {
10
10
  microsoftOutlook,
@@ -0,0 +1,38 @@
1
+ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
2
+
3
+ export default {
4
+ key: "microsoft_outlook-move-email-to-folder",
5
+ name: "Move Email to Folder",
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.1",
8
+ type: "action",
9
+ props: {
10
+ microsoftOutlook,
11
+ messageId: {
12
+ propDefinition: [
13
+ microsoftOutlook,
14
+ "messageId",
15
+ ],
16
+ },
17
+ folderId: {
18
+ propDefinition: [
19
+ microsoftOutlook,
20
+ "folderIds",
21
+ ],
22
+ type: "string",
23
+ label: "Folder ID",
24
+ description: "The identifier of the folder to move the selected message to",
25
+ },
26
+ },
27
+ async run({ $ }) {
28
+ const response = await this.microsoftOutlook.moveMessage({
29
+ $,
30
+ messageId: this.messageId,
31
+ data: {
32
+ destinationId: this.folderId,
33
+ },
34
+ });
35
+ $.export("$summary", `Successfully moved email to folder with ID: ${this.folderId}`);
36
+ return response;
37
+ },
38
+ };
@@ -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.2",
7
+ version: "0.0.3",
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-send-email",
6
- version: "0.0.10",
6
+ version: "0.0.11",
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.9",
6
+ version: "0.0.10",
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: {
@@ -143,6 +143,20 @@ export default {
143
143
  })) || [];
144
144
  },
145
145
  },
146
+ folderIds: {
147
+ type: "string[]",
148
+ label: "Folder IDs to Monitor",
149
+ 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 { value: folders } = await this.listFolders();
152
+ return folders?.map(({
153
+ id: value, displayName: label,
154
+ }) => ({
155
+ value,
156
+ label,
157
+ })) || [];
158
+ },
159
+ },
146
160
  },
147
161
  methods: {
148
162
  _getUrl(path) {
@@ -335,6 +349,21 @@ export default {
335
349
  ...args,
336
350
  });
337
351
  },
352
+ listFolders(args = {}) {
353
+ return this._makeRequest({
354
+ path: "/me/mailFolders",
355
+ ...args,
356
+ });
357
+ },
358
+ moveMessage({
359
+ messageId, ...args
360
+ }) {
361
+ return this._makeRequest({
362
+ method: "POST",
363
+ path: `/me/messages/${messageId}/move`,
364
+ ...args,
365
+ });
366
+ },
338
367
  updateMessage({
339
368
  messageId, ...args
340
369
  }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/microsoft_outlook",
3
- "version": "1.1.1",
3
+ "version": "1.3.0",
4
4
  "description": "Pipedream Microsoft Outlook Components",
5
5
  "main": "microsoft_outlook.app.mjs",
6
6
  "keywords": [
@@ -5,7 +5,7 @@ export default {
5
5
  key: "microsoft_outlook-new-contact",
6
6
  name: "New Contact Event (Instant)",
7
7
  description: "Emit new event when a new Contact is created",
8
- version: "0.0.10",
8
+ version: "0.0.11",
9
9
  type: "source",
10
10
  hooks: {
11
11
  ...common.hooks,
@@ -7,25 +7,17 @@ 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.13",
10
+ version: "0.0.14",
11
11
  type: "source",
12
12
  dedupe: "unique",
13
13
  props: {
14
14
  ...common.props,
15
15
  folderIds: {
16
- type: "string[]",
17
- label: "Folder IDs to Monitor",
18
- 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\").",
16
+ propDefinition: [
17
+ common.props.microsoftOutlook,
18
+ "folderIds",
19
+ ],
19
20
  optional: true,
20
- async options() {
21
- const { value: folders } = await this.listFolders();
22
- return folders?.map(({
23
- id: value, displayName: label,
24
- }) => ({
25
- value,
26
- label,
27
- })) || [];
28
- },
29
21
  },
30
22
  },
31
23
  hooks: {
@@ -56,13 +48,8 @@ export default {
56
48
  },
57
49
  methods: {
58
50
  ...common.methods,
59
- listFolders() {
60
- return this.microsoftOutlook._makeRequest({
61
- path: "/me/mailFolders",
62
- });
63
- },
64
51
  async getFolderIdByName(name) {
65
- const { value: folders } = await this.listFolders();
52
+ const { value: folders } = await this.microsoftOutlook.listFolders();
66
53
  const folder = folders.find(({ displayName }) => displayName === name);
67
54
  return folder?.id;
68
55
  },