n8n-nodes-doppelganger 0.1.0 → 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.
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
# n8n-nodes-doppelganger
|
|
2
|
-
|
|
3
|
-
Official n8n community node for running Doppelganger tasks via the local API.
|
|
4
|
-
|
|
1
|
+
# n8n-nodes-doppelganger
|
|
2
|
+
|
|
3
|
+
Official n8n community node for running Doppelganger tasks via the local API.
|
|
4
|
+
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
+
### Classic n8n Community Nodes (recommended)
|
|
8
|
+
|
|
7
9
|
1. In n8n, open **Settings** -> **Community Nodes**.
|
|
8
10
|
2. Enter the package name: `n8n-nodes-doppelganger`.
|
|
9
11
|
3. Install and restart n8n if prompted.
|
|
@@ -16,26 +18,25 @@ npm run build
|
|
|
16
18
|
```
|
|
17
19
|
|
|
18
20
|
Then add the package in n8n as a community node or publish to npm and install from there.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
- Docker: https://hub.docker.com/r/mnemosyneai/doppelganger
|
|
21
|
+
## Setup
|
|
22
|
+
|
|
23
|
+
1. Create Doppelganger API credentials in n8n.
|
|
24
|
+
- Base URL: `http://localhost:11345` (or your server)
|
|
25
|
+
- API Key: from Doppelganger Settings
|
|
26
|
+
2. Add the **Doppelganger** node to a workflow.
|
|
27
|
+
3. Set your Task ID and optional variables (JSON).
|
|
28
|
+
|
|
29
|
+
## What it does
|
|
30
|
+
|
|
31
|
+
Calls:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
POST /tasks/:id/api
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Auth header: `x-api-key`.
|
|
38
|
+
|
|
39
|
+
## Links
|
|
40
|
+
|
|
41
|
+
- Homepage: https://doppelgangerdev.com
|
|
42
|
+
- Docker: https://hub.docker.com/r/mnemosyneai/doppelganger
|
|
@@ -5,14 +5,14 @@ const n8n_workflow_1 = require("n8n-workflow");
|
|
|
5
5
|
class Doppelganger {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.description = {
|
|
8
|
-
displayName: '
|
|
8
|
+
displayName: 'Doppelganger',
|
|
9
9
|
name: 'doppelganger',
|
|
10
10
|
icon: 'file:icon.png',
|
|
11
11
|
group: ['transform'],
|
|
12
12
|
version: 1,
|
|
13
13
|
description: 'Run a Doppelganger task via the API',
|
|
14
14
|
defaults: {
|
|
15
|
-
name: '
|
|
15
|
+
name: 'Execute Task',
|
|
16
16
|
},
|
|
17
17
|
inputs: ['main'],
|
|
18
18
|
outputs: ['main'],
|
|
@@ -23,6 +23,21 @@ class Doppelganger {
|
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
properties: [
|
|
26
|
+
{
|
|
27
|
+
displayName: 'Operation',
|
|
28
|
+
name: 'operation',
|
|
29
|
+
type: 'options',
|
|
30
|
+
noDataExpression: true,
|
|
31
|
+
options: [
|
|
32
|
+
{
|
|
33
|
+
name: 'Execute Task',
|
|
34
|
+
value: 'executeTask',
|
|
35
|
+
description: 'Run a Doppelganger task',
|
|
36
|
+
action: 'Execute a task',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
default: 'executeTask',
|
|
40
|
+
},
|
|
26
41
|
{
|
|
27
42
|
displayName: 'Task ID',
|
|
28
43
|
name: 'taskId',
|
|
@@ -32,36 +47,61 @@ class Doppelganger {
|
|
|
32
47
|
description: 'Task ID from the Doppelganger dashboard',
|
|
33
48
|
},
|
|
34
49
|
{
|
|
35
|
-
displayName: 'Variables
|
|
50
|
+
displayName: 'Variables',
|
|
36
51
|
name: 'variables',
|
|
37
|
-
type: '
|
|
38
|
-
default:
|
|
52
|
+
type: 'fixedCollection',
|
|
53
|
+
default: {},
|
|
39
54
|
required: false,
|
|
40
|
-
description: '
|
|
55
|
+
description: 'Optional task variables to override',
|
|
56
|
+
typeOptions: {
|
|
57
|
+
multipleValues: true,
|
|
58
|
+
},
|
|
59
|
+
options: [
|
|
60
|
+
{
|
|
61
|
+
name: 'values',
|
|
62
|
+
displayName: 'Variable',
|
|
63
|
+
values: [
|
|
64
|
+
{
|
|
65
|
+
displayName: 'Name',
|
|
66
|
+
name: 'name',
|
|
67
|
+
type: 'string',
|
|
68
|
+
default: '',
|
|
69
|
+
required: true,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
displayName: 'Value',
|
|
73
|
+
name: 'value',
|
|
74
|
+
type: 'string',
|
|
75
|
+
default: '',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
],
|
|
41
80
|
},
|
|
42
81
|
],
|
|
43
82
|
};
|
|
44
83
|
}
|
|
45
84
|
async execute() {
|
|
85
|
+
var _a, _b;
|
|
46
86
|
const items = this.getInputData();
|
|
47
87
|
const returnData = [];
|
|
48
88
|
for (let i = 0; i < items.length; i++) {
|
|
89
|
+
const operation = this.getNodeParameter('operation', i);
|
|
90
|
+
if (operation !== 'executeTask') {
|
|
91
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Unsupported operation.', {
|
|
92
|
+
itemIndex: i,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
49
95
|
const taskId = this.getNodeParameter('taskId', i);
|
|
50
96
|
const variablesRaw = this.getNodeParameter('variables', i);
|
|
51
|
-
|
|
52
|
-
if (variablesRaw) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
catch (error) {
|
|
58
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Variables must be valid JSON.', {
|
|
59
|
-
itemIndex: i,
|
|
60
|
-
});
|
|
97
|
+
const variables = {};
|
|
98
|
+
if ((_a = variablesRaw === null || variablesRaw === void 0 ? void 0 : variablesRaw.values) === null || _a === void 0 ? void 0 : _a.length) {
|
|
99
|
+
for (const entry of variablesRaw.values) {
|
|
100
|
+
const key = (entry.name || '').trim();
|
|
101
|
+
if (!key) {
|
|
102
|
+
continue;
|
|
61
103
|
}
|
|
62
|
-
|
|
63
|
-
else {
|
|
64
|
-
variables = variablesRaw;
|
|
104
|
+
variables[key] = (_b = entry.value) !== null && _b !== void 0 ? _b : '';
|
|
65
105
|
}
|
|
66
106
|
}
|
|
67
107
|
const credentials = await this.getCredentials('doppelgangerApi');
|
|
Binary file
|