n8n-nodes-filekiwi 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
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# n8n-nodes-filekiwi
|
|
2
|
+
|
|
3
|
+
Input files and get shareable encrypted links instantly — no need to wait for the upload to finish.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### In n8n (Community Node)
|
|
8
|
+
|
|
9
|
+
1. Go to **Settings > Community Nodes**
|
|
10
|
+
2. Enter `n8n-nodes-filekiwi`
|
|
11
|
+
3. Click **Install**
|
|
12
|
+
|
|
13
|
+
### Manual
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
cd ~/.n8n/nodes
|
|
17
|
+
npm install n8n-nodes-filekiwi
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Restart n8n after installation.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
The **File Kiwi** node accepts the following parameters:
|
|
25
|
+
|
|
26
|
+
| Parameter | Required | Description |
|
|
27
|
+
|-----------|----------|-------------|
|
|
28
|
+
| **File Path** | Yes | Path to the file to upload. Defaults to `{{ $json.fileName }}` for use with the Local File Trigger. |
|
|
29
|
+
| **Title** | No | Optional title for the file.kiwi link. |
|
|
30
|
+
| **Wait for Upload** | No | Wait for the upload to complete before continuing. Default: **off** |
|
|
31
|
+
|
|
32
|
+
### Output
|
|
33
|
+
|
|
34
|
+
| Field | Description |
|
|
35
|
+
|-------|-------------|
|
|
36
|
+
| `fileKiwiUrl` | Shareable encrypted link to the uploaded file |
|
|
37
|
+
| `webfolderId` | The webfolder ID on file.kiwi |
|
|
38
|
+
|
|
39
|
+
### Instant Link Sharing
|
|
40
|
+
|
|
41
|
+
By default, **Wait for Upload** is off — the download link is returned immediately, even while the file is still uploading. This means you can send the link via email or Slack right away, and the recipient can start downloading while uploading. No need to wait for large files to finish uploading before sharing.
|
|
42
|
+
|
|
43
|
+
### Example Workflow
|
|
44
|
+
|
|
45
|
+
**Local File Trigger** -> **File Kiwi** -> **Slack / Email / etc.**
|
|
46
|
+
|
|
47
|
+
1. A new file appears in a watched folder
|
|
48
|
+
2. File Kiwi creates an encrypted link and returns it instantly
|
|
49
|
+
3. The link is sent via Slack, email, or any other service — upload continues in the background
|
|
50
|
+
4. The recipient opens the link and can start downloading as the upload progresses
|
|
51
|
+
|
|
52
|
+
## Development
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm install
|
|
56
|
+
npm run build
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
MIT
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class FileKiwi implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileKiwi = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
class FileKiwi {
|
|
6
|
+
description = {
|
|
7
|
+
displayName: 'File Kiwi',
|
|
8
|
+
name: 'fileKiwi',
|
|
9
|
+
icon: 'file:filekiwi.svg',
|
|
10
|
+
group: ['output'],
|
|
11
|
+
version: 1,
|
|
12
|
+
subtitle: '={{$parameter["title"] || "Upload file"}}',
|
|
13
|
+
description: 'Upload files to file.kiwi and get shareable encrypted links',
|
|
14
|
+
defaults: {
|
|
15
|
+
name: 'File Kiwi',
|
|
16
|
+
},
|
|
17
|
+
inputs: ['main'],
|
|
18
|
+
outputs: ['main'],
|
|
19
|
+
properties: [
|
|
20
|
+
{
|
|
21
|
+
displayName: 'File Path',
|
|
22
|
+
name: 'filePath',
|
|
23
|
+
type: 'string',
|
|
24
|
+
default: '={{ $json.fileName }}',
|
|
25
|
+
placeholder: '/path/to/file.txt',
|
|
26
|
+
description: 'Path to the file to upload. Uses fileName from Local File Trigger by default.',
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Title',
|
|
31
|
+
name: 'title',
|
|
32
|
+
type: 'string',
|
|
33
|
+
default: '',
|
|
34
|
+
placeholder: 'My shared files',
|
|
35
|
+
description: 'Optional title for the file.kiwi link',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
displayName: 'Wait for Upload',
|
|
39
|
+
name: 'waitForUpload',
|
|
40
|
+
type: 'boolean',
|
|
41
|
+
default: false,
|
|
42
|
+
description: 'Whether to wait for the upload to complete before continuing. When off, the link is returned immediately and the upload runs in the background.',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
async execute() {
|
|
47
|
+
const { createWebFolder, startUpload } = await import('@file-kiwi/node');
|
|
48
|
+
const items = this.getInputData();
|
|
49
|
+
const returnData = [];
|
|
50
|
+
for (let i = 0; i < items.length; i++) {
|
|
51
|
+
try {
|
|
52
|
+
const filePath = this.getNodeParameter('filePath', i);
|
|
53
|
+
const title = this.getNodeParameter('title', i);
|
|
54
|
+
const waitForUpload = this.getNodeParameter('waitForUpload', i);
|
|
55
|
+
if (!filePath) {
|
|
56
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'File path is empty', { itemIndex: i });
|
|
57
|
+
}
|
|
58
|
+
const webfolder = await createWebFolder({
|
|
59
|
+
files: [filePath],
|
|
60
|
+
...(title ? { title } : {}),
|
|
61
|
+
});
|
|
62
|
+
if (waitForUpload) {
|
|
63
|
+
await startUpload(webfolder);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
startUpload(webfolder, {
|
|
67
|
+
onError: (file, err) => {
|
|
68
|
+
console.error(`[FileKiwi] Upload failed for ${file.filepath}: ${err.message}`);
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
returnData.push({
|
|
73
|
+
json: {
|
|
74
|
+
...items[i].json,
|
|
75
|
+
fileKiwiUrl: webfolder.webfolderUrl,
|
|
76
|
+
webfolderId: webfolder.webfolderId,
|
|
77
|
+
},
|
|
78
|
+
pairedItem: { item: i },
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (this.continueOnFail()) {
|
|
83
|
+
returnData.push({
|
|
84
|
+
json: {
|
|
85
|
+
...items[i].json,
|
|
86
|
+
error: error.message,
|
|
87
|
+
},
|
|
88
|
+
pairedItem: { item: i },
|
|
89
|
+
});
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return [returnData];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.FileKiwi = FileKiwi;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" style="stop-color:#6DBE45"/>
|
|
5
|
+
<stop offset="100%" style="stop-color:#4A9E2F"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect width="64" height="64" rx="12" fill="url(#bg)"/>
|
|
9
|
+
<g transform="translate(32,32)">
|
|
10
|
+
<ellipse cx="0" cy="2" rx="14" ry="17" fill="#8B5E3C"/>
|
|
11
|
+
<ellipse cx="0" cy="2" rx="11" ry="14" fill="#A4D65E"/>
|
|
12
|
+
<circle cx="0" cy="2" r="3" fill="#F5F5DC"/>
|
|
13
|
+
<g stroke="#7CB342" stroke-width="0.8" fill="none">
|
|
14
|
+
<line x1="0" y1="-1" x2="-7" y2="-10"/>
|
|
15
|
+
<line x1="0" y1="-1" x2="7" y2="-10"/>
|
|
16
|
+
<line x1="0" y1="-1" x2="-9" y2="-4"/>
|
|
17
|
+
<line x1="0" y1="-1" x2="9" y2="-4"/>
|
|
18
|
+
<line x1="0" y1="-1" x2="-8" y2="5"/>
|
|
19
|
+
<line x1="0" y1="-1" x2="8" y2="5"/>
|
|
20
|
+
<line x1="0" y1="-1" x2="-5" y2="11"/>
|
|
21
|
+
<line x1="0" y1="-1" x2="5" y2="11"/>
|
|
22
|
+
</g>
|
|
23
|
+
</g>
|
|
24
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-filekiwi",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n node to upload files to file.kiwi and get shareable links",
|
|
5
|
+
"keywords": ["n8n-community-node-package", "n8n", "file-kiwi", "file-sharing", "encryption"],
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/file-kiwi/n8n.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/file-kiwi/n8n",
|
|
11
|
+
"author": {
|
|
12
|
+
"name": "file.kiwi",
|
|
13
|
+
"url": "https://file.kiwi"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"main": "dist/nodes/FileKiwi/FileKiwi.node.js",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc && npm run copy-assets",
|
|
22
|
+
"copy-assets": "cp src/nodes/FileKiwi/filekiwi.svg dist/nodes/FileKiwi/",
|
|
23
|
+
"prepublishOnly": "npm run build"
|
|
24
|
+
},
|
|
25
|
+
"n8n": {
|
|
26
|
+
"n8nNodesApiVersion": 1,
|
|
27
|
+
"nodes": [
|
|
28
|
+
"dist/nodes/FileKiwi/FileKiwi.node.js"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@file-kiwi/node": "^1.0.8"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"n8n-workflow": "^1.0.0",
|
|
36
|
+
"typescript": "^5.4.0",
|
|
37
|
+
"@types/node": "^22.0.0"
|
|
38
|
+
}
|
|
39
|
+
}
|