convex-cms 0.0.1

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 (379) hide show
  1. package/dist/cli/commands/admin.d.ts +16 -0
  2. package/dist/cli/commands/admin.d.ts.map +1 -0
  3. package/dist/cli/commands/admin.js +88 -0
  4. package/dist/cli/commands/admin.js.map +1 -0
  5. package/dist/cli/index.d.ts +3 -0
  6. package/dist/cli/index.d.ts.map +1 -0
  7. package/dist/cli/index.js +18 -0
  8. package/dist/cli/index.js.map +1 -0
  9. package/dist/cli/utils/detectConvexUrl.d.ts +13 -0
  10. package/dist/cli/utils/detectConvexUrl.d.ts.map +1 -0
  11. package/dist/cli/utils/detectConvexUrl.js +48 -0
  12. package/dist/cli/utils/detectConvexUrl.js.map +1 -0
  13. package/dist/cli/utils/openBrowser.d.ts +7 -0
  14. package/dist/cli/utils/openBrowser.d.ts.map +1 -0
  15. package/dist/cli/utils/openBrowser.js +17 -0
  16. package/dist/cli/utils/openBrowser.js.map +1 -0
  17. package/dist/client/admin-config.d.ts +126 -0
  18. package/dist/client/admin-config.d.ts.map +1 -0
  19. package/dist/client/admin-config.js +117 -0
  20. package/dist/client/admin-config.js.map +1 -0
  21. package/dist/client/adminApi.d.ts +2273 -0
  22. package/dist/client/adminApi.d.ts.map +1 -0
  23. package/dist/client/adminApi.js +716 -0
  24. package/dist/client/adminApi.js.map +1 -0
  25. package/dist/client/agentTools.d.ts +933 -0
  26. package/dist/client/agentTools.d.ts.map +1 -0
  27. package/dist/client/agentTools.js +1004 -0
  28. package/dist/client/agentTools.js.map +1 -0
  29. package/dist/client/argTypes.d.ts +212 -0
  30. package/dist/client/argTypes.d.ts.map +1 -0
  31. package/dist/client/argTypes.js +5 -0
  32. package/dist/client/argTypes.js.map +1 -0
  33. package/dist/client/field-types.d.ts +55 -0
  34. package/dist/client/field-types.d.ts.map +1 -0
  35. package/dist/client/field-types.js +152 -0
  36. package/dist/client/field-types.js.map +1 -0
  37. package/dist/client/index.d.ts +189 -0
  38. package/dist/client/index.d.ts.map +1 -0
  39. package/dist/client/index.js +668 -0
  40. package/dist/client/index.js.map +1 -0
  41. package/dist/client/queryBuilder.d.ts +765 -0
  42. package/dist/client/queryBuilder.d.ts.map +1 -0
  43. package/dist/client/queryBuilder.js +970 -0
  44. package/dist/client/queryBuilder.js.map +1 -0
  45. package/dist/client/schema/codegen.d.ts +128 -0
  46. package/dist/client/schema/codegen.d.ts.map +1 -0
  47. package/dist/client/schema/codegen.js +318 -0
  48. package/dist/client/schema/codegen.js.map +1 -0
  49. package/dist/client/schema/defineContentType.d.ts +221 -0
  50. package/dist/client/schema/defineContentType.d.ts.map +1 -0
  51. package/dist/client/schema/defineContentType.js +380 -0
  52. package/dist/client/schema/defineContentType.js.map +1 -0
  53. package/dist/client/schema/index.d.ts +85 -0
  54. package/dist/client/schema/index.d.ts.map +1 -0
  55. package/dist/client/schema/index.js +92 -0
  56. package/dist/client/schema/index.js.map +1 -0
  57. package/dist/client/schema/schemaDrift.d.ts +199 -0
  58. package/dist/client/schema/schemaDrift.d.ts.map +1 -0
  59. package/dist/client/schema/schemaDrift.js +340 -0
  60. package/dist/client/schema/schemaDrift.js.map +1 -0
  61. package/dist/client/schema/typedClient.d.ts +401 -0
  62. package/dist/client/schema/typedClient.d.ts.map +1 -0
  63. package/dist/client/schema/typedClient.js +269 -0
  64. package/dist/client/schema/typedClient.js.map +1 -0
  65. package/dist/client/schema/types.d.ts +477 -0
  66. package/dist/client/schema/types.d.ts.map +1 -0
  67. package/dist/client/schema/types.js +39 -0
  68. package/dist/client/schema/types.js.map +1 -0
  69. package/dist/client/types.d.ts +449 -0
  70. package/dist/client/types.d.ts.map +1 -0
  71. package/dist/client/types.js +149 -0
  72. package/dist/client/types.js.map +1 -0
  73. package/dist/client/workflows.d.ts +51 -0
  74. package/dist/client/workflows.d.ts.map +1 -0
  75. package/dist/client/workflows.js +103 -0
  76. package/dist/client/workflows.js.map +1 -0
  77. package/dist/client/wrapper.d.ts +2198 -0
  78. package/dist/client/wrapper.d.ts.map +1 -0
  79. package/dist/client/wrapper.js +2651 -0
  80. package/dist/client/wrapper.js.map +1 -0
  81. package/dist/component/_generated/api.d.ts +124 -0
  82. package/dist/component/_generated/api.d.ts.map +1 -0
  83. package/dist/component/_generated/api.js +31 -0
  84. package/dist/component/_generated/api.js.map +1 -0
  85. package/dist/component/_generated/component.d.ts +4321 -0
  86. package/dist/component/_generated/component.d.ts.map +1 -0
  87. package/dist/component/_generated/component.js +11 -0
  88. package/dist/component/_generated/component.js.map +1 -0
  89. package/dist/component/_generated/dataModel.d.ts +46 -0
  90. package/dist/component/_generated/dataModel.d.ts.map +1 -0
  91. package/dist/component/_generated/dataModel.js +11 -0
  92. package/dist/component/_generated/dataModel.js.map +1 -0
  93. package/dist/component/_generated/server.d.ts +121 -0
  94. package/dist/component/_generated/server.d.ts.map +1 -0
  95. package/dist/component/_generated/server.js +78 -0
  96. package/dist/component/_generated/server.js.map +1 -0
  97. package/dist/component/auditLog.d.ts +410 -0
  98. package/dist/component/auditLog.d.ts.map +1 -0
  99. package/dist/component/auditLog.js +607 -0
  100. package/dist/component/auditLog.js.map +1 -0
  101. package/dist/component/authorization.d.ts +323 -0
  102. package/dist/component/authorization.d.ts.map +1 -0
  103. package/dist/component/authorization.js +464 -0
  104. package/dist/component/authorization.js.map +1 -0
  105. package/dist/component/authorizationHooks.d.ts +184 -0
  106. package/dist/component/authorizationHooks.d.ts.map +1 -0
  107. package/dist/component/authorizationHooks.js +521 -0
  108. package/dist/component/authorizationHooks.js.map +1 -0
  109. package/dist/component/bulkOperations.d.ts +200 -0
  110. package/dist/component/bulkOperations.d.ts.map +1 -0
  111. package/dist/component/bulkOperations.js +568 -0
  112. package/dist/component/bulkOperations.js.map +1 -0
  113. package/dist/component/contentEntries.d.ts +719 -0
  114. package/dist/component/contentEntries.d.ts.map +1 -0
  115. package/dist/component/contentEntries.js +1617 -0
  116. package/dist/component/contentEntries.js.map +1 -0
  117. package/dist/component/contentEntryMutations.d.ts +505 -0
  118. package/dist/component/contentEntryMutations.d.ts.map +1 -0
  119. package/dist/component/contentEntryMutations.js +1009 -0
  120. package/dist/component/contentEntryMutations.js.map +1 -0
  121. package/dist/component/contentEntryValidation.d.ts +115 -0
  122. package/dist/component/contentEntryValidation.d.ts.map +1 -0
  123. package/dist/component/contentEntryValidation.js +546 -0
  124. package/dist/component/contentEntryValidation.js.map +1 -0
  125. package/dist/component/contentLock.d.ts +328 -0
  126. package/dist/component/contentLock.d.ts.map +1 -0
  127. package/dist/component/contentLock.js +471 -0
  128. package/dist/component/contentLock.js.map +1 -0
  129. package/dist/component/contentTypeMigration.d.ts +411 -0
  130. package/dist/component/contentTypeMigration.d.ts.map +1 -0
  131. package/dist/component/contentTypeMigration.js +805 -0
  132. package/dist/component/contentTypeMigration.js.map +1 -0
  133. package/dist/component/contentTypeMutations.d.ts +975 -0
  134. package/dist/component/contentTypeMutations.d.ts.map +1 -0
  135. package/dist/component/contentTypeMutations.js +768 -0
  136. package/dist/component/contentTypeMutations.js.map +1 -0
  137. package/dist/component/contentTypes.d.ts +538 -0
  138. package/dist/component/contentTypes.d.ts.map +1 -0
  139. package/dist/component/contentTypes.js +304 -0
  140. package/dist/component/contentTypes.js.map +1 -0
  141. package/dist/component/convex.config.d.ts +42 -0
  142. package/dist/component/convex.config.d.ts.map +1 -0
  143. package/dist/component/convex.config.js +43 -0
  144. package/dist/component/convex.config.js.map +1 -0
  145. package/dist/component/documentTypes.d.ts +186 -0
  146. package/dist/component/documentTypes.d.ts.map +1 -0
  147. package/dist/component/documentTypes.js +23 -0
  148. package/dist/component/documentTypes.js.map +1 -0
  149. package/dist/component/eventEmitter.d.ts +281 -0
  150. package/dist/component/eventEmitter.d.ts.map +1 -0
  151. package/dist/component/eventEmitter.js +300 -0
  152. package/dist/component/eventEmitter.js.map +1 -0
  153. package/dist/component/exportImport.d.ts +1120 -0
  154. package/dist/component/exportImport.d.ts.map +1 -0
  155. package/dist/component/exportImport.js +931 -0
  156. package/dist/component/exportImport.js.map +1 -0
  157. package/dist/component/index.d.ts +28 -0
  158. package/dist/component/index.d.ts.map +1 -0
  159. package/dist/component/index.js +142 -0
  160. package/dist/component/index.js.map +1 -0
  161. package/dist/component/lib/deepReferenceResolver.d.ts +252 -0
  162. package/dist/component/lib/deepReferenceResolver.d.ts.map +1 -0
  163. package/dist/component/lib/deepReferenceResolver.js +601 -0
  164. package/dist/component/lib/deepReferenceResolver.js.map +1 -0
  165. package/dist/component/lib/errors.d.ts +306 -0
  166. package/dist/component/lib/errors.d.ts.map +1 -0
  167. package/dist/component/lib/errors.js +407 -0
  168. package/dist/component/lib/errors.js.map +1 -0
  169. package/dist/component/lib/index.d.ts +10 -0
  170. package/dist/component/lib/index.d.ts.map +1 -0
  171. package/dist/component/lib/index.js +33 -0
  172. package/dist/component/lib/index.js.map +1 -0
  173. package/dist/component/lib/mediaReferenceResolver.d.ts +217 -0
  174. package/dist/component/lib/mediaReferenceResolver.d.ts.map +1 -0
  175. package/dist/component/lib/mediaReferenceResolver.js +326 -0
  176. package/dist/component/lib/mediaReferenceResolver.js.map +1 -0
  177. package/dist/component/lib/metadataExtractor.d.ts +245 -0
  178. package/dist/component/lib/metadataExtractor.d.ts.map +1 -0
  179. package/dist/component/lib/metadataExtractor.js +548 -0
  180. package/dist/component/lib/metadataExtractor.js.map +1 -0
  181. package/dist/component/lib/mutationAuth.d.ts +95 -0
  182. package/dist/component/lib/mutationAuth.d.ts.map +1 -0
  183. package/dist/component/lib/mutationAuth.js +146 -0
  184. package/dist/component/lib/mutationAuth.js.map +1 -0
  185. package/dist/component/lib/queries.d.ts +17 -0
  186. package/dist/component/lib/queries.d.ts.map +1 -0
  187. package/dist/component/lib/queries.js +49 -0
  188. package/dist/component/lib/queries.js.map +1 -0
  189. package/dist/component/lib/ragContentChunker.d.ts +423 -0
  190. package/dist/component/lib/ragContentChunker.d.ts.map +1 -0
  191. package/dist/component/lib/ragContentChunker.js +897 -0
  192. package/dist/component/lib/ragContentChunker.js.map +1 -0
  193. package/dist/component/lib/referenceResolver.d.ts +175 -0
  194. package/dist/component/lib/referenceResolver.d.ts.map +1 -0
  195. package/dist/component/lib/referenceResolver.js +293 -0
  196. package/dist/component/lib/referenceResolver.js.map +1 -0
  197. package/dist/component/lib/slugGenerator.d.ts +71 -0
  198. package/dist/component/lib/slugGenerator.d.ts.map +1 -0
  199. package/dist/component/lib/slugGenerator.js +207 -0
  200. package/dist/component/lib/slugGenerator.js.map +1 -0
  201. package/dist/component/lib/slugUniqueness.d.ts +131 -0
  202. package/dist/component/lib/slugUniqueness.d.ts.map +1 -0
  203. package/dist/component/lib/slugUniqueness.js +229 -0
  204. package/dist/component/lib/slugUniqueness.js.map +1 -0
  205. package/dist/component/lib/softDelete.d.ts +18 -0
  206. package/dist/component/lib/softDelete.d.ts.map +1 -0
  207. package/dist/component/lib/softDelete.js +29 -0
  208. package/dist/component/lib/softDelete.js.map +1 -0
  209. package/dist/component/localeFallbackChain.d.ts +410 -0
  210. package/dist/component/localeFallbackChain.d.ts.map +1 -0
  211. package/dist/component/localeFallbackChain.js +467 -0
  212. package/dist/component/localeFallbackChain.js.map +1 -0
  213. package/dist/component/localeFields.d.ts +508 -0
  214. package/dist/component/localeFields.d.ts.map +1 -0
  215. package/dist/component/localeFields.js +592 -0
  216. package/dist/component/localeFields.js.map +1 -0
  217. package/dist/component/mediaAssetMutations.d.ts +235 -0
  218. package/dist/component/mediaAssetMutations.d.ts.map +1 -0
  219. package/dist/component/mediaAssetMutations.js +558 -0
  220. package/dist/component/mediaAssetMutations.js.map +1 -0
  221. package/dist/component/mediaAssets.d.ts +168 -0
  222. package/dist/component/mediaAssets.d.ts.map +1 -0
  223. package/dist/component/mediaAssets.js +618 -0
  224. package/dist/component/mediaAssets.js.map +1 -0
  225. package/dist/component/mediaFolderMutations.d.ts +642 -0
  226. package/dist/component/mediaFolderMutations.d.ts.map +1 -0
  227. package/dist/component/mediaFolderMutations.js +849 -0
  228. package/dist/component/mediaFolderMutations.js.map +1 -0
  229. package/dist/component/mediaUploadMutations.d.ts +136 -0
  230. package/dist/component/mediaUploadMutations.d.ts.map +1 -0
  231. package/dist/component/mediaUploadMutations.js +205 -0
  232. package/dist/component/mediaUploadMutations.js.map +1 -0
  233. package/dist/component/mediaVariantMutations.d.ts +468 -0
  234. package/dist/component/mediaVariantMutations.d.ts.map +1 -0
  235. package/dist/component/mediaVariantMutations.js +737 -0
  236. package/dist/component/mediaVariantMutations.js.map +1 -0
  237. package/dist/component/mediaVariants.d.ts +525 -0
  238. package/dist/component/mediaVariants.d.ts.map +1 -0
  239. package/dist/component/mediaVariants.js +661 -0
  240. package/dist/component/mediaVariants.js.map +1 -0
  241. package/dist/component/ragContentIndexer.d.ts +595 -0
  242. package/dist/component/ragContentIndexer.d.ts.map +1 -0
  243. package/dist/component/ragContentIndexer.js +794 -0
  244. package/dist/component/ragContentIndexer.js.map +1 -0
  245. package/dist/component/rateLimitHooks.d.ts +266 -0
  246. package/dist/component/rateLimitHooks.d.ts.map +1 -0
  247. package/dist/component/rateLimitHooks.js +412 -0
  248. package/dist/component/rateLimitHooks.js.map +1 -0
  249. package/dist/component/roles.d.ts +649 -0
  250. package/dist/component/roles.d.ts.map +1 -0
  251. package/dist/component/roles.js +884 -0
  252. package/dist/component/roles.js.map +1 -0
  253. package/dist/component/scheduledPublish.d.ts +182 -0
  254. package/dist/component/scheduledPublish.d.ts.map +1 -0
  255. package/dist/component/scheduledPublish.js +304 -0
  256. package/dist/component/scheduledPublish.js.map +1 -0
  257. package/dist/component/schema.d.ts +4114 -0
  258. package/dist/component/schema.d.ts.map +1 -0
  259. package/dist/component/schema.js +469 -0
  260. package/dist/component/schema.js.map +1 -0
  261. package/dist/component/taxonomies.d.ts +476 -0
  262. package/dist/component/taxonomies.d.ts.map +1 -0
  263. package/dist/component/taxonomies.js +785 -0
  264. package/dist/component/taxonomies.js.map +1 -0
  265. package/dist/component/taxonomyMutations.d.ts +206 -0
  266. package/dist/component/taxonomyMutations.d.ts.map +1 -0
  267. package/dist/component/taxonomyMutations.js +1001 -0
  268. package/dist/component/taxonomyMutations.js.map +1 -0
  269. package/dist/component/trash.d.ts +265 -0
  270. package/dist/component/trash.d.ts.map +1 -0
  271. package/dist/component/trash.js +621 -0
  272. package/dist/component/trash.js.map +1 -0
  273. package/dist/component/types.d.ts +4 -0
  274. package/dist/component/types.d.ts.map +1 -0
  275. package/dist/component/types.js +2 -0
  276. package/dist/component/types.js.map +1 -0
  277. package/dist/component/userContext.d.ts +508 -0
  278. package/dist/component/userContext.d.ts.map +1 -0
  279. package/dist/component/userContext.js +615 -0
  280. package/dist/component/userContext.js.map +1 -0
  281. package/dist/component/validation.d.ts +387 -0
  282. package/dist/component/validation.d.ts.map +1 -0
  283. package/dist/component/validation.js +1052 -0
  284. package/dist/component/validation.js.map +1 -0
  285. package/dist/component/validators.d.ts +4645 -0
  286. package/dist/component/validators.d.ts.map +1 -0
  287. package/dist/component/validators.js +641 -0
  288. package/dist/component/validators.js.map +1 -0
  289. package/dist/component/versionMutations.d.ts +216 -0
  290. package/dist/component/versionMutations.d.ts.map +1 -0
  291. package/dist/component/versionMutations.js +321 -0
  292. package/dist/component/versionMutations.js.map +1 -0
  293. package/dist/component/webhookTrigger.d.ts +770 -0
  294. package/dist/component/webhookTrigger.d.ts.map +1 -0
  295. package/dist/component/webhookTrigger.js +1413 -0
  296. package/dist/component/webhookTrigger.js.map +1 -0
  297. package/dist/react/index.d.ts +316 -0
  298. package/dist/react/index.d.ts.map +1 -0
  299. package/dist/react/index.js +558 -0
  300. package/dist/react/index.js.map +1 -0
  301. package/dist/test.d.ts +2230 -0
  302. package/dist/test.d.ts.map +1 -0
  303. package/dist/test.js +1107 -0
  304. package/dist/test.js.map +1 -0
  305. package/package.json +95 -0
  306. package/src/cli/commands/admin.ts +104 -0
  307. package/src/cli/index.ts +21 -0
  308. package/src/cli/utils/detectConvexUrl.ts +54 -0
  309. package/src/cli/utils/openBrowser.ts +16 -0
  310. package/src/client/admin-config.ts +138 -0
  311. package/src/client/adminApi.ts +942 -0
  312. package/src/client/agentTools.ts +1311 -0
  313. package/src/client/argTypes.ts +316 -0
  314. package/src/client/field-types.ts +187 -0
  315. package/src/client/index.ts +1301 -0
  316. package/src/client/queryBuilder.ts +1100 -0
  317. package/src/client/schema/codegen.ts +500 -0
  318. package/src/client/schema/defineContentType.ts +501 -0
  319. package/src/client/schema/index.ts +169 -0
  320. package/src/client/schema/schemaDrift.ts +574 -0
  321. package/src/client/schema/typedClient.ts +688 -0
  322. package/src/client/schema/types.ts +666 -0
  323. package/src/client/types.ts +723 -0
  324. package/src/client/workflows.ts +141 -0
  325. package/src/client/wrapper.ts +4304 -0
  326. package/src/component/_generated/api.ts +140 -0
  327. package/src/component/_generated/component.ts +5029 -0
  328. package/src/component/_generated/dataModel.ts +60 -0
  329. package/src/component/_generated/server.ts +156 -0
  330. package/src/component/authorization.ts +647 -0
  331. package/src/component/authorizationHooks.ts +668 -0
  332. package/src/component/bulkOperations.ts +687 -0
  333. package/src/component/contentEntries.ts +1976 -0
  334. package/src/component/contentEntryMutations.ts +1223 -0
  335. package/src/component/contentEntryValidation.ts +707 -0
  336. package/src/component/contentLock.ts +550 -0
  337. package/src/component/contentTypeMigration.ts +1064 -0
  338. package/src/component/contentTypeMutations.ts +969 -0
  339. package/src/component/contentTypes.ts +346 -0
  340. package/src/component/convex.config.ts +44 -0
  341. package/src/component/documentTypes.ts +240 -0
  342. package/src/component/eventEmitter.ts +485 -0
  343. package/src/component/exportImport.ts +1169 -0
  344. package/src/component/index.ts +491 -0
  345. package/src/component/lib/deepReferenceResolver.ts +999 -0
  346. package/src/component/lib/errors.ts +816 -0
  347. package/src/component/lib/index.ts +145 -0
  348. package/src/component/lib/mediaReferenceResolver.ts +495 -0
  349. package/src/component/lib/metadataExtractor.ts +792 -0
  350. package/src/component/lib/mutationAuth.ts +199 -0
  351. package/src/component/lib/queries.ts +79 -0
  352. package/src/component/lib/ragContentChunker.ts +1371 -0
  353. package/src/component/lib/referenceResolver.ts +430 -0
  354. package/src/component/lib/slugGenerator.ts +262 -0
  355. package/src/component/lib/slugUniqueness.ts +333 -0
  356. package/src/component/lib/softDelete.ts +44 -0
  357. package/src/component/localeFallbackChain.ts +673 -0
  358. package/src/component/localeFields.ts +896 -0
  359. package/src/component/mediaAssetMutations.ts +725 -0
  360. package/src/component/mediaAssets.ts +932 -0
  361. package/src/component/mediaFolderMutations.ts +1046 -0
  362. package/src/component/mediaUploadMutations.ts +224 -0
  363. package/src/component/mediaVariantMutations.ts +900 -0
  364. package/src/component/mediaVariants.ts +793 -0
  365. package/src/component/ragContentIndexer.ts +1067 -0
  366. package/src/component/rateLimitHooks.ts +572 -0
  367. package/src/component/roles.ts +1360 -0
  368. package/src/component/scheduledPublish.ts +358 -0
  369. package/src/component/schema.ts +617 -0
  370. package/src/component/taxonomies.ts +949 -0
  371. package/src/component/taxonomyMutations.ts +1210 -0
  372. package/src/component/trash.ts +724 -0
  373. package/src/component/userContext.ts +898 -0
  374. package/src/component/validation.ts +1388 -0
  375. package/src/component/validators.ts +949 -0
  376. package/src/component/versionMutations.ts +392 -0
  377. package/src/component/webhookTrigger.ts +1922 -0
  378. package/src/react/index.ts +898 -0
  379. package/src/test.ts +1580 -0
