mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
Merge branch 'master' into Dropbox-OAuth2-Support
This commit is contained in:
commit
dc6cf5b9a7
|
@ -97,24 +97,28 @@ class LoadNodesAndCredentialsClass {
|
|||
* @memberof LoadNodesAndCredentialsClass
|
||||
*/
|
||||
async getN8nNodePackages(): Promise<string[]> {
|
||||
const packages: string[] = [];
|
||||
for (const file of await fsReaddirAsync(this.nodeModulesPath)) {
|
||||
if (file.indexOf('n8n-nodes-') !== 0) {
|
||||
continue;
|
||||
const getN8nNodePackagesRecursive = async (relativePath: string): Promise<string[]> => {
|
||||
const results: string[] = [];
|
||||
const nodeModulesPath = `${this.nodeModulesPath}/${relativePath}`;
|
||||
for (const file of await fsReaddirAsync(nodeModulesPath)) {
|
||||
const isN8nNodesPackage = file.indexOf('n8n-nodes-') === 0;
|
||||
const isNpmScopedPackage = file.indexOf('@') === 0;
|
||||
if (!isN8nNodesPackage && !isNpmScopedPackage) {
|
||||
continue;
|
||||
}
|
||||
if (!(await fsStatAsync(nodeModulesPath)).isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
if (isN8nNodesPackage) { results.push(`${relativePath}${file}`); }
|
||||
if (isNpmScopedPackage) {
|
||||
results.push(...await getN8nNodePackagesRecursive(`${relativePath}${file}/`));
|
||||
}
|
||||
}
|
||||
|
||||
// Check if it is really a folder
|
||||
if (!(await fsStatAsync(path.join(this.nodeModulesPath, file))).isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
packages.push(file);
|
||||
}
|
||||
|
||||
return packages;
|
||||
return results;
|
||||
};
|
||||
return getN8nNodePackagesRecursive('');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads credentials from a file
|
||||
*
|
||||
|
|
|
@ -569,7 +569,7 @@ class App {
|
|||
|
||||
const nodeTypes = NodeTypes();
|
||||
|
||||
const loadDataInstance = new LoadNodeParameterOptions(nodeType, nodeTypes, JSON.parse('' + req.query.currentNodeParameters), credentials);
|
||||
const loadDataInstance = new LoadNodeParameterOptions(nodeType, nodeTypes, credentials!);
|
||||
|
||||
const workflowData = loadDataInstance.getWorkflowData() as IWorkflowBase;
|
||||
const workflowCredentials = await WorkflowCredentials(workflowData.nodes);
|
||||
|
@ -603,8 +603,8 @@ class App {
|
|||
|
||||
|
||||
// Returns the node icon
|
||||
this.app.get('/rest/node-icon/:nodeType', async (req: express.Request, res: express.Response): Promise<void> => {
|
||||
const nodeTypeName = req.params.nodeType;
|
||||
this.app.get(['/rest/node-icon/:nodeType', '/rest/node-icon/:scope/:nodeType'], async (req: express.Request, res: express.Response): Promise<void> => {
|
||||
const nodeTypeName = `${req.params.scope ? `${req.params.scope}/` : ''}${req.params.nodeType}`;
|
||||
|
||||
const nodeTypes = NodeTypes();
|
||||
const nodeType = nodeTypes.getByName(nodeTypeName);
|
||||
|
|
|
@ -246,7 +246,7 @@ export class GraphQL implements INodeType {
|
|||
}
|
||||
}
|
||||
if (requestOptions.body.operationName === '') {
|
||||
requestOptions.body.operation = null;
|
||||
requestOptions.body.operationName = null;
|
||||
}
|
||||
requestOptions.json = true;
|
||||
} else {
|
||||
|
|
|
@ -32,7 +32,7 @@ export class Switch implements INodeType {
|
|||
{
|
||||
name: 'Expression',
|
||||
value: 'expression',
|
||||
description: 'Expression decides how to route date.',
|
||||
description: 'Expression decides how to route data.',
|
||||
},
|
||||
{
|
||||
name: 'Rules',
|
||||
|
|
Loading…
Reference in a new issue