@revealui/core 0.0.0-canary-20260409021642

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 (522) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +171 -0
  3. package/dist/api/compression.d.ts +83 -0
  4. package/dist/api/compression.d.ts.map +1 -0
  5. package/dist/api/compression.js +233 -0
  6. package/dist/api/payload-optimization.d.ts +138 -0
  7. package/dist/api/payload-optimization.d.ts.map +1 -0
  8. package/dist/api/payload-optimization.js +320 -0
  9. package/dist/api/rate-limit.d.ts +114 -0
  10. package/dist/api/rate-limit.d.ts.map +1 -0
  11. package/dist/api/rate-limit.js +376 -0
  12. package/dist/api/response-cache.d.ts +125 -0
  13. package/dist/api/response-cache.d.ts.map +1 -0
  14. package/dist/api/response-cache.js +335 -0
  15. package/dist/api/rest.d.ts +54 -0
  16. package/dist/api/rest.d.ts.map +1 -0
  17. package/dist/api/rest.js +465 -0
  18. package/dist/auth/access.d.ts +25 -0
  19. package/dist/auth/access.d.ts.map +1 -0
  20. package/dist/auth/access.js +20 -0
  21. package/dist/auth/index.d.ts +2 -0
  22. package/dist/auth/index.d.ts.map +1 -0
  23. package/dist/auth/index.js +2 -0
  24. package/dist/cache/query-cache.d.ts +100 -0
  25. package/dist/cache/query-cache.d.ts.map +1 -0
  26. package/dist/cache/query-cache.js +266 -0
  27. package/dist/caching/index.d.ts +6 -0
  28. package/dist/caching/index.d.ts.map +1 -0
  29. package/dist/caching/index.js +5 -0
  30. package/dist/client/admin/RichText.d.ts +12 -0
  31. package/dist/client/admin/RichText.d.ts.map +1 -0
  32. package/dist/client/admin/RichText.js +5 -0
  33. package/dist/client/admin/components/AdminDashboard.d.ts +7 -0
  34. package/dist/client/admin/components/AdminDashboard.d.ts.map +1 -0
  35. package/dist/client/admin/components/AdminDashboard.js +308 -0
  36. package/dist/client/admin/components/CollectionList.d.ts +16 -0
  37. package/dist/client/admin/components/CollectionList.d.ts.map +1 -0
  38. package/dist/client/admin/components/CollectionList.js +67 -0
  39. package/dist/client/admin/components/DocumentForm.d.ts +11 -0
  40. package/dist/client/admin/components/DocumentForm.d.ts.map +1 -0
  41. package/dist/client/admin/components/DocumentForm.js +223 -0
  42. package/dist/client/admin/components/GlobalForm.d.ts +11 -0
  43. package/dist/client/admin/components/GlobalForm.d.ts.map +1 -0
  44. package/dist/client/admin/components/GlobalForm.js +74 -0
  45. package/dist/client/admin/context/ServerFunctionContext.d.ts +8 -0
  46. package/dist/client/admin/context/ServerFunctionContext.d.ts.map +1 -0
  47. package/dist/client/admin/context/ServerFunctionContext.js +15 -0
  48. package/dist/client/admin/i18n/en.d.ts +25 -0
  49. package/dist/client/admin/i18n/en.d.ts.map +1 -0
  50. package/dist/client/admin/i18n/en.js +25 -0
  51. package/dist/client/admin/index.d.ts +11 -0
  52. package/dist/client/admin/index.d.ts.map +1 -0
  53. package/dist/client/admin/index.js +11 -0
  54. package/dist/client/admin/layout.d.ts +10 -0
  55. package/dist/client/admin/layout.d.ts.map +1 -0
  56. package/dist/client/admin/layout.js +7 -0
  57. package/dist/client/admin/page.d.ts +38 -0
  58. package/dist/client/admin/page.d.ts.map +1 -0
  59. package/dist/client/admin/page.js +15 -0
  60. package/dist/client/admin/utils/apiClient.d.ts +110 -0
  61. package/dist/client/admin/utils/apiClient.d.ts.map +1 -0
  62. package/dist/client/admin/utils/apiClient.js +216 -0
  63. package/dist/client/admin/utils/index.d.ts +5 -0
  64. package/dist/client/admin/utils/index.d.ts.map +1 -0
  65. package/dist/client/admin/utils/index.js +4 -0
  66. package/dist/client/admin/utils/serializeConfig.d.ts +7 -0
  67. package/dist/client/admin/utils/serializeConfig.d.ts.map +1 -0
  68. package/dist/client/admin/utils/serializeConfig.js +35 -0
  69. package/dist/client/hooks.d.ts +18 -0
  70. package/dist/client/hooks.d.ts.map +1 -0
  71. package/dist/client/hooks.js +29 -0
  72. package/dist/client/index.d.ts +11 -0
  73. package/dist/client/index.d.ts.map +1 -0
  74. package/dist/client/index.js +13 -0
  75. package/dist/client/richtext/RichTextEditor.d.ts +48 -0
  76. package/dist/client/richtext/RichTextEditor.d.ts.map +1 -0
  77. package/dist/client/richtext/RichTextEditor.js +360 -0
  78. package/dist/client/richtext/components/ImageNodeComponent.d.ts +9 -0
  79. package/dist/client/richtext/components/ImageNodeComponent.d.ts.map +1 -0
  80. package/dist/client/richtext/components/ImageNodeComponent.js +98 -0
  81. package/dist/client/richtext/components/ImageUploadButton.d.ts +13 -0
  82. package/dist/client/richtext/components/ImageUploadButton.d.ts.map +1 -0
  83. package/dist/client/richtext/components/ImageUploadButton.js +118 -0
  84. package/dist/client/richtext/index.d.ts +92 -0
  85. package/dist/client/richtext/index.d.ts.map +1 -0
  86. package/dist/client/richtext/index.js +74 -0
  87. package/dist/client/richtext/nodes/DecoratorBlockNode.d.ts +20 -0
  88. package/dist/client/richtext/nodes/DecoratorBlockNode.d.ts.map +1 -0
  89. package/dist/client/richtext/nodes/DecoratorBlockNode.js +29 -0
  90. package/dist/client/richtext/nodes/ImageNode.d.ts +51 -0
  91. package/dist/client/richtext/nodes/ImageNode.d.ts.map +1 -0
  92. package/dist/client/richtext/nodes/ImageNode.js +95 -0
  93. package/dist/client/richtext/plugins/CollaborationPlugin.d.ts +13 -0
  94. package/dist/client/richtext/plugins/CollaborationPlugin.d.ts.map +1 -0
  95. package/dist/client/richtext/plugins/CollaborationPlugin.js +8 -0
  96. package/dist/client/richtext/plugins/CursorsOverlayPlugin.d.ts +4 -0
  97. package/dist/client/richtext/plugins/CursorsOverlayPlugin.d.ts.map +1 -0
  98. package/dist/client/richtext/plugins/CursorsOverlayPlugin.js +50 -0
  99. package/dist/client/richtext/plugins/FloatingToolbarPlugin.d.ts +7 -0
  100. package/dist/client/richtext/plugins/FloatingToolbarPlugin.d.ts.map +1 -0
  101. package/dist/client/richtext/plugins/FloatingToolbarPlugin.js +246 -0
  102. package/dist/client/richtext/plugins/ImagePlugin.d.ts +3 -0
  103. package/dist/client/richtext/plugins/ImagePlugin.d.ts.map +1 -0
  104. package/dist/client/richtext/plugins/ImagePlugin.js +73 -0
  105. package/dist/client/richtext/plugins/PastePlugin.d.ts +2 -0
  106. package/dist/client/richtext/plugins/PastePlugin.d.ts.map +1 -0
  107. package/dist/client/richtext/plugins/PastePlugin.js +36 -0
  108. package/dist/client/richtext/plugins/ToolbarPlugin.d.ts +8 -0
  109. package/dist/client/richtext/plugins/ToolbarPlugin.d.ts.map +1 -0
  110. package/dist/client/richtext/plugins/ToolbarPlugin.js +204 -0
  111. package/dist/client/ui/index.d.ts +111 -0
  112. package/dist/client/ui/index.d.ts.map +1 -0
  113. package/dist/client/ui/index.js +130 -0
  114. package/dist/collections/CollectionOperations.d.ts +27 -0
  115. package/dist/collections/CollectionOperations.d.ts.map +1 -0
  116. package/dist/collections/CollectionOperations.js +48 -0
  117. package/dist/collections/hooks.d.ts +11 -0
  118. package/dist/collections/hooks.d.ts.map +1 -0
  119. package/dist/collections/hooks.js +35 -0
  120. package/dist/collections/index.d.ts +2 -0
  121. package/dist/collections/index.d.ts.map +1 -0
  122. package/dist/collections/index.js +1 -0
  123. package/dist/collections/operations/create.d.ts +9 -0
  124. package/dist/collections/operations/create.d.ts.map +1 -0
  125. package/dist/collections/operations/create.js +130 -0
  126. package/dist/collections/operations/createMany.d.ts +12 -0
  127. package/dist/collections/operations/createMany.d.ts.map +1 -0
  128. package/dist/collections/operations/createMany.js +43 -0
  129. package/dist/collections/operations/delete.d.ts +10 -0
  130. package/dist/collections/operations/delete.d.ts.map +1 -0
  131. package/dist/collections/operations/delete.js +45 -0
  132. package/dist/collections/operations/deleteMany.d.ts +11 -0
  133. package/dist/collections/operations/deleteMany.d.ts.map +1 -0
  134. package/dist/collections/operations/deleteMany.js +50 -0
  135. package/dist/collections/operations/fieldHooks.d.ts +21 -0
  136. package/dist/collections/operations/fieldHooks.d.ts.map +1 -0
  137. package/dist/collections/operations/fieldHooks.js +51 -0
  138. package/dist/collections/operations/find.d.ts +8 -0
  139. package/dist/collections/operations/find.d.ts.map +1 -0
  140. package/dist/collections/operations/find.js +231 -0
  141. package/dist/collections/operations/findById.d.ts +14 -0
  142. package/dist/collections/operations/findById.d.ts.map +1 -0
  143. package/dist/collections/operations/findById.js +111 -0
  144. package/dist/collections/operations/sqlAdapter.d.ts +23 -0
  145. package/dist/collections/operations/sqlAdapter.d.ts.map +1 -0
  146. package/dist/collections/operations/sqlAdapter.js +108 -0
  147. package/dist/collections/operations/update.d.ts +8 -0
  148. package/dist/collections/operations/update.d.ts.map +1 -0
  149. package/dist/collections/operations/update.js +226 -0
  150. package/dist/collections/operations/updateMany.d.ts +11 -0
  151. package/dist/collections/operations/updateMany.d.ts.map +1 -0
  152. package/dist/collections/operations/updateMany.js +52 -0
  153. package/dist/collections/registry.d.ts +12 -0
  154. package/dist/collections/registry.d.ts.map +1 -0
  155. package/dist/collections/registry.js +38 -0
  156. package/dist/config/index.d.ts +9 -0
  157. package/dist/config/index.d.ts.map +1 -0
  158. package/dist/config/index.js +61 -0
  159. package/dist/config/runtime.d.ts +22 -0
  160. package/dist/config/runtime.d.ts.map +1 -0
  161. package/dist/config/runtime.js +32 -0
  162. package/dist/config/utils.d.ts +2 -0
  163. package/dist/config/utils.d.ts.map +1 -0
  164. package/dist/config/utils.js +21 -0
  165. package/dist/database/index.d.ts +4 -0
  166. package/dist/database/index.d.ts.map +1 -0
  167. package/dist/database/index.js +2 -0
  168. package/dist/database/safe-parse.d.ts +26 -0
  169. package/dist/database/safe-parse.d.ts.map +1 -0
  170. package/dist/database/safe-parse.js +42 -0
  171. package/dist/database/ssl-config.d.ts +9 -0
  172. package/dist/database/ssl-config.d.ts.map +1 -0
  173. package/dist/database/ssl-config.js +7 -0
  174. package/dist/database/type-adapter.d.ts +113 -0
  175. package/dist/database/type-adapter.d.ts.map +1 -0
  176. package/dist/database/type-adapter.js +97 -0
  177. package/dist/database/universal-postgres.d.ts +45 -0
  178. package/dist/database/universal-postgres.d.ts.map +1 -0
  179. package/dist/database/universal-postgres.js +531 -0
  180. package/dist/dataloader.d.ts +26 -0
  181. package/dist/dataloader.d.ts.map +1 -0
  182. package/dist/dataloader.js +176 -0
  183. package/dist/error-handling/error-boundary.d.ts +94 -0
  184. package/dist/error-handling/error-boundary.d.ts.map +1 -0
  185. package/dist/error-handling/error-boundary.js +285 -0
  186. package/dist/error-handling/error-reporter.d.ts +214 -0
  187. package/dist/error-handling/error-reporter.d.ts.map +1 -0
  188. package/dist/error-handling/error-reporter.js +491 -0
  189. package/dist/error-handling/fallback-components.d.ts +131 -0
  190. package/dist/error-handling/fallback-components.d.ts.map +1 -0
  191. package/dist/error-handling/fallback-components.js +371 -0
  192. package/dist/error-handling/index.d.ts +14 -0
  193. package/dist/error-handling/index.d.ts.map +1 -0
  194. package/dist/error-handling/index.js +12 -0
  195. package/dist/factories/builders.d.ts +50 -0
  196. package/dist/factories/builders.d.ts.map +1 -0
  197. package/dist/factories/builders.js +77 -0
  198. package/dist/factories/index.d.ts +2 -0
  199. package/dist/factories/index.d.ts.map +1 -0
  200. package/dist/factories/index.js +1 -0
  201. package/dist/features.d.ts +88 -0
  202. package/dist/features.d.ts.map +1 -0
  203. package/dist/features.js +105 -0
  204. package/dist/fieldTraversal.d.ts +26 -0
  205. package/dist/fieldTraversal.d.ts.map +1 -0
  206. package/dist/fieldTraversal.js +132 -0
  207. package/dist/fields/config/types.d.ts +48 -0
  208. package/dist/fields/config/types.d.ts.map +1 -0
  209. package/dist/fields/config/types.js +20 -0
  210. package/dist/fields/getDefaultValue.d.ts +16 -0
  211. package/dist/fields/getDefaultValue.d.ts.map +1 -0
  212. package/dist/fields/getDefaultValue.js +20 -0
  213. package/dist/fields/getFieldPaths.d.ts +25 -0
  214. package/dist/fields/getFieldPaths.d.ts.map +1 -0
  215. package/dist/fields/getFieldPaths.js +23 -0
  216. package/dist/fields/hooks/afterRead/index.d.ts +36 -0
  217. package/dist/fields/hooks/afterRead/index.d.ts.map +1 -0
  218. package/dist/fields/hooks/afterRead/index.js +70 -0
  219. package/dist/fields/hooks/afterRead/promise.d.ts +46 -0
  220. package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -0
  221. package/dist/fields/hooks/afterRead/promise.js +178 -0
  222. package/dist/fields/hooks/afterRead/traverseFields.d.ts +44 -0
  223. package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -0
  224. package/dist/fields/hooks/afterRead/traverseFields.js +37 -0
  225. package/dist/generated/index.d.ts +10 -0
  226. package/dist/generated/index.d.ts.map +1 -0
  227. package/dist/generated/index.js +9 -0
  228. package/dist/generated/types/cms.d.ts +1766 -0
  229. package/dist/generated/types/cms.d.ts.map +1 -0
  230. package/dist/generated/types/cms.js +11 -0
  231. package/dist/generated/types/index.d.ts +16 -0
  232. package/dist/generated/types/index.d.ts.map +1 -0
  233. package/dist/generated/types/index.js +21 -0
  234. package/dist/generated/types/neon.d.ts +11 -0
  235. package/dist/generated/types/neon.d.ts.map +1 -0
  236. package/dist/generated/types/neon.js +13 -0
  237. package/dist/globals/GlobalOperations.d.ts +24 -0
  238. package/dist/globals/GlobalOperations.d.ts.map +1 -0
  239. package/dist/globals/GlobalOperations.js +165 -0
  240. package/dist/globals/index.d.ts +2 -0
  241. package/dist/globals/index.d.ts.map +1 -0
  242. package/dist/globals/index.js +1 -0
  243. package/dist/index.d.ts +75 -0
  244. package/dist/index.d.ts.map +1 -0
  245. package/dist/index.js +136 -0
  246. package/dist/instance/RevealUIInstance.d.ts +6 -0
  247. package/dist/instance/RevealUIInstance.d.ts.map +1 -0
  248. package/dist/instance/RevealUIInstance.js +293 -0
  249. package/dist/instance/index.d.ts +3 -0
  250. package/dist/instance/index.d.ts.map +1 -0
  251. package/dist/instance/index.js +2 -0
  252. package/dist/instance/logger.d.ts +31 -0
  253. package/dist/instance/logger.d.ts.map +1 -0
  254. package/dist/instance/logger.js +42 -0
  255. package/dist/instance/methods/create.d.ts +10 -0
  256. package/dist/instance/methods/create.d.ts.map +1 -0
  257. package/dist/instance/methods/create.js +38 -0
  258. package/dist/instance/methods/delete.d.ts +10 -0
  259. package/dist/instance/methods/delete.d.ts.map +1 -0
  260. package/dist/instance/methods/delete.js +24 -0
  261. package/dist/instance/methods/find.d.ts +10 -0
  262. package/dist/instance/methods/find.d.ts.map +1 -0
  263. package/dist/instance/methods/find.js +20 -0
  264. package/dist/instance/methods/findById.d.ts +13 -0
  265. package/dist/instance/methods/findById.d.ts.map +1 -0
  266. package/dist/instance/methods/findById.js +20 -0
  267. package/dist/instance/methods/hooks.d.ts +14 -0
  268. package/dist/instance/methods/hooks.d.ts.map +1 -0
  269. package/dist/instance/methods/hooks.js +34 -0
  270. package/dist/instance/methods/update.d.ts +10 -0
  271. package/dist/instance/methods/update.d.ts.map +1 -0
  272. package/dist/instance/methods/update.js +42 -0
  273. package/dist/jobs/index.d.ts +16 -0
  274. package/dist/jobs/index.d.ts.map +1 -0
  275. package/dist/jobs/index.js +14 -0
  276. package/dist/jobs/queue.d.ts +57 -0
  277. package/dist/jobs/queue.d.ts.map +1 -0
  278. package/dist/jobs/queue.js +134 -0
  279. package/dist/license-encryption.d.ts +21 -0
  280. package/dist/license-encryption.d.ts.map +1 -0
  281. package/dist/license-encryption.js +74 -0
  282. package/dist/license.d.ts +99 -0
  283. package/dist/license.d.ts.map +1 -0
  284. package/dist/license.js +262 -0
  285. package/dist/monitoring/alerts.d.ts +118 -0
  286. package/dist/monitoring/alerts.d.ts.map +1 -0
  287. package/dist/monitoring/alerts.js +324 -0
  288. package/dist/monitoring/cleanup-manager.d.ts +71 -0
  289. package/dist/monitoring/cleanup-manager.d.ts.map +1 -0
  290. package/dist/monitoring/cleanup-manager.js +226 -0
  291. package/dist/monitoring/health-monitor.d.ts +22 -0
  292. package/dist/monitoring/health-monitor.d.ts.map +1 -0
  293. package/dist/monitoring/health-monitor.js +142 -0
  294. package/dist/monitoring/index.d.ts +14 -0
  295. package/dist/monitoring/index.d.ts.map +1 -0
  296. package/dist/monitoring/index.js +17 -0
  297. package/dist/monitoring/process-registry.d.ts +97 -0
  298. package/dist/monitoring/process-registry.d.ts.map +1 -0
  299. package/dist/monitoring/process-registry.js +222 -0
  300. package/dist/monitoring/query-monitor.d.ts +153 -0
  301. package/dist/monitoring/query-monitor.d.ts.map +1 -0
  302. package/dist/monitoring/query-monitor.js +209 -0
  303. package/dist/monitoring/types.d.ts +231 -0
  304. package/dist/monitoring/types.d.ts.map +1 -0
  305. package/dist/monitoring/types.js +42 -0
  306. package/dist/monitoring/zombie-detector.d.ts +81 -0
  307. package/dist/monitoring/zombie-detector.d.ts.map +1 -0
  308. package/dist/monitoring/zombie-detector.js +236 -0
  309. package/dist/nextjs/index.d.ts +4 -0
  310. package/dist/nextjs/index.d.ts.map +1 -0
  311. package/dist/nextjs/index.js +3 -0
  312. package/dist/nextjs/utilities.d.ts +5 -0
  313. package/dist/nextjs/utilities.d.ts.map +1 -0
  314. package/dist/nextjs/utilities.js +16 -0
  315. package/dist/nextjs/withRevealUI.d.ts +20 -0
  316. package/dist/nextjs/withRevealUI.d.ts.map +1 -0
  317. package/dist/nextjs/withRevealUI.js +181 -0
  318. package/dist/observability/alerts.d.ts +138 -0
  319. package/dist/observability/alerts.d.ts.map +1 -0
  320. package/dist/observability/alerts.js +389 -0
  321. package/dist/observability/health-check.d.ts +91 -0
  322. package/dist/observability/health-check.d.ts.map +1 -0
  323. package/dist/observability/health-check.js +345 -0
  324. package/dist/observability/index.d.ts +12 -0
  325. package/dist/observability/index.d.ts.map +1 -0
  326. package/dist/observability/index.js +11 -0
  327. package/dist/observability/logger.d.ts +47 -0
  328. package/dist/observability/logger.d.ts.map +1 -0
  329. package/dist/observability/logger.js +140 -0
  330. package/dist/observability/metrics.d.ts +205 -0
  331. package/dist/observability/metrics.d.ts.map +1 -0
  332. package/dist/observability/metrics.js +429 -0
  333. package/dist/observability/tracing.d.ts +149 -0
  334. package/dist/observability/tracing.d.ts.map +1 -0
  335. package/dist/observability/tracing.js +380 -0
  336. package/dist/plugins/form-builder.d.ts +115 -0
  337. package/dist/plugins/form-builder.d.ts.map +1 -0
  338. package/dist/plugins/form-builder.js +239 -0
  339. package/dist/plugins/index.d.ts +5 -0
  340. package/dist/plugins/index.d.ts.map +1 -0
  341. package/dist/plugins/index.js +4 -0
  342. package/dist/plugins/nested-docs.d.ts +12 -0
  343. package/dist/plugins/nested-docs.d.ts.map +1 -0
  344. package/dist/plugins/nested-docs.js +111 -0
  345. package/dist/plugins/redirects.d.ts +17 -0
  346. package/dist/plugins/redirects.d.ts.map +1 -0
  347. package/dist/plugins/redirects.js +62 -0
  348. package/dist/queries/index.d.ts +2 -0
  349. package/dist/queries/index.d.ts.map +1 -0
  350. package/dist/queries/index.js +1 -0
  351. package/dist/queries/queryBuilder.d.ts +47 -0
  352. package/dist/queries/queryBuilder.d.ts.map +1 -0
  353. package/dist/queries/queryBuilder.js +276 -0
  354. package/dist/relationships/analyzer.d.ts +39 -0
  355. package/dist/relationships/analyzer.d.ts.map +1 -0
  356. package/dist/relationships/analyzer.js +135 -0
  357. package/dist/relationships/index.d.ts +3 -0
  358. package/dist/relationships/index.d.ts.map +1 -0
  359. package/dist/relationships/index.js +2 -0
  360. package/dist/relationships/populate-core.d.ts +57 -0
  361. package/dist/relationships/populate-core.d.ts.map +1 -0
  362. package/dist/relationships/populate-core.js +116 -0
  363. package/dist/relationships/populate-helpers.d.ts +58 -0
  364. package/dist/relationships/populate-helpers.d.ts.map +1 -0
  365. package/dist/relationships/populate-helpers.js +82 -0
  366. package/dist/relationships/population.d.ts +34 -0
  367. package/dist/relationships/population.d.ts.map +1 -0
  368. package/dist/relationships/population.js +193 -0
  369. package/dist/revealui.d.ts +46 -0
  370. package/dist/revealui.d.ts.map +1 -0
  371. package/dist/revealui.js +92 -0
  372. package/dist/richtext/exports/client/rcc.d.ts +37 -0
  373. package/dist/richtext/exports/client/rcc.d.ts.map +1 -0
  374. package/dist/richtext/exports/client/rcc.js +182 -0
  375. package/dist/richtext/exports/server/rsc.d.ts +134 -0
  376. package/dist/richtext/exports/server/rsc.d.ts.map +1 -0
  377. package/dist/richtext/exports/server/rsc.js +344 -0
  378. package/dist/richtext/index.d.ts +161 -0
  379. package/dist/richtext/index.d.ts.map +1 -0
  380. package/dist/richtext/index.js +243 -0
  381. package/dist/richtext/lexical.d.ts +23 -0
  382. package/dist/richtext/lexical.d.ts.map +1 -0
  383. package/dist/richtext/lexical.js +35 -0
  384. package/dist/security/index.d.ts +6 -0
  385. package/dist/security/index.d.ts.map +1 -0
  386. package/dist/security/index.js +5 -0
  387. package/dist/server/index.d.ts +21 -0
  388. package/dist/server/index.d.ts.map +1 -0
  389. package/dist/server/index.js +28 -0
  390. package/dist/server/renderPage.d.ts +69 -0
  391. package/dist/server/renderPage.d.ts.map +1 -0
  392. package/dist/server/renderPage.js +109 -0
  393. package/dist/storage/index.d.ts +2 -0
  394. package/dist/storage/index.d.ts.map +1 -0
  395. package/dist/storage/index.js +2 -0
  396. package/dist/storage/vercel-blob.d.ts +17 -0
  397. package/dist/storage/vercel-blob.d.ts.map +1 -0
  398. package/dist/storage/vercel-blob.js +86 -0
  399. package/dist/translations/index.d.ts +17 -0
  400. package/dist/translations/index.d.ts.map +1 -0
  401. package/dist/translations/index.js +1 -0
  402. package/dist/types/access.d.ts +67 -0
  403. package/dist/types/access.d.ts.map +1 -0
  404. package/dist/types/access.js +8 -0
  405. package/dist/types/api.d.ts +57 -0
  406. package/dist/types/api.d.ts.map +1 -0
  407. package/dist/types/api.js +8 -0
  408. package/dist/types/cms.d.ts +8 -0
  409. package/dist/types/cms.d.ts.map +1 -0
  410. package/dist/types/cms.js +6 -0
  411. package/dist/types/config.d.ts +152 -0
  412. package/dist/types/config.d.ts.map +1 -0
  413. package/dist/types/config.js +9 -0
  414. package/dist/types/core.d.ts +11 -0
  415. package/dist/types/core.d.ts.map +1 -0
  416. package/dist/types/core.js +9 -0
  417. package/dist/types/extensions.d.ts +116 -0
  418. package/dist/types/extensions.d.ts.map +1 -0
  419. package/dist/types/extensions.js +8 -0
  420. package/dist/types/frontend.d.ts +53 -0
  421. package/dist/types/frontend.d.ts.map +1 -0
  422. package/dist/types/frontend.js +7 -0
  423. package/dist/types/generated.d.ts +12 -0
  424. package/dist/types/generated.d.ts.map +1 -0
  425. package/dist/types/generated.js +10 -0
  426. package/dist/types/hooks.d.ts +53 -0
  427. package/dist/types/hooks.d.ts.map +1 -0
  428. package/dist/types/hooks.js +8 -0
  429. package/dist/types/index.d.ts +49 -0
  430. package/dist/types/index.d.ts.map +1 -0
  431. package/dist/types/index.js +61 -0
  432. package/dist/types/interfaces/app.d.ts +50 -0
  433. package/dist/types/interfaces/app.d.ts.map +1 -0
  434. package/dist/types/interfaces/app.js +5 -0
  435. package/dist/types/jobs.d.ts +112 -0
  436. package/dist/types/jobs.d.ts.map +1 -0
  437. package/dist/types/jobs.js +7 -0
  438. package/dist/types/legacy.d.ts +147 -0
  439. package/dist/types/legacy.d.ts.map +1 -0
  440. package/dist/types/legacy.js +8 -0
  441. package/dist/types/plugins.d.ts +17 -0
  442. package/dist/types/plugins.d.ts.map +1 -0
  443. package/dist/types/plugins.js +8 -0
  444. package/dist/types/query.d.ts +99 -0
  445. package/dist/types/query.d.ts.map +1 -0
  446. package/dist/types/query.js +24 -0
  447. package/dist/types/request.d.ts +40 -0
  448. package/dist/types/request.d.ts.map +1 -0
  449. package/dist/types/request.js +8 -0
  450. package/dist/types/richtext.d.ts +23 -0
  451. package/dist/types/richtext.d.ts.map +1 -0
  452. package/dist/types/richtext.js +8 -0
  453. package/dist/types/runtime.d.ts +275 -0
  454. package/dist/types/runtime.d.ts.map +1 -0
  455. package/dist/types/runtime.js +9 -0
  456. package/dist/types/schema.d.ts +9 -0
  457. package/dist/types/schema.d.ts.map +1 -0
  458. package/dist/types/schema.js +7 -0
  459. package/dist/types/user.d.ts +48 -0
  460. package/dist/types/user.d.ts.map +1 -0
  461. package/dist/types/user.js +8 -0
  462. package/dist/utils/access-conversion.d.ts +17 -0
  463. package/dist/utils/access-conversion.d.ts.map +1 -0
  464. package/dist/utils/access-conversion.js +96 -0
  465. package/dist/utils/api-wrapper.d.ts +63 -0
  466. package/dist/utils/api-wrapper.d.ts.map +1 -0
  467. package/dist/utils/api-wrapper.js +151 -0
  468. package/dist/utils/block-conversion.d.ts +21 -0
  469. package/dist/utils/block-conversion.d.ts.map +1 -0
  470. package/dist/utils/block-conversion.js +109 -0
  471. package/dist/utils/cache.d.ts +86 -0
  472. package/dist/utils/cache.d.ts.map +1 -0
  473. package/dist/utils/cache.js +154 -0
  474. package/dist/utils/deep-clone.d.ts +25 -0
  475. package/dist/utils/deep-clone.d.ts.map +1 -0
  476. package/dist/utils/deep-clone.js +114 -0
  477. package/dist/utils/error-responses.d.ts +57 -0
  478. package/dist/utils/error-responses.d.ts.map +1 -0
  479. package/dist/utils/error-responses.js +95 -0
  480. package/dist/utils/errors.d.ts +133 -0
  481. package/dist/utils/errors.d.ts.map +1 -0
  482. package/dist/utils/errors.js +500 -0
  483. package/dist/utils/field-conversion.d.ts +40 -0
  484. package/dist/utils/field-conversion.d.ts.map +1 -0
  485. package/dist/utils/field-conversion.js +275 -0
  486. package/dist/utils/flattenResult.d.ts +7 -0
  487. package/dist/utils/flattenResult.d.ts.map +1 -0
  488. package/dist/utils/flattenResult.js +22 -0
  489. package/dist/utils/getBlockSelect.d.ts +12 -0
  490. package/dist/utils/getBlockSelect.d.ts.map +1 -0
  491. package/dist/utils/getBlockSelect.js +12 -0
  492. package/dist/utils/getSelectMode.d.ts +8 -0
  493. package/dist/utils/getSelectMode.d.ts.map +1 -0
  494. package/dist/utils/getSelectMode.js +21 -0
  495. package/dist/utils/isValidID.d.ts +5 -0
  496. package/dist/utils/isValidID.d.ts.map +1 -0
  497. package/dist/utils/isValidID.js +13 -0
  498. package/dist/utils/json-parsing.d.ts +48 -0
  499. package/dist/utils/json-parsing.d.ts.map +1 -0
  500. package/dist/utils/json-parsing.js +130 -0
  501. package/dist/utils/logger-client.d.ts +32 -0
  502. package/dist/utils/logger-client.d.ts.map +1 -0
  503. package/dist/utils/logger-client.js +55 -0
  504. package/dist/utils/logger-server.d.ts +32 -0
  505. package/dist/utils/logger-server.d.ts.map +1 -0
  506. package/dist/utils/logger-server.js +68 -0
  507. package/dist/utils/logger.d.ts +14 -0
  508. package/dist/utils/logger.d.ts.map +1 -0
  509. package/dist/utils/logger.js +12 -0
  510. package/dist/utils/request-context.d.ts +143 -0
  511. package/dist/utils/request-context.d.ts.map +1 -0
  512. package/dist/utils/request-context.js +168 -0
  513. package/dist/utils/stripUnselectedFields.d.ts +10 -0
  514. package/dist/utils/stripUnselectedFields.d.ts.map +1 -0
  515. package/dist/utils/stripUnselectedFields.js +20 -0
  516. package/dist/utils/type-guards.d.ts +33 -0
  517. package/dist/utils/type-guards.d.ts.map +1 -0
  518. package/dist/utils/type-guards.js +63 -0
  519. package/dist/utils/user.d.ts +14 -0
  520. package/dist/utils/user.d.ts.map +1 -0
  521. package/dist/utils/user.js +15 -0
  522. package/package.json +302 -0
