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,765 @@
1
+ /**
2
+ * Fluent Query Builder for Content Entries
3
+ *
4
+ * Provides a chainable, type-safe interface for constructing complex
5
+ * content queries. Supports filtering, sorting, pagination, and search
6
+ * with TypeScript inference.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * // Simple query with chaining
11
+ * const posts = await cms.contentEntries
12
+ * .query()
13
+ * .contentType("blog_post")
14
+ * .status("published")
15
+ * .limit(10)
16
+ * .execute(ctx);
17
+ *
18
+ * // Complex query with field filters
19
+ * const featured = await cms.contentEntries
20
+ * .query()
21
+ * .contentType("blog_post")
22
+ * .where("category", "eq", "technology")
23
+ * .where("featured", "eq", true)
24
+ * .whereIn("tags", ["javascript", "typescript"])
25
+ * .orderBy("_creationTime", "desc")
26
+ * .limit(5)
27
+ * .execute(ctx);
28
+ *
29
+ * // Pagination with cursor
30
+ * const page1 = await cms.contentEntries
31
+ * .query()
32
+ * .contentType("blog_post")
33
+ * .limit(20)
34
+ * .execute(ctx);
35
+ *
36
+ * const page2 = await cms.contentEntries
37
+ * .query()
38
+ * .contentType("blog_post")
39
+ * .limit(20)
40
+ * .cursor(page1.continueCursor)
41
+ * .execute(ctx);
42
+ * ```
43
+ */
44
+ import type { ContentEntry, ContentStatus, FilterOperator, PaginationResult, ContentQueryOptions } from "./types.js";
45
+ import type { ConvexContext, TypedComponentApi } from "./wrapper.js";
46
+ /**
47
+ * Sort direction for query results.
48
+ */
49
+ export type SortDirection = "asc" | "desc";
50
+ /**
51
+ * Sortable fields for content entries.
52
+ * Currently supports creation time; can be extended for custom field sorting.
53
+ */
54
+ export type SortableField = "_creationTime" | "_id" | string;
55
+ /**
56
+ * Result from executing a query builder.
57
+ * Extends PaginationResult with convenience methods.
58
+ */
59
+ export interface QueryBuilderResult<T> extends PaginationResult<T> {
60
+ /**
61
+ * Whether there are more results available.
62
+ * Alias for !isDone for convenience.
63
+ */
64
+ hasMore: boolean;
65
+ }
66
+ /**
67
+ * Fluent query builder for constructing content entry queries.
68
+ *
69
+ * Provides a chainable API for building complex queries with:
70
+ * - Content type filtering
71
+ * - Status filtering (single or multiple)
72
+ * - Field-level filters with various operators
73
+ * - Full-text search
74
+ * - Locale filtering
75
+ * - Cursor-based pagination
76
+ * - Sort direction
77
+ *
78
+ * All methods return `this` for chaining, except terminal methods
79
+ * (`execute()`, `first()`, `count()`) which execute the query.
80
+ *
81
+ * @example
82
+ * ```typescript
83
+ * // The query builder is obtained from contentEntries.query()
84
+ * const builder = cms.contentEntries.query();
85
+ *
86
+ * // Chain methods to build the query
87
+ * const result = await builder
88
+ * .contentType("blog_post")
89
+ * .status("published")
90
+ * .where("author", "eq", "user_123")
91
+ * .search("typescript")
92
+ * .limit(10)
93
+ * .execute(ctx);
94
+ * ```
95
+ */
96
+ export declare class ContentQueryBuilder {
97
+ private state;
98
+ private readonly api;
99
+ constructor(api: TypedComponentApi);
100
+ /**
101
+ * Filter by content type name.
102
+ *
103
+ * @param name - The content type name (e.g., "blog_post")
104
+ * @returns this for chaining
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * const posts = await cms.contentEntries
109
+ * .query()
110
+ * .contentType("blog_post")
111
+ * .execute(ctx);
112
+ * ```
113
+ */
114
+ contentType(name: string): this;
115
+ /**
116
+ * Filter by content type ID.
117
+ *
118
+ * @param id - The content type ID
119
+ * @returns this for chaining
120
+ *
121
+ * @example
122
+ * ```typescript
123
+ * const posts = await cms.contentEntries
124
+ * .query()
125
+ * .contentTypeById(typeId)
126
+ * .execute(ctx);
127
+ * ```
128
+ */
129
+ contentTypeById(id: string): this;
130
+ /**
131
+ * Filter by a single status.
132
+ *
133
+ * @param status - The status to filter by
134
+ * @returns this for chaining
135
+ *
136
+ * @example
137
+ * ```typescript
138
+ * const published = await cms.contentEntries
139
+ * .query()
140
+ * .status("published")
141
+ * .execute(ctx);
142
+ * ```
143
+ */
144
+ status(status: ContentStatus): this;
145
+ /**
146
+ * Filter by multiple statuses (OR logic).
147
+ *
148
+ * Useful for admin views that need to show content in various states.
149
+ *
150
+ * @param statuses - Array of statuses to include
151
+ * @returns this for chaining
152
+ *
153
+ * @example
154
+ * ```typescript
155
+ * // Show all non-archived content in admin
156
+ * const editorial = await cms.contentEntries
157
+ * .query()
158
+ * .statusIn(["draft", "published", "scheduled"])
159
+ * .execute(ctx);
160
+ * ```
161
+ */
162
+ statusIn(statuses: ContentStatus[]): this;
163
+ /**
164
+ * Shorthand for status("published").
165
+ *
166
+ * @returns this for chaining
167
+ */
168
+ published(): this;
169
+ /**
170
+ * Shorthand for status("draft").
171
+ *
172
+ * @returns this for chaining
173
+ */
174
+ drafts(): this;
175
+ /**
176
+ * Shorthand for status("archived").
177
+ *
178
+ * @returns this for chaining
179
+ */
180
+ archived(): this;
181
+ /**
182
+ * Shorthand for status("scheduled").
183
+ *
184
+ * @returns this for chaining
185
+ */
186
+ scheduled(): this;
187
+ /**
188
+ * Filter by locale.
189
+ *
190
+ * @param locale - The locale code (e.g., "en-US", "es-ES")
191
+ * @returns this for chaining
192
+ *
193
+ * @example
194
+ * ```typescript
195
+ * const spanishPosts = await cms.contentEntries
196
+ * .query()
197
+ * .contentType("blog_post")
198
+ * .locale("es-ES")
199
+ * .execute(ctx);
200
+ * ```
201
+ */
202
+ locale(locale: string): this;
203
+ /**
204
+ * Include soft-deleted entries in results.
205
+ *
206
+ * By default, soft-deleted entries are excluded.
207
+ *
208
+ * @param include - Whether to include deleted entries (default: true)
209
+ * @returns this for chaining
210
+ *
211
+ * @example
212
+ * ```typescript
213
+ * // Show all entries including deleted ones
214
+ * const all = await cms.contentEntries
215
+ * .query()
216
+ * .includeDeleted()
217
+ * .execute(ctx);
218
+ *
219
+ * // Explicitly exclude deleted (same as default)
220
+ * const active = await cms.contentEntries
221
+ * .query()
222
+ * .includeDeleted(false)
223
+ * .execute(ctx);
224
+ * ```
225
+ */
226
+ includeDeleted(include?: boolean): this;
227
+ /**
228
+ * Only return soft-deleted entries.
229
+ *
230
+ * @returns this for chaining
231
+ *
232
+ * @example
233
+ * ```typescript
234
+ * const trash = await cms.contentEntries
235
+ * .query()
236
+ * .onlyDeleted()
237
+ * .execute(ctx);
238
+ * ```
239
+ */
240
+ onlyDeleted(): this;
241
+ /**
242
+ * Search content using full-text search.
243
+ *
244
+ * Searches indexed fields in the content entry data.
245
+ * Requires the searchIndexing feature to be enabled.
246
+ *
247
+ * @param query - The search query string
248
+ * @returns this for chaining
249
+ *
250
+ * @example
251
+ * ```typescript
252
+ * const results = await cms.contentEntries
253
+ * .query()
254
+ * .contentType("blog_post")
255
+ * .search("typescript tutorial")
256
+ * .execute(ctx);
257
+ * ```
258
+ */
259
+ search(query: string): this;
260
+ /**
261
+ * Add a field filter condition.
262
+ *
263
+ * Multiple filters are combined with AND logic.
264
+ *
265
+ * @param field - The field name in the content data
266
+ * @param operator - The comparison operator
267
+ * @param value - The value to compare against
268
+ * @returns this for chaining
269
+ *
270
+ * @example
271
+ * ```typescript
272
+ * const techPosts = await cms.contentEntries
273
+ * .query()
274
+ * .contentType("blog_post")
275
+ * .where("category", "eq", "technology")
276
+ * .where("views", "gte", 100)
277
+ * .execute(ctx);
278
+ * ```
279
+ */
280
+ where(field: string, operator: FilterOperator, value: unknown): this;
281
+ /**
282
+ * Filter where field equals value.
283
+ * Shorthand for where(field, "eq", value).
284
+ *
285
+ * @param field - The field name
286
+ * @param value - The value to match
287
+ * @returns this for chaining
288
+ *
289
+ * @example
290
+ * ```typescript
291
+ * const featured = await cms.contentEntries
292
+ * .query()
293
+ * .whereEquals("featured", true)
294
+ * .execute(ctx);
295
+ * ```
296
+ */
297
+ whereEquals(field: string, value: unknown): this;
298
+ /**
299
+ * Filter where field does not equal value.
300
+ * Shorthand for where(field, "ne", value).
301
+ *
302
+ * @param field - The field name
303
+ * @param value - The value to exclude
304
+ * @returns this for chaining
305
+ */
306
+ whereNotEquals(field: string, value: unknown): this;
307
+ /**
308
+ * Filter where field is greater than value.
309
+ * Shorthand for where(field, "gt", value).
310
+ *
311
+ * @param field - The field name
312
+ * @param value - The minimum value (exclusive)
313
+ * @returns this for chaining
314
+ *
315
+ * @example
316
+ * ```typescript
317
+ * const expensive = await cms.contentEntries
318
+ * .query()
319
+ * .contentType("product")
320
+ * .whereGreaterThan("price", 100)
321
+ * .execute(ctx);
322
+ * ```
323
+ */
324
+ whereGreaterThan(field: string, value: number | Date): this;
325
+ /**
326
+ * Filter where field is greater than or equal to value.
327
+ * Shorthand for where(field, "gte", value).
328
+ *
329
+ * @param field - The field name
330
+ * @param value - The minimum value (inclusive)
331
+ * @returns this for chaining
332
+ */
333
+ whereGreaterThanOrEquals(field: string, value: number | Date): this;
334
+ /**
335
+ * Filter where field is less than value.
336
+ * Shorthand for where(field, "lt", value).
337
+ *
338
+ * @param field - The field name
339
+ * @param value - The maximum value (exclusive)
340
+ * @returns this for chaining
341
+ */
342
+ whereLessThan(field: string, value: number | Date): this;
343
+ /**
344
+ * Filter where field is less than or equal to value.
345
+ * Shorthand for where(field, "lte", value).
346
+ *
347
+ * @param field - The field name
348
+ * @param value - The maximum value (inclusive)
349
+ * @returns this for chaining
350
+ */
351
+ whereLessThanOrEquals(field: string, value: number | Date): this;
352
+ /**
353
+ * Filter where field is in a range (inclusive).
354
+ *
355
+ * @param field - The field name
356
+ * @param min - The minimum value (inclusive)
357
+ * @param max - The maximum value (inclusive)
358
+ * @returns this for chaining
359
+ *
360
+ * @example
361
+ * ```typescript
362
+ * const midRange = await cms.contentEntries
363
+ * .query()
364
+ * .contentType("product")
365
+ * .whereBetween("price", 50, 150)
366
+ * .execute(ctx);
367
+ * ```
368
+ */
369
+ whereBetween(field: string, min: number | Date, max: number | Date): this;
370
+ /**
371
+ * Filter where field value is in an array of allowed values.
372
+ * Shorthand for where(field, "in", values).
373
+ *
374
+ * @param field - The field name
375
+ * @param values - Array of allowed values
376
+ * @returns this for chaining
377
+ *
378
+ * @example
379
+ * ```typescript
380
+ * const categoryPosts = await cms.contentEntries
381
+ * .query()
382
+ * .whereIn("category", ["tech", "science", "design"])
383
+ * .execute(ctx);
384
+ * ```
385
+ */
386
+ whereIn(field: string, values: unknown[]): this;
387
+ /**
388
+ * Filter where field value is NOT in an array of values.
389
+ * Shorthand for where(field, "notIn", values).
390
+ *
391
+ * @param field - The field name
392
+ * @param values - Array of excluded values
393
+ * @returns this for chaining
394
+ */
395
+ whereNotIn(field: string, values: unknown[]): this;
396
+ /**
397
+ * Filter where string field contains a substring.
398
+ * For array fields, checks if the array contains the value.
399
+ * Shorthand for where(field, "contains", value).
400
+ *
401
+ * @param field - The field name
402
+ * @param value - The substring or array value to find
403
+ * @returns this for chaining
404
+ *
405
+ * @example
406
+ * ```typescript
407
+ * // String contains
408
+ * const results = await cms.contentEntries
409
+ * .query()
410
+ * .whereContains("title", "guide")
411
+ * .execute(ctx);
412
+ *
413
+ * // Array contains
414
+ * const tagged = await cms.contentEntries
415
+ * .query()
416
+ * .whereContains("tags", "featured")
417
+ * .execute(ctx);
418
+ * ```
419
+ */
420
+ whereContains(field: string, value: unknown): this;
421
+ /**
422
+ * Filter where string field starts with a prefix.
423
+ * Shorthand for where(field, "startsWith", prefix).
424
+ *
425
+ * @param field - The field name
426
+ * @param prefix - The prefix to match
427
+ * @returns this for chaining
428
+ *
429
+ * @example
430
+ * ```typescript
431
+ * const year2026 = await cms.contentEntries
432
+ * .query()
433
+ * .whereStartsWith("slug", "2026-")
434
+ * .execute(ctx);
435
+ * ```
436
+ */
437
+ whereStartsWith(field: string, prefix: string): this;
438
+ /**
439
+ * Filter where string field ends with a suffix.
440
+ * Shorthand for where(field, "endsWith", suffix).
441
+ *
442
+ * @param field - The field name
443
+ * @param suffix - The suffix to match
444
+ * @returns this for chaining
445
+ */
446
+ whereEndsWith(field: string, suffix: string): this;
447
+ /**
448
+ * Set the sort order for results.
449
+ *
450
+ * Supports sorting by:
451
+ * - System fields: "_creationTime", "_id", "firstPublishedAt", "lastPublishedAt", "scheduledPublishAt", "version"
452
+ * - Custom data fields: Use "data.fieldName" format (e.g., "data.price", "data.sortOrder")
453
+ *
454
+ * Results are sorted in descending order by default.
455
+ *
456
+ * @param field - The field to sort by (system field or "data.fieldName" for custom fields)
457
+ * @param direction - Sort direction ("asc" or "desc")
458
+ * @returns this for chaining
459
+ *
460
+ * @example
461
+ * ```typescript
462
+ * // Newest first (default)
463
+ * const newest = await cms.contentEntries
464
+ * .query()
465
+ * .orderBy("_creationTime", "desc")
466
+ * .execute(ctx);
467
+ *
468
+ * // Oldest first
469
+ * const oldest = await cms.contentEntries
470
+ * .query()
471
+ * .orderBy("_creationTime", "asc")
472
+ * .execute(ctx);
473
+ *
474
+ * // Sort by publish date
475
+ * const byPublishDate = await cms.contentEntries
476
+ * .query()
477
+ * .orderBy("firstPublishedAt", "desc")
478
+ * .execute(ctx);
479
+ *
480
+ * // Sort by custom field (price, low to high)
481
+ * const byPrice = await cms.contentEntries
482
+ * .query()
483
+ * .contentType("product")
484
+ * .orderBy("data.price", "asc")
485
+ * .execute(ctx);
486
+ *
487
+ * // Sort by custom order field
488
+ * const byOrder = await cms.contentEntries
489
+ * .query()
490
+ * .contentType("menu_item")
491
+ * .orderBy("data.sortOrder", "asc")
492
+ * .execute(ctx);
493
+ * ```
494
+ */
495
+ orderBy(field: SortableField, direction?: SortDirection): this;
496
+ /**
497
+ * Sort by first publish date (newest published first).
498
+ * Useful for showing recently published content.
499
+ *
500
+ * @param direction - Sort direction ("asc" or "desc", default "desc")
501
+ * @returns this for chaining
502
+ *
503
+ * @example
504
+ * ```typescript
505
+ * const recentlyPublished = await cms.contentEntries
506
+ * .query()
507
+ * .status("published")
508
+ * .byPublishDate()
509
+ * .execute(ctx);
510
+ * ```
511
+ */
512
+ byPublishDate(direction?: SortDirection): this;
513
+ /**
514
+ * Sort by last publish date (most recently updated first).
515
+ * Useful for showing recently updated content.
516
+ *
517
+ * @param direction - Sort direction ("asc" or "desc", default "desc")
518
+ * @returns this for chaining
519
+ */
520
+ byLastPublishDate(direction?: SortDirection): this;
521
+ /**
522
+ * Sort by a custom data field.
523
+ * Convenience method that automatically prefixes field name with "data.".
524
+ *
525
+ * @param fieldName - The field name in the content entry's data object
526
+ * @param direction - Sort direction ("asc" or "desc", default "desc")
527
+ * @returns this for chaining
528
+ *
529
+ * @example
530
+ * ```typescript
531
+ * // Sort by price (low to high)
532
+ * const cheapest = await cms.contentEntries
533
+ * .query()
534
+ * .contentType("product")
535
+ * .orderByField("price", "asc")
536
+ * .execute(ctx);
537
+ *
538
+ * // Sort by title alphabetically
539
+ * const alphabetical = await cms.contentEntries
540
+ * .query()
541
+ * .orderByField("title", "asc")
542
+ * .execute(ctx);
543
+ * ```
544
+ */
545
+ orderByField(fieldName: string, direction?: SortDirection): this;
546
+ /**
547
+ * Sort by newest first (descending creation time).
548
+ * Shorthand for orderBy("_creationTime", "desc").
549
+ *
550
+ * @returns this for chaining
551
+ */
552
+ newestFirst(): this;
553
+ /**
554
+ * Sort by oldest first (ascending creation time).
555
+ * Shorthand for orderBy("_creationTime", "asc").
556
+ *
557
+ * @returns this for chaining
558
+ */
559
+ oldestFirst(): this;
560
+ /**
561
+ * Set the maximum number of results to return.
562
+ *
563
+ * @param count - Number of items per page (1-250)
564
+ * @returns this for chaining
565
+ *
566
+ * @example
567
+ * ```typescript
568
+ * const firstTen = await cms.contentEntries
569
+ * .query()
570
+ * .limit(10)
571
+ * .execute(ctx);
572
+ * ```
573
+ */
574
+ limit(count: number): this;
575
+ /**
576
+ * Set the pagination cursor for fetching the next page.
577
+ *
578
+ * Use the `continueCursor` from the previous query result.
579
+ *
580
+ * @param cursor - The cursor from the previous page
581
+ * @returns this for chaining
582
+ *
583
+ * @example
584
+ * ```typescript
585
+ * const page1 = await cms.contentEntries
586
+ * .query()
587
+ * .limit(20)
588
+ * .execute(ctx);
589
+ *
590
+ * if (!page1.isDone) {
591
+ * const page2 = await cms.contentEntries
592
+ * .query()
593
+ * .limit(20)
594
+ * .cursor(page1.continueCursor)
595
+ * .execute(ctx);
596
+ * }
597
+ * ```
598
+ */
599
+ cursor(cursor: string | null | undefined): this;
600
+ /**
601
+ * Alias for cursor() for more natural chaining.
602
+ *
603
+ * @param cursor - The cursor from the previous page
604
+ * @returns this for chaining
605
+ */
606
+ after(cursor: string | null | undefined): this;
607
+ /**
608
+ * Build the query options object from the current state.
609
+ *
610
+ * This is primarily for internal use, but can be useful for debugging
611
+ * or when you need to pass options to the underlying API directly.
612
+ *
613
+ * @returns The compiled ContentQueryOptions
614
+ *
615
+ * @example
616
+ * ```typescript
617
+ * const options = cms.contentEntries
618
+ * .query()
619
+ * .contentType("blog_post")
620
+ * .status("published")
621
+ * .orderBy("data.price", "asc")
622
+ * .toOptions();
623
+ *
624
+ * console.log(options);
625
+ * // {
626
+ * // contentTypeName: "blog_post",
627
+ * // status: "published",
628
+ * // sortField: "data.price",
629
+ * // sortDirection: "asc",
630
+ * // fieldFilters: [],
631
+ * // paginationOpts: { numItems: 50 }
632
+ * // }
633
+ * ```
634
+ */
635
+ toOptions(): ContentQueryOptions;
636
+ /**
637
+ * Execute the query and return paginated results.
638
+ *
639
+ * This is the primary terminal method that runs the built query.
640
+ *
641
+ * @param ctx - Convex query context
642
+ * @returns Promise resolving to paginated results
643
+ *
644
+ * @example
645
+ * ```typescript
646
+ * const result = await cms.contentEntries
647
+ * .query()
648
+ * .contentType("blog_post")
649
+ * .status("published")
650
+ * .limit(10)
651
+ * .execute(ctx);
652
+ *
653
+ * console.log(result.page); // Array of entries
654
+ * console.log(result.isDone); // true if no more results
655
+ * console.log(result.continueCursor); // Cursor for next page
656
+ * console.log(result.hasMore); // Convenience: !isDone
657
+ * ```
658
+ */
659
+ execute(ctx: ConvexContext): Promise<QueryBuilderResult<ContentEntry>>;
660
+ /**
661
+ * Execute the query and return only the first result.
662
+ *
663
+ * Convenience method that sets limit(1) and returns the first item or null.
664
+ *
665
+ * @param ctx - Convex query context
666
+ * @returns Promise resolving to the first entry or null
667
+ *
668
+ * @example
669
+ * ```typescript
670
+ * const latest = await cms.contentEntries
671
+ * .query()
672
+ * .contentType("blog_post")
673
+ * .status("published")
674
+ * .newestFirst()
675
+ * .first(ctx);
676
+ *
677
+ * if (latest) {
678
+ * console.log(latest.data.title);
679
+ * }
680
+ * ```
681
+ */
682
+ first(ctx: ConvexContext): Promise<ContentEntry | null>;
683
+ /**
684
+ * Execute the query and check if any results exist.
685
+ *
686
+ * Convenience method that sets limit(1) and returns boolean.
687
+ *
688
+ * @param ctx - Convex query context
689
+ * @returns Promise resolving to true if results exist
690
+ *
691
+ * @example
692
+ * ```typescript
693
+ * const hasPublished = await cms.contentEntries
694
+ * .query()
695
+ * .contentType("blog_post")
696
+ * .status("published")
697
+ * .exists(ctx);
698
+ *
699
+ * if (!hasPublished) {
700
+ * console.log("No published posts yet");
701
+ * }
702
+ * ```
703
+ */
704
+ exists(ctx: ConvexContext): Promise<boolean>;
705
+ /**
706
+ * Execute the query and collect all results into a single array.
707
+ *
708
+ * WARNING: This fetches ALL matching results, potentially making
709
+ * multiple paginated requests. Use with caution on large datasets.
710
+ *
711
+ * @param ctx - Convex query context
712
+ * @param maxPages - Maximum number of pages to fetch (default: 10)
713
+ * @returns Promise resolving to array of all entries
714
+ *
715
+ * @example
716
+ * ```typescript
717
+ * // Get all published posts (use with caution!)
718
+ * const allPosts = await cms.contentEntries
719
+ * .query()
720
+ * .contentType("blog_post")
721
+ * .status("published")
722
+ * .all(ctx);
723
+ * ```
724
+ */
725
+ all(ctx: ConvexContext, maxPages?: number): Promise<ContentEntry[]>;
726
+ /**
727
+ * Create a copy of this query builder with the current state.
728
+ *
729
+ * Useful for creating variations of a base query.
730
+ *
731
+ * @returns A new QueryBuilder with the same state
732
+ *
733
+ * @example
734
+ * ```typescript
735
+ * const baseQuery = cms.contentEntries
736
+ * .query()
737
+ * .contentType("blog_post");
738
+ *
739
+ * const published = await baseQuery.clone()
740
+ * .status("published")
741
+ * .execute(ctx);
742
+ *
743
+ * const drafts = await baseQuery.clone()
744
+ * .status("draft")
745
+ * .execute(ctx);
746
+ * ```
747
+ */
748
+ clone(): ContentQueryBuilder;
749
+ /**
750
+ * Reset the query builder to its initial state.
751
+ *
752
+ * @returns this for chaining
753
+ */
754
+ reset(): this;
755
+ }
756
+ /**
757
+ * Create a new content query builder.
758
+ *
759
+ * This is typically called internally by ContentEntriesApi.query().
760
+ *
761
+ * @param api - The typed component API
762
+ * @returns A new ContentQueryBuilder instance
763
+ */
764
+ export declare function createQueryBuilder(api: TypedComponentApi): ContentQueryBuilder;
765
+ //# sourceMappingURL=queryBuilder.d.ts.map