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,477 @@
1
+ /**
2
+ * Type-Safe Schema Definition Types
3
+ *
4
+ * These types enable full TypeScript inference for content type schemas
5
+ * using Convex's native `Infer<typeof validator>` pattern.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { v, Infer } from "convex/values";
10
+ * import { defineContentType, InferContentType } from "@convex-cms/core";
11
+ *
12
+ * export const blogPost = defineContentType({
13
+ * name: "blog_post",
14
+ * validator: v.object({
15
+ * title: v.string(),
16
+ * content: v.string(),
17
+ * publishedAt: v.optional(v.number()),
18
+ * }),
19
+ * meta: {
20
+ * displayName: "Blog Post",
21
+ * titleField: "title",
22
+ * },
23
+ * });
24
+ *
25
+ * // Type is inferred automatically
26
+ * type BlogPostData = InferContentType<typeof blogPost>;
27
+ * // { title: string; content: string; publishedAt?: number }
28
+ * ```
29
+ */
30
+ import type { Validator } from "convex/values";
31
+ /**
32
+ * UI rendering hints for fields in the admin interface.
33
+ * These help the admin UI understand how to render each field type.
34
+ */
35
+ export type FieldRenderAs = "text" | "textarea" | "richText" | "number" | "boolean" | "date" | "datetime" | "reference" | "media" | "json" | "select" | "multiSelect" | "slug" | "code" | "color" | "url" | "email";
36
+ /**
37
+ * Metadata for a single field within a content type.
38
+ * This provides UI hints, validation configuration, and searchability.
39
+ *
40
+ * All options here correspond to the `options` field in the database
41
+ * field definition format and are passed through to the CMS component.
42
+ */
43
+ export interface FieldMeta {
44
+ /**
45
+ * Human-readable label for the field in the admin UI.
46
+ * If not provided, the field name will be used.
47
+ */
48
+ label?: string;
49
+ /**
50
+ * Hint for how the admin UI should render this field.
51
+ * Use this to distinguish between field types that share the same
52
+ * validator type (e.g., `richText` vs `text` both use `v.string()`).
53
+ * @default Inferred from validator type
54
+ */
55
+ renderAs?: FieldRenderAs;
56
+ /**
57
+ * Description/help text shown in the admin UI.
58
+ */
59
+ description?: string;
60
+ /**
61
+ * Whether this field should be indexed for search.
62
+ * Only applicable for text-like fields.
63
+ * @default false
64
+ */
65
+ searchable?: boolean;
66
+ /**
67
+ * Whether this field supports per-locale values.
68
+ * When true, the field can have different values for each locale.
69
+ * @default false
70
+ */
71
+ localized?: boolean;
72
+ /**
73
+ * Placeholder text for input fields.
74
+ */
75
+ placeholder?: string;
76
+ /**
77
+ * Display order in the admin UI (lower = earlier).
78
+ */
79
+ sortOrder?: number;
80
+ /**
81
+ * If true, this field is hidden in the admin UI.
82
+ */
83
+ hidden?: boolean;
84
+ /**
85
+ * If true, this field is read-only in the admin UI.
86
+ */
87
+ readOnly?: boolean;
88
+ /**
89
+ * Default value for the field.
90
+ * Type depends on the field type.
91
+ */
92
+ defaultValue?: unknown;
93
+ /**
94
+ * Minimum length for text fields.
95
+ * Enforced during validation.
96
+ */
97
+ minLength?: number;
98
+ /**
99
+ * Maximum length for text fields.
100
+ * Enforced during validation.
101
+ */
102
+ maxLength?: number;
103
+ /**
104
+ * Regex pattern for text validation.
105
+ * The content must match this pattern to be valid.
106
+ * @example "^[a-z0-9-]+$" for slug validation
107
+ */
108
+ pattern?: string;
109
+ /**
110
+ * Error message to display when pattern validation fails.
111
+ * If not provided, a generic message is shown.
112
+ */
113
+ patternMessage?: string;
114
+ /**
115
+ * Whether the text field should render as a multiline textarea.
116
+ * Only applicable when renderAs is "text" or "textarea".
117
+ * @default false
118
+ */
119
+ multiline?: boolean;
120
+ /**
121
+ * Minimum value for number fields.
122
+ * Enforced during validation.
123
+ */
124
+ min?: number;
125
+ /**
126
+ * Maximum value for number fields.
127
+ * Enforced during validation.
128
+ */
129
+ max?: number;
130
+ /**
131
+ * Step increment for number inputs.
132
+ * Used for UI number spinners.
133
+ * @example 0.01 for currency values
134
+ */
135
+ step?: number;
136
+ /**
137
+ * Decimal precision for number fields.
138
+ * Numbers will be rounded to this many decimal places.
139
+ * @example 2 for currency (e.g., 19.99)
140
+ */
141
+ precision?: number;
142
+ /**
143
+ * Prefix to display before the number input.
144
+ * @example "$" for currency
145
+ */
146
+ prefix?: string;
147
+ /**
148
+ * Suffix to display after the number input.
149
+ * @example "%" for percentages
150
+ */
151
+ suffix?: string;
152
+ /**
153
+ * Label to display when the boolean is true.
154
+ * @example "Yes", "Enabled", "Active"
155
+ */
156
+ trueLabel?: string;
157
+ /**
158
+ * Label to display when the boolean is false.
159
+ * @example "No", "Disabled", "Inactive"
160
+ */
161
+ falseLabel?: string;
162
+ /**
163
+ * Minimum allowed date (ISO 8601 format).
164
+ * @example "2026-01-01"
165
+ */
166
+ minDate?: string;
167
+ /**
168
+ * Maximum allowed date (ISO 8601 format).
169
+ * @example "2025-12-31"
170
+ */
171
+ maxDate?: string;
172
+ /**
173
+ * IANA timezone for datetime fields.
174
+ * Used for display and input conversion.
175
+ * @example "America/New_York"
176
+ */
177
+ timezone?: string;
178
+ /**
179
+ * Display format for date/datetime fields.
180
+ * Uses date-fns format strings.
181
+ * @example "yyyy-MM-dd" or "PPP" (localized)
182
+ */
183
+ format?: string;
184
+ /**
185
+ * For reference fields: allowed content type names.
186
+ * If not specified, references to any content type are allowed.
187
+ */
188
+ allowedContentTypes?: string[];
189
+ /**
190
+ * Whether multiple references can be selected.
191
+ * When true, the field stores an array of IDs.
192
+ * @default false
193
+ */
194
+ multiple?: boolean;
195
+ /**
196
+ * Minimum number of items required (for array fields).
197
+ * Only applies when `multiple` is true.
198
+ */
199
+ minItems?: number;
200
+ /**
201
+ * Maximum number of items allowed (for array fields).
202
+ * Only applies when `multiple` is true.
203
+ */
204
+ maxItems?: number;
205
+ /**
206
+ * Whether to allow creating new referenced entries inline.
207
+ * @default false
208
+ */
209
+ allowInlineCreation?: boolean;
210
+ /**
211
+ * For media fields: allowed MIME types.
212
+ * @example ["image/jpeg", "image/png", "image/webp"]
213
+ */
214
+ allowedMimeTypes?: string[];
215
+ /**
216
+ * Maximum file size in bytes.
217
+ * @example 5 * 1024 * 1024 for 5MB
218
+ */
219
+ maxFileSize?: number;
220
+ /**
221
+ * For select/multiSelect fields: available options.
222
+ */
223
+ options?: Array<{
224
+ value: string;
225
+ label: string;
226
+ }>;
227
+ /**
228
+ * Minimum number of selections required (for multiSelect).
229
+ */
230
+ minSelections?: number;
231
+ /**
232
+ * Maximum number of selections allowed (for multiSelect).
233
+ */
234
+ maxSelections?: number;
235
+ /**
236
+ * Allowed block types for rich text fields.
237
+ * @example ["paragraph", "heading", "list", "blockquote"]
238
+ */
239
+ allowedBlocks?: string[];
240
+ /**
241
+ * Allowed inline marks/formatting for rich text fields.
242
+ * @example ["bold", "italic", "link", "code"]
243
+ */
244
+ allowedMarks?: string[];
245
+ /**
246
+ * JSON Schema for validating the JSON field content.
247
+ * Should be a valid JSON Schema object.
248
+ */
249
+ schema?: object;
250
+ /**
251
+ * The taxonomy ID to use for this tag/category field.
252
+ * Either taxonomyId or taxonomyName must be provided for taxonomy fields.
253
+ */
254
+ taxonomyId?: string;
255
+ /**
256
+ * The taxonomy name to use for this tag/category field.
257
+ * Alternative to taxonomyId - will look up the taxonomy by name.
258
+ */
259
+ taxonomyName?: string;
260
+ /**
261
+ * Whether to allow creating new taxonomy terms inline.
262
+ * @default false
263
+ */
264
+ allowCreate?: boolean;
265
+ /**
266
+ * Maximum number of tags that can be selected.
267
+ */
268
+ maxTags?: number;
269
+ /**
270
+ * Minimum number of tags required.
271
+ */
272
+ minTags?: number;
273
+ /**
274
+ * For hierarchical taxonomies: maximum depth level to show.
275
+ * 0 = root only, 1 = root and children, etc.
276
+ */
277
+ depth?: number;
278
+ /**
279
+ * Whether to allow selecting multiple categories (for category fields).
280
+ * @default false
281
+ */
282
+ allowMultiple?: boolean;
283
+ }
284
+ /**
285
+ * Content type metadata configuration.
286
+ * Provides display information and field-level metadata.
287
+ */
288
+ export interface ContentTypeMeta<TFieldNames extends string = string> {
289
+ /**
290
+ * Human-readable display name for the content type.
291
+ * Shown in the admin UI.
292
+ */
293
+ displayName: string;
294
+ /**
295
+ * Description of this content type.
296
+ */
297
+ description?: string;
298
+ /**
299
+ * Icon identifier for the admin UI (e.g., emoji or icon name).
300
+ */
301
+ icon?: string;
302
+ /**
303
+ * Field to use for the entry's title in listings.
304
+ * Must be a key from the validator's object type.
305
+ */
306
+ titleField?: TFieldNames;
307
+ /**
308
+ * Field to use for generating URL slugs.
309
+ * Must be a key from the validator's object type.
310
+ */
311
+ slugField?: TFieldNames;
312
+ /**
313
+ * If true, only one entry of this content type can exist.
314
+ */
315
+ singleton?: boolean;
316
+ /**
317
+ * Display order in admin UI navigation.
318
+ */
319
+ sortOrder?: number;
320
+ /**
321
+ * Field-level metadata keyed by field name.
322
+ * Only fields present in the validator can have metadata.
323
+ */
324
+ fields?: Partial<Record<TFieldNames, FieldMeta>>;
325
+ }
326
+ /**
327
+ * Input configuration for defineContentType().
328
+ *
329
+ * @typeParam TValidator - The Convex validator for the content data shape
330
+ */
331
+ export interface ContentTypeConfig<TValidator extends Validator<Record<string, unknown>, "required", string>> {
332
+ /**
333
+ * Unique machine-readable name for this content type.
334
+ * Used as the identifier in code and URLs.
335
+ *
336
+ * Must be:
337
+ * - Lowercase letters, numbers, and underscores only
338
+ * - Start with a letter
339
+ * - 1-50 characters
340
+ *
341
+ * @example "blog_post", "product", "author"
342
+ */
343
+ name: string;
344
+ /**
345
+ * Convex validator defining the content data shape.
346
+ * Types are automatically inferred via `Infer<typeof validator>`.
347
+ *
348
+ * Must be a `v.object()` validator.
349
+ *
350
+ * @example
351
+ * ```typescript
352
+ * validator: v.object({
353
+ * title: v.string(),
354
+ * content: v.string(),
355
+ * author: v.id("contentEntries"),
356
+ * })
357
+ * ```
358
+ */
359
+ validator: TValidator;
360
+ /**
361
+ * CMS-specific metadata for display and configuration.
362
+ */
363
+ meta: ContentTypeMeta<TValidator extends Validator<infer T, "required", string> ? T extends Record<string, unknown> ? keyof T & string : string : string>;
364
+ }
365
+ /**
366
+ * A fully defined content type with validator and metadata.
367
+ *
368
+ * @typeParam TName - The literal string type for the content type name
369
+ * @typeParam TValidator - The Convex validator for content data
370
+ */
371
+ export interface ContentTypeDefinition<TName extends string = string, TValidator extends Validator<Record<string, unknown>, "required", string> = Validator<Record<string, unknown>, "required", string>> {
372
+ /**
373
+ * The unique identifier for this content type.
374
+ */
375
+ readonly name: TName;
376
+ /**
377
+ * The Convex validator for content data.
378
+ * Use `Infer<typeof definition.validator>` for the TypeScript type.
379
+ */
380
+ readonly validator: TValidator;
381
+ /**
382
+ * CMS metadata for display and configuration.
383
+ */
384
+ readonly meta: ContentTypeMeta;
385
+ /**
386
+ * Internal marker to identify content type definitions.
387
+ * @internal
388
+ */
389
+ readonly _type: "content_type_definition";
390
+ }
391
+ /**
392
+ * Infer the TypeScript type for a content type's data from its definition.
393
+ *
394
+ * This is a thin wrapper around Convex's native `Infer<typeof validator>`.
395
+ *
396
+ * @example
397
+ * ```typescript
398
+ * const blogPost = defineContentType({
399
+ * name: "blog_post",
400
+ * validator: v.object({
401
+ * title: v.string(),
402
+ * content: v.string(),
403
+ * }),
404
+ * meta: { displayName: "Blog Post" },
405
+ * });
406
+ *
407
+ * type BlogPostData = InferContentType<typeof blogPost>;
408
+ * // { title: string; content: string }
409
+ * ```
410
+ */
411
+ export type InferContentType<T extends ContentTypeDefinition> = T extends ContentTypeDefinition<string, infer V> ? V extends Validator<infer Data, "required", string> ? Data : never : never;
412
+ /**
413
+ * A schema object containing multiple content type definitions.
414
+ *
415
+ * @example
416
+ * ```typescript
417
+ * export const contentSchema = {
418
+ * blogPost,
419
+ * author,
420
+ * product,
421
+ * } satisfies ContentSchema;
422
+ * ```
423
+ */
424
+ export type ContentSchema = Record<string, ContentTypeDefinition>;
425
+ /**
426
+ * Infer all content data types from a schema object.
427
+ *
428
+ * Returns a mapped type where:
429
+ * - Keys are the content type names (from the `name` property)
430
+ * - Values are the inferred data types
431
+ *
432
+ * @example
433
+ * ```typescript
434
+ * const contentSchema = { blogPost, author, product };
435
+ *
436
+ * type ContentTypes = InferSchema<typeof contentSchema>;
437
+ * // {
438
+ * // blog_post: { title: string; content: string; ... };
439
+ * // author: { name: string; bio?: string; ... };
440
+ * // product: { name: string; price: number; ... };
441
+ * // }
442
+ * ```
443
+ */
444
+ export type InferSchema<T extends ContentSchema> = {
445
+ [K in keyof T as T[K] extends ContentTypeDefinition<infer Name, Validator<Record<string, unknown>, "required", string>> ? Name : never]: T[K] extends ContentTypeDefinition<string, infer V> ? V extends Validator<infer Data, "required", string> ? Data : never : never;
446
+ };
447
+ /**
448
+ * Extract all content type names from a schema.
449
+ *
450
+ * @example
451
+ * ```typescript
452
+ * type Names = SchemaContentTypeNames<typeof contentSchema>;
453
+ * // "blog_post" | "author" | "product"
454
+ * ```
455
+ */
456
+ export type SchemaContentTypeNames<T extends ContentSchema> = {
457
+ [K in keyof T]: T[K] extends ContentTypeDefinition<infer Name, Validator<Record<string, unknown>, "required", string>> ? Name : never;
458
+ }[keyof T];
459
+ /**
460
+ * Get the data type for a specific content type name from a schema.
461
+ *
462
+ * @example
463
+ * ```typescript
464
+ * type BlogData = SchemaContentType<typeof contentSchema, "blog_post">;
465
+ * // { title: string; content: string; ... }
466
+ * ```
467
+ */
468
+ export type SchemaContentType<T extends ContentSchema, Name extends SchemaContentTypeNames<T>> = InferSchema<T>[Name];
469
+ /**
470
+ * Extract field names from a content type definition.
471
+ */
472
+ export type ContentTypeFieldNames<T extends ContentTypeDefinition> = T extends ContentTypeDefinition<string, infer V> ? V extends Validator<infer Data, "required", string> ? Data extends Record<string, unknown> ? keyof Data & string : never : never : never;
473
+ /**
474
+ * Check if a value is a ContentTypeDefinition.
475
+ */
476
+ export declare function isContentTypeDefinition(value: unknown): value is ContentTypeDefinition;
477
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/client/schema/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAM/C;;;GAGG;AACH,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,UAAU,GACV,UAAU,GACV,QAAQ,GACR,SAAS,GACT,MAAM,GACN,UAAU,GACV,WAAW,GACX,OAAO,GACP,MAAM,GACN,QAAQ,GACR,aAAa,GACb,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,GACL,OAAO,CAAC;AAEZ;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IAKxB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IAEzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAE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AiB,CAC3B,CAAC,SAAS,aAAa,EACvB,IAAI,SAAS,sBAAsB,CAAC,CAAC,CAAC,IACpC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAMzB;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,qBAAqB,IAC/D,CAAC,SAAS,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC5C,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,GACjD,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,MAAM,IAAI,GAAG,MAAM,GACnB,KAAK,GACP,KAAK,GACP,KAAK,CAAC;AAEZ;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB,CAOtF"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Type-Safe Schema Definition Types
3
+ *
4
+ * These types enable full TypeScript inference for content type schemas
5
+ * using Convex's native `Infer<typeof validator>` pattern.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { v, Infer } from "convex/values";
10
+ * import { defineContentType, InferContentType } from "@convex-cms/core";
11
+ *
12
+ * export const blogPost = defineContentType({
13
+ * name: "blog_post",
14
+ * validator: v.object({
15
+ * title: v.string(),
16
+ * content: v.string(),
17
+ * publishedAt: v.optional(v.number()),
18
+ * }),
19
+ * meta: {
20
+ * displayName: "Blog Post",
21
+ * titleField: "title",
22
+ * },
23
+ * });
24
+ *
25
+ * // Type is inferred automatically
26
+ * type BlogPostData = InferContentType<typeof blogPost>;
27
+ * // { title: string; content: string; publishedAt?: number }
28
+ * ```
29
+ */
30
+ /**
31
+ * Check if a value is a ContentTypeDefinition.
32
+ */
33
+ export function isContentTypeDefinition(value) {
34
+ return (typeof value === "object" &&
35
+ value !== null &&
36
+ "_type" in value &&
37
+ value._type === "content_type_definition");
38
+ }
39
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/client/schema/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAmnBH;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACpD,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAO,IAAI,KAAK;QACf,KAA+B,CAAC,KAAK,KAAK,yBAAyB,CACrE,CAAC;AACJ,CAAC"}