mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
b03e358a12
* 👕 Enable `consistent-type-imports` for nodes-base
* 👕 Apply to nodes-base
* ⏪ Undo unrelated changes
* 🚚 Move to `.eslintrc.js` in nodes-base
* ⏪ Revert "Enable `consistent-type-imports` for nodes-base"
This reverts commit 529ad72b05
.
* 👕 Fix severity
173 lines
3.7 KiB
TypeScript
173 lines
3.7 KiB
TypeScript
import type { INodeProperties } from 'n8n-workflow';
|
|
|
|
export const userOperations: INodeProperties[] = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
noDataExpression: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['user'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Get',
|
|
value: 'get',
|
|
description: 'Get a user',
|
|
action: 'Get a user',
|
|
},
|
|
{
|
|
name: 'Get Many',
|
|
value: 'getAll',
|
|
description: 'Get many users',
|
|
action: 'Get many users',
|
|
},
|
|
],
|
|
default: 'get',
|
|
},
|
|
];
|
|
|
|
export const userFields: INodeProperties[] = [
|
|
/* -------------------------------------------------------------------------- */
|
|
/* user:get */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'User ID',
|
|
name: 'userId',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['user'],
|
|
operation: ['get'],
|
|
},
|
|
},
|
|
description: 'ID of user that needs to be fetched',
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* user:getAll */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['user'],
|
|
operation: ['getAll'],
|
|
},
|
|
},
|
|
default: false,
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
},
|
|
{
|
|
displayName: 'Limit',
|
|
name: 'limit',
|
|
type: 'number',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['user'],
|
|
operation: ['getAll'],
|
|
returnAll: [false],
|
|
},
|
|
},
|
|
typeOptions: {
|
|
minValue: 1,
|
|
maxValue: 100,
|
|
},
|
|
default: 50,
|
|
description: 'Max number of results to return',
|
|
},
|
|
{
|
|
displayName: 'Options',
|
|
name: 'options',
|
|
type: 'collection',
|
|
placeholder: 'Add Field',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['user'],
|
|
operation: ['getAll'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Conditions',
|
|
name: 'conditionsUi',
|
|
placeholder: 'Add Condition',
|
|
type: 'fixedCollection',
|
|
typeOptions: {
|
|
multipleValues: true,
|
|
},
|
|
description: 'The condition to set',
|
|
default: {},
|
|
options: [
|
|
{
|
|
name: 'conditionValues',
|
|
displayName: 'Condition',
|
|
values: [
|
|
{
|
|
displayName: 'Field Name or ID',
|
|
name: 'field',
|
|
type: 'options',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getUserFields',
|
|
},
|
|
default: '',
|
|
description:
|
|
'For date, number, or boolean, please use expressions. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
},
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-operation-without-no-data-expression
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
options: [
|
|
{
|
|
name: '<',
|
|
value: '<',
|
|
},
|
|
{
|
|
name: '<=',
|
|
value: '<=',
|
|
},
|
|
{
|
|
name: '=',
|
|
value: 'equal',
|
|
},
|
|
{
|
|
name: '>',
|
|
value: '>',
|
|
},
|
|
{
|
|
name: '>=',
|
|
value: '>=',
|
|
},
|
|
],
|
|
default: 'equal',
|
|
},
|
|
{
|
|
displayName: 'Value',
|
|
name: 'value',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Fields',
|
|
name: 'fields',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Fields to include separated by ,',
|
|
},
|
|
],
|
|
},
|
|
];
|