@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.
- package/package.json +7 -21
- package/src/index.js +217 -71
- package/src/index.d.ts +0 -6
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/create-draft-reply-action.d.ts +0 -17
- package/src/lib/actions/create-draft-reply-action.d.ts.map +0 -1
- package/src/lib/actions/create-draft-reply-action.js +0 -265
- package/src/lib/actions/create-draft-reply-action.js.map +0 -1
- package/src/lib/actions/get-mail-action.d.ts +0 -7
- package/src/lib/actions/get-mail-action.d.ts.map +0 -1
- package/src/lib/actions/get-mail-action.js +0 -40
- package/src/lib/actions/get-mail-action.js.map +0 -1
- package/src/lib/actions/get-thread-action.d.ts +0 -9
- package/src/lib/actions/get-thread-action.d.ts.map +0 -1
- package/src/lib/actions/get-thread-action.js +0 -44
- package/src/lib/actions/get-thread-action.js.map +0 -1
- package/src/lib/actions/reply-to-email-action.d.ts +0 -16
- package/src/lib/actions/reply-to-email-action.d.ts.map +0 -1
- package/src/lib/actions/reply-to-email-action.js +0 -198
- package/src/lib/actions/reply-to-email-action.js.map +0 -1
- package/src/lib/actions/request-approval-in-email.d.ts +0 -15
- package/src/lib/actions/request-approval-in-email.d.ts.map +0 -1
- package/src/lib/actions/request-approval-in-email.js +0 -175
- package/src/lib/actions/request-approval-in-email.js.map +0 -1
- package/src/lib/actions/search-email-action.d.ts +0 -22
- package/src/lib/actions/search-email-action.d.ts.map +0 -1
- package/src/lib/actions/search-email-action.js +0 -175
- package/src/lib/actions/search-email-action.js.map +0 -1
- package/src/lib/actions/send-email-action.d.ts +0 -18
- package/src/lib/actions/send-email-action.d.ts.map +0 -1
- package/src/lib/actions/send-email-action.js +0 -192
- package/src/lib/actions/send-email-action.js.map +0 -1
- package/src/lib/auth.d.ts +0 -12
- package/src/lib/auth.d.ts.map +0 -1
- package/src/lib/auth.js +0 -106
- package/src/lib/auth.js.map +0 -1
- package/src/lib/common/data.d.ts +0 -132
- package/src/lib/common/data.d.ts.map +0 -1
- package/src/lib/common/data.js +0 -209
- package/src/lib/common/data.js.map +0 -1
- package/src/lib/common/models.d.ts +0 -86
- package/src/lib/common/models.d.ts.map +0 -1
- package/src/lib/common/models.js +0 -26
- package/src/lib/common/models.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -21
- package/src/lib/common/props.d.ts.map +0 -1
- package/src/lib/common/props.js +0 -226
- package/src/lib/common/props.js.map +0 -1
- package/src/lib/triggers/new-attachment.d.ts +0 -208
- package/src/lib/triggers/new-attachment.d.ts.map +0 -1
- package/src/lib/triggers/new-attachment.js +0 -142
- package/src/lib/triggers/new-attachment.js.map +0 -1
- package/src/lib/triggers/new-conversation.d.ts +0 -59
- package/src/lib/triggers/new-conversation.d.ts.map +0 -1
- package/src/lib/triggers/new-conversation.js +0 -306
- package/src/lib/triggers/new-conversation.js.map +0 -1
- package/src/lib/triggers/new-email.d.ts +0 -52
- package/src/lib/triggers/new-email.d.ts.map +0 -1
- package/src/lib/triggers/new-email.js +0 -131
- package/src/lib/triggers/new-email.js.map +0 -1
- package/src/lib/triggers/new-label.d.ts +0 -15
- package/src/lib/triggers/new-label.d.ts.map +0 -1
- package/src/lib/triggers/new-label.js +0 -78
- package/src/lib/triggers/new-label.js.map +0 -1
- package/src/lib/triggers/new-labeled-email.d.ts +0 -99
- package/src/lib/triggers/new-labeled-email.d.ts.map +0 -1
- package/src/lib/triggers/new-labeled-email.js +0 -141
- package/src/lib/triggers/new-labeled-email.js.map +0 -1
package/src/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { gmailAuth, getAccessToken, GmailAuthValue, createGoogleClient, } from './lib/auth';
|
|
2
|
-
export declare const gmail: import("@activepieces/pieces-framework").Piece<(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
|
-
}>)[]>;
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,SAAS,EACT,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,KAAK;;;MA8ChB,CAAC"}
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAA6D;AAC7D,iDAAqD;AACrD,uEAAuE;AACvE,+EAA8E;AAC9E,uFAAsF;AACtF,wDAAgE;AAChE,wEAA+E;AAC/E,uFAAiF;AACjF,kEAA0E;AAC1E,wDAAgE;AAChE,2EAA0E;AAC1E,mEAAoE;AACpE,qCAAuE;AAEvE,mCAKoB;AAJlB,iGAAA,SAAS,OAAA;AACT,sGAAA,cAAc,OAAA;AAEd,0GAAA,kBAAkB,OAAA;AAGP,QAAA,KAAK,GAAG,IAAA,8BAAW,EAAC;IAC/B,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,+CAA+C;IACxD,UAAU,EAAE;QACV,sBAAa,CAAC,aAAa;QAC3B,sBAAa,CAAC,qBAAqB;KACpC;IACD,OAAO,EAAE;QACP,wCAAoB;QACpB,kDAAsB;QACtB,+CAAuB;QACvB,uDAA2B;QAC3B,qCAAmB;QACnB,2CAAqB;QACrB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,uCAAuC;YACtD,IAAI,EAAE,gBAAS;YACf,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,MAAM,IAAA,qBAAc,EAAC,IAAsB,CAAC,EAAE;iBACxE,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,WAAW,EAAE,OAAO;IACpB,WAAW,EAAE,yBAAyB;IAEtC,OAAO,EAAE;QACP,UAAU;QACV,oBAAoB;QACpB,WAAW;QACX,YAAY;QACZ,YAAY;QACZ,WAAW;QACX,sBAAsB;QACtB,eAAe;QACf,UAAU;QACV,YAAY;QACZ,aAAa;QACb,mBAAmB;KACpB;IACD,QAAQ,EAAE;QACR,gCAAoB;QACpB,+CAA2B;QAC3B,0CAAyB;QACzB,gCAAoB;KACrB;IACD,IAAI,EAAE,gBAAS;CAChB,CAAC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const gmailCreateDraftReplyAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
}>)[], {
|
|
5
|
-
message_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (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
|
-
}>)[]>;
|
|
9
|
-
reply_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
10
|
-
body_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
11
|
-
body: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
12
|
-
include_original_message: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
13
|
-
sender_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
14
|
-
attachment: import("@activepieces/pieces-framework").FileProperty<false>;
|
|
15
|
-
attachment_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
16
|
-
}>;
|
|
17
|
-
//# sourceMappingURL=create-draft-reply-action.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-draft-reply-action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-draft-reply-action.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;EA+StC,CAAC"}
|
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gmailCreateDraftReplyAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const mime_types_1 = tslib_1.__importDefault(require("mime-types"));
|
|
7
|
-
const mail_composer_1 = tslib_1.__importDefault(require("nodemailer/lib/mail-composer"));
|
|
8
|
-
const auth_1 = require("../auth");
|
|
9
|
-
const googleapis_1 = require("googleapis");
|
|
10
|
-
const props_1 = require("../common/props");
|
|
11
|
-
exports.gmailCreateDraftReplyAction = (0, pieces_framework_1.createAction)({
|
|
12
|
-
auth: auth_1.gmailAuth,
|
|
13
|
-
name: 'create_draft_reply',
|
|
14
|
-
description: 'Creates a draft reply to an existing email.',
|
|
15
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Builds a draft reply to an existing email and saves it (unsent) in the thread, addressing the original sender (reply) or all participants (reply all) and optionally quoting the original message. Use this when a human should review and send the response rather than sending it automatically; requires the Gmail message ID of the email being replied to. Not idempotent: each call creates a new draft.',
|
|
18
|
-
idempotent: false,
|
|
19
|
-
},
|
|
20
|
-
displayName: 'Create Draft Reply',
|
|
21
|
-
props: {
|
|
22
|
-
message_id: props_1.GmailProps.message,
|
|
23
|
-
reply_type: pieces_framework_1.Property.StaticDropdown({
|
|
24
|
-
displayName: 'Reply Type',
|
|
25
|
-
description: 'Choose whether to reply to sender only or to all recipients',
|
|
26
|
-
required: true,
|
|
27
|
-
defaultValue: 'reply',
|
|
28
|
-
options: {
|
|
29
|
-
disabled: false,
|
|
30
|
-
options: [
|
|
31
|
-
{
|
|
32
|
-
label: 'Reply (to sender only)',
|
|
33
|
-
value: 'reply',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
label: 'Reply All (to all recipients)',
|
|
37
|
-
value: 'reply_all',
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
}),
|
|
42
|
-
body_type: pieces_framework_1.Property.StaticDropdown({
|
|
43
|
-
displayName: 'Body Type',
|
|
44
|
-
required: true,
|
|
45
|
-
defaultValue: 'plain_text',
|
|
46
|
-
options: {
|
|
47
|
-
disabled: false,
|
|
48
|
-
options: [
|
|
49
|
-
{
|
|
50
|
-
label: 'Plain text',
|
|
51
|
-
value: 'plain_text',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
label: 'HTML',
|
|
55
|
-
value: 'html',
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
},
|
|
59
|
-
}),
|
|
60
|
-
body: pieces_framework_1.Property.LongText({
|
|
61
|
-
displayName: 'Draft Reply Body',
|
|
62
|
-
description: 'Your draft reply message content',
|
|
63
|
-
required: false,
|
|
64
|
-
}),
|
|
65
|
-
include_original_message: pieces_framework_1.Property.Checkbox({
|
|
66
|
-
displayName: 'Include Original Message',
|
|
67
|
-
description: 'Include the original message content in the draft reply',
|
|
68
|
-
required: true,
|
|
69
|
-
defaultValue: true,
|
|
70
|
-
}),
|
|
71
|
-
sender_name: pieces_framework_1.Property.ShortText({
|
|
72
|
-
displayName: 'Sender Name',
|
|
73
|
-
description: 'Optional sender name to display',
|
|
74
|
-
required: false,
|
|
75
|
-
}),
|
|
76
|
-
attachment: pieces_framework_1.Property.File({
|
|
77
|
-
displayName: 'Attachment',
|
|
78
|
-
description: 'Optional file to attach to your draft reply',
|
|
79
|
-
required: false,
|
|
80
|
-
}),
|
|
81
|
-
attachment_name: pieces_framework_1.Property.ShortText({
|
|
82
|
-
displayName: 'Attachment Name',
|
|
83
|
-
description: 'Custom name for the attachment',
|
|
84
|
-
required: false,
|
|
85
|
-
}),
|
|
86
|
-
},
|
|
87
|
-
run(context) {
|
|
88
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
89
|
-
var _a;
|
|
90
|
-
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
91
|
-
const gmail = googleapis_1.google.gmail({ version: 'v1', auth: authClient });
|
|
92
|
-
const originalMessage = yield gmail.users.messages.get({
|
|
93
|
-
userId: 'me',
|
|
94
|
-
id: context.propsValue.message_id,
|
|
95
|
-
format: 'full',
|
|
96
|
-
});
|
|
97
|
-
if (!originalMessage.data || !originalMessage.data.payload) {
|
|
98
|
-
throw new Error('Could not fetch original message details');
|
|
99
|
-
}
|
|
100
|
-
const headers = originalMessage.data.payload.headers || [];
|
|
101
|
-
const headerMap = headers.reduce((acc, header) => {
|
|
102
|
-
if (header.name && header.value) {
|
|
103
|
-
acc[header.name.toLowerCase()] = header.value;
|
|
104
|
-
}
|
|
105
|
-
return acc;
|
|
106
|
-
}, {});
|
|
107
|
-
const originalSubject = headerMap['subject'] || '';
|
|
108
|
-
const originalFrom = headerMap['from'] || '';
|
|
109
|
-
const originalTo = headerMap['to'] || '';
|
|
110
|
-
const originalCc = headerMap['cc'] || '';
|
|
111
|
-
const originalReplyTo = headerMap['reply-to'] || '';
|
|
112
|
-
const originalMessageId = headerMap['message-id'] || '';
|
|
113
|
-
const originalReferences = headerMap['references'] || '';
|
|
114
|
-
const originalDate = headerMap['date'] || '';
|
|
115
|
-
let originalMessageContent = '';
|
|
116
|
-
if (context.propsValue.include_original_message) {
|
|
117
|
-
try {
|
|
118
|
-
const { parseStream } = yield Promise.resolve().then(() => tslib_1.__importStar(require('../common/data')));
|
|
119
|
-
const originalMessageFull = yield gmail.users.messages.get({
|
|
120
|
-
userId: 'me',
|
|
121
|
-
id: context.propsValue.message_id,
|
|
122
|
-
format: 'raw',
|
|
123
|
-
});
|
|
124
|
-
if (originalMessageFull.data.raw) {
|
|
125
|
-
const rawMessage = Buffer.from(originalMessageFull.data.raw, 'base64').toString('utf-8');
|
|
126
|
-
const parsedMessage = yield parseStream(rawMessage);
|
|
127
|
-
let messageText = parsedMessage.text || '';
|
|
128
|
-
if (!messageText && parsedMessage.html) {
|
|
129
|
-
messageText = parsedMessage.html
|
|
130
|
-
.replace(/<[^>]*>/g, '')
|
|
131
|
-
.replace(/ /g, ' ')
|
|
132
|
-
.replace(/&/g, '&')
|
|
133
|
-
.replace(/</g, '<')
|
|
134
|
-
.replace(/>/g, '>');
|
|
135
|
-
}
|
|
136
|
-
if (messageText) {
|
|
137
|
-
const quotedLines = messageText
|
|
138
|
-
.split('\n')
|
|
139
|
-
.map((line) => `> ${line.trim()}`);
|
|
140
|
-
const senderInfo = `On ${originalDate}, ${originalFrom} wrote:`;
|
|
141
|
-
originalMessageContent = `${senderInfo}\n${quotedLines.join('\n')}`;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
catch (error) {
|
|
146
|
-
console.warn('Could not extract original message content for quoting:', error);
|
|
147
|
-
originalMessageContent = `On ${originalDate}, ${originalFrom} wrote:\n> [Original message content could not be parsed]`;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
const toRecipients = [];
|
|
151
|
-
const ccRecipients = [];
|
|
152
|
-
if (context.propsValue.reply_type === 'reply_all') {
|
|
153
|
-
const senderEmail = originalReplyTo || originalFrom;
|
|
154
|
-
if (senderEmail) {
|
|
155
|
-
toRecipients.push(senderEmail);
|
|
156
|
-
}
|
|
157
|
-
const currentUserEmail = yield (0, auth_1.getUserEmail)(context.auth, authClient);
|
|
158
|
-
if (originalTo) {
|
|
159
|
-
const toEmails = originalTo.split(',').map((email) => email.trim());
|
|
160
|
-
toRecipients.push(...toEmails.filter((email) => !email.includes(currentUserEmail || '')));
|
|
161
|
-
}
|
|
162
|
-
if (originalCc) {
|
|
163
|
-
const ccEmails = originalCc.split(',').map((email) => email.trim());
|
|
164
|
-
ccRecipients.push(...ccEmails.filter((email) => !email.includes(currentUserEmail || '')));
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
const senderEmail = originalReplyTo || originalFrom;
|
|
169
|
-
if (senderEmail) {
|
|
170
|
-
toRecipients.push(senderEmail);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
let replySubject = originalSubject;
|
|
174
|
-
if (!replySubject.toLowerCase().startsWith('re:')) {
|
|
175
|
-
replySubject = `Re: ${replySubject}`;
|
|
176
|
-
}
|
|
177
|
-
let referencesHeader = originalMessageId;
|
|
178
|
-
if (originalReferences) {
|
|
179
|
-
referencesHeader = `${originalReferences} ${originalMessageId}`;
|
|
180
|
-
}
|
|
181
|
-
const senderEmail = yield (0, auth_1.getUserEmail)(context.auth, authClient);
|
|
182
|
-
let draftBody = context.propsValue.body || '';
|
|
183
|
-
if (context.propsValue.include_original_message && originalMessageContent) {
|
|
184
|
-
const separator = context.propsValue.body_type === 'html'
|
|
185
|
-
? '<br><br>--- Original Message ---<br>'
|
|
186
|
-
: '\n\n--- Original Message ---\n';
|
|
187
|
-
const quotedContent = context.propsValue.body_type === 'html'
|
|
188
|
-
? originalMessageContent.replace(/\n/g, '<br>')
|
|
189
|
-
: originalMessageContent;
|
|
190
|
-
draftBody = draftBody
|
|
191
|
-
? `${draftBody}${separator}${quotedContent}`
|
|
192
|
-
: quotedContent;
|
|
193
|
-
}
|
|
194
|
-
const subjectBase64 = Buffer.from(replySubject).toString('base64');
|
|
195
|
-
const mailOptions = {
|
|
196
|
-
to: toRecipients.join(', '),
|
|
197
|
-
cc: ccRecipients.length > 0 ? ccRecipients.join(', ') : undefined,
|
|
198
|
-
subject: `=?UTF-8?B?${subjectBase64}?=`,
|
|
199
|
-
text: context.propsValue.body_type === 'plain_text' ? draftBody : undefined,
|
|
200
|
-
html: context.propsValue.body_type === 'html' ? draftBody : undefined,
|
|
201
|
-
attachments: [],
|
|
202
|
-
headers: [
|
|
203
|
-
{
|
|
204
|
-
key: 'In-Reply-To',
|
|
205
|
-
value: originalMessageId,
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
key: 'References',
|
|
209
|
-
value: referencesHeader,
|
|
210
|
-
},
|
|
211
|
-
],
|
|
212
|
-
};
|
|
213
|
-
if (senderEmail) {
|
|
214
|
-
mailOptions.from = context.propsValue.sender_name
|
|
215
|
-
? `${context.propsValue.sender_name} <${senderEmail}>`
|
|
216
|
-
: senderEmail;
|
|
217
|
-
}
|
|
218
|
-
if (context.propsValue.attachment) {
|
|
219
|
-
const lookupResult = mime_types_1.default.lookup(context.propsValue.attachment.extension || '');
|
|
220
|
-
const attachmentOption = [
|
|
221
|
-
{
|
|
222
|
-
filename: (_a = context.propsValue.attachment_name) !== null && _a !== void 0 ? _a : context.propsValue.attachment.filename,
|
|
223
|
-
content: context.propsValue.attachment.base64,
|
|
224
|
-
contentType: lookupResult || undefined,
|
|
225
|
-
encoding: 'base64',
|
|
226
|
-
},
|
|
227
|
-
];
|
|
228
|
-
mailOptions.attachments = attachmentOption;
|
|
229
|
-
}
|
|
230
|
-
const mail = new mail_composer_1.default(mailOptions).compile();
|
|
231
|
-
mail.keepBcc = true;
|
|
232
|
-
const mailBody = yield mail.build();
|
|
233
|
-
const encodedPayload = Buffer.from(mailBody)
|
|
234
|
-
.toString('base64')
|
|
235
|
-
.replace(/\+/g, '-')
|
|
236
|
-
.replace(/\//g, '_');
|
|
237
|
-
const draft = yield gmail.users.drafts.create({
|
|
238
|
-
userId: 'me',
|
|
239
|
-
requestBody: {
|
|
240
|
-
message: {
|
|
241
|
-
threadId: originalMessage.data.threadId || undefined,
|
|
242
|
-
raw: encodedPayload,
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
});
|
|
246
|
-
return Object.assign(Object.assign({}, draft.data), { originalMessage: {
|
|
247
|
-
id: context.propsValue.message_id,
|
|
248
|
-
subject: originalSubject,
|
|
249
|
-
from: originalFrom,
|
|
250
|
-
to: originalTo,
|
|
251
|
-
date: originalDate,
|
|
252
|
-
threadId: originalMessage.data.threadId,
|
|
253
|
-
}, draftDetails: {
|
|
254
|
-
replyType: context.propsValue.reply_type,
|
|
255
|
-
recipients: {
|
|
256
|
-
to: toRecipients,
|
|
257
|
-
cc: ccRecipients,
|
|
258
|
-
},
|
|
259
|
-
subject: replySubject,
|
|
260
|
-
includeOriginal: context.propsValue.include_original_message,
|
|
261
|
-
} });
|
|
262
|
-
});
|
|
263
|
-
},
|
|
264
|
-
});
|
|
265
|
-
//# sourceMappingURL=create-draft-reply-action.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-draft-reply-action.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-draft-reply-action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,oEAA8B;AAC9B,yFAAwD;AAExD,kCAAsE;AACtE,2CAAoC;AACpC,2CAA6C;AAEhC,QAAA,2BAA2B,GAAG,IAAA,+BAAY,EAAC;IACtD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,6CAA6C;IAC1D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,gZAAgZ;QAClZ,UAAU,EAAE,KAAK;KAClB;IACD,WAAW,EAAE,oBAAoB;IACjC,KAAK,EAAE;QACL,UAAU,EAAE,kBAAU,CAAC,OAAO;QAC9B,UAAU,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAClC,WAAW,EAAE,YAAY;YACzB,WAAW,EACT,6DAA6D;YAC/D,QAAQ,EA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AAE;wBACP,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,QAAQ,IAAI,SAAS;wBACpD,GAAG,EAAE,cAAc;qBACpB;iBACF;aACF,CAAC,CAAC;YAEH,uCACK,KAAK,CAAC,IAAI,KACb,eAAe,EAAE;oBACf,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;oBACjC,OAAO,EAAE,eAAe;oBACxB,IAAI,EAAE,YAAY;oBAClB,EAAE,EAAE,UAAU;oBACd,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,QAAQ;iBACxC,EACD,YAAY,EAAE;oBACZ,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;oBACxC,UAAU,EAAE;wBACV,EAAE,EAAE,YAAY;wBAChB,EAAE,EAAE,YAAY;qBACjB;oBACD,OAAO,EAAE,YAAY;oBACrB,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,wBAAwB;iBAC7D,IACD;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const gmailGetEmailAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
}>)[], {
|
|
5
|
-
message_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=get-mail-action.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-mail-action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-mail-action.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB;;;;;EA4C9B,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gmailGetEmailAction = 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
|
-
exports.gmailGetEmailAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.gmailAuth,
|
|
11
|
-
name: 'gmail_get_mail',
|
|
12
|
-
description: 'Get an email via Id.',
|
|
13
|
-
audience: 'both',
|
|
14
|
-
aiMetadata: {
|
|
15
|
-
description: 'Fetches a single email by its Gmail message ID and returns its parsed contents, including headers, body, and decoded attachments. Use this to read the full details of a specific known message, typically after a trigger or search yields its ID. Idempotent: a read-only lookup that does not modify the mailbox.',
|
|
16
|
-
idempotent: true,
|
|
17
|
-
},
|
|
18
|
-
displayName: 'Get Email',
|
|
19
|
-
props: {
|
|
20
|
-
message_id: pieces_framework_1.Property.ShortText({
|
|
21
|
-
displayName: 'Message ID',
|
|
22
|
-
description: 'The messageId of the mail to read.',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
},
|
|
26
|
-
run(context) {
|
|
27
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
29
|
-
const gmail = googleapis_1.google.gmail({ version: 'v1', auth: authClient });
|
|
30
|
-
const rawMailResponse = yield gmail.users.messages.get({
|
|
31
|
-
userId: 'me',
|
|
32
|
-
id: context.propsValue.message_id,
|
|
33
|
-
format: 'raw',
|
|
34
|
-
});
|
|
35
|
-
const parsedMailResponse = yield (0, data_1.parseStream)(Buffer.from(rawMailResponse.data.raw, 'base64').toString('utf-8'));
|
|
36
|
-
return Object.assign(Object.assign({ id: context.propsValue.message_id }, parsedMailResponse), { attachments: yield (0, data_1.convertAttachment)(parsedMailResponse.attachments, context.files) });
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
//# sourceMappingURL=get-mail-action.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-mail-action.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-mail-action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAAwD;AACxD,2CAAoC;AACpC,yCAAgE;AAEnD,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,sBAAsB;IACnC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,sTAAsT;QACxT,UAAU,EAAE,IAAI;KACjB;IACD,WAAW,EAAE,WAAW;IACxB,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAE1D,MAAM,KAAK,GAAG,mBAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAEhE,MAAM,eAAe,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;gBACrD,MAAM,EAAE,IAAI;gBACZ,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,UAAW;gBAClC,MAAM,EAAE,KAAK;aACd,CAAC,CAAC;YAEH,MAAM,kBAAkB,GAAG,MAAM,IAAA,kBAAW,EAC1C,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,GAAa,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAChE,OAAO,CACR,CACF,CAAC;YAEF,qCACE,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU,IAC9B,kBAAkB,KACrB,WAAW,EAAE,MAAM,IAAA,wBAAiB,EAClC,kBAAkB,CAAC,WAAW,EAC9B,OAAO,CAAC,KAAK,CACd,IACD;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { GmailMessageFormat } from '../common/models';
|
|
2
|
-
export declare const gmailGetThread: import("@activepieces/pieces-framework").IAction<(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
|
-
}>)[], {
|
|
6
|
-
thread_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
format: import("@activepieces/pieces-framework").StaticDropdownProperty<GmailMessageFormat, false> | import("@activepieces/pieces-framework").StaticDropdownProperty<GmailMessageFormat, true>;
|
|
8
|
-
}>;
|
|
9
|
-
//# sourceMappingURL=get-thread-action.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-thread-action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-thread-action.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGtD,eAAO,MAAM,cAAc;;;;;;EAiCzB,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gmailGetThread = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const data_1 = require("../common/data");
|
|
7
|
-
const models_1 = require("../common/models");
|
|
8
|
-
const auth_1 = require("../auth");
|
|
9
|
-
exports.gmailGetThread = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.gmailAuth,
|
|
11
|
-
name: 'gmail_get_thread',
|
|
12
|
-
description: 'Get a thread from your Gmail account via Id',
|
|
13
|
-
displayName: 'Get Thread',
|
|
14
|
-
props: {
|
|
15
|
-
thread_id: pieces_framework_1.Property.ShortText({
|
|
16
|
-
displayName: 'Thread ID',
|
|
17
|
-
description: 'The thread Id of the mail to read',
|
|
18
|
-
required: true,
|
|
19
|
-
}),
|
|
20
|
-
format: pieces_framework_1.Property.StaticDropdown({
|
|
21
|
-
displayName: 'Format',
|
|
22
|
-
description: 'Format of the mail',
|
|
23
|
-
required: false,
|
|
24
|
-
defaultValue: 'full',
|
|
25
|
-
options: {
|
|
26
|
-
disabled: false,
|
|
27
|
-
options: [
|
|
28
|
-
{ value: models_1.GmailMessageFormat.MINIMAL, label: 'Minimal' },
|
|
29
|
-
{ value: models_1.GmailMessageFormat.FULL, label: 'Full' },
|
|
30
|
-
{ value: models_1.GmailMessageFormat.RAW, label: 'Raw' },
|
|
31
|
-
{ value: models_1.GmailMessageFormat.METADATA, label: 'Metadata' },
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
}),
|
|
35
|
-
},
|
|
36
|
-
run: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue: { format, thread_id } }) {
|
|
37
|
-
return yield data_1.GmailRequests.getThread({
|
|
38
|
-
access_token: yield (0, auth_1.getAccessToken)(auth),
|
|
39
|
-
thread_id,
|
|
40
|
-
format: format !== null && format !== void 0 ? format : models_1.GmailMessageFormat.FULL,
|
|
41
|
-
});
|
|
42
|
-
}),
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=get-thread-action.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,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,GAAI,2BAAkB,CAAC,IAAI;SAC1C,CAAC,CAAA;MAAA;CACL,CAAC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const gmailReplyToEmailAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
}>)[], {
|
|
5
|
-
message_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (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
|
-
}>)[]>;
|
|
9
|
-
reply_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
10
|
-
body_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
11
|
-
body: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
12
|
-
sender_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
13
|
-
attachment: import("@activepieces/pieces-framework").FileProperty<false>;
|
|
14
|
-
attachment_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
15
|
-
}>;
|
|
16
|
-
//# sourceMappingURL=reply-to-email-action.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reply-to-email-action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/reply-to-email-action.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;EAyNlC,CAAC"}
|