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,592 @@
1
+ /**
2
+ * Locale-Specific Content Field Storage and Resolution
3
+ *
4
+ * This module provides the schema and storage structure for locale-specific
5
+ * content field values. It allows fields marked as `localized: true` in their
6
+ * field definition to store translations keyed by locale code within content entries.
7
+ *
8
+ * Storage Structure:
9
+ * - Non-localized fields: { title: "Hello World" }
10
+ * - Localized fields: { title: { "en-US": "Hello World", "es-ES": "Hola Mundo" } }
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * // Content entry data with localized fields
15
+ * const data = {
16
+ * // Non-localized field (same value for all locales)
17
+ * slug: "my-post",
18
+ *
19
+ * // Localized field (translations keyed by locale)
20
+ * title: {
21
+ * "en-US": "My Blog Post",
22
+ * "es-ES": "Mi Entrada de Blog",
23
+ * "fr-FR": "Mon Article de Blog",
24
+ * },
25
+ *
26
+ * // Localized rich text field
27
+ * content: {
28
+ * "en-US": "<p>Welcome to my blog!</p>",
29
+ * "es-ES": "<p>¡Bienvenido a mi blog!</p>",
30
+ * },
31
+ * };
32
+ * ```
33
+ */
34
+ // =============================================================================
35
+ // Type Guards
36
+ // =============================================================================
37
+ /**
38
+ * Checks if a value is a LocalizedFieldValue structure.
39
+ *
40
+ * A value is considered localized if:
41
+ * - It is a non-null object
42
+ * - It is not an array
43
+ * - At least one key contains a hyphen (BCP 47 locale codes like "en-US")
44
+ * - All keys match the BCP 47 pattern (language[-Script][-REGION])
45
+ *
46
+ * Note: For fields that should store localized content, use the `localized: true`
47
+ * property in the field definition. This function is a heuristic type guard.
48
+ *
49
+ * @param value - The value to check
50
+ * @returns true if the value appears to be a LocalizedFieldValue
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * isLocalizedFieldValue({ "en-US": "Hello" }); // true
55
+ * isLocalizedFieldValue({ "en-US": "Hello", "es-ES": "Hola" }); // true
56
+ * isLocalizedFieldValue("Hello"); // false
57
+ * isLocalizedFieldValue({ foo: "bar" }); // false (no hyphenated locale key)
58
+ * isLocalizedFieldValue({ en: "Hello" }); // false (no hyphen - ambiguous)
59
+ * ```
60
+ */
61
+ export function isLocalizedFieldValue(value) {
62
+ if (value === null || value === undefined) {
63
+ return false;
64
+ }
65
+ if (typeof value !== "object" || Array.isArray(value)) {
66
+ return false;
67
+ }
68
+ const keys = Object.keys(value);
69
+ // Empty objects are not localized values
70
+ if (keys.length === 0) {
71
+ return false;
72
+ }
73
+ // Check if all keys are valid BCP 47 locale codes
74
+ // Valid patterns (with hyphen required for disambiguation):
75
+ // - "en-US" (language + ISO 3166-1 alpha-2 region, uppercase)
76
+ // At least one key must be hyphenated to confirm this is a localized structure
77
+ const hasHyphenatedKey = keys.some((key) => key.includes("-"));
78
+ if (!hasHyphenatedKey) {
79
+ return false;
80
+ }
81
+ // All keys must be valid locale patterns
82
+ const localePattern = /^[a-z]{2,3}(-[A-Z][a-z]{3})?(-[A-Z]{2})?$/;
83
+ return keys.every((key) => {
84
+ // Must have hyphen if longer than 3 chars
85
+ if (key.length > 3 && !key.includes("-")) {
86
+ return false;
87
+ }
88
+ return localePattern.test(key);
89
+ });
90
+ }
91
+ /**
92
+ * Checks if a field definition indicates the field should be localized.
93
+ *
94
+ * @param fieldDef - The field definition to check
95
+ * @returns true if the field is marked as localized
96
+ */
97
+ export function isFieldLocalized(fieldDef) {
98
+ return fieldDef.localized === true;
99
+ }
100
+ // =============================================================================
101
+ // Field Value Operations
102
+ // =============================================================================
103
+ /**
104
+ * Gets a value from a potentially localized field.
105
+ *
106
+ * If the field value is a LocalizedFieldValue, resolves using the specified locale
107
+ * with fallback chain. If it's a plain value, returns it directly.
108
+ *
109
+ * @param value - The field value (may be localized or plain)
110
+ * @param options - Locale resolution options
111
+ * @returns The resolved value result
112
+ *
113
+ * @example
114
+ * ```typescript
115
+ * // With localized value
116
+ * const localizedTitle = { "en-US": "Hello", "es-ES": "Hola" };
117
+ * const result = getLocalizedValue(localizedTitle, { locale: "es-ES" });
118
+ * // result: { value: "Hola", resolvedLocale: "es-ES", isExactMatch: true }
119
+ *
120
+ * // With fallback
121
+ * const result2 = getLocalizedValue(localizedTitle, {
122
+ * locale: "fr-FR",
123
+ * fallbackChain: ["en-US"],
124
+ * });
125
+ * // result2: { value: "Hello", resolvedLocale: "en-US", isExactMatch: false }
126
+ *
127
+ * // With plain value (non-localized field)
128
+ * const result3 = getLocalizedValue("Plain text", { locale: "en-US" });
129
+ * // result3: { value: "Plain text", resolvedLocale: undefined, isExactMatch: true }
130
+ * ```
131
+ */
132
+ export function getLocalizedValue(value, options) {
133
+ // If not a localized value, return directly
134
+ if (!isLocalizedFieldValue(value)) {
135
+ return {
136
+ value: value,
137
+ resolvedLocale: undefined,
138
+ isExactMatch: true,
139
+ };
140
+ }
141
+ const localizedValue = value;
142
+ const { locale, fallbackChain = [], defaultLocale = "en" } = options;
143
+ // Try the primary locale first
144
+ if (locale in localizedValue) {
145
+ return {
146
+ value: localizedValue[locale],
147
+ resolvedLocale: locale,
148
+ isExactMatch: true,
149
+ };
150
+ }
151
+ // Try fallback chain
152
+ for (const fallbackLocale of fallbackChain) {
153
+ if (fallbackLocale in localizedValue) {
154
+ return {
155
+ value: localizedValue[fallbackLocale],
156
+ resolvedLocale: fallbackLocale,
157
+ isExactMatch: false,
158
+ };
159
+ }
160
+ }
161
+ // Try default locale
162
+ if (defaultLocale && defaultLocale in localizedValue) {
163
+ return {
164
+ value: localizedValue[defaultLocale],
165
+ resolvedLocale: defaultLocale,
166
+ isExactMatch: false,
167
+ };
168
+ }
169
+ // Try to find any available locale as last resort
170
+ const availableLocales = Object.keys(localizedValue);
171
+ if (availableLocales.length > 0) {
172
+ const firstAvailable = availableLocales[0];
173
+ return {
174
+ value: localizedValue[firstAvailable],
175
+ resolvedLocale: firstAvailable,
176
+ isExactMatch: false,
177
+ };
178
+ }
179
+ // No value found
180
+ return {
181
+ value: undefined,
182
+ resolvedLocale: undefined,
183
+ isExactMatch: false,
184
+ };
185
+ }
186
+ /**
187
+ * Sets a value for a specific locale in a localized field.
188
+ *
189
+ * If the existing value is not localized, it converts it to a localized structure
190
+ * with the new value for the specified locale.
191
+ *
192
+ * @param existingValue - The current field value (may be localized or plain)
193
+ * @param locale - The locale to set the value for
194
+ * @param newValue - The new value to set
195
+ * @param preserveExisting - If true and converting from plain to localized,
196
+ * preserves the existing value under the default locale
197
+ * @param defaultLocale - The locale to use for preserving existing plain values
198
+ * @returns The updated localized field value
199
+ *
200
+ * @example
201
+ * ```typescript
202
+ * // Set value for a locale
203
+ * const existing = { "en-US": "Hello" };
204
+ * const updated = setLocalizedValue(existing, "es-ES", "Hola");
205
+ * // updated: { "en-US": "Hello", "es-ES": "Hola" }
206
+ *
207
+ * // Convert plain to localized
208
+ * const plain = "Hello";
209
+ * const converted = setLocalizedValue(plain, "es-ES", "Hola", true, "en-US");
210
+ * // converted: { "en-US": "Hello", "es-ES": "Hola" }
211
+ * ```
212
+ */
213
+ export function setLocalizedValue(existingValue, locale, newValue, preserveExisting = true, defaultLocale = "en") {
214
+ // If already localized, just add/update the locale
215
+ if (isLocalizedFieldValue(existingValue)) {
216
+ return {
217
+ ...existingValue,
218
+ [locale]: newValue,
219
+ };
220
+ }
221
+ // Converting from plain value to localized
222
+ const result = {
223
+ [locale]: newValue,
224
+ };
225
+ // Preserve existing plain value under default locale if requested
226
+ if (preserveExisting &&
227
+ existingValue !== undefined &&
228
+ existingValue !== null &&
229
+ locale !== defaultLocale) {
230
+ result[defaultLocale] = existingValue;
231
+ }
232
+ return result;
233
+ }
234
+ /**
235
+ * Removes a specific locale from a localized field value.
236
+ *
237
+ * @param localizedValue - The localized field value
238
+ * @param locale - The locale to remove
239
+ * @returns The updated localized field value, or undefined if empty
240
+ *
241
+ * @example
242
+ * ```typescript
243
+ * const value = { "en-US": "Hello", "es-ES": "Hola" };
244
+ * const updated = removeLocale(value, "es-ES");
245
+ * // updated: { "en-US": "Hello" }
246
+ * ```
247
+ */
248
+ export function removeLocale(localizedValue, locale) {
249
+ const { [locale]: _removed, ...rest } = localizedValue;
250
+ // Return undefined if no locales remain
251
+ if (Object.keys(rest).length === 0) {
252
+ return undefined;
253
+ }
254
+ return rest;
255
+ }
256
+ /**
257
+ * Merges translations from one localized value into another.
258
+ *
259
+ * @param target - The base localized value
260
+ * @param source - The localized value to merge in (overwrites existing locales)
261
+ * @returns The merged localized field value
262
+ *
263
+ * @example
264
+ * ```typescript
265
+ * const target = { "en-US": "Hello", "es-ES": "Hola" };
266
+ * const source = { "es-ES": "Hola!", "fr-FR": "Bonjour" };
267
+ * const merged = mergeLocalizedValues(target, source);
268
+ * // merged: { "en-US": "Hello", "es-ES": "Hola!", "fr-FR": "Bonjour" }
269
+ * ```
270
+ */
271
+ export function mergeLocalizedValues(target, source) {
272
+ return {
273
+ ...(target ?? {}),
274
+ ...source,
275
+ };
276
+ }
277
+ /**
278
+ * Gets all available locales from a localized field value.
279
+ *
280
+ * @param value - The field value (may be localized or plain)
281
+ * @returns Array of locale codes, or empty array if not localized
282
+ *
283
+ * @example
284
+ * ```typescript
285
+ * const value = { "en-US": "Hello", "es-ES": "Hola" };
286
+ * const locales = getAvailableLocales(value);
287
+ * // locales: ["en-US", "es-ES"]
288
+ *
289
+ * const plain = "Hello";
290
+ * const locales2 = getAvailableLocales(plain);
291
+ * // locales2: []
292
+ * ```
293
+ */
294
+ export function getAvailableLocales(value) {
295
+ if (!isLocalizedFieldValue(value)) {
296
+ return [];
297
+ }
298
+ return Object.keys(value);
299
+ }
300
+ /**
301
+ * Checks if a localized field has a translation for a specific locale.
302
+ *
303
+ * @param value - The field value (may be localized or plain)
304
+ * @param locale - The locale to check
305
+ * @returns true if the locale has a translation
306
+ */
307
+ export function hasLocale(value, locale) {
308
+ if (!isLocalizedFieldValue(value)) {
309
+ return false;
310
+ }
311
+ return locale in value;
312
+ }
313
+ /**
314
+ * Resolves all localized fields in content data to single values for a specific locale.
315
+ *
316
+ * This function takes raw content entry data (which may contain LocalizedFieldValue
317
+ * structures for localized fields) and resolves each field to a single value
318
+ * based on the requested locale and fallback chain.
319
+ *
320
+ * @param data - The raw content entry data
321
+ * @param options - Resolution options including fields and locale settings
322
+ * @returns The resolved content data with metadata about resolution
323
+ *
324
+ * @example
325
+ * ```typescript
326
+ * const rawData = {
327
+ * slug: "my-post", // non-localized
328
+ * title: { "en-US": "Hello", "es-ES": "Hola" }, // localized
329
+ * content: { "en-US": "Content here" }, // localized, missing es-ES
330
+ * };
331
+ *
332
+ * const result = resolveContentData(rawData, {
333
+ * locale: "es-ES",
334
+ * fallbackChain: ["en-US"],
335
+ * fields: [
336
+ * { name: "slug", localized: false, ... },
337
+ * { name: "title", localized: true, ... },
338
+ * { name: "content", localized: true, ... },
339
+ * ],
340
+ * });
341
+ *
342
+ * // result.data: { slug: "my-post", title: "Hola", content: "Content here" }
343
+ * // result.missingTranslations: ["content"]
344
+ * ```
345
+ */
346
+ export function resolveContentData(data, options) {
347
+ const { fields, locale, fallbackChain, defaultLocale } = options;
348
+ const resolvedData = {};
349
+ const resolutions = {};
350
+ const missingTranslations = [];
351
+ // Create a map of field names to their definitions for quick lookup
352
+ const fieldMap = new Map();
353
+ for (const field of fields) {
354
+ fieldMap.set(field.name, field);
355
+ }
356
+ // Process each field in the data
357
+ for (const [fieldName, fieldValue] of Object.entries(data)) {
358
+ const fieldDef = fieldMap.get(fieldName);
359
+ // If field is localized, resolve using locale
360
+ if (fieldDef && isFieldLocalized(fieldDef)) {
361
+ const result = getLocalizedValue(fieldValue, {
362
+ locale,
363
+ fallbackChain,
364
+ defaultLocale,
365
+ });
366
+ resolvedData[fieldName] = result.value;
367
+ resolutions[fieldName] = result;
368
+ // Track if this was not an exact match (missing translation)
369
+ if (!result.isExactMatch && result.resolvedLocale !== undefined) {
370
+ missingTranslations.push(fieldName);
371
+ }
372
+ }
373
+ else {
374
+ // Non-localized field - pass through as-is
375
+ resolvedData[fieldName] = fieldValue;
376
+ }
377
+ }
378
+ return {
379
+ data: resolvedData,
380
+ resolutions,
381
+ missingTranslations,
382
+ };
383
+ }
384
+ /**
385
+ * Sets values for multiple localized fields for a specific locale.
386
+ *
387
+ * This function takes a partial data object with values for a specific locale
388
+ * and merges them into the existing content data's localized field structures.
389
+ *
390
+ * @param existingData - The existing content entry data
391
+ * @param newValues - New values to set (field name -> value)
392
+ * @param locale - The locale to set values for
393
+ * @param fields - Field definitions to determine which fields are localized
394
+ * @param defaultLocale - Default locale for preserving existing values
395
+ * @returns Updated content data with localized values merged in
396
+ *
397
+ * @example
398
+ * ```typescript
399
+ * const existingData = {
400
+ * slug: "my-post",
401
+ * title: { "en-US": "Hello" },
402
+ * };
403
+ *
404
+ * const updated = setLocalizedContentData(
405
+ * existingData,
406
+ * { title: "Hola", slug: "mi-post" }, // slug will be overwritten, title merged
407
+ * "es-ES",
408
+ * fields
409
+ * );
410
+ *
411
+ * // updated: {
412
+ * // slug: "mi-post", // non-localized, just replaced
413
+ * // title: { "en-US": "Hello", "es-ES": "Hola" }, // localized, merged
414
+ * // }
415
+ * ```
416
+ */
417
+ export function setLocalizedContentData(existingData, newValues, locale, fields, defaultLocale = "en") {
418
+ // Create a map of field names to their definitions for quick lookup
419
+ const fieldMap = new Map();
420
+ for (const field of fields) {
421
+ fieldMap.set(field.name, field);
422
+ }
423
+ const result = { ...existingData };
424
+ for (const [fieldName, newValue] of Object.entries(newValues)) {
425
+ const fieldDef = fieldMap.get(fieldName);
426
+ if (fieldDef && isFieldLocalized(fieldDef)) {
427
+ // Localized field - merge into localized structure
428
+ result[fieldName] = setLocalizedValue(existingData[fieldName], locale, newValue, true, defaultLocale);
429
+ }
430
+ else {
431
+ // Non-localized field - just replace
432
+ result[fieldName] = newValue;
433
+ }
434
+ }
435
+ return result;
436
+ }
437
+ /**
438
+ * Resolves all localized fields in a content entry to the requested locale with fallback support.
439
+ *
440
+ * This function takes raw content entry data (which may contain LocalizedFieldValue
441
+ * structures for localized fields) and resolves each field to a single value
442
+ * based on the requested locale and fallback chain. It merges localized and
443
+ * non-localized field values into a unified data structure.
444
+ *
445
+ * Resolution order for each localized field:
446
+ * 1. Try the requested locale
447
+ * 2. Try each locale in the fallback chain (in order)
448
+ * 3. Try the default locale
449
+ * 4. Return first available locale as last resort
450
+ * 5. Return undefined if no value exists
451
+ *
452
+ * @param entry - The content entry with potentially localized data
453
+ * @param options - Locale resolution options
454
+ * @returns The entry with resolved locale data and resolution metadata
455
+ *
456
+ * @example
457
+ * ```typescript
458
+ * const entry = {
459
+ * _id: "abc123",
460
+ * slug: "my-post",
461
+ * data: {
462
+ * slug: "my-post", // non-localized
463
+ * title: { "en-US": "Hello", "es-ES": "Hola" }, // localized
464
+ * content: { "en-US": "Content here" }, // localized, missing es-ES
465
+ * },
466
+ * };
467
+ *
468
+ * const resolved = resolveLocaleContent(entry, {
469
+ * locale: "es-ES",
470
+ * fallbackChain: ["en-US"],
471
+ * defaultLocale: "en-US",
472
+ * fields: contentType.fields,
473
+ * });
474
+ *
475
+ * // resolved.data: { slug: "my-post", title: "Hola", content: "Content here" }
476
+ * // resolved.localeResolution.fieldsFromFallback: ["content"]
477
+ * // resolved.localeResolution.fieldResolutions: { content: "en-US" }
478
+ * ```
479
+ */
480
+ export function resolveLocaleContent(entry, options) {
481
+ const { locale, fallbackChain = [], defaultLocale = "en", fields, includeResolutionMetadata = true, } = options;
482
+ // Resolve content data using existing function
483
+ const resolved = resolveContentData(entry.data, {
484
+ locale,
485
+ fallbackChain,
486
+ defaultLocale,
487
+ fields,
488
+ });
489
+ // Build field resolution map for fields that used fallback
490
+ const fieldResolutions = {};
491
+ for (const [fieldName, resolution] of Object.entries(resolved.resolutions)) {
492
+ if (!resolution.isExactMatch && resolution.resolvedLocale) {
493
+ fieldResolutions[fieldName] = resolution.resolvedLocale;
494
+ }
495
+ }
496
+ // Return entry with resolved data and metadata
497
+ return {
498
+ ...entry,
499
+ data: resolved.data,
500
+ localeResolution: includeResolutionMetadata
501
+ ? {
502
+ requestedLocale: locale,
503
+ fallbackChain,
504
+ defaultLocale,
505
+ fieldsFromFallback: resolved.missingTranslations,
506
+ fieldResolutions,
507
+ }
508
+ : undefined,
509
+ };
510
+ }
511
+ /**
512
+ * Resolves locale content for an array of content entries.
513
+ *
514
+ * This is a convenience function for batch-resolving multiple entries.
515
+ * Useful when fetching lists of content entries that need locale resolution.
516
+ *
517
+ * @param entries - Array of content entries to resolve
518
+ * @param options - Locale resolution options (applied to all entries)
519
+ * @returns Array of entries with resolved locale data
520
+ *
521
+ * @example
522
+ * ```typescript
523
+ * const entries = await cms.contentEntries.list(ctx, {
524
+ * contentTypeName: "blog_post",
525
+ * status: "published",
526
+ * paginationOpts: { numItems: 10 },
527
+ * });
528
+ *
529
+ * const resolvedEntries = resolveLocaleContentBatch(entries.page, {
530
+ * locale: "es-ES",
531
+ * fallbackChain: cms.getLocaleFallbackChain("es-ES"),
532
+ * defaultLocale: cms.config.defaultLocale,
533
+ * fields: blogPostContentType.fields,
534
+ * });
535
+ * ```
536
+ */
537
+ export function resolveLocaleContentBatch(entries, options) {
538
+ return entries.map((entry) => resolveLocaleContent(entry, options));
539
+ }
540
+ /**
541
+ * Gets the translation completeness status for content data across locales.
542
+ *
543
+ * @param data - The content entry data
544
+ * @param fields - Field definitions for the content type
545
+ * @param requiredLocales - Locales that should have translations
546
+ * @returns Translation status per locale
547
+ *
548
+ * @example
549
+ * ```typescript
550
+ * const data = {
551
+ * title: { "en-US": "Hello", "es-ES": "Hola" },
552
+ * content: { "en-US": "Content here" }, // missing es-ES
553
+ * };
554
+ *
555
+ * const status = getTranslationStatus(data, fields, ["en-US", "es-ES"]);
556
+ * // status: {
557
+ * // "en-US": { complete: true, missingFields: [], percentage: 100 },
558
+ * // "es-ES": { complete: false, missingFields: ["content"], percentage: 50 },
559
+ * // }
560
+ * ```
561
+ */
562
+ export function getTranslationStatus(data, fields, requiredLocales) {
563
+ const result = {};
564
+ // Get all localized fields
565
+ const localizedFields = fields.filter(isFieldLocalized);
566
+ if (localizedFields.length === 0) {
567
+ // No localized fields - all locales are "complete"
568
+ for (const locale of requiredLocales) {
569
+ result[locale] = { complete: true, missingFields: [], percentage: 100 };
570
+ }
571
+ return result;
572
+ }
573
+ for (const locale of requiredLocales) {
574
+ const missingFields = [];
575
+ for (const field of localizedFields) {
576
+ const fieldValue = data[field.name];
577
+ if (!hasLocale(fieldValue, locale)) {
578
+ missingFields.push(field.name);
579
+ }
580
+ }
581
+ const percentage = Math.round(((localizedFields.length - missingFields.length) /
582
+ localizedFields.length) *
583
+ 100);
584
+ result[locale] = {
585
+ complete: missingFields.length === 0,
586
+ missingFields,
587
+ percentage,
588
+ };
589
+ }
590
+ return result;
591
+ }
592
+ //# sourceMappingURL=localeFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localeFields.js","sourceRoot":"","sources":["../../src/component/localeFields.ts"],"names":[],"mappings":"AAAA;;;;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