@revealui/core 0.0.0-canary-20260409021642

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (522) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +171 -0
  3. package/dist/api/compression.d.ts +83 -0
  4. package/dist/api/compression.d.ts.map +1 -0
  5. package/dist/api/compression.js +233 -0
  6. package/dist/api/payload-optimization.d.ts +138 -0
  7. package/dist/api/payload-optimization.d.ts.map +1 -0
  8. package/dist/api/payload-optimization.js +320 -0
  9. package/dist/api/rate-limit.d.ts +114 -0
  10. package/dist/api/rate-limit.d.ts.map +1 -0
  11. package/dist/api/rate-limit.js +376 -0
  12. package/dist/api/response-cache.d.ts +125 -0
  13. package/dist/api/response-cache.d.ts.map +1 -0
  14. package/dist/api/response-cache.js +335 -0
  15. package/dist/api/rest.d.ts +54 -0
  16. package/dist/api/rest.d.ts.map +1 -0
  17. package/dist/api/rest.js +465 -0
  18. package/dist/auth/access.d.ts +25 -0
  19. package/dist/auth/access.d.ts.map +1 -0
  20. package/dist/auth/access.js +20 -0
  21. package/dist/auth/index.d.ts +2 -0
  22. package/dist/auth/index.d.ts.map +1 -0
  23. package/dist/auth/index.js +2 -0
  24. package/dist/cache/query-cache.d.ts +100 -0
  25. package/dist/cache/query-cache.d.ts.map +1 -0
  26. package/dist/cache/query-cache.js +266 -0
  27. package/dist/caching/index.d.ts +6 -0
  28. package/dist/caching/index.d.ts.map +1 -0
  29. package/dist/caching/index.js +5 -0
  30. package/dist/client/admin/RichText.d.ts +12 -0
  31. package/dist/client/admin/RichText.d.ts.map +1 -0
  32. package/dist/client/admin/RichText.js +5 -0
  33. package/dist/client/admin/components/AdminDashboard.d.ts +7 -0
  34. package/dist/client/admin/components/AdminDashboard.d.ts.map +1 -0
  35. package/dist/client/admin/components/AdminDashboard.js +308 -0
  36. package/dist/client/admin/components/CollectionList.d.ts +16 -0
  37. package/dist/client/admin/components/CollectionList.d.ts.map +1 -0
  38. package/dist/client/admin/components/CollectionList.js +67 -0
  39. package/dist/client/admin/components/DocumentForm.d.ts +11 -0
  40. package/dist/client/admin/components/DocumentForm.d.ts.map +1 -0
  41. package/dist/client/admin/components/DocumentForm.js +223 -0
  42. package/dist/client/admin/components/GlobalForm.d.ts +11 -0
  43. package/dist/client/admin/components/GlobalForm.d.ts.map +1 -0
  44. package/dist/client/admin/components/GlobalForm.js +74 -0
  45. package/dist/client/admin/context/ServerFunctionContext.d.ts +8 -0
  46. package/dist/client/admin/context/ServerFunctionContext.d.ts.map +1 -0
  47. package/dist/client/admin/context/ServerFunctionContext.js +15 -0
  48. package/dist/client/admin/i18n/en.d.ts +25 -0
  49. package/dist/client/admin/i18n/en.d.ts.map +1 -0
  50. package/dist/client/admin/i18n/en.js +25 -0
  51. package/dist/client/admin/index.d.ts +11 -0
  52. package/dist/client/admin/index.d.ts.map +1 -0
  53. package/dist/client/admin/index.js +11 -0
  54. package/dist/client/admin/layout.d.ts +10 -0
  55. package/dist/client/admin/layout.d.ts.map +1 -0
  56. package/dist/client/admin/layout.js +7 -0
  57. package/dist/client/admin/page.d.ts +38 -0
  58. package/dist/client/admin/page.d.ts.map +1 -0
  59. package/dist/client/admin/page.js +15 -0
  60. package/dist/client/admin/utils/apiClient.d.ts +110 -0
  61. package/dist/client/admin/utils/apiClient.d.ts.map +1 -0
  62. package/dist/client/admin/utils/apiClient.js +216 -0
  63. package/dist/client/admin/utils/index.d.ts +5 -0
  64. package/dist/client/admin/utils/index.d.ts.map +1 -0
  65. package/dist/client/admin/utils/index.js +4 -0
  66. package/dist/client/admin/utils/serializeConfig.d.ts +7 -0
  67. package/dist/client/admin/utils/serializeConfig.d.ts.map +1 -0
  68. package/dist/client/admin/utils/serializeConfig.js +35 -0
  69. package/dist/client/hooks.d.ts +18 -0
  70. package/dist/client/hooks.d.ts.map +1 -0
  71. package/dist/client/hooks.js +29 -0
  72. package/dist/client/index.d.ts +11 -0
  73. package/dist/client/index.d.ts.map +1 -0
  74. package/dist/client/index.js +13 -0
  75. package/dist/client/richtext/RichTextEditor.d.ts +48 -0
  76. package/dist/client/richtext/RichTextEditor.d.ts.map +1 -0
  77. package/dist/client/richtext/RichTextEditor.js +360 -0
  78. package/dist/client/richtext/components/ImageNodeComponent.d.ts +9 -0
  79. package/dist/client/richtext/components/ImageNodeComponent.d.ts.map +1 -0
  80. package/dist/client/richtext/components/ImageNodeComponent.js +98 -0
  81. package/dist/client/richtext/components/ImageUploadButton.d.ts +13 -0
  82. package/dist/client/richtext/components/ImageUploadButton.d.ts.map +1 -0
  83. package/dist/client/richtext/components/ImageUploadButton.js +118 -0
  84. package/dist/client/richtext/index.d.ts +92 -0
  85. package/dist/client/richtext/index.d.ts.map +1 -0
  86. package/dist/client/richtext/index.js +74 -0
  87. package/dist/client/richtext/nodes/DecoratorBlockNode.d.ts +20 -0
  88. package/dist/client/richtext/nodes/DecoratorBlockNode.d.ts.map +1 -0
  89. package/dist/client/richtext/nodes/DecoratorBlockNode.js +29 -0
  90. package/dist/client/richtext/nodes/ImageNode.d.ts +51 -0
  91. package/dist/client/richtext/nodes/ImageNode.d.ts.map +1 -0
  92. package/dist/client/richtext/nodes/ImageNode.js +95 -0
  93. package/dist/client/richtext/plugins/CollaborationPlugin.d.ts +13 -0
  94. package/dist/client/richtext/plugins/CollaborationPlugin.d.ts.map +1 -0
  95. package/dist/client/richtext/plugins/CollaborationPlugin.js +8 -0
  96. package/dist/client/richtext/plugins/CursorsOverlayPlugin.d.ts +4 -0
  97. package/dist/client/richtext/plugins/CursorsOverlayPlugin.d.ts.map +1 -0
  98. package/dist/client/richtext/plugins/CursorsOverlayPlugin.js +50 -0
  99. package/dist/client/richtext/plugins/FloatingToolbarPlugin.d.ts +7 -0
  100. package/dist/client/richtext/plugins/FloatingToolbarPlugin.d.ts.map +1 -0
  101. package/dist/client/richtext/plugins/FloatingToolbarPlugin.js +246 -0
  102. package/dist/client/richtext/plugins/ImagePlugin.d.ts +3 -0
  103. package/dist/client/richtext/plugins/ImagePlugin.d.ts.map +1 -0
  104. package/dist/client/richtext/plugins/ImagePlugin.js +73 -0
  105. package/dist/client/richtext/plugins/PastePlugin.d.ts +2 -0
  106. package/dist/client/richtext/plugins/PastePlugin.d.ts.map +1 -0
  107. package/dist/client/richtext/plugins/PastePlugin.js +36 -0
  108. package/dist/client/richtext/plugins/ToolbarPlugin.d.ts +8 -0
  109. package/dist/client/richtext/plugins/ToolbarPlugin.d.ts.map +1 -0
  110. package/dist/client/richtext/plugins/ToolbarPlugin.js +204 -0
  111. package/dist/client/ui/index.d.ts +111 -0
  112. package/dist/client/ui/index.d.ts.map +1 -0
  113. package/dist/client/ui/index.js +130 -0
  114. package/dist/collections/CollectionOperations.d.ts +27 -0
  115. package/dist/collections/CollectionOperations.d.ts.map +1 -0
  116. package/dist/collections/CollectionOperations.js +48 -0
  117. package/dist/collections/hooks.d.ts +11 -0
  118. package/dist/collections/hooks.d.ts.map +1 -0
  119. package/dist/collections/hooks.js +35 -0
  120. package/dist/collections/index.d.ts +2 -0
  121. package/dist/collections/index.d.ts.map +1 -0
  122. package/dist/collections/index.js +1 -0
  123. package/dist/collections/operations/create.d.ts +9 -0
  124. package/dist/collections/operations/create.d.ts.map +1 -0
  125. package/dist/collections/operations/create.js +130 -0
  126. package/dist/collections/operations/createMany.d.ts +12 -0
  127. package/dist/collections/operations/createMany.d.ts.map +1 -0
  128. package/dist/collections/operations/createMany.js +43 -0
  129. package/dist/collections/operations/delete.d.ts +10 -0
  130. package/dist/collections/operations/delete.d.ts.map +1 -0
  131. package/dist/collections/operations/delete.js +45 -0
  132. package/dist/collections/operations/deleteMany.d.ts +11 -0
  133. package/dist/collections/operations/deleteMany.d.ts.map +1 -0
  134. package/dist/collections/operations/deleteMany.js +50 -0
  135. package/dist/collections/operations/fieldHooks.d.ts +21 -0
  136. package/dist/collections/operations/fieldHooks.d.ts.map +1 -0
  137. package/dist/collections/operations/fieldHooks.js +51 -0
  138. package/dist/collections/operations/find.d.ts +8 -0
  139. package/dist/collections/operations/find.d.ts.map +1 -0
  140. package/dist/collections/operations/find.js +231 -0
  141. package/dist/collections/operations/findById.d.ts +14 -0
  142. package/dist/collections/operations/findById.d.ts.map +1 -0
  143. package/dist/collections/operations/findById.js +111 -0
  144. package/dist/collections/operations/sqlAdapter.d.ts +23 -0
  145. package/dist/collections/operations/sqlAdapter.d.ts.map +1 -0
  146. package/dist/collections/operations/sqlAdapter.js +108 -0
  147. package/dist/collections/operations/update.d.ts +8 -0
  148. package/dist/collections/operations/update.d.ts.map +1 -0
  149. package/dist/collections/operations/update.js +226 -0
  150. package/dist/collections/operations/updateMany.d.ts +11 -0
  151. package/dist/collections/operations/updateMany.d.ts.map +1 -0
  152. package/dist/collections/operations/updateMany.js +52 -0
  153. package/dist/collections/registry.d.ts +12 -0
  154. package/dist/collections/registry.d.ts.map +1 -0
  155. package/dist/collections/registry.js +38 -0
  156. package/dist/config/index.d.ts +9 -0
  157. package/dist/config/index.d.ts.map +1 -0
  158. package/dist/config/index.js +61 -0
  159. package/dist/config/runtime.d.ts +22 -0
  160. package/dist/config/runtime.d.ts.map +1 -0
  161. package/dist/config/runtime.js +32 -0
  162. package/dist/config/utils.d.ts +2 -0
  163. package/dist/config/utils.d.ts.map +1 -0
  164. package/dist/config/utils.js +21 -0
  165. package/dist/database/index.d.ts +4 -0
  166. package/dist/database/index.d.ts.map +1 -0
  167. package/dist/database/index.js +2 -0
  168. package/dist/database/safe-parse.d.ts +26 -0
  169. package/dist/database/safe-parse.d.ts.map +1 -0
  170. package/dist/database/safe-parse.js +42 -0
  171. package/dist/database/ssl-config.d.ts +9 -0
  172. package/dist/database/ssl-config.d.ts.map +1 -0
  173. package/dist/database/ssl-config.js +7 -0
  174. package/dist/database/type-adapter.d.ts +113 -0
  175. package/dist/database/type-adapter.d.ts.map +1 -0
  176. package/dist/database/type-adapter.js +97 -0
  177. package/dist/database/universal-postgres.d.ts +45 -0
  178. package/dist/database/universal-postgres.d.ts.map +1 -0
  179. package/dist/database/universal-postgres.js +531 -0
  180. package/dist/dataloader.d.ts +26 -0
  181. package/dist/dataloader.d.ts.map +1 -0
  182. package/dist/dataloader.js +176 -0
  183. package/dist/error-handling/error-boundary.d.ts +94 -0
  184. package/dist/error-handling/error-boundary.d.ts.map +1 -0
  185. package/dist/error-handling/error-boundary.js +285 -0
  186. package/dist/error-handling/error-reporter.d.ts +214 -0
  187. package/dist/error-handling/error-reporter.d.ts.map +1 -0
  188. package/dist/error-handling/error-reporter.js +491 -0
  189. package/dist/error-handling/fallback-components.d.ts +131 -0
  190. package/dist/error-handling/fallback-components.d.ts.map +1 -0
  191. package/dist/error-handling/fallback-components.js +371 -0
  192. package/dist/error-handling/index.d.ts +14 -0
  193. package/dist/error-handling/index.d.ts.map +1 -0
  194. package/dist/error-handling/index.js +12 -0
  195. package/dist/factories/builders.d.ts +50 -0
  196. package/dist/factories/builders.d.ts.map +1 -0
  197. package/dist/factories/builders.js +77 -0
  198. package/dist/factories/index.d.ts +2 -0
  199. package/dist/factories/index.d.ts.map +1 -0
  200. package/dist/factories/index.js +1 -0
  201. package/dist/features.d.ts +88 -0
  202. package/dist/features.d.ts.map +1 -0
  203. package/dist/features.js +105 -0
  204. package/dist/fieldTraversal.d.ts +26 -0
  205. package/dist/fieldTraversal.d.ts.map +1 -0
  206. package/dist/fieldTraversal.js +132 -0
  207. package/dist/fields/config/types.d.ts +48 -0
  208. package/dist/fields/config/types.d.ts.map +1 -0
  209. package/dist/fields/config/types.js +20 -0
  210. package/dist/fields/getDefaultValue.d.ts +16 -0
  211. package/dist/fields/getDefaultValue.d.ts.map +1 -0
  212. package/dist/fields/getDefaultValue.js +20 -0
  213. package/dist/fields/getFieldPaths.d.ts +25 -0
  214. package/dist/fields/getFieldPaths.d.ts.map +1 -0
  215. package/dist/fields/getFieldPaths.js +23 -0
  216. package/dist/fields/hooks/afterRead/index.d.ts +36 -0
  217. package/dist/fields/hooks/afterRead/index.d.ts.map +1 -0
  218. package/dist/fields/hooks/afterRead/index.js +70 -0
  219. package/dist/fields/hooks/afterRead/promise.d.ts +46 -0
  220. package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -0
  221. package/dist/fields/hooks/afterRead/promise.js +178 -0
  222. package/dist/fields/hooks/afterRead/traverseFields.d.ts +44 -0
  223. package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -0
  224. package/dist/fields/hooks/afterRead/traverseFields.js +37 -0
  225. package/dist/generated/index.d.ts +10 -0
  226. package/dist/generated/index.d.ts.map +1 -0
  227. package/dist/generated/index.js +9 -0
  228. package/dist/generated/types/cms.d.ts +1766 -0
  229. package/dist/generated/types/cms.d.ts.map +1 -0
  230. package/dist/generated/types/cms.js +11 -0
  231. package/dist/generated/types/index.d.ts +16 -0
  232. package/dist/generated/types/index.d.ts.map +1 -0
  233. package/dist/generated/types/index.js +21 -0
  234. package/dist/generated/types/neon.d.ts +11 -0
  235. package/dist/generated/types/neon.d.ts.map +1 -0
  236. package/dist/generated/types/neon.js +13 -0
  237. package/dist/globals/GlobalOperations.d.ts +24 -0
  238. package/dist/globals/GlobalOperations.d.ts.map +1 -0
  239. package/dist/globals/GlobalOperations.js +165 -0
  240. package/dist/globals/index.d.ts +2 -0
  241. package/dist/globals/index.d.ts.map +1 -0
  242. package/dist/globals/index.js +1 -0
  243. package/dist/index.d.ts +75 -0
  244. package/dist/index.d.ts.map +1 -0
  245. package/dist/index.js +136 -0
  246. package/dist/instance/RevealUIInstance.d.ts +6 -0
  247. package/dist/instance/RevealUIInstance.d.ts.map +1 -0
  248. package/dist/instance/RevealUIInstance.js +293 -0
  249. package/dist/instance/index.d.ts +3 -0
  250. package/dist/instance/index.d.ts.map +1 -0
  251. package/dist/instance/index.js +2 -0
  252. package/dist/instance/logger.d.ts +31 -0
  253. package/dist/instance/logger.d.ts.map +1 -0
  254. package/dist/instance/logger.js +42 -0
  255. package/dist/instance/methods/create.d.ts +10 -0
  256. package/dist/instance/methods/create.d.ts.map +1 -0
  257. package/dist/instance/methods/create.js +38 -0
  258. package/dist/instance/methods/delete.d.ts +10 -0
  259. package/dist/instance/methods/delete.d.ts.map +1 -0
  260. package/dist/instance/methods/delete.js +24 -0
  261. package/dist/instance/methods/find.d.ts +10 -0
  262. package/dist/instance/methods/find.d.ts.map +1 -0
  263. package/dist/instance/methods/find.js +20 -0
  264. package/dist/instance/methods/findById.d.ts +13 -0
  265. package/dist/instance/methods/findById.d.ts.map +1 -0
  266. package/dist/instance/methods/findById.js +20 -0
  267. package/dist/instance/methods/hooks.d.ts +14 -0
  268. package/dist/instance/methods/hooks.d.ts.map +1 -0
  269. package/dist/instance/methods/hooks.js +34 -0
  270. package/dist/instance/methods/update.d.ts +10 -0
  271. package/dist/instance/methods/update.d.ts.map +1 -0
  272. package/dist/instance/methods/update.js +42 -0
  273. package/dist/jobs/index.d.ts +16 -0
  274. package/dist/jobs/index.d.ts.map +1 -0
  275. package/dist/jobs/index.js +14 -0
  276. package/dist/jobs/queue.d.ts +57 -0
  277. package/dist/jobs/queue.d.ts.map +1 -0
  278. package/dist/jobs/queue.js +134 -0
  279. package/dist/license-encryption.d.ts +21 -0
  280. package/dist/license-encryption.d.ts.map +1 -0
  281. package/dist/license-encryption.js +74 -0
  282. package/dist/license.d.ts +99 -0
  283. package/dist/license.d.ts.map +1 -0
  284. package/dist/license.js +262 -0
  285. package/dist/monitoring/alerts.d.ts +118 -0
  286. package/dist/monitoring/alerts.d.ts.map +1 -0
  287. package/dist/monitoring/alerts.js +324 -0
  288. package/dist/monitoring/cleanup-manager.d.ts +71 -0
  289. package/dist/monitoring/cleanup-manager.d.ts.map +1 -0
  290. package/dist/monitoring/cleanup-manager.js +226 -0
  291. package/dist/monitoring/health-monitor.d.ts +22 -0
  292. package/dist/monitoring/health-monitor.d.ts.map +1 -0
  293. package/dist/monitoring/health-monitor.js +142 -0
  294. package/dist/monitoring/index.d.ts +14 -0
  295. package/dist/monitoring/index.d.ts.map +1 -0
  296. package/dist/monitoring/index.js +17 -0
  297. package/dist/monitoring/process-registry.d.ts +97 -0
  298. package/dist/monitoring/process-registry.d.ts.map +1 -0
  299. package/dist/monitoring/process-registry.js +222 -0
  300. package/dist/monitoring/query-monitor.d.ts +153 -0
  301. package/dist/monitoring/query-monitor.d.ts.map +1 -0
  302. package/dist/monitoring/query-monitor.js +209 -0
  303. package/dist/monitoring/types.d.ts +231 -0
  304. package/dist/monitoring/types.d.ts.map +1 -0
  305. package/dist/monitoring/types.js +42 -0
  306. package/dist/monitoring/zombie-detector.d.ts +81 -0
  307. package/dist/monitoring/zombie-detector.d.ts.map +1 -0
  308. package/dist/monitoring/zombie-detector.js +236 -0
  309. package/dist/nextjs/index.d.ts +4 -0
  310. package/dist/nextjs/index.d.ts.map +1 -0
  311. package/dist/nextjs/index.js +3 -0
  312. package/dist/nextjs/utilities.d.ts +5 -0
  313. package/dist/nextjs/utilities.d.ts.map +1 -0
  314. package/dist/nextjs/utilities.js +16 -0
  315. package/dist/nextjs/withRevealUI.d.ts +20 -0
  316. package/dist/nextjs/withRevealUI.d.ts.map +1 -0
  317. package/dist/nextjs/withRevealUI.js +181 -0
  318. package/dist/observability/alerts.d.ts +138 -0
  319. package/dist/observability/alerts.d.ts.map +1 -0
  320. package/dist/observability/alerts.js +389 -0
  321. package/dist/observability/health-check.d.ts +91 -0
  322. package/dist/observability/health-check.d.ts.map +1 -0
  323. package/dist/observability/health-check.js +345 -0
  324. package/dist/observability/index.d.ts +12 -0
  325. package/dist/observability/index.d.ts.map +1 -0
  326. package/dist/observability/index.js +11 -0
  327. package/dist/observability/logger.d.ts +47 -0
  328. package/dist/observability/logger.d.ts.map +1 -0
  329. package/dist/observability/logger.js +140 -0
  330. package/dist/observability/metrics.d.ts +205 -0
  331. package/dist/observability/metrics.d.ts.map +1 -0
  332. package/dist/observability/metrics.js +429 -0
  333. package/dist/observability/tracing.d.ts +149 -0
  334. package/dist/observability/tracing.d.ts.map +1 -0
  335. package/dist/observability/tracing.js +380 -0
  336. package/dist/plugins/form-builder.d.ts +115 -0
  337. package/dist/plugins/form-builder.d.ts.map +1 -0
  338. package/dist/plugins/form-builder.js +239 -0
  339. package/dist/plugins/index.d.ts +5 -0
  340. package/dist/plugins/index.d.ts.map +1 -0
  341. package/dist/plugins/index.js +4 -0
  342. package/dist/plugins/nested-docs.d.ts +12 -0
  343. package/dist/plugins/nested-docs.d.ts.map +1 -0
  344. package/dist/plugins/nested-docs.js +111 -0
  345. package/dist/plugins/redirects.d.ts +17 -0
  346. package/dist/plugins/redirects.d.ts.map +1 -0
  347. package/dist/plugins/redirects.js +62 -0
  348. package/dist/queries/index.d.ts +2 -0
  349. package/dist/queries/index.d.ts.map +1 -0
  350. package/dist/queries/index.js +1 -0
  351. package/dist/queries/queryBuilder.d.ts +47 -0
  352. package/dist/queries/queryBuilder.d.ts.map +1 -0
  353. package/dist/queries/queryBuilder.js +276 -0
  354. package/dist/relationships/analyzer.d.ts +39 -0
  355. package/dist/relationships/analyzer.d.ts.map +1 -0
  356. package/dist/relationships/analyzer.js +135 -0
  357. package/dist/relationships/index.d.ts +3 -0
  358. package/dist/relationships/index.d.ts.map +1 -0
  359. package/dist/relationships/index.js +2 -0
  360. package/dist/relationships/populate-core.d.ts +57 -0
  361. package/dist/relationships/populate-core.d.ts.map +1 -0
  362. package/dist/relationships/populate-core.js +116 -0
  363. package/dist/relationships/populate-helpers.d.ts +58 -0
  364. package/dist/relationships/populate-helpers.d.ts.map +1 -0
  365. package/dist/relationships/populate-helpers.js +82 -0
  366. package/dist/relationships/population.d.ts +34 -0
  367. package/dist/relationships/population.d.ts.map +1 -0
  368. package/dist/relationships/population.js +193 -0
  369. package/dist/revealui.d.ts +46 -0
  370. package/dist/revealui.d.ts.map +1 -0
  371. package/dist/revealui.js +92 -0
  372. package/dist/richtext/exports/client/rcc.d.ts +37 -0
  373. package/dist/richtext/exports/client/rcc.d.ts.map +1 -0
  374. package/dist/richtext/exports/client/rcc.js +182 -0
  375. package/dist/richtext/exports/server/rsc.d.ts +134 -0
  376. package/dist/richtext/exports/server/rsc.d.ts.map +1 -0
  377. package/dist/richtext/exports/server/rsc.js +344 -0
  378. package/dist/richtext/index.d.ts +161 -0
  379. package/dist/richtext/index.d.ts.map +1 -0
  380. package/dist/richtext/index.js +243 -0
  381. package/dist/richtext/lexical.d.ts +23 -0
  382. package/dist/richtext/lexical.d.ts.map +1 -0
  383. package/dist/richtext/lexical.js +35 -0
  384. package/dist/security/index.d.ts +6 -0
  385. package/dist/security/index.d.ts.map +1 -0
  386. package/dist/security/index.js +5 -0
  387. package/dist/server/index.d.ts +21 -0
  388. package/dist/server/index.d.ts.map +1 -0
  389. package/dist/server/index.js +28 -0
  390. package/dist/server/renderPage.d.ts +69 -0
  391. package/dist/server/renderPage.d.ts.map +1 -0
  392. package/dist/server/renderPage.js +109 -0
  393. package/dist/storage/index.d.ts +2 -0
  394. package/dist/storage/index.d.ts.map +1 -0
  395. package/dist/storage/index.js +2 -0
  396. package/dist/storage/vercel-blob.d.ts +17 -0
  397. package/dist/storage/vercel-blob.d.ts.map +1 -0
  398. package/dist/storage/vercel-blob.js +86 -0
  399. package/dist/translations/index.d.ts +17 -0
  400. package/dist/translations/index.d.ts.map +1 -0
  401. package/dist/translations/index.js +1 -0
  402. package/dist/types/access.d.ts +67 -0
  403. package/dist/types/access.d.ts.map +1 -0
  404. package/dist/types/access.js +8 -0
  405. package/dist/types/api.d.ts +57 -0
  406. package/dist/types/api.d.ts.map +1 -0
  407. package/dist/types/api.js +8 -0
  408. package/dist/types/cms.d.ts +8 -0
  409. package/dist/types/cms.d.ts.map +1 -0
  410. package/dist/types/cms.js +6 -0
  411. package/dist/types/config.d.ts +152 -0
  412. package/dist/types/config.d.ts.map +1 -0
  413. package/dist/types/config.js +9 -0
  414. package/dist/types/core.d.ts +11 -0
  415. package/dist/types/core.d.ts.map +1 -0
  416. package/dist/types/core.js +9 -0
  417. package/dist/types/extensions.d.ts +116 -0
  418. package/dist/types/extensions.d.ts.map +1 -0
  419. package/dist/types/extensions.js +8 -0
  420. package/dist/types/frontend.d.ts +53 -0
  421. package/dist/types/frontend.d.ts.map +1 -0
  422. package/dist/types/frontend.js +7 -0
  423. package/dist/types/generated.d.ts +12 -0
  424. package/dist/types/generated.d.ts.map +1 -0
  425. package/dist/types/generated.js +10 -0
  426. package/dist/types/hooks.d.ts +53 -0
  427. package/dist/types/hooks.d.ts.map +1 -0
  428. package/dist/types/hooks.js +8 -0
  429. package/dist/types/index.d.ts +49 -0
  430. package/dist/types/index.d.ts.map +1 -0
  431. package/dist/types/index.js +61 -0
  432. package/dist/types/interfaces/app.d.ts +50 -0
  433. package/dist/types/interfaces/app.d.ts.map +1 -0
  434. package/dist/types/interfaces/app.js +5 -0
  435. package/dist/types/jobs.d.ts +112 -0
  436. package/dist/types/jobs.d.ts.map +1 -0
  437. package/dist/types/jobs.js +7 -0
  438. package/dist/types/legacy.d.ts +147 -0
  439. package/dist/types/legacy.d.ts.map +1 -0
  440. package/dist/types/legacy.js +8 -0
  441. package/dist/types/plugins.d.ts +17 -0
  442. package/dist/types/plugins.d.ts.map +1 -0
  443. package/dist/types/plugins.js +8 -0
  444. package/dist/types/query.d.ts +99 -0
  445. package/dist/types/query.d.ts.map +1 -0
  446. package/dist/types/query.js +24 -0
  447. package/dist/types/request.d.ts +40 -0
  448. package/dist/types/request.d.ts.map +1 -0
  449. package/dist/types/request.js +8 -0
  450. package/dist/types/richtext.d.ts +23 -0
  451. package/dist/types/richtext.d.ts.map +1 -0
  452. package/dist/types/richtext.js +8 -0
  453. package/dist/types/runtime.d.ts +275 -0
  454. package/dist/types/runtime.d.ts.map +1 -0
  455. package/dist/types/runtime.js +9 -0
  456. package/dist/types/schema.d.ts +9 -0
  457. package/dist/types/schema.d.ts.map +1 -0
  458. package/dist/types/schema.js +7 -0
  459. package/dist/types/user.d.ts +48 -0
  460. package/dist/types/user.d.ts.map +1 -0
  461. package/dist/types/user.js +8 -0
  462. package/dist/utils/access-conversion.d.ts +17 -0
  463. package/dist/utils/access-conversion.d.ts.map +1 -0
  464. package/dist/utils/access-conversion.js +96 -0
  465. package/dist/utils/api-wrapper.d.ts +63 -0
  466. package/dist/utils/api-wrapper.d.ts.map +1 -0
  467. package/dist/utils/api-wrapper.js +151 -0
  468. package/dist/utils/block-conversion.d.ts +21 -0
  469. package/dist/utils/block-conversion.d.ts.map +1 -0
  470. package/dist/utils/block-conversion.js +109 -0
  471. package/dist/utils/cache.d.ts +86 -0
  472. package/dist/utils/cache.d.ts.map +1 -0
  473. package/dist/utils/cache.js +154 -0
  474. package/dist/utils/deep-clone.d.ts +25 -0
  475. package/dist/utils/deep-clone.d.ts.map +1 -0
  476. package/dist/utils/deep-clone.js +114 -0
  477. package/dist/utils/error-responses.d.ts +57 -0
  478. package/dist/utils/error-responses.d.ts.map +1 -0
  479. package/dist/utils/error-responses.js +95 -0
  480. package/dist/utils/errors.d.ts +133 -0
  481. package/dist/utils/errors.d.ts.map +1 -0
  482. package/dist/utils/errors.js +500 -0
  483. package/dist/utils/field-conversion.d.ts +40 -0
  484. package/dist/utils/field-conversion.d.ts.map +1 -0
  485. package/dist/utils/field-conversion.js +275 -0
  486. package/dist/utils/flattenResult.d.ts +7 -0
  487. package/dist/utils/flattenResult.d.ts.map +1 -0
  488. package/dist/utils/flattenResult.js +22 -0
  489. package/dist/utils/getBlockSelect.d.ts +12 -0
  490. package/dist/utils/getBlockSelect.d.ts.map +1 -0
  491. package/dist/utils/getBlockSelect.js +12 -0
  492. package/dist/utils/getSelectMode.d.ts +8 -0
  493. package/dist/utils/getSelectMode.d.ts.map +1 -0
  494. package/dist/utils/getSelectMode.js +21 -0
  495. package/dist/utils/isValidID.d.ts +5 -0
  496. package/dist/utils/isValidID.d.ts.map +1 -0
  497. package/dist/utils/isValidID.js +13 -0
  498. package/dist/utils/json-parsing.d.ts +48 -0
  499. package/dist/utils/json-parsing.d.ts.map +1 -0
  500. package/dist/utils/json-parsing.js +130 -0
  501. package/dist/utils/logger-client.d.ts +32 -0
  502. package/dist/utils/logger-client.d.ts.map +1 -0
  503. package/dist/utils/logger-client.js +55 -0
  504. package/dist/utils/logger-server.d.ts +32 -0
  505. package/dist/utils/logger-server.d.ts.map +1 -0
  506. package/dist/utils/logger-server.js +68 -0
  507. package/dist/utils/logger.d.ts +14 -0
  508. package/dist/utils/logger.d.ts.map +1 -0
  509. package/dist/utils/logger.js +12 -0
  510. package/dist/utils/request-context.d.ts +143 -0
  511. package/dist/utils/request-context.d.ts.map +1 -0
  512. package/dist/utils/request-context.js +168 -0
  513. package/dist/utils/stripUnselectedFields.d.ts +10 -0
  514. package/dist/utils/stripUnselectedFields.d.ts.map +1 -0
  515. package/dist/utils/stripUnselectedFields.js +20 -0
  516. package/dist/utils/type-guards.d.ts +33 -0
  517. package/dist/utils/type-guards.d.ts.map +1 -0
  518. package/dist/utils/type-guards.js +63 -0
  519. package/dist/utils/user.d.ts +14 -0
  520. package/dist/utils/user.d.ts.map +1 -0
  521. package/dist/utils/user.js +15 -0
  522. package/package.json +302 -0
