@marinoscar/platform-api 0.0.0-stage → 0.1.0-next.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 (616) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/LICENSE +21 -0
  3. package/README.md +106 -2
  4. package/dist/core/crypto/encryption-key-startup-check.d.ts +29 -0
  5. package/dist/core/crypto/encryption-key-startup-check.d.ts.map +1 -0
  6. package/dist/core/crypto/encryption-key-startup-check.js +221 -0
  7. package/dist/core/crypto/encryption-key-startup-check.js.map +1 -0
  8. package/dist/core/crypto/secret-cipher.d.ts +151 -0
  9. package/dist/core/crypto/secret-cipher.d.ts.map +1 -0
  10. package/dist/core/crypto/secret-cipher.js +452 -0
  11. package/dist/core/crypto/secret-cipher.js.map +1 -0
  12. package/dist/core/data-access/index.d.ts +6 -0
  13. package/dist/core/data-access/index.d.ts.map +1 -0
  14. package/dist/core/data-access/index.js +19 -0
  15. package/dist/core/data-access/index.js.map +1 -0
  16. package/dist/core/data-access/scoped-access.error.d.ts +35 -0
  17. package/dist/core/data-access/scoped-access.error.d.ts.map +1 -0
  18. package/dist/core/data-access/scoped-access.error.js +43 -0
  19. package/dist/core/data-access/scoped-access.error.js.map +1 -0
  20. package/dist/core/data-access/scoped-client.d.ts +104 -0
  21. package/dist/core/data-access/scoped-client.d.ts.map +1 -0
  22. package/dist/core/data-access/scoped-client.js +270 -0
  23. package/dist/core/data-access/scoped-client.js.map +1 -0
  24. package/dist/core/data-access/types.d.ts +85 -0
  25. package/dist/core/data-access/types.d.ts.map +1 -0
  26. package/dist/core/data-access/types.js +12 -0
  27. package/dist/core/data-access/types.js.map +1 -0
  28. package/dist/core/data-access/user-owned-data.registry.d.ts +60 -0
  29. package/dist/core/data-access/user-owned-data.registry.d.ts.map +1 -0
  30. package/dist/core/data-access/user-owned-data.registry.js +140 -0
  31. package/dist/core/data-access/user-owned-data.registry.js.map +1 -0
  32. package/dist/core/errors/database-seed.exception.d.ts +23 -0
  33. package/dist/core/errors/database-seed.exception.d.ts.map +1 -0
  34. package/dist/core/errors/database-seed.exception.js +49 -0
  35. package/dist/core/errors/database-seed.exception.js.map +1 -0
  36. package/dist/core/errors/error.dto.d.ts +47 -0
  37. package/dist/core/errors/error.dto.d.ts.map +1 -0
  38. package/dist/core/errors/error.dto.js +121 -0
  39. package/dist/core/errors/error.dto.js.map +1 -0
  40. package/dist/core/errors/http-exception.filter.d.ts +63 -0
  41. package/dist/core/errors/http-exception.filter.d.ts.map +1 -0
  42. package/dist/core/errors/http-exception.filter.js +234 -0
  43. package/dist/core/errors/http-exception.filter.js.map +1 -0
  44. package/dist/core/errors/verbatim-error-body.exception.d.ts +46 -0
  45. package/dist/core/errors/verbatim-error-body.exception.d.ts.map +1 -0
  46. package/dist/core/errors/verbatim-error-body.exception.js +135 -0
  47. package/dist/core/errors/verbatim-error-body.exception.js.map +1 -0
  48. package/dist/core/host/index.d.ts +7 -0
  49. package/dist/core/host/index.d.ts.map +1 -0
  50. package/dist/core/host/index.js +14 -0
  51. package/dist/core/host/index.js.map +1 -0
  52. package/dist/core/host/platform-host.d.ts +58 -0
  53. package/dist/core/host/platform-host.d.ts.map +1 -0
  54. package/dist/core/host/platform-host.js +104 -0
  55. package/dist/core/host/platform-host.js.map +1 -0
  56. package/dist/core/host/platform-host.module.d.ts +53 -0
  57. package/dist/core/host/platform-host.module.d.ts.map +1 -0
  58. package/dist/core/host/platform-host.module.js +90 -0
  59. package/dist/core/host/platform-host.module.js.map +1 -0
  60. package/dist/core/host/ports.d.ts +132 -0
  61. package/dist/core/host/ports.d.ts.map +1 -0
  62. package/dist/core/host/ports.js +48 -0
  63. package/dist/core/host/ports.js.map +1 -0
  64. package/dist/core/index.d.ts +15 -0
  65. package/dist/core/index.d.ts.map +1 -0
  66. package/dist/core/index.js +77 -0
  67. package/dist/core/index.js.map +1 -0
  68. package/dist/core/openapi/openapi-tag.registry.d.ts +80 -0
  69. package/dist/core/openapi/openapi-tag.registry.d.ts.map +1 -0
  70. package/dist/core/openapi/openapi-tag.registry.js +72 -0
  71. package/dist/core/openapi/openapi-tag.registry.js.map +1 -0
  72. package/dist/core/principal/index.d.ts +6 -0
  73. package/dist/core/principal/index.d.ts.map +1 -0
  74. package/dist/core/principal/index.js +3 -0
  75. package/dist/core/principal/index.js.map +1 -0
  76. package/dist/core/principal/principal.types.d.ts +222 -0
  77. package/dist/core/principal/principal.types.d.ts.map +1 -0
  78. package/dist/core/principal/principal.types.js +22 -0
  79. package/dist/core/principal/principal.types.js.map +1 -0
  80. package/dist/core/registry/index.d.ts +4 -0
  81. package/dist/core/registry/index.d.ts.map +1 -0
  82. package/dist/core/registry/index.js +19 -0
  83. package/dist/core/registry/index.js.map +1 -0
  84. package/dist/core/registry/registry-freeze.service.d.ts +14 -0
  85. package/dist/core/registry/registry-freeze.service.d.ts.map +1 -0
  86. package/dist/core/registry/registry-freeze.service.js +55 -0
  87. package/dist/core/registry/registry-freeze.service.js.map +1 -0
  88. package/dist/core/registry/registry.d.ts +268 -0
  89. package/dist/core/registry/registry.d.ts.map +1 -0
  90. package/dist/core/registry/registry.js +351 -0
  91. package/dist/core/registry/registry.js.map +1 -0
  92. package/dist/core/registry/testing.d.ts +29 -0
  93. package/dist/core/registry/testing.d.ts.map +1 -0
  94. package/dist/core/registry/testing.js +63 -0
  95. package/dist/core/registry/testing.js.map +1 -0
  96. package/dist/doctor/doctor-check.interface.d.ts +100 -0
  97. package/dist/doctor/doctor-check.interface.d.ts.map +1 -0
  98. package/dist/doctor/doctor-check.interface.js +95 -0
  99. package/dist/doctor/doctor-check.interface.js.map +1 -0
  100. package/dist/doctor/doctor-check.registry.d.ts +37 -0
  101. package/dist/doctor/doctor-check.registry.d.ts.map +1 -0
  102. package/dist/doctor/doctor-check.registry.js +96 -0
  103. package/dist/doctor/doctor-check.registry.js.map +1 -0
  104. package/dist/doctor/doctor.controller.factory.d.ts +29 -0
  105. package/dist/doctor/doctor.controller.factory.d.ts.map +1 -0
  106. package/dist/doctor/doctor.controller.factory.js +121 -0
  107. package/dist/doctor/doctor.controller.factory.js.map +1 -0
  108. package/dist/doctor/doctor.module.d.ts +78 -0
  109. package/dist/doctor/doctor.module.d.ts.map +1 -0
  110. package/dist/doctor/doctor.module.js +158 -0
  111. package/dist/doctor/doctor.module.js.map +1 -0
  112. package/dist/doctor/doctor.options.d.ts +39 -0
  113. package/dist/doctor/doctor.options.d.ts.map +1 -0
  114. package/dist/doctor/doctor.options.js +21 -0
  115. package/dist/doctor/doctor.options.js.map +1 -0
  116. package/dist/doctor/doctor.service.d.ts +80 -0
  117. package/dist/doctor/doctor.service.d.ts.map +1 -0
  118. package/dist/doctor/doctor.service.js +301 -0
  119. package/dist/doctor/doctor.service.js.map +1 -0
  120. package/dist/doctor/dto/doctor-query.dto.d.ts +15 -0
  121. package/dist/doctor/dto/doctor-query.dto.d.ts.map +1 -0
  122. package/dist/doctor/dto/doctor-query.dto.js +16 -0
  123. package/dist/doctor/dto/doctor-query.dto.js.map +1 -0
  124. package/dist/doctor/dto/doctor-report.dto.d.ts +27 -0
  125. package/dist/doctor/dto/doctor-report.dto.d.ts.map +1 -0
  126. package/dist/doctor/dto/doctor-report.dto.js +23 -0
  127. package/dist/doctor/dto/doctor-report.dto.js.map +1 -0
  128. package/dist/doctor/egress/classify-host.d.ts +73 -0
  129. package/dist/doctor/egress/classify-host.d.ts.map +1 -0
  130. package/dist/doctor/egress/classify-host.js +210 -0
  131. package/dist/doctor/egress/classify-host.js.map +1 -0
  132. package/dist/doctor/egress/egress.registry.d.ts +34 -0
  133. package/dist/doctor/egress/egress.registry.d.ts.map +1 -0
  134. package/dist/doctor/egress/egress.registry.js +70 -0
  135. package/dist/doctor/egress/egress.registry.js.map +1 -0
  136. package/dist/doctor/egress/egress.types.d.ts +135 -0
  137. package/dist/doctor/egress/egress.types.d.ts.map +1 -0
  138. package/dist/doctor/egress/egress.types.js +42 -0
  139. package/dist/doctor/egress/egress.types.js.map +1 -0
  140. package/dist/doctor/egress/index.d.ts +6 -0
  141. package/dist/doctor/egress/index.d.ts.map +1 -0
  142. package/dist/doctor/egress/index.js +23 -0
  143. package/dist/doctor/egress/index.js.map +1 -0
  144. package/dist/doctor/egress/network-egress.doctor-check.d.ts +78 -0
  145. package/dist/doctor/egress/network-egress.doctor-check.d.ts.map +1 -0
  146. package/dist/doctor/egress/network-egress.doctor-check.js +226 -0
  147. package/dist/doctor/egress/network-egress.doctor-check.js.map +1 -0
  148. package/dist/doctor/index.d.ts +19 -0
  149. package/dist/doctor/index.d.ts.map +1 -0
  150. package/dist/doctor/index.js +66 -0
  151. package/dist/doctor/index.js.map +1 -0
  152. package/dist/doctor/support-bundle/index.d.ts +12 -0
  153. package/dist/doctor/support-bundle/index.d.ts.map +1 -0
  154. package/dist/doctor/support-bundle/index.js +32 -0
  155. package/dist/doctor/support-bundle/index.js.map +1 -0
  156. package/dist/doctor/support-bundle/redact.d.ts +76 -0
  157. package/dist/doctor/support-bundle/redact.d.ts.map +1 -0
  158. package/dist/doctor/support-bundle/redact.js +236 -0
  159. package/dist/doctor/support-bundle/redact.js.map +1 -0
  160. package/dist/doctor/support-bundle/sections/doctor.section.d.ts +81 -0
  161. package/dist/doctor/support-bundle/sections/doctor.section.d.ts.map +1 -0
  162. package/dist/doctor/support-bundle/sections/doctor.section.js +83 -0
  163. package/dist/doctor/support-bundle/sections/doctor.section.js.map +1 -0
  164. package/dist/doctor/support-bundle/sections/egress.section.d.ts +73 -0
  165. package/dist/doctor/support-bundle/sections/egress.section.d.ts.map +1 -0
  166. package/dist/doctor/support-bundle/sections/egress.section.js +97 -0
  167. package/dist/doctor/support-bundle/sections/egress.section.js.map +1 -0
  168. package/dist/doctor/support-bundle/sections/meta.section.d.ts +39 -0
  169. package/dist/doctor/support-bundle/sections/meta.section.d.ts.map +1 -0
  170. package/dist/doctor/support-bundle/sections/meta.section.js +89 -0
  171. package/dist/doctor/support-bundle/sections/meta.section.js.map +1 -0
  172. package/dist/doctor/support-bundle/support-bundle-section.interface.d.ts +100 -0
  173. package/dist/doctor/support-bundle/support-bundle-section.interface.d.ts.map +1 -0
  174. package/dist/doctor/support-bundle/support-bundle-section.interface.js +59 -0
  175. package/dist/doctor/support-bundle/support-bundle-section.interface.js.map +1 -0
  176. package/dist/doctor/support-bundle/support-bundle.controller.d.ts +57 -0
  177. package/dist/doctor/support-bundle/support-bundle.controller.d.ts.map +1 -0
  178. package/dist/doctor/support-bundle/support-bundle.controller.js +141 -0
  179. package/dist/doctor/support-bundle/support-bundle.controller.js.map +1 -0
  180. package/dist/doctor/support-bundle/support-bundle.options.d.ts +92 -0
  181. package/dist/doctor/support-bundle/support-bundle.options.d.ts.map +1 -0
  182. package/dist/doctor/support-bundle/support-bundle.options.js +100 -0
  183. package/dist/doctor/support-bundle/support-bundle.options.js.map +1 -0
  184. package/dist/doctor/support-bundle/support-bundle.registry.d.ts +38 -0
  185. package/dist/doctor/support-bundle/support-bundle.registry.d.ts.map +1 -0
  186. package/dist/doctor/support-bundle/support-bundle.registry.js +90 -0
  187. package/dist/doctor/support-bundle/support-bundle.registry.js.map +1 -0
  188. package/dist/doctor/support-bundle/support-bundle.service.d.ts +63 -0
  189. package/dist/doctor/support-bundle/support-bundle.service.d.ts.map +1 -0
  190. package/dist/doctor/support-bundle/support-bundle.service.js +244 -0
  191. package/dist/doctor/support-bundle/support-bundle.service.js.map +1 -0
  192. package/dist/index.d.ts +11 -0
  193. package/dist/index.d.ts.map +1 -0
  194. package/dist/index.js +14 -0
  195. package/dist/index.js.map +1 -0
  196. package/dist/otel-core/index.d.ts +9 -0
  197. package/dist/otel-core/index.d.ts.map +1 -0
  198. package/dist/otel-core/index.js +58 -0
  199. package/dist/otel-core/index.js.map +1 -0
  200. package/dist/otel-core/metrics/gauge-provider.d.ts +44 -0
  201. package/dist/otel-core/metrics/gauge-provider.d.ts.map +1 -0
  202. package/dist/otel-core/metrics/gauge-provider.js +37 -0
  203. package/dist/otel-core/metrics/gauge-provider.js.map +1 -0
  204. package/dist/otel-core/metrics/labels.d.ts +79 -0
  205. package/dist/otel-core/metrics/labels.d.ts.map +1 -0
  206. package/dist/otel-core/metrics/labels.js +135 -0
  207. package/dist/otel-core/metrics/labels.js.map +1 -0
  208. package/dist/otel-core/metrics/metric-name.registry.d.ts +130 -0
  209. package/dist/otel-core/metrics/metric-name.registry.d.ts.map +1 -0
  210. package/dist/otel-core/metrics/metric-name.registry.js +134 -0
  211. package/dist/otel-core/metrics/metric-name.registry.js.map +1 -0
  212. package/dist/otel-core/metrics/metrics-host.service.d.ts +163 -0
  213. package/dist/otel-core/metrics/metrics-host.service.d.ts.map +1 -0
  214. package/dist/otel-core/metrics/metrics-host.service.js +344 -0
  215. package/dist/otel-core/metrics/metrics-host.service.js.map +1 -0
  216. package/dist/otel-core/metrics/otel-metrics.module.d.ts +54 -0
  217. package/dist/otel-core/metrics/otel-metrics.module.d.ts.map +1 -0
  218. package/dist/otel-core/metrics/otel-metrics.module.js +83 -0
  219. package/dist/otel-core/metrics/otel-metrics.module.js.map +1 -0
  220. package/dist/otel-core/sdk/index.d.ts +5 -0
  221. package/dist/otel-core/sdk/index.d.ts.map +1 -0
  222. package/dist/otel-core/sdk/index.js +27 -0
  223. package/dist/otel-core/sdk/index.js.map +1 -0
  224. package/dist/otel-core/sdk/initialize-otel.d.ts +126 -0
  225. package/dist/otel-core/sdk/initialize-otel.d.ts.map +1 -0
  226. package/dist/otel-core/sdk/initialize-otel.js +204 -0
  227. package/dist/otel-core/sdk/initialize-otel.js.map +1 -0
  228. package/dist/otel-core/sdk/instance-id.d.ts +29 -0
  229. package/dist/otel-core/sdk/instance-id.d.ts.map +1 -0
  230. package/dist/otel-core/sdk/instance-id.js +65 -0
  231. package/dist/otel-core/sdk/instance-id.js.map +1 -0
  232. package/dist/otel-core/sdk/service-name.d.ts +28 -0
  233. package/dist/otel-core/sdk/service-name.d.ts.map +1 -0
  234. package/dist/otel-core/sdk/service-name.js +63 -0
  235. package/dist/otel-core/sdk/service-name.js.map +1 -0
  236. package/dist/otel-core/sdk/telemetry-gate.d.ts +116 -0
  237. package/dist/otel-core/sdk/telemetry-gate.d.ts.map +1 -0
  238. package/dist/otel-core/sdk/telemetry-gate.js +297 -0
  239. package/dist/otel-core/sdk/telemetry-gate.js.map +1 -0
  240. package/dist/otel-core/spans/request-span-attributes.d.ts +58 -0
  241. package/dist/otel-core/spans/request-span-attributes.d.ts.map +1 -0
  242. package/dist/otel-core/spans/request-span-attributes.js +155 -0
  243. package/dist/otel-core/spans/request-span-attributes.js.map +1 -0
  244. package/dist/otel-core/spans/trace.decorator.d.ts +36 -0
  245. package/dist/otel-core/spans/trace.decorator.d.ts.map +1 -0
  246. package/dist/otel-core/spans/trace.decorator.js +74 -0
  247. package/dist/otel-core/spans/trace.decorator.js.map +1 -0
  248. package/dist/telemetry/assistant/telemetry-ai-enabled.guard.d.ts +15 -0
  249. package/dist/telemetry/assistant/telemetry-ai-enabled.guard.d.ts.map +1 -0
  250. package/dist/telemetry/assistant/telemetry-ai-enabled.guard.js +50 -0
  251. package/dist/telemetry/assistant/telemetry-ai-enabled.guard.js.map +1 -0
  252. package/dist/telemetry/assistant/telemetry-assistant.controller.d.ts +14 -0
  253. package/dist/telemetry/assistant/telemetry-assistant.controller.d.ts.map +1 -0
  254. package/dist/telemetry/assistant/telemetry-assistant.controller.js +178 -0
  255. package/dist/telemetry/assistant/telemetry-assistant.controller.js.map +1 -0
  256. package/dist/telemetry/assistant/telemetry-assistant.metrics.d.ts +147 -0
  257. package/dist/telemetry/assistant/telemetry-assistant.metrics.d.ts.map +1 -0
  258. package/dist/telemetry/assistant/telemetry-assistant.metrics.js +495 -0
  259. package/dist/telemetry/assistant/telemetry-assistant.metrics.js.map +1 -0
  260. package/dist/telemetry/assistant/telemetry-assistant.service.d.ts +216 -0
  261. package/dist/telemetry/assistant/telemetry-assistant.service.d.ts.map +1 -0
  262. package/dist/telemetry/assistant/telemetry-assistant.service.js +1256 -0
  263. package/dist/telemetry/assistant/telemetry-assistant.service.js.map +1 -0
  264. package/dist/telemetry/assistant/telemetry-assistant.sql.d.ts +69 -0
  265. package/dist/telemetry/assistant/telemetry-assistant.sql.d.ts.map +1 -0
  266. package/dist/telemetry/assistant/telemetry-assistant.sql.js +471 -0
  267. package/dist/telemetry/assistant/telemetry-assistant.sql.js.map +1 -0
  268. package/dist/telemetry/assistant/telemetry-assistant.sse.d.ts +15 -0
  269. package/dist/telemetry/assistant/telemetry-assistant.sse.d.ts.map +1 -0
  270. package/dist/telemetry/assistant/telemetry-assistant.sse.js +68 -0
  271. package/dist/telemetry/assistant/telemetry-assistant.sse.js.map +1 -0
  272. package/dist/telemetry/connection/dto/telemetry-connection.dto.d.ts +92 -0
  273. package/dist/telemetry/connection/dto/telemetry-connection.dto.d.ts.map +1 -0
  274. package/dist/telemetry/connection/dto/telemetry-connection.dto.js +41 -0
  275. package/dist/telemetry/connection/dto/telemetry-connection.dto.js.map +1 -0
  276. package/dist/telemetry/connection/telemetry-connection-admin.service.d.ts +45 -0
  277. package/dist/telemetry/connection/telemetry-connection-admin.service.d.ts.map +1 -0
  278. package/dist/telemetry/connection/telemetry-connection-admin.service.js +303 -0
  279. package/dist/telemetry/connection/telemetry-connection-admin.service.js.map +1 -0
  280. package/dist/telemetry/connection/telemetry-connection-test.service.d.ts +41 -0
  281. package/dist/telemetry/connection/telemetry-connection-test.service.d.ts.map +1 -0
  282. package/dist/telemetry/connection/telemetry-connection-test.service.js +187 -0
  283. package/dist/telemetry/connection/telemetry-connection-test.service.js.map +1 -0
  284. package/dist/telemetry/connection/telemetry-connection.controller.d.ts +14 -0
  285. package/dist/telemetry/connection/telemetry-connection.controller.d.ts.map +1 -0
  286. package/dist/telemetry/connection/telemetry-connection.controller.js +192 -0
  287. package/dist/telemetry/connection/telemetry-connection.controller.js.map +1 -0
  288. package/dist/telemetry/connection/telemetry-connection.schema.d.ts +28 -0
  289. package/dist/telemetry/connection/telemetry-connection.schema.d.ts.map +1 -0
  290. package/dist/telemetry/connection/telemetry-connection.schema.js +106 -0
  291. package/dist/telemetry/connection/telemetry-connection.schema.js.map +1 -0
  292. package/dist/telemetry/connection/telemetry-connection.service.d.ts +197 -0
  293. package/dist/telemetry/connection/telemetry-connection.service.d.ts.map +1 -0
  294. package/dist/telemetry/connection/telemetry-connection.service.js +461 -0
  295. package/dist/telemetry/connection/telemetry-connection.service.js.map +1 -0
  296. package/dist/telemetry/dashboard/sql-literals.d.ts +19 -0
  297. package/dist/telemetry/dashboard/sql-literals.d.ts.map +1 -0
  298. package/dist/telemetry/dashboard/sql-literals.js +75 -0
  299. package/dist/telemetry/dashboard/sql-literals.js.map +1 -0
  300. package/dist/telemetry/dashboard/telemetry-dashboard.controller.d.ts +14 -0
  301. package/dist/telemetry/dashboard/telemetry-dashboard.controller.d.ts.map +1 -0
  302. package/dist/telemetry/dashboard/telemetry-dashboard.controller.js +277 -0
  303. package/dist/telemetry/dashboard/telemetry-dashboard.controller.js.map +1 -0
  304. package/dist/telemetry/dashboard/telemetry-dashboard.service.d.ts +112 -0
  305. package/dist/telemetry/dashboard/telemetry-dashboard.service.d.ts.map +1 -0
  306. package/dist/telemetry/dashboard/telemetry-dashboard.service.js +904 -0
  307. package/dist/telemetry/dashboard/telemetry-dashboard.service.js.map +1 -0
  308. package/dist/telemetry/dashboard/telemetry-dashboard.sql.d.ts +212 -0
  309. package/dist/telemetry/dashboard/telemetry-dashboard.sql.d.ts.map +1 -0
  310. package/dist/telemetry/dashboard/telemetry-dashboard.sql.js +486 -0
  311. package/dist/telemetry/dashboard/telemetry-dashboard.sql.js.map +1 -0
  312. package/dist/telemetry/dashboard/telemetry-dashboard.verdict.d.ts +235 -0
  313. package/dist/telemetry/dashboard/telemetry-dashboard.verdict.d.ts.map +1 -0
  314. package/dist/telemetry/dashboard/telemetry-dashboard.verdict.js +269 -0
  315. package/dist/telemetry/dashboard/telemetry-dashboard.verdict.js.map +1 -0
  316. package/dist/telemetry/dashboard/verdict-policy.d.ts +51 -0
  317. package/dist/telemetry/dashboard/verdict-policy.d.ts.map +1 -0
  318. package/dist/telemetry/dashboard/verdict-policy.js +77 -0
  319. package/dist/telemetry/dashboard/verdict-policy.js.map +1 -0
  320. package/dist/telemetry/doctor/egress/greptimedb.egress.contributor.d.ts +21 -0
  321. package/dist/telemetry/doctor/egress/greptimedb.egress.contributor.d.ts.map +1 -0
  322. package/dist/telemetry/doctor/egress/greptimedb.egress.contributor.js +59 -0
  323. package/dist/telemetry/doctor/egress/greptimedb.egress.contributor.js.map +1 -0
  324. package/dist/telemetry/doctor/telemetry-connection.doctor-check.d.ts +23 -0
  325. package/dist/telemetry/doctor/telemetry-connection.doctor-check.d.ts.map +1 -0
  326. package/dist/telemetry/doctor/telemetry-connection.doctor-check.js +69 -0
  327. package/dist/telemetry/doctor/telemetry-connection.doctor-check.js.map +1 -0
  328. package/dist/telemetry/doctor/telemetry-export.doctor-check.d.ts +33 -0
  329. package/dist/telemetry/doctor/telemetry-export.doctor-check.d.ts.map +1 -0
  330. package/dist/telemetry/doctor/telemetry-export.doctor-check.js +105 -0
  331. package/dist/telemetry/doctor/telemetry-export.doctor-check.js.map +1 -0
  332. package/dist/telemetry/doctor/telemetry-freshness.doctor-check.d.ts +38 -0
  333. package/dist/telemetry/doctor/telemetry-freshness.doctor-check.d.ts.map +1 -0
  334. package/dist/telemetry/doctor/telemetry-freshness.doctor-check.js +104 -0
  335. package/dist/telemetry/doctor/telemetry-freshness.doctor-check.js.map +1 -0
  336. package/dist/telemetry/doctor/telemetry-reachable.doctor-check.d.ts +23 -0
  337. package/dist/telemetry/doctor/telemetry-reachable.doctor-check.d.ts.map +1 -0
  338. package/dist/telemetry/doctor/telemetry-reachable.doctor-check.js +65 -0
  339. package/dist/telemetry/doctor/telemetry-reachable.doctor-check.js.map +1 -0
  340. package/dist/telemetry/doctor/telemetry-tables.doctor-check.d.ts +23 -0
  341. package/dist/telemetry/doctor/telemetry-tables.doctor-check.d.ts.map +1 -0
  342. package/dist/telemetry/doctor/telemetry-tables.doctor-check.js +91 -0
  343. package/dist/telemetry/doctor/telemetry-tables.doctor-check.js.map +1 -0
  344. package/dist/telemetry/dto/telemetry-assistant.dto.d.ts +14 -0
  345. package/dist/telemetry/dto/telemetry-assistant.dto.d.ts.map +1 -0
  346. package/dist/telemetry/dto/telemetry-assistant.dto.js +29 -0
  347. package/dist/telemetry/dto/telemetry-assistant.dto.js.map +1 -0
  348. package/dist/telemetry/dto/telemetry-config.dto.d.ts +59 -0
  349. package/dist/telemetry/dto/telemetry-config.dto.d.ts.map +1 -0
  350. package/dist/telemetry/dto/telemetry-config.dto.js +18 -0
  351. package/dist/telemetry/dto/telemetry-config.dto.js.map +1 -0
  352. package/dist/telemetry/dto/telemetry-dashboard.dto.d.ts +397 -0
  353. package/dist/telemetry/dto/telemetry-dashboard.dto.d.ts.map +1 -0
  354. package/dist/telemetry/dto/telemetry-dashboard.dto.js +118 -0
  355. package/dist/telemetry/dto/telemetry-dashboard.dto.js.map +1 -0
  356. package/dist/telemetry/dto/telemetry-query.dto.d.ts +44 -0
  357. package/dist/telemetry/dto/telemetry-query.dto.d.ts.map +1 -0
  358. package/dist/telemetry/dto/telemetry-query.dto.js +42 -0
  359. package/dist/telemetry/dto/telemetry-query.dto.js.map +1 -0
  360. package/dist/telemetry/dto/telemetry-status.dto.d.ts +22 -0
  361. package/dist/telemetry/dto/telemetry-status.dto.d.ts.map +1 -0
  362. package/dist/telemetry/dto/telemetry-status.dto.js +12 -0
  363. package/dist/telemetry/dto/telemetry-status.dto.js.map +1 -0
  364. package/dist/telemetry/export/parquet-writer.loader.d.ts +13 -0
  365. package/dist/telemetry/export/parquet-writer.loader.d.ts.map +1 -0
  366. package/dist/telemetry/export/parquet-writer.loader.js +29 -0
  367. package/dist/telemetry/export/parquet-writer.loader.js.map +1 -0
  368. package/dist/telemetry/export/telemetry-export.service.d.ts +39 -0
  369. package/dist/telemetry/export/telemetry-export.service.d.ts.map +1 -0
  370. package/dist/telemetry/export/telemetry-export.service.js +185 -0
  371. package/dist/telemetry/export/telemetry-export.service.js.map +1 -0
  372. package/dist/telemetry/greptime/greptime-host.d.ts +44 -0
  373. package/dist/telemetry/greptime/greptime-host.d.ts.map +1 -0
  374. package/dist/telemetry/greptime/greptime-host.js +114 -0
  375. package/dist/telemetry/greptime/greptime-host.js.map +1 -0
  376. package/dist/telemetry/greptime/greptime.client.d.ts +171 -0
  377. package/dist/telemetry/greptime/greptime.client.d.ts.map +1 -0
  378. package/dist/telemetry/greptime/greptime.client.js +352 -0
  379. package/dist/telemetry/greptime/greptime.client.js.map +1 -0
  380. package/dist/telemetry/greptime/greptime.errors.d.ts +59 -0
  381. package/dist/telemetry/greptime/greptime.errors.d.ts.map +1 -0
  382. package/dist/telemetry/greptime/greptime.errors.js +100 -0
  383. package/dist/telemetry/greptime/greptime.errors.js.map +1 -0
  384. package/dist/telemetry/handlers/telemetry-retention.handler.d.ts +27 -0
  385. package/dist/telemetry/handlers/telemetry-retention.handler.d.ts.map +1 -0
  386. package/dist/telemetry/handlers/telemetry-retention.handler.js +123 -0
  387. package/dist/telemetry/handlers/telemetry-retention.handler.js.map +1 -0
  388. package/dist/telemetry/index.d.ts +37 -0
  389. package/dist/telemetry/index.d.ts.map +1 -0
  390. package/dist/telemetry/index.js +97 -0
  391. package/dist/telemetry/index.js.map +1 -0
  392. package/dist/telemetry/internal/blank-secret.d.ts +3 -0
  393. package/dist/telemetry/internal/blank-secret.d.ts.map +1 -0
  394. package/dist/telemetry/internal/blank-secret.js +14 -0
  395. package/dist/telemetry/internal/blank-secret.js.map +1 -0
  396. package/dist/telemetry/internal/csv.d.ts +9 -0
  397. package/dist/telemetry/internal/csv.d.ts.map +1 -0
  398. package/dist/telemetry/internal/csv.js +23 -0
  399. package/dist/telemetry/internal/csv.js.map +1 -0
  400. package/dist/telemetry/internal/sse.d.ts +23 -0
  401. package/dist/telemetry/internal/sse.d.ts.map +1 -0
  402. package/dist/telemetry/internal/sse.js +43 -0
  403. package/dist/telemetry/internal/sse.js.map +1 -0
  404. package/dist/telemetry/metrics/groups/database.metric-group.d.ts +7 -0
  405. package/dist/telemetry/metrics/groups/database.metric-group.d.ts.map +1 -0
  406. package/dist/telemetry/metrics/groups/database.metric-group.js +159 -0
  407. package/dist/telemetry/metrics/groups/database.metric-group.js.map +1 -0
  408. package/dist/telemetry/metrics/groups/host.metric-group.d.ts +7 -0
  409. package/dist/telemetry/metrics/groups/host.metric-group.d.ts.map +1 -0
  410. package/dist/telemetry/metrics/groups/host.metric-group.js +146 -0
  411. package/dist/telemetry/metrics/groups/host.metric-group.js.map +1 -0
  412. package/dist/telemetry/metrics/groups/nodes.metric-group.d.ts +7 -0
  413. package/dist/telemetry/metrics/groups/nodes.metric-group.d.ts.map +1 -0
  414. package/dist/telemetry/metrics/groups/nodes.metric-group.js +159 -0
  415. package/dist/telemetry/metrics/groups/nodes.metric-group.js.map +1 -0
  416. package/dist/telemetry/metrics/groups/pipeline.metric-group.d.ts +7 -0
  417. package/dist/telemetry/metrics/groups/pipeline.metric-group.d.ts.map +1 -0
  418. package/dist/telemetry/metrics/groups/pipeline.metric-group.js +144 -0
  419. package/dist/telemetry/metrics/groups/pipeline.metric-group.js.map +1 -0
  420. package/dist/telemetry/metrics/groups/queue.metric-group.d.ts +7 -0
  421. package/dist/telemetry/metrics/groups/queue.metric-group.d.ts.map +1 -0
  422. package/dist/telemetry/metrics/groups/queue.metric-group.js +163 -0
  423. package/dist/telemetry/metrics/groups/queue.metric-group.js.map +1 -0
  424. package/dist/telemetry/metrics/groups/uptime.metric-group.d.ts +7 -0
  425. package/dist/telemetry/metrics/groups/uptime.metric-group.d.ts.map +1 -0
  426. package/dist/telemetry/metrics/groups/uptime.metric-group.js +103 -0
  427. package/dist/telemetry/metrics/groups/uptime.metric-group.js.map +1 -0
  428. package/dist/telemetry/metrics/metric-catalog.d.ts +324 -0
  429. package/dist/telemetry/metrics/metric-catalog.d.ts.map +1 -0
  430. package/dist/telemetry/metrics/metric-catalog.helpers.d.ts +30 -0
  431. package/dist/telemetry/metrics/metric-catalog.helpers.d.ts.map +1 -0
  432. package/dist/telemetry/metrics/metric-catalog.helpers.js +37 -0
  433. package/dist/telemetry/metrics/metric-catalog.helpers.js.map +1 -0
  434. package/dist/telemetry/metrics/metric-catalog.js +180 -0
  435. package/dist/telemetry/metrics/metric-catalog.js.map +1 -0
  436. package/dist/telemetry/metrics/metric-group-registry.service.d.ts +59 -0
  437. package/dist/telemetry/metrics/metric-group-registry.service.d.ts.map +1 -0
  438. package/dist/telemetry/metrics/metric-group-registry.service.js +99 -0
  439. package/dist/telemetry/metrics/metric-group-registry.service.js.map +1 -0
  440. package/dist/telemetry/metrics/metric-group.d.ts +113 -0
  441. package/dist/telemetry/metrics/metric-group.d.ts.map +1 -0
  442. package/dist/telemetry/metrics/metric-group.js +647 -0
  443. package/dist/telemetry/metrics/metric-group.js.map +1 -0
  444. package/dist/telemetry/metrics/metric-group.manifest.d.ts +2 -0
  445. package/dist/telemetry/metrics/metric-group.manifest.d.ts.map +1 -0
  446. package/dist/telemetry/metrics/metric-group.manifest.js +30 -0
  447. package/dist/telemetry/metrics/metric-group.manifest.js.map +1 -0
  448. package/dist/telemetry/metrics/metric-group.registry.d.ts +109 -0
  449. package/dist/telemetry/metrics/metric-group.registry.d.ts.map +1 -0
  450. package/dist/telemetry/metrics/metric-group.registry.js +181 -0
  451. package/dist/telemetry/metrics/metric-group.registry.js.map +1 -0
  452. package/dist/telemetry/metrics/metric-sql.d.ts +98 -0
  453. package/dist/telemetry/metrics/metric-sql.d.ts.map +1 -0
  454. package/dist/telemetry/metrics/metric-sql.js +259 -0
  455. package/dist/telemetry/metrics/metric-sql.js.map +1 -0
  456. package/dist/telemetry/metrics/metric-values.d.ts +19 -0
  457. package/dist/telemetry/metrics/metric-values.d.ts.map +1 -0
  458. package/dist/telemetry/metrics/metric-values.js +97 -0
  459. package/dist/telemetry/metrics/metric-values.js.map +1 -0
  460. package/dist/telemetry/metrics/metric-verdict.d.ts +20 -0
  461. package/dist/telemetry/metrics/metric-verdict.d.ts.map +1 -0
  462. package/dist/telemetry/metrics/metric-verdict.js +218 -0
  463. package/dist/telemetry/metrics/metric-verdict.js.map +1 -0
  464. package/dist/telemetry/ports.d.ts +575 -0
  465. package/dist/telemetry/ports.d.ts.map +1 -0
  466. package/dist/telemetry/ports.js +78 -0
  467. package/dist/telemetry/ports.js.map +1 -0
  468. package/dist/telemetry/query/sql-guard.d.ts +71 -0
  469. package/dist/telemetry/query/sql-guard.d.ts.map +1 -0
  470. package/dist/telemetry/query/sql-guard.js +258 -0
  471. package/dist/telemetry/query/sql-guard.js.map +1 -0
  472. package/dist/telemetry/query/telemetry-availability.d.ts +11 -0
  473. package/dist/telemetry/query/telemetry-availability.d.ts.map +1 -0
  474. package/dist/telemetry/query/telemetry-availability.js +55 -0
  475. package/dist/telemetry/query/telemetry-availability.js.map +1 -0
  476. package/dist/telemetry/query/telemetry-query.errors.d.ts +48 -0
  477. package/dist/telemetry/query/telemetry-query.errors.d.ts.map +1 -0
  478. package/dist/telemetry/query/telemetry-query.errors.js +100 -0
  479. package/dist/telemetry/query/telemetry-query.errors.js.map +1 -0
  480. package/dist/telemetry/query/telemetry-query.service.d.ts +57 -0
  481. package/dist/telemetry/query/telemetry-query.service.d.ts.map +1 -0
  482. package/dist/telemetry/query/telemetry-query.service.js +194 -0
  483. package/dist/telemetry/query/telemetry-query.service.js.map +1 -0
  484. package/dist/telemetry/query/telemetry-schema.service.d.ts +36 -0
  485. package/dist/telemetry/query/telemetry-schema.service.d.ts.map +1 -0
  486. package/dist/telemetry/query/telemetry-schema.service.js +154 -0
  487. package/dist/telemetry/query/telemetry-schema.service.js.map +1 -0
  488. package/dist/telemetry/stack/dto/telemetry-stack.dto.d.ts +29 -0
  489. package/dist/telemetry/stack/dto/telemetry-stack.dto.d.ts.map +1 -0
  490. package/dist/telemetry/stack/dto/telemetry-stack.dto.js +27 -0
  491. package/dist/telemetry/stack/dto/telemetry-stack.dto.js.map +1 -0
  492. package/dist/telemetry/stack/stack-agent.client.d.ts +76 -0
  493. package/dist/telemetry/stack/stack-agent.client.d.ts.map +1 -0
  494. package/dist/telemetry/stack/stack-agent.client.js +208 -0
  495. package/dist/telemetry/stack/stack-agent.client.js.map +1 -0
  496. package/dist/telemetry/stack/telemetry-stack-deploy.handler.d.ts +43 -0
  497. package/dist/telemetry/stack/telemetry-stack-deploy.handler.d.ts.map +1 -0
  498. package/dist/telemetry/stack/telemetry-stack-deploy.handler.js +159 -0
  499. package/dist/telemetry/stack/telemetry-stack-deploy.handler.js.map +1 -0
  500. package/dist/telemetry/stack/telemetry-stack.controller.d.ts +14 -0
  501. package/dist/telemetry/stack/telemetry-stack.controller.d.ts.map +1 -0
  502. package/dist/telemetry/stack/telemetry-stack.controller.js +107 -0
  503. package/dist/telemetry/stack/telemetry-stack.controller.js.map +1 -0
  504. package/dist/telemetry/stack/telemetry-stack.service.d.ts +19 -0
  505. package/dist/telemetry/stack/telemetry-stack.service.d.ts.map +1 -0
  506. package/dist/telemetry/stack/telemetry-stack.service.js +122 -0
  507. package/dist/telemetry/stack/telemetry-stack.service.js.map +1 -0
  508. package/dist/telemetry/tasks/telemetry-retention.task.d.ts +8 -0
  509. package/dist/telemetry/tasks/telemetry-retention.task.d.ts.map +1 -0
  510. package/dist/telemetry/tasks/telemetry-retention.task.js +61 -0
  511. package/dist/telemetry/tasks/telemetry-retention.task.js.map +1 -0
  512. package/dist/telemetry/telemetry-admin.controller.d.ts +14 -0
  513. package/dist/telemetry/telemetry-admin.controller.d.ts.map +1 -0
  514. package/dist/telemetry/telemetry-admin.controller.js +148 -0
  515. package/dist/telemetry/telemetry-admin.controller.js.map +1 -0
  516. package/dist/telemetry/telemetry-config.controller.d.ts +14 -0
  517. package/dist/telemetry/telemetry-config.controller.d.ts.map +1 -0
  518. package/dist/telemetry/telemetry-config.controller.js +73 -0
  519. package/dist/telemetry/telemetry-config.controller.js.map +1 -0
  520. package/dist/telemetry/telemetry-explorer.controller.d.ts +14 -0
  521. package/dist/telemetry/telemetry-explorer.controller.d.ts.map +1 -0
  522. package/dist/telemetry/telemetry-explorer.controller.js +193 -0
  523. package/dist/telemetry/telemetry-explorer.controller.js.map +1 -0
  524. package/dist/telemetry/telemetry-settings.service.d.ts +85 -0
  525. package/dist/telemetry/telemetry-settings.service.d.ts.map +1 -0
  526. package/dist/telemetry/telemetry-settings.service.js +278 -0
  527. package/dist/telemetry/telemetry-settings.service.js.map +1 -0
  528. package/dist/telemetry/telemetry-status.service.d.ts +28 -0
  529. package/dist/telemetry/telemetry-status.service.d.ts.map +1 -0
  530. package/dist/telemetry/telemetry-status.service.js +185 -0
  531. package/dist/telemetry/telemetry-status.service.js.map +1 -0
  532. package/dist/telemetry/telemetry-support-bundle.section.d.ts +163 -0
  533. package/dist/telemetry/telemetry-support-bundle.section.d.ts.map +1 -0
  534. package/dist/telemetry/telemetry-support-bundle.section.js +187 -0
  535. package/dist/telemetry/telemetry-support-bundle.section.js.map +1 -0
  536. package/dist/telemetry/telemetry.module.d.ts +35 -0
  537. package/dist/telemetry/telemetry.module.d.ts.map +1 -0
  538. package/dist/telemetry/telemetry.module.js +210 -0
  539. package/dist/telemetry/telemetry.module.js.map +1 -0
  540. package/dist/telemetry/telemetry.options.d.ts +176 -0
  541. package/dist/telemetry/telemetry.options.d.ts.map +1 -0
  542. package/dist/telemetry/telemetry.options.js +246 -0
  543. package/dist/telemetry/telemetry.options.js.map +1 -0
  544. package/dist/telemetry/telemetry.permissions.d.ts +76 -0
  545. package/dist/telemetry/telemetry.permissions.d.ts.map +1 -0
  546. package/dist/telemetry/telemetry.permissions.js +85 -0
  547. package/dist/telemetry/telemetry.permissions.js.map +1 -0
  548. package/dist/telemetry/telemetry.settings.d.ts +79 -0
  549. package/dist/telemetry/telemetry.settings.d.ts.map +1 -0
  550. package/dist/telemetry/telemetry.settings.js +92 -0
  551. package/dist/telemetry/telemetry.settings.js.map +1 -0
  552. package/dist/telemetry/testing/coach-metric-group.fixture.d.ts +17 -0
  553. package/dist/telemetry/testing/coach-metric-group.fixture.d.ts.map +1 -0
  554. package/dist/telemetry/testing/coach-metric-group.fixture.js +128 -0
  555. package/dist/telemetry/testing/coach-metric-group.fixture.js.map +1 -0
  556. package/dist/telemetry/testing/conformance.d.ts +257 -0
  557. package/dist/telemetry/testing/conformance.d.ts.map +1 -0
  558. package/dist/telemetry/testing/conformance.js +626 -0
  559. package/dist/telemetry/testing/conformance.js.map +1 -0
  560. package/dist/telemetry/testing/index.d.ts +10 -0
  561. package/dist/telemetry/testing/index.d.ts.map +1 -0
  562. package/dist/telemetry/testing/index.js +41 -0
  563. package/dist/telemetry/testing/index.js.map +1 -0
  564. package/dist/telemetry/testing/metric-schema.fixture.d.ts +73 -0
  565. package/dist/telemetry/testing/metric-schema.fixture.d.ts.map +1 -0
  566. package/dist/telemetry/testing/metric-schema.fixture.js +362 -0
  567. package/dist/telemetry/testing/metric-schema.fixture.js.map +1 -0
  568. package/dist/telemetry/testing/stub-ports.d.ts +46 -0
  569. package/dist/telemetry/testing/stub-ports.d.ts.map +1 -0
  570. package/dist/telemetry/testing/stub-ports.js +119 -0
  571. package/dist/telemetry/testing/stub-ports.js.map +1 -0
  572. package/dist/testing/conformance-suite.d.ts +106 -0
  573. package/dist/testing/conformance-suite.d.ts.map +1 -0
  574. package/dist/testing/conformance-suite.js +8 -0
  575. package/dist/testing/conformance-suite.js.map +1 -0
  576. package/dist/testing/conformance-suites.d.ts +14 -0
  577. package/dist/testing/conformance-suites.d.ts.map +1 -0
  578. package/dist/testing/conformance-suites.js +27 -0
  579. package/dist/testing/conformance-suites.js.map +1 -0
  580. package/dist/testing/host/in-memory-audit-sink.d.ts +23 -0
  581. package/dist/testing/host/in-memory-audit-sink.d.ts.map +1 -0
  582. package/dist/testing/host/in-memory-audit-sink.js +30 -0
  583. package/dist/testing/host/in-memory-audit-sink.js.map +1 -0
  584. package/dist/testing/host/in-memory-system-settings-store.d.ts +31 -0
  585. package/dist/testing/host/in-memory-system-settings-store.d.ts.map +1 -0
  586. package/dist/testing/host/in-memory-system-settings-store.js +54 -0
  587. package/dist/testing/host/in-memory-system-settings-store.js.map +1 -0
  588. package/dist/testing/host/index.d.ts +4 -0
  589. package/dist/testing/host/index.d.ts.map +1 -0
  590. package/dist/testing/host/index.js +13 -0
  591. package/dist/testing/host/index.js.map +1 -0
  592. package/dist/testing/host/test-platform-host.d.ts +35 -0
  593. package/dist/testing/host/test-platform-host.d.ts.map +1 -0
  594. package/dist/testing/host/test-platform-host.js +81 -0
  595. package/dist/testing/host/test-platform-host.js.map +1 -0
  596. package/dist/testing/index.d.ts +12 -0
  597. package/dist/testing/index.d.ts.map +1 -0
  598. package/dist/testing/index.js +32 -0
  599. package/dist/testing/index.js.map +1 -0
  600. package/dist/testing/prisma-schema.d.ts +99 -0
  601. package/dist/testing/prisma-schema.d.ts.map +1 -0
  602. package/dist/testing/prisma-schema.js +175 -0
  603. package/dist/testing/prisma-schema.js.map +1 -0
  604. package/dist/testing/run-platform-conformance.d.ts +70 -0
  605. package/dist/testing/run-platform-conformance.d.ts.map +1 -0
  606. package/dist/testing/run-platform-conformance.js +77 -0
  607. package/dist/testing/run-platform-conformance.js.map +1 -0
  608. package/dist/testing/suites/cron-enqueue-only.d.ts +46 -0
  609. package/dist/testing/suites/cron-enqueue-only.d.ts.map +1 -0
  610. package/dist/testing/suites/cron-enqueue-only.js +177 -0
  611. package/dist/testing/suites/cron-enqueue-only.js.map +1 -0
  612. package/dist/testing/suites/user-owned-data.d.ts +86 -0
  613. package/dist/testing/suites/user-owned-data.d.ts.map +1 -0
  614. package/dist/testing/suites/user-owned-data.js +329 -0
  615. package/dist/testing/suites/user-owned-data.js.map +1 -0
  616. package/package.json +129 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,54 @@
