@revealui/core 0.2.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. package/dist/api/compression.d.ts.map +1 -1
  2. package/dist/api/payload-optimization.d.ts.map +1 -1
  3. package/dist/api/rate-limit.d.ts +29 -28
  4. package/dist/api/rate-limit.d.ts.map +1 -1
  5. package/dist/api/rate-limit.js +63 -3
  6. package/dist/api/response-cache.d.ts.map +1 -1
  7. package/dist/api/response-cache.js +1 -1
  8. package/dist/api/rest.d.ts.map +1 -1
  9. package/dist/api/rest.js +3 -2
  10. package/dist/auth/access.d.ts.map +1 -1
  11. package/dist/auth/index.d.ts.map +1 -1
  12. package/dist/cache/query-cache.d.ts +12 -10
  13. package/dist/cache/query-cache.d.ts.map +1 -1
  14. package/dist/cache/query-cache.js +38 -42
  15. package/dist/caching/index.d.ts +6 -0
  16. package/dist/caching/index.d.ts.map +1 -0
  17. package/dist/caching/index.js +5 -0
  18. package/dist/client/admin/RichText.d.ts +1 -1
  19. package/dist/client/admin/RichText.d.ts.map +1 -1
  20. package/dist/client/admin/components/AdminDashboard.d.ts.map +1 -1
  21. package/dist/client/admin/components/AdminDashboard.js +195 -205
  22. package/dist/client/admin/components/CollectionList.d.ts.map +1 -1
  23. package/dist/client/admin/components/DocumentForm.d.ts.map +1 -1
  24. package/dist/client/admin/components/DocumentForm.js +130 -6
  25. package/dist/client/admin/components/GlobalForm.d.ts.map +1 -1
  26. package/dist/client/admin/context/ServerFunctionContext.d.ts +8 -0
  27. package/dist/client/admin/context/ServerFunctionContext.d.ts.map +1 -0
  28. package/dist/client/admin/context/ServerFunctionContext.js +15 -0
  29. package/dist/client/admin/i18n/en.d.ts.map +1 -1
  30. package/dist/client/admin/index.d.ts +1 -0
  31. package/dist/client/admin/index.d.ts.map +1 -1
  32. package/dist/client/admin/index.js +1 -0
  33. package/dist/client/admin/layout.d.ts +1 -1
  34. package/dist/client/admin/layout.d.ts.map +1 -1
  35. package/dist/client/admin/layout.js +3 -2
  36. package/dist/client/admin/page.d.ts.map +1 -1
  37. package/dist/client/admin/utils/apiClient.d.ts.map +1 -1
  38. package/dist/client/admin/utils/apiClient.js +0 -4
  39. package/dist/client/admin/utils/index.d.ts +0 -1
  40. package/dist/client/admin/utils/index.d.ts.map +1 -1
  41. package/dist/client/admin/utils/index.js +0 -1
  42. package/dist/client/admin/utils/serializeConfig.d.ts.map +1 -1
  43. package/dist/client/hooks.d.ts.map +1 -1
  44. package/dist/client/index.d.ts.map +1 -1
  45. package/dist/client/richtext/RichTextEditor.d.ts.map +1 -1
  46. package/dist/client/richtext/components/ImageNodeComponent.d.ts.map +1 -1
  47. package/dist/client/richtext/components/ImageNodeComponent.js +0 -1
  48. package/dist/client/richtext/components/ImageUploadButton.d.ts +2 -0
  49. package/dist/client/richtext/components/ImageUploadButton.d.ts.map +1 -1
  50. package/dist/client/richtext/components/ImageUploadButton.js +30 -15
  51. package/dist/client/richtext/index.d.ts.map +1 -1
  52. package/dist/client/richtext/nodes/DecoratorBlockNode.d.ts.map +1 -1
  53. package/dist/client/richtext/nodes/ImageNode.d.ts.map +1 -1
  54. package/dist/client/richtext/plugins/CollaborationPlugin.d.ts.map +1 -1
  55. package/dist/client/richtext/plugins/CursorsOverlayPlugin.d.ts.map +1 -1
  56. package/dist/client/richtext/plugins/FloatingToolbarPlugin.d.ts.map +1 -1
  57. package/dist/client/richtext/plugins/FloatingToolbarPlugin.js +1 -3
  58. package/dist/client/richtext/plugins/ImagePlugin.d.ts.map +1 -1
  59. package/dist/client/richtext/plugins/ToolbarPlugin.d.ts.map +1 -1
  60. package/dist/client/ui/index.d.ts.map +1 -1
  61. package/dist/client/ui/index.js +1 -1
  62. package/dist/collections/CollectionOperations.d.ts +7 -7
  63. package/dist/collections/CollectionOperations.d.ts.map +1 -1
  64. package/dist/collections/CollectionOperations.js +15 -1
  65. package/dist/collections/hooks.d.ts.map +1 -1
  66. package/dist/collections/index.d.ts.map +1 -1
  67. package/dist/collections/operations/create.d.ts +4 -5
  68. package/dist/collections/operations/create.d.ts.map +1 -1
  69. package/dist/collections/operations/create.js +35 -6
  70. package/dist/collections/operations/createMany.d.ts +12 -0
  71. package/dist/collections/operations/createMany.d.ts.map +1 -0
  72. package/dist/collections/operations/createMany.js +43 -0
  73. package/dist/collections/operations/delete.d.ts +1 -1
  74. package/dist/collections/operations/delete.d.ts.map +1 -1
  75. package/dist/collections/operations/delete.js +31 -2
  76. package/dist/collections/operations/deleteMany.d.ts +11 -0
  77. package/dist/collections/operations/deleteMany.d.ts.map +1 -0
  78. package/dist/collections/operations/deleteMany.js +50 -0
  79. package/dist/collections/operations/fieldHooks.d.ts +2 -2
  80. package/dist/collections/operations/fieldHooks.d.ts.map +1 -1
  81. package/dist/collections/operations/fieldHooks.js +4 -4
  82. package/dist/collections/operations/find.d.ts +2 -4
  83. package/dist/collections/operations/find.d.ts.map +1 -1
  84. package/dist/collections/operations/find.js +115 -8
  85. package/dist/collections/operations/findById.d.ts +3 -4
  86. package/dist/collections/operations/findById.d.ts.map +1 -1
  87. package/dist/collections/operations/findById.js +53 -1
  88. package/dist/collections/operations/sqlAdapter.d.ts +23 -0
  89. package/dist/collections/operations/sqlAdapter.d.ts.map +1 -0
  90. package/dist/collections/operations/sqlAdapter.js +76 -0
  91. package/dist/collections/operations/update.d.ts +3 -5
  92. package/dist/collections/operations/update.d.ts.map +1 -1
  93. package/dist/collections/operations/update.js +103 -11
  94. package/dist/collections/operations/updateMany.d.ts +11 -0
  95. package/dist/collections/operations/updateMany.d.ts.map +1 -0
  96. package/dist/collections/operations/updateMany.js +52 -0
  97. package/dist/collections/registry.d.ts +12 -0
  98. package/dist/collections/registry.d.ts.map +1 -0
  99. package/dist/collections/registry.js +38 -0
  100. package/dist/config/index.d.ts.map +1 -1
  101. package/dist/config/runtime.d.ts.map +1 -1
  102. package/dist/config/utils.d.ts +0 -10
  103. package/dist/config/utils.d.ts.map +1 -1
  104. package/dist/config/utils.js +0 -13
  105. package/dist/database/index.d.ts +3 -0
  106. package/dist/database/index.d.ts.map +1 -1
  107. package/dist/database/index.js +1 -5
  108. package/dist/database/safe-parse.d.ts.map +1 -1
  109. package/dist/database/ssl-config.d.ts.map +1 -1
  110. package/dist/database/type-adapter.d.ts.map +1 -1
  111. package/dist/database/universal-postgres.d.ts.map +1 -1
  112. package/dist/database/universal-postgres.js +6 -1
  113. package/dist/dataloader.d.ts.map +1 -1
  114. package/dist/error-handling/error-boundary.d.ts.map +1 -1
  115. package/dist/error-handling/error-reporter.d.ts +1 -1
  116. package/dist/error-handling/error-reporter.d.ts.map +1 -1
  117. package/dist/error-handling/error-reporter.js +19 -5
  118. package/dist/error-handling/fallback-components.d.ts.map +1 -1
  119. package/dist/error-handling/fallback-components.js +1 -1
  120. package/dist/error-handling/index.d.ts +2 -4
  121. package/dist/error-handling/index.d.ts.map +1 -1
  122. package/dist/error-handling/index.js +1 -4
  123. package/dist/factories/builders.d.ts.map +1 -1
  124. package/dist/factories/index.d.ts.map +1 -1
  125. package/dist/features.d.ts +7 -7
  126. package/dist/features.d.ts.map +1 -1
  127. package/dist/features.js +2 -2
  128. package/dist/fieldTraversal.d.ts.map +1 -1
  129. package/dist/fields/config/types.d.ts.map +1 -1
  130. package/dist/fields/getDefaultValue.d.ts.map +1 -1
  131. package/dist/fields/getFieldPaths.d.ts.map +1 -1
  132. package/dist/fields/hooks/afterRead/index.d.ts.map +1 -1
  133. package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
  134. package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -1
  135. package/dist/generated/types/cms.d.ts.map +1 -1
  136. package/dist/generated/types/cms.js +0 -1
  137. package/dist/generated/types/neon.d.ts.map +1 -1
  138. package/dist/generated/types/neon.js +4 -2
  139. package/dist/globals/GlobalOperations.d.ts.map +1 -1
  140. package/dist/globals/GlobalOperations.js +16 -4
  141. package/dist/globals/index.d.ts.map +1 -1
  142. package/dist/index.d.ts +15 -4
  143. package/dist/index.d.ts.map +1 -1
  144. package/dist/index.js +15 -5
  145. package/dist/instance/RevealUIInstance.d.ts.map +1 -1
  146. package/dist/instance/RevealUIInstance.js +6 -19
  147. package/dist/instance/index.d.ts.map +1 -1
  148. package/dist/instance/logger.d.ts.map +1 -1
  149. package/dist/instance/methods/create.d.ts.map +1 -1
  150. package/dist/instance/methods/create.js +0 -3
  151. package/dist/instance/methods/delete.d.ts.map +1 -1
  152. package/dist/instance/methods/delete.js +1 -4
  153. package/dist/instance/methods/find.d.ts.map +1 -1
  154. package/dist/instance/methods/find.js +0 -3
  155. package/dist/instance/methods/findById.d.ts.map +1 -1
  156. package/dist/instance/methods/findById.js +0 -3
  157. package/dist/instance/methods/hooks.d.ts.map +1 -1
  158. package/dist/instance/methods/update.d.ts.map +1 -1
  159. package/dist/instance/methods/update.js +0 -3
  160. package/dist/jobs/index.d.ts +16 -0
  161. package/dist/jobs/index.d.ts.map +1 -0
  162. package/dist/jobs/index.js +14 -0
  163. package/dist/jobs/queue.d.ts +57 -0
  164. package/dist/jobs/queue.d.ts.map +1 -0
  165. package/dist/jobs/queue.js +134 -0
  166. package/dist/license-encryption.d.ts +21 -0
  167. package/dist/license-encryption.d.ts.map +1 -0
  168. package/dist/license-encryption.js +74 -0
  169. package/dist/license.d.ts +26 -3
  170. package/dist/license.d.ts.map +1 -1
  171. package/dist/license.js +87 -7
  172. package/dist/monitoring/alerts.d.ts +4 -4
  173. package/dist/monitoring/alerts.d.ts.map +1 -1
  174. package/dist/monitoring/cleanup-manager.d.ts.map +1 -1
  175. package/dist/monitoring/health-monitor.d.ts.map +1 -1
  176. package/dist/monitoring/index.d.ts.map +1 -1
  177. package/dist/monitoring/process-registry.d.ts.map +1 -1
  178. package/dist/monitoring/query-monitor.d.ts.map +1 -1
  179. package/dist/monitoring/types.d.ts.map +1 -1
  180. package/dist/monitoring/zombie-detector.d.ts.map +1 -1
  181. package/dist/monitoring/zombie-detector.js +5 -0
  182. package/dist/nextjs/index.d.ts.map +1 -1
  183. package/dist/nextjs/utilities.d.ts.map +1 -1
  184. package/dist/nextjs/withRevealUI.d.ts.map +1 -1
  185. package/dist/observability/alerts.d.ts.map +1 -1
  186. package/dist/observability/alerts.js +1 -2
  187. package/dist/observability/health-check.d.ts +0 -4
  188. package/dist/observability/health-check.d.ts.map +1 -1
  189. package/dist/observability/health-check.js +0 -36
  190. package/dist/observability/index.d.ts.map +1 -1
  191. package/dist/observability/logger.d.ts.map +1 -1
  192. package/dist/observability/logger.js +1 -1
  193. package/dist/observability/metrics.d.ts.map +1 -1
  194. package/dist/observability/tracing.d.ts.map +1 -1
  195. package/dist/observability/tracing.js +0 -1
  196. package/dist/plugins/form-builder.d.ts.map +1 -1
  197. package/dist/plugins/index.d.ts.map +1 -1
  198. package/dist/plugins/nested-docs.d.ts +4 -0
  199. package/dist/plugins/nested-docs.d.ts.map +1 -1
  200. package/dist/plugins/nested-docs.js +50 -6
  201. package/dist/plugins/redirects.d.ts.map +1 -1
  202. package/dist/queries/index.d.ts.map +1 -1
  203. package/dist/queries/queryBuilder.d.ts.map +1 -1
  204. package/dist/queries/queryBuilder.js +13 -5
  205. package/dist/relationships/analyzer.d.ts.map +1 -1
  206. package/dist/relationships/analyzer.js +8 -0
  207. package/dist/relationships/index.d.ts.map +1 -1
  208. package/dist/relationships/populate-core.d.ts +57 -0
  209. package/dist/relationships/populate-core.d.ts.map +1 -0
  210. package/dist/relationships/populate-core.js +116 -0
  211. package/dist/relationships/populate-helpers.d.ts +5 -51
  212. package/dist/relationships/populate-helpers.d.ts.map +1 -1
  213. package/dist/relationships/populate-helpers.js +4 -109
  214. package/dist/relationships/population.d.ts +1 -9
  215. package/dist/relationships/population.d.ts.map +1 -1
  216. package/dist/relationships/population.js +8 -3
  217. package/dist/revealui.d.ts.map +1 -1
  218. package/dist/richtext/exports/client/rcc.d.ts.map +1 -1
  219. package/dist/richtext/exports/client/rcc.js +1 -1
  220. package/dist/richtext/exports/server/rsc.d.ts +17 -0
  221. package/dist/richtext/exports/server/rsc.d.ts.map +1 -1
  222. package/dist/richtext/exports/server/rsc.js +61 -5
  223. package/dist/richtext/index.d.ts.map +1 -1
  224. package/dist/richtext/lexical.d.ts.map +1 -1
  225. package/dist/security/index.d.ts +3 -16
  226. package/dist/security/index.d.ts.map +1 -1
  227. package/dist/security/index.js +3 -16
  228. package/dist/server/index.d.ts.map +1 -1
  229. package/dist/server/renderPage.d.ts.map +1 -1
  230. package/dist/storage/index.d.ts +1 -0
  231. package/dist/storage/index.d.ts.map +1 -1
  232. package/dist/storage/index.js +2 -4
  233. package/dist/storage/vercel-blob.d.ts.map +1 -1
  234. package/dist/storage/vercel-blob.js +3 -0
  235. package/dist/translations/index.d.ts.map +1 -1
  236. package/dist/types/access.d.ts.map +1 -1
  237. package/dist/types/api.d.ts.map +1 -1
  238. package/dist/types/cms.d.ts.map +1 -1
  239. package/dist/types/config.d.ts.map +1 -1
  240. package/dist/types/core.d.ts +1 -1
  241. package/dist/types/core.d.ts.map +1 -1
  242. package/dist/types/extensions.d.ts.map +1 -1
  243. package/dist/types/frontend.d.ts.map +1 -1
  244. package/dist/types/generated.d.ts.map +1 -1
  245. package/dist/types/hooks.d.ts.map +1 -1
  246. package/dist/types/index.d.ts +1 -1
  247. package/dist/types/index.d.ts.map +1 -1
  248. package/dist/types/interfaces/app.d.ts.map +1 -1
  249. package/dist/types/jobs.d.ts.map +1 -1
  250. package/dist/types/legacy.d.ts.map +1 -1
  251. package/dist/types/plugins.d.ts.map +1 -1
  252. package/dist/types/query.d.ts.map +1 -1
  253. package/dist/types/request.d.ts.map +1 -1
  254. package/dist/types/richtext.d.ts.map +1 -1
  255. package/dist/types/runtime.d.ts +60 -1
  256. package/dist/types/runtime.d.ts.map +1 -1
  257. package/dist/types/schema.d.ts.map +1 -1
  258. package/dist/types/user.d.ts.map +1 -1
  259. package/dist/utils/access-conversion.d.ts.map +1 -1
  260. package/dist/utils/api-wrapper.d.ts.map +1 -1
  261. package/dist/utils/api-wrapper.js +1 -1
  262. package/dist/utils/block-conversion.d.ts.map +1 -1
  263. package/dist/utils/cache.d.ts.map +1 -1
  264. package/dist/utils/deep-clone.js +0 -1
  265. package/dist/utils/error-responses.d.ts.map +1 -1
  266. package/dist/utils/error-responses.js +2 -3
  267. package/dist/utils/errors.d.ts +36 -0
  268. package/dist/utils/errors.d.ts.map +1 -1
  269. package/dist/utils/errors.js +103 -0
  270. package/dist/utils/field-conversion.d.ts +1 -1
  271. package/dist/utils/field-conversion.d.ts.map +1 -1
  272. package/dist/utils/flattenResult.d.ts.map +1 -1
  273. package/dist/utils/flattenResult.js +0 -1
  274. package/dist/utils/getBlockSelect.d.ts.map +1 -1
  275. package/dist/utils/getSelectMode.d.ts.map +1 -1
  276. package/dist/utils/isValidID.d.ts.map +1 -1
  277. package/dist/utils/json-parsing.d.ts.map +1 -1
  278. package/dist/utils/logger-client.d.ts.map +1 -1
  279. package/dist/utils/logger-server.d.ts.map +1 -1
  280. package/dist/utils/logger.d.ts.map +1 -1
  281. package/dist/utils/request-context.d.ts.map +1 -1
  282. package/dist/utils/stripUnselectedFields.d.ts.map +1 -1
  283. package/dist/utils/type-guards.d.ts.map +1 -1
  284. package/package.json +58 -26
  285. package/dist/caching/app-cache.d.ts +0 -237
  286. package/dist/caching/app-cache.d.ts.map +0 -1
  287. package/dist/caching/app-cache.js +0 -430
  288. package/dist/caching/cdn-config.d.ts +0 -155
  289. package/dist/caching/cdn-config.d.ts.map +0 -1
  290. package/dist/caching/cdn-config.js +0 -411
  291. package/dist/caching/edge-cache.d.ts +0 -177
  292. package/dist/caching/edge-cache.d.ts.map +0 -1
  293. package/dist/caching/edge-cache.js +0 -385
  294. package/dist/caching/service-worker.d.ts +0 -154
  295. package/dist/caching/service-worker.d.ts.map +0 -1
  296. package/dist/caching/service-worker.js +0 -437
  297. package/dist/client/admin/utils/auth.d.ts +0 -23
  298. package/dist/client/admin/utils/auth.d.ts.map +0 -1
  299. package/dist/client/admin/utils/auth.js +0 -52
  300. package/dist/client/http/client.d.ts +0 -15
  301. package/dist/client/http/client.d.ts.map +0 -1
  302. package/dist/client/http/client.js +0 -49
  303. package/dist/client/http/fetchBanner.d.ts +0 -18
  304. package/dist/client/http/fetchBanner.d.ts.map +0 -1
  305. package/dist/client/http/fetchBanner.js +0 -44
  306. package/dist/client/http/fetchCard.d.ts +0 -18
  307. package/dist/client/http/fetchCard.d.ts.map +0 -1
  308. package/dist/client/http/fetchCard.js +0 -46
  309. package/dist/client/http/fetchEvents.d.ts +0 -18
  310. package/dist/client/http/fetchEvents.d.ts.map +0 -1
  311. package/dist/client/http/fetchEvents.js +0 -44
  312. package/dist/client/http/fetchHero.d.ts +0 -17
  313. package/dist/client/http/fetchHero.d.ts.map +0 -1
  314. package/dist/client/http/fetchHero.js +0 -55
  315. package/dist/client/http/fetchMainInfos.d.ts +0 -17
  316. package/dist/client/http/fetchMainInfos.d.ts.map +0 -1
  317. package/dist/client/http/fetchMainInfos.js +0 -44
  318. package/dist/client/http/fetchVideos.d.ts +0 -13
  319. package/dist/client/http/fetchVideos.d.ts.map +0 -1
  320. package/dist/client/http/fetchVideos.js +0 -36
  321. package/dist/client/http/index.d.ts +0 -19
  322. package/dist/client/http/index.d.ts.map +0 -1
  323. package/dist/client/http/index.js +0 -11
  324. package/dist/error-handling/circuit-breaker.d.ts +0 -262
  325. package/dist/error-handling/circuit-breaker.d.ts.map +0 -1
  326. package/dist/error-handling/circuit-breaker.js +0 -542
  327. package/dist/error-handling/retry.d.ts +0 -194
  328. package/dist/error-handling/retry.d.ts.map +0 -1
  329. package/dist/error-handling/retry.js +0 -450
  330. package/dist/errors/index.d.ts +0 -23
  331. package/dist/errors/index.d.ts.map +0 -1
  332. package/dist/errors/index.js +0 -40
  333. package/dist/generated/agents/index.d.ts +0 -8
  334. package/dist/generated/agents/index.d.ts.map +0 -1
  335. package/dist/generated/agents/index.js +0 -7
  336. package/dist/generated/components/index.d.ts +0 -8
  337. package/dist/generated/components/index.d.ts.map +0 -1
  338. package/dist/generated/components/index.js +0 -7
  339. package/dist/generated/functions/index.d.ts +0 -8
  340. package/dist/generated/functions/index.d.ts.map +0 -1
  341. package/dist/generated/functions/index.js +0 -7
  342. package/dist/generated/hooks/index.d.ts +0 -8
  343. package/dist/generated/hooks/index.d.ts.map +0 -1
  344. package/dist/generated/hooks/index.js +0 -7
  345. package/dist/generated/plans/index.d.ts +0 -8
  346. package/dist/generated/plans/index.d.ts.map +0 -1
  347. package/dist/generated/plans/index.js +0 -7
  348. package/dist/generated/prompts/index.d.ts +0 -8
  349. package/dist/generated/prompts/index.d.ts.map +0 -1
  350. package/dist/generated/prompts/index.js +0 -7
  351. package/dist/generated/tools/index.d.ts +0 -8
  352. package/dist/generated/tools/index.d.ts.map +0 -1
  353. package/dist/generated/tools/index.js +0 -7
  354. package/dist/generated/types/supabase.d.ts +0 -193
  355. package/dist/generated/types/supabase.d.ts.map +0 -1
  356. package/dist/generated/types/supabase.js +0 -5
  357. package/dist/optimization/asset-optimizer.d.ts +0 -202
  358. package/dist/optimization/asset-optimizer.d.ts.map +0 -1
  359. package/dist/optimization/asset-optimizer.js +0 -312
  360. package/dist/optimization/build-optimizer.d.ts +0 -202
  361. package/dist/optimization/build-optimizer.d.ts.map +0 -1
  362. package/dist/optimization/build-optimizer.js +0 -271
  363. package/dist/optimization/bundle-analyzer.d.ts +0 -98
  364. package/dist/optimization/bundle-analyzer.d.ts.map +0 -1
  365. package/dist/optimization/bundle-analyzer.js +0 -322
  366. package/dist/optimization/code-splitting.d.ts +0 -131
  367. package/dist/optimization/code-splitting.d.ts.map +0 -1
  368. package/dist/optimization/code-splitting.js +0 -277
  369. package/dist/plugin/index.d.ts +0 -12
  370. package/dist/plugin/index.d.ts.map +0 -1
  371. package/dist/plugin/index.js +0 -4
  372. package/dist/security/audit.d.ts +0 -188
  373. package/dist/security/audit.d.ts.map +0 -1
  374. package/dist/security/audit.js +0 -431
  375. package/dist/security/auth.d.ts +0 -241
  376. package/dist/security/auth.d.ts.map +0 -1
  377. package/dist/security/auth.js +0 -476
  378. package/dist/security/authorization.d.ts +0 -235
  379. package/dist/security/authorization.d.ts.map +0 -1
  380. package/dist/security/authorization.js +0 -434
  381. package/dist/security/encryption.d.ts +0 -214
  382. package/dist/security/encryption.d.ts.map +0 -1
  383. package/dist/security/encryption.js +0 -517
  384. package/dist/security/gdpr.d.ts +0 -300
  385. package/dist/security/gdpr.d.ts.map +0 -1
  386. package/dist/security/gdpr.js +0 -465
  387. package/dist/security/headers.d.ts +0 -182
  388. package/dist/security/headers.d.ts.map +0 -1
  389. package/dist/security/headers.js +0 -402
  390. package/dist/utils/jwt-validation.d.ts +0 -14
  391. package/dist/utils/jwt-validation.d.ts.map +0 -1
  392. package/dist/utils/jwt-validation.js +0 -36
  393. package/dist/utils/request-headers.d.ts +0 -15
  394. package/dist/utils/request-headers.d.ts.map +0 -1
  395. package/dist/utils/request-headers.js +0 -31
