The source headers, LICENSE files, and license metadata had drifted apart. Align the entire project to MIT: - Convert every source-file header to the MIT text across all comment styles (Go, TS, TSX, JS, MJS, SQL, CSS, GraphQL, shell), including SPDX-License-Identifier tags - Set the root and cookie-banner LICENSE files to the MIT text with a "MIT License" title line - Switch the package.json license fields, Docker image label, and cookie-banner README to MIT - Update docs and the genmodels header generator accordingly - Normalize copyright lines to a single format (Copyright (c) <year(s)> Probo Inc <hello@probo.com>.): unify the hello@getprobo.com and hello@probo.inc emails to hello@probo.com and the comma-separated years to a hyphenated range Genuine third-party references are intentionally left untouched: the Lucide icon attributions (Lucide is ISC) and the trivy dependency license allowlist. Signed-off-by: Sacha Al Himdani <sacha@probo.com>
259 lines
6.2 KiB
TypeScript
259 lines
6.2 KiB
TypeScript
// Copyright (c) 2025-2026 Probo Inc <hello@probo.com>.
|
|
//
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
// of this software and associated documentation files (the "Software"), to deal
|
|
// in the Software without restriction, including without limitation the rights
|
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
// copies of the Software, and to permit persons to whom the Software is
|
|
// furnished to do so, subject to the following conditions:
|
|
//
|
|
// The above copyright notice and this permission notice shall be included in
|
|
// all copies or substantial portions of the Software.
|
|
//
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
// SOFTWARE.
|
|
|
|
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
import { proboApiRequest } from '../../GenericFunctions';
|
|
|
|
export const description: INodeProperties[] = [
|
|
{
|
|
displayName: 'Obligation ID',
|
|
name: 'id',
|
|
type: 'string',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['obligation'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
default: '',
|
|
description: 'The ID of the obligation to update',
|
|
required: true,
|
|
},
|
|
{
|
|
displayName: 'Area',
|
|
name: 'area',
|
|
type: 'string',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['obligation'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
default: '',
|
|
description: 'The area of the obligation',
|
|
},
|
|
{
|
|
displayName: 'Source',
|
|
name: 'source',
|
|
type: 'string',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['obligation'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
default: '',
|
|
description: 'The source of the obligation',
|
|
},
|
|
{
|
|
displayName: 'Requirement',
|
|
name: 'requirement',
|
|
type: 'string',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['obligation'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
default: '',
|
|
description: 'The requirement of the obligation',
|
|
},
|
|
{
|
|
displayName: 'Actions to Be Implemented',
|
|
name: 'actionsToBeImplemented',
|
|
type: 'string',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['obligation'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
default: '',
|
|
description: 'The actions to be implemented for the obligation',
|
|
},
|
|
{
|
|
displayName: 'Regulator',
|
|
name: 'regulator',
|
|
type: 'string',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['obligation'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
default: '',
|
|
description: 'The regulator of the obligation',
|
|
},
|
|
{
|
|
displayName: 'Owner ID',
|
|
name: 'ownerId',
|
|
type: 'string',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['obligation'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
default: '',
|
|
description: 'The ID of the owner',
|
|
},
|
|
{
|
|
displayName: 'Last Review Date',
|
|
name: 'lastReviewDate',
|
|
type: 'string',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['obligation'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
default: '',
|
|
description: 'The last review date of the obligation',
|
|
},
|
|
{
|
|
displayName: 'Due Date',
|
|
name: 'dueDate',
|
|
type: 'string',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['obligation'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
default: '',
|
|
description: 'The due date of the obligation',
|
|
},
|
|
{
|
|
displayName: 'Status',
|
|
name: 'status',
|
|
type: 'options',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['obligation'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: '(Unchanged)',
|
|
value: '',
|
|
},
|
|
{
|
|
name: 'Non Compliant',
|
|
value: 'NON_COMPLIANT',
|
|
},
|
|
{
|
|
name: 'Partially Compliant',
|
|
value: 'PARTIALLY_COMPLIANT',
|
|
},
|
|
{
|
|
name: 'Compliant',
|
|
value: 'COMPLIANT',
|
|
},
|
|
],
|
|
default: '',
|
|
description: 'The status of the obligation',
|
|
},
|
|
{
|
|
displayName: 'Type',
|
|
name: 'type',
|
|
type: 'options',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['obligation'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: '(Unchanged)',
|
|
value: '',
|
|
},
|
|
{
|
|
name: 'Legal',
|
|
value: 'LEGAL',
|
|
},
|
|
{
|
|
name: 'Contractual',
|
|
value: 'CONTRACTUAL',
|
|
},
|
|
],
|
|
default: '',
|
|
description: 'The type of the obligation',
|
|
},
|
|
];
|
|
|
|
export async function execute(
|
|
this: IExecuteFunctions,
|
|
itemIndex: number,
|
|
): Promise<INodeExecutionData> {
|
|
const id = this.getNodeParameter('id', itemIndex) as string;
|
|
const area = this.getNodeParameter('area', itemIndex, '') as string;
|
|
const source = this.getNodeParameter('source', itemIndex, '') as string;
|
|
const requirement = this.getNodeParameter('requirement', itemIndex, '') as string;
|
|
const actionsToBeImplemented = this.getNodeParameter('actionsToBeImplemented', itemIndex, '') as string;
|
|
const regulator = this.getNodeParameter('regulator', itemIndex, '') as string;
|
|
const ownerId = this.getNodeParameter('ownerId', itemIndex, '') as string;
|
|
const lastReviewDate = this.getNodeParameter('lastReviewDate', itemIndex, '') as string;
|
|
const dueDate = this.getNodeParameter('dueDate', itemIndex, '') as string;
|
|
const status = this.getNodeParameter('status', itemIndex, '') as string;
|
|
const type = this.getNodeParameter('type', itemIndex, '') as string;
|
|
|
|
const query = `
|
|
mutation UpdateObligation($input: UpdateObligationInput!) {
|
|
updateObligation(input: $input) {
|
|
obligation {
|
|
id
|
|
area
|
|
source
|
|
requirement
|
|
actionsToBeImplemented
|
|
regulator
|
|
lastReviewDate
|
|
dueDate
|
|
status
|
|
type
|
|
createdAt
|
|
updatedAt
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
const input: Record<string, string> = { id };
|
|
if (area) input.area = area;
|
|
if (source) input.source = source;
|
|
if (requirement) input.requirement = requirement;
|
|
if (actionsToBeImplemented) input.actionsToBeImplemented = actionsToBeImplemented;
|
|
if (regulator) input.regulator = regulator;
|
|
if (ownerId) input.ownerId = ownerId;
|
|
if (lastReviewDate) input.lastReviewDate = lastReviewDate;
|
|
if (dueDate) input.dueDate = dueDate;
|
|
if (status) input.status = status;
|
|
if (type) input.type = type;
|
|
|
|
const responseData = await proboApiRequest.call(this, query, { input });
|
|
|
|
return {
|
|
json: responseData,
|
|
pairedItem: { item: itemIndex },
|
|
};
|
|
}
|