@dnet5/n8n-nodes-resend 0.1.3

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.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/dist/credentials/ResendApi.credentials.d.ts +10 -0
  4. package/dist/credentials/ResendApi.credentials.js +39 -0
  5. package/dist/credentials/ResendApi.credentials.js.map +1 -0
  6. package/dist/credentials/resend.svg +9 -0
  7. package/dist/nodes/Resend/GenericFunctions.d.ts +3 -0
  8. package/dist/nodes/Resend/GenericFunctions.js +43 -0
  9. package/dist/nodes/Resend/GenericFunctions.js.map +1 -0
  10. package/dist/nodes/Resend/Resend.node.d.ts +5 -0
  11. package/dist/nodes/Resend/Resend.node.js +616 -0
  12. package/dist/nodes/Resend/Resend.node.js.map +1 -0
  13. package/dist/nodes/Resend/Resend.node.json +17 -0
  14. package/dist/nodes/Resend/descriptions/ApiKeyDescription.d.ts +3 -0
  15. package/dist/nodes/Resend/descriptions/ApiKeyDescription.js +135 -0
  16. package/dist/nodes/Resend/descriptions/ApiKeyDescription.js.map +1 -0
  17. package/dist/nodes/Resend/descriptions/BroadcastDescription.d.ts +3 -0
  18. package/dist/nodes/Resend/descriptions/BroadcastDescription.js +337 -0
  19. package/dist/nodes/Resend/descriptions/BroadcastDescription.js.map +1 -0
  20. package/dist/nodes/Resend/descriptions/ContactDescription.d.ts +3 -0
  21. package/dist/nodes/Resend/descriptions/ContactDescription.js +290 -0
  22. package/dist/nodes/Resend/descriptions/ContactDescription.js.map +1 -0
  23. package/dist/nodes/Resend/descriptions/ContactPropertyDescription.d.ts +3 -0
  24. package/dist/nodes/Resend/descriptions/ContactPropertyDescription.js +198 -0
  25. package/dist/nodes/Resend/descriptions/ContactPropertyDescription.js.map +1 -0
  26. package/dist/nodes/Resend/descriptions/DomainDescription.d.ts +3 -0
  27. package/dist/nodes/Resend/descriptions/DomainDescription.js +273 -0
  28. package/dist/nodes/Resend/descriptions/DomainDescription.js.map +1 -0
  29. package/dist/nodes/Resend/descriptions/EmailDescription.d.ts +3 -0
  30. package/dist/nodes/Resend/descriptions/EmailDescription.js +422 -0
  31. package/dist/nodes/Resend/descriptions/EmailDescription.js.map +1 -0
  32. package/dist/nodes/Resend/descriptions/SegmentDescription.d.ts +3 -0
  33. package/dist/nodes/Resend/descriptions/SegmentDescription.js +158 -0
  34. package/dist/nodes/Resend/descriptions/SegmentDescription.js.map +1 -0
  35. package/dist/nodes/Resend/descriptions/TemplateDescription.d.ts +3 -0
  36. package/dist/nodes/Resend/descriptions/TemplateDescription.js +318 -0
  37. package/dist/nodes/Resend/descriptions/TemplateDescription.js.map +1 -0
  38. package/dist/nodes/Resend/descriptions/TopicDescription.d.ts +3 -0
  39. package/dist/nodes/Resend/descriptions/TopicDescription.js +242 -0
  40. package/dist/nodes/Resend/descriptions/TopicDescription.js.map +1 -0
  41. package/dist/nodes/Resend/descriptions/WebhookDescription.d.ts +3 -0
  42. package/dist/nodes/Resend/descriptions/WebhookDescription.js +214 -0
  43. package/dist/nodes/Resend/descriptions/WebhookDescription.js.map +1 -0
  44. package/dist/nodes/Resend/descriptions/index.d.ts +10 -0
  45. package/dist/nodes/Resend/descriptions/index.js +34 -0
  46. package/dist/nodes/Resend/descriptions/index.js.map +1 -0
  47. package/dist/nodes/Resend/resend.svg +9 -0
  48. package/package.json +53 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 dnet5
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.
package/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # @dnet5/n8n-nodes-resend
2
+
3
+ An [n8n](https://n8n.io/) community node for the [Resend](https://resend.com/) email API.
4
+
5
+ Resend is a modern email API for developers. This node provides full coverage of the Resend API with 10 resources and 50+ operations.
6
+
7
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
8
+
9
+ ## Installation
10
+
11
+ ### Community Nodes (Recommended)
12
+
13
+ 1. Go to **Settings > Community Nodes**
14
+ 2. Select **Install**
15
+ 3. Enter `@dnet5/n8n-nodes-resend` and confirm
16
+
17
+ ### Manual Installation
18
+
19
+ ```bash
20
+ npm install @dnet5/n8n-nodes-resend
21
+ ```
22
+
23
+ ## Credentials
24
+
25
+ 1. Create a [Resend account](https://resend.com/signup)
26
+ 2. Go to **API Keys** in the Resend dashboard
27
+ 3. Click **Create API Key**
28
+ 4. In n8n, create a new **Resend API** credential and paste your key
29
+
30
+ ## Resources & Operations
31
+
32
+ | Resource | Operations |
33
+ |----------|-----------|
34
+ | **Email** | Send, Send Batch, Get, Get Many, Update, Cancel |
35
+ | **Domain** | Create, Get, Get Many, Update, Delete, Verify |
36
+ | **API Key** | Create, Get Many, Delete |
37
+ | **Contact** | Create, Get, Get Many, Update, Delete |
38
+ | **Broadcast** | Create, Get, Get Many, Send, Update, Delete |
39
+ | **Segment** | Create, Get, Get Many, Update, Delete |
40
+ | **Topic** | Create, Get, Get Many, Update, Delete |
41
+ | **Template** | Create, Get, Get Many, Update, Delete, Publish, Duplicate |
42
+ | **Webhook** | Create, Get, Get Many, Update, Delete |
43
+ | **Contact Property** | Create, Get, Get Many, Update, Delete |
44
+
45
+ ## Features
46
+
47
+ - **Full API coverage**: 10 resources, 53 operations
48
+ - **Pagination support**: Automatic cursor-based pagination with "Return All" toggle
49
+ - **Batch emails**: Send up to 100 emails in a single request
50
+ - **Idempotency**: Support for Idempotency-Key header on send operations
51
+ - **AI-ready**: `usableAsTool: true` for n8n AI agent workflows
52
+ - **Error handling**: `continueOnFail()` support for resilient workflows
53
+
54
+ ## License
55
+
56
+ [MIT](LICENSE)
@@ -0,0 +1,10 @@
1
+ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class ResendApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ icon: "file:resend.svg";
7
+ properties: INodeProperties[];
8
+ authenticate: IAuthenticateGeneric;
9
+ test: ICredentialTestRequest;
10
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResendApi = void 0;
4
+ class ResendApi {
5
+ constructor() {
6
+ this.name = 'resendApi';
7
+ this.displayName = 'Resend API';
8
+ this.documentationUrl = 'https://resend.com/docs/introduction';
9
+ this.icon = 'file:resend.svg';
10
+ this.properties = [
11
+ {
12
+ displayName: 'API Key',
13
+ name: 'apiKey',
14
+ type: 'string',
15
+ typeOptions: { password: true },
16
+ default: '',
17
+ placeholder: 're_xxxxxxxxx',
18
+ required: true,
19
+ },
20
+ ];
21
+ this.authenticate = {
22
+ type: 'generic',
23
+ properties: {
24
+ headers: {
25
+ Authorization: '=Bearer {{$credentials.apiKey}}',
26
+ },
27
+ },
28
+ };
29
+ this.test = {
30
+ request: {
31
+ baseURL: 'https://api.resend.com',
32
+ url: '/domains',
33
+ method: 'GET',
34
+ },
35
+ };
36
+ }
37
+ }
38
+ exports.ResendApi = ResendApi;
39
+ //# sourceMappingURL=ResendApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResendApi.credentials.js","sourceRoot":"","sources":["../../credentials/ResendApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,SAAS;IAAtB;QACC,SAAI,GAAG,WAAW,CAAC;QACnB,gBAAW,GAAG,YAAY,CAAC;QAC3B,qBAAgB,GAAG,sCAAsC,CAAC;QAC1D,SAAI,GAAG,iBAA0B,CAAC;QAElC,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,cAAc;gBAC3B,QAAQ,EAAE,IAAI;aACd;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,iCAAiC;iBAChD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,wBAAwB;gBACjC,GAAG,EAAE,UAAU;gBACf,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AAlCD,8BAkCC"}
@@ -0,0 +1,9 @@
1
+ <svg viewBox="450 450 900 900" xmlns="http://www.w3.org/2000/svg">
2
+ <style>
3
+ path { fill: #000; }
4
+ @media (prefers-color-scheme: dark) {
5
+ path { fill: #fff; }
6
+ }
7
+ </style>
8
+ <path d="M1000.46 450C1174.77 450 1278.43 553.669 1278.43 691.282C1278.43 828.896 1174.77 932.563 1000.46 932.563H912.382L1350 1350H1040.82L707.794 1033.48C683.944 1011.47 672.936 985.781 672.935 963.765C672.935 932.572 694.959 905.049 737.161 893.122L908.712 847.244C973.85 829.812 1018.81 779.353 1018.81 713.298C1018.8 632.567 952.745 585.78 871.095 585.78H450V450H1000.46Z"/>
9
+ </svg>
@@ -0,0 +1,3 @@
1
+ import type { IDataObject, IExecuteFunctions, IHttpRequestMethods, ILoadOptionsFunctions } from 'n8n-workflow';
2
+ export declare function resendApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject | IDataObject[], qs?: IDataObject, headers?: IDataObject): Promise<any>;
3
+ export declare function resendApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, qs?: IDataObject): Promise<any[]>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resendApiRequest = resendApiRequest;
4
+ exports.resendApiRequestAllItems = resendApiRequestAllItems;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ async function resendApiRequest(method, endpoint, body = {}, qs = {}, headers = {}) {
7
+ const options = {
8
+ method,
9
+ url: `https://api.resend.com${endpoint}`,
10
+ qs,
11
+ headers: {
12
+ 'Content-Type': 'application/json',
13
+ ...headers,
14
+ },
15
+ json: true,
16
+ };
17
+ if (method !== 'GET' && Object.keys(body).length > 0) {
18
+ options.body = body;
19
+ }
20
+ else if (method !== 'GET' && Array.isArray(body) && body.length > 0) {
21
+ options.body = body;
22
+ }
23
+ try {
24
+ return await this.helpers.requestWithAuthentication.call(this, 'resendApi', options);
25
+ }
26
+ catch (error) {
27
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
28
+ }
29
+ }
30
+ async function resendApiRequestAllItems(method, endpoint, body = {}, qs = {}) {
31
+ const returnData = [];
32
+ let responseData;
33
+ do {
34
+ responseData = await resendApiRequest.call(this, method, endpoint, body, qs);
35
+ const items = responseData.data || [];
36
+ returnData.push(...items);
37
+ if (responseData.has_more && items.length > 0) {
38
+ qs.after = items[items.length - 1].id;
39
+ }
40
+ } while (responseData.has_more);
41
+ return returnData;
42
+ }
43
+ //# sourceMappingURL=GenericFunctions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Resend/GenericFunctions.ts"],"names":[],"mappings":";;AAUA,4CA8BC;AAED,4DAsBC;AAxDD,+CAA4C;AAErC,KAAK,UAAU,gBAAgB,CAErC,MAA2B,EAC3B,QAAgB,EAChB,OAAoC,EAAE,EACtC,KAAkB,EAAE,EACpB,UAAuB,EAAE;IAEzB,MAAM,OAAO,GAAwB;QACpC,MAAM;QACN,GAAG,EAAE,yBAAyB,QAAQ,EAAE;QACxC,EAAE;QACF,OAAO,EAAE;YACR,cAAc,EAAE,kBAAkB;YAClC,GAAG,OAAO;SACV;QACD,IAAI,EAAE,IAAI;KACV,CAAC;IAEF,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;SAAM,IAAI,MAAM,KAAK,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,IAAI,CAAC;QACJ,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IACtF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAmB,CAAC,CAAC;IAC7D,CAAC;AACF,CAAC;AAEM,KAAK,UAAU,wBAAwB,CAE7C,MAA2B,EAC3B,QAAgB,EAChB,OAAoB,EAAE,EACtB,KAAkB,EAAE;IAEpB,MAAM,UAAU,GAAU,EAAE,CAAC;IAC7B,IAAI,YAAiB,CAAC;IAEtB,GAAG,CAAC;QACH,YAAY,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAE7E,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,IAAI,EAAE,CAAC;QACtC,UAAU,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QAE1B,IAAI,YAAY,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/C,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,CAAC;IACF,CAAC,QAAQ,YAAY,CAAC,QAAQ,EAAE;IAEhC,OAAO,UAAU,CAAC;AACnB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class Resend implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }