UNPKG

@sphereon/ssi-sdk.anomaly-detection

Version:

39 lines (34 loc) 1.48 kB
import { IAgentPlugin, IPluginMethodMap, IAgentContext } from '@veramo/core'; import { GeolocationStoreArgs, IGeolocationStore } from '@sphereon/ssi-sdk.geolocation-store'; type DnsLookupFn = (hostname: string) => Promise<string>; declare const anomalyDetectionMethods: Array<string>; /** * {@inheritDoc IAnomalyDetection} */ declare class AnomalyDetection implements IAgentPlugin { readonly schema: any; private readonly db; private readonly dnsLookup?; readonly methods: IAnomalyDetection; constructor(args: { geoIpDB: Uint8Array; dnsLookupCallback?: DnsLookupFn; }); private anomalyDetectionLookupLocation; private resolveDns; } interface IAnomalyDetection extends IPluginMethodMap { anomalyDetectionLookupLocation(args: AnomalyDetectionLookupLocationArgs, context: IRequiredContext): Promise<AnomalyDetectionLookupLocationResult>; } type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>; type AnomalyDetectionLookupLocationArgs = PartialBy<GeolocationStoreArgs, 'storeId' | 'namespace'>; type AnomalyDetectionLookupLocationResult = { continent?: string; country?: string; }; type IRequiredContext = IAgentContext<IGeolocationStore>; /** * @public */ declare const schema: any; export { AnomalyDetection, type AnomalyDetectionLookupLocationArgs, type AnomalyDetectionLookupLocationResult, type IAnomalyDetection, type IRequiredContext, type PartialBy, anomalyDetectionMethods, schema };