n8n-3867-progressively-apply-prettier-to-all (#3873)

* 🔨 formatting nodes with prettier
This commit is contained in:
Michael Kret
2022-08-17 18:50:24 +03:00
committed by GitHub
parent f2d326c7f0
commit 91d7e16c81
1072 changed files with 42357 additions and 59109 deletions

View File

@@ -74,12 +74,8 @@ export class Rundeck implements INodeType {
type: 'string',
displayOptions: {
show: {
operation: [
'execute',
],
resource: [
'job',
],
operation: ['execute'],
resource: ['job'],
},
},
default: '',
@@ -97,12 +93,8 @@ export class Rundeck implements INodeType {
},
displayOptions: {
show: {
operation: [
'execute',
],
resource: [
'job',
],
operation: ['execute'],
resource: ['job'],
},
},
default: {},
@@ -128,7 +120,6 @@ export class Rundeck implements INodeType {
],
},
// ----------------------------------
// job:getMetadata
// ----------------------------------
@@ -138,12 +129,8 @@ export class Rundeck implements INodeType {
type: 'string',
displayOptions: {
show: {
operation: [
'getMetadata',
],
resource: [
'job',
],
operation: ['getMetadata'],
resource: ['job'],
},
},
default: '',
@@ -152,12 +139,9 @@ export class Rundeck implements INodeType {
description: 'The job ID to get metadata off',
},
],
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
// Input data
const items = this.getInputData();
const returnData: IDataObject[] = [];
@@ -168,16 +152,15 @@ export class Rundeck implements INodeType {
const rundeckApi = new RundeckApi(this);
await rundeckApi.init();
for (let i = 0; i < length; i++) {
if (resource === 'job') {
if (operation === 'execute') {
// ----------------------------------
// job: execute
// ----------------------------------
const jobid = this.getNodeParameter('jobid', i) as string;
const rundeckArguments = (this.getNodeParameter('arguments', i) as IDataObject).arguments as IDataObject[];
const rundeckArguments = (this.getNodeParameter('arguments', i) as IDataObject)
.arguments as IDataObject[];
const response = await rundeckApi.executeJob(jobid, rundeckArguments);
returnData.push(response);
@@ -190,14 +173,21 @@ export class Rundeck implements INodeType {
returnData.push(response);
} else {
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not supported!`, { itemIndex: i });
throw new NodeOperationError(
this.getNode(),
`The operation "${operation}" is not supported!`,
{ itemIndex: i },
);
}
} else {
throw new NodeOperationError(this.getNode(), `The resource "${resource}" is not supported!`, { itemIndex: i });
throw new NodeOperationError(
this.getNode(),
`The resource "${resource}" is not supported!`,
{ itemIndex: i },
);
}
}
return [this.helpers.returnJsonArray(returnData)];
}
}