fix(core): update
This commit is contained in:
parent
b80e042cbd
commit
ca1d0bd9a3
@ -40,6 +40,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@push.rocks/smartfile": "^10.0.28",
|
"@push.rocks/smartfile": "^10.0.28",
|
||||||
"@push.rocks/smartpath": "^5.0.5",
|
"@push.rocks/smartpath": "^5.0.5",
|
||||||
|
"axios": "^1.4.0",
|
||||||
"csv-parser": "^3.0.0",
|
"csv-parser": "^3.0.0",
|
||||||
"unzipper": "^0.10.14"
|
"unzipper": "^0.10.14"
|
||||||
}
|
}
|
||||||
|
24
pnpm-lock.yaml
generated
24
pnpm-lock.yaml
generated
@ -11,6 +11,9 @@ dependencies:
|
|||||||
'@push.rocks/smartpath':
|
'@push.rocks/smartpath':
|
||||||
specifier: ^5.0.5
|
specifier: ^5.0.5
|
||||||
version: 5.0.11
|
version: 5.0.11
|
||||||
|
axios:
|
||||||
|
specifier: ^1.4.0
|
||||||
|
version: 1.4.0
|
||||||
csv-parser:
|
csv-parser:
|
||||||
specifier: ^3.0.0
|
specifier: ^3.0.0
|
||||||
version: 3.0.0
|
version: 3.0.0
|
||||||
@ -2009,6 +2012,16 @@ packages:
|
|||||||
engines: {node: '>=4'}
|
engines: {node: '>=4'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/axios@1.4.0:
|
||||||
|
resolution: {integrity: sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==}
|
||||||
|
dependencies:
|
||||||
|
follow-redirects: 1.15.2
|
||||||
|
form-data: 4.0.0
|
||||||
|
proxy-from-env: 1.1.0
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- debug
|
||||||
|
dev: false
|
||||||
|
|
||||||
/balanced-match@1.0.2:
|
/balanced-match@1.0.2:
|
||||||
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
|
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
|
||||||
|
|
||||||
@ -2843,6 +2856,16 @@ packages:
|
|||||||
path-exists: 4.0.0
|
path-exists: 4.0.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/follow-redirects@1.15.2:
|
||||||
|
resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==}
|
||||||
|
engines: {node: '>=4.0'}
|
||||||
|
peerDependencies:
|
||||||
|
debug: '*'
|
||||||
|
peerDependenciesMeta:
|
||||||
|
debug:
|
||||||
|
optional: true
|
||||||
|
dev: false
|
||||||
|
|
||||||
/foreground-child@2.0.0:
|
/foreground-child@2.0.0:
|
||||||
resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==}
|
resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==}
|
||||||
engines: {node: '>=8.0.0'}
|
engines: {node: '>=8.0.0'}
|
||||||
@ -4022,7 +4045,6 @@ packages:
|
|||||||
|
|
||||||
/proxy-from-env@1.1.0:
|
/proxy-from-env@1.1.0:
|
||||||
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
|
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
|
||||||
dev: true
|
|
||||||
|
|
||||||
/public-ip@6.0.1:
|
/public-ip@6.0.1:
|
||||||
resolution: {integrity: sha512-1/Mxa1MKrAQ4jF5IalECSBtB0W1FAtnG+9c5X16jjvV/Gx9fiRy7xXIrHlBGYjnTlai0zdZkM3LrpmASavmAEg==}
|
resolution: {integrity: sha512-1/Mxa1MKrAQ4jF5IalECSBtB0W1FAtnG+9c5X16jjvV/Gx9fiRy7xXIrHlBGYjnTlai0zdZkM3LrpmASavmAEg==}
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@apiclient.xyz/abuse.ch',
|
name: '@apiclient.xyz/abuse.ch',
|
||||||
version: '1.0.4',
|
version: '1.0.5',
|
||||||
description: 'an unofficial client to retrieve abuse.ch data'
|
description: 'an unofficial client to retrieve abuse.ch data'
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import * as plugins from './plugins.js';
|
import * as plugins from './plugins.js';
|
||||||
import * as paths from './paths.js';
|
import * as paths from './paths.js';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
export interface IThreatFoxData {
|
export interface IThreatFoxData {
|
||||||
ID: string;
|
ID: string;
|
||||||
@ -20,19 +21,13 @@ export class ThreatFox {
|
|||||||
const zipPath = plugins.path.join(paths.threatFoxTmp, 'threatfox.zip');
|
const zipPath = plugins.path.join(paths.threatFoxTmp, 'threatfox.zip');
|
||||||
const csvPath = plugins.path.join(paths.threatFoxTmp, 'full.csv');
|
const csvPath = plugins.path.join(paths.threatFoxTmp, 'full.csv');
|
||||||
|
|
||||||
const response = await fetch(ThreatFox.THREATFOX_API_URL);
|
const response = await axios.get(ThreatFox.THREATFOX_API_URL, { responseType: 'stream' });
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error(`HTTP error! status: ${response.status}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
const fileStream = plugins.fs.createWriteStream(zipPath);
|
const fileStream = plugins.fs.createWriteStream(zipPath);
|
||||||
// @ts-ignore
|
response.data.pipe(fileStream);
|
||||||
const readable = plugins.stream.Readable.from(response.body);
|
fileStream.on('finish', resolve);
|
||||||
plugins.stream.pipeline(readable, fileStream, (err) => {
|
fileStream.on('error', reject);
|
||||||
if (err) reject(err);
|
|
||||||
else resolve(null);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import * as plugins from './plugins.js';
|
import * as plugins from './plugins.js';
|
||||||
import * as paths from './paths.js';
|
import * as paths from './paths.js';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
export interface IUrlHouseData {
|
export interface IUrlHouseData {
|
||||||
ID: string;
|
ID: string;
|
||||||
@ -20,19 +21,13 @@ export class UrlHouse {
|
|||||||
const zipPath = plugins.path.join(paths.urlHouseTmp, 'urlhaus.zip');
|
const zipPath = plugins.path.join(paths.urlHouseTmp, 'urlhaus.zip');
|
||||||
const csvPath = plugins.path.join(paths.urlHouseTmp, 'csv.txt');
|
const csvPath = plugins.path.join(paths.urlHouseTmp, 'csv.txt');
|
||||||
|
|
||||||
const response = await fetch(UrlHouse.URLHOUSE_API_URL);
|
const response = await axios.get(UrlHouse.URLHOUSE_API_URL, { responseType: 'stream' });
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error(`HTTP error! status: ${response.status}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
const fileStream = plugins.fs.createWriteStream(zipPath);
|
const fileStream = plugins.fs.createWriteStream(zipPath);
|
||||||
// @ts-ignore
|
response.data.pipe(fileStream);
|
||||||
const readable = plugins.stream.Readable.from(response.body);
|
fileStream.on('finish', resolve);
|
||||||
plugins.stream.pipeline(readable, fileStream, (err) => {
|
fileStream.on('error', reject);
|
||||||
if (err) reject(err);
|
|
||||||
else resolve(null);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user