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,401 @@
1
+ /**
2
+ * Schema-Aware Typed CMS Client
3
+ *
4
+ * This module provides type-safe access to content entries when a schema
5
+ * is configured. The types are inferred from the Convex validators defined
6
+ * in the schema.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { v } from "convex/values";
11
+ * import { defineContentType, createContentSchema, createTypedCmsClient } from "@convex-cms/core";
12
+ * import { components } from "./_generated/api";
13
+ *
14
+ * // Define content types with validators
15
+ * const blogPost = defineContentType({
16
+ * name: "blog_post",
17
+ * validator: v.object({ title: v.string(), content: v.string() }),
18
+ * meta: { displayName: "Blog Post" },
19
+ * });
20
+ *
21
+ * const contentSchema = createContentSchema({ blogPost });
22
+ *
23
+ * // Create a typed CMS client
24
+ * export const cms = createTypedCmsClient(components.convexCms, {
25
+ * schema: contentSchema,
26
+ * });
27
+ *
28
+ * // Now methods return typed data
29
+ * const post = await cms.contentEntries.get<"blog_post">(ctx, id);
30
+ * post.data.title // ✅ string - TypeScript knows the type
31
+ * post.data.typo // ❌ Error: Property 'typo' does not exist
32
+ * ```
33
+ */
34
+ import type { ContentTypeDefinition, InferSchema, SchemaContentTypeNames } from "./types.js";
35
+ import type { ContentEntry, ContentStatus, PaginationOpts } from "../types.js";
36
+ import type { ContentSchemaInstance } from "./defineContentType.js";
37
+ import type { ConvexContext } from "../wrapper.js";
38
+ /**
39
+ * A content entry with typed data based on the schema.
40
+ *
41
+ * @typeParam TData - The inferred data type from the content type's validator
42
+ */
43
+ export interface TypedContentEntry<TData extends Record<string, unknown>> extends Omit<ContentEntry, "data"> {
44
+ /**
45
+ * The content data with full type inference.
46
+ */
47
+ data: TData;
48
+ }
49
+ /**
50
+ * A paginated result with typed content entries.
51
+ */
52
+ export interface TypedPaginationResult<TData extends Record<string, unknown>> {
53
+ page: TypedContentEntry<TData>[];
54
+ continueCursor: string | null;
55
+ isDone: boolean;
56
+ }
57
+ /**
58
+ * Extract the data type for a content type name from a schema.
59
+ */
60
+ export type SchemaDataType<TSchema extends ContentSchemaInstance<Record<string, ContentTypeDefinition>>, TName extends string> = TSchema extends ContentSchemaInstance<infer TDefs> ? TName extends keyof InferSchema<TDefs> ? InferSchema<TDefs>[TName] extends Record<string, unknown> ? InferSchema<TDefs>[TName] : Record<string, unknown> : Record<string, unknown> : Record<string, unknown>;
61
+ /**
62
+ * Extract all valid content type names from a schema.
63
+ */
64
+ export type ValidContentTypeName<TSchema extends ContentSchemaInstance<Record<string, ContentTypeDefinition>>> = TSchema extends ContentSchemaInstance<infer TDefs> ? SchemaContentTypeNames<TDefs> : string;
65
+ /**
66
+ * Typed content entries API methods.
67
+ *
68
+ * These methods provide full type inference for content data when a schema
69
+ * is configured.
70
+ *
71
+ * @typeParam TSchema - The content schema instance type
72
+ */
73
+ export interface TypedContentEntriesApi<TSchema extends ContentSchemaInstance<Record<string, ContentTypeDefinition>>> {
74
+ /**
75
+ * Get a content entry by ID with typed data.
76
+ *
77
+ * @param ctx - Convex context
78
+ * @param id - The content entry ID
79
+ * @returns The entry with typed data, or null if not found
80
+ *
81
+ * @example
82
+ * ```typescript
83
+ * const post = await cms.contentEntries.get<"blog_post">(ctx, id);
84
+ * if (post) {
85
+ * console.log(post.data.title); // ✅ TypeScript knows title is string
86
+ * }
87
+ * ```
88
+ */
89
+ get<TName extends ValidContentTypeName<TSchema>>(ctx: ConvexContext, id: string): Promise<TypedContentEntry<SchemaDataType<TSchema, TName>> | null>;
90
+ /**
91
+ * Get a content entry by slug with typed data.
92
+ *
93
+ * @param ctx - Convex context
94
+ * @param options - Query options including contentTypeName and slug
95
+ * @returns The entry with typed data, or null if not found
96
+ */
97
+ getBySlug<TName extends ValidContentTypeName<TSchema>>(ctx: ConvexContext, options: {
98
+ contentTypeName: TName;
99
+ slug: string;
100
+ locale?: string;
101
+ status?: ContentStatus | ContentStatus[];
102
+ }): Promise<TypedContentEntry<SchemaDataType<TSchema, TName>> | null>;
103
+ /**
104
+ * Create a new content entry with typed data.
105
+ *
106
+ * @param ctx - Convex context
107
+ * @param options - Creation options including typed data
108
+ * @returns The created entry with typed data
109
+ *
110
+ * @example
111
+ * ```typescript
112
+ * const post = await cms.contentEntries.create<"blog_post">(ctx, {
113
+ * contentTypeName: "blog_post",
114
+ * data: {
115
+ * title: "Hello World", // ✅ TypeScript validates this
116
+ * typo: "oops", // ❌ Error: 'typo' does not exist
117
+ * },
118
+ * });
119
+ * ```
120
+ */
121
+ create<TName extends ValidContentTypeName<TSchema>>(ctx: ConvexContext, options: TypedCreateEntryOptions<TSchema, TName>): Promise<TypedContentEntry<SchemaDataType<TSchema, TName>>>;
122
+ /**
123
+ * Update an existing content entry with typed data.
124
+ *
125
+ * @param ctx - Convex context
126
+ * @param options - Update options including partial typed data
127
+ * @returns The updated entry with typed data
128
+ */
129
+ update<TName extends ValidContentTypeName<TSchema>>(ctx: ConvexContext, options: TypedUpdateEntryOptions<TSchema, TName>): Promise<TypedContentEntry<SchemaDataType<TSchema, TName>>>;
130
+ /**
131
+ * List content entries with typed data.
132
+ *
133
+ * @param ctx - Convex context
134
+ * @param options - List options
135
+ * @returns Paginated results with typed entries
136
+ */
137
+ list<TName extends ValidContentTypeName<TSchema>>(ctx: ConvexContext, options: TypedListEntriesOptions<TName>): Promise<TypedPaginationResult<SchemaDataType<TSchema, TName>>>;
138
+ }
139
+ /**
140
+ * Options for creating a content entry with typed data.
141
+ */
142
+ export interface TypedCreateEntryOptions<TSchema extends ContentSchemaInstance<Record<string, ContentTypeDefinition>>, TName extends ValidContentTypeName<TSchema>> {
143
+ /**
144
+ * The content type name (must match a type in the schema).
145
+ */
146
+ contentTypeName: TName;
147
+ /**
148
+ * The content data (fully typed based on the content type's validator).
149
+ */
150
+ data: SchemaDataType<TSchema, TName>;
151
+ /**
152
+ * Optional slug (auto-generated if not provided).
153
+ */
154
+ slug?: string;
155
+ /**
156
+ * Optional locale for localized content.
157
+ */
158
+ locale?: string;
159
+ /**
160
+ * User ID of the creator.
161
+ */
162
+ createdBy?: string;
163
+ }
164
+ /**
165
+ * Options for updating a content entry with typed data.
166
+ */
167
+ export interface TypedUpdateEntryOptions<TSchema extends ContentSchemaInstance<Record<string, ContentTypeDefinition>>, TName extends ValidContentTypeName<TSchema>> {
168
+ /**
169
+ * The content entry ID.
170
+ */
171
+ id: string;
172
+ /**
173
+ * Partial content data (typed based on the content type).
174
+ */
175
+ data?: Partial<SchemaDataType<TSchema, TName>>;
176
+ /**
177
+ * Optional updated slug.
178
+ */
179
+ slug?: string;
180
+ /**
181
+ * User ID of the updater.
182
+ */
183
+ updatedBy?: string;
184
+ }
185
+ /**
186
+ * Options for listing content entries with typed results.
187
+ */
188
+ export interface TypedListEntriesOptions<TName extends string> {
189
+ /**
190
+ * Filter by content type name.
191
+ */
192
+ contentTypeName?: TName;
193
+ /**
194
+ * Filter by status.
195
+ */
196
+ status?: ContentStatus;
197
+ /**
198
+ * Filter by multiple statuses.
199
+ */
200
+ statusIn?: ContentStatus[];
201
+ /**
202
+ * Filter by locale.
203
+ */
204
+ locale?: string;
205
+ /**
206
+ * Search query.
207
+ */
208
+ search?: string;
209
+ /**
210
+ * Include soft-deleted entries.
211
+ */
212
+ includeDeleted?: boolean;
213
+ /**
214
+ * Pagination options.
215
+ */
216
+ paginationOpts: PaginationOpts;
217
+ }
218
+ /**
219
+ * Helper type to check if a schema has a specific content type.
220
+ */
221
+ export type HasContentType<TSchema extends ContentSchemaInstance<Record<string, ContentTypeDefinition>>, TName extends string> = TName extends ValidContentTypeName<TSchema> ? true : false;
222
+ /**
223
+ * Utility type to get the definition for a specific content type.
224
+ */
225
+ export type GetContentTypeDefinition<TSchema extends ContentSchemaInstance<Record<string, ContentTypeDefinition>>, TName extends string> = TSchema extends ContentSchemaInstance<infer TDefs> ? {
226
+ [K in keyof TDefs]: TDefs[K] extends ContentTypeDefinition<TName, infer _V> ? TDefs[K] : never;
227
+ }[keyof TDefs] : never;
228
+ import type { ComponentConfig } from "../types.js";
229
+ import type { TypedComponentApi, CmsClient } from "../wrapper.js";
230
+ /**
231
+ * Configuration for creating a typed CMS client.
232
+ */
233
+ export interface TypedCmsClientConfig<TSchema extends ContentSchemaInstance<Record<string, ContentTypeDefinition>>> extends ComponentConfig {
234
+ /**
235
+ * The content schema instance containing type definitions.
236
+ * Created using `createContentSchema()`.
237
+ */
238
+ schema: TSchema;
239
+ }
240
+ /**
241
+ * A typed CMS client with schema-aware content entry methods.
242
+ *
243
+ * @typeParam TSchema - The content schema instance type
244
+ */
245
+ export interface TypedCmsClient<TSchema extends ContentSchemaInstance<Record<string, ContentTypeDefinition>>> extends CmsClient {
246
+ /**
247
+ * The content schema configured for this client.
248
+ */
249
+ readonly schema: TSchema;
250
+ /**
251
+ * Typed content entries API with methods that return properly typed data.
252
+ */
253
+ readonly typedContentEntries: TypedContentEntriesApiImpl<TSchema>;
254
+ }
255
+ /**
256
+ * Implementation of typed content entries API.
257
+ *
258
+ * This provides typed wrappers around the base content entries API that
259
+ * cast results to the appropriate types based on the schema.
260
+ *
261
+ * @typeParam TSchema - The content schema instance type
262
+ */
263
+ export declare class TypedContentEntriesApiImpl<TSchema extends ContentSchemaInstance<Record<string, ContentTypeDefinition>>> {
264
+ private baseClient;
265
+ private schema;
266
+ constructor(baseClient: CmsClient, schema: TSchema);
267
+ /**
268
+ * Get a content entry by ID with typed data.
269
+ *
270
+ * @param ctx - Convex context
271
+ * @param id - The content entry ID
272
+ * @returns The entry with typed data, or null if not found
273
+ *
274
+ * @example
275
+ * ```typescript
276
+ * const post = await cms.typedContentEntries.get<"blog_post">(ctx, id);
277
+ * if (post) {
278
+ * console.log(post.data.title); // ✅ TypeScript knows title is string
279
+ * }
280
+ * ```
281
+ */
282
+ get<TName extends ValidContentTypeName<TSchema>>(ctx: ConvexContext, id: string): Promise<TypedContentEntry<SchemaDataType<TSchema, TName>> | null>;
283
+ /**
284
+ * Get a content entry by slug with typed data.
285
+ *
286
+ * @param ctx - Convex context
287
+ * @param options - Query options including contentTypeName and slug
288
+ * @returns The entry with typed data, or null if not found
289
+ */
290
+ getBySlug<TName extends ValidContentTypeName<TSchema>>(ctx: ConvexContext, options: {
291
+ contentTypeName: TName;
292
+ slug: string;
293
+ locale?: string;
294
+ }): Promise<TypedContentEntry<SchemaDataType<TSchema, TName>> | null>;
295
+ /**
296
+ * Create a new content entry with typed data.
297
+ *
298
+ * @param ctx - Convex context
299
+ * @param options - Creation options including typed data
300
+ * @returns The created entry with typed data
301
+ *
302
+ * @example
303
+ * ```typescript
304
+ * const post = await cms.typedContentEntries.create<"blog_post">(ctx, {
305
+ * contentTypeName: "blog_post",
306
+ * data: {
307
+ * title: "Hello World", // ✅ TypeScript validates this
308
+ * content: "...",
309
+ * },
310
+ * });
311
+ * ```
312
+ */
313
+ create<TName extends ValidContentTypeName<TSchema>>(ctx: ConvexContext, options: TypedCreateEntryOptions<TSchema, TName>): Promise<TypedContentEntry<SchemaDataType<TSchema, TName>>>;
314
+ /**
315
+ * Update an existing content entry with typed data.
316
+ *
317
+ * @param ctx - Convex context
318
+ * @param options - Update options including partial typed data
319
+ * @returns The updated entry with typed data
320
+ */
321
+ update<TName extends ValidContentTypeName<TSchema>>(ctx: ConvexContext, options: TypedUpdateEntryOptions<TSchema, TName>): Promise<TypedContentEntry<SchemaDataType<TSchema, TName>>>;
322
+ /**
323
+ * List content entries with typed data.
324
+ *
325
+ * @param ctx - Convex context
326
+ * @param options - List options
327
+ * @returns Paginated results with typed entries
328
+ */
329
+ list<TName extends ValidContentTypeName<TSchema>>(ctx: ConvexContext, options: TypedListEntriesOptions<TName>): Promise<TypedPaginationResult<SchemaDataType<TSchema, TName>>>;
330
+ /**
331
+ * Publish a content entry.
332
+ *
333
+ * @param ctx - Convex context
334
+ * @param id - The entry ID to publish
335
+ * @param updatedBy - Optional user ID who triggered the publish
336
+ * @returns The published entry with typed data
337
+ */
338
+ publish<TName extends ValidContentTypeName<TSchema>>(ctx: ConvexContext, id: string, updatedBy?: string): Promise<TypedContentEntry<SchemaDataType<TSchema, TName>>>;
339
+ /**
340
+ * Unpublish a content entry.
341
+ *
342
+ * @param ctx - Convex context
343
+ * @param id - The entry ID to unpublish
344
+ * @param updatedBy - Optional user ID who triggered the unpublish
345
+ * @returns The unpublished entry with typed data
346
+ */
347
+ unpublish<TName extends ValidContentTypeName<TSchema>>(ctx: ConvexContext, id: string, updatedBy?: string): Promise<TypedContentEntry<SchemaDataType<TSchema, TName>>>;
348
+ /**
349
+ * Get the schema configured for this typed client.
350
+ */
351
+ getSchema(): TSchema;
352
+ /**
353
+ * Validate that a content type exists in the schema.
354
+ *
355
+ * @param name - The content type name to validate
356
+ * @returns true if the content type exists
357
+ */
358
+ hasContentType(name: string): boolean;
359
+ }
360
+ /**
361
+ * Creates a typed CMS client with schema-aware content entry methods.
362
+ *
363
+ * This is the main entry point for using type-safe content operations.
364
+ * The returned client extends the base `CmsClient` with additional
365
+ * `typedContentEntries` methods that provide full TypeScript inference.
366
+ *
367
+ * @param componentApi - The component API from `components.convexCms`
368
+ * @param config - Configuration including the content schema
369
+ * @returns A typed CMS client instance
370
+ *
371
+ * @example
372
+ * ```typescript
373
+ * import { v } from "convex/values";
374
+ * import { defineContentType, createContentSchema, createTypedCmsClient } from "@convex-cms/core";
375
+ * import { components } from "./_generated/api";
376
+ *
377
+ * // Define content types
378
+ * const blogPost = defineContentType({
379
+ * name: "blog_post",
380
+ * validator: v.object({
381
+ * title: v.string(),
382
+ * content: v.string(),
383
+ * }),
384
+ * meta: { displayName: "Blog Post" },
385
+ * });
386
+ *
387
+ * const contentSchema = createContentSchema({ blogPost });
388
+ *
389
+ * // Create a typed client
390
+ * export const cms = createTypedCmsClient(components.convexCms, {
391
+ * schema: contentSchema,
392
+ * });
393
+ *
394
+ * // Use with full type inference
395
+ * const post = await cms.typedContentEntries.get<"blog_post">(ctx, id);
396
+ * post.data.title; // ✅ string
397
+ * post.data.typo; // ❌ Error: Property 'typo' does not exist
398
+ * ```
399
+ */
400
+ export declare function createTypedCmsClient<TSchema extends ContentSchemaInstance<Record<string, ContentTypeDefinition>>>(componentApi: TypedComponentApi, config: TypedCmsClientConfig<TSchema>): TypedCmsClient<TSchema>;
401
+ //# sourceMappingURL=typedClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typedClient.d.ts","sourceRoot":"","sources":["../../../src/client/schema/typedClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,WAAW,EACX,sBAAsB,EACtB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,C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c,CAAC,OAAO,CAAC,CAyBzB"}
@@ -0,0 +1,269 @@
1
+ /**
2
+ * Schema-Aware Typed CMS Client
3
+ *
4
+ * This module provides type-safe access to content entries when a schema
5
+ * is configured. The types are inferred from the Convex validators defined
6
+ * in the schema.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { v } from "convex/values";
11
+ * import { defineContentType, createContentSchema, createTypedCmsClient } from "@convex-cms/core";
12
+ * import { components } from "./_generated/api";
13
+ *
14
+ * // Define content types with validators
15
+ * const blogPost = defineContentType({
16
+ * name: "blog_post",
17
+ * validator: v.object({ title: v.string(), content: v.string() }),
18
+ * meta: { displayName: "Blog Post" },
19
+ * });
20
+ *
21
+ * const contentSchema = createContentSchema({ blogPost });
22
+ *
23
+ * // Create a typed CMS client
24
+ * export const cms = createTypedCmsClient(components.convexCms, {
25
+ * schema: contentSchema,
26
+ * });
27
+ *
28
+ * // Now methods return typed data
29
+ * const post = await cms.contentEntries.get<"blog_post">(ctx, id);
30
+ * post.data.title // ✅ string - TypeScript knows the type
31
+ * post.data.typo // ❌ Error: Property 'typo' does not exist
32
+ * ```
33
+ */
34
+ /**
35
+ * Implementation of typed content entries API.
36
+ *
37
+ * This provides typed wrappers around the base content entries API that
38
+ * cast results to the appropriate types based on the schema.
39
+ *
40
+ * @typeParam TSchema - The content schema instance type
41
+ */
42
+ export class TypedContentEntriesApiImpl {
43
+ baseClient;
44
+ schema;
45
+ constructor(baseClient, schema) {
46
+ this.baseClient = baseClient;
47
+ this.schema = schema;
48
+ }
49
+ /**
50
+ * Get a content entry by ID with typed data.
51
+ *
52
+ * @param ctx - Convex context
53
+ * @param id - The content entry ID
54
+ * @returns The entry with typed data, or null if not found
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * const post = await cms.typedContentEntries.get<"blog_post">(ctx, id);
59
+ * if (post) {
60
+ * console.log(post.data.title); // ✅ TypeScript knows title is string
61
+ * }
62
+ * ```
63
+ */
64
+ async get(ctx, id) {
65
+ const entry = await this.baseClient.contentEntries.get(ctx, { id });
66
+ if (!entry)
67
+ return null;
68
+ // Cast to typed entry - the data shape is validated at write time
69
+ return entry;
70
+ }
71
+ /**
72
+ * Get a content entry by slug with typed data.
73
+ *
74
+ * @param ctx - Convex context
75
+ * @param options - Query options including contentTypeName and slug
76
+ * @returns The entry with typed data, or null if not found
77
+ */
78
+ async getBySlug(ctx, options) {
79
+ const entry = await this.baseClient.contentEntries.getBySlug(ctx, {
80
+ contentTypeName: options.contentTypeName,
81
+ slug: options.slug,
82
+ locale: options.locale,
83
+ });
84
+ if (!entry)
85
+ return null;
86
+ return entry;
87
+ }
88
+ /**
89
+ * Create a new content entry with typed data.
90
+ *
91
+ * @param ctx - Convex context
92
+ * @param options - Creation options including typed data
93
+ * @returns The created entry with typed data
94
+ *
95
+ * @example
96
+ * ```typescript
97
+ * const post = await cms.typedContentEntries.create<"blog_post">(ctx, {
98
+ * contentTypeName: "blog_post",
99
+ * data: {
100
+ * title: "Hello World", // ✅ TypeScript validates this
101
+ * content: "...",
102
+ * },
103
+ * });
104
+ * ```
105
+ */
106
+ async create(ctx, options) {
107
+ // Look up the content type by name to get its ID
108
+ const contentType = await this.baseClient.contentTypes.getByName(ctx, options.contentTypeName);
109
+ if (!contentType) {
110
+ throw new Error(`Content type "${options.contentTypeName}" not found`);
111
+ }
112
+ const entry = await this.baseClient.contentEntries.create(ctx, {
113
+ contentTypeId: contentType._id,
114
+ data: options.data,
115
+ slug: options.slug,
116
+ locale: options.locale,
117
+ createdBy: options.createdBy,
118
+ });
119
+ return entry;
120
+ }
121
+ /**
122
+ * Update an existing content entry with typed data.
123
+ *
124
+ * @param ctx - Convex context
125
+ * @param options - Update options including partial typed data
126
+ * @returns The updated entry with typed data
127
+ */
128
+ async update(ctx, options) {
129
+ const entry = await this.baseClient.contentEntries.update(ctx, {
130
+ id: options.id,
131
+ data: options.data,
132
+ slug: options.slug,
133
+ updatedBy: options.updatedBy,
134
+ });
135
+ return entry;
136
+ }
137
+ /**
138
+ * List content entries with typed data.
139
+ *
140
+ * @param ctx - Convex context
141
+ * @param options - List options
142
+ * @returns Paginated results with typed entries
143
+ */
144
+ async list(ctx, options) {
145
+ // If filtering by content type name, look up the content type ID
146
+ let contentTypeId;
147
+ if (options.contentTypeName) {
148
+ const contentType = await this.baseClient.contentTypes.getByName(ctx, options.contentTypeName);
149
+ if (contentType) {
150
+ contentTypeId = contentType._id;
151
+ }
152
+ }
153
+ const result = await this.baseClient.contentEntries.list(ctx, {
154
+ contentTypeId,
155
+ status: options.status,
156
+ statusIn: options.statusIn,
157
+ locale: options.locale,
158
+ search: options.search,
159
+ includeDeleted: options.includeDeleted,
160
+ paginationOpts: options.paginationOpts,
161
+ });
162
+ return {
163
+ page: result.page,
164
+ continueCursor: result.continueCursor,
165
+ isDone: result.isDone,
166
+ };
167
+ }
168
+ /**
169
+ * Publish a content entry.
170
+ *
171
+ * @param ctx - Convex context
172
+ * @param id - The entry ID to publish
173
+ * @param updatedBy - Optional user ID who triggered the publish
174
+ * @returns The published entry with typed data
175
+ */
176
+ async publish(ctx, id, updatedBy) {
177
+ const entry = await this.baseClient.contentEntries.publish(ctx, {
178
+ id,
179
+ updatedBy,
180
+ });
181
+ return entry;
182
+ }
183
+ /**
184
+ * Unpublish a content entry.
185
+ *
186
+ * @param ctx - Convex context
187
+ * @param id - The entry ID to unpublish
188
+ * @param updatedBy - Optional user ID who triggered the unpublish
189
+ * @returns The unpublished entry with typed data
190
+ */
191
+ async unpublish(ctx, id, updatedBy) {
192
+ const entry = await this.baseClient.contentEntries.unpublish(ctx, {
193
+ id,
194
+ updatedBy,
195
+ });
196
+ return entry;
197
+ }
198
+ /**
199
+ * Get the schema configured for this typed client.
200
+ */
201
+ getSchema() {
202
+ return this.schema;
203
+ }
204
+ /**
205
+ * Validate that a content type exists in the schema.
206
+ *
207
+ * @param name - The content type name to validate
208
+ * @returns true if the content type exists
209
+ */
210
+ hasContentType(name) {
211
+ return this.schema.hasContentType(name);
212
+ }
213
+ }
214
+ /**
215
+ * Creates a typed CMS client with schema-aware content entry methods.
216
+ *
217
+ * This is the main entry point for using type-safe content operations.
218
+ * The returned client extends the base `CmsClient` with additional
219
+ * `typedContentEntries` methods that provide full TypeScript inference.
220
+ *
221
+ * @param componentApi - The component API from `components.convexCms`
222
+ * @param config - Configuration including the content schema
223
+ * @returns A typed CMS client instance
224
+ *
225
+ * @example
226
+ * ```typescript
227
+ * import { v } from "convex/values";
228
+ * import { defineContentType, createContentSchema, createTypedCmsClient } from "@convex-cms/core";
229
+ * import { components } from "./_generated/api";
230
+ *
231
+ * // Define content types
232
+ * const blogPost = defineContentType({
233
+ * name: "blog_post",
234
+ * validator: v.object({
235
+ * title: v.string(),
236
+ * content: v.string(),
237
+ * }),
238
+ * meta: { displayName: "Blog Post" },
239
+ * });
240
+ *
241
+ * const contentSchema = createContentSchema({ blogPost });
242
+ *
243
+ * // Create a typed client
244
+ * export const cms = createTypedCmsClient(components.convexCms, {
245
+ * schema: contentSchema,
246
+ * });
247
+ *
248
+ * // Use with full type inference
249
+ * const post = await cms.typedContentEntries.get<"blog_post">(ctx, id);
250
+ * post.data.title; // ✅ string
251
+ * post.data.typo; // ❌ Error: Property 'typo' does not exist
252
+ * ```
253
+ */
254
+ export function createTypedCmsClient(componentApi, config) {
255
+ // Import createCmsClient dynamically to avoid circular imports
256
+ // The actual import happens at runtime
257
+ const { createCmsClient } = require("../index.js");
258
+ // Create the base client with the provided config
259
+ const baseClient = createCmsClient(componentApi, config);
260
+ // Create the typed content entries API
261
+ const typedContentEntries = new TypedContentEntriesApiImpl(baseClient, config.schema);
262
+ // Return an extended client with the typed API
263
+ return {
264
+ ...baseClient,
265
+ schema: config.schema,
266
+ typedContentEntries,
267
+ };
268
+ }
269
+ //# sourceMappingURL=typedClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typedClient.js","sourceRoot":"","sources":["../../../src/client/schema/typedClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;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