@@ -0,0 +1,376 @@
1
+ /**
2
+ * API Rate Limiting
3
+ *
4
+ * Implements rate limiting to prevent API abuse
5
+ */
6
+ import { NextResponse } from 'next/server';
7
+ import { logger } from '../observability/logger.js';
8
+ // WARNING: In-memory store — resets on every serverless cold start or process restart.
9
+ // This module is NOT used by any app in production (API uses apps/api/src/middleware/rate-limit.ts,
10
+ // CMS uses @revealui/auth/server which is DB-backed). Exported for framework consumers only.
11
+ // Replace with a database-backed store before using in production.
12
+ const rateLimitStore = new Map();
13
+ /**
14
+ * Default key generator (by IP address)
15
+ */
16
+ function defaultKeyGenerator(request) {
17
+ // Try to get real IP from headers
18
+ const forwarded = request.headers.get('x-forwarded-for');
19
+ const realIp = request.headers.get('x-real-ip');
20
+ if (forwarded) {
21
+ const parts = forwarded.split(',');
22
+ return parts[0]?.trim() || 'unknown';
23
+ }
24
+ if (realIp) {
25
+ return realIp;
26
+ }
27
+ // Fallback to unknown (NextRequest doesn't have ip property)
28
+ return 'unknown';
29
+ }
30
+ /**
31
+ * Check if rate limit exceeded
32
+ */
33
+ export function checkRateLimit(request, config) {
34
+ const { windowMs, maxRequests, keyGenerator = defaultKeyGenerator, skip } = config;
35
+ // Skip rate limiting if configured
36
+ if (skip?.(request)) {
37
+ return {
38
+ allowed: true,
39
+ limit: maxRequests,
40
+ remaining: maxRequests,
41
+ resetTime: Date.now() + windowMs,
42
+ };
43
+ }
44
+ // Get key
45
+ const key = keyGenerator(request);
46
+ // Get or create entry
47
+ const now = Date.now();
48
+ let entry = rateLimitStore.get(key);
49
+ // Reset if window expired
50
+ if (!entry || now > entry.resetTime) {
51
+ entry = {
52
+ count: 0,
53
+ resetTime: now + windowMs,
54
+ };
55
+ rateLimitStore.set(key, entry);
56
+ }
57
+ // Increment count
58
+ entry.count++;
59
+ // Check limit
60
+ const allowed = entry.count <= maxRequests;
61
+ const remaining = Math.max(0, maxRequests - entry.count);
62
+ return {
63
+ allowed,
64
+ limit: maxRequests,
65
+ remaining,
66
+ resetTime: entry.resetTime,
67
+ };
68
+ }
69
+ /**
70
+ * Create rate limit middleware
71
+ */
72
+ export function createRateLimitMiddleware(config) {
73
+ return async (request, next) => {
74
+ const result = checkRateLimit(request, config);
75
+ // Set rate limit headers
76
+ const response = result.allowed
77
+ ? await next()
78
+ : config.handler
79
+ ? config.handler(request)
80
+ : createRateLimitResponse(result);
81
+ // Add rate limit headers
82
+ response.headers.set('X-RateLimit-Limit', result.limit.toString());
83
+ response.headers.set('X-RateLimit-Remaining', result.remaining.toString());
84
+ response.headers.set('X-RateLimit-Reset', new Date(result.resetTime).toISOString());
85
+ return response;
86
+ };
87
+ }
88
+ /**
89
+ * Create rate limit exceeded response
90
+ */
91
+ function createRateLimitResponse(result) {
92
+ const retryAfter = Math.ceil((result.resetTime - Date.now()) / 1000);
93
+ return NextResponse.json({
94
+ error: 'Too Many Requests',
95
+ message: 'Rate limit exceeded. Please try again later.',
96
+ limit: result.limit,
97
+ remaining: result.remaining,
98
+ resetTime: new Date(result.resetTime).toISOString(),
99
+ retryAfter,
100
+ }, {
101
+ status: 429,
102
+ headers: {
103
+ 'Retry-After': retryAfter.toString(),
104
+ },
105
+ });
106
+ }
107
+ /**
108
+ * Cleanup expired rate limit entries across all stores
109
+ */
110
+ export function cleanupRateLimits() {
111
+ const now = Date.now();
112
+ let cleaned = 0;
113
+ for (const [key, entry] of rateLimitStore.entries()) {
114
+ if (now > entry.resetTime) {
115
+ rateLimitStore.delete(key);
116
+ cleaned++;
117
+ }
118
+ }
119
+ // Evict stale sliding window entries (no timestamps within last hour)
120
+ for (const [key, entry] of slidingWindowStore.entries()) {
121
+ entry.timestamps = entry.timestamps.filter((ts) => now - ts < 3_600_000);
122
+ if (entry.timestamps.length === 0) {
123
+ slidingWindowStore.delete(key);
124
+ cleaned++;
125
+ }
126
+ }
127
+ // Evict stale token bucket entries (idle for more than 1 hour)
128
+ for (const [key, entry] of tokenBucketStore.entries()) {
129
+ if (now - entry.lastRefill > 3_600_000) {
130
+ tokenBucketStore.delete(key);
131
+ cleaned++;
132
+ }
133
+ }
134
+ return cleaned;
135
+ }
136
+ /**
137
+ * Start rate limit cleanup interval
138
+ */
139
+ export function startRateLimitCleanup(intervalMs = 60000) {
140
+ return setInterval(() => {
141
+ const cleaned = cleanupRateLimits();
142
+ if (cleaned > 0) {
143
+ logger.info('Cleaned up expired rate limit entries', { count: cleaned });
144
+ }
145
+ }, intervalMs);
146
+ }
147
+ /**
148
+ * Get rate limit stats
149
+ */
150
+ export function getRateLimitStats() {
151
+ const now = Date.now();
152
+ let active = 0;
153
+ let expired = 0;
154
+ for (const entry of rateLimitStore.values()) {
155
+ if (now > entry.resetTime) {
156
+ expired++;
157
+ }
158
+ else {
159
+ active++;
160
+ }
161
+ }
162
+ return {
163
+ total: rateLimitStore.size,
164
+ active,
165
+ expired,
166
+ };
167
+ }
168
+ /**
169
+ * Default rate limit presets (immutable reference copy)
170
+ */
171
+ const DEFAULT_RATE_LIMIT_PRESETS = {
172
+ // Very strict (10 requests per minute)
173
+ veryStrict: {
174
+ windowMs: 60 * 1000,
175
+ maxRequests: 10,
176
+ },
177
+ // Strict (30 requests per minute)
178
+ strict: {
179
+ windowMs: 60 * 1000,
180
+ maxRequests: 30,
181
+ },
182
+ // Standard (100 requests per minute)
183
+ standard: {
184
+ windowMs: 60 * 1000,
185
+ maxRequests: 100,
186
+ },
187
+ // Relaxed (500 requests per minute)
188
+ relaxed: {
189
+ windowMs: 60 * 1000,
190
+ maxRequests: 500,
191
+ },
192
+ // Per hour (1000 requests per hour)
193
+ hourly: {
194
+ windowMs: 60 * 60 * 1000,
195
+ maxRequests: 1000,
196
+ },
197
+ // Per day (10000 requests per day)
198
+ daily: {
199
+ windowMs: 24 * 60 * 60 * 1000,
200
+ maxRequests: 10000,
201
+ },
202
+ };
203
+ /** Mutable presets (overridable via configureRateLimitPresets) */
204
+ let rateLimitPresets = {
205
+ ...DEFAULT_RATE_LIMIT_PRESETS,
206
+ };
207
+ /**
208
+ * Override one or more rate limit presets.
209
+ *
210
+ * Unknown keys create new presets; existing keys are merged with defaults.
211
+ */
212
+ export function configureRateLimitPresets(overrides) {
213
+ for (const [key, override] of Object.entries(overrides)) {
214
+ const base = DEFAULT_RATE_LIMIT_PRESETS[key] ?? {
215
+ windowMs: 60_000,
216
+ maxRequests: 100,
217
+ };
218
+ rateLimitPresets[key] = { ...base, ...override };
219
+ }
220
+ }
221
+ /**
222
+ * Get the current (possibly overridden) rate limit presets.
223
+ */
224
+ export function getRateLimitPresets() {
225
+ return rateLimitPresets;
226
+ }
227
+ /**
228
+ * Reset all presets to their defaults.
229
+ */
230
+ export function resetRateLimitPresets() {
231
+ rateLimitPresets = { ...DEFAULT_RATE_LIMIT_PRESETS };
232
+ }
233
+ /**
234
+ * Rate limit presets — backward-compatible accessor.
235
+ *
236
+ * Reads from the mutable `rateLimitPresets` so overrides from
237
+ * `configureRateLimitPresets()` are reflected automatically.
238
+ */
239
+ export const RATE_LIMIT_PRESETS = new Proxy({}, {
240
+ get(_target, prop) {
241
+ return rateLimitPresets[prop];
242
+ },
243
+ ownKeys() {
244
+ return Object.keys(rateLimitPresets);
245
+ },
246
+ getOwnPropertyDescriptor(_target, prop) {
247
+ if (prop in rateLimitPresets) {
248
+ return {
249
+ configurable: true,
250
+ enumerable: true,
251
+ value: rateLimitPresets[prop],
252
+ };
253
+ }
254
+ return undefined;
255
+ },
256
+ has(_target, prop) {
257
+ return prop in rateLimitPresets;
258
+ },
259
+ });
260
+ /**
261
+ * Rate limit by user ID
262
+ */
263
+ export function createUserRateLimit(config) {
264
+ return createRateLimitMiddleware({
265
+ ...config,
266
+ keyGenerator: (request) => {
267
+ // Get user ID from auth header or session
268
+ const userId = request.headers.get('x-user-id') || 'anonymous';
269
+ return `user:${userId}`;
270
+ },
271
+ });
272
+ }
273
+ /**
274
+ * Rate limit by API key
275
+ */
276
+ export function createAPIKeyRateLimit(config) {
277
+ return createRateLimitMiddleware({
278
+ ...config,
279
+ keyGenerator: (request) => {
280
+ const apiKey = request.headers.get('x-api-key') || 'unknown';
281
+ return `apikey:${apiKey}`;
282
+ },
283
+ });
284
+ }
285
+ /**
286
+ * Rate limit by endpoint
287
+ */
288
+ export function createEndpointRateLimit(config) {
289
+ return createRateLimitMiddleware({
290
+ ...config,
291
+ keyGenerator: (request) => {
292
+ const ip = defaultKeyGenerator(request);
293
+ const url = new URL(request.url);
294
+ const path = url.pathname;
295
+ return `${ip}:${path}`;
296
+ },
297
+ });
298
+ }
299
+ const slidingWindowStore = new Map();
300
+ export function checkSlidingWindowRateLimit(request, config) {
301
+ const { windowMs, maxRequests, keyGenerator = defaultKeyGenerator } = config;
302
+ const key = keyGenerator(request);
303
+ const now = Date.now();
304
+ // Get or create entry
305
+ let entry = slidingWindowStore.get(key);
306
+ if (!entry) {
307
+ entry = { timestamps: [] };
308
+ slidingWindowStore.set(key, entry);
309
+ }
310
+ // Remove expired timestamps
311
+ entry.timestamps = entry.timestamps.filter((ts) => now - ts < windowMs);
312
+ // Check limit
313
+ const allowed = entry.timestamps.length < maxRequests;
314
+ if (allowed) {
315
+ entry.timestamps.push(now);
316
+ }
317
+ return {
318
+ allowed,
319
+ limit: maxRequests,
320
+ remaining: Math.max(0, maxRequests - entry.timestamps.length),
321
+ };
322
+ }
323
+ const tokenBucketStore = new Map();
324
+ export function checkTokenBucketRateLimit(request, config) {
325
+ const { maxRequests, refillRate, windowMs, keyGenerator = defaultKeyGenerator } = config;
326
+ const key = keyGenerator(request);
327
+ const now = Date.now();
328
+ // Get or create entry
329
+ let entry = tokenBucketStore.get(key);
330
+ if (!entry) {
331
+ entry = {
332
+ tokens: maxRequests,
333
+ lastRefill: now,
334
+ };
335
+ tokenBucketStore.set(key, entry);
336
+ }
337
+ // Refill tokens
338
+ const timePassed = now - entry.lastRefill;
339
+ const tokensToAdd = Math.floor((timePassed / windowMs) * refillRate);
340
+ if (tokensToAdd > 0) {
341
+ entry.tokens = Math.min(maxRequests, entry.tokens + tokensToAdd);
342
+ entry.lastRefill = now;
343
+ }
344
+ // Check if tokens available
345
+ const allowed = entry.tokens > 0;
346
+ if (allowed) {
347
+ entry.tokens--;
348
+ }
349
+ return {
350
+ allowed,
351
+ limit: maxRequests,
352
+ remaining: entry.tokens,
353
+ };
354
+ }
355
+ /**
356
+ * Clear rate limit for specific key
357
+ */
358
+ export function clearRateLimit(key) {
359
+ rateLimitStore.delete(key);
360
+ slidingWindowStore.delete(key);
361
+ tokenBucketStore.delete(key);
362
+ }
363
+ /**
364
+ * Clear all rate limits
365
+ */
366
+ export function clearAllRateLimits() {
367
+ rateLimitStore.clear();
368
+ slidingWindowStore.clear();
369
+ tokenBucketStore.clear();
370
+ }
371
+ /**
372
+ * Get rate limit info for key
373
+ */
374
+ export function getRateLimitInfo(key) {
375
+ return rateLimitStore.get(key) || null;
376
+ }
@@ -0,0 +1,125 @@
1
+ /**
2
+ * API Response Caching Layer
3
+ *
4
+ * Implements HTTP caching for API responses
5
+ */
6
+ import { type NextRequest, NextResponse } from 'next/server';
7
+ interface CacheOptions {
8
+ ttl?: number;
9
+ staleWhileRevalidate?: number;
10
+ tags?: string[];
11
+ vary?: string[];
12
+ private?: boolean;
13
+ noStore?: boolean;
14
+ }
15
+ /**
16
+ * Generate cache key from request
17
+ */
18
+ export declare function generateCacheKey(request: NextRequest): string;
19
+ /**
20
+ * Get cached response
21
+ */
22
+ export declare function getCachedResponse(request: NextRequest): Promise<NextResponse | null>;
23
+ /**
24
+ * Set cached response
25
+ */
26
+ export declare function setCachedResponse(request: NextRequest, response: NextResponse, options?: CacheOptions): Promise<void>;
27
+ /**
28
+ * Invalidate cache by key
29
+ */
30
+ export declare function invalidateCacheKey(key: string): void;
31
+ /**
32
+ * Invalidate cache by pattern
33
+ */
34
+ export declare function invalidateCachePattern(pattern: string): number;
35
+ /**
36
+ * Invalidate cache by tags
37
+ */
38
+ export declare function invalidateCacheTags(tags: string[]): number;
39
+ /**
40
+ * Clear all cache
41
+ */
42
+ export declare function clearCache(): void;
43
+ /**
44
+ * Set Cache-Control headers
45
+ */
46
+ export declare function setCacheHeaders(response: NextResponse, options: CacheOptions): NextResponse;
47
+ /**
48
+ * Create caching middleware
49
+ */
50
+ export declare function createCacheMiddleware(options?: CacheOptions): (request: NextRequest, next: () => Promise<NextResponse>) => Promise<NextResponse<unknown>>;
51
+ /**
52
+ * Get cache statistics
53
+ */
54
+ export declare function getCacheStats(): {
55
+ totalEntries: number;
56
+ validEntries: number;
57
+ expiredEntries: number;
58
+ totalSize: number;
59
+ averageSize: number;
60
+ };
61
+ /**
62
+ * Purge expired entries
63
+ */
64
+ export declare function purgeExpiredCache(): number;
65
+ /**
66
+ * Start cache cleanup interval
67
+ */
68
+ export declare function startCacheCleanup(intervalMs?: number): NodeJS.Timeout;
69
+ /**
70
+ * Cache response with ETag
71
+ */
72
+ export declare function withETag(response: NextResponse, content: string): NextResponse;
73
+ /**
74
+ * Check if request has matching ETag
75
+ */
76
+ export declare function checkETag(request: NextRequest, etag: string): boolean;
77
+ /**
78
+ * Create 304 Not Modified response
79
+ */
80
+ export declare function createNotModifiedResponse(): NextResponse;
81
+ /**
82
+ * Cache presets for common scenarios
83
+ */
84
+ export declare const CACHE_PRESETS: {
85
+ readonly noCache: {
86
+ readonly noStore: true;
87
+ };
88
+ readonly short: {
89
+ readonly ttl: 60;
90
+ readonly staleWhileRevalidate: 30;
91
+ };
92
+ readonly medium: {
93
+ readonly ttl: 300;
94
+ readonly staleWhileRevalidate: 60;
95
+ };
96
+ readonly long: {
97
+ readonly ttl: 3600;
98
+ readonly staleWhileRevalidate: 300;
99
+ };
100
+ readonly veryLong: {
101
+ readonly ttl: 86400;
102
+ readonly staleWhileRevalidate: 3600;
103
+ };
104
+ readonly immutable: {
105
+ readonly ttl: 31536000;
106
+ readonly private: false;
107
+ };
108
+ readonly private: {
109
+ readonly ttl: 300;
110
+ readonly private: true;
111
+ };
112
+ readonly public: {
113
+ readonly ttl: 3600;
114
+ readonly private: false;
115
+ };
116
+ };
117
+ /**
118
+ * Cache API response
119
+ */
120
+ export declare function cacheAPIResponse<T>(key: string, responseFn: () => Promise<T>, options?: CacheOptions): Promise<{
121
+ data: T;
122
+ cached: boolean;
123
+ }>;
124
+ export {};
125
+ //# sourceMappingURL=response-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-cache.d.ts","sourceRoot":"","sources":["../../src/api/response-cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG7D,UAAU,YAAY;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAiBD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAW7D;AAyBD;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CA0B1F;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,YAAY,EACtB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAY9D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAW1D;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAEjC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CA6B3F;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,YAAiB,IAChD,SAAS,WAAW,EAAE,MAAM,MAAM,OAAO,CAAC,YAAY,CAAC,oCAqBtE;AAED;;GAEG;AACH,wBAAgB,aAAa;;;;;;EA0B5B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAc1C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,GAAE,MAAc,GAAG,MAAM,CAAC,OAAO,CAO5E;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,CAQ9E;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAGrE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,YAAY,CAKxD;AAED;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+ChB,CAAC;AAEX;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC5B,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,CAsCvC"}