n8n-nodes-agentgen 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/README.md +112 -0
- package/dist/credentials/AgentGenApi.credentials.d.ts +18 -0
- package/dist/credentials/AgentGenApi.credentials.d.ts.map +1 -0
- package/dist/credentials/AgentGenApi.credentials.js +47 -0
- package/dist/credentials/AgentGenApi.credentials.js.map +1 -0
- package/dist/nodes/AgentGen/AgentGen.node.d.ts +6 -0
- package/dist/nodes/AgentGen/AgentGen.node.d.ts.map +1 -0
- package/dist/nodes/AgentGen/AgentGen.node.js +404 -0
- package/dist/nodes/AgentGen/AgentGen.node.js.map +1 -0
- package/dist/nodes/AgentGen/agentgen.svg +13 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# n8n-nodes-agentgen
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/n8n-nodes-agentgen)
|
|
4
|
+
|
|
5
|
+
This is an [n8n](https://n8n.io) community node for **[AgentGen](https://www.agent-gen.com)** — an HTML → PDF and HTML → Image generation service built for AI agents and developers.
|
|
6
|
+
|
|
7
|
+
Send an HTML string, get back a publicly accessible URL pointing to a rendered PDF or image.
|
|
8
|
+
|
|
9
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
Follow the [n8n community node installation guide](https://docs.n8n.io/integrations/community-nodes/installation/). Search for `n8n-nodes-agentgen`.
|
|
16
|
+
|
|
17
|
+
**Manual install:**
|
|
18
|
+
```bash
|
|
19
|
+
# In your n8n root directory
|
|
20
|
+
npm install n8n-nodes-agentgen
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Operations
|
|
26
|
+
|
|
27
|
+
| Operation | Description | Token cost |
|
|
28
|
+
|-----------|-------------|------------|
|
|
29
|
+
| **Generate Image** | Render HTML → PNG / JPEG / WebP screenshot | 1 token |
|
|
30
|
+
| **Generate PDF** | Render HTML → PDF (single or multi-page) | 2 tokens / page |
|
|
31
|
+
| **Upload Temp File** | Upload an asset for use inside HTML templates | Free |
|
|
32
|
+
| **Get Balance** | Check current token balance | Free |
|
|
33
|
+
|
|
34
|
+
### Generate Image
|
|
35
|
+
|
|
36
|
+
Renders an HTML string to an image file.
|
|
37
|
+
|
|
38
|
+
| Parameter | Required | Default | Description |
|
|
39
|
+
|-----------|----------|---------|-------------|
|
|
40
|
+
| HTML | ✅ | — | HTML content to render (max 500 KB) |
|
|
41
|
+
| Width | — | 1200 | Viewport width in px (1–5000) |
|
|
42
|
+
| Height | — | 630 | Viewport height in px (1–5000) |
|
|
43
|
+
| Format | — | `png` | Output format: `png`, `jpeg`, or `webp` |
|
|
44
|
+
| Device Scale Factor | — | 2 | Pixel ratio (1–3). `2` = retina-quality |
|
|
45
|
+
|
|
46
|
+
**Output:** `{ url, width, height, format, tokens_used, request_id }`
|
|
47
|
+
|
|
48
|
+
### Generate PDF — Single Page
|
|
49
|
+
|
|
50
|
+
| Parameter | Required | Default | Description |
|
|
51
|
+
|-----------|----------|---------|-------------|
|
|
52
|
+
| HTML | ✅ | — | HTML content (max 500 KB) |
|
|
53
|
+
| Format | — | `A4` | Paper size: `A4`, `A3`, `Letter`, `Legal` |
|
|
54
|
+
| Landscape | — | false | Landscape orientation |
|
|
55
|
+
| Margin Top/Bottom/Left/Right | — | — | CSS lengths e.g. `20mm`, `1in` |
|
|
56
|
+
| Print Background | — | true | Render CSS backgrounds |
|
|
57
|
+
|
|
58
|
+
### Generate PDF — Multi-Page
|
|
59
|
+
|
|
60
|
+
Accepts a JSON array of page objects. Each page can have its own layout:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
[
|
|
64
|
+
{ "html": "<h1>Cover</h1>", "format": "A4" },
|
|
65
|
+
{ "html": "<p>Content</p>", "format": "A4", "landscape": true }
|
|
66
|
+
]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Output:** `{ url, pages, tokens_used, request_id }`
|
|
70
|
+
|
|
71
|
+
### Upload Temp File
|
|
72
|
+
|
|
73
|
+
Uploads a binary file from the workflow for use inside HTML `<img src="...">` or CSS references. Files are publicly accessible for **24 hours**, then auto-deleted.
|
|
74
|
+
|
|
75
|
+
Connect any node that produces binary data (e.g. **HTTP Request**, **Read Binary File**) before this node, then set the **Input Binary Field** to the binary property name.
|
|
76
|
+
|
|
77
|
+
**Output:** `{ url, key, size, expires_in, expires_at }`
|
|
78
|
+
|
|
79
|
+
### Get Balance
|
|
80
|
+
|
|
81
|
+
Returns the token balance for your API key.
|
|
82
|
+
|
|
83
|
+
**Output:** `{ tokens: number }`
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Credentials
|
|
88
|
+
|
|
89
|
+
Add an **AgentGen API** credential and paste your API key. Get one at [agent-gen.com](https://www.agent-gen.com).
|
|
90
|
+
|
|
91
|
+
n8n will automatically test the credential against the `/v1/balance` endpoint when you click **Test credential**.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Compatibility
|
|
96
|
+
|
|
97
|
+
- **n8n** ≥ 1.0.0
|
|
98
|
+
- Tested against n8n-workflow 2.x
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Resources
|
|
103
|
+
|
|
104
|
+
- [AgentGen documentation](https://www.agent-gen.com)
|
|
105
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
|
|
106
|
+
- [Source code](https://github.com/Agent-Gen-com/agent-gen-lib/tree/main/n8n)
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
[MIT](https://github.com/Agent-Gen-com/agent-gen-lib/blob/main/LICENSE)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class AgentGenApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
/**
|
|
8
|
+
* Inject the API key as an X-API-Key header on every request
|
|
9
|
+
* that uses this credential type.
|
|
10
|
+
*/
|
|
11
|
+
authenticate: IAuthenticateGeneric;
|
|
12
|
+
/**
|
|
13
|
+
* Validate the credential by hitting the balance endpoint.
|
|
14
|
+
* n8n will call this when the user clicks "Test credential".
|
|
15
|
+
*/
|
|
16
|
+
test: ICredentialTestRequest;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=AgentGenApi.credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentGenApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/AgentGenApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB,qBAAa,WAAY,YAAW,eAAe;IAClD,IAAI,SAAiB;IACrB,WAAW,SAAkB;IAC7B,gBAAgB,SAA+B;IAE/C,UAAU,EAAE,eAAe,EAAE,CAW3B;IAEF;;;OAGG;IACH,YAAY,EAAE,oBAAoB,CAOhC;IAEF;;;OAGG;IACH,IAAI,EAAE,sBAAsB,CAM1B;CACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentGenApi = void 0;
|
|
4
|
+
class AgentGenApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'agentGenApi';
|
|
7
|
+
this.displayName = 'AgentGen API';
|
|
8
|
+
this.documentationUrl = 'https://www.agent-gen.com';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'API Key',
|
|
12
|
+
name: 'apiKey',
|
|
13
|
+
type: 'string',
|
|
14
|
+
typeOptions: { password: true },
|
|
15
|
+
default: '',
|
|
16
|
+
required: true,
|
|
17
|
+
placeholder: 'ag_...',
|
|
18
|
+
description: 'Your AgentGen API key. Get one at agent-gen.com.',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Inject the API key as an X-API-Key header on every request
|
|
23
|
+
* that uses this credential type.
|
|
24
|
+
*/
|
|
25
|
+
this.authenticate = {
|
|
26
|
+
type: 'generic',
|
|
27
|
+
properties: {
|
|
28
|
+
headers: {
|
|
29
|
+
'X-API-Key': '={{$credentials.apiKey}}',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Validate the credential by hitting the balance endpoint.
|
|
35
|
+
* n8n will call this when the user clicks "Test credential".
|
|
36
|
+
*/
|
|
37
|
+
this.test = {
|
|
38
|
+
request: {
|
|
39
|
+
baseURL: 'https://www.agent-gen.com/api',
|
|
40
|
+
url: '/v1/balance',
|
|
41
|
+
method: 'GET',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.AgentGenApi = AgentGenApi;
|
|
47
|
+
//# sourceMappingURL=AgentGenApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentGenApi.credentials.js","sourceRoot":"","sources":["../../credentials/AgentGenApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,WAAW;IAAxB;QACC,SAAI,GAAG,aAAa,CAAC;QACrB,gBAAW,GAAG,cAAc,CAAC;QAC7B,qBAAgB,GAAG,2BAA2B,CAAC;QAE/C,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;gBACd,WAAW,EAAE,QAAQ;gBACrB,WAAW,EAAE,kDAAkD;aAC/D;SACD,CAAC;QAEF;;;WAGG;QACH,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,WAAW,EAAE,0BAA0B;iBACvC;aACD;SACD,CAAC;QAEF;;;WAGG;QACH,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,+BAA+B;gBACxC,GAAG,EAAE,aAAa;gBAClB,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AA1CD,kCA0CC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class AgentGen implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=AgentGen.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentGen.node.d.ts","sourceRoot":"","sources":["../../../nodes/AgentGen/AgentGen.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,iBAAiB,EAGjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,MAAM,cAAc,CAAC;AAKtB,qBAAa,QAAS,YAAW,SAAS;IACzC,WAAW,EAAE,oBAAoB,CAyQ/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAyKvE"}
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentGen = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const BASE_URL = 'https://www.agent-gen.com/api';
|
|
6
|
+
class AgentGen {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'AgentGen',
|
|
10
|
+
name: 'agentGen',
|
|
11
|
+
icon: 'file:agentgen.svg',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
15
|
+
description: 'Generate PDFs and images from HTML using the AgentGen API',
|
|
16
|
+
defaults: {
|
|
17
|
+
name: 'AgentGen',
|
|
18
|
+
},
|
|
19
|
+
inputs: ['main'],
|
|
20
|
+
outputs: ['main'],
|
|
21
|
+
credentials: [
|
|
22
|
+
{
|
|
23
|
+
name: 'agentGenApi',
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
properties: [
|
|
28
|
+
// ─── Operation selector ─────────────────────────────────────────────────
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Operation',
|
|
31
|
+
name: 'operation',
|
|
32
|
+
type: 'options',
|
|
33
|
+
noDataExpression: true,
|
|
34
|
+
options: [
|
|
35
|
+
{
|
|
36
|
+
name: 'Generate Image',
|
|
37
|
+
value: 'generateImage',
|
|
38
|
+
description: 'Render HTML to an image (PNG / JPEG / WebP). Costs 1 token.',
|
|
39
|
+
action: 'Generate image from HTML',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'Generate PDF',
|
|
43
|
+
value: 'generatePdf',
|
|
44
|
+
description: 'Render HTML to a PDF (single or multi-page). Costs 2 tokens per page.',
|
|
45
|
+
action: 'Generate PDF from HTML',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'Get Balance',
|
|
49
|
+
value: 'getBalance',
|
|
50
|
+
description: 'Get the current token balance for your API key',
|
|
51
|
+
action: 'Get token balance',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'Upload Temp File',
|
|
55
|
+
value: 'uploadTempFile',
|
|
56
|
+
description: 'Upload a file for use inside HTML templates. Free — auto-deleted after 24 hours.',
|
|
57
|
+
action: 'Upload a temporary file',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
default: 'generateImage',
|
|
61
|
+
},
|
|
62
|
+
// ─── Generate Image ──────────────────────────────────────────────────────
|
|
63
|
+
{
|
|
64
|
+
displayName: 'HTML',
|
|
65
|
+
name: 'html',
|
|
66
|
+
type: 'string',
|
|
67
|
+
typeOptions: { rows: 8 },
|
|
68
|
+
displayOptions: {
|
|
69
|
+
show: { operation: ['generateImage'] },
|
|
70
|
+
},
|
|
71
|
+
default: '<h1 style="font-family:sans-serif;text-align:center">Hello, AgentGen!</h1>',
|
|
72
|
+
required: true,
|
|
73
|
+
description: 'HTML content to render (max 500 KB)',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
displayName: 'Image Options',
|
|
77
|
+
name: 'imageOptions',
|
|
78
|
+
type: 'collection',
|
|
79
|
+
placeholder: 'Add Option',
|
|
80
|
+
displayOptions: {
|
|
81
|
+
show: { operation: ['generateImage'] },
|
|
82
|
+
},
|
|
83
|
+
default: {},
|
|
84
|
+
options: [
|
|
85
|
+
{
|
|
86
|
+
displayName: 'Device Scale Factor',
|
|
87
|
+
name: 'device_scale_factor',
|
|
88
|
+
type: 'number',
|
|
89
|
+
typeOptions: { minValue: 1, maxValue: 3, numberPrecision: 1 },
|
|
90
|
+
default: 2,
|
|
91
|
+
description: 'Device pixel ratio (1–3). Higher produces sharper images.',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
displayName: 'Format',
|
|
95
|
+
name: 'format',
|
|
96
|
+
type: 'options',
|
|
97
|
+
options: [
|
|
98
|
+
{ name: 'PNG', value: 'png' },
|
|
99
|
+
{ name: 'JPEG', value: 'jpeg' },
|
|
100
|
+
{ name: 'WebP', value: 'webp' },
|
|
101
|
+
],
|
|
102
|
+
default: 'png',
|
|
103
|
+
description: 'Output image format',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
displayName: 'Height',
|
|
107
|
+
name: 'height',
|
|
108
|
+
type: 'number',
|
|
109
|
+
typeOptions: { minValue: 1, maxValue: 5000 },
|
|
110
|
+
default: 630,
|
|
111
|
+
description: 'Viewport height in pixels (1–5000)',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
displayName: 'Width',
|
|
115
|
+
name: 'width',
|
|
116
|
+
type: 'number',
|
|
117
|
+
typeOptions: { minValue: 1, maxValue: 5000 },
|
|
118
|
+
default: 1200,
|
|
119
|
+
description: 'Viewport width in pixels (1–5000)',
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
// ─── Generate PDF ────────────────────────────────────────────────────────
|
|
124
|
+
{
|
|
125
|
+
displayName: 'PDF Mode',
|
|
126
|
+
name: 'pdfMode',
|
|
127
|
+
type: 'options',
|
|
128
|
+
noDataExpression: true,
|
|
129
|
+
displayOptions: {
|
|
130
|
+
show: { operation: ['generatePdf'] },
|
|
131
|
+
},
|
|
132
|
+
options: [
|
|
133
|
+
{
|
|
134
|
+
name: 'Single Page',
|
|
135
|
+
value: 'singlePage',
|
|
136
|
+
description: 'One HTML input → one-page PDF',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'Multi-Page',
|
|
140
|
+
value: 'multiPage',
|
|
141
|
+
description: 'JSON array of page objects → multi-page PDF',
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
default: 'singlePage',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
displayName: 'HTML',
|
|
148
|
+
name: 'pdfHtml',
|
|
149
|
+
type: 'string',
|
|
150
|
+
typeOptions: { rows: 8 },
|
|
151
|
+
displayOptions: {
|
|
152
|
+
show: { operation: ['generatePdf'], pdfMode: ['singlePage'] },
|
|
153
|
+
},
|
|
154
|
+
default: '<h1 style="font-family:sans-serif">Hello, AgentGen!</h1>',
|
|
155
|
+
required: true,
|
|
156
|
+
description: 'HTML content to render (max 500 KB)',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
displayName: 'PDF Options',
|
|
160
|
+
name: 'pdfOptions',
|
|
161
|
+
type: 'collection',
|
|
162
|
+
placeholder: 'Add Option',
|
|
163
|
+
displayOptions: {
|
|
164
|
+
show: { operation: ['generatePdf'], pdfMode: ['singlePage'] },
|
|
165
|
+
},
|
|
166
|
+
default: {},
|
|
167
|
+
options: [
|
|
168
|
+
{
|
|
169
|
+
displayName: 'Format',
|
|
170
|
+
name: 'format',
|
|
171
|
+
type: 'options',
|
|
172
|
+
options: [
|
|
173
|
+
{ name: 'A4', value: 'A4' },
|
|
174
|
+
{ name: 'A3', value: 'A3' },
|
|
175
|
+
{ name: 'Legal', value: 'Legal' },
|
|
176
|
+
{ name: 'Letter', value: 'Letter' },
|
|
177
|
+
],
|
|
178
|
+
default: 'A4',
|
|
179
|
+
description: 'Paper size',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
displayName: 'Landscape',
|
|
183
|
+
name: 'landscape',
|
|
184
|
+
type: 'boolean',
|
|
185
|
+
default: false,
|
|
186
|
+
description: 'Whether to render in landscape orientation',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
displayName: 'Margin Bottom',
|
|
190
|
+
name: 'margin_bottom',
|
|
191
|
+
type: 'string',
|
|
192
|
+
default: '',
|
|
193
|
+
placeholder: '20mm',
|
|
194
|
+
description: 'Bottom page margin as a CSS length (e.g. "20mm", "1in")',
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
displayName: 'Margin Left',
|
|
198
|
+
name: 'margin_left',
|
|
199
|
+
type: 'string',
|
|
200
|
+
default: '',
|
|
201
|
+
placeholder: '20mm',
|
|
202
|
+
description: 'Left page margin as a CSS length (e.g. "20mm", "1in")',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
displayName: 'Margin Right',
|
|
206
|
+
name: 'margin_right',
|
|
207
|
+
type: 'string',
|
|
208
|
+
default: '',
|
|
209
|
+
placeholder: '20mm',
|
|
210
|
+
description: 'Right page margin as a CSS length (e.g. "20mm", "1in")',
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
displayName: 'Margin Top',
|
|
214
|
+
name: 'margin_top',
|
|
215
|
+
type: 'string',
|
|
216
|
+
default: '',
|
|
217
|
+
placeholder: '20mm',
|
|
218
|
+
description: 'Top page margin as a CSS length (e.g. "20mm", "1in")',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
displayName: 'Print Background',
|
|
222
|
+
name: 'print_background',
|
|
223
|
+
type: 'boolean',
|
|
224
|
+
default: true,
|
|
225
|
+
description: 'Whether to render CSS backgrounds',
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
displayName: 'Pages (JSON)',
|
|
231
|
+
name: 'pdfPages',
|
|
232
|
+
type: 'json',
|
|
233
|
+
displayOptions: {
|
|
234
|
+
show: { operation: ['generatePdf'], pdfMode: ['multiPage'] },
|
|
235
|
+
},
|
|
236
|
+
default: '[\n { "html": "<h1>Page 1</h1>", "format": "A4" },\n { "html": "<h1>Page 2</h1>", "format": "A4" }\n]',
|
|
237
|
+
required: true,
|
|
238
|
+
description: 'JSON array of page objects. Each object accepts: html (required), format, width, height, landscape, print_background, margin ({ top, bottom, left, right }).',
|
|
239
|
+
},
|
|
240
|
+
// ─── Upload Temp File ────────────────────────────────────────────────────
|
|
241
|
+
{
|
|
242
|
+
displayName: 'Input Binary Field',
|
|
243
|
+
name: 'binaryPropertyName',
|
|
244
|
+
type: 'string',
|
|
245
|
+
displayOptions: {
|
|
246
|
+
show: { operation: ['uploadTempFile'] },
|
|
247
|
+
},
|
|
248
|
+
default: 'data',
|
|
249
|
+
required: true,
|
|
250
|
+
description: 'Name of the binary property on the incoming item that contains the file to upload',
|
|
251
|
+
hint: 'This is the binary field name from a previous node (e.g. "data" from an HTTP Request or Read Binary File node)',
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
displayName: 'Filename',
|
|
255
|
+
name: 'filename',
|
|
256
|
+
type: 'string',
|
|
257
|
+
displayOptions: {
|
|
258
|
+
show: { operation: ['uploadTempFile'] },
|
|
259
|
+
},
|
|
260
|
+
default: '',
|
|
261
|
+
placeholder: 'image.png',
|
|
262
|
+
description: 'Override the filename sent to the API. Defaults to the filename from the binary data.',
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
async execute() {
|
|
268
|
+
const items = this.getInputData();
|
|
269
|
+
const returnData = [];
|
|
270
|
+
for (let i = 0; i < items.length; i++) {
|
|
271
|
+
const operation = this.getNodeParameter('operation', i);
|
|
272
|
+
try {
|
|
273
|
+
let responseData;
|
|
274
|
+
// ── Generate Image ────────────────────────────────────────────────────
|
|
275
|
+
if (operation === 'generateImage') {
|
|
276
|
+
const html = this.getNodeParameter('html', i);
|
|
277
|
+
const imageOptions = this.getNodeParameter('imageOptions', i);
|
|
278
|
+
const body = { html };
|
|
279
|
+
if (imageOptions.width !== undefined)
|
|
280
|
+
body.width = imageOptions.width;
|
|
281
|
+
if (imageOptions.height !== undefined)
|
|
282
|
+
body.height = imageOptions.height;
|
|
283
|
+
if (imageOptions.format)
|
|
284
|
+
body.format = imageOptions.format;
|
|
285
|
+
if (imageOptions.device_scale_factor !== undefined)
|
|
286
|
+
body.device_scale_factor = imageOptions.device_scale_factor;
|
|
287
|
+
const options = {
|
|
288
|
+
method: 'POST',
|
|
289
|
+
url: `${BASE_URL}/v1/generate/image`,
|
|
290
|
+
body,
|
|
291
|
+
json: true,
|
|
292
|
+
};
|
|
293
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'agentGenApi', options));
|
|
294
|
+
}
|
|
295
|
+
// ── Generate PDF ──────────────────────────────────────────────────────
|
|
296
|
+
else if (operation === 'generatePdf') {
|
|
297
|
+
const pdfMode = this.getNodeParameter('pdfMode', i);
|
|
298
|
+
let body;
|
|
299
|
+
if (pdfMode === 'singlePage') {
|
|
300
|
+
const html = this.getNodeParameter('pdfHtml', i);
|
|
301
|
+
const pdfOptions = this.getNodeParameter('pdfOptions', i);
|
|
302
|
+
body = { html };
|
|
303
|
+
if (pdfOptions.format)
|
|
304
|
+
body.format = pdfOptions.format;
|
|
305
|
+
if (pdfOptions.landscape !== undefined)
|
|
306
|
+
body.landscape = pdfOptions.landscape;
|
|
307
|
+
if (pdfOptions.print_background !== undefined)
|
|
308
|
+
body.print_background = pdfOptions.print_background;
|
|
309
|
+
// Build margin object only if at least one margin is set
|
|
310
|
+
const margin = {};
|
|
311
|
+
if (pdfOptions.margin_top)
|
|
312
|
+
margin.top = pdfOptions.margin_top;
|
|
313
|
+
if (pdfOptions.margin_bottom)
|
|
314
|
+
margin.bottom = pdfOptions.margin_bottom;
|
|
315
|
+
if (pdfOptions.margin_left)
|
|
316
|
+
margin.left = pdfOptions.margin_left;
|
|
317
|
+
if (pdfOptions.margin_right)
|
|
318
|
+
margin.right = pdfOptions.margin_right;
|
|
319
|
+
if (Object.keys(margin).length > 0)
|
|
320
|
+
body.margin = margin;
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
// Multi-page
|
|
324
|
+
const pagesJson = this.getNodeParameter('pdfPages', i);
|
|
325
|
+
let pages;
|
|
326
|
+
try {
|
|
327
|
+
pages = (typeof pagesJson === 'string'
|
|
328
|
+
? JSON.parse(pagesJson)
|
|
329
|
+
: pagesJson);
|
|
330
|
+
}
|
|
331
|
+
catch {
|
|
332
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Pages must be a valid JSON array. Each element must have at least an "html" property.', { itemIndex: i });
|
|
333
|
+
}
|
|
334
|
+
if (!Array.isArray(pages) || pages.length === 0) {
|
|
335
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Pages must be a non-empty JSON array.', { itemIndex: i });
|
|
336
|
+
}
|
|
337
|
+
body = { pages };
|
|
338
|
+
}
|
|
339
|
+
const options = {
|
|
340
|
+
method: 'POST',
|
|
341
|
+
url: `${BASE_URL}/v1/generate/pdf`,
|
|
342
|
+
body,
|
|
343
|
+
json: true,
|
|
344
|
+
};
|
|
345
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'agentGenApi', options));
|
|
346
|
+
}
|
|
347
|
+
// ── Upload Temp File ──────────────────────────────────────────────────
|
|
348
|
+
else if (operation === 'uploadTempFile') {
|
|
349
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
350
|
+
const filenameOverride = this.getNodeParameter('filename', i);
|
|
351
|
+
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
|
352
|
+
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
353
|
+
const filename = filenameOverride || binaryData.fileName || 'upload';
|
|
354
|
+
const options = {
|
|
355
|
+
method: 'POST',
|
|
356
|
+
url: `${BASE_URL}/v1/upload/temp`,
|
|
357
|
+
body: {
|
|
358
|
+
file: {
|
|
359
|
+
value: binaryDataBuffer,
|
|
360
|
+
options: {
|
|
361
|
+
filename,
|
|
362
|
+
contentType: binaryData.mimeType,
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
json: true,
|
|
367
|
+
};
|
|
368
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'agentGenApi', options));
|
|
369
|
+
}
|
|
370
|
+
// ── Get Balance ───────────────────────────────────────────────────────
|
|
371
|
+
else if (operation === 'getBalance') {
|
|
372
|
+
const options = {
|
|
373
|
+
method: 'GET',
|
|
374
|
+
url: `${BASE_URL}/v1/balance`,
|
|
375
|
+
json: true,
|
|
376
|
+
};
|
|
377
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'agentGenApi', options));
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`, {
|
|
381
|
+
itemIndex: i,
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
returnData.push({
|
|
385
|
+
json: responseData,
|
|
386
|
+
pairedItem: { item: i },
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
catch (error) {
|
|
390
|
+
if (this.continueOnFail()) {
|
|
391
|
+
returnData.push({
|
|
392
|
+
json: { error: error.message },
|
|
393
|
+
pairedItem: { item: i },
|
|
394
|
+
});
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
397
|
+
throw error;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
return [returnData];
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
exports.AgentGen = AgentGen;
|
|
404
|
+
//# sourceMappingURL=AgentGen.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentGen.node.js","sourceRoot":"","sources":["../../../nodes/AgentGen/AgentGen.node.ts"],"names":[],"mappings":";;;AASA,+CAAkD;AAElD,MAAM,QAAQ,GAAG,+BAA+B,CAAC;AAEjD,MAAa,QAAQ;IAArB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,2DAA2D;YACxE,QAAQ,EAAE;gBACT,IAAI,EAAE,UAAU;aAChB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,aAAa;oBACnB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,UAAU,EAAE;gBACX,2EAA2E;gBAC3E;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EA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|
|
2
|
+
<rect width="60" height="60" rx="10" fill="#6C47FF"/>
|
|
3
|
+
<!-- Document shape -->
|
|
4
|
+
<rect x="14" y="10" width="24" height="30" rx="2" fill="white" opacity="0.15"/>
|
|
5
|
+
<rect x="16" y="12" width="20" height="26" rx="1.5" fill="white" opacity="0.25"/>
|
|
6
|
+
<!-- Lines representing content -->
|
|
7
|
+
<rect x="19" y="17" width="14" height="2" rx="1" fill="white" opacity="0.9"/>
|
|
8
|
+
<rect x="19" y="22" width="11" height="2" rx="1" fill="white" opacity="0.9"/>
|
|
9
|
+
<rect x="19" y="27" width="13" height="2" rx="1" fill="white" opacity="0.9"/>
|
|
10
|
+
<!-- "AG" badge -->
|
|
11
|
+
<circle cx="40" cy="42" r="12" fill="#FF6B6B"/>
|
|
12
|
+
<text x="40" y="47" font-family="Arial,sans-serif" font-size="11" font-weight="bold" text-anchor="middle" fill="white">AG</text>
|
|
13
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-agentgen",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n community node for AgentGen — HTML to PDF and Image generation",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package",
|
|
7
|
+
"agentgen",
|
|
8
|
+
"html-to-pdf",
|
|
9
|
+
"html-to-image",
|
|
10
|
+
"pdf",
|
|
11
|
+
"screenshot"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"homepage": "https://github.com/Agent-Gen-com/agent-gen-lib",
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "AgentGen",
|
|
17
|
+
"email": "support@agent-gen.com"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/Agent-Gen-com/agent-gen-lib.git",
|
|
22
|
+
"directory": "n8n"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc && copyfiles -u 1 nodes/**/*.svg dist/nodes/",
|
|
26
|
+
"dev": "tsc --watch",
|
|
27
|
+
"format": "prettier nodes credentials --write",
|
|
28
|
+
"lint": "eslint nodes credentials --ext .ts",
|
|
29
|
+
"lintfix": "eslint nodes credentials --ext .ts --fix",
|
|
30
|
+
"prepublishOnly": "npm run build && npm run lint"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist"
|
|
34
|
+
],
|
|
35
|
+
"n8n": {
|
|
36
|
+
"n8nNodesApiVersion": 1,
|
|
37
|
+
"credentials": [
|
|
38
|
+
"dist/credentials/AgentGenApi.credentials.js"
|
|
39
|
+
],
|
|
40
|
+
"nodes": [
|
|
41
|
+
"dist/nodes/AgentGen/AgentGen.node.js"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
46
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
47
|
+
"@types/node": "^20.0.0",
|
|
48
|
+
"copyfiles": "^2.4.1",
|
|
49
|
+
"eslint": "^8.0.0",
|
|
50
|
+
"n8n-workflow": "*",
|
|
51
|
+
"prettier": "^3.0.0",
|
|
52
|
+
"typescript": "^5.4.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"n8n-workflow": "*"
|
|
56
|
+
}
|
|
57
|
+
}
|