kernel-dns-client/dist/index.js

22 lines
779 B
JavaScript
Raw Normal View History

2023-02-19 21:22:59 +00:00
import { Client, factory } from "@lumeweb/libkernel-universal";
2023-02-19 21:44:38 +00:00
import { DNS_RECORD_TYPE, } from "@lumeweb/libresolver";
2023-02-19 21:22:59 +00:00
const MODULE = "PACYNuYbp_5hgCjMK16EGcytB9QCxDLe4_uitahwePdeaA";
export class DnsClient extends Client {
async register() {
return this.callModuleReturn("register");
2022-07-21 17:22:02 +00:00
}
2023-02-19 21:22:59 +00:00
async clear() {
return this.callModuleReturn("clear");
2022-07-21 17:22:02 +00:00
}
2023-02-19 21:22:59 +00:00
async getResolvers() {
2023-02-19 21:34:33 +00:00
return this.callModuleReturn("getResolvers");
2022-07-21 17:22:02 +00:00
}
2023-02-19 21:22:59 +00:00
async ready() {
return this.callModuleReturn("ready");
2022-07-20 11:11:06 +00:00
}
2023-02-19 21:42:13 +00:00
async resolve(domain, options = { type: DNS_RECORD_TYPE.CONTENT }, bypassCache = false) {
2023-02-19 21:44:38 +00:00
return this.callModuleReturn("resolve", { domain, options, bypassCache });
2023-02-19 21:42:13 +00:00
}
2022-07-20 11:11:06 +00:00
}
2023-02-19 21:22:59 +00:00
export const createClient = factory(DnsClient, MODULE);