*Update dist
This commit is contained in:
parent
8a88a43c20
commit
e06c86720f
|
@ -1,2 +1,3 @@
|
|||
import type { ResolverModule } from "@lumeweb/resolver-common";
|
||||
export declare function setup(rm: ResolverModule): void;
|
||||
export * from "./resolverRegistry.js";
|
||||
|
|
|
@ -30,3 +30,4 @@ async function handleResolve(aq) {
|
|||
}
|
||||
aq.respond(ret);
|
||||
}
|
||||
export * from "./resolverRegistry.js";
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
import { DNSResult, ResolverOptions } from "@lumeweb/resolver-common";
|
||||
export declare class ResolverRegistry {
|
||||
resolve(
|
||||
domain: string,
|
||||
options?: ResolverOptions,
|
||||
bypassCache?: boolean
|
||||
): Promise<DNSResult>;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
import { DNS_RECORD_TYPE, resolverError, } from "@lumeweb/resolver-common";
|
||||
import { resolve } from "@lumeweb/kernel-dns-client";
|
||||
export class ResolverRegistry {
|
||||
async resolve(domain, options = { type: DNS_RECORD_TYPE.DEFAULT }, bypassCache = false) {
|
||||
let result;
|
||||
try {
|
||||
result = await resolve(domain, options, bypassCache);
|
||||
}
|
||||
catch (e) {
|
||||
return resolverError(e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue