@divyacon/piece-gmail 0.0.0-stage → 0.1.0
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/LICENSE.MIT-AP +24 -0
- package/README.md +8 -2
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +111 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/actions/ai-get-message-action.d.ts +7 -0
- package/dist/lib/actions/ai-get-message-action.d.ts.map +1 -0
- package/dist/lib/actions/ai-get-message-action.js +24 -0
- package/dist/lib/actions/ai-get-message-action.js.map +1 -0
- package/dist/lib/actions/ai-reply-to-thread-action.d.ts +16 -0
- package/dist/lib/actions/ai-reply-to-thread-action.d.ts.map +1 -0
- package/dist/lib/actions/ai-reply-to-thread-action.js +24 -0
- package/dist/lib/actions/ai-reply-to-thread-action.js.map +1 -0
- package/dist/lib/actions/ai-search-email-action.d.ts +21 -0
- package/dist/lib/actions/ai-search-email-action.d.ts.map +1 -0
- package/dist/lib/actions/ai-search-email-action.js +24 -0
- package/dist/lib/actions/ai-search-email-action.js.map +1 -0
- package/dist/lib/actions/ai-send-email-action.d.ts +18 -0
- package/dist/lib/actions/ai-send-email-action.d.ts.map +1 -0
- package/dist/lib/actions/ai-send-email-action.js +24 -0
- package/dist/lib/actions/ai-send-email-action.js.map +1 -0
- package/dist/lib/actions/create-draft-action.d.ts +16 -0
- package/dist/lib/actions/create-draft-action.d.ts.map +1 -0
- package/dist/lib/actions/create-draft-action.js +137 -0
- package/dist/lib/actions/create-draft-action.js.map +1 -0
- package/dist/lib/actions/create-draft-reply-action.d.ts +17 -0
- package/dist/lib/actions/create-draft-reply-action.d.ts.map +1 -0
- package/dist/lib/actions/create-draft-reply-action.js +269 -0
- package/dist/lib/actions/create-draft-reply-action.js.map +1 -0
- package/dist/lib/actions/delete-draft-action.d.ts +7 -0
- package/dist/lib/actions/delete-draft-action.d.ts.map +1 -0
- package/dist/lib/actions/delete-draft-action.js +62 -0
- package/dist/lib/actions/delete-draft-action.js.map +1 -0
- package/dist/lib/actions/forward-message-action.d.ts +12 -0
- package/dist/lib/actions/forward-message-action.d.ts.map +1 -0
- package/dist/lib/actions/forward-message-action.js +139 -0
- package/dist/lib/actions/forward-message-action.js.map +1 -0
- package/dist/lib/actions/get-attachment-action.d.ts +9 -0
- package/dist/lib/actions/get-attachment-action.d.ts.map +1 -0
- package/dist/lib/actions/get-attachment-action.js +80 -0
- package/dist/lib/actions/get-attachment-action.js.map +1 -0
- package/dist/lib/actions/get-draft-action.d.ts +7 -0
- package/dist/lib/actions/get-draft-action.d.ts.map +1 -0
- package/dist/lib/actions/get-draft-action.js +56 -0
- package/dist/lib/actions/get-draft-action.js.map +1 -0
- package/dist/lib/actions/get-label-action.d.ts +7 -0
- package/dist/lib/actions/get-label-action.d.ts.map +1 -0
- package/dist/lib/actions/get-label-action.js +55 -0
- package/dist/lib/actions/get-label-action.js.map +1 -0
- package/dist/lib/actions/get-mail-action.d.ts +7 -0
- package/dist/lib/actions/get-mail-action.d.ts.map +1 -0
- package/dist/lib/actions/get-mail-action.js +44 -0
- package/dist/lib/actions/get-mail-action.js.map +1 -0
- package/dist/lib/actions/get-profile-action.d.ts +5 -0
- package/dist/lib/actions/get-profile-action.d.ts.map +1 -0
- package/dist/lib/actions/get-profile-action.js +43 -0
- package/dist/lib/actions/get-profile-action.js.map +1 -0
- package/dist/lib/actions/get-thread-action.d.ts +9 -0
- package/dist/lib/actions/get-thread-action.d.ts.map +1 -0
- package/dist/lib/actions/get-thread-action.js +53 -0
- package/dist/lib/actions/get-thread-action.js.map +1 -0
- package/dist/lib/actions/list-drafts-action.d.ts +8 -0
- package/dist/lib/actions/list-drafts-action.d.ts.map +1 -0
- package/dist/lib/actions/list-drafts-action.js +62 -0
- package/dist/lib/actions/list-drafts-action.js.map +1 -0
- package/dist/lib/actions/list-history-action.d.ts +9 -0
- package/dist/lib/actions/list-history-action.d.ts.map +1 -0
- package/dist/lib/actions/list-history-action.js +74 -0
- package/dist/lib/actions/list-history-action.js.map +1 -0
- package/dist/lib/actions/list-labels-action.d.ts +5 -0
- package/dist/lib/actions/list-labels-action.d.ts.map +1 -0
- package/dist/lib/actions/list-labels-action.js +47 -0
- package/dist/lib/actions/list-labels-action.js.map +1 -0
- package/dist/lib/actions/list-threads-action.d.ts +10 -0
- package/dist/lib/actions/list-threads-action.d.ts.map +1 -0
- package/dist/lib/actions/list-threads-action.js +74 -0
- package/dist/lib/actions/list-threads-action.js.map +1 -0
- package/dist/lib/actions/reply-to-email-action.d.ts +16 -0
- package/dist/lib/actions/reply-to-email-action.d.ts.map +1 -0
- package/dist/lib/actions/reply-to-email-action.js +202 -0
- package/dist/lib/actions/reply-to-email-action.js.map +1 -0
- package/dist/lib/actions/request-approval-in-email.d.ts +15 -0
- package/dist/lib/actions/request-approval-in-email.d.ts.map +1 -0
- package/dist/lib/actions/request-approval-in-email.js +174 -0
- package/dist/lib/actions/request-approval-in-email.js.map +1 -0
- package/dist/lib/actions/search-email-action.d.ts +22 -0
- package/dist/lib/actions/search-email-action.d.ts.map +1 -0
- package/dist/lib/actions/search-email-action.js +179 -0
- package/dist/lib/actions/search-email-action.js.map +1 -0
- package/dist/lib/actions/send-draft-action.d.ts +7 -0
- package/dist/lib/actions/send-draft-action.d.ts.map +1 -0
- package/dist/lib/actions/send-draft-action.js +57 -0
- package/dist/lib/actions/send-draft-action.js.map +1 -0
- package/dist/lib/actions/send-email-action.d.ts +18 -0
- package/dist/lib/actions/send-email-action.d.ts.map +1 -0
- package/dist/lib/actions/send-email-action.js +196 -0
- package/dist/lib/actions/send-email-action.js.map +1 -0
- package/dist/lib/actions/stop-watch-action.d.ts +5 -0
- package/dist/lib/actions/stop-watch-action.d.ts.map +1 -0
- package/dist/lib/actions/stop-watch-action.js +41 -0
- package/dist/lib/actions/stop-watch-action.js.map +1 -0
- package/dist/lib/actions/update-draft-action.d.ts +17 -0
- package/dist/lib/actions/update-draft-action.d.ts.map +1 -0
- package/dist/lib/actions/update-draft-action.js +193 -0
- package/dist/lib/actions/update-draft-action.js.map +1 -0
- package/dist/lib/auth.d.ts +12 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +108 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/common/data.d.ts +132 -0
- package/dist/lib/common/data.d.ts.map +1 -0
- package/dist/lib/common/data.js +209 -0
- package/dist/lib/common/data.js.map +1 -0
- package/dist/lib/common/mime.d.ts +29 -0
- package/dist/lib/common/mime.d.ts.map +1 -0
- package/dist/lib/common/mime.js +59 -0
- package/dist/lib/common/mime.js.map +1 -0
- package/dist/lib/common/models.d.ts +86 -0
- package/dist/lib/common/models.d.ts.map +1 -0
- package/dist/lib/common/models.js +26 -0
- package/dist/lib/common/models.js.map +1 -0
- package/dist/lib/common/props.d.ts +28 -0
- package/dist/lib/common/props.d.ts.map +1 -0
- package/dist/lib/common/props.js +231 -0
- package/dist/lib/common/props.js.map +1 -0
- package/dist/lib/output-schemas.d.ts +29 -0
- package/dist/lib/output-schemas.d.ts.map +1 -0
- package/dist/lib/output-schemas.js +1029 -0
- package/dist/lib/output-schemas.js.map +1 -0
- package/dist/lib/triggers/new-attachment.d.ts +144 -0
- package/dist/lib/triggers/new-attachment.d.ts.map +1 -0
- package/dist/lib/triggers/new-attachment.js +150 -0
- package/dist/lib/triggers/new-attachment.js.map +1 -0
- package/dist/lib/triggers/new-conversation.d.ts +59 -0
- package/dist/lib/triggers/new-conversation.d.ts.map +1 -0
- package/dist/lib/triggers/new-conversation.js +308 -0
- package/dist/lib/triggers/new-conversation.js.map +1 -0
- package/dist/lib/triggers/new-email.d.ts +52 -0
- package/dist/lib/triggers/new-email.d.ts.map +1 -0
- package/dist/lib/triggers/new-email.js +135 -0
- package/dist/lib/triggers/new-email.js.map +1 -0
- package/dist/lib/triggers/new-label.d.ts +15 -0
- package/dist/lib/triggers/new-label.d.ts.map +1 -0
- package/dist/lib/triggers/new-label.js +82 -0
- package/dist/lib/triggers/new-label.js.map +1 -0
- package/dist/lib/triggers/new-labeled-email.d.ts +35 -0
- package/dist/lib/triggers/new-labeled-email.d.ts.map +1 -0
- package/dist/lib/triggers/new-labeled-email.js +147 -0
- package/dist/lib/triggers/new-labeled-email.js.map +1 -0
- package/package.json +53 -3
- package/src/index.ts +107 -0
- package/src/lib/actions/ai-get-message-action.ts +20 -0
- package/src/lib/actions/ai-reply-to-thread-action.ts +20 -0
- package/src/lib/actions/ai-search-email-action.ts +21 -0
- package/src/lib/actions/ai-send-email-action.ts +20 -0
- package/src/lib/actions/create-draft-action.ts +148 -0
- package/src/lib/actions/create-draft-reply-action.ts +314 -0
- package/src/lib/actions/delete-draft-action.ts +57 -0
- package/src/lib/actions/forward-message-action.ts +159 -0
- package/src/lib/actions/get-attachment-action.ts +83 -0
- package/src/lib/actions/get-draft-action.ts +53 -0
- package/src/lib/actions/get-label-action.ts +53 -0
- package/src/lib/actions/get-mail-action.ts +52 -0
- package/src/lib/actions/get-profile-action.ts +39 -0
- package/src/lib/actions/get-thread-action.ts +47 -0
- package/src/lib/actions/list-drafts-action.ts +72 -0
- package/src/lib/actions/list-history-action.ts +83 -0
- package/src/lib/actions/list-labels-action.ts +43 -0
- package/src/lib/actions/list-threads-action.ts +89 -0
- package/src/lib/actions/reply-to-email-action.ts +228 -0
- package/src/lib/actions/request-approval-in-email.ts +197 -0
- package/src/lib/actions/search-email-action.ts +219 -0
- package/src/lib/actions/send-draft-action.ts +54 -0
- package/src/lib/actions/send-email-action.ts +213 -0
- package/src/lib/actions/stop-watch-action.ts +37 -0
- package/src/lib/actions/update-draft-action.ts +211 -0
- package/src/lib/auth.ts +116 -0
- package/src/lib/common/data.ts +268 -0
- package/src/lib/common/mime.ts +82 -0
- package/src/lib/common/models.ts +91 -0
- package/src/lib/common/props.ts +262 -0
- package/src/lib/output-schemas.ts +1061 -0
- package/src/lib/triggers/new-attachment.ts +203 -0
- package/src/lib/triggers/new-conversation.ts +413 -0
- package/src/lib/triggers/new-email.ts +173 -0
- package/src/lib/triggers/new-label.ts +83 -0
- package/src/lib/triggers/new-labeled-email.ts +197 -0
package/LICENSE.MIT-AP
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Activepieces AB
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
Derived helpers in this folder are adapted from Activepieces (MIT) for use
|
|
24
|
+
inside CX without depending on @activepieces/* packages at runtime.
|
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @divyacon/piece-gmail
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
DivyaCon Gmail Connector for workflows and automations.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
`ash
|
|
8
|
+
npm install @divyacon/piece-gmail
|
|
9
|
+
`
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { gmailAuth, getAccessToken, GmailAuthValue, createGoogleClient, } from './lib/auth';
|
|
2
|
+
export declare const gmail: import("@agnocon/pieces-framework").Piece<(import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
4
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
}>)[]>;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoCA,OAAO,EACL,SAAS,EACT,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,KAAK;;;MAiEhB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gmail = exports.createGoogleClient = exports.getAccessToken = exports.gmailAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/gmail/src/index.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
8
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
9
|
+
const pieces_framework_2 = require("@agnocon/pieces-framework");
|
|
10
|
+
const send_email_action_1 = require("./lib/actions/send-email-action");
|
|
11
|
+
const reply_to_email_action_1 = require("./lib/actions/reply-to-email-action");
|
|
12
|
+
const create_draft_reply_action_1 = require("./lib/actions/create-draft-reply-action");
|
|
13
|
+
const new_email_1 = require("./lib/triggers/new-email");
|
|
14
|
+
const new_labeled_email_1 = require("./lib/triggers/new-labeled-email");
|
|
15
|
+
const request_approval_in_email_1 = require("./lib/actions/request-approval-in-email");
|
|
16
|
+
const new_attachment_1 = require("./lib/triggers/new-attachment");
|
|
17
|
+
const new_label_1 = require("./lib/triggers/new-label");
|
|
18
|
+
const search_email_action_1 = require("./lib/actions/search-email-action");
|
|
19
|
+
const get_mail_action_1 = require("./lib/actions/get-mail-action");
|
|
20
|
+
const auth_1 = require("./lib/auth");
|
|
21
|
+
const ai_send_email_action_1 = require("./lib/actions/ai-send-email-action");
|
|
22
|
+
const ai_reply_to_thread_action_1 = require("./lib/actions/ai-reply-to-thread-action");
|
|
23
|
+
const ai_get_message_action_1 = require("./lib/actions/ai-get-message-action");
|
|
24
|
+
const ai_search_email_action_1 = require("./lib/actions/ai-search-email-action");
|
|
25
|
+
const get_thread_action_1 = require("./lib/actions/get-thread-action");
|
|
26
|
+
const create_draft_action_1 = require("./lib/actions/create-draft-action");
|
|
27
|
+
const update_draft_action_1 = require("./lib/actions/update-draft-action");
|
|
28
|
+
const send_draft_action_1 = require("./lib/actions/send-draft-action");
|
|
29
|
+
const get_draft_action_1 = require("./lib/actions/get-draft-action");
|
|
30
|
+
const list_drafts_action_1 = require("./lib/actions/list-drafts-action");
|
|
31
|
+
const delete_draft_action_1 = require("./lib/actions/delete-draft-action");
|
|
32
|
+
const list_threads_action_1 = require("./lib/actions/list-threads-action");
|
|
33
|
+
const get_attachment_action_1 = require("./lib/actions/get-attachment-action");
|
|
34
|
+
const forward_message_action_1 = require("./lib/actions/forward-message-action");
|
|
35
|
+
const list_labels_action_1 = require("./lib/actions/list-labels-action");
|
|
36
|
+
const get_label_action_1 = require("./lib/actions/get-label-action");
|
|
37
|
+
const get_profile_action_1 = require("./lib/actions/get-profile-action");
|
|
38
|
+
const list_history_action_1 = require("./lib/actions/list-history-action");
|
|
39
|
+
const stop_watch_action_1 = require("./lib/actions/stop-watch-action");
|
|
40
|
+
var auth_2 = require("./lib/auth");
|
|
41
|
+
Object.defineProperty(exports, "gmailAuth", { enumerable: true, get: function () { return auth_2.gmailAuth; } });
|
|
42
|
+
Object.defineProperty(exports, "getAccessToken", { enumerable: true, get: function () { return auth_2.getAccessToken; } });
|
|
43
|
+
Object.defineProperty(exports, "createGoogleClient", { enumerable: true, get: function () { return auth_2.createGoogleClient; } });
|
|
44
|
+
exports.gmail = (0, pieces_framework_1.createPiece)({
|
|
45
|
+
minimumSupportedRelease: '0.87.0',
|
|
46
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/gmail.png',
|
|
47
|
+
categories: [
|
|
48
|
+
pieces_framework_2.PieceCategory.COMMUNICATION,
|
|
49
|
+
pieces_framework_2.PieceCategory.BUSINESS_INTELLIGENCE,
|
|
50
|
+
],
|
|
51
|
+
actions: [
|
|
52
|
+
send_email_action_1.gmailSendEmailAction,
|
|
53
|
+
request_approval_in_email_1.requestApprovalInEmail,
|
|
54
|
+
reply_to_email_action_1.gmailReplyToEmailAction,
|
|
55
|
+
create_draft_reply_action_1.gmailCreateDraftReplyAction,
|
|
56
|
+
get_mail_action_1.gmailGetEmailAction,
|
|
57
|
+
search_email_action_1.gmailSearchMailAction,
|
|
58
|
+
ai_send_email_action_1.gmailAiSendEmailAction,
|
|
59
|
+
ai_reply_to_thread_action_1.gmailAiReplyToThreadAction,
|
|
60
|
+
ai_get_message_action_1.gmailAiGetMessageAction,
|
|
61
|
+
ai_search_email_action_1.gmailAiSearchEmailAction,
|
|
62
|
+
get_thread_action_1.gmailGetThread,
|
|
63
|
+
create_draft_action_1.gmailCreateDraftAction,
|
|
64
|
+
update_draft_action_1.gmailUpdateDraftAction,
|
|
65
|
+
send_draft_action_1.gmailSendDraftAction,
|
|
66
|
+
get_draft_action_1.gmailGetDraftAction,
|
|
67
|
+
list_drafts_action_1.gmailListDraftsAction,
|
|
68
|
+
delete_draft_action_1.gmailDeleteDraftAction,
|
|
69
|
+
list_threads_action_1.gmailListThreadsAction,
|
|
70
|
+
get_attachment_action_1.gmailGetAttachmentAction,
|
|
71
|
+
forward_message_action_1.gmailForwardMessageAction,
|
|
72
|
+
list_labels_action_1.gmailListLabelsAction,
|
|
73
|
+
get_label_action_1.gmailGetLabelAction,
|
|
74
|
+
get_profile_action_1.gmailGetProfileAction,
|
|
75
|
+
list_history_action_1.gmailListHistoryAction,
|
|
76
|
+
stop_watch_action_1.gmailStopWatchAction,
|
|
77
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
78
|
+
baseUrl: () => 'https://gmail.googleapis.com/gmail/v1',
|
|
79
|
+
auth: auth_1.gmailAuth,
|
|
80
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
+
return ({
|
|
82
|
+
Authorization: `Bearer ${yield (0, auth_1.getAccessToken)(auth)}`,
|
|
83
|
+
});
|
|
84
|
+
}),
|
|
85
|
+
}),
|
|
86
|
+
],
|
|
87
|
+
displayName: 'Gmail',
|
|
88
|
+
description: 'Email service by Google',
|
|
89
|
+
authors: [
|
|
90
|
+
'kanarelo',
|
|
91
|
+
'abdullahranginwala',
|
|
92
|
+
'BastienMe',
|
|
93
|
+
'Salem-Alaa',
|
|
94
|
+
'kishanprmr',
|
|
95
|
+
'MoShizzle',
|
|
96
|
+
'AbdulTheActivePiecer',
|
|
97
|
+
'khaledmashaly',
|
|
98
|
+
'abuaboud',
|
|
99
|
+
'AdamSelene',
|
|
100
|
+
'sanket-a11y',
|
|
101
|
+
'onyedikachi-david',
|
|
102
|
+
],
|
|
103
|
+
triggers: [
|
|
104
|
+
new_email_1.gmailNewEmailTrigger,
|
|
105
|
+
new_labeled_email_1.gmailNewLabeledEmailTrigger,
|
|
106
|
+
new_attachment_1.gmailNewAttachmentTrigger,
|
|
107
|
+
new_label_1.gmailNewLabelTrigger,
|
|
108
|
+
],
|
|
109
|
+
auth: auth_1.gmailAuth,
|
|
110
|
+
});
|
|
111
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,iFAAiF;AACjF,qEAAqE;AACrE,0DAAmE;AACnE,gEAAwD;AACxD,gEAA0D;AAC1D,uEAAuE;AACvE,+EAA8E;AAC9E,uFAAsF;AACtF,wDAAgE;AAChE,wEAA+E;AAC/E,uFAAiF;AACjF,kEAA0E;AAC1E,wDAAgE;AAChE,2EAA0E;AAC1E,mEAAoE;AACpE,qCAAuE;AACvE,6EAA4E;AAC5E,uFAAqF;AACrF,+EAA8E;AAC9E,iFAAgF;AAChF,uEAAiE;AACjE,2EAA2E;AAC3E,2EAA2E;AAC3E,uEAAuE;AACvE,qEAAqE;AACrE,yEAAyE;AACzE,2EAA2E;AAC3E,2EAA2E;AAC3E,+EAA+E;AAC/E,iFAAiF;AACjF,yEAAyE;AACzE,qEAAqE;AACrE,yEAAyE;AACzE,2EAA2E;AAC3E,uEAAuE;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,gCAAa,CAAC,aAAa;QAC3B,gCAAa,CAAC,qBAAqB;KACpC;IACD,OAAO,EAAE;QACP,wCAAoB;QACpB,kDAAsB;QACtB,+CAAuB;QACvB,uDAA2B;QAC3B,qCAAmB;QACnB,2CAAqB;QACrB,6CAAsB;QACtB,sDAA0B;QAC1B,+CAAuB;QACvB,iDAAwB;QACxB,kCAAc;QACd,4CAAsB;QACtB,4CAAsB;QACtB,wCAAoB;QACpB,sCAAmB;QACnB,0CAAqB;QACrB,4CAAsB;QACtB,4CAAsB;QACtB,gDAAwB;QACxB,kDAAyB;QACzB,0CAAqB;QACrB,sCAAmB;QACnB,0CAAqB;QACrB,4CAAsB;QACtB,wCAAoB;QACpB,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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const gmailAiGetMessageAction: import("@agnocon/pieces-framework").IAction<(import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>)[], {
|
|
5
|
+
message_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=ai-get-message-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-get-message-action.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/ai-get-message-action.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,uBAAuB;;;;;EAclC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gmailAiGetMessageAction = void 0;
|
|
4
|
+
// Vendored from Activepieces packages/pieces/community/gmail/src/lib/actions/ai-get-message-action.ts (MIT).
|
|
5
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
6
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const get_mail_action_1 = require("./get-mail-action");
|
|
9
|
+
const output_schemas_1 = require("../output-schemas");
|
|
10
|
+
exports.gmailAiGetMessageAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.gmailAuth,
|
|
12
|
+
name: 'gmail_get_message',
|
|
13
|
+
displayName: 'Get Message',
|
|
14
|
+
description: 'Get a single email message by its ID.',
|
|
15
|
+
audience: 'ai',
|
|
16
|
+
aiMetadata: {
|
|
17
|
+
description: 'Fetches a single email by its Gmail message ID and returns its parsed contents, including headers, body, and decoded attachments (each attachment is returned with its downloaded content directly, so a separate Get Attachment call is normally unnecessary). Use this to read the full details of a specific known message; obtain the message ID from Search Email. Idempotent: a read-only lookup that does not modify the mailbox.',
|
|
18
|
+
idempotent: true,
|
|
19
|
+
},
|
|
20
|
+
outputSchema: output_schemas_1.gmailAiGetMessageActionOutputSchema,
|
|
21
|
+
props: get_mail_action_1.gmailGetEmailAction.props,
|
|
22
|
+
run: get_mail_action_1.gmailGetEmailAction.run,
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=ai-get-message-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-get-message-action.js","sourceRoot":"","sources":["../../../src/lib/actions/ai-get-message-action.ts"],"names":[],"mappings":";;;AAAA,6GAA6G;AAC7G,qEAAqE;AACrE,gEAAyD;AACzD,kCAAoC;AACpC,uDAAwD;AACxD,sDAAwE;AAE3D,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,uCAAuC;IACpD,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,WAAW,EACT,0aAA0a;QAC5a,UAAU,EAAE,IAAI;KACjB;IACD,YAAY,EAAE,oDAAmC;IACjD,KAAK,EAAE,qCAAmB,CAAC,KAAK;IAChC,GAAG,EAAE,qCAAmB,CAAC,GAAG;CAC7B,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const gmailAiReplyToThreadAction: import("@agnocon/pieces-framework").IAction<(import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>)[], {
|
|
5
|
+
message_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, (import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
6
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
7
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
8
|
+
}>)[]>;
|
|
9
|
+
reply_type: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
10
|
+
body_type: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
11
|
+
body: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
12
|
+
sender_name: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
13
|
+
attachment: import("@agnocon/pieces-framework").FileProperty<false, false>;
|
|
14
|
+
attachment_name: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=ai-reply-to-thread-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-reply-to-thread-action.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/ai-reply-to-thread-action.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;EAcrC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gmailAiReplyToThreadAction = void 0;
|
|
4
|
+
// Vendored from Activepieces packages/pieces/community/gmail/src/lib/actions/ai-reply-to-thread-action.ts (MIT).
|
|
5
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
6
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const reply_to_email_action_1 = require("./reply-to-email-action");
|
|
9
|
+
const output_schemas_1 = require("../output-schemas");
|
|
10
|
+
exports.gmailAiReplyToThreadAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.gmailAuth,
|
|
12
|
+
name: 'gmail_reply_to_thread',
|
|
13
|
+
displayName: 'Reply to Thread',
|
|
14
|
+
description: 'Reply to an existing email thread.',
|
|
15
|
+
audience: 'ai',
|
|
16
|
+
aiMetadata: {
|
|
17
|
+
description: 'Sends a reply to an existing email, preserving the thread and subject and addressing the original sender (reply) or all participants (reply all). Use this to respond within a known conversation; requires the Gmail message ID of the email being answered (obtain it from Search Email or Get Thread). Not idempotent: each call sends a new reply into the thread.',
|
|
18
|
+
idempotent: false,
|
|
19
|
+
},
|
|
20
|
+
outputSchema: output_schemas_1.gmailAiReplyToThreadActionOutputSchema,
|
|
21
|
+
props: reply_to_email_action_1.gmailReplyToEmailAction.props,
|
|
22
|
+
run: reply_to_email_action_1.gmailReplyToEmailAction.run,
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=ai-reply-to-thread-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-reply-to-thread-action.js","sourceRoot":"","sources":["../../../src/lib/actions/ai-reply-to-thread-action.ts"],"names":[],"mappings":";;;AAAA,iHAAiH;AACjH,qEAAqE;AACrE,gEAAyD;AACzD,kCAAoC;AACpC,mEAAkE;AAClE,sDAA2E;AAE9D,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,oCAAoC;IACjD,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,WAAW,EACT,wWAAwW;QAC1W,UAAU,EAAE,KAAK;KAClB;IACD,YAAY,EAAE,uDAAsC;IACpD,KAAK,EAAE,+CAAuB,CAAC,KAAK;IACpC,GAAG,EAAE,+CAAuB,CAAC,GAAG;CACjC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const gmailAiSearchEmailAction: import("@agnocon/pieces-framework").IAction<(import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>)[], {
|
|
5
|
+
from: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
to: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
7
|
+
subject: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
content: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
9
|
+
has_attachment: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
10
|
+
attachment_name: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
11
|
+
label: import("@agnocon/pieces-framework").DropdownProperty<import("../common/models").GmailLabel, false, (import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
12
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
13
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
14
|
+
}>)[]>;
|
|
15
|
+
category: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
|
|
16
|
+
after_date: import("@agnocon/pieces-framework").DateTimeProperty<false>;
|
|
17
|
+
before_date: import("@agnocon/pieces-framework").DateTimeProperty<false>;
|
|
18
|
+
include_spam_trash: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
19
|
+
max_results: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
20
|
+
}>;
|
|
21
|
+
//# sourceMappingURL=ai-search-email-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-search-email-action.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/ai-search-email-action.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;EAenC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gmailAiSearchEmailAction = void 0;
|
|
4
|
+
// Vendored from Activepieces packages/pieces/community/gmail/src/lib/actions/ai-search-email-action.ts (MIT).
|
|
5
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
6
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const search_email_action_1 = require("./search-email-action");
|
|
9
|
+
const output_schemas_1 = require("../output-schemas");
|
|
10
|
+
exports.gmailAiSearchEmailAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.gmailAuth,
|
|
12
|
+
name: 'gmail_search_email',
|
|
13
|
+
displayName: 'Search Email',
|
|
14
|
+
description: 'Search emails using advanced criteria. If no filters are provided, the latest emails are returned.',
|
|
15
|
+
audience: 'ai',
|
|
16
|
+
aiMetadata: {
|
|
17
|
+
description: 'Searches the mailbox for emails matching combinable filters (sender, recipient, subject, body text, label, category, date range, attachment presence/name) and returns the matched messages with parsed contents and their message IDs. Use this as the primary resolver to locate messages or discover their message IDs before reading or replying to them; with no filters it returns the most recent emails. Bound results with Max Results (1-500, default 10). Idempotent: a read-only search that does not modify the mailbox.',
|
|
18
|
+
idempotent: true,
|
|
19
|
+
},
|
|
20
|
+
outputSchema: output_schemas_1.gmailAiSearchEmailActionOutputSchema,
|
|
21
|
+
props: search_email_action_1.gmailSearchMailAction.props,
|
|
22
|
+
run: search_email_action_1.gmailSearchMailAction.run,
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=ai-search-email-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-search-email-action.js","sourceRoot":"","sources":["../../../src/lib/actions/ai-search-email-action.ts"],"names":[],"mappings":";;;AAAA,8GAA8G;AAC9G,qEAAqE;AACrE,gEAAyD;AACzD,kCAAoC;AACpC,+DAA8D;AAC9D,sDAAyE;AAE5D,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,cAAc;IAC3B,WAAW,EACT,oGAAoG;IACtG,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,WAAW,EACT,ugBAAugB;QACzgB,UAAU,EAAE,IAAI;KACjB;IACD,YAAY,EAAE,qDAAoC;IAClD,KAAK,EAAE,2CAAqB,CAAC,KAAK;IAClC,GAAG,EAAE,2CAAqB,CAAC,GAAG;CAC/B,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const gmailAiSendEmailAction: import("@agnocon/pieces-framework").IAction<(import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>)[], {
|
|
5
|
+
receiver: import("@agnocon/pieces-framework").ArrayProperty<true>;
|
|
6
|
+
cc: import("@agnocon/pieces-framework").ArrayProperty<false>;
|
|
7
|
+
bcc: import("@agnocon/pieces-framework").ArrayProperty<false>;
|
|
8
|
+
subject: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
9
|
+
body_type: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
10
|
+
body: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
reply_to: import("@agnocon/pieces-framework").ArrayProperty<false>;
|
|
12
|
+
sender_name: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
13
|
+
from: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
14
|
+
attachments: import("@agnocon/pieces-framework").ArrayProperty<true> | import("@agnocon/pieces-framework").ArrayProperty<false>;
|
|
15
|
+
in_reply_to: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
16
|
+
draft: import("@agnocon/pieces-framework").CheckboxProperty<true>;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=ai-send-email-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-send-email-action.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/ai-send-email-action.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;EAcjC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gmailAiSendEmailAction = void 0;
|
|
4
|
+
// Vendored from Activepieces packages/pieces/community/gmail/src/lib/actions/ai-send-email-action.ts (MIT).
|
|
5
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
6
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const send_email_action_1 = require("./send-email-action");
|
|
9
|
+
const output_schemas_1 = require("../output-schemas");
|
|
10
|
+
exports.gmailAiSendEmailAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.gmailAuth,
|
|
12
|
+
name: 'gmail_send_email',
|
|
13
|
+
displayName: 'Send Email',
|
|
14
|
+
description: 'Send an email through a Gmail account',
|
|
15
|
+
audience: 'ai',
|
|
16
|
+
aiMetadata: {
|
|
17
|
+
description: 'Composes and sends a new email from the connected Gmail account to one or more recipients, with optional CC/BCC, attachments, and a plain-text or HTML body. Use this to originate a fresh message; to answer an existing conversation prefer Reply to Thread, and to save an unsent message use Create Draft. Not idempotent: each call sends a separate message.',
|
|
18
|
+
idempotent: false,
|
|
19
|
+
},
|
|
20
|
+
outputSchema: output_schemas_1.gmailAiSendEmailActionOutputSchema,
|
|
21
|
+
props: send_email_action_1.gmailSendEmailAction.props,
|
|
22
|
+
run: send_email_action_1.gmailSendEmailAction.run,
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=ai-send-email-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-send-email-action.js","sourceRoot":"","sources":["../../../src/lib/actions/ai-send-email-action.ts"],"names":[],"mappings":";;;AAAA,4GAA4G;AAC5G,qEAAqE;AACrE,gEAAyD;AACzD,kCAAoC;AACpC,2DAA2D;AAC3D,sDAAuE;AAE1D,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,uCAAuC;IACpD,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,WAAW,EACT,oWAAoW;QACtW,UAAU,EAAE,KAAK;KAClB;IACD,YAAY,EAAE,mDAAkC;IAChD,KAAK,EAAE,wCAAoB,CAAC,KAAK;IACjC,GAAG,EAAE,wCAAoB,CAAC,GAAG;CAC9B,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const gmailCreateDraftAction: import("@agnocon/pieces-framework").IAction<(import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>)[], {
|
|
5
|
+
receiver: import("@agnocon/pieces-framework").ArrayProperty<false>;
|
|
6
|
+
cc: import("@agnocon/pieces-framework").ArrayProperty<false>;
|
|
7
|
+
bcc: import("@agnocon/pieces-framework").ArrayProperty<false>;
|
|
8
|
+
subject: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
9
|
+
body_type: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
10
|
+
body: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
11
|
+
sender_name: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
12
|
+
from: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
13
|
+
thread_id: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
14
|
+
attachments: import("@agnocon/pieces-framework").ArrayProperty<true> | import("@agnocon/pieces-framework").ArrayProperty<false>;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=create-draft-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-draft-action.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-draft-action.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;EA6IjC,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gmailCreateDraftAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/gmail/src/lib/actions/create-draft-action.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const auth_1 = require("../auth");
|
|
9
|
+
const gmail_1 = require("@googleapis/gmail");
|
|
10
|
+
const mime_1 = require("../common/mime");
|
|
11
|
+
const output_schemas_1 = require("../output-schemas");
|
|
12
|
+
exports.gmailCreateDraftAction = (0, pieces_framework_1.createAction)({
|
|
13
|
+
auth: auth_1.gmailAuth,
|
|
14
|
+
name: 'gmail_create_draft',
|
|
15
|
+
displayName: 'Create Draft',
|
|
16
|
+
description: 'Create a new draft email (optionally inside an existing thread).',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
aiMetadata: {
|
|
19
|
+
description: 'Creates an unsent draft email with the given recipients, subject, body, and optional attachments, optionally placing it inside an existing thread. Use this when a message should be saved for later review or sending rather than sent immediately; send it afterwards with Send Draft. To attach the draft to a conversation, pass a thread ID from Search Email or Get Thread. Not idempotent: each call creates a separate draft.',
|
|
20
|
+
idempotent: false,
|
|
21
|
+
},
|
|
22
|
+
props: {
|
|
23
|
+
receiver: pieces_framework_1.Property.Array({
|
|
24
|
+
displayName: 'Receiver Email (To)',
|
|
25
|
+
required: false,
|
|
26
|
+
}),
|
|
27
|
+
cc: pieces_framework_1.Property.Array({
|
|
28
|
+
displayName: 'CC Email',
|
|
29
|
+
required: false,
|
|
30
|
+
}),
|
|
31
|
+
bcc: pieces_framework_1.Property.Array({
|
|
32
|
+
displayName: 'BCC Email',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
35
|
+
subject: pieces_framework_1.Property.ShortText({
|
|
36
|
+
displayName: 'Subject',
|
|
37
|
+
required: true,
|
|
38
|
+
}),
|
|
39
|
+
body_type: pieces_framework_1.Property.StaticDropdown({
|
|
40
|
+
displayName: 'Body Type',
|
|
41
|
+
required: true,
|
|
42
|
+
defaultValue: 'plain_text',
|
|
43
|
+
options: {
|
|
44
|
+
disabled: false,
|
|
45
|
+
options: [
|
|
46
|
+
{ label: 'plain text', value: 'plain_text' },
|
|
47
|
+
{ label: 'html', value: 'html' },
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
body: pieces_framework_1.Property.LongText({
|
|
52
|
+
displayName: 'Body',
|
|
53
|
+
description: 'Body for the draft email.',
|
|
54
|
+
required: true,
|
|
55
|
+
}),
|
|
56
|
+
sender_name: pieces_framework_1.Property.ShortText({
|
|
57
|
+
displayName: 'Sender Name',
|
|
58
|
+
required: false,
|
|
59
|
+
}),
|
|
60
|
+
from: pieces_framework_1.Property.ShortText({
|
|
61
|
+
displayName: 'Sender Email',
|
|
62
|
+
description: "The address must be listed in your Gmail account's settings.",
|
|
63
|
+
required: false,
|
|
64
|
+
}),
|
|
65
|
+
thread_id: pieces_framework_1.Property.ShortText({
|
|
66
|
+
displayName: 'Thread ID',
|
|
67
|
+
description: 'Optional thread ID to attach this draft to an existing conversation (obtain from Search Email or Get Thread).',
|
|
68
|
+
required: false,
|
|
69
|
+
}),
|
|
70
|
+
attachments: pieces_framework_1.Property.Array({
|
|
71
|
+
displayName: 'Attachments',
|
|
72
|
+
required: false,
|
|
73
|
+
properties: {
|
|
74
|
+
file: pieces_framework_1.Property.File({
|
|
75
|
+
displayName: 'File',
|
|
76
|
+
description: 'File to attach to the draft.',
|
|
77
|
+
required: true,
|
|
78
|
+
}),
|
|
79
|
+
name: pieces_framework_1.Property.ShortText({
|
|
80
|
+
displayName: 'Attachment Name',
|
|
81
|
+
description: 'Optional name to override the attachment filename.',
|
|
82
|
+
required: false,
|
|
83
|
+
}),
|
|
84
|
+
},
|
|
85
|
+
}),
|
|
86
|
+
},
|
|
87
|
+
outputSchema: output_schemas_1.gmailCreateDraftActionOutputSchema,
|
|
88
|
+
run(context) {
|
|
89
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
var _a, _b, _c;
|
|
91
|
+
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
92
|
+
const gmail = (0, gmail_1.gmail)({ version: 'v1', auth: authClient });
|
|
93
|
+
try {
|
|
94
|
+
const receiver = (_a = context.propsValue.receiver) === null || _a === void 0 ? void 0 : _a.filter((email) => email !== '');
|
|
95
|
+
const cc = (_b = context.propsValue.cc) === null || _b === void 0 ? void 0 : _b.filter((email) => email !== '');
|
|
96
|
+
const bcc = (_c = context.propsValue.bcc) === null || _c === void 0 ? void 0 : _c.filter((email) => email !== '');
|
|
97
|
+
const senderEmail = context.propsValue.from ||
|
|
98
|
+
(yield (0, auth_1.getUserEmail)(context.auth, authClient));
|
|
99
|
+
const from = senderEmail
|
|
100
|
+
? context.propsValue.sender_name
|
|
101
|
+
? `${context.propsValue.sender_name} <${senderEmail}>`
|
|
102
|
+
: senderEmail
|
|
103
|
+
: undefined;
|
|
104
|
+
const raw = yield mime_1.GmailMime.buildRawMessage({
|
|
105
|
+
to: receiver,
|
|
106
|
+
cc,
|
|
107
|
+
bcc,
|
|
108
|
+
from,
|
|
109
|
+
subject: context.propsValue.subject,
|
|
110
|
+
bodyType: context.propsValue.body_type,
|
|
111
|
+
body: context.propsValue.body,
|
|
112
|
+
attachments: context.propsValue.attachments,
|
|
113
|
+
});
|
|
114
|
+
const response = yield gmail.users.drafts.create({
|
|
115
|
+
userId: 'me',
|
|
116
|
+
requestBody: {
|
|
117
|
+
message: {
|
|
118
|
+
raw,
|
|
119
|
+
threadId: context.propsValue.thread_id || undefined,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
return response.data;
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
if (error.code === 403) {
|
|
127
|
+
throw new Error('Insufficient permissions to create a draft. Ensure the gmail.compose scope is granted.');
|
|
128
|
+
}
|
|
129
|
+
else if (error.code === 429) {
|
|
130
|
+
throw new Error('Gmail API rate limit exceeded. Please try again later.');
|
|
131
|
+
}
|
|
132
|
+
throw new Error(`Failed to create draft: ${error.message}`);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
//# sourceMappingURL=create-draft-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-draft-action.js","sourceRoot":"","sources":["../../../src/lib/actions/create-draft-action.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const gmailCreateDraftReplyAction: import("@agnocon/pieces-framework").IAction<(import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>)[], {
|
|
5
|
+
message_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, (import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
6
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
7
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
8
|
+
}>)[]>;
|
|
9
|
+
reply_type: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
10
|
+
body_type: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
11
|
+
body: import("@agnocon/pieces-framework").LongTextProperty<false>;
|
|
12
|
+
include_original_message: import("@agnocon/pieces-framework").CheckboxProperty<true>;
|
|
13
|
+
sender_name: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
14
|
+
attachment: import("@agnocon/pieces-framework").FileProperty<false, false>;
|
|
15
|
+
attachment_name: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=create-draft-reply-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-draft-reply-action.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-draft-reply-action.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;EAgTtC,CAAC"}
|