fix(core): update

This commit is contained in:
Philipp Kunz 2022-07-27 08:59:29 +02:00
parent ca72206ab4
commit 862577745d
11 changed files with 8097 additions and 19072 deletions

View File

@ -12,20 +12,12 @@ stages:
- release
- metadata
before_script:
- npm install -g @shipzone/npmci
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
@ -97,10 +89,9 @@ codequality:
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker
@ -120,11 +111,10 @@ trigger:
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci node install stable
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
- npmci command npm run buildDocs
tags:
- lossless
- docker

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "current file",
"type": "node",
"command": "npm test",
"name": "Run npm test",
"request": "launch",
"args": [
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
"type": "node-terminal"
}
]
}

View File

@ -5,7 +5,7 @@
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitrepo": "smartdns",
"shortDescription": "smart dns methods written in TypeScript",
"description": "smart dns methods written in TypeScript",
"npmPackagename": "@pushrocks/smartdns",
"license": "MIT"
}

27015
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,8 @@
"typings": "dist_ts/index.d.ts",
"scripts": {
"test": "(tstest test/)",
"build": "(tsbuild --web)"
"build": "(tsbuild --web)",
"buildDocs": "tsdoc"
},
"repository": {
"type": "git",
@ -25,18 +26,18 @@
},
"homepage": "https://gitlab.com/pushrocks/dnsly#README",
"dependencies": {
"@pushrocks/smartdelay": "^2.0.10",
"@pushrocks/smartenv": "^4.0.16",
"@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartrequest": "^1.1.47",
"@tsclass/tsclass": "^3.0.21",
"dns2": "^1.4.2"
"@pushrocks/smartdelay": "^2.0.13",
"@pushrocks/smartenv": "^5.0.2",
"@pushrocks/smartpromise": "^3.1.7",
"@pushrocks/smartrequest": "^1.1.56",
"@tsclass/tsclass": "^4.0.17",
"dns2": "^2.0.5"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.24",
"@gitzone/tstest": "^1.0.43",
"@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.0.27",
"@gitzone/tsbuild": "^2.1.63",
"@gitzone/tstest": "^1.0.72",
"@pushrocks/tapbundle": "^5.0.4",
"@types/node": "^18.6.1",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0"
},
@ -54,5 +55,6 @@
],
"browserslist": [
"last 1 chrome versions"
]
],
"type": "module"
}

View File

@ -1,16 +1,16 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartdns from '../ts/index';
import * as smartdns from '../ts/index.js';
let testDnsly: smartdns.Smartdns;
tap.test('should create an instance of Dnsly', async () => {
testDnsly = new smartdns.Smartdns({});
expect(testDnsly).to.be.instanceOf(smartdns.Smartdns);
expect(testDnsly).toBeInstanceOf(smartdns.Smartdns);
});
tap.test('should get an A DNS Record', async () => {
return expect(testDnsly.getRecordA('dnsly_a.bleu.de')).to.eventually.deep.equal([
return expect(await testDnsly.getRecordA('dnsly_a.bleu.de')).toEqual([
{
name: 'dnsly_a.bleu.de',
value: '127.0.0.1',
@ -21,7 +21,7 @@ tap.test('should get an A DNS Record', async () => {
});
tap.test('should get an AAAA Record', async () => {
return expect(testDnsly.getRecordAAAA('dnsly_aaaa.bleu.de')).to.eventually.deep.equal([
return expect(await testDnsly.getRecordAAAA('dnsly_aaaa.bleu.de')).toEqual([
{
name: 'dnsly_aaaa.bleu.de',
value: '::1',
@ -32,7 +32,7 @@ tap.test('should get an AAAA Record', async () => {
});
tap.test('should get a txt record', async () => {
return expect(testDnsly.getRecordTxt('dnsly_txt.bleu.de')).to.eventually.deep.equal([
return expect(await testDnsly.getRecordTxt('dnsly_txt.bleu.de')).toEqual([
{
name: 'dnsly_txt.bleu.de',
value: 'sometext_txt',
@ -48,18 +48,15 @@ tap.test('should, get a mx record for a domain', async () => {
});
tap.test('should check until DNS is available', async () => {
return expect(testDnsly.checkUntilAvailable('dnsly_txt.bleu.de', 'TXT', 'sometext_txt')).to
.eventually.be.true;
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 () => {
return expect(testDnsly.checkUntilAvailable('dnsly_txt.bleu.de', 'TXT', 'sometext_txt2')).to
.eventually.be.false;
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 () => {
return expect(testDnsly.checkUntilAvailable('dnsly_txtNotThere.bleu.de', 'TXT', 'sometext_txt2'))
.to.eventually.be.false;
return expect(await testDnsly.checkUntilAvailable('dnsly_txtNotThere.bleu.de', 'TXT', 'sometext_txt2')).toBeFalse()
});
tap.test('should get name server for hostname', async () => {
@ -70,7 +67,7 @@ tap.test('should get name server for hostname', async () => {
tap.test('should detect dns sec', async () => {
const result = await testDnsly.getRecordA('lossless.com');
console.log(result[0]);
expect(result[0].dnsSecEnabled).to.be.true;
expect(result[0].dnsSecEnabled).toBeTrue();
});
tap.start();

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartdns',
version: '4.0.11',
description: 'smart dns methods written in TypeScript'
}

View File

@ -2,7 +2,7 @@ import * as smartenv from '@pushrocks/smartenv';
const smartenvInstance = new smartenv.Smartenv();
// node native scope
import type dnsType from 'dns';
const dns: typeof dnsType = smartenvInstance.getSafeNodeModule('dns');
const dns: typeof dnsType = await smartenvInstance.getSafeNodeModule('dns');
export { dns };
@ -18,7 +18,5 @@ import * as tsclass from '@tsclass/tsclass';
export { tsclass };
// third party scope
const dns2 = smartenvInstance.getSafeNodeModule('dns2');
export { dns2 };

View File

@ -1,4 +1,4 @@
import * as plugins from './dnsly.plugins';
import * as plugins from './dnsly.plugins.js';
export type TDnsProvider = 'google' | 'cloudflare';

10
tsconfig.json Normal file
View File

@ -0,0 +1,10 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext",
"esModuleInterop": true
}
}

View File

@ -1,17 +0,0 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}