nestjs-ddd-cli 2.2.0 → 3.2.1

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 (254) hide show
  1. package/README.md +247 -408
  2. package/ddd.schema.json +111 -0
  3. package/dist/commands/aggregate-validator.d.ts +9 -0
  4. package/dist/commands/aggregate-validator.js +953 -0
  5. package/dist/commands/aggregate-validator.js.map +1 -0
  6. package/dist/commands/ai-assist.d.ts +8 -0
  7. package/dist/commands/ai-assist.js +337 -0
  8. package/dist/commands/ai-assist.js.map +1 -0
  9. package/dist/commands/api-contracts.d.ts +9 -0
  10. package/dist/commands/api-contracts.js +1368 -0
  11. package/dist/commands/api-contracts.js.map +1 -0
  12. package/dist/commands/api-docs.d.ts +8 -0
  13. package/dist/commands/api-docs.js +408 -0
  14. package/dist/commands/api-docs.js.map +1 -0
  15. package/dist/commands/api-versioning.d.ts +11 -0
  16. package/dist/commands/api-versioning.js +643 -0
  17. package/dist/commands/api-versioning.js.map +1 -0
  18. package/dist/commands/audit-logging.d.ts +9 -0
  19. package/dist/commands/audit-logging.js +1129 -0
  20. package/dist/commands/audit-logging.js.map +1 -0
  21. package/dist/commands/batch-generate.d.ts +10 -0
  22. package/dist/commands/batch-generate.js +405 -0
  23. package/dist/commands/batch-generate.js.map +1 -0
  24. package/dist/commands/caching-strategies.d.ts +9 -0
  25. package/dist/commands/caching-strategies.js +874 -0
  26. package/dist/commands/caching-strategies.js.map +1 -0
  27. package/dist/commands/code-analyzer.d.ts +42 -0
  28. package/dist/commands/code-analyzer.js +474 -0
  29. package/dist/commands/code-analyzer.js.map +1 -0
  30. package/dist/commands/database-seeding.d.ts +6 -0
  31. package/dist/commands/database-seeding.js +621 -0
  32. package/dist/commands/database-seeding.js.map +1 -0
  33. package/dist/commands/db-optimization.d.ts +7 -0
  34. package/dist/commands/db-optimization.js +687 -0
  35. package/dist/commands/db-optimization.js.map +1 -0
  36. package/dist/commands/dependency-graph.d.ts +6 -0
  37. package/dist/commands/dependency-graph.js +329 -0
  38. package/dist/commands/dependency-graph.js.map +1 -0
  39. package/dist/commands/doctor-enhanced.d.ts +22 -0
  40. package/dist/commands/doctor-enhanced.js +543 -0
  41. package/dist/commands/doctor-enhanced.js.map +1 -0
  42. package/dist/commands/doctor.d.ts +4 -0
  43. package/dist/commands/doctor.js +151 -0
  44. package/dist/commands/doctor.js.map +1 -0
  45. package/dist/commands/env-manager.d.ts +6 -0
  46. package/dist/commands/env-manager.js +419 -0
  47. package/dist/commands/env-manager.js.map +1 -0
  48. package/dist/commands/event-sourcing-full.d.ts +10 -0
  49. package/dist/commands/event-sourcing-full.js +1107 -0
  50. package/dist/commands/event-sourcing-full.js.map +1 -0
  51. package/dist/commands/feature-flags.d.ts +9 -0
  52. package/dist/commands/feature-flags.js +824 -0
  53. package/dist/commands/feature-flags.js.map +1 -0
  54. package/dist/commands/filter-dsl.d.ts +10 -0
  55. package/dist/commands/filter-dsl.js +1407 -0
  56. package/dist/commands/filter-dsl.js.map +1 -0
  57. package/dist/commands/generate-all.js +485 -32
  58. package/dist/commands/generate-all.js.map +1 -1
  59. package/dist/commands/generate-deployment.d.ts +8 -0
  60. package/dist/commands/generate-deployment.js +746 -0
  61. package/dist/commands/generate-deployment.js.map +1 -0
  62. package/dist/commands/generate-domain-service.d.ts +14 -0
  63. package/dist/commands/generate-domain-service.js +796 -0
  64. package/dist/commands/generate-domain-service.js.map +1 -0
  65. package/dist/commands/generate-entity.js +82 -24
  66. package/dist/commands/generate-entity.js.map +1 -1
  67. package/dist/commands/generate-from-schema.d.ts +56 -0
  68. package/dist/commands/generate-from-schema.js +222 -0
  69. package/dist/commands/generate-from-schema.js.map +1 -0
  70. package/dist/commands/generate-orchestrator.d.ts +14 -0
  71. package/dist/commands/generate-orchestrator.js +887 -0
  72. package/dist/commands/generate-orchestrator.js.map +1 -0
  73. package/dist/commands/generate-repository.d.ts +14 -0
  74. package/dist/commands/generate-repository.js +1019 -0
  75. package/dist/commands/generate-repository.js.map +1 -0
  76. package/dist/commands/generate-shared.d.ts +4 -0
  77. package/dist/commands/generate-shared.js +388 -0
  78. package/dist/commands/generate-shared.js.map +1 -0
  79. package/dist/commands/generate-value-object.d.ts +32 -0
  80. package/dist/commands/generate-value-object.js +700 -0
  81. package/dist/commands/generate-value-object.js.map +1 -0
  82. package/dist/commands/graphql-subscriptions.d.ts +6 -0
  83. package/dist/commands/graphql-subscriptions.js +607 -0
  84. package/dist/commands/graphql-subscriptions.js.map +1 -0
  85. package/dist/commands/graphql-types.d.ts +5 -0
  86. package/dist/commands/graphql-types.js +423 -0
  87. package/dist/commands/graphql-types.js.map +1 -0
  88. package/dist/commands/health-probes-advanced.d.ts +6 -0
  89. package/dist/commands/health-probes-advanced.js +655 -0
  90. package/dist/commands/health-probes-advanced.js.map +1 -0
  91. package/dist/commands/i18n-setup.d.ts +10 -0
  92. package/dist/commands/i18n-setup.js +677 -0
  93. package/dist/commands/i18n-setup.js.map +1 -0
  94. package/dist/commands/init-config.d.ts +6 -0
  95. package/dist/commands/init-config.js +370 -0
  96. package/dist/commands/init-config.js.map +1 -0
  97. package/dist/commands/init-project.js +56 -6
  98. package/dist/commands/init-project.js.map +1 -1
  99. package/dist/commands/interactive-scaffold.d.ts +5 -0
  100. package/dist/commands/interactive-scaffold.js +271 -0
  101. package/dist/commands/interactive-scaffold.js.map +1 -0
  102. package/dist/commands/metrics-prometheus.d.ts +6 -0
  103. package/dist/commands/metrics-prometheus.js +681 -0
  104. package/dist/commands/metrics-prometheus.js.map +1 -0
  105. package/dist/commands/migration-engine.d.ts +6 -0
  106. package/dist/commands/migration-engine.js +446 -0
  107. package/dist/commands/migration-engine.js.map +1 -0
  108. package/dist/commands/migration.d.ts +12 -0
  109. package/dist/commands/migration.js +484 -0
  110. package/dist/commands/migration.js.map +1 -0
  111. package/dist/commands/monorepo.d.ts +8 -0
  112. package/dist/commands/monorepo.js +483 -0
  113. package/dist/commands/monorepo.js.map +1 -0
  114. package/dist/commands/multi-database.d.ts +5 -0
  115. package/dist/commands/multi-database.js +439 -0
  116. package/dist/commands/multi-database.js.map +1 -0
  117. package/dist/commands/observability-tracing.d.ts +10 -0
  118. package/dist/commands/observability-tracing.js +740 -0
  119. package/dist/commands/observability-tracing.js.map +1 -0
  120. package/dist/commands/openapi-export.d.ts +8 -0
  121. package/dist/commands/openapi-export.js +359 -0
  122. package/dist/commands/openapi-export.js.map +1 -0
  123. package/dist/commands/perf-analyzer.d.ts +8 -0
  124. package/dist/commands/perf-analyzer.js +423 -0
  125. package/dist/commands/perf-analyzer.js.map +1 -0
  126. package/dist/commands/rate-limiting.d.ts +10 -0
  127. package/dist/commands/rate-limiting.js +953 -0
  128. package/dist/commands/rate-limiting.js.map +1 -0
  129. package/dist/commands/recipe-plugin.d.ts +56 -0
  130. package/dist/commands/recipe-plugin.js +315 -0
  131. package/dist/commands/recipe-plugin.js.map +1 -0
  132. package/dist/commands/recipe.d.ts +6 -0
  133. package/dist/commands/recipe.js +3941 -0
  134. package/dist/commands/recipe.js.map +1 -0
  135. package/dist/commands/recipes/elasticsearch.recipe.d.ts +1 -0
  136. package/dist/commands/recipes/elasticsearch.recipe.js +761 -0
  137. package/dist/commands/recipes/elasticsearch.recipe.js.map +1 -0
  138. package/dist/commands/recipes/event-sourcing.recipe.d.ts +1 -0
  139. package/dist/commands/recipes/event-sourcing.recipe.js +889 -0
  140. package/dist/commands/recipes/event-sourcing.recipe.js.map +1 -0
  141. package/dist/commands/recipes/index.d.ts +7 -0
  142. package/dist/commands/recipes/index.js +24 -0
  143. package/dist/commands/recipes/index.js.map +1 -0
  144. package/dist/commands/recipes/message-queue.recipe.d.ts +1 -0
  145. package/dist/commands/recipes/message-queue.recipe.js +706 -0
  146. package/dist/commands/recipes/message-queue.recipe.js.map +1 -0
  147. package/dist/commands/recipes/middleware.recipe.d.ts +1 -0
  148. package/dist/commands/recipes/middleware.recipe.js +383 -0
  149. package/dist/commands/recipes/middleware.recipe.js.map +1 -0
  150. package/dist/commands/recipes/multi-tenancy.recipe.d.ts +1 -0
  151. package/dist/commands/recipes/multi-tenancy.recipe.js +520 -0
  152. package/dist/commands/recipes/multi-tenancy.recipe.js.map +1 -0
  153. package/dist/commands/recipes/oauth2.recipe.d.ts +1 -0
  154. package/dist/commands/recipes/oauth2.recipe.js +472 -0
  155. package/dist/commands/recipes/oauth2.recipe.js.map +1 -0
  156. package/dist/commands/recipes/websocket.recipe.d.ts +1 -0
  157. package/dist/commands/recipes/websocket.recipe.js +453 -0
  158. package/dist/commands/recipes/websocket.recipe.js.map +1 -0
  159. package/dist/commands/resilience-patterns.d.ts +13 -0
  160. package/dist/commands/resilience-patterns.js +1029 -0
  161. package/dist/commands/resilience-patterns.js.map +1 -0
  162. package/dist/commands/security-patterns.d.ts +11 -0
  163. package/dist/commands/security-patterns.js +2233 -0
  164. package/dist/commands/security-patterns.js.map +1 -0
  165. package/dist/commands/template-debug.d.ts +27 -0
  166. package/dist/commands/template-debug.js +388 -0
  167. package/dist/commands/template-debug.js.map +1 -0
  168. package/dist/commands/test-factory-full.d.ts +9 -0
  169. package/dist/commands/test-factory-full.js +1570 -0
  170. package/dist/commands/test-factory-full.js.map +1 -0
  171. package/dist/commands/test-scaffold.d.ts +7 -0
  172. package/dist/commands/test-scaffold.js +621 -0
  173. package/dist/commands/test-scaffold.js.map +1 -0
  174. package/dist/index.js +1088 -0
  175. package/dist/index.js.map +1 -1
  176. package/dist/templates/ai-context/CLAUDE.md.hbs +158 -0
  177. package/dist/templates/ai-context/conventions.md.hbs +154 -0
  178. package/dist/templates/command/create-command.hbs +6 -14
  179. package/dist/templates/command/delete-command.hbs +19 -0
  180. package/dist/templates/command/update-command.hbs +24 -0
  181. package/dist/templates/controller/controller.hbs +64 -17
  182. package/dist/templates/dto/create-dto.hbs +29 -5
  183. package/dist/templates/dto/filter-dto.hbs +52 -0
  184. package/dist/templates/dto/filter-query.dto.hbs +148 -0
  185. package/dist/templates/dto/paginated-response.dto.hbs +29 -0
  186. package/dist/templates/dto/pagination-query.dto.hbs +30 -0
  187. package/dist/templates/dto/response-dto.hbs +38 -0
  188. package/dist/templates/dto/update-dto.hbs +11 -0
  189. package/dist/templates/entity/entity.hbs +32 -1
  190. package/dist/templates/event/domain-event.hbs +33 -7
  191. package/dist/templates/event/event-handler.hbs +40 -0
  192. package/dist/templates/exception/base-exceptions.hbs +69 -0
  193. package/dist/templates/exception/entity-not-found.exception.hbs +7 -0
  194. package/dist/templates/mapper/mapper.hbs +49 -24
  195. package/dist/templates/module/module.hbs +34 -10
  196. package/dist/templates/orm-entity/orm-entity.hbs +63 -12
  197. package/dist/templates/prisma/prisma-mapper.hbs +71 -0
  198. package/dist/templates/prisma/prisma-repository.hbs +114 -0
  199. package/dist/templates/prisma/prisma-schema.hbs +20 -0
  200. package/dist/templates/prisma/prisma-service.hbs +51 -0
  201. package/dist/templates/query/get-all.query.hbs +50 -0
  202. package/dist/templates/query/get-by-id.query.hbs +31 -0
  203. package/dist/templates/repository/repository.hbs +55 -13
  204. package/dist/templates/resolver/graphql-input.hbs +54 -0
  205. package/dist/templates/resolver/graphql-type.hbs +58 -0
  206. package/dist/templates/resolver/pagination-args.hbs +33 -0
  207. package/dist/templates/resolver/resolver.hbs +62 -0
  208. package/dist/templates/shared/prisma-query-builder.util.hbs +189 -0
  209. package/dist/templates/shared/query-builder.util.hbs +218 -0
  210. package/dist/templates/test/controller.spec.hbs +124 -0
  211. package/dist/templates/test/repository.spec.hbs +158 -0
  212. package/dist/templates/test/usecase.spec.hbs +116 -0
  213. package/dist/templates/usecase/create-usecase.hbs +19 -7
  214. package/dist/templates/usecase/delete-usecase.hbs +17 -0
  215. package/dist/templates/usecase/update-usecase.hbs +31 -0
  216. package/dist/utils/config.utils.d.ts +45 -0
  217. package/dist/utils/config.utils.js +211 -0
  218. package/dist/utils/config.utils.js.map +1 -0
  219. package/dist/utils/error.utils.d.ts +145 -0
  220. package/dist/utils/error.utils.js +422 -0
  221. package/dist/utils/error.utils.js.map +1 -0
  222. package/dist/utils/field.utils.d.ts +54 -0
  223. package/dist/utils/field.utils.js +389 -0
  224. package/dist/utils/field.utils.js.map +1 -0
  225. package/dist/utils/file.utils.d.ts +19 -8
  226. package/dist/utils/file.utils.js +135 -4
  227. package/dist/utils/file.utils.js.map +1 -1
  228. package/dist/utils/idempotency.utils.d.ts +123 -0
  229. package/dist/utils/idempotency.utils.js +444 -0
  230. package/dist/utils/idempotency.utils.js.map +1 -0
  231. package/dist/utils/naming.utils.js +26 -3
  232. package/dist/utils/naming.utils.js.map +1 -1
  233. package/dist/utils/performance.utils.d.ts +37 -0
  234. package/dist/utils/performance.utils.js +158 -0
  235. package/dist/utils/performance.utils.js.map +1 -0
  236. package/dist/utils/relation.utils.d.ts +92 -0
  237. package/dist/utils/relation.utils.js +388 -0
  238. package/dist/utils/relation.utils.js.map +1 -0
  239. package/dist/utils/rollback.utils.d.ts +49 -0
  240. package/dist/utils/rollback.utils.js +306 -0
  241. package/dist/utils/rollback.utils.js.map +1 -0
  242. package/dist/utils/schema.utils.d.ts +123 -0
  243. package/dist/utils/schema.utils.js +419 -0
  244. package/dist/utils/schema.utils.js.map +1 -0
  245. package/dist/utils/security.utils.d.ts +57 -0
  246. package/dist/utils/security.utils.js +315 -0
  247. package/dist/utils/security.utils.js.map +1 -0
  248. package/dist/utils/template-engine.utils.d.ts +80 -0
  249. package/dist/utils/template-engine.utils.js +463 -0
  250. package/dist/utils/template-engine.utils.js.map +1 -0
  251. package/dist/utils/validation-registry.utils.d.ts +160 -0
  252. package/dist/utils/validation-registry.utils.js +526 -0
  253. package/dist/utils/validation-registry.utils.js.map +1 -0
  254. package/package.json +3 -1
