n8n-nodes-resend 1.0.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.md +19 -0
- package/README.md +104 -0
- package/dist/credentials/ExampleCredentialsApi.credentials.d.ts +9 -0
- package/dist/credentials/ExampleCredentialsApi.credentials.js +47 -0
- package/dist/credentials/ExampleCredentialsApi.credentials.js.map +1 -0
- package/dist/credentials/HttpBinApi.credentials.d.ts +9 -0
- package/dist/credentials/HttpBinApi.credentials.js +43 -0
- package/dist/credentials/HttpBinApi.credentials.js.map +1 -0
- package/dist/credentials/ResendApi.credentials.d.ts +8 -0
- package/dist/credentials/ResendApi.credentials.js +30 -0
- package/dist/credentials/ResendApi.credentials.js.map +1 -0
- package/dist/nodes/ExampleNode/ExampleNode.node.d.ts +5 -0
- package/dist/nodes/ExampleNode/ExampleNode.node.js +60 -0
- package/dist/nodes/ExampleNode/ExampleNode.node.js.map +1 -0
- package/dist/nodes/HttpBin/HttpBin.node.d.ts +4 -0
- package/dist/nodes/HttpBin/HttpBin.node.js +56 -0
- package/dist/nodes/HttpBin/HttpBin.node.js.map +1 -0
- package/dist/nodes/HttpBin/HttpBin.node.json +18 -0
- package/dist/nodes/HttpBin/HttpVerbDescription.d.ts +3 -0
- package/dist/nodes/HttpBin/HttpVerbDescription.js +236 -0
- package/dist/nodes/HttpBin/HttpVerbDescription.js.map +1 -0
- package/dist/nodes/Resend/Resend.node.d.ts +5 -0
- package/dist/nodes/Resend/Resend.node.js +261 -0
- package/dist/nodes/Resend/Resend.node.js.map +1 -0
- package/dist/nodes/Resend/Resend.svg +3 -0
- package/dist/nodes/Resend/ResendTrigger.node.d.ts +12 -0
- package/dist/nodes/Resend/ResendTrigger.node.js +98 -0
- package/dist/nodes/Resend/ResendTrigger.node.js.map +1 -0
- package/dist/package.json +61 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/index.js +0 -0
- package/package.json +61 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.httpVerbFields = exports.httpVerbOperations = void 0;
|
|
4
|
+
exports.httpVerbOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: {
|
|
12
|
+
resource: ['httpVerb'],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
name: 'GET',
|
|
18
|
+
value: 'get',
|
|
19
|
+
description: 'Perform a GET request',
|
|
20
|
+
action: 'Perform a GET request',
|
|
21
|
+
routing: {
|
|
22
|
+
request: {
|
|
23
|
+
method: 'GET',
|
|
24
|
+
url: '/get',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'DELETE',
|
|
30
|
+
value: 'delete',
|
|
31
|
+
description: 'Perform a DELETE request',
|
|
32
|
+
action: 'Perform a DELETE request',
|
|
33
|
+
routing: {
|
|
34
|
+
request: {
|
|
35
|
+
method: 'DELETE',
|
|
36
|
+
url: '/delete',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
default: 'get',
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
const getOperation = [
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Type of Data',
|
|
47
|
+
name: 'typeofData',
|
|
48
|
+
default: 'queryParameter',
|
|
49
|
+
description: 'Select type of data to send [Query Parameters]',
|
|
50
|
+
displayOptions: {
|
|
51
|
+
show: {
|
|
52
|
+
resource: ['httpVerb'],
|
|
53
|
+
operation: ['get'],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
type: 'options',
|
|
57
|
+
options: [
|
|
58
|
+
{
|
|
59
|
+
name: 'Query',
|
|
60
|
+
value: 'queryParameter',
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
required: true,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
displayName: 'Query Parameters',
|
|
67
|
+
name: 'arguments',
|
|
68
|
+
default: {},
|
|
69
|
+
description: "The request's query parameters",
|
|
70
|
+
displayOptions: {
|
|
71
|
+
show: {
|
|
72
|
+
resource: ['httpVerb'],
|
|
73
|
+
operation: ['get'],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
options: [
|
|
77
|
+
{
|
|
78
|
+
name: 'keyvalue',
|
|
79
|
+
displayName: 'Key:Value',
|
|
80
|
+
values: [
|
|
81
|
+
{
|
|
82
|
+
displayName: 'Key',
|
|
83
|
+
name: 'key',
|
|
84
|
+
type: 'string',
|
|
85
|
+
default: '',
|
|
86
|
+
required: true,
|
|
87
|
+
description: 'Key of query parameter',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
displayName: 'Value',
|
|
91
|
+
name: 'value',
|
|
92
|
+
type: 'string',
|
|
93
|
+
default: '',
|
|
94
|
+
routing: {
|
|
95
|
+
send: {
|
|
96
|
+
property: '={{$parent.key}}',
|
|
97
|
+
type: 'query',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
required: true,
|
|
101
|
+
description: 'Value of query parameter',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
type: 'fixedCollection',
|
|
107
|
+
typeOptions: {
|
|
108
|
+
multipleValues: true,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
const deleteOperation = [
|
|
113
|
+
{
|
|
114
|
+
displayName: 'Type of Data',
|
|
115
|
+
name: 'typeofData',
|
|
116
|
+
default: 'queryParameter',
|
|
117
|
+
description: 'Select type of data to send [Query Parameter Arguments, JSON-Body]',
|
|
118
|
+
displayOptions: {
|
|
119
|
+
show: {
|
|
120
|
+
resource: ['httpVerb'],
|
|
121
|
+
operation: ['delete'],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
options: [
|
|
125
|
+
{
|
|
126
|
+
name: 'Query',
|
|
127
|
+
value: 'queryParameter',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'JSON',
|
|
131
|
+
value: 'jsonData',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
required: true,
|
|
135
|
+
type: 'options',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
displayName: 'Query Parameters',
|
|
139
|
+
name: 'arguments',
|
|
140
|
+
default: {},
|
|
141
|
+
description: "The request's query parameters",
|
|
142
|
+
displayOptions: {
|
|
143
|
+
show: {
|
|
144
|
+
resource: ['httpVerb'],
|
|
145
|
+
operation: ['delete'],
|
|
146
|
+
typeofData: ['queryParameter'],
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
options: [
|
|
150
|
+
{
|
|
151
|
+
name: 'keyvalue',
|
|
152
|
+
displayName: 'Key:Value',
|
|
153
|
+
values: [
|
|
154
|
+
{
|
|
155
|
+
displayName: 'Key',
|
|
156
|
+
name: 'key',
|
|
157
|
+
type: 'string',
|
|
158
|
+
default: '',
|
|
159
|
+
required: true,
|
|
160
|
+
description: 'Key of query parameter',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
displayName: 'Value',
|
|
164
|
+
name: 'value',
|
|
165
|
+
type: 'string',
|
|
166
|
+
default: '',
|
|
167
|
+
routing: {
|
|
168
|
+
send: {
|
|
169
|
+
property: '={{$parent.key}}',
|
|
170
|
+
type: 'query',
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
required: true,
|
|
174
|
+
description: 'Value of query parameter',
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
type: 'fixedCollection',
|
|
180
|
+
typeOptions: {
|
|
181
|
+
multipleValues: true,
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
displayName: 'JSON Object',
|
|
186
|
+
name: 'arguments',
|
|
187
|
+
default: {},
|
|
188
|
+
description: "The request's JSON properties",
|
|
189
|
+
displayOptions: {
|
|
190
|
+
show: {
|
|
191
|
+
resource: ['httpVerb'],
|
|
192
|
+
operation: ['delete'],
|
|
193
|
+
typeofData: ['jsonData'],
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
options: [
|
|
197
|
+
{
|
|
198
|
+
name: 'keyvalue',
|
|
199
|
+
displayName: 'Key:Value',
|
|
200
|
+
values: [
|
|
201
|
+
{
|
|
202
|
+
displayName: 'Key',
|
|
203
|
+
name: 'key',
|
|
204
|
+
type: 'string',
|
|
205
|
+
default: '',
|
|
206
|
+
required: true,
|
|
207
|
+
description: 'Key of JSON property',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
displayName: 'Value',
|
|
211
|
+
name: 'value',
|
|
212
|
+
type: 'string',
|
|
213
|
+
default: '',
|
|
214
|
+
routing: {
|
|
215
|
+
send: {
|
|
216
|
+
property: '={{$parent.key}}',
|
|
217
|
+
type: 'body',
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
required: true,
|
|
221
|
+
description: 'Value of JSON property',
|
|
222
|
+
},
|
|
223
|
+
],
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
type: 'fixedCollection',
|
|
227
|
+
typeOptions: {
|
|
228
|
+
multipleValues: true,
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
];
|
|
232
|
+
exports.httpVerbFields = [
|
|
233
|
+
...getOperation,
|
|
234
|
+
...deleteOperation,
|
|
235
|
+
];
|
|
236
|
+
//# sourceMappingURL=HttpVerbDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpVerbDescription.js","sourceRoot":"","sources":["../../../nodes/HttpBin/HttpVerbDescription.ts"],"names":[],"mappings":";;;AAGa,QAAA,kBAAkB,GAAsB;IACpD;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BACX,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,sBAAsB;qBACnC;oBACD;wBACC,WAAW,EAAE,OAAO;wBACpB,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE,EAAE;wBACX,OAAO,EAAE;4BACR,IAAI,EAAE;gCACL,QAAQ,EAAE,kBAAkB;gCAC5B,IAAI,EAAE,MAAM;6BACZ;yBACD;wBACD,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,wBAAwB;qBACrC;iBACD;aACD;SACD;QACD,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE;YACZ,cAAc,EAAE,IAAI;SACpB;KACD;CACD,CAAC;AAEW,QAAA,cAAc,GAAsB;IAIhD,GAAG,YAAY;IAKf,GAAG,eAAe;CAClB,CAAC"}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Resend = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
class Resend {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'Resend',
|
|
9
|
+
name: 'resend',
|
|
10
|
+
icon: 'file:Resend.svg',
|
|
11
|
+
group: ['output'],
|
|
12
|
+
version: 1,
|
|
13
|
+
description: 'Sends emails via Resend API',
|
|
14
|
+
defaults: {
|
|
15
|
+
name: 'Resend',
|
|
16
|
+
},
|
|
17
|
+
credentials: [
|
|
18
|
+
{
|
|
19
|
+
name: 'resendApi',
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
inputs: ['main'],
|
|
24
|
+
outputs: ['main'],
|
|
25
|
+
properties: [
|
|
26
|
+
{
|
|
27
|
+
displayName: 'Operation',
|
|
28
|
+
name: 'operation',
|
|
29
|
+
type: 'options',
|
|
30
|
+
noDataExpression: true,
|
|
31
|
+
options: [
|
|
32
|
+
{
|
|
33
|
+
name: 'Send Email',
|
|
34
|
+
value: 'sendEmail',
|
|
35
|
+
action: 'Send an email',
|
|
36
|
+
routing: {
|
|
37
|
+
request: {
|
|
38
|
+
method: 'POST',
|
|
39
|
+
url: 'https://api.resend.com/emails',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
default: 'sendEmail',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
displayName: 'From',
|
|
48
|
+
name: 'fromEmail',
|
|
49
|
+
type: 'string',
|
|
50
|
+
required: true,
|
|
51
|
+
default: '',
|
|
52
|
+
placeholder: 'you@example.com',
|
|
53
|
+
displayOptions: {
|
|
54
|
+
show: {
|
|
55
|
+
operation: ['sendEmail'],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
description: 'Sender email address',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
displayName: 'To',
|
|
62
|
+
name: 'toEmail',
|
|
63
|
+
type: 'string',
|
|
64
|
+
required: true,
|
|
65
|
+
default: '',
|
|
66
|
+
placeholder: 'user@example.com',
|
|
67
|
+
displayOptions: {
|
|
68
|
+
show: {
|
|
69
|
+
operation: ['sendEmail'],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
description: 'Comma-separated list of recipient email addresses',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
displayName: 'Subject',
|
|
76
|
+
name: 'subject',
|
|
77
|
+
type: 'string',
|
|
78
|
+
required: true,
|
|
79
|
+
default: '',
|
|
80
|
+
placeholder: 'Hello from n8n!',
|
|
81
|
+
displayOptions: {
|
|
82
|
+
show: {
|
|
83
|
+
operation: ['sendEmail'],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
displayName: 'HTML',
|
|
89
|
+
name: 'htmlBody',
|
|
90
|
+
type: 'string',
|
|
91
|
+
required: true,
|
|
92
|
+
default: '',
|
|
93
|
+
typeOptions: {
|
|
94
|
+
multiline: true,
|
|
95
|
+
},
|
|
96
|
+
placeholder: '<p>Your HTML content here</p>',
|
|
97
|
+
displayOptions: {
|
|
98
|
+
show: {
|
|
99
|
+
operation: ['sendEmail'],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
displayName: 'Text',
|
|
105
|
+
name: 'textBody',
|
|
106
|
+
type: 'string',
|
|
107
|
+
default: '',
|
|
108
|
+
placeholder: 'Your plain text content here',
|
|
109
|
+
displayOptions: {
|
|
110
|
+
show: {
|
|
111
|
+
operation: ['sendEmail'],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
description: 'Plain text content of the email (optional)',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
displayName: 'CC',
|
|
118
|
+
name: 'ccEmail',
|
|
119
|
+
type: 'string',
|
|
120
|
+
default: '',
|
|
121
|
+
placeholder: 'cc@example.com',
|
|
122
|
+
displayOptions: {
|
|
123
|
+
show: {
|
|
124
|
+
operation: ['sendEmail'],
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
description: 'Comma-separated list of CC email addresses',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
displayName: 'BCC',
|
|
131
|
+
name: 'bccEmail',
|
|
132
|
+
type: 'string',
|
|
133
|
+
default: '',
|
|
134
|
+
placeholder: 'bcc@example.com',
|
|
135
|
+
displayOptions: {
|
|
136
|
+
show: {
|
|
137
|
+
operation: ['sendEmail'],
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
description: 'Comma-separated list of BCC email addresses',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
displayName: 'Reply To',
|
|
144
|
+
name: 'replyToEmail',
|
|
145
|
+
type: 'string',
|
|
146
|
+
default: '',
|
|
147
|
+
placeholder: 'reply@example.com',
|
|
148
|
+
displayOptions: {
|
|
149
|
+
show: {
|
|
150
|
+
operation: ['sendEmail'],
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
description: 'Email address to set as reply-to',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
displayName: 'Tags',
|
|
157
|
+
name: 'tags',
|
|
158
|
+
type: 'fixedCollection',
|
|
159
|
+
default: {},
|
|
160
|
+
placeholder: 'Add Tag',
|
|
161
|
+
displayOptions: {
|
|
162
|
+
show: {
|
|
163
|
+
operation: ['sendEmail'],
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
typeOptions: {
|
|
167
|
+
multipleValues: true,
|
|
168
|
+
properties: [
|
|
169
|
+
{
|
|
170
|
+
name: 'tag',
|
|
171
|
+
displayName: 'Tag',
|
|
172
|
+
values: [
|
|
173
|
+
{
|
|
174
|
+
displayName: 'Name',
|
|
175
|
+
name: 'name',
|
|
176
|
+
type: 'string',
|
|
177
|
+
default: '',
|
|
178
|
+
description: 'Name of the tag',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
displayName: 'Value',
|
|
182
|
+
name: 'value',
|
|
183
|
+
type: 'string',
|
|
184
|
+
default: '',
|
|
185
|
+
description: 'Value of the tag',
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
description: 'Tags to categorize the email',
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
async execute() {
|
|
197
|
+
const items = this.getInputData();
|
|
198
|
+
const returnData = [];
|
|
199
|
+
const length = items.length;
|
|
200
|
+
for (let i = 0; i < length; i++) {
|
|
201
|
+
try {
|
|
202
|
+
const operation = this.getNodeParameter('operation', i);
|
|
203
|
+
const credentials = await this.getCredentials('resendApi');
|
|
204
|
+
const apiKey = credentials.apiKey;
|
|
205
|
+
if (operation === 'sendEmail') {
|
|
206
|
+
const fromEmail = this.getNodeParameter('fromEmail', i);
|
|
207
|
+
const toEmail = this.getNodeParameter('toEmail', i);
|
|
208
|
+
const subject = this.getNodeParameter('subject', i);
|
|
209
|
+
const htmlBody = this.getNodeParameter('htmlBody', i);
|
|
210
|
+
const textBody = this.getNodeParameter('textBody', i, '');
|
|
211
|
+
const ccEmail = this.getNodeParameter('ccEmail', i, '');
|
|
212
|
+
const bccEmail = this.getNodeParameter('bccEmail', i, '');
|
|
213
|
+
const replyToEmail = this.getNodeParameter('replyToEmail', i, '');
|
|
214
|
+
const tagsData = this.getNodeParameter('tags', i, { tag: [] });
|
|
215
|
+
const requestBody = {
|
|
216
|
+
from: fromEmail,
|
|
217
|
+
to: toEmail.split(',').map(email => email.trim()).filter(email => email),
|
|
218
|
+
subject: subject,
|
|
219
|
+
html: htmlBody,
|
|
220
|
+
};
|
|
221
|
+
if (textBody) {
|
|
222
|
+
requestBody.text = textBody;
|
|
223
|
+
}
|
|
224
|
+
if (ccEmail) {
|
|
225
|
+
requestBody.cc = ccEmail.split(',').map(email => email.trim()).filter(email => email);
|
|
226
|
+
}
|
|
227
|
+
if (bccEmail) {
|
|
228
|
+
requestBody.bcc = bccEmail.split(',').map(email => email.trim()).filter(email => email);
|
|
229
|
+
}
|
|
230
|
+
if (replyToEmail) {
|
|
231
|
+
requestBody.reply_to = replyToEmail;
|
|
232
|
+
}
|
|
233
|
+
if (tagsData.tag && tagsData.tag.length > 0) {
|
|
234
|
+
requestBody.tags = tagsData.tag.map(t => ({ name: t.name, value: t.value }));
|
|
235
|
+
}
|
|
236
|
+
const response = await this.helpers.httpRequest({
|
|
237
|
+
url: 'https://api.resend.com/emails',
|
|
238
|
+
method: 'POST',
|
|
239
|
+
headers: {
|
|
240
|
+
Authorization: `Bearer ${apiKey}`,
|
|
241
|
+
'Content-Type': 'application/json',
|
|
242
|
+
},
|
|
243
|
+
body: requestBody,
|
|
244
|
+
json: true,
|
|
245
|
+
});
|
|
246
|
+
returnData.push({ json: response, pairedItem: { item: i } });
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
catch (error) {
|
|
250
|
+
if (this.continueOnFail()) {
|
|
251
|
+
returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return [returnData];
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
exports.Resend = Resend;
|
|
261
|
+
//# sourceMappingURL=Resend.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Resend.node.js","sourceRoot":"","sources":["../../../nodes/Resend/Resend.node.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AAEtB,MAAa,MAAM;IAAnB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,QAAQ;YACrB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE;gBACT,IAAI,EAAE,QAAQ;aAEd;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,WAAW;oBACjB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,MAAM,EAAE,CAAC,MAA4B,CAAC;YACtC,OAAO,EAAE,CAAC,MAA4B,CAAC;YACvC,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,YAAY;4BAClB,KAAK,EAAE,WAAW;4BAClB,MAAM,EAAE,eAAe;4BACvB,OAAO,EAAE;gCACR,OAAO,EAAE;oCACR,MAAM,EAAE,MAAM;oCACd,GAAG,EAAE,+BAA+B;iCACpC;6BACD;yBACD;qBACD;oBACD,OAAO,EAAE,WAAW;iBACpB;gBAED;oBACC,WAAW,EAAE,MAAM;oBACnB,IAAI,E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AO,EAAE,EAAE,KAAK,CAAC,CAAC;YACrD,CAAC;QACF,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AApQD,wBAoQC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="600" height="600" viewBox="0 0 600 600" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M186 447.471V154H318.062C336.788 154 353.697 158.053 368.79 166.158C384.163 174.263 396.181 185.443 404.845 199.698C413.51 213.672 417.842 229.604 417.842 247.491C417.842 265.938 413.51 282.568 404.845 297.381C396.181 311.915 384.302 323.375 369.209 331.759C354.117 340.144 337.067 344.337 318.062 344.337H253.917V447.471H186ZM348.667 447.471L274.041 314.99L346.99 304.509L430 447.471H348.667ZM253.917 289.835H311.773C319.04 289.835 325.329 288.298 330.639 285.223C336.229 281.869 340.421 277.258 343.216 271.388C346.291 265.519 347.828 258.811 347.828 251.265C347.828 243.718 346.151 237.15 342.797 231.56C339.443 225.691 334.552 221.219 328.124 218.144C321.975 215.07 314.428 213.533 305.484 213.533H253.917V289.835Z" fill="black"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IHookFunctions, IWebhookFunctions, IWebhookResponseData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class ResendTrigger implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
|
5
|
+
webhookMethods: {
|
|
6
|
+
default: {
|
|
7
|
+
checkExists(this: IHookFunctions): Promise<boolean>;
|
|
8
|
+
create(this: IHookFunctions): Promise<boolean>;
|
|
9
|
+
delete(this: IHookFunctions): Promise<boolean>;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResendTrigger = void 0;
|
|
4
|
+
class ResendTrigger {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.description = {
|
|
7
|
+
displayName: 'Resend Trigger',
|
|
8
|
+
name: 'resendTrigger',
|
|
9
|
+
icon: 'file:Resend.svg',
|
|
10
|
+
group: ['trigger'],
|
|
11
|
+
version: 1,
|
|
12
|
+
description: 'Handles Resend webhooks for various email events',
|
|
13
|
+
defaults: {
|
|
14
|
+
name: 'Resend Trigger',
|
|
15
|
+
},
|
|
16
|
+
inputs: [],
|
|
17
|
+
outputs: ['main'],
|
|
18
|
+
webhooks: [
|
|
19
|
+
{
|
|
20
|
+
name: 'default',
|
|
21
|
+
httpMethod: 'POST',
|
|
22
|
+
responseMode: 'onReceived',
|
|
23
|
+
path: 'webhook',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
properties: [
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Webhook Signing Secret',
|
|
29
|
+
name: 'webhookSigningSecret',
|
|
30
|
+
type: 'string',
|
|
31
|
+
typeOptions: { password: true },
|
|
32
|
+
required: true,
|
|
33
|
+
default: '',
|
|
34
|
+
description: 'Found in your Resend webhook configuration page (whsec_... value).',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
displayName: 'Events',
|
|
38
|
+
name: 'events',
|
|
39
|
+
type: 'multiOptions',
|
|
40
|
+
required: true,
|
|
41
|
+
default: ['email.sent'], options: [
|
|
42
|
+
{ name: 'Contact Created', value: 'contact.created' },
|
|
43
|
+
{ name: 'Contact Deleted', value: 'contact.deleted' },
|
|
44
|
+
{ name: 'Contact Updated', value: 'contact.updated' },
|
|
45
|
+
{ name: 'Domain Created', value: 'domain.created' },
|
|
46
|
+
{ name: 'Domain Deleted', value: 'domain.deleted' },
|
|
47
|
+
{ name: 'Domain Updated', value: 'domain.updated' },
|
|
48
|
+
{ name: 'Email Bounced', value: 'email.bounced' },
|
|
49
|
+
{ name: 'Email Clicked', value: 'email.clicked' },
|
|
50
|
+
{ name: 'Email Complained', value: 'email.complained' },
|
|
51
|
+
{ name: 'Email Delivered', value: 'email.delivered' },
|
|
52
|
+
{ name: 'Email Delivery Delayed', value: 'email.delivery_delayed' },
|
|
53
|
+
{ name: 'Email Opened', value: 'email.opened' },
|
|
54
|
+
{ name: 'Email Sent', value: 'email.sent' },
|
|
55
|
+
],
|
|
56
|
+
description: 'Select the Resend event types to listen for',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
this.webhookMethods = {
|
|
61
|
+
default: {
|
|
62
|
+
async checkExists() {
|
|
63
|
+
return true;
|
|
64
|
+
},
|
|
65
|
+
async create() {
|
|
66
|
+
return true;
|
|
67
|
+
},
|
|
68
|
+
async delete() {
|
|
69
|
+
return true;
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
async webhook() {
|
|
75
|
+
const bodyData = this.getBodyData();
|
|
76
|
+
const subscribedEvents = this.getNodeParameter('events');
|
|
77
|
+
if (!bodyData || typeof bodyData !== 'object' || !('type' in bodyData)) {
|
|
78
|
+
console.warn('Received webhook data that was not in the expected format.');
|
|
79
|
+
return {
|
|
80
|
+
workflowData: [[]],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const eventType = bodyData.type;
|
|
84
|
+
if (subscribedEvents.includes(eventType)) {
|
|
85
|
+
return {
|
|
86
|
+
workflowData: [this.helpers.returnJsonArray([bodyData])],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
console.log(`Received event type "${eventType}" but not subscribed, ignoring.`);
|
|
91
|
+
return {
|
|
92
|
+
workflowData: [[]],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.ResendTrigger = ResendTrigger;
|
|
98
|
+
//# sourceMappingURL=ResendTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResendT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