From 85bff72e0e13085a323e303cb4e6732e491edb60 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Tue, 2 Dec 2025 10:54:10 +0100 Subject: [PATCH] Add options to sideload owner and vendors Signed-off-by: Bryan Frimin --- .../Probo/actions/asset/create.operation.ts | 55 ++++++++++++++++++- .../Probo/actions/asset/get.operation.ts | 55 ++++++++++++++++++- .../Probo/actions/asset/getAll.operation.ts | 55 ++++++++++++++++++- .../Probo/actions/asset/update.operation.ts | 55 ++++++++++++++++++- .../Probo/actions/datum/create.operation.ts | 55 ++++++++++++++++++- .../Probo/actions/datum/get.operation.ts | 55 ++++++++++++++++++- .../Probo/actions/datum/getAll.operation.ts | 55 ++++++++++++++++++- .../Probo/actions/datum/update.operation.ts | 55 ++++++++++++++++++- 8 files changed, 432 insertions(+), 8 deletions(-) diff --git a/packages/n8n-node/nodes/Probo/actions/asset/create.operation.ts b/packages/n8n-node/nodes/Probo/actions/asset/create.operation.ts index 752c5d5dd..9cd5e2aed 100644 --- a/packages/n8n-node/nodes/Probo/actions/asset/create.operation.ts +++ b/packages/n8n-node/nodes/Probo/actions/asset/create.operation.ts @@ -109,6 +109,35 @@ export const description: INodeProperties[] = [ default: '', description: 'Comma-separated list of vendor IDs', }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + default: {}, + displayOptions: { + show: { + resource: ['asset'], + operation: ['create'], + }, + }, + options: [ + { + displayName: 'Include Owner', + name: 'includeOwner', + type: 'boolean', + default: false, + description: 'Whether to include owner details in the response', + }, + { + displayName: 'Include Vendors', + name: 'includeVendors', + type: 'boolean', + default: false, + description: 'Whether to include vendors in the response', + }, + ], + }, ]; export async function execute( @@ -122,6 +151,29 @@ export async function execute( const assetType = this.getNodeParameter('assetType', itemIndex) as string; const dataTypesStored = this.getNodeParameter('dataTypesStored', itemIndex) as string; const vendorIdsStr = this.getNodeParameter('vendorIds', itemIndex, '') as string; + const options = this.getNodeParameter('options', itemIndex, {}) as { + includeOwner?: boolean; + includeVendors?: boolean; + }; + + const ownerFragment = options.includeOwner + ? `owner { + id + fullName + primaryEmailAddress + }` + : ''; + + const vendorsFragment = options.includeVendors + ? `vendors(first: 100) { + edges { + node { + id + name + } + } + }` + : ''; const query = ` mutation CreateAsset($input: CreateAssetInput!) { @@ -133,6 +185,8 @@ export async function execute( amount assetType dataTypesStored + ${ownerFragment} + ${vendorsFragment} createdAt updatedAt } @@ -162,4 +216,3 @@ export async function execute( pairedItem: { item: itemIndex }, }; } - diff --git a/packages/n8n-node/nodes/Probo/actions/asset/get.operation.ts b/packages/n8n-node/nodes/Probo/actions/asset/get.operation.ts index 8758eb021..30cff8470 100644 --- a/packages/n8n-node/nodes/Probo/actions/asset/get.operation.ts +++ b/packages/n8n-node/nodes/Probo/actions/asset/get.operation.ts @@ -16,6 +16,35 @@ export const description: INodeProperties[] = [ description: 'The ID of the asset', required: true, }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + default: {}, + displayOptions: { + show: { + resource: ['asset'], + operation: ['get'], + }, + }, + options: [ + { + displayName: 'Include Owner', + name: 'includeOwner', + type: 'boolean', + default: false, + description: 'Whether to include owner details in the response', + }, + { + displayName: 'Include Vendors', + name: 'includeVendors', + type: 'boolean', + default: false, + description: 'Whether to include vendors in the response', + }, + ], + }, ]; export async function execute( @@ -23,6 +52,29 @@ export async function execute( itemIndex: number, ): Promise { const assetId = this.getNodeParameter('assetId', itemIndex) as string; + const options = this.getNodeParameter('options', itemIndex, {}) as { + includeOwner?: boolean; + includeVendors?: boolean; + }; + + const ownerFragment = options.includeOwner + ? `owner { + id + fullName + primaryEmailAddress + }` + : ''; + + const vendorsFragment = options.includeVendors + ? `vendors(first: 100) { + edges { + node { + id + name + } + } + }` + : ''; const query = ` query GetAsset($assetId: ID!) { @@ -33,6 +85,8 @@ export async function execute( amount assetType dataTypesStored + ${ownerFragment} + ${vendorsFragment} createdAt updatedAt } @@ -51,4 +105,3 @@ export async function execute( pairedItem: { item: itemIndex }, }; } - diff --git a/packages/n8n-node/nodes/Probo/actions/asset/getAll.operation.ts b/packages/n8n-node/nodes/Probo/actions/asset/getAll.operation.ts index d5a693f5c..ccb4d216d 100644 --- a/packages/n8n-node/nodes/Probo/actions/asset/getAll.operation.ts +++ b/packages/n8n-node/nodes/Probo/actions/asset/getAll.operation.ts @@ -46,6 +46,35 @@ export const description: INodeProperties[] = [ default: 50, description: 'Max number of results to return', }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + default: {}, + displayOptions: { + show: { + resource: ['asset'], + operation: ['getAll'], + }, + }, + options: [ + { + displayName: 'Include Owner', + name: 'includeOwner', + type: 'boolean', + default: false, + description: 'Whether to include owner details in the response', + }, + { + displayName: 'Include Vendors', + name: 'includeVendors', + type: 'boolean', + default: false, + description: 'Whether to include vendors in the response', + }, + ], + }, ]; export async function execute( @@ -55,6 +84,29 @@ export async function execute( 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 options = this.getNodeParameter('options', itemIndex, {}) as { + includeOwner?: boolean; + includeVendors?: boolean; + }; + + const ownerFragment = options.includeOwner + ? `owner { + id + fullName + primaryEmailAddress + }` + : ''; + + const vendorsFragment = options.includeVendors + ? `vendors(first: 100) { + edges { + node { + id + name + } + } + }` + : ''; const query = ` query GetAssets($organizationId: ID!, $first: Int, $after: CursorKey) { @@ -68,6 +120,8 @@ export async function execute( amount assetType dataTypesStored + ${ownerFragment} + ${vendorsFragment} createdAt updatedAt } @@ -96,4 +150,3 @@ export async function execute( pairedItem: { item: itemIndex }, }; } - diff --git a/packages/n8n-node/nodes/Probo/actions/asset/update.operation.ts b/packages/n8n-node/nodes/Probo/actions/asset/update.operation.ts index 1f244da31..05205ed3e 100644 --- a/packages/n8n-node/nodes/Probo/actions/asset/update.operation.ts +++ b/packages/n8n-node/nodes/Probo/actions/asset/update.operation.ts @@ -104,6 +104,35 @@ export const description: INodeProperties[] = [ default: '', description: 'Comma-separated list of vendor IDs', }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + default: {}, + displayOptions: { + show: { + resource: ['asset'], + operation: ['update'], + }, + }, + options: [ + { + displayName: 'Include Owner', + name: 'includeOwner', + type: 'boolean', + default: false, + description: 'Whether to include owner details in the response', + }, + { + displayName: 'Include Vendors', + name: 'includeVendors', + type: 'boolean', + default: false, + description: 'Whether to include vendors in the response', + }, + ], + }, ]; export async function execute( @@ -117,6 +146,29 @@ export async function execute( const assetType = this.getNodeParameter('assetType', itemIndex, '') as string; const dataTypesStored = this.getNodeParameter('dataTypesStored', itemIndex, '') as string; const vendorIdsStr = this.getNodeParameter('vendorIds', itemIndex, '') as string; + const options = this.getNodeParameter('options', itemIndex, {}) as { + includeOwner?: boolean; + includeVendors?: boolean; + }; + + const ownerFragment = options.includeOwner + ? `owner { + id + fullName + primaryEmailAddress + }` + : ''; + + const vendorsFragment = options.includeVendors + ? `vendors(first: 100) { + edges { + node { + id + name + } + } + }` + : ''; const query = ` mutation UpdateAsset($input: UpdateAssetInput!) { @@ -127,6 +179,8 @@ export async function execute( amount assetType dataTypesStored + ${ownerFragment} + ${vendorsFragment} createdAt updatedAt } @@ -152,4 +206,3 @@ export async function execute( pairedItem: { item: itemIndex }, }; } - diff --git a/packages/n8n-node/nodes/Probo/actions/datum/create.operation.ts b/packages/n8n-node/nodes/Probo/actions/datum/create.operation.ts index 7e2764a8d..34c492d9b 100644 --- a/packages/n8n-node/nodes/Probo/actions/datum/create.operation.ts +++ b/packages/n8n-node/nodes/Probo/actions/datum/create.operation.ts @@ -89,6 +89,35 @@ export const description: INodeProperties[] = [ default: '', description: 'Comma-separated list of vendor IDs', }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + default: {}, + displayOptions: { + show: { + resource: ['datum'], + operation: ['create'], + }, + }, + options: [ + { + displayName: 'Include Owner', + name: 'includeOwner', + type: 'boolean', + default: false, + description: 'Whether to include owner details in the response', + }, + { + displayName: 'Include Vendors', + name: 'includeVendors', + type: 'boolean', + default: false, + description: 'Whether to include vendors in the response', + }, + ], + }, ]; export async function execute( @@ -100,6 +129,29 @@ export async function execute( const dataClassification = this.getNodeParameter('dataClassification', itemIndex) as string; const ownerId = this.getNodeParameter('ownerId', itemIndex) as string; const vendorIdsStr = this.getNodeParameter('vendorIds', itemIndex, '') as string; + const options = this.getNodeParameter('options', itemIndex, {}) as { + includeOwner?: boolean; + includeVendors?: boolean; + }; + + const ownerFragment = options.includeOwner + ? `owner { + id + fullName + primaryEmailAddress + }` + : ''; + + const vendorsFragment = options.includeVendors + ? `vendors(first: 100) { + edges { + node { + id + name + } + } + }` + : ''; const query = ` mutation CreateDatum($input: CreateDatumInput!) { @@ -109,6 +161,8 @@ export async function execute( id name dataClassification + ${ownerFragment} + ${vendorsFragment} createdAt updatedAt } @@ -136,4 +190,3 @@ export async function execute( pairedItem: { item: itemIndex }, }; } - diff --git a/packages/n8n-node/nodes/Probo/actions/datum/get.operation.ts b/packages/n8n-node/nodes/Probo/actions/datum/get.operation.ts index 0727ea11f..8709e7896 100644 --- a/packages/n8n-node/nodes/Probo/actions/datum/get.operation.ts +++ b/packages/n8n-node/nodes/Probo/actions/datum/get.operation.ts @@ -16,6 +16,35 @@ export const description: INodeProperties[] = [ description: 'The ID of the datum', required: true, }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + default: {}, + displayOptions: { + show: { + resource: ['datum'], + operation: ['get'], + }, + }, + options: [ + { + displayName: 'Include Owner', + name: 'includeOwner', + type: 'boolean', + default: false, + description: 'Whether to include owner details in the response', + }, + { + displayName: 'Include Vendors', + name: 'includeVendors', + type: 'boolean', + default: false, + description: 'Whether to include vendors in the response', + }, + ], + }, ]; export async function execute( @@ -23,6 +52,29 @@ export async function execute( itemIndex: number, ): Promise { const datumId = this.getNodeParameter('datumId', itemIndex) as string; + const options = this.getNodeParameter('options', itemIndex, {}) as { + includeOwner?: boolean; + includeVendors?: boolean; + }; + + const ownerFragment = options.includeOwner + ? `owner { + id + fullName + primaryEmailAddress + }` + : ''; + + const vendorsFragment = options.includeVendors + ? `vendors(first: 100) { + edges { + node { + id + name + } + } + }` + : ''; const query = ` query GetDatum($datumId: ID!) { @@ -31,6 +83,8 @@ export async function execute( id name dataClassification + ${ownerFragment} + ${vendorsFragment} createdAt updatedAt } @@ -49,4 +103,3 @@ export async function execute( pairedItem: { item: itemIndex }, }; } - diff --git a/packages/n8n-node/nodes/Probo/actions/datum/getAll.operation.ts b/packages/n8n-node/nodes/Probo/actions/datum/getAll.operation.ts index 20ba5e6f8..8070558e4 100644 --- a/packages/n8n-node/nodes/Probo/actions/datum/getAll.operation.ts +++ b/packages/n8n-node/nodes/Probo/actions/datum/getAll.operation.ts @@ -46,6 +46,35 @@ export const description: INodeProperties[] = [ default: 50, description: 'Max number of results to return', }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + default: {}, + displayOptions: { + show: { + resource: ['datum'], + operation: ['getAll'], + }, + }, + options: [ + { + displayName: 'Include Owner', + name: 'includeOwner', + type: 'boolean', + default: false, + description: 'Whether to include owner details in the response', + }, + { + displayName: 'Include Vendors', + name: 'includeVendors', + type: 'boolean', + default: false, + description: 'Whether to include vendors in the response', + }, + ], + }, ]; export async function execute( @@ -55,6 +84,29 @@ export async function execute( 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 options = this.getNodeParameter('options', itemIndex, {}) as { + includeOwner?: boolean; + includeVendors?: boolean; + }; + + const ownerFragment = options.includeOwner + ? `owner { + id + fullName + primaryEmailAddress + }` + : ''; + + const vendorsFragment = options.includeVendors + ? `vendors(first: 100) { + edges { + node { + id + name + } + } + }` + : ''; const query = ` query GetData($organizationId: ID!, $first: Int, $after: CursorKey) { @@ -66,6 +118,8 @@ export async function execute( id name dataClassification + ${ownerFragment} + ${vendorsFragment} createdAt updatedAt } @@ -94,4 +148,3 @@ export async function execute( pairedItem: { item: itemIndex }, }; } - diff --git a/packages/n8n-node/nodes/Probo/actions/datum/update.operation.ts b/packages/n8n-node/nodes/Probo/actions/datum/update.operation.ts index 1e320289e..0e382837d 100644 --- a/packages/n8n-node/nodes/Probo/actions/datum/update.operation.ts +++ b/packages/n8n-node/nodes/Probo/actions/datum/update.operation.ts @@ -86,6 +86,35 @@ export const description: INodeProperties[] = [ default: '', description: 'Comma-separated list of vendor IDs', }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + default: {}, + displayOptions: { + show: { + resource: ['datum'], + operation: ['update'], + }, + }, + options: [ + { + displayName: 'Include Owner', + name: 'includeOwner', + type: 'boolean', + default: false, + description: 'Whether to include owner details in the response', + }, + { + displayName: 'Include Vendors', + name: 'includeVendors', + type: 'boolean', + default: false, + description: 'Whether to include vendors in the response', + }, + ], + }, ]; export async function execute( @@ -97,6 +126,29 @@ export async function execute( const dataClassification = this.getNodeParameter('dataClassification', itemIndex, '') as string; const ownerId = this.getNodeParameter('ownerId', itemIndex, '') as string; const vendorIdsStr = this.getNodeParameter('vendorIds', itemIndex, '') as string; + const options = this.getNodeParameter('options', itemIndex, {}) as { + includeOwner?: boolean; + includeVendors?: boolean; + }; + + const ownerFragment = options.includeOwner + ? `owner { + id + fullName + primaryEmailAddress + }` + : ''; + + const vendorsFragment = options.includeVendors + ? `vendors(first: 100) { + edges { + node { + id + name + } + } + }` + : ''; const query = ` mutation UpdateDatum($input: UpdateDatumInput!) { @@ -105,6 +157,8 @@ export async function execute( id name dataClassification + ${ownerFragment} + ${vendorsFragment} createdAt updatedAt } @@ -128,4 +182,3 @@ export async function execute( pairedItem: { item: itemIndex }, }; } -