@russ-b/nestjs-common-tools 2.1.1 → 2.3.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 (94) hide show
  1. package/README.md +275 -0
  2. package/dist/common/util/error.util.d.ts +1 -0
  3. package/dist/common/util/error.util.js +10 -0
  4. package/dist/common/util/error.util.js.map +1 -0
  5. package/dist/common/util/index.d.ts +1 -0
  6. package/dist/common/util/index.js +1 -0
  7. package/dist/common/util/index.js.map +1 -1
  8. package/dist/errors/api-error-code.enum.d.ts +11 -0
  9. package/dist/errors/api-error-code.enum.js +16 -0
  10. package/dist/errors/api-error-code.enum.js.map +1 -0
  11. package/dist/errors/api-error-response.type.d.ts +11 -0
  12. package/dist/errors/api-error-response.type.js +3 -0
  13. package/dist/errors/api-error-response.type.js.map +1 -0
  14. package/dist/errors/api-error-root-field.constant.d.ts +1 -0
  15. package/dist/errors/api-error-root-field.constant.js +5 -0
  16. package/dist/errors/api-error-root-field.constant.js.map +1 -0
  17. package/dist/errors/class-validator-exception.factory.d.ts +6 -0
  18. package/dist/errors/class-validator-exception.factory.js +38 -0
  19. package/dist/errors/class-validator-exception.factory.js.map +1 -0
  20. package/dist/errors/error-response.factory.d.ts +10 -0
  21. package/dist/errors/error-response.factory.js +46 -0
  22. package/dist/errors/error-response.factory.js.map +1 -0
  23. package/dist/errors/index.d.ts +5 -0
  24. package/dist/errors/index.js +22 -0
  25. package/dist/errors/index.js.map +1 -0
  26. package/dist/logger/pino/index.d.ts +1 -0
  27. package/dist/{common/filters → logger/pino}/index.js +1 -1
  28. package/dist/logger/pino/index.js.map +1 -0
  29. package/dist/logger/pino-logger.d.ts +13 -0
  30. package/dist/logger/pino-logger.js +62 -0
  31. package/dist/logger/pino-logger.js.map +1 -0
  32. package/dist/modules/index.d.ts +1 -0
  33. package/dist/modules/index.js +1 -0
  34. package/dist/modules/index.js.map +1 -1
  35. package/dist/modules/outbox/entities/index.d.ts +1 -0
  36. package/dist/modules/outbox/entities/index.js +18 -0
  37. package/dist/modules/outbox/entities/index.js.map +1 -0
  38. package/dist/modules/outbox/entities/outbox-event.entity.d.ts +14 -0
  39. package/dist/modules/outbox/entities/outbox-event.entity.js +76 -0
  40. package/dist/modules/outbox/entities/outbox-event.entity.js.map +1 -0
  41. package/dist/modules/outbox/enums/index.d.ts +1 -0
  42. package/dist/modules/outbox/enums/index.js +18 -0
  43. package/dist/modules/outbox/enums/index.js.map +1 -0
  44. package/dist/modules/outbox/enums/outbox-event-status.enum.d.ts +6 -0
  45. package/dist/modules/outbox/enums/outbox-event-status.enum.js +11 -0
  46. package/dist/modules/outbox/enums/outbox-event-status.enum.js.map +1 -0
  47. package/dist/modules/outbox/index.d.ts +6 -0
  48. package/dist/modules/outbox/index.js +23 -0
  49. package/dist/modules/outbox/index.js.map +1 -0
  50. package/dist/modules/outbox/outbox-options.util.d.ts +3 -0
  51. package/dist/modules/outbox/outbox-options.util.js +34 -0
  52. package/dist/modules/outbox/outbox-options.util.js.map +1 -0
  53. package/dist/modules/outbox/outbox.constants.d.ts +2 -0
  54. package/dist/modules/outbox/outbox.constants.js +6 -0
  55. package/dist/modules/outbox/outbox.constants.js.map +1 -0
  56. package/dist/modules/outbox/outbox.module.d.ts +6 -0
  57. package/dist/modules/outbox/outbox.module.js +74 -0
  58. package/dist/modules/outbox/outbox.module.js.map +1 -0
  59. package/dist/modules/outbox/services/base-worker.d.ts +15 -0
  60. package/dist/modules/outbox/services/base-worker.js +99 -0
  61. package/dist/modules/outbox/services/base-worker.js.map +1 -0
  62. package/dist/modules/outbox/services/index.d.ts +3 -0
  63. package/dist/modules/outbox/services/index.js +20 -0
  64. package/dist/modules/outbox/services/index.js.map +1 -0
  65. package/dist/modules/outbox/services/outbox-cleanup.worker.d.ts +9 -0
  66. package/dist/modules/outbox/services/outbox-cleanup.worker.js +59 -0
  67. package/dist/modules/outbox/services/outbox-cleanup.worker.js.map +1 -0
  68. package/dist/modules/outbox/services/outbox.service.d.ts +33 -0
  69. package/dist/modules/outbox/services/outbox.service.js +289 -0
  70. package/dist/modules/outbox/services/outbox.service.js.map +1 -0
  71. package/dist/modules/outbox/types/index.d.ts +1 -0
  72. package/dist/modules/outbox/types/index.js +18 -0
  73. package/dist/modules/outbox/types/index.js.map +1 -0
  74. package/dist/modules/outbox/types/outbox-module-options.interface.d.ts +35 -0
  75. package/dist/modules/outbox/types/outbox-module-options.interface.js +3 -0
  76. package/dist/modules/outbox/types/outbox-module-options.interface.js.map +1 -0
  77. package/dist/zod/filters/index.d.ts +3 -0
  78. package/dist/zod/filters/index.js +20 -0
  79. package/dist/zod/filters/index.js.map +1 -0
  80. package/dist/zod/filters/zod-express-exception.filter.d.ts +8 -0
  81. package/dist/zod/filters/zod-express-exception.filter.js +35 -0
  82. package/dist/zod/filters/zod-express-exception.filter.js.map +1 -0
  83. package/dist/zod/filters/zod-fastify-exception.filter.d.ts +8 -0
  84. package/dist/zod/filters/zod-fastify-exception.filter.js +35 -0
  85. package/dist/zod/filters/zod-fastify-exception.filter.js.map +1 -0
  86. package/dist/zod/filters/zod-validation-error-response.d.ts +6 -0
  87. package/dist/zod/filters/zod-validation-error-response.js +24 -0
  88. package/dist/zod/filters/zod-validation-error-response.js.map +1 -0
  89. package/dist/zod/index.d.ts +1 -0
  90. package/dist/zod/index.js +18 -0
  91. package/dist/zod/index.js.map +1 -0
  92. package/package.json +70 -12
  93. package/dist/common/filters/index.d.ts +0 -1
  94. package/dist/common/filters/index.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@russ-b/nestjs-common-tools",