@@ -0,0 +1,681 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.setupMetricsPrometheus = setupMetricsPrometheus;
40
+ const fs = __importStar(require("fs"));
41
+ const path = __importStar(require("path"));
42
+ const chalk_1 = __importDefault(require("chalk"));
43
+ const naming_utils_1 = require("../utils/naming.utils");
44
+ async function setupMetricsPrometheus(basePath, options = {}) {
45
+ console.log(chalk_1.default.bold.blue('\n📊 Setting up Prometheus Metrics\n'));
46
+ const moduleName = options.module || 'shared';
47
+ const pascalName = (0, naming_utils_1.toPascalCase)(moduleName);
48
+ const camelName = (0, naming_utils_1.toCamelCase)(moduleName);
49
+ const kebabName = (0, naming_utils_1.toKebabCase)(moduleName);
50
+ const customMetrics = options.customMetrics || [];
51
+ const includeDefaultMetrics = options.includeDefaultMetrics !== false;
52
+ const baseDir = path.join(basePath, 'src', kebabName, 'infrastructure', 'metrics');
53
+ fs.mkdirSync(baseDir, { recursive: true });
54
+ // Metrics registry
55
+ const metricsRegistryContent = `import { Injectable, OnModuleInit } from '@nestjs/common';
56
+ import {
57
+ Registry,
58
+ Counter,
59
+ Gauge,
60
+ Histogram,
61
+ Summary,
62
+ collectDefaultMetrics,
63
+ Metric,
64
+ } from 'prom-client';
65
+
66
+ export type MetricType = 'counter' | 'gauge' | 'histogram' | 'summary';
67
+
68
+ export interface MetricConfig {
69
+ name: string;
70
+ help: string;
71
+ type: MetricType;
72
+ labelNames?: string[];
73
+ buckets?: number[]; // For histograms
74
+ percentiles?: number[]; // For summaries
75
+ }
76
+
77
+ /**
78
+ * Prometheus metrics registry and factory
79
+ */
80
+ @Injectable()
81
+ export class MetricsRegistry implements OnModuleInit {
82
+ private readonly registry: Registry;
83
+ private readonly metrics: Map<string, Metric<string>> = new Map();
84
+
85
+ constructor() {
86
+ this.registry = new Registry();
87
+ this.registry.setDefaultLabels({
88
+ app: process.env.APP_NAME || '${kebabName}',
89
+ env: process.env.NODE_ENV || 'development',
90
+ });
91
+ }
92
+
93
+ async onModuleInit(): Promise<void> {
94
+ ${includeDefaultMetrics ? `// Collect default Node.js metrics
95
+ collectDefaultMetrics({
96
+ register: this.registry,
97
+ prefix: '${camelName}_',
98
+ gcDurationBuckets: [0.001, 0.01, 0.1, 1, 2, 5],
99
+ });` : '// Default metrics disabled'}
100
+ }
101
+
102
+ /**
103
+ * Get the Prometheus registry
104
+ */
105
+ getRegistry(): Registry {
106
+ return this.registry;
107
+ }
108
+
109
+ /**
110
+ * Get metrics in Prometheus format
111
+ */
112
+ async getMetrics(): Promise<string> {
113
+ return this.registry.metrics();
114
+ }
115
+
116
+ /**
117
+ * Get metrics as JSON
118
+ */
119
+ async getMetricsAsJson(): Promise<object> {
120
+ return this.registry.getMetricsAsJSON();
121
+ }
122
+
123
+ /**
124
+ * Create or get a counter
125
+ */
126
+ counter(config: Omit<MetricConfig, 'type'>): Counter<string> {
127
+ const key = \`counter_\${config.name}\`;
128
+
129
+ if (!this.metrics.has(key)) {
130
+ const counter = new Counter({
131
+ name: config.name,
132
+ help: config.help,
133
+ labelNames: config.labelNames || [],
134
+ registers: [this.registry],
135
+ });
136
+ this.metrics.set(key, counter);
137
+ }
138
+
139
+ return this.metrics.get(key) as Counter<string>;
140
+ }
141
+
142
+ /**
143
+ * Create or get a gauge
144
+ */
145
+ gauge(config: Omit<MetricConfig, 'type'>): Gauge<string> {
146
+ const key = \`gauge_\${config.name}\`;
147
+
148
+ if (!this.metrics.has(key)) {
149
+ const gauge = new Gauge({
150
+ name: config.name,
151
+ help: config.help,
152
+ labelNames: config.labelNames || [],
153
+ registers: [this.registry],
154
+ });
155
+ this.metrics.set(key, gauge);
156
+ }
157
+
158
+ return this.metrics.get(key) as Gauge<string>;
159
+ }
160
+
161
+ /**
162
+ * Create or get a histogram
163
+ */
164
+ histogram(config: Omit<MetricConfig, 'type'> & { buckets?: number[] }): Histogram<string> {
165
+ const key = \`histogram_\${config.name}\`;
166
+
167
+ if (!this.metrics.has(key)) {
168
+ const histogram = new Histogram({
169
+ name: config.name,
170
+ help: config.help,
171
+ labelNames: config.labelNames || [],
172
+ buckets: config.buckets || [0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10],
173
+ registers: [this.registry],
174
+ });
175
+ this.metrics.set(key, histogram);
176
+ }
177
+
178
+ return this.metrics.get(key) as Histogram<string>;
179
+ }
180
+
181
+ /**
182
+ * Create or get a summary
183
+ */
184
+ summary(config: Omit<MetricConfig, 'type'> & { percentiles?: number[] }): Summary<string> {
185
+ const key = \`summary_\${config.name}\`;
186
+
187
+ if (!this.metrics.has(key)) {
188
+ const summary = new Summary({
189
+ name: config.name,
190
+ help: config.help,
191
+ labelNames: config.labelNames || [],
192
+ percentiles: config.percentiles || [0.5, 0.9, 0.95, 0.99],
193
+ registers: [this.registry],
194
+ });
195
+ this.metrics.set(key, summary);
196
+ }
197
+
198
+ return this.metrics.get(key) as Summary<string>;
199
+ }
200
+
201
+ /**
202
+ * Remove a metric
203
+ */
204
+ removeMetric(name: string): void {
205
+ this.registry.removeSingleMetric(name);
206
+ // Remove from all type keys
207
+ ['counter', 'gauge', 'histogram', 'summary'].forEach((type) => {
208
+ this.metrics.delete(\`\${type}_\${name}\`);
209
+ });
210
+ }
211
+
212
+ /**
213
+ * Clear all metrics
214
+ */
215
+ clear(): void {
216
+ this.registry.clear();
217
+ this.metrics.clear();
218
+ }
219
+ }
220
+ `;
221
+ fs.writeFileSync(path.join(baseDir, 'metrics-registry.ts'), metricsRegistryContent);
222
+ // HTTP metrics interceptor
223
+ const httpMetricsContent = `import { Injectable, NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common';
224
+ import { Observable } from 'rxjs';
225
+ import { tap } from 'rxjs/operators';
226
+ import { MetricsRegistry } from './metrics-registry';
227
+ import { Counter, Histogram } from 'prom-client';
228
+
229
+ /**
230
+ * HTTP request metrics interceptor
231
+ */
232
+ @Injectable()
233
+ export class HttpMetricsInterceptor implements NestInterceptor {
234
+ private readonly requestCounter: Counter<string>;
235
+ private readonly requestDuration: Histogram<string>;
236
+ private readonly requestSize: Histogram<string>;
237
+ private readonly responseSize: Histogram<string>;
238
+
239
+ constructor(private readonly metricsRegistry: MetricsRegistry) {
240
+ this.requestCounter = this.metricsRegistry.counter({
241
+ name: 'http_requests_total',
242
+ help: 'Total number of HTTP requests',
243
+ labelNames: ['method', 'path', 'status'],
244
+ });
245
+
246
+ this.requestDuration = this.metricsRegistry.histogram({
247
+ name: 'http_request_duration_seconds',
248
+ help: 'HTTP request duration in seconds',
249
+ labelNames: ['method', 'path', 'status'],
250
+ buckets: [0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10],
251
+ });
252
+
253
+ this.requestSize = this.metricsRegistry.histogram({
254
+ name: 'http_request_size_bytes',
255
+ help: 'HTTP request size in bytes',
256
+ labelNames: ['method', 'path'],
257
+ buckets: [100, 1000, 10000, 100000, 1000000],
258
+ });
259
+
260
+ this.responseSize = this.metricsRegistry.histogram({
261
+ name: 'http_response_size_bytes',
262
+ help: 'HTTP response size in bytes',
263
+ labelNames: ['method', 'path', 'status'],
264
+ buckets: [100, 1000, 10000, 100000, 1000000],
265
+ });
266
+ }
267
+
268
+ intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
269
+ const request = context.switchToHttp().getRequest();
270
+ const response = context.switchToHttp().getResponse();
271
+ const startTime = process.hrtime();
272
+
273
+ const method = request.method;
274
+ const path = this.normalizePath(request.route?.path || request.url);
275
+
276
+ // Record request size
277
+ const contentLength = parseInt(request.headers['content-length'] || '0', 10);
278
+ if (contentLength > 0) {
279
+ this.requestSize.observe({ method, path }, contentLength);
280
+ }
281
+
282
+ return next.handle().pipe(
283
+ tap({
284
+ next: (data) => {
285
+ this.recordMetrics(method, path, response.statusCode, startTime, data);
286
+ },
287
+ error: (error) => {
288
+ const status = error.status || 500;
289
+ this.recordMetrics(method, path, status, startTime);
290
+ },
291
+ }),
292
+ );
293
+ }
294
+
295
+ private recordMetrics(
296
+ method: string,
297
+ path: string,
298
+ status: number,
299
+ startTime: [number, number],
300
+ data?: any,
301
+ ): void {
302
+ const [seconds, nanoseconds] = process.hrtime(startTime);
303
+ const duration = seconds + nanoseconds / 1e9;
304
+
305
+ const labels = { method, path, status: status.toString() };
306
+
307
+ this.requestCounter.inc(labels);
308
+ this.requestDuration.observe(labels, duration);
309
+
310
+ // Estimate response size
311
+ if (data) {
312
+ const responseSize = JSON.stringify(data).length;
313
+ this.responseSize.observe(labels, responseSize);
314
+ }
315
+ }
316
+
317
+ private normalizePath(path: string): string {
318
+ // Replace dynamic segments with placeholders
319
+ return path
320
+ .replace(/\\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi, '/:uuid')
321
+ .replace(/\\/\\d+/g, '/:id')
322
+ .replace(/\\?.*/g, ''); // Remove query string
323
+ }
324
+ }
325
+ `;
326
+ fs.writeFileSync(path.join(baseDir, 'http-metrics.interceptor.ts'), httpMetricsContent);
327
+ // Business metrics service
328
+ const businessMetricsContent = `import { Injectable } from '@nestjs/common';
329
+ import { MetricsRegistry } from './metrics-registry';
330
+ import { Counter, Gauge, Histogram } from 'prom-client';
331
+
332
+ /**
333
+ * Business-specific metrics for ${pascalName}
334
+ */
335
+ @Injectable()
336
+ export class ${pascalName}MetricsService {
337
+ // Counters
338
+ private readonly operationsTotal: Counter<string>;
339
+ private readonly errorsTotal: Counter<string>;
340
+ private readonly eventsProcessed: Counter<string>;
341
+
342
+ // Gauges
343
+ private readonly activeUsers: Gauge<string>;
344
+ private readonly queueSize: Gauge<string>;
345
+ private readonly cacheHitRatio: Gauge<string>;
346
+
347
+ // Histograms
348
+ private readonly operationDuration: Histogram<string>;
349
+ private readonly payloadSize: Histogram<string>;
350
+
351
+ constructor(private readonly metricsRegistry: MetricsRegistry) {
352
+ // Initialize counters
353
+ this.operationsTotal = this.metricsRegistry.counter({
354
+ name: '${camelName}_operations_total',
355
+ help: 'Total number of ${camelName} operations',
356
+ labelNames: ['operation', 'status'],
357
+ });
358
+
359
+ this.errorsTotal = this.metricsRegistry.counter({
360
+ name: '${camelName}_errors_total',
361
+ help: 'Total number of ${camelName} errors',
362
+ labelNames: ['operation', 'error_type'],
363
+ });
364
+
365
+ this.eventsProcessed = this.metricsRegistry.counter({
366
+ name: '${camelName}_events_processed_total',
367
+ help: 'Total number of events processed',
368
+ labelNames: ['event_type'],
369
+ });
370
+
371
+ // Initialize gauges
372
+ this.activeUsers = this.metricsRegistry.gauge({
373
+ name: '${camelName}_active_users',
374
+ help: 'Number of currently active users',
375
+ });
376
+
377
+ this.queueSize = this.metricsRegistry.gauge({
378
+ name: '${camelName}_queue_size',
379
+ help: 'Current size of processing queue',
380
+ labelNames: ['queue_name'],
381
+ });
382
+
383
+ this.cacheHitRatio = this.metricsRegistry.gauge({
384
+ name: '${camelName}_cache_hit_ratio',
385
+ help: 'Cache hit ratio (0-1)',
386
+ labelNames: ['cache_name'],
387
+ });
388
+
389
+ // Initialize histograms
390
+ this.operationDuration = this.metricsRegistry.histogram({
391
+ name: '${camelName}_operation_duration_seconds',
392
+ help: 'Duration of ${camelName} operations',
393
+ labelNames: ['operation'],
394
+ buckets: [0.01, 0.05, 0.1, 0.5, 1, 2, 5, 10],
395
+ });
396
+
397
+ this.payloadSize = this.metricsRegistry.histogram({
398
+ name: '${camelName}_payload_size_bytes',
399
+ help: 'Size of ${camelName} payloads',
400
+ labelNames: ['operation'],
401
+ buckets: [100, 500, 1000, 5000, 10000, 50000, 100000],
402
+ });
403
+ }
404
+
405
+ // ==================
406
+ // Counter Methods
407
+ // ==================
408
+
409
+ /**
410
+ * Increment operation counter
411
+ */
412
+ recordOperation(operation: string, status: 'success' | 'failure'): void {
413
+ this.operationsTotal.inc({ operation, status });
414
+ }
415
+
416
+ /**
417
+ * Record an error
418
+ */
419
+ recordError(operation: string, errorType: string): void {
420
+ this.errorsTotal.inc({ operation, error_type: errorType });
421
+ }
422
+
423
+ /**
424
+ * Record event processing
425
+ */
426
+ recordEventProcessed(eventType: string): void {
427
+ this.eventsProcessed.inc({ event_type: eventType });
428
+ }
429
+
430
+ // ==================
431
+ // Gauge Methods
432
+ // ==================
433
+
434
+ /**
435
+ * Set active users count
436
+ */
437
+ setActiveUsers(count: number): void {
438
+ this.activeUsers.set(count);
439
+ }
440
+
441
+ /**
442
+ * Update queue size
443
+ */
444
+ setQueueSize(queueName: string, size: number): void {
445
+ this.queueSize.set({ queue_name: queueName }, size);
446
+ }
447
+
448
+ /**
449
+ * Update cache hit ratio
450
+ */
451
+ setCacheHitRatio(cacheName: string, ratio: number): void {
452
+ this.cacheHitRatio.set({ cache_name: cacheName }, Math.min(1, Math.max(0, ratio)));
453
+ }
454
+
455
+ // ==================
456
+ // Histogram Methods
457
+ // ==================
458
+
459
+ /**
460
+ * Record operation duration
461
+ */
462
+ recordOperationDuration(operation: string, durationSeconds: number): void {
463
+ this.operationDuration.observe({ operation }, durationSeconds);
464
+ }
465
+
466
+ /**
467
+ * Record payload size
468
+ */
469
+ recordPayloadSize(operation: string, sizeBytes: number): void {
470
+ this.payloadSize.observe({ operation }, sizeBytes);
471
+ }
472
+
473
+ /**
474
+ * Create a timer for measuring operation duration
475
+ */
476
+ startTimer(operation: string): () => void {
477
+ const startTime = process.hrtime();
478
+ return () => {
479
+ const [seconds, nanoseconds] = process.hrtime(startTime);
480
+ const duration = seconds + nanoseconds / 1e9;
481
+ this.recordOperationDuration(operation, duration);
482
+ };
483
+ }
484
+ }
485
+ `;
486
+ fs.writeFileSync(path.join(baseDir, `${kebabName}-metrics.service.ts`), businessMetricsContent);
487
+ // Metrics controller
488
+ const metricsControllerContent = `import { Controller, Get, Res, Header } from '@nestjs/common';
489
+ import { Response } from 'express';
490
+ import { MetricsRegistry } from './metrics-registry';
491
+
492
+ /**
493
+ * Prometheus metrics endpoint
494
+ */
495
+ @Controller('metrics')
496
+ export class MetricsController {
497
+ constructor(private readonly metricsRegistry: MetricsRegistry) {}
498
+
499
+ /**
500
+ * Get metrics in Prometheus format
501
+ */
502
+ @Get()
503
+ @Header('Content-Type', 'text/plain; version=0.0.4; charset=utf-8')
504
+ async getMetrics(@Res() res: Response): Promise<void> {
505
+ const metrics = await this.metricsRegistry.getMetrics();
506
+ res.send(metrics);
507
+ }
508
+
509
+ /**
510
+ * Get metrics as JSON (for debugging)
511
+ */
512
+ @Get('json')
513
+ async getMetricsJson(): Promise<object> {
514
+ return this.metricsRegistry.getMetricsAsJson();
515
+ }
516
+ }
517
+ `;
518
+ fs.writeFileSync(path.join(baseDir, 'metrics.controller.ts'), metricsControllerContent);
519
+ // Metrics decorator
520
+ const metricsDecoratorContent = `import { SetMetadata } from '@nestjs/common';
521
+
522
+ export const METRICS_KEY = 'metrics';
523
+
524
+ export interface MetricsOptions {
525
+ name?: string;
526
+ labels?: Record<string, string>;
527
+ recordDuration?: boolean;
528
+ recordPayloadSize?: boolean;
529
+ }
530
+
531
+ /**
532
+ * Decorator to automatically record metrics for a method
533
+ */
534
+ export function RecordMetrics(options: MetricsOptions = {}): MethodDecorator {
535
+ return SetMetadata(METRICS_KEY, options);
536
+ }
537
+
538
+ /**
539
+ * Decorator to skip metrics recording
540
+ */
541
+ export function SkipMetrics(): MethodDecorator {
542
+ return SetMetadata(METRICS_KEY, { skip: true });
543
+ }
544
+ `;
545
+ fs.writeFileSync(path.join(baseDir, 'metrics.decorator.ts'), metricsDecoratorContent);
546
+ // Metrics module
547
+ const metricsModuleContent = `import { Module, Global } from '@nestjs/common';
548
+ import { APP_INTERCEPTOR } from '@nestjs/core';
549
+ import { MetricsRegistry } from './metrics-registry';
550
+ import { MetricsController } from './metrics.controller';
551
+ import { HttpMetricsInterceptor } from './http-metrics.interceptor';
552
+ import { ${pascalName}MetricsService } from './${kebabName}-metrics.service';
553
+
554
+ @Global()
555
+ @Module({
556
+ controllers: [MetricsController],
557
+ providers: [
558
+ MetricsRegistry,
559
+ ${pascalName}MetricsService,
560
+ {
561
+ provide: APP_INTERCEPTOR,
562
+ useClass: HttpMetricsInterceptor,
563
+ },
564
+ ],
565
+ exports: [MetricsRegistry, ${pascalName}MetricsService],
566
+ })
567
+ export class ${pascalName}MetricsModule {}
568
+ `;
569
+ fs.writeFileSync(path.join(baseDir, 'metrics.module.ts'), metricsModuleContent);
570
+ // Grafana dashboard JSON
571
+ const grafanaDashboardContent = `{
572
+ "annotations": {
573
+ "list": []
574
+ },
575
+ "title": "${pascalName} Metrics Dashboard",
576
+ "uid": "${kebabName}-metrics",
577
+ "version": 1,
578
+ "panels": [
579
+ {
580
+ "title": "Request Rate",
581
+ "type": "graph",
582
+ "gridPos": { "h": 8, "w": 12, "x": 0, "y": 0 },
583
+ "targets": [
584
+ {
585
+ "expr": "rate(http_requests_total{app=\\"${kebabName}\\"}[5m])",
586
+ "legendFormat": "{{method}} {{path}}"
587
+ }
588
+ ]
589
+ },
590
+ {
591
+ "title": "Request Duration (p99)",
592
+ "type": "graph",
593
+ "gridPos": { "h": 8, "w": 12, "x": 12, "y": 0 },
594
+ "targets": [
595
+ {
596
+ "expr": "histogram_quantile(0.99, rate(http_request_duration_seconds_bucket{app=\\"${kebabName}\\"}[5m]))",
597
+ "legendFormat": "{{method}} {{path}}"
598
+ }
599
+ ]
600
+ },
601
+ {
602
+ "title": "Error Rate",
603
+ "type": "graph",
604
+ "gridPos": { "h": 8, "w": 12, "x": 0, "y": 8 },
605
+ "targets": [
606
+ {
607
+ "expr": "rate(${camelName}_errors_total[5m])",
608
+ "legendFormat": "{{operation}} - {{error_type}}"
609
+ }
610
+ ]
611
+ },
612
+ {
613
+ "title": "Active Users",
614
+ "type": "stat",
615
+ "gridPos": { "h": 4, "w": 6, "x": 12, "y": 8 },
616
+ "targets": [
617
+ {
618
+ "expr": "${camelName}_active_users",
619
+ "legendFormat": "Active Users"
620
+ }
621
+ ]
622
+ },
623
+ {
624
+ "title": "Cache Hit Ratio",
625
+ "type": "gauge",
626
+ "gridPos": { "h": 4, "w": 6, "x": 18, "y": 8 },
627
+ "targets": [
628
+ {
629
+ "expr": "${camelName}_cache_hit_ratio",
630
+ "legendFormat": "{{cache_name}}"
631
+ }
632
+ ]
633
+ },
634
+ {
635
+ "title": "Memory Usage",
636
+ "type": "graph",
637
+ "gridPos": { "h": 8, "w": 12, "x": 0, "y": 16 },
638
+ "targets": [
639
+ {
640
+ "expr": "${camelName}_nodejs_heap_size_used_bytes / 1024 / 1024",
641
+ "legendFormat": "Heap Used (MB)"
642
+ },
643
+ {
644
+ "expr": "${camelName}_nodejs_external_memory_bytes / 1024 / 1024",
645
+ "legendFormat": "External (MB)"
646
+ }
647
+ ]
648
+ },
649
+ {
650
+ "title": "Event Loop Lag",
651
+ "type": "graph",
652
+ "gridPos": { "h": 8, "w": 12, "x": 12, "y": 16 },
653
+ "targets": [
654
+ {
655
+ "expr": "${camelName}_nodejs_eventloop_lag_seconds",
656
+ "legendFormat": "Event Loop Lag"
657
+ }
658
+ ]
659
+ }
660
+ ]
661
+ }
662
+ `;
663
+ fs.writeFileSync(path.join(baseDir, 'grafana-dashboard.json'), grafanaDashboardContent);
664
+ console.log(chalk_1.default.green(` ✓ Created metrics registry`));
665
+ console.log(chalk_1.default.green(` ✓ Created HTTP metrics interceptor`));
666
+ console.log(chalk_1.default.green(` ✓ Created ${kebabName}-metrics.service.ts`));
667
+ console.log(chalk_1.default.green(` ✓ Created metrics controller`));
668
+ console.log(chalk_1.default.green(` ✓ Created metrics decorator`));
669
+ console.log(chalk_1.default.green(` ✓ Created metrics module`));
670
+ console.log(chalk_1.default.green(` ✓ Created Grafana dashboard`));
671
+ console.log(chalk_1.default.bold.green(`\n✅ Prometheus metrics setup complete for ${pascalName}`));
672
+ console.log(chalk_1.default.cyan(`Generated files in: ${baseDir}`));
673
+ console.log(chalk_1.default.gray(' - metrics-registry.ts (Prometheus registry)'));
674
+ console.log(chalk_1.default.gray(' - http-metrics.interceptor.ts (HTTP metrics)'));
675
+ console.log(chalk_1.default.gray(` - ${kebabName}-metrics.service.ts (Business metrics)`));
676
+ console.log(chalk_1.default.gray(' - metrics.controller.ts (/metrics endpoint)'));
677
+ console.log(chalk_1.default.gray(' - metrics.decorator.ts (Metrics decorators)'));
678
+ console.log(chalk_1.default.gray(' - metrics.module.ts (Module definition)'));
679
+ console.log(chalk_1.default.gray(' - grafana-dashboard.json (Grafana dashboard)'));
680
+ }
681
+ //# sourceMappingURL=metrics-prometheus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics-prometheus.js","sourceRoot":"","sources":["../../src/commands/metrics-prometheus.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,wDA0oBC;AArpBD,uCAAyB;AACzB,2CAA6B;AAC7B,kDAA0B;AAC1B,wDAA+E;AAQxE,KAAK,UAAU,sBAAsB,CAC1C,QAAgB,EAChB,UAAoC,EAAE;IAEtC,OAAO,CAAC,GAAG,CAAC,e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AC1D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC,CAAC;IAC1E,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,OAAO,SAAS,wCAAwC,CAAC,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC,CAAC;AAC5E,CAAC"}
@@ -0,0 +1,6 @@
1
+ export interface MigrationEngineOptions {
2
+ path?: string;
3
+ orm?: 'typeorm' | 'prisma';
4
+ dryRun?: boolean;
5
+ }
6
+ export declare function diffMigration(basePath: string, options?: MigrationEngineOptions): Promise<void>;