@divyacon/piece-microsoft-outlook 0.1.1 → 0.7.8

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.
Files changed (107) hide show
  1. package/package.json +9 -27
  2. package/src/i18n/de.json +298 -0
  3. package/src/i18n/es.json +298 -0
  4. package/src/i18n/fr.json +298 -0
  5. package/src/i18n/ja.json +298 -0
  6. package/src/i18n/nl.json +298 -0
  7. package/src/i18n/pt.json +298 -0
  8. package/src/i18n/ru.json +41 -0
  9. package/src/i18n/translation.json +298 -0
  10. package/src/i18n/vi.json +41 -0
  11. package/src/i18n/zh.json +298 -0
  12. package/src/index.js +77 -0
  13. package/dist/index.d.ts +0 -2
  14. package/dist/index.d.ts.map +0 -1
  15. package/dist/index.js +0 -65
  16. package/dist/index.js.map +0 -1
  17. package/dist/lib/actions/add-label-to-email.d.ts +0 -5
  18. package/dist/lib/actions/add-label-to-email.d.ts.map +0 -1
  19. package/dist/lib/actions/add-label-to-email.js +0 -44
  20. package/dist/lib/actions/add-label-to-email.js.map +0 -1
  21. package/dist/lib/actions/create-draft-email.d.ts +0 -10
  22. package/dist/lib/actions/create-draft-email.d.ts.map +0 -1
  23. package/dist/lib/actions/create-draft-email.js +0 -108
  24. package/dist/lib/actions/create-draft-email.js.map +0 -1
  25. package/dist/lib/actions/download-email-attachment.d.ts +0 -4
  26. package/dist/lib/actions/download-email-attachment.d.ts.map +0 -1
  27. package/dist/lib/actions/download-email-attachment.js +0 -44
  28. package/dist/lib/actions/download-email-attachment.js.map +0 -1
  29. package/dist/lib/actions/find-email.d.ts +0 -6
  30. package/dist/lib/actions/find-email.d.ts.map +0 -1
  31. package/dist/lib/actions/find-email.js +0 -67
  32. package/dist/lib/actions/find-email.js.map +0 -1
  33. package/dist/lib/actions/forward-email.d.ts +0 -6
  34. package/dist/lib/actions/forward-email.d.ts.map +0 -1
  35. package/dist/lib/actions/forward-email.js +0 -61
  36. package/dist/lib/actions/forward-email.js.map +0 -1
  37. package/dist/lib/actions/move-email-to-folder.d.ts +0 -5
  38. package/dist/lib/actions/move-email-to-folder.d.ts.map +0 -1
  39. package/dist/lib/actions/move-email-to-folder.js +0 -41
  40. package/dist/lib/actions/move-email-to-folder.js.map +0 -1
  41. package/dist/lib/actions/remove-label-from-email.d.ts +0 -5
  42. package/dist/lib/actions/remove-label-from-email.d.ts.map +0 -1
  43. package/dist/lib/actions/remove-label-from-email.js +0 -44
  44. package/dist/lib/actions/remove-label-from-email.js.map +0 -1
  45. package/dist/lib/actions/reply-email.d.ts +0 -10
  46. package/dist/lib/actions/reply-email.d.ts.map +0 -1
  47. package/dist/lib/actions/reply-email.js +0 -161
  48. package/dist/lib/actions/reply-email.js.map +0 -1
  49. package/dist/lib/actions/request-approval-send-email.d.ts +0 -6
  50. package/dist/lib/actions/request-approval-send-email.d.ts.map +0 -1
  51. package/dist/lib/actions/request-approval-send-email.js +0 -99
  52. package/dist/lib/actions/request-approval-send-email.js.map +0 -1
  53. package/dist/lib/actions/send-draft-email.d.ts +0 -4
  54. package/dist/lib/actions/send-draft-email.d.ts.map +0 -1
  55. package/dist/lib/actions/send-draft-email.js +0 -38
  56. package/dist/lib/actions/send-draft-email.js.map +0 -1
  57. package/dist/lib/actions/send-email.d.ts +0 -10
  58. package/dist/lib/actions/send-email.d.ts.map +0 -1
  59. package/dist/lib/actions/send-email.js +0 -111
  60. package/dist/lib/actions/send-email.js.map +0 -1
  61. package/dist/lib/common/auth.d.ts +0 -2
  62. package/dist/lib/common/auth.d.ts.map +0 -1
  63. package/dist/lib/common/auth.js +0 -88
  64. package/dist/lib/common/auth.js.map +0 -1
  65. package/dist/lib/common/client.d.ts +0 -16
  66. package/dist/lib/common/client.d.ts.map +0 -1
  67. package/dist/lib/common/client.js +0 -27
  68. package/dist/lib/common/client.js.map +0 -1
  69. package/dist/lib/common/microsoft-cloud.d.ts +0 -6
  70. package/dist/lib/common/microsoft-cloud.d.ts.map +0 -1
  71. package/dist/lib/common/microsoft-cloud.js +0 -57
  72. package/dist/lib/common/microsoft-cloud.js.map +0 -1
  73. package/dist/lib/common/props.d.ts +0 -10
  74. package/dist/lib/common/props.d.ts.map +0 -1
  75. package/dist/lib/common/props.js +0 -124
  76. package/dist/lib/common/props.js.map +0 -1
  77. package/dist/lib/triggers/new-attachment.d.ts +0 -19
  78. package/dist/lib/triggers/new-attachment.d.ts.map +0 -1
  79. package/dist/lib/triggers/new-attachment.js +0 -129
  80. package/dist/lib/triggers/new-attachment.js.map +0 -1
  81. package/dist/lib/triggers/new-email-in-folder.d.ts +0 -11
  82. package/dist/lib/triggers/new-email-in-folder.d.ts.map +0 -1
  83. package/dist/lib/triggers/new-email-in-folder.js +0 -96
  84. package/dist/lib/triggers/new-email-in-folder.js.map +0 -1
  85. package/dist/lib/triggers/new-email.d.ts +0 -15
  86. package/dist/lib/triggers/new-email.d.ts.map +0 -1
  87. package/dist/lib/triggers/new-email.js +0 -120
  88. package/dist/lib/triggers/new-email.js.map +0 -1
  89. package/src/index.ts +0 -56
  90. package/src/lib/actions/add-label-to-email.ts +0 -41
  91. package/src/lib/actions/create-draft-email.ts +0 -106
  92. package/src/lib/actions/download-email-attachment.ts +0 -47
  93. package/src/lib/actions/find-email.ts +0 -72
  94. package/src/lib/actions/forward-email.ts +0 -64
  95. package/src/lib/actions/move-email-to-folder.ts +0 -36
  96. package/src/lib/actions/remove-label-from-email.ts +0 -43
  97. package/src/lib/actions/reply-email.ts +0 -158
  98. package/src/lib/actions/request-approval-send-email.ts +0 -105
  99. package/src/lib/actions/send-draft-email.ts +0 -33
  100. package/src/lib/actions/send-email.ts +0 -110
  101. package/src/lib/common/auth.ts +0 -85
  102. package/src/lib/common/client.ts +0 -26
  103. package/src/lib/common/microsoft-cloud.ts +0 -56
  104. package/src/lib/common/props.ts +0 -137
  105. package/src/lib/triggers/new-attachment.ts +0 -153
  106. package/src/lib/triggers/new-email-in-folder.ts +0 -95
  107. package/src/lib/triggers/new-email.ts +0 -126