@@ -1,131 +0,0 @@
1
- /**
2
- * Code Splitting Utilities
3
- *
4
- * Helpers for dynamic imports, lazy loading, and code splitting
5
- */
6
- import { type ComponentType, type LazyExoticComponent } from 'react';
7
- /**
8
- * Lazy load component with retry logic
9
- */
10
- export interface LazyLoadOptions {
11
- maxRetries?: number;
12
- retryDelay?: number;
13
- fallback?: ComponentType;
14
- }
15
- export declare function lazyWithRetry<TProps = Record<string, unknown>>(importFn: () => Promise<{
16
- default: ComponentType<TProps>;
17
- }>, options?: LazyLoadOptions): LazyExoticComponent<ComponentType<TProps>>;
18
- /**
19
- * Preload component
20
- */
21
- export declare function preloadComponent<T = unknown>(importFn: () => Promise<T>): Promise<T>;
22
- /**
23
- * Lazy load with prefetch on hover
24
- */
25
- export declare function lazyWithPrefetch<TProps = Record<string, unknown>>(importFn: () => Promise<{
26
- default: ComponentType<TProps>;
27
- }>): {
28
- Component: LazyExoticComponent<ComponentType<TProps>>;
29
- prefetch: () => void;
30
- };
31
- /**
32
- * Route-based code splitting helper
33
- */
34
- export interface RouteConfig<TProps = Record<string, unknown>> {
35
- path: string;
36
- component: () => Promise<{
37
- default: ComponentType<TProps>;
38
- }>;
39
- preload?: boolean;
40
- }
41
- export declare function createRoutes(configs: RouteConfig[]): {
42
- path: string;
43
- Component: LazyExoticComponent<ComponentType<Record<string, unknown>>>;
44
- preload: (() => Promise<{
45
- default: ComponentType<Record<string, unknown>>;
46
- }>) | undefined;
47
- }[];
48
- /**
49
- * Chunk naming helper
50
- */
51
- export declare function createChunkName(name: string): string;
52
- /**
53
- * Dynamic import with webpack magic comments
54
- */
55
- export declare function lazyWithChunkName<TProps = Record<string, unknown>>(_chunkName: string, importFn: () => Promise<{
56
- default: ComponentType<TProps>;
57
- }>): LazyExoticComponent<ComponentType<TProps>>;
58
- /**
59
- * Prefetch multiple components
60
- */
61
- export declare function prefetchComponents<T = unknown>(importFns: Array<() => Promise<T>>): Promise<T[]>;
62
- /**
63
- * Idle callback prefetch
64
- */
65
- export declare function prefetchOnIdle(importFn: () => Promise<unknown>): void;
66
- /**
67
- * Intersection observer prefetch
68
- */
69
- export declare function prefetchOnVisible(element: HTMLElement | null, importFn: () => Promise<unknown>, options?: IntersectionObserverInit): () => void;
70
- /**
71
- * Media query based loading
72
- */
73
- export declare function loadOnMediaQuery(query: string, importFn: () => Promise<unknown>): () => void;
74
- /**
75
- * Load on interaction (click, hover, focus)
76
- */
77
- export declare function loadOnInteraction(element: HTMLElement | null, importFn: () => Promise<unknown>, events?: string[]): () => void;
78
- /**
79
- * Split vendors into separate chunks
80
- */
81
- export interface VendorChunkConfig {
82
- name: string;
83
- test: RegExp;
84
- priority?: number;
85
- }
86
- export declare const VENDOR_CHUNK_CONFIGS: VendorChunkConfig[];
87
- /**
88
- * Generate webpack splitChunks config
89
- */
90
- export declare function generateSplitChunksConfig(customChunks?: VendorChunkConfig[]): {
91
- chunks: string;
92
- maxInitialRequests: number;
93
- maxAsyncRequests: number;
94
- minSize: number;
95
- cacheGroups: Record<string, unknown>;
96
- };
97
- /**
98
- * Module concatenation helper
99
- */
100
- export declare function shouldConcatenateModule(modulePath: string): boolean;
101
- /**
102
- * Tree shaking helper - mark side effects
103
- */
104
- export declare function markPureCall(fn: Function): Function;
105
- /**
106
- * Inline critical scripts
107
- */
108
- export declare function shouldInlineScript(scriptPath: string, size: number): boolean;
109
- /**
110
- * Bundle budget checker
111
- */
112
- export interface BundleBudget {
113
- maxSize: number;
114
- maxInitialSize: number;
115
- maxAsyncSize: number;
116
- maxCSSSize: number;
117
- }
118
- export declare const DEFAULT_BUDGETS: BundleBudget;
119
- export interface BudgetViolation {
120
- type: 'total' | 'initial' | 'async' | 'css';
121
- actual: number;
122
- budget: number;
123
- exceeded: number;
124
- }
125
- export declare function checkBundleBudgets(stats: {
126
- totalSize: number;
127
- initialSize: number;
128
- asyncSizes: number[];
129
- cssSize: number;
130
- }, budgets?: BundleBudget): BudgetViolation[];
131
- //# sourceMappingURL=code-splitting.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"code-splitting.d.ts","sourceRoot":"","sources":["../../src/optimization/code-splitting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAQ,MAAM,OAAO,CAAA;AAG1E;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,aAAa,CAAA;CACzB;AAED,wBAAgB,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5D,QAAQ,EAAE,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC,EAC3D,OAAO,GAAE,eAAoB,GAC5B,mBAAmB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CA6B5C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,O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,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,eAAe,EAAE,YAK7B,CAAA;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,CAAA;IAC3C,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE;IACL,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,GAAE,YAA8B,GACtC,eAAe,EAAE,CA0CnB"}
@@ -1,277 +0,0 @@
1
- /**
2
- * Code Splitting Utilities
3
- *
4
- * Helpers for dynamic imports, lazy loading, and code splitting
5
- */
6
- import { lazy } from 'react';
7
- import { logger } from '../observability/logger.js';
8
- export function lazyWithRetry(importFn, options = {}) {
9
- const { maxRetries = 3, retryDelay = 1000 } = options;
10
- return lazy(() => {
11
- return new Promise((resolve, reject) => {
12
- let retries = 0;
13
- const attemptImport = () => {
14
- importFn()
15
- .then(resolve)
16
- .catch((error) => {
17
- if (retries < maxRetries) {
18
- retries++;
19
- logger.warn('Import failed, retrying', { attempt: retries, maxRetries });
20
- setTimeout(attemptImport, retryDelay);
21
- }
22
- else {
23
- logger.error('Import failed after max retries', error instanceof Error ? error : new Error(String(error)), { maxRetries });
24
- reject(error);
25
- }
26
- });
27
- };
28
- attemptImport();
29
- });
30
- });
31
- }
32
- /**
33
- * Preload component
34
- */
35
- export function preloadComponent(importFn) {
36
- return importFn();
37
- }
38
- /**
39
- * Lazy load with prefetch on hover
40
- */
41
- export function lazyWithPrefetch(importFn) {
42
- let importPromise = null;
43
- const prefetch = () => {
44
- if (!importPromise) {
45
- importPromise = importFn();
46
- }
47
- return importPromise;
48
- };
49
- const Component = lazy(() => {
50
- if (!importPromise) {
51
- importPromise = importFn();
52
- }
53
- return importPromise;
54
- });
55
- return { Component, prefetch };
56
- }
57
- export function createRoutes(configs) {
58
- return configs.map((config) => ({
59
- path: config.path,
60
- Component: lazy(config.component),
61
- preload: config.preload ? () => config.component() : undefined,
62
- }));
63
- }
64
- /**
65
- * Chunk naming helper
66
- */
67
- export function createChunkName(name) {
68
- return name.replace(/[^a-zA-Z0-9]/g, '-').toLowerCase();
69
- }
70
- /**
71
- * Dynamic import with webpack magic comments
72
- */
73
- export function lazyWithChunkName(_chunkName, importFn) {
74
- // In production, webpack will use the magic comment in the actual import
75
- // This is a runtime helper for consistency
76
- return lazy(importFn);
77
- }
78
- /**
79
- * Prefetch multiple components
80
- */
81
- export function prefetchComponents(importFns) {
82
- return Promise.all(importFns.map((fn) => fn()));
83
- }
84
- /**
85
- * Idle callback prefetch
86
- */
87
- export function prefetchOnIdle(importFn) {
88
- if ('requestIdleCallback' in window) {
89
- window.requestIdleCallback(() => importFn());
90
- }
91
- else {
92
- // Fallback for browsers without requestIdleCallback
93
- setTimeout(() => importFn(), 1);
94
- }
95
- }
96
- /**
97
- * Intersection observer prefetch
98
- */
99
- export function prefetchOnVisible(element, importFn, options) {
100
- if (!element || typeof IntersectionObserver === 'undefined') {
101
- return () => { };
102
- }
103
- const observer = new IntersectionObserver((entries) => {
104
- for (const entry of entries) {
105
- if (entry.isIntersecting) {
106
- importFn();
107
- observer.disconnect();
108
- }
109
- }
110
- }, options);
111
- observer.observe(element);
112
- return () => observer.disconnect();
113
- }
114
- /**
115
- * Media query based loading
116
- */
117
- export function loadOnMediaQuery(query, importFn) {
118
- if (typeof window === 'undefined') {
119
- return () => { };
120
- }
121
- const mediaQuery = window.matchMedia(query);
122
- const handleChange = (e) => {
123
- if (e.matches) {
124
- importFn();
125
- }
126
- };
127
- // Check initial state
128
- if (mediaQuery.matches) {
129
- importFn();
130
- }
131
- // Listen for changes
132
- mediaQuery.addEventListener('change', handleChange);
133
- return () => mediaQuery.removeEventListener('change', handleChange);
134
- }
135
- /**
136
- * Load on interaction (click, hover, focus)
137
- */
138
- export function loadOnInteraction(element, importFn, events = ['mouseenter', 'focus']) {
139
- if (!element) {
140
- return () => { };
141
- }
142
- let loaded = false;
143
- const handleInteraction = () => {
144
- if (!loaded) {
145
- loaded = true;
146
- importFn();
147
- cleanup();
148
- }
149
- };
150
- const cleanup = () => {
151
- for (const event of events) {
152
- element.removeEventListener(event, handleInteraction);
153
- }
154
- };
155
- for (const event of events) {
156
- element.addEventListener(event, handleInteraction, { once: true });
157
- }
158
- return cleanup;
159
- }
160
- export const VENDOR_CHUNK_CONFIGS = [
161
- {
162
- name: 'react-vendors',
163
- test: /[\\/]node_modules[\\/](react|react-dom|react-router|react-router-dom)[\\/]/,
164
- priority: 10,
165
- },
166
- {
167
- name: 'ui-vendors',
168
- test: /[\\/]node_modules[\\/](class-variance-authority|clsx)[\\/]/,
169
- priority: 9,
170
- },
171
- {
172
- name: 'utils-vendors',
173
- test: /[\\/]node_modules[\\/](lodash|date-fns|classnames|clsx)[\\/]/,
174
- priority: 8,
175
- },
176
- {
177
- name: 'vendors',
178
- test: /[\\/]node_modules[\\/]/,
179
- priority: 5,
180
- },
181
- ];
182
- /**
183
- * Generate webpack splitChunks config
184
- */
185
- export function generateSplitChunksConfig(customChunks = []) {
186
- const chunks = [...VENDOR_CHUNK_CONFIGS, ...customChunks];
187
- const cacheGroups = {};
188
- for (const chunk of chunks) {
189
- cacheGroups[chunk.name] = {
190
- test: chunk.test,
191
- priority: chunk.priority || 5,
192
- reuseExistingChunk: true,
193
- enforce: true,
194
- };
195
- }
196
- return {
197
- chunks: 'all',
198
- maxInitialRequests: 25,
199
- maxAsyncRequests: 25,
200
- minSize: 20000,
201
- cacheGroups,
202
- };
203
- }
204
- /**
205
- * Module concatenation helper
206
- */
207
- export function shouldConcatenateModule(modulePath) {
208
- // Don't concatenate node_modules by default
209
- if (modulePath.includes('node_modules')) {
210
- return false;
211
- }
212
- // Concatenate ES modules
213
- return modulePath.endsWith('.js') || modulePath.endsWith('.ts');
214
- }
215
- /**
216
- * Tree shaking helper - mark side effects
217
- */
218
- export function markPureCall(fn) {
219
- // This is for documentation purposes
220
- // Actual tree shaking is done by bundler
221
- return fn;
222
- }
223
- /**
224
- * Inline critical scripts
225
- */
226
- export function shouldInlineScript(scriptPath, size) {
227
- // Inline if:
228
- // 1. Critical script (runtime, polyfills)
229
- // 2. Small size (<5KB)
230
- const isCritical = scriptPath.includes('runtime') || scriptPath.includes('polyfill');
231
- const isSmall = size < 5 * 1024;
232
- return isCritical || isSmall;
233
- }
234
- export const DEFAULT_BUDGETS = {
235
- maxSize: 500 * 1024, // 500KB total
236
- maxInitialSize: 200 * 1024, // 200KB initial
237
- maxAsyncSize: 100 * 1024, // 100KB per async chunk
238
- maxCSSSize: 50 * 1024, // 50KB CSS
239
- };
240
- export function checkBundleBudgets(stats, budgets = DEFAULT_BUDGETS) {
241
- const violations = [];
242
- if (stats.totalSize > budgets.maxSize) {
243
- violations.push({
244
- type: 'total',
245
- actual: stats.totalSize,
246
- budget: budgets.maxSize,
247
- exceeded: stats.totalSize - budgets.maxSize,
248
- });
249
- }
250
- if (stats.initialSize > budgets.maxInitialSize) {
251
- violations.push({
252
- type: 'initial',
253
- actual: stats.initialSize,
254
- budget: budgets.maxInitialSize,
255
- exceeded: stats.initialSize - budgets.maxInitialSize,
256
- });
257
- }
258
- for (const asyncSize of stats.asyncSizes) {
259
- if (asyncSize > budgets.maxAsyncSize) {
260
- violations.push({
261
- type: 'async',
262
- actual: asyncSize,
263
- budget: budgets.maxAsyncSize,
264
- exceeded: asyncSize - budgets.maxAsyncSize,
265
- });
266
- }
267
- }
268
- if (stats.cssSize > budgets.maxCSSSize) {
269
- violations.push({
270
- type: 'css',
271
- actual: stats.cssSize,
272
- budget: budgets.maxCSSSize,
273
- exceeded: stats.cssSize - budgets.maxCSSSize,
274
- });
275
- }
276
- return violations;
277
- }
@@ -1,12 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- interface RevealUIOptions {
3
- prerender?: boolean | {
4
- partial?: boolean;
5
- noExtraDir?: boolean;
6
- parallel?: number;
7
- disableAutoRun?: boolean;
8
- };
9
- }
10
- export default function revealui(options?: RevealUIOptions): Plugin;
11
- export {};
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAElC,UAAU,eAAe;IACvB,SAAS,CAAC,EACN,OAAO,GACP;QACE,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,cAAc,CAAC,EAAE,OAAO,CAAA;KACzB,CAAA;CACN;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,MAAM,CAGtE"}
@@ -1,4 +0,0 @@
1
- export default function revealui(options = {}) {
2
- // Use revealui internally but expose as revealui
3
- return revealui(options);
4
- }
@@ -1,188 +0,0 @@
1
- /**
2
- * Audit Logging System
3
- *
4
- * Track security-relevant events and user actions for compliance
5
- */
6
- export type AuditEventType = 'auth.login' | 'auth.logout' | 'auth.failed_login' | 'auth.password_change' | 'auth.password_reset' | 'auth.mfa_enabled' | 'auth.mfa_disabled' | 'user.create' | 'user.update' | 'user.delete' | 'user.view' | 'data.create' | 'data.read' | 'data.update' | 'data.delete' | 'data.export' | 'permission.grant' | 'permission.revoke' | 'role.assign' | 'role.remove' | 'config.change' | 'security.violation' | 'security.alert' | 'gdpr.consent' | 'gdpr.data_request' | 'gdpr.data_deletion' | string;
7
- export type AuditSeverity = 'low' | 'medium' | 'high' | 'critical';
8
- export interface AuditEvent {
9
- id: string;
10
- timestamp: string;
11
- type: AuditEventType;
12
- severity: AuditSeverity;
13
- actor: {
14
- id: string;
15
- type: 'user' | 'system' | 'api';
16
- ip?: string;
17
- userAgent?: string;
18
- };
19
- resource?: {
20
- type: string;
21
- id: string;
22
- name?: string;
23
- };
24
- action: string;
25
- result: 'success' | 'failure' | 'partial';
26
- changes?: {
27
- before?: Record<string, unknown>;
28
- after?: Record<string, unknown>;
29
- };
30
- metadata?: Record<string, unknown>;
31
- message?: string;
32
- }
33
- export interface AuditQuery {
34
- types?: AuditEventType[];
35
- actorId?: string;
36
- resourceType?: string;
37
- resourceId?: string;
38
- startDate?: Date;
39
- endDate?: Date;
40
- severity?: AuditSeverity[];
41
- result?: ('success' | 'failure' | 'partial')[];
42
- limit?: number;
43
- offset?: number;
44
- }
45
- export interface AuditStorage {
46
- write(event: AuditEvent): Promise<void>;
47
- query(query: AuditQuery): Promise<AuditEvent[]>;
48
- count(query: AuditQuery): Promise<number>;
49
- }
50
- /**
51
- * Audit logging system
52
- */
53
- export declare class AuditSystem {
54
- private storage;
55
- private filters;
56
- constructor(storage: AuditStorage);
57
- /**
58
- * Log audit event
59
- */
60
- log(event: Omit<AuditEvent, 'id' | 'timestamp'>): Promise<void>;
61
- /**
62
- * Log authentication event
63
- */
64
- logAuth(type: Extract<AuditEventType, 'auth.login' | 'auth.logout' | 'auth.failed_login' | 'auth.password_change'>, actorId: string, result: 'success' | 'failure', metadata?: Record<string, unknown>): Promise<void>;
65
- /**
66
- * Log data access event
67
- */
68
- logDataAccess(action: 'create' | 'read' | 'update' | 'delete', actorId: string, resourceType: string, resourceId: string, result: 'success' | 'failure', changes?: {
69
- before?: Record<string, unknown>;
70
- after?: Record<string, unknown>;
71
- }): Promise<void>;
72
- /**
73
- * Log permission change
74
- */
75
- logPermissionChange(action: 'grant' | 'revoke', actorId: string, targetUserId: string, permission: string, result: 'success' | 'failure'): Promise<void>;
76
- /**
77
- * Log security event
78
- */
79
- logSecurityEvent(type: 'violation' | 'alert', severity: AuditSeverity, actorId: string, message: string, metadata?: Record<string, unknown>): Promise<void>;
80
- /**
81
- * Log GDPR event
82
- */
83
- logGDPREvent(type: 'consent' | 'data_request' | 'data_deletion', actorId: string, result: 'success' | 'failure', metadata?: Record<string, unknown>): Promise<void>;
84
- /**
85
- * Query audit logs
86
- */
87
- query(query: AuditQuery): Promise<AuditEvent[]>;
88
- /**
89
- * Count audit logs
90
- */
91
- count(query: AuditQuery): Promise<number>;
92
- /**
93
- * Add filter
94
- */
95
- addFilter(filter: (event: AuditEvent) => boolean): void;
96
- /**
97
- * Remove filter
98
- */
99
- removeFilter(filter: (event: AuditEvent) => boolean): void;
100
- }
101
- /**
102
- * In-memory audit storage (for development)
103
- */
104
- export declare class InMemoryAuditStorage implements AuditStorage {
105
- private events;
106
- private maxEvents;
107
- constructor(maxEvents?: number);
108
- write(event: AuditEvent): Promise<void>;
109
- query(query: AuditQuery): Promise<AuditEvent[]>;
110
- count(query: AuditQuery): Promise<number>;
111
- /**
112
- * Clear all events
113
- */
114
- clear(): void;
115
- /**
116
- * Get all events
117
- */
118
- getAll(): AuditEvent[];
119
- }
120
- /**
121
- * Audit trail decorator
122
- */
123
- export declare function AuditTrail(type: AuditEventType, action: string, options?: {
124
- severity?: AuditSeverity;
125
- captureChanges?: boolean;
126
- resourceType?: string;
127
- }): (_target: object, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
128
- /**
129
- * Audit middleware
130
- */
131
- export declare function createAuditMiddleware<TRequest = unknown, TResponse = unknown>(audit: AuditSystem, getUser: (request: TRequest) => {
132
- id: string;
133
- ip?: string;
134
- userAgent?: string;
135
- }): (request: TRequest & {
136
- method: string;
137
- url: string;
138
- }, next: () => Promise<TResponse & {
139
- status?: number;
140
- }>) => Promise<TResponse & {
141
- status?: number;
142
- }>;
143
- /**
144
- * Audit report generator
145
- */
146
- export declare class AuditReportGenerator {
147
- private audit;
148
- constructor(audit: AuditSystem);
149
- /**
150
- * Generate security report
151
- */
152
- generateSecurityReport(startDate: Date, endDate: Date): Promise<{
153
- totalEvents: number;
154
- securityViolations: number;
155
- failedLogins: number;
156
- permissionChanges: number;
157
- dataExports: number;
158
- criticalEvents: AuditEvent[];
159
- }>;
160
- /**
161
- * Generate user activity report
162
- */
163
- generateUserActivityReport(userId: string, startDate: Date, endDate: Date): Promise<{
164
- totalActions: number;
165
- actionsByType: Record<string, number>;
166
- failedActions: number;
167
- recentActions: AuditEvent[];
168
- }>;
169
- /**
170
- * Generate compliance report
171
- */
172
- generateComplianceReport(startDate: Date, endDate: Date): Promise<{
173
- dataAccesses: number;
174
- dataModifications: number;
175
- dataDeletions: number;
176
- gdprRequests: number;
177
- auditTrailComplete: boolean;
178
- }>;
179
- /**
180
- * Check audit trail continuity
181
- */
182
- private checkAuditTrailContinuity;
183
- }
184
- /**
185
- * Global audit system
186
- */
187
- export declare const audit: AuditSystem;
188
- //# sourceMappingURL=audit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/security/audit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,cAAc,GACtB,YAAY,GACZ,aAAa,GACb,mBAAmB,GACnB,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,GAClB,mBAAmB,GACnB,aAAa,GACb,aAAa,GACb,aAAa,GACb,WAAW,GACX,aAAa,GACb,WAAW,GACX,aAAa,GACb,aAAa,GACb,aAAa,GACb,kBAAkB,GAClB,mBAAmB,GACnB,aAAa,GACb,aAAa,GACb,eAAe,GACf,oBAAoB,GACpB,gBAAgB,GAChB,cAAc,GACd,mBAAmB,GACnB,oBAAoB,GACpB,MAAM,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAA;AAElE,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,EAAE,aAAa,CAAA;IACvB,KAAK,EAAE;QACL,EAAE,EAAE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