n8n-nodes-test-node 1.0.13 → 1.0.15
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 +15 -5
- package/dist/{CamofoxBrowserApi.credentials.d.ts → GofileAPIApi.credentials.d.ts} +1 -1
- package/dist/{CamofoxBrowserApi.credentials.js → GofileAPIApi.credentials.js} +7 -7
- package/dist/GofileAPIFilesNode.node.d.ts +5 -0
- package/dist/GofileAPIFilesNode.node.js +119 -0
- package/dist/GofileAPIFilesToolNode.node.d.ts +5 -0
- package/dist/GofileAPIFilesToolNode.node.js +120 -0
- package/dist/{CamofoxBrowserNode.node.d.ts → GofileAPINode.node.d.ts} +1 -1
- package/dist/GofileAPINode.node.js +837 -0
- package/dist/{CamofoxBrowserToolNode.node.d.ts → GofileAPIToolNode.node.d.ts} +1 -1
- package/dist/GofileAPIToolNode.node.js +838 -0
- package/package.json +9 -6
- package/dist/CamofoxBrowserNode.node.js +0 -2563
- package/dist/CamofoxBrowserToolNode.node.js +0 -2564
- package/dist/RemoteChromiumCDPAutomationAPIApi.credentials.d.ts +0 -9
- package/dist/RemoteChromiumCDPAutomationAPIApi.credentials.js +0 -45
- package/dist/RemoteChromiumCDPAutomationAPINode.node.d.ts +0 -4
- package/dist/RemoteChromiumCDPAutomationAPINode.node.js +0 -3786
- package/dist/RemoteChromiumCDPAutomationAPIToolNode.node.d.ts +0 -4
- package/dist/RemoteChromiumCDPAutomationAPIToolNode.node.js +0 -3787
- package/dist/icon.png +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# n8n-nodes-test-node
|
|
2
2
|
|
|
3
|
-
Auto-generated n8n community node for the **
|
|
3
|
+
Auto-generated n8n community node for the **Gofile API** API (spec version 2025-05-16), built from its OpenAPI document.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -14,10 +14,19 @@ npm install n8n-nodes-test-node
|
|
|
14
14
|
|
|
15
15
|
## What was generated
|
|
16
16
|
|
|
17
|
-
- Node type(s) in this package: **
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
17
|
+
- Node type(s) in this package: **gofileAPI**, **gofileAPITool** (AI Agent tool), **gofileAPIFiles** (file upload/download), **gofileAPIFilesTool** (file upload/download, AI Agent tool).
|
|
18
|
+
- 2 resource(s), 14 operation(s) (identical parameter set on the regular and tool nodes -- they share the same credential and routing, differing only in identity and how they present themselves).
|
|
19
|
+
- 1 file upload/download operation(s), handled by the separate **Files** node -- see "File upload/download" below for why they're not part of the main node.
|
|
20
|
+
- Credential type **gofileAPIApi**, with an editable **Base URL** field, plus: API Key / Bearer token field(s) per the spec's security scheme.
|
|
21
|
+
- Default Base URL: `https://api.gofile.io` (override it in the credential's "Base URL" field to point at a different environment)
|
|
22
|
+
|
|
23
|
+
## File upload/download
|
|
24
|
+
|
|
25
|
+
Operations whose request body is a `multipart/form-data` file upload, or whose response is binary (an image, PDF, or other non-JSON file), are generated as a **separate node** ("...Files") rather than folded into the main one. This is deliberate, not a limitation of the source spec: n8n's declarative request-routing (what the main node is built with, so it needs no hand-written request logic) is confirmed broken for binary payloads -- it JSON-serializes binary data instead of sending real bytes ([n8n-io/n8n#17823](https://github.com/n8n-io/n8n/issues/17823)). The Files node is instead a small, hand-written (programmatic) node using n8n's HTTP helpers directly, which handle binary correctly.
|
|
26
|
+
|
|
27
|
+
- **Uploads**: set "Input Binary Field" to the name of the binary property on the incoming item that holds the file (n8n's convention -- usually `data`, e.g. from a **Read/Write File** or **HTTP Request** node upstream).
|
|
28
|
+
- **Downloads**: set "Output Binary Field" to the name the downloaded file should be written to on the output item (also usually `data`, ready for a **Read/Write File** node or another HTTP call downstream).
|
|
29
|
+
- The Files node shares the exact same credential as the main node.
|
|
21
30
|
|
|
22
31
|
## Using the AI Agent tool node
|
|
23
32
|
|
|
@@ -34,6 +43,7 @@ Once installed and enabled, add an **AI Agent** node to your workflow, and this
|
|
|
34
43
|
- OAuth2 and HTTP Basic each use n8n's own built-in credential mechanism and can't be combined with each other or with API Key/Bearer in one credential. If a spec declares more than one auth *family* as alternatives, this generator picks one deterministically -- **OAuth2 > HTTP Basic > API Key/Bearer** -- and the rest are ignored (logged during generation, and listed above if applicable). Multiple schemes *within* the API Key/Bearer family are still combined into one credential.
|
|
35
44
|
- If some operations require only an unsupported scheme while others are covered by this node's credential (the classic Swagger Petstore spec is a real example -- OAuth2 implicit flow for writes, an API key for some reads), the unsupported operations are left out of the node rather than the whole build failing -- see above for which ones, if any.
|
|
36
45
|
- Request bodies with nested objects, arrays, or genuine `oneOf`/`anyOf`/`allOf` type unions are exposed as a single raw "Body (JSON)" field rather than individual fields. A nullable/optional primitive field (OpenAPI 3.1's `anyOf: [{type: 'string'}, {type: 'null'}]`, as FastAPI/Pydantic generates for `Optional[str]`) is still recognized as simple and gets its own field.
|
|
46
|
+
- The Files node keeps every field top-level (no "Additional Fields" grouping for optional params, unlike the main node) -- binary operations tend to have few parameters, so this keeps its hand-written `execute()` logic simpler.
|
|
37
47
|
|
|
38
48
|
## Regenerating
|
|
39
49
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class GofileAPIApi implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
displayName: string;
|
|
5
5
|
documentationUrl: string;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
class
|
|
3
|
+
exports.GofileAPIApi = void 0;
|
|
4
|
+
class GofileAPIApi {
|
|
5
5
|
constructor() {
|
|
6
|
-
this.name = '
|
|
7
|
-
this.displayName = '
|
|
6
|
+
this.name = 'gofileAPIApi';
|
|
7
|
+
this.displayName = 'Gofile API';
|
|
8
8
|
this.documentationUrl = '';
|
|
9
9
|
this.properties = [
|
|
10
10
|
{
|
|
11
11
|
displayName: 'Base URL',
|
|
12
12
|
name: 'baseUrl',
|
|
13
13
|
type: 'string',
|
|
14
|
-
default: '
|
|
14
|
+
default: 'https://api.gofile.io',
|
|
15
15
|
required: true,
|
|
16
16
|
description: 'Base URL every request is sent to. Change this to point the node at a different environment (staging, self-hosted, etc.).',
|
|
17
17
|
},
|
|
@@ -36,10 +36,10 @@ class CamofoxBrowserApi {
|
|
|
36
36
|
this.test = {
|
|
37
37
|
request: {
|
|
38
38
|
baseURL: '={{$credentials.baseUrl}}',
|
|
39
|
-
url: '/
|
|
39
|
+
url: '/accounts/getid',
|
|
40
40
|
method: 'GET',
|
|
41
41
|
},
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
exports.
|
|
45
|
+
exports.GofileAPIApi = GofileAPIApi;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class GofileAPIFilesNode implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GofileAPIFilesNode = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const CREDENTIAL_TYPE_NAME = 'gofileAPIApi';
|
|
6
|
+
class GofileAPIFilesNode {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'Gofile API Files',
|
|
10
|
+
name: 'gofileAPIFiles',
|
|
11
|
+
icon: 'file:icon.svg',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
subtitle: '={{$parameter["operation"] + ($parameter["resource"] ? " " + $parameter["resource"] : "")}}',
|
|
15
|
+
description: 'File upload/download operations for the Gofile API API that need real binary handling (a separate, hand-written node -- see README).',
|
|
16
|
+
defaults: {
|
|
17
|
+
name: 'Gofile API Files',
|
|
18
|
+
},
|
|
19
|
+
inputs: ['main'],
|
|
20
|
+
outputs: ['main'],
|
|
21
|
+
credentials: [
|
|
22
|
+
{
|
|
23
|
+
name: CREDENTIAL_TYPE_NAME,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
properties: [
|
|
28
|
+
{
|
|
29
|
+
displayName: 'Operation',
|
|
30
|
+
name: 'operation',
|
|
31
|
+
type: 'options',
|
|
32
|
+
noDataExpression: true,
|
|
33
|
+
options: [
|
|
34
|
+
{
|
|
35
|
+
name: 'Upload A File',
|
|
36
|
+
value: 'uploadFile',
|
|
37
|
+
action: 'Upload a file',
|
|
38
|
+
description: 'Uploads a file to Gofile. If folderId is omitted, Gofile creates a new public folder. Regional upload hosts may be selected by changing the server URL. The official documentation states that the API uses Bearer-token authentication.',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
default: 'uploadFile',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Input Binary Field',
|
|
45
|
+
name: 'binaryPropertyName',
|
|
46
|
+
type: 'string',
|
|
47
|
+
default: 'data',
|
|
48
|
+
required: true,
|
|
49
|
+
description: 'File to upload.',
|
|
50
|
+
displayOptions: {
|
|
51
|
+
show: {
|
|
52
|
+
operation: ['uploadFile'],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
displayName: 'Folder Id',
|
|
58
|
+
name: 'folderId',
|
|
59
|
+
type: 'string',
|
|
60
|
+
default: '',
|
|
61
|
+
required: false,
|
|
62
|
+
description: 'Destination folder ID. If omitted, a new public folder is created.',
|
|
63
|
+
displayOptions: {
|
|
64
|
+
show: {
|
|
65
|
+
operation: ['uploadFile'],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
async execute() {
|
|
73
|
+
var _a;
|
|
74
|
+
const items = this.getInputData();
|
|
75
|
+
const returnData = [];
|
|
76
|
+
const credentials = await this.getCredentials(CREDENTIAL_TYPE_NAME);
|
|
77
|
+
const baseUrl = credentials.baseUrl;
|
|
78
|
+
for (let i = 0; i < items.length; i++) {
|
|
79
|
+
try {
|
|
80
|
+
const operation = this.getNodeParameter('operation', i);
|
|
81
|
+
switch (operation) {
|
|
82
|
+
case 'uploadFile': {
|
|
83
|
+
const url = `${baseUrl}/uploadfile`;
|
|
84
|
+
const inputBinaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
85
|
+
const fileBinaryData = this.helpers.assertBinaryData(i, inputBinaryPropertyName);
|
|
86
|
+
const fileBuffer = await this.helpers.getBinaryDataBuffer(i, inputBinaryPropertyName);
|
|
87
|
+
const formData = new FormData();
|
|
88
|
+
formData.append('file', new Blob([fileBuffer], { type: fileBinaryData.mimeType }), fileBinaryData.fileName || 'file');
|
|
89
|
+
formData.append('folderId', String(this.getNodeParameter('folderId', i, '')));
|
|
90
|
+
const response = (await this.helpers.httpRequestWithAuthentication.call(this, CREDENTIAL_TYPE_NAME, {
|
|
91
|
+
method: 'POST',
|
|
92
|
+
url,
|
|
93
|
+
body: formData,
|
|
94
|
+
returnFullResponse: true,
|
|
95
|
+
}));
|
|
96
|
+
returnData.push({
|
|
97
|
+
json: ((_a = response.body) !== null && _a !== void 0 ? _a : {}),
|
|
98
|
+
pairedItem: { item: i },
|
|
99
|
+
});
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
default:
|
|
103
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`, {
|
|
104
|
+
itemIndex: i,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
if (this.continueOnFail()) {
|
|
110
|
+
returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return [returnData];
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.GofileAPIFilesNode = GofileAPIFilesNode;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class GofileAPIFilesToolNode implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GofileAPIFilesToolNode = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const CREDENTIAL_TYPE_NAME = 'gofileAPIApi';
|
|
6
|
+
class GofileAPIFilesToolNode {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'Gofile API Files Tool',
|
|
10
|
+
name: 'gofileAPIFilesTool',
|
|
11
|
+
icon: 'file:icon.svg',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
subtitle: '={{$parameter["operation"] + ($parameter["resource"] ? " " + $parameter["resource"] : "")}}',
|
|
15
|
+
description: 'Use this tool to upload or download files via the Gofile API API.',
|
|
16
|
+
usableAsTool: true,
|
|
17
|
+
defaults: {
|
|
18
|
+
name: 'Gofile API Files Tool',
|
|
19
|
+
},
|
|
20
|
+
inputs: ['main'],
|
|
21
|
+
outputs: ['main'],
|
|
22
|
+
credentials: [
|
|
23
|
+
{
|
|
24
|
+
name: CREDENTIAL_TYPE_NAME,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
properties: [
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Operation',
|
|
31
|
+
name: 'operation',
|
|
32
|
+
type: 'options',
|
|
33
|
+
noDataExpression: true,
|
|
34
|
+
options: [
|
|
35
|
+
{
|
|
36
|
+
name: 'Upload A File',
|
|
37
|
+
value: 'uploadFile',
|
|
38
|
+
action: 'Upload a file',
|
|
39
|
+
description: 'Uploads a file to Gofile. If folderId is omitted, Gofile creates a new public folder. Regional upload hosts may be selected by changing the server URL. The official documentation states that the API uses Bearer-token authentication.',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
default: 'uploadFile',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
displayName: 'Input Binary Field',
|
|
46
|
+
name: 'binaryPropertyName',
|
|
47
|
+
type: 'string',
|
|
48
|
+
default: 'data',
|
|
49
|
+
required: true,
|
|
50
|
+
description: 'File to upload.',
|
|
51
|
+
displayOptions: {
|
|
52
|
+
show: {
|
|
53
|
+
operation: ['uploadFile'],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
displayName: 'Folder Id',
|
|
59
|
+
name: 'folderId',
|
|
60
|
+
type: 'string',
|
|
61
|
+
default: '',
|
|
62
|
+
required: false,
|
|
63
|
+
description: 'Destination folder ID. If omitted, a new public folder is created.',
|
|
64
|
+
displayOptions: {
|
|
65
|
+
show: {
|
|
66
|
+
operation: ['uploadFile'],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
async execute() {
|
|
74
|
+
var _a;
|
|
75
|
+
const items = this.getInputData();
|
|
76
|
+
const returnData = [];
|
|
77
|
+
const credentials = await this.getCredentials(CREDENTIAL_TYPE_NAME);
|
|
78
|
+
const baseUrl = credentials.baseUrl;
|
|
79
|
+
for (let i = 0; i < items.length; i++) {
|
|
80
|
+
try {
|
|
81
|
+
const operation = this.getNodeParameter('operation', i);
|
|
82
|
+
switch (operation) {
|
|
83
|
+
case 'uploadFile': {
|
|
84
|
+
const url = `${baseUrl}/uploadfile`;
|
|
85
|
+
const inputBinaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
86
|
+
const fileBinaryData = this.helpers.assertBinaryData(i, inputBinaryPropertyName);
|
|
87
|
+
const fileBuffer = await this.helpers.getBinaryDataBuffer(i, inputBinaryPropertyName);
|
|
88
|
+
const formData = new FormData();
|
|
89
|
+
formData.append('file', new Blob([fileBuffer], { type: fileBinaryData.mimeType }), fileBinaryData.fileName || 'file');
|
|
90
|
+
formData.append('folderId', String(this.getNodeParameter('folderId', i, '')));
|
|
91
|
+
const response = (await this.helpers.httpRequestWithAuthentication.call(this, CREDENTIAL_TYPE_NAME, {
|
|
92
|
+
method: 'POST',
|
|
93
|
+
url,
|
|
94
|
+
body: formData,
|
|
95
|
+
returnFullResponse: true,
|
|
96
|
+
}));
|
|
97
|
+
returnData.push({
|
|
98
|
+
json: ((_a = response.body) !== null && _a !== void 0 ? _a : {}),
|
|
99
|
+
pairedItem: { item: i },
|
|
100
|
+
});
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
default:
|
|
104
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`, {
|
|
105
|
+
itemIndex: i,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
if (this.continueOnFail()) {
|
|
111
|
+
returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return [returnData];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.GofileAPIFilesToolNode = GofileAPIFilesToolNode;
|