@activepieces/piece-gmail 0.12.5 → 0.12.7

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 (69) hide show
  1. package/package.json +7 -21
  2. package/src/index.js +217 -71
  3. package/src/index.d.ts +0 -6
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/create-draft-reply-action.d.ts +0 -17
  7. package/src/lib/actions/create-draft-reply-action.d.ts.map +0 -1
  8. package/src/lib/actions/create-draft-reply-action.js +0 -265
  9. package/src/lib/actions/create-draft-reply-action.js.map +0 -1
  10. package/src/lib/actions/get-mail-action.d.ts +0 -7
  11. package/src/lib/actions/get-mail-action.d.ts.map +0 -1
  12. package/src/lib/actions/get-mail-action.js +0 -40
  13. package/src/lib/actions/get-mail-action.js.map +0 -1
  14. package/src/lib/actions/get-thread-action.d.ts +0 -9
  15. package/src/lib/actions/get-thread-action.d.ts.map +0 -1
  16. package/src/lib/actions/get-thread-action.js +0 -44
  17. package/src/lib/actions/get-thread-action.js.map +0 -1
  18. package/src/lib/actions/reply-to-email-action.d.ts +0 -16
  19. package/src/lib/actions/reply-to-email-action.d.ts.map +0 -1
  20. package/src/lib/actions/reply-to-email-action.js +0 -198
  21. package/src/lib/actions/reply-to-email-action.js.map +0 -1
  22. package/src/lib/actions/request-approval-in-email.d.ts +0 -15
  23. package/src/lib/actions/request-approval-in-email.d.ts.map +0 -1
  24. package/src/lib/actions/request-approval-in-email.js +0 -175
  25. package/src/lib/actions/request-approval-in-email.js.map +0 -1
  26. package/src/lib/actions/search-email-action.d.ts +0 -22
  27. package/src/lib/actions/search-email-action.d.ts.map +0 -1
  28. package/src/lib/actions/search-email-action.js +0 -175
  29. package/src/lib/actions/search-email-action.js.map +0 -1
  30. package/src/lib/actions/send-email-action.d.ts +0 -18
  31. package/src/lib/actions/send-email-action.d.ts.map +0 -1
  32. package/src/lib/actions/send-email-action.js +0 -192
  33. package/src/lib/actions/send-email-action.js.map +0 -1
  34. package/src/lib/auth.d.ts +0 -12
  35. package/src/lib/auth.d.ts.map +0 -1
  36. package/src/lib/auth.js +0 -106
  37. package/src/lib/auth.js.map +0 -1
  38. package/src/lib/common/data.d.ts +0 -132
  39. package/src/lib/common/data.d.ts.map +0 -1
  40. package/src/lib/common/data.js +0 -209
  41. package/src/lib/common/data.js.map +0 -1
  42. package/src/lib/common/models.d.ts +0 -86
  43. package/src/lib/common/models.d.ts.map +0 -1
  44. package/src/lib/common/models.js +0 -26
  45. package/src/lib/common/models.js.map +0 -1
  46. package/src/lib/common/props.d.ts +0 -21
  47. package/src/lib/common/props.d.ts.map +0 -1
  48. package/src/lib/common/props.js +0 -226
  49. package/src/lib/common/props.js.map +0 -1
  50. package/src/lib/triggers/new-attachment.d.ts +0 -208
  51. package/src/lib/triggers/new-attachment.d.ts.map +0 -1
  52. package/src/lib/triggers/new-attachment.js +0 -142
  53. package/src/lib/triggers/new-attachment.js.map +0 -1
  54. package/src/lib/triggers/new-conversation.d.ts +0 -59
  55. package/src/lib/triggers/new-conversation.d.ts.map +0 -1
  56. package/src/lib/triggers/new-conversation.js +0 -306
  57. package/src/lib/triggers/new-conversation.js.map +0 -1
  58. package/src/lib/triggers/new-email.d.ts +0 -52
  59. package/src/lib/triggers/new-email.d.ts.map +0 -1
  60. package/src/lib/triggers/new-email.js +0 -131
  61. package/src/lib/triggers/new-email.js.map +0 -1
  62. package/src/lib/triggers/new-label.d.ts +0 -15
  63. package/src/lib/triggers/new-label.d.ts.map +0 -1
  64. package/src/lib/triggers/new-label.js +0 -78
  65. package/src/lib/triggers/new-label.js.map +0 -1
  66. package/src/lib/triggers/new-labeled-email.d.ts +0 -99
  67. package/src/lib/triggers/new-labeled-email.d.ts.map +0 -1
  68. package/src/lib/triggers/new-labeled-email.js +0 -141
  69. package/src/lib/triggers/new-labeled-email.js.map +0 -1