@@ -0,0 +1,407 @@
1
+ /**
2
+ * Centralized Error Handling Module
3
+ *
4
+ * Provides structured error codes, error classes, and helper functions
5
+ * for consistent error handling across all mutation files.
6
+ *
7
+ * Error Format:
8
+ * - code: Machine-readable error code (e.g., "CONTENT_TYPE_NOT_FOUND")
9
+ * - category: Error category for routing (e.g., "NOT_FOUND", "DELETED")
10
+ * - message: Human-readable description
11
+ * - context: Additional data for debugging (resource IDs, states, etc.)
12
+ */
13
+ // =============================================================================
14
+ // Error Codes
15
+ // =============================================================================
16
+ /**
17
+ * Content Type Error Codes
18
+ */
19
+ export const ContentTypeErrorCodes = {
20
+ NOT_FOUND: "CONTENT_TYPE_NOT_FOUND",
21
+ DELETED: "CONTENT_TYPE_DELETED",
22
+ INACTIVE: "CONTENT_TYPE_INACTIVE",
23
+ NAME_INVALID: "CONTENT_TYPE_NAME_INVALID",
24
+ NAME_DUPLICATE: "CONTENT_TYPE_NAME_DUPLICATE",
25
+ FIELD_VALIDATION_FAILED: "CONTENT_TYPE_FIELD_VALIDATION_FAILED",
26
+ SLUG_FIELD_INVALID: "CONTENT_TYPE_SLUG_FIELD_INVALID",
27
+ TITLE_FIELD_INVALID: "CONTENT_TYPE_TITLE_FIELD_INVALID",
28
+ HAS_ENTRIES: "CONTENT_TYPE_HAS_ENTRIES",
29
+ BREAKING_CHANGE: "CONTENT_TYPE_BREAKING_CHANGE",
30
+ };
31
+ /**
32
+ * Content Entry Error Codes
33
+ */
34
+ export const ContentEntryErrorCodes = {
35
+ NOT_FOUND: "CONTENT_ENTRY_NOT_FOUND",
36
+ DELETED: "CONTENT_ENTRY_DELETED",
37
+ NOT_DELETED: "CONTENT_ENTRY_NOT_DELETED",
38
+ ALREADY_PUBLISHED: "CONTENT_ENTRY_ALREADY_PUBLISHED",
39
+ NOT_PUBLISHED: "CONTENT_ENTRY_NOT_PUBLISHED",
40
+ ARCHIVED: "CONTENT_ENTRY_ARCHIVED",
41
+ VALIDATION_FAILED: "CONTENT_ENTRY_VALIDATION_FAILED",
42
+ SLUG_CONFLICT: "CONTENT_ENTRY_SLUG_CONFLICT",
43
+ LOCKED: "CONTENT_ENTRY_LOCKED",
44
+ CREATE_FAILED: "CONTENT_ENTRY_CREATE_FAILED",
45
+ UPDATE_FAILED: "CONTENT_ENTRY_UPDATE_FAILED",
46
+ };
47
+ /**
48
+ * Media Asset Error Codes
49
+ */
50
+ export const MediaAssetErrorCodes = {
51
+ NOT_FOUND: "MEDIA_ASSET_NOT_FOUND",
52
+ DELETED: "MEDIA_ASSET_DELETED",
53
+ NOT_DELETED: "MEDIA_ASSET_NOT_DELETED",
54
+ HAS_REFERENCES: "MEDIA_ASSET_HAS_REFERENCES",
55
+ CREATE_FAILED: "MEDIA_ASSET_CREATE_FAILED",
56
+ UPDATE_FAILED: "MEDIA_ASSET_UPDATE_FAILED",
57
+ UPLOAD_INVALID: "MEDIA_ASSET_UPLOAD_INVALID",
58
+ };
59
+ /**
60
+ * Media Folder Error Codes
61
+ */
62
+ export const MediaFolderErrorCodes = {
63
+ NOT_FOUND: "MEDIA_FOLDER_NOT_FOUND",
64
+ DELETED: "MEDIA_FOLDER_DELETED",
65
+ NOT_DELETED: "MEDIA_FOLDER_NOT_DELETED",
66
+ NAME_INVALID: "MEDIA_FOLDER_NAME_INVALID",
67
+ NAME_DUPLICATE: "MEDIA_FOLDER_NAME_DUPLICATE",
68
+ DEPTH_EXCEEDED: "MEDIA_FOLDER_DEPTH_EXCEEDED",
69
+ PATH_TOO_LONG: "MEDIA_FOLDER_PATH_TOO_LONG",
70
+ HAS_CONTENTS: "MEDIA_FOLDER_HAS_CONTENTS",
71
+ CIRCULAR_MOVE: "MEDIA_FOLDER_CIRCULAR_MOVE",
72
+ PARENT_DELETED: "MEDIA_FOLDER_PARENT_DELETED",
73
+ CREATE_FAILED: "MEDIA_FOLDER_CREATE_FAILED",
74
+ };
75
+ /**
76
+ * Version Error Codes
77
+ */
78
+ export const VersionErrorCodes = {
79
+ NOT_FOUND: "VERSION_NOT_FOUND",
80
+ ENTRY_NOT_FOUND: "VERSION_ENTRY_NOT_FOUND",
81
+ ENTRY_DELETED: "VERSION_ENTRY_DELETED",
82
+ MISMATCH: "VERSION_MISMATCH",
83
+ ROLLBACK_FAILED: "VERSION_ROLLBACK_FAILED",
84
+ };
85
+ /**
86
+ * General Error Codes
87
+ */
88
+ export const GeneralErrorCodes = {
89
+ BATCH_SIZE_EXCEEDED: "BATCH_SIZE_EXCEEDED",
90
+ PERMISSION_DENIED: "PERMISSION_DENIED",
91
+ INTERNAL_ERROR: "INTERNAL_ERROR",
92
+ };
93
+ /**
94
+ * Combined object containing all error codes for reference.
95
+ * Note: Due to key collisions (e.g., NOT_FOUND exists in multiple categories),
96
+ * use the specific error code objects for accessing values in code.
97
+ * This object is primarily useful for listing all possible error code values.
98
+ */
99
+ export const ErrorCodes = {
100
+ // Content Type Errors
101
+ CONTENT_TYPE_NOT_FOUND: ContentTypeErrorCodes.NOT_FOUND,
102
+ CONTENT_TYPE_DELETED: ContentTypeErrorCodes.DELETED,
103
+ CONTENT_TYPE_INACTIVE: ContentTypeErrorCodes.INACTIVE,
104
+ CONTENT_TYPE_NAME_INVALID: ContentTypeErrorCodes.NAME_INVALID,
105
+ CONTENT_TYPE_NAME_DUPLICATE: ContentTypeErrorCodes.NAME_DUPLICATE,
106
+ CONTENT_TYPE_FIELD_VALIDATION_FAILED: ContentTypeErrorCodes.FIELD_VALIDATION_FAILED,
107
+ CONTENT_TYPE_SLUG_FIELD_INVALID: ContentTypeErrorCodes.SLUG_FIELD_INVALID,
108
+ CONTENT_TYPE_TITLE_FIELD_INVALID: ContentTypeErrorCodes.TITLE_FIELD_INVALID,
109
+ CONTENT_TYPE_HAS_ENTRIES: ContentTypeErrorCodes.HAS_ENTRIES,
110
+ CONTENT_TYPE_BREAKING_CHANGE: ContentTypeErrorCodes.BREAKING_CHANGE,
111
+ // Content Entry Errors
112
+ CONTENT_ENTRY_NOT_FOUND: ContentEntryErrorCodes.NOT_FOUND,
113
+ CONTENT_ENTRY_DELETED: ContentEntryErrorCodes.DELETED,
114
+ CONTENT_ENTRY_NOT_DELETED: ContentEntryErrorCodes.NOT_DELETED,
115
+ CONTENT_ENTRY_ALREADY_PUBLISHED: ContentEntryErrorCodes.ALREADY_PUBLISHED,
116
+ CONTENT_ENTRY_NOT_PUBLISHED: ContentEntryErrorCodes.NOT_PUBLISHED,
117
+ CONTENT_ENTRY_ARCHIVED: ContentEntryErrorCodes.ARCHIVED,
118
+ CONTENT_ENTRY_VALIDATION_FAILED: ContentEntryErrorCodes.VALIDATION_FAILED,
119
+ CONTENT_ENTRY_SLUG_CONFLICT: ContentEntryErrorCodes.SLUG_CONFLICT,
120
+ CONTENT_ENTRY_LOCKED: ContentEntryErrorCodes.LOCKED,
121
+ CONTENT_ENTRY_CREATE_FAILED: ContentEntryErrorCodes.CREATE_FAILED,
122
+ CONTENT_ENTRY_UPDATE_FAILED: ContentEntryErrorCodes.UPDATE_FAILED,
123
+ // Media Asset Errors
124
+ MEDIA_ASSET_NOT_FOUND: MediaAssetErrorCodes.NOT_FOUND,
125
+ MEDIA_ASSET_DELETED: MediaAssetErrorCodes.DELETED,
126
+ MEDIA_ASSET_NOT_DELETED: MediaAssetErrorCodes.NOT_DELETED,
127
+ MEDIA_ASSET_HAS_REFERENCES: MediaAssetErrorCodes.HAS_REFERENCES,
128
+ MEDIA_ASSET_CREATE_FAILED: MediaAssetErrorCodes.CREATE_FAILED,
129
+ MEDIA_ASSET_UPDATE_FAILED: MediaAssetErrorCodes.UPDATE_FAILED,
130
+ MEDIA_ASSET_UPLOAD_INVALID: MediaAssetErrorCodes.UPLOAD_INVALID,
131
+ // Media Folder Errors
132
+ MEDIA_FOLDER_NOT_FOUND: MediaFolderErrorCodes.NOT_FOUND,
133
+ MEDIA_FOLDER_DELETED: MediaFolderErrorCodes.DELETED,
134
+ MEDIA_FOLDER_NOT_DELETED: MediaFolderErrorCodes.NOT_DELETED,
135
+ MEDIA_FOLDER_NAME_INVALID: MediaFolderErrorCodes.NAME_INVALID,
136
+ MEDIA_FOLDER_NAME_DUPLICATE: MediaFolderErrorCodes.NAME_DUPLICATE,
137
+ MEDIA_FOLDER_DEPTH_EXCEEDED: MediaFolderErrorCodes.DEPTH_EXCEEDED,
138
+ MEDIA_FOLDER_PATH_TOO_LONG: MediaFolderErrorCodes.PATH_TOO_LONG,
139
+ MEDIA_FOLDER_HAS_CONTENTS: MediaFolderErrorCodes.HAS_CONTENTS,
140
+ MEDIA_FOLDER_CIRCULAR_MOVE: MediaFolderErrorCodes.CIRCULAR_MOVE,
141
+ MEDIA_FOLDER_PARENT_DELETED: MediaFolderErrorCodes.PARENT_DELETED,
142
+ MEDIA_FOLDER_CREATE_FAILED: MediaFolderErrorCodes.CREATE_FAILED,
143
+ // Version Errors
144
+ VERSION_NOT_FOUND: VersionErrorCodes.NOT_FOUND,
145
+ VERSION_ENTRY_NOT_FOUND: VersionErrorCodes.ENTRY_NOT_FOUND,
146
+ VERSION_ENTRY_DELETED: VersionErrorCodes.ENTRY_DELETED,
147
+ VERSION_MISMATCH: VersionErrorCodes.MISMATCH,
148
+ VERSION_ROLLBACK_FAILED: VersionErrorCodes.ROLLBACK_FAILED,
149
+ // General Errors
150
+ BATCH_SIZE_EXCEEDED: GeneralErrorCodes.BATCH_SIZE_EXCEEDED,
151
+ PERMISSION_DENIED: GeneralErrorCodes.PERMISSION_DENIED,
152
+ INTERNAL_ERROR: GeneralErrorCodes.INTERNAL_ERROR,
153
+ };
154
+ // =============================================================================
155
+ // CMS Error Class
156
+ // =============================================================================
157
+ /**
158
+ * Custom error class for CMS operations.
159
+ *
160
+ * Provides structured error information including:
161
+ * - Machine-readable error code
162
+ * - Error category for routing
163
+ * - Human-readable message
164
+ * - Additional context for debugging
165
+ *
166
+ * @example
167
+ * ```typescript
168
+ * throw new CMSError(
169
+ * ErrorCodes.CONTENT_TYPE_NOT_FOUND,
170
+ * "NOT_FOUND",
171
+ * `Content type not found: ${id}`,
172
+ * { resourceType: "contentType", resourceId: id }
173
+ * );
174
+ * ```
175
+ */
176
+ export class CMSError extends Error {
177
+ code;
178
+ category;
179
+ context;
180
+ constructor(code, category, message, context) {
181
+ // Format message to include code for easier debugging
182
+ const formattedMessage = `[${code}] ${message}`;
183
+ super(formattedMessage);
184
+ this.name = "CMSError";
185
+ this.code = code;
186
+ this.category = category;
187
+ this.context = context;
188
+ // Maintain proper stack trace in V8 environments
189
+ if (Error.captureStackTrace) {
190
+ Error.captureStackTrace(this, CMSError);
191
+ }
192
+ }
193
+ /**
194
+ * Convert error to a plain object for serialization.
195
+ */
196
+ toJSON() {
197
+ return {
198
+ name: this.name,
199
+ code: this.code,
200
+ category: this.category,
201
+ message: this.message,
202
+ context: this.context,
203
+ };
204
+ }
205
+ }
206
+ // =============================================================================
207
+ // Error Factory Functions
208
+ // =============================================================================
209
+ // -----------------------------------------------------------------------------
210
+ // Content Type Errors
211
+ // -----------------------------------------------------------------------------
212
+ export function contentTypeNotFound(id) {
213
+ return new CMSError(ContentTypeErrorCodes.NOT_FOUND, "NOT_FOUND", `Content type not found. The content type with ID "${id}" does not exist.`, { resourceType: "contentType", resourceId: id });
214
+ }
215
+ export function contentTypeDeleted(id, name) {
216
+ const identifier = name ? `"${name}" (${id})` : `"${id}"`;
217
+ return new CMSError(ContentTypeErrorCodes.DELETED, "DELETED", `Content type ${identifier} has been deleted. Restore it first to perform this operation.`, { resourceType: "contentType", resourceId: id, resourceName: name, currentState: "deleted" });
218
+ }
219
+ export function contentTypeInactive(id, name) {
220
+ const identifier = name ? `"${name}"` : `"${id}"`;
221
+ return new CMSError(ContentTypeErrorCodes.INACTIVE, "INACTIVE", `Content type ${identifier} is not active. Activate it first to create entries.`, { resourceType: "contentType", resourceId: id, resourceName: name, currentState: "inactive" });
222
+ }
223
+ export function contentTypeNameInvalid(name) {
224
+ return new CMSError(ContentTypeErrorCodes.NAME_INVALID, "VALIDATION", `Invalid content type name "${name}". Name must start with a lowercase letter and contain only lowercase letters, numbers, and underscores (1-64 characters).`, { details: `Provided name: "${name}"` });
225
+ }
226
+ export function contentTypeNameDuplicate(name) {
227
+ return new CMSError(ContentTypeErrorCodes.NAME_DUPLICATE, "STATE_CONFLICT", `A content type with name "${name}" already exists. Please choose a different name.`, { resourceType: "contentType", resourceName: name });
228
+ }
229
+ export function contentTypeFieldValidationFailed(errors) {
230
+ const errorMessages = errors.map((e) => `${e.fieldName}: ${e.message}`).join("; ");
231
+ return new CMSError(ContentTypeErrorCodes.FIELD_VALIDATION_FAILED, "VALIDATION", `Invalid field definitions: ${errorMessages}`, { fields: errors.map((e) => ({ field: e.fieldName, message: e.message, code: e.code })) });
232
+ }
233
+ export function contentTypeSlugFieldInvalid(slugField, availableFields) {
234
+ return new CMSError(ContentTypeErrorCodes.SLUG_FIELD_INVALID, "VALIDATION", `slugField "${slugField}" does not reference an existing field. Available fields: ${availableFields.join(", ")}`, { details: `Invalid slugField: "${slugField}"` });
235
+ }
236
+ export function contentTypeTitleFieldInvalid(titleField, availableFields) {
237
+ return new CMSError(ContentTypeErrorCodes.TITLE_FIELD_INVALID, "VALIDATION", `titleField "${titleField}" does not reference an existing field. Available fields: ${availableFields.join(", ")}`, { details: `Invalid titleField: "${titleField}"` });
238
+ }
239
+ export function contentTypeHasEntries(id, name, entryCount) {
240
+ return new CMSError(ContentTypeErrorCodes.HAS_ENTRIES, "REFERENCE_CONFLICT", `Cannot delete content type "${name}": it has ${entryCount} content ${entryCount === 1 ? "entry" : "entries"}. Delete all entries first or use force delete.`, {
241
+ resourceType: "contentType",
242
+ resourceId: id,
243
+ resourceName: name,
244
+ referenceCount: entryCount,
245
+ });
246
+ }
247
+ export function contentTypeBreakingChange(breakingChanges) {
248
+ const summary = breakingChanges
249
+ .map((bc) => `- ${bc.fieldName}: ${bc.message} (affects ${bc.affectedEntriesCount} entries)`)
250
+ .join("\n");
251
+ return new CMSError(ContentTypeErrorCodes.BREAKING_CHANGE, "STATE_CONFLICT", `Cannot update content type due to breaking changes:\n${summary}\n\nUse allowBreakingChanges: true to force the update.`, { details: summary });
252
+ }
253
+ // -----------------------------------------------------------------------------
254
+ // Content Entry Errors
255
+ // -----------------------------------------------------------------------------
256
+ export function contentEntryNotFound(id) {
257
+ return new CMSError(ContentEntryErrorCodes.NOT_FOUND, "NOT_FOUND", `Content entry not found. The entry with ID "${id}" does not exist.`, { resourceType: "contentEntry", resourceId: id });
258
+ }
259
+ export function contentEntryDeleted(id) {
260
+ return new CMSError(ContentEntryErrorCodes.DELETED, "DELETED", `Content entry "${id}" has been deleted. Restore it from trash first to perform this operation.`, { resourceType: "contentEntry", resourceId: id, currentState: "deleted" });
261
+ }
262
+ export function contentEntryNotDeleted(id) {
263
+ return new CMSError(ContentEntryErrorCodes.NOT_DELETED, "STATE_CONFLICT", `Content entry "${id}" is not deleted. Only deleted entries can be restored.`, { resourceType: "contentEntry", resourceId: id, currentState: "active", expectedState: "deleted" });
264
+ }
265
+ export function contentEntryAlreadyPublished(id) {
266
+ return new CMSError(ContentEntryErrorCodes.ALREADY_PUBLISHED, "STATE_CONFLICT", `Content entry "${id}" is already published. Use update instead if you want to modify it.`, { resourceType: "contentEntry", resourceId: id, currentState: "published", expectedState: "draft" });
267
+ }
268
+ export function contentEntryNotPublished(id, currentStatus) {
269
+ return new CMSError(ContentEntryErrorCodes.NOT_PUBLISHED, "STATE_CONFLICT", `Content entry "${id}" is not published. Current status: "${currentStatus}". Only published entries can be unpublished.`, { resourceType: "contentEntry", resourceId: id, currentState: currentStatus, expectedState: "published" });
270
+ }
271
+ export function contentEntryArchived(id) {
272
+ return new CMSError(ContentEntryErrorCodes.ARCHIVED, "STATE_CONFLICT", `Cannot publish archived content entry "${id}". Restore it from archive first.`, { resourceType: "contentEntry", resourceId: id, currentState: "archived" });
273
+ }
274
+ export function contentEntryValidationFailed(errors) {
275
+ const errorMessages = errors.map((e) => `${e.field}: ${e.message}`).join("; ");
276
+ return new CMSError(ContentEntryErrorCodes.VALIDATION_FAILED, "VALIDATION", `Content validation failed: ${errorMessages}`, { fields: errors });
277
+ }
278
+ export function contentEntryLocked(entryId, lockedBy, lockedAt, currentUser) {
279
+ const lockedDate = new Date(lockedAt).toISOString();
280
+ return new CMSError(ContentEntryErrorCodes.LOCKED, "LOCK_CONFLICT", `Content entry "${entryId}" is locked by user "${lockedBy}" since ${lockedDate}. Only the lock holder can modify this entry.`, { lockedBy, lockedAt, currentUser });
281
+ }
282
+ export function contentEntryCreateFailed(contentTypeId) {
283
+ return new CMSError(ContentEntryErrorCodes.CREATE_FAILED, "INTERNAL", `Failed to create content entry for content type "${contentTypeId}". The entry was not persisted.`, { resourceType: "contentEntry" });
284
+ }
285
+ export function contentEntryUpdateFailed(id) {
286
+ return new CMSError(ContentEntryErrorCodes.UPDATE_FAILED, "INTERNAL", `Failed to retrieve content entry "${id}" after update. The update may have failed.`, { resourceType: "contentEntry", resourceId: id });
287
+ }
288
+ // -----------------------------------------------------------------------------
289
+ // Media Asset Errors
290
+ // -----------------------------------------------------------------------------
291
+ export function mediaAssetNotFound(id) {
292
+ return new CMSError(MediaAssetErrorCodes.NOT_FOUND, "NOT_FOUND", `Media asset not found. The asset with ID "${id}" does not exist.`, { resourceType: "mediaAsset", resourceId: id });
293
+ }
294
+ export function mediaAssetDeleted(id) {
295
+ return new CMSError(MediaAssetErrorCodes.DELETED, "DELETED", `Media asset "${id}" has been deleted. Restore it first to perform this operation.`, { resourceType: "mediaAsset", resourceId: id, currentState: "deleted" });
296
+ }
297
+ export function mediaAssetNotDeleted(id) {
298
+ return new CMSError(MediaAssetErrorCodes.NOT_DELETED, "STATE_CONFLICT", `Media asset "${id}" is not deleted. Only deleted assets can be restored.`, { resourceType: "mediaAsset", resourceId: id, currentState: "active", expectedState: "deleted" });
299
+ }
300
+ export function mediaAssetHasReferences(id, references) {
301
+ const refSummary = references
302
+ .slice(0, 5)
303
+ .map((r) => `${r.type}: ${r.name || r.id}`)
304
+ .join(", ");
305
+ const moreCount = references.length > 5 ? ` and ${references.length - 5} more` : "";
306
+ return new CMSError(MediaAssetErrorCodes.HAS_REFERENCES, "REFERENCE_CONFLICT", `Cannot delete media asset "${id}": it is referenced by ${references.length} ${references.length === 1 ? "resource" : "resources"} (${refSummary}${moreCount}). Remove references first or use force delete.`, { referencingResources: references, referenceCount: references.length });
307
+ }
308
+ export function mediaAssetCreateFailed() {
309
+ return new CMSError(MediaAssetErrorCodes.CREATE_FAILED, "INTERNAL", "Failed to create media asset. The asset was not persisted.", { resourceType: "mediaAsset" });
310
+ }
311
+ export function mediaAssetUpdateFailed(id) {
312
+ return new CMSError(MediaAssetErrorCodes.UPDATE_FAILED, "INTERNAL", `Failed to retrieve media asset "${id}" after update. The update may have failed.`, { resourceType: "mediaAsset", resourceId: id });
313
+ }
314
+ // -----------------------------------------------------------------------------
315
+ // Media Folder Errors
316
+ // -----------------------------------------------------------------------------
317
+ export function mediaFolderNotFound(id) {
318
+ return new CMSError(MediaFolderErrorCodes.NOT_FOUND, "NOT_FOUND", `Media folder not found. The folder with ID "${id}" does not exist.`, { resourceType: "mediaFolder", resourceId: id });
319
+ }
320
+ export function mediaFolderDeleted(id) {
321
+ return new CMSError(MediaFolderErrorCodes.DELETED, "DELETED", `Media folder "${id}" has been deleted. Restore it first to perform this operation.`, { resourceType: "mediaFolder", resourceId: id, currentState: "deleted" });
322
+ }
323
+ export function mediaFolderNotDeleted(id) {
324
+ return new CMSError(MediaFolderErrorCodes.NOT_DELETED, "STATE_CONFLICT", `Media folder "${id}" is not deleted. Only deleted folders can be restored.`, { resourceType: "mediaFolder", resourceId: id, currentState: "active", expectedState: "deleted" });
325
+ }
326
+ export function mediaFolderNameInvalid(name, reason) {
327
+ return new CMSError(MediaFolderErrorCodes.NAME_INVALID, "VALIDATION", `Invalid folder name "${name}": ${reason}`, { details: reason });
328
+ }
329
+ export function mediaFolderNameDuplicate(name, parentPath) {
330
+ const location = parentPath ? ` at "${parentPath}"` : " at this location";
331
+ return new CMSError(MediaFolderErrorCodes.NAME_DUPLICATE, "STATE_CONFLICT", `A folder named "${name}" already exists${location}. Please choose a different name.`, { resourceType: "mediaFolder", resourceName: name });
332
+ }
333
+ export function mediaFolderDepthExceeded(maxDepth, currentDepth) {
334
+ return new CMSError(MediaFolderErrorCodes.DEPTH_EXCEEDED, "LIMIT_EXCEEDED", `Cannot create folder: maximum nesting depth of ${maxDepth} exceeded. Current depth would be ${currentDepth}.`, { details: `Max depth: ${maxDepth}, attempted depth: ${currentDepth}` });
335
+ }
336
+ export function mediaFolderPathTooLong(maxLength, pathLength) {
337
+ return new CMSError(MediaFolderErrorCodes.PATH_TOO_LONG, "LIMIT_EXCEEDED", `Cannot create folder: path would exceed maximum length of ${maxLength} characters (would be ${pathLength}).`, { details: `Max length: ${maxLength}, attempted length: ${pathLength}` });
338
+ }
339
+ export function mediaFolderHasContents(id, folderCount, assetCount) {
340
+ const contents = [];
341
+ if (folderCount > 0)
342
+ contents.push(`${folderCount} ${folderCount === 1 ? "subfolder" : "subfolders"}`);
343
+ if (assetCount > 0)
344
+ contents.push(`${assetCount} ${assetCount === 1 ? "asset" : "assets"}`);
345
+ return new CMSError(MediaFolderErrorCodes.HAS_CONTENTS, "REFERENCE_CONFLICT", `Cannot delete folder "${id}": it contains ${contents.join(" and ")}. Delete contents first or use recursive delete.`, { resourceType: "mediaFolder", resourceId: id });
346
+ }
347
+ export function mediaFolderCircularMove(id) {
348
+ return new CMSError(MediaFolderErrorCodes.CIRCULAR_MOVE, "VALIDATION", `Cannot move folder "${id}" into itself or one of its descendants. This would create a circular reference.`, { resourceType: "mediaFolder", resourceId: id });
349
+ }
350
+ export function mediaFolderParentDeleted(id, parentId) {
351
+ return new CMSError(MediaFolderErrorCodes.PARENT_DELETED, "STATE_CONFLICT", `Cannot restore folder "${id}": parent folder "${parentId}" is still deleted. Restore the parent folder first.`, { resourceType: "mediaFolder", resourceId: id });
352
+ }
353
+ export function mediaFolderCreateFailed() {
354
+ return new CMSError(MediaFolderErrorCodes.CREATE_FAILED, "INTERNAL", "Failed to create media folder. The folder was not persisted.", { resourceType: "mediaFolder" });
355
+ }
356
+ // -----------------------------------------------------------------------------
357
+ // Version Errors
358
+ // -----------------------------------------------------------------------------
359
+ export function versionNotFound(entryId, versionNumber) {
360
+ return new CMSError(VersionErrorCodes.NOT_FOUND, "NOT_FOUND", `Version ${versionNumber} not found for entry "${entryId}". Check if the version number is correct.`, { resourceType: "version", resourceId: entryId });
361
+ }
362
+ export function versionEntryNotFound(entryId) {
363
+ return new CMSError(VersionErrorCodes.ENTRY_NOT_FOUND, "NOT_FOUND", `Content entry "${entryId}" not found. Cannot create version snapshot for non-existent entry.`, { resourceType: "contentEntry", resourceId: entryId });
364
+ }
365
+ export function versionEntryDeleted(entryId) {
366
+ return new CMSError(VersionErrorCodes.ENTRY_DELETED, "DELETED", `Content entry "${entryId}" has been deleted. Cannot create version snapshot or rollback deleted entries. Restore the entry first.`, { resourceType: "contentEntry", resourceId: entryId, currentState: "deleted" });
367
+ }
368
+ export function versionMismatch(entryId, versionId) {
369
+ return new CMSError(VersionErrorCodes.MISMATCH, "VALIDATION", `Version "${versionId}" does not belong to entry "${entryId}". Ensure you're using the correct version for this entry.`, { resourceType: "version", resourceId: versionId });
370
+ }
371
+ export function versionRollbackFailed(entryId) {
372
+ return new CMSError(VersionErrorCodes.ROLLBACK_FAILED, "INTERNAL", `Failed to retrieve entry "${entryId}" after rollback. The rollback may have failed.`, { resourceType: "contentEntry", resourceId: entryId });
373
+ }
374
+ // -----------------------------------------------------------------------------
375
+ // General Errors
376
+ // -----------------------------------------------------------------------------
377
+ export function batchSizeExceeded(maxSize, requestedSize) {
378
+ return new CMSError(GeneralErrorCodes.BATCH_SIZE_EXCEEDED, "LIMIT_EXCEEDED", `Batch size exceeds limit. Maximum ${maxSize} items per batch, but ${requestedSize} were requested.`, { details: `Max: ${maxSize}, requested: ${requestedSize}` });
379
+ }
380
+ export function permissionDenied(action, resource) {
381
+ return new CMSError(GeneralErrorCodes.PERMISSION_DENIED, "PERMISSION", `Permission denied: you do not have access to ${action} ${resource}.`, { details: `Action: ${action}, resource: ${resource}` });
382
+ }
383
+ export function internalError(message) {
384
+ return new CMSError(GeneralErrorCodes.INTERNAL_ERROR, "INTERNAL", `Internal error: ${message}`, { details: message });
385
+ }
386
+ // =============================================================================
387
+ // Type Guards
388
+ // =============================================================================
389
+ /**
390
+ * Type guard to check if an error is a CMSError.
391
+ */
392
+ export function isCMSError(error) {
393
+ return error instanceof CMSError;
394
+ }
395
+ /**
396
+ * Type guard to check if an error has a specific error code.
397
+ */
398
+ export function hasErrorCode(error, code) {
399
+ return isCMSError(error) && error.code === code;
400
+ }
401
+ /**
402
+ * Type guard to check if an error is in a specific category.
403
+ */
404
+ export function isErrorCategory(error, category) {
405
+ return isCMSError(error) && error.category === category;
406
+ }
407
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/component/lib/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAqBH,gFAAgF;AAChF,cAAc;AACd,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,SAAS,EAAE,wBAAwB;IACnC,OAAO,EAAE,sBAAsB;IAC/B,QAAQ,EAAE,uBAAuB;IACjC,YAAY,EAAE,2BAA2B;IACzC,cAAc,EAAE,6BAA6B;IAC7C,uBAAuB,EAAE,sCAAsC;IAC/D,kBAAkB,EAAE,iCAAiC;IACrD,mBAAmB,EAAE,kCAAkC;IACvD,WAAW,EAAE,0BAA0B;IACvC,eAAe,EAAE,8BAA8B;CACvC,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,SAAS,EAAE,yBAAyB;IACpC,OAAO,EAAE,uBAAuB;IAChC,WAAW,EAAE,2BAA2B;IACxC,iBAAiB,EAAE,iCAAiC;IACpD,aAAa,EAAE,6BAA6B;IAC5C,QAAQ,EAAE,wBAAwB;IAClC,iBAAiB,EAAE,iCAAiC;IACpD,aAAa,EAAE,6BAA6B;IAC5C,MAAM,EAAE,sBAAsB;IAC9B,aAAa,EAAE,6BAA6B;IAC5C,aAAa,EAAE,6BAA6B;CACpC,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,SAAS,EAAE,uBAAuB;IAClC,OAAO,EAAE,qBAAqB;IAC9B,WAAW,EAAE,yBAAyB;IACtC,cAAc,EAAE,4BAA4B;IAC5C,aAAa,EAAE,2BAA2B;IAC1C,aAAa,EAAE,2BAA2B;IAC1C,cAAc,EAAE,4BAA4B;CACpC,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,SAAS,EAA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C,OAAe,EAAE,aAAqB;IACtE,OAAO,IAAI,QAAQ,CACjB,iBAAiB,CAAC,mBAAmB,EACrC,gBAAgB,EAChB,qCAAqC,OAAO,yBAAyB,aAAa,kBAAkB,EACpG,EAAE,OAAO,EAAE,QAAQ,OAAO,gBAAgB,aAAa,EAAE,EAAE,CAC5D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,QAAgB;IAC/D,OAAO,IAAI,QAAQ,CACjB,iBAAiB,CAAC,iBAAiB,EACnC,YAAY,EACZ,gDAAgD,MAAM,IAAI,QAAQ,GAAG,EACrE,EAAE,OAAO,EAAE,WAAW,MAAM,eAAe,QAAQ,EAAE,EAAE,CACxD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO,IAAI,QAAQ,CACjB,iBAAiB,CAAC,cAAc,EAChC,UAAU,EACV,mBAAmB,OAAO,EAAE,EAC5B,EAAE,OAAO,EAAE,OAAO,EAAE,CACrB,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,cAAc;AACd,gFAAgF;AAEhF;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,KAAK,YAAY,QAAQ,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc,EAAE,IAAe;IAC1D,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc,EAAE,QAAuB;IACrE,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Library utilities for the CMS component
3
+ */
4
+ export { generateSlug, isValidSlug, generateUniqueSlug, type SlugOptions, } from "./slugGenerator.js";
5
+ export { CMSError, isCMSError, hasErrorCode, isErrorCategory, ErrorCodes, ContentTypeErrorCodes, ContentEntryErrorCodes, MediaAssetErrorCodes, MediaFolderErrorCodes, VersionErrorCodes, GeneralErrorCodes, contentTypeNotFound, contentTypeDeleted, contentTypeInactive, contentTypeNameInvalid, contentTypeNameDuplicate, contentTypeFieldValidationFailed, contentTypeSlugFieldInvalid, contentTypeTitleFieldInvalid, contentTypeHasEntries, contentTypeBreakingChange, contentEntryNotFound, contentEntryDeleted, contentEntryNotDeleted, contentEntryAlreadyPublished, contentEntryNotPublished, contentEntryArchived, contentEntryValidationFailed, contentEntryLocked, contentEntryCreateFailed, contentEntryUpdateFailed, mediaAssetNotFound, mediaAssetDeleted, mediaAssetNotDeleted, mediaAssetHasReferences, mediaAssetCreateFailed, mediaAssetUpdateFailed, mediaFolderNotFound, mediaFolderDeleted, mediaFolderNotDeleted, mediaFolderNameInvalid, mediaFolderNameDuplicate, mediaFolderDepthExceeded, mediaFolderPathTooLong, mediaFolderHasContents, mediaFolderCircularMove, mediaFolderParentDeleted, mediaFolderCreateFailed, versionNotFound, versionEntryNotFound, versionEntryDeleted, versionMismatch, versionRollbackFailed, batchSizeExceeded, permissionDenied, internalError, type ErrorCode, type ErrorCategory, type CMSErrorContext, type ResourceErrorContext, type ValidationErrorContext, type LockErrorContext, type ReferenceErrorContext, } from "./errors.js";
6
+ export { checkSlugUniqueness, ensureUniqueSlug, findNextAvailableSlug, validateSlugFormat, type SlugUniquenessOptions, type SlugCheckResult, type SlugEntry, type SlugQueryFn, type SlugPrefixQueryFn, } from "./slugUniqueness.js";
7
+ export { isDeleted, isActive, filterActive, filterDeleted, requireNotDeleted, requireDeleted, type SoftDeletable, } from "./softDelete.js";
8
+ export { getContentTypeByName, getTaxonomyByName, contentTypeExists, taxonomyExists, getActiveById, type GetByIdOptions, } from "./queries.js";
9
+ export { chunkContentEntry, extractContent, chunkText, chunkMultipleEntries, estimateChunkingStats, extractTextFromRichText, extractTextFromJson, extractTextFromSelect, stripHtmlTags, DEFAULT_CHUNK_OPTIONS, DEFAULT_EXTRACTION_OPTIONS, type ContentChunk, type ChunkMetadata, type ChunkSemanticType, type ChunkOptions, type RagExtractionOptions, type ExtractedContent, type ContentTypeInfo, type ContentEntryInfo, type ResolvedReferenceInfo, type FieldDefinition as RagFieldDefinition, } from "./ragContentChunker.js";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/lib/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,KAAK,WAAW,GACjB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAEL,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,eAAe,EAEf,UAAU,EACV,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAEjB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,gCAAgC,EAChC,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACrB,yBAAyB,EAEzB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,oBAAoB,EACpB,4BAA4B,EAC5B,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EAExB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EAEtB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EAEvB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EAErB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EAEb,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,KAAK,cAAc,GACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAEL,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,qBAAqB,EAErB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EAEb,qBAAqB,EACrB,0BAA0B,EAE1B,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,IAAI,kBAAkB,GAC3C,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Library utilities for the CMS component
3
+ */
4
+ export { generateSlug, isValidSlug, generateUniqueSlug, } from "./slugGenerator.js";
5
+ // Error handling exports
6
+ export {
7
+ // Error class and types
8
+ CMSError, isCMSError, hasErrorCode, isErrorCategory,
9
+ // Error codes
10
+ ErrorCodes, ContentTypeErrorCodes, ContentEntryErrorCodes, MediaAssetErrorCodes, MediaFolderErrorCodes, VersionErrorCodes, GeneralErrorCodes,
11
+ // Error factory functions - Content Types
12
+ contentTypeNotFound, contentTypeDeleted, contentTypeInactive, contentTypeNameInvalid, contentTypeNameDuplicate, contentTypeFieldValidationFailed, contentTypeSlugFieldInvalid, contentTypeTitleFieldInvalid, contentTypeHasEntries, contentTypeBreakingChange,
13
+ // Error factory functions - Content Entries
14
+ contentEntryNotFound, contentEntryDeleted, contentEntryNotDeleted, contentEntryAlreadyPublished, contentEntryNotPublished, contentEntryArchived, contentEntryValidationFailed, contentEntryLocked, contentEntryCreateFailed, contentEntryUpdateFailed,
15
+ // Error factory functions - Media Assets
16
+ mediaAssetNotFound, mediaAssetDeleted, mediaAssetNotDeleted, mediaAssetHasReferences, mediaAssetCreateFailed, mediaAssetUpdateFailed,
17
+ // Error factory functions - Media Folders
18
+ mediaFolderNotFound, mediaFolderDeleted, mediaFolderNotDeleted, mediaFolderNameInvalid, mediaFolderNameDuplicate, mediaFolderDepthExceeded, mediaFolderPathTooLong, mediaFolderHasContents, mediaFolderCircularMove, mediaFolderParentDeleted, mediaFolderCreateFailed,
19
+ // Error factory functions - Versions
20
+ versionNotFound, versionEntryNotFound, versionEntryDeleted, versionMismatch, versionRollbackFailed,
21
+ // Error factory functions - General
22
+ batchSizeExceeded, permissionDenied, internalError, } from "./errors.js";
23
+ export { checkSlugUniqueness, ensureUniqueSlug, findNextAvailableSlug, validateSlugFormat, } from "./slugUniqueness.js";
24
+ export { isDeleted, isActive, filterActive, filterDeleted, requireNotDeleted, requireDeleted, } from "./softDelete.js";
25
+ export { getContentTypeByName, getTaxonomyByName, contentTypeExists, taxonomyExists, getActiveById, } from "./queries.js";
26
+ export {
27
+ // Main API functions
28
+ chunkContentEntry, extractContent, chunkText, chunkMultipleEntries, estimateChunkingStats,
29
+ // Text extraction utilities
30
+ extractTextFromRichText, extractTextFromJson, extractTextFromSelect, stripHtmlTags,
31
+ // Configuration defaults
32
+ DEFAULT_CHUNK_OPTIONS, DEFAULT_EXTRACTION_OPTIONS, } from "./ragContentChunker.js";
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/lib/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,GAEnB,MAAM,oBAAoB,CAAC;AAE5B,yBAAyB;AACzB,OAAO;AACL,wBAAwB;AACxB,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,eAAe;AACf,cAAc;AACd,UAAU,EACV,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB;AACjB,0CAA0C;AAC1C,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,gCAAgC,EAChC,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACrB,yBAAyB;AACzB,4CAA4C;AAC5C,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,oBAAoB,EACpB,4BAA4B,EAC5B,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB;AACxB,yCAAyC;AACzC,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB;AACtB,0CAA0C;AAC1C,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB;AACvB,qCAAqC;AACrC,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,qBAAqB;AACrB,oCAAoC;AACpC,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,GASd,MAAM,aAAa,CAAC;AAErB,OA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