n8n-node-dev 0.19.0 → 0.23.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/dist/commands/build.js +0 -1
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/new.js +7 -17
- package/dist/commands/new.js.map +1 -1
- package/dist/src/Build.js +9 -6
- package/dist/src/Build.js.map +1 -1
- package/dist/src/Create.js +2 -4
- package/dist/src/Create.js.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +8 -7
- package/templates/credentials/simple.ts +3 -5
- package/templates/execute/simple.ts +4 -12
- package/templates/trigger/simple.ts +3 -11
- package/templates/webhook/simple.ts +9 -24
package/dist/commands/build.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../commands/build.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../commands/build.ts"],"names":[],"mappings":";;;AAAA,uCAAwC;AACxC,4CAAgD;AAEhD,gCAAmD;AAEnD,MAAa,KAAM,SAAQ,iBAAO;IAsBjC,KAAK,CAAC,GAAG;QAER,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAEpC,IAAI,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAC1C,IAAI,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QAEtC,IAAI;YACH,MAAM,OAAO,GAAkB,EAAE,CAAC;YAElC,IAAI,KAAK,CAAC,WAAW,EAAE;gBACtB,OAAO,CAAC,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC;aAC9C;YACD,IAAI,KAAK,CAAC,KAAK,EAAE;gBAChB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;aACrB;YAED,MAAM,eAAe,GAAG,MAAM,gBAAU,CAAC,OAAO,CAAC,CAAC;YAElD,IAAI,CAAC,GAAG,CAAC,6DAA6D,eAAe,EAAE,CAAC,CAAC;SACzF;QAAC,OAAO,KAAK,EAAE;YAEf,IAAI,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;YAC5C,IAAI,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;YAEjD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACtB;IACF,CAAC;;AAjDF,sBAkDC;AAjDO,iBAAW,GAAG,2EAA2E,CAAC;AAE1F,cAAQ,GAAG;IACjB,sBAAsB;IACtB,gDAAgD;IAChD,8BAA8B;CAC9B,CAAC;AAEK,WAAK,GAAG;IACd,IAAI,EAAE,eAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IAC/B,WAAW,EAAE,eAAK,CAAC,MAAM,CAAC;QACzB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,oDAAoD,uBAAY,CAAC,mCAAmC,EAAE,GAAG;KACtH,CAAC;IACF,KAAK,EAAE,eAAK,CAAC,OAAO,CAAC;QACpB,WAAW,EACV,oFAAoF;KACrF,CAAC;CACF,CAAC"}
|
package/dist/commands/new.js
CHANGED
|
@@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
14
14
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
15
|
if (mod && mod.__esModule) return mod;
|
|
16
16
|
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
@@ -25,9 +25,9 @@ const fs = __importStar(require("fs"));
|
|
|
25
25
|
const inquirer = __importStar(require("inquirer"));
|
|
26
26
|
const command_1 = require("@oclif/command");
|
|
27
27
|
const path_1 = require("path");
|
|
28
|
+
const src_1 = require("../src");
|
|
28
29
|
const { promisify } = require('util');
|
|
29
30
|
const fsAccess = promisify(fs.access);
|
|
30
|
-
const src_1 = require("../src");
|
|
31
31
|
class New extends command_1.Command {
|
|
32
32
|
async run() {
|
|
33
33
|
try {
|
|
@@ -38,10 +38,7 @@ class New extends command_1.Command {
|
|
|
38
38
|
type: 'list',
|
|
39
39
|
default: 'Node',
|
|
40
40
|
message: 'What do you want to create?',
|
|
41
|
-
choices: [
|
|
42
|
-
'Credentials',
|
|
43
|
-
'Node',
|
|
44
|
-
],
|
|
41
|
+
choices: ['Credentials', 'Node'],
|
|
45
42
|
};
|
|
46
43
|
const typeAnswers = await inquirer.prompt(typeQuestion);
|
|
47
44
|
let sourceFolder = '';
|
|
@@ -55,11 +52,7 @@ class New extends command_1.Command {
|
|
|
55
52
|
type: 'list',
|
|
56
53
|
default: 'Execute',
|
|
57
54
|
message: 'What kind of node do you want to create?',
|
|
58
|
-
choices: [
|
|
59
|
-
'Execute',
|
|
60
|
-
'Trigger',
|
|
61
|
-
'Webhook',
|
|
62
|
-
],
|
|
55
|
+
choices: ['Execute', 'Trigger', 'Webhook'],
|
|
63
56
|
};
|
|
64
57
|
const nodeTypeAnswers = await inquirer.prompt(nodeTypeQuestion);
|
|
65
58
|
sourceFolder = 'execute';
|
|
@@ -85,7 +78,7 @@ class New extends command_1.Command {
|
|
|
85
78
|
message: 'How should the node be called?',
|
|
86
79
|
},
|
|
87
80
|
];
|
|
88
|
-
if (getDescription
|
|
81
|
+
if (getDescription) {
|
|
89
82
|
additionalQuestions.push({
|
|
90
83
|
name: 'description',
|
|
91
84
|
type: 'input',
|
|
@@ -124,19 +117,16 @@ class New extends command_1.Command {
|
|
|
124
117
|
await src_1.createTemplate(sourceFilePath, destinationFilePath, replaceValues);
|
|
125
118
|
this.log('\nExecution was successfull:');
|
|
126
119
|
this.log('====================================');
|
|
127
|
-
this.log(
|
|
120
|
+
this.log(`Node got created: ${destinationFilePath}`);
|
|
128
121
|
}
|
|
129
122
|
catch (error) {
|
|
130
123
|
this.log(`\nGOT ERROR: "${error.message}"`);
|
|
131
124
|
this.log('====================================');
|
|
132
125
|
this.log(error.stack);
|
|
133
|
-
return;
|
|
134
126
|
}
|
|
135
127
|
}
|
|
136
128
|
}
|
|
137
129
|
exports.New = New;
|
|
138
130
|
New.description = 'Create new credentials/node';
|
|
139
|
-
New.examples = [
|
|
140
|
-
`$ n8n-node-dev new`,
|
|
141
|
-
];
|
|
131
|
+
New.examples = [`$ n8n-node-dev new`];
|
|
142
132
|
//# sourceMappingURL=new.js.map
|
package/dist/commands/new.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new.js","sourceRoot":"","sources":["../../commands/new.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"new.js","sourceRoot":"","sources":["../../commands/new.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAGA,wDAA0C;AAC1C,uCAAyB;AACzB,mDAAqC;AACrC,4CAAyC;AACzC,+BAA4B;AAE5B,gCAAwC;AAGxC,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAEtC,MAAM,QAAQ,GAAG,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;AAEtC,MAAa,GAAI,SAAQ,iBAAO;IAM/B,KAAK,CAAC,GAAG;QACR,IAAI;YACH,IAAI,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;YAC1C,IAAI,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;YAGtC,MAAM,YAAY,GAAgC;gBACjD,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,MAAM;gBACf,OAAO,EAAE,6BAA6B;gBACtC,OAAO,EA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C,WAAW;aACrD,CAAC;YAEF,MAAM,oBAAc,CAAC,cAAc,EAAE,mBAAmB,EAAE,aAAa,CAAC,CAAC;YAEzE,IAAI,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;YACzC,IAAI,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;YAEjD,IAAI,CAAC,GAAG,CAAC,qBAAqB,mBAAmB,EAAE,CAAC,CAAC;SACrD;QAAC,OAAO,KAAK,EAAE;YAEf,IAAI,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;YAC5C,IAAI,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;YAEjD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACtB;IACF,CAAC;;AA/IF,kBAgJC;AA/IO,eAAW,GAAG,6BAA6B,CAAC;AAE5C,YAAQ,GAAG,CAAC,oBAAoB,CAAC,CAAC"}
|
package/dist/src/Build.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildFiles = exports.createCustomTsconfig = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
|
-
const copyfiles = require('copyfiles');
|
|
6
5
|
const promises_1 = require("fs/promises");
|
|
7
6
|
const fs_1 = require("fs");
|
|
8
7
|
const path_1 = require("path");
|
|
9
8
|
const tmp_promise_1 = require("tmp-promise");
|
|
10
9
|
const util_1 = require("util");
|
|
10
|
+
const n8n_core_1 = require("n8n-core");
|
|
11
|
+
const copyfiles = require('copyfiles');
|
|
11
12
|
const fsReadFileAsync = util_1.promisify(promises_1.readFile);
|
|
12
13
|
const fsWriteAsync = util_1.promisify(fs_1.write);
|
|
13
|
-
const n8n_core_1 = require("n8n-core");
|
|
14
14
|
async function createCustomTsconfig() {
|
|
15
15
|
const tsconfigPath = path_1.join(__dirname, '../../src/tsconfig-build.json');
|
|
16
16
|
const tsConfigString = await promises_1.readFile(tsconfigPath, { encoding: 'utf8' });
|
|
@@ -20,7 +20,7 @@ async function createCustomTsconfig() {
|
|
|
20
20
|
newIncludeFiles.push(path_1.join(process.cwd(), includeFile));
|
|
21
21
|
}
|
|
22
22
|
tsConfig.include = newIncludeFiles;
|
|
23
|
-
const { fd, path, cleanup } = await tmp_promise_1.file(
|
|
23
|
+
const { fd, path, cleanup } = await tmp_promise_1.file();
|
|
24
24
|
await fsWriteAsync(fd, Buffer.from(JSON.stringify(tsConfig, null, 2), 'utf8'));
|
|
25
25
|
return {
|
|
26
26
|
path,
|
|
@@ -47,7 +47,10 @@ async function buildFiles(options) {
|
|
|
47
47
|
}
|
|
48
48
|
let buildProcess;
|
|
49
49
|
try {
|
|
50
|
-
buildProcess = child_process_1.spawn('node', buildCommand.split(' '), {
|
|
50
|
+
buildProcess = child_process_1.spawn('node', buildCommand.split(' '), {
|
|
51
|
+
windowsVerbatimArguments: true,
|
|
52
|
+
cwd: process.cwd(),
|
|
53
|
+
});
|
|
51
54
|
buildProcess.stdout.pipe(process.stdout);
|
|
52
55
|
buildProcess.stderr.pipe(process.stderr);
|
|
53
56
|
process.on('exit', () => {
|
|
@@ -63,10 +66,10 @@ async function buildFiles(options) {
|
|
|
63
66
|
throw new Error(errorMessage);
|
|
64
67
|
}
|
|
65
68
|
return new Promise((resolve, reject) => {
|
|
66
|
-
['*.png', '*.node.json'].forEach(filenamePattern => {
|
|
69
|
+
['*.png', '*.node.json'].forEach((filenamePattern) => {
|
|
67
70
|
copyfiles([path_1.join(process.cwd(), `./${filenamePattern}`), outputDirectory], { up: true }, () => resolve(outputDirectory));
|
|
68
71
|
});
|
|
69
|
-
buildProcess.on('exit', code => {
|
|
72
|
+
buildProcess.on('exit', (code) => {
|
|
70
73
|
tsconfigData.cleanup();
|
|
71
74
|
});
|
|
72
75
|
});
|
package/dist/src/Build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Build.js","sourceRoot":"","sources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AAC;QAEjC,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE;YAE/B,YAAY,GAAG,GAAG,YAAY,4BAA4B,KAAK,CAAC,MAAM,EAAE,CAAC;SACzE;QAID,YAAY,CAAC,OAAO,EAAE,CAAC;QAEvB,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;KAC9B;IAGD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,EAAE;YAEpD,SAAS,CAAC,CAAC,WAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,eAAe,EAAE,CAAC,EAAE,eAAe,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAC5F,OAAO,CAAC,eAAe,CAAC,CACxB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YAGhC,YAAY,CAAC,OAAO,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC;AA/ED,gCA+EC"}
|
package/dist/src/Create.js
CHANGED
|
@@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
14
14
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
15
|
if (mod && mod.__esModule) return mod;
|
|
16
16
|
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
@@ -27,9 +27,7 @@ const fsCopyFile = promisify(fs.copyFile);
|
|
|
27
27
|
async function createTemplate(sourceFilePath, destinationFilePath, replaceValues) {
|
|
28
28
|
await fsCopyFile(sourceFilePath, destinationFilePath);
|
|
29
29
|
const options = {
|
|
30
|
-
files: [
|
|
31
|
-
destinationFilePath,
|
|
32
|
-
],
|
|
30
|
+
files: [destinationFilePath],
|
|
33
31
|
from: [],
|
|
34
32
|
to: [],
|
|
35
33
|
};
|
package/dist/src/Create.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Create.js","sourceRoot":"","sources":["../../src/Create.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Create.js","sourceRoot":"","sources":["../../src/Create.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,qDAAqE;AAGrE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAGtC,MAAM,UAAU,GAAG,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AAWnC,KAAK,UAAU,cAAc,CACnC,cAAsB,EACtB,mBAA2B,EAC3B,aAAqB;IAIrB,MAAM,UAAU,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;IAGtD,MAAM,OAAO,GAAwB;QACpC,KAAK,EAAE,CAAC,mBAAmB,CAAC;QAC5B,IAAI,EAAE,EAAE;QACR,EAAE,EAAE,EAAE;KACN,CAAC;IACF,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACrD,OAAO,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAC1C,MAAM,+BAAa,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AApBD,wCAoBC"}
|
package/dist/src/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
7
7
|
o[k2] = m[k];
|
|
8
8
|
}));
|
|
9
9
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./Build"), exports);
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,0CAAwB;AACxB,2CAAyB;AACzB,+CAA6B"}
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.
|
|
1
|
+
{"version":"0.23.0","commands":{"build":{"id":"build","description":"Builds credentials and nodes and copies it to n8n custom extension folder","pluginName":"n8n-node-dev","pluginType":"core","aliases":[],"examples":["$ n8n-node-dev build","$ n8n-node-dev build --destination ~/n8n-nodes","$ n8n-node-dev build --watch"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"destination":{"name":"destination","type":"option","char":"d","description":"The path to copy the compiles files to [default: /root/.n8n/custom]"},"watch":{"name":"watch","type":"boolean","description":"Starts in watch mode and automatically builds and copies file whenever they change","allowNo":false}},"args":[]},"new":{"id":"new","description":"Create new credentials/node","pluginName":"n8n-node-dev","pluginType":"core","aliases":[],"examples":["$ n8n-node-dev new"],"flags":{},"args":[]}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-node-dev",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "CLI to simplify n8n credentials/node development",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://n8n.io",
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"dev": "npm run watch",
|
|
23
23
|
"build": "tsc",
|
|
24
|
+
"format": "cd ../.. && node_modules/prettier/bin-prettier.js packages/node-dev/**/**.ts --write",
|
|
25
|
+
"lint": "cd ../.. && node_modules/eslint/bin/eslint.js packages/node-dev",
|
|
26
|
+
"lintfix": "cd ../.. && node_modules/eslint/bin/eslint.js packages/node-dev --fix",
|
|
24
27
|
"postpack": "rm -f oclif.manifest.json",
|
|
25
28
|
"prepack": "echo \"Building project...\" && rm -rf dist && tsc -b && oclif-dev manifest",
|
|
26
|
-
"tslint": "tslint -p tsconfig.json -c tslint.json",
|
|
27
|
-
"tslintfix": "tslint --fix -p tsconfig.json -c tslint.json",
|
|
28
29
|
"watch": "tsc --watch"
|
|
29
30
|
},
|
|
30
31
|
"bin": {
|
|
@@ -59,12 +60,12 @@
|
|
|
59
60
|
"change-case": "^4.1.1",
|
|
60
61
|
"copyfiles": "^2.1.1",
|
|
61
62
|
"inquirer": "^7.0.1",
|
|
62
|
-
"n8n-core": "~0.
|
|
63
|
-
"n8n-workflow": "~0.
|
|
63
|
+
"n8n-core": "~0.82.0",
|
|
64
|
+
"n8n-workflow": "~0.67.0",
|
|
64
65
|
"oauth-1.0a": "^2.2.6",
|
|
65
66
|
"replace-in-file": "^6.0.0",
|
|
66
67
|
"request": "^2.88.2",
|
|
67
|
-
"tmp-promise": "^
|
|
68
|
-
"typescript": "~3.
|
|
68
|
+
"tmp-promise": "^3.0.2",
|
|
69
|
+
"typescript": "~4.3.5"
|
|
69
70
|
}
|
|
70
71
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ICredentialType,
|
|
3
|
-
NodePropertyTypes,
|
|
4
|
-
} from 'n8n-workflow';
|
|
5
|
-
|
|
1
|
+
import { ICredentialType, NodePropertyTypes } from 'n8n-workflow';
|
|
6
2
|
|
|
7
3
|
export class ClassNameReplace implements ICredentialType {
|
|
8
4
|
name = 'N8nNameReplace';
|
|
5
|
+
|
|
9
6
|
displayName = 'DisplayNameReplace';
|
|
7
|
+
|
|
10
8
|
properties = [
|
|
11
9
|
// The credentials to get from user and save encrypted.
|
|
12
10
|
// Properties can be defined exactly in the same way
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { IExecuteFunctions } from 'n8n-core';
|
|
2
|
-
import {
|
|
3
|
-
INodeExecutionData,
|
|
4
|
-
INodeType,
|
|
5
|
-
INodeTypeDescription,
|
|
6
|
-
} from 'n8n-workflow';
|
|
7
|
-
|
|
2
|
+
import { INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
8
3
|
|
|
9
4
|
export class ClassNameReplace implements INodeType {
|
|
10
5
|
description: INodeTypeDescription = {
|
|
@@ -29,13 +24,11 @@ export class ClassNameReplace implements INodeType {
|
|
|
29
24
|
default: '',
|
|
30
25
|
placeholder: 'Placeholder value',
|
|
31
26
|
description: 'The description text',
|
|
32
|
-
}
|
|
33
|
-
]
|
|
27
|
+
},
|
|
28
|
+
],
|
|
34
29
|
};
|
|
35
30
|
|
|
36
|
-
|
|
37
31
|
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
38
|
-
|
|
39
32
|
const items = this.getInputData();
|
|
40
33
|
|
|
41
34
|
let item: INodeExecutionData;
|
|
@@ -48,10 +41,9 @@ export class ClassNameReplace implements INodeType {
|
|
|
48
41
|
myString = this.getNodeParameter('myString', itemIndex, '') as string;
|
|
49
42
|
item = items[itemIndex];
|
|
50
43
|
|
|
51
|
-
item.json
|
|
44
|
+
item.json.myString = myString;
|
|
52
45
|
}
|
|
53
46
|
|
|
54
47
|
return this.prepareOutputData(items);
|
|
55
|
-
|
|
56
48
|
}
|
|
57
49
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { ITriggerFunctions } from 'n8n-core';
|
|
2
|
-
import {
|
|
3
|
-
INodeType,
|
|
4
|
-
INodeTypeDescription,
|
|
5
|
-
ITriggerResponse,
|
|
6
|
-
} from 'n8n-workflow';
|
|
7
|
-
|
|
2
|
+
import { INodeType, INodeTypeDescription, ITriggerResponse } from 'n8n-workflow';
|
|
8
3
|
|
|
9
4
|
export class ClassNameReplace implements INodeType {
|
|
10
5
|
description: INodeTypeDescription = {
|
|
@@ -32,12 +27,10 @@ export class ClassNameReplace implements INodeType {
|
|
|
32
27
|
default: 1,
|
|
33
28
|
description: 'Every how many minutes the workflow should be triggered.',
|
|
34
29
|
},
|
|
35
|
-
]
|
|
30
|
+
],
|
|
36
31
|
};
|
|
37
32
|
|
|
38
|
-
|
|
39
33
|
async trigger(this: ITriggerFunctions): Promise<ITriggerResponse> {
|
|
40
|
-
|
|
41
34
|
const interval = this.getNodeParameter('interval', 1) as number;
|
|
42
35
|
|
|
43
36
|
if (interval <= 0) {
|
|
@@ -48,7 +41,7 @@ export class ClassNameReplace implements INodeType {
|
|
|
48
41
|
// Every time the emit function gets called a new workflow
|
|
49
42
|
// executions gets started with the provided entries.
|
|
50
43
|
const entry = {
|
|
51
|
-
|
|
44
|
+
exampleKey: 'exampleData',
|
|
52
45
|
};
|
|
53
46
|
this.emit([this.helpers.returnJsonArray([entry])]);
|
|
54
47
|
};
|
|
@@ -78,6 +71,5 @@ export class ClassNameReplace implements INodeType {
|
|
|
78
71
|
closeFunction,
|
|
79
72
|
manualTriggerFunction,
|
|
80
73
|
};
|
|
81
|
-
|
|
82
74
|
}
|
|
83
75
|
}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IWebhookFunctions,
|
|
3
|
-
} from 'n8n-core';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
IDataObject,
|
|
7
|
-
INodeTypeDescription,
|
|
8
|
-
INodeType,
|
|
9
|
-
IWebhookResponseData,
|
|
10
|
-
} from 'n8n-workflow';
|
|
1
|
+
import { IWebhookFunctions } from 'n8n-core';
|
|
11
2
|
|
|
3
|
+
import { IDataObject, INodeTypeDescription, INodeType, IWebhookResponseData } from 'n8n-workflow';
|
|
12
4
|
|
|
13
5
|
export class ClassNameReplace implements INodeType {
|
|
14
6
|
description: INodeTypeDescription = {
|
|
@@ -47,25 +39,18 @@ export class ClassNameReplace implements INodeType {
|
|
|
47
39
|
],
|
|
48
40
|
};
|
|
49
41
|
|
|
50
|
-
|
|
51
42
|
async webhook(this: IWebhookFunctions): Promise<IWebhookResponseData> {
|
|
52
|
-
|
|
53
43
|
// The data to return and so start the workflow with
|
|
54
44
|
const returnData: IDataObject[] = [];
|
|
55
|
-
returnData.push(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
);
|
|
45
|
+
returnData.push({
|
|
46
|
+
headers: this.getHeaderData(),
|
|
47
|
+
params: this.getParamsData(),
|
|
48
|
+
query: this.getQueryData(),
|
|
49
|
+
body: this.getBodyData(),
|
|
50
|
+
});
|
|
63
51
|
|
|
64
52
|
return {
|
|
65
|
-
workflowData: [
|
|
66
|
-
this.helpers.returnJsonArray(returnData)
|
|
67
|
-
],
|
|
53
|
+
workflowData: [this.helpers.returnJsonArray(returnData)],
|
|
68
54
|
};
|
|
69
|
-
|
|
70
55
|
}
|
|
71
56
|
}
|