2022-08-17 08:50:24 -07:00
import { INodeProperties } from 'n8n-workflow' ;
2021-09-30 09:58:30 -07:00
export const scanOperations : INodeProperties [ ] = [
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
noDataExpression : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'scan' ] ,
2021-09-30 09:58:30 -07:00
} ,
} ,
options : [
{
name : 'Get' ,
value : 'get' ,
2022-07-10 13:50:51 -07:00
action : 'Get a scan' ,
2021-09-30 09:58:30 -07:00
} ,
{
name : 'Get All' ,
value : 'getAll' ,
2022-07-10 13:50:51 -07:00
action : 'Get all scans' ,
2021-09-30 09:58:30 -07:00
} ,
{
name : 'Perform' ,
value : 'perform' ,
2022-07-10 13:50:51 -07:00
action : 'Perform a scan' ,
2021-09-30 09:58:30 -07:00
} ,
] ,
default : 'perform' ,
} ,
] ;
export const scanFields : INodeProperties [ ] = [
// ----------------------------------------
// scan: get
// ----------------------------------------
{
displayName : 'Scan ID' ,
name : 'scanId' ,
type : 'string' ,
default : '' ,
description : 'ID of the scan to retrieve' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'scan' ] ,
operation : [ 'get' ] ,
2021-09-30 09:58:30 -07:00
} ,
} ,
} ,
// ----------------------------------------
// scan: getAll
// ----------------------------------------
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
default : false ,
description : 'Whether to return all results or only up to a given limit' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'scan' ] ,
operation : [ 'getAll' ] ,
2021-09-30 09:58:30 -07:00
} ,
} ,
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
default : 50 ,
description : 'Max number of results to return' ,
typeOptions : {
minValue : 1 ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'scan' ] ,
operation : [ 'getAll' ] ,
returnAll : [ false ] ,
2021-09-30 09:58:30 -07:00
} ,
} ,
} ,
{
displayName : 'Filters' ,
name : 'filters' ,
type : 'collection' ,
placeholder : 'Add Filter' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'scan' ] ,
operation : [ 'getAll' ] ,
2021-09-30 09:58:30 -07:00
} ,
} ,
options : [
{
displayName : 'Query' ,
name : 'query' ,
type : 'string' ,
2022-08-17 08:50:24 -07:00
description :
'Query using the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-dsl-query-string-query">Elastic Search Query String syntax</a>. See <a href="https://urlscan.io/docs/search/">supported fields</a> in the documentation.' ,
2021-09-30 09:58:30 -07:00
default : '' ,
placeholder : 'domain:n8n.io' ,
} ,
] ,
} ,
// ----------------------------------------
// scan: perform
// ----------------------------------------
{
displayName : 'URL' ,
name : 'url' ,
type : 'string' ,
default : '' ,
placeholder : 'https://n8n.io' ,
description : 'URL to scan' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'scan' ] ,
operation : [ 'perform' ] ,
2021-09-30 09:58:30 -07:00
} ,
} ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'scan' ] ,
operation : [ 'perform' ] ,
2021-09-30 09:58:30 -07:00
} ,
} ,
options : [
{
displayName : 'Custom Agent' ,
name : 'customAgent' ,
2022-08-17 08:50:24 -07:00
description :
'<code>User-Agent</code> header to set for this scan. Defaults to <code>n8n</code>' ,
2021-09-30 09:58:30 -07:00
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Override Safety' ,
name : 'overrideSafety' ,
description : 'Disable reclassification of URLs with potential PII in them' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Referer' ,
name : 'referer' ,
description : 'HTTP referer to set for this scan' ,
type : 'string' ,
2021-10-01 07:21:28 -07:00
placeholder : 'https://n8n.io' ,
2021-09-30 09:58:30 -07:00
default : '' ,
} ,
{
displayName : 'Tags' ,
name : 'tags' ,
2022-08-17 08:50:24 -07:00
description :
'Comma-separated list of user-defined tags to add to this scan. Limited to 10 tags.' ,
2021-09-30 09:58:30 -07:00
placeholder : 'phishing, malicious' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Visibility' ,
name : 'visibility' ,
type : 'options' ,
default : 'private' ,
options : [
{
name : 'Private' ,
value : 'private' ,
} ,
{
name : 'Public' ,
value : 'public' ,
} ,
{
name : 'Unlisted' ,
value : 'unlisted' ,
} ,
] ,
} ,
] ,
} ,
] ;