Compare commits
No commits in common. "f1bbbf540d72b7a3f2f87ef49084a77d8da39842" and "7c3da38a15253d7571cfaa988747d410aa54720b" have entirely different histories.
f1bbbf540d
...
7c3da38a15
|
@ -2,10 +2,9 @@ import { Client } from "@lumeweb/libkernel-universal";
|
|||
import { DNSResult, ResolverOptions } from "@lumeweb/libresolver";
|
||||
import { ResolverModule } from "./module.js";
|
||||
export declare class DnsClient extends Client {
|
||||
get resolvers(): Promise<Set<ResolverModule>>;
|
||||
register(): Promise<void>;
|
||||
registerResolver(module: string): Promise<void>;
|
||||
clear(): Promise<void>;
|
||||
get resolvers(): Promise<Set<ResolverModule>>;
|
||||
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;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"}
|
||||
{"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"}
|
|
@ -3,6 +3,12 @@ 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) => {
|
||||
|
@ -10,17 +16,6 @@ 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,6 +9,12 @@ 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(
|
||||
|
@ -18,21 +24,6 @@ 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