@liberstudio/cloudflare-list 2.0.4 → 2.0.5

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.
Files changed (2) hide show
  1. package/README.md +22 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -39,3 +39,25 @@ import { CloudflareAttacksModule } from "@liberstudio/cloudflare-list";
39
39
  })
40
40
  export class AppModule {}
41
41
  ```
42
+
43
+ ## Versione Asincrona con ConfigModule
44
+
45
+ ```typescript
46
+ import { CloudflareAttacksModule } from "@liberstudio/cloudflare-list";
47
+
48
+ @Module({
49
+ imports: [
50
+ CloudflareAttacksModule.forRootAsync({
51
+ imports: [ConfigModule],
52
+ inject: [ConfigService],
53
+ useFactory: (config: ConfigService) => ({
54
+ apiToken: config.getOrThrow<string>('CLOUDFLARE_API_TOKEN'),
55
+ accountId: config.getOrThrow<string>('CLOUDFLARE_ACCOUNT_ID'),
56
+ listId: config.getOrThrow<string>('CLOUDFLARE_LIST_ID'),
57
+ comment: config.get<string>('CLOUDFLARE_LIST_COMMENT') || 'Blocked'
58
+ })
59
+ }),
60
+ ],
61
+ })
62
+ export class AppModule {}
63
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liberstudio/cloudflare-list",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Modulo NestJS per gestione IP List Cloudflare",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",