1
+ # @marinoscar/platform-api
2
+
3
+ ## 0.1.0-next.3
4
+
5
+ ### Minor Changes
6
+
7
+ - 76fb492: Export `deriveSigningKey(purpose)` from `@marinoscar/platform-api/core`: a 32-byte HMAC key derived from `SECRETS_ENCRYPTION_KEY` under the permanent label `enterpriseappbase:signing-key:v1:`, byte-identical to the app-side copy it replaces (#822).
8
+ - 55a3402: Add the support bundle: `@marinoscar/platform-contract/doctor` (`supportBundleSchema`), `GET <doctor path>/support-bundle` with `SupportBundleRegistry`, `SupportBundleService`, redaction rules v1 and the built-in `meta`, `doctor` and `egress` sections in `@marinoscar/platform-api/doctor`, and the "Download support bundle" button and `useSupportBundleDownload` hook in `@marinoscar/platform-web/doctor` (plus the optional `PlatformApiClient.getBlob`).
9
+ - f1fff88: Add the `telemetry` slice (`@marinoscar/platform-api/telemetry` and `/telemetry/testing`): `TelemetryModule.forRoot({ host, imports, ... })` with host ports for audit, settings, credentials, jobs, AI and app identity, the metric-group registry, the `VERDICT_POLICY` token with configurable verdict thresholds, and the five telemetry Doctor checks.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [738d71c]
14
+ - Updated dependencies [55a3402]
15
+ - Updated dependencies [bd9ad6f]
16
+ - @marinoscar/platform-contract@0.1.0-next.3
17
+
18
+ ## 0.1.0-next.2
19
+
20
+ ### Minor Changes
21
+
22
+ - fd29180: Add `@marinoscar/platform-contract/doctor`, the first contract slice (#701): the Doctor's report, row, status and query schemas, their types and the zod-free status constants. `platform-api`'s Doctor DTOs now wrap these schemas and `platform-web`'s Doctor takes its types from them; both re-export the old names (`DOCTOR_STATUS_ORDER` and `DoctorReportQuery` in `platform-web` are deprecated aliases). No wire or OpenAPI change. Sets the contract conventions (slice layout, zod-free constants, import rules, `schema` catalog kind).
23
+ - c41df57: Doctor slice: add the egress inventory (`EgressRegistry`, `EgressContributor`, `EgressDependency`, `classifyHost`) and the `network.egress` air-gap readiness check (`NetworkEgressDoctorCheck`, graded by `DEPLOYMENT_NETWORK_SOURCE`); `network` joins `PLATFORM_DOCTOR_CATEGORIES`.
24
+ - a2db925: Add the `otel-core` slice: `@marinoscar/platform-api/otel-core/sdk` (the Nest-free `initializeOtel()` bootstrap, the runtime `telemetryGate` and its gated exporters, the service-name and instance-id resolvers) and `@marinoscar/platform-api/otel-core` (the `MetricsHostService` metrics host and `OtelMetricsModule`, the app-metric name registry, label bounding, the gauge-provider seam, `registerRequestSpanAttributes` and `@Trace()`).
25
+ - ab888f5: Scoped data access in `@marinoscar/platform-api/core` (the user-owned data registry, `forUser`/`userScopeExtension`, `asSystem`, `ScopedAccessError`; schema-independent via `@prisma/client/extension`) and the `userOwnedData` conformance suite in `@marinoscar/platform-api/testing`.
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [fd29180]
30
+ - @marinoscar/platform-contract@0.1.0-next.2
31
+
32
+ ## 0.1.0-next.1
33
+
34
+ ### Minor Changes
35
+
36
+ - 1ca1ff0: core: add the principal and scope types, HttpExceptionFilter with ErrorDto and its exceptions, the secret cipher with verifyEncryptionKeyAtStartup, and the openApiTags registry.
37
+
38
+ ## 0.1.0-next.0
39
+
40
+ ### Minor Changes
41
+
42
+ - 385e12f: Add the Doctor slice (`@marinoscar/platform-api/doctor`, `@marinoscar/platform-web/doctor/headless` and `/doctor/ui`), host ports in `core` (`definePlatformHost`, `PlatformHostModule`, `PlatformHostProvider`, `PlatformApiClient`) and in-memory test hosts in `testing`.
43
+ - a66fef1: First pre-release of the platform packages: the six-package scaffold (build formats, boundary lint, pack check, TSDoc and generated API reference, single-instance peer dependencies) plus the first slices.
44
+
45
+ - `@marinoscar/platform-api/core`: the typed registry primitive (`defineRegistry`, `Registry`, `RegistryError`, `RegistryFreezeService`, `withTemporaryEntries`).
46
+ - `@marinoscar/platform-api/testing`: the conformance harness (`runPlatformConformance`, `conformanceSuites`) with the `cron-enqueue-only` suite.
47
+ - `@marinoscar/platform-cli/core`: the CLI command and env-spec fragment registries.
48
+ - `@marinoscar/platform-cli/telemetry`: the node span relay and the telemetry env-spec fragment.
49
+ - `@marinoscar/platform-infra`: `infraFile()`, the `platform-infra` command (`sync` materialises fragments into an app) and the `telemetry` slice (collector and GreptimeDB compose fragments, collector config and overlay, typed manifest).
50
+ - `@marinoscar/platform-contract`, `@marinoscar/platform-web` and `@marinoscar/platform-db` ship their package scaffold only; their slices follow in later releases.
51
+
52
+ ### Patch Changes
53
+
54
+ - 9bc1ed1: Declare `fastify` as an optional peer: npm no longer auto-installs a second fastify beside the exact version `@nestjs/platform-fastify` pins in a consumer app (found by the consumer smoke).
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 marinoscar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,107 @@
1
- # Temporary Holding Version
1
+ # @marinoscar/platform-api
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The NestJS side of the platform: dynamic modules (one subpath export per slice, for example `@marinoscar/platform-api/<slice>`) that an app imports into its own `AppModule` and extends through options, registries and injection tokens. CommonJS, compiled with `tsc` so decorator metadata (`design:paramtypes`) survives for Nest dependency injection.
4
+
5
+ ## Purpose and scope
6
+
7
+ Dynamic modules, services, guards and registries of the platform's API slices. It does not own the app's composition root, its product identity or its own feature modules.
8
+
9
+ Status: pre-release (version `0.0.0`). The root export is only the package name (`PLATFORM_PACKAGE`); the slices are subpath exports, each with its own README:
10
+
11
+ - `@marinoscar/platform-api/core`: the bottom of the slice graph, code only: the typed registry primitive (`defineRegistry`, `Registry`, `RegistryError`, `RegistryFreezeService`, `withTemporaryEntries`), the principal and scope contract (`Principal`, `Scope`, `SystemActor`, ADR 0001), the exception filter and its exceptions (`HttpExceptionFilter`, `ErrorDto`, `withVerbatimErrorBody`, `DatabaseSeedException`), the secret cipher (`encryptSecret`, `decryptSecret`, `userCredentialPurpose`, `deriveSigningKey`, `verifyEncryptionKeyAtStartup`) and the OpenAPI tag registry (`openApiTags`), and scoped data access (`userOwnedModelRegistry`, `forUser`, `userScopeExtension`, `asSystem`, `ScopedAccessError`; schema-independent, #699). [README](src/core/README.md).
12
+ - `@marinoscar/platform-api/testing`: the conformance harness (`runPlatformConformance`, `conformanceSuites`, the `cron-enqueue-only` and `user-owned-data` suites, and the small Prisma schema reader behind the latter). [README](src/testing/README.md).
13
+ - `@marinoscar/platform-api/doctor`: the admin Doctor, `GET /api/admin/doctor` (`DoctorModule.forRoot({ host })`, `DoctorCheckRegistry`, the check contract). The first packaged slice (#696). [README](src/doctor/README.md).
14
+ - `@marinoscar/platform-api/otel-core` and `@marinoscar/platform-api/otel-core/sdk`: the emitting half of telemetry (#700): `initializeOtel` (the Nest-free SDK bootstrap, loaded first), the runtime export gate `telemetryGate`, the metrics host `MetricsHostService` with the app-metric name registry and the gauge-provider seam, `registerRequestSpanAttributes` and `@Trace()`. [README](src/otel-core/README.md).
15
+
16
+ The `core` slice also holds the **host ports** (#696: `definePlatformHost`, `AUDIT_SINK`, `SYSTEM_SETTINGS_STORE`, `PLATFORM_PRISMA`, `PlatformHostModule`), the one mechanism every packaged slice uses to reach app-owned capabilities, with test doubles in `testing`. [Host ports](src/core/README.md#host-ports).
17
+
18
+ More slices arrive in later releases of the platform program.
19
+
20
+ ## Install and peer dependencies
21
+
22
+ ```bash
23
+ npm install @marinoscar/platform-api
24
+ ```
25
+
26
+ Install these in the app; the package never bundles its own copy (a second copy breaks dependency injection, hooks or theme context).
27
+
28
+ | Package | Range |
29
+ |---|---|
30
+ | `@nestjs/common` | `^11.1.12` |
31
+ | `@nestjs/core` | `^11.1.12` |
32
+ | `@nestjs/swagger` | `^11.2.5` |
33
+ | `@opentelemetry/api` | `^1.9.1` |
34
+ | `@prisma/client` | `^7.8.0` |
35
+ | `fastify` | `^5` |
36
+ | `nestjs-zod` | `^5.4.0` |
37
+ | `reflect-metadata` | `^0.2.2` |
38
+ | `rxjs` | `^7.8.1` |
39
+ | `zod` | `^4.4.3` |
40
+
41
+ The OpenTelemetry SDK packages the `otel-core` slice installs (`@opentelemetry/sdk-node`, the auto-instrumentations, the OTLP/HTTP exporters and their SDK siblings) are regular dependencies, not peers: only `@opentelemetry/api`, which holds the process-wide providers, must be a single shared copy.
42
+
43
+ ## Quick start
44
+
45
+ Run the platform's conformance suites from a spec of your own (the reference app's is [`apps/api/test/jobs/cron-enqueue-only.spec.ts`](../../apps/api/test/jobs/cron-enqueue-only.spec.ts)):
46
+
47
+ ```ts
48
+ import { join } from 'node:path';
49
+ import { runPlatformConformance } from '@marinoscar/platform-api/testing';
50
+
51
+ runPlatformConformance({
52
+ sourceRoots: [join(__dirname, '..', '..', 'src')],
53
+ suites: { cronEnqueueOnly: { exempt: EXEMPT, minCronFiles: 8 } },
54
+ });
55
+ ```
56
+
57
+ Declare a registry with `defineRegistry`, register the exception filter and validate the encryption key at bootstrap with `@marinoscar/platform-api/core`; see the [core README](src/core/README.md#quick-start).
58
+
59
+ ## Configuration
60
+
61
+ None at the package level. Each slice documents its own options: `DoctorModule.forRoot()` in the [doctor README](src/doctor/README.md#configuration), `initializeOtel()` and `OtelMetricsModule` in the [otel-core README](src/otel-core/README.md#configuration), `PlatformHostModule.forRoot()` in the [core README](src/core/README.md#host-ports), the harness in the [testing README](src/testing/README.md#configuration).
62
+
63
+ ## Extension-point catalog
64
+
65
+ None. The root export is only the package name; the extension points live in the slice catalogs ([core](src/core/README.md#extension-point-catalog), [testing](src/testing/README.md#extension-point-catalog), [doctor](src/doctor/README.md#extension-point-catalog), [otel-core](src/otel-core/README.md#extension-point-catalog)).
66
+
67
+ ## Data
68
+
69
+ None yet. A slice that owns models documents them here and in its own README; the schema fragments and migrations ship in `@marinoscar/platform-db`.
70
+
71
+ ## Permissions and settings
72
+
73
+ The `doctor` slice requires `system_settings:read` by default and declares no permission of its own ([README](src/doctor/README.md#permissions-and-settings)). Other slices declare theirs in their own README as they are extracted.
74
+
75
+ ## UI
76
+
77
+ None. Pages and settings cards live in `@marinoscar/platform-web`.
78
+
79
+ ## Infra
80
+
81
+ Compose, nginx and collector configuration live in `@marinoscar/platform-infra`. The package reads `SECRETS_ENCRYPTION_KEY` (the `core` slice's secret cipher, see the [core README](src/core/README.md#configuration)) and, in the `otel-core` slice, the existing OpenTelemetry variables (`OTEL_ENABLED`, `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_SERVICE_NAME`, `OTEL_DEBUG`); it exports OTLP/HTTP to the collector ([otel-core README](src/otel-core/README.md#infra)) and adds no variable.
82
+
83
+ ## Observability
84
+
85
+ The `doctor` slice logs one `warn` line when a check throws; `core` logs one `debug` line when it freezes the static registries, one line per handled error and the encryption-key startup check ([core README](src/core/README.md#observability)). Packaged code logs through Nest's `Logger`, which the app routes to its own logger. `otel-core` installs the OpenTelemetry SDK (when `OTEL_ENABLED=true`) and exports only what its runtime gate lets through ([README](src/otel-core/README.md#observability)). Other slices document theirs as they are extracted.
86
+
87
+ ## Security notes
88
+
89
+ Every packaged controller takes the app's auth decorators through the host access port (`definePlatformHost`) rather than ship its own, and every `forRoot` refuses to build one without a host, so a packaged route is never public. The one route so far, `GET /api/admin/doctor`, is read-only and requires `system_settings:read` by default. The `core` slice also holds the secret cipher and the exception filter; their key handling, the module-scope key cache (install exactly one copy of the package) and the error-body rules are in the [core README](src/core/README.md#security-notes).
90
+
91
+ ## Conformance suite
92
+
93
+ The harness is the `testing` slice: `runPlatformConformance()` from `@marinoscar/platform-api/testing` runs the platform's suites in any app: `cron-enqueue-only` and `user-owned-data`. See the [testing README](src/testing/README.md#conformance-suite).
94
+
95
+ ## Upgrade notes
96
+
97
+ None. No version has been published yet, so there is nothing to migrate from.
98
+
99
+ ## Troubleshooting
100
+
101
+ None yet. Build and import problems common to every platform package are in [DEVELOPMENT.md § Platform packages](../../docs/DEVELOPMENT.md#platform-packages).
102
+
103
+ ## Links
104
+
105
+ - [Platform packages spec](../../docs/specs/platform-packages.md): the extension contract and the package documentation standard
106
+ - [Package documentation standard and checks](../../docs/PACKAGES.md): how this README, the TSDoc and the catalog are checked
107
+ - [DEVELOPMENT.md § Platform packages](../../docs/DEVELOPMENT.md#platform-packages): build, test and lint commands
@@ -0,0 +1,29 @@
1
+ import type { LoggerService } from '@nestjs/common';
2
+ /**
3
+ * Validate the encryption key as far as this deployment's state allows, and
4
+ * throw if the deployment is unable to read secrets it has already stored.
5
+ *
6
+ * Call from bootstrap BEFORE the port is bound, so a deployment that cannot
7
+ * read its own credentials never serves a request. See the header for the
8
+ * full decision; the short version is that a present key is always validated
9
+ * and an absent one is only fatal when there is something to decrypt.
10
+ *
11
+ * - Key set: validated (throws the cipher's operator-facing error if
12
+ * malformed), then one `log` line.
13
+ * - Key absent, `countStoredSecrets()` rejects: one `warn` line, boot continues.
14
+ * - Key absent, count above zero: throws.
15
+ * - Key absent, count zero: one `warn` line, boot continues.
16
+ *
17
+ * @param countStoredSecrets - How many encrypted secrets the deployment has
18
+ * stored (the reference app counts its `credentials` rows). Called only
19
+ * when the key is absent.
20
+ * @param logger - Where the outcome is logged; a Nest `Logger` fits.
21
+ * @throws if the key is set but malformed, or unset while secrets are stored.
22
+ * @stability stable
23
+ * @example
24
+ * ```ts
25
+ * await verifyEncryptionKeyAtStartup(() => app.get(PrismaService).credential.count(), logger);
26
+ * ```
27
+ */
28
+ export declare function verifyEncryptionKeyAtStartup(countStoredSecrets: () => Promise<number>, logger: Pick<LoggerService, 'log' | 'warn' | 'error'>): Promise<void>;
29
+ //# sourceMappingURL=encryption-key-startup-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryption-key-startup-check.d.ts","sourceRoot":"","sources":["../../../src/core/crypto/encryption-key-startup-check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAoHpD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,4BAA4B,CAChD,kBAAkB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EACzC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC,GACpD,OAAO,CAAC,IAAI,CAAC,CA2Ff"}
@@ -0,0 +1,221 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.verifyEncryptionKeyAtStartup = verifyEncryptionKeyAtStartup;
4
+ const secret_cipher_1 = require("./secret-cipher");
5
+ // =============================================================================
6
+ // SECRETS_ENCRYPTION_KEY startup validation (issue #116, epic #108)
7
+ // =============================================================================
8
+ //
9
+ // #114 built the cipher and #115 built the store on top of it. Both fail at the
10
+ // moment of use if the key is missing or malformed, which is the failure this
11
+ // issue exists to move: a deployment that boots happily and then 500s on a
12
+ // settings page has turned a configuration error into a runtime error, and
13
+ // handed it to the wrong person. This module is the bootstrap-time check that
14
+ // puts it back in the deploy log.
15
+ //
16
+ // -----------------------------------------------------------------------------
17
+ // THE DECISION: NO DEVELOPMENT FALLBACK KEY, AND NO NODE_ENV GATE AT ALL
18
+ // -----------------------------------------------------------------------------
19
+ // #116 offered two acceptable shapes for "the variable is absent in
20
+ // development": fail identically everywhere, or fall back to a fixed,
21
+ // loudly-logged development key. This chooses the first, and goes further by
22
+ // not branching on NODE_ENV anywhere in this file. Two reasons.
23
+ //
24
+ // 1. A FIXED FALLBACK KEY IS A KEY IN A PUBLIC REPOSITORY. Whatever constant we
25
+ // shipped would be the key protecting every secret in any deployment that
26
+ // reached the fallback branch. The branch is only safe if "is this
27
+ // production?" is answered correctly 100% of the time — and here it would be
28
+ // answered by NODE_ENV, which is UNSET by default in Node, which
29
+ // `configuration.ts` therefore defaults to 'development', and which
30
+ // `app.module.ts` already uses to decide whether to load TestAuthModule. A
31
+ // deployment that forgets to set it does not fail; it quietly encrypts real
32
+ // SMTP passwords under a constant anyone can read off GitHub, and every
33
+ // symptom of that is invisible. Trading a hard failure for a silent
34
+ // catastrophic one is a bad trade at any convenience saving.
35
+ //
36
+ // 2. IT WOULD ALSO CORRUPT DEVELOPER DATA. Credentials written under a fallback
37
+ // key become permanently unreadable the moment a developer sets a real key —
38
+ // the cipher's auth tag fails, `CredentialsService.getSecret` throws, and the
39
+ // reported cause ("the payload is corrupt or the key changed") is true but
40
+ // baffling, because nobody remembers a key they never set.
41
+ //
42
+ // -----------------------------------------------------------------------------
43
+ // SO WHAT MAKES IT STRICT WITHOUT BREAKING EVERY EXISTING DEPLOYMENT?
44
+ // -----------------------------------------------------------------------------
45
+ // The hard constraint: this repository sets SECRETS_ENCRYPTION_KEY NOWHERE
46
+ // today — not in `infra/compose/.env.example` (#116 item 2 adds it), not in the
47
+ // compose files, not in CI. In particular the `Smoke (boot compiled API)` job
48
+ // boots `dist/main.js` with NODE_ENV=production and no such variable. A naive
49
+ // unconditional throw here would therefore red the build immediately and break
50
+ // every running deployment on its next restart — for a feature that, today, has
51
+ // no consumer at all (#109 will be the first).
52
+ //
53
+ // Strictness is gated on whether the credential store IS IN USE, which is a
54
+ // fact about the deployment rather than a claim about it:
55
+ //
56
+ // key present -> validate its format. ALWAYS, in every environment. A
57
+ // typo'd key is unambiguously an operator error, it can
58
+ // never be the intended state, and catching it costs
59
+ // nothing because no deployment sets the variable yet.
60
+ //
61
+ // key absent, -> THROW. Every one of those rows is ciphertext this process
62
+ // rows exist cannot read. The deployment is already broken; the only
63
+ // question is whether it announces that in the deploy log or
64
+ // waits to 500 at an admin. This is the case the issue is
65
+ // actually about, and it is strict in development too.
66
+ //
67
+ // key absent, -> WARN and boot. Nothing is stored, so nothing is
68
+ // no rows unreadable, and there is no misconfiguration to report —
69
+ // the feature is simply not set up. Every deployment in
70
+ // existence right now, the smoke job included, is here.
71
+ //
72
+ // The state machine is closed rather than merely convenient, because rows
73
+ // cannot exist without a key having been configured when they were written:
74
+ // `CredentialsService.setSecret` calls `encryptSecret`, which throws without a
75
+ // valid key. So "rows exist" really does mean "a key was working here once",
76
+ // and its absence now really is a regression rather than a first-time setup.
77
+ //
78
+ // WHAT A DEVELOPER RUNNING `docker compose up` FOR THE FIRST TIME EXPERIENCES,
79
+ // which is the trade-off this accepts and is worth stating plainly: the stack
80
+ // comes up normally, with one WARN line naming the variable and giving the
81
+ // generation command. Credential storage is the only thing that does not work,
82
+ // and the first attempt to store one fails with secret-cipher's operator-facing
83
+ // error — which also names the variable and gives the command. So the cost of
84
+ // refusing a fallback key is one deferred error message, on a feature they were
85
+ // deliberately reaching for, that tells them exactly what to do. The cost of
86
+ // accepting one was a public key on production secrets. That is the trade.
87
+ //
88
+ // This is a floor, not a ceiling. Once #116 items 2-5 put the variable in
89
+ // `.env.example` and the security docs, and once #109 gives the store a real
90
+ // consumer, the "absent, no rows" branch can be tightened to a hard failure
91
+ // without stranding anyone — every path that would then break has by that point
92
+ // been told about the variable. Tightening it TODAY would only mean breaking CI
93
+ // and every deployment to protect a feature nothing uses.
94
+ //
95
+ // -----------------------------------------------------------------------------
96
+ // MOVED INTO @marinoscar/platform-api/core (issue #698)
97
+ // -----------------------------------------------------------------------------
98
+ // The one signature change of that move: the function used to take the app's
99
+ // `PrismaService` and call `prisma.credential.count()` itself. It now takes a
100
+ // `countStoredSecrets` callback, so core never imports a Prisma client or an
101
+ // app model. The reference app passes
102
+ // `() => app.get(PrismaService).credential.count()` from `main.ts`. Every
103
+ // message and every decision branch above is unchanged.
104
+ // =============================================================================
105
+ /**
106
+ * Kept as a literal rather than imported from secret-cipher, which does not
107
+ * export it. Duplicating one string is the smaller cost: widening that module's
108
+ * public surface for a log line invites the next caller to reach in for
109
+ * something that actually matters.
110
+ */
111
+ const KEY_ENV_VAR = 'SECRETS_ENCRYPTION_KEY';
112
+ /** Repeated in every operator-facing message here. Same text as #114's. */
113
+ const GENERATE_COMMAND = 'openssl rand -base64 32';
114
+ /**
115
+ * Validate the encryption key as far as this deployment's state allows, and
116
+ * throw if the deployment is unable to read secrets it has already stored.
117
+ *
118
+ * Call from bootstrap BEFORE the port is bound, so a deployment that cannot
119
+ * read its own credentials never serves a request. See the header for the
120
+ * full decision; the short version is that a present key is always validated
121
+ * and an absent one is only fatal when there is something to decrypt.
122
+ *
123
+ * - Key set: validated (throws the cipher's operator-facing error if
124
+ * malformed), then one `log` line.
125
+ * - Key absent, `countStoredSecrets()` rejects: one `warn` line, boot continues.
126
+ * - Key absent, count above zero: throws.
127
+ * - Key absent, count zero: one `warn` line, boot continues.
128
+ *
129
+ * @param countStoredSecrets - How many encrypted secrets the deployment has
130
+ * stored (the reference app counts its `credentials` rows). Called only
131
+ * when the key is absent.
132
+ * @param logger - Where the outcome is logged; a Nest `Logger` fits.
133
+ * @throws if the key is set but malformed, or unset while secrets are stored.
134
+ * @stability stable
135
+ * @example
136
+ * ```ts
137
+ * await verifyEncryptionKeyAtStartup(() => app.get(PrismaService).credential.count(), logger);
138
+ * ```
139
+ */
140
+ async function verifyEncryptionKeyAtStartup(countStoredSecrets, logger) {
141
+ // An empty value ('SECRETS_ENCRYPTION_KEY=' with nothing after it, which is
142
+ // exactly what copying `.env.example` produces) is deliberately treated as
143
+ // ABSENT rather than as malformed — matching `getMasterKey`, which reports
144
+ // `!raw` as "is not set". A whitespace-only value is NOT absent: it is
145
+ // truthy, so it takes the strict branch below and is rejected as invalid
146
+ // base64, which is the honest reading of somebody having typed something.
147
+ if (process.env[KEY_ENV_VAR]) {
148
+ // Deliberately not wrapped, re-worded, or downgraded by environment.
149
+ // secret-cipher's error already names the variable, describes the shape of
150
+ // the failure ("decoded to 24 bytes") and gives the generation command,
151
+ // and it is addressed to precisely the person reading a failed deploy.
152
+ // Rewriting it here could only lose information.
153
+ (0, secret_cipher_1.assertEncryptionKeyConfigured)();
154
+ logger.log(`${KEY_ENV_VAR} is configured; encrypted credential storage is available.`);
155
+ return;
156
+ }
157
+ let storedCredentials;
158
+ try {
159
+ storedCredentials = await countStoredSecrets();
160
+ }
161
+ catch (error) {
162
+ // A failed probe is NOT a boot failure, and specifically is not reported as
163
+ // an encryption-key problem.
164
+ //
165
+ // The realistic cause is that the `credentials` table does not exist yet —
166
+ // a deployment running this build before `prisma migrate deploy` (Prisma
167
+ // P2021). Refusing to boot there would mean a new release could not start
168
+ // until migrations ran, while the migration step in some setups runs from
169
+ // the very container being blocked. The other cause is a database that is
170
+ // unreachable, which readiness already reports accurately and which would
171
+ // only be obscured by a message about encryption keys sending an operator
172
+ // to check the wrong thing.
173
+ //
174
+ // Failing OPEN here is safe because it cannot hide the dangerous state: if
175
+ // credentials do exist, this same check throws on the next boot that can
176
+ // actually see them.
177
+ logger.warn(`Could not check for stored credentials while validating ${KEY_ENV_VAR} ` +
178
+ `(the credentials table may not be migrated yet). Continuing startup. ` +
179
+ `Cause: ${error instanceof Error ? error.message : String(error)}`);
180
+ return;
181
+ }
182
+ if (storedCredentials > 0) {
183
+ // Fatal in EVERY environment, development included. There is no reading of
184
+ // this state that is intended: rows only exist because a key was working
185
+ // here at some point, so it has since been removed or the deployment is
186
+ // pointed at another environment's database.
187
+ //
188
+ // The message carries a count and never an address — `purpose`/`name` pairs
189
+ // are low-risk but this string goes to stdout on a failed deploy, and a
190
+ // count is all an operator needs to gauge the scale. Recovery detail
191
+ // (re-entering credentials, which ones) belongs in the rotation runbook,
192
+ // #116 item 5.
193
+ throw new Error(`${KEY_ENV_VAR} is not set, but ${storedCredentials} encrypted credential(s) ` +
194
+ `are stored in the database. Without the key that encrypted them they cannot ` +
195
+ `be read, so this deployment would fail at the point of use rather than here. ` +
196
+ `Restore the original key, or — if it is genuinely lost — delete the affected ` +
197
+ `credentials and have an administrator enter them again under a new key ` +
198
+ `generated with: ${GENERATE_COMMAND}`);
199
+ }
200
+ // Nothing is stored, so nothing is unreadable.
201
+ //
202
+ // STILL WARN AND NOT THROW, AND DELIBERATELY SO AFTER #377. Epic #372 moved
203
+ // object storage's secret access key into this store, so this branch is no
204
+ // longer "an unused feature is unconfigured" — a deployment here cannot save
205
+ // a storage credential, and every upload, avatar and database backup will be
206
+ // refused with a 503 naming the missing field. That is a strictly better
207
+ // outcome than refusing to boot: an API that will not start serves NOTHING,
208
+ // takes its health checks, its admin UI and the settings page an operator
209
+ // needs in order to fix this down with it, and turns a missing variable into
210
+ // an outage. The 503 says exactly what is wrong, to exactly the person who
211
+ // can fix it, on exactly the path that needs it.
212
+ //
213
+ // WARN and not ERROR for the same reason as before: a boot that then works
214
+ // for everything except storage is not a failed boot, and logging it at
215
+ // `error` trains operators to scroll past real ones.
216
+ logger.warn(`${KEY_ENV_VAR} is not set. Encrypted credential storage is unavailable, so ` +
217
+ `object storage cannot be configured and file uploads, avatars and database ` +
218
+ `backups will be refused until it is. No credentials are currently stored, ` +
219
+ `so nothing already saved is at risk. Generate a key with: ${GENERATE_COMMAND}`);
220
+ }
221
+ //# sourceMappingURL=encryption-key-startup-check.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryption-key-startup-check.js","sourceRoot":"","sources":["../../../src/core/crypto/encryption-key-startup-check.ts"],"names":[],"mappings":";;AA8IA,oEA8FC;AA1OD,mDAAgE;AAEhE,gFAAgF;AAChF,qEAAqE;AACrE,gFAAgF;AAChF,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,2EAA2E;AAC3E,2EAA2E;AAC3E,8EAA8E;AAC9E,kCAAkC;AAClC,EAAE;AACF,gFAAgF;AAChF,yEAAyE;AACzE,gFAAgF;AAChF,oEAAoE;AACpE,sEAAsE;AACtE,6EAA6E;AAC7E,gEAAgE;AAChE,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,sEAAsE;AACtE,gFAAgF;AAChF,oEAAoE;AACpE,uEAAuE;AACvE,8EAA8E;AAC9E,+EAA+E;AAC/E,2EAA2E;AAC3E,uEAAuE;AACvE,gEAAgE;AAChE,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,iFAAiF;AACjF,8EAA8E;AAC9E,8DAA8D;AAC9D,EAAE;AACF,gFAAgF;AAChF,sEAAsE;AACtE,gFAAgF;AAChF,2EAA2E;AAC3E,gFAAgF;AAChF,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,4EAA4E;AAC5E,0DAA0D;AAC1D,EAAE;AACF,0EAA0E;AAC1E,2EAA2E;AAC3E,wEAAwE;AACxE,0EAA0E;AAC1E,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,gFAAgF;AAChF,6EAA6E;AAC7E,0EAA0E;AAC1E,EAAE;AACF,qEAAqE;AACrE,8EAA8E;AAC9E,2EAA2E;AAC3E,2EAA2E;AAC3E,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,+EAA+E;AAC/E,6EAA6E;AAC7E,6EAA6E;AAC7E,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,2EAA2E;AAC3E,+EAA+E;AAC/E,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,6EAA6E;AAC7E,2EAA2E;AAC3E,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,gFAAgF;AAChF,gFAAgF;AAChF,0DAA0D;AAC1D,EAAE;AACF,gFAAgF;AAChF,wDAAwD;AACxD,gFAAgF;AAChF,6EAA6E;AAC7E,8EAA8E;AAC9E,6EAA6E;AAC7E,sCAAsC;AACtC,0EAA0E;AAC1E,wDAAwD;AACxD,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAE7C,2EAA2E;AAC3E,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACI,KAAK,UAAU,4BAA4B,CAChD,kBAAyC,EACzC,MAAqD;IAErD,4EAA4E;IAC5E,2EAA2E;IAC3E,2EAA2E;IAC3E,uEAAuE;IACvE,yEAAyE;IACzE,0EAA0E;IAC1E,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7B,qEAAqE;QACrE,2EAA2E;QAC3E,wEAAwE;QACxE,uEAAuE;QACvE,iDAAiD;QACjD,IAAA,6CAA6B,GAAE,CAAC;QAEhC,MAAM,CAAC,GAAG,CACR,GAAG,WAAW,4DAA4D,CAC3E,CAAC;QACF,OAAO;IACT,CAAC;IAED,IAAI,iBAAyB,CAAC;IAC9B,IAAI,CAAC;QACH,iBAAiB,GAAG,MAAM,kBAAkB,EAAE,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,4EAA4E;QAC5E,6BAA6B;QAC7B,EAAE;QACF,2EAA2E;QAC3E,yEAAyE;QACzE,0EAA0E;QAC1E,0EAA0E;QAC1E,0EAA0E;QAC1E,0EAA0E;QAC1E,0EAA0E;QAC1E,4BAA4B;QAC5B,EAAE;QACF,2EAA2E;QAC3E,yEAAyE;QACzE,qBAAqB;QACrB,MAAM,CAAC,IAAI,CACT,2DAA2D,WAAW,GAAG;YACvE,uEAAuE;YACvE,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACrE,CAAC;QACF,OAAO;IACT,CAAC;IAED,IAAI,iBAAiB,GAAG,CAAC,EAAE,CAAC;QAC1B,2EAA2E;QAC3E,yEAAyE;QACzE,wEAAwE;QACxE,6CAA6C;QAC7C,EAAE;QACF,4EAA4E;QAC5E,wEAAwE;QACxE,qEAAqE;QACrE,yEAAyE;QACzE,eAAe;QACf,MAAM,IAAI,KAAK,CACb,GAAG,WAAW,oBAAoB,iBAAiB,2BAA2B;YAC5E,8EAA8E;YAC9E,+EAA+E;YAC/E,+EAA+E;YAC/E,yEAAyE;YACzE,mBAAmB,gBAAgB,EAAE,CACxC,CAAC;IACJ,CAAC;IAED,+CAA+C;IAC/C,EAAE;IACF,4EAA4E;IAC5E,2EAA2E;IAC3E,6EAA6E;IAC7E,6EAA6E;IAC7E,yEAAyE;IACzE,4EAA4E;IAC5E,0EAA0E;IAC1E,6EAA6E;IAC7E,2EAA2E;IAC3E,iDAAiD;IACjD,EAAE;IACF,2EAA2E;IAC3E,wEAAwE;IACxE,qDAAqD;IACrD,MAAM,CAAC,IAAI,CACT,GAAG,WAAW,+DAA+D;QAC3E,6EAA6E;QAC7E,4EAA4E;QAC5E,6DAA6D,gBAAgB,EAAE,CAClF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,151 @@
1
+ /**
2
+ * First segment of every owner-bound sub-key domain (issue #387). See
3
+ * {@link userCredentialPurpose}. System purposes may not contain `:` at all
4
+ * (the reference app enforces it in `credentials/credential-internals.ts`),
5
+ * so no system purpose can begin with this.
6
+ *
7
+ * @stability stable
8
+ * @example
9
+ * ```ts
10
+ * purpose.startsWith(USER_CREDENTIAL_DOMAIN_PREFIX); // an owner-bound domain
11
+ * ```
12
+ */
13
+ export declare const USER_CREDENTIAL_DOMAIN_PREFIX = "user:";
14
+ /**
15
+ * Is `value` a canonical (lowercase, hyphenated) UUID string?
16
+ *
17
+ * @param value - Anything.
18
+ * @returns `true` for `8-4-4-4-12` lowercase hex, the spelling Postgres and
19
+ * Prisma render.
20
+ * @stability stable
21
+ * @example
22
+ * ```ts
23
+ * isCanonicalUuid('00000000-0000-4000-8000-000000000001'); // true
24
+ * isCanonicalUuid('00000000-0000-4000-8000-00000000000A'); // false (uppercase)
25
+ * ```
26
+ */
27
+ export declare function isCanonicalUuid(value: unknown): value is string;
28
+ /**
29
+ * Encrypt `plaintext` under the purpose-bound sub-key for `purpose`.
30
+ *
31
+ * Returns a base64 string carrying its own IV and auth tag — safe to put
32
+ * straight into a `text` column.
33
+ *
34
+ * @param plaintext - The secret, as UTF-8 text.
35
+ * @param purpose - The sub-key domain: a short fixed string per kind of
36
+ * secret (`'smtp'`), or {@link userCredentialPurpose} for a per-user one.
37
+ * @returns base64 of `[iv: 12 bytes][authTag: 16 bytes][ciphertext]`.
38
+ * @throws if the key is missing/malformed, or `purpose` is empty.
39
+ * @stability stable
40
+ * @example
41
+ * ```ts
42
+ * const stored = encryptSecret(password, 'smtp');
43
+ * ```
44
+ */
45
+ export declare function encryptSecret(plaintext: string, purpose: string): string;
46
+ /**
47
+ * Decrypt a payload produced by `encryptSecret` under the SAME `purpose`.
48
+ *
49
+ * Any tampering — a flipped bit in the IV, the tag, or the ciphertext — and
50
+ * any purpose mismatch fails here rather than returning plausible garbage.
51
+ * That is the entire reason this is GCM and not CBC: an unauthenticated mode
52
+ * would hand back corrupted bytes that then get used as an SMTP password.
53
+ *
54
+ * @param payload - A string returned by {@link encryptSecret}.
55
+ * @param purpose - The same purpose it was encrypted under.
56
+ * @returns The plaintext.
57
+ * @throws if the key is missing/malformed, `purpose` is empty, the payload is
58
+ * truncated, or authentication fails.
59
+ * @stability stable
60
+ * @example
61
+ * ```ts
62
+ * const password = decryptSecret(row.encryptedValue, 'smtp');
63
+ * ```
64
+ */
65
+ export declare function decryptSecret(payload: string, purpose: string): string;
66
+ /**
67
+ * Throw unless `SECRETS_ENCRYPTION_KEY` is present and well-formed.
68
+ *
69
+ * Exists so startup can fail on a bad key instead of the first administrator
70
+ * who tries to save a credential — a misconfiguration should surface in the
71
+ * deploy logs, not as a 500 weeks later. Wiring this into bootstrap is #116;
72
+ * this issue only provides the check.
73
+ *
74
+ * Also warms the cache, so the first real encrypt does not pay for validation.
75
+ *
76
+ * @throws the operator-facing key error (names the variable, the shape of the
77
+ * failure and the generation command; never key material).
78
+ * @stability stable
79
+ * @example
80
+ * ```ts
81
+ * assertEncryptionKeyConfigured(); // throws if SECRETS_ENCRYPTION_KEY is unusable
82
+ * ```
83
+ */
84
+ export declare function assertEncryptionKeyConfigured(): void;
85
+ /**
86
+ * A 32-byte HMAC key for `purpose`, derived from `SECRETS_ENCRYPTION_KEY`
87
+ * (issue #822).
88
+ *
89
+ * For server-signed, short-lived tokens (a download link, a one-time URL)
90
+ * that need a deployment secret without a new environment variable: the
91
+ * master key is already mandatory and validated at startup, and the label
92
+ * `enterpriseappbase:signing-key:v1:` keeps every signing domain independent
93
+ * of every encryption domain, so a signing key can never decrypt a stored
94
+ * credential.
95
+ *
96
+ * Derivation: `HMAC-SHA256(masterKey, "enterpriseappbase:signing-key:v1:" + purpose)`.
97
+ * The label is permanent. Rotating the master key invalidates every
98
+ * outstanding token, which for minutes-long tokens is the desired behaviour.
99
+ *
100
+ * `purpose` is a code constant (`'android-app-download'`), never user input:
101
+ * derived keys are cached per purpose for the life of the process. Never log
102
+ * or return the key.
103
+ *
104
+ * @param purpose - The signing domain: a short fixed string per kind of token.
105
+ * @returns A 32-byte key for `createHmac('sha256', key)`.
106
+ * @throws if the key is missing/malformed (the same operator-facing error as
107
+ * {@link assertEncryptionKeyConfigured}), or `purpose` is empty.
108
+ * @stability stable
109
+ * @example
110
+ * ```ts
111
+ * const mac = createHmac('sha256', deriveSigningKey('android-app-download'))
112
+ * .update(payload)
113
+ * .digest('base64url');
114
+ * ```
115
+ */
116
+ export declare function deriveSigningKey(purpose: string): Buffer;
117
+ /**
118
+ * The owner-bound sub-key domain for a PER-USER credential (issue #387):
119
+ * `user:<userId>:<purpose>`.
120
+ *
121
+ * Pass the result as the `purpose` argument of {@link encryptSecret} /
122
+ * {@link decryptSecret}; those functions are unchanged. Binding the owner into
123
+ * the domain means a ciphertext copied from user A's row into user B's row —
124
+ * a SQL write, a bug copying rows — fails GCM authentication rather than
125
+ * handing B the use of A's key. The system store's domain is the bare purpose;
126
+ * this is the same construction with the owner prepended.
127
+ *
128
+ * WHY THE STRING DECOMPOSES ONE WAY ONLY:
129
+ * - `userId` must be a canonical UUID: fixed length, no `:`, one spelling
130
+ * per id (an uppercase variant would otherwise derive a second key for
131
+ * the same user and strand every row written under the first).
132
+ * - `purpose` must not contain `:`, so the final segment is unambiguous.
133
+ * - System purposes may not contain `:` either, so no system purpose can
134
+ * equal, or begin with, `user:` — the two key spaces cannot collide.
135
+ * Together that makes (userId, purpose) → domain injective, which is what the
136
+ * concatenation in `deriveKey` relies on.
137
+ *
138
+ * @throws a plain Error (no values in it) on a non-canonical id or a bad
139
+ * purpose. Callers validate first and report their own 400; this is
140
+ * the backstop that keeps a malformed domain from ever deriving a key.
141
+ * @param userId - The owner: a canonical UUID.
142
+ * @param purpose - The kind of secret; non-empty, no `:`.
143
+ * @returns `user:<userId>:<purpose>`.
144
+ * @stability stable
145
+ * @example
146
+ * ```ts
147
+ * const stored = encryptSecret(apiKey, userCredentialPurpose(userId, 'ai_user_key'));
148
+ * ```
149
+ */
150
+ export declare function userCredentialPurpose(userId: string, purpose: string): string;
151
+ //# sourceMappingURL=secret-cipher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secret-cipher.d.ts","sourceRoot":"","sources":["../../../src/core/crypto/secret-cipher.ts"],"names":[],"mappings":"AA6EA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,6BAA6B,UAAU,CAAC;AAUrD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE/D;AA+ID;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CA8BxE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAqDtE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,6BAA6B,IAAI,IAAI,CAEpD;AAQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAaxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAc7E"}