4 Commits

Author SHA1 Message Date
32f8315493 1.0.6 2023-04-10 14:42:24 +02:00
ffbf56625e fix(core): update 2023-04-10 14:42:24 +02:00
d928a62b5e 1.0.5 2023-04-10 14:34:29 +02:00
b5c5b18f35 fix(core): update 2023-04-10 14:34:28 +02:00
5 changed files with 65 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartwhois", "name": "@pushrocks/smartwhois",
"version": "1.0.4", "version": "1.0.6",
"private": false, "private": false,
"description": "a package for dealing with whois requests", "description": "a package for dealing with whois requests",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@ -23,6 +23,7 @@
"@types/node": "^18.15.11" "@types/node": "^18.15.11"
}, },
"dependencies": { "dependencies": {
"tldts": "^6.0.3",
"whoiser": "^1.16.0" "whoiser": "^1.16.0"
}, },
"browserslist": [ "browserslist": [

14
pnpm-lock.yaml generated
View File

@ -1,6 +1,9 @@
lockfileVersion: '6.0' lockfileVersion: '6.0'
dependencies: dependencies:
tldts:
specifier: ^6.0.3
version: 6.0.3
whoiser: whoiser:
specifier: ^1.16.0 specifier: ^1.16.0
version: 1.16.0 version: 1.16.0
@ -4177,6 +4180,17 @@ packages:
esm: 3.2.25 esm: 3.2.25
dev: true dev: true
/tldts-core@6.0.3:
resolution: {integrity: sha512-PLiEM2aCkfGifyr8npbd93eWIW4isFRB44vTiup5DRie6e2Qy3+9quwHb252v12JyoM+RmF1cxtDgwD2PVBOjA==}
dev: false
/tldts@6.0.3:
resolution: {integrity: sha512-rcdUIwrcGuMWe5+fg5FFBrmWTYdbfpHwkk1AjBKoSDbpsdAsYqJYKoZOVOHn8MQCYatADKGAx/SU+jpSKxSYNw==}
hasBin: true
dependencies:
tldts-core: 6.0.3
dev: false
/to-regex-range@5.0.1: /to-regex-range@5.0.1:
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
engines: {node: '>=8.0'} engines: {node: '>=8.0'}

View File

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

View File

@ -1,7 +1,44 @@
import * as plugins from './smartwhois.plugins.js'; import * as plugins from './smartwhois.plugins.js';
export interface IWhoisInfo {
domain: string;
isRegistered: boolean;
domainStatus: Array<
| 'clientTransferProhibited'
| 'clientUpdateProhibited'
| 'clientDeleteProhibited'
| 'clientHold'
| 'serverTransferProhibited'
| 'serverUpdateProhibited'
| 'serverDeleteProhibited'
| 'serverHold'
| 'inactive'
| 'pendingDelete'
| 'pendingRenew'
| 'pendingTransfer'
| 'pendingUpdate'
| 'ok'>;
domainWithoutSuffix: string;
hostname: string;
isIcann: boolean;
isIp: boolean;
isPrivate: boolean;
publicSuffix: string;
subdomain: string;
dnsSec: 'signedDelegation' | 'unsigned';
originalWhoisInfo: {
[key: string]: any;
};
whoisServers: string[];
registrar: string;
registrarUrl: string;
createdDate: string;
updatedDate: string;
expiryDate: string;
}
export class SmartWhois { export class SmartWhois {
public async getWhoisForDomain(domainArg: string) { public async getWhoisForDomain(domainArg: string): Promise<IWhoisInfo> {
const whoisInfo = await plugins.whoiser.domain(domainArg); const whoisInfo = await plugins.whoiser.domain(domainArg);
const whoisServers = Object.keys(whoisInfo); const whoisServers = Object.keys(whoisInfo);
const selectedWhoisInfo: any = whoisInfo[whoisServers[0]]; const selectedWhoisInfo: any = whoisInfo[whoisServers[0]];
@ -10,7 +47,14 @@ export class SmartWhois {
const createdDate = selectedWhoisInfo['Created Date']; const createdDate = selectedWhoisInfo['Created Date'];
const updatedDate = selectedWhoisInfo['Updated Date']; const updatedDate = selectedWhoisInfo['Updated Date'];
const expiryDate = selectedWhoisInfo['Expiry Date']; const expiryDate = selectedWhoisInfo['Expiry Date'];
const tldtsData = plugins.tldts.parse(domainArg);
return { return {
...tldtsData,
isRegistered: true,
domainStatus: selectedWhoisInfo['Domain Status'].map((statusArg: string) => statusArg.split(' ')[0]),
dnsSec: selectedWhoisInfo['DNSSEC'],
originalWhoisInfo: whoisInfo, originalWhoisInfo: whoisInfo,
whoisServers, whoisServers,
registrar, registrar,

View File

@ -1,6 +1,8 @@
// third party // third party
import * as whoiser from 'whoiser'; import * as whoiser from 'whoiser';
import tldts from 'tldts';
export { export {
whoiser whoiser,
tldts,
} }