*Initial version
This commit is contained in:
parent
0440702514
commit
d3be614120
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2022 Lume Web
|
||||
Copyright (c) 2022 Hammer Technologies LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
export declare function resolve(domain: string, params: any, force?: boolean): Promise<any>;
|
||||
//# sourceMappingURL=index.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,UAAQ,gBAQvE"}
|
|
@ -0,0 +1,19 @@
|
|||
import { callModule as callModuleKernel, connectModule as connectModuleKernel, } from "libkernel";
|
||||
import { callModule as callModuleModule, connectModule as connectModuleModule, } from "libkmodule";
|
||||
const DNS_MODULE = "AQBLKpieqOfKVRgMa8k45P4S_ILYgJmswVso4vT1qzoG-A";
|
||||
let callModule, connectModule;
|
||||
if (window.document) {
|
||||
callModule = callModuleKernel;
|
||||
connectModule = connectModuleKernel;
|
||||
}
|
||||
else {
|
||||
callModule = callModuleModule;
|
||||
connectModule = connectModuleModule;
|
||||
}
|
||||
export async function resolve(domain, params, force = false) {
|
||||
const [resp, err] = await callModule(DNS_MODULE, "resolve", { domain, params, force });
|
||||
if (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
return resp;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "@lumeweb/kernel-dns-client",
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"dependencies": {
|
||||
"buffer": "^6.0.3",
|
||||
"libkernel": "^0.1.43",
|
||||
"libkmodule": "^0.2.44",
|
||||
"libskynet": "^0.0.62"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.0.6",
|
||||
"prettier": "^2.7.1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
import {
|
||||
callModule as callModuleKernel,
|
||||
connectModule as connectModuleKernel,
|
||||
} from "libkernel";
|
||||
import {
|
||||
callModule as callModuleModule,
|
||||
connectModule as connectModuleModule,
|
||||
} from "libkmodule";
|
||||
|
||||
const DNS_MODULE = "AQBLKpieqOfKVRgMa8k45P4S_ILYgJmswVso4vT1qzoG-A";
|
||||
|
||||
let callModule: typeof callModuleModule,
|
||||
connectModule: typeof connectModuleModule;
|
||||
|
||||
if (window.document) {
|
||||
callModule = callModuleKernel;
|
||||
connectModule = connectModuleKernel;
|
||||
} else {
|
||||
callModule = callModuleModule;
|
||||
connectModule = connectModuleModule;
|
||||
}
|
||||
|
||||
export async function resolve(domain: string, params: any, force = false) {
|
||||
const [resp, err] = await callModule(DNS_MODULE, "resolve", {domain, params, force});
|
||||
|
||||
if (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
|
||||
return resp;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"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