Compare commits
2 Commits
7c3da38a15
...
f1bbbf540d
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | f1bbbf540d | |
Derrick Hammer | 1e8924d5ac |
|
@ -2,9 +2,10 @@ import { Client } from "@lumeweb/libkernel-universal";
|
|||
import { DNSResult, ResolverOptions } from "@lumeweb/libresolver";
|
||||
import { ResolverModule } from "./module.js";
|
||||
export declare class DnsClient extends Client {
|
||||
register(): Promise<void>;
|
||||
clear(): Promise<void>;
|
||||
get resolvers(): Promise<Set<ResolverModule>>;
|
||||
register(): Promise<void>;
|
||||
registerResolver(module: string): Promise<void>;
|
||||
clear(): Promise<void>;
|
||||
resolve(
|
||||
domain: string,
|
||||
options?: ResolverOptions,
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAW,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAEL,SAAS,EACT,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAI3D,qBAAa,SAAU,SAAQ,MAAM;IACtB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAGzB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAGnC,IAAI,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAQ5C;IACY,OAAO,CAClB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,eAAmD,EAC5D,WAAW,GAAE,OAAe,GAC3B,OAAO,CAAC,SAAS,CAAC;CAGtB;AAED,eAAO,MAAM,YAAY,6BAAwC,CAAC;AAClE,cAAc,aAAa,CAAC"}
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAW,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAEL,SAAS,EACT,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAI3D,qBAAa,SAAU,SAAQ,MAAM;IACnC,IAAI,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAQ5C;IAEY,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM/C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,OAAO,CAClB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,eAAmD,EAC5D,WAAW,GAAE,OAAe,GAC3B,OAAO,CAAC,SAAS,CAAC;CAGtB;AAED,eAAO,MAAM,YAAY,6BAAwC,CAAC;AAClE,cAAc,aAAa,CAAC"}
|
|
@ -3,12 +3,6 @@ import { DNS_RECORD_TYPE, } from "@lumeweb/libresolver";
|
|||
import { createModule } from "./module.js";
|
||||
const MODULE = "vAA-phmM1ztqu8zGBKF2nM3b8N_IQGWlB6J_doi2FhqS-A";
|
||||
export class DnsClient extends Client {
|
||||
async register() {
|
||||
return this.callModuleReturn("register");
|
||||
}
|
||||
async clear() {
|
||||
return this.callModuleReturn("clear");
|
||||
}
|
||||
get resolvers() {
|
||||
return this.callModuleReturn("getResolvers").then((resolvers) => {
|
||||
return new Set(resolvers.map((resolver) => {
|
||||
|
@ -16,6 +10,17 @@ export class DnsClient extends Client {
|
|||
}));
|
||||
});
|
||||
}
|
||||
async register() {
|
||||
return this.callModuleReturn("register");
|
||||
}
|
||||
async registerResolver(module) {
|
||||
const bag = await this.loadBound(module);
|
||||
const ret = await bag.callModule("register");
|
||||
return ret[0];
|
||||
}
|
||||
async clear() {
|
||||
return this.callModuleReturn("clear");
|
||||
}
|
||||
async resolve(domain, options = { type: DNS_RECORD_TYPE.CONTENT }, bypassCache = false) {
|
||||
return this.callModuleReturn("resolve", { domain, options, bypassCache });
|
||||
}
|
||||
|
|
21
src/index.ts
21
src/index.ts
|
@ -9,12 +9,6 @@ import { createModule, ResolverModule } from "./module.js";
|
|||
const MODULE = "vAA-phmM1ztqu8zGBKF2nM3b8N_IQGWlB6J_doi2FhqS-A";
|
||||
|
||||
export class DnsClient extends Client {
|
||||
public async register(): Promise<void> {
|
||||
return this.callModuleReturn("register");
|
||||
}
|
||||
public async clear(): Promise<void> {
|
||||
return this.callModuleReturn("clear");
|
||||
}
|
||||
get resolvers(): Promise<Set<ResolverModule>> {
|
||||
return this.callModuleReturn("getResolvers").then((resolvers: string[]) => {
|
||||
return new Set(
|
||||
|
@ -24,6 +18,21 @@ export class DnsClient extends Client {
|
|||
);
|
||||
});
|
||||
}
|
||||
|
||||
public async register(): Promise<void> {
|
||||
return this.callModuleReturn("register");
|
||||
}
|
||||
|
||||
public async registerResolver(module: string): Promise<void> {
|
||||
const bag = await this.loadBound(module);
|
||||
const ret = await bag.callModule("register");
|
||||
return ret[0];
|
||||
}
|
||||
|
||||
public async clear(): Promise<void> {
|
||||
return this.callModuleReturn("clear");
|
||||
}
|
||||
|
||||
public async resolve(
|
||||
domain: string,
|
||||
options: ResolverOptions = { type: DNS_RECORD_TYPE.CONTENT },
|
||||
|
|
Loading…
Reference in New Issue