@activepieces/piece-gmail 0.12.4 → 0.12.6
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 -260
- 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 -35
- 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 -193
- 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 -170
- 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 -170
- 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 -187
- 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 -139
- 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 -128
- 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 -75
- 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 -138
- package/src/lib/triggers/new-labeled-email.js.map +0 -1
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gmailSendEmailAction = 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
|
-
exports.gmailSendEmailAction = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: auth_1.gmailAuth,
|
|
12
|
-
name: 'send_email',
|
|
13
|
-
description: 'Send an email through a Gmail account',
|
|
14
|
-
displayName: 'Send Email',
|
|
15
|
-
props: {
|
|
16
|
-
receiver: pieces_framework_1.Property.Array({
|
|
17
|
-
displayName: 'Receiver Email (To)',
|
|
18
|
-
description: undefined,
|
|
19
|
-
required: true,
|
|
20
|
-
}),
|
|
21
|
-
cc: pieces_framework_1.Property.Array({
|
|
22
|
-
displayName: 'CC Email',
|
|
23
|
-
description: undefined,
|
|
24
|
-
required: false,
|
|
25
|
-
}),
|
|
26
|
-
bcc: pieces_framework_1.Property.Array({
|
|
27
|
-
displayName: 'BCC Email',
|
|
28
|
-
description: undefined,
|
|
29
|
-
required: false,
|
|
30
|
-
}),
|
|
31
|
-
subject: pieces_framework_1.Property.ShortText({
|
|
32
|
-
displayName: 'Subject',
|
|
33
|
-
description: undefined,
|
|
34
|
-
required: true,
|
|
35
|
-
}),
|
|
36
|
-
body_type: pieces_framework_1.Property.StaticDropdown({
|
|
37
|
-
displayName: 'Body Type',
|
|
38
|
-
required: true,
|
|
39
|
-
defaultValue: 'plain_text',
|
|
40
|
-
options: {
|
|
41
|
-
disabled: false,
|
|
42
|
-
options: [
|
|
43
|
-
{
|
|
44
|
-
label: 'plain text',
|
|
45
|
-
value: 'plain_text',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
label: 'html',
|
|
49
|
-
value: 'html',
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
},
|
|
53
|
-
}),
|
|
54
|
-
body: pieces_framework_1.Property.ShortText({
|
|
55
|
-
displayName: 'Body',
|
|
56
|
-
description: 'Body for the email you want to send',
|
|
57
|
-
required: true,
|
|
58
|
-
}),
|
|
59
|
-
reply_to: pieces_framework_1.Property.Array({
|
|
60
|
-
displayName: 'Reply-To Email',
|
|
61
|
-
description: 'Email address to set as the "Reply-To" header',
|
|
62
|
-
required: false,
|
|
63
|
-
}),
|
|
64
|
-
sender_name: pieces_framework_1.Property.ShortText({
|
|
65
|
-
displayName: 'Sender Name',
|
|
66
|
-
required: false,
|
|
67
|
-
}),
|
|
68
|
-
from: pieces_framework_1.Property.ShortText({
|
|
69
|
-
displayName: 'Sender Email',
|
|
70
|
-
description: "The address must be listed in your GMail account's settings",
|
|
71
|
-
required: false,
|
|
72
|
-
}),
|
|
73
|
-
attachments: pieces_framework_1.Property.Array({
|
|
74
|
-
displayName: 'Attachments',
|
|
75
|
-
required: false,
|
|
76
|
-
properties: {
|
|
77
|
-
file: pieces_framework_1.Property.File({
|
|
78
|
-
displayName: 'File',
|
|
79
|
-
description: 'File to attach to the email you want to send.',
|
|
80
|
-
required: true,
|
|
81
|
-
}),
|
|
82
|
-
name: pieces_framework_1.Property.ShortText({
|
|
83
|
-
displayName: 'Attachment Name',
|
|
84
|
-
description: 'In case you want to change the name of the attachment.',
|
|
85
|
-
required: false,
|
|
86
|
-
}),
|
|
87
|
-
},
|
|
88
|
-
}),
|
|
89
|
-
in_reply_to: pieces_framework_1.Property.ShortText({
|
|
90
|
-
displayName: 'In reply to',
|
|
91
|
-
description: 'Reply to this Message-ID',
|
|
92
|
-
required: false,
|
|
93
|
-
}),
|
|
94
|
-
draft: pieces_framework_1.Property.Checkbox({
|
|
95
|
-
displayName: 'Create draft',
|
|
96
|
-
description: 'Create draft without sending the actual email',
|
|
97
|
-
required: true,
|
|
98
|
-
defaultValue: false,
|
|
99
|
-
}),
|
|
100
|
-
},
|
|
101
|
-
run(context) {
|
|
102
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
103
|
-
var _a, _b, _c, _d, _e;
|
|
104
|
-
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
105
|
-
const gmail = googleapis_1.google.gmail({ version: 'v1', auth: authClient });
|
|
106
|
-
const subjectBase64 = Buffer.from(context.propsValue['subject']).toString('base64');
|
|
107
|
-
const attachments = context.propsValue.attachments;
|
|
108
|
-
const replyTo = (_a = context.propsValue['reply_to']) === null || _a === void 0 ? void 0 : _a.filter((email) => email !== '');
|
|
109
|
-
const receiver = (_b = context.propsValue['receiver']) === null || _b === void 0 ? void 0 : _b.filter((email) => email !== '');
|
|
110
|
-
const cc = (_c = context.propsValue['cc']) === null || _c === void 0 ? void 0 : _c.filter((email) => email !== '');
|
|
111
|
-
const bcc = (_d = context.propsValue['bcc']) === null || _d === void 0 ? void 0 : _d.filter((email) => email !== '');
|
|
112
|
-
const mailOptions = {
|
|
113
|
-
to: receiver.join(', '), // Join all email addresses with a comma
|
|
114
|
-
cc: cc ? cc.join(', ') : undefined,
|
|
115
|
-
bcc: bcc ? bcc.join(', ') : undefined,
|
|
116
|
-
subject: `=?UTF-8?B?${subjectBase64}?=`,
|
|
117
|
-
replyTo: replyTo ? replyTo.join(', ') : '',
|
|
118
|
-
text: context.propsValue.body_type === 'plain_text'
|
|
119
|
-
? context.propsValue['body']
|
|
120
|
-
: undefined,
|
|
121
|
-
html: context.propsValue.body_type === 'html'
|
|
122
|
-
? context.propsValue['body']
|
|
123
|
-
: undefined,
|
|
124
|
-
attachments: [],
|
|
125
|
-
};
|
|
126
|
-
let threadId = undefined;
|
|
127
|
-
if (context.propsValue.in_reply_to) {
|
|
128
|
-
mailOptions.headers = [
|
|
129
|
-
{
|
|
130
|
-
key: 'References',
|
|
131
|
-
value: context.propsValue.in_reply_to,
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
key: 'In-Reply-To',
|
|
135
|
-
value: context.propsValue.in_reply_to,
|
|
136
|
-
},
|
|
137
|
-
];
|
|
138
|
-
const messages = yield gmail.users.messages.list({
|
|
139
|
-
userId: 'me',
|
|
140
|
-
q: `Rfc822msgid:${context.propsValue.in_reply_to}`,
|
|
141
|
-
});
|
|
142
|
-
threadId = (_e = messages.data.messages) === null || _e === void 0 ? void 0 : _e[0].threadId;
|
|
143
|
-
}
|
|
144
|
-
const senderEmail = context.propsValue.from || (yield (0, auth_1.getUserEmail)(context.auth, authClient));
|
|
145
|
-
if (senderEmail) {
|
|
146
|
-
mailOptions.from = context.propsValue.sender_name
|
|
147
|
-
? `${context.propsValue['sender_name']} <${senderEmail}>`
|
|
148
|
-
: senderEmail;
|
|
149
|
-
}
|
|
150
|
-
if (attachments && attachments.length > 0) {
|
|
151
|
-
const attachmentOption = attachments.map(({ file, name }) => {
|
|
152
|
-
const lookupResult = mime_types_1.default.lookup(file.extension ? file.extension : '');
|
|
153
|
-
return {
|
|
154
|
-
filename: name !== null && name !== void 0 ? name : file.filename,
|
|
155
|
-
content: file === null || file === void 0 ? void 0 : file.base64,
|
|
156
|
-
contentType: lookupResult ? lookupResult : undefined,
|
|
157
|
-
encoding: 'base64',
|
|
158
|
-
};
|
|
159
|
-
});
|
|
160
|
-
mailOptions.attachments = attachmentOption;
|
|
161
|
-
}
|
|
162
|
-
const mail = new mail_composer_1.default(mailOptions).compile();
|
|
163
|
-
mail.keepBcc = true;
|
|
164
|
-
const mailBody = yield mail.build();
|
|
165
|
-
const encodedPayload = Buffer.from(mailBody)
|
|
166
|
-
.toString('base64')
|
|
167
|
-
.replace(/\+/g, '-')
|
|
168
|
-
.replace(/\//g, '_');
|
|
169
|
-
if (context.propsValue.draft) {
|
|
170
|
-
return yield gmail.users.drafts.create({
|
|
171
|
-
userId: 'me',
|
|
172
|
-
requestBody: { message: { threadId, raw: encodedPayload } },
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
return yield gmail.users.messages.send({
|
|
177
|
-
userId: 'me',
|
|
178
|
-
requestBody: {
|
|
179
|
-
threadId,
|
|
180
|
-
raw: encodedPayload,
|
|
181
|
-
},
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
},
|
|
186
|
-
});
|
|
187
|
-
//# sourceMappingURL=send-email-action.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"send-email-action.js","sourceRoot":"","sources":["../../../../src/lib/actions/send-email-action.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,oEAA8B;AAC9B,yFAAwD;AAExD,kCAAsE;AACtE,2CAAoC;AAEvB,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,uCAAuC;IACpD,WAAW,EAAE,YAAY;IACzB,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACvB,WAAW,EAAE,qBAAqB;YAClC,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,EAAE,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACjB,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,GAAG,EAAE,2BAAQ,CAAC,KAAK,CAAC;YAClB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,cAAc,CAAC;YACjC,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE;gBACP,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,YAAY;wBACnB,KAAK,EAAE,YAAY;qBACpB;oBACD;wBACE,KAAK,EAAE,MAAM;wBACb,KAAK,EAAE,MAAM;qBACd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nB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAEvB,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;gBAC7B,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;oBACrC,MAAM,EAAE,IAAI;oBACZ,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE;iBAC5D,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;oBACrC,MAAM,EAAE,IAAI;oBACZ,WAAW,EAAE;wBACX,QAAQ;wBACR,GAAG,EAAE,cAAc;qBACpB;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
package/src/lib/auth.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';
|
|
2
|
-
import { OAuth2Client } from 'googleapis-common';
|
|
3
|
-
export declare const gmailScopes: string[];
|
|
4
|
-
export declare const gmailAuth: (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
5
|
-
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
6
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
}>)[];
|
|
8
|
-
export type GmailAuthValue = AppConnectionValueForAuthProperty<typeof gmailAuth>;
|
|
9
|
-
export declare function createGoogleClient(auth: GmailAuthValue): Promise<OAuth2Client>;
|
|
10
|
-
export declare const getAccessToken: (auth: GmailAuthValue) => Promise<string>;
|
|
11
|
-
export declare function getUserEmail(auth: GmailAuthValue, authClient: OAuth2Client): Promise<string | undefined>;
|
|
12
|
-
//# sourceMappingURL=auth.d.ts.map
|
package/src/lib/auth.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EAGlC,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQjD,eAAO,MAAM,WAAW,UAA0C,CAAC;AAEnE,eAAO,MAAM,SAAS;;;KA0CrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,iCAAiC,CAC5D,OAAO,SAAS,CACjB,CAAC;AAEF,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,YAAY,CAAC,CAoBvB;AAED,eAAO,MAAM,cAAc,SAAgB,cAAc,KAAG,OAAO,CAAC,MAAM,CAazE,CAAC;AAEF,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,EACpB,UAAU,EAAE,YAAY,GACvB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAQ7B"}
|
package/src/lib/auth.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAccessToken = exports.gmailAuth = exports.gmailScopes = void 0;
|
|
4
|
-
exports.createGoogleClient = createGoogleClient;
|
|
5
|
-
exports.getUserEmail = getUserEmail;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
8
|
-
const shared_1 = require("@activepieces/shared");
|
|
9
|
-
const googleapis_1 = require("googleapis");
|
|
10
|
-
const googleapis_common_1 = require("googleapis-common");
|
|
11
|
-
const gmailServiceAccountScopes = [
|
|
12
|
-
'https://www.googleapis.com/auth/gmail.send',
|
|
13
|
-
'https://www.googleapis.com/auth/gmail.readonly',
|
|
14
|
-
'https://www.googleapis.com/auth/gmail.compose',
|
|
15
|
-
];
|
|
16
|
-
exports.gmailScopes = [...gmailServiceAccountScopes, 'email'];
|
|
17
|
-
exports.gmailAuth = [
|
|
18
|
-
pieces_framework_1.PieceAuth.OAuth2({
|
|
19
|
-
description: '',
|
|
20
|
-
authUrl: 'https://accounts.google.com/o/oauth2/auth',
|
|
21
|
-
tokenUrl: 'https://oauth2.googleapis.com/token',
|
|
22
|
-
required: true,
|
|
23
|
-
scope: exports.gmailScopes,
|
|
24
|
-
}),
|
|
25
|
-
pieces_framework_1.PieceAuth.CustomAuth({
|
|
26
|
-
displayName: 'Service Account (Advanced)',
|
|
27
|
-
description: 'Authenticate via service account from https://console.cloud.google.com/ > IAM & Admin > Service Accounts > Create Service Account > Keys > Add key. <br> <br> You can optionally use domain-wide delegation (https://support.google.com/a/answer/162106?hl=en#zippy=%2Cset-up-domain-wide-delegation-for-a-client) to access Gmail without adding the service account to each mailbox. <br> <br> **Note:** A user email with domain-wide delegation is required for Gmail service account access.',
|
|
28
|
-
required: true,
|
|
29
|
-
props: {
|
|
30
|
-
serviceAccount: pieces_framework_1.Property.LongText({
|
|
31
|
-
displayName: 'Service Account JSON Key',
|
|
32
|
-
required: true,
|
|
33
|
-
}),
|
|
34
|
-
userEmail: pieces_framework_1.Property.ShortText({
|
|
35
|
-
displayName: 'User Email',
|
|
36
|
-
required: true,
|
|
37
|
-
description: 'Email address of the user to impersonate. Required for Gmail service account access via domain-wide delegation.',
|
|
38
|
-
}),
|
|
39
|
-
},
|
|
40
|
-
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
41
|
-
try {
|
|
42
|
-
yield (0, exports.getAccessToken)({
|
|
43
|
-
type: shared_1.AppConnectionType.CUSTOM_AUTH,
|
|
44
|
-
props: Object.assign({}, auth),
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
catch (e) {
|
|
48
|
-
return {
|
|
49
|
-
valid: false,
|
|
50
|
-
error: e.message,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
valid: true,
|
|
55
|
-
};
|
|
56
|
-
}),
|
|
57
|
-
}),
|
|
58
|
-
];
|
|
59
|
-
function createGoogleClient(auth) {
|
|
60
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
var _a;
|
|
62
|
-
if (auth.type === shared_1.AppConnectionType.CUSTOM_AUTH) {
|
|
63
|
-
let serviceAccount;
|
|
64
|
-
try {
|
|
65
|
-
serviceAccount = JSON.parse(auth.props.serviceAccount);
|
|
66
|
-
}
|
|
67
|
-
catch (_b) {
|
|
68
|
-
throw new Error('Invalid Service Account JSON Key. Please provide a valid JSON string.');
|
|
69
|
-
}
|
|
70
|
-
return new googleapis_1.google.auth.JWT({
|
|
71
|
-
email: serviceAccount.client_email,
|
|
72
|
-
key: serviceAccount.private_key,
|
|
73
|
-
scopes: gmailServiceAccountScopes,
|
|
74
|
-
subject: ((_a = auth.props.userEmail) === null || _a === void 0 ? void 0 : _a.trim()) || undefined,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
const authClient = new googleapis_common_1.OAuth2Client();
|
|
78
|
-
authClient.setCredentials(auth);
|
|
79
|
-
return authClient;
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
const getAccessToken = (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
83
|
-
if (auth.type === shared_1.AppConnectionType.CUSTOM_AUTH) {
|
|
84
|
-
const googleClient = yield createGoogleClient(auth);
|
|
85
|
-
const response = yield googleClient.getAccessToken();
|
|
86
|
-
if (response.token) {
|
|
87
|
-
return response.token;
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
throw new Error('Could not retrieve access token from service account json');
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return auth.access_token;
|
|
94
|
-
});
|
|
95
|
-
exports.getAccessToken = getAccessToken;
|
|
96
|
-
function getUserEmail(auth, authClient) {
|
|
97
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
var _a, _b;
|
|
99
|
-
if (auth.type === shared_1.AppConnectionType.CUSTOM_AUTH) {
|
|
100
|
-
return (_a = auth.props.userEmail) === null || _a === void 0 ? void 0 : _a.trim();
|
|
101
|
-
}
|
|
102
|
-
return ((_b = (yield googleapis_1.google.oauth2({ version: 'v2', auth: authClient }).userinfo.get())
|
|
103
|
-
.data.email) !== null && _b !== void 0 ? _b : undefined);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=auth.js.map
|
package/src/lib/auth.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;AAiEA,gDAsBC;AAiBD,oCAWC;;AAnHD,qEAIwC;AACxC,iDAAyD;AACzD,2CAAoC;AACpC,yDAAiD;AAEjD,MAAM,yBAAyB,GAAG;IAChC,4CAA4C;IAC5C,gDAAgD;IAChD,+CAA+C;CAChD,CAAC;AAEW,QAAA,WAAW,GAAG,CAAC,GAAG,yBAAyB,EAAE,OAAO,CAAC,CAAC;AAEtD,QAAA,SAAS,GAAG;IACvB,4BAAS,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,2CAA2C;QACpD,QAAQ,EAAE,qCAAqC;QAC/C,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,mBAAW;KACnB,CAAC;IACF,4BAAS,CAAC,UAAU,CAAC;QACnB,WAAW,EAAE,4BAA4B;QACzC,WAAW,EACT,oeAAoe;QACte,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE;YACL,cAAc,EAAE,2BAAQ,CAAC,QAAQ,CAAC;gBAChC,WAAW,EAAE,0BAA0B;gBACvC,QAAQ,EAAE,IAAI;aACf,CAAC;YACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;gBAC5B,WAAW,EAAE,YAAY;gBACzB,QAAQ,EAAE,IAAI;gBACd,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O,IAAoB,EAAmB,EAAE;IAC5E,IAAI,IAAI,CAAC,IAAI,KAAK,0BAAiB,CAAC,WAAW,EAAE,CAAC;QAChD,MAAM,YAAY,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,cAAc,EAAE,CAAC;QACrD,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACnB,OAAO,QAAQ,CAAC,KAAK,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CACb,2DAA2D,CAC5D,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC,YAAY,CAAC;AAC3B,CAAC,CAAA,CAAC;AAbW,QAAA,cAAc,kBAazB;AAEF,SAAsB,YAAY,CAChC,IAAoB,EACpB,UAAwB;;;QAExB,IAAI,IAAI,CAAC,IAAI,KAAK,0BAAiB,CAAC,WAAW,EAAE,CAAC;YAChD,OAAO,MAAA,IAAI,CAAC,KAAK,CAAC,SAAS,0CAAE,IAAI,EAAE,CAAC;QACtC,CAAC;QACD,OAAO,CACL,MAAA,CAAC,MAAM,mBAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;aACtE,IAAI,CAAC,KAAK,mCAAI,SAAS,CAC3B,CAAC;IACJ,CAAC;CAAA"}
|
package/src/lib/common/data.d.ts
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { FilesService } from '@activepieces/pieces-framework';
|
|
2
|
-
import { GmailLabel, GmailThread, GmailMessageFormat, GmailMessageResponse as GmailMessageList } from './models';
|
|
3
|
-
import { Attachment, ParsedMail } from 'mailparser';
|
|
4
|
-
import { GmailAuthValue } from '../auth';
|
|
5
|
-
interface SearchMailProps {
|
|
6
|
-
access_token: string;
|
|
7
|
-
from: string;
|
|
8
|
-
to: string;
|
|
9
|
-
subject?: string;
|
|
10
|
-
label: GmailLabel;
|
|
11
|
-
category: string;
|
|
12
|
-
after?: number;
|
|
13
|
-
before?: number;
|
|
14
|
-
max_results?: number;
|
|
15
|
-
page_token?: string;
|
|
16
|
-
}
|
|
17
|
-
interface GetMailProps {
|
|
18
|
-
access_token: string;
|
|
19
|
-
message_id?: string;
|
|
20
|
-
thread_id?: string;
|
|
21
|
-
format: GmailMessageFormat;
|
|
22
|
-
}
|
|
23
|
-
export declare const GmailRequests: {
|
|
24
|
-
getMail: ({ access_token, format, message_id }: GetMailProps) => Promise<{
|
|
25
|
-
id: string;
|
|
26
|
-
threadId: string;
|
|
27
|
-
labelIds: [string];
|
|
28
|
-
snippet: string;
|
|
29
|
-
historyId: string;
|
|
30
|
-
internalDate: number;
|
|
31
|
-
payload: {
|
|
32
|
-
partId: string;
|
|
33
|
-
mimeType: string;
|
|
34
|
-
filename: string;
|
|
35
|
-
headers: {
|
|
36
|
-
name: string;
|
|
37
|
-
value: string;
|
|
38
|
-
}[];
|
|
39
|
-
body: {
|
|
40
|
-
data: any;
|
|
41
|
-
size: number;
|
|
42
|
-
};
|
|
43
|
-
parts: {
|
|
44
|
-
parts: any[];
|
|
45
|
-
partId: string;
|
|
46
|
-
mimeType: string;
|
|
47
|
-
filename: string;
|
|
48
|
-
headers: {
|
|
49
|
-
name: string;
|
|
50
|
-
value: string;
|
|
51
|
-
}[];
|
|
52
|
-
body: {
|
|
53
|
-
size: number;
|
|
54
|
-
data: string;
|
|
55
|
-
};
|
|
56
|
-
}[];
|
|
57
|
-
};
|
|
58
|
-
sizeEstimate: number;
|
|
59
|
-
raw: string;
|
|
60
|
-
subject: string;
|
|
61
|
-
body_html: string;
|
|
62
|
-
body_plain: string;
|
|
63
|
-
}>;
|
|
64
|
-
getThread: ({ access_token, format, thread_id }: GetMailProps) => Promise<GmailThread>;
|
|
65
|
-
getLabels: (authentication: GmailAuthValue) => Promise<import("@activepieces/pieces-common").HttpResponse<{
|
|
66
|
-
labels: GmailLabel[];
|
|
67
|
-
}>>;
|
|
68
|
-
searchMail: ({ access_token, max_results, page_token: pageToken, ...mail }: SearchMailProps) => Promise<GmailMessageList | {
|
|
69
|
-
nextPageToken?: string | undefined;
|
|
70
|
-
messages: {
|
|
71
|
-
message: {
|
|
72
|
-
id: string;
|
|
73
|
-
threadId: string;
|
|
74
|
-
labelIds: [string];
|
|
75
|
-
snippet: string;
|
|
76
|
-
historyId: string;
|
|
77
|
-
internalDate: number;
|
|
78
|
-
payload: {
|
|
79
|
-
partId: string;
|
|
80
|
-
mimeType: string;
|
|
81
|
-
filename: string;
|
|
82
|
-
headers: {
|
|
83
|
-
name: string;
|
|
84
|
-
value: string;
|
|
85
|
-
}[];
|
|
86
|
-
body: {
|
|
87
|
-
data: any;
|
|
88
|
-
size: number;
|
|
89
|
-
};
|
|
90
|
-
parts: {
|
|
91
|
-
parts: any[];
|
|
92
|
-
partId: string;
|
|
93
|
-
mimeType: string;
|
|
94
|
-
filename: string;
|
|
95
|
-
headers: {
|
|
96
|
-
name: string;
|
|
97
|
-
value: string;
|
|
98
|
-
}[];
|
|
99
|
-
body: {
|
|
100
|
-
size: number;
|
|
101
|
-
data: string;
|
|
102
|
-
};
|
|
103
|
-
}[];
|
|
104
|
-
};
|
|
105
|
-
sizeEstimate: number;
|
|
106
|
-
raw: string;
|
|
107
|
-
subject: string;
|
|
108
|
-
body_html: string;
|
|
109
|
-
body_plain: string;
|
|
110
|
-
};
|
|
111
|
-
thread: GmailThread;
|
|
112
|
-
}[];
|
|
113
|
-
resultSizeEstimate: number;
|
|
114
|
-
}>;
|
|
115
|
-
getRecentMessages: (authentication: GmailAuthValue, maxResults?: number) => Promise<import("@activepieces/pieces-common").HttpResponse<GmailMessageList>>;
|
|
116
|
-
getRecentThreads: (authentication: GmailAuthValue, maxResults?: number) => Promise<import("@activepieces/pieces-common").HttpResponse<{
|
|
117
|
-
threads: {
|
|
118
|
-
id: string;
|
|
119
|
-
snippet?: string;
|
|
120
|
-
}[];
|
|
121
|
-
}>>;
|
|
122
|
-
};
|
|
123
|
-
export declare function parseStream(stream: any): Promise<ParsedMail>;
|
|
124
|
-
export declare function convertAttachment(attachments: Attachment[], files: FilesService): Promise<{
|
|
125
|
-
fileName: string;
|
|
126
|
-
mimeType: string;
|
|
127
|
-
size: number;
|
|
128
|
-
data: string;
|
|
129
|
-
}[]>;
|
|
130
|
-
export declare function getFirstFiveOrAll(array: unknown[]): unknown[];
|
|
131
|
-
export {};
|
|
132
|
-
//# sourceMappingURL=data.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EACL,UAAU,EAEV,WAAW,EACX,kBAAkB,EAClB,oBAAoB,IAAI,gBAAgB,EACzC,MAAM,UAAU,CAAC;AAMlB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAgB,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,cAAc,EAAkB,MAAM,SAAS,CAAC;AAEzD,UAAU,eAAe;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,YAAY;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AAED,eAAO,MAA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