Compare commits

..

No commits in common. "f1bbbf540d72b7a3f2f87ef49084a77d8da39842" and "7c3da38a15253d7571cfaa988747d410aa54720b" have entirely different histories.

4 changed files with 14 additions and 29 deletions

3
dist/index.d.ts vendored
View File

@ -2,10 +2,9 @@ import { Client } from "@lumeweb/libkernel-universal";
import { DNSResult, ResolverOptions } from "@lumeweb/libresolver"; import { DNSResult, ResolverOptions } from "@lumeweb/libresolver";
import { ResolverModule } from "./module.js"; import { ResolverModule } from "./module.js";
export declare class DnsClient extends Client { export declare class DnsClient extends Client {
get resolvers(): Promise<Set<ResolverModule>>;
register(): Promise<void>; register(): Promise<void>;
registerResolver(module: string): Promise<void>;
clear(): Promise<void>; clear(): Promise<void>;
get resolvers(): Promise<Set<ResolverModule>>;
resolve( resolve(
domain: string, domain: string,
options?: ResolverOptions, options?: ResolverOptions,

2
dist/index.d.ts.map vendored
View File

@ -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"}

17
dist/index.js vendored
View File

@ -3,6 +3,12 @@ import { DNS_RECORD_TYPE, } from "@lumeweb/libresolver";
import { createModule } from "./module.js"; import { createModule } from "./module.js";
const MODULE = "vAA-phmM1ztqu8zGBKF2nM3b8N_IQGWlB6J_doi2FhqS-A"; const MODULE = "vAA-phmM1ztqu8zGBKF2nM3b8N_IQGWlB6J_doi2FhqS-A";
export class DnsClient extends Client { export class DnsClient extends Client {
async register() {
return this.callModuleReturn("register");
}
async clear() {
return this.callModuleReturn("clear");
}
get resolvers() { get resolvers() {
return this.callModuleReturn("getResolvers").then((resolvers) => { return this.callModuleReturn("getResolvers").then((resolvers) => {
return new Set(resolvers.map((resolver) => { 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) { async resolve(domain, options = { type: DNS_RECORD_TYPE.CONTENT }, bypassCache = false) {
return this.callModuleReturn("resolve", { domain, options, bypassCache }); return this.callModuleReturn("resolve", { domain, options, bypassCache });
} }

View File

@ -9,6 +9,12 @@ import { createModule, ResolverModule } from "./module.js";
const MODULE = "vAA-phmM1ztqu8zGBKF2nM3b8N_IQGWlB6J_doi2FhqS-A"; const MODULE = "vAA-phmM1ztqu8zGBKF2nM3b8N_IQGWlB6J_doi2FhqS-A";
export class DnsClient extends Client { 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>> { get resolvers(): Promise<Set<ResolverModule>> {
return this.callModuleReturn("getResolvers").then((resolvers: string[]) => { return this.callModuleReturn("getResolvers").then((resolvers: string[]) => {
return new Set( 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( public async resolve(
domain: string, domain: string,
options: ResolverOptions = { type: DNS_RECORD_TYPE.CONTENT }, options: ResolverOptions = { type: DNS_RECORD_TYPE.CONTENT },