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
package/LICENSE.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2022 n8n
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
+
the Software without restriction, including without limitation the rights to
|
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
8
|
+
so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Resend Nodes for n8n
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This package provides n8n nodes to interact with the Resend email platform. It allows you to:
|
|
6
|
+
|
|
7
|
+
* Send emails using the Resend API.
|
|
8
|
+
* Receive and process webhook events from Resend for various email activities.
|
|
9
|
+
|
|
10
|
+
This integration uses the official [Resend API](https://resend.com/docs/api-reference/introduction).
|
|
11
|
+
|
|
12
|
+
## Prerequisites/Setup
|
|
13
|
+
|
|
14
|
+
* You need a Resend account. If you don't have one, you can sign up at [resend.com](https://resend.com/).
|
|
15
|
+
* For detailed information about the Resend API, refer to the official [API Documentation](https://resend.com/docs/api-reference/introduction).
|
|
16
|
+
|
|
17
|
+
## Credentials Setup (`ResendApi`)
|
|
18
|
+
|
|
19
|
+
To use these nodes, you need to configure the "Resend API" credentials in n8n:
|
|
20
|
+
|
|
21
|
+
1. In your n8n workspace, go to **Credentials** and click **Add credential**.
|
|
22
|
+
2. Search for "Resend API" and select it.
|
|
23
|
+
3. Fill in the required field:
|
|
24
|
+
* **API Key**: Your Resend API key.
|
|
25
|
+
4. You can find your API Key in your Resend dashboard under **API Keys** ([https://resend.com/api-keys](https://resend.com/api-keys)). Create a new API key if you haven't already, ensuring it has the necessary permissions (e.g., "Full access" for sending emails).
|
|
26
|
+
5. Save the credential.
|
|
27
|
+
|
|
28
|
+
## Nodes
|
|
29
|
+
|
|
30
|
+
### Resend Action Node
|
|
31
|
+
|
|
32
|
+
* **Name:** `Resend`
|
|
33
|
+
* **Description:** Allows sending emails and performing other Resend actions (currently, only sending email is implemented).
|
|
34
|
+
|
|
35
|
+
#### Operations
|
|
36
|
+
|
|
37
|
+
##### Send Email
|
|
38
|
+
|
|
39
|
+
* **Description:** Sends an email using the Resend API.
|
|
40
|
+
* **Parameters:**
|
|
41
|
+
* `From`: (String, Required) The sender's email address (e.g., `you@yourdomain.com`). Must be a verified domain in Resend.
|
|
42
|
+
* `To`: (String, Required) Comma-separated list of recipient email addresses (e.g., `user1@example.com, user2@example.com`).
|
|
43
|
+
* `Subject`: (String, Required) The subject line of the email.
|
|
44
|
+
* `HTML Body`: (String, Required) The HTML content of the email.
|
|
45
|
+
* `Text Body`: (String, Optional) The plain text content of the email. It's recommended to include this for email clients that don't support HTML.
|
|
46
|
+
* `CC`: (String, Optional) Comma-separated list of CC recipient email addresses.
|
|
47
|
+
* `BCC`: (String, Optional) Comma-separated list of BCC recipient email addresses.
|
|
48
|
+
* `Reply To`: (String, Optional) An email address to set as the reply-to address.
|
|
49
|
+
* `Tags`: (Collection, Optional) A list of tags (name/value pairs) to categorize the email (e.g., `[{ "name": "category", "value": "transactional" }]`).
|
|
50
|
+
|
|
51
|
+
### Resend Trigger Node
|
|
52
|
+
|
|
53
|
+
* **Name:** `Resend Trigger`
|
|
54
|
+
* **Description:** Receives and processes webhook events from Resend for various email activities.
|
|
55
|
+
|
|
56
|
+
#### Setup
|
|
57
|
+
|
|
58
|
+
1. **Add the `Resend Trigger` node** to your n8n workflow.
|
|
59
|
+
2. Open the node's parameters. You will see a **Webhook URL**. Copy this URL.
|
|
60
|
+
3. In your Resend dashboard, navigate to **API** -> **Webhooks** ([https://resend.com/webhooks](https://resend.com/webhooks)).
|
|
61
|
+
4. Click **Add webhook** (or similar button).
|
|
62
|
+
5. Paste the copied n8n Webhook URL into the "Webhook URL" field in Resend.
|
|
63
|
+
6. **Events to send:** Select the specific email events you want Resend to send to your n8n trigger.
|
|
64
|
+
7. After saving the webhook in Resend, it will display a **Webhook Signing Secret**. This is a crucial security token (usually starts with `whsec_`). Copy this secret.
|
|
65
|
+
8. Go back to your n8n `Resend Trigger` node and paste this secret into the **Webhook Signing Secret** parameter.
|
|
66
|
+
9. In the `Resend Trigger` node, select the same **Events** that you configured in the Resend webhook settings. The available event types include:
|
|
67
|
+
* `email.sent`
|
|
68
|
+
* `email.delivered`
|
|
69
|
+
* `email.delivery_delayed`
|
|
70
|
+
* `email.complained` (spam complaint)
|
|
71
|
+
* `email.bounced`
|
|
72
|
+
* `email.opened`
|
|
73
|
+
* `email.clicked`
|
|
74
|
+
* `contact.created`
|
|
75
|
+
* `contact.updated`
|
|
76
|
+
* `contact.deleted`
|
|
77
|
+
* `domain.created`
|
|
78
|
+
* `domain.updated`
|
|
79
|
+
* `domain.deleted`
|
|
80
|
+
|
|
81
|
+
#### Output
|
|
82
|
+
|
|
83
|
+
The trigger node will output the JSON payload sent by Resend for the configured event. This payload contains detailed information about the event, such as the email ID, recipient, timestamp, and event-specific data.
|
|
84
|
+
|
|
85
|
+
## Example Usage
|
|
86
|
+
|
|
87
|
+
* **Resend Action Node:**
|
|
88
|
+
* _Scenario:_ When a new user signs up in your application (e.g., via a webhook from your backend or a database trigger), use the `Resend` node to send them a personalized welcome email.
|
|
89
|
+
* **Resend Trigger Node:**
|
|
90
|
+
* _Scenario:_ When an `email.bounced` event is received, you could have a workflow that:
|
|
91
|
+
1. Parses the bounced email address from the trigger output.
|
|
92
|
+
2. Updates a contact record in your CRM to mark the email as invalid.
|
|
93
|
+
3. Notifies your support team about the bounce.
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
MIT
|
|
98
|
+
|
|
99
|
+
## Contribution & Issues
|
|
100
|
+
|
|
101
|
+
Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to:
|
|
102
|
+
|
|
103
|
+
* Raise an issue on the GitHub repository.
|
|
104
|
+
* Fork the repository and submit a pull request.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class ExampleCredentialsApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExampleCredentialsApi = void 0;
|
|
4
|
+
class ExampleCredentialsApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'exampleCredentialsApi';
|
|
7
|
+
this.displayName = 'Example Credentials API';
|
|
8
|
+
this.documentationUrl = 'https://your-docs-url';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'User Name',
|
|
12
|
+
name: 'username',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: '',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Password',
|
|
18
|
+
name: 'password',
|
|
19
|
+
type: 'string',
|
|
20
|
+
typeOptions: {
|
|
21
|
+
password: true,
|
|
22
|
+
},
|
|
23
|
+
default: '',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
this.authenticate = {
|
|
27
|
+
type: 'generic',
|
|
28
|
+
properties: {
|
|
29
|
+
auth: {
|
|
30
|
+
username: '={{ $credentials.username }}',
|
|
31
|
+
password: '={{ $credentials.password }}',
|
|
32
|
+
},
|
|
33
|
+
qs: {
|
|
34
|
+
n8n: 'rocks',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
this.test = {
|
|
39
|
+
request: {
|
|
40
|
+
baseURL: 'https://example.com/',
|
|
41
|
+
url: '',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.ExampleCredentialsApi = ExampleCredentialsApi;
|
|
47
|
+
//# sourceMappingURL=ExampleCredentialsApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleCredentialsApi.credentials.js","sourceRoot":"","sources":["../../credentials/ExampleCredentialsApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,qBAAqB;IAAlC;QACC,SAAI,GAAG,uBAAuB,CAAC;QAC/B,gBAAW,GAAG,yBAAyB,CAAC;QAExC,qBAAgB,GAAG,uBAAuB,CAAC;QAE3C,eAAU,GAAsB;YAI/B;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;aACX;SACD,CAAC;QAKF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,IAAI,EAAE;oBACL,QAAQ,EAAE,8BAA8B;oBACxC,QAAQ,EAAE,8BAA8B;iBACxC;gBACD,EAAE,EAAE;oBAEH,GAAG,EAAE,OAAO;iBACZ;aACD;SACD,CAAC;QAGF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,sBAAsB;gBAC/B,GAAG,EAAE,EAAE;aACP;SACD,CAAC;IACH,CAAC;CAAA;AAnDD,sDAmDC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class HttpBinApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpBinApi = void 0;
|
|
4
|
+
class HttpBinApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'httpbinApi';
|
|
7
|
+
this.displayName = 'HttpBin API';
|
|
8
|
+
this.documentationUrl = 'https://your-docs-url';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Token',
|
|
12
|
+
name: 'token',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: '',
|
|
15
|
+
typeOptions: {
|
|
16
|
+
password: true,
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Domain',
|
|
21
|
+
name: 'domain',
|
|
22
|
+
type: 'string',
|
|
23
|
+
default: 'https://httpbin.org',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
this.authenticate = {
|
|
27
|
+
type: 'generic',
|
|
28
|
+
properties: {
|
|
29
|
+
headers: {
|
|
30
|
+
Authorization: '={{"Bearer " + $credentials.token}}',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
this.test = {
|
|
35
|
+
request: {
|
|
36
|
+
baseURL: '={{$credentials?.domain}}',
|
|
37
|
+
url: '/bearer',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.HttpBinApi = HttpBinApi;
|
|
43
|
+
//# sourceMappingURL=HttpBinApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpBinApi.credentials.js","sourceRoot":"","sources":["../../credentials/HttpBinApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,UAAU;IAAvB;QACC,SAAI,GAAG,YAAY,CAAC;QACpB,gBAAW,GAAG,aAAa,CAAC;QAC5B,qBAAgB,GAAG,uBAAuB,CAAC;QAC3C,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;aACD;YACD;gBACC,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,qBAAqB;aAC9B;SACD,CAAC;QAMF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,qCAAqC;iBACpD;aACD;SACD,CAAC;QAGF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,2BAA2B;gBACpC,GAAG,EAAE,SAAS;aACd;SACD,CAAC;IACH,CAAC;CAAA;AA1CD,gCA0CC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ICredentialType, INodeProperties, IAuthenticateGeneric } from 'n8n-workflow';
|
|
2
|
+
export declare class ResendApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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/api-reference/introduction';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'API Key',
|
|
12
|
+
name: 'apiKey',
|
|
13
|
+
type: 'string',
|
|
14
|
+
typeOptions: { password: true },
|
|
15
|
+
default: '',
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
this.authenticate = {
|
|
20
|
+
type: 'generic',
|
|
21
|
+
properties: {
|
|
22
|
+
headers: {
|
|
23
|
+
Authorization: '={{"Bearer " + $credentials.apiKey}}',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.ResendApi = ResendApi;
|
|
30
|
+
//# sourceMappingURL=ResendApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResendApi.credentials.js","sourceRoot":"","sources":["../../credentials/ResendApi.credentials.ts"],"names":[],"mappings":";;;AAMA,MAAa,SAAS;IAAtB;QACC,SAAI,GAAG,WAAW,CAAC;QACnB,gBAAW,GAAG,YAAY,CAAC;QAC3B,qBAAgB,GAAG,oDAAoD,CAAC;QACxE,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,QAAQ,EAAE,IAAI;aACd;SACD,CAAC;QACF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,sCAAsC;iBACrD;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAtBD,8BAsBC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class ExampleNode implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExampleNode = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
class ExampleNode {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'Example Node',
|
|
9
|
+
name: 'exampleNode',
|
|
10
|
+
group: ['transform'],
|
|
11
|
+
version: 1,
|
|
12
|
+
description: 'Basic Example Node',
|
|
13
|
+
defaults: {
|
|
14
|
+
name: 'Example Node',
|
|
15
|
+
},
|
|
16
|
+
inputs: [n8n_workflow_1.NodeConnectionType.Main],
|
|
17
|
+
outputs: [n8n_workflow_1.NodeConnectionType.Main],
|
|
18
|
+
usableAsTool: true,
|
|
19
|
+
properties: [
|
|
20
|
+
{
|
|
21
|
+
displayName: 'My String',
|
|
22
|
+
name: 'myString',
|
|
23
|
+
type: 'string',
|
|
24
|
+
default: '',
|
|
25
|
+
placeholder: 'Placeholder value',
|
|
26
|
+
description: 'The description text',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async execute() {
|
|
32
|
+
const items = this.getInputData();
|
|
33
|
+
let item;
|
|
34
|
+
let myString;
|
|
35
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
36
|
+
try {
|
|
37
|
+
myString = this.getNodeParameter('myString', itemIndex, '');
|
|
38
|
+
item = items[itemIndex];
|
|
39
|
+
item.json.myString = myString;
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
if (this.continueOnFail()) {
|
|
43
|
+
items.push({ json: this.getInputData(itemIndex)[0].json, error, pairedItem: itemIndex });
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
if (error.context) {
|
|
47
|
+
error.context.itemIndex = itemIndex;
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, {
|
|
51
|
+
itemIndex,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return [items];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.ExampleNode = ExampleNode;
|
|
60
|
+
//# sourceMappingURL=ExampleNode.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleNode.node.js","sourceRoot":"","sources":["../../../nodes/ExampleNode/ExampleNode.node.ts"],"names":[],"mappings":";;;AAMA,+CAAsE;AAEtE,MAAa,WAAW;IAAxB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE;gBACT,IAAI,EAAE,cAAc;aACpB;YACD,MAAM,EAAE,CAAC,iCAAkB,CAAC,IAAI,CAAC;YACjC,OAAO,EAAE,CAAC,iCAAkB,CAAC,IAAI,CAAC;YAClC,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE;gBAGX;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,mBAAmB;oBAChC,WAAW,EAAE,sBAAsB;iBACnC;aACD;SACD,CAAC;IA2CH,CAAC;IArCA,KAAK,CAAC,OAAO;QACZ,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAElC,IAAI,IAAwB,CAAC;QAC7B,IAAI,QAAgB,CAAC;QAKrB,KAAK,IAAI,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC;YAC/D,IAAI,CAAC;gBACJ,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE,CAAW,CAAC;gBACtE,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;gBAExB,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC/B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAGhB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;gBAC1F,CAAC;qBAAM,CAAC;oBAEP,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;wBAGnB,KAAK,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;wBACpC,MAAM,KAAK,CAAC;oBACb,CAAC;oBACD,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE;wBACnD,SAAS;qBACT,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;QACF,CAAC;QAED,OAAO,CAAC,KAAK,CAAC,CAAC;IAChB,CAAC;CACD;AApED,kCAoEC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpBin = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const HttpVerbDescription_1 = require("./HttpVerbDescription");
|
|
6
|
+
class HttpBin {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'HttpBin',
|
|
10
|
+
name: 'httpBin',
|
|
11
|
+
icon: 'file:httpbin.svg',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
15
|
+
description: 'Interact with HttpBin API',
|
|
16
|
+
defaults: {
|
|
17
|
+
name: 'HttpBin',
|
|
18
|
+
},
|
|
19
|
+
inputs: [n8n_workflow_1.NodeConnectionType.Main],
|
|
20
|
+
outputs: [n8n_workflow_1.NodeConnectionType.Main],
|
|
21
|
+
credentials: [
|
|
22
|
+
{
|
|
23
|
+
name: 'httpbinApi',
|
|
24
|
+
required: false,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
requestDefaults: {
|
|
28
|
+
baseURL: 'https://httpbin.org',
|
|
29
|
+
url: '',
|
|
30
|
+
headers: {
|
|
31
|
+
Accept: 'application/json',
|
|
32
|
+
'Content-Type': 'application/json',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
properties: [
|
|
36
|
+
{
|
|
37
|
+
displayName: 'Resource',
|
|
38
|
+
name: 'resource',
|
|
39
|
+
type: 'options',
|
|
40
|
+
noDataExpression: true,
|
|
41
|
+
options: [
|
|
42
|
+
{
|
|
43
|
+
name: 'HTTP Verb',
|
|
44
|
+
value: 'httpVerb',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
default: 'httpVerb',
|
|
48
|
+
},
|
|
49
|
+
...HttpVerbDescription_1.httpVerbOperations,
|
|
50
|
+
...HttpVerbDescription_1.httpVerbFields,
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.HttpBin = HttpBin;
|
|
56
|
+
//# sourceMappingURL=HttpBin.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpBin.node.js","sourceRoot":"","sources":["../../../nodes/HttpBin/HttpBin.node.ts"],"names":[],"mappings":";;;AAAA,+CAAmF;AACnF,+DAA2E;AAE3E,MAAa,OAAO;IAApB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE;gBACT,IAAI,EAAE,SAAS;aACf;YACD,MAAM,EAAE,CAAC,iCAAkB,CAAC,IAAI,CAAC;YACjC,OAAO,EAAE,CAAC,iCAAkB,CAAC,IAAI,CAAC;YAClC,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE,KAAK;iBACf;aACD;YACD,eAAe,EAAE;gBAChB,OAAO,EAAE,qBAAqB;gBAC9B,GAAG,EAAE,EAAE;gBACP,OAAO,EAAE;oBACR,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBAClC;aACD;YAYD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,WAAW;4BACjB,KAAK,EAAE,UAAU;yBACjB;qBACD;oBACD,OAAO,EAAE,UAAU;iBACnB;gBAED,GAAG,wCAAkB;gBACrB,GAAG,oCAAc;aACjB;SACD,CAAC;IACH,CAAC;CAAA;AA1DD,0BA0DC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-base.httpbin",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Development", "Developer Tools"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "http://httpbin.org/#/Auth/get_bearer"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "http://httpbin.org/"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|