2023-01-27 03:22:44 -08:00
import type { INodeProperties } from 'n8n-workflow' ;
2021-11-03 17:55:04 -07:00
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 : {
2022-08-17 08:50:24 -07:00
resource : [ 'userGroup' ] ,
2021-11-03 17:55:04 -07:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
2022-07-10 13:50:51 -07:00
action : 'Create a user group' ,
2021-11-03 17:55:04 -07:00
} ,
{
name : 'Disable' ,
value : 'disable' ,
2022-07-10 13:50:51 -07:00
action : 'Disable a user group' ,
2021-11-03 17:55:04 -07:00
} ,
{
name : 'Enable' ,
value : 'enable' ,
2022-07-10 13:50:51 -07:00
action : 'Enable a user group' ,
2021-11-03 17:55:04 -07:00
} ,
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2021-11-03 17:55:04 -07:00
value : 'getAll' ,
2022-09-08 08:10:13 -07:00
action : 'Get many user groups' ,
2021-11-03 17:55:04 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
2022-07-10 13:50:51 -07:00
action : 'Update a user group' ,
2021-11-03 17:55:04 -07:00
} ,
] ,
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 : {
2022-08-17 08:50:24 -07:00
operation : [ 'create' ] ,
resource : [ 'userGroup' ] ,
2021-11-03 17:55:04 -07:00
} ,
} ,
required : true ,
description : 'A name for the User Group. Must be unique among User Groups.' ,
} ,
{
2023-02-03 08:04:37 -08:00
displayName : 'Options' ,
name : 'Options' ,
2021-11-03 17:55:04 -07:00
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'userGroup' ] ,
operation : [ 'create' ] ,
2021-11-03 17:55:04 -07:00
} ,
} ,
options : [
{
2022-06-20 07:54:01 -07:00
displayName : 'Channel Names or IDs' ,
2021-11-03 17:55:04 -07:00
name : 'channelIds' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getChannels' ,
} ,
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'A comma-separated string of encoded channel IDs for which the User Group uses as a default. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
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-06-20 07:54:01 -07:00
description : 'Whether to 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 : {
2022-08-17 08:50:24 -07:00
operation : [ 'disable' ] ,
resource : [ 'userGroup' ] ,
2021-11-03 17:55:04 -07:00
} ,
} ,
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
} ,
{
2023-02-03 08:04:37 -08:00
displayName : 'Options' ,
name : 'options' ,
2021-11-03 17:55:04 -07:00
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'userGroup' ] ,
operation : [ 'disable' ] ,
2021-11-03 17:55:04 -07:00
} ,
} ,
options : [
{
displayName : 'Include Count' ,
name : 'include_count' ,
type : 'boolean' ,
default : true ,
2022-06-20 07:54:01 -07:00
description : 'Whether to 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 : {
2022-08-17 08:50:24 -07:00
operation : [ 'enable' ] ,
resource : [ 'userGroup' ] ,
2021-11-03 17:55:04 -07:00
} ,
} ,
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
} ,
{
2023-02-03 08:04:37 -08:00
displayName : 'Options' ,
name : 'option' ,
2021-11-03 17:55:04 -07:00
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'userGroup' ] ,
operation : [ 'enable' ] ,
2021-11-03 17:55:04 -07:00
} ,
} ,
options : [
{
displayName : 'Include Count' ,
name : 'include_count' ,
type : 'boolean' ,
default : true ,
2022-06-20 07:54:01 -07:00
description : 'Whether to 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 : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'userGroup' ] ,
2021-11-03 17:55:04 -07:00
} ,
} ,
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 : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'userGroup' ] ,
returnAll : [ false ] ,
2021-11-03 17:55:04 -07:00
} ,
} ,
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
} ,
{
2023-02-03 08:04:37 -08:00
displayName : 'Options' ,
name : 'options' ,
2021-11-03 17:55:04 -07:00
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'userGroup' ] ,
operation : [ 'getAll' ] ,
2021-11-03 17:55:04 -07:00
} ,
} ,
options : [
{
displayName : 'Include Count' ,
name : 'include_count' ,
type : 'boolean' ,
default : true ,
2022-06-20 07:54:01 -07:00
description : 'Whether to 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-06-20 07:54:01 -07:00
description : 'Whether to include disabled User Groups' ,
2021-11-03 17:55:04 -07:00
} ,
{
displayName : 'Include Users' ,
name : 'include_users' ,
type : 'boolean' ,
default : true ,
2022-06-20 07:54:01 -07:00
description : 'Whether to 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 : {
2022-08-17 08:50:24 -07:00
operation : [ 'update' ] ,
resource : [ 'userGroup' ] ,
2021-11-03 17:55:04 -07:00
} ,
} ,
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 : {
2022-08-17 08:50:24 -07:00
resource : [ 'userGroup' ] ,
operation : [ 'update' ] ,
2021-11-03 17:55:04 -07:00
} ,
} ,
options : [
{
2022-06-20 07:54:01 -07:00
displayName : 'Channel Names or IDs' ,
2021-11-03 17:55:04 -07:00
name : 'channels' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getChannels' ,
} ,
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'A comma-separated string of encoded channel IDs for which the User Group uses as a default. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
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-06-20 07:54:01 -07:00
description : 'Whether to 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
] ;