@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 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/instance/methods/hooks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EAEjB,gBAAgB,EACjB,MAAM,sBAAsB,CAAA;AAE7B;;GAEG;AACH,wBAAsB,SAAS,CAC7B,KAAK,EAAE,qBAAqB,EAAE,GAAG,SAAS,EAC1C,IAAI,EAAE;IACJ,GAAG,EAAE,cAAc,CAAA;IACnB,OAAO,EAAE,iBAAiB,CAAA;CAC3B,EACD,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,cAAc,CAAC,CA0BzB"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/instance/methods/hooks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EAEjB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,wBAAsB,SAAS,CAC7B,KAAK,EAAE,qBAAqB,EAAE,GAAG,SAAS,EAC1C,IAAI,EAAE;IACJ,GAAG,EAAE,cAAc,CAAC;IACpB,OAAO,EAAE,iBAAiB,CAAC;CAC5B,EACD,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,cAAc,CAAC,CA0BzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/instance/methods/update.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAIjG,wBAAsB,MAAM,CAC1B,QAAQ,EAAE,gBAAgB,EAC1B,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACtC,OAAO,EAAE,mBAAmB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GACpD,OAAO,CAAC,cAAc,CAAC,CAgDzB"}
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/instance/methods/update.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGlG,wBAAsB,MAAM,CAC1B,QAAQ,EAAE,gBAAgB,EAC1B,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACtC,OAAO,EAAE,mBAAmB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GACpD,OAAO,CAAC,cAAc,CAAC,CA6CzB"}
@@ -3,13 +3,10 @@
3
3
  *
4
4
  * Updates an existing document in a collection with hook handling.
5
5
  */
6
- import { validateJWTFromRequest } from '../../utils/jwt-validation.js';
7
6
  import { callHooks } from './hooks.js';
