mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
fix(AWS SNS Trigger Node): add missing jsonParse import (#4463)
* fix(AwsSnsTrigger): add missing jsonParse import * add clear typings for req.rawBody and getHeaderData()
This commit is contained in:
committed by
GitHub
parent
d9a41ea9d7
commit
e6ec134cf3
@@ -74,7 +74,7 @@ import crypto, { createHmac } from 'crypto';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { get } from 'lodash';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import express from 'express';
|
||||
import type { Request, Response } from 'express';
|
||||
import FormData from 'form-data';
|
||||
import path from 'path';
|
||||
import { OptionsWithUri, OptionsWithUrl } from 'request';
|
||||
@@ -103,6 +103,7 @@ import {
|
||||
} from '.';
|
||||
import { extractValue } from './ExtractValue';
|
||||
import { getClientCredentialsToken } from './OAuth2Helper';
|
||||
import { IncomingHttpHeaders } from 'http';
|
||||
|
||||
axios.defaults.timeout = 300000;
|
||||
// Prevent axios from adding x-form-www-urlencoded headers by default
|
||||
@@ -2937,7 +2938,7 @@ export function getExecuteWebhookFunctions(
|
||||
async getCredentials(type: string): Promise<ICredentialDataDecryptedObject> {
|
||||
return getCredentials(workflow, node, type, additionalData, mode);
|
||||
},
|
||||
getHeaderData(): object {
|
||||
getHeaderData(): IncomingHttpHeaders {
|
||||
if (additionalData.httpRequest === undefined) {
|
||||
throw new Error('Request is missing!');
|
||||
}
|
||||
@@ -2987,13 +2988,13 @@ export function getExecuteWebhookFunctions(
|
||||
}
|
||||
return additionalData.httpRequest.query;
|
||||
},
|
||||
getRequestObject(): express.Request {
|
||||
getRequestObject(): Request {
|
||||
if (additionalData.httpRequest === undefined) {
|
||||
throw new Error('Request is missing!');
|
||||
}
|
||||
return additionalData.httpRequest;
|
||||
},
|
||||
getResponseObject(): express.Response {
|
||||
getResponseObject(): Response {
|
||||
if (additionalData.httpResponse === undefined) {
|
||||
throw new Error('Response is missing!');
|
||||
}
|
||||
|
||||
@@ -19,3 +19,9 @@ export * from './LoadNodeListSearch';
|
||||
export * from './NodeExecuteFunctions';
|
||||
export * from './WorkflowExecute';
|
||||
export { NodeExecuteFunctions, UserSettings };
|
||||
|
||||
declare module 'http' {
|
||||
export interface IncomingMessage {
|
||||
rawBody: Buffer;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user