Add options to sideload owner and vendors
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -109,6 +109,35 @@ export const description: INodeProperties[] = [
|
|||||||
default: '',
|
default: '',
|
||||||
description: 'Comma-separated list of vendor IDs',
|
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(
|
export async function execute(
|
||||||
@@ -122,6 +151,29 @@ export async function execute(
|
|||||||
const assetType = this.getNodeParameter('assetType', itemIndex) as string;
|
const assetType = this.getNodeParameter('assetType', itemIndex) as string;
|
||||||
const dataTypesStored = this.getNodeParameter('dataTypesStored', itemIndex) as string;
|
const dataTypesStored = this.getNodeParameter('dataTypesStored', itemIndex) as string;
|
||||||
const vendorIdsStr = this.getNodeParameter('vendorIds', 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 = `
|
const query = `
|
||||||
mutation CreateAsset($input: CreateAssetInput!) {
|
mutation CreateAsset($input: CreateAssetInput!) {
|
||||||
@@ -133,6 +185,8 @@ export async function execute(
|
|||||||
amount
|
amount
|
||||||
assetType
|
assetType
|
||||||
dataTypesStored
|
dataTypesStored
|
||||||
|
${ownerFragment}
|
||||||
|
${vendorsFragment}
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
}
|
}
|
||||||
@@ -162,4 +216,3 @@ export async function execute(
|
|||||||
pairedItem: { item: itemIndex },
|
pairedItem: { item: itemIndex },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,35 @@ export const description: INodeProperties[] = [
|
|||||||
description: 'The ID of the asset',
|
description: 'The ID of the asset',
|
||||||
required: true,
|
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(
|
export async function execute(
|
||||||
@@ -23,6 +52,29 @@ export async function execute(
|
|||||||
itemIndex: number,
|
itemIndex: number,
|
||||||
): Promise<INodeExecutionData> {
|
): Promise<INodeExecutionData> {
|
||||||
const assetId = this.getNodeParameter('assetId', itemIndex) as string;
|
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 = `
|
const query = `
|
||||||
query GetAsset($assetId: ID!) {
|
query GetAsset($assetId: ID!) {
|
||||||
@@ -33,6 +85,8 @@ export async function execute(
|
|||||||
amount
|
amount
|
||||||
assetType
|
assetType
|
||||||
dataTypesStored
|
dataTypesStored
|
||||||
|
${ownerFragment}
|
||||||
|
${vendorsFragment}
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
}
|
}
|
||||||
@@ -51,4 +105,3 @@ export async function execute(
|
|||||||
pairedItem: { item: itemIndex },
|
pairedItem: { item: itemIndex },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,35 @@ export const description: INodeProperties[] = [
|
|||||||
default: 50,
|
default: 50,
|
||||||
description: 'Max number of results to return',
|
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(
|
export async function execute(
|
||||||
@@ -55,6 +84,29 @@ export async function execute(
|
|||||||
const organizationId = this.getNodeParameter('organizationId', itemIndex) as string;
|
const organizationId = this.getNodeParameter('organizationId', itemIndex) as string;
|
||||||
const returnAll = this.getNodeParameter('returnAll', itemIndex) as boolean;
|
const returnAll = this.getNodeParameter('returnAll', itemIndex) as boolean;
|
||||||
const limit = this.getNodeParameter('limit', itemIndex, 50) as number;
|
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 = `
|
const query = `
|
||||||
query GetAssets($organizationId: ID!, $first: Int, $after: CursorKey) {
|
query GetAssets($organizationId: ID!, $first: Int, $after: CursorKey) {
|
||||||
@@ -68,6 +120,8 @@ export async function execute(
|
|||||||
amount
|
amount
|
||||||
assetType
|
assetType
|
||||||
dataTypesStored
|
dataTypesStored
|
||||||
|
${ownerFragment}
|
||||||
|
${vendorsFragment}
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
}
|
}
|
||||||
@@ -96,4 +150,3 @@ export async function execute(
|
|||||||
pairedItem: { item: itemIndex },
|
pairedItem: { item: itemIndex },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,35 @@ export const description: INodeProperties[] = [
|
|||||||
default: '',
|
default: '',
|
||||||
description: 'Comma-separated list of vendor IDs',
|
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(
|
export async function execute(
|
||||||
@@ -117,6 +146,29 @@ export async function execute(
|
|||||||
const assetType = this.getNodeParameter('assetType', itemIndex, '') as string;
|
const assetType = this.getNodeParameter('assetType', itemIndex, '') as string;
|
||||||
const dataTypesStored = this.getNodeParameter('dataTypesStored', itemIndex, '') as string;
|
const dataTypesStored = this.getNodeParameter('dataTypesStored', itemIndex, '') as string;
|
||||||
const vendorIdsStr = this.getNodeParameter('vendorIds', 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 = `
|
const query = `
|
||||||
mutation UpdateAsset($input: UpdateAssetInput!) {
|
mutation UpdateAsset($input: UpdateAssetInput!) {
|
||||||
@@ -127,6 +179,8 @@ export async function execute(
|
|||||||
amount
|
amount
|
||||||
assetType
|
assetType
|
||||||
dataTypesStored
|
dataTypesStored
|
||||||
|
${ownerFragment}
|
||||||
|
${vendorsFragment}
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
}
|
}
|
||||||
@@ -152,4 +206,3 @@ export async function execute(
|
|||||||
pairedItem: { item: itemIndex },
|
pairedItem: { item: itemIndex },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,35 @@ export const description: INodeProperties[] = [
|
|||||||
default: '',
|
default: '',
|
||||||
description: 'Comma-separated list of vendor IDs',
|
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(
|
export async function execute(
|
||||||
@@ -100,6 +129,29 @@ export async function execute(
|
|||||||
const dataClassification = this.getNodeParameter('dataClassification', itemIndex) as string;
|
const dataClassification = this.getNodeParameter('dataClassification', itemIndex) as string;
|
||||||
const ownerId = this.getNodeParameter('ownerId', itemIndex) as string;
|
const ownerId = this.getNodeParameter('ownerId', itemIndex) as string;
|
||||||
const vendorIdsStr = this.getNodeParameter('vendorIds', 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 = `
|
const query = `
|
||||||
mutation CreateDatum($input: CreateDatumInput!) {
|
mutation CreateDatum($input: CreateDatumInput!) {
|
||||||
@@ -109,6 +161,8 @@ export async function execute(
|
|||||||
id
|
id
|
||||||
name
|
name
|
||||||
dataClassification
|
dataClassification
|
||||||
|
${ownerFragment}
|
||||||
|
${vendorsFragment}
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
}
|
}
|
||||||
@@ -136,4 +190,3 @@ export async function execute(
|
|||||||
pairedItem: { item: itemIndex },
|
pairedItem: { item: itemIndex },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,35 @@ export const description: INodeProperties[] = [
|
|||||||
description: 'The ID of the datum',
|
description: 'The ID of the datum',
|
||||||
required: true,
|
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(
|
export async function execute(
|
||||||
@@ -23,6 +52,29 @@ export async function execute(
|
|||||||
itemIndex: number,
|
itemIndex: number,
|
||||||
): Promise<INodeExecutionData> {
|
): Promise<INodeExecutionData> {
|
||||||
const datumId = this.getNodeParameter('datumId', itemIndex) as string;
|
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 = `
|
const query = `
|
||||||
query GetDatum($datumId: ID!) {
|
query GetDatum($datumId: ID!) {
|
||||||
@@ -31,6 +83,8 @@ export async function execute(
|
|||||||
id
|
id
|
||||||
name
|
name
|
||||||
dataClassification
|
dataClassification
|
||||||
|
${ownerFragment}
|
||||||
|
${vendorsFragment}
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
}
|
}
|
||||||
@@ -49,4 +103,3 @@ export async function execute(
|
|||||||
pairedItem: { item: itemIndex },
|
pairedItem: { item: itemIndex },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,35 @@ export const description: INodeProperties[] = [
|
|||||||
default: 50,
|
default: 50,
|
||||||
description: 'Max number of results to return',
|
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(
|
export async function execute(
|
||||||
@@ -55,6 +84,29 @@ export async function execute(
|
|||||||
const organizationId = this.getNodeParameter('organizationId', itemIndex) as string;
|
const organizationId = this.getNodeParameter('organizationId', itemIndex) as string;
|
||||||
const returnAll = this.getNodeParameter('returnAll', itemIndex) as boolean;
|
const returnAll = this.getNodeParameter('returnAll', itemIndex) as boolean;
|
||||||
const limit = this.getNodeParameter('limit', itemIndex, 50) as number;
|
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 = `
|
const query = `
|
||||||
query GetData($organizationId: ID!, $first: Int, $after: CursorKey) {
|
query GetData($organizationId: ID!, $first: Int, $after: CursorKey) {
|
||||||
@@ -66,6 +118,8 @@ export async function execute(
|
|||||||
id
|
id
|
||||||
name
|
name
|
||||||
dataClassification
|
dataClassification
|
||||||
|
${ownerFragment}
|
||||||
|
${vendorsFragment}
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
}
|
}
|
||||||
@@ -94,4 +148,3 @@ export async function execute(
|
|||||||
pairedItem: { item: itemIndex },
|
pairedItem: { item: itemIndex },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,35 @@ export const description: INodeProperties[] = [
|
|||||||
default: '',
|
default: '',
|
||||||
description: 'Comma-separated list of vendor IDs',
|
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(
|
export async function execute(
|
||||||
@@ -97,6 +126,29 @@ export async function execute(
|
|||||||
const dataClassification = this.getNodeParameter('dataClassification', itemIndex, '') as string;
|
const dataClassification = this.getNodeParameter('dataClassification', itemIndex, '') as string;
|
||||||
const ownerId = this.getNodeParameter('ownerId', itemIndex, '') as string;
|
const ownerId = this.getNodeParameter('ownerId', itemIndex, '') as string;
|
||||||
const vendorIdsStr = this.getNodeParameter('vendorIds', 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 = `
|
const query = `
|
||||||
mutation UpdateDatum($input: UpdateDatumInput!) {
|
mutation UpdateDatum($input: UpdateDatumInput!) {
|
||||||
@@ -105,6 +157,8 @@ export async function execute(
|
|||||||
id
|
id
|
||||||
name
|
name
|
||||||
dataClassification
|
dataClassification
|
||||||
|
${ownerFragment}
|
||||||
|
${vendorsFragment}
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
}
|
}
|
||||||
@@ -128,4 +182,3 @@ export async function execute(
|
|||||||
pairedItem: { item: itemIndex },
|
pairedItem: { item: itemIndex },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user