8
7
  export async function update(instance, ensureDbConnected, options) {
9
8
  await ensureDbConnected();
10
9
  const { collection, req } = options;
11
- // Validate JWT token if authorization header is provided
12
- await validateJWTFromRequest(req);
13
10
  if (!instance.collections[collection]) {
14
11
  throw new Error(`Collection '${collection}' not found`);
15
12
  }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Background Job Queue
3
+ *
4
+ * PostgreSQL-backed job queue using raw SQL for portability.
5
+ * No external dependencies (no Redis, no pg-boss).
6
+ *
7
+ * Usage:
8
+ * import { createJobQueue } from '@revealui/core/jobs';
9
+ *
10
+ * const queue = createJobQueue(dbExecutor);
11
+ * await queue.send('email.send', { to: 'user@example.com', subject: '...' });
12
+ * queue.work('email.send', async (job) => { await sendEmail(job.data); });
13
+ */
14
+ export type { DatabaseExecutor, JobHandler, JobPayload, JobQueue, JobQueueConfig, SendOptions, } from './queue.js';
15
+ export { createJobQueue } from './queue.js';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jobs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,cAAc,EACd,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Background Job Queue
3
+ *
4
+ * PostgreSQL-backed job queue using raw SQL for portability.
5
+ * No external dependencies (no Redis, no pg-boss).
6
+ *
7
+ * Usage:
8
+ * import { createJobQueue } from '@revealui/core/jobs';
9
+ *
10
+ * const queue = createJobQueue(dbExecutor);
11
+ * await queue.send('email.send', { to: 'user@example.com', subject: '...' });
12
+ * queue.work('email.send', async (job) => { await sendEmail(job.data); });
13
+ */
14
+ export { createJobQueue } from './queue.js';
@@ -0,0 +1,57 @@
1
+ /**
2
+ * PostgreSQL-backed Job Queue
3
+ *
4
+ * Uses raw SQL via a database executor for portability.
5
+ * Supports: delayed jobs, retries with exponential backoff, priorities, expiration.
6
+ *
7
+ * The jobs table must exist (see packages/db/src/schema/jobs.ts).
8
+ */
9
+ /** Minimal database executor — accepts raw SQL strings */
10
+ export interface DatabaseExecutor {
11
+ execute(query: string, params?: unknown[]): Promise<{
12
+ rows: Record<string, unknown>[];
13
+ }>;
14
+ }
15
+ export interface JobQueueConfig {
16
+ /** Polling interval in milliseconds (default: 5000) */
17
+ pollingIntervalMs: number;
18
+ /** Maximum concurrent jobs per worker (default: 5) */
19
+ concurrency: number;
20
+ /** Default retry limit for jobs without explicit limit (default: 3) */
21
+ defaultRetryLimit: number;
22
+ /** Base delay for exponential backoff in ms (default: 1000) */
23
+ retryBackoffMs: number;
24
+ /** Logger with error method */
25
+ logger?: {
26
+ error: (msg: string) => void;
27
+ };
28
+ }
29
+ export interface SendOptions {
30
+ /** Higher priority = processed first (default: 0) */
31
+ priority?: number;
32
+ /** Maximum retry attempts (default: config.defaultRetryLimit) */
33
+ retryLimit?: number;
34
+ /** Delay before first processing (Date or milliseconds from now) */
35
+ startAfter?: Date | number;
36
+ /** Job expires at this time (unprocessed jobs are skipped) */
37
+ expireAt?: Date;
38
+ }
39
+ export interface JobPayload {
40
+ id: string;
41
+ name: string;
42
+ data: Record<string, unknown>;
43
+ retryCount: number;
44
+ }
45
+ export type JobHandler = (job: JobPayload) => Promise<void>;
46
+ export interface JobQueue {
47
+ /** Enqueue a job for background processing */
48
+ send(name: string, data: Record<string, unknown>, options?: SendOptions): Promise<string>;
49
+ /** Register a handler for a job type and start polling */
50
+ work(name: string, handler: JobHandler): void;
51
+ /** Stop all polling workers */
52
+ stop(): void;
53
+ /** Get counts by state for monitoring */
54
+ getQueueStats(): Promise<Record<string, number>>;
55
+ }
56
+ export declare function createJobQueue(executor: DatabaseExecutor, overrides?: Partial<JobQueueConfig>): JobQueue;
57
+ //# sourceMappingURL=queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/jobs/queue.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,0DAA0D;AA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C,MAAM,CAAC,CAAC;IAC1F,0DAA0D;IAC1D,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9C,+BAA+B;IAC/B,IAAI,IAAI,IAAI,CAAC;IACb,yCAAyC;IACzC,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAClD;AAMD,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAClC,QAAQ,CAwJV"}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * PostgreSQL-backed Job Queue
3
+ *
4
+ * Uses raw SQL via a database executor for portability.
5
+ * Supports: delayed jobs, retries with exponential backoff, priorities, expiration.
6
+ *
7
+ * The jobs table must exist (see packages/db/src/schema/jobs.ts).
8
+ */
9
+ const DEFAULT_CONFIG = {
10
+ pollingIntervalMs: 5000,
11
+ concurrency: 5,
12
+ defaultRetryLimit: 3,
13
+ retryBackoffMs: 1000,
14
+ };
15
+ // =============================================================================
16
+ // Implementation
17
+ // =============================================================================
18
+ export function createJobQueue(executor, overrides) {
19
+ const config = { ...DEFAULT_CONFIG, ...overrides };
20
+ const timers = [];
21
+ const activeJobs = new Set();
22
+ let stopped = false;
23
+ async function send(name, data, options) {
24
+ const id = crypto.randomUUID();
25
+ let startAfter = new Date();
26
+ if (options?.startAfter instanceof Date) {
27
+ startAfter = options.startAfter;
28
+ }
29
+ else if (typeof options?.startAfter === 'number') {
30
+ startAfter = new Date(Date.now() + options.startAfter);
31
+ }
32
+ await executor.execute(`INSERT INTO jobs (id, name, data, state, priority, retry_limit, start_after, expire_at, created_at)
33
+ VALUES ($1, $2, $3, 'created', $4, $5, $6, $7, NOW())`, [
34
+ id,
35
+ name,
36
+ JSON.stringify(data),
37
+ options?.priority ?? 0,
38
+ options?.retryLimit ?? config.defaultRetryLimit,
39
+ startAfter.toISOString(),
40
+ options?.expireAt?.toISOString() ?? null,
41
+ ]);
42
+ return id;
43
+ }
44
+ /**
45
+ * Atomically claim the next available job using FOR UPDATE SKIP LOCKED.
46
+ */
47
+ async function fetchNextJob(name) {
48
+ const result = await executor.execute(`UPDATE jobs
49
+ SET state = 'active', started_at = NOW()
50
+ WHERE id = (
51
+ SELECT id FROM jobs
52
+ WHERE name = $1
53
+ AND state IN ('created', 'retry')
54
+ AND start_after <= NOW()
55
+ AND (expire_at IS NULL OR expire_at > NOW())
56
+ ORDER BY priority DESC, created_at ASC
57
+ LIMIT 1
58
+ FOR UPDATE SKIP LOCKED
59
+ )
60
+ RETURNING id, name, data, retry_count`, [name]);
61
+ const row = result.rows[0];
62
+ if (!row)
63
+ return null;
64
+ return {
65
+ id: row.id,
66
+ name: row.name,
67
+ data: (typeof row.data === 'string' ? JSON.parse(row.data) : row.data),
68
+ retryCount: row.retry_count ?? 0,
69
+ };
70
+ }
71
+ async function completeJob(id) {
72
+ await executor.execute(`UPDATE jobs SET state = 'completed', completed_at = NOW() WHERE id = $1`, [id]);
73
+ }
74
+ async function failJob(id, retryCount, retryLimit, error) {
75
+ if (retryCount + 1 < retryLimit) {
76
+ const delay = config.retryBackoffMs * 2 ** retryCount;
77
+ const nextRetry = new Date(Date.now() + delay);
78
+ await executor.execute(`UPDATE jobs SET state = 'retry', retry_count = $1, start_after = $2, output = $3 WHERE id = $4`, [retryCount + 1, nextRetry.toISOString(), JSON.stringify({ error }), id]);
79
+ }
80
+ else {
81
+ await executor.execute(`UPDATE jobs SET state = 'failed', retry_count = $1, completed_at = NOW(), output = $2 WHERE id = $3`, [retryCount + 1, JSON.stringify({ error }), id]);
82
+ }
83
+ }
84
+ async function poll(name, handler) {
85
+ if (stopped)
86
+ return;
87
+ if (activeJobs.size >= config.concurrency)
88
+ return;
89
+ try {
90
+ const job = await fetchNextJob(name);
91
+ if (!job)
92
+ return;
93
+ activeJobs.add(job.id);
94
+ try {
95
+ await handler(job);
96
+ await completeJob(job.id);
97
+ }
98
+ catch (err) {
99
+ const errorMsg = err instanceof Error ? err.message : String(err);
100
+ config.logger?.error(`Job ${name}/${job.id} failed: ${errorMsg}`);
101
+ await failJob(job.id, job.retryCount, config.defaultRetryLimit, errorMsg);
102
+ }
103
+ finally {
104
+ activeJobs.delete(job.id);
105
+ }
106
+ }
107
+ catch (err) {
108
+ config.logger?.error(`Job queue poll error for ${name}: ${err instanceof Error ? err.message : String(err)}`);
109
+ }
110
+ }
111
+ function work(name, handler) {
112
+ const timer = setInterval(() => {
113
+ void poll(name, handler);
114
+ }, config.pollingIntervalMs);
115
+ timers.push(timer);
116
+ void poll(name, handler);
117
+ }
118
+ function stop() {
119
+ stopped = true;
120
+ for (const timer of timers) {
121
+ clearInterval(timer);
122
+ }
123
+ timers.length = 0;
124
+ }
125
+ async function getQueueStats() {
126
+ const result = await executor.execute(`SELECT state, count(*)::int as count FROM jobs GROUP BY state`);
127
+ const stats = {};
128
+ for (const row of result.rows) {
129
+ stats[row.state] = row.count;
130
+ }
131
+ return stats;
132
+ }
133
+ return { send, work, stop, getQueueStats };
134
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * AES-256-GCM encryption for license keys at rest.
3
+ *
4
+ * Format: enc:<iv-hex>:<ciphertext-hex>:<auth-tag-hex>
5
+ * Falls back to plaintext when REVEALUI_LICENSE_ENCRYPTION_KEY is not set.
6
+ */
7
+ /**
8
+ * Encrypt a plaintext license key.
9
+ * Returns `enc:<iv>:<ciphertext>:<tag>` or the original plaintext if no key is configured.
10
+ */
11
+ export declare function encryptLicenseKey(plaintext: string): string;
12
+ /**
13
+ * Decrypt a license key.
14
+ * If the value doesn't start with `enc:`, returns it as-is (plaintext fallback).
15
+ */
16
+ export declare function decryptLicenseKey(stored: string): string;
17
+ /**
18
+ * Check whether a stored license key value is encrypted.
19
+ */
20
+ export declare function isEncryptedLicenseKey(value: string): boolean;
21
+ //# sourceMappingURL=license-encryption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"license-encryption.d.ts","sourceRoot":"","sources":["../src/license-encryption.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyBH;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAW3D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA+BxD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE5D"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * AES-256-GCM encryption for license keys at rest.
3
+ *
4
+ * Format: enc:<iv-hex>:<ciphertext-hex>:<auth-tag-hex>
5
+ * Falls back to plaintext when REVEALUI_LICENSE_ENCRYPTION_KEY is not set.
6
+ */
7
+ import { createCipheriv, createDecipheriv, createHash, randomBytes } from 'node:crypto';
8
+ const ENC_PREFIX = 'enc:';
9
+ const ALGORITHM = 'aes-256-gcm';
10
+ const IV_BYTES = 12;
11
+ /**
12
+ * Derives a 32-byte key from the env var value.
13
+ * Accepts either a 64-char hex string or an arbitrary passphrase (hashed to 32 bytes).
14
+ */
15
+ function deriveKey(raw) {
16
+ if (/^[0-9a-f]{64}$/i.test(raw)) {
17
+ return Buffer.from(raw, 'hex');
18
+ }
19
+ return createHash('sha256').update(raw).digest();
20
+ }
21
+ function getEncryptionKey() {
22
+ const raw = process.env.REVEALUI_LICENSE_ENCRYPTION_KEY;
23
+ if (!raw)
24
+ return null;
25
+ return deriveKey(raw);
26
+ }
27
+ /**
28
+ * Encrypt a plaintext license key.
29
+ * Returns `enc:<iv>:<ciphertext>:<tag>` or the original plaintext if no key is configured.
30
+ */
31
+ export function encryptLicenseKey(plaintext) {
32
+ const key = getEncryptionKey();
33
+ if (!key)
34
+ return plaintext;
35
+ const iv = randomBytes(IV_BYTES);
36
+ const cipher = createCipheriv(ALGORITHM, key, iv);
37
+ const encrypted = Buffer.concat([cipher.update(plaintext, 'utf8'), cipher.final()]);
38
+ const tag = cipher.getAuthTag();
39
+ return `${ENC_PREFIX}${iv.toString('hex')}:${encrypted.toString('hex')}:${tag.toString('hex')}`;
40
+ }
41
+ /**
42
+ * Decrypt a license key.
43
+ * If the value doesn't start with `enc:`, returns it as-is (plaintext fallback).
44
+ */
45
+ export function decryptLicenseKey(stored) {
46
+ if (!stored.startsWith(ENC_PREFIX)) {
47
+ return stored; // plaintext — backward compatible
48
+ }
49
+ const key = getEncryptionKey();
50
+ if (!key) {
51
+ throw new Error('Encrypted license key found but REVEALUI_LICENSE_ENCRYPTION_KEY is not set. ' +
52
+ 'Cannot decrypt without the encryption key.');
53
+ }
54
+ const parts = stored.slice(ENC_PREFIX.length).split(':');
55
+ if (parts.length !== 3) {
56
+ throw new Error('Malformed encrypted license key — expected enc:<iv>:<ciphertext>:<tag>');
57
+ }
58
+ const [ivHex, ciphertextHex, tagHex] = parts;
59
+ const iv = Buffer.from(ivHex, 'hex');
60
+ const ciphertext = Buffer.from(ciphertextHex, 'hex');
61
+ const tag = Buffer.from(tagHex, 'hex');
62
+ if (iv.length !== IV_BYTES) {
63
+ throw new Error(`Invalid IV length: expected ${IV_BYTES} bytes, got ${iv.length}`);
64
+ }
65
+ const decipher = createDecipheriv(ALGORITHM, key, iv);
66
+ decipher.setAuthTag(tag);
67
+ return Buffer.concat([decipher.update(ciphertext), decipher.final()]).toString('utf8');
68
+ }
69
+ /**
70
+ * Check whether a stored license key value is encrypted.
71
+ */
72
+ export function isEncryptedLicenseKey(value) {
73
+ return value.startsWith(ENC_PREFIX);
74
+ }
package/dist/license.d.ts CHANGED
@@ -24,6 +24,21 @@ declare const licensePayloadSchema: z.ZodObject<{
24
24
  exp: z.ZodOptional<z.ZodNumber>;
25
25
  }, z.core.$strip>;
26
26
  export type LicensePayload = z.infer<typeof licensePayloadSchema>;
27
+ /** License cache TTL configuration */
28
+ export interface LicenseCacheConfig {
29
+ /** Cache TTL in milliseconds (default: 24 hours) */
30
+ ttlMs: number;
31
+ }
32
+ /**
33
+ * Configure the license cache TTL.
34
+ * Useful for tests (short TTL) or deployments needing faster revocation detection.
35
+ */
36
+ export declare function configureLicenseCache(overrides: Partial<LicenseCacheConfig>): void;
37
+ /**
38
+ * Computes a deterministic Key ID (kid) from a public key PEM string.
39
+ * Returns the first 8 characters of the SHA-256 hex digest of the PEM.
40
+ */
41
+ export declare function computeKeyId(publicKeyPem: string): string;
27
42
  /**
28
43
  * Validates a license key JWT and returns the decoded payload.
29
44
  * Returns null if the key is invalid, expired, or missing.
@@ -38,11 +53,11 @@ export declare function validateLicenseKey(licenseKey: string, publicKey: string
38
53
  export declare function initializeLicense(): Promise<LicenseTier>;
39
54
  /**
40
55
  * Returns the current license tier.
41
- * If the license hasn't been initialized, returns 'free'.
56
+ * If the license hasn't been initialized or the cache has expired, returns 'free'.
42
57
  */
43
58
  export declare function getCurrentTier(): LicenseTier;
44
59
  /**
45
- * Returns the full license payload, or null if no valid license.
60
+ * Returns the full license payload, or null if no valid license or cache expired.
46
61
  */
47
62
  export declare function getLicensePayload(): LicensePayload | null;
48
63
  /**
@@ -63,6 +78,12 @@ export declare function getMaxUsers(): number;
63
78
  * Track B metering: free=1K, pro=10K, max=50K, enterprise=unlimited.
64
79
  */
65
80
  export declare function getMaxAgentTasks(): number;
81
+ /**
82
+ * Returns the maximum free-tier AI sampling tasks per billing cycle.
83
+ * Free users get 50 cloud AI tasks/month via platform Groq key.
84
+ * Paid users return 0 (they use full quota via getMaxAgentTasks instead).
85
+ */
86
+ export declare function getMaxFreemiumTasks(): number;
66
87
  /**
67
88
  * Generates a signed license key JWT.
68
89
  * This is a server-only function — requires the private key.
@@ -71,9 +92,11 @@ export declare function getMaxAgentTasks(): number;
71
92
  * @param privateKey - RS256 private key (PEM format)
72
93
  * @param expiresInSeconds - JWT expiration in seconds. Pass null for perpetual
73
94
  * licenses (no exp claim). Defaults to 1 year for subscription licenses.
95
+ * @param publicKey - RS256 public key (PEM format). When provided, a `kid`
96
+ * claim is added to the JWT header for forward-compatible key rotation.
74
97
  * @returns Signed JWT string
75
98
  */
76
- export declare function generateLicenseKey(payload: Omit<LicensePayload, 'iat' | 'exp'>, privateKey: string, expiresInSeconds?: number | null): Promise<string>;
99
+ export declare function generateLicenseKey(payload: Omit<LicensePayload, 'iat' | 'exp'>, privateKey: string, expiresInSeconds?: number | null, publicKey?: string): Promise<string>;
77
100
  /**
78
101
  * Reset license state. Primarily for testing.
79
102
  */
@@ -1 +1 @@
1
- {"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../src/license.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,YAAY,CAAA;AAE/D,qCAAqC;AACrC,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;iBAqBxB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AA+BjE;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAgBhC;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,WAAW,CAAC,CAuB9D;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,IAAI,CAEzD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,WAAW,GAAG,OAAO,CAoB7D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAKpC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAKpC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAKzC;AAED;;;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;;;GAGG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,WAAW,GAAG,OAAO,CAqB7D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAMpC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAMpC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAMzC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAI5C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,KAAK,GAAG,KAAK,CAAC,EAC5C,UAAU,EAAE,MAAM,EAClB,gBAAgB,GAAE,MAAM,GAAG,IAAyB,EACpD,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAYjB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAGxC"}
package/dist/license.js CHANGED
@@ -5,8 +5,11 @@
5
5
  * - jose - JWT token verification (Web Crypto API)
6
6
  * - zod - Schema validation for license payloads
7
7
  */
8
- import { importPKCS8, importSPKI, jwtVerify, SignJWT } from 'jose';
8
+ import { createHash } from 'node:crypto';
9
+ import { decodeProtectedHeader, importPKCS8, importSPKI, jwtVerify, SignJWT } from 'jose';
9
10
  import { z } from 'zod';
11
+ import { decryptLicenseKey } from './license-encryption.js';
12
+ import { logger } from './utils/logger.js';
10
13
  /** Decoded license payload schema */
11
14
  const licensePayloadSchema = z.object({
12
15
  /** License tier */
@@ -30,6 +33,18 @@ const licensePayloadSchema = z.object({
30
33
  /** License expiration timestamp — absent for perpetual licenses */
31
34
  exp: z.number().optional(),
32
35
  });
36
+ const DEFAULT_CACHE_CONFIG = {
37
+ ttlMs: 5 * 60 * 1000, // 5 minutes — revoked licenses lose access within 5 min
38
+ };
39
+ let cacheConfig = { ...DEFAULT_CACHE_CONFIG };
40
+ let cachedAt = 0;
41
+ /**
42
+ * Configure the license cache TTL.
43
+ * Useful for tests (short TTL) or deployments needing faster revocation detection.
44
+ */
45
+ export function configureLicenseCache(overrides) {
46
+ cacheConfig = { ...DEFAULT_CACHE_CONFIG, ...overrides };
47
+ }
33
48
  let cachedState = {
34
49
  tier: 'free',
35
50
  payload: null,
@@ -41,13 +56,26 @@ let cachedState = {
41
56
  * For local development, it reads from REVEALUI_LICENSE_PUBLIC_KEY env var.
42
57
  */
43
58
  function getPublicKey() {
44
- return process.env.REVEALUI_LICENSE_PUBLIC_KEY ?? null;
59
+ const raw = process.env.REVEALUI_LICENSE_PUBLIC_KEY ?? null;
60
+ // Docker/env files store PEM as single-line with literal \n — restore real newlines
61
+ return raw ? raw.replace(/\\n/g, '\n') : null;
45
62
  }
46
63
  /**
47
64
  * Reads the license key from environment.
65
+ * Supports encrypted keys (enc:iv:ciphertext:tag format) via REVEALUI_LICENSE_ENCRYPTION_KEY.
48
66
  */
49
67
  function getLicenseKey() {
50
- return process.env.REVEALUI_LICENSE_KEY ?? null;
68
+ const raw = process.env.REVEALUI_LICENSE_KEY ?? null;
69
+ if (!raw)
70
+ return null;
71
+ return decryptLicenseKey(raw);
72
+ }
73
+ /**
74
+ * Computes a deterministic Key ID (kid) from a public key PEM string.
75
+ * Returns the first 8 characters of the SHA-256 hex digest of the PEM.
76
+ */
77
+ export function computeKeyId(publicKeyPem) {
78
+ return createHash('sha256').update(publicKeyPem).digest('hex').slice(0, 8);
51
79
  }
52
80
  /**
53
81
  * Validates a license key JWT and returns the decoded payload.
@@ -55,6 +83,13 @@ function getLicenseKey() {
55
83
  */
56
84
  export async function validateLicenseKey(licenseKey, publicKey) {
57
85
  try {
86
+ // Extract kid from JWT header for forward-compatible key rotation
87
+ const header = decodeProtectedHeader(licenseKey);
88
+ const expectedKid = computeKeyId(publicKey);
89
+ if (header.kid && header.kid !== expectedKid) {
90
+ logger.warn(`JWT kid mismatch: token has "${header.kid}", current key is "${expectedKid}". ` +
91
+ 'Token may have been signed with a rotated key.');
92
+ }
58
93
  const key = await importSPKI(publicKey, 'RS256');
59
94
  const { payload } = await jwtVerify(licenseKey, key, {
60
95
  algorithms: ['RS256', 'ES256'],
@@ -80,11 +115,13 @@ export async function initializeLicense() {
80
115
  const publicKey = getPublicKey();
81
116
  if (!(licenseKey && publicKey)) {
82
117
  cachedState = { tier: 'free', payload: null, validatedAt: Date.now() };
118
+ cachedAt = Date.now();
83
119
  return 'free';
84
120
  }
85
121
  const payload = await validateLicenseKey(licenseKey, publicKey);
86
122
  if (!payload) {
87
123
  cachedState = { tier: 'free', payload: null, validatedAt: Date.now() };
124
+ cachedAt = Date.now();
88
125
  return 'free';
89
126
  }
90
127
  cachedState = {
@@ -92,19 +129,39 @@ export async function initializeLicense() {
92
129
  payload,
93
130
  validatedAt: Date.now(),
94
131
  };
132
+ cachedAt = Date.now();
133
+ // Clamp cache TTL to license expiry so revoked licenses don't survive the full TTL
134
+ if (payload.exp) {
135
+ const msUntilExpiry = payload.exp * 1000 - Date.now();
136
+ if (msUntilExpiry > 0 && msUntilExpiry < cacheConfig.ttlMs) {
137
+ cacheConfig = { ...cacheConfig, ttlMs: msUntilExpiry };
138
+ }
139
+ }
95
140
  return payload.tier;
96
141
  }
142
+ /**
143
+ * Invalidates the cached license state if it has exceeded the configured TTL.
144
+ * After invalidation, the license defaults to 'free' until re-initialized.
145
+ */
146
+ function evictStaleCache() {
147
+ if (cachedAt > 0 && Date.now() - cachedAt > cacheConfig.ttlMs) {
148
+ cachedState = { tier: 'free', payload: null, validatedAt: null };
149
+ cachedAt = 0;
150
+ }
151
+ }
97
152
  /**
98
153
  * Returns the current license tier.
99
- * If the license hasn't been initialized, returns 'free'.
154
+ * If the license hasn't been initialized or the cache has expired, returns 'free'.
100
155
  */
101
156
  export function getCurrentTier() {
157
+ evictStaleCache();
102
158
  return cachedState.tier;
103
159
  }
104
160
  /**
105
- * Returns the full license payload, or null if no valid license.
161
+ * Returns the full license payload, or null if no valid license or cache expired.
106
162
  */
107
163
  export function getLicensePayload() {
164
+ evictStaleCache();
108
165
  return cachedState.payload;
109
166
  }
110
167
  /**
@@ -112,6 +169,7 @@ export function getLicensePayload() {
112
169
  * Also validates that the license has not expired (checks JWT exp claim).
113
170
  */
114
171
  export function isLicensed(requiredTier) {
172
+ evictStaleCache();
115
173
  const tierRank = {
116
174
  free: 0,
117
175
  pro: 1,
@@ -134,6 +192,7 @@ export function isLicensed(requiredTier) {
134
192
  * Returns the maximum number of sites allowed by the current license.
135
193
  */
136
194
  export function getMaxSites() {
195
+ evictStaleCache();
137
196
  if (cachedState.tier === 'enterprise')
138
197
  return Infinity;
139
198
  if (cachedState.tier === 'max')
@@ -146,6 +205,7 @@ export function getMaxSites() {
146
205
  * Returns the maximum number of users/editors allowed by the current license.
147
206
  */
148
207
  export function getMaxUsers() {
208
+ evictStaleCache();
149
209
  if (cachedState.tier === 'enterprise')
150
210
  return Infinity;
151
211
  if (cachedState.tier === 'max')
@@ -159,6 +219,7 @@ export function getMaxUsers() {
159
219
  * Track B metering: free=1K, pro=10K, max=50K, enterprise=unlimited.
160
220
  */
161
221
  export function getMaxAgentTasks() {
222
+ evictStaleCache();
162
223
  if (cachedState.tier === 'enterprise')
163
224
  return Infinity;
164
225
  if (cachedState.tier === 'max')
@@ -167,6 +228,17 @@ export function getMaxAgentTasks() {
167
228
  return 10_000;
168
229
  return 1_000;
169
230
  }
231
+ /**
232
+ * Returns the maximum free-tier AI sampling tasks per billing cycle.
233
+ * Free users get 50 cloud AI tasks/month via platform Groq key.
234
+ * Paid users return 0 (they use full quota via getMaxAgentTasks instead).
235
+ */
236
+ export function getMaxFreemiumTasks() {
237
+ evictStaleCache();
238
+ if (cachedState.tier === 'free')
239
+ return 50;
240
+ return 0;
241
+ }
170
242
  /**
171
243
  * Generates a signed license key JWT.
172
244
  * This is a server-only function — requires the private key.
@@ -175,11 +247,18 @@ export function getMaxAgentTasks() {
175
247
  * @param privateKey - RS256 private key (PEM format)
176
248
  * @param expiresInSeconds - JWT expiration in seconds. Pass null for perpetual
177
249
  * licenses (no exp claim). Defaults to 1 year for subscription licenses.
250
+ * @param publicKey - RS256 public key (PEM format). When provided, a `kid`
251
+ * claim is added to the JWT header for forward-compatible key rotation.
178
252
  * @returns Signed JWT string
179
253
  */
180
- export async function generateLicenseKey(payload, privateKey, expiresInSeconds = 365 * 24 * 60 * 60) {
254
+ export async function generateLicenseKey(payload, privateKey, expiresInSeconds = 365 * 24 * 60 * 60, publicKey) {
181
255
  const key = await importPKCS8(privateKey, 'RS256');
182
- const builder = new SignJWT({ ...payload }).setProtectedHeader({ alg: 'RS256' }).setIssuedAt();
256
+ const kid = publicKey ? computeKeyId(publicKey) : undefined;
257
+ const header = { alg: 'RS256' };
258
+ if (kid) {
259
+ header.kid = kid;
260
+ }
261
+ const builder = new SignJWT({ ...payload }).setProtectedHeader(header).setIssuedAt();
183
262
  if (expiresInSeconds !== null) {
184
263
  builder.setExpirationTime(`${expiresInSeconds}s`);
185
264
  }
@@ -190,4 +269,5 @@ export async function generateLicenseKey(payload, privateKey, expiresInSeconds =
190
269
  */
191
270
  export function resetLicenseState() {
192
271
  cachedState = { tier: 'free', payload: null, validatedAt: null };
272
+ cachedAt = 0;
193
273
  }
@@ -100,14 +100,14 @@ declare class AlertManager {
100
100
  * Singleton instance
101
101
  */
102
102
  export declare const alertManager: AlertManager;
103
- /**
104
- * Export AlertManager class for testing
105
- */
106
- export { AlertManager };
107
103
  /**
108
104
  * Export types for testing
109
105
  */
110
106
  export type { AlertChannel, SentryClient };
107
+ /**
108
+ * Export AlertManager class for testing
109
+ */
110
+ export { AlertManager };
111
111
  /**
112
112
  * Convenience functions
113
113
  */
@@ -1 +1 @@
1
- {"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../src/monitoring/alerts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEvC;;GAEG;AACH,UAAU,YAAY;IACpB,cAAc,EAAE,CAAC,OAAO,EAAE,MA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