mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 19:11:13 +00:00
65 lines
1.4 KiB
TypeScript
65 lines
1.4 KiB
TypeScript
import type { INodeProperties } from 'n8n-workflow';
|
|
import { updateDisplayOptions } from 'n8n-workflow';
|
|
|
|
import {
|
|
untilContainerSelected,
|
|
untilItemSelected,
|
|
validateCustomProperties,
|
|
} from '../../helpers/utils';
|
|
import { containerResourceLocator, itemResourceLocator } from '../common';
|
|
|
|
const properties: INodeProperties[] = [
|
|
{ ...containerResourceLocator, description: 'Select the container you want to use' },
|
|
{ ...itemResourceLocator, description: 'Select the item to be updated' },
|
|
{
|
|
displayName: 'Item Contents',
|
|
name: 'customProperties',
|
|
default: '{}',
|
|
description: 'The item contents as a JSON object',
|
|
displayOptions: {
|
|
hide: {
|
|
...untilContainerSelected,
|
|
...untilItemSelected,
|
|
},
|
|
},
|
|
required: true,
|
|
routing: {
|
|
send: {
|
|
preSend: [validateCustomProperties],
|
|
},
|
|
},
|
|
type: 'json',
|
|
},
|
|
{
|
|
displayName: 'Additional Fields',
|
|
name: 'additionalFields',
|
|
default: {},
|
|
displayOptions: {
|
|
hide: {
|
|
...untilContainerSelected,
|
|
...untilItemSelected,
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Partition Key',
|
|
name: 'partitionKey',
|
|
type: 'string',
|
|
hint: 'Only required if a custom partition key is set for the container',
|
|
default: '',
|
|
},
|
|
],
|
|
placeholder: 'Add Partition Key',
|
|
type: 'collection',
|
|
},
|
|
];
|
|
|
|
const displayOptions = {
|
|
show: {
|
|
resource: ['item'],
|
|
operation: ['update'],
|
|
},
|
|
};
|
|
|
|
export const description = updateDisplayOptions(displayOptions, properties);
|