import { IAllExecuteFunctions , IBinaryData , ICredentialTestFunctions as ICredentialTestFunctionsBase , ICredentialType , IDataObject , IExecuteFunctions as IExecuteFunctionsBase , IExecuteSingleFunctions as IExecuteSingleFunctionsBase , IHookFunctions as IHookFunctionsBase , IHttpRequestOptions , ILoadOptionsFunctions as ILoadOptionsFunctionsBase , INodeExecutionData , INodeType , IOAuth2Options , IPollFunctions as IPollFunctionsBase , IPollResponse , ITriggerFunctions as ITriggerFunctionsBase , ITriggerResponse , IWebhookFunctions as IWebhookFunctionsBase , IWorkflowSettings as IWorkflowSettingsWorkflow , } from 'n8n-workflow' ; import { OptionsWithUri , OptionsWithUrl } from 'request' ; import * as requestPromise from 'request-promise-native' ; interface Constructable < T > { new ( ) : T ; } export interface IProcessMessage { data ? : any ; type : string ; } export interface IExecuteFunctions extends IExecuteFunctionsBase { helpers : { httpRequest ( requestOptions ) : Promise < any > ; prepareBinaryData ( binaryData , filePath ? , mimeType ? ) : Promise < IBinaryData > ; getBinaryDataBuffer ( itemIndex , propertyName ) : Promise < Buffer > ; request : ( uriOrObject : string | IDataObject | any , options ? : IDataObject ) => Promise < any > ; requestOAuth2 ( this , credentialsType , requestOptions , oAuth2Options ? ) : Promise < any > ; requestOAuth1 ( this , credentialsType , requestOptions ) : Promise < any > ; returnJsonArray ( jsonData ) : INodeExecutionData [ ] ; } ; } export interface IExecuteSingleFunctions extends IExecuteSingleFunctionsBase { helpers : { httpRequest ( requestOptions ) : Promise < any > ; prepareBinaryData ( binaryData , filePath ? , mimeType ? ) : Promise < IBinaryData > ; request : ( uriOrObject : string | IDataObject | any , options ? : IDataObject ) => Promise < any > ; requestOAuth2 ( this , credentialsType , requestOptions , oAuth2Options ? ) : Promise < any > ; requestOAuth1 ( this , credentialsType , requestOptions ) : Promise < any > ; } ; } export interface IPollFunctions extends IPollFunctionsBase { helpers : { httpRequest ( requestOptions ) : Promise < any > ; prepareBinaryData ( binaryData , filePath ? , mimeType ? ) : Promise < IBinaryData > ; request : ( uriOrObject : string | IDataObject | any , options ? : IDataObject ) => Promise < any > ; requestOAuth2 ( this , credentialsType , requestOptions , oAuth2Options ? ) : Promise < any > ; requestOAuth1 ( this , credentialsType , requestOptions ) : Promise < any > ; returnJsonArray ( jsonData ) : INodeExecutionData [ ] ; } ; } export interface IResponseError extends Error { statusCode ? : number ; } export interface ITriggerFunctions extends ITriggerFunctionsBase { helpers : { httpRequest ( requestOptions ) : Promise < any > ; prepareBinaryData ( binaryData , filePath ? , mimeType ? ) : Promise < IBinaryData > ; request : ( uriOrObject : string | IDataObject | any , options ? : IDataObject ) => Promise < any > ; requestOAuth2 ( this , credentialsType , requestOptions , oAuth2Options ? ) : Promise < any > ; requestOAuth1 ( this , credentialsType , requestOptions ) : Promise < any > ; returnJsonArray ( jsonData ) : INodeExecutionData [ ] ; } ; } export interface ITriggerTime { mode : string ; hour : number ; minute : number ; dayOfMonth : number ; weekeday : number ; [ key ] : string | number ; } export interface IUserSettings { encryptionKey ? : string ; tunnelSubdomain ? : string ; instanceId ? : string ; } export interface ILoadOptionsFunctions extends ILoadOptionsFunctionsBase { helpers : { httpRequest ( requestOptions ) : Promise < any > ; request ? : ( uriOrObject : string | IDataObject | any , options ? : IDataObject ) => Promise < any > ; requestOAuth2 ? : ( this : IAllExecuteFunctions , credentialsType : string , requestOptions : OptionsWithUri | requestPromise . RequestPromiseOptions , oAuth2Options ? : IOAuth2Options ) => Promise < any > ; requestOAuth1 ? ( this , credentialsType , requestOptions ) : Promise < any > ; } ; } export interface ICredentialTestFunctions extends ICredentialTestFunctionsBase { helpers : { request : requestPromise . RequestPromiseAPI ; } ; } export interface IHookFunctions extends IHookFunctionsBase { helpers : { httpRequest ( requestOptions ) : Promise < any > ; request : ( uriOrObject : string | IDataObject | any , options ? : IDataObject ) => Promise < any > ; requestOAuth2 ( this , credentialsType , requestOptions , oAuth2Options ? ) : Promise < any > ; requestOAuth1 ( this , credentialsType , requestOptions ) : Promise < any > ; } ; } export interface IWebhookFunctions extends IWebhookFunctionsBase { helpers : { httpRequest ( requestOptions ) : Promise < any > ; prepareBinaryData ( binaryData , filePath ? , mimeType ? ) : Promise < IBinaryData > ; request : ( uriOrObject : string | IDataObject | any , options ? : IDataObject ) => Promise < any > ; requestOAuth2 ( this , credentialsType , requestOptions , oAuth2Options ? ) : Promise < any > ; requestOAuth1 ( this , credentialsType , requestOptions ) : Promise < any > ; returnJsonArray ( jsonData ) : INodeExecutionData [ ] ; } ; } export interface IWorkflowSettings extends IWorkflowSettingsWorkflow { errorWorkflow ? : string ; timezone ? : string ; saveManualRuns ? : boolean ; } export interface INodeDefinitionFile { [ key ] : Constructable < INodeType | ICredentialType > ; } export interface INodeInputDataConnections { [ key ] : INodeExecutionData [ ] [ ] ; } export interface IWorkflowData { pollResponses ? : IPollResponse [ ] ; triggerResponses ? : ITriggerResponse [ ] ; } export interface IBinaryDataConfig { mode : 'default' | 'filesystem' ; availableModes : string ; localStoragePath : string ; binaryDataTTL : number ; persistedBinaryDataTTL : number ; } export interface IBinaryDataManager { init ( startPurger ) : Promise < void > ; storeBinaryData ( binaryBuffer , executionId ) : Promise < string > ; retrieveBinaryDataByIdentifier ( identifier ) : Promise < Buffer > ; markDataForDeletionByExecutionId ( executionId ) : Promise < void > ; deleteMarkedFiles ( ) : Promise < unknown > ; deleteBinaryDataByIdentifier ( identifier ) : Promise < void > ; duplicateBinaryDataByIdentifier ( binaryDataId , prefix ) : Promise < string > ; deleteBinaryDataByExecutionId ( executionId ) : Promise < void > ; persistBinaryDataForExecutionId ( executionId ) : Promise < void > ; }