@liberstudio/cloudflare-list 2.0.7 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  import { HttpService } from "@nestjs/axios";
2
- import type { CloudflareAttacksOptions, CloudflareResponse } from "./interfaces";
2
+ import type { CloudflareAttacksOptions } from "./interfaces";
3
3
  export declare class AttacksService {
4
4
  private readonly httpService;
5
5
  private readonly options;
6
6
  private readonly logger;
7
7
  private readonly API_URL;
8
8
  constructor(httpService: HttpService, options: CloudflareAttacksOptions);
9
- updateIpList(ip: string): Promise<CloudflareResponse>;
9
+ updateIpList(ip: string): Promise<any>;
10
10
  }
@@ -20,7 +20,6 @@ exports.AttacksService = void 0;
20
20
  const common_1 = require("@nestjs/common");
21
21
  const axios_1 = require("@nestjs/axios");
22
22
  const axios_2 = __importDefault(require("axios"));
23
- const rxjs_1 = require("rxjs");
24
23
  let AttacksService = class AttacksService {
25
24
  constructor(httpService, options) {
26
25
  this.httpService = httpService;
@@ -38,12 +37,13 @@ let AttacksService = class AttacksService {
38
37
  const formattedIp = ip.includes("/") ? ip : `${ip}/32`;
39
38
  const body = [{ ip: formattedIp, comment }];
40
39
  try {
41
- const response = await (0, rxjs_1.firstValueFrom)(this.httpService.post(url, body, {
40
+ const response = await axios_2.default.post(url, body, {
42
41
  headers: {
43
42
  Authorization: `Bearer ${apiToken}`,
44
43
  "Content-Type": "application/json",
44
+ Accept: "application/json", // Aggiungi questo esplicitamente
45
45
  },
46
- }));
46
+ });
47
47
  return response.data;
48
48
  }
49
49
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liberstudio/cloudflare-list",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "Modulo NestJS per gestione IP List Cloudflare",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",