mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
Fixed issues after feedback
This commit is contained in:
parent
3615cd9021
commit
3f15fd5cfc
|
@ -29,15 +29,22 @@ export class AwsCognito implements INodeType {
|
||||||
inputs: [NodeConnectionType.Main],
|
inputs: [NodeConnectionType.Main],
|
||||||
outputs: [NodeConnectionType.Main],
|
outputs: [NodeConnectionType.Main],
|
||||||
hints: [
|
hints: [
|
||||||
// ToDo: Add hints
|
{
|
||||||
// {
|
message: 'Please select a parameter in the options to update the user',
|
||||||
// message: 'Please select a parameter in the options to modify the post',
|
displayCondition:
|
||||||
// displayCondition:
|
'={{$parameter["resource"] === "user" && $parameter["operation"] === "update" && Object.keys($parameter["additionalOptions"]).length === 0}}',
|
||||||
// '={{$parameter["resource"] === "user" && $parameter["operation"] === "update" && Object.keys($parameter["additionalOptions"]).length === 0}}',
|
whenToDisplay: 'always',
|
||||||
// whenToDisplay: 'always',
|
location: 'outputPane',
|
||||||
// location: 'outputPane',
|
type: 'warning',
|
||||||
// type: 'warning',
|
},
|
||||||
// },
|
{
|
||||||
|
message: 'Please select a parameter in the options to update the group',
|
||||||
|
displayCondition:
|
||||||
|
'={{$parameter["resource"] === "group" && $parameter["operation"] === "update" && Object.keys($parameter["options"]).length === 0}}',
|
||||||
|
whenToDisplay: 'always',
|
||||||
|
location: 'outputPane',
|
||||||
|
type: 'warning',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
credentials: [
|
credentials: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,8 +37,6 @@ export async function presendFilter(
|
||||||
let filterType = additionalFields.filterType as string;
|
let filterType = additionalFields.filterType as string;
|
||||||
const filterValue = additionalFields.filterValue as string;
|
const filterValue = additionalFields.filterValue as string;
|
||||||
|
|
||||||
console.log('Attribute', filterAttribute, 'Type', filterType, 'Value', filterValue);
|
|
||||||
|
|
||||||
if (!filterAttribute || !filterType || !filterValue) {
|
if (!filterAttribute || !filterType || !filterValue) {
|
||||||
throw new NodeOperationError(
|
throw new NodeOperationError(
|
||||||
this.getNode(),
|
this.getNode(),
|
||||||
|
@ -240,6 +238,12 @@ export async function handleErrorPostReceive(
|
||||||
}
|
}
|
||||||
} else if (resource === 'user') {
|
} else if (resource === 'user') {
|
||||||
if (operation === 'create') {
|
if (operation === 'create') {
|
||||||
|
if (errorType === 'UserNotFoundException') {
|
||||||
|
throw new NodeApiError(this.getNode(), response as unknown as JsonObject, {
|
||||||
|
message: "'Message Action: Resend' needs an existing user",
|
||||||
|
description: 'Adjust the "User Name" parameter setting to create the user correctly.',
|
||||||
|
});
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
errorType === 'UsernameExistsException' &&
|
errorType === 'UsernameExistsException' &&
|
||||||
errorMessage === 'User account already exists'
|
errorMessage === 'User account already exists'
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
import type { INodeProperties } from 'n8n-workflow';
|
import type { INodeProperties } from 'n8n-workflow';
|
||||||
|
|
||||||
import { handleErrorPostReceive, handlePagination, presendPath } from '../GenericFunctions';
|
import {
|
||||||
|
handleErrorPostReceive,
|
||||||
|
handlePagination,
|
||||||
|
presendOptions,
|
||||||
|
presendPath,
|
||||||
|
} from '../GenericFunctions';
|
||||||
|
|
||||||
export const groupOperations: INodeProperties[] = [
|
export const groupOperations: INodeProperties[] = [
|
||||||
{
|
{
|
||||||
|
@ -51,7 +56,7 @@ export const groupOperations: INodeProperties[] = [
|
||||||
{
|
{
|
||||||
type: 'set',
|
type: 'set',
|
||||||
properties: {
|
properties: {
|
||||||
value: '={{ { "deleted": true } }}',
|
value: '={{ { "success": true } }}',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -106,6 +111,9 @@ export const groupOperations: INodeProperties[] = [
|
||||||
value: 'update',
|
value: 'update',
|
||||||
description: 'Update an existing group',
|
description: 'Update an existing group',
|
||||||
routing: {
|
routing: {
|
||||||
|
send: {
|
||||||
|
preSend: [presendOptions],
|
||||||
|
},
|
||||||
request: {
|
request: {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -119,7 +127,7 @@ export const groupOperations: INodeProperties[] = [
|
||||||
{
|
{
|
||||||
type: 'set',
|
type: 'set',
|
||||||
properties: {
|
properties: {
|
||||||
value: '={{ { "updated": true } }}',
|
value: '={{ { "success": true } }}',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -39,7 +39,7 @@ export const userOperations: INodeProperties[] = [
|
||||||
{
|
{
|
||||||
type: 'set',
|
type: 'set',
|
||||||
properties: {
|
properties: {
|
||||||
value: '={{ { "added": true } }}',
|
value: '={{ { "success": true } }}',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -83,7 +83,7 @@ export const userOperations: INodeProperties[] = [
|
||||||
{
|
{
|
||||||
type: 'set',
|
type: 'set',
|
||||||
properties: {
|
properties: {
|
||||||
value: '={{ { "deleted": true } }}',
|
value: '={{ { "success": true } }}',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -113,7 +113,10 @@ export const userOperations: INodeProperties[] = [
|
||||||
value: 'getAll',
|
value: 'getAll',
|
||||||
description: 'Retrieve a list of users',
|
description: 'Retrieve a list of users',
|
||||||
routing: {
|
routing: {
|
||||||
send: { paginate: true },
|
send: {
|
||||||
|
paginate: true,
|
||||||
|
preSend: [presendFilter],
|
||||||
|
},
|
||||||
operations: { pagination: handlePagination },
|
operations: { pagination: handlePagination },
|
||||||
request: {
|
request: {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
@ -151,7 +154,7 @@ export const userOperations: INodeProperties[] = [
|
||||||
{
|
{
|
||||||
type: 'set',
|
type: 'set',
|
||||||
properties: {
|
properties: {
|
||||||
value: '={{ { "removed": true } }}',
|
value: '={{ { "success": true } }}',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -177,7 +180,7 @@ export const userOperations: INodeProperties[] = [
|
||||||
{
|
{
|
||||||
type: 'set',
|
type: 'set',
|
||||||
properties: {
|
properties: {
|
||||||
value: '={{ { "updated": true } }}',
|
value: '={{ { "success": true } }}',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -428,11 +431,11 @@ const createFields: INodeProperties[] = [
|
||||||
],
|
],
|
||||||
routing: {
|
routing: {
|
||||||
send: {
|
send: {
|
||||||
|
preSend: [processAttributes],
|
||||||
type: 'body',
|
type: 'body',
|
||||||
property: 'UserAttributes',
|
property: 'UserAttributes',
|
||||||
value:
|
value:
|
||||||
'={{ $value.attributes?.map(attribute => ({ Name: attribute.Name, Value: attribute.Value })) || [] }}',
|
'={{ $value.attributes?.map(attribute => ({ Name: attribute.Name, Value: attribute.Value })) || [] }}',
|
||||||
preSend: [processAttributes],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -703,11 +706,6 @@ const getAllFields: INodeProperties[] = [
|
||||||
default: 'username',
|
default: 'username',
|
||||||
hint: 'Make sure to select an attribute, type, and provide a value before submitting.',
|
hint: 'Make sure to select an attribute, type, and provide a value before submitting.',
|
||||||
description: 'The attribute to search for',
|
description: 'The attribute to search for',
|
||||||
routing: {
|
|
||||||
send: {
|
|
||||||
preSend: [presendFilter],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
options: [
|
options: [
|
||||||
{ name: 'Cognito User Status', value: 'cognito:user_status' },
|
{ name: 'Cognito User Status', value: 'cognito:user_status' },
|
||||||
{ name: 'Email', value: 'email' },
|
{ name: 'Email', value: 'email' },
|
||||||
|
|
Loading…
Reference in a new issue