Files
n8n-enterprise-unlocked/packages/nodes-base/nodes/SecurityScorecard/descriptions/CompanyDescription.ts
Iván Ovejero b03e358a12 refactor: Integrate consistent-type-imports in nodes-base (no-changelog) (#5267)
* 👕 Enable `consistent-type-imports` for nodes-base

* 👕 Apply to nodes-base

*  Undo unrelated changes

* 🚚 Move to `.eslintrc.js` in nodes-base

*  Revert "Enable `consistent-type-imports` for nodes-base"

This reverts commit 529ad72b051478fa1633aaf84b2864f2fdc7613c.

* 👕 Fix severity
2023-01-27 12:22:44 +01:00

216 lines
4.4 KiB
TypeScript

import type { INodeProperties } from 'n8n-workflow';
export const companyOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
required: true,
displayOptions: {
show: {
resource: ['company'],
},
},
options: [
{
name: 'Get Factor Scores',
value: 'getFactor',
description: 'Get company factor scores and issue counts',
action: 'Get a company factor scores and issue counts',
},
{
name: 'Get Historical Factor Scores',
value: 'getFactorHistorical',
description: "Get company's historical factor scores",
action: "Get a company's historical factor scores",
},
{
name: 'Get Historical Scores',
value: 'getHistoricalScore',
description: "Get company's historical scores",
action: "Get a company's historical scores",
},
{
name: 'Get Information and Scorecard',
value: 'getScorecard',
description: 'Get company information and summary of their scorecard',
action: 'Get company information and a summary of their scorecard',
},
{
name: 'Get Score Plan',
value: 'getScorePlan',
description: "Get company's score improvement plan",
action: "Get a company's score improvement plan",
},
],
default: 'getFactor',
},
];
export const companyFields: INodeProperties[] = [
{
displayName: 'Scorecard Identifier',
name: 'scorecardIdentifier',
description: 'Primary identifier of a company or scorecard, i.e. domain.',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['company'],
operation: [
'getScorecard',
'getFactor',
'getFactorHistorical',
'getHistoricalScore',
'getScorePlan',
],
},
},
},
{
displayName: 'Score',
name: 'score',
description: 'Score target',
type: 'number',
displayOptions: {
show: {
resource: ['company'],
operation: ['getScorePlan'],
},
},
required: true,
default: 0,
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['company'],
operation: ['getFactor', 'getFactorHistorical', 'getHistoricalScore', 'getScorePlan'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['company'],
operation: ['getFactor', 'getFactorHistorical', 'getHistoricalScore', 'getScorePlan'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 100,
},
default: 100,
description: 'Max number of results to return',
},
{
displayName: 'Simplify',
name: 'simple',
type: 'boolean',
displayOptions: {
show: {
resource: ['company'],
operation: ['getFactorHistorical', 'getHistoricalScore'],
},
},
default: true,
description: 'Whether to return a simplified version of the response instead of the raw data',
},
// company:getFactor
{
displayName: 'Filters',
name: 'filters',
displayOptions: {
show: {
resource: ['company'],
operation: ['getFactor'],
},
},
type: 'collection',
placeholder: 'Add Filter',
default: {},
options: [
{
displayName: 'Severity',
name: 'severity',
type: 'string',
default: '',
placeholder: '',
},
{
displayName: 'Severity In',
description: 'Filter issues by comma-separated severity list',
name: 'severity_in',
type: 'string',
default: '',
placeholder: '',
},
],
},
// company:getFactorHistorical
// company:getHistoricalScore
{
displayName: 'Options',
name: 'options',
displayOptions: {
show: {
resource: ['company'],
operation: ['getFactorHistorical', 'getHistoricalScore'],
},
},
type: 'collection',
placeholder: 'Add Option',
default: {},
options: [
{
displayName: 'Date From',
description: 'History start date',
name: 'date_from',
type: 'dateTime',
default: '',
},
{
displayName: 'Date To',
description: 'History end date',
name: 'date_to',
type: 'dateTime',
default: '',
},
{
displayName: 'Timing',
description: 'Date granularity',
name: 'timing',
type: 'options',
options: [
{
name: 'Daily',
value: 'daily',
},
{
name: 'Weekly',
value: 'weekly',
},
{
name: 'Monthly',
value: 'monthly',
},
],
default: 'daily',
},
],
},
];