fix(core): update
This commit is contained in:
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartwhois',
|
||||
version: '1.0.2',
|
||||
description: 'a package for dealing with whois requests'
|
||||
}
|
25
ts/index.ts
Normal file
25
ts/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import * as plugins from './smartwhois.plugins.js';
|
||||
|
||||
export class SmartWhois {
|
||||
public async getWhoisForDomain(domainArg: string) {
|
||||
const whoisInfo = await plugins.whoiser.domain(domainArg);
|
||||
const whoisServers = Object.keys(whoisInfo);
|
||||
const selectedWhoisInfo: any = whoisInfo[whoisServers[0]];
|
||||
const registrar = selectedWhoisInfo.Registrar;
|
||||
const registrarUrl = selectedWhoisInfo['Registrar URL'];
|
||||
const createdDate = selectedWhoisInfo['Created Date'];
|
||||
const updatedDate = selectedWhoisInfo['Updated Date'];
|
||||
const expiryDate = selectedWhoisInfo['Expiry Date'];
|
||||
return {
|
||||
originalWhoisInfo: whoisInfo,
|
||||
whoisServers,
|
||||
registrar,
|
||||
registrarUrl,
|
||||
createdDate,
|
||||
updatedDate,
|
||||
expiryDate,
|
||||
};
|
||||
}
|
||||
|
||||
public async getWhoisForIp(ipArg: string) {}
|
||||
}
|
6
ts/smartwhois.plugins.ts
Normal file
6
ts/smartwhois.plugins.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// third party
|
||||
import * as whoiser from 'whoiser';
|
||||
|
||||
export {
|
||||
whoiser
|
||||
}
|
Reference in New Issue
Block a user