diff --git a/packages/nodes-base/nodes/Aws/AwsLambda.node.ts b/packages/nodes-base/nodes/Aws/AwsLambda.node.ts index 75d5e98680..b08d28ba70 100644 --- a/packages/nodes-base/nodes/Aws/AwsLambda.node.ts +++ b/packages/nodes-base/nodes/Aws/AwsLambda.node.ts @@ -140,6 +140,27 @@ export class AwsLambda implements INodeType { value: func.FunctionArn as string, }); } + + if (data.NextMarker) { + let marker: string = data.NextMarker; + while (true) { + const dataLoop = await awsApiRequestREST.call(this, 'lambda', 'GET', `/2015-03-31/functions/?MaxItems=50&Marker=${encodeURIComponent(marker)}`); + + for (const func of dataLoop.Functions!) { + returnData.push({ + name: func.FunctionName as string, + value: func.FunctionArn as string, + }); + } + + if (dataLoop.NextMarker) { + marker = dataLoop.NextMarker; + } else { + break; + } + } + } + return returnData; }, }, diff --git a/packages/nodes-base/nodes/Aws/Comprehend/AwsComprehend.node.ts b/packages/nodes-base/nodes/Aws/Comprehend/AwsComprehend.node.ts index 7640586d4a..179aef23d6 100644 --- a/packages/nodes-base/nodes/Aws/Comprehend/AwsComprehend.node.ts +++ b/packages/nodes-base/nodes/Aws/Comprehend/AwsComprehend.node.ts @@ -63,6 +63,11 @@ export class AwsComprehend implements INodeType { value: 'detectSentiment', description: 'Analyse the sentiment of the text', }, + { + name: 'Detect Entities', + value: 'detectEntities', + description: 'Inspects text for named entities, and returns information about them', + }, ], default: 'detectDominantLanguage', description: 'The operation to perform.', @@ -129,6 +134,7 @@ export class AwsComprehend implements INodeType { ], operation: [ 'detectSentiment', + 'detectEntities', ], }, }, @@ -168,6 +174,26 @@ export class AwsComprehend implements INodeType { default: true, description: 'When set to true a simplify version of the response will be used else the raw data.', }, + { + displayName: 'Endpoint Arn', + name: 'endpointArn', + type: 'string', + typeOptions: { + alwaysOpenEditWindow: true, + }, + default: '', + displayOptions: { + show: { + resource: [ + 'text', + ], + operation: [ + 'detectEntities', + ], + }, + }, + description: 'The Amazon Resource Name of an endpoint that is associated with a custom entity recognition model.', + }, ], }; @@ -209,6 +235,25 @@ export class AwsComprehend implements INodeType { }; responseData = await awsApiRequestREST.call(this, 'comprehend', 'POST', '', JSON.stringify(body), { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }); } + + //https://docs.aws.amazon.com/comprehend/latest/dg/API_DetectEntities.html + if (operation === 'detectEntities') { + const action = 'Comprehend_20171127.DetectEntities'; + const text = this.getNodeParameter('text', i) as string; + const languageCode = this.getNodeParameter('languageCode', i) as string; + const endpointArn = this.getNodeParameter('endpointArn', i) as string; + + const body: IDataObject = { + Text: text, + LanguageCode: languageCode, + }; + + if (endpointArn && endpointArn !== '') { + body.EndpointArn = endpointArn; + } + + responseData = await awsApiRequestREST.call(this, 'comprehend', 'POST', '', JSON.stringify(body), { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }); + } } if (Array.isArray(responseData)) {