nestjs-ip-filter 0.2.0 → 1.0.0

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 (41) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +106 -132
  3. package/dist/index.js +0 -1
  4. package/dist/ipfilter-deny.exception.js +0 -1
  5. package/dist/ipfilter.constants.js +0 -1
  6. package/dist/ipfilter.guard.d.ts +2 -3
  7. package/dist/ipfilter.guard.js +11 -25
  8. package/dist/ipfilter.interface.d.ts +1 -4
  9. package/dist/ipfilter.interface.js +0 -1
  10. package/dist/ipfilter.module-definition.d.ts +7 -1
  11. package/dist/ipfilter.module-definition.js +15 -3
  12. package/dist/ipfilter.module.js +3 -10
  13. package/dist/ipfilter.service.d.ts +7 -4
  14. package/dist/ipfilter.service.js +59 -11
  15. package/package.json +36 -60
  16. package/.eslintrc.js +0 -29
  17. package/.prettierrc +0 -4
  18. package/.vscode/settings.json +0 -3
  19. package/dist/index.js.map +0 -1
  20. package/dist/ipfilter-deny.exception.js.map +0 -1
  21. package/dist/ipfilter.constants.js.map +0 -1
  22. package/dist/ipfilter.guard.js.map +0 -1
  23. package/dist/ipfilter.interface.js.map +0 -1
  24. package/dist/ipfilter.module-definition.js.map +0 -1
  25. package/dist/ipfilter.module.js.map +0 -1
  26. package/dist/ipfilter.service.js.map +0 -1
  27. package/dist/tsconfig.tsbuildinfo +0 -1
  28. package/index.js +0 -6
  29. package/index.ts +0 -1
  30. package/lib/index.ts +0 -7
  31. package/lib/ipfilter-deny.exception.ts +0 -7
  32. package/lib/ipfilter.constants.ts +0 -1
  33. package/lib/ipfilter.guard.ts +0 -56
  34. package/lib/ipfilter.interface.ts +0 -10
  35. package/lib/ipfilter.module-definition.ts +0 -5
  36. package/lib/ipfilter.module.ts +0 -22
  37. package/lib/ipfilter.service.ts +0 -37
  38. package/nest-cli.json +0 -5
  39. package/renovate.json +0 -10
  40. package/tsconfig.build.json +0 -4
  41. package/tsconfig.json +0 -24
@@ -1,37 +0,0 @@
1
- import { Inject, Injectable } from '@nestjs/common';
2
- import { IpFilterModuleOptions } from './ipfilter.interface';
3
- import { MODULE_OPTIONS_TOKEN } from './ipfilter.module-definition';
4
-
5
- @Injectable()
6
- export class IpFilterService {
7
- useDenyException: boolean;
8
-
9
- private _whitelist: string[];
10
- private _blacklist: string[];
11
-
12
- constructor(
13
- @Inject(MODULE_OPTIONS_TOKEN)
14
- readonly options: IpFilterModuleOptions,
15
- ) {
16
- this.useDenyException = options.useDenyException ?? false;
17
-
18
- this._whitelist = Object.assign([], options.whitelist ?? []);
19
- this._blacklist = Object.assign([], options.blacklist ?? []);
20
- }
21
-
22
- get whitelist() {
23
- return this._whitelist;
24
- }
25
-
26
- set whitelist(whitelist: string[]) {
27
- this._whitelist = whitelist;
28
- }
29
-
30
- get blacklist() {
31
- return this._blacklist;
32
- }
33
-
34
- set blacklist(blacklist: string[]) {
35
- this._blacklist = blacklist;
36
- }
37
- }
package/nest-cli.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/nest-cli",
3
- "collection": "@nestjs/schematics",
4
- "sourceRoot": "src"
5
- }
package/renovate.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "packageRules": [{
3
- "depTypeList": ["devDependencies"],
4
- "automerge": true,
5
- "ignoreTests": true
6
- }],
7
- "extends": [
8
- "config:base"
9
- ]
10
- }
@@ -1,4 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "exclude": ["node_modules", "dist", "test", "**/*spec.ts"]
4
- }
package/tsconfig.json DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "declaration": true,
5
- "removeComments": true,
6
- "emitDecoratorMetadata": true,
7
- "experimentalDecorators": true,
8
- "allowSyntheticDefaultImports": true,
9
- "target": "es2017",
10
- "sourceMap": true,
11
- "outDir": "./dist",
12
- "baseUrl": "./",
13
- "incremental": true,
14
- "skipLibCheck": true
15
- },
16
- "include": [
17
- "lib/**/*"
18
- ],
19
- "exclude": [
20
- "node_modules",
21
- "**/*.spec.ts",
22
- "tests",
23
- ]
24
- }