fix(core): update
This commit is contained in:
parent
e23579709a
commit
6f09a82eee
@ -1,14 +1,13 @@
|
|||||||
{
|
{
|
||||||
"gitzone": {
|
"gitzone": {
|
||||||
"projectType": "npm",
|
"projectType": "npm",
|
||||||
"compliance": "standard",
|
|
||||||
"module": {
|
"module": {
|
||||||
"githost": {},
|
"githost": "gitlab.com",
|
||||||
"gitscope": {},
|
"gitscope": "pushrocks",
|
||||||
"gitrepo": {},
|
"gitrepo": "smartdns",
|
||||||
"shortDescription": {},
|
"shortDescription": "smart dns methods written in TypeScript",
|
||||||
"npmPackagename": {},
|
"npmPackagename": "@pushrocks/smartdns",
|
||||||
"license": {}
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npmci": {
|
"npmci": {
|
||||||
|
31
readme.md
31
readme.md
@ -1,17 +1,17 @@
|
|||||||
# @[object Object]/[object Object]
|
# @pushrocks/smartdns
|
||||||
[object Object]
|
smart dns methods written in TypeScript
|
||||||
|
|
||||||
## Availabililty and Links
|
## Availabililty and Links
|
||||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/[object Object])
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartdns)
|
||||||
* [gitlab.com (source)](https://[object Object]/[object Object]/[object Object])
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartdns)
|
||||||
* [github.com (source mirror)](https://github.com/[object Object]/[object Object])
|
* [github.com (source mirror)](https://github.com/pushrocks/smartdns)
|
||||||
* [docs (typedoc)](https://[object Object].gitlab.io/[object Object]/)
|
* [docs (typedoc)](https://pushrocks.gitlab.io/smartdns/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
[![pipeline status](https://[object Object]/[object Object]/[object Object]/badges/master/pipeline.svg)](https://[object Object]/[object Object]/[object Object]/commits/master)
|
[![pipeline status](https://gitlab.com/pushrocks/smartdns/badges/master/pipeline.svg)](https://gitlab.com/pushrocks/smartdns/commits/master)
|
||||||
[![coverage report](https://[object Object]/[object Object]/[object Object]/badges/master/coverage.svg)](https://[object Object]/[object Object]/[object Object]/commits/master)
|
[![coverage report](https://gitlab.com/pushrocks/smartdns/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartdns/commits/master)
|
||||||
[![npm downloads per month](https://img.shields.io/npm/dm/[object Object].svg)](https://www.npmjs.com/package/[object Object])
|
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartdns.svg)](https://www.npmjs.com/package/@pushrocks/smartdns)
|
||||||
[![Known Vulnerabilities](https://snyk.io/test/npm/[object Object]/badge.svg)](https://snyk.io/test/npm/[object Object])
|
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartdns/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartdns)
|
||||||
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
|
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
|
||||||
@ -22,7 +22,7 @@ Use TypeScript for best in class instellisense.
|
|||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
const mySmartDns = new smartdns.SmartDns(); // uses Google DNS Https API
|
const mySmartDns = new smartdns.SmartDns(); // uses Google DNS Https API
|
||||||
const demoRecord = mySmartDns.getRecord('example.com', 'AAAA') // returns promise
|
const demoRecord = mySmartDns.getRecord('example.com', 'AAAA'); // returns promise
|
||||||
/*
|
/*
|
||||||
demoRecord looks like this:
|
demoRecord looks like this:
|
||||||
{
|
{
|
||||||
@ -34,16 +34,13 @@ demoRecord looks like this:
|
|||||||
*/
|
*/
|
||||||
```
|
```
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
## Contribution
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
|
||||||
|
|
||||||
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)
|
|
||||||
|
|
||||||
For further information read the linked docs at the top of this readme.
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
> [object Object] licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||||
|
|
||||||
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
|
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
|
||||||
|
@ -71,6 +71,6 @@ tap.test('should detect dns sec', async () => {
|
|||||||
const result = await testDnsly.getRecordA('lossless.com');
|
const result = await testDnsly.getRecordA('lossless.com');
|
||||||
console.log(result[0]);
|
console.log(result[0]);
|
||||||
expect(result[0].dnsSecEnabled).to.be.true;
|
expect(result[0].dnsSecEnabled).to.be.true;
|
||||||
})
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
26
ts/index.ts
26
ts/index.ts
@ -11,12 +11,10 @@ export interface IGoogleDNSHTTPSResponse {
|
|||||||
RA: boolean;
|
RA: boolean;
|
||||||
AD: boolean;
|
AD: boolean;
|
||||||
CD: boolean;
|
CD: boolean;
|
||||||
Question: Array< { name: string, type: number }>;
|
Question: Array<{ name: string; type: number }>;
|
||||||
Answer: Array<
|
Answer: Array<{ name: string; type: number; TTL: number; data: string }>;
|
||||||
{ name: string, type: number, TTL: number, data: string }
|
Additional: [];
|
||||||
>,
|
Comment: string;
|
||||||
Additional: [],
|
|
||||||
Comment: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -26,13 +24,13 @@ export class Smartdns {
|
|||||||
public dnsServerIp: string;
|
public dnsServerIp: string;
|
||||||
public dnsServerPort: number;
|
public dnsServerPort: number;
|
||||||
|
|
||||||
public dnsTypeMap: {[key: string]: number} = {
|
public dnsTypeMap: { [key: string]: number } = {
|
||||||
A: 1,
|
A: 1,
|
||||||
AAAA: 28,
|
AAAA: 28,
|
||||||
CNAME: 5,
|
CNAME: 5,
|
||||||
MX: 15,
|
MX: 15,
|
||||||
TXT: 16,
|
TXT: 16
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor for class dnsly
|
* constructor for class dnsly
|
||||||
@ -187,16 +185,18 @@ export class Smartdns {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public convertDnsTypeNameToTypeNumber (dnsTypeNameArg: string): number {
|
public convertDnsTypeNameToTypeNumber(dnsTypeNameArg: string): number {
|
||||||
return this.dnsTypeMap[dnsTypeNameArg];
|
return this.dnsTypeMap[dnsTypeNameArg];
|
||||||
}
|
}
|
||||||
|
|
||||||
public convertDnsTypeNumberToTypeName (dnsTypeNumberArg: number): plugins.tsclass.network.TDnsRecordType {
|
public convertDnsTypeNumberToTypeName(
|
||||||
|
dnsTypeNumberArg: number
|
||||||
|
): plugins.tsclass.network.TDnsRecordType {
|
||||||
for (const key in this.dnsTypeMap) {
|
for (const key in this.dnsTypeMap) {
|
||||||
if (this.dnsTypeMap[key] === dnsTypeNumberArg) {
|
if (this.dnsTypeMap[key] === dnsTypeNumberArg) {
|
||||||
return key as plugins.tsclass.network.TDnsRecordType;
|
return key as plugins.tsclass.network.TDnsRecordType;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
return null
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user