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:
2025-11-22 17:07:12 +00:00
parent 83fab5dbd3
commit 89b51ff9f7
13 changed files with 9022 additions and 4105 deletions

View File

@@ -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'
}

View File

@@ -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);

View File

@@ -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),

View File

@@ -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';