BREAKING CHANGE(UrlHaus): Rename UrlHouse to UrlHaus (public API change), migrate dev dependencies to @git.zone, bump runtime deps, adjust TS module resolution, and update tests/docs.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
* autocreated commitinfo by @push.rocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@apiclient.xyz/abuse.ch',
|
||||
version: '1.0.12',
|
||||
version: '2.0.0',
|
||||
description: 'an unofficial client to retrieve abuse.ch data'
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ export class ThreatFox {
|
||||
plugins.fs.createReadStream(csvPath),
|
||||
plugins.csv({
|
||||
headers: ['ID', 'Dateadded', 'URL', 'URLStatus', 'Threat', 'AssociatedTags', 'ThreatFoxLink', 'Reporter'],
|
||||
mapValues: ({ header, value }) => value.trim()
|
||||
mapValues: ({ header, value }) => value.trim(),
|
||||
}),
|
||||
(err) => {
|
||||
if (err) reject(err);
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as plugins from './plugins.js';
|
||||
import * as paths from './paths.js';
|
||||
import * as helpers from './helpers.js';
|
||||
|
||||
export interface IUrlHouseData {
|
||||
export interface IUrlHausData {
|
||||
ID: string;
|
||||
Dateadded: string;
|
||||
URL: string;
|
||||
@@ -13,15 +13,15 @@ export interface IUrlHouseData {
|
||||
Reporter: string;
|
||||
}
|
||||
|
||||
export class UrlHouse {
|
||||
export class UrlHaus {
|
||||
private static readonly URLHOUSE_API_URL: string = 'https://urlhaus.abuse.ch/downloads/csv/';
|
||||
|
||||
public async getData(): Promise<IUrlHouseData[]> {
|
||||
public async getData(): Promise<IUrlHausData[]> {
|
||||
plugins.smartfile.fs.ensureDirSync(paths.urlHouseTmp);
|
||||
const zipPath = plugins.path.join(paths.urlHouseTmp, 'urlhaus.zip');
|
||||
const csvPath = plugins.path.join(paths.urlHouseTmp, 'csv.txt');
|
||||
|
||||
const response = await plugins.nodeFetch(UrlHouse.URLHOUSE_API_URL, {
|
||||
const response = await plugins.nodeFetch(UrlHaus.URLHOUSE_API_URL, {
|
||||
...(helpers.findProxy() ? {
|
||||
agent: helpers.getAgent(),
|
||||
} : {})
|
||||
@@ -51,7 +51,7 @@ export class UrlHouse {
|
||||
);
|
||||
});
|
||||
|
||||
let data: IUrlHouseData[] = [];
|
||||
let data: IUrlHausData[] = [];
|
||||
await new Promise((resolve, reject) => {
|
||||
plugins.stream.pipeline(
|
||||
plugins.fs.createReadStream(csvPath),
|
||||
@@ -1,3 +1,3 @@
|
||||
export * from './abuse.ch.classes.feodotracker.js';
|
||||
export * from './abuse.ch.classes.threatfox.js';
|
||||
export * from './abuse.ch.classes.urlhouse.js';
|
||||
export * from './abuse.ch.classes.urlhaus.js';
|
||||
|
||||
Reference in New Issue
Block a user