Add missing resources to CLI, MCP, and n8n surfaces
Audit all three API surfaces against the console GraphQL schema and add missing resources: asset, audit, datum, dpia, evidence upload, measure, obligation, processing activity, rights request, snapshot, task, tia, trust center (with references/files), and vendor management CLI commands; MCP tools for deletes, rights requests, trust center, vendor contacts/services, and compliance external URLs; n8n nodes for obligation, finding, task, evidence, processing activity, dpia, tia, rights request, snapshot, audit log, access review, organization context, trust center, and additional control/measure/vendor operations. Include MCP e2e test infrastructure (testutil MCP client with API key auth and JSON-RPC session management) and tests covering all new MCP tools. Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -0,0 +1,272 @@
|
||||
// Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { proboApiRequest } from '../../GenericFunctions';
|
||||
|
||||
export const description: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Organization ID',
|
||||
name: 'organizationId',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The ID of the organization',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Kind',
|
||||
name: 'kind',
|
||||
type: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Minor Nonconformity',
|
||||
value: 'MINOR_NONCONFORMITY',
|
||||
},
|
||||
{
|
||||
name: 'Major Nonconformity',
|
||||
value: 'MAJOR_NONCONFORMITY',
|
||||
},
|
||||
{
|
||||
name: 'Observation',
|
||||
value: 'OBSERVATION',
|
||||
},
|
||||
{
|
||||
name: 'Exception',
|
||||
value: 'EXCEPTION',
|
||||
},
|
||||
],
|
||||
default: 'MINOR_NONCONFORMITY',
|
||||
description: 'The kind of finding',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The description of the finding',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Corrective Action',
|
||||
name: 'correctiveAction',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The corrective action for the finding',
|
||||
},
|
||||
{
|
||||
displayName: 'Due Date',
|
||||
name: 'dueDate',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The due date for the finding (ISO 8601 format)',
|
||||
},
|
||||
{
|
||||
displayName: 'Effectiveness Check',
|
||||
name: 'effectivenessCheck',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The effectiveness check for the finding',
|
||||
},
|
||||
{
|
||||
displayName: 'Identified On',
|
||||
name: 'identifiedOn',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The date the finding was identified (ISO 8601 format)',
|
||||
},
|
||||
{
|
||||
displayName: 'Owner ID',
|
||||
name: 'ownerId',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The ID of the person who owns this finding',
|
||||
},
|
||||
{
|
||||
displayName: 'Priority',
|
||||
name: 'priority',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Low',
|
||||
value: 'LOW',
|
||||
},
|
||||
{
|
||||
name: 'Medium',
|
||||
value: 'MEDIUM',
|
||||
},
|
||||
{
|
||||
name: 'High',
|
||||
value: 'HIGH',
|
||||
},
|
||||
],
|
||||
default: 'MEDIUM',
|
||||
description: 'The priority of the finding',
|
||||
},
|
||||
{
|
||||
displayName: 'Risk ID',
|
||||
name: 'riskId',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The ID of the associated risk',
|
||||
},
|
||||
{
|
||||
displayName: 'Root Cause',
|
||||
name: 'rootCause',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The root cause of the finding',
|
||||
},
|
||||
{
|
||||
displayName: 'Source',
|
||||
name: 'source',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The source of the finding',
|
||||
},
|
||||
{
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Closed',
|
||||
value: 'CLOSED',
|
||||
},
|
||||
{
|
||||
name: 'False Positive',
|
||||
value: 'FALSE_POSITIVE',
|
||||
},
|
||||
{
|
||||
name: 'In Progress',
|
||||
value: 'IN_PROGRESS',
|
||||
},
|
||||
{
|
||||
name: 'Mitigated',
|
||||
value: 'MITIGATED',
|
||||
},
|
||||
{
|
||||
name: 'Open',
|
||||
value: 'OPEN',
|
||||
},
|
||||
{
|
||||
name: 'Risk Accepted',
|
||||
value: 'RISK_ACCEPTED',
|
||||
},
|
||||
],
|
||||
default: 'OPEN',
|
||||
description: 'The status of the finding',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export async function execute(
|
||||
this: IExecuteFunctions,
|
||||
itemIndex: number,
|
||||
): Promise<INodeExecutionData> {
|
||||
const organizationId = this.getNodeParameter('organizationId', itemIndex) as string;
|
||||
const kind = this.getNodeParameter('kind', itemIndex) as string;
|
||||
const description = this.getNodeParameter('description', itemIndex) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', itemIndex, {}) as {
|
||||
source?: string;
|
||||
identifiedOn?: string;
|
||||
rootCause?: string;
|
||||
correctiveAction?: string;
|
||||
ownerId?: string;
|
||||
dueDate?: string;
|
||||
status?: string;
|
||||
priority?: string;
|
||||
riskId?: string;
|
||||
effectivenessCheck?: string;
|
||||
};
|
||||
|
||||
const query = `
|
||||
mutation CreateFinding($input: CreateFindingInput!) {
|
||||
createFinding(input: $input) {
|
||||
findingEdge {
|
||||
node {
|
||||
id
|
||||
kind
|
||||
description
|
||||
source
|
||||
identifiedOn
|
||||
rootCause
|
||||
correctiveAction
|
||||
dueDate
|
||||
status
|
||||
priority
|
||||
effectivenessCheck
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const input: Record<string, unknown> = {
|
||||
organizationId,
|
||||
kind,
|
||||
description,
|
||||
};
|
||||
if (additionalFields.source) input.source = additionalFields.source;
|
||||
if (additionalFields.identifiedOn) input.identifiedOn = additionalFields.identifiedOn;
|
||||
if (additionalFields.rootCause) input.rootCause = additionalFields.rootCause;
|
||||
if (additionalFields.correctiveAction) input.correctiveAction = additionalFields.correctiveAction;
|
||||
if (additionalFields.ownerId) input.ownerId = additionalFields.ownerId;
|
||||
if (additionalFields.dueDate) input.dueDate = additionalFields.dueDate;
|
||||
if (additionalFields.status) input.status = additionalFields.status;
|
||||
if (additionalFields.priority) input.priority = additionalFields.priority;
|
||||
if (additionalFields.riskId) input.riskId = additionalFields.riskId;
|
||||
if (additionalFields.effectivenessCheck) input.effectivenessCheck = additionalFields.effectivenessCheck;
|
||||
|
||||
const responseData = await proboApiRequest.call(this, query, { input });
|
||||
|
||||
return {
|
||||
json: responseData,
|
||||
pairedItem: { item: itemIndex },
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
// Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { proboApiRequest } from '../../GenericFunctions';
|
||||
|
||||
export const description: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Finding ID',
|
||||
name: 'findingId',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['delete'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The ID of the finding to delete',
|
||||
required: true,
|
||||
},
|
||||
];
|
||||
|
||||
export async function execute(
|
||||
this: IExecuteFunctions,
|
||||
itemIndex: number,
|
||||
): Promise<INodeExecutionData> {
|
||||
const findingId = this.getNodeParameter('findingId', itemIndex) as string;
|
||||
|
||||
const query = `
|
||||
mutation DeleteFinding($input: DeleteFindingInput!) {
|
||||
deleteFinding(input: $input) {
|
||||
deletedFindingId
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const responseData = await proboApiRequest.call(this, query, { input: { findingId } });
|
||||
|
||||
return {
|
||||
json: responseData,
|
||||
pairedItem: { item: itemIndex },
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
// Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { proboApiRequest } from '../../GenericFunctions';
|
||||
|
||||
export const description: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Finding ID',
|
||||
name: 'findingId',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['get'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The ID of the finding',
|
||||
required: true,
|
||||
},
|
||||
];
|
||||
|
||||
export async function execute(
|
||||
this: IExecuteFunctions,
|
||||
itemIndex: number,
|
||||
): Promise<INodeExecutionData> {
|
||||
const findingId = this.getNodeParameter('findingId', itemIndex) as string;
|
||||
|
||||
const query = `
|
||||
query GetFinding($findingId: ID!) {
|
||||
node(id: $findingId) {
|
||||
... on Finding {
|
||||
id
|
||||
kind
|
||||
description
|
||||
source
|
||||
identifiedOn
|
||||
rootCause
|
||||
correctiveAction
|
||||
dueDate
|
||||
status
|
||||
priority
|
||||
effectivenessCheck
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const variables = {
|
||||
findingId,
|
||||
};
|
||||
|
||||
const responseData = await proboApiRequest.call(this, query, variables);
|
||||
|
||||
return {
|
||||
json: responseData,
|
||||
pairedItem: { item: itemIndex },
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
// Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
import type { INodeProperties, IExecuteFunctions, INodeExecutionData, IDataObject } from 'n8n-workflow';
|
||||
import { proboApiRequestAllItems } from '../../GenericFunctions';
|
||||
|
||||
export const description: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Organization ID',
|
||||
name: 'organizationId',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The ID of the organization',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['getAll'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
},
|
||||
default: 50,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
];
|
||||
|
||||
export async function execute(
|
||||
this: IExecuteFunctions,
|
||||
itemIndex: number,
|
||||
): Promise<INodeExecutionData> {
|
||||
const organizationId = this.getNodeParameter('organizationId', itemIndex) as string;
|
||||
const returnAll = this.getNodeParameter('returnAll', itemIndex) as boolean;
|
||||
const limit = this.getNodeParameter('limit', itemIndex, 50) as number;
|
||||
|
||||
const query = `
|
||||
query GetFindings($organizationId: ID!, $first: Int, $after: CursorKey) {
|
||||
node(id: $organizationId) {
|
||||
... on Organization {
|
||||
findings(first: $first, after: $after) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
kind
|
||||
description
|
||||
source
|
||||
identifiedOn
|
||||
rootCause
|
||||
correctiveAction
|
||||
dueDate
|
||||
status
|
||||
priority
|
||||
effectivenessCheck
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
endCursor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const findings = await proboApiRequestAllItems.call(
|
||||
this,
|
||||
query,
|
||||
{ organizationId },
|
||||
(response) => {
|
||||
const data = response?.data as IDataObject | undefined;
|
||||
const node = data?.node as IDataObject | undefined;
|
||||
return node?.findings as IDataObject | undefined;
|
||||
},
|
||||
returnAll,
|
||||
limit,
|
||||
);
|
||||
|
||||
return {
|
||||
json: { findings },
|
||||
pairedItem: { item: itemIndex },
|
||||
};
|
||||
}
|
||||
98
packages/n8n-node/nodes/Probo/actions/finding/index.ts
Normal file
98
packages/n8n-node/nodes/Probo/actions/finding/index.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
// Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import * as createOp from './create.operation';
|
||||
import * as updateOp from './update.operation';
|
||||
import * as deleteOp from './delete.operation';
|
||||
import * as getOp from './get.operation';
|
||||
import * as getAllOp from './getAll.operation';
|
||||
import * as linkAuditOp from './linkAudit.operation';
|
||||
import * as unlinkAuditOp from './unlinkAudit.operation';
|
||||
|
||||
export const description: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Create',
|
||||
value: 'create',
|
||||
description: 'Create a new finding',
|
||||
action: 'Create a finding',
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
description: 'Delete a finding',
|
||||
action: 'Delete a finding',
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Get a finding',
|
||||
action: 'Get a finding',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Get many findings',
|
||||
action: 'Get many findings',
|
||||
},
|
||||
{
|
||||
name: 'Link Audit',
|
||||
value: 'linkAudit',
|
||||
description: 'Link an audit to a finding',
|
||||
action: 'Link an audit to a finding',
|
||||
},
|
||||
{
|
||||
name: 'Unlink Audit',
|
||||
value: 'unlinkAudit',
|
||||
description: 'Unlink an audit from a finding',
|
||||
action: 'Unlink an audit from a finding',
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
value: 'update',
|
||||
description: 'Update an existing finding',
|
||||
action: 'Update a finding',
|
||||
},
|
||||
],
|
||||
default: 'create',
|
||||
},
|
||||
...createOp.description,
|
||||
...updateOp.description,
|
||||
...deleteOp.description,
|
||||
...getOp.description,
|
||||
...getAllOp.description,
|
||||
...linkAuditOp.description,
|
||||
...unlinkAuditOp.description,
|
||||
];
|
||||
|
||||
export {
|
||||
createOp as create,
|
||||
updateOp as update,
|
||||
deleteOp as delete,
|
||||
getOp as get,
|
||||
getAllOp as getAll,
|
||||
linkAuditOp as linkAudit,
|
||||
unlinkAuditOp as unlinkAudit,
|
||||
};
|
||||
@@ -0,0 +1,87 @@
|
||||
// Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { proboApiRequest } from '../../GenericFunctions';
|
||||
|
||||
export const description: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Finding ID',
|
||||
name: 'findingId',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['linkAudit'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The ID of the finding',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Audit ID',
|
||||
name: 'auditId',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['linkAudit'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The ID of the audit to link',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Reference ID',
|
||||
name: 'referenceId',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['linkAudit'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The reference ID for the mapping',
|
||||
required: true,
|
||||
},
|
||||
];
|
||||
|
||||
export async function execute(
|
||||
this: IExecuteFunctions,
|
||||
itemIndex: number,
|
||||
): Promise<INodeExecutionData> {
|
||||
const findingId = this.getNodeParameter('findingId', itemIndex) as string;
|
||||
const auditId = this.getNodeParameter('auditId', itemIndex) as string;
|
||||
const referenceId = this.getNodeParameter('referenceId', itemIndex) as string;
|
||||
|
||||
const query = `
|
||||
mutation CreateFindingAuditMapping($input: CreateFindingAuditMappingInput!) {
|
||||
createFindingAuditMapping(input: $input) {
|
||||
finding {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const responseData = await proboApiRequest.call(this, query, { input: { findingId, auditId, referenceId } });
|
||||
|
||||
return {
|
||||
json: responseData,
|
||||
pairedItem: { item: itemIndex },
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { proboApiRequest } from '../../GenericFunctions';
|
||||
|
||||
export const description: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Finding ID',
|
||||
name: 'findingId',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['unlinkAudit'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The ID of the finding',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Audit ID',
|
||||
name: 'auditId',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['unlinkAudit'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The ID of the audit to unlink',
|
||||
required: true,
|
||||
},
|
||||
];
|
||||
|
||||
export async function execute(
|
||||
this: IExecuteFunctions,
|
||||
itemIndex: number,
|
||||
): Promise<INodeExecutionData> {
|
||||
const findingId = this.getNodeParameter('findingId', itemIndex) as string;
|
||||
const auditId = this.getNodeParameter('auditId', itemIndex) as string;
|
||||
|
||||
const query = `
|
||||
mutation DeleteFindingAuditMapping($input: DeleteFindingAuditMappingInput!) {
|
||||
deleteFindingAuditMapping(input: $input) {
|
||||
finding {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const responseData = await proboApiRequest.call(this, query, { input: { findingId, auditId } });
|
||||
|
||||
return {
|
||||
json: responseData,
|
||||
pairedItem: { item: itemIndex },
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
// Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||
import { proboApiRequest } from '../../GenericFunctions';
|
||||
|
||||
export const description: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Finding ID',
|
||||
name: 'findingId',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The ID of the finding to update',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['finding'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Corrective Action',
|
||||
name: 'correctiveAction',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The corrective action for the finding',
|
||||
},
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The description of the finding',
|
||||
},
|
||||
{
|
||||
displayName: 'Due Date',
|
||||
name: 'dueDate',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The due date for the finding (ISO 8601 format)',
|
||||
},
|
||||
{
|
||||
displayName: 'Effectiveness Check',
|
||||
name: 'effectivenessCheck',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The effectiveness check for the finding',
|
||||
},
|
||||
{
|
||||
displayName: 'Identified On',
|
||||
name: 'identifiedOn',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The date the finding was identified (ISO 8601 format)',
|
||||
},
|
||||
{
|
||||
displayName: 'Owner ID',
|
||||
name: 'ownerId',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The ID of the person who owns this finding',
|
||||
},
|
||||
{
|
||||
displayName: 'Priority',
|
||||
name: 'priority',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: '(Unchanged)',
|
||||
value: '',
|
||||
},
|
||||
{
|
||||
name: 'Low',
|
||||
value: 'LOW',
|
||||
},
|
||||
{
|
||||
name: 'Medium',
|
||||
value: 'MEDIUM',
|
||||
},
|
||||
{
|
||||
name: 'High',
|
||||
value: 'HIGH',
|
||||
},
|
||||
],
|
||||
default: '',
|
||||
description: 'The priority of the finding',
|
||||
},
|
||||
{
|
||||
displayName: 'Risk ID',
|
||||
name: 'riskId',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The ID of the associated risk',
|
||||
},
|
||||
{
|
||||
displayName: 'Root Cause',
|
||||
name: 'rootCause',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The root cause of the finding',
|
||||
},
|
||||
{
|
||||
displayName: 'Source',
|
||||
name: 'source',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The source of the finding',
|
||||
},
|
||||
{
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: '(Unchanged)',
|
||||
value: '',
|
||||
},
|
||||
{
|
||||
name: 'Closed',
|
||||
value: 'CLOSED',
|
||||
},
|
||||
{
|
||||
name: 'False Positive',
|
||||
value: 'FALSE_POSITIVE',
|
||||
},
|
||||
{
|
||||
name: 'In Progress',
|
||||
value: 'IN_PROGRESS',
|
||||
},
|
||||
{
|
||||
name: 'Mitigated',
|
||||
value: 'MITIGATED',
|
||||
},
|
||||
{
|
||||
name: 'Open',
|
||||
value: 'OPEN',
|
||||
},
|
||||
{
|
||||
name: 'Risk Accepted',
|
||||
value: 'RISK_ACCEPTED',
|
||||
},
|
||||
],
|
||||
default: '',
|
||||
description: 'The status of the finding',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export async function execute(
|
||||
this: IExecuteFunctions,
|
||||
itemIndex: number,
|
||||
): Promise<INodeExecutionData> {
|
||||
const findingId = this.getNodeParameter('findingId', itemIndex) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', itemIndex, {}) as {
|
||||
description?: string;
|
||||
source?: string;
|
||||
identifiedOn?: string;
|
||||
rootCause?: string;
|
||||
correctiveAction?: string;
|
||||
ownerId?: string;
|
||||
dueDate?: string;
|
||||
status?: string;
|
||||
priority?: string;
|
||||
riskId?: string;
|
||||
effectivenessCheck?: string;
|
||||
};
|
||||
|
||||
const query = `
|
||||
mutation UpdateFinding($input: UpdateFindingInput!) {
|
||||
updateFinding(input: $input) {
|
||||
finding {
|
||||
id
|
||||
kind
|
||||
description
|
||||
source
|
||||
identifiedOn
|
||||
rootCause
|
||||
correctiveAction
|
||||
dueDate
|
||||
status
|
||||
priority
|
||||
effectivenessCheck
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const input: Record<string, unknown> = { id: findingId };
|
||||
if (additionalFields.description !== undefined) input.description = additionalFields.description === '' ? null : additionalFields.description;
|
||||
if (additionalFields.source !== undefined) input.source = additionalFields.source === '' ? null : additionalFields.source;
|
||||
if (additionalFields.identifiedOn !== undefined) input.identifiedOn = additionalFields.identifiedOn === '' ? null : additionalFields.identifiedOn;
|
||||
if (additionalFields.rootCause !== undefined) input.rootCause = additionalFields.rootCause === '' ? null : additionalFields.rootCause;
|
||||
if (additionalFields.correctiveAction !== undefined) input.correctiveAction = additionalFields.correctiveAction === '' ? null : additionalFields.correctiveAction;
|
||||
if (additionalFields.ownerId !== undefined) input.ownerId = additionalFields.ownerId === '' ? null : additionalFields.ownerId;
|
||||
if (additionalFields.dueDate !== undefined) input.dueDate = additionalFields.dueDate === '' ? null : additionalFields.dueDate;
|
||||
if (additionalFields.status !== undefined) input.status = additionalFields.status;
|
||||
if (additionalFields.priority !== undefined) input.priority = additionalFields.priority;
|
||||
if (additionalFields.riskId !== undefined) input.riskId = additionalFields.riskId === '' ? null : additionalFields.riskId;
|
||||
if (additionalFields.effectivenessCheck !== undefined) input.effectivenessCheck = additionalFields.effectivenessCheck === '' ? null : additionalFields.effectivenessCheck;
|
||||
|
||||
const responseData = await proboApiRequest.call(this, query, { input });
|
||||
|
||||
return {
|
||||
json: responseData,
|
||||
pairedItem: { item: itemIndex },
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user