From f9aa961e01cfaf7c94e7f00c2c77797e4cbc2278 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Tue, 27 May 2025 11:39:22 +0000 Subject: [PATCH] fix(test & plugins): Rename test client variable and export smartrequest in client plugins --- changelog.md | 6 ++++++ package.json | 1 + pnpm-lock.yaml | 5 ++++- test/test.client.ts | 24 ++++++++++++------------ ts/00_commitinfo_data.ts | 2 +- ts_client/plugins.ts | 3 ++- 6 files changed, 26 insertions(+), 15 deletions(-) diff --git a/changelog.md b/changelog.md index eb25376..775ede7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2025-05-27 - 7.0.1 - fix(test & plugins) +Rename test client variable and export smartrequest in client plugins + +- Renamed variable 'testDnsly' to 'testDnsClient' in test/test.client.ts for better clarity. +- Added @push.rocks/smartrequest dependency in package.json and updated ts_client/plugins.ts to export it. + ## 2025-05-27 - 7.0.0 - BREAKING CHANGE(core) Refactor module entry point and update plugin imports; remove deprecated dnsly.plugins, update dependency versions, and adjust test imports diff --git a/package.json b/package.json index 5ce1607..90bc04a 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@push.rocks/smartdelay": "^3.0.1", "@push.rocks/smartenv": "^5.0.5", "@push.rocks/smartpromise": "^4.2.3", + "@push.rocks/smartrequest": "^2.1.0", "@tsclass/tsclass": "^9.2.0", "@types/dns-packet": "^5.6.5", "@types/elliptic": "^6.4.18", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ec1732e..f7af34a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: '@push.rocks/smartpromise': specifier: ^4.2.3 version: 4.2.3 + '@push.rocks/smartrequest': + specifier: ^2.1.0 + version: 2.1.0 '@tsclass/tsclass': specifier: ^9.2.0 version: 9.2.0 @@ -2358,7 +2361,7 @@ packages: engines: {node: '>= 14'} humanize-ms@1.2.1: - resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} + resolution: {integrity: sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=} humanize-number@0.0.2: resolution: {integrity: sha512-un3ZAcNQGI7RzaWGZzQDH47HETM4Wrj6z6E4TId8Yeq9w5ZKUVB1nrT2jwFheTUjEmqcgTjXDc959jum+ai1kQ==} diff --git a/test/test.client.ts b/test/test.client.ts index 158b8f7..a9a80b5 100644 --- a/test/test.client.ts +++ b/test/test.client.ts @@ -2,15 +2,15 @@ import { expect, tap } from '@git.zone/tstest/tapbundle'; import * as smartdns from '../ts_client/index.js'; -let testDnsly: smartdns.Smartdns; +let testDnsClient: smartdns.Smartdns; tap.test('should create an instance of Dnsly', async () => { - testDnsly = new smartdns.Smartdns({}); - expect(testDnsly).toBeInstanceOf(smartdns.Smartdns); + testDnsClient = new smartdns.Smartdns({}); + expect(testDnsClient).toBeInstanceOf(smartdns.Smartdns); }); tap.test('should get an A DNS Record', async () => { - return expect(await testDnsly.getRecordsA('dnsly_a.bleu.de')).toEqual([ + return expect(await testDnsClient.getRecordsA('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(await testDnsly.getRecordsAAAA('dnsly_aaaa.bleu.de')).toEqual([ + return expect(await testDnsClient.getRecordsAAAA('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(await testDnsly.getRecordsTxt('dnsly_txt.bleu.de')).toEqual([ + return expect(await testDnsClient.getRecordsTxt('dnsly_txt.bleu.de')).toEqual([ { name: 'dnsly_txt.bleu.de', value: 'sometext_txt', @@ -43,35 +43,35 @@ tap.test('should get a txt record', async () => { }); tap.test('should, get a mx record for a domain', async () => { - const res = await testDnsly.getRecords('bleu.de', 'MX'); + const res = await testDnsClient.getRecords('bleu.de', 'MX'); console.log(res); }); tap.test('should check until DNS is available', async () => { return expect( - await testDnsly.checkUntilAvailable('dnsly_txt.bleu.de', 'TXT', 'sometext_txt') + await testDnsClient.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( - await testDnsly.checkUntilAvailable('dnsly_txt.bleu.de', 'TXT', 'sometext_txt2') + await testDnsClient.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( - await testDnsly.checkUntilAvailable('dnsly_txtNotThere.bleu.de', 'TXT', 'sometext_txt2') + await testDnsClient.checkUntilAvailable('dnsly_txtNotThere.bleu.de', 'TXT', 'sometext_txt2') ).toBeFalse(); }); tap.test('should get name server for hostname', async () => { - let result = await testDnsly.getNameServers('bleu.de'); + let result = await testDnsClient.getNameServers('bleu.de'); console.log(result); }); tap.test('should detect dns sec', async () => { - const result = await testDnsly.getRecordsA('lossless.com'); + const result = await testDnsClient.getRecordsA('lossless.com'); console.log(result[0]); expect(result[0].dnsSecEnabled).toBeTrue(); }); diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 64d2228..00bd39c 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartdns', - version: '7.0.0', + version: '7.0.1', description: 'A robust TypeScript library providing advanced DNS management and resolution capabilities including support for DNSSEC, custom DNS servers, and integration with various DNS providers.' } diff --git a/ts_client/plugins.ts b/ts_client/plugins.ts index ba69f33..8710b68 100644 --- a/ts_client/plugins.ts +++ b/ts_client/plugins.ts @@ -9,8 +9,9 @@ export { dns }; // pushrocks scope import * as smartdelay from '@push.rocks/smartdelay'; import * as smartpromise from '@push.rocks/smartpromise'; +import * as smartrequest from '@push.rocks/smartrequest'; -export { smartdelay, smartenv, smartpromise }; +export { smartdelay, smartenv, smartpromise, smartrequest }; import * as tsclass from '@tsclass/tsclass';