Add text detection operation to AWS Rekognition (#1417)

This commit is contained in:
Ricardo Espinoza
2021-02-21 04:47:34 -05:00
committed by GitHub
parent 4d4ab7943b
commit 13e76e33e8
2 changed files with 179 additions and 44 deletions

View File

@@ -29,6 +29,10 @@ import {
IDataObject,
} from 'n8n-workflow';
import {
pascalCase,
} from 'change-case';
export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string | Buffer | IDataObject, query: IDataObject = {}, headers?: object, option: IDataObject = {}, region?: string): Promise<any> { // tslint:disable-line:no-any
const credentials = this.getCredentials('aws');
if (credentials === undefined) {
@@ -128,3 +132,11 @@ export async function awsApiRequestSOAPAllItems(this: IHookFunctions | IExecuteF
function queryToString(params: IDataObject) {
return Object.keys(params).map(key => key + '=' + params[key]).join('&');
}
export function keysTPascalCase(object: IDataObject) {
const data: IDataObject = {};
for (const key of Object.keys(object)) {
data[pascalCase(key as string)] = object[key];
}
return data;
}