Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
deba684093 | |||
1625f507d8 | |||
32f8315493 | |||
ffbf56625e |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartwhois",
|
"name": "@pushrocks/smartwhois",
|
||||||
"version": "1.0.5",
|
"version": "1.0.7",
|
||||||
"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",
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/smartwhois',
|
name: '@pushrocks/smartwhois',
|
||||||
version: '1.0.5',
|
version: '1.0.7',
|
||||||
description: 'a package for dealing with whois requests'
|
description: 'a package for dealing with whois requests'
|
||||||
}
|
}
|
||||||
|
21
ts/index.ts
21
ts/index.ts
@ -2,6 +2,22 @@ import * as plugins from './smartwhois.plugins.js';
|
|||||||
|
|
||||||
export interface IWhoisInfo {
|
export interface IWhoisInfo {
|
||||||
domain: string;
|
domain: string;
|
||||||
|
isRegistered: boolean;
|
||||||
|
domainStatus: Array<
|
||||||
|
| 'clientTransferProhibited'
|
||||||
|
| 'clientUpdateProhibited'
|
||||||
|
| 'clientDeleteProhibited'
|
||||||
|
| 'clientHold'
|
||||||
|
| 'serverTransferProhibited'
|
||||||
|
| 'serverUpdateProhibited'
|
||||||
|
| 'serverDeleteProhibited'
|
||||||
|
| 'serverHold'
|
||||||
|
| 'inactive'
|
||||||
|
| 'pendingDelete'
|
||||||
|
| 'pendingRenew'
|
||||||
|
| 'pendingTransfer'
|
||||||
|
| 'pendingUpdate'
|
||||||
|
| 'ok'>;
|
||||||
domainWithoutSuffix: string;
|
domainWithoutSuffix: string;
|
||||||
hostname: string;
|
hostname: string;
|
||||||
isIcann: boolean;
|
isIcann: boolean;
|
||||||
@ -9,7 +25,6 @@ export interface IWhoisInfo {
|
|||||||
isPrivate: boolean;
|
isPrivate: boolean;
|
||||||
publicSuffix: string;
|
publicSuffix: string;
|
||||||
subdomain: string;
|
subdomain: string;
|
||||||
isRegistered: boolean;
|
|
||||||
dnsSec: 'signedDelegation' | 'unsigned';
|
dnsSec: 'signedDelegation' | 'unsigned';
|
||||||
originalWhoisInfo: {
|
originalWhoisInfo: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
@ -22,9 +37,8 @@ export interface IWhoisInfo {
|
|||||||
expiryDate: 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]];
|
||||||
@ -39,6 +53,7 @@ export class SmartWhois {
|
|||||||
return {
|
return {
|
||||||
...tldtsData,
|
...tldtsData,
|
||||||
isRegistered: true,
|
isRegistered: true,
|
||||||
|
domainStatus: selectedWhoisInfo['Domain Status'].map((statusArg: string) => statusArg.split(' ')[0]),
|
||||||
dnsSec: selectedWhoisInfo['DNSSEC'],
|
dnsSec: selectedWhoisInfo['DNSSEC'],
|
||||||
originalWhoisInfo: whoisInfo,
|
originalWhoisInfo: whoisInfo,
|
||||||
whoisServers,
|
whoisServers,
|
||||||
|
Reference in New Issue
Block a user