first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user