pull:初次提交
This commit is contained in:
@@ -0,0 +1,132 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const userPoolResourceLocator: INodeProperties = {
|
||||
displayName: 'User Pool',
|
||||
name: 'userPool',
|
||||
required: true,
|
||||
type: 'resourceLocator',
|
||||
default: {
|
||||
mode: 'list',
|
||||
value: '',
|
||||
},
|
||||
routing: {
|
||||
send: {
|
||||
type: 'body',
|
||||
property: 'UserPoolId',
|
||||
},
|
||||
},
|
||||
modes: [
|
||||
{
|
||||
displayName: 'From list',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
typeOptions: {
|
||||
searchListMethod: 'searchUserPools',
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'By ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
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',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const groupResourceLocator: INodeProperties = {
|
||||
displayName: 'Group',
|
||||
name: 'group',
|
||||
default: {
|
||||
mode: 'list',
|
||||
value: '',
|
||||
},
|
||||
routing: {
|
||||
send: {
|
||||
type: 'body',
|
||||
property: 'GroupName',
|
||||
},
|
||||
},
|
||||
modes: [
|
||||
{
|
||||
displayName: 'From list',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
typeOptions: {
|
||||
searchListMethod: 'searchGroups',
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'By Name',
|
||||
name: 'groupName',
|
||||
type: 'string',
|
||||
hint: 'Enter the group name',
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: '^[\\w+=,.@-]+$',
|
||||
errorMessage: 'The group name must follow the allowed pattern.',
|
||||
},
|
||||
},
|
||||
],
|
||||
placeholder: 'e.g. Admins',
|
||||
},
|
||||
],
|
||||
required: true,
|
||||
type: 'resourceLocator',
|
||||
};
|
||||
|
||||
export const userResourceLocator: INodeProperties = {
|
||||
displayName: 'User',
|
||||
name: 'user',
|
||||
default: {
|
||||
mode: 'list',
|
||||
value: '',
|
||||
},
|
||||
modes: [
|
||||
{
|
||||
displayName: 'From List',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
typeOptions: {
|
||||
searchListMethod: 'searchUsers',
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'By ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
hint: 'Enter the user ID',
|
||||
placeholder: 'e.g. 02bd9fd6-8f93-4758-87c3-1fb73740a315',
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: '^[\\w-]+-[0-9a-zA-Z]+$',
|
||||
errorMessage: 'The ID must follow the pattern "xxxxxx-xxxxxxxxxxx"',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
routing: {
|
||||
send: {
|
||||
type: 'body',
|
||||
property: 'Username',
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
type: 'resourceLocator',
|
||||
};
|
||||
@@ -0,0 +1,155 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import * as create from './create.operation';
|
||||
import * as del from './delete.operation';
|
||||
import * as get from './get.operation';
|
||||
import * as getAll from './getAll.operation';
|
||||
import * as update from './update.operation';
|
||||
import { handleError } from '../../helpers/errorHandler';
|
||||
import { processGroup } from '../../helpers/utils';
|
||||
|
||||
export const description: 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',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
handleError,
|
||||
{
|
||||
type: 'rootProperty',
|
||||
properties: {
|
||||
property: 'Group',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
action: 'Create group',
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
description: 'Delete an existing group',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Amz-Target': 'AWSCognitoIdentityProviderService.DeleteGroup',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
handleError,
|
||||
{
|
||||
type: 'set',
|
||||
properties: {
|
||||
value: '={{ { "deleted": true } }}',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
action: 'Delete group',
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Retrieve details of an existing group',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Amz-Target': 'AWSCognitoIdentityProviderService.GetGroup',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [handleError, processGroup],
|
||||
},
|
||||
},
|
||||
action: 'Get group',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Retrieve a list of groups',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Amz-Target': 'AWSCognitoIdentityProviderService.ListGroups',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
handleError,
|
||||
processGroup,
|
||||
{
|
||||
type: 'rootProperty',
|
||||
properties: {
|
||||
property: 'Groups',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
action: 'Get many groups',
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
value: 'update',
|
||||
description: 'Update an existing group',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Amz-Target': 'AWSCognitoIdentityProviderService.UpdateGroup',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
handleError,
|
||||
{
|
||||
type: 'set',
|
||||
properties: {
|
||||
value: '={{ { "updated": true } }}',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
action: 'Update group',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
...create.description,
|
||||
...del.description,
|
||||
...get.description,
|
||||
...getAll.description,
|
||||
...update.description,
|
||||
];
|
||||
@@ -0,0 +1,106 @@
|
||||
import type { IExecuteSingleFunctions, IHttpRequestOptions, INodeProperties } from 'n8n-workflow';
|
||||
import { NodeApiError, updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { validateArn } from '../../helpers/utils';
|
||||
import { userPoolResourceLocator } from '../common.description';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userPoolResourceLocator,
|
||||
description: 'Select the user pool to use',
|
||||
},
|
||||
{
|
||||
displayName: 'Group Name',
|
||||
name: 'newGroupName',
|
||||
default: '',
|
||||
placeholder: 'e.g. MyNewGroup',
|
||||
description: 'The name of the new group to create',
|
||||
required: true,
|
||||
type: 'string',
|
||||
validateType: 'string',
|
||||
routing: {
|
||||
send: {
|
||||
property: 'GroupName',
|
||||
type: 'body',
|
||||
preSend: [
|
||||
async function (
|
||||
this: IExecuteSingleFunctions,
|
||||
requestOptions: IHttpRequestOptions,
|
||||
): Promise<IHttpRequestOptions> {
|
||||
const newGroupName = this.getNodeParameter('newGroupName', '') as string;
|
||||
const groupNameRegex = /^[\p{L}\p{M}\p{S}\p{N}\p{P}]+$/u;
|
||||
if (!groupNameRegex.test(newGroupName)) {
|
||||
throw new NodeApiError(this.getNode(), {
|
||||
message: 'Invalid format for Group Name',
|
||||
description: 'Group Name should not contain spaces.',
|
||||
});
|
||||
}
|
||||
return requestOptions;
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
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',
|
||||
},
|
||||
{
|
||||
displayName: 'Role ARN',
|
||||
name: 'arn',
|
||||
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',
|
||||
property: 'Arn',
|
||||
preSend: [validateArn],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
placeholder: 'Add Option',
|
||||
type: 'collection',
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['group'],
|
||||
operation: ['create'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,24 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { groupResourceLocator, userPoolResourceLocator } from '../common.description';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userPoolResourceLocator,
|
||||
description: 'Select the user pool to use',
|
||||
},
|
||||
{
|
||||
...groupResourceLocator,
|
||||
description: 'Select the group you want to delete',
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['group'],
|
||||
operation: ['delete'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,31 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { groupResourceLocator, userPoolResourceLocator } from '../common.description';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userPoolResourceLocator,
|
||||
description: 'Select the user pool to use',
|
||||
},
|
||||
{
|
||||
...groupResourceLocator,
|
||||
description: 'Select the group you want to retrieve',
|
||||
},
|
||||
{
|
||||
displayName: 'Include Users',
|
||||
name: 'includeUsers',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether to include a list of users in the group',
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['group'],
|
||||
operation: ['get'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,72 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { userPoolResourceLocator } from '../common.description';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userPoolResourceLocator,
|
||||
description: 'Select the user pool to use',
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
type: 'boolean',
|
||||
routing: {
|
||||
operations: {
|
||||
pagination: {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
continue: '={{ !!$response.body?.NextToken }}',
|
||||
request: {
|
||||
body: {
|
||||
NextToken: '={{ $response.body?.NextToken }}',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
required: true,
|
||||
type: 'number',
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 60,
|
||||
},
|
||||
default: 50,
|
||||
description: 'Max number of results to return',
|
||||
displayOptions: {
|
||||
show: {
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
routing: {
|
||||
send: {
|
||||
type: 'body',
|
||||
property: 'Limit',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Include Users',
|
||||
name: 'includeUsers',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether to include a list of users in the group',
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['group'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,107 @@
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteSingleFunctions,
|
||||
IHttpRequestOptions,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError, updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { validateArn } from '../../helpers/utils';
|
||||
import { groupResourceLocator, userPoolResourceLocator } from '../common.description';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userPoolResourceLocator,
|
||||
description: 'Select the user pool to use',
|
||||
},
|
||||
{
|
||||
...groupResourceLocator,
|
||||
description: 'Select the group you want to update',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
placeholder: 'Add Option',
|
||||
type: 'collection',
|
||||
default: {},
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [
|
||||
async function (
|
||||
this: IExecuteSingleFunctions,
|
||||
requestOptions: IHttpRequestOptions,
|
||||
): Promise<IHttpRequestOptions> {
|
||||
const additionalFields = this.getNodeParameter('additionalFields', {}) as IDataObject;
|
||||
const arn = additionalFields.arn as string | undefined;
|
||||
const description = additionalFields.description as string | undefined;
|
||||
const precedence = additionalFields.precedence as number | undefined;
|
||||
if (!description && !precedence && !arn) {
|
||||
throw new NodeApiError(this.getNode(), {
|
||||
message: 'At least one field must be provided for update.',
|
||||
description: 'Please provide a value for Description, Precedence, or Role ARN.',
|
||||
});
|
||||
}
|
||||
return requestOptions;
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
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',
|
||||
},
|
||||
{
|
||||
displayName: 'Role ARN',
|
||||
name: 'arn',
|
||||
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',
|
||||
property: 'Arn',
|
||||
preSend: [validateArn],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['group'],
|
||||
operation: ['update'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,3 @@
|
||||
export * as group from './group/Group.resource';
|
||||
export * as user from './user/User.resource';
|
||||
export * as userPool from './userPool/UserPool.resource';
|
||||
@@ -0,0 +1,229 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import * as addToGroup from './addToGroup.operation';
|
||||
import * as create from './create.operation';
|
||||
import * as del from './delete.operation';
|
||||
import * as get from './get.operation';
|
||||
import * as getAll from './getAll.operation';
|
||||
import * as removeFromGroup from './removeFromGroup.operation';
|
||||
import * as update from './update.operation';
|
||||
import { handleError } from '../../helpers/errorHandler';
|
||||
import { preSendUserFields, simplifyUser } from '../../helpers/utils';
|
||||
|
||||
export const description: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
default: 'getAll',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Add to Group',
|
||||
value: 'addToGroup',
|
||||
description: 'Add an existing user to a group',
|
||||
action: 'Add user to group',
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [preSendUserFields],
|
||||
},
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Amz-Target': 'AWSCognitoIdentityProviderService.AdminAddUserToGroup',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
handleError,
|
||||
{
|
||||
type: 'set',
|
||||
properties: {
|
||||
value: '={{ { "addedToGroup": true } }}',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Create',
|
||||
value: 'create',
|
||||
description: 'Create a new user',
|
||||
action: 'Create user',
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [preSendUserFields],
|
||||
},
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Amz-Target': 'AWSCognitoIdentityProviderService.AdminCreateUser',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
handleError,
|
||||
{
|
||||
type: 'rootProperty',
|
||||
properties: {
|
||||
property: 'User',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
description: 'Delete a user',
|
||||
action: 'Delete user',
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [preSendUserFields],
|
||||
},
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Amz-Target': 'AWSCognitoIdentityProviderService.AdminDeleteUser',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
handleError,
|
||||
{
|
||||
type: 'set',
|
||||
properties: {
|
||||
value: '={{ { "deleted": true } }}',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Retrieve information of an existing user',
|
||||
action: 'Get user',
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [preSendUserFields],
|
||||
},
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Amz-Target': 'AWSCognitoIdentityProviderService.AdminGetUser',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [handleError, simplifyUser],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Retrieve a list of users',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Amz-Target': 'AWSCognitoIdentityProviderService.ListUsers',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
handleError,
|
||||
simplifyUser,
|
||||
{
|
||||
type: 'rootProperty',
|
||||
properties: {
|
||||
property: 'Users',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
action: 'Get many users',
|
||||
},
|
||||
{
|
||||
name: 'Remove From Group',
|
||||
value: 'removeFromGroup',
|
||||
description: 'Remove a user from a group',
|
||||
action: 'Remove user from group',
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [preSendUserFields],
|
||||
},
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Amz-Target': 'AWSCognitoIdentityProviderService.AdminRemoveUserFromGroup',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
handleError,
|
||||
{
|
||||
type: 'set',
|
||||
properties: {
|
||||
value: '={{ { "removedFromGroup": true } }}',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
value: 'update',
|
||||
description: 'Update an existing user',
|
||||
action: 'Update user',
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [preSendUserFields],
|
||||
},
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Amz-Target': 'AWSCognitoIdentityProviderService.AdminUpdateUserAttributes',
|
||||
},
|
||||
ignoreHttpStatusErrors: true,
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
handleError,
|
||||
{
|
||||
type: 'set',
|
||||
properties: {
|
||||
value: '={{ { "updated": true } }}',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
...create.description,
|
||||
...del.description,
|
||||
...get.description,
|
||||
...getAll.description,
|
||||
...update.description,
|
||||
...addToGroup.description,
|
||||
...removeFromGroup.description,
|
||||
];
|
||||
@@ -0,0 +1,32 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
groupResourceLocator,
|
||||
userPoolResourceLocator,
|
||||
userResourceLocator,
|
||||
} from '../common.description';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userPoolResourceLocator,
|
||||
description: 'Select the user pool to use',
|
||||
},
|
||||
{
|
||||
...userResourceLocator,
|
||||
description: 'Select the user you want to add to the group',
|
||||
},
|
||||
{
|
||||
...groupResourceLocator,
|
||||
description: 'Select the group you want to add the user to',
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['addToGroup'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,280 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { preSendAttributes, preSendDesiredDeliveryMediums } from '../../helpers/utils';
|
||||
import { userPoolResourceLocator } from '../common.description';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userPoolResourceLocator,
|
||||
description: 'Select the user pool to retrieve',
|
||||
},
|
||||
{
|
||||
displayName: 'User Name',
|
||||
name: 'newUserName',
|
||||
default: '',
|
||||
description:
|
||||
'Depending on the user pool settings, this parameter requires the username, the email, or the phone number. No whitespace is allowed.',
|
||||
placeholder: 'e.g. JohnSmith',
|
||||
required: true,
|
||||
routing: {
|
||||
send: {
|
||||
property: 'Username',
|
||||
type: 'body',
|
||||
},
|
||||
},
|
||||
type: 'string',
|
||||
validateType: 'string',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Message Action',
|
||||
name: 'messageAction',
|
||||
default: 'RESEND',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Resend',
|
||||
value: 'RESEND',
|
||||
description:
|
||||
"Resend the invitation message to a user that already exists and reset the expiration limit on the user's account",
|
||||
},
|
||||
{
|
||||
name: 'Suppress',
|
||||
value: 'SUPPRESS',
|
||||
description: 'Suppress sending the message',
|
||||
},
|
||||
],
|
||||
routing: {
|
||||
send: {
|
||||
property: 'MessageAction',
|
||||
type: 'body',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Force Alias Creation',
|
||||
name: 'forceAliasCreation',
|
||||
type: 'boolean',
|
||||
validateType: 'boolean',
|
||||
default: false,
|
||||
description:
|
||||
'Whether this parameter is used only if the phone_number_verified or email_verified attribute is set to true. Otherwise, it is ignored. If set to true, and the phone number or email address specified in the UserAttributes parameter already exists as an alias with a different user, the alias will be migrated. If set to false, an AliasExistsException error is thrown if the alias already exists.',
|
||||
routing: {
|
||||
send: {
|
||||
type: 'body',
|
||||
property: 'ForceAliasCreation',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'User Attributes',
|
||||
name: 'userAttributes',
|
||||
type: 'fixedCollection',
|
||||
placeholder: 'Add Attribute',
|
||||
default: {
|
||||
attributes: [],
|
||||
},
|
||||
required: true,
|
||||
description: 'Attributes to update for the user',
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [preSendAttributes],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Attributes',
|
||||
name: 'attributes',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Attribute Type',
|
||||
name: 'attributeType',
|
||||
type: 'options',
|
||||
default: 'standard',
|
||||
options: [
|
||||
{
|
||||
name: 'Standard Attribute',
|
||||
value: 'standard',
|
||||
},
|
||||
{
|
||||
name: 'Custom Attribute',
|
||||
value: 'custom',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Standard Attribute',
|
||||
name: 'standardName',
|
||||
type: 'options',
|
||||
default: 'address',
|
||||
options: [
|
||||
{
|
||||
name: 'Address',
|
||||
value: 'address',
|
||||
},
|
||||
{
|
||||
name: 'Birthdate',
|
||||
value: 'birthdate',
|
||||
},
|
||||
{
|
||||
name: 'Email',
|
||||
value: 'email',
|
||||
},
|
||||
{
|
||||
name: 'Email Verified',
|
||||
value: 'email_verified',
|
||||
},
|
||||
{
|
||||
name: 'Family Name',
|
||||
value: 'family_name',
|
||||
},
|
||||
{
|
||||
name: 'Gender',
|
||||
value: 'gender',
|
||||
},
|
||||
{
|
||||
name: 'Given Name',
|
||||
value: 'given_name',
|
||||
},
|
||||
{
|
||||
name: 'Locale',
|
||||
value: 'locale',
|
||||
},
|
||||
{
|
||||
name: 'Middle Name',
|
||||
value: 'middle_name',
|
||||
},
|
||||
{
|
||||
name: 'Name',
|
||||
value: 'name',
|
||||
},
|
||||
{
|
||||
name: 'Nickname',
|
||||
value: 'nickname',
|
||||
},
|
||||
{
|
||||
name: 'Phone Number',
|
||||
value: 'phone_number',
|
||||
},
|
||||
{
|
||||
name: 'Phone Number Verified',
|
||||
value: 'phone_number_verified',
|
||||
},
|
||||
{
|
||||
name: 'Preferred Username',
|
||||
value: 'preferred_username',
|
||||
},
|
||||
{
|
||||
name: 'Profile Picture',
|
||||
value: 'profilepicture',
|
||||
},
|
||||
{
|
||||
name: 'Updated At',
|
||||
value: 'updated_at',
|
||||
},
|
||||
{
|
||||
name: 'User Sub',
|
||||
value: 'sub',
|
||||
},
|
||||
{
|
||||
name: 'Website',
|
||||
value: 'website',
|
||||
},
|
||||
{
|
||||
name: 'Zone Info',
|
||||
value: 'zoneinfo',
|
||||
},
|
||||
],
|
||||
displayOptions: {
|
||||
show: {
|
||||
attributeType: ['standard'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Custom Attribute Name',
|
||||
name: 'customName',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'custom:myAttribute',
|
||||
description: 'The name of the custom attribute (must start with "custom:")',
|
||||
displayOptions: {
|
||||
show: {
|
||||
attributeType: ['custom'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Value',
|
||||
name: 'value',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The value of the attribute',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Desired Delivery Mediums',
|
||||
name: 'desiredDeliveryMediums',
|
||||
default: ['SMS'],
|
||||
description: 'Specify how to send the welcome message',
|
||||
type: 'multiOptions',
|
||||
options: [
|
||||
{
|
||||
name: 'SMS',
|
||||
value: 'SMS',
|
||||
},
|
||||
{
|
||||
name: 'Email',
|
||||
value: 'EMAIL',
|
||||
},
|
||||
],
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [preSendDesiredDeliveryMediums],
|
||||
property: 'DesiredDeliveryMediums',
|
||||
type: 'body',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Temporary Password',
|
||||
name: 'temporaryPasswordOptions',
|
||||
type: 'string',
|
||||
typeOptions: {
|
||||
password: true,
|
||||
},
|
||||
default: '',
|
||||
description:
|
||||
"The user's temporary password that will be valid only once. If not set, Amazon Cognito will automatically generate one for you.",
|
||||
routing: {
|
||||
send: {
|
||||
property: 'TemporaryPassword',
|
||||
type: 'body',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['create'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,24 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { userPoolResourceLocator, userResourceLocator } from '../common.description';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userPoolResourceLocator,
|
||||
description: 'Select the user pool to use',
|
||||
},
|
||||
{
|
||||
...userResourceLocator,
|
||||
description: 'Select the user you want to delete',
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['delete'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,31 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { userPoolResourceLocator, userResourceLocator } from '../common.description';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userPoolResourceLocator,
|
||||
description: 'Select the user pool to use',
|
||||
},
|
||||
{
|
||||
...userResourceLocator,
|
||||
description: 'Select the user you want to retrieve',
|
||||
},
|
||||
{
|
||||
displayName: 'Simplify',
|
||||
name: 'simple',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description: 'Whether to return a simplified version of the response instead of the raw data',
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['get'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,174 @@
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteSingleFunctions,
|
||||
IHttpRequestOptions,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
import { jsonParse, updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import type { Filters } from '../../helpers/interfaces';
|
||||
import { userPoolResourceLocator } from '../common.description';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userPoolResourceLocator,
|
||||
description: 'Select the user pool to use',
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
type: 'boolean',
|
||||
routing: {
|
||||
operations: {
|
||||
pagination: {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
continue: '={{ !!$response.body?.PaginationToken }}',
|
||||
|
||||
request: {
|
||||
body: {
|
||||
PaginationToken: '={{ $response.body?.PaginationToken }}',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
required: true,
|
||||
type: 'number',
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 60,
|
||||
},
|
||||
default: 50,
|
||||
description: 'Max number of results to return',
|
||||
displayOptions: {
|
||||
show: {
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
routing: {
|
||||
send: {
|
||||
type: 'body',
|
||||
property: 'Limit',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Simplify',
|
||||
name: 'simple',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description: 'Whether to return a simplified version of the response instead of the raw data',
|
||||
},
|
||||
{
|
||||
displayName: 'Filters',
|
||||
name: 'filters',
|
||||
type: 'fixedCollection',
|
||||
placeholder: 'Add Filter',
|
||||
default: {},
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [
|
||||
async function (
|
||||
this: IExecuteSingleFunctions,
|
||||
requestOptions: IHttpRequestOptions,
|
||||
): Promise<IHttpRequestOptions> {
|
||||
const filters = this.getNodeParameter('filters', {}) as Filters;
|
||||
const filter = filters.filter;
|
||||
if (!filter?.value) return requestOptions;
|
||||
const { attribute: filterAttribute, value: filterValue } = filter;
|
||||
const body = jsonParse<IDataObject>(String(requestOptions.body), {
|
||||
acceptJSObject: true,
|
||||
errorMessage: 'Invalid request body. Request body must be valid JSON.',
|
||||
});
|
||||
const filterString = filterAttribute ? `"${filterAttribute}"^="${filterValue}"` : '';
|
||||
return {
|
||||
...requestOptions,
|
||||
body: JSON.stringify({ ...body, Filter: filterString }),
|
||||
};
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Filter',
|
||||
name: 'filter',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Attribute',
|
||||
name: 'attribute',
|
||||
type: 'options',
|
||||
default: 'email',
|
||||
description: 'The attribute to search for',
|
||||
options: [
|
||||
{
|
||||
name: 'Cognito User Status',
|
||||
value: 'cognito:user_status',
|
||||
},
|
||||
{
|
||||
name: 'Email',
|
||||
value: 'email',
|
||||
},
|
||||
{
|
||||
name: 'Family Name',
|
||||
value: 'family_name',
|
||||
},
|
||||
{
|
||||
name: 'Given Name',
|
||||
value: 'given_name',
|
||||
},
|
||||
{
|
||||
name: 'Name',
|
||||
value: 'name',
|
||||
},
|
||||
{
|
||||
name: 'Phone Number',
|
||||
value: 'phone_number',
|
||||
},
|
||||
{
|
||||
name: 'Preferred Username',
|
||||
value: 'preferred_username',
|
||||
},
|
||||
{
|
||||
name: 'Status (Enabled)',
|
||||
value: 'status',
|
||||
},
|
||||
{
|
||||
name: 'Sub',
|
||||
value: 'sub',
|
||||
},
|
||||
{
|
||||
name: 'Username',
|
||||
value: 'username',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Value',
|
||||
name: 'value',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The value of the attribute to search for',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,43 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
groupResourceLocator,
|
||||
userPoolResourceLocator,
|
||||
userResourceLocator,
|
||||
} from '../common.description';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userPoolResourceLocator,
|
||||
description: 'Select the user pool to use',
|
||||
},
|
||||
{
|
||||
...userResourceLocator,
|
||||
description: 'Select the user you want to remove from the group',
|
||||
},
|
||||
{
|
||||
...groupResourceLocator,
|
||||
description: 'Select the group you want to remove the user from',
|
||||
modes: groupResourceLocator.modes?.map((mode) =>
|
||||
mode.name === 'list'
|
||||
? {
|
||||
...mode,
|
||||
typeOptions: {
|
||||
...mode.typeOptions,
|
||||
searchListMethod: 'searchGroupsForUser',
|
||||
},
|
||||
}
|
||||
: mode,
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['removeFromGroup'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,166 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { preSendAttributes } from '../../helpers/utils';
|
||||
import { userPoolResourceLocator, userResourceLocator } from '../common.description';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userPoolResourceLocator,
|
||||
description: 'Select the user pool to use',
|
||||
},
|
||||
userResourceLocator,
|
||||
{
|
||||
displayName: 'User Attributes',
|
||||
name: 'userAttributes',
|
||||
type: 'fixedCollection',
|
||||
placeholder: 'Add Attribute',
|
||||
default: {
|
||||
attributes: [],
|
||||
},
|
||||
required: true,
|
||||
description: 'Attributes to update for the user',
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [preSendAttributes],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Attributes',
|
||||
name: 'attributes',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Attribute Type',
|
||||
name: 'attributeType',
|
||||
type: 'options',
|
||||
default: 'standard',
|
||||
options: [
|
||||
{
|
||||
name: 'Standard Attribute',
|
||||
value: 'standard',
|
||||
},
|
||||
{
|
||||
name: 'Custom Attribute',
|
||||
value: 'custom',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Standard Attribute',
|
||||
name: 'standardName',
|
||||
type: 'options',
|
||||
default: 'address',
|
||||
options: [
|
||||
{
|
||||
name: 'Address',
|
||||
value: 'address',
|
||||
},
|
||||
{
|
||||
name: 'Birthdate',
|
||||
value: 'birthdate',
|
||||
},
|
||||
{
|
||||
name: 'Email',
|
||||
value: 'email',
|
||||
},
|
||||
{
|
||||
name: 'Family Name',
|
||||
value: 'family_name',
|
||||
},
|
||||
{
|
||||
name: 'Gender',
|
||||
value: 'gender',
|
||||
},
|
||||
{
|
||||
name: 'Given Name',
|
||||
value: 'given_name',
|
||||
},
|
||||
{
|
||||
name: 'Locale',
|
||||
value: 'locale',
|
||||
},
|
||||
{
|
||||
name: 'Middle Name',
|
||||
value: 'middle_name',
|
||||
},
|
||||
{
|
||||
name: 'Name',
|
||||
value: 'name',
|
||||
},
|
||||
{
|
||||
name: 'Nickname',
|
||||
value: 'nickname',
|
||||
},
|
||||
{
|
||||
name: 'Phone Number',
|
||||
value: 'phone_number',
|
||||
},
|
||||
{
|
||||
name: 'Preferred Username',
|
||||
value: 'preferred_username',
|
||||
},
|
||||
{
|
||||
name: 'Profile Picture',
|
||||
value: 'profilepicture',
|
||||
},
|
||||
{
|
||||
name: 'Updated At',
|
||||
value: 'updated_at',
|
||||
},
|
||||
{
|
||||
name: 'User Sub',
|
||||
value: 'sub',
|
||||
},
|
||||
{
|
||||
name: 'Website',
|
||||
value: 'website',
|
||||
},
|
||||
{
|
||||
name: 'Zone Info',
|
||||
value: 'zoneinfo',
|
||||
},
|
||||
],
|
||||
displayOptions: {
|
||||
show: {
|
||||
attributeType: ['standard'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Custom Attribute Name',
|
||||
name: 'customName',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'custom:myAttribute',
|
||||
description: 'The name of the custom attribute (must start with "custom:")',
|
||||
displayOptions: {
|
||||
show: {
|
||||
attributeType: ['custom'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Value',
|
||||
name: 'value',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The value of the attribute',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['user'],
|
||||
operation: ['update'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,47 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import * as get from './get.operation';
|
||||
import { simplifyUserPool } from '../../helpers/utils';
|
||||
|
||||
export const description: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['userPool'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
action: 'Get user pool',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-Amz-Target': 'AWSCognitoIdentityProviderService.DescribeUserPool',
|
||||
},
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
simplifyUserPool,
|
||||
{
|
||||
type: 'rootProperty',
|
||||
properties: {
|
||||
property: 'UserPool',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
default: 'get',
|
||||
},
|
||||
|
||||
...get.description,
|
||||
];
|
||||
@@ -0,0 +1,27 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { userPoolResourceLocator } from '../common.description';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...userPoolResourceLocator,
|
||||
description: 'Select the user pool to retrieve',
|
||||
},
|
||||
{
|
||||
displayName: 'Simplify',
|
||||
name: 'simple',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description: 'Whether to return a simplified version of the response instead of the raw data',
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['userPool'],
|
||||
operation: ['get'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
Reference in New Issue
Block a user