mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat: Add crowd.dev node and trigger node (#6082)
This commit is contained in:
57
packages/nodes-base/nodes/CrowdDev/descriptions/utils.ts
Normal file
57
packages/nodes-base/nodes/CrowdDev/descriptions/utils.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const showFor =
|
||||
(resources: string[]) =>
|
||||
(operations?: string[]): Partial<INodeProperties> => {
|
||||
return operations !== undefined
|
||||
? {
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: resources,
|
||||
operation: operations,
|
||||
},
|
||||
},
|
||||
}
|
||||
: {
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: resources,
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const mapWith =
|
||||
<T>(...objects: Array<Partial<T>>) =>
|
||||
(item: Partial<T>) =>
|
||||
Object.assign({}, item, ...objects);
|
||||
|
||||
export const getId = (): INodeProperties => ({
|
||||
displayName: 'ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
routing: {
|
||||
send: {
|
||||
type: 'query',
|
||||
property: 'ids[]',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const getAdditionalOptions = (fields: INodeProperties[]): INodeProperties => {
|
||||
return {
|
||||
displayName: 'Additional Options',
|
||||
name: 'additionalOptions',
|
||||
type: 'collection',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
default: {},
|
||||
placeholder: 'Add Option',
|
||||
options: fields,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user