mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
n8n-3867-progressively-apply-prettier-to-all (#3873)
* 🔨 formatting nodes with prettier
This commit is contained in:
@@ -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)];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user