@lenne.tech/nest-server 11.31.2 → 11.31.3

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 (160) hide show
  1. package/.claude/rules/architecture.md +2 -0
  2. package/.claude/rules/configurable-features.md +2 -0
  3. package/CLAUDE.md +28 -1
  4. package/FRAMEWORK-API.md +4 -1
  5. package/dist/config.env.d.ts +4 -0
  6. package/dist/config.env.js +32 -2
  7. package/dist/config.env.js.map +1 -1
  8. package/dist/core/common/helpers/logging.helper.d.ts +1 -0
  9. package/dist/core/common/helpers/logging.helper.js +12 -0
  10. package/dist/core/common/helpers/logging.helper.js.map +1 -1
  11. package/dist/core/common/helpers/meta.helper.d.ts +1 -0
  12. package/dist/core/common/helpers/meta.helper.js +32 -1
  13. package/dist/core/common/helpers/meta.helper.js.map +1 -1
  14. package/dist/core/common/interfaces/server-options.interface.d.ts +9 -0
  15. package/dist/core/common/services/email.service.d.ts +3 -1
  16. package/dist/core/common/services/email.service.js +33 -2
  17. package/dist/core/common/services/email.service.js.map +1 -1
  18. package/dist/core/common/services/template.service.js +9 -4
  19. package/dist/core/common/services/template.service.js.map +1 -1
  20. package/dist/core/modules/hub/core-hub-actions.controller.d.ts +22 -0
  21. package/dist/core/modules/hub/core-hub-actions.controller.js +141 -0
  22. package/dist/core/modules/hub/core-hub-actions.controller.js.map +1 -0
  23. package/dist/core/modules/hub/core-hub-html.service.d.ts +8 -0
  24. package/dist/core/modules/hub/core-hub-html.service.js +123 -0
  25. package/dist/core/modules/hub/core-hub-html.service.js.map +1 -0
  26. package/dist/core/modules/hub/core-hub.controller.d.ts +56 -0
  27. package/dist/core/modules/hub/core-hub.controller.js +398 -0
  28. package/dist/core/modules/hub/core-hub.controller.js.map +1 -0
  29. package/dist/core/modules/hub/core-hub.module.d.ts +17 -0
  30. package/dist/core/modules/hub/core-hub.module.js +109 -0
  31. package/dist/core/modules/hub/core-hub.module.js.map +1 -0
  32. package/dist/core/modules/hub/core-hub.service.d.ts +18 -0
  33. package/dist/core/modules/hub/core-hub.service.js +153 -0
  34. package/dist/core/modules/hub/core-hub.service.js.map +1 -0
  35. package/dist/core/modules/hub/helpers/hub-client-js.helper.d.ts +1 -0
  36. package/dist/core/modules/hub/helpers/hub-client-js.helper.js +755 -0
  37. package/dist/core/modules/hub/helpers/hub-client-js.helper.js.map +1 -0
  38. package/dist/core/modules/hub/helpers/hub-command-shape.helper.d.ts +1 -0
  39. package/dist/core/modules/hub/helpers/hub-command-shape.helper.js +33 -0
  40. package/dist/core/modules/hub/helpers/hub-command-shape.helper.js.map +1 -0
  41. package/dist/core/modules/hub/helpers/hub-mask.helper.d.ts +1 -0
  42. package/dist/core/modules/hub/helpers/hub-mask.helper.js +46 -0
  43. package/dist/core/modules/hub/helpers/hub-mask.helper.js.map +1 -0
  44. package/dist/core/modules/hub/helpers/hub-mermaid.helper.d.ts +10 -0
  45. package/dist/core/modules/hub/helpers/hub-mermaid.helper.js +35 -0
  46. package/dist/core/modules/hub/helpers/hub-mermaid.helper.js.map +1 -0
  47. package/dist/core/modules/hub/helpers/hub-shell.helper.d.ts +9 -0
  48. package/dist/core/modules/hub/helpers/hub-shell.helper.js +62 -0
  49. package/dist/core/modules/hub/helpers/hub-shell.helper.js.map +1 -0
  50. package/dist/core/modules/hub/hub-action-messages.d.ts +17 -0
  51. package/dist/core/modules/hub/hub-action-messages.js +21 -0
  52. package/dist/core/modules/hub/hub-action-messages.js.map +1 -0
  53. package/dist/core/modules/hub/hub-config.helper.d.ts +11 -0
  54. package/dist/core/modules/hub/hub-config.helper.js +164 -0
  55. package/dist/core/modules/hub/hub-config.helper.js.map +1 -0
  56. package/dist/core/modules/hub/hub-nav.d.ts +12 -0
  57. package/dist/core/modules/hub/hub-nav.js +43 -0
  58. package/dist/core/modules/hub/hub-nav.js.map +1 -0
  59. package/dist/core/modules/hub/hub-ring-buffer.d.ts +22 -0
  60. package/dist/core/modules/hub/hub-ring-buffer.js +59 -0
  61. package/dist/core/modules/hub/hub-ring-buffer.js.map +1 -0
  62. package/dist/core/modules/hub/hub.constants.d.ts +18 -0
  63. package/dist/core/modules/hub/hub.constants.js +22 -0
  64. package/dist/core/modules/hub/hub.constants.js.map +1 -0
  65. package/dist/core/modules/hub/index.d.ts +25 -0
  66. package/dist/core/modules/hub/index.js +42 -0
  67. package/dist/core/modules/hub/index.js.map +1 -0
  68. package/dist/core/modules/hub/interfaces/hub-config.interface.d.ts +115 -0
  69. package/dist/core/modules/hub/interfaces/hub-config.interface.js +3 -0
  70. package/dist/core/modules/hub/interfaces/hub-config.interface.js.map +1 -0
  71. package/dist/core/modules/hub/interfaces/hub-panels.interface.d.ts +231 -0
  72. package/dist/core/modules/hub/interfaces/hub-panels.interface.js +3 -0
  73. package/dist/core/modules/hub/interfaces/hub-panels.interface.js.map +1 -0
  74. package/dist/core/modules/hub/middleware/hub-trace.middleware.d.ts +8 -0
  75. package/dist/core/modules/hub/middleware/hub-trace.middleware.js +50 -0
  76. package/dist/core/modules/hub/middleware/hub-trace.middleware.js.map +1 -0
  77. package/dist/core/modules/hub/services/core-hub-actions.service.d.ts +48 -0
  78. package/dist/core/modules/hub/services/core-hub-actions.service.js +136 -0
  79. package/dist/core/modules/hub/services/core-hub-actions.service.js.map +1 -0
  80. package/dist/core/modules/hub/services/core-hub-db.service.d.ts +19 -0
  81. package/dist/core/modules/hub/services/core-hub-db.service.js +180 -0
  82. package/dist/core/modules/hub/services/core-hub-db.service.js.map +1 -0
  83. package/dist/core/modules/hub/services/core-hub-email.service.d.ts +24 -0
  84. package/dist/core/modules/hub/services/core-hub-email.service.js +148 -0
  85. package/dist/core/modules/hub/services/core-hub-email.service.js.map +1 -0
  86. package/dist/core/modules/hub/services/core-hub-mailbox.service.d.ts +20 -0
  87. package/dist/core/modules/hub/services/core-hub-mailbox.service.js +103 -0
  88. package/dist/core/modules/hub/services/core-hub-mailbox.service.js.map +1 -0
  89. package/dist/core/modules/hub/services/core-hub-migrations.service.d.ts +25 -0
  90. package/dist/core/modules/hub/services/core-hub-migrations.service.js +115 -0
  91. package/dist/core/modules/hub/services/core-hub-migrations.service.js.map +1 -0
  92. package/dist/core/modules/hub/services/core-hub-sources.service.d.ts +28 -0
  93. package/dist/core/modules/hub/services/core-hub-sources.service.js +187 -0
  94. package/dist/core/modules/hub/services/core-hub-sources.service.js.map +1 -0
  95. package/dist/core/modules/hub/services/hub-log-buffer.service.d.ts +24 -0
  96. package/dist/core/modules/hub/services/hub-log-buffer.service.js +210 -0
  97. package/dist/core/modules/hub/services/hub-log-buffer.service.js.map +1 -0
  98. package/dist/core/modules/hub/services/hub-query-profiler.service.d.ts +38 -0
  99. package/dist/core/modules/hub/services/hub-query-profiler.service.js +235 -0
  100. package/dist/core/modules/hub/services/hub-query-profiler.service.js.map +1 -0
  101. package/dist/core/modules/hub/services/hub-trace-buffer.service.d.ts +18 -0
  102. package/dist/core/modules/hub/services/hub-trace-buffer.service.js +123 -0
  103. package/dist/core/modules/hub/services/hub-trace-buffer.service.js.map +1 -0
  104. package/dist/core.module.js +42 -1
  105. package/dist/core.module.js.map +1 -1
  106. package/dist/index.d.ts +1 -0
  107. package/dist/index.js +1 -0
  108. package/dist/index.js.map +1 -1
  109. package/dist/tsconfig.build.tsbuildinfo +1 -1
  110. package/docs/REQUEST-LIFECYCLE.md +1 -0
  111. package/migration-guides/11.31.2-to-11.31.3.md +135 -0
  112. package/package.json +5 -4
  113. package/src/config.env.ts +75 -2
  114. package/src/core/common/helpers/logging.helper.spec.ts +61 -0
  115. package/src/core/common/helpers/logging.helper.ts +48 -0
  116. package/src/core/common/helpers/meta.helper.ts +46 -1
  117. package/src/core/common/interfaces/server-options.interface.ts +46 -0
  118. package/src/core/common/services/email.service.ts +33 -1
  119. package/src/core/common/services/template.service.ts +21 -16
  120. package/src/core/modules/hub/INTEGRATION-CHECKLIST.md +64 -0
  121. package/src/core/modules/hub/README.md +159 -0
  122. package/src/core/modules/hub/core-hub-actions.controller.ts +137 -0
  123. package/src/core/modules/hub/core-hub-html.service.ts +135 -0
  124. package/src/core/modules/hub/core-hub.controller.ts +286 -0
  125. package/src/core/modules/hub/core-hub.module.spec.ts +108 -0
  126. package/src/core/modules/hub/core-hub.module.ts +159 -0
  127. package/src/core/modules/hub/core-hub.service.ts +169 -0
  128. package/src/core/modules/hub/helpers/hub-client-js.helper.ts +768 -0
  129. package/src/core/modules/hub/helpers/hub-command-shape.helper.spec.ts +48 -0
  130. package/src/core/modules/hub/helpers/hub-command-shape.helper.ts +47 -0
  131. package/src/core/modules/hub/helpers/hub-mask.helper.spec.ts +67 -0
  132. package/src/core/modules/hub/helpers/hub-mask.helper.ts +78 -0
  133. package/src/core/modules/hub/helpers/hub-mermaid.helper.spec.ts +54 -0
  134. package/src/core/modules/hub/helpers/hub-mermaid.helper.ts +62 -0
  135. package/src/core/modules/hub/helpers/hub-shell.helper.spec.ts +106 -0
  136. package/src/core/modules/hub/helpers/hub-shell.helper.ts +90 -0
  137. package/src/core/modules/hub/hub-action-messages.ts +47 -0
  138. package/src/core/modules/hub/hub-config.helper.spec.ts +108 -0
  139. package/src/core/modules/hub/hub-config.helper.ts +233 -0
  140. package/src/core/modules/hub/hub-nav.ts +66 -0
  141. package/src/core/modules/hub/hub-ring-buffer.spec.ts +95 -0
  142. package/src/core/modules/hub/hub-ring-buffer.ts +101 -0
  143. package/src/core/modules/hub/hub.constants.ts +84 -0
  144. package/src/core/modules/hub/index.ts +25 -0
  145. package/src/core/modules/hub/interfaces/hub-config.interface.ts +265 -0
  146. package/src/core/modules/hub/interfaces/hub-panels.interface.ts +186 -0
  147. package/src/core/modules/hub/middleware/hub-trace.middleware.ts +45 -0
  148. package/src/core/modules/hub/services/core-hub-actions.service.ts +133 -0
  149. package/src/core/modules/hub/services/core-hub-db.service.ts +185 -0
  150. package/src/core/modules/hub/services/core-hub-email.service.ts +158 -0
  151. package/src/core/modules/hub/services/core-hub-mailbox.service.spec.ts +116 -0
  152. package/src/core/modules/hub/services/core-hub-mailbox.service.ts +121 -0
  153. package/src/core/modules/hub/services/core-hub-migrations.service.ts +112 -0
  154. package/src/core/modules/hub/services/core-hub-sources.service.ts +194 -0
  155. package/src/core/modules/hub/services/hub-log-buffer.service.ts +252 -0
  156. package/src/core/modules/hub/services/hub-query-profiler.service.ts +274 -0
  157. package/src/core/modules/hub/services/hub-trace-buffer.service.spec.ts +112 -0
  158. package/src/core/modules/hub/services/hub-trace-buffer.service.ts +134 -0
  159. package/src/core.module.ts +61 -1
  160. package/src/index.ts +6 -0