3
- "version": "2.1.1",
3
+ "version": "2.3.0",
4
4
  "description": "NestJS utility tools",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,14 +8,6 @@
8
8
  "dist",
9
9
  "README.md"
10
10
  ],
11
- "scripts": {
12
- "build": "node -e \"const fs = require('fs'); fs.rmSync('dist', { recursive: true, force: true }); fs.rmSync('tsconfig.tsbuildinfo', { force: true });\" && tsc",
13
- "test": "jest",
14
- "prepublishOnly": "npm test",
15
- "prepare": "npm run build",
16
- "lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
17
- "format": "prettier --write \"src/**/*.ts\""
18
- },
19
11
  "keywords": [
20
12
  "nestjs",
21
13
  "typeorm",
@@ -64,10 +56,26 @@
64
56
  "types": "./dist/modules/index.d.ts",
65
57
  "default": "./dist/modules/index.js"
66
58
  },
59
+ "./modules/outbox": {
60
+ "types": "./dist/modules/outbox/index.d.ts",
61
+ "default": "./dist/modules/outbox/index.js"
62
+ },
67
63
  "./logger": {
68
64
  "types": "./dist/logger/index.d.ts",
69
65
  "default": "./dist/logger/index.js"
70
66
  },
67
+ "./logger/pino": {
68
+ "types": "./dist/logger/pino/index.d.ts",
69
+ "default": "./dist/logger/pino/index.js"
70
+ },
71
+ "./errors": {
72
+ "types": "./dist/errors/index.d.ts",
73
+ "default": "./dist/errors/index.js"
74
+ },
75
+ "./zod": {
76
+ "types": "./dist/zod/index.d.ts",
77
+ "default": "./dist/zod/index.js"
78
+ },
71
79
  "./package.json": "./package.json"
