2021-11-03 17:55:04 -07:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const userGroupOperations: INodeProperties[] = [
|
2021-11-03 17:55:04 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-11-03 17:55:04 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create a user group',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Disable',
|
|
|
|
value: 'disable',
|
|
|
|
description: 'Disable a user group',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Enable',
|
|
|
|
value: 'enable',
|
|
|
|
description: 'Enable a user group',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get All',
|
|
|
|
value: 'getAll',
|
|
|
|
description: 'Get all user groups',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
|
|
|
description: 'Update a user group',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'create',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-11-03 17:55:04 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const userGroupFields: INodeProperties[] = [
|
2021-11-03 17:55:04 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* userGroup:create */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
description: 'A name for the User Group. Must be unique among User Groups.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Channel IDs',
|
|
|
|
name: 'channelIds',
|
|
|
|
type: 'multiOptions',
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getChannels',
|
|
|
|
},
|
|
|
|
default: [],
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'A comma-separated string of encoded channel IDs for which the User Group uses as a default',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'A short description of the User Group',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Handle',
|
|
|
|
name: 'handle',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'A mention handle. Must be unique among channels, users and User Groups.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Include Count',
|
|
|
|
name: 'include_count',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Include the number of users in each User Group',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
/* userGroup:disable */
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'User Group ID',
|
|
|
|
name: 'userGroupId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'disable',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The encoded ID of the User Group to update',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'disable',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Include Count',
|
|
|
|
name: 'include_count',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Include the number of users in each User Group',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
/* userGroup:enable */
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'User Group ID',
|
|
|
|
name: 'userGroupId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'enable',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The encoded ID of the User Group to update',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'enable',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Include Count',
|
|
|
|
name: 'include_count',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Include the number of users in each User Group',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* userGroup:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
returnAll: [
|
|
|
|
false,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 500,
|
|
|
|
},
|
|
|
|
default: 100,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Include Count',
|
|
|
|
name: 'include_count',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Include the number of users in each User Group',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Include Disabled',
|
|
|
|
name: 'include_disabled',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Include disabled User Groups',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Include Users',
|
|
|
|
name: 'include_users',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Include the list of users for each User Group',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
/* userGroup:update */
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'User Group ID',
|
|
|
|
name: 'userGroupId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The encoded ID of the User Group to update',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Update Fields',
|
|
|
|
name: 'updateFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userGroup',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Channel IDs',
|
|
|
|
name: 'channels',
|
|
|
|
type: 'multiOptions',
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getChannels',
|
|
|
|
},
|
|
|
|
default: [],
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'A comma-separated string of encoded channel IDs for which the User Group uses as a default',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'A short description of the User Group',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Handle',
|
|
|
|
name: 'handle',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'A mention handle. Must be unique among channels, users and User Groups.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Include Count',
|
|
|
|
name: 'include_count',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Include the number of users in each User Group',
|
2021-11-03 17:55:04 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'A name for the User Group. Must be unique among User Groups.',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
];
|