@pipedream/microsoft_outlook 1.5.3 → 1.5.5

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.
@@ -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",
7
+ version: "0.0.9",
8
8
  type: "action",
9
9
  props: {
10
10
  microsoftOutlook,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/microsoft_outlook",
3
- "version": "1.5.3",
3
+ "version": "1.5.5",
4
4
  "description": "Pipedream Microsoft Outlook Components",
5
5
  "main": "microsoft_outlook.app.mjs",
6
6
  "keywords": [
@@ -54,5 +54,22 @@ export default {
54
54
  const draftsFolderId = this.db.get("draftsFolderId");
55
55
  return item.parentFolderId !== sentItemFolderId && item.parentFolderId !== draftsFolderId;
56
56
  },
57
+ async getMessageAttachments(message) {
58
+ const { value: attachments } = await this.microsoftOutlook.listAttachments({
59
+ messageId: message.id,
60
+ });
61
+ if (!attachments?.length) {
62
+ return [];
63
+ }
64
+ return attachments.map((attachment) => ({
65
+ ...attachment,
66
+ messageId: message.id,
67
+ messageSubject: message.subject,
68
+ messageSender: message.sender,
69
+ messageReceivedDateTime: message.receivedDateTime,
70
+ parentFolderId: message.parentFolderId,
71
+ contentBytes: undefined,
72
+ }));
73
+ },
57
74
  },
58
75
  };
@@ -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.3",
8
+ version: "0.0.4",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  methods: {
@@ -36,23 +36,6 @@ export default {
36
36
  }
37
37
  return attachments;
38
38
  },
39
- async getMessageAttachments(message) {
40
- const { value: attachments } = await this.microsoftOutlook.listAttachments({
41
- messageId: message.id,
42
- });
43
- if (!attachments?.length) {
44
- return [];
45
- }
46
- return attachments.map((attachment) => ({
47
- ...attachment,
48
- messageId: message.id,
49
- messageSubject: message.subject,
50
- messageSender: message.sender,
51
- messageReceivedDateTime: message.receivedDateTime,
52
- parentFolderId: message.parentFolderId,
53
- contentBytes: undefined,
54
- }));
55
- },
56
39
  emitEvent(item) {
57
40
  if (this.isRelevant(item)) {
58
41
  this.$emit(item, this.generateMeta(item));
@@ -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.19",
10
+ version: "0.1.0",
11
11
  type: "source",
12
12
  dedupe: "unique",
13
13
  methods: {
@@ -66,6 +66,10 @@ export default {
66
66
  resource: folder,
67
67
  messageId: resourceId,
68
68
  });
69
+ if (item.hasAttachments) {
70
+ const attachments = await this.getMessageAttachments(item);
71
+ item.attachments = attachments;
72
+ }
69
73
  this.emitEvent(item);
70
74
  } catch {
71
75
  console.log(`Could not fetch message with ID: ${resourceId}`);