@@ -1,306 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gmailNewConversationTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const props_1 = require("../common/props");
7
- const auth_1 = require("../auth");
8
- const googleapis_1 = require("googleapis");
9
- const data_1 = require("../common/data");
10
- function enrichNewConversation(_a) {
11
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ gmail, threadId, files, conversationInfo, }) {
12
- var _b;
13
- const threadResponse = yield gmail.users.threads.get({
14
- userId: 'me',
15
- id: threadId,
16
- format: 'full',
17
- });
18
- const thread = threadResponse.data;
19
- const messages = thread.messages || [];
20
- const firstMessage = messages[0];
21
- if (!(firstMessage === null || firstMessage === void 0 ? void 0 : firstMessage.id)) {
22
- throw new Error('No messages found in thread');
23
- }
24
- const rawMessageResponse = yield gmail.users.messages.get({
25
- userId: 'me',
26
- id: firstMessage.id,
27
- format: 'raw',
28
- });
29
- const parsedFirstMessage = yield (0, data_1.parseStream)(Buffer.from(rawMessageResponse.data.raw, 'base64').toString('utf-8'));
30
- const headers = ((_b = firstMessage.payload) === null || _b === void 0 ? void 0 : _b.headers) || [];
31
- const headerMap = headers.reduce((acc, header) => {
32
- if (header.name && header.value) {
33
- acc[header.name.toLowerCase()] = header.value;
34
- }
35
- return acc;
36
- }, {});
37
- return {
38
- conversation: {
39
- threadId: threadId,
40
- messageCount: messages.length,
41
- snippet: thread.snippet || '',
42
- historyId: thread.historyId,
43
- participants: extractParticipants(messages),
44
- subject: headerMap['subject'] || '',
45
- starter: {
46
- from: headerMap['from'] || '',
47
- to: headerMap['to'] || '',
48
- cc: headerMap['cc'] || '',
49
- bcc: headerMap['bcc'] || '',
50
- date: headerMap['date'] || '',
51
- messageId: firstMessage.id,
52
- },
53
- },
54
- firstMessage: Object.assign(Object.assign({}, parsedFirstMessage), { messageId: firstMessage.id, attachments: yield (0, data_1.convertAttachment)(parsedFirstMessage.attachments, files) }),
55
- conversationInfo: Object.assign(Object.assign({}, conversationInfo), { triggeredAt: Date.now() }),
56
- };
57
- });
58
- }
59
- function extractParticipants(messages) {
60
- const participants = {
61
- from: new Set(),
62
- to: new Set(),
63
- cc: new Set(),
64
- };
65
- messages.forEach((message) => {
66
- var _a;
67
- const headers = ((_a = message.payload) === null || _a === void 0 ? void 0 : _a.headers) || [];
68
- headers.forEach((header) => {
69
- if (header.name && header.value) {
70
- const name = header.name.toLowerCase();
71
- const value = header.value;
72
- if (name === 'from') {
73
- participants.from.add(value);
74
- }
75
- else if (name === 'to') {
76
- value
77
- .split(',')
78
- .forEach((email) => participants.to.add(email.trim()));
79
- }
80
- else if (name === 'cc') {
81
- value
82
- .split(',')
83
- .forEach((email) => participants.cc.add(email.trim()));
84
- }
85
- }
86
- });
87
- });
88
- return {
89
- from: participants.from,
90
- to: participants.to,
91
- cc: participants.cc,
92
- };
93
- }
94
- exports.gmailNewConversationTrigger = (0, pieces_framework_1.createTrigger)({
95
- auth: auth_1.gmailAuth,
96
- name: 'new_conversation',
97
- displayName: 'New Conversation',
98
- description: 'Triggers when a new email conversation (thread) begins',
99
- props: {
100
- from: Object.assign(Object.assign({}, props_1.GmailProps.from), { description: 'Filter by sender email (optional)', displayName: 'From', required: false }),
101
- subject: pieces_framework_1.Property.ShortText({
102
- displayName: 'Subject Contains',
103
- description: 'Only trigger for conversations containing this text in the subject (optional)',
104
- required: false,
105
- }),
106
- maxAgeHours: pieces_framework_1.Property.Number({
107
- displayName: 'Maximum Age (Hours)',
108
- description: 'Only trigger for conversations started within this many hours',
109
- required: false,
110
- defaultValue: 24,
111
- }),
112
- },
113
- sampleData: {},
114
- type: pieces_framework_1.TriggerStrategy.POLLING,
115
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
116
- const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
117
- const gmail = googleapis_1.google.gmail({ version: 'v1', auth: authClient });
118
- const profile = yield gmail.users.getProfile({ userId: 'me' });
119
- yield context.store.put('lastHistoryId', profile.data.historyId);
120
- yield context.store.put('processedThreads', []);
121
- }),
122
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
123
- yield context.store.delete('lastHistoryId');
124
- yield context.store.delete('processedThreads');
125
- }),
126
- run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
127
- var _a, _b, _c, _d;
128
- const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
129
- const gmail = googleapis_1.google.gmail({ version: 'v1', auth: authClient });
130
- const lastHistoryId = yield context.store.get('lastHistoryId');
131
- const processedThreads = (yield context.store.get('processedThreads')) || [];
132
- const maxAge = (context.propsValue.maxAgeHours || 24) * 60 * 60 * 1000;
133
- const cutoffTime = Date.now() - maxAge;
134
- try {
135
- const historyResponse = yield gmail.users.history.list({
136
- userId: 'me',
137
- startHistoryId: lastHistoryId,
138
- historyTypes: ['messageAdded'],
139
- maxResults: 100,
140
- });
141
- const newConversations = [];
142
- if (historyResponse.data.history) {
143
- for (const history of historyResponse.data.history) {
144
- if (history.messagesAdded) {
145
- for (const added of history.messagesAdded) {
146
- const threadId = (_a = added.message) === null || _a === void 0 ? void 0 : _a.threadId;
147
- if (threadId && !processedThreads.includes(threadId)) {
148
- const threadResponse = yield gmail.users.threads.get({
149
- userId: 'me',
150
- id: threadId,
151
- format: 'minimal',
152
- });
153
- if (((_b = threadResponse.data.messages) === null || _b === void 0 ? void 0 : _b.length) === 1) {
154
- newConversations.push(threadId);
155
- }
156
- }
157
- }
158
- }
159
- }
160
- }
161
- const results = [];
162
- for (const threadId of newConversations) {
163
- const threadResponse = yield gmail.users.threads.get({
164
- userId: 'me',
165
- id: threadId,
166
- format: 'full',
167
- });
168
- const thread = threadResponse.data;
169
- const firstMessage = (_c = thread.messages) === null || _c === void 0 ? void 0 : _c[0];
170
- if (!firstMessage)
171
- continue;
172
- const messageDate = parseInt(firstMessage.internalDate || '0');
173
- if (messageDate < cutoffTime)
174
- continue;
175
- const headers = ((_d = firstMessage.payload) === null || _d === void 0 ? void 0 : _d.headers) || [];
176
- const headerMap = {};
177
- headers.forEach((h) => {
178
- if (h.name && h.value) {
179
- headerMap[h.name.toLowerCase()] = h.value;
180
- }
181
- });
182
- if (context.propsValue.from) {
183
- const from = headerMap['from'] || '';
184
- if (!from.toLowerCase().includes(context.propsValue.from.toLowerCase())) {
185
- continue;
186
- }
187
- }
188
- if (context.propsValue.subject) {
189
- const subject = headerMap['subject'] || '';
190
- if (!subject
191
- .toLowerCase()
192
- .includes(context.propsValue.subject.toLowerCase())) {
193
- continue;
194
- }
195
- }
196
- const rawResponse = yield gmail.users.messages.get({
197
- userId: 'me',
198
- id: firstMessage.id,
199
- format: 'raw',
200
- });
201
- const parsedMessage = yield (0, data_1.parseStream)(Buffer.from(rawResponse.data.raw, 'base64').toString('utf-8'));
202
- results.push({
203
- id: `conversation_${threadId}`,
204
- data: {
205
- thread: {
206
- id: threadId,
207
- snippet: thread.snippet,
208
- messageCount: 1,
209
- },
210
- message: Object.assign(Object.assign({}, parsedMessage), { id: firstMessage.id, threadId: threadId, date: new Date(messageDate).toISOString(), attachments: yield (0, data_1.convertAttachment)(parsedMessage.attachments, context.files) }),
211
- conversation: {
212
- starter: {
213
- from: headerMap['from'],
214
- to: headerMap['to'],
215
- subject: headerMap['subject'],
216
- date: headerMap['date'],
217
- },
218
- },
219
- },
220
- });
221
- processedThreads.push(threadId);
222
- }
223
- if (historyResponse.data.historyId) {
224
- yield context.store.put('lastHistoryId', historyResponse.data.historyId);
225
- }
226
- const recentThreads = processedThreads.slice(-1000);
227
- yield context.store.put('processedThreads', recentThreads);
228
- return results;
229
- }
230
- catch (error) {
231
- if (error.code === 404) {
232
- const profile = yield gmail.users.getProfile({ userId: 'me' });
233
- yield context.store.put('lastHistoryId', profile.data.historyId);
234
- return [];
235
- }
236
- throw error;
237
- }
238
- }),
239
- test: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
240
- var _a, _b;
241
- const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
242
- const gmail = googleapis_1.google.gmail({ version: 'v1', auth: authClient });
243
- const maxAge = (context.propsValue.maxAgeHours || 24) * 60 * 60 * 1000;
244
- const cutoffSeconds = Math.floor((Date.now() - maxAge) / 1000);
245
- let query = `after:${cutoffSeconds}`;
246
- if (context.propsValue.from) {
247
- query += ` from:(${context.propsValue.from})`;
248
- }
249
- if (context.propsValue.subject) {
250
- query += ` subject:(${context.propsValue.subject})`;
251
- }
252
- const threadsResponse = yield gmail.users.threads.list({
253
- userId: 'me',
254
- q: query,
255
- maxResults: 5,
256
- });
257
- const results = [];
258
- if (threadsResponse.data.threads) {
259
- for (const thread of threadsResponse.data.threads) {
260
- const threadId = thread.id;
261
- const fullThread = yield gmail.users.threads.get({
262
- userId: 'me',
263
- id: threadId,
264
- format: 'full',
265
- });
266
- if (((_a = fullThread.data.messages) === null || _a === void 0 ? void 0 : _a.length) === 1) {
267
- const firstMessage = fullThread.data.messages[0];
268
- const headers = ((_b = firstMessage.payload) === null || _b === void 0 ? void 0 : _b.headers) || [];
269
- const headerMap = {};
270
- headers.forEach((h) => {
271
- if (h.name && h.value) {
272
- headerMap[h.name.toLowerCase()] = h.value;
273
- }
274
- });
275
- const rawResponse = yield gmail.users.messages.get({
276
- userId: 'me',
277
- id: firstMessage.id,
278
- format: 'raw',
279
- });
280
- const parsedMessage = yield (0, data_1.parseStream)(Buffer.from(rawResponse.data.raw, 'base64').toString('utf-8'));
281
- results.push({
282
- id: `test_conversation_${threadId}`,
283
- data: {
284
- thread: {
285
- id: threadId,
286
- snippet: fullThread.data.snippet,
287
- messageCount: 1,
288
- },
289
- message: Object.assign(Object.assign({}, parsedMessage), { id: firstMessage.id, threadId: threadId, date: new Date(parseInt(firstMessage.internalDate || '0')).toISOString(), attachments: yield (0, data_1.convertAttachment)(parsedMessage.attachments, context.files) }),
290
- conversation: {
291
- starter: {
292
- from: headerMap['from'],
293
- to: headerMap['to'],
294
- subject: headerMap['subject'],
295
- date: headerMap['date'],
296
- },
297
- },
298
- },
299
- });
300
- }
301
- }
302
- }
303
- return results;
304
- }),
305
- });
306
- //# sourceMappingURL=new-conversation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-conversation.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-conversation.ts"],"names":[],"mappings":";;;;AAAA,qEAKwC;AACxC,2CAA6C;AAC7C,kCAAwD;AACxD,2CAAoC;AACpC,yCAAgE;AAEhE,SAAe,qBAAqB;iEAAC,EACnC,KAAK,EACL,QAAQ,EACR,KAAK,EACL,gBAAgB,GASjB;;QACC,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;YACnD,MAAM,EAAE,IAAI;YACZ,EAAE,EAAE,QAAQ;YACZ,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC;QACnC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;QAEvC,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,EAAE,CAAA,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,kBAAkB,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;YACxD,MAAM,EAAE,IAAI;YACZ,EAAE,EAAE,YAAY,CAAC,EAAE;YACnB,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QAEH,MAAM,kBAAkB,GAAG,MAAM,IAAA,kBAAW,EAC1C,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAa,EAAE,QAAQ,CAAC,CAAC,QAAQ,CACnE,OAAO,CACR,CACF,CAAC;QAEF,MAAM,OAAO,GAAG,CAAA,MAAA,YAAY,CAAC,OAAO,0CAAE,OAAO,KAAI,EAAE,CAAC;QACpD,MAAM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AG,MAAM,IAAA,kBAAW,EACrC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAa,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAC5D,OAAO,CACR,CACF,CAAC;oBAEF,OAAO,CAAC,IAAI,CAAC;wBACX,EAAE,EAAE,qBAAqB,QAAQ,EAAE;wBACnC,IAAI,EAAE;4BACJ,MAAM,EAAE;gCACN,EAAE,EAAE,QAAQ;gCACZ,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,OAAO;gCAChC,YAAY,EAAE,CAAC;6BAChB;4BACD,OAAO,kCACF,aAAa,KAChB,EAAE,EAAE,YAAY,CAAC,EAAE,EACnB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,IAAI,CACZ,QAAQ,CAAC,YAAY,CAAC,YAAY,IAAI,GAAG,CAAC,CAC3C,CAAC,WAAW,EAAE,EACf,WAAW,EAAE,MAAM,IAAA,wBAAiB,EAClC,aAAa,CAAC,WAAW,EACzB,OAAO,CAAC,KAAK,CACd,GACF;4BACD,YAAY,EAAE;gCACZ,OAAO,EAAE;oCACP,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC;oCACvB,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC;oCACnB,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC;oCAC7B,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC;iCACxB;6BACF;yBACF;qBACF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -1,52 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- import { GmailLabel } from '../common/models';
3
- export declare const gmailNewEmailTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
4
- serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
5
- userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
- }>)[], {
7
- subject: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- from: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- to: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- label: import("@activepieces/pieces-framework").DropdownProperty<GmailLabel, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
11
- serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
12
- userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
- }>)[]>;
14
- category: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
15
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
16
- serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
17
- userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
18
- }>)[], {
19
- subject: import("@activepieces/pieces-framework").ShortTextProperty<false>;
20
- from: import("@activepieces/pieces-framework").ShortTextProperty<false>;
21
- to: import("@activepieces/pieces-framework").ShortTextProperty<false>;
22
- label: import("@activepieces/pieces-framework").DropdownProperty<GmailLabel, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
23
- serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
24
- userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
25
- }>)[]>;
26
- category: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
27
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
28
- serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
29
- userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
30
- }>)[], {
31
- subject: import("@activepieces/pieces-framework").ShortTextProperty<false>;
32
- from: import("@activepieces/pieces-framework").ShortTextProperty<false>;
33
- to: import("@activepieces/pieces-framework").ShortTextProperty<false>;
34
- label: import("@activepieces/pieces-framework").DropdownProperty<GmailLabel, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
35
- serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
36
- userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
37
- }>)[]>;
38
- category: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
39
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
40
- serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
41
- userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
42
- }>)[], {
43
- subject: import("@activepieces/pieces-framework").ShortTextProperty<false>;
44
- from: import("@activepieces/pieces-framework").ShortTextProperty<false>;
45
- to: import("@activepieces/pieces-framework").ShortTextProperty<false>;
46
- label: import("@activepieces/pieces-framework").DropdownProperty<GmailLabel, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
47
- serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
48
- userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
49
- }>)[]>;
50
- category: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
51
- }>;
52
- //# sourceMappingURL=new-email.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-email.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-email.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAU9C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuD/B,CAAC"}
@@ -1,131 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gmailNewEmailTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const props_1 = require("../common/props");
7
- const auth_1 = require("../auth");
8
- const data_1 = require("../common/data");
9
- const googleapis_1 = require("googleapis");
10
- exports.gmailNewEmailTrigger = (0, pieces_framework_1.createTrigger)({
11
- auth: auth_1.gmailAuth,
12
- name: 'gmail_new_email_received',
13
- displayName: 'New Email',
14
- description: 'Triggers when new mail is found in your Gmail inbox',
15
- aiMetadata: {
16
- description: 'Fires when a new email arrives in the connected Gmail account, optionally narrowed by sender, recipient, subject, label, or category filters. Each event represents one newly received message with its parsed contents and thread.',
17
- },
18
- props: {
19
- subject: props_1.GmailProps.subject,
20
- from: props_1.GmailProps.from,
21
- to: props_1.GmailProps.to,
22
- label: props_1.GmailProps.label,
23
- category: props_1.GmailProps.category,
24
- },
25
- sampleData: {},
26
- type: pieces_framework_1.TriggerStrategy.POLLING,
27
- onEnable(context) {
28
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
- yield context.store.put('lastPoll', Date.now());
30
- });
31
- },
32
- onDisable(context) {
33
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
34
- return;
35
- });
36
- },
37
- run(context) {
38
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
39
- var _a;
40
- const lastFetchEpochMS = (_a = (yield context.store.get('lastPoll'))) !== null && _a !== void 0 ? _a : 0;
41
- const items = yield pollRecentMessages({
42
- auth: context.auth,
43
- props: context.propsValue,
44
- files: context.files,
45
- lastFetchEpochMS: lastFetchEpochMS,
46
- });
47
- const newLastEpochMilliSeconds = items.reduce((acc, item) => Math.max(acc, item.epochMilliSeconds), lastFetchEpochMS);
48
- yield context.store.put('lastPoll', newLastEpochMilliSeconds);
49
- return items
50
- .filter((f) => f.epochMilliSeconds > lastFetchEpochMS)
51
- .map((item) => item.data);
52
- });
53
- },
54
- test(context) {
55
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
56
- var _a;
57
- const lastFetchEpochMS = (_a = (yield context.store.get('lastPoll'))) !== null && _a !== void 0 ? _a : 0;
58
- const items = yield pollRecentMessages({
59
- auth: context.auth,
60
- props: context.propsValue,
61
- files: context.files,
62
- lastFetchEpochMS: lastFetchEpochMS,
63
- });
64
- return (0, data_1.getFirstFiveOrAll)(items.map((item) => item.data));
65
- });
66
- },
67
- });
68
- function pollRecentMessages(_a) {
69
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, props, files, lastFetchEpochMS, }) {
70
- var _b;
71
- const authClient = yield (0, auth_1.createGoogleClient)(auth);
72
- const gmail = googleapis_1.google.gmail({ version: 'v1', auth: authClient });
73
- // construct query
74
- const query = [];
75
- const maxResults = lastFetchEpochMS === 0 ? 5 : 20;
76
- const afterUnixSeconds = Math.floor(lastFetchEpochMS / 1000);
77
- if (props.from)
78
- query.push(`from:(${props.from})`);
79
- if (props.to)
80
- query.push(`to:(${props.to})`);
81
- if (props.subject)
82
- query.push(`subject:(${props.subject})`);
83
- if (props.label)
84
- query.push(`label:${props.label.name}`);
85
- if (props.category)
86
- query.push(`category:${props.category}`);
87
- if (afterUnixSeconds != null && afterUnixSeconds > 0)
88
- query.push(`after:${afterUnixSeconds}`);
89
- // List Messages
90
- const messagesResponse = yield gmail.users.messages.list({
91
- userId: 'me',
92
- q: query.join(' '),
93
- maxResults,
94
- });
95
- // Reverse to process oldest-first so partial progress doesn't skip messages
96
- const messages = (messagesResponse.data.messages || []).slice().reverse();
97
- const pollingResponse = [];
98
- for (const message of messages) {
99
- try {
100
- const rawMailResponse = yield gmail.users.messages.get({
101
- userId: 'me',
102
- id: message.id,
103
- format: 'raw',
104
- });
105
- const threadResponse = yield gmail.users.threads.get({
106
- userId: 'me',
107
- id: message.threadId,
108
- });
109
- const parsedMailResponse = yield (0, data_1.parseStream)(Buffer.from(rawMailResponse.data.raw, 'base64').toString('utf-8'));
110
- pollingResponse.push({
111
- epochMilliSeconds: Number(rawMailResponse.data.internalDate),
112
- data: {
113
- message: Object.assign(Object.assign({}, parsedMailResponse), { attachments: yield (0, data_1.convertAttachment)(parsedMailResponse.attachments, files) }),
114
- thread: Object.assign({}, threadResponse),
115
- },
116
- });
117
- }
118
- catch (error) {
119
- const isRateLimit = error.status === 429 ||
120
- (error.status === 403 &&
121
- /quota|rate.?limit/i.test((_b = error.message) !== null && _b !== void 0 ? _b : ''));
122
- if (isRateLimit) {
123
- break;
124
- }
125
- throw error;
126
- }
127
- }
128
- return pollingResponse;
129
- });
130
- }
131
- //# sourceMappingURL=new-email.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-email.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-email.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AAExC,2CAA6C;AAC7C,kCAAwE;AACxE,yCAIwB;AACxB,2CAAoC;AAEvB,QAAA,oBAAoB,GAAG,IAAA,gCAAa,EAAC;IAChD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,qDAAqD;IAClE,UAAU,EAAE;QACV,WAAW,EACT,qOAAqO;KACxO;IACD,KAAK,EAAE;QACL,OAAO,EAAE,kBAAU,CAAC,OAAO;QAC3B,IAAI,EAAE,kBAAU,CAAC,IAAI;QACrB,EAAE,EAAE,kBAAU,CAAC,EAAE;QACjB,KAAK,EAAE,kBAAU,C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AE,QAAQ,CAAC,CAAC,QAAQ,CAChE,OAAO,CACR,CACF,CAAC;gBAEF,eAAe,CAAC,IAAI,CAAC;oBACnB,iBAAiB,EAAE,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC;oBAC5D,IAAI,EAAE;wBACJ,OAAO,kCACF,kBAAkB,KACrB,WAAW,EAAE,MAAM,IAAA,wBAAiB,EAClC,kBAAkB,CAAC,WAAW,EAC9B,KAAK,CACN,GACF;wBACD,MAAM,oBACD,cAAc,CAClB;qBACF;iBACF,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,MAAM,WAAW,GACf,KAAK,CAAC,MAAM,KAAK,GAAG;oBACpB,CAAC,KAAK,CAAC,MAAM,KAAK,GAAG;wBACnB,oBAAoB,CAAC,IAAI,CAAC,MAAA,KAAK,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC,CAAC;gBACpD,IAAI,WAAW,EAAE,CAAC;oBAChB,MAAM;gBACR,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;QAED,OAAO,eAAe,CAAC;IACzB,CAAC;CAAA"}
@@ -1,15 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const gmailNewLabelTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
3
- serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
4
- userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
- }>)[], {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
6
- serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
7
- userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
- }>)[], {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
9
- serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
10
- userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
11
- }>)[], {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
12
- serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
13
- userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
- }>)[], {}>;
15
- //# sourceMappingURL=new-label.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-label.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAQhF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;UAwE/B,CAAC"}
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gmailNewLabelTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../auth");
7
- const googleapis_1 = require("googleapis");
8
- const data_1 = require("../common/data");
9
- const shared_1 = require("@activepieces/shared");
10
- const TRIGGER_KEY = 'labels';
11
- exports.gmailNewLabelTrigger = (0, pieces_framework_1.createTrigger)({
12
- auth: auth_1.gmailAuth,
13
- name: 'new_label',
14
- displayName: 'New Label',
15
- description: 'Triggers when a new label is created.',
16
- aiMetadata: {
17
- description: 'Fires when a new label is created in the connected Gmail account. Each event represents one newly added label not seen on a prior poll.',
18
- },
19
- props: {},
20
- sampleData: {},
21
- type: pieces_framework_1.TriggerStrategy.POLLING,
22
- onEnable(context) {
23
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
- const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
25
- const gmail = googleapis_1.google.gmail({ version: 'v1', auth: authClient });
26
- const response = yield gmail.users.labels.list({
27
- userId: 'me',
28
- });
29
- const labels = response.data.labels || [];
30
- const existingLabelIds = labels.map((label) => label.id);
31
- yield context.store.put(TRIGGER_KEY, JSON.stringify(existingLabelIds));
32
- });
33
- },
34
- onDisable(context) {
35
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
36
- yield context.store.delete(TRIGGER_KEY);
37
- });
38
- },
39
- test(context) {
40
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
41
- const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
42
- const gmail = googleapis_1.google.gmail({ version: 'v1', auth: authClient });
43
- const response = yield gmail.users.labels.list({
44
- userId: 'me',
45
- });
46
- const labels = response.data.labels || [];
47
- return (0, data_1.getFirstFiveOrAll)(labels);
48
- });
49
- },
50
- run(context) {
51
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
52
- var _a;
53
- const existingIds = (_a = (yield context.store.get(TRIGGER_KEY))) !== null && _a !== void 0 ? _a : '[]';
54
- const parsedExistingIds = JSON.parse(existingIds);
55
- const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
56
- const gmail = googleapis_1.google.gmail({ version: 'v1', auth: authClient });
57
- const response = yield gmail.users.labels.list({
58
- userId: 'me',
59
- });
60
- if ((0, shared_1.isNil)(response.data.labels) || response.data.labels.length === 0) {
61
- yield context.store.put(TRIGGER_KEY, '[]');
62
- return [];
63
- }
64
- const allCurrentIds = response.data.labels.map((label) => label.id);
65
- const newLables = response.data.labels.filter((label) => {
66
- var _a;
67
- const labelId = (_a = label.id) !== null && _a !== void 0 ? _a : undefined;
68
- return labelId !== undefined && !parsedExistingIds.includes(labelId);
69
- });
70
- yield context.store.put(TRIGGER_KEY, JSON.stringify(allCurrentIds));
71
- if (newLables.length === 0) {
72
- return [];
73
- }
74
- return newLables;
75
- });
76
- },
77
- });
78
- //# sourceMappingURL=new-label.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-label.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-label.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,kCAAwD;AACxD,2CAAoC;AACpC,yCAAmD;AACnD,iDAA6C;AAE7C,MAAM,WAAW,GAAG,QAAQ,CAAC;AAEhB,QAAA,oBAAoB,GAAG,IAAA,gCAAa,EAAC;IAChD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,uCAAuC;IACpD,UAAU,EAAE;QACV,WAAW,EACT,yIAAyI;KAC5I;IACD,KAAK,EAAE,EAAE;IACT,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC1D,MAAM,KAAK,GAAG,mBAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAEhE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;gBAC7C,MAAM,EAAE,IAAI;aACb,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;YAE1C,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACzD,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,C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