*Update dist
This commit is contained in:
parent
90330d8dcd
commit
89a17b5ac8
|
@ -1,3 +1,3 @@
|
||||||
import type { ResolverModule } from "@lumeweb/resolver-common";
|
import type { ResolverModuleConstructor } from "@lumeweb/resolver-common";
|
||||||
export declare function setup(rm: ResolverModule): void;
|
export declare function setup(rm: ResolverModuleConstructor): void;
|
||||||
export * from "./resolverRegistry.js";
|
export * from "./resolverRegistry.js";
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
import { addHandler, handleMessage } from "libkmodule";
|
import { addHandler, handleMessage } from "libkmodule";
|
||||||
import { register } from "@lumeweb/kernel-dns-client";
|
import { register } from "@lumeweb/kernel-dns-client";
|
||||||
|
import { RpcNetwork } from "@lumeweb/kernel-rpc-client";
|
||||||
|
import { ResolverRegistry } from "./resolverRegistry.js";
|
||||||
let resolver;
|
let resolver;
|
||||||
export function setup(rm) {
|
export function setup(rm) {
|
||||||
addHandler("resolve", handleResolve);
|
addHandler("resolve", handleResolve);
|
||||||
addHandler("register", handleRegister);
|
addHandler("register", handleRegister);
|
||||||
addHandler("getSupportedTlds", handleGetSupportedTlds);
|
addHandler("getSupportedTlds", handleGetSupportedTlds);
|
||||||
onmessage = handleMessage;
|
onmessage = handleMessage;
|
||||||
resolver = rm;
|
resolver = new rm(new ResolverRegistry(new RpcNetwork()));
|
||||||
}
|
}
|
||||||
async function handleRegister(aq) {
|
async function handleRegister(aq) {
|
||||||
await register();
|
await register();
|
||||||
|
|
|
@ -19,7 +19,7 @@ export class ResolverRegistry {
|
||||||
return new Set(resolvers.map((resolver) => new ResolverModule(this, resolver)));
|
return new Set(resolvers.map((resolver) => new ResolverModule(this, resolver)));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async resolve(domain, options = { type: DNS_RECORD_TYPE.DEFAULT }, bypassCache = false) {
|
async resolve(domain, options = { type: DNS_RECORD_TYPE.CONTENT }, bypassCache = false) {
|
||||||
let result;
|
let result;
|
||||||
try {
|
try {
|
||||||
result = await resolve(domain, options, bypassCache);
|
result = await resolve(domain, options, bypassCache);
|
||||||
|
|
Loading…
Reference in New Issue