diff --git a/nodes/DependencyAnalytics/DependencyAnalytics.node.ts b/nodes/DependencyAnalytics/DependencyAnalytics.node.ts index 75caa75..b51b775 100644 --- a/nodes/DependencyAnalytics/DependencyAnalytics.node.ts +++ b/nodes/DependencyAnalytics/DependencyAnalytics.node.ts @@ -47,13 +47,6 @@ export class DependencyAnalytics implements INodeType { outputs: [NodeConnectionType.Main], usableAsTool: true, credentials: credentials, - requestDefaults: { - baseURL: 'https://rhtpa.stage.redhat.com/api/v2/', - headers: { - Accept: 'application/json', - 'Content-Type': 'application/json', - }, - }, properties, }; diff --git a/nodes/DependencyAnalytics/DependencyAnalytics.spec.ts b/nodes/DependencyAnalytics/DependencyAnalytics.spec.ts index b4dc955..c2abb23 100644 --- a/nodes/DependencyAnalytics/DependencyAnalytics.spec.ts +++ b/nodes/DependencyAnalytics/DependencyAnalytics.spec.ts @@ -22,6 +22,7 @@ test('It contains all expected displayNames in properties', () => { 'Base URL', 'Resource', 'Identifier', + 'Identifier', 'Limit', 'Output', 'Selected Fields', diff --git a/nodes/DependencyAnalytics/actions/advisory.ts b/nodes/DependencyAnalytics/actions/advisory.ts index 19d8fd9..3e544b8 100644 --- a/nodes/DependencyAnalytics/actions/advisory.ts +++ b/nodes/DependencyAnalytics/actions/advisory.ts @@ -8,7 +8,7 @@ import { shapeOutput } from '../utils/output'; export async function get({ ctx, itemIndex }: { ctx: IExecuteFunctions; itemIndex: number }) { const credentialName = chooseCredential(ctx, itemIndex); const base = getBase(ctx, itemIndex); - const identifierRaw = (ctx.getNodeParameter('identifier', itemIndex, '') as string).trim(); + const identifierRaw = (ctx.getNodeParameter('identifierSha', itemIndex, '') as string).trim(); if (!identifierRaw) throwError(ctx.getNode(), "The 'Identifier' parameter is required.", itemIndex); diff --git a/nodes/DependencyAnalytics/actions/sbom.ts b/nodes/DependencyAnalytics/actions/sbom.ts index b511077..7a004bc 100644 --- a/nodes/DependencyAnalytics/actions/sbom.ts +++ b/nodes/DependencyAnalytics/actions/sbom.ts @@ -8,7 +8,7 @@ import { shapeOutput } from '../utils/output'; export async function get({ ctx, itemIndex }: { ctx: IExecuteFunctions; itemIndex: number }) { const credentialName = chooseCredential(ctx, itemIndex); const base = getBase(ctx, itemIndex); - const identifierRaw = (ctx.getNodeParameter('identifier', itemIndex, '') as string).trim(); + const identifierRaw = (ctx.getNodeParameter('identifierSha', itemIndex, '') as string).trim(); if (!identifierRaw) throwError(ctx.getNode(), "The 'Identifier' parameter is required.", itemIndex); diff --git a/nodes/DependencyAnalytics/actions/vulnerability.ts b/nodes/DependencyAnalytics/actions/vulnerability.ts index 5cfabd8..6c57dc7 100644 --- a/nodes/DependencyAnalytics/actions/vulnerability.ts +++ b/nodes/DependencyAnalytics/actions/vulnerability.ts @@ -9,7 +9,7 @@ import { shapeOutput } from '../utils/output'; export async function get({ ctx, itemIndex }: { ctx: IExecuteFunctions; itemIndex: number }) { const credentialName = chooseCredential(ctx, itemIndex); const base = getBase(ctx, itemIndex); - const identifierRaw = (ctx.getNodeParameter('identifier', itemIndex, '') as string).trim(); + const identifierRaw = (ctx.getNodeParameter('identifierCve', itemIndex, '') as string).trim(); if (!identifierRaw) throwError(ctx.getNode(), "The 'Identifier' parameter is required.", itemIndex); diff --git a/nodes/DependencyAnalytics/descriptions/common.properties.ts b/nodes/DependencyAnalytics/descriptions/common.properties.ts index 8ab79cc..8fe7e36 100644 --- a/nodes/DependencyAnalytics/descriptions/common.properties.ts +++ b/nodes/DependencyAnalytics/descriptions/common.properties.ts @@ -45,14 +45,26 @@ export const commonProperties: INodeProperties[] = [ // common “get” param { displayName: 'Identifier', - name: 'identifier', + name: 'identifierCve', + type: 'string', + required: true, + default: '', + description: 'Vulnerability identifier (CVE)', + placeholder: 'e.g. CVE-2024-1234', + displayOptions: { + show: { operation: ['get'], resource: ['vulnerability'] }, + }, + }, + { + displayName: 'Identifier', + name: 'identifierSha', type: 'string', required: true, default: '', description: 'SHA ID (sha256|sha384|sha512) or a normalized identifier', - placeholder: 'e.g. sha256:3a7bd3e2360a3d…, CVE-2024-1234', + placeholder: 'e.g. sha256:3a7bd3…, sha384:…, or sha512:…', displayOptions: { - show: { operation: ['get'], resource: ['sbom', 'vulnerability', 'advisory'] }, + show: { operation: ['get'], resource: ['sbom', 'advisory'] }, }, },