Compare commits

...

29 Commits

Author SHA1 Message Date
semantic-release-bot 39e18c8cc3 chore(release): 0.1.0-develop.7 [skip ci]
# [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)
2023-09-04 10:21:07 +00:00
Derrick Hammer e2030ed2d1
Merge remote-tracking branch 'origin/develop' into develop 2023-09-04 06:20:12 -04:00
Derrick Hammer ca50e53b42
dep: update module hash 2023-09-04 06:20:01 -04:00
Derrick Hammer cd9b16b0a8
dep: update libkernel 2023-09-04 06:19:45 -04:00
semantic-release-bot 36ae80631d chore(release): 0.1.0-develop.6 [skip ci]
# [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)
2023-09-03 05:42:47 +00:00
Derrick Hammer b7b5c8e925
Merge remote-tracking branch 'origin/develop' into develop 2023-09-03 01:41:55 -04:00
Derrick Hammer a0cae7c212
dep: update libkernel 2023-09-03 01:41:50 -04:00
Derrick Hammer a195dea42f
dep: update module hash 2023-09-03 01:41:36 -04:00
semantic-release-bot e511099ce1 chore(release): 0.1.0-develop.5 [skip ci]
# [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)
2023-09-02 17:46:24 +00:00
Derrick Hammer ab593e459c
Merge remote-tracking branch 'origin/develop' into develop 2023-09-02 13:45:32 -04:00
Derrick Hammer 2764aa9841
dep: update module hash 2023-09-02 13:45:21 -04:00
Derrick Hammer 76c8c41137
dep: update libkernel 2023-09-02 13:44:42 -04:00
semantic-release-bot 814b129a28 chore(release): 0.1.0-develop.4 [skip ci]
# [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)
2023-07-29 04:27:56 +00:00
Derrick Hammer df519483ed
Merge remote-tracking branch 'origin/develop' into develop 2023-07-29 00:26:47 -04:00
Derrick Hammer 27f4701918
dep: update libkernel 2023-07-29 00:08:21 -04:00
Derrick Hammer 32b9baa058
dep: update module hash 2023-07-29 00:07:33 -04:00
semantic-release-bot c1e9c6a4b9 chore(release): 0.1.0-develop.3 [skip ci]
# [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)
2023-07-24 21:34:47 +00:00
Derrick Hammer de7c06fa97
Merge remote-tracking branch 'origin/develop' into develop 2023-07-24 17:33:46 -04:00
Derrick Hammer 113ba18cdb
dep: update module hash 2023-07-24 17:33:12 -04:00
Derrick Hammer ab2d70bd21
dep: update libkernel 2023-07-24 17:32:48 -04:00
semantic-release-bot b187dc399f chore(release): 0.1.0-develop.2 [skip ci]
# [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)
2023-07-15 08:36:16 +00:00
Derrick Hammer 9fde1e3aff
dep: update libresolver 2023-07-15 04:35:18 -04:00
semantic-release-bot 8e1bdf9acf chore(release): 0.1.0-develop.1 [skip ci]
# [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](62b7fb0292))
2023-07-15 08:19:45 +00:00
Derrick Hammer e1a4a7870f
dep: update module hash 2023-07-15 04:18:38 -04:00
Derrick Hammer 62b7fb0292
feat: add ready method to ResolverModule 2023-07-15 04:12:24 -04:00
Derrick Hammer 0de5765355
dep: update deps 2023-07-15 04:09:22 -04:00
semantic-release-bot 4bb0959bf1 chore(release): 0.0.2-develop.1 [skip ci]
## [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](b856cf16d2))
2023-07-05 09:37:17 +00:00
Derrick Hammer c762506f13
ci: setup 2023-07-05 05:33:35 -04:00
Derrick Hammer c9c7bfe498
refactor: move to new sdks 2023-07-05 05:33:18 -04:00
14 changed files with 18428 additions and 146 deletions

13
.github/workflows/ci.yml vendored Normal file
View File

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

5
.presetterrc.json Normal file
View File

@ -0,0 +1,5 @@
{
"preset": [
"@lumeweb/node-library-preset"
]
}

25
CHANGELOG.md Normal file
View File

@ -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))

17
dist/index.d.ts vendored
View File

@ -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
dist/index.d.ts.map vendored
View File

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

29
dist/index.js vendored
View File

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

21
dist/module.d.ts vendored
View File

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

View File

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

33
dist/module.js vendored
View File

@ -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);

18347
npm-shrinkwrap.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -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 });
}

View File

@ -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);

View File

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