@@ -1,137 +0,0 @@
1
- import { OAuth2PropertyValue, Property } from '@agnocon/pieces-framework';
2
- import { PageCollection } from '@microsoft/microsoft-graph-client';
3
- import { MailFolder, Message } from '@microsoft/microsoft-graph-types';
4
- import { microsoftOutlookAuth } from './auth';
5
- import { outlookCommon } from './client';
6
-
7
- type DropdownParams = {
8
- displayName: string;
9
- description: string;
10
- required: boolean;
11
- };
12
-
13
- export const messageIdDropdown = (params: DropdownParams) =>
14
- Property.Dropdown({
15
- auth: microsoftOutlookAuth,
16
- displayName: params.displayName,
17
- description: params.description,
18
- required: params.required,
19
- refreshers: [],
20
- options: async ({ auth }) => {
21
- if (!auth) {
22
- return {
23
- placeholder: 'Please connect your account first.',
24
- disabled: true,
25
- options: [],
26
- };
27
- }
28
-
29
- const authValue = auth as OAuth2PropertyValue;
30
- const client = outlookCommon.createClient(authValue);
31
-
32
- try {
33
- const response: PageCollection = await client
34
- .api(`${outlookCommon.mailboxPrefix(authValue)}/messages?$top=50&$select=id,subject,from,receivedDateTime`)
35
- .orderby('receivedDateTime desc')
36
- .get();
37
-
38
- const messages = response.value as Message[];
39
-
40
- return {
41
- disabled: false,
42
- options: messages.map((message) => ({
43
- label: `${message.subject || 'No Subject'}`,
44
- value: message.id,
45
- })),
46
- };
47
- } catch (error) {
48
- return {
49
- disabled: true,
50
- options: [],
51
- };
52
- }
53
- },
54
- });
55
-
56
- export const draftMessageIdDropdown = (params: DropdownParams) =>
57
- Property.Dropdown({
58
- auth: microsoftOutlookAuth,
59
- displayName: params.displayName,
60
- description: params.description,
61
- required: params.required,
62
- refreshers: [],
63
- options: async ({ auth }) => {
64
- if (!auth) {
65
- return {
66
- placeholder: 'Please connect your account first.',
67
- disabled: true,
68
- options: [],
69
- };
70
- }
71
-
72
- const authValue = auth as OAuth2PropertyValue;
73
- const client = outlookCommon.createClient(authValue);
74
-
75
- try {
76
- const response: PageCollection = await client
77
- .api(`${outlookCommon.mailboxPrefix(authValue)}/mailFolders/drafts/messages?$top=50&$select=id,subject,from,receivedDateTime`)
78
- .orderby('receivedDateTime desc')
79
- .get();
80
-
81
- const messages = response.value as Message[];
82
-
83
- return {
84
- disabled: false,
85
- options: messages.map((message) => ({
86
- label: `${message.subject || 'No Subject'}`,
87
- value: message.id,
88
- })),
89
- };
90
- } catch (error) {
91
- return {
92
- disabled: true,
93
- options: [],
94
- };
95
- }
96
- },
97
- });
98
-
99
- export const mailFolderIdDropdown = (params: DropdownParams) =>
100
- Property.Dropdown({
101
- auth: microsoftOutlookAuth,
102
- displayName: params.displayName,
103
- description: params.description,
104
- required: params.required,
105
- refreshers: [],
106
- options: async ({ auth }) => {
107
- if (!auth) {
108
- return {
109
- placeholder: 'Please connect your account first.',
110
- disabled: true,
111
- options: [],
112
- };
113
- }
114
-
115
- const authValue = auth as OAuth2PropertyValue;
116
- const client = outlookCommon.createClient(authValue);
117
-
118
- try {
119
- const response: PageCollection = await client.api(`${outlookCommon.mailboxPrefix(authValue)}/mailFolders`).get();
120
-
121
- const folders = response.value as MailFolder[];
122
-
123
- return {
124
- disabled: false,
125
- options: folders.map((folder) => ({
126
- label: folder.displayName || folder.id || 'Unknown',
127
- value: folder.id || '',
128
- })),
129
- };
130
- } catch (error) {
131
- return {
132
- disabled: true,
133
- options: [],
134
- };
135
- }
136
- },
137
- });
@@ -1,153 +0,0 @@
1
- import { FilesService, TriggerStrategy, createTrigger, Property } from '@agnocon/pieces-framework';
2
- import { Client, PageCollection } from '@microsoft/microsoft-graph-client';
3
- import { Message, FileAttachment } from '@microsoft/microsoft-graph-types';
4
- import dayjs from 'dayjs';
5
- import { microsoftOutlookAuth } from '../common/auth';
6
- import { outlookCommon } from '../common/client';
7
- import { mailFolderIdDropdown } from '../common/props';
8
- import { isNil } from '@agnocon/pieces-framework';
9
-
10
- async function enrichAttachments(
11
- client: Client,
12
- mailboxPrefix: string,
13
- messages: Message[],
14
- files: FilesService,
15
- nameFilter?: string,
16
- senderFilter?: string,
17
- ): Promise<Record<string, any>[]> {
18
- const attachments: Record<string, any>[] = [];
19
-
20
- for (const message of messages) {
21
- if (senderFilter && message.sender?.emailAddress?.address && !message.sender.emailAddress.address.toLowerCase().includes(senderFilter.toLowerCase())) {
22
- continue;
23
- }
24
-
25
- const attachmentResponse: PageCollection = await client
26
- .api(`${mailboxPrefix}/messages/${message.id}/attachments`)
27
- .get();
28
-
29
- for (const attachment of attachmentResponse.value as FileAttachment[]) {
30
- const { contentBytes, ...rest } = attachment;
31
-
32
- if (nameFilter && attachment.name && !attachment.name.toLowerCase().includes(nameFilter.toLowerCase())) {
33
- continue;
34
- }
35
-
36
- if (attachment.name && contentBytes) {
37
- const file = await files.write({
38
- fileName: attachment.name,
39
- data: Buffer.from(contentBytes, 'base64'),
40
- });
41
-
42
- attachments.push({
43
- file,
44
- messageId: message.id!,
45
- messageSubject: message.subject,
46
- messageSender: message.sender,
47
- messageReceivedDateTime: message.receivedDateTime,
48
- parentFolderId: message.parentFolderId,
49
- ...rest,
50
- });
51
- }
52
- }
53
- }
54
- return attachments;
55
- }
56
-
57
- export const newAttachmentTrigger = createTrigger({
58
- auth: microsoftOutlookAuth,
59
- name: 'newAttachment',
60
- displayName: 'New Attachment',
61
- description: 'Triggers when a new email containing one or more attachments arrives.',
62
- aiMetadata: {
63
- description: 'Fires once per attachment when a new email carrying one or more file attachments arrives, optionally scoped to a folder, sender, or attachment-name filter. Each fire represents a single attachment from a newly received message.',
64
- },
65
- props: {
66
- folderId: mailFolderIdDropdown({
67
- displayName: 'Folder',
68
- description: 'Monitor attachments in a specific folder. Leave empty to monitor all folders.',
69
- required: false,
70
- }),
71
- sender: Property.ShortText({
72
- displayName: 'From (Sender Email)',
73
- description: 'Filter emails from a specific sender (optional). Leave empty to for all senders.',
74
- required: false,
75
- }),
76
- attachmentNameFilter: Property.ShortText({
77
- displayName: 'Attachment Name Filter',
78
- description: 'Filter attachments by name (contains). Leave empty to include all attachments.',
79
- required: false,
80
- }),
81
- },
82
- sampleData: {},
83
- type: TriggerStrategy.POLLING,
84
- async onEnable(context) {
85
- await context.store.put('lastPoll', Date.now());
86
- },
87
- async onDisable(context) {
88
- // return
89
- },
90
- async test(context) {
91
- const { folderId, attachmentNameFilter, sender } = context.propsValue;
92
- const client = outlookCommon.createClient(context.auth);
93
- const baseUrl = folderId ? `${outlookCommon.mailboxPrefix(context.auth)}/mailFolders/${folderId}/messages` : `${outlookCommon.mailboxPrefix(context.auth)}/messages`;
94
-
95
- const response: PageCollection = await client
96
- .api(`${baseUrl}?$filter=hasAttachments eq true`)
97
- .top(10)
98
- .get();
99
-
100
- const attachments = await enrichAttachments(client, outlookCommon.mailboxPrefix(context.auth), response.value as Message[], context.files, attachmentNameFilter, sender);
101
-
102
- const items = attachments.map((attachment) => ({
103
- epochMilliSeconds: dayjs(attachment['messageReceivedDateTime']).valueOf(),
104
- data: attachment,
105
- }));
106
-
107
- return items.map((item) => item.data);
108
- },
109
- async run(context) {
110
- const lastFetchEpochMS = await context.store.get<number>('lastPoll');
111
- if (isNil(lastFetchEpochMS)) {
112
- throw new Error("lastPoll doesn't exist in the store.");
113
- }
114
-
115
- const { folderId, attachmentNameFilter, sender } = context.propsValue;
116
- const client = outlookCommon.createClient(context.auth);
117
-
118
- const baseUrl = folderId ? `${outlookCommon.mailboxPrefix(context.auth)}/mailFolders/${folderId}/messages` : `${outlookCommon.mailboxPrefix(context.auth)}/messages`;
119
- let response: PageCollection = await client
120
- .api(
121
- `${baseUrl}?$filter=receivedDateTime gt ${dayjs(
122
- lastFetchEpochMS,
123
- ).toISOString()} and hasAttachments eq true`,
124
- )
125
- .orderby('receivedDateTime desc')
126
- .get();
127
-
128
- const messages: Message[] = [];
129
-
130
- while (response.value.length > 0) {
131
- messages.push(...(response.value as Message[]));
132
-
133
- if (response['@odata.nextLink']) {
134
- response = await client.api(response['@odata.nextLink']).get();
135
- } else {
136
- break;
137
- }
138
- }
139
- const attachments = await enrichAttachments(client, outlookCommon.mailboxPrefix(context.auth), messages, context.files, attachmentNameFilter, sender);
140
-
141
- const items = attachments.map((attachment) => ({
142
- epochMilliSeconds: dayjs(attachment['messageReceivedDateTime']).valueOf(),
143
- data: attachment,
144
- }));
145
-
146
- const newLastEpochMilliSeconds = items.reduce(
147
- (acc, item) => Math.max(acc, item.epochMilliSeconds),
148
- lastFetchEpochMS,
149
- );
150
- await context.store.put('lastPoll', newLastEpochMilliSeconds);
151
- return items.filter((f) => f.epochMilliSeconds > lastFetchEpochMS).map((item) => item.data);
152
- },
153
- });
@@ -1,95 +0,0 @@
1
- import { DedupeStrategy, Polling, pollingHelper } from '@agnocon/pieces-common';
2
- import {
3
- AppConnectionValueForAuthProperty,
4
- PiecePropValueSchema,
5
- TriggerStrategy,
6
- createTrigger,
7
- } from '@agnocon/pieces-framework';
8
- import { PageCollection } from '@microsoft/microsoft-graph-client';
9
- import { Message } from '@microsoft/microsoft-graph-types';
10
- import dayjs from 'dayjs';
11
- import { microsoftOutlookAuth } from '../common/auth';
12
- import { outlookCommon } from '../common/client';
13
- import { mailFolderIdDropdown } from '../common/props';
14
-
15
- const polling: Polling<AppConnectionValueForAuthProperty<typeof microsoftOutlookAuth>, { folderId?: string }> = {
16
- strategy: DedupeStrategy.TIMEBASED,
17
- items: async ({ auth, lastFetchEpochMS, propsValue }) => {
18
- const client = outlookCommon.createClient(auth);
19
-
20
- const messages = [];
21
- const folderId = propsValue.folderId;
22
-
23
- const filter =
24
- lastFetchEpochMS === 0
25
- ? '$top=10'
26
- : `$filter=createdDateTime gt ${dayjs(lastFetchEpochMS).toISOString()}`;
27
-
28
- let response: PageCollection = await client
29
- .api(`${outlookCommon.mailboxPrefix(auth)}/mailFolders/${folderId}/messages?${filter}`)
30
- .orderby('createdDateTime desc')
31
- .get();
32
-
33
- if (lastFetchEpochMS === 0) {
34
- for (const message of response.value as Message[]) {
35
- messages.push(message);
36
- }
37
- } else {
38
- while (response.value.length > 0) {
39
- for (const message of response.value as Message[]) {
40
- messages.push(message);
41
- }
42
-
43
- if (response['@odata.nextLink']) {
44
- response = await client.api(response['@odata.nextLink']).get();
45
- } else {
46
- break;
47
- }
48
- }
49
- }
50
-
51
- return messages.map((message) => ({
52
- epochMilliSeconds: dayjs(message.createdDateTime).valueOf(),
53
- data: message,
54
- }));
55
- },
56
- };
57
-
58
- export const newEmailInFolderTrigger = createTrigger({
59
- auth: microsoftOutlookAuth,
60
- name: 'newEmailInFolder',
61
- displayName: 'New Email in Folder',
62
- description: 'Triggers when a new email is delivered into the specified folder.',
63
- aiMetadata: {
64
- description: 'Fires when a new message appears in the chosen Outlook mail folder. Each fire represents one new email added to that folder.',
65
- },
66
- props: {
67
- folderId: mailFolderIdDropdown({
68
- displayName: 'Folder',
69
- description: '',
70
- required: true,
71
- }),
72
- },
73
- sampleData: {},
74
- type: TriggerStrategy.POLLING,
75
- async onEnable(context) {
76
- await pollingHelper.onEnable(polling, {
77
- auth: context.auth,
78
- store: context.store,
79
- propsValue: context.propsValue,
80
- });
81
- },
82
- async onDisable(context) {
83
- await pollingHelper.onDisable(polling, {
84
- auth: context.auth,
85
- store: context.store,
86
- propsValue: context.propsValue,
87
- });
88
- },
89
- async test(context) {
90
- return await pollingHelper.test(polling, context);
91
- },
92
- async run(context) {
93
- return await pollingHelper.poll(polling, context);
94
- },
95
- });
@@ -1,126 +0,0 @@
1
- import { DedupeStrategy, Polling, pollingHelper } from '@agnocon/pieces-common';
2
- import {
3
- AppConnectionValueForAuthProperty,
4
- TriggerStrategy,
5
- createTrigger,
6
- Property,
7
- } from '@agnocon/pieces-framework';
8
- import { PageCollection } from '@microsoft/microsoft-graph-client';
9
- import { Message } from '@microsoft/microsoft-graph-types';
10
- import dayjs from 'dayjs';
11
- import { microsoftOutlookAuth } from '../common/auth';
12
- import { outlookCommon } from '../common/client';
13
-
14
- const polling: Polling<AppConnectionValueForAuthProperty<typeof microsoftOutlookAuth>, {
15
- sender?: string;
16
- recipient?: string;
17
- }> = {
18
- strategy: DedupeStrategy.TIMEBASED,
19
- items: async ({ auth, lastFetchEpochMS, propsValue }) => {
20
- const client = outlookCommon.createClient(auth);
21
-
22
- const messages = [];
23
- const filter =
24
- lastFetchEpochMS === 0
25
- ? '$top=10'
26
- : `$filter=receivedDateTime gt ${dayjs(lastFetchEpochMS).toISOString()}`;
27
-
28
- let response: PageCollection = await client
29
- .api(`${outlookCommon.mailboxPrefix(auth)}/mailFolders/inbox/messages?${filter}`)
30
- .orderby('receivedDateTime desc')
31
- .get();
32
-
33
- if (lastFetchEpochMS === 0) {
34
- for (const message of response.value as Message[]) {
35
- messages.push(message);
36
- }
37
- } else {
38
- while (response.value.length > 0) {
39
- for (const message of response.value as Message[]) {
40
- messages.push(message);
41
- }
42
-
43
- if (response['@odata.nextLink']) {
44
- response = await client.api(response['@odata.nextLink']).get();
45
- } else {
46
- break;
47
- }
48
- }
49
- }
50
-
51
- let filteredMessages = messages;
52
-
53
- if (propsValue?.sender) {
54
- filteredMessages = filteredMessages.filter(
55
- (message) => {
56
- const messageSenderEmail = message.from?.emailAddress?.address?.toLowerCase();
57
- const filterSenderEmail = propsValue.sender?.toLowerCase();
58
- return messageSenderEmail === filterSenderEmail;
59
- }
60
- );
61
- }
62
-
63
- if (propsValue?.recipient) {
64
- filteredMessages = filteredMessages.filter(
65
- (message) => {
66
- const hasRecipient = message.toRecipients?.some(
67
- (recipient) => {
68
- const recipientEmail = recipient.emailAddress?.address?.toLowerCase();
69
- const filterRecipientEmail = propsValue.recipient?.toLowerCase();
70
- return recipientEmail === filterRecipientEmail;
71
- }
72
- );
73
- return hasRecipient;
74
- }
75
- );
76
- }
77
- return filteredMessages.map((message) => ({
78
- epochMilliSeconds: dayjs(message.receivedDateTime).valueOf(),
79
- data: message,
80
- }));
81
- },
82
- };
83
-
84
- export const newEmailTrigger = createTrigger({
85
- auth: microsoftOutlookAuth,
86
- name: 'newEmail',
87
- displayName: 'New Email',
88
- description: 'Triggers when a new email is received in the inbox.',
89
- aiMetadata: {
90
- description: 'Fires when a new message arrives in the mailbox Inbox, optionally narrowed to a specific sender and/or recipient address. Each fire represents one newly received email.',
91
- },
92
- props: {
93
- sender: Property.ShortText({
94
- displayName: 'From (Sender Email)',
95
- description: 'Filter emails from a specific sender (optional). Leave empty to for all senders.',
96
- required: false,
97
- }),
98
- recipient: Property.ShortText({
99
- displayName: 'To (Recipient Email)',
100
- description: 'Filter emails to a specific recipient (optional). Leave empty to for all recipients.',
101
- required: false,
102
- }),
103
- },
104
- sampleData: {},
105
- type: TriggerStrategy.POLLING,
106
- async onEnable(context) {
107
- await pollingHelper.onEnable(polling, {
108
- auth: context.auth,
109
- store: context.store,
110
- propsValue: context.propsValue,
111
- });
112
- },
113
- async onDisable(context) {
114
- await pollingHelper.onDisable(polling, {
115
- auth: context.auth,
116
- store: context.store,
117
- propsValue: context.propsValue,
118
- });
119
- },
120
- async test(context) {
121
- return await pollingHelper.test(polling, context);
122
- },
123
- async run(context) {
124
- return await pollingHelper.poll(polling, context);
125
- },
126
- });