Compare commits
29 Commits
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 39e18c8cc3 | |
Derrick Hammer | e2030ed2d1 | |
Derrick Hammer | ca50e53b42 | |
Derrick Hammer | cd9b16b0a8 | |
semantic-release-bot | 36ae80631d | |
Derrick Hammer | b7b5c8e925 | |
Derrick Hammer | a0cae7c212 | |
Derrick Hammer | a195dea42f | |
semantic-release-bot | e511099ce1 | |
Derrick Hammer | ab593e459c | |
Derrick Hammer | 2764aa9841 | |
Derrick Hammer | 76c8c41137 | |
semantic-release-bot | 814b129a28 | |
Derrick Hammer | df519483ed | |
Derrick Hammer | 27f4701918 | |
Derrick Hammer | 32b9baa058 | |
semantic-release-bot | c1e9c6a4b9 | |
Derrick Hammer | de7c06fa97 | |
Derrick Hammer | 113ba18cdb | |
Derrick Hammer | ab2d70bd21 | |
semantic-release-bot | b187dc399f | |
Derrick Hammer | 9fde1e3aff | |
semantic-release-bot | 8e1bdf9acf | |
Derrick Hammer | e1a4a7870f | |
Derrick Hammer | 62b7fb0292 | |
Derrick Hammer | 0de5765355 | |
semantic-release-bot | 4bb0959bf1 | |
Derrick Hammer | c762506f13 | |
Derrick Hammer | c9c7bfe498 |
|
@ -0,0 +1,13 @@
|
|||
name: Build/Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
- develop-*
|
||||
|
||||
jobs:
|
||||
main:
|
||||
uses: lumeweb/github-node-deploy-workflow/.github/workflows/main.yml@master
|
||||
secrets: inherit
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"preset": [
|
||||
"@lumeweb/node-library-preset"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
# [0.1.0-develop.7](https://git.lumeweb.com/LumeWeb/kernel-dns-client/compare/v0.1.0-develop.6...v0.1.0-develop.7) (2023-09-04)
|
||||
|
||||
# [0.1.0-develop.6](https://git.lumeweb.com/LumeWeb/kernel-dns-client/compare/v0.1.0-develop.5...v0.1.0-develop.6) (2023-09-03)
|
||||
|
||||
# [0.1.0-develop.5](https://git.lumeweb.com/LumeWeb/kernel-dns-client/compare/v0.1.0-develop.4...v0.1.0-develop.5) (2023-09-02)
|
||||
|
||||
# [0.1.0-develop.4](https://git.lumeweb.com/LumeWeb/kernel-dns-client/compare/v0.1.0-develop.3...v0.1.0-develop.4) (2023-07-29)
|
||||
|
||||
# [0.1.0-develop.3](https://git.lumeweb.com/LumeWeb/kernel-dns-client/compare/v0.1.0-develop.2...v0.1.0-develop.3) (2023-07-24)
|
||||
|
||||
# [0.1.0-develop.2](https://git.lumeweb.com/LumeWeb/kernel-dns-client/compare/v0.1.0-develop.1...v0.1.0-develop.2) (2023-07-15)
|
||||
|
||||
# [0.1.0-develop.1](https://git.lumeweb.com/LumeWeb/kernel-dns-client/compare/v0.0.2-develop.1...v0.1.0-develop.1) (2023-07-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add ready method to ResolverModule ([62b7fb0](https://git.lumeweb.com/LumeWeb/kernel-dns-client/commit/62b7fb0292c82f28b134710770f550054bbbbc81))
|
||||
|
||||
## [0.0.2-develop.1](https://git.lumeweb.com/LumeWeb/kernel-dns-client/compare/v0.0.1...v0.0.2-develop.1) (2023-07-05)
|
||||
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "*Update register to use loadBound" ([b856cf1](https://git.lumeweb.com/LumeWeb/kernel-dns-client/commit/b856cf16d2e4e70b9e4e6d6ff6d6f4351a68177e))
|
|
@ -1,17 +0,0 @@
|
|||
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>;
|
||||
resolve(
|
||||
domain: string,
|
||||
options?: ResolverOptions,
|
||||
bypassCache?: boolean
|
||||
): Promise<DNSResult>;
|
||||
}
|
||||
export declare const createClient: (...args: any) => DnsClient;
|
||||
export * from "./module.js";
|
||||
//# sourceMappingURL=index.d.ts.map
|
|
@ -1 +0,0 @@
|
|||
{"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"}
|
|
@ -1,29 +0,0 @@
|
|||
import { Client, factory } from "@lumeweb/libkernel-universal";
|
||||
import { DNS_RECORD_TYPE, } from "@lumeweb/libresolver";
|
||||
import { createModule } from "./module.js";
|
||||
const MODULE = "vAA-phmM1ztqu8zGBKF2nM3b8N_IQGWlB6J_doi2FhqS-A";
|
||||
export class DnsClient extends Client {
|
||||
get resolvers() {
|
||||
return this.callModuleReturn("getResolvers").then((resolvers) => {
|
||||
return new Set(resolvers.map((resolver) => {
|
||||
return createModule(resolver, this);
|
||||
}));
|
||||
});
|
||||
}
|
||||
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 });
|
||||
}
|
||||
}
|
||||
export const createClient = factory(DnsClient, MODULE);
|
||||
export * from "./module.js";
|
|
@ -1,21 +0,0 @@
|
|||
import { Client } from "@lumeweb/libkernel-universal";
|
||||
import { DnsClient } from "./index.js";
|
||||
import { DNSResult, ResolverOptions } from "@lumeweb/libresolver";
|
||||
export declare class ResolverModule extends Client {
|
||||
private domain;
|
||||
constructor(domain: string, resolver?: DnsClient);
|
||||
private _resolver?;
|
||||
get resolver(): DnsClient;
|
||||
set resolver(value: DnsClient);
|
||||
resolve(
|
||||
domain: string,
|
||||
options: ResolverOptions,
|
||||
bypassCache: boolean
|
||||
): Promise<DNSResult>;
|
||||
getSupportedTlds(): Promise<string[]>;
|
||||
}
|
||||
export declare const createModule: (
|
||||
module: string,
|
||||
client: DnsClient
|
||||
) => ResolverModule;
|
||||
//# sourceMappingURL=module.d.ts.map
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAW,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EACL,SAAS,EAET,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,cAAe,SAAQ,MAAM;IACxC,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS;IAMhD,OAAO,CAAC,SAAS,CAAC,CAAY;IAE9B,IAAI,QAAQ,IAAI,SAAS,CAExB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,SAAS,EAE5B;IAEK,OAAO,CACX,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,SAAS,CAAC;IAWf,gBAAgB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAG5C;AAED,eAAO,MAAM,YAAY,WACf,MAAM,UACN,SAAS,KAChB,cAC8D,CAAC"}
|
|
@ -1,33 +0,0 @@
|
|||
import { Client, factory } from "@lumeweb/libkernel-universal";
|
||||
import { resolverError, } from "@lumeweb/libresolver";
|
||||
export class ResolverModule extends Client {
|
||||
domain;
|
||||
constructor(domain, resolver) {
|
||||
super();
|
||||
this._resolver = resolver;
|
||||
this.domain = domain;
|
||||
}
|
||||
_resolver;
|
||||
get resolver() {
|
||||
return this._resolver;
|
||||
}
|
||||
set resolver(value) {
|
||||
this._resolver = value;
|
||||
}
|
||||
async resolve(domain, options, bypassCache) {
|
||||
try {
|
||||
return this.callModuleReturn("resolve", {
|
||||
domain,
|
||||
options,
|
||||
bypassCache,
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
return resolverError(e);
|
||||
}
|
||||
}
|
||||
async getSupportedTlds() {
|
||||
return this.callModuleReturn("getSupportedTlds");
|
||||
}
|
||||
}
|
||||
export const createModule = (module, client) => factory(ResolverModule, module)(module, client);
|
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
|
@ -1,18 +1,30 @@
|
|||
{
|
||||
"name": "@lumeweb/kernel-dns-client",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.0-develop.7",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"dependencies": {
|
||||
"@lumeweb/libkernel-universal": "git+https://git.lumeweb.com/LumeWeb/libkernel-universal.git",
|
||||
"@lumeweb/libresolver": "git+https://git.lumeweb.com/LumeWeb/libresolver.git",
|
||||
"libkernel": "^0.1.43",
|
||||
"libkmodule": "^0.2.44",
|
||||
"libskynet": "^0.0.62"
|
||||
"main": "lib/index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "gitea@git.lumeweb.com:LumeWeb/kernel-dns-client.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.0.6",
|
||||
"prettier": "^2.7.1",
|
||||
"typescript": "^4.9.5"
|
||||
"@lumeweb/node-library-preset": "^0.2.7",
|
||||
"presetter": "*"
|
||||
},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"scripts": {
|
||||
"prepare": "presetter bootstrap",
|
||||
"build": "run build",
|
||||
"semantic-release": "semantic-release"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lumeweb/libkernel": "^0.1.0-develop.44",
|
||||
"@lumeweb/libresolver": "^0.1.0-develop.1"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
|
|
10
src/index.ts
10
src/index.ts
|
@ -1,4 +1,4 @@
|
|||
import { Client, factory } from "@lumeweb/libkernel-universal";
|
||||
import { Client, factory } from "@lumeweb/libkernel/module";
|
||||
import {
|
||||
DNS_RECORD_TYPE,
|
||||
DNSResult,
|
||||
|
@ -6,7 +6,7 @@ import {
|
|||
} from "@lumeweb/libresolver";
|
||||
import { createModule, ResolverModule } from "./module.js";
|
||||
|
||||
const MODULE = "vAA-phmM1ztqu8zGBKF2nM3b8N_IQGWlB6J_doi2FhqS-A";
|
||||
const MODULE = "zdiN14h2ecmQ27hMFiL9ZrH2ZbE6s3ZbUJ7L1gDZiXazdRie9Sa5uRRpvb";
|
||||
|
||||
export class DnsClient extends Client {
|
||||
get resolvers(): Promise<Set<ResolverModule>> {
|
||||
|
@ -14,7 +14,7 @@ export class DnsClient extends Client {
|
|||
return new Set(
|
||||
resolvers.map((resolver: string): ResolverModule => {
|
||||
return createModule(resolver, this);
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ export class DnsClient extends Client {
|
|||
}
|
||||
|
||||
public async registerResolver(module: string): Promise<void> {
|
||||
const bag = await this.loadBound(module);
|
||||
const bag = await this.getBound(module);
|
||||
const ret = await bag.callModule("register");
|
||||
return ret[0];
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ export class DnsClient extends Client {
|
|||
public async resolve(
|
||||
domain: string,
|
||||
options: ResolverOptions = { type: DNS_RECORD_TYPE.CONTENT },
|
||||
bypassCache: boolean = false
|
||||
bypassCache: boolean = false,
|
||||
): Promise<DNSResult> {
|
||||
return this.callModuleReturn("resolve", { domain, options, bypassCache });
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Client, factory } from "@lumeweb/libkernel-universal";
|
||||
import { Client, factory } from "@lumeweb/libkernel/module";
|
||||
import { DnsClient } from "./index.js";
|
||||
import {
|
||||
DNSResult,
|
||||
|
@ -9,8 +9,8 @@ import {
|
|||
export class ResolverModule extends Client {
|
||||
private domain: string;
|
||||
|
||||
constructor(domain: string, resolver?: DnsClient) {
|
||||
super();
|
||||
constructor(module: string, domain: string, resolver?: DnsClient) {
|
||||
super(module);
|
||||
this._resolver = resolver;
|
||||
this.domain = domain;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ export class ResolverModule extends Client {
|
|||
async resolve(
|
||||
domain: string,
|
||||
options: ResolverOptions,
|
||||
bypassCache: boolean
|
||||
bypassCache: boolean,
|
||||
): Promise<DNSResult> {
|
||||
try {
|
||||
return this.callModuleReturn("resolve", {
|
||||
|
@ -40,13 +40,18 @@ export class ResolverModule extends Client {
|
|||
return resolverError(e as Error);
|
||||
}
|
||||
}
|
||||
|
||||
async getSupportedTlds(): Promise<string[]> {
|
||||
return this.callModuleReturn("getSupportedTlds");
|
||||
}
|
||||
|
||||
async ready(): Promise<any> {
|
||||
return this.callModuleReturn("ready");
|
||||
}
|
||||
}
|
||||
|
||||
export const createModule = (
|
||||
module: string,
|
||||
client: DnsClient
|
||||
client: DnsClient,
|
||||
): ResolverModule =>
|
||||
factory<ResolverModule>(ResolverModule, module)(module, client);
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"strict": true,
|
||||
"module": "esnext",
|
||||
"target": "esnext",
|
||||
"esModuleInterop": true,
|
||||
"sourceMap": false,
|
||||
"rootDir": "src",
|
||||
"outDir": "dist",
|
||||
"typeRoots": [
|
||||
"node_modules/@types",
|
||||
],
|
||||
"moduleResolution": "node",
|
||||
"declarationMap": true,
|
||||
"declarationDir": "dist",
|
||||
"emitDeclarationOnly": false,
|
||||
"allowJs": true
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue