nestjs-ip-filter 0.1.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 (48) hide show
  1. package/.eslintrc.js +29 -0
  2. package/.prettierrc +4 -0
  3. package/.vscode/settings.json +3 -0
  4. package/LICENSE +21 -0
  5. package/README.md +190 -0
  6. package/dist/index.d.ts +8 -0
  7. package/dist/index.js +21 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/ipfilter-core.module.d.ts +24 -0
  10. package/dist/ipfilter-core.module.js +87 -0
  11. package/dist/ipfilter-core.module.js.map +1 -0
  12. package/dist/ipfilter-deny.exception.d.ts +4 -0
  13. package/dist/ipfilter-deny.exception.js +11 -0
  14. package/dist/ipfilter-deny.exception.js.map +1 -0
  15. package/dist/ipfilter.constants.d.ts +2 -0
  16. package/dist/ipfilter.constants.js +6 -0
  17. package/dist/ipfilter.constants.js.map +1 -0
  18. package/dist/ipfilter.guard.d.ts +8 -0
  19. package/dist/ipfilter.guard.js +57 -0
  20. package/dist/ipfilter.guard.js.map +1 -0
  21. package/dist/ipfilter.interface.d.ts +18 -0
  22. package/dist/ipfilter.interface.js +3 -0
  23. package/dist/ipfilter.interface.js.map +1 -0
  24. package/dist/ipfilter.module.d.ts +6 -0
  25. package/dist/ipfilter.module.js +22 -0
  26. package/dist/ipfilter.module.js.map +1 -0
  27. package/dist/ipfilter.providers.d.ts +3 -0
  28. package/dist/ipfilter.providers.js +13 -0
  29. package/dist/ipfilter.providers.js.map +1 -0
  30. package/dist/ipfilter.service.d.ts +12 -0
  31. package/dist/ipfilter.service.js +45 -0
  32. package/dist/ipfilter.service.js.map +1 -0
  33. package/dist/tsconfig.tsbuildinfo +1 -0
  34. package/index.js +6 -0
  35. package/index.ts +1 -0
  36. package/lib/index.ts +8 -0
  37. package/lib/ipfilter-core.module.ts +94 -0
  38. package/lib/ipfilter-deny.exception.ts +7 -0
  39. package/lib/ipfilter.constants.ts +2 -0
  40. package/lib/ipfilter.guard.ts +56 -0
  41. package/lib/ipfilter.interface.ts +28 -0
  42. package/lib/ipfilter.module.ts +23 -0
  43. package/lib/ipfilter.providers.ts +13 -0
  44. package/lib/ipfilter.service.ts +37 -0
  45. package/nest-cli.json +5 -0
  46. package/package.json +86 -0
  47. package/tsconfig.build.json +4 -0
  48. package/tsconfig.json +24 -0
package/package.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "nestjs-ip-filter",
3
+ "version": "0.1.0",
4
+ "description": "A NestJS Guard for filtering IP addresses",
5
+ "author": "Deokgyu Yang <secugyu@gmail.com>",
6
+ "keywords": [
7
+ "nestjs",
8
+ "ip filter",
9
+ "whitelist",
10
+ "blacklist"
11
+ ],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/awesometic/nestjs-ip-filter.git"
16
+ },
17
+ "homepage": "https://github.com/awesometic/nestjs-ip-filter",
18
+ "bugs": {
19
+ "url": "https://github.com/awesometic/nestjs-ip-filter/issues"
20
+ },
21
+ "scripts": {
22
+ "prebuild": "rimraf dist",
23
+ "build": "rm -rf dist && tsc -p tsconfig.json",
24
+ "format": "prettier --write \"{lib,example}/**/*.ts\"",
25
+ "prepublish:npm": "npm run lint && npm run format && npm run build",
26
+ "publish:npm": "npm publish --access public",
27
+ "start": "nest start",
28
+ "start:dev": "nest start --watch",
29
+ "start:debug": "nest start --debug --watch",
30
+ "lint": "eslint \"{lib,apps,libs,test,example/src}/**/*.ts\" --fix",
31
+ "test": "jest",
32
+ "test:watch": "jest --watch",
33
+ "test:cov": "jest --coverage",
34
+ "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand"
35
+ },
36
+ "dependencies": {
37
+ "@nestjs/common": "^8.1.1",
38
+ "@nestjs/core": "^8.1.1",
39
+ "@nestjs/platform-express": "^8.1.1",
40
+ "@supercharge/request-ip": "^1.2.0",
41
+ "reflect-metadata": "^0.1.13",
42
+ "rimraf": "^3.0.2",
43
+ "rxjs": "^7.4.0"
44
+ },
45
+ "devDependencies": {
46
+ "@nestjs/cli": "^8.1.3",
47
+ "@nestjs/schematics": "^8.0.4",
48
+ "@nestjs/testing": "^8.1.1",
49
+ "@types/express": "^4.17.13",
50
+ "@types/jest": "^27.0.2",
51
+ "@types/node": "^16.11.1",
52
+ "@types/supertest": "^2.0.11",
53
+ "@typescript-eslint/eslint-plugin": "^5.28.0",
54
+ "@typescript-eslint/parser": "^5.28.0",
55
+ "eslint": "^8.17.0",
56
+ "eslint-config-google": "^0.14.0",
57
+ "eslint-config-prettier": "^8.3.0",
58
+ "eslint-plugin-prettier": "^3.4.1",
59
+ "jest": "^27.3.0",
60
+ "prettier": "^2.4.1",
61
+ "source-map-support": "^0.5.20",
62
+ "supertest": "^6.1.6",
63
+ "ts-jest": "^27.0.7",
64
+ "ts-loader": "^9.2.6",
65
+ "ts-node": "^10.3.0",
66
+ "tsconfig-paths": "^3.11.0",
67
+ "typescript": "^4.4.4"
68
+ },
69
+ "jest": {
70
+ "moduleFileExtensions": [
71
+ "js",
72
+ "json",
73
+ "ts"
74
+ ],
75
+ "rootDir": "lib",
76
+ "testRegex": ".*\\.spec\\.ts$",
77
+ "transform": {
78
+ "^.+\\.(t|j)s$": "ts-jest"
79
+ },
80
+ "collectCoverageFrom": [
81
+ "**/*.(t|j)s"
82
+ ],
83
+ "coverageDirectory": "../coverage",
84
+ "testEnvironment": "node"
85
+ }
86
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "exclude": ["node_modules", "dist", "test", "**/*spec.ts"]
4
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,24 @@
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
+ }