fix(core): update

This commit is contained in:
Philipp Kunz 2023-04-19 14:52:37 +02:00
parent 18f09a5109
commit 43ebd17ae6
6 changed files with 41 additions and 9 deletions

View File

@ -23,7 +23,7 @@
"@types/node": "^18.15.11"
},
"dependencies": {
"@pushrocks/smartrequest": "^2.0.11",
"@pushrocks/smartrequest": "^2.0.15",
"@pushrocks/smarturl": "^3.0.6",
"tldts": "^6.0.3",
"whoiser": "^1.16.0"

18
pnpm-lock.yaml generated
View File

@ -2,8 +2,8 @@ lockfileVersion: '6.0'
dependencies:
'@pushrocks/smartrequest':
specifier: ^2.0.11
version: 2.0.11
specifier: ^2.0.15
version: 2.0.15
'@pushrocks/smarturl':
specifier: ^3.0.6
version: 3.0.6
@ -479,7 +479,7 @@ packages:
'@pushrocks/smartmime': 1.0.5
'@pushrocks/smartpath': 5.0.5
'@pushrocks/smartpromise': 3.1.7
'@pushrocks/smartrequest': 2.0.11
'@pushrocks/smartrequest': 2.0.15
'@pushrocks/smartsitemap': 2.0.1
'@pushrocks/smarttime': 4.0.1
'@tsclass/tsclass': 4.0.34
@ -520,7 +520,7 @@ packages:
'@pushrocks/smartmime': 1.0.5
'@pushrocks/smartpath': 5.0.5
'@pushrocks/smartpromise': 3.1.7
'@pushrocks/smartrequest': 2.0.11
'@pushrocks/smartrequest': 2.0.15
'@pushrocks/smartstream': 2.0.3
'@pushrocks/streamfunction': 4.0.4
'@types/fs-extra': 11.0.1
@ -677,6 +677,10 @@ packages:
/@pushrocks/smartpromise@3.1.7:
resolution: {integrity: sha512-2gLQCeviEJwZ+cHHtK2Ks98brZatGC6dPXKIs1tVgJsiNgRFjnp90fESuJ1Pmoe7RrS+7J3mO4NtsFHAJJ/y5w==}
dev: true
/@pushrocks/smartpromise@4.0.2:
resolution: {integrity: sha512-bqorOaGXPOuiOSV81luTKrTghg4O4NBRD0zyv7TIqmrMGf4a0uoozaUMp1X8vQdZW+y0gTzUJP9wkzAE6Cci0g==}
/@pushrocks/smartpuppeteer@2.0.2:
resolution: {integrity: sha512-l3tqnD6Evseofq1avHsMy2FXXEmCd4Z+nm3xmMWS7nWvP9qTbJIn0XguOBaUIAhR8zE53UKPXs5/qBqXVNZDDQ==}
@ -692,10 +696,10 @@ packages:
- utf-8-validate
dev: true
/@pushrocks/smartrequest@2.0.11:
resolution: {integrity: sha512-fqS5D+o4fzhen4qlhT8DJiSSUVno1q+hSXcq5VJFGTQVtvaZ5lZeK1odqMJsCOHZ3mD2LykrufIPViktwgnyVg==}
/@pushrocks/smartrequest@2.0.15:
resolution: {integrity: sha512-QDXXKhOwAIp+TNFrDglApBpbCTClHrf8pUM3w81q5+VtrMbqUrLINHhInXt3ZUSgTS7RD9HtJSIVSqAukcJo5A==}
dependencies:
'@pushrocks/smartpromise': 3.1.7
'@pushrocks/smartpromise': 4.0.2
'@pushrocks/smarturl': 3.0.6
agentkeepalive: 4.3.0
form-data: 4.0.0

View File

@ -13,6 +13,11 @@ tap.test('should get a parsed url result for whois', async () => {
console.log(parsedUrlResult);
});
tap.test('should get additional data', async () => {
const parsedUrlResult = await testSmartWhois.getAdditionalWhoisDataForDomain('https://coffee.link/understanding-gen-z/');
console.log(parsedUrlResult);
});
tap.test('should get whois info for domain', async () => {
const whoisInfo = await testSmartWhois.getWhoisForDomain('task.vc');
console.log(whoisInfo);

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartwhois',
version: '1.0.8',
version: '1.0.9',
description: 'a package for dealing with whois requests'
}

View File

@ -53,6 +53,27 @@ export class SmartWhois {
}
}
public async getAdditionalWhoisDataForDomain(domainArg: string) {
if (domainArg.includes('//')) {
const parsedUrlResult = await this.getParsedUrlResultForWhois(domainArg);
domainArg = parsedUrlResult.fullDomain;
}
// lets test http response
const httpResult = await plugins.smartrequest.safeGet(`http://${domainArg}/`);
// lets test https response
const httpsResult = await plugins.smartrequest.safeGet(`https://${domainArg}/`);
return {
httpStatus: httpResult.statusCode,
httpsStatus: httpsResult.statusCode,
httpContentType: httpResult.headers['content-type'],
httpsContentType: httpsResult.headers['content-type'],
}
}
public async getWhoisForDomain(domainArg: string): Promise<IWhoisInfo> {
if (domainArg.includes('//')) {

View File

@ -1,8 +1,10 @@
// pushrocks scope
import * as smarturl from '@pushrocks/smarturl';
import * as smartrequest from '@pushrocks/smartrequest';
export {
smarturl,
smartrequest,
}
// third party