mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-27 05:29:42 -08:00
79 lines
1.6 KiB
TypeScript
79 lines
1.6 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: 'searchUser',
|
||
|
description: 'Retrieve a user by username',
|
||
|
action: 'Get User',
|
||
|
},
|
||
|
],
|
||
|
default: 'searchUser',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
export const userFields: INodeProperties[] = [
|
||
|
/* -------------------------------------------------------------------------- */
|
||
|
/* user:searchUser */
|
||
|
/* -------------------------------------------------------------------------- */
|
||
|
{
|
||
|
displayName: 'User',
|
||
|
name: 'user',
|
||
|
type: 'resourceLocator',
|
||
|
default: { mode: 'username', value: '' },
|
||
|
required: true,
|
||
|
description: 'The user you want to search',
|
||
|
displayOptions: {
|
||
|
show: {
|
||
|
operation: ['searchUser'],
|
||
|
resource: ['user'],
|
||
|
},
|
||
|
hide: {
|
||
|
me: [true],
|
||
|
},
|
||
|
},
|
||
|
modes: [
|
||
|
{
|
||
|
displayName: 'By Username',
|
||
|
name: 'username',
|
||
|
type: 'string',
|
||
|
validation: [],
|
||
|
placeholder: 'e.g. n8n',
|
||
|
url: '',
|
||
|
},
|
||
|
{
|
||
|
displayName: 'By ID',
|
||
|
name: 'id',
|
||
|
type: 'string',
|
||
|
validation: [],
|
||
|
placeholder: 'e.g. 1068479892537384960',
|
||
|
url: '',
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
{
|
||
|
displayName: 'Me',
|
||
|
name: 'me',
|
||
|
type: 'boolean',
|
||
|
displayOptions: {
|
||
|
show: {
|
||
|
operation: ['searchUser'],
|
||
|
resource: ['user'],
|
||
|
},
|
||
|
},
|
||
|
default: false,
|
||
|
description: 'Whether you want to search the authenticated user',
|
||
|
},
|
||
|
];
|