@liberstudio/cloudflare-list 2.0.3 → 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 +23 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -9,9 +9,8 @@
9
9
  5. Salvare il token API senza scadenza
10
10
  6. Domains > Scegliere il dominio da utilizzare
11
11
  7. Andare nella categoria Security > Security Rules > Create rule > Custom Rules
12
- 8. Nome: <Name>, Field: <IP Source Address , is in, scegli la lista creata prima>, Action: <Block>
12
+ 8. Nome: <Name>, Field: <IP Source Address , is in, scegli la lista creata prima>, Action: Block
13
13
  9. Salvare la regola
14
- 10. Creare un token API
15
14
 
16
15
  ## Installazione
17
16
 
@@ -40,3 +39,25 @@ import { CloudflareAttacksModule } from "@liberstudio/cloudflare-list";
40
39
  })
41
40
  export class AppModule {}
42
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.3",
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",