@lenne.tech/nest-server 11.31.2 → 11.32.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 (181) hide show
  1. package/.claude/rules/architecture.md +2 -0
  2. package/.claude/rules/configurable-features.md +2 -0
  3. package/.claude/rules/versioning.md +5 -8
  4. package/CLAUDE.md +31 -4
  5. package/FRAMEWORK-API.md +7 -2
  6. package/README.md +1 -0
  7. package/dist/config.env.d.ts +4 -0
  8. package/dist/config.env.js +32 -2
  9. package/dist/config.env.js.map +1 -1
  10. package/dist/core/common/helpers/logging.helper.d.ts +1 -0
  11. package/dist/core/common/helpers/logging.helper.js +12 -0
  12. package/dist/core/common/helpers/logging.helper.js.map +1 -1
  13. package/dist/core/common/helpers/meta.helper.d.ts +1 -0
  14. package/dist/core/common/helpers/meta.helper.js +32 -1
  15. package/dist/core/common/helpers/meta.helper.js.map +1 -1
  16. package/dist/core/common/helpers/process-diagnostics.helper.d.ts +18 -0
  17. package/dist/core/common/helpers/process-diagnostics.helper.js +88 -0
  18. package/dist/core/common/helpers/process-diagnostics.helper.js.map +1 -0
  19. package/dist/core/common/interfaces/server-options.interface.d.ts +12 -0
  20. package/dist/core/common/services/brevo.service.d.ts +7 -1
  21. package/dist/core/common/services/brevo.service.js +37 -16
  22. package/dist/core/common/services/brevo.service.js.map +1 -1
  23. package/dist/core/common/services/email.service.d.ts +3 -1
  24. package/dist/core/common/services/email.service.js +33 -2
  25. package/dist/core/common/services/email.service.js.map +1 -1
  26. package/dist/core/common/services/template.service.js +9 -4
  27. package/dist/core/common/services/template.service.js.map +1 -1
  28. package/dist/core/modules/better-auth/core-better-auth-email-verification.service.js +9 -4
  29. package/dist/core/modules/better-auth/core-better-auth-email-verification.service.js.map +1 -1
  30. package/dist/core/modules/hub/core-hub-actions.controller.d.ts +22 -0
  31. package/dist/core/modules/hub/core-hub-actions.controller.js +141 -0
  32. package/dist/core/modules/hub/core-hub-actions.controller.js.map +1 -0
  33. package/dist/core/modules/hub/core-hub-html.service.d.ts +8 -0
  34. package/dist/core/modules/hub/core-hub-html.service.js +123 -0
  35. package/dist/core/modules/hub/core-hub-html.service.js.map +1 -0
  36. package/dist/core/modules/hub/core-hub.controller.d.ts +56 -0
  37. package/dist/core/modules/hub/core-hub.controller.js +398 -0
  38. package/dist/core/modules/hub/core-hub.controller.js.map +1 -0
  39. package/dist/core/modules/hub/core-hub.module.d.ts +17 -0
  40. package/dist/core/modules/hub/core-hub.module.js +109 -0
  41. package/dist/core/modules/hub/core-hub.module.js.map +1 -0
  42. package/dist/core/modules/hub/core-hub.service.d.ts +18 -0
  43. package/dist/core/modules/hub/core-hub.service.js +153 -0
  44. package/dist/core/modules/hub/core-hub.service.js.map +1 -0
  45. package/dist/core/modules/hub/helpers/hub-client-js.helper.d.ts +1 -0
  46. package/dist/core/modules/hub/helpers/hub-client-js.helper.js +755 -0
  47. package/dist/core/modules/hub/helpers/hub-client-js.helper.js.map +1 -0
  48. package/dist/core/modules/hub/helpers/hub-command-shape.helper.d.ts +1 -0
  49. package/dist/core/modules/hub/helpers/hub-command-shape.helper.js +33 -0
  50. package/dist/core/modules/hub/helpers/hub-command-shape.helper.js.map +1 -0
  51. package/dist/core/modules/hub/helpers/hub-mask.helper.d.ts +1 -0
  52. package/dist/core/modules/hub/helpers/hub-mask.helper.js +46 -0
  53. package/dist/core/modules/hub/helpers/hub-mask.helper.js.map +1 -0
  54. package/dist/core/modules/hub/helpers/hub-mermaid.helper.d.ts +10 -0
  55. package/dist/core/modules/hub/helpers/hub-mermaid.helper.js +35 -0
  56. package/dist/core/modules/hub/helpers/hub-mermaid.helper.js.map +1 -0
  57. package/dist/core/modules/hub/helpers/hub-shell.helper.d.ts +9 -0
  58. package/dist/core/modules/hub/helpers/hub-shell.helper.js +62 -0
  59. package/dist/core/modules/hub/helpers/hub-shell.helper.js.map +1 -0
  60. package/dist/core/modules/hub/hub-action-messages.d.ts +17 -0
  61. package/dist/core/modules/hub/hub-action-messages.js +21 -0
  62. package/dist/core/modules/hub/hub-action-messages.js.map +1 -0
  63. package/dist/core/modules/hub/hub-config.helper.d.ts +11 -0
  64. package/dist/core/modules/hub/hub-config.helper.js +164 -0
  65. package/dist/core/modules/hub/hub-config.helper.js.map +1 -0
  66. package/dist/core/modules/hub/hub-nav.d.ts +12 -0
  67. package/dist/core/modules/hub/hub-nav.js +43 -0
  68. package/dist/core/modules/hub/hub-nav.js.map +1 -0
  69. package/dist/core/modules/hub/hub-ring-buffer.d.ts +22 -0
  70. package/dist/core/modules/hub/hub-ring-buffer.js +59 -0
  71. package/dist/core/modules/hub/hub-ring-buffer.js.map +1 -0
  72. package/dist/core/modules/hub/hub.constants.d.ts +18 -0
  73. package/dist/core/modules/hub/hub.constants.js +22 -0
  74. package/dist/core/modules/hub/hub.constants.js.map +1 -0
  75. package/dist/core/modules/hub/index.d.ts +25 -0
  76. package/dist/core/modules/hub/index.js +42 -0
  77. package/dist/core/modules/hub/index.js.map +1 -0
  78. package/dist/core/modules/hub/interfaces/hub-config.interface.d.ts +115 -0
  79. package/dist/core/modules/hub/interfaces/hub-config.interface.js +3 -0
  80. package/dist/core/modules/hub/interfaces/hub-config.interface.js.map +1 -0
  81. package/dist/core/modules/hub/interfaces/hub-panels.interface.d.ts +231 -0
  82. package/dist/core/modules/hub/interfaces/hub-panels.interface.js +3 -0
  83. package/dist/core/modules/hub/interfaces/hub-panels.interface.js.map +1 -0
  84. package/dist/core/modules/hub/middleware/hub-trace.middleware.d.ts +8 -0
  85. package/dist/core/modules/hub/middleware/hub-trace.middleware.js +50 -0
  86. package/dist/core/modules/hub/middleware/hub-trace.middleware.js.map +1 -0
  87. package/dist/core/modules/hub/services/core-hub-actions.service.d.ts +48 -0
  88. package/dist/core/modules/hub/services/core-hub-actions.service.js +136 -0
  89. package/dist/core/modules/hub/services/core-hub-actions.service.js.map +1 -0
  90. package/dist/core/modules/hub/services/core-hub-db.service.d.ts +19 -0
  91. package/dist/core/modules/hub/services/core-hub-db.service.js +180 -0
  92. package/dist/core/modules/hub/services/core-hub-db.service.js.map +1 -0
  93. package/dist/core/modules/hub/services/core-hub-email.service.d.ts +24 -0
  94. package/dist/core/modules/hub/services/core-hub-email.service.js +148 -0
  95. package/dist/core/modules/hub/services/core-hub-email.service.js.map +1 -0
  96. package/dist/core/modules/hub/services/core-hub-mailbox.service.d.ts +20 -0
  97. package/dist/core/modules/hub/services/core-hub-mailbox.service.js +103 -0
  98. package/dist/core/modules/hub/services/core-hub-mailbox.service.js.map +1 -0
  99. package/dist/core/modules/hub/services/core-hub-migrations.service.d.ts +25 -0
  100. package/dist/core/modules/hub/services/core-hub-migrations.service.js +115 -0
  101. package/dist/core/modules/hub/services/core-hub-migrations.service.js.map +1 -0
  102. package/dist/core/modules/hub/services/core-hub-sources.service.d.ts +28 -0
  103. package/dist/core/modules/hub/services/core-hub-sources.service.js +187 -0
  104. package/dist/core/modules/hub/services/core-hub-sources.service.js.map +1 -0
  105. package/dist/core/modules/hub/services/hub-log-buffer.service.d.ts +24 -0
  106. package/dist/core/modules/hub/services/hub-log-buffer.service.js +210 -0
  107. package/dist/core/modules/hub/services/hub-log-buffer.service.js.map +1 -0
  108. package/dist/core/modules/hub/services/hub-query-profiler.service.d.ts +38 -0
  109. package/dist/core/modules/hub/services/hub-query-profiler.service.js +235 -0
  110. package/dist/core/modules/hub/services/hub-query-profiler.service.js.map +1 -0
  111. package/dist/core/modules/hub/services/hub-trace-buffer.service.d.ts +18 -0
  112. package/dist/core/modules/hub/services/hub-trace-buffer.service.js +123 -0
  113. package/dist/core/modules/hub/services/hub-trace-buffer.service.js.map +1 -0
  114. package/dist/core.module.js +42 -1
  115. package/dist/core.module.js.map +1 -1
  116. package/dist/index.d.ts +2 -0
  117. package/dist/index.js +2 -0
  118. package/dist/index.js.map +1 -1
  119. package/dist/main.js +5 -2
  120. package/dist/main.js.map +1 -1
  121. package/dist/tsconfig.build.tsbuildinfo +1 -1
  122. package/docs/REQUEST-LIFECYCLE.md +2 -0
  123. package/docs/brevo-manual-test.md +166 -0
  124. package/docs/security-overrides.md +90 -0
  125. package/migration-guides/11.31.2-to-11.31.3.md +135 -0
  126. package/migration-guides/11.31.3-to-11.32.0.md +254 -0
  127. package/package.json +16 -14
  128. package/src/config.env.ts +75 -2
  129. package/src/core/common/helpers/logging.helper.spec.ts +61 -0
  130. package/src/core/common/helpers/logging.helper.ts +48 -0
  131. package/src/core/common/helpers/meta.helper.ts +46 -1
  132. package/src/core/common/helpers/process-diagnostics.helper.spec.ts +310 -0
  133. package/src/core/common/helpers/process-diagnostics.helper.ts +321 -0
  134. package/src/core/common/interfaces/server-options.interface.ts +78 -0
  135. package/src/core/common/services/brevo.service.spec.ts +266 -0
  136. package/src/core/common/services/brevo.service.ts +100 -17
  137. package/src/core/common/services/email.service.ts +33 -1
  138. package/src/core/common/services/template.service.ts +21 -16
  139. package/src/core/modules/better-auth/core-better-auth-email-verification.service.ts +14 -4
  140. package/src/core/modules/hub/INTEGRATION-CHECKLIST.md +64 -0
  141. package/src/core/modules/hub/README.md +159 -0
  142. package/src/core/modules/hub/core-hub-actions.controller.ts +137 -0
  143. package/src/core/modules/hub/core-hub-html.service.ts +135 -0
  144. package/src/core/modules/hub/core-hub.controller.ts +286 -0
  145. package/src/core/modules/hub/core-hub.module.spec.ts +108 -0
  146. package/src/core/modules/hub/core-hub.module.ts +159 -0
  147. package/src/core/modules/hub/core-hub.service.ts +169 -0
  148. package/src/core/modules/hub/helpers/hub-client-js.helper.ts +768 -0
  149. package/src/core/modules/hub/helpers/hub-command-shape.helper.spec.ts +48 -0
  150. package/src/core/modules/hub/helpers/hub-command-shape.helper.ts +47 -0
  151. package/src/core/modules/hub/helpers/hub-mask.helper.spec.ts +67 -0
  152. package/src/core/modules/hub/helpers/hub-mask.helper.ts +78 -0
  153. package/src/core/modules/hub/helpers/hub-mermaid.helper.spec.ts +54 -0
  154. package/src/core/modules/hub/helpers/hub-mermaid.helper.ts +62 -0
  155. package/src/core/modules/hub/helpers/hub-shell.helper.spec.ts +106 -0
  156. package/src/core/modules/hub/helpers/hub-shell.helper.ts +90 -0
  157. package/src/core/modules/hub/hub-action-messages.ts +47 -0
  158. package/src/core/modules/hub/hub-config.helper.spec.ts +108 -0
  159. package/src/core/modules/hub/hub-config.helper.ts +233 -0
  160. package/src/core/modules/hub/hub-nav.ts +66 -0
  161. package/src/core/modules/hub/hub-ring-buffer.spec.ts +95 -0
  162. package/src/core/modules/hub/hub-ring-buffer.ts +101 -0
  163. package/src/core/modules/hub/hub.constants.ts +84 -0
  164. package/src/core/modules/hub/index.ts +25 -0
  165. package/src/core/modules/hub/interfaces/hub-config.interface.ts +265 -0
  166. package/src/core/modules/hub/interfaces/hub-panels.interface.ts +186 -0
  167. package/src/core/modules/hub/middleware/hub-trace.middleware.ts +45 -0
  168. package/src/core/modules/hub/services/core-hub-actions.service.ts +133 -0
  169. package/src/core/modules/hub/services/core-hub-db.service.ts +185 -0
  170. package/src/core/modules/hub/services/core-hub-email.service.ts +158 -0
  171. package/src/core/modules/hub/services/core-hub-mailbox.service.spec.ts +116 -0
  172. package/src/core/modules/hub/services/core-hub-mailbox.service.ts +121 -0
  173. package/src/core/modules/hub/services/core-hub-migrations.service.ts +112 -0
  174. package/src/core/modules/hub/services/core-hub-sources.service.ts +194 -0
  175. package/src/core/modules/hub/services/hub-log-buffer.service.ts +252 -0
  176. package/src/core/modules/hub/services/hub-query-profiler.service.ts +274 -0
  177. package/src/core/modules/hub/services/hub-trace-buffer.service.spec.ts +112 -0
  178. package/src/core/modules/hub/services/hub-trace-buffer.service.ts +134 -0
  179. package/src/core.module.ts +61 -1
  180. package/src/index.ts +7 -0
  181. package/src/main.ts +22 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-client-js.helper.js","sourceRoot":"","sources":["../../../../../src/core/modules/hub/helpers/hub-client-js.helper.ts"],"names":[],"mappings":";;AAiBA,wCA8uBC;AA9uBD,SAAgB,cAAc;IAC5B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4uBR,CAAC;AACF,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function normalizeCommandShape(value: unknown, depth?: number): unknown;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeCommandShape = normalizeCommandShape;
