@activepieces/piece-resend 0.0.1 → 0.1.1
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 +11 -8
- package/src/index.d.ts +2 -1
- package/src/index.js +20 -4
- package/src/index.js.map +1 -1
- package/src/lib/actions/send-email.d.ts +11 -1
- package/src/lib/actions/send-email.js +14 -16
- package/src/lib/actions/send-email.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-resend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@sinclair/typebox": "0.26.8",
|
|
6
|
-
"axios": "1.
|
|
6
|
+
"axios": "^1.6.3",
|
|
7
|
+
"dayjs": "1.11.9",
|
|
8
|
+
"is-base64": "1.1.0",
|
|
7
9
|
"lodash": "4.17.21",
|
|
8
|
-
"nanoid": "3.3.
|
|
9
|
-
"
|
|
10
|
-
"@activepieces/
|
|
11
|
-
"@activepieces/pieces-
|
|
12
|
-
"
|
|
10
|
+
"nanoid": "3.3.6",
|
|
11
|
+
"semver": "7.5.4",
|
|
12
|
+
"@activepieces/pieces-common": "0.2.8",
|
|
13
|
+
"@activepieces/pieces-framework": "0.7.14",
|
|
14
|
+
"@activepieces/shared": "0.10.66",
|
|
15
|
+
"tslib": "2.6.1"
|
|
13
16
|
},
|
|
14
17
|
"main": "./src/index.js",
|
|
15
|
-
"
|
|
18
|
+
"type": "commonjs"
|
|
16
19
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const resendAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
2
|
+
export declare const resend: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
package/src/index.js
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resend = void 0;
|
|
3
|
+
exports.resend = exports.resendAuth = void 0;
|
|
4
4
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
5
|
const send_email_1 = require("./lib/actions/send-email");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
exports.resendAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
8
|
+
displayName: 'API Key',
|
|
9
|
+
required: true,
|
|
10
|
+
});
|
|
6
11
|
exports.resend = (0, pieces_framework_1.createPiece)({
|
|
7
|
-
displayName:
|
|
8
|
-
|
|
12
|
+
displayName: 'Resend',
|
|
13
|
+
minimumSupportedRelease: '0.5.0',
|
|
14
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/resend.png',
|
|
9
15
|
authors: [],
|
|
10
|
-
|
|
16
|
+
auth: exports.resendAuth,
|
|
17
|
+
actions: [
|
|
18
|
+
send_email_1.sendEmail,
|
|
19
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
20
|
+
baseUrl: () => 'https://api.resend.com',
|
|
21
|
+
auth: exports.resendAuth,
|
|
22
|
+
authMapping: (auth) => ({
|
|
23
|
+
Authorization: `Bearer ${auth}`,
|
|
24
|
+
}),
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
11
27
|
triggers: [],
|
|
12
28
|
});
|
|
13
29
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/resend/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,yDAAqD;AACrD,+DAAwE;AAE3D,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC7C,WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEU,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,QAAQ;IACrB,uBAAuB,EAAE,OAAO;IAChC,OAAO,EAAE,gDAAgD;IACzD,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,kBAAU;IAChB,OAAO,EAAE;QACP,sBAAS;QACT,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,wBAAwB;YACvC,IAAI,EAAE,kBAAU;YAChB,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBACtB,aAAa,EAAE,UAAU,IAAI,EAAE;aAChC,CAAC;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
export declare const sendEmail: import("@activepieces/pieces-framework").
|
|
1
|
+
export declare const sendEmail: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
to: import("@activepieces/pieces-framework").ArrayProperty<true>;
|
|
3
|
+
from_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
from: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
bcc: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
6
|
+
cc: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
7
|
+
reply_to: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
subject: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
9
|
+
content_type: import("@activepieces/pieces-framework").DropdownProperty<"text" | "html", false> | import("@activepieces/pieces-framework").DropdownProperty<"text" | "html", true>;
|
|
10
|
+
content: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
}>;
|
|
@@ -4,15 +4,13 @@ exports.sendEmail = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const __1 = require("../..");
|
|
7
8
|
exports.sendEmail = (0, pieces_framework_1.createAction)({
|
|
9
|
+
auth: __1.resendAuth,
|
|
8
10
|
name: 'send_email',
|
|
9
|
-
displayName:
|
|
10
|
-
description:
|
|
11
|
+
displayName: 'Send Email',
|
|
12
|
+
description: 'Send a text or HTML email',
|
|
11
13
|
props: {
|
|
12
|
-
authentication: pieces_framework_1.Property.SecretText({
|
|
13
|
-
displayName: "API Key",
|
|
14
|
-
required: true,
|
|
15
|
-
}),
|
|
16
14
|
to: pieces_framework_1.Property.Array({
|
|
17
15
|
displayName: 'To',
|
|
18
16
|
description: 'Emails of the recipients',
|
|
@@ -29,13 +27,13 @@ exports.sendEmail = (0, pieces_framework_1.createAction)({
|
|
|
29
27
|
required: true,
|
|
30
28
|
}),
|
|
31
29
|
bcc: pieces_framework_1.Property.Array({
|
|
32
|
-
displayName:
|
|
33
|
-
description:
|
|
30
|
+
displayName: 'BCC',
|
|
31
|
+
description: 'List of emails in bcc',
|
|
34
32
|
required: false,
|
|
35
33
|
}),
|
|
36
34
|
cc: pieces_framework_1.Property.Array({
|
|
37
|
-
displayName:
|
|
38
|
-
description:
|
|
35
|
+
displayName: 'CC',
|
|
36
|
+
description: 'List of emails in cc',
|
|
39
37
|
required: false,
|
|
40
38
|
}),
|
|
41
39
|
reply_to: pieces_framework_1.Property.ShortText({
|
|
@@ -49,7 +47,7 @@ exports.sendEmail = (0, pieces_framework_1.createAction)({
|
|
|
49
47
|
required: true,
|
|
50
48
|
}),
|
|
51
49
|
content_type: pieces_framework_1.Property.Dropdown({
|
|
52
|
-
displayName:
|
|
50
|
+
displayName: 'Content Type',
|
|
53
51
|
refreshers: [],
|
|
54
52
|
required: true,
|
|
55
53
|
defaultValue: 'html',
|
|
@@ -59,9 +57,9 @@ exports.sendEmail = (0, pieces_framework_1.createAction)({
|
|
|
59
57
|
options: [
|
|
60
58
|
{ label: 'Plain Text', value: 'text' },
|
|
61
59
|
{ label: 'HTML', value: 'html' },
|
|
62
|
-
]
|
|
60
|
+
],
|
|
63
61
|
};
|
|
64
|
-
})
|
|
62
|
+
}),
|
|
65
63
|
}),
|
|
66
64
|
content: pieces_framework_1.Property.ShortText({
|
|
67
65
|
displayName: 'Content',
|
|
@@ -71,7 +69,7 @@ exports.sendEmail = (0, pieces_framework_1.createAction)({
|
|
|
71
69
|
},
|
|
72
70
|
run(context) {
|
|
73
71
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
const { to, from, from_name, reply_to, subject, content_type, content, cc, bcc } = context.propsValue;
|
|
72
|
+
const { to, from, from_name, reply_to, subject, content_type, content, cc, bcc, } = context.propsValue;
|
|
75
73
|
const requestBody = {
|
|
76
74
|
to,
|
|
77
75
|
from: from_name ? `${from_name} <${from}>` : from,
|
|
@@ -92,11 +90,11 @@ exports.sendEmail = (0, pieces_framework_1.createAction)({
|
|
|
92
90
|
body: requestBody,
|
|
93
91
|
authentication: {
|
|
94
92
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
95
|
-
token: context.
|
|
93
|
+
token: context.auth,
|
|
96
94
|
},
|
|
97
95
|
queryParams: {},
|
|
98
96
|
});
|
|
99
97
|
});
|
|
100
|
-
}
|
|
98
|
+
},
|
|
101
99
|
});
|
|
102
100
|
//# sourceMappingURL=send-email.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-email.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"send-email.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/resend/src/lib/actions/send-email.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AACrC,6BAAmC;AAEtB,QAAA,SAAS,GAAG,IAAA,+BAAY,EAAC;IACpC,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,WAA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