@pipedream/microsoft_outlook 1.5.0 → 1.5.2

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.6",
8
+ version: "0.0.7",
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.4",
7
+ version: "0.0.5",
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.13",
6
+ version: "0.0.14",
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: {
@@ -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.13",
6
+ version: "0.0.14",
7
7
  name: "Create Draft Email",
8
8
  description: "Create a draft email, [See the documentation](https://docs.microsoft.com/en-us/graph/api/user-post-messages)",
9
9
  props: {
@@ -6,7 +6,7 @@ export default {
6
6
  key: "microsoft_outlook-download-attachment",
7
7
  name: "Download Attachment",
8
8
  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.1",
9
+ version: "0.0.3",
10
10
  type: "action",
11
11
  props: {
12
12
  microsoftOutlook,
@@ -31,6 +31,11 @@ export default {
31
31
  label: "Filename",
32
32
  description: "The filename to save the attachment as in the /tmp directory",
33
33
  },
34
+ syncDir: {
35
+ type: "dir",
36
+ accessMode: "write",
37
+ sync: true,
38
+ },
34
39
  },
35
40
  async run({ $ }) {
36
41
  const response = await this.microsoftOutlook.getAttachment({
@@ -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.13",
6
+ version: "0.0.14",
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,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.4",
7
+ version: "0.0.5",
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-list-contacts",
6
- version: "0.0.13",
6
+ version: "0.0.14",
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.4",
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-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.6",
7
+ version: "0.0.7",
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.4",
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-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.6",
7
+ version: "0.0.7",
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.3",
7
+ version: "0.0.4",
8
8
  type: "action",
9
9
  props: {
10
10
  microsoftOutlook,
@@ -67,7 +67,7 @@ export default {
67
67
  data: {
68
68
  comment: this.comment,
69
69
  message: {
70
- ...this.microsoftOutlook.prepareMessageBody(this),
70
+ ...await this.microsoftOutlook.prepareMessageBody(this),
71
71
  ...this.expand,
72
72
  },
73
73
  },
@@ -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.14",
6
+ version: "0.0.15",
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: {
@@ -63,7 +63,7 @@ export default {
63
63
  $,
64
64
  data: {
65
65
  message: {
66
- ...this.microsoftOutlook.prepareMessageBody(this),
66
+ ...await this.microsoftOutlook.prepareMessageBody(this),
67
67
  ...this.expand,
68
68
  },
69
69
  },
@@ -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.13",
6
+ version: "0.0.14",
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: {
@@ -1,7 +1,7 @@
1
- import { axios } from "@pipedream/platform";
2
- import fs from "fs";
1
+ import {
2
+ axios, getFileStream,
3
+ } from "@pipedream/platform";
3
4
  import path from "path";
4
- import { encode } from "js-base64";
5
5
  import mime from "mime-types";
6
6
  const DEFAULT_LIMIT = 50;
7
7
 
@@ -54,9 +54,9 @@ export default {
54
54
  optional: true,
55
55
  },
56
56
  files: {
57
- label: "File paths",
58
- description: "Absolute paths to the files (eg. `/tmp/my_file.pdf`)",
59
57
  type: "string[]",
58
+ label: "File Paths or URLs",
59
+ description: "Provide either an array of file URLs or an array of paths to a files in the /tmp directory (for example, /tmp/myFile.pdf).",
60
60
  optional: true,
61
61
  },
62
62
  contact: {
@@ -253,7 +253,19 @@ export default {
253
253
  ...args,
254
254
  });
255
255
  },
256
- prepareMessageBody(self) {
256
+ async streamToBase64(stream) {
257
+ return new Promise((resolve, reject) => {
258
+ const chunks = [];
259
+
260
+ stream.on("data", (chunk) => chunks.push(chunk));
261
+ stream.on("end", () => {
262
+ const buffer = Buffer.concat(chunks);
263
+ resolve(buffer.toString("base64"));
264
+ });
265
+ stream.on("error", reject);
266
+ });
267
+ },
268
+ async prepareMessageBody(self) {
257
269
  const toRecipients = [];
258
270
  const ccRecipients = [];
259
271
  const bccRecipients = [];
@@ -285,15 +297,13 @@ export default {
285
297
 
286
298
  const attachments = [];
287
299
  for (let i = 0; self.files && i < self.files.length; i++) {
300
+ const stream = await getFileStream(self.files[i]);
301
+ const base64 = await this.streamToBase64(stream);
288
302
  attachments.push({
289
303
  "@odata.type": "#microsoft.graph.fileAttachment",
290
304
  "name": path.basename(self.files[i]),
291
305
  "contentType": mime.lookup(self.files[i]),
292
- "contentBytes": encode([
293
- ...fs.readFileSync(self.files[i], {
294
- flag: "r",
295
- }).values(),
296
- ]),
306
+ "contentBytes": base64,
297
307
  });
298
308
  }
299
309
  const message = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/microsoft_outlook",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "Pipedream Microsoft Outlook Components",
5
5
  "main": "microsoft_outlook.app.mjs",
6
6
  "keywords": [
@@ -12,7 +12,7 @@
12
12
  "homepage": "https://pipedream.com/apps/microsoft_outlook",
13
13
  "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
14
14
  "dependencies": {
15
- "@pipedream/platform": "^3.0.3",
15
+ "@pipedream/platform": "^3.1.0",
16
16
  "axios": "^0.21.1",
17
17
  "js-base64": "^3.7.2",
18
18
  "md5": "^2.3.0",
@@ -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.1",
8
+ version: "0.0.2",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  methods: {
@@ -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.14",
8
+ version: "0.0.15",
9
9
  type: "source",
10
10
  hooks: {
11
11
  ...common.hooks,
@@ -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.17",
10
+ version: "0.0.18",
11
11
  type: "source",
12
12
  dedupe: "unique",
13
13
  methods: {