fix(core): update
This commit is contained in:
parent
d928a62b5e
commit
ffbf56625e
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartwhois',
|
||||
version: '1.0.5',
|
||||
version: '1.0.6',
|
||||
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 {
|
||||
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;
|
||||
@ -9,7 +25,6 @@ export interface IWhoisInfo {
|
||||
isPrivate: boolean;
|
||||
publicSuffix: string;
|
||||
subdomain: string;
|
||||
isRegistered: boolean;
|
||||
dnsSec: 'signedDelegation' | 'unsigned';
|
||||
originalWhoisInfo: {
|
||||
[key: string]: any;
|
||||
@ -22,9 +37,8 @@ export interface IWhoisInfo {
|
||||
expiryDate: string;
|
||||
}
|
||||
|
||||
|
||||
export class SmartWhois {
|
||||
public async getWhoisForDomain(domainArg: string) {
|
||||
public async getWhoisForDomain(domainArg: string): Promise<IWhoisInfo> {
|
||||
const whoisInfo = await plugins.whoiser.domain(domainArg);
|
||||
const whoisServers = Object.keys(whoisInfo);
|
||||
const selectedWhoisInfo: any = whoisInfo[whoisServers[0]];
|
||||
@ -39,6 +53,7 @@ export class SmartWhois {
|
||||
return {
|
||||
...tldtsData,
|
||||
isRegistered: true,
|
||||
domainStatus: selectedWhoisInfo['Domain Status'].map((statusArg: string) => statusArg.split(' ')[0]),
|
||||
dnsSec: selectedWhoisInfo['DNSSEC'],
|
||||
originalWhoisInfo: whoisInfo,
|
||||
whoisServers,
|
||||
|
Loading…
Reference in New Issue
Block a user