Compare commits

...

33 Commits

Author SHA1 Message Date
semantic-release-bot 53bc0a9fc5 chore(release): 0.1.0-develop.10 [skip ci]
# [0.1.0-develop.10](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.9...v0.1.0-develop.10) (2023-09-11)
2023-09-11 18:24:04 +00:00
Derrick Hammer 5aec957be2
dep: update libkernel 2023-09-11 14:23:12 -04:00
semantic-release-bot c87eb3d36e chore(release): 0.1.0-develop.9 [skip ci]
# [0.1.0-develop.9](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.8...v0.1.0-develop.9) (2023-09-04)
2023-09-04 10:39:20 +00:00
Derrick Hammer 9ca2b44fc5
Merge remote-tracking branch 'origin/develop' into develop 2023-09-04 06:38:14 -04:00
Derrick Hammer 571b65135a
dep: update deps 2023-09-04 06:38:08 -04:00
semantic-release-bot b3baa80dd0 chore(release): 0.1.0-develop.8 [skip ci]
# [0.1.0-develop.8](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.7...v0.1.0-develop.8) (2023-09-03)
2023-09-03 05:48:57 +00:00
Derrick Hammer df25afd000
Merge remote-tracking branch 'origin/develop' into develop 2023-09-03 01:47:57 -04:00
Derrick Hammer c225edd2f3
dep: update deps 2023-09-03 01:47:50 -04:00
semantic-release-bot 43c4810e8a chore(release): 0.1.0-develop.7 [skip ci]
# [0.1.0-develop.7](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.6...v0.1.0-develop.7) (2023-09-02)
2023-09-02 18:02:07 +00:00
Derrick Hammer 4a32e3dd72
Merge remote-tracking branch 'origin/develop' into develop 2023-09-02 14:01:06 -04:00
Derrick Hammer 39f9250201
dep: update deps 2023-09-02 14:01:03 -04:00
semantic-release-bot b491b25e30 chore(release): 0.1.0-develop.6 [skip ci]
# [0.1.0-develop.6](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.5...v0.1.0-develop.6) (2023-07-29)
2023-07-29 21:10:54 +00:00
Derrick Hammer 7406fa2596
Merge remote-tracking branch 'origin/develop' into develop 2023-07-29 17:09:51 -04:00
Derrick Hammer 12522ca10e
refactor: change ready to return the value of ready as it is now boolean 2023-07-29 17:09:46 -04:00
semantic-release-bot 4db427ce2b chore(release): 0.1.0-develop.5 [skip ci]
# [0.1.0-develop.5](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.4...v0.1.0-develop.5) (2023-07-29)
2023-07-29 20:49:18 +00:00
Derrick Hammer 1ef420ee15
Merge remote-tracking branch 'origin/develop' into develop 2023-07-29 16:48:09 -04:00
Derrick Hammer f22107f501
dep: update libkernel 2023-07-29 16:48:04 -04:00
semantic-release-bot 56e889bdcb chore(release): 0.1.0-develop.4 [skip ci]
# [0.1.0-develop.4](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.3...v0.1.0-develop.4) (2023-07-29)
2023-07-29 20:23:23 +00:00
Derrick Hammer 2e6857fae7
Merge remote-tracking branch 'origin/develop' into develop 2023-07-29 16:22:03 -04:00
Derrick Hammer f7f8e553c4
dep: update deps 2023-07-29 16:21:56 -04:00
semantic-release-bot 50d491fe38 chore(release): 0.1.0-develop.3 [skip ci]
# [0.1.0-develop.3](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.2...v0.1.0-develop.3) (2023-07-15)
2023-07-15 08:45:04 +00:00
Derrick Hammer c08fd5bf02
dep: update deps 2023-07-15 04:44:02 -04:00
semantic-release-bot 89c5c6f6c2 chore(release): 0.1.0-develop.2 [skip ci]
# [0.1.0-develop.2](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.1...v0.1.0-develop.2) (2023-07-15)
2023-07-15 08:33:43 +00:00
Derrick Hammer 4c698eb4b5
dep: update deps 2023-07-15 04:32:47 -04:00
semantic-release-bot 7f61f0666a chore(release): 0.1.0-develop.1 [skip ci]
# [0.1.0-develop.1](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.0.2-develop.2...v0.1.0-develop.1) (2023-07-15)

### Features

* add ready to setup ([c329921](c329921aa4))
2023-07-15 08:24:10 +00:00
Derrick Hammer 0d8d04b5d1
Merge remote-tracking branch 'origin/develop' into develop 2023-07-15 04:23:08 -04:00
Derrick Hammer c329921aa4
feat: add ready to setup 2023-07-15 04:22:59 -04:00
Derrick Hammer 9fa4e3eb12
dep: update deps 2023-07-15 04:22:54 -04:00
semantic-release-bot fe220ee0e5 chore(release): 0.0.2-develop.2 [skip ci]
## [0.0.2-develop.2](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.0.2-develop.1...v0.0.2-develop.2) (2023-07-14)

