UNPKG

@mindconnect/mindconnect-nodejs

Version:

MindConnect Library for NodeJS (community based)

36 lines (35 loc) 1.88 kB
import { TimeStampedDataPoint } from ".."; import { IMindConnectConfiguration } from "./mindconnect-models"; export declare const convertToTdpArray: (data: any[]) => TimeStampedDataPoint[]; export declare type authJson = { auth: string; iv: string; gateway: string; tenant: string; }; export declare const isUrl: (url: string) => boolean; export declare const getPiamUrl: (gateway: string, tenant: string) => string; export declare const encrypt: (user: string, password: string, passkey: string, gateway: string, tenant: string) => authJson; export declare const decrypt: (encryptedAuth: authJson, passkey: string) => string; export declare const getAgentDir: (path?: string | undefined) => string; export declare const getHomeDotMcDir: () => string; export declare const storeAuth: (encryptedAuth: authJson) => void; export declare const loadAuth: () => authJson; export declare const getConfigProfile: (config: IMindConnectConfiguration) => string; export declare const checkCertificate: (config: IMindConnectConfiguration, options: any) => boolean; /** * retry the function n times (while progressively waiting for the success) until success * the waiting schema is iteration * timeoutInMiliseconds (default is 300ms) * * @param {number} n * @param {Function} func * @param {number} [timoutinMilliseconds=300] * @param {Function} [logFunction] * @returns */ export declare const retry: (n: number, func: Function, timoutinMilliseconds?: number, logFunction?: Function | undefined) => Promise<any>; export declare const checkAssetId: (agentId: string) => void; export declare const throwError: (error: string) => never; export declare const toQueryString: (qs: any) => string; export declare const removeUndefined: (obj: any) => any; export declare function checksumFile(hashName: string, path: string): Promise<string>;