4
+ const MAX_DEPTH = 5;
5
+ const MAX_KEYS = 32;
6
+ const MAX_ARRAY_ITEMS = 8;
7
+ const DEPTH_SENTINEL = '…';
8
+ const PLACEHOLDER = '?';
9
+ function normalizeCommandShape(value, depth = 0) {
10
+ if (depth >= MAX_DEPTH) {
11
+ return DEPTH_SENTINEL;
12
+ }
13
+ if (Array.isArray(value)) {
14
+ if (value.length > 0 && typeof value[0] === 'object' && value[0] !== null) {
15
+ return value.slice(0, MAX_ARRAY_ITEMS).map((item) => normalizeCommandShape(item, depth + 1));
16
+ }
17
+ return [PLACEHOLDER];
18
+ }
19
+ if (value !== null && typeof value === 'object') {
20
+ const out = {};
21
+ let count = 0;
22
+ for (const key of Object.keys(value)) {
23
+ if (++count > MAX_KEYS) {
24
+ out[DEPTH_SENTINEL] = DEPTH_SENTINEL;
25
+ break;
26
+ }
27
+ out[key] = normalizeCommandShape(value[key], depth + 1);
28
+ }
29
+ return out;
30
+ }
31
+ return PLACEHOLDER;
32
+ }
33
+ //# sourceMappingURL=hub-command-shape.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-command-shape.helper.js","sourceRoot":"","sources":["../../../../../src/core/modules/hub/helpers/hub-command-shape.helper.ts"],"names":[],"mappings":";;AAmBA,sDA2BC;AAjCD,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,SAAgB,qBAAqB,CAAC,KAAc,EAAE,KAAK,GAAG,CAAC;IAC7D,IAAI,KAAK,IAAI,SAAS,EAAE,CAAC;QACvB,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAEzB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YAC1E,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;QAC/F,CAAC;QACD,OAAO,CAAC,WAAW,CAAC,CAAC;IACvB,CAAC;IAED,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,MAAM,GAAG,GAA4B,EAAE,CAAC;QACxC,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAgC,CAAC,EAAE,CAAC;YAChE,IAAI,EAAE,KAAK,GAAG,QAAQ,EAAE,CAAC;gBACvB,GAAG,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;gBACrC,MAAM;YACR,CAAC;YACD,GAAG,CAAC,GAAG,CAAC,GAAG,qBAAqB,CAAE,KAAiC,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;QACvF,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function maskConfigDeep<T>(value: T, extraSecretKeys?: string[]): T;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.maskConfigDeep = maskConfigDeep;
4
+ const SECRET_KEY_PATTERN = /secret|passwd|password|passphrase|credential|api[-_]?key|access[-_]?token|refresh[-_]?token|private[-_]?key|encryption|\btoken\b|\bpass\b|(^|[^a-z])key([^a-z]|$)/i;
5
+ const URI_CREDENTIAL_PATTERN = /^([a-z][a-z0-9+.-]*:\/\/[^/@:\s]+:)([^@/\s]+)(@)/i;
6
+ const MASK = '***';
7
+ function maskConfigDeep(value, extraSecretKeys = []) {
8
+ const extra = new Set(extraSecretKeys.map((k) => k.toLowerCase()));
9
+ return maskValue(value, false, extra);
10
+ }
11
+ function isSecretKey(key, extra) {
12
+ return extra.has(key.toLowerCase()) || SECRET_KEY_PATTERN.test(key);
13
+ }
14
+ function maskString(value) {
15
+ const uriMatch = value.match(URI_CREDENTIAL_PATTERN);
16
+ if (uriMatch) {
17
+ return value.replace(URI_CREDENTIAL_PATTERN, `$1${MASK}$3`);
18
+ }
19
+ return value;
20
+ }
21
+ function maskValue(value, keyIsSecret, extra) {
22
+ if (value === null || value === undefined) {
23
+ return value;
24
+ }
25
+ if (typeof value !== 'object') {
26
+ if (keyIsSecret) {
27
+ return MASK;
28
+ }
29
+ return typeof value === 'string' ? maskString(value) : value;
30
+ }
31
+ if (keyIsSecret) {
32
+ return MASK;
33
+ }
34
+ if (value instanceof Date || Buffer.isBuffer(value)) {
35
+ return value;
36
+ }
37
+ if (Array.isArray(value)) {
38
+ return value.map((item) => maskValue(item, false, extra));
39
+ }
40
+ const out = {};
41
+ for (const [key, val] of Object.entries(value)) {
42
+ out[key] = maskValue(val, isSecretKey(key, extra), extra);
43
+ }
44
+ return out;
45
+ }
46
+ //# sourceMappingURL=hub-mask.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-mask.helper.js","sourceRoot":"","sources":["../../../../../src/core/modules/hub/helpers/hub-mask.helper.ts"],"names":[],"mappings":";;AA2BA,wCAGC;AArBD,MAAM,kBAAkB,GACtB,oKAAoK,CAAC;AAGvK,MAAM,sBAAsB,GAAG,mDAAmD,CAAC;AAEnF,MAAM,IAAI,GAAG,KAAK,CAAC;AAYnB,SAAgB,cAAc,CAAI,KAAQ,EAAE,kBAA4B,EAAE;IACxE,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IACnE,OAAO,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAM,CAAC;AAC7C,CAAC;AAED,SAAS,WAAW,CAAC,GAAW,EAAE,KAAkB;IAClD,OAAO,KAA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IAAI,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,EAAE,CAAC;QAC1E,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,10 @@
1
+ export interface HubModelDescriptor {
2
+ fields: HubModelField[];
3
+ name: string;
4
+ }
5
+ export interface HubModelField {
6
+ name: string;
7
+ ref?: string;
8
+ type: string;
9
+ }
10
+ export declare function buildErDiagram(models: HubModelDescriptor[]): string;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildErDiagram = buildErDiagram;
4
+ function sanitizeIdentifier(value) {
5
+ const cleaned = String(value ?? '').replace(/[^A-Za-z0-9_]/g, '_');
6
+ return /^[A-Za-z_]/.test(cleaned) ? cleaned : `_${cleaned}`;
7
+ }
8
+ function buildErDiagram(models) {
9
+ if (!models || models.length === 0) {
10
+ return 'erDiagram';
11
+ }
12
+ const present = new Set(models.map((m) => m.name));
13
+ const lines = ['erDiagram'];
14
+ for (const model of models) {
15
+ const entity = sanitizeIdentifier(model.name);
16
+ lines.push(` ${entity} {`);
17
+ for (const field of model.fields) {
18
+ const type = sanitizeIdentifier(field.type || 'Mixed');
19
+ const name = sanitizeIdentifier(field.name);
20
+ lines.push(` ${type} ${name}`);
21
+ }
22
+ lines.push(' }');
23
+ }
24
+ for (const model of models) {
25
+ const from = sanitizeIdentifier(model.name);
26
+ for (const field of model.fields) {
27
+ if (field.ref && present.has(field.ref)) {
28
+ const to = sanitizeIdentifier(field.ref);
29
+ lines.push(` ${from} ||--o{ ${to} : ${sanitizeIdentifier(field.name)}`);
30
+ }
31
+ }
32
+ }
33
+ return lines.join('\n');
34
+ }
35
+ //# sourceMappingURL=hub-mermaid.helper.js.map
@@ -0,0 +1 @@
1
+ {"version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CAAC;IAED,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5C,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACjC,IAAI,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;gBACxC,MAAM,EAAE,GAAG,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACzC,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC3E,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare const HUB_NONCE_PLACEHOLDER = "__CSP_NONCE__";
2
+ export declare function escapeHtml(value: string): string;
3
+ export declare function escapeJsString(value: string): string;
4
+ export declare function generateNonce(): string;
5
+ export declare function injectNonce(html: string, nonce: string): string;
6
+ export declare function buildHubCsp(nonce: string): string;
7
+ export declare function buildHubSecurityHeaders(nonce: string, opts?: {
8
+ cacheable?: boolean;
9
+ }): Record<string, string>;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HUB_NONCE_PLACEHOLDER = void 0;
4
+ exports.escapeHtml = escapeHtml;
5
+ exports.escapeJsString = escapeJsString;
6
+ exports.generateNonce = generateNonce;
7
+ exports.injectNonce = injectNonce;
8
+ exports.buildHubCsp = buildHubCsp;
9
+ exports.buildHubSecurityHeaders = buildHubSecurityHeaders;
10
+ const crypto_1 = require("crypto");
11
+ exports.HUB_NONCE_PLACEHOLDER = '__CSP_NONCE__';
12
+ const LINE_SEPARATOR = String.fromCharCode(0x2028);
13
+ const PARAGRAPH_SEPARATOR = String.fromCharCode(0x2029);
14
+ function escapeHtml(value) {
15
+ return String(value ?? '')
16
+ .replace(/&/g, '&amp;')
17
+ .replace(/</g, '&lt;')
18
+ .replace(/>/g, '&gt;')
19
+ .replace(/"/g, '&quot;')
20
+ .replace(/'/g, '&#39;');
21
+ }
22
+ function escapeJsString(value) {
23
+ return String(value ?? '')
24
+ .replace(/\\/g, '\\\\')
25
+ .replace(/'/g, "\\'")
26
+ .replace(/</g, '\\u003c')
27
+ .replace(/\r/g, '\\r')
28
+ .replace(/\n/g, '\\n')
29
+ .split(LINE_SEPARATOR)
30
+ .join('\\u2028')
31
+ .split(PARAGRAPH_SEPARATOR)
32
+ .join('\\u2029');
33
+ }
34
+ function generateNonce() {
35
+ return (0, crypto_1.randomBytes)(16).toString('base64');
36
+ }
37
+ function injectNonce(html, nonce) {
38
+ return html.split(exports.HUB_NONCE_PLACEHOLDER).join(nonce);
39
+ }
40
+ function buildHubCsp(nonce) {
41
+ return [
42
+ "default-src 'none'",
43
+ `script-src 'nonce-${nonce}' 'self'`,
44
+ `style-src 'nonce-${nonce}'`,
45
+ "img-src 'self' data:",
46
+ "connect-src 'self'",
47
+ "frame-src 'self'",
48
+ "frame-ancestors 'none'",
49
+ "base-uri 'none'",
50
+ "form-action 'self'",
51
+ ].join('; ');
52
+ }
53
+ function buildHubSecurityHeaders(nonce, opts) {
54
+ return {
55
+ 'Cache-Control': opts?.cacheable ? 'private, max-age=86400, immutable' : 'no-store',
56
+ 'Content-Security-Policy': buildHubCsp(nonce),
57
+ 'Referrer-Policy': 'no-referrer',
58
+ 'X-Content-Type-Options': 'nosniff',
59
+ 'X-Frame-Options': 'DENY',
60
+ };
61
+ }
62
+ //# sourceMappingURL=hub-shell.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-shell.helper.js","sourceRoot":"","sources":["../../../../../src/core/modules/hub/helpers/hub-shell.helper.ts"],"names":[],"mappings":";;;AAiBA,gCAOC;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CAAC,CAAC;AACvD,CAAC;AAOD,SAAgB,WAAW,CAAC,KAAa;IACvC,OAAO;QACL,oBAAoB;QACpB,qBAAqB,KAAK,UAAU;QACpC,oBAAoB,KAAK,GAAG;QAC5B,sBAAsB;QACtB,oBAAoB;QACpB,kBAAkB;QAClB,wBAAwB;QACxB,iBAAiB;QACjB,oBAAoB;KACrB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AASD,SAAgB,uBAAuB,CAAC,KAAa,EAAE,IAA8B;IACnF,OAAO;QACL,eAAe,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,UAAU;QACnF,yBAAyB,EAAE,WAAW,CAAC,KAAK,CAAC;QAC7C,iBAAiB,EAAE,aAAa;QAChC,wBAAwB,EAAE,SAAS;QACnC,iBAAiB,EAAE,MAAM;KAC1B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ export declare const HubActionMessage: {
2
+ readonly actionFailed: "Action failed.";
3
+ readonly confirmationFilenameMismatch: "Confirmation filename does not match.";
4
+ readonly confirmationFilenameRequired: "Confirmation filename required.";
5
+ readonly emailServiceUnavailable: "EmailService is not available.";
6
+ readonly fileNotFound: "File not found.";
7
+ readonly invalidFileId: "Invalid file id.";
8
+ readonly migrationsDisabled: "The migrations panel is disabled.";
9
+ readonly missingHubRequestHeader: "Missing X-Hub-Request header.";
10
+ readonly mongoUnavailable: "No MongoDB connection is available.";
11
+ readonly mongoUriMissing: "No MongoDB URI is configured.";
12
+ readonly recipientRequired: "Recipient (to) required.";
13
+ readonly unknownCollector: "Unknown collector.";
14
+ readonly unknownCronAction: "Unknown cron action.";
15
+ readonly confirmationKeywordMismatch: (expected: string) => string;
16
+ readonly unknownEmailTemplate: (name: string) => string;
17
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HubActionMessage = void 0;
4
+ exports.HubActionMessage = {
5
+ actionFailed: 'Action failed.',
6
+ confirmationFilenameMismatch: 'Confirmation filename does not match.',
7
+ confirmationFilenameRequired: 'Confirmation filename required.',
8
+ emailServiceUnavailable: 'EmailService is not available.',
9
+ fileNotFound: 'File not found.',
10
+ invalidFileId: 'Invalid file id.',
11
+ migrationsDisabled: 'The migrations panel is disabled.',
12
+ missingHubRequestHeader: 'Missing X-Hub-Request header.',
13
+ mongoUnavailable: 'No MongoDB connection is available.',
14
+ mongoUriMissing: 'No MongoDB URI is configured.',
15
+ recipientRequired: 'Recipient (to) required.',
16
+ unknownCollector: 'Unknown collector.',
17
+ unknownCronAction: 'Unknown cron action.',
18
+ confirmationKeywordMismatch: (expected) => `Confirmation keyword mismatch (expected "${expected}").`,
19
+ unknownEmailTemplate: (name) => `Unknown email template "${name}".`,
20
+ };
21
+ //# sourceMappingURL=hub-action-messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-action-messages.js","sourceRoot":"","sources":["../../../../src/core/modules/hub/hub-action-messages.ts"],"names":[],"mappings":";;;AAca,QAAA,gBAAgB,GAAG;IAE9B,YAAY,EAAE,gBAAgB;IAE9B,4BAA4B,EAAE,uCAAuC;IAErE,4BAA4B,EAAE,iCAAiC;IAE/D,uBAAuB,EAAE,gCAAgC;IAEzD,YAAY,EAAE,iBAAiB;IAE/B,aAAa,EAAE,kBAAkB;IAEjC,kBAAkB,EAAE,mCAAmC;IAEvD,uBAAuB,EAAE,+BAA+B;IAExD,gBAAgB,EAAE,qCAAqC;IAEvD,eAAe,EAAE,+BAA+B;IAEhD,iBAAiB,EAAE,0BAA0B;IAE7C,gBAAgB,EAAE,oBAAoB;IAEtC,iBAAiB,EAAE,sBAAsB;IAGzC,2BAA2B,EAAE,CAAC,QAAgB,EAAU,EAAE,CAAC,4CAA4C,QAAQ,KAAK;IAEpH,oBAAoB,EAAE,CAAC,IAAY,EAAU,EAAE,CAAC,2BAA2B,IAAI,IAAI;CAC3E,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { IHubConfig, ResolvedHubConfig } from './interfaces/hub-config.interface';
2
+ export interface HubConfigContext {
3
+ env: string;
4
+ graphQlEnabled?: boolean;
5
+ permissionsPath?: string;
6
+ version: string;
7
+ }
8
+ export declare function isReachableEnv(env: string | undefined): boolean;
9
+ export declare function isHubEnabled(config: boolean | IHubConfig | undefined): boolean;
10
+ export declare function isHubQueriesEnabled(config: boolean | IHubConfig | undefined): boolean;
11
+ export declare function normalizeHubConfig(config: boolean | IHubConfig, ctx: HubConfigContext): ResolvedHubConfig;
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isReachableEnv = isReachableEnv;
4
+ exports.isHubEnabled = isHubEnabled;
5
+ exports.isHubQueriesEnabled = isHubQueriesEnabled;
6
+ exports.normalizeHubConfig = normalizeHubConfig;
7
+ const role_enum_1 = require("../../common/enums/role.enum");
8
+ const meta_helper_1 = require("../../common/helpers/meta.helper");
9
+ const hub_constants_1 = require("./hub.constants");
10
+ const NON_REACHABLE_ENVS = new Set(['ci', 'development', 'e2e', 'local', 'test']);
11
+ function isReachableEnv(env) {
12
+ return !NON_REACHABLE_ENVS.has((env ?? '').toLowerCase());
13
+ }
14
+ function isHubEnabled(config) {
15
+ if (config === true) {
16
+ return true;
17
+ }
18
+ if (config === false || config === undefined || config === null) {
19
+ return false;
20
+ }
21
+ return config.enabled !== false;
22
+ }
23
+ function isHubQueriesEnabled(config) {
24
+ if (!isHubEnabled(config) || typeof config !== 'object') {
25
+ return false;
26
+ }
27
+ return isCollectorEnabled(config.collectors?.queries);
28
+ }
29
+ function normalizeHubConfig(config, ctx) {
30
+ const cfg = typeof config === 'object' && config !== null ? config : {};
31
+ return {
32
+ actions: cfg.actions !== false,
33
+ allowPublicAccessInProduction: cfg.allowPublicAccessInProduction === true,
34
+ collectors: {
35
+ logs: resolveLogsCollector(cfg.collectors?.logs, true),
36
+ queries: resolveQueriesCollector(cfg.collectors?.queries, false),
37
+ traces: resolveTracesCollector(cfg.collectors?.traces, true),
38
+ },
39
+ db: cfg.db === false
40
+ ? false
41
+ : { includeIndexes: typeof cfg.db === 'object' ? cfg.db.includeIndexes === true : false },
42
+ emailPreview: cfg.emailPreview !== false,
43
+ env: ctx.env,
44
+ links: resolveLinks(cfg.links, ctx),
45
+ loginEndpoint: cfg.loginEndpoint ?? '/iam/sign-in/email',
46
+ logoutEndpoint: cfg.logoutEndpoint ?? '/iam/sign-out',
47
+ mailbox: resolveMailbox(cfg.mailbox),
48
+ migrations: resolveMigrations(cfg.migrations),
49
+ path: sanitizePath(cfg.path) || hub_constants_1.HUB_DEFAULT_PATH,
50
+ pollIntervalMs: Math.max(hub_constants_1.HUB_MIN_POLL_INTERVAL_MS, cfg.pollIntervalMs ?? hub_constants_1.HUB_DEFAULT_POLL_INTERVAL_MS),
51
+ roles: resolveRoles(cfg.roles),
52
+ version: ctx.version && ctx.version !== 'unknown' ? ctx.version : (0, meta_helper_1.getVersion)(),
53
+ };
54
+ }
55
+ function isCollectorEnabled(value, defaultOn = false) {
56
+ if (value === undefined) {
57
+ return defaultOn;
58
+ }
59
+ if (typeof value === 'boolean') {
60
+ return value;
61
+ }
62
+ return value.enabled !== false;
63
+ }
64
+ function resolveLinks(links, ctx) {
65
+ const out = {};
66
+ const swagger = links?.swagger;
67
+ if (swagger !== false) {
68
+ out.swagger = typeof swagger === 'string' ? swagger : '/swagger';
69
+ }
70
+ const graphql = links?.graphql;
71
+ if (graphql === false) {
72
+ }
73
+ else if (typeof graphql === 'string') {
74
+ out.graphql = graphql;
75
+ }
76
+ else if (ctx.graphQlEnabled !== false) {
77
+ out.graphql = '/graphql';
78
+ }
79
+ const permissions = links?.permissions;
80
+ if (permissions === false) {
81
+ }
82
+ else if (typeof permissions === 'string') {
83
+ out.permissions = permissions;
84
+ }
85
+ else if (ctx.permissionsPath) {
86
+ out.permissions = '/' + ctx.permissionsPath.replace(/^\/+/, '');
87
+ }
88
+ if (links?.mailpit) {
89
+ out.mailpit = links.mailpit;
90
+ }
91
+ return out;
92
+ }
93
+ function resolveLogsCollector(value, defaultOn) {
94
+ if (!isCollectorEnabled(value, defaultOn)) {
95
+ return false;
96
+ }
97
+ const obj = typeof value === 'object' ? value : {};
98
+ return {
99
+ capacity: obj.capacity ?? hub_constants_1.HUB_DEFAULT_LOG_CAPACITY,
100
+ excludeContexts: obj.excludeContexts ?? [],
101
+ levels: obj.levels ?? ['log', 'warn', 'error', 'fatal'],
102
+ maxMessageLength: obj.maxMessageLength ?? hub_constants_1.HUB_DEFAULT_LOG_MAX_MESSAGE_LENGTH,
103
+ };
104
+ }
105
+ function resolveMailbox(value) {
106
+ if (!isCollectorEnabled(value, false)) {
107
+ return false;
108
+ }
109
+ const obj = typeof value === 'object' ? value : {};
110
+ return {
111
+ capacity: obj.capacity ?? hub_constants_1.HUB_DEFAULT_MAILBOX_CAPACITY,
112
+ maxMailSize: obj.maxMailSize ?? hub_constants_1.HUB_DEFAULT_MAILBOX_MAX_MAIL_SIZE,
113
+ mode: obj.mode === 'copy' ? 'copy' : 'capture',
114
+ };
115
+ }
116
+ function resolveMigrations(value) {
117
+ if (value === false) {
118
+ return false;
119
+ }
120
+ const obj = typeof value === 'object' && value ? value : {};
121
+ return {
122
+ collectionName: obj.collectionName ?? hub_constants_1.HUB_DEFAULT_MIGRATIONS_COLLECTION,
123
+ dir: obj.dir ?? hub_constants_1.HUB_DEFAULT_MIGRATIONS_DIR,
124
+ lockCollectionName: obj.lockCollectionName,
125
+ };
126
+ }
127
+ function resolveQueriesCollector(value, defaultOn) {
128
+ if (!isCollectorEnabled(value, defaultOn)) {
129
+ return false;
130
+ }
131
+ const obj = typeof value === 'object' ? value : {};
132
+ return {
133
+ capacity: obj.capacity ?? hub_constants_1.HUB_DEFAULT_QUERY_CAPACITY,
134
+ criticalMs: obj.criticalMs ?? hub_constants_1.HUB_DEFAULT_QUERY_CRITICAL_MS,
135
+ ignoreCommands: obj.ignoreCommands,
136
+ maxShapeLength: obj.maxShapeLength ?? hub_constants_1.HUB_DEFAULT_QUERY_MAX_SHAPE_LENGTH,
137
+ warnMs: obj.warnMs ?? hub_constants_1.HUB_DEFAULT_QUERY_WARN_MS,
138
+ };
139
+ }
140
+ function resolveRoles(roles) {
141
+ if (roles === false) {
142
+ return false;
143
+ }
144
+ if (roles === undefined) {
145
+ return [role_enum_1.RoleEnum.ADMIN];
146
+ }
147
+ return Array.isArray(roles) ? roles : [roles];
148
+ }
149
+ function resolveTracesCollector(value, defaultOn) {
150
+ if (!isCollectorEnabled(value, defaultOn)) {
151
+ return false;
152
+ }
153
+ const obj = typeof value === 'object' ? value : {};
154
+ return {
155
+ capacity: obj.capacity ?? hub_constants_1.HUB_DEFAULT_TRACE_CAPACITY,
156
+ captureGraphQlOperation: obj.captureGraphQlOperation !== false,
157
+ excludePaths: obj.excludePaths ?? ['/hub'],
158
+ slowMs: obj.slowMs ?? hub_constants_1.HUB_DEFAULT_TRACE_SLOW_MS,
159
+ };
160
+ }
161
+ function sanitizePath(path) {
162
+ return (path ?? '').replace(/^\/+|\/+$/g, '');
163
+ }
164
+ //# sourceMappingURL=hub-config.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-config.helper.js","sourceRoot":"","sources":["../../../../src/core/modules/hub/hub-config.helper.ts"],"names":[],"mappings":";;AA8CA,wCAEC;AAGD,oCAQC;AAGD,kDAKC;AAMD,gDA4BC;AArGD,4DAAwD;AACxD,kEAA8D;AAE9D,mDAgByB;AAwBzB,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAGlF,SAAgB,cAAc,CAAC,GAAuB;IACpD,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC5D,CAAC;AAGD,SAAgB,YAAY,CAAC,MAAwC;IACnE,IA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C,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,yCAAyB;KAChD,CAAC;AACJ,CAAC;AAGD,SAAS,YAAY,CAAC,IAAwB;IAC5C,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAChD,CAAC"}
@@ -0,0 +1,12 @@
1
+ export type HubPanelGroup = 'Overview' | 'Runtime' | 'Data' | 'API & Docs';
2
+ export interface HubPanel {
3
+ readonly group: HubPanelGroup;
4
+ readonly id: string;
5
+ readonly json: string;
6
+ readonly optional?: boolean;
7
+ readonly path: string;
8
+ readonly title: string;
9
+ }
10
+ export declare const HUB_PANELS: readonly HubPanel[];
11
+ export declare const HUB_PANEL_GROUPS: readonly HubPanelGroup[];
12
+ export declare function findHubPanelByPath(subPath: string): HubPanel | undefined;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HUB_PANEL_GROUPS = exports.HUB_PANELS = void 0;
4
+ exports.findHubPanelByPath = findHubPanelByPath;
5
+ exports.HUB_PANELS = [
6
+ { group: 'Overview', id: 'dashboard', json: 'dashboard.json', path: '', title: 'Dashboard' },
7
+ { group: 'Overview', id: 'diagnostics', json: 'diagnostics.json', path: 'diagnostics', title: 'Diagnostics' },
8
+ { group: 'Runtime', id: 'logs', json: 'logs.json', path: 'logs', title: 'Logs' },
9
+ { group: 'Runtime', id: 'traces', json: 'traces.json', path: 'traces', title: 'Request Traces' },
10
+ { group: 'Runtime', id: 'queries', json: 'queries.json', path: 'queries', title: 'Query Performance' },
11
+ { group: 'Runtime', id: 'cron', json: 'cron.json', optional: true, path: 'cron', title: 'Cron Jobs' },
12
+ { group: 'Data', id: 'db', json: 'db.json', path: 'db', title: 'Database' },
13
+ { group: 'Data', id: 'models', json: 'models.json', path: 'models', title: 'Models / ERD' },
14
+ { group: 'Data', id: 'migrations', json: 'migrations.json', path: 'migrations', title: 'Migrations' },
15
+ { group: 'Data', id: 'files', json: 'files.json', path: 'files', title: 'Files' },
16
+ { group: 'Data', id: 'config', json: 'config.json', path: 'config', title: 'Config' },
17
+ {
18
+ group: 'Data',
19
+ id: 'auth-migration',
20
+ json: 'auth-migration.json',
21
+ optional: true,
22
+ path: 'auth-migration',
23
+ title: 'Auth Migration',
24
+ },
25
+ {
26
+ group: 'API & Docs',
27
+ id: 'routes',
28
+ json: 'routes.json',
29
+ optional: true,
30
+ path: 'routes',
31
+ title: 'Routes / Permissions',
32
+ },
33
+ { group: 'API & Docs', id: 'error-codes', json: 'error-codes.json', path: 'error-codes', title: 'Error Codes' },
34
+ { group: 'API & Docs', id: 'emails', json: 'emails.json', path: 'emails', title: 'Email Preview' },
35
+ { group: 'API & Docs', id: 'mailbox', json: 'mailbox.json', optional: true, path: 'mailbox', title: 'Mailbox' },
36
+ { group: 'API & Docs', id: 'ai', json: 'ai.json', optional: true, path: 'ai', title: 'AI' },
37
+ ];
38
+ exports.HUB_PANEL_GROUPS = ['Overview', 'Runtime', 'Data', 'API & Docs'];
39
+ function findHubPanelByPath(subPath) {
40
+ const normalized = subPath.replace(/^\/+|\/+$/g, '');
41
+ return exports.HUB_PANELS.find((panel) => panel.path === normalized);
42
+ }
43
+ //# sourceMappingURL=hub-nav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-nav.js","sourceRoot":"","sources":["../../../../src/core/modules/hub/hub-nav.ts"],"names":[],"mappings":";;;AA8DA,gDAGC;AAxCY,QAAA,UAAU,GAAwB;IAC7C,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE;IAC5F,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC7G,EAAE,KAAK,EA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 -0,0 +1,22 @@
1
+ export interface HubBufferEntry {
2
+ seq: number;
3
+ timestamp: number;
4
+ }
5
+ export declare class HubRingBuffer<T extends HubBufferEntry> {
6
+ readonly capacity: number;
7
+ private minValidSeq;
8
+ private nextSeq;
9
+ private readonly slots;
10
+ constructor(capacity: number);
11
+ get firstRetainedSeq(): number;
12
+ get lastSeq(): number;
13
+ get size(): number;
14
+ private get oldestSeq();
15
+ add(entry: Omit<T, 'seq' | 'timestamp'> & {
16
+ timestamp?: number;
17
+ }): T;
18
+ clear(): void;
19
+ recent(limit?: number): T[];
20
+ since(sinceSeq: number, limit?: number): T[];
21
+ private collect;
22
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HubRingBuffer = void 0;
4
+ class HubRingBuffer {
5
+ capacity;
6
+ minValidSeq = 0;
7
+ nextSeq = 0;
8
+ slots;
9
+ constructor(capacity) {
10
+ this.capacity = Math.max(1, Math.floor(capacity));
11
+ this.slots = Array.from({ length: this.capacity });
12
+ }
13
+ get firstRetainedSeq() {
14
+ return this.size === 0 ? -1 : this.oldestSeq;
15
+ }
16
+ get lastSeq() {
17
+ return this.nextSeq - 1;
18
+ }
19
+ get size() {
20
+ return this.nextSeq - this.oldestSeq;
21
+ }
22
+ get oldestSeq() {
23
+ return Math.max(this.nextSeq - this.capacity, this.minValidSeq);
24
+ }
25
+ add(entry) {
26
+ const full = {
27
+ ...entry,
28
+ seq: this.nextSeq,
29
+ timestamp: entry.timestamp ?? Date.now(),
30
+ };
31
+ this.slots[this.nextSeq % this.capacity] = full;
32
+ this.nextSeq++;
33
+ return full;
34
+ }
35
+ clear() {
36
+ this.slots.fill(undefined);
37
+ this.minValidSeq = this.nextSeq;
38
+ }
39
+ recent(limit = this.capacity) {
40
+ return this.collect(this.nextSeq - Math.max(0, limit));
41
+ }
42
+ since(sinceSeq, limit = this.capacity) {
43
+ const start = Math.max(sinceSeq + 1, this.nextSeq - Math.max(0, limit));
44
+ return this.collect(start);
45
+ }
46
+ collect(startSeq) {
47
+ const from = Math.max(startSeq, this.oldestSeq, 0);
48
+ const result = [];
49
+ for (let seq = from; seq < this.nextSeq; seq++) {
50
+ const entry = this.slots[seq % this.capacity];
51
+ if (entry !== undefined && entry.seq === seq) {
52
+ result.push(entry);
53
+ }
54
+ }
55
+ return result;
56
+ }
57
+ }
58
+ exports.HubRingBuffer = HubRingBuffer;
59
+ //# sourceMappingURL=hub-ring-buffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-ring-buffer.js","sourceRoot":"","sources":["../../../../src/core/modules/hub/hub-ring-buffer.ts"],"names":[],"mappings":";;;AAuBA,MAAa,aAAa;IAER,QAAQ,CAAS;IAGzB,WAAW,GAAG,CAAC,CAAC;IAChB,OAAO,GAAG,CAAC,CAAC;IACH,KAAK,CAAoB;IAE1C,YAAY,QAAgB;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAgB,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACpE,CAAC;IAGD,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;IAC/C,CAAC;IAGD,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IAC1B,CAAC;IAGD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC;IACvC,CAAC;IAGD,IAAY,SAAS;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW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