### Bug Fixes

* typo in package.json ([9ca41e3](9ca41e3261))
2023-07-14 10:24:29 +00:00
Derrick Hammer 9ca41e3261
fix: typo in package.json 2023-07-14 06:23:30 -04:00
semantic-release-bot 533b8a32d5 chore(release): 0.0.2-develop.1 [skip ci]
## [0.0.2-develop.1](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.0.1...v0.0.2-develop.1) (2023-07-05)
2023-07-05 09:46:02 +00:00
Derrick Hammer 2445de5711
ci: setup 2023-07-05 05:44:46 -04:00
Derrick Hammer fb6b5c4b52
refactor: switch to new sdks 2023-07-05 05:42:15 -04:00
11 changed files with 18460 additions and 119 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"
]
}

33
CHANGELOG.md Normal file
View File

@ -0,0 +1,33 @@
# [0.1.0-develop.10](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.9...v0.1.0-develop.10) (2023-09-11)
# [0.1.0-develop.9](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.8...v0.1.0-develop.9) (2023-09-04)
# [0.1.0-develop.8](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.7...v0.1.0-develop.8) (2023-09-03)
# [0.1.0-develop.7](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.6...v0.1.0-develop.7) (2023-09-02)
# [0.1.0-develop.6](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.5...v0.1.0-develop.6) (2023-07-29)
# [0.1.0-develop.5](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.1.0-develop.4...v0.1.0-develop.5) (2023-07-29)
# [0.1.0-develop.4](https://git.lumeweb.com/LumeWeb/kernel-libresolver/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-libresolver/compare/v0.1.0-develop.2...v0.1.0-develop.3) (2023-07-15)
# [0.1.0-develop.2](https://git.lumeweb.com/LumeWeb/kernel-libresolver/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-libresolver/compare/v0.0.2-develop.2...v0.1.0-develop.1) (2023-07-15)
### Features
* add ready to setup ([c329921](https://git.lumeweb.com/LumeWeb/kernel-libresolver/commit/c329921aa403b65cb5938a8ea421bdbe3796541a))
## [0.0.2-develop.2](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.0.2-develop.1...v0.0.2-develop.2) (2023-07-14)
### Bug Fixes
* typo in package.json ([9ca41e3](https://git.lumeweb.com/LumeWeb/kernel-libresolver/commit/9ca41e326156244ebaa46b565aed98dfbd20ef7b))
## [0.0.2-develop.1](https://git.lumeweb.com/LumeWeb/kernel-libresolver/compare/v0.0.1...v0.0.2-develop.1) (2023-07-05)

1
dist/client.d.ts vendored
View File

@ -1 +0,0 @@
export declare const dnsClient: import("@lumeweb/kernel-dns-client").DnsClient;

2
dist/client.js vendored
View File

@ -1,2 +0,0 @@
import { createClient } from "@lumeweb/kernel-dns-client";
export const dnsClient = createClient();

22
dist/index.d.ts vendored
View File

@ -1,22 +0,0 @@
import type {
DNSResult,
ResolverModule as ResolverModuleBase,
} from "@lumeweb/libresolver";
import { DnsClient } from "@lumeweb/kernel-dns-client";
import { ResolverOptions } from "@lumeweb/libresolver/src/types.js";
export interface ResolverModule {
get resolver(): DnsClient;
set resolver(value: DnsClient);
resolve(
domain: string,
options: ResolverOptions,
bypassCache: boolean
): Promise<DNSResult>;
getSupportedTlds(): string[];
getSupportedTlds(): Promise<string[]>;
getSupportedTlds(): any;
}
export declare function setup(rm: ResolverModule | ResolverModuleBase): void;
export * from "@lumeweb/libresolver/dist/util.js";
export * from "@lumeweb/libresolver/dist/types.js";
export { AbstractResolverModule } from "@lumeweb/libresolver/dist/resolverModule.js";

42
dist/index.js vendored
View File

@ -1,42 +0,0 @@
import { addHandler, handleMessage } from "libkmodule";
import { DNS_RECORD_TYPE } from "@lumeweb/libresolver";
import { dnsClient } from "./client.js";
let resolver;
export function setup(rm) {
addHandler("resolve", handleResolve);
addHandler("register", handleRegister);
addHandler("getSupportedTlds", handleGetSupportedTlds);
onmessage = handleMessage;
resolver = rm;
// @ts-ignore
resolver.resolver = dnsClient;
}
async function handleRegister(aq) {
await dnsClient.register();
aq.respond();
}
async function handleResolve(aq) {
if (!("domain" in aq.callerInput)) {
aq.reject("domain required");
return;
}
let ret;
try {
ret = await resolver.resolve(aq.callerInput.domain, aq.callerInput?.options ?? { type: DNS_RECORD_TYPE.CONTENT }, aq.callerInput?.bypassCache || false);
}
catch (e) {
aq.reject(e);
return;
}
if (ret.error) {
aq.reject(ret.error);
return;
}
aq.respond(ret);
}
function handleGetSupportedTlds(aq) {
aq.respond(resolver.getSupportedTlds());
}
export * from "@lumeweb/libresolver/dist/util.js";
export * from "@lumeweb/libresolver/dist/types.js";
export { AbstractResolverModule } from "@lumeweb/libresolver/dist/resolverModule.js";

18366
npm-shrinkwrap.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,31 @@
{
"name": "@lumeweb/kernel-libresolver",
"version": "0.1.0",
"main": "dist/index.js",
"dependencies": {
"@lumeweb/kernel-dns-client": "git+https://git.lumeweb.com/LumeWeb/kernel-dns-client.git",
"@lumeweb/kernel-libresolver": "git+https://git.lumeweb.com/LumeWeb/kernel-libresolver.git",
"@lumeweb/kernel-rpc-client": "git+https://git.lumeweb.com/LumeWeb/kernel-rpc-client.git",
"@lumeweb/libkernel-universal": "git+https://git.lumeweb.com/LumeWeb/libkernel-universal.git",
"@lumeweb/libresolver": "git+https://git.lumeweb.com/LumeWeb/libresolver.git",
"libkmodule": "^0.2.53"
"version": "0.1.0-develop.10",
"main": "lib/index.js",
"type": "module",
"repository": {
"type": "git",
"url": "gitea@git.lumeweb.com:LumeWeb/kernel-libresolver.git"
},
"devDependencies": {
"@lumeweb/relay-types": "git+https://git.lumeweb.com/LumeWeb/relay-types.git",
"@types/node": "^18.14.0",
"prettier": "^2.8.4",
"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/kernel-dns-client": "^0.1.0-develop.7",
"@lumeweb/libkernel": "^0.1.0-develop.62",
"@lumeweb/libresolver": "^0.1.0-develop.1"
},
"files": [
"lib"
],
"publishConfig": {
"access": "public"
}
}

View File

@ -1,33 +1,20 @@
import { addHandler, ActiveQuery, handleMessage } from "libkmodule";
import {
addHandler,
ActiveQuery,
handleMessage,
} from "@lumeweb/libkernel/module";
import type {
DNSResult,
ResolverModule as ResolverModuleBase,
} from "@lumeweb/libresolver";
import type { DNSResult } from "@lumeweb/libresolver";
import { DNS_RECORD_TYPE } from "@lumeweb/libresolver";
import { dnsClient } from "./client.js";
import { DnsClient } from "@lumeweb/kernel-dns-client";
import { ResolverOptions } from "@lumeweb/libresolver/src/types.js";
import { ResolverModule } from "@lumeweb/kernel-dns-client";
let resolver: ResolverModule | ResolverModuleBase;
let resolver: ResolverModule;
export interface ResolverModule {
get resolver(): DnsClient;
set resolver(value: DnsClient);
resolve(
domain: string,
options: ResolverOptions,
bypassCache: boolean
): Promise<DNSResult>;
getSupportedTlds(): string[];
getSupportedTlds(): Promise<string[]>;
getSupportedTlds(): any;
}
export function setup(rm: ResolverModule | ResolverModuleBase) {
export function setup(rm: ResolverModule) {
addHandler("resolve", handleResolve);
addHandler("register", handleRegister);
addHandler("ready", handleReady);
addHandler("getSupportedTlds", handleGetSupportedTlds);
onmessage = handleMessage;
resolver = rm;
@ -51,7 +38,7 @@ async function handleResolve(aq: ActiveQuery) {
ret = await resolver.resolve(
aq.callerInput.domain,
aq.callerInput?.options ?? { type: DNS_RECORD_TYPE.CONTENT },
aq.callerInput?.bypassCache || false
aq.callerInput?.bypassCache || false,
);
} catch (e: any) {
aq.reject(e);
@ -70,6 +57,10 @@ function handleGetSupportedTlds(aq: ActiveQuery) {
aq.respond(resolver.getSupportedTlds());
}
export * from "@lumeweb/libresolver/dist/util.js";
export * from "@lumeweb/libresolver/dist/types.js";
export { AbstractResolverModule } from "@lumeweb/libresolver/dist/resolverModule.js";
async function handleReady(aq: ActiveQuery) {
aq.respond(await resolver.ready());
}
export * from "@lumeweb/libresolver/lib/util.js";
export * from "@lumeweb/libresolver/lib/types.js";
export { AbstractResolverModule } from "@lumeweb/libresolver/lib/resolverModule.js";

View File

@ -1,12 +0,0 @@
{
"compilerOptions": {
"target": "esnext",
"declaration": true,
"moduleResolution": "node",
"outDir": "./dist",
"strict": true,
"allowSyntheticDefaultImports": true
},
"include": ["src"],
"exclude": ["node_modules", "**/__tests__/*"]
}