@@ -0,0 +1,345 @@
1
+ /**
2
+ * Health Check System
3
+ *
4
+ * Provides health and readiness checks for the application
5
+ */
6
+ import { execFile } from 'node:child_process';
7
+ import { promisify } from 'node:util';
8
+ import { logger } from './logger.js';
9
+ const execFileAsync = promisify(execFile);
10
+ export class HealthCheckSystem {
11
+ checks = new Map();
12
+ startTime = Date.now();
13
+ /**
14
+ * Register a health check
15
+ */
16
+ register(check) {
17
+ this.checks.set(check.name, check);
18
+ }
19
+ /**
20
+ * Unregister a health check
21
+ */
22
+ unregister(name) {
23
+ this.checks.delete(name);
24
+ }
25
+ /**
26
+ * Run all health checks
27
+ */
28
+ async checkHealth() {
29
+ const results = {};
30
+ let overallStatus = 'healthy';
31
+ for (const [name, check] of this.checks) {
32
+ const startTime = Date.now();
33
+ try {
34
+ const timeout = check.timeout || 5000;
35
+ const result = await this.runWithTimeout(check.check(), timeout);
36
+ results[name] = {
37
+ ...result,
38
+ duration: Date.now() - startTime,
39
+ timestamp: new Date().toISOString(),
40
+ };
41
+ // Update overall status
42
+ if (check.critical && result.status === 'unhealthy') {
43
+ overallStatus = 'unhealthy';
44
+ }
45
+ else if (result.status === 'degraded' && overallStatus === 'healthy') {
46
+ overallStatus = 'degraded';
47
+ }
48
+ else if (result.status === 'unhealthy' && overallStatus !== 'unhealthy') {
49
+ overallStatus = 'degraded';
50
+ }
51
+ }
52
+ catch (error) {
53
+ const duration = Date.now() - startTime;
54
+ results[name] = {
55
+ status: 'unhealthy',
56
+ message: error instanceof Error ? error.message : 'Check failed',
57
+ duration,
58
+ timestamp: new Date().toISOString(),
59
+ };
60
+ if (check.critical) {
61
+ overallStatus = 'unhealthy';
62
+ }
63
+ else if (overallStatus === 'healthy') {
64
+ overallStatus = 'degraded';
65
+ }
66
+ }
67
+ }
68
+ return {
69
+ status: overallStatus,
70
+ checks: results,
71
+ timestamp: new Date().toISOString(),
72
+ uptime: Date.now() - this.startTime,
73
+ version: process.env.APP_VERSION,
74
+ };
75
+ }
76
+ /**
77
+ * Run check with timeout
78
+ */
79
+ async runWithTimeout(promise, timeoutMs) {
80
+ return Promise.race([
81
+ promise,
82
+ new Promise((_, reject) => setTimeout(() => reject(new Error('Check timeout')), timeoutMs)),
83
+ ]);
84
+ }
85
+ /**
86
+ * Get uptime in seconds
87
+ */
88
+ getUptime() {
89
+ return Math.floor((Date.now() - this.startTime) / 1000);
90
+ }
91
+ }
92
+ /**
93
+ * Default health check system
94
+ */
95
+ export const healthCheck = new HealthCheckSystem();
96
+ /**
97
+ * Database health check
98
+ */
99
+ export function createDatabaseHealthCheck(queryFn) {
100
+ return {
101
+ name: 'database',
102
+ critical: true,
103
+ timeout: 5000,
104
+ check: async () => {
105
+ const startTime = Date.now();
106
+ try {
107
+ await queryFn();
108
+ const duration = Date.now() - startTime;
109
+ return {
110
+ status: duration > 1000 ? 'degraded' : 'healthy',
111
+ message: duration > 1000 ? 'Database responding slowly' : 'Database healthy',
112
+ details: {
113
+ responseTime: duration,
114
+ },
115
+ };
116
+ }
117
+ catch (error) {
118
+ // Surface the root cause — Drizzle wraps Neon errors with "Failed query: ..."
119
+ // but the actual HTTP/connection error is in .cause
120
+ let message = error instanceof Error ? error.message : 'Database connection failed';
121
+ if (error instanceof Error && error.cause instanceof Error) {
122
+ message = `${message} | cause: ${error.cause.message}`;
123
+ }
124
+ return {
125
+ status: 'unhealthy',
126
+ message,
127
+ };
128
+ }
129
+ },
130
+ };
131
+ }
132
+ /**
133
+ * Memory health check
134
+ */
135
+ export function createMemoryHealthCheck(thresholdPercent = 90) {
136
+ return {
137
+ name: 'memory',
138
+ critical: false,
139
+ timeout: 1000,
140
+ check: async () => {
141
+ if (typeof process === 'undefined') {
142
+ return {
143
+ status: 'healthy',
144
+ message: 'Memory check not available',
145
+ };
146
+ }
147
+ const usage = process.memoryUsage();
148
+ const usedPercent = (usage.heapUsed / usage.heapTotal) * 100;
149
+ let status = 'healthy';
150
+ let message = 'Memory usage normal';
151
+ if (usedPercent > thresholdPercent) {
152
+ status = 'unhealthy';
153
+ message = 'Memory usage critical';
154
+ }
155
+ else if (usedPercent > thresholdPercent * 0.8) {
156
+ status = 'degraded';
157
+ message = 'Memory usage high';
158
+ }
159
+ return {
160
+ status,
161
+ message,
162
+ details: {
163
+ heapUsed: usage.heapUsed,
164
+ heapTotal: usage.heapTotal,
165
+ usedPercent: usedPercent.toFixed(2),
166
+ external: usage.external,
167
+ rss: usage.rss,
168
+ },
169
+ };
170
+ },
171
+ };
172
+ }
173
+ /**
174
+ * Disk health check
175
+ */
176
+ export function createDiskHealthCheck(thresholdPercent = 90) {
177
+ return {
178
+ name: 'disk',
179
+ critical: false,
180
+ timeout: 2000,
181
+ check: async () => {
182
+ try {
183
+ const { stdout } = await execFileAsync('df', ['-P', '/']);
184
+ // df -P output: "Filesystem 1024-blocks Used Available Capacity% Mounted"
185
+ const lines = stdout.trim().split('\n');
186
+ const dataLine = lines[1];
187
+ if (!dataLine)
188
+ throw new Error('Unexpected df output format');
189
+ const parts = dataLine.split(/\s+/);
190
+ const usedPercent = Number.parseInt(parts[4] ?? '0', 10);
191
+ const availableKb = Number.parseInt(parts[3] ?? '0', 10);
192
+ const availableMb = Math.round(availableKb / 1024);
193
+ const status = usedPercent >= thresholdPercent
194
+ ? 'unhealthy'
195
+ : usedPercent >= thresholdPercent - 10
196
+ ? 'degraded'
197
+ : 'healthy';
198
+ return {
199
+ status,
200
+ message: status === 'healthy'
201
+ ? `Disk usage ${usedPercent}% (${availableMb} MB free)`
202
+ : `Disk usage ${usedPercent}% exceeds threshold ${thresholdPercent}% (${availableMb} MB free)`,
203
+ details: { usedPercent, availableMb, thresholdPercent },
204
+ };
205
+ }
206
+ catch (err) {
207
+ logger.warn('Disk health check failed', {
208
+ error: err instanceof Error ? err.message : String(err),
209
+ });
210
+ return {
211
+ status: 'degraded',
212
+ message: 'Disk check unavailable',
213
+ };
214
+ }
215
+ },
216
+ };
217
+ }
218
+ /**
219
+ * API endpoint health check
220
+ */
221
+ export function createAPIHealthCheck(url, expectedStatus = 200) {
222
+ return {
223
+ name: `api:${url}`,
224
+ critical: false,
225
+ timeout: 10000,
226
+ check: async () => {
227
+ const startTime = Date.now();
228
+ try {
229
+ const response = await fetch(url);
230
+ const duration = Date.now() - startTime;
231
+ if (response.status !== expectedStatus) {
232
+ return {
233
+ status: 'unhealthy',
234
+ message: `API returned ${response.status}, expected ${expectedStatus}`,
235
+ details: {
236
+ status: response.status,
237
+ responseTime: duration,
238
+ },
239
+ };
240
+ }
241
+ return {
242
+ status: duration > 2000 ? 'degraded' : 'healthy',
243
+ message: duration > 2000 ? 'API responding slowly' : 'API healthy',
244
+ details: {
245
+ status: response.status,
246
+ responseTime: duration,
247
+ },
248
+ };
249
+ }
250
+ catch (error) {
251
+ return {
252
+ status: 'unhealthy',
253
+ message: error instanceof Error ? error.message : 'API unreachable',
254
+ };
255
+ }
256
+ },
257
+ };
258
+ }
259
+ /**
260
+ * Custom health check
261
+ */
262
+ export function createCustomHealthCheck(name, checkFn, critical = false) {
263
+ return {
264
+ name,
265
+ critical,
266
+ check: checkFn,
267
+ };
268
+ }
269
+ /**
270
+ * Create health check endpoint handler
271
+ */
272
+ export function createHealthEndpoint() {
273
+ return async () => {
274
+ const health = await healthCheck.checkHealth();
275
+ const status = health.status === 'healthy' ? 200 : health.status === 'degraded' ? 200 : 503;
276
+ return new Response(JSON.stringify(health, null, 2), {
277
+ status,
278
+ headers: {
279
+ 'Content-Type': 'application/json',
280
+ 'Cache-Control': 'no-cache, no-store, must-revalidate',
281
+ },
282
+ });
283
+ };
284
+ }
285
+ /**
286
+ * Create readiness check endpoint handler
287
+ */
288
+ export function createReadinessEndpoint() {
289
+ return async () => {
290
+ const health = await healthCheck.checkHealth();
291
+ // Only return 200 if all critical checks are healthy
292
+ const ready = health.status !== 'unhealthy';
293
+ const status = ready ? 200 : 503;
294
+ return new Response(JSON.stringify({
295
+ ready,
296
+ status: health.status,
297
+ timestamp: health.timestamp,
298
+ }, null, 2), {
299
+ status,
300
+ headers: {
301
+ 'Content-Type': 'application/json',
302
+ 'Cache-Control': 'no-cache, no-store, must-revalidate',
303
+ },
304
+ });
305
+ };
306
+ }
307
+ /**
308
+ * Create liveness check endpoint handler
309
+ */
310
+ export function createLivenessEndpoint() {
311
+ return () => {
312
+ // Liveness is simple - if we can respond, we're alive
313
+ return new Response(JSON.stringify({
314
+ alive: true,
315
+ timestamp: new Date().toISOString(),
316
+ uptime: healthCheck.getUptime(),
317
+ }, null, 2), {
318
+ status: 200,
319
+ headers: {
320
+ 'Content-Type': 'application/json',
321
+ 'Cache-Control': 'no-cache, no-store, must-revalidate',
322
+ },
323
+ });
324
+ };
325
+ }
326
+ /**
327
+ * Monitor health and log status changes
328
+ */
329
+ export async function monitorHealth(intervalMs = 30000, onStatusChange) {
330
+ let lastStatus = null;
331
+ const monitor = async () => {
332
+ const health = await healthCheck.checkHealth();
333
+ if (health.status !== lastStatus) {
334
+ logger.info('Health status changed', { from: lastStatus, to: health.status });
335
+ if (onStatusChange) {
336
+ onStatusChange(health.status);
337
+ }
338
+ lastStatus = health.status;
339
+ }
340
+ };
341
+ // Run immediately
342
+ await monitor();
343
+ // Then run on interval
344
+ return setInterval(monitor, intervalMs);
345
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Observability Module
3
+ *
4
+ * Centralized exports for observability functionality including logging,
5
+ * metrics, tracing, alerts, and health checks.
6
+ */
7
+ export * from './alerts.js';
8
+ export * from './health-check.js';
9
+ export * from './logger.js';
10
+ export * from './metrics.js';
11
+ export * from './tracing.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/observability/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Observability Module
3
+ *
4
+ * Centralized exports for observability functionality including logging,
5
+ * metrics, tracing, alerts, and health checks.
6
+ */
7
+ export * from './alerts.js';
8
+ export * from './health-check.js';
9
+ export * from './logger.js';
10
+ export * from './metrics.js';
11
+ export * from './tracing.js';
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Structured Logging Infrastructure
3
+ *
4
+ * Re-exports from @revealui/utils to maintain backward compatibility.
5
+ * The actual implementation has been moved to @revealui/utils to break circular dependencies.
6
+ */
7
+ export type { LogContext, LogEntry, LoggerConfig, LogLevel, } from '@revealui/utils/logger';
8
+ export { createLogger, Logger, logAudit, logError, logger, logQuery, } from '@revealui/utils/logger';
9
+ /**
10
+ * Request logger middleware
11
+ */
12
+ export declare function createRequestLogger<TRequest = unknown, TResponse = unknown>(options?: {
13
+ includeBody?: boolean;
14
+ includeHeaders?: boolean;
15
+ }): (request: TRequest & {
16
+ method: string;
17
+ url: string;
18
+ headers?: {
19
+ get?: (key: string) => string | null;
20
+ entries?: () => Iterable<[string, string]>;
21
+ };
22
+ }, next: () => Promise<TResponse>) => Promise<TResponse>;
23
+ /**
24
+ * Performance logger
25
+ */
26
+ export declare function logPerformance(operation: string, duration: number, context?: Record<string, unknown>): void;
27
+ /**
28
+ * API call logger
29
+ */
30
+ export declare function logAPICall(method: string, url: string, status: number, duration: number, context?: Record<string, unknown>): void;
31
+ /**
32
+ * Cache operation logger
33
+ */
34
+ export declare function logCache(operation: 'hit' | 'miss' | 'set' | 'delete', key: string, context?: Record<string, unknown>): void;
35
+ /**
36
+ * User action logger
37
+ */
38
+ export declare function logUserAction(action: string, userId?: string, context?: Record<string, unknown>): void;
39
+ /**
40
+ * System event logger
41
+ */
42
+ export declare function logSystemEvent(event: string, context?: Record<string, unknown>): void;
43
+ /**
44
+ * Sanitize sensitive data from logs
45
+ */
46
+ export declare function sanitizeLogData(data: Record<string, unknown>): Record<string, unknown>;
47
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/observability/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,YAAY,EACV,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAKhC;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,GAAG,OAAO,EAAE,SAAS,GAAG,OAAO,EACzE,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,IAG/D,SAAS,QAAQ,GAAG;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE;QACR,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;QACrC,OAAO,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KAC5C,CAAC;CACH,EACD,MAAM,MAAM,OAAO,CAAC,SAAS,CAAC,KAC7B,OAAO,CAAC,SAAS,CAAC,CA6CtB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,IAAI,CASN;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,IAAI,CAgBN;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,SAAS,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,EAC5C,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,IAAI,CAMN;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,IAAI,CAMN;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAKrF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA2BtF"}
@@ -0,0 +1,140 @@
1
+ /**
2
+ * Structured Logging Infrastructure
3
+ *
4
+ * Re-exports from @revealui/utils to maintain backward compatibility.
5
+ * The actual implementation has been moved to @revealui/utils to break circular dependencies.
6
+ */
7
+ // Import logger for internal use
8
+ import { logger as utilsLogger } from '@revealui/utils/logger';
9
+ export { createLogger, Logger, logAudit, logError, logger, logQuery, } from '@revealui/utils/logger';
10
+ // Additional helper functions that were in core but not in utils
11
+ // These can stay here as they're core-specific
12
+ /**
13
+ * Request logger middleware
14
+ */
15
+ export function createRequestLogger(options = {}) {
16
+ return async (request, next) => {
17
+ // Import logger at runtime to avoid circular deps
18
+ const { logger } = await import('@revealui/utils/logger');
19
+ const requestId = crypto.randomUUID();
20
+ const startTime = Date.now();
21
+ const requestLogger = logger.child({
22
+ requestId,
23
+ method: request.method,
24
+ url: request.url,
25
+ userAgent: request.headers?.get?.('user-agent'),
26
+ });
27
+ requestLogger.info('Request started');
28
+ if (options.includeHeaders) {
29
+ requestLogger.debug('Request headers', {
30
+ headers: Object.fromEntries(request.headers?.entries?.() || []),
31
+ });
32
+ }
33
+ try {
34
+ const response = await next();
35
+ const duration = Date.now() - startTime;
36
+ const responseWithStatus = response;
37
+ requestLogger.info('Request completed', {
38
+ status: responseWithStatus.status ?? 200,
39
+ duration,
40
+ });
41
+ return response;
42
+ }
43
+ catch (error) {
44
+ const duration = Date.now() - startTime;
45
+ requestLogger.error('Request failed', error instanceof Error ? error : new Error(String(error)), { duration });
46
+ throw error;
47
+ }
48
+ };
49
+ }
50
+ /**
51
+ * Performance logger
52
+ */
53
+ export function logPerformance(operation, duration, context) {
54
+ const level = duration > 1000 ? 'warn' : 'info';
55
+ utilsLogger[level](`Performance: ${operation}`, {
56
+ ...context,
57
+ operation,
58
+ duration,
59
+ slow: duration > 1000,
60
+ });
61
+ }
62
+ /**
63
+ * API call logger
64
+ */
65
+ export function logAPICall(method, url, status, duration, context) {
66
+ const apiContext = {
67
+ ...context,
68
+ method,
69
+ url,
70
+ status,
71
+ duration,
72
+ };
73
+ if (status >= 400) {
74
+ utilsLogger.error('API call', undefined, apiContext);
75
+ }
76
+ else if (status >= 300) {
77
+ utilsLogger.warn('API call', apiContext);
78
+ }
79
+ else {
80
+ utilsLogger.info('API call', apiContext);
81
+ }
82
+ }
83
+ /**
84
+ * Cache operation logger
85
+ */
86
+ export function logCache(operation, key, context) {
87
+ utilsLogger.debug(`Cache ${operation}`, {
88
+ ...context,
89
+ operation,
90
+ key,
91
+ });
92
+ }
93
+ /**
94
+ * User action logger
95
+ */
96
+ export function logUserAction(action, userId, context) {
97
+ utilsLogger.info('User action', {
98
+ ...context,
99
+ action,
100
+ userId,
101
+ });
102
+ }
103
+ /**
104
+ * System event logger
105
+ */
106
+ export function logSystemEvent(event, context) {
107
+ utilsLogger.info('System event', {
108
+ ...context,
109
+ event,
110
+ });
111
+ }
112
+ /**
113
+ * Sanitize sensitive data from logs
114
+ */
115
+ export function sanitizeLogData(data) {
116
+ const sensitiveKeys = [
117
+ 'password',
118
+ 'token',
119
+ 'secret',
120
+ 'apiKey',
121
+ 'accessToken',
122
+ 'refreshToken',
123
+ 'creditCard',
124
+ 'ssn',
125
+ ];
126
+ const sanitized = {};
127
+ for (const [key, value] of Object.entries(data)) {
128
+ const lowerKey = key.toLowerCase();
129
+ if (sensitiveKeys.some((sensitive) => lowerKey.includes(sensitive.toLowerCase()))) {
130
+ sanitized[key] = '[REDACTED]';
131
+ }
132
+ else if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
133
+ sanitized[key] = sanitizeLogData(value);
134
+ }
135
+ else {
136
+ sanitized[key] = value;
137
+ }
138
+ }
139
+ return sanitized;
140
+ }