Add MS Graph Security node (#2307)

*  Create MS Graph Security node

*  General update

* 📦 Update package-lock.json

* 👕 Fix lint

* 🔥 Remove Reviewed field

*  Set max limit to 1000

*  Add limit to 1000 to second resource
This commit is contained in:
Iván Ovejero
2022-01-08 10:53:10 +01:00
committed by GitHub
parent 8e708f3d3d
commit 77a05976ec
8 changed files with 762 additions and 1 deletions

View File

@@ -0,0 +1,230 @@
import {
INodeProperties,
} from 'n8n-workflow';
export const secureScoreControlProfileOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: [
'secureScoreControlProfile',
],
},
},
options: [
{
name: 'Get',
value: 'get',
},
{
name: 'Get All',
value: 'getAll',
},
{
name: 'Update',
value: 'update',
},
],
default: 'get',
},
];
export const secureScoreControlProfileFields: INodeProperties[] = [
// ----------------------------------------
// secureScore: get
// ----------------------------------------
{
displayName: 'Secure Score Control Profile ID',
name: 'secureScoreControlProfileId',
description: 'ID of the secure score control profile to retrieve',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'secureScoreControlProfile',
],
operation: [
'get',
],
},
},
},
// ----------------------------------------
// secureScoreControlProfile: 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: {
resource: [
'secureScoreControlProfile',
],
operation: [
'getAll',
],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
default: 50,
description: 'Max number of results to return',
typeOptions: {
minValue: 1,
maxValue: 1000,
},
displayOptions: {
show: {
resource: [
'secureScoreControlProfile',
],
operation: [
'getAll',
],
returnAll: [
false,
],
},
},
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
default: {},
placeholder: 'Add Filter',
displayOptions: {
show: {
resource: [
'secureScoreControlProfile',
],
operation: [
'getAll',
],
},
},
options: [
{
displayName: 'Filter Query Parameter',
name: 'filter',
description: '<a href="https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter">Query parameter</a> to filter results by',
type: 'string',
default: '',
placeholder: 'startsWith(id, \'AATP\')',
},
],
},
// ----------------------------------------
// secureScoreControlProfile: update
// ----------------------------------------
{
displayName: 'Secure Score Control Profile ID',
name: 'secureScoreControlProfileId',
description: 'ID of the secure score control profile to update',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'secureScoreControlProfile',
],
operation: [
'update',
],
},
},
},
{
displayName: 'Provider',
name: 'provider',
type: 'string',
description: 'Name of the provider of the security product or service',
default: '',
placeholder: 'SecureScore',
required: true,
displayOptions: {
show: {
resource: [
'secureScoreControlProfile',
],
operation: [
'update',
],
},
},
},
{
displayName: 'Vendor',
name: 'vendor',
type: 'string',
description: 'Name of the vendor of the security product or service',
default: '',
placeholder: 'Microsoft',
required: true,
displayOptions: {
show: {
resource: [
'secureScoreControlProfile',
],
operation: [
'update',
],
},
},
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'secureScoreControlProfile',
],
operation: [
'update',
],
},
},
options: [
{
displayName: 'State',
name: 'state',
type: 'options',
default: 'Default',
description: 'Analyst driven setting on the control',
options: [
{
name: 'Default',
value: 'Default',
},
{
name: 'Ignored',
value: 'Ignored',
},
{
name: 'Third Party',
value: 'ThirdParty',
},
],
},
],
},
];

View File

@@ -0,0 +1,132 @@
import {
INodeProperties,
} from 'n8n-workflow';
export const secureScoreOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: [
'secureScore',
],
},
},
options: [
{
name: 'Get',
value: 'get',
},
{
name: 'Get All',
value: 'getAll',
},
],
default: 'get',
},
];
export const secureScoreFields: INodeProperties[] = [
// ----------------------------------------
// secureScore: get
// ----------------------------------------
{
displayName: 'Secure Score ID',
name: 'secureScoreId',
description: 'ID of the secure score to retrieve',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'secureScore',
],
operation: [
'get',
],
},
},
},
// ----------------------------------------
// secureScore: 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: {
resource: [
'secureScore',
],
operation: [
'getAll',
],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
default: 50,
description: 'Max number of results to return',
typeOptions: {
minValue: 1,
maxValue: 1000,
},
displayOptions: {
show: {
resource: [
'secureScore',
],
operation: [
'getAll',
],
returnAll: [
false,
],
},
},
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
default: {},
placeholder: 'Add Filter',
displayOptions: {
show: {
resource: [
'secureScore',
],
operation: [
'getAll',
],
},
},
options: [
{
displayName: 'Filter Query Parameter',
name: 'filter',
description: '<a href="https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter">Query parameter</a> to filter results by',
type: 'string',
default: '',
placeholder: 'currentScore eq 13',
},
{
displayName: 'Include Control Scores',
name: 'includeControlScores',
type: 'boolean',
default: false,
},
],
},
];

View File

@@ -0,0 +1,2 @@
export * from './SecureScoreDescription';
export * from './SecureScoreControlProfileDescription';