72
80
  },
73
81
  "typesVersions": {
@@ -93,8 +101,20 @@
93
101
  "modules": [
94
102
  "dist/modules/index.d.ts"
95
103
  ],
104
+ "modules/outbox": [
105
+ "dist/modules/outbox/index.d.ts"
106
+ ],
96
107
  "logger": [
97
108
  "dist/logger/index.d.ts"
109
+ ],
110
+ "logger/pino": [
111
+ "dist/logger/pino/index.d.ts"
112
+ ],
113
+ "errors": [
114
+ "dist/errors/index.d.ts"
115
+ ],
116
+ "zod": [
117
+ "dist/zod/index.d.ts"
98
118
  ]
99
119
  }
100
120
  },
@@ -110,11 +130,37 @@
110
130
  "@nestjs/common": "^10.0.0 || ^11.0.0",
111
131
  "@nestjs/config": "^3.0.0 || ^4.0.0",
112
132
  "@nestjs/typeorm": "^10.0.0 || ^11.0.0",
133
+ "fastify": "^4.0.0 || ^5.0.0",
113
134
  "nest-winston": "^1.10.2",
135
+ "nestjs-pino": "^4.6.1",
136
+ "pino": "^10.3.1",
137
+ "pino-http": "^11.0.0",
138
+ "pino-pretty": "^13.1.3",
114
139
  "typeorm": "^0.3.20",
115
140
  "winston": "^3.17.0",
141
+ "winston-loki": "^6.1.3",
116
142
  "winston-transport": "^4.9.0",
117
- "winston-loki": "^6.1.3"
143
+ "zod": "^3.0.0 || ^4.0.0"
144
+ },
145
+ "peerDependenciesMeta": {
146
+ "fastify": {
147
+ "optional": true
148
+ },
149
+ "nestjs-pino": {
150
+ "optional": true
151
+ },
152
+ "pino": {
153
+ "optional": true
154
+ },
155
+ "pino-http": {
156
+ "optional": true
157
+ },
158
+ "pino-pretty": {
159
+ "optional": true
160
+ },
161
+ "zod": {
162
+ "optional": true
163
+ }
118
164
  },
119
165
  "devDependencies": {
120
166
  "@eslint/eslintrc": "^3.2.0",
@@ -126,12 +172,18 @@
126
172
  "eslint": "^9.18.0",
127
173
  "eslint-config-prettier": "^10.0.1",
128
174
  "eslint-plugin-prettier": "^5.2.2",
175
+ "fastify": "^5.8.5",
129
176
  "jest": "^29.7.0",
177
+ "nestjs-pino": "^4.6.1",
178
+ "pino": "^10.3.1",
179
+ "pino-http": "^11.0.0",
180
+ "pino-pretty": "^13.1.3",
130
181
  "prettier": "^3.4.2",
131
182
  "ts-jest": "^29.2.5",
132
183
  "tsconfig-paths": "^4.2.0",
133
184
  "typescript": "^5.7.3",
134
- "typescript-eslint": "^8.20.0"
185
+ "typescript-eslint": "^8.20.0",
186
+ "zod": "^4.0.0"
135
187
  },
136
188
  "jest": {
137
189
  "moduleFileExtensions": [
@@ -152,5 +204,11 @@
152
204
  ],
153
205
  "coverageDirectory": "../coverage",
154
206
  "testEnvironment": "node"
207
+ },
208
+ "scripts": {
209
+ "build": "node -e \"const fs = require('fs'); fs.rmSync('dist', { recursive: true, force: true }); fs.rmSync('tsconfig.tsbuildinfo', { force: true });\" && tsc",
210
+ "test": "jest",
211
+ "lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
212
+ "format": "prettier --write \"src/**/*.ts\""
155
213
  }
156
- }
214
+ }
@@ -1 +0,0 @@
1
- export * from '../../typeorm/filters';
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/filters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC"}