2024-12-05 11:15:33 -08:00
|
|
|
import type { INodeProperties } from 'n8n-workflow';
|
2024-11-25 02:55:45 -08:00
|
|
|
|
2024-12-09 06:16:01 -08:00
|
|
|
import {
|
|
|
|
handleErrorPostReceive,
|
|
|
|
handlePagination,
|
|
|
|
presendOptions,
|
|
|
|
presendPath,
|
|
|
|
} from '../GenericFunctions';
|
2024-11-25 02:55:45 -08:00
|
|
|
|
|
|
|
export const groupOperations: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
|
|
|
noDataExpression: true,
|
|
|
|
default: 'getAll',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: ['group'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create a new group',
|
|
|
|
routing: {
|
|
|
|
request: {
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
'X-Amz-Target': 'AWSCognitoIdentityProviderService.CreateGroup',
|
|
|
|
},
|
2024-11-28 00:03:01 -08:00
|
|
|
ignoreHttpStatusErrors: true,
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
output: {
|
|
|
|
postReceive: [handleErrorPostReceive],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
action: 'Create group',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
|
|
|
description: 'Delete an existing group',
|
|
|
|
routing: {
|
|
|
|
request: {
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
'X-Amz-Target': 'AWSCognitoIdentityProviderService.DeleteGroup',
|
|
|
|
},
|
2024-11-28 00:03:01 -08:00
|
|
|
ignoreHttpStatusErrors: true,
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
output: {
|
2024-11-26 16:04:52 -08:00
|
|
|
postReceive: [
|
|
|
|
handleErrorPostReceive,
|
|
|
|
{
|
|
|
|
type: 'set',
|
|
|
|
properties: {
|
2024-12-09 06:16:01 -08:00
|
|
|
value: '={{ { "success": true } }}',
|
2024-11-26 16:04:52 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
action: 'Delete group',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Retrieve details of an existing group',
|
|
|
|
routing: {
|
|
|
|
request: {
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
2024-11-26 04:20:53 -08:00
|
|
|
'X-Amz-Target': 'AWSCognitoIdentityProviderService.GetGroup',
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
2024-11-28 00:03:01 -08:00
|
|
|
ignoreHttpStatusErrors: true,
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
output: {
|
|
|
|
postReceive: [handleErrorPostReceive],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
action: 'Get group',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get Many',
|
|
|
|
value: 'getAll',
|
|
|
|
description: 'Retrieve a list of groups',
|
|
|
|
routing: {
|
2024-11-28 11:07:25 -08:00
|
|
|
send: { paginate: true },
|
|
|
|
operations: { pagination: handlePagination },
|
2024-11-25 02:55:45 -08:00
|
|
|
request: {
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
'X-Amz-Target': 'AWSCognitoIdentityProviderService.ListGroups',
|
|
|
|
},
|
|
|
|
qs: {
|
|
|
|
pageSize:
|
2024-12-05 11:15:33 -08:00
|
|
|
'={{ $parameter["limit"] ? ($parameter["limit"] < 60 ? $parameter["limit"] : 60) : 60 }}',
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
2024-11-28 00:03:01 -08:00
|
|
|
ignoreHttpStatusErrors: true,
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
output: {
|
2024-11-28 11:07:25 -08:00
|
|
|
postReceive: [handleErrorPostReceive],
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
action: 'Get many groups',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
|
|
|
description: 'Update an existing group',
|
|
|
|
routing: {
|
2024-12-09 06:16:01 -08:00
|
|
|
send: {
|
|
|
|
preSend: [presendOptions],
|
|
|
|
},
|
2024-11-25 02:55:45 -08:00
|
|
|
request: {
|
|
|
|
method: 'POST',
|
|
|
|
headers: {
|
|
|
|
'X-Amz-Target': 'AWSCognitoIdentityProviderService.UpdateGroup',
|
|
|
|
},
|
2024-11-28 00:03:01 -08:00
|
|
|
ignoreHttpStatusErrors: true,
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
output: {
|
2024-11-26 16:04:52 -08:00
|
|
|
postReceive: [
|
|
|
|
handleErrorPostReceive,
|
|
|
|
{
|
|
|
|
type: 'set',
|
|
|
|
properties: {
|
2024-12-09 06:16:01 -08:00
|
|
|
value: '={{ { "success": true } }}',
|
2024-11-26 16:04:52 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
action: 'Update group',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const createFields: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'User Pool ID',
|
|
|
|
name: 'userPoolId',
|
|
|
|
required: true,
|
|
|
|
type: 'resourceLocator',
|
|
|
|
default: {
|
|
|
|
mode: 'list',
|
|
|
|
value: '',
|
|
|
|
},
|
|
|
|
description: 'The user pool ID where the users are managed',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: ['group'],
|
|
|
|
operation: ['create'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
type: 'body',
|
|
|
|
property: 'UserPoolId',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
modes: [
|
|
|
|
{
|
2024-11-26 16:04:52 -08:00
|
|
|
displayName: 'From list',
|
2024-11-25 02:55:45 -08:00
|
|
|
name: 'list',
|
|
|
|
type: 'list',
|
|
|
|
typeOptions: {
|
|
|
|
searchListMethod: 'searchUserPools',
|
|
|
|
searchable: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'By ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
hint: 'Enter the user pool ID',
|
|
|
|
validation: [
|
|
|
|
{
|
|
|
|
type: 'regex',
|
|
|
|
properties: {
|
|
|
|
regex: '^[\\w-]+_[0-9a-zA-Z]+$',
|
2024-11-26 16:04:52 -08:00
|
|
|
errorMessage: 'The ID must follow the pattern "xxxxxx_xxxxxxxxxxx".',
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
placeholder: 'e.g. eu-central-1_ab12cdefgh',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2024-11-28 00:03:01 -08:00
|
|
|
displayName: 'Group Name',
|
2024-11-26 04:20:53 -08:00
|
|
|
name: 'GroupName',
|
2024-11-25 02:55:45 -08:00
|
|
|
default: '',
|
|
|
|
placeholder: 'e.g. My New Group',
|
|
|
|
description: 'The name of the new group to create',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: ['group'],
|
|
|
|
operation: ['create'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
routing: {
|
|
|
|
send: {
|
2024-11-26 04:20:53 -08:00
|
|
|
property: 'GroupName',
|
2024-11-25 02:55:45 -08:00
|
|
|
type: 'body',
|
2024-11-26 04:20:53 -08:00
|
|
|
paginate: true,
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
type: 'string',
|
|
|
|
validateType: 'string',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Options',
|
|
|
|
name: 'options',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: ['group'],
|
|
|
|
operation: ['create'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
2024-11-26 16:04:52 -08:00
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'Description',
|
|
|
|
default: '',
|
|
|
|
placeholder: 'e.g. New group description',
|
|
|
|
description: 'A description for the new group',
|
|
|
|
type: 'string',
|
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
type: 'body',
|
|
|
|
property: 'Description',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Precedence',
|
|
|
|
name: 'Precedence',
|
|
|
|
default: '',
|
|
|
|
placeholder: 'e.g. 10',
|
|
|
|
description: 'Precedence value for the group. Lower values indicate higher priority.',
|
|
|
|
type: 'number',
|
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
type: 'body',
|
|
|
|
property: 'Precedence',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
validateType: 'number',
|
|
|
|
},
|
2024-11-25 02:55:45 -08:00
|
|
|
{
|
|
|
|
displayName: 'Path',
|
|
|
|
name: 'path',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
placeholder: 'e.g. /division_abc/engineering/',
|
|
|
|
description: 'The path to the group, if it is not included, it defaults to a slash (/)',
|
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
property: 'Path',
|
|
|
|
type: 'body',
|
2024-12-05 11:15:33 -08:00
|
|
|
preSend: [presendPath],
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-11-26 16:04:52 -08:00
|
|
|
{
|
|
|
|
displayName: 'Role ARN',
|
2024-12-05 11:15:33 -08:00
|
|
|
name: 'Arn',
|
2024-11-26 16:04:52 -08:00
|
|
|
default: '',
|
|
|
|
placeholder: 'e.g. arn:aws:iam::123456789012:role/GroupRole',
|
|
|
|
description: 'The role ARN for the group, used for setting claims in tokens',
|
|
|
|
type: 'string',
|
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
type: 'body',
|
2024-12-05 11:15:33 -08:00
|
|
|
property: 'Arn',
|
2024-11-26 16:04:52 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-11-25 02:55:45 -08:00
|
|
|
],
|
|
|
|
placeholder: 'Add Option',
|
|
|
|
type: 'collection',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const deleteFields: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'User Pool ID',
|
|
|
|
name: 'userPoolId',
|
|
|
|
required: true,
|
|
|
|
type: 'resourceLocator',
|
|
|
|
default: {
|
|
|
|
mode: 'list',
|
|
|
|
value: '',
|
|
|
|
},
|
|
|
|
description: 'The user pool ID where the users are managed',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: ['group'],
|
|
|
|
operation: ['delete'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
type: 'body',
|
|
|
|
property: 'UserPoolId',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
modes: [
|
|
|
|
{
|
2024-11-26 16:04:52 -08:00
|
|
|
displayName: 'From list',
|
2024-11-25 02:55:45 -08:00
|
|
|
name: 'list',
|
|
|
|
type: 'list',
|
|
|
|
typeOptions: {
|
|
|
|
searchListMethod: 'searchUserPools',
|
|
|
|
searchable: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'By ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
hint: 'Enter the user pool ID',
|
|
|
|
validation: [
|
|
|
|
{
|
|
|
|
type: 'regex',
|
|
|
|
properties: {
|
|
|
|
regex: '^[\\w-]+_[0-9a-zA-Z]+$',
|
|
|
|
errorMessage: 'The ID must follow the pattern "xxxxxx_xxxxxxxxxxx"',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
placeholder: 'e.g. eu-central-1_ab12cdefgh',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2024-11-26 16:04:52 -08:00
|
|
|
displayName: 'Group',
|
2024-11-26 04:20:53 -08:00
|
|
|
name: 'GroupName',
|
2024-11-25 02:55:45 -08:00
|
|
|
default: {
|
|
|
|
mode: 'list',
|
|
|
|
value: '',
|
|
|
|
},
|
|
|
|
description: 'Select the group you want to delete',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: ['group'],
|
|
|
|
operation: ['delete'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
modes: [
|
|
|
|
{
|
2024-11-26 04:20:53 -08:00
|
|
|
displayName: 'From list',
|
2024-11-25 02:55:45 -08:00
|
|
|
name: 'list',
|
|
|
|
type: 'list',
|
|
|
|
typeOptions: {
|
2024-11-26 16:04:52 -08:00
|
|
|
searchListMethod: 'searchGroups',
|
2024-11-25 02:55:45 -08:00
|
|
|
searchable: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2024-11-26 04:20:53 -08:00
|
|
|
displayName: 'By Name',
|
2024-11-26 16:04:52 -08:00
|
|
|
name: 'GroupName',
|
2024-11-25 02:55:45 -08:00
|
|
|
type: 'string',
|
2024-11-26 04:20:53 -08:00
|
|
|
hint: 'Enter the group name',
|
|
|
|
validation: [
|
|
|
|
{
|
|
|
|
type: 'regex',
|
|
|
|
properties: {
|
|
|
|
regex: '^[\\w+=,.@-]+$',
|
2024-11-26 16:04:52 -08:00
|
|
|
errorMessage: 'The group name must follow the allowed pattern.',
|
2024-11-26 04:20:53 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
placeholder: 'e.g. Admins',
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
required: true,
|
2024-11-26 04:20:53 -08:00
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
type: 'body',
|
|
|
|
property: 'GroupName',
|
|
|
|
},
|
|
|
|
},
|
2024-11-25 02:55:45 -08:00
|
|
|
type: 'resourceLocator',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const getFields: INodeProperties[] = [
|
|
|
|
{
|
2024-11-26 04:20:53 -08:00
|
|
|
displayName: 'User Pool ID',
|
|
|
|
name: 'userPoolId',
|
|
|
|
required: true,
|
|
|
|
type: 'resourceLocator',
|
2024-11-25 02:55:45 -08:00
|
|
|
default: {
|
|
|
|
mode: 'list',
|
|
|
|
value: '',
|
|
|
|
},
|
2024-11-26 04:20:53 -08:00
|
|
|
description: 'The user pool ID where the users are managed',
|
2024-11-25 02:55:45 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: ['group'],
|
|
|
|
operation: ['get'],
|
|
|
|
},
|
|
|
|
},
|
2024-11-26 04:20:53 -08:00
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
type: 'body',
|
|
|
|
property: 'UserPoolId',
|
|
|
|
},
|
|
|
|
},
|
2024-11-25 02:55:45 -08:00
|
|
|
modes: [
|
|
|
|
{
|
2024-11-26 06:47:14 -08:00
|
|
|
displayName: 'From list',
|
2024-11-25 02:55:45 -08:00
|
|
|
name: 'list',
|
|
|
|
type: 'list',
|
|
|
|
typeOptions: {
|
2024-11-26 04:20:53 -08:00
|
|
|
searchListMethod: 'searchUserPools',
|
2024-11-25 02:55:45 -08:00
|
|
|
searchable: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'By ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
2024-11-26 04:20:53 -08:00
|
|
|
hint: 'Enter the user pool ID',
|
|
|
|
validation: [
|
|
|
|
{
|
|
|
|
type: 'regex',
|
|
|
|
properties: {
|
|
|
|
regex: '^[\\w-]+_[0-9a-zA-Z]+$',
|
|
|
|
errorMessage: 'The ID must follow the pattern "xxxxxx_xxxxxxxxxxx"',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
placeholder: 'e.g. eu-central-1_ab12cdefgh',
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2024-11-26 16:04:52 -08:00
|
|
|
displayName: 'Group',
|
2024-11-26 04:20:53 -08:00
|
|
|
name: 'GroupName',
|
|
|
|
required: true,
|
|
|
|
type: 'resourceLocator',
|
2024-11-26 16:04:52 -08:00
|
|
|
default: {
|
|
|
|
mode: 'list',
|
|
|
|
value: '',
|
|
|
|
},
|
|
|
|
description: 'Select the group you want to retrieve',
|
2024-11-26 06:47:14 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: ['group'],
|
|
|
|
operation: ['get'],
|
|
|
|
},
|
|
|
|
},
|
2024-11-26 04:20:53 -08:00
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
type: 'body',
|
|
|
|
property: 'GroupName',
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
},
|
2024-11-26 04:20:53 -08:00
|
|
|
modes: [
|
2024-11-25 02:55:45 -08:00
|
|
|
{
|
2024-11-26 04:20:53 -08:00
|
|
|
displayName: 'From list',
|
|
|
|
name: 'list',
|
|
|
|
type: 'list',
|
2024-11-25 02:55:45 -08:00
|
|
|
typeOptions: {
|
2024-11-26 06:47:14 -08:00
|
|
|
searchListMethod: 'searchGroups',
|
2024-11-26 04:20:53 -08:00
|
|
|
searchable: true,
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2024-11-26 04:20:53 -08:00
|
|
|
displayName: 'By Name',
|
2024-11-26 06:47:14 -08:00
|
|
|
name: 'GroupName',
|
2024-11-26 04:20:53 -08:00
|
|
|
type: 'string',
|
|
|
|
hint: 'Enter the group name',
|
|
|
|
validation: [
|
|
|
|
{
|
|
|
|
type: 'regex',
|
|
|
|
properties: {
|
|
|
|
regex: '^[\\w+=,.@-]+$',
|
2024-11-26 06:47:14 -08:00
|
|
|
errorMessage: 'The group name must follow the allowed pattern.',
|
2024-11-26 04:20:53 -08:00
|
|
|
},
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
2024-11-26 04:20:53 -08:00
|
|
|
],
|
|
|
|
placeholder: 'e.g. Admins',
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const getAllFields: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'User Pool ID',
|
|
|
|
name: 'userPoolId',
|
|
|
|
required: true,
|
|
|
|
type: 'resourceLocator',
|
|
|
|
default: { mode: 'list', value: '' },
|
|
|
|
description: 'The user pool ID where the users are managed',
|
|
|
|
displayOptions: { show: { resource: ['group'], operation: ['getAll'] } },
|
|
|
|
routing: { send: { type: 'body', property: 'UserPoolId' } },
|
|
|
|
modes: [
|
|
|
|
{
|
2024-11-26 16:04:52 -08:00
|
|
|
displayName: 'From list',
|
2024-11-25 02:55:45 -08:00
|
|
|
name: 'list',
|
|
|
|
type: 'list',
|
|
|
|
typeOptions: {
|
|
|
|
searchListMethod: 'searchUserPools',
|
|
|
|
searchable: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'By ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
hint: 'Enter the user pool ID',
|
|
|
|
validation: [
|
|
|
|
{
|
|
|
|
type: 'regex',
|
|
|
|
properties: {
|
|
|
|
regex: '^[\\w-]+_[0-9a-zA-Z]+$',
|
|
|
|
errorMessage: 'The ID must follow the pattern "xxxxxx_xxxxxxxxxxx"',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
placeholder: 'e.g. eu-central-1_ab12cdefgh',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2024-12-05 11:15:33 -08:00
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
2024-11-25 02:55:45 -08:00
|
|
|
default: false,
|
2024-12-05 11:15:33 -08:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
|
|
displayOptions: { show: { resource: ['group'], operation: ['getAll'] } },
|
2024-11-26 16:04:52 -08:00
|
|
|
type: 'boolean',
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
{
|
2024-12-05 11:15:33 -08:00
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
required: true,
|
|
|
|
type: 'number',
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
2024-12-05 11:15:33 -08:00
|
|
|
default: 20,
|
|
|
|
description: 'Max number of results to return',
|
|
|
|
displayOptions: { show: { resource: ['group'], operation: ['getAll'], returnAll: [false] } },
|
|
|
|
routing: { send: { type: 'body', property: 'Limit' } },
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const updateFields: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'User Pool ID',
|
|
|
|
name: 'userPoolId',
|
|
|
|
required: true,
|
|
|
|
type: 'resourceLocator',
|
|
|
|
default: {
|
|
|
|
mode: 'list',
|
|
|
|
value: '',
|
|
|
|
},
|
|
|
|
description: 'The user pool ID where the users are managed',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: ['group'],
|
|
|
|
operation: ['update'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
type: 'body',
|
|
|
|
property: 'UserPoolId',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
modes: [
|
|
|
|
{
|
2024-11-26 16:04:52 -08:00
|
|
|
displayName: 'From list',
|
2024-11-25 02:55:45 -08:00
|
|
|
name: 'list',
|
|
|
|
type: 'list',
|
|
|
|
typeOptions: {
|
|
|
|
searchListMethod: 'searchUserPools',
|
|
|
|
searchable: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'By ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
hint: 'Enter the user pool ID',
|
|
|
|
validation: [
|
|
|
|
{
|
|
|
|
type: 'regex',
|
|
|
|
properties: {
|
|
|
|
regex: '^[\\w-]+_[0-9a-zA-Z]+$',
|
|
|
|
errorMessage: 'The ID must follow the pattern "xxxxxx_xxxxxxxxxxx"',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
placeholder: 'e.g. eu-central-1_ab12cdefgh',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2024-11-26 16:04:52 -08:00
|
|
|
displayName: 'Group',
|
2024-11-26 04:20:53 -08:00
|
|
|
name: 'GroupName',
|
2024-11-25 02:55:45 -08:00
|
|
|
default: {
|
|
|
|
mode: 'list',
|
|
|
|
value: '',
|
|
|
|
},
|
|
|
|
description: 'Select the group you want to update',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: ['group'],
|
|
|
|
operation: ['update'],
|
|
|
|
},
|
|
|
|
},
|
2024-11-26 16:04:52 -08:00
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
type: 'body',
|
|
|
|
property: 'GroupName',
|
|
|
|
},
|
|
|
|
},
|
2024-11-25 02:55:45 -08:00
|
|
|
modes: [
|
|
|
|
{
|
2024-11-26 16:04:52 -08:00
|
|
|
displayName: 'From list',
|
2024-11-25 02:55:45 -08:00
|
|
|
name: 'list',
|
|
|
|
type: 'list',
|
|
|
|
typeOptions: {
|
2024-11-26 06:47:14 -08:00
|
|
|
searchListMethod: 'searchGroups',
|
2024-11-25 02:55:45 -08:00
|
|
|
searchable: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2024-11-26 04:20:53 -08:00
|
|
|
displayName: 'By Name',
|
2024-11-26 06:47:14 -08:00
|
|
|
name: 'GroupName',
|
2024-11-25 02:55:45 -08:00
|
|
|
type: 'string',
|
2024-11-26 04:20:53 -08:00
|
|
|
hint: 'Enter the group name',
|
|
|
|
validation: [
|
|
|
|
{
|
|
|
|
type: 'regex',
|
|
|
|
properties: {
|
|
|
|
regex: '^[\\w+=,.@-]+$',
|
2024-11-26 06:47:14 -08:00
|
|
|
errorMessage: 'The group name must follow the allowed pattern.',
|
2024-11-26 04:20:53 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
placeholder: 'e.g. Admins',
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
required: true,
|
|
|
|
type: 'resourceLocator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Options',
|
|
|
|
name: 'options',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: ['group'],
|
|
|
|
operation: ['update'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
2024-11-26 16:04:52 -08:00
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'Description',
|
|
|
|
default: '',
|
|
|
|
placeholder: 'e.g. Updated group description',
|
|
|
|
description: 'A new description for the group',
|
|
|
|
type: 'string',
|
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
type: 'body',
|
|
|
|
property: 'Description',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Precedence',
|
|
|
|
name: 'Precedence',
|
|
|
|
default: '',
|
|
|
|
placeholder: 'e.g. 10',
|
|
|
|
description:
|
|
|
|
'The new precedence value for the group. Lower values indicate higher priority.',
|
|
|
|
type: 'number',
|
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
type: 'body',
|
|
|
|
property: 'Precedence',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
validateType: 'number',
|
|
|
|
},
|
2024-11-25 02:55:45 -08:00
|
|
|
{
|
|
|
|
displayName: 'Path',
|
|
|
|
name: 'path',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
placeholder: 'e.g. /division_abc/engineering/',
|
|
|
|
description: 'The path to the group, if it is not included, it defaults to a slash (/)',
|
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
property: 'Path',
|
|
|
|
type: 'body',
|
2024-12-05 11:15:33 -08:00
|
|
|
preSend: [presendPath],
|
2024-11-25 02:55:45 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-11-26 16:04:52 -08:00
|
|
|
{
|
|
|
|
displayName: 'Role ARN',
|
2024-12-05 11:15:33 -08:00
|
|
|
name: 'Arn',
|
2024-11-26 16:04:52 -08:00
|
|
|
default: '',
|
|
|
|
placeholder: 'e.g. arn:aws:iam::123456789012:role/GroupRole',
|
|
|
|
description:
|
|
|
|
'A new role Amazon Resource Name (ARN) for the group. Used for setting claims in tokens.',
|
|
|
|
type: 'string',
|
|
|
|
routing: {
|
|
|
|
send: {
|
|
|
|
type: 'body',
|
2024-12-05 11:15:33 -08:00
|
|
|
property: 'Arn',
|
2024-11-26 16:04:52 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-11-25 02:55:45 -08:00
|
|
|
],
|
|
|
|
placeholder: 'Add Option',
|
|
|
|
type: 'collection',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const groupFields: INodeProperties[] = [
|
|
|
|
...createFields,
|
|
|
|
...deleteFields,
|
|
|
|
...getFields,
|
|
|
|
...getAllFields,
|
|
|
|
...updateFields,
|
|
|
|
];
|