fix(core): update
This commit is contained in:
parent
6281ab0c80
commit
4102c3a692
@ -13,8 +13,13 @@ stages:
|
|||||||
- metadata
|
- metadata
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- npm install -g @shipzone/npmci
|
- pnpm install -g pnpm
|
||||||
|
- pnpm install -g @shipzone/npmci
|
||||||
|
- npmci npm prepare
|
||||||
|
|
||||||
|
# ====================
|
||||||
|
# security stage
|
||||||
|
# ====================
|
||||||
# ====================
|
# ====================
|
||||||
# security stage
|
# security stage
|
||||||
# ====================
|
# ====================
|
||||||
@ -22,11 +27,10 @@ auditProductionDependencies:
|
|||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
|
||||||
- npmci command npm install --production --ignore-scripts
|
|
||||||
- npmci command npm config set registry https://registry.npmjs.org
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
- npmci command npm audit --audit-level=high --only=prod --production
|
- npmci command pnpm audit --audit-level=high --prod
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
@ -34,11 +38,10 @@ auditDevDependencies:
|
|||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
|
||||||
- npmci command npm install --ignore-scripts
|
|
||||||
- npmci command npm config set registry https://registry.npmjs.org
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
- npmci command npm audit --audit-level=high --only=dev
|
- npmci command pnpm audit --audit-level=high --dev
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
@ -49,7 +52,6 @@ auditDevDependencies:
|
|||||||
testStable:
|
testStable:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
|
||||||
- npmci node install stable
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci npm test
|
- npmci npm test
|
||||||
@ -60,10 +62,9 @@ testStable:
|
|||||||
testBuild:
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
|
||||||
- npmci node install stable
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command npm run build
|
- npmci npm build
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
@ -112,7 +113,6 @@ pages:
|
|||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci node install stable
|
- npmci node install stable
|
||||||
- npmci npm prepare
|
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command npm run buildDocs
|
- npmci command npm run buildDocs
|
||||||
tags:
|
tags:
|
||||||
|
14936
package-lock.json
generated
14936
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -29,17 +29,16 @@
|
|||||||
"@pushrocks/smartdelay": "^2.0.13",
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
"@pushrocks/smartenv": "^5.0.2",
|
"@pushrocks/smartenv": "^5.0.2",
|
||||||
"@pushrocks/smartpromise": "^3.1.7",
|
"@pushrocks/smartpromise": "^3.1.7",
|
||||||
"@pushrocks/smartrequest": "^1.1.56",
|
"@pushrocks/smartrequest": "^2.0.11",
|
||||||
"@tsclass/tsclass": "^4.0.17",
|
"@tsclass/tsclass": "^4.0.17",
|
||||||
"dns2": "^2.0.5"
|
"dns2": "^2.0.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.63",
|
"@gitzone/tsbuild": "^2.1.63",
|
||||||
|
"@gitzone/tsrun": "^1.2.39",
|
||||||
"@gitzone/tstest": "^1.0.72",
|
"@gitzone/tstest": "^1.0.72",
|
||||||
"@pushrocks/tapbundle": "^5.0.4",
|
"@pushrocks/tapbundle": "^5.0.4",
|
||||||
"@types/node": "^18.6.1",
|
"@types/node": "^18.6.1"
|
||||||
"tslint": "^6.1.3",
|
|
||||||
"tslint-config-prettier": "^1.18.0"
|
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
4453
pnpm-lock.yaml
generated
Normal file
4453
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,6 @@ Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](htt
|
|||||||
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartdns)](https://lossless.cloud)
|
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartdns)](https://lossless.cloud)
|
||||||
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartdns)](https://lossless.cloud)
|
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartdns)](https://lossless.cloud)
|
||||||
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartdns)](https://lossless.cloud)
|
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartdns)](https://lossless.cloud)
|
||||||
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -47,7 +46,6 @@ We are always happy for code contributions. If you are not the code contributing
|
|||||||
|
|
||||||
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.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
## Legal
|
||||||
|
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc)
|
||||||
| 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)
|
|
||||||
|
12
test/test.ts
12
test/test.ts
@ -48,15 +48,21 @@ tap.test('should, get a mx record for a domain', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should check until DNS is available', async () => {
|
tap.test('should check until DNS is available', async () => {
|
||||||
return expect(await testDnsly.checkUntilAvailable('dnsly_txt.bleu.de', 'TXT', 'sometext_txt')).toBeTrue();
|
return expect(
|
||||||
|
await testDnsly.checkUntilAvailable('dnsly_txt.bleu.de', 'TXT', 'sometext_txt')
|
||||||
|
).toBeTrue();
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should check until DNS is available an return false if it fails', async () => {
|
tap.test('should check until DNS is available an return false if it fails', async () => {
|
||||||
return expect(await testDnsly.checkUntilAvailable('dnsly_txt.bleu.de', 'TXT', 'sometext_txt2')).toBeFalse()
|
return expect(
|
||||||
|
await testDnsly.checkUntilAvailable('dnsly_txt.bleu.de', 'TXT', 'sometext_txt2')
|
||||||
|
).toBeFalse();
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should check until DNS is available an return false if it fails', async () => {
|
tap.test('should check until DNS is available an return false if it fails', async () => {
|
||||||
return expect(await testDnsly.checkUntilAvailable('dnsly_txtNotThere.bleu.de', 'TXT', 'sometext_txt2')).toBeFalse()
|
return expect(
|
||||||
|
await testDnsly.checkUntilAvailable('dnsly_txtNotThere.bleu.de', 'TXT', 'sometext_txt2')
|
||||||
|
).toBeFalse();
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should get name server for hostname', async () => {
|
tap.test('should get name server for hostname', async () => {
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/smartdns',
|
name: '@pushrocks/smartdns',
|
||||||
version: '5.0.2',
|
version: '5.0.3',
|
||||||
description: 'smart dns methods written in TypeScript'
|
description: 'smart dns methods written in TypeScript'
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import * as plugins from './dnsly.plugins.js';
|
|||||||
|
|
||||||
export type TDnsProvider = 'google' | 'cloudflare';
|
export type TDnsProvider = 'google' | 'cloudflare';
|
||||||
|
|
||||||
export const makeNodeProcessUseDnsProvider = async (providerArg: TDnsProvider) => {
|
export const makeNodeProcessUseDnsProvider = (providerArg: TDnsProvider) => {
|
||||||
switch (providerArg) {
|
switch (providerArg) {
|
||||||
case 'cloudflare':
|
case 'cloudflare':
|
||||||
plugins.dns.setServers([
|
plugins.dns.setServers([
|
||||||
@ -131,7 +131,7 @@ export class Smartdns {
|
|||||||
public async getRecord(
|
public async getRecord(
|
||||||
recordNameArg: string,
|
recordNameArg: string,
|
||||||
recordTypeArg: plugins.tsclass.network.TDnsRecordType,
|
recordTypeArg: plugins.tsclass.network.TDnsRecordType,
|
||||||
retriesCounterArg = 20,
|
retriesCounterArg = 20
|
||||||
): Promise<plugins.tsclass.network.IDnsRecord[]> {
|
): Promise<plugins.tsclass.network.IDnsRecord[]> {
|
||||||
const requestUrl = `https://cloudflare-dns.com/dns-query?name=${recordNameArg}&type=${recordTypeArg}&do=1`;
|
const requestUrl = `https://cloudflare-dns.com/dns-query?name=${recordNameArg}&type=${recordTypeArg}&do=1`;
|
||||||
const returnArray: plugins.tsclass.network.IDnsRecord[] = [];
|
const returnArray: plugins.tsclass.network.IDnsRecord[] = [];
|
||||||
@ -147,9 +147,9 @@ export class Smartdns {
|
|||||||
await plugins.smartdelay.delayFor(500);
|
await plugins.smartdelay.delayFor(500);
|
||||||
return getResponseBody(counterArg++);
|
return getResponseBody(counterArg++);
|
||||||
} else {
|
} else {
|
||||||
return responseBody
|
return responseBody;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
const responseBody = await getResponseBody();
|
const responseBody = await getResponseBody();
|
||||||
for (const dnsEntry of responseBody.Answer) {
|
for (const dnsEntry of responseBody.Answer) {
|
||||||
if (dnsEntry.data.startsWith('"') && dnsEntry.data.endsWith('"')) {
|
if (dnsEntry.data.startsWith('"') && dnsEntry.data.endsWith('"')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user