@@ -0,0 +1,398 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.CoreHubController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const roles_decorator_1 = require("../../common/decorators/roles.decorator");
18
+ const role_enum_1 = require("../../common/enums/role.enum");
19
+ const core_hub_html_service_1 = require("./core-hub-html.service");
20
+ const core_hub_service_1 = require("./core-hub.service");
21
+ const hub_nav_1 = require("./hub-nav");
22
+ const core_hub_db_service_1 = require("./services/core-hub-db.service");
23
+ const core_hub_email_service_1 = require("./services/core-hub-email.service");
24
+ const core_hub_mailbox_service_1 = require("./services/core-hub-mailbox.service");
25
+ const core_hub_migrations_service_1 = require("./services/core-hub-migrations.service");
26
+ const core_hub_sources_service_1 = require("./services/core-hub-sources.service");
27
+ const hub_log_buffer_service_1 = require("./services/hub-log-buffer.service");
28
+ const hub_query_profiler_service_1 = require("./services/hub-query-profiler.service");
29
+ const hub_trace_buffer_service_1 = require("./services/hub-trace-buffer.service");
30
+ const hub_shell_helper_1 = require("./helpers/hub-shell.helper");
31
+ const HUB_PAGE_PATHS = hub_nav_1.HUB_PANELS.filter((panel) => panel.path).map((panel) => panel.path);
32
+ let CoreHubController = class CoreHubController {
33
+ hubService;
34
+ htmlService;
35
+ dbService;
36
+ migrationsService;
37
+ sourcesService;
38
+ emailService;
39
+ logBuffer;
40
+ traceBuffer;
41
+ queryProfiler;
42
+ mailboxService;
43
+ cachedClientScript;
44
+ constructor(hubService, htmlService, dbService, migrationsService, sourcesService, emailService, logBuffer, traceBuffer, queryProfiler, mailboxService) {
45
+ this.hubService = hubService;
46
+ this.htmlService = htmlService;
47
+ this.dbService = dbService;
48
+ this.migrationsService = migrationsService;
49
+ this.sourcesService = sourcesService;
50
+ this.emailService = emailService;
51
+ this.logBuffer = logBuffer;
52
+ this.traceBuffer = traceBuffer;
53
+ this.queryProfiler = queryProfiler;
54
+ this.mailboxService = mailboxService;
55
+ }
56
+ async aiJson(res) {
57
+ this.sendJson(res, await this.sourcesService.getAi());
58
+ }
59
+ async authMigrationJson(res) {
60
+ this.sendJson(res, await this.sourcesService.getAuthMigration());
61
+ }
62
+ configJson(res) {
63
+ this.sendJson(res, this.hubService.getConfigMasked());
64
+ }
65
+ cronJson(res) {
66
+ this.sendJson(res, this.sourcesService.getCron());
67
+ }
68
+ emailsJson(res) {
69
+ if (!this.emailService.previewEnabled) {
70
+ this.sendJson(res, { available: false, hint: 'The email preview panel is disabled (hub.emailPreview: false).' });
71
+ return;
72
+ }
73
+ this.sendJson(res, this.emailService.getTemplates());
74
+ }
75
+ errorCodesJson(locale, res) {
76
+ this.sendJson(res, this.sourcesService.getErrorCodes(locale || 'en'));
77
+ }
78
+ dashboardJson(res) {
79
+ this.sendJson(res, this.hubService.getDashboard());
80
+ }
81
+ async dbJson(res) {
82
+ this.sendJson(res, await this.dbService.getDbStats());
83
+ }
84
+ diagnosticsJson(res) {
85
+ this.sendJson(res, this.hubService.getDiagnostics(this.collectorBuffers()));
86
+ }
87
+ async filesJson(bucket, skip, limit, res) {
88
+ this.sendJson(res, await this.dbService.getFiles(bucket || 'fs', Number(skip) || 0, Number(limit) || 100));
89
+ }
90
+ async migrationsJson(res) {
91
+ this.sendJson(res, await this.migrationsService.getStatus());
92
+ }
93
+ mailboxJson(since, res) {
94
+ if (!this.mailboxService) {
95
+ this.sendJson(res, { available: false, hint: 'The mailbox is not enabled.' });
96
+ return;
97
+ }
98
+ this.sendJson(res, this.mailboxService.getMailbox(since !== undefined ? Number(since) : undefined));
99
+ }
100
+ mailboxHtml(seq, res) {
101
+ const html = this.mailboxService?.getMailHtml(Number(seq));
102
+ res.set({
103
+ 'Cache-Control': 'no-store',
104
+ 'Content-Security-Policy': "default-src 'none'; img-src * data:; style-src 'unsafe-inline'; font-src data:",
105
+ 'X-Content-Type-Options': 'nosniff',
106
+ 'X-Frame-Options': 'SAMEORIGIN',
107
+ });
108
+ res
109
+ .type('html')
110
+ .send(html ??
111
+ '<!DOCTYPE html><html><body style="font-family:sans-serif;color:#8b97a8;padding:20px">No preview available.</body></html>');
112
+ }
113
+ logsJson(since, res) {
114
+ if (!this.logBuffer.enabled) {
115
+ this.sendJson(res, { available: false, hint: 'The logs collector is disabled.' });
116
+ return;
117
+ }
118
+ this.sendJson(res, this.logBuffer.getData(since !== undefined ? Number(since) : undefined));
119
+ }
120
+ modelsJson(res) {
121
+ this.sendJson(res, this.dbService.getModels());
122
+ }
123
+ sessionJson(res) {
124
+ this.sendJson(res, this.hubService.getSessionPayload());
125
+ }
126
+ queriesJson(res) {
127
+ if (!this.queryProfiler.enabled) {
128
+ this.sendJson(res, {
129
+ available: false,
130
+ hint: 'The query profiler is disabled (opt-in via hub.collectors.queries).',
131
+ });
132
+ return;
133
+ }
134
+ this.sendJson(res, this.queryProfiler.getData());
135
+ }
136
+ tracesJson(since, res) {
137
+ if (!this.traceBuffer.enabled) {
138
+ this.sendJson(res, { available: false, hint: 'The traces collector is disabled.' });
139
+ return;
140
+ }
141
+ this.sendJson(res, this.traceBuffer.getData(since !== undefined ? Number(since) : undefined));
142
+ }
143
+ async routesJson(res) {
144
+ this.sendJson(res, await this.sourcesService.getRoutes());
145
+ }
146
+ async emailPreview(template, locale, res) {
147
+ const result = await this.emailService.renderPreview(template || '', locale);
148
+ res.set({
149
+ 'Cache-Control': 'no-store',
150
+ 'Content-Security-Policy': "default-src 'none'; img-src * data:; style-src 'unsafe-inline'; font-src data:",
151
+ 'X-Content-Type-Options': 'nosniff',
152
+ 'X-Frame-Options': 'SAMEORIGIN',
153
+ });
154
+ if ('available' in result && result.available === false) {
155
+ res
156
+ .type('html')
157
+ .send(`<!DOCTYPE html><html><body style="font-family:sans-serif;color:#8b97a8;padding:20px">${(0, hub_shell_helper_1.escapeHtml)(result.hint)}</body></html>`);
158
+ return;
159
+ }
160
+ res.type('html').send(result.html);
161
+ }
162
+ hubJs(res) {
163
+ if (!this.cachedClientScript) {
164
+ this.cachedClientScript = this.htmlService.buildClientScript();
165
+ }
166
+ res.set((0, hub_shell_helper_1.buildHubSecurityHeaders)((0, hub_shell_helper_1.generateNonce)(), { cacheable: true }));
167
+ res.type('application/javascript').send(this.cachedClientScript);
168
+ }
169
+ root(authHeader, res) {
170
+ this.sendShell(res, authHeader);
171
+ }
172
+ page(authHeader, res) {
173
+ this.sendShell(res, authHeader);
174
+ }
175
+ authPage(res) {
176
+ this.sendShell(res, undefined);
177
+ }
178
+ collectorBuffers() {
179
+ const logs = this.logBuffer.getData();
180
+ const traces = this.traceBuffer.getData();
181
+ const queries = this.queryProfiler.getData();
182
+ return {
183
+ logs: { capacity: 0, enabled: this.logBuffer.enabled, size: logs.records.length },
184
+ queries: { capacity: 0, enabled: this.queryProfiler.enabled, size: queries.recent.length },
185
+ traces: { capacity: 0, enabled: this.traceBuffer.enabled, size: traces.traces.length },
186
+ };
187
+ }
188
+ sendJson(res, data) {
189
+ res.set((0, hub_shell_helper_1.buildHubSecurityHeaders)((0, hub_shell_helper_1.generateNonce)()));
190
+ res.type('application/json').send(JSON.stringify(data));
191
+ }
192
+ sendShell(res, authHeader) {
193
+ const nonce = (0, hub_shell_helper_1.generateNonce)();
194
+ const html = (0, hub_shell_helper_1.injectNonce)(this.htmlService.buildShell(authHeader), nonce);
195
+ res.set((0, hub_shell_helper_1.buildHubSecurityHeaders)(nonce));
196
+ res.type('html').send(html);
197
+ }
198
+ };
199
+ exports.CoreHubController = CoreHubController;
200
+ __decorate([
201
+ (0, common_1.Get)('ai.json'),
202
+ __param(0, (0, common_1.Res)()),
203
+ __metadata("design:type", Function),
204
+ __metadata("design:paramtypes", [Object]),
205
+ __metadata("design:returntype", Promise)
206
+ ], CoreHubController.prototype, "aiJson", null);
207
+ __decorate([
208
+ (0, common_1.Get)('auth-migration.json'),
209
+ __param(0, (0, common_1.Res)()),
210
+ __metadata("design:type", Function),
211
+ __metadata("design:paramtypes", [Object]),
212
+ __metadata("design:returntype", Promise)
213
+ ], CoreHubController.prototype, "authMigrationJson", null);
214
+ __decorate([
215
+ (0, common_1.Get)('config.json'),
216
+ __param(0, (0, common_1.Res)()),
217
+ __metadata("design:type", Function),
218
+ __metadata("design:paramtypes", [Object]),
219
+ __metadata("design:returntype", void 0)
220
+ ], CoreHubController.prototype, "configJson", null);
221
+ __decorate([
222
+ (0, common_1.Get)('cron.json'),
223
+ __param(0, (0, common_1.Res)()),
224
+ __metadata("design:type", Function),
225
+ __metadata("design:paramtypes", [Object]),
226
+ __metadata("design:returntype", void 0)
227
+ ], CoreHubController.prototype, "cronJson", null);
228
+ __decorate([
229
+ (0, common_1.Get)('emails.json'),
230
+ __param(0, (0, common_1.Res)()),
231
+ __metadata("design:type", Function),
232
+ __metadata("design:paramtypes", [Object]),
233
+ __metadata("design:returntype", void 0)
234
+ ], CoreHubController.prototype, "emailsJson", null);
235
+ __decorate([
236
+ (0, common_1.Get)('error-codes.json'),
237
+ __param(0, (0, common_1.Query)('locale')),
238
+ __param(1, (0, common_1.Res)()),
239
+ __metadata("design:type", Function),
240
+ __metadata("design:paramtypes", [String, Object]),
241
+ __metadata("design:returntype", void 0)
242
+ ], CoreHubController.prototype, "errorCodesJson", null);
243
+ __decorate([
244
+ (0, common_1.Get)('dashboard.json'),
245
+ __param(0, (0, common_1.Res)()),
246
+ __metadata("design:type", Function),
247
+ __metadata("design:paramtypes", [Object]),
248
+ __metadata("design:returntype", void 0)
249
+ ], CoreHubController.prototype, "dashboardJson", null);
250
+ __decorate([
251
+ (0, common_1.Get)('db.json'),
252
+ __param(0, (0, common_1.Res)()),
253
+ __metadata("design:type", Function),
254
+ __metadata("design:paramtypes", [Object]),
255
+ __metadata("design:returntype", Promise)
256
+ ], CoreHubController.prototype, "dbJson", null);
257
+ __decorate([
258
+ (0, common_1.Get)('diagnostics.json'),
259
+ __param(0, (0, common_1.Res)()),
260
+ __metadata("design:type", Function),
261
+ __metadata("design:paramtypes", [Object]),
262
+ __metadata("design:returntype", void 0)
263
+ ], CoreHubController.prototype, "diagnosticsJson", null);
264
+ __decorate([
265
+ (0, common_1.Get)('files.json'),
266
+ __param(0, (0, common_1.Query)('bucket')),
267
+ __param(1, (0, common_1.Query)('skip')),
268
+ __param(2, (0, common_1.Query)('limit')),
269
+ __param(3, (0, common_1.Res)()),
270
+ __metadata("design:type", Function),
271
+ __metadata("design:paramtypes", [String, String, String, Object]),
272
+ __metadata("design:returntype", Promise)
273
+ ], CoreHubController.prototype, "filesJson", null);
274
+ __decorate([
275
+ (0, common_1.Get)('migrations.json'),
276
+ __param(0, (0, common_1.Res)()),
277
+ __metadata("design:type", Function),
278
+ __metadata("design:paramtypes", [Object]),
279
+ __metadata("design:returntype", Promise)
280
+ ], CoreHubController.prototype, "migrationsJson", null);
281
+ __decorate([
282
+ (0, common_1.Get)('mailbox.json'),
283
+ __param(0, (0, common_1.Query)('since')),
284
+ __param(1, (0, common_1.Res)()),
285
+ __metadata("design:type", Function),
286
+ __metadata("design:paramtypes", [String, Object]),
287
+ __metadata("design:returntype", void 0)
288
+ ], CoreHubController.prototype, "mailboxJson", null);
289
+ __decorate([
290
+ (0, common_1.Get)('mailbox/:seq/html'),
291
+ __param(0, (0, common_1.Param)('seq')),
292
+ __param(1, (0, common_1.Res)()),
293
+ __metadata("design:type", Function),
294
+ __metadata("design:paramtypes", [String, Object]),
295
+ __metadata("design:returntype", void 0)
296
+ ], CoreHubController.prototype, "mailboxHtml", null);
297
+ __decorate([
298
+ (0, common_1.Get)('logs.json'),
299
+ __param(0, (0, common_1.Query)('since')),
300
+ __param(1, (0, common_1.Res)()),
301
+ __metadata("design:type", Function),
302
+ __metadata("design:paramtypes", [String, Object]),
303
+ __metadata("design:returntype", void 0)
304
+ ], CoreHubController.prototype, "logsJson", null);
305
+ __decorate([
306
+ (0, common_1.Get)('models.json'),
307
+ __param(0, (0, common_1.Res)()),
308
+ __metadata("design:type", Function),
309
+ __metadata("design:paramtypes", [Object]),
310
+ __metadata("design:returntype", void 0)
311
+ ], CoreHubController.prototype, "modelsJson", null);
312
+ __decorate([
313
+ (0, common_1.Get)('session.json'),
314
+ __param(0, (0, common_1.Res)()),
315
+ __metadata("design:type", Function),
316
+ __metadata("design:paramtypes", [Object]),
317
+ __metadata("design:returntype", void 0)
318
+ ], CoreHubController.prototype, "sessionJson", null);
319
+ __decorate([
320
+ (0, common_1.Get)('queries.json'),
321
+ __param(0, (0, common_1.Res)()),
322
+ __metadata("design:type", Function),
323
+ __metadata("design:paramtypes", [Object]),
324
+ __metadata("design:returntype", void 0)
325
+ ], CoreHubController.prototype, "queriesJson", null);
326
+ __decorate([
327
+ (0, common_1.Get)('traces.json'),
328
+ __param(0, (0, common_1.Query)('since')),
329
+ __param(1, (0, common_1.Res)()),
330
+ __metadata("design:type", Function),
331
+ __metadata("design:paramtypes", [String, Object]),
332
+ __metadata("design:returntype", void 0)
333
+ ], CoreHubController.prototype, "tracesJson", null);
334
+ __decorate([
335
+ (0, common_1.Get)('routes.json'),
336
+ __param(0, (0, common_1.Res)()),
337
+ __metadata("design:type", Function),
338
+ __metadata("design:paramtypes", [Object]),
339
+ __metadata("design:returntype", Promise)
340
+ ], CoreHubController.prototype, "routesJson", null);
341
+ __decorate([
342
+ (0, common_1.Get)('emails/preview'),
343
+ __param(0, (0, common_1.Query)('template')),
344
+ __param(1, (0, common_1.Query)('locale')),
345
+ __param(2, (0, common_1.Res)()),
346
+ __metadata("design:type", Function),
347
+ __metadata("design:paramtypes", [String, String, Object]),
348
+ __metadata("design:returntype", Promise)
349
+ ], CoreHubController.prototype, "emailPreview", null);
350
+ __decorate([
351
+ (0, common_1.Get)('hub.js'),
352
+ (0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.S_EVERYONE),
353
+ __param(0, (0, common_1.Res)()),
354
+ __metadata("design:type", Function),
355
+ __metadata("design:paramtypes", [Object]),
356
+ __metadata("design:returntype", void 0)
357
+ ], CoreHubController.prototype, "hubJs", null);
358
+ __decorate([
359
+ (0, common_1.Get)(),
360
+ (0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.S_EVERYONE),
361
+ __param(0, (0, common_1.Headers)('authorization')),
362
+ __param(1, (0, common_1.Res)()),
363
+ __metadata("design:type", Function),
364
+ __metadata("design:paramtypes", [String, Object]),
365
+ __metadata("design:returntype", void 0)
366
+ ], CoreHubController.prototype, "root", null);
367
+ __decorate([
368
+ (0, common_1.Get)(HUB_PAGE_PATHS),
369
+ (0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.S_EVERYONE),
370
+ __param(0, (0, common_1.Headers)('authorization')),
371
+ __param(1, (0, common_1.Res)()),
372
+ __metadata("design:type", Function),
373
+ __metadata("design:paramtypes", [String, Object]),
374
+ __metadata("design:returntype", void 0)
375
+ ], CoreHubController.prototype, "page", null);
376
+ __decorate([
377
+ (0, common_1.Get)('auth'),
378
+ (0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.S_EVERYONE),
379
+ __param(0, (0, common_1.Res)()),
380
+ __metadata("design:type", Function),
381
+ __metadata("design:paramtypes", [Object]),
382
+ __metadata("design:returntype", void 0)
383
+ ], CoreHubController.prototype, "authPage", null);
384
+ exports.CoreHubController = CoreHubController = __decorate([
385
+ (0, common_1.Controller)(),
386
+ __param(9, (0, common_1.Optional)()),
387
+ __metadata("design:paramtypes", [core_hub_service_1.CoreHubService,
388
+ core_hub_html_service_1.CoreHubHtmlService,
389
+ core_hub_db_service_1.CoreHubDbService,
390
+ core_hub_migrations_service_1.CoreHubMigrationsService,
391
+ core_hub_sources_service_1.CoreHubSourcesService,
392
+ core_hub_email_service_1.CoreHubEmailService,
393
+ hub_log_buffer_service_1.HubLogBufferService,
394
+ hub_trace_buffer_service_1.HubTraceBufferService,
395
+ hub_query_profiler_service_1.HubQueryProfilerService,
396
+ core_hub_mailbox_service_1.CoreHubMailboxService])
397
+ ], CoreHubController);
398
+ //# sourceMappingURL=core-hub.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-hub.controller.js","sourceRoot":"","sources":["../../../../src/core/modules/hub/core-hub.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAuF;AAGvF,6EAAgE;AAChE,4DAAwD;AAExD,mEAA6D;AAC7D,yDAAoD;AACpD,uCAAuC;AACvC,wEAAkE;AAClE,8EAAwE;AACxE,kFAA4E;AAC5E,wFAAkF;AAClF,kFAA4E;AAC5E,8EAAwE;AACxE,sFAAgF;AAChF,kFAA4E;AAC5E,iEAA6G;AAG7G,MAAM,cAAc,GAAG,oBAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAiBpF,IA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;IACjB,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;IACf,WAAA,IAAA,YAAG,GAAE,CAAA;;;;qDAmBP;AAMD;IAFC,IAAA,YAAG,EAAC,QAAQ,CAAC;IACb,IAAA,uBAAK,EAAC,oBAAQ,CAAC,UAAU,CAAC;IACpB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;8CAMX;AAWD;IAFC,IAAA,YAAG,GAAE;IACL,IAAA,uBAAK,EAAC,oBAAQ,CAAC,UAAU,CAAC;IACrB,WAAA,IAAA,gBAAO,EAAC,eAAe,CAAC,CAAA;IAAkC,WAAA,IAAA,YAAG,GAAE,CAAA;;;;6CAEpE;AAKD;IAFC,IAAA,YAAG,EAAC,cAAc,CAAC;IACnB,IAAA,uBAAK,EAAC,oBAAQ,CAAC,UAAU,CAAC;IACrB,WAAA,IAAA,gBAAO,EAAC,eAAe,CAAC,CAAA;IAAkC,WAAA,IAAA,YAAG,GAAE,CAAA;;;;6CAEpE;AAKD;IAFC,IAAA,YAAG,EAAC,MAAM,CAAC;IACX,IAAA,uBAAK,EAAC,oBAAQ,CAAC,UAAU,CAAC;IACjB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;iDAEd;4BA/NU,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;IAeR,WAAA,IAAA,iBAAQ,GAAE,CAAA;qCAVoB,iCAAc;QACb,0CAAkB;QACpB,sCAAgB;QACR,sDAAwB;QAC3B,gDAAqB;QACvB,4CAAmB;QACtB,4CAAmB;QACjB,gDAAqB;QACnB,oDAAuB;QAET,gDAAqB;GAd5D,iBAAiB,CAwP7B"}
@@ -0,0 +1,17 @@
1
+ import { DynamicModule, MiddlewareConsumer, NestModule, Type } from '@nestjs/common';
2
+ import { HubConfigContext } from './hub-config.helper';
3
+ import { IHubConfig } from './interfaces/hub-config.interface';
4
+ export interface CoreHubModuleOptions {
5
+ actionsController?: Type<any>;
6
+ actionsService?: Type<any>;
7
+ config: boolean | IHubConfig;
8
+ controller?: Type<any>;
9
+ ctx: HubConfigContext;
10
+ htmlService?: Type<any>;
11
+ service?: Type<any>;
12
+ }
13
+ export declare class CoreHubModule implements NestModule {
14
+ private static traceEnabled;
15
+ configure(consumer: MiddlewareConsumer): void;
16
+ static forRoot(options: CoreHubModuleOptions): DynamicModule;
17
+ }
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var CoreHubModule_1;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.CoreHubModule = void 0;
11
+ const common_1 = require("@nestjs/common");
12
+ const constants_1 = require("@nestjs/common/constants");
13
+ const core_hub_actions_controller_1 = require("./core-hub-actions.controller");
14
+ const core_hub_html_service_1 = require("./core-hub-html.service");
15
+ const core_hub_controller_1 = require("./core-hub.controller");
16
+ const core_hub_service_1 = require("./core-hub.service");
17
+ const hub_constants_1 = require("./hub.constants");
18
+ const hub_config_helper_1 = require("./hub-config.helper");
19
+ const hub_trace_middleware_1 = require("./middleware/hub-trace.middleware");
20
+ const core_hub_actions_service_1 = require("./services/core-hub-actions.service");
21
+ const core_hub_db_service_1 = require("./services/core-hub-db.service");
22
+ const core_hub_email_service_1 = require("./services/core-hub-email.service");
23
+ const core_hub_mailbox_service_1 = require("./services/core-hub-mailbox.service");
24
+ const core_hub_migrations_service_1 = require("./services/core-hub-migrations.service");
25
+ const core_hub_sources_service_1 = require("./services/core-hub-sources.service");
26
+ const hub_log_buffer_service_1 = require("./services/hub-log-buffer.service");
27
+ const hub_query_profiler_service_1 = require("./services/hub-query-profiler.service");
28
+ const hub_trace_buffer_service_1 = require("./services/hub-trace-buffer.service");
29
+ let CoreHubModule = class CoreHubModule {
30
+ static { CoreHubModule_1 = this; }
31
+ static traceEnabled = false;
32
+ configure(consumer) {
33
+ if (CoreHubModule_1.traceEnabled) {
34
+ consumer.apply(hub_trace_middleware_1.HubTraceMiddleware).forRoutes('*');
35
+ }
36
+ }
37
+ static forRoot(options) {
38
+ const resolved = (0, hub_config_helper_1.normalizeHubConfig)(options.config, options.ctx);
39
+ CoreHubModule_1.traceEnabled = resolved.collectors.traces !== false;
40
+ if (resolved.mailbox !== false && resolved.mailbox.mode === 'capture' && (0, hub_config_helper_1.isReachableEnv)(resolved.env)) {
41
+ throw new Error(`Hub mailbox mode 'capture' is not permitted in a reachable environment (${resolved.env}): it ` +
42
+ "suppresses all outgoing mail. Use mode 'copy' (send + record) or disable the mailbox.");
43
+ }
44
+ if (resolved.roles === false && (0, hub_config_helper_1.isReachableEnv)(resolved.env) && !resolved.allowPublicAccessInProduction) {
45
+ throw new Error(`Hub 'roles: false' (no auth check) is not permitted in a reachable environment (${resolved.env}): ` +
46
+ 'it exposes the config viewer, logs and destructive admin actions to unauthenticated requests. ' +
47
+ 'Keep the default ADMIN gate (omit `roles`), or — ONLY behind a fully-controlled network ' +
48
+ 'boundary — set hub.allowPublicAccessInProduction: true to acknowledge the risk.');
49
+ }
50
+ const ControllerClass = options.controller || core_hub_controller_1.CoreHubController;
51
+ const ActionsControllerClass = options.actionsController || core_hub_actions_controller_1.CoreHubActionsController;
52
+ for (const Ctrl of resolved.actions ? [ControllerClass, ActionsControllerClass] : [ControllerClass]) {
53
+ Reflect.defineMetadata(constants_1.PATH_METADATA, resolved.path, Ctrl);
54
+ if (resolved.roles === false) {
55
+ Reflect.deleteMetadata('roles', Ctrl);
56
+ }
57
+ else {
58
+ Reflect.defineMetadata('roles', resolved.roles, Ctrl);
59
+ }
60
+ }
61
+ const providers = [
62
+ { provide: hub_constants_1.HUB_CONFIG, useValue: resolved },
63
+ { provide: core_hub_service_1.CoreHubService, useClass: options.service || core_hub_service_1.CoreHubService },
64
+ { provide: core_hub_html_service_1.CoreHubHtmlService, useClass: options.htmlService || core_hub_html_service_1.CoreHubHtmlService },
65
+ core_hub_db_service_1.CoreHubDbService,
66
+ core_hub_email_service_1.CoreHubEmailService,
67
+ core_hub_migrations_service_1.CoreHubMigrationsService,
68
+ core_hub_sources_service_1.CoreHubSourcesService,
69
+ hub_log_buffer_service_1.HubLogBufferService,
70
+ hub_query_profiler_service_1.HubQueryProfilerService,
71
+ hub_trace_buffer_service_1.HubTraceBufferService,
72
+ hub_trace_middleware_1.HubTraceMiddleware,
73
+ ];
74
+ const controllers = [ControllerClass];
75
+ if (resolved.actions) {
76
+ controllers.push(ActionsControllerClass);
77
+ providers.push({ provide: core_hub_actions_service_1.CoreHubActionsService, useClass: options.actionsService || core_hub_actions_service_1.CoreHubActionsService });
78
+ }
79
+ const global = resolved.mailbox !== false;
80
+ if (global) {
81
+ providers.push(core_hub_mailbox_service_1.CoreHubMailboxService);
82
+ providers.push({ provide: hub_constants_1.HUB_EMAIL_CAPTURE, useExisting: core_hub_mailbox_service_1.CoreHubMailboxService });
83
+ }
84
+ return {
85
+ controllers,
86
+ exports: [
87
+ core_hub_service_1.CoreHubService,
88
+ core_hub_html_service_1.CoreHubHtmlService,
89
+ core_hub_db_service_1.CoreHubDbService,
90
+ core_hub_email_service_1.CoreHubEmailService,
91
+ core_hub_migrations_service_1.CoreHubMigrationsService,
92
+ core_hub_sources_service_1.CoreHubSourcesService,
93
+ hub_log_buffer_service_1.HubLogBufferService,
94
+ hub_query_profiler_service_1.HubQueryProfilerService,
95
+ hub_trace_buffer_service_1.HubTraceBufferService,
96
+ hub_constants_1.HUB_CONFIG,
97
+ ...(global ? [core_hub_mailbox_service_1.CoreHubMailboxService, hub_constants_1.HUB_EMAIL_CAPTURE] : []),
98
+ ],
99
+ global,
100
+ module: CoreHubModule_1,
101
+ providers,
102
+ };
103
+ }
104
+ };
105
+ exports.CoreHubModule = CoreHubModule;
106
+ exports.CoreHubModule = CoreHubModule = CoreHubModule_1 = __decorate([
107
+ (0, common_1.Module)({})
108
+ ], CoreHubModule);
109
+ //# sourceMappingURL=core-hub.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-hub.module.js","sourceRoot":"","sources":["../../../../src/core/modules/hub/core-hub.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuG;AACvG,wDAAyD;AAEzD,+EAAyE;AACzE,mEAA6D;AAC7D,+DAA0D;AAC1D,yDAAoD;AACpD,mDAAgE;AAChE,2DAA2F;AAC3F,4EAAuE;AACvE,kFAA4E;AAC5E,wEAAkE;AAClE,8EAAwE;AACxE,kFAA4E;AAC5E,wFAAkF;AAClF,kFAA4E;AAC5E,8EAAwE;AACxE,sFAAgF;AAChF,kFAA4E;AA6BrE,IAAM,aAAa,GAAnB,MAAM,aAAa;;IAGhB,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC;IAEpC,SAAS,CAAC,QAA4B;QACpC,IAAI,eAAa,CAAC,YAAY,EAAE,CAAC;YAG/B,QAAQ,CAAC,KAAK,CAAC,yCAAkB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,OAA6B;QAC1C,MAAM,QAAQ,GAAG,IAAA,sCAAkB,EAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACjE,eAAa,CAAC,YAAY,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,KAAK,KAAK,CAAC;QAKlE,IAAI,QAAQ,CAAC,OAAO,KAAK,KAAK,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,IAAA,kCAAc,EAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACtG,MAAM,IAAI,KAAK,CACb,2EAA2E,QAAQ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AgB;YAChB,4CAAmB;YACnB,sDAAwB;YACxB,gDAAqB;YAGrB,4CAAmB;YACnB,oDAAuB;YACvB,gDAAqB;YACrB,yCAAkB;SACnB,CAAC;QAGF,MAAM,WAAW,GAAgB,CAAC,eAAe,CAAC,CAAC;QACnD,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;YACrB,WAAW,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YACzC,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,gDAAqB,EAAE,QAAQ,EAAE,OAAO,CAAC,cAAc,IAAI,gDAAqB,EAAE,CAAC,CAAC;QAChH,CAAC;QAKD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,KAAK,KAAK,CAAC;QAC1C,IAAI,MAAM,EAAE,CAAC;YACX,SAAS,CAAC,IAAI,CAAC,gDAAqB,CAAC,CAAC;YACtC,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,iCAAiB,EAAE,WAAW,EAAE,gDAAqB,EAAE,CAAC,CAAC;QACrF,CAAC;QAED,OAAO;YACL,WAAW;YACX,OAAO,EAAE;gBACP,iCAAc;gBACd,0CAAkB;gBAClB,sCAAgB;gBAChB,4CAAmB;gBACnB,sDAAwB;gBACxB,gDAAqB;gBACrB,4CAAmB;gBACnB,oDAAuB;gBACvB,gDAAqB;gBACrB,0BAAU;gBACV,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,gDAAqB,EAAE,iCAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aAC9D;YACD,MAAM;YACN,MAAM,EAAE,eAAa;YACrB,SAAS;SACV,CAAC;IACJ,CAAC;;AA9GU,sCAAa;wBAAb,aAAa;IADzB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,aAAa,CA+GzB"}
@@ -0,0 +1,18 @@
1
+ import { Connection } from 'mongoose';
2
+ import { ConfigService } from '../../common/services/config.service';
3
+ import { CoreHubSourcesService } from './services/core-hub-sources.service';
4
+ import { HubDashboardData, HubDiagnosticsData, HubSessionData } from './interfaces/hub-panels.interface';
5
+ import { ResolvedHubConfig } from './interfaces/hub-config.interface';
6
+ export declare class CoreHubService {
7
+ protected readonly config: ResolvedHubConfig;
8
+ protected readonly configService: ConfigService;
9
+ protected readonly sources: CoreHubSourcesService;
10
+ protected readonly connection?: Connection;
11
+ constructor(config: ResolvedHubConfig, configService: ConfigService, sources: CoreHubSourcesService, connection?: Connection);
12
+ getDashboard(): HubDashboardData;
13
+ getDiagnostics(buffers?: HubDiagnosticsData['buffers']): HubDiagnosticsData;
14
+ getConfigMasked(): Record<string, unknown>;
15
+ getResolvedConfig(): ResolvedHubConfig;
16
+ getSessionPayload(): HubSessionData;
17
+ protected featureMatrix(): Record<string, boolean>;
18
+ }