n8n-nodes-binalyze-air
Version:
Binalyze AIR nodes for automating DFIR with n8n workflows
45 lines (44 loc) • 3.26 kB
TypeScript
import { IExecuteFunctions, ILoadOptionsFunctions, IHttpRequestOptions, IHttpRequestMethods, INodePropertyOptions, INodeListSearchItems, INodeListSearchResult, INodeExecutionData } from 'n8n-workflow';
import { AirCredentials } from '../../../credentials/AirApi.credentials';
export interface PaginationInfo {
totalEntityCount: number;
pageSize: number;
currentPage: number;
totalPageCount: number;
}
export interface ApiResponse {
success: boolean;
result?: {
entities?: any[];
totalEntityCount?: number;
currentPage?: number;
pageSize?: number;
previousPage?: number;
totalPageCount?: number;
nextPage?: number;
sortables?: string[];
filters?: any[];
} | any[];
errors?: string[];
}
export declare function getAirCredentials(context: IExecuteFunctions | ILoadOptionsFunctions): Promise<AirCredentials>;
export declare function buildRequestOptions(credentials: AirCredentials, method: IHttpRequestMethods, endpoint: string, queryParams?: Record<string, string | number>): IHttpRequestOptions;
export declare function validateApiResponse(responseData: ApiResponse, context?: string): void;
export declare function makeApiRequestWithErrorHandling<T>(context: IExecuteFunctions | ILoadOptionsFunctions, requestOptions: IHttpRequestOptions, operation: string, itemIndex?: number): Promise<T>;
export declare function buildRequestOptionsWithErrorHandling(credentials: AirCredentials, method: IHttpRequestMethods, endpoint: string, queryParams?: Record<string, string | number>): IHttpRequestOptions;
export declare function extractEntityId(entity: any, entityType?: string): string;
export declare function normalizeAndValidateId(id: any, fieldName?: string): string;
export declare function isValidEntity(entity: any, requiredFields?: string[]): boolean;
export declare function validateAndExtractOrganizationId(context: IExecuteFunctions, credentials: AirCredentials, organizationResource: any, itemIndex: number, findOrganizationByNameFn: (context: IExecuteFunctions, credentials: AirCredentials, name: string) => Promise<string>): Promise<string>;
export declare function createListSearchResults(entities: any[], validationFn: (entity: any) => boolean, mapFn: (entity: any) => INodeListSearchItems, filter?: string): INodeListSearchResult;
export declare function createLoadOptions(entities: any[], validationFn: (entity: any) => boolean, mapFn: (entity: any) => INodePropertyOptions): INodePropertyOptions[];
export declare function handleExecuteError(context: IExecuteFunctions, error: any, itemIndex: number, returnData: INodeExecutionData[]): void;
export declare function extractEntitiesFromResponse(responseData: ApiResponse): any[];
export declare function hasResponsePagination(responseData: ApiResponse): boolean;
export declare function extractPaginationInfo(source: ApiResponse | any): PaginationInfo | null;
export declare function processApiResponseEntities(entities: any[], returnData: INodeExecutionData[], itemIndex: number, options?: {
includePagination?: boolean;
paginationData?: PaginationInfo | null;
excludeFields?: string[];
}): void;
export declare function catchAndFormatError(error: any, operation: string): Error;