@gaganref/confect-server 0.0.0-stage → 10.3.1-fork.2

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 (367) hide show
  1. package/CHANGELOG.md +2119 -0
  2. package/LICENSE +7 -0
  3. package/README.md +16 -2
  4. package/dist/ActionCtx.d.ts +10 -0
  5. package/dist/ActionCtx.d.ts.map +1 -0
  6. package/dist/ActionCtx.js +18 -0
  7. package/dist/ActionCtx.js.map +1 -0
  8. package/dist/ActionRunner.d.ts +16 -0
  9. package/dist/ActionRunner.d.ts.map +1 -0
  10. package/dist/ActionRunner.js +18 -0
  11. package/dist/ActionRunner.js.map +1 -0
  12. package/dist/AiGatewayDecisionClient.d.ts +20 -0
  13. package/dist/AiGatewayDecisionClient.d.ts.map +1 -0
  14. package/dist/AiGatewayDecisionClient.js +31 -0
  15. package/dist/AiGatewayDecisionClient.js.map +1 -0
  16. package/dist/AiGatewayDecisionModel.d.ts +24 -0
  17. package/dist/AiGatewayDecisionModel.d.ts.map +1 -0
  18. package/dist/AiGatewayDecisionModel.js +27 -0
  19. package/dist/AiGatewayDecisionModel.js.map +1 -0
  20. package/dist/AiGatewayLanguageClient.d.ts +21 -0
  21. package/dist/AiGatewayLanguageClient.d.ts.map +1 -0
  22. package/dist/AiGatewayLanguageClient.js +32 -0
  23. package/dist/AiGatewayLanguageClient.js.map +1 -0
  24. package/dist/AiGatewayLanguageModel.d.ts +95 -0
  25. package/dist/AiGatewayLanguageModel.d.ts.map +1 -0
  26. package/dist/AiGatewayLanguageModel.js +42 -0
  27. package/dist/AiGatewayLanguageModel.js.map +1 -0
  28. package/dist/Auth.d.ts +20 -0
  29. package/dist/Auth.d.ts.map +1 -0
  30. package/dist/Auth.js +31 -0
  31. package/dist/Auth.js.map +1 -0
  32. package/dist/BlobNotFoundError.d.ts +9 -0
  33. package/dist/BlobNotFoundError.d.ts.map +1 -0
  34. package/dist/BlobNotFoundError.js +13 -0
  35. package/dist/BlobNotFoundError.js.map +1 -0
  36. package/dist/Callback.d.ts +31 -0
  37. package/dist/Callback.d.ts.map +1 -0
  38. package/dist/Callback.js +182 -0
  39. package/dist/Callback.js.map +1 -0
  40. package/dist/ComponentCtx.d.ts +71 -0
  41. package/dist/ComponentCtx.d.ts.map +1 -0
  42. package/dist/ComponentCtx.js +0 -0
  43. package/dist/ConvexConfigProvider.d.ts +21 -0
  44. package/dist/ConvexConfigProvider.d.ts.map +1 -0
  45. package/dist/ConvexConfigProvider.js +36 -0
  46. package/dist/ConvexConfigProvider.js.map +1 -0
  47. package/dist/ConvexFunctionDefinitions.d.ts +25 -0
  48. package/dist/ConvexFunctionDefinitions.d.ts.map +1 -0
  49. package/dist/ConvexFunctionDefinitions.js +25 -0
  50. package/dist/ConvexFunctionDefinitions.js.map +1 -0
  51. package/dist/ConvexLogger.d.ts +17 -0
  52. package/dist/ConvexLogger.d.ts.map +1 -0
  53. package/dist/ConvexLogger.js +33 -0
  54. package/dist/ConvexLogger.js.map +1 -0
  55. package/dist/CronJob.d.ts +14 -0
  56. package/dist/CronJob.d.ts.map +1 -0
  57. package/dist/CronJob.js +22 -0
  58. package/dist/CronJob.js.map +1 -0
  59. package/dist/CronJobs.d.ts +22 -0
  60. package/dist/CronJobs.d.ts.map +1 -0
  61. package/dist/CronJobs.js +83 -0
  62. package/dist/CronJobs.js.map +1 -0
  63. package/dist/DataModel.d.ts +28 -0
  64. package/dist/DataModel.d.ts.map +1 -0
  65. package/dist/DataModel.js +7 -0
  66. package/dist/DataModel.js.map +1 -0
  67. package/dist/DatabaseReader.d.ts +26 -0
  68. package/dist/DatabaseReader.d.ts.map +1 -0
  69. package/dist/DatabaseReader.js +33 -0
  70. package/dist/DatabaseReader.js.map +1 -0
  71. package/dist/DatabaseSchema.d.ts +67 -0
  72. package/dist/DatabaseSchema.d.ts.map +1 -0
  73. package/dist/DatabaseSchema.js +61 -0
  74. package/dist/DatabaseSchema.js.map +1 -0
  75. package/dist/DatabaseWriter.d.ts +44 -0
  76. package/dist/DatabaseWriter.d.ts.map +1 -0
  77. package/dist/DatabaseWriter.js +47 -0
  78. package/dist/DatabaseWriter.js.map +1 -0
  79. package/dist/Document.d.ts +37 -0
  80. package/dist/Document.d.ts.map +1 -0
  81. package/dist/Document.js +54 -0
  82. package/dist/Document.js.map +1 -0
  83. package/dist/ExecutionMetadata.d.ts +13 -0
  84. package/dist/ExecutionMetadata.d.ts.map +1 -0
  85. package/dist/ExecutionMetadata.js +19 -0
  86. package/dist/ExecutionMetadata.js.map +1 -0
  87. package/dist/FunctionImpl.d.ts +39 -0
  88. package/dist/FunctionImpl.d.ts.map +1 -0
  89. package/dist/FunctionImpl.js +46 -0
  90. package/dist/FunctionImpl.js.map +1 -0
  91. package/dist/FunctionRegistryItem.d.ts +36 -0
  92. package/dist/FunctionRegistryItem.d.ts.map +1 -0
  93. package/dist/FunctionRegistryItem.js +34 -0
  94. package/dist/FunctionRegistryItem.js.map +1 -0
  95. package/dist/GroupImpl.d.ts +77 -0
  96. package/dist/GroupImpl.d.ts.map +1 -0
  97. package/dist/GroupImpl.js +81 -0
  98. package/dist/GroupImpl.js.map +1 -0
  99. package/dist/GroupRegistry.d.ts +8 -0
  100. package/dist/GroupRegistry.d.ts.map +1 -0
  101. package/dist/GroupRegistry.js +26 -0
  102. package/dist/GroupRegistry.js.map +1 -0
  103. package/dist/Handler.d.ts +47 -0
  104. package/dist/Handler.d.ts.map +1 -0
  105. package/dist/Handler.js +7 -0
  106. package/dist/Handler.js.map +1 -0
  107. package/dist/HttpRouter.d.ts +80 -0
  108. package/dist/HttpRouter.d.ts.map +1 -0
  109. package/dist/HttpRouter.js +195 -0
  110. package/dist/HttpRouter.js.map +1 -0
  111. package/dist/MiddlewareImpl.d.ts +79 -0
  112. package/dist/MiddlewareImpl.d.ts.map +1 -0
  113. package/dist/MiddlewareImpl.js +58 -0
  114. package/dist/MiddlewareImpl.js.map +1 -0
  115. package/dist/MiddlewareRegistryItem.d.ts +12 -0
  116. package/dist/MiddlewareRegistryItem.d.ts.map +1 -0
  117. package/dist/MiddlewareRegistryItem.js +15 -0
  118. package/dist/MiddlewareRegistryItem.js.map +1 -0
  119. package/dist/MutationCtx.d.ts +10 -0
  120. package/dist/MutationCtx.d.ts.map +1 -0
  121. package/dist/MutationCtx.js +18 -0
  122. package/dist/MutationCtx.js.map +1 -0
  123. package/dist/MutationRunner.d.ts +27 -0
  124. package/dist/MutationRunner.d.ts.map +1 -0
  125. package/dist/MutationRunner.js +28 -0
  126. package/dist/MutationRunner.js.map +1 -0
  127. package/dist/MutationTransactionContext.d.ts +17 -0
  128. package/dist/MutationTransactionContext.d.ts.map +1 -0
  129. package/dist/MutationTransactionContext.js +20 -0
  130. package/dist/MutationTransactionContext.js.map +1 -0
  131. package/dist/OrderedQuery.d.ts +32 -0
  132. package/dist/OrderedQuery.d.ts.map +1 -0
  133. package/dist/OrderedQuery.js +36 -0
  134. package/dist/OrderedQuery.js.map +1 -0
  135. package/dist/QueryCtx.d.ts +10 -0
  136. package/dist/QueryCtx.d.ts.map +1 -0
  137. package/dist/QueryCtx.js +18 -0
  138. package/dist/QueryCtx.js.map +1 -0
  139. package/dist/QueryInitializer.d.ts +75 -0
  140. package/dist/QueryInitializer.d.ts.map +1 -0
  141. package/dist/QueryInitializer.js +105 -0
  142. package/dist/QueryInitializer.js.map +1 -0
  143. package/dist/QueryRunner.d.ts +46 -0
  144. package/dist/QueryRunner.d.ts.map +1 -0
  145. package/dist/QueryRunner.js +30 -0
  146. package/dist/QueryRunner.js.map +1 -0
  147. package/dist/QueryStream.d.ts +678 -0
  148. package/dist/QueryStream.d.ts.map +1 -0
  149. package/dist/QueryStream.js +943 -0
  150. package/dist/QueryStream.js.map +1 -0
  151. package/dist/QueryStreamCursor.d.ts +39 -0
  152. package/dist/QueryStreamCursor.d.ts.map +1 -0
  153. package/dist/QueryStreamCursor.js +52 -0
  154. package/dist/QueryStreamCursor.js.map +1 -0
  155. package/dist/QueryStreamIndexPrefix.d.ts +48 -0
  156. package/dist/QueryStreamIndexPrefix.d.ts.map +1 -0
  157. package/dist/QueryStreamIndexPrefix.js +38 -0
  158. package/dist/QueryStreamIndexPrefix.js.map +1 -0
  159. package/dist/QueryStreamIndexRange.d.ts +193 -0
  160. package/dist/QueryStreamIndexRange.d.ts.map +1 -0
  161. package/dist/QueryStreamIndexRange.js +241 -0
  162. package/dist/QueryStreamIndexRange.js.map +1 -0
  163. package/dist/QueryStreamKey.d.ts +64 -0
  164. package/dist/QueryStreamKey.d.ts.map +1 -0
  165. package/dist/QueryStreamKey.js +69 -0
  166. package/dist/QueryStreamKey.js.map +1 -0
  167. package/dist/QueryStreamKeyBounds.d.ts +136 -0
  168. package/dist/QueryStreamKeyBounds.d.ts.map +1 -0
  169. package/dist/QueryStreamKeyBounds.js +208 -0
  170. package/dist/QueryStreamKeyBounds.js.map +1 -0
  171. package/dist/QueryStreamKeyLabels.d.ts +27 -0
  172. package/dist/QueryStreamKeyLabels.d.ts.map +1 -0
  173. package/dist/QueryStreamKeyLabels.js +22 -0
  174. package/dist/QueryStreamKeyLabels.js.map +1 -0
  175. package/dist/QueryStreamKeyLayout.d.ts +179 -0
  176. package/dist/QueryStreamKeyLayout.d.ts.map +1 -0
  177. package/dist/QueryStreamKeyLayout.js +167 -0
  178. package/dist/QueryStreamKeyLayout.js.map +1 -0
  179. package/dist/QueryStreamKeyValues.d.ts +40 -0
  180. package/dist/QueryStreamKeyValues.d.ts.map +1 -0
  181. package/dist/QueryStreamKeyValues.js +57 -0
  182. package/dist/QueryStreamKeyValues.js.map +1 -0
  183. package/dist/QueryStreamOrderDirection.d.ts +24 -0
  184. package/dist/QueryStreamOrderDirection.d.ts.map +1 -0
  185. package/dist/QueryStreamOrderDirection.js +11 -0
  186. package/dist/QueryStreamOrderDirection.js.map +1 -0
  187. package/dist/QueryStreamPagination.d.ts +264 -0
  188. package/dist/QueryStreamPagination.d.ts.map +1 -0
  189. package/dist/QueryStreamPagination.js +172 -0
  190. package/dist/QueryStreamPagination.js.map +1 -0
  191. package/dist/QueryStreamReadBudget.d.ts +63 -0
  192. package/dist/QueryStreamReadBudget.d.ts.map +1 -0
  193. package/dist/QueryStreamReadBudget.js +81 -0
  194. package/dist/QueryStreamReadBudget.js.map +1 -0
  195. package/dist/QueryTransactionContext.d.ts +16 -0
  196. package/dist/QueryTransactionContext.d.ts.map +1 -0
  197. package/dist/QueryTransactionContext.js +17 -0
  198. package/dist/QueryTransactionContext.js.map +1 -0
  199. package/dist/RegisteredConvexFunction.d.ts +359 -0
  200. package/dist/RegisteredConvexFunction.d.ts.map +1 -0
  201. package/dist/RegisteredConvexFunction.js +154 -0
  202. package/dist/RegisteredConvexFunction.js.map +1 -0
  203. package/dist/RegisteredFunction.d.ts +143 -0
  204. package/dist/RegisteredFunction.d.ts.map +1 -0
  205. package/dist/RegisteredFunction.js +125 -0
  206. package/dist/RegisteredFunction.js.map +1 -0
  207. package/dist/RegisteredFunctions.d.ts +57 -0
  208. package/dist/RegisteredFunctions.d.ts.map +1 -0
  209. package/dist/RegisteredFunctions.js +32 -0
  210. package/dist/RegisteredFunctions.js.map +1 -0
  211. package/dist/RegisteredNodeFunction.d.ts +11 -0
  212. package/dist/RegisteredNodeFunction.d.ts.map +1 -0
  213. package/dist/RegisteredNodeFunction.js +45 -0
  214. package/dist/RegisteredNodeFunction.js.map +1 -0
  215. package/dist/Registry.d.ts +12 -0
  216. package/dist/Registry.d.ts.map +1 -0
  217. package/dist/Registry.js +17 -0
  218. package/dist/Registry.js.map +1 -0
  219. package/dist/RegistryItems.d.ts +21 -0
  220. package/dist/RegistryItems.d.ts.map +1 -0
  221. package/dist/RegistryItems.js +27 -0
  222. package/dist/RegistryItems.js.map +1 -0
  223. package/dist/RequestMetadata.d.ts +12 -0
  224. package/dist/RequestMetadata.d.ts.map +1 -0
  225. package/dist/RequestMetadata.js +16 -0
  226. package/dist/RequestMetadata.js.map +1 -0
  227. package/dist/ResolvedMiddleware.d.ts +24 -0
  228. package/dist/ResolvedMiddleware.d.ts.map +1 -0
  229. package/dist/ResolvedMiddleware.js +34 -0
  230. package/dist/ResolvedMiddleware.js.map +1 -0
  231. package/dist/Scheduler.d.ts +31 -0
  232. package/dist/Scheduler.d.ts.map +1 -0
  233. package/dist/Scheduler.js +35 -0
  234. package/dist/Scheduler.js.map +1 -0
  235. package/dist/Storage.d.ts +22 -0
  236. package/dist/Storage.d.ts.map +1 -0
  237. package/dist/Storage.js +27 -0
  238. package/dist/Storage.js.map +1 -0
  239. package/dist/StorageActionWriter.d.ts +35 -0
  240. package/dist/StorageActionWriter.d.ts.map +1 -0
  241. package/dist/StorageActionWriter.js +24 -0
  242. package/dist/StorageActionWriter.js.map +1 -0
  243. package/dist/StorageReader.d.ts +26 -0
  244. package/dist/StorageReader.d.ts.map +1 -0
  245. package/dist/StorageReader.js +22 -0
  246. package/dist/StorageReader.js.map +1 -0
  247. package/dist/StorageWriter.d.ts +29 -0
  248. package/dist/StorageWriter.d.ts.map +1 -0
  249. package/dist/StorageWriter.js +24 -0
  250. package/dist/StorageWriter.js.map +1 -0
  251. package/dist/Table.d.ts +274 -0
  252. package/dist/Table.d.ts.map +1 -0
  253. package/dist/Table.js +70 -0
  254. package/dist/Table.js.map +1 -0
  255. package/dist/TableInfo.d.ts +44 -0
  256. package/dist/TableInfo.d.ts.map +1 -0
  257. package/dist/TableInfo.js +7 -0
  258. package/dist/TableInfo.js.map +1 -0
  259. package/dist/TransactionMetadata.d.ts +12 -0
  260. package/dist/TransactionMetadata.d.ts.map +1 -0
  261. package/dist/TransactionMetadata.js +16 -0
  262. package/dist/TransactionMetadata.js.map +1 -0
  263. package/dist/VectorSearch.d.ts +23 -0
  264. package/dist/VectorSearch.d.ts.map +1 -0
  265. package/dist/VectorSearch.js +17 -0
  266. package/dist/VectorSearch.js.map +1 -0
  267. package/dist/_virtual/_rolldown/runtime.js +13 -0
  268. package/dist/index.d.ts +88 -0
  269. package/dist/index.d.ts.map +1 -0
  270. package/dist/index.js +61 -0
  271. package/dist/internal/AiGatewayDecisionClient.d.ts +7 -0
  272. package/dist/internal/AiGatewayDecisionClient.d.ts.map +1 -0
  273. package/dist/internal/AiGatewayDecisionClient.js +19 -0
  274. package/dist/internal/AiGatewayDecisionClient.js.map +1 -0
  275. package/dist/internal/AiGatewayLanguageClient.d.ts +7 -0
  276. package/dist/internal/AiGatewayLanguageClient.d.ts.map +1 -0
  277. package/dist/internal/AiGatewayLanguageClient.js +19 -0
  278. package/dist/internal/AiGatewayLanguageClient.js.map +1 -0
  279. package/dist/internal/AiGatewayServiceToken.d.ts +46 -0
  280. package/dist/internal/AiGatewayServiceToken.d.ts.map +1 -0
  281. package/dist/internal/AiGatewayServiceToken.js +62 -0
  282. package/dist/internal/AiGatewayServiceToken.js.map +1 -0
  283. package/dist/internal/constants.d.ts +2 -0
  284. package/dist/internal/constants.d.ts.map +1 -0
  285. package/dist/internal/constants.js +6 -0
  286. package/dist/internal/constants.js.map +1 -0
  287. package/dist/internal/utils.d.ts +13 -0
  288. package/dist/internal/utils.d.ts.map +1 -0
  289. package/dist/internal/utils.js +50 -0
  290. package/dist/internal/utils.js.map +1 -0
  291. package/dist/node.d.ts +2 -0
  292. package/dist/node.d.ts.map +1 -0
  293. package/dist/node.js +1 -0
  294. package/package.json +68 -3
  295. package/src/ActionCtx.ts +45 -0
  296. package/src/ActionRunner.ts +36 -0
  297. package/src/AiGatewayDecisionClient.ts +40 -0
  298. package/src/AiGatewayDecisionModel.ts +46 -0
  299. package/src/AiGatewayLanguageClient.ts +41 -0
  300. package/src/AiGatewayLanguageModel.ts +61 -0
  301. package/src/Auth.ts +51 -0
  302. package/src/BlobNotFoundError.ts +12 -0
  303. package/src/Callback.ts +313 -0
  304. package/src/ComponentCtx.ts +192 -0
  305. package/src/ConvexConfigProvider.ts +39 -0
  306. package/src/ConvexFunctionDefinitions.ts +91 -0
  307. package/src/ConvexLogger.ts +43 -0
  308. package/src/CronJob.ts +42 -0
  309. package/src/CronJobs.ts +165 -0
  310. package/src/DataModel.ts +81 -0
  311. package/src/DatabaseReader.ts +118 -0
  312. package/src/DatabaseSchema.ts +139 -0
  313. package/src/DatabaseWriter.ts +232 -0
  314. package/src/Document.ts +146 -0
  315. package/src/ExecutionMetadata.ts +26 -0
  316. package/src/FunctionImpl.ts +96 -0
  317. package/src/FunctionRegistryItem.ts +85 -0
  318. package/src/GroupImpl.ts +167 -0
  319. package/src/GroupRegistry.ts +41 -0
  320. package/src/Handler.ts +191 -0
  321. package/src/HttpRouter.ts +388 -0
  322. package/src/MiddlewareImpl.ts +247 -0
  323. package/src/MiddlewareRegistryItem.ts +21 -0
  324. package/src/MutationCtx.ts +45 -0
  325. package/src/MutationRunner.ts +66 -0
  326. package/src/MutationTransactionContext.ts +48 -0
  327. package/src/OrderedQuery.ts +136 -0
  328. package/src/QueryCtx.ts +45 -0
  329. package/src/QueryInitializer.ts +537 -0
  330. package/src/QueryRunner.ts +91 -0
  331. package/src/QueryStream.ts +2476 -0
  332. package/src/QueryStreamCursor.ts +99 -0
  333. package/src/QueryStreamIndexPrefix.ts +79 -0
  334. package/src/QueryStreamIndexRange.ts +489 -0
  335. package/src/QueryStreamKey.ts +118 -0
  336. package/src/QueryStreamKeyBounds.ts +395 -0
  337. package/src/QueryStreamKeyLabels.ts +56 -0
  338. package/src/QueryStreamKeyLayout.ts +382 -0
  339. package/src/QueryStreamKeyValues.ts +112 -0
  340. package/src/QueryStreamOrderDirection.ts +29 -0
  341. package/src/QueryStreamPagination.ts +357 -0
  342. package/src/QueryStreamReadBudget.ts +167 -0
  343. package/src/QueryTransactionContext.ts +37 -0
  344. package/src/RegisteredConvexFunction.ts +415 -0
  345. package/src/RegisteredFunction.ts +391 -0
  346. package/src/RegisteredFunctions.ts +88 -0
  347. package/src/RegisteredNodeFunction.ts +120 -0
  348. package/src/Registry.ts +17 -0
  349. package/src/RegistryItems.ts +40 -0
  350. package/src/RequestMetadata.ts +20 -0
  351. package/src/ResolvedMiddleware.ts +70 -0
  352. package/src/Scheduler.ts +85 -0
  353. package/src/Storage.ts +37 -0
  354. package/src/StorageActionWriter.ts +59 -0
  355. package/src/StorageReader.ts +59 -0
  356. package/src/StorageWriter.ts +58 -0
  357. package/src/Table.ts +156 -0
  358. package/src/TableInfo.ts +106 -0
  359. package/src/TransactionMetadata.ts +20 -0
  360. package/src/VectorSearch.ts +75 -0
  361. package/src/index.ts +87 -0
  362. package/src/internal/AiGatewayDecisionClient.ts +16 -0
  363. package/src/internal/AiGatewayLanguageClient.ts +16 -0
  364. package/src/internal/AiGatewayServiceToken.ts +129 -0
  365. package/src/internal/constants.ts +1 -0
  366. package/src/internal/utils.ts +89 -0
  367. package/src/node.ts +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Document.js","names":[],"sources":["../src/Document.ts"],"sourcesContent":["import type { ReadonlyValue } from \"@confect/core/SchemaToValidator\";\nimport { pipe } from \"effect/Function\";\nimport * as Effect from \"effect/Effect\";\nimport * as Function from \"effect/Function\";\nimport * as Schema from \"effect/Schema\";\nimport type { ReadonlyRecord } from \"effect/Record\";\nimport type * as DatabaseSchema from \"./DatabaseSchema\";\nimport type * as DataModel from \"./DataModel\";\nimport type * as TableInfo from \"./TableInfo\";\nimport type * as Table from \"./Table\";\n\nexport type Document<\n Schema_ extends DatabaseSchema.AnyWithProps,\n TableName extends DatabaseSchema.TableNames<Schema_>,\n> = DataModel.DocumentByName<DataModel.FromSchema<Schema_>, TableName>;\n\nexport type WithoutSystemFields<Doc> = Doc extends unknown\n ? Omit<Doc, \"_creationTime\" | \"_id\">\n : never;\n\nexport type Any = any;\nexport type AnyEncoded = ReadonlyRecord<string, ReadonlyValue>;\n\nexport const decode = Function.dual<\n <Table_ extends Table.AnyWithProps>(\n table: Table_,\n ) => (\n self: TableInfo.TableInfo<Table_>[\"convexDocument\"],\n ) => Effect.Effect<\n TableInfo.TableInfo<Table_>[\"document\"],\n DocumentDecodeError\n >,\n <Table_ extends Table.AnyWithProps>(\n self: TableInfo.TableInfo<Table_>[\"convexDocument\"],\n table: Table_,\n ) => Effect.Effect<\n TableInfo.TableInfo<Table_>[\"document\"],\n DocumentDecodeError\n >\n>(\n 2,\n <Table_ extends Table.AnyWithProps>(\n self: TableInfo.TableInfo<Table_>[\"convexDocument\"],\n table: Table_,\n ): Effect.Effect<\n TableInfo.TableInfo<Table_>[\"document\"],\n DocumentDecodeError\n > =>\n pipe(\n self,\n Schema.decodeUnknownEffect(table.Doc),\n Effect.catchIf(Schema.isSchemaError, (schemaError) =>\n Effect.fail(\n new DocumentDecodeError({\n tableName: table.tableName,\n id: self._id,\n parseError: schemaError.message,\n }),\n ),\n ),\n ),\n);\n\nexport const encode = Function.dual<\n <Table_ extends Table.AnyWithProps>(\n table: Table_,\n ) => (\n self: Schema.Schema.Type<Table.Fields<Table_>>,\n ) => Effect.Effect<\n Schema.Codec.Encoded<Table.Fields<Table_>>,\n DocumentEncodeError\n >,\n <Table_ extends Table.AnyWithProps>(\n self: Schema.Schema.Type<Table.Fields<Table_>>,\n table: Table_,\n ) => Effect.Effect<\n Schema.Codec.Encoded<Table.Fields<Table_>>,\n DocumentEncodeError\n >\n>(\n 2,\n <Table_ extends Table.AnyWithProps>(\n self: Schema.Schema.Type<Table.Fields<Table_>>,\n table: Table_,\n ): Effect.Effect<\n Schema.Codec.Encoded<Table.Fields<Table_>>,\n DocumentEncodeError\n > =>\n pipe(\n self,\n Schema.encodeEffect(table.Fields),\n Effect.catchIf(Schema.isSchemaError, (schemaError) =>\n Effect.fail(\n new DocumentEncodeError({\n tableName: table.tableName,\n id: self._id,\n parseError: schemaError.message,\n }),\n ),\n ),\n ),\n);\n\nexport class DocumentDecodeError extends Schema.TaggedError<DocumentDecodeError>()(\n \"DocumentDecodeError\",\n {\n tableName: Schema.String,\n id: Schema.String,\n parseError: Schema.String,\n },\n) {\n override get message(): string {\n return documentErrorMessage({\n id: this.id,\n tableName: this.tableName,\n message: `could not be decoded:\\n\\n${this.parseError}`,\n });\n }\n}\n\nexport class DocumentEncodeError extends Schema.TaggedError<DocumentEncodeError>()(\n \"DocumentEncodeError\",\n {\n tableName: Schema.String,\n id: Schema.String,\n parseError: Schema.String,\n },\n) {\n override get message(): string {\n return documentErrorMessage({\n id: this.id,\n tableName: this.tableName,\n message: `could not be encoded:\\n\\n${this.parseError}`,\n });\n }\n}\n\nexport const documentErrorMessage = ({\n id,\n tableName,\n message,\n}: {\n id: string;\n tableName: string;\n message: string;\n}) => `Document with ID '${id}' in table '${tableName}' ${message}`;\n"],"mappings":";;;;;;;;;;;;;AAuBA,MAAa,SAAS,SAAS,KAiB7B,IAEE,MACA,UAKA,KACE,MACA,OAAO,oBAAoB,MAAM,GAAG,GACpC,OAAO,QAAQ,OAAO,gBAAgB,gBACpC,OAAO,KACL,IAAI,oBAAoB;CACtB,WAAW,MAAM;CACjB,IAAI,KAAK;CACT,YAAY,YAAY;AAC1B,CAAC,CACH,CACF,CACF,CACJ;AAEA,MAAa,SAAS,SAAS,KAiB7B,IAEE,MACA,UAKA,KACE,MACA,OAAO,aAAa,MAAM,MAAM,GAChC,OAAO,QAAQ,OAAO,gBAAgB,gBACpC,OAAO,KACL,IAAI,oBAAoB;CACtB,WAAW,MAAM;CACjB,IAAI,KAAK;CACT,YAAY,YAAY;AAC1B,CAAC,CACH,CACF,CACF,CACJ;AAEA,IAAa,sBAAb,cAAyC,OAAO,YAAiC,CAAC,CAChF,uBACA;CACE,WAAW,OAAO;CAClB,IAAI,OAAO;CACX,YAAY,OAAO;AACrB,CACF,CAAC,CAAC;CACA,IAAa,UAAkB;EAC7B,OAAO,qBAAqB;GAC1B,IAAI,KAAK;GACT,WAAW,KAAK;GAChB,SAAS,4BAA4B,KAAK;EAC5C,CAAC;CACH;AACF;AAEA,IAAa,sBAAb,cAAyC,OAAO,YAAiC,CAAC,CAChF,uBACA;CACE,WAAW,OAAO;CAClB,IAAI,OAAO;CACX,YAAY,OAAO;AACrB,CACF,CAAC,CAAC;CACA,IAAa,UAAkB;EAC7B,OAAO,qBAAqB;GAC1B,IAAI,KAAK;GACT,WAAW,KAAK;GAChB,SAAS,4BAA4B,KAAK;EAC5C,CAAC;CACH;AACF;AAEA,MAAa,wBAAwB,EACnC,IACA,WACA,cAKI,qBAAqB,GAAG,cAAc,UAAU,IAAI"}
@@ -0,0 +1,13 @@
1
+ import type { QueryMeta } from "convex/server";
2
+ import * as Context from "effect/Context";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Layer from "effect/Layer";
5
+ export type { DeploymentMetadata, FunctionMetadata } from "convex/server";
6
+ declare const ExecutionMetadata_base: Context.ServiceClass<ExecutionMetadata, "@confect/server/ExecutionMetadata", {
7
+ getFunction: () => Effect.Effect<import("convex/server").FunctionMetadata, never, never>;
8
+ getDeployment: () => Effect.Effect<import("convex/server").DeploymentMetadata, never, never>;
9
+ }>;
10
+ export declare class ExecutionMetadata extends ExecutionMetadata_base {
11
+ }
12
+ export declare const layer: (meta: Pick<QueryMeta, "getFunctionMetadata" | "getDeploymentMetadata">) => Layer.Layer<ExecutionMetadata, never, never>;
13
+ //# sourceMappingURL=ExecutionMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecutionMetadata.d.ts","sourceRoot":"","sources":["../src/ExecutionMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;;;;;AAa1E,qBAAa,iBAAkB,SAAQ,sBAGC;CAAG;AAE3C,eAAO,MAAM,KAAK,SACV,IAAI,CAAC,SAAS,EAAE,qBAAqB,GAAG,uBAAuB,CAAC,iDACvB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
+ import * as Context from "effect/Context";
3
+ import * as Layer from "effect/Layer";
4
+ import * as Effect from "effect/Effect";
5
+ //#region src/ExecutionMetadata.ts
6
+ var ExecutionMetadata_exports = /* @__PURE__ */ __exportAll({
7
+ ExecutionMetadata: () => ExecutionMetadata,
8
+ layer: () => layer
9
+ });
10
+ const make = (meta) => ({
11
+ getFunction: Effect.fn("ExecutionMetadata.getFunction")(() => Effect.promise(() => meta.getFunctionMetadata())),
12
+ getDeployment: Effect.fn("ExecutionMetadata.getDeployment")(() => Effect.promise(() => meta.getDeploymentMetadata()))
13
+ });
14
+ var ExecutionMetadata = class extends Context.Service()("@confect/server/ExecutionMetadata") {};
15
+ const layer = (meta) => Layer.succeed(ExecutionMetadata, make(meta));
16
+ //#endregion
17
+ export { ExecutionMetadata, ExecutionMetadata_exports, layer };
18
+
19
+ //# sourceMappingURL=ExecutionMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecutionMetadata.js","names":[],"sources":["../src/ExecutionMetadata.ts"],"sourcesContent":["import type { QueryMeta } from \"convex/server\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\n\nexport type { DeploymentMetadata, FunctionMetadata } from \"convex/server\";\n\nconst make = (\n meta: Pick<QueryMeta, \"getFunctionMetadata\" | \"getDeploymentMetadata\">,\n) => ({\n getFunction: Effect.fn(\"ExecutionMetadata.getFunction\")(() =>\n Effect.promise(() => meta.getFunctionMetadata()),\n ),\n getDeployment: Effect.fn(\"ExecutionMetadata.getDeployment\")(() =>\n Effect.promise(() => meta.getDeploymentMetadata()),\n ),\n});\n\nexport class ExecutionMetadata extends Context.Service<\n ExecutionMetadata,\n ReturnType<typeof make>\n>()(\"@confect/server/ExecutionMetadata\") {}\n\nexport const layer = (\n meta: Pick<QueryMeta, \"getFunctionMetadata\" | \"getDeploymentMetadata\">,\n) => Layer.succeed(ExecutionMetadata, make(meta));\n"],"mappings":";;;;;;;;;AAOA,MAAM,QACJ,UACI;CACJ,aAAa,OAAO,GAAG,+BAA+B,CAAC,OACrD,OAAO,cAAc,KAAK,oBAAoB,CAAC,CACjD;CACA,eAAe,OAAO,GAAG,iCAAiC,CAAC,OACzD,OAAO,cAAc,KAAK,sBAAsB,CAAC,CACnD;AACF;AAEA,IAAa,oBAAb,cAAuC,QAAQ,QAG7C,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC;AAE1C,MAAa,SACX,SACG,MAAM,QAAQ,mBAAmB,KAAK,IAAI,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type * as FunctionSpec from "@confect/core/FunctionSpec";
2
+ import type * as GroupSpec from "@confect/core/GroupSpec";
3
+ import type * as MiddlewareSpec from "@confect/core/MiddlewareSpec";
4
+ import * as Context from "effect/Context";
5
+ import * as Layer from "effect/Layer";
6
+ import type * as DatabaseSchema from "./DatabaseSchema";
7
+ import type * as Handler from "./Handler";
8
+ export interface FunctionImpl<Name_ extends string> {
9
+ readonly name: Name_;
10
+ }
11
+ export declare const FunctionImpl: <Name_ extends string>({ name }: {
12
+ name: Name_;
13
+ }) => Context.Service<FunctionImpl<Name_>, FunctionImpl<Name_>>;
14
+ /**
15
+ * Register a single function's implementation into the group's `Registry`.
16
+ *
17
+ * The function is registered under a flat, single-segment key (its own `name`),
18
+ * not a project-wide dot-path. Each group's impl layer is built in
19
+ * isolation—`RegisteredFunctions.buildForGroup` (and the CLI's `validateImpl`)
20
+ * provide a fresh `Registry` per group—so function names only need to be unique
21
+ * within their own group.
22
+ *
23
+ * `databaseSchema` is retained purely as a type-level carrier: the handler's
24
+ * ctx-service requirements (`DatabaseReader`, `QueryCtx<DataModel>`, …) are
25
+ * derived from it via `Handler.WithName`. It is not read at runtime—the
26
+ * generated per-group registry forwards the schema value to the function
27
+ * builders—so impls depend on `_generated/schema` (table schemas) rather than
28
+ * `_generated/api` (which transitively imports every function spec).
29
+ */
30
+ export declare const make: <DatabaseSchema_ extends DatabaseSchema.AnyWithProps, Group extends GroupSpec.AnyWithProps, const Name_ extends FunctionSpec.Name<GroupSpec.Functions<Group>>>(_databaseSchema: DatabaseSchema_, group: Group, name: Name_, handler: Handler.WithName<DatabaseSchema_, GroupSpec.Functions<Group>, Name_, MiddlewareSpec.Provides<GroupSpec.MiddlewareSpecs<Group> | FunctionSpec.MiddlewareSpecs<FunctionSpec.WithName<GroupSpec.Functions<Group>, Name_>>>>) => Layer.Layer<FunctionImpl<Name_>>;
31
+ /**
32
+ * Get the function implementation service type for a specific function name.
33
+ */
34
+ export type ForFunction<Name_ extends string> = FunctionImpl<Name_>;
35
+ /**
36
+ * Get all function implementation services required for a group spec.
37
+ */
38
+ export type FromGroupSpec<Group extends GroupSpec.AnyWithProps> = FunctionSpec.Name<GroupSpec.Functions<Group>> extends infer FunctionNames extends string ? FunctionNames extends string ? FunctionImpl<FunctionNames> : never : never;
39
+ //# sourceMappingURL=FunctionImpl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FunctionImpl.d.ts","sourceRoot":"","sources":["../src/FunctionImpl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,YAAY,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,KAAK,SAAS,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,KAAK,cAAc,MAAM,8BAA8B,CAAC;AAEpE,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,KAAK,OAAO,MAAM,WAAW,CAAC;AAI1C,MAAM,WAAW,YAAY,CAAC,KAAK,SAAS,MAAM;IAChD,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,GAAI,KAAK,SAAS,MAAM,YAAY;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,8DACE,CAAC;AAE/E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,IAAI,GACf,eAAe,SAAS,cAAc,CAAC,YAAY,EACnD,KAAK,SAAS,SAAS,CAAC,YAAY,EACpC,KAAK,CAAC,KAAK,SAAS,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,mBAEhD,eAAe,SACzB,KAAK,QACN,KAAK,WACF,OAAO,CAAC,QAAQ,CACvB,eAAe,EACf,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,EAC1B,KAAK,EACL,cAAc,CAAC,QAAQ,CACnB,SAAS,CAAC,eAAe,CAAC,KAAK,CAAC,GAChC,YAAY,CAAC,eAAe,CAC1B,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CACzD,CACJ,CACF,KACA,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAuBjC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,MAAM,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,KAAK,SAAS,SAAS,CAAC,YAAY,IAC5D,YAAY,CAAC,IAAI,CACf,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAC3B,SAAS,MAAM,aAAa,SAAS,MAAM,GACxC,aAAa,SAAS,MAAM,GAC1B,YAAY,CAAC,aAAa,CAAC,GAC3B,KAAK,GACP,KAAK,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
+ import { Registry } from "./Registry.js";
3
+ import { make as make$1 } from "./FunctionRegistryItem.js";
4
+ import { setNestedProperty } from "./internal/utils.js";
5
+ import * as Context from "effect/Context";
6
+ import * as Layer from "effect/Layer";
7
+ import * as Effect from "effect/Effect";
8
+ import * as Ref from "effect/Ref";
9
+ //#region src/FunctionImpl.ts
10
+ var FunctionImpl_exports = /* @__PURE__ */ __exportAll({
11
+ FunctionImpl: () => FunctionImpl,
12
+ make: () => make
13
+ });
14
+ const FunctionImpl = ({ name }) => Context.Service(`@confect/server/FunctionImpl/${name}`);
15
+ /**
16
+ * Register a single function's implementation into the group's `Registry`.
17
+ *
18
+ * The function is registered under a flat, single-segment key (its own `name`),
19
+ * not a project-wide dot-path. Each group's impl layer is built in
20
+ * isolation—`RegisteredFunctions.buildForGroup` (and the CLI's `validateImpl`)
21
+ * provide a fresh `Registry` per group—so function names only need to be unique
22
+ * within their own group.
23
+ *
24
+ * `databaseSchema` is retained purely as a type-level carrier: the handler's
25
+ * ctx-service requirements (`DatabaseReader`, `QueryCtx<DataModel>`, …) are
26
+ * derived from it via `Handler.WithName`. It is not read at runtime—the
27
+ * generated per-group registry forwards the schema value to the function
28
+ * builders—so impls depend on `_generated/schema` (table schemas) rather than
29
+ * `_generated/api` (which transitively imports every function spec).
30
+ */
31
+ const make = (_databaseSchema, group, name, handler) => {
32
+ const functionSpec = group.functions[name];
33
+ return Layer.effect(FunctionImpl({ name }), Effect.gen(function* () {
34
+ const registry = yield* Registry;
35
+ yield* Ref.update(registry, (registryItems) => setNestedProperty(registryItems, [name], make$1({
36
+ functionSpec,
37
+ groupMiddlewareAttachments: group.middlewareAttachments,
38
+ handler
39
+ })));
40
+ return { name };
41
+ }));
42
+ };
43
+ //#endregion
44
+ export { FunctionImpl, FunctionImpl_exports, make };
45
+
46
+ //# sourceMappingURL=FunctionImpl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FunctionImpl.js","names":["Registry.Registry","FunctionRegistryItem.make"],"sources":["../src/FunctionImpl.ts"],"sourcesContent":["import type * as FunctionSpec from \"@confect/core/FunctionSpec\";\nimport type * as GroupSpec from \"@confect/core/GroupSpec\";\nimport type * as MiddlewareSpec from \"@confect/core/MiddlewareSpec\";\nimport * as Registry from \"./Registry\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Ref from \"effect/Ref\";\nimport type * as DatabaseSchema from \"./DatabaseSchema\";\nimport type * as Handler from \"./Handler\";\nimport { setNestedProperty } from \"./internal/utils\";\nimport * as FunctionRegistryItem from \"./FunctionRegistryItem\";\n\nexport interface FunctionImpl<Name_ extends string> {\n readonly name: Name_;\n}\n\nexport const FunctionImpl = <Name_ extends string>({ name }: { name: Name_ }) =>\n Context.Service<FunctionImpl<Name_>>(`@confect/server/FunctionImpl/${name}`);\n\n/**\n * Register a single function's implementation into the group's `Registry`.\n *\n * The function is registered under a flat, single-segment key (its own `name`),\n * not a project-wide dot-path. Each group's impl layer is built in\n * isolation—`RegisteredFunctions.buildForGroup` (and the CLI's `validateImpl`)\n * provide a fresh `Registry` per group—so function names only need to be unique\n * within their own group.\n *\n * `databaseSchema` is retained purely as a type-level carrier: the handler's\n * ctx-service requirements (`DatabaseReader`, `QueryCtx<DataModel>`, …) are\n * derived from it via `Handler.WithName`. It is not read at runtime—the\n * generated per-group registry forwards the schema value to the function\n * builders—so impls depend on `_generated/schema` (table schemas) rather than\n * `_generated/api` (which transitively imports every function spec).\n */\nexport const make = <\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n Group extends GroupSpec.AnyWithProps,\n const Name_ extends FunctionSpec.Name<GroupSpec.Functions<Group>>,\n>(\n _databaseSchema: DatabaseSchema_,\n group: Group,\n name: Name_,\n handler: Handler.WithName<\n DatabaseSchema_,\n GroupSpec.Functions<Group>,\n Name_,\n MiddlewareSpec.Provides<\n | GroupSpec.MiddlewareSpecs<Group>\n | FunctionSpec.MiddlewareSpecs<\n FunctionSpec.WithName<GroupSpec.Functions<Group>, Name_>\n >\n >\n >,\n): Layer.Layer<FunctionImpl<Name_>> => {\n const functionSpec = group.functions[name]!;\n\n return Layer.effect(\n FunctionImpl<Name_>({ name }),\n Effect.gen(function* () {\n const registry = yield* Registry.Registry;\n\n yield* Ref.update(registry, (registryItems) =>\n setNestedProperty(\n registryItems,\n [name],\n FunctionRegistryItem.make({\n functionSpec,\n groupMiddlewareAttachments: group.middlewareAttachments,\n handler,\n }),\n ),\n );\n\n return { name };\n }),\n );\n};\n\n/**\n * Get the function implementation service type for a specific function name.\n */\nexport type ForFunction<Name_ extends string> = FunctionImpl<Name_>;\n\n/**\n * Get all function implementation services required for a group spec.\n */\nexport type FromGroupSpec<Group extends GroupSpec.AnyWithProps> =\n FunctionSpec.Name<\n GroupSpec.Functions<Group>\n > extends infer FunctionNames extends string\n ? FunctionNames extends string\n ? FunctionImpl<FunctionNames>\n : never\n : never;\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAa,gBAAsC,EAAE,WACnD,QAAQ,QAA6B,gCAAgC,MAAM;;;;;;;;;;;;;;;;;AAkB7E,MAAa,QAKX,iBACA,OACA,MACA,YAWqC;CACrC,MAAM,eAAe,MAAM,UAAU;CAErC,OAAO,MAAM,OACX,aAAoB,EAAE,KAAK,CAAC,GAC5B,OAAO,IAAI,aAAa;EACtB,MAAM,WAAW,OAAOA;EAExB,OAAO,IAAI,OAAO,WAAW,kBAC3B,kBACE,eACA,CAAC,IAAI,GACLC,OAA0B;GACxB;GACA,4BAA4B,MAAM;GAClC;EACF,CAAC,CACH,CACF;EAEA,OAAO,EAAE,KAAK;CAChB,CAAC,CACH;AACF"}
@@ -0,0 +1,36 @@
1
+ import type * as MiddlewareAttachment from "@confect/core/MiddlewareAttachment";
2
+ import type * as FunctionSpec from "@confect/core/FunctionSpec";
3
+ import type { FunctionType, FunctionVisibility } from "convex/server";
4
+ import type * as Schema from "effect/Schema";
5
+ import type * as Handler from "./Handler";
6
+ export declare const TypeId = "~@confect/server/FunctionRegistryItem";
7
+ export type TypeId = typeof TypeId;
8
+ export declare const isFunctionRegistryItem: (value: unknown) => value is AnyWithProps;
9
+ /**
10
+ * A function registered by `FunctionImpl.make`, one of two shapes keyed by the
11
+ * spec's provenance.
12
+ */
13
+ export type AnyWithProps = ConfectFunctionRegistryItem | ConvexFunctionRegistryItem;
14
+ export interface ConfectFunctionRegistryItem {
15
+ readonly [TypeId]: TypeId;
16
+ readonly _tag: "Confect";
17
+ readonly name: string;
18
+ readonly functionVisibility: FunctionVisibility;
19
+ readonly functionType: FunctionType;
20
+ readonly args: Schema.Codec<any, any>;
21
+ readonly returns: Schema.Codec<any, any>;
22
+ readonly error?: Schema.Codec<any, any>;
23
+ readonly middlewareAttachments: ReadonlyArray<MiddlewareAttachment.MiddlewareAttachment>;
24
+ readonly handler: Handler.AnyConfectProvenance;
25
+ }
26
+ export interface ConvexFunctionRegistryItem {
27
+ readonly [TypeId]: TypeId;
28
+ readonly _tag: "Convex";
29
+ readonly handler: Handler.AnyConvexProvenance;
30
+ }
31
+ export declare const make: ({ functionSpec, groupMiddlewareAttachments, handler, }: {
32
+ functionSpec: FunctionSpec.AnyWithProps;
33
+ groupMiddlewareAttachments: ReadonlyArray<MiddlewareAttachment.MiddlewareAttachment>;
34
+ handler: Handler.Any;
35
+ }) => AnyWithProps;
36
+ //# sourceMappingURL=FunctionRegistryItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FunctionRegistryItem.d.ts","sourceRoot":"","sources":["../src/FunctionRegistryItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,oBAAoB,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,KAAK,YAAY,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGtE,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,OAAO,MAAM,WAAW,CAAC;AAE1C,eAAO,MAAM,MAAM,0CAA0C,CAAC;AAC9D,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC,eAAO,MAAM,sBAAsB,UAAW,OAAO,KAAG,KAAK,IAAI,YAC3B,CAAC;AAMvC;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB,2BAA2B,GAC3B,0BAA0B,CAAC;AAE/B,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAChD,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACzC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACxC,QAAQ,CAAC,qBAAqB,EAAE,aAAa,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;IACzF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC;CAChD;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC;CAC/C;AAED,eAAO,MAAM,IAAI,2DAId;IACD,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC;IACxC,0BAA0B,EAAE,aAAa,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;IACrF,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC;CACtB,KAAG,YA8BD,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
+ import * as Match from "effect/Match";
3
+ import * as Predicate from "effect/Predicate";
4
+ import * as Lazy from "@confect/core/Lazy";
5
+ //#region src/FunctionRegistryItem.ts
6
+ var FunctionRegistryItem_exports = /* @__PURE__ */ __exportAll({
7
+ TypeId: () => TypeId,
8
+ isFunctionRegistryItem: () => isFunctionRegistryItem,
9
+ make: () => make
10
+ });
11
+ const TypeId = "~@confect/server/FunctionRegistryItem";
12
+ const isFunctionRegistryItem = (value) => Predicate.hasProperty(value, TypeId);
13
+ const FunctionRegistryItemProto = { [TypeId]: TypeId };
14
+ const make = ({ functionSpec, groupMiddlewareAttachments, handler }) => Match.value(functionSpec.functionProvenance).pipe(Match.tag("Convex", () => Object.assign(Object.create(FunctionRegistryItemProto), {
15
+ _tag: "Convex",
16
+ handler
17
+ })), Match.tag("Confect", (provenance) => {
18
+ const item = Object.assign(Object.create(FunctionRegistryItemProto), {
19
+ _tag: "Confect",
20
+ name: functionSpec.name,
21
+ functionVisibility: functionSpec.functionVisibility,
22
+ functionType: functionSpec.runtimeAndFunctionType.functionType,
23
+ middlewareAttachments: [...groupMiddlewareAttachments, ...functionSpec.middlewareAttachments],
24
+ handler
25
+ });
26
+ Lazy.defineProperty(item, "args", () => provenance.args);
27
+ Lazy.defineProperty(item, "returns", () => provenance.returns);
28
+ if ("error" in provenance) Lazy.defineProperty(item, "error", () => provenance.error);
29
+ return item;
30
+ }), Match.exhaustive);
31
+ //#endregion
32
+ export { FunctionRegistryItem_exports, TypeId, isFunctionRegistryItem, make };
33
+
34
+ //# sourceMappingURL=FunctionRegistryItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FunctionRegistryItem.js","names":[],"sources":["../src/FunctionRegistryItem.ts"],"sourcesContent":["import type * as MiddlewareAttachment from \"@confect/core/MiddlewareAttachment\";\nimport type * as FunctionSpec from \"@confect/core/FunctionSpec\";\nimport * as Lazy from \"@confect/core/Lazy\";\nimport type { FunctionType, FunctionVisibility } from \"convex/server\";\nimport * as Match from \"effect/Match\";\nimport * as Predicate from \"effect/Predicate\";\nimport type * as Schema from \"effect/Schema\";\nimport type * as Handler from \"./Handler\";\n\nexport const TypeId = \"~@confect/server/FunctionRegistryItem\";\nexport type TypeId = typeof TypeId;\n\nexport const isFunctionRegistryItem = (value: unknown): value is AnyWithProps =>\n Predicate.hasProperty(value, TypeId);\n\nconst FunctionRegistryItemProto = {\n [TypeId]: TypeId,\n};\n\n/**\n * A function registered by `FunctionImpl.make`, one of two shapes keyed by the\n * spec's provenance.\n */\nexport type AnyWithProps =\n | ConfectFunctionRegistryItem\n | ConvexFunctionRegistryItem;\n\nexport interface ConfectFunctionRegistryItem {\n readonly [TypeId]: TypeId;\n readonly _tag: \"Confect\";\n readonly name: string;\n readonly functionVisibility: FunctionVisibility;\n readonly functionType: FunctionType;\n readonly args: Schema.Codec<any, any>;\n readonly returns: Schema.Codec<any, any>;\n readonly error?: Schema.Codec<any, any>;\n readonly middlewareAttachments: ReadonlyArray<MiddlewareAttachment.MiddlewareAttachment>;\n readonly handler: Handler.AnyConfectProvenance;\n}\n\nexport interface ConvexFunctionRegistryItem {\n readonly [TypeId]: TypeId;\n readonly _tag: \"Convex\";\n readonly handler: Handler.AnyConvexProvenance;\n}\n\nexport const make = ({\n functionSpec,\n groupMiddlewareAttachments,\n handler,\n}: {\n functionSpec: FunctionSpec.AnyWithProps;\n groupMiddlewareAttachments: ReadonlyArray<MiddlewareAttachment.MiddlewareAttachment>;\n handler: Handler.Any;\n}): AnyWithProps =>\n Match.value(functionSpec.functionProvenance).pipe(\n Match.tag(\"Convex\", (): AnyWithProps =>\n Object.assign(Object.create(FunctionRegistryItemProto), {\n _tag: \"Convex\" as const,\n handler: handler as Handler.AnyConvexProvenance,\n }),\n ),\n Match.tag(\"Confect\", (provenance): AnyWithProps => {\n const item = Object.assign(Object.create(FunctionRegistryItemProto), {\n _tag: \"Confect\" as const,\n name: functionSpec.name,\n functionVisibility: functionSpec.functionVisibility,\n functionType: functionSpec.runtimeAndFunctionType.functionType,\n middlewareAttachments: [\n ...groupMiddlewareAttachments,\n ...functionSpec.middlewareAttachments,\n ],\n handler: handler as Handler.AnyConfectProvenance,\n });\n\n Lazy.defineProperty(item, \"args\", () => provenance.args);\n Lazy.defineProperty(item, \"returns\", () => provenance.returns);\n if (\"error\" in provenance) {\n Lazy.defineProperty(item, \"error\", () => provenance.error);\n }\n\n return item as AnyWithProps;\n }),\n Match.exhaustive,\n );\n"],"mappings":";;;;;;;;;;AASA,MAAa,SAAS;AAGtB,MAAa,0BAA0B,UACrC,UAAU,YAAY,OAAO,MAAM;AAErC,MAAM,4BAA4B,GAC/B,SAAS,OACZ;AA6BA,MAAa,QAAQ,EACnB,cACA,4BACA,cAMA,MAAM,MAAM,aAAa,kBAAkB,CAAC,CAAC,KAC3C,MAAM,IAAI,gBACR,OAAO,OAAO,OAAO,OAAO,yBAAyB,GAAG;CACtD,MAAM;CACG;AACX,CAAC,CACH,GACA,MAAM,IAAI,YAAY,eAA6B;CACjD,MAAM,OAAO,OAAO,OAAO,OAAO,OAAO,yBAAyB,GAAG;EACnE,MAAM;EACN,MAAM,aAAa;EACnB,oBAAoB,aAAa;EACjC,cAAc,aAAa,uBAAuB;EAClD,uBAAuB,CACrB,GAAG,4BACH,GAAG,aAAa,qBAClB;EACS;CACX,CAAC;CAED,KAAK,eAAe,MAAM,cAAc,WAAW,IAAI;CACvD,KAAK,eAAe,MAAM,iBAAiB,WAAW,OAAO;CAC7D,IAAI,WAAW,YACb,KAAK,eAAe,MAAM,eAAe,WAAW,KAAK;CAG3D,OAAO;AACT,CAAC,GACD,MAAM,UACR"}
@@ -0,0 +1,77 @@
1
+ import type * as GroupSpec from "@confect/core/GroupSpec";
2
+ import type * as MiddlewareSpec from "@confect/core/MiddlewareSpec";
3
+ import * as Context from "effect/Context";
4
+ import * as Layer from "effect/Layer";
5
+ import type * as DatabaseSchema from "./DatabaseSchema";
6
+ import type * as FunctionImpl from "./FunctionImpl";
7
+ import type * as MiddlewareImpl from "./MiddlewareImpl";
8
+ export declare const TypeId = "~@confect/server/GroupImpl";
9
+ export type TypeId = typeof TypeId;
10
+ export type FinalizationStatus = "Unfinalized" | "Finalized";
11
+ export interface GroupImpl<FinalizationStatus_ extends FinalizationStatus = "Unfinalized"> {
12
+ readonly [TypeId]: TypeId;
13
+ readonly finalizationStatus: FinalizationStatus_;
14
+ /**
15
+ * Names of every function registered into this group's layer scope by
16
+ * `FunctionImpl.make`. Authoritative only when `finalizationStatus` is
17
+ * `"Finalized"`; the `"Unfinalized"` value is set to `[]` at `make`-time
18
+ * since the list is only known once `finalize` snapshots the registry.
19
+ */
20
+ readonly registeredFunctionNames: ReadonlyArray<string>;
21
+ /**
22
+ * Keys of every middleware whose implementation registered into this group's
23
+ * layer scope via `MiddlewareImpl.make` (and friends). Same authoritativeness
24
+ * caveat as `registeredFunctionNames`. Lets consumers (the CLI's
25
+ * `validateImpl`) verify middleware-impl completeness against a `GroupSpec`'s
26
+ * attached middleware without inspecting the `Registry`.
27
+ */
28
+ readonly registeredMiddlewareKeys: ReadonlyArray<string>;
29
+ }
30
+ export interface Any extends GroupImpl<FinalizationStatus> {
31
+ }
32
+ export declare const isGroupImpl: (u: unknown) => u is Any;
33
+ export interface AnyFinalized extends GroupImpl<"Finalized"> {
34
+ }
35
+ export interface AnyUnfinalized extends GroupImpl<"Unfinalized"> {
36
+ }
37
+ export declare const isFinalizedGroupImpl: (u: unknown) => u is AnyFinalized;
38
+ export declare const isUnfinalizedGroupImpl: (u: unknown) => u is AnyUnfinalized;
39
+ /**
40
+ * Build the runtime tag for a `GroupImpl` service. The finalization status is
41
+ * embedded in the tag string so that `Unfinalized` and `Finalized` are distinct
42
+ * services at runtime; consumers of a finalized layer (the server's
43
+ * `RegisteredFunctions.buildForGroup` and the CLI's `validateImpl`) retrieve
44
+ * the typed `Finalized` service directly rather than scanning the context.
45
+ *
46
+ * The tag is keyed only by finalization status—no group path—because each
47
+ * group's impl layer is built in its own isolated scope
48
+ * (`buildForGroup`/`validateImpl` each provide a fresh `Registry`), so at most
49
+ * one `GroupImpl` service of each status exists per build.
50
+ */
51
+ export declare const GroupImpl: <FinalizationStatus_ extends FinalizationStatus>({ finalizationStatus, }: {
52
+ finalizationStatus: FinalizationStatus_;
53
+ }) => Context.Service<GroupImpl<FinalizationStatus_>, GroupImpl<FinalizationStatus_>>;
54
+ /**
55
+ * Begin a group's impl layer. `databaseSchema` and `group` are retained only as
56
+ * type-level carriers (`group` drives the required `FunctionImpl` services via
57
+ * `FromGroupSpec<Group>`; `databaseSchema` keeps the impl's dependency on
58
+ * `_generated/schema` symmetric with `FunctionImpl.make`). Neither is read at
59
+ * runtime.
60
+ */
61
+ export declare const make: <DatabaseSchema_ extends DatabaseSchema.AnyWithProps, Group extends GroupSpec.AnyWithProps>(_databaseSchema: DatabaseSchema_, _group: Group & MiddlewareSpec.ValidateImplRequires<GroupSpec.Functions<Group>, GroupSpec.MiddlewareSpecs<Group>>) => Layer.Layer<GroupImpl<"Unfinalized">, never, FunctionImpl.FromGroupSpec<Group> | MiddlewareImpl.FromGroupSpec<Group>>;
62
+ /**
63
+ * Mark a `GroupImpl` layer as fully implemented. The parameter type defaults
64
+ * `RIn = never`, so passing a layer that still requires any `FunctionImpl`
65
+ * service produces a type error at the impl author's site. The codegen boundary
66
+ * requires the resulting `"Finalized"` brand, so omitting this call is also
67
+ * rejected downstream.
68
+ *
69
+ * As a side effect of finalization, the names of every `FunctionImpl` that
70
+ * registered into this group's scope are snapshotted onto the produced service
71
+ * value's `registeredFunctionNames` field, so consumers can verify impl
72
+ * completeness against a `GroupSpec`'s expected functions without having to
73
+ * inspect the `Registry` themselves.
74
+ */
75
+ export declare const finalize: (group: Layer.Layer<GroupImpl<"Unfinalized">>) => Layer.Layer<GroupImpl<"Finalized">>;
76
+ export type FromGroupSpec<Group extends GroupSpec.AnyWithProps> = FunctionImpl.FromGroupSpec<Group> | MiddlewareImpl.FromGroupSpec<Group>;
77
+ //# sourceMappingURL=GroupImpl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupImpl.d.ts","sourceRoot":"","sources":["../src/GroupImpl.ts"],"names":[],"mappings":"AAAA,O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AWG;AACH,eAAO,MAAM,SAAS,GAAI,mBAAmB,SAAS,kBAAkB,2BAErE;IACD,kBAAkB,EAAE,mBAAmB,CAAC;CACzC,oFAGE,CAAC;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,GACf,eAAe,SAAS,cAAc,CAAC,YAAY,EACnD,KAAK,SAAS,SAAS,CAAC,YAAY,mBAEnB,eAAe,UACxB,KAAK,GACX,cAAc,CAAC,oBAAoB,CACjC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,EAC1B,SAAS,CAAC,eAAe,CAAC,KAAK,CAAC,CACjC,KACF,KAAK,CAAC,KAAK,CACZ,SAAS,CAAC,aAAa,CAAC,EACxB,KAAK,EACL,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,CActE,CAAC;AAOJ;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,UACZ,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,KAC3C,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CA6BlC,CAAC;AAEJ,MAAM,MAAM,aAAa,CAAC,KAAK,SAAS,SAAS,CAAC,YAAY,IAC1D,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,GACjC,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
+ import { Registry } from "./Registry.js";
3
+ import { functionNames, middlewareKeys } from "./RegistryItems.js";
4
+ import * as Context from "effect/Context";
5
+ import * as Layer from "effect/Layer";
6
+ import * as Effect from "effect/Effect";
7
+ import * as Option from "effect/Option";
8
+ import * as Array from "effect/Array";
9
+ import * as Predicate from "effect/Predicate";
10
+ import * as Ref from "effect/Ref";
11
+ //#region src/GroupImpl.ts
12
+ var GroupImpl_exports = /* @__PURE__ */ __exportAll({
13
+ GroupImpl: () => GroupImpl,
14
+ TypeId: () => TypeId,
15
+ finalize: () => finalize,
16
+ isFinalizedGroupImpl: () => isFinalizedGroupImpl,
17
+ isGroupImpl: () => isGroupImpl,
18
+ isUnfinalizedGroupImpl: () => isUnfinalizedGroupImpl,
19
+ make: () => make
20
+ });
21
+ const TypeId = "~@confect/server/GroupImpl";
22
+ const isGroupImpl = (u) => Predicate.hasProperty(u, TypeId);
23
+ const isFinalizedGroupImpl = (u) => isGroupImpl(u) && u.finalizationStatus === "Finalized";
24
+ const isUnfinalizedGroupImpl = (u) => isGroupImpl(u) && u.finalizationStatus === "Unfinalized";
25
+ /**
26
+ * Build the runtime tag for a `GroupImpl` service. The finalization status is
27
+ * embedded in the tag string so that `Unfinalized` and `Finalized` are distinct
28
+ * services at runtime; consumers of a finalized layer (the server's
29
+ * `RegisteredFunctions.buildForGroup` and the CLI's `validateImpl`) retrieve
30
+ * the typed `Finalized` service directly rather than scanning the context.
31
+ *
32
+ * The tag is keyed only by finalization status—no group path—because each
33
+ * group's impl layer is built in its own isolated scope
34
+ * (`buildForGroup`/`validateImpl` each provide a fresh `Registry`), so at most
35
+ * one `GroupImpl` service of each status exists per build.
36
+ */
37
+ const GroupImpl = ({ finalizationStatus }) => Context.Service(`@confect/server/GroupImpl/${finalizationStatus}`);
38
+ /**
39
+ * Begin a group's impl layer. `databaseSchema` and `group` are retained only as
40
+ * type-level carriers (`group` drives the required `FunctionImpl` services via
41
+ * `FromGroupSpec<Group>`; `databaseSchema` keeps the impl's dependency on
42
+ * `_generated/schema` symmetric with `FunctionImpl.make`). Neither is read at
43
+ * runtime.
44
+ */
45
+ const make = (_databaseSchema, _group) => Layer.succeed(GroupImpl({ finalizationStatus: "Unfinalized" }), {
46
+ [TypeId]: TypeId,
47
+ finalizationStatus: "Unfinalized",
48
+ registeredFunctionNames: [],
49
+ registeredMiddlewareKeys: []
50
+ });
51
+ const findUnfinalizedGroupImpl = (context) => Array.findFirst(context.mapUnsafe.values(), isUnfinalizedGroupImpl);
52
+ /**
53
+ * Mark a `GroupImpl` layer as fully implemented. The parameter type defaults
54
+ * `RIn = never`, so passing a layer that still requires any `FunctionImpl`
55
+ * service produces a type error at the impl author's site. The codegen boundary
56
+ * requires the resulting `"Finalized"` brand, so omitting this call is also
57
+ * rejected downstream.
58
+ *
59
+ * As a side effect of finalization, the names of every `FunctionImpl` that
60
+ * registered into this group's scope are snapshotted onto the produced service
61
+ * value's `registeredFunctionNames` field, so consumers can verify impl
62
+ * completeness against a `GroupSpec`'s expected functions without having to
63
+ * inspect the `Registry` themselves.
64
+ */
65
+ const finalize = (group) => Layer.flatMap(group, (context) => findUnfinalizedGroupImpl(context).pipe(Option.match({
66
+ onNone: () => Layer.effect(GroupImpl({ finalizationStatus: "Finalized" }), Effect.die(/* @__PURE__ */ new Error("GroupImpl.finalize: no Unfinalized GroupImpl service was found in the layer's context."))),
67
+ onSome: () => Layer.effect(GroupImpl({ finalizationStatus: "Finalized" }), Effect.gen(function* () {
68
+ const registry = yield* Registry;
69
+ const items = yield* Ref.get(registry);
70
+ return {
71
+ [TypeId]: TypeId,
72
+ finalizationStatus: "Finalized",
73
+ registeredFunctionNames: functionNames(items),
74
+ registeredMiddlewareKeys: middlewareKeys(items)
75
+ };
76
+ }))
77
+ })));
78
+ //#endregion
79
+ export { GroupImpl, GroupImpl_exports, TypeId, finalize, isFinalizedGroupImpl, isGroupImpl, isUnfinalizedGroupImpl, make };
80
+
81
+ //# sourceMappingURL=GroupImpl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupImpl.js","names":["Registry.Registry","RegistryItems.functionNames","RegistryItems.middlewareKeys"],"sources":["../src/GroupImpl.ts"],"sourcesContent":["import type * as GroupSpec from \"@confect/core/GroupSpec\";\nimport type * as MiddlewareSpec from \"@confect/core/MiddlewareSpec\";\nimport * as Registry from \"./Registry\";\nimport * as RegistryItems from \"./RegistryItems\";\nimport * as Array from \"effect/Array\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Predicate from \"effect/Predicate\";\nimport * as Ref from \"effect/Ref\";\nimport type * as DatabaseSchema from \"./DatabaseSchema\";\nimport type * as FunctionImpl from \"./FunctionImpl\";\nimport type * as MiddlewareImpl from \"./MiddlewareImpl\";\n\nexport const TypeId = \"~@confect/server/GroupImpl\";\nexport type TypeId = typeof TypeId;\n\nexport type FinalizationStatus = \"Unfinalized\" | \"Finalized\";\n\nexport interface GroupImpl<\n FinalizationStatus_ extends FinalizationStatus = \"Unfinalized\",\n> {\n readonly [TypeId]: TypeId;\n readonly finalizationStatus: FinalizationStatus_;\n /**\n * Names of every function registered into this group's layer scope by\n * `FunctionImpl.make`. Authoritative only when `finalizationStatus` is\n * `\"Finalized\"`; the `\"Unfinalized\"` value is set to `[]` at `make`-time\n * since the list is only known once `finalize` snapshots the registry.\n */\n readonly registeredFunctionNames: ReadonlyArray<string>;\n /**\n * Keys of every middleware whose implementation registered into this group's\n * layer scope via `MiddlewareImpl.make` (and friends). Same authoritativeness\n * caveat as `registeredFunctionNames`. Lets consumers (the CLI's\n * `validateImpl`) verify middleware-impl completeness against a `GroupSpec`'s\n * attached middleware without inspecting the `Registry`.\n */\n readonly registeredMiddlewareKeys: ReadonlyArray<string>;\n}\n\nexport interface Any extends GroupImpl<FinalizationStatus> {}\n\nexport const isGroupImpl = (u: unknown): u is Any =>\n Predicate.hasProperty(u, TypeId);\n\nexport interface AnyFinalized extends GroupImpl<\"Finalized\"> {}\nexport interface AnyUnfinalized extends GroupImpl<\"Unfinalized\"> {}\n\nexport const isFinalizedGroupImpl = (u: unknown): u is AnyFinalized =>\n isGroupImpl(u) && u.finalizationStatus === \"Finalized\";\n\nexport const isUnfinalizedGroupImpl = (u: unknown): u is AnyUnfinalized =>\n isGroupImpl(u) && u.finalizationStatus === \"Unfinalized\";\n\n/**\n * Build the runtime tag for a `GroupImpl` service. The finalization status is\n * embedded in the tag string so that `Unfinalized` and `Finalized` are distinct\n * services at runtime; consumers of a finalized layer (the server's\n * `RegisteredFunctions.buildForGroup` and the CLI's `validateImpl`) retrieve\n * the typed `Finalized` service directly rather than scanning the context.\n *\n * The tag is keyed only by finalization status—no group path—because each\n * group's impl layer is built in its own isolated scope\n * (`buildForGroup`/`validateImpl` each provide a fresh `Registry`), so at most\n * one `GroupImpl` service of each status exists per build.\n */\nexport const GroupImpl = <FinalizationStatus_ extends FinalizationStatus>({\n finalizationStatus,\n}: {\n finalizationStatus: FinalizationStatus_;\n}) =>\n Context.Service<GroupImpl<FinalizationStatus_>>(\n `@confect/server/GroupImpl/${finalizationStatus}`,\n );\n\n/**\n * Begin a group's impl layer. `databaseSchema` and `group` are retained only as\n * type-level carriers (`group` drives the required `FunctionImpl` services via\n * `FromGroupSpec<Group>`; `databaseSchema` keeps the impl's dependency on\n * `_generated/schema` symmetric with `FunctionImpl.make`). Neither is read at\n * runtime.\n */\nexport const make = <\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n Group extends GroupSpec.AnyWithProps,\n>(\n _databaseSchema: DatabaseSchema_,\n _group: Group &\n MiddlewareSpec.ValidateImplRequires<\n GroupSpec.Functions<Group>,\n GroupSpec.MiddlewareSpecs<Group>\n >,\n): Layer.Layer<\n GroupImpl<\"Unfinalized\">,\n never,\n FunctionImpl.FromGroupSpec<Group> | MiddlewareImpl.FromGroupSpec<Group>\n> =>\n Layer.succeed(\n GroupImpl<\"Unfinalized\">({ finalizationStatus: \"Unfinalized\" }),\n {\n [TypeId]: TypeId,\n finalizationStatus: \"Unfinalized\" as const,\n registeredFunctionNames: [],\n registeredMiddlewareKeys: [],\n },\n ) as Layer.Layer<\n GroupImpl<\"Unfinalized\">,\n never,\n FunctionImpl.FromGroupSpec<Group> | MiddlewareImpl.FromGroupSpec<Group>\n >;\n\nconst findUnfinalizedGroupImpl = <S>(\n context: Context.Context<S>,\n): Option.Option<AnyUnfinalized> =>\n Array.findFirst(context.mapUnsafe.values(), isUnfinalizedGroupImpl);\n\n/**\n * Mark a `GroupImpl` layer as fully implemented. The parameter type defaults\n * `RIn = never`, so passing a layer that still requires any `FunctionImpl`\n * service produces a type error at the impl author's site. The codegen boundary\n * requires the resulting `\"Finalized\"` brand, so omitting this call is also\n * rejected downstream.\n *\n * As a side effect of finalization, the names of every `FunctionImpl` that\n * registered into this group's scope are snapshotted onto the produced service\n * value's `registeredFunctionNames` field, so consumers can verify impl\n * completeness against a `GroupSpec`'s expected functions without having to\n * inspect the `Registry` themselves.\n */\nexport const finalize = (\n group: Layer.Layer<GroupImpl<\"Unfinalized\">>,\n): Layer.Layer<GroupImpl<\"Finalized\">> =>\n Layer.flatMap(group, (context): Layer.Layer<GroupImpl<\"Finalized\">> =>\n findUnfinalizedGroupImpl(context).pipe(\n Option.match({\n onNone: () =>\n Layer.effect(\n GroupImpl<\"Finalized\">({ finalizationStatus: \"Finalized\" }),\n Effect.die(\n new Error(\n \"GroupImpl.finalize: no Unfinalized GroupImpl service was found in the layer's context.\",\n ),\n ),\n ),\n onSome: () =>\n Layer.effect(\n GroupImpl<\"Finalized\">({ finalizationStatus: \"Finalized\" }),\n Effect.gen(function* () {\n const registry = yield* Registry.Registry;\n const items = yield* Ref.get(registry);\n return {\n [TypeId]: TypeId,\n finalizationStatus: \"Finalized\" as const,\n registeredFunctionNames: RegistryItems.functionNames(items),\n registeredMiddlewareKeys: RegistryItems.middlewareKeys(items),\n };\n }),\n ),\n }),\n ),\n );\n\nexport type FromGroupSpec<Group extends GroupSpec.AnyWithProps> =\n | FunctionImpl.FromGroupSpec<Group>\n | MiddlewareImpl.FromGroupSpec<Group>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAeA,MAAa,SAAS;AA6BtB,MAAa,eAAe,MAC1B,UAAU,YAAY,GAAG,MAAM;AAKjC,MAAa,wBAAwB,MACnC,YAAY,CAAC,KAAK,EAAE,uBAAuB;AAE7C,MAAa,0BAA0B,MACrC,YAAY,CAAC,KAAK,EAAE,uBAAuB;;;;;;;;;;;;;AAc7C,MAAa,aAA6D,EACxE,yBAIA,QAAQ,QACN,6BAA6B,oBAC/B;;;;;;;;AASF,MAAa,QAIX,iBACA,WAUA,MAAM,QACJ,UAAyB,EAAE,oBAAoB,cAAc,CAAC,GAC9D;EACG,SAAS;CACV,oBAAoB;CACpB,yBAAyB,CAAC;CAC1B,0BAA0B,CAAC;AAC7B,CACF;AAMF,MAAM,4BACJ,YAEA,MAAM,UAAU,QAAQ,UAAU,OAAO,GAAG,sBAAsB;;;;;;;;;;;;;;AAepE,MAAa,YACX,UAEA,MAAM,QAAQ,QAAQ,YACpB,yBAAyB,OAAO,CAAC,CAAC,KAChC,OAAO,MAAM;CACX,cACE,MAAM,OACJ,UAAuB,EAAE,oBAAoB,YAAY,CAAC,GAC1D,OAAO,oBACL,IAAI,MACF,wFACF,CACF,CACF;CACF,cACE,MAAM,OACJ,UAAuB,EAAE,oBAAoB,YAAY,CAAC,GAC1D,OAAO,IAAI,aAAa;EACtB,MAAM,WAAW,OAAOA;EACxB,MAAM,QAAQ,OAAO,IAAI,IAAI,QAAQ;EACrC,OAAO;IACJ,SAAS;GACV,oBAAoB;GACpB,yBAAyBC,cAA4B,KAAK;GAC1D,0BAA0BC,eAA6B,KAAK;EAC9D;CACF,CAAC,CACH;AACJ,CAAC,CACH,CACF"}
@@ -0,0 +1,8 @@
1
+ import type * as Layer from "effect/Layer";
2
+ import type * as GroupImpl from "./GroupImpl";
3
+ import * as MiddlewareRegistryItem from "./MiddlewareRegistryItem";
4
+ export declare const make: (groupLayer: Layer.Layer<GroupImpl.GroupImpl<"Finalized">>) => {
5
+ functionRegistryItems: Record<string, unknown>;
6
+ middlewareRegistryItems: Map<string, MiddlewareRegistryItem.MiddlewareRegistryItem>;
7
+ };
8
+ //# sourceMappingURL=GroupRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupRegistry.d.ts","sourceRoot":"","sources":["../src/GroupRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAI3C,OAAO,KAAK,KAAK,SAAS,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,sBAAsB,MAAM,0BAA0B,CAAC;AAEnE,eAAO,MAAM,IAAI,eACH,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;;;CAe1D,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { Registry } from "./Registry.js";
2
+ import { isMiddlewareRegistryItem } from "./MiddlewareRegistryItem.js";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Ref from "effect/Ref";
5
+ //#region src/GroupRegistry.ts
6
+ const make = (groupLayer) => {
7
+ const registryItems = Effect.gen(function* () {
8
+ const registry = yield* Registry;
9
+ return yield* Ref.get(registry);
10
+ }).pipe(Effect.provide(groupLayer), Effect.provideService(Registry, Ref.makeUnsafe({})), Effect.runSync);
11
+ return partitionRegistryItems(registryItems);
12
+ };
13
+ const partitionRegistryItems = (registryItems) => {
14
+ const middlewareRegistryItems = /* @__PURE__ */ new Map();
15
+ const functionRegistryItems = {};
16
+ for (const [key, value] of Object.entries(registryItems)) if (isMiddlewareRegistryItem(value)) middlewareRegistryItems.set(value.middlewareSpec.key, value);
17
+ else functionRegistryItems[key] = value;
18
+ return {
19
+ functionRegistryItems,
20
+ middlewareRegistryItems
21
+ };
22
+ };
23
+ //#endregion
24
+ export { make };
25
+
26
+ //# sourceMappingURL=GroupRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupRegistry.js","names":["Registry.Registry","MiddlewareRegistryItem.isMiddlewareRegistryItem"],"sources":["../src/GroupRegistry.ts"],"sourcesContent":["import * as Effect from \"effect/Effect\";\nimport type * as Layer from \"effect/Layer\";\nimport * as Ref from \"effect/Ref\";\nimport * as Registry from \"./Registry\";\nimport type * as RegistryItems from \"./RegistryItems\";\nimport type * as GroupImpl from \"./GroupImpl\";\nimport * as MiddlewareRegistryItem from \"./MiddlewareRegistryItem\";\n\nexport const make = (\n groupLayer: Layer.Layer<GroupImpl.GroupImpl<\"Finalized\">>,\n) => {\n const registryItems = Effect.gen(function* () {\n const registry = yield* Registry.Registry;\n return yield* Ref.get(registry);\n }).pipe(\n Effect.provide(groupLayer),\n Effect.provideService(\n Registry.Registry,\n Ref.makeUnsafe<RegistryItems.RegistryItems>({}),\n ),\n Effect.runSync,\n );\n\n return partitionRegistryItems(registryItems);\n};\n\nconst partitionRegistryItems = (registryItems: RegistryItems.RegistryItems) => {\n const middlewareRegistryItems = new Map<\n string,\n MiddlewareRegistryItem.MiddlewareRegistryItem\n >();\n const functionRegistryItems: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(registryItems)) {\n if (MiddlewareRegistryItem.isMiddlewareRegistryItem(value)) {\n middlewareRegistryItems.set(value.middlewareSpec.key, value);\n } else {\n functionRegistryItems[key] = value;\n }\n }\n return { functionRegistryItems, middlewareRegistryItems };\n};\n"],"mappings":";;;;;AAQA,MAAa,QACX,eACG;CACH,MAAM,gBAAgB,OAAO,IAAI,aAAa;EAC5C,MAAM,WAAW,OAAOA;EACxB,OAAO,OAAO,IAAI,IAAI,QAAQ;CAChC,CAAC,CAAC,CAAC,KACD,OAAO,QAAQ,UAAU,GACzB,OAAO,eACLA,UACA,IAAI,WAAwC,CAAC,CAAC,CAChD,GACA,OAAO,OACT;CAEA,OAAO,uBAAuB,aAAa;AAC7C;AAEA,MAAM,0BAA0B,kBAA+C;CAC7E,MAAM,0CAA0B,IAAI,IAGlC;CACF,MAAM,wBAAiD,CAAC;CACxD,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,aAAa,GACrD,IAAIC,yBAAgD,KAAK,GACvD,wBAAwB,IAAI,MAAM,eAAe,KAAK,KAAK;MAE3D,sBAAsB,OAAO;CAGjC,OAAO;EAAE;EAAuB;CAAwB;AAC1D"}
@@ -0,0 +1,47 @@
1
+ import type { FunctionSpec, RuntimeAndFunctionType } from "@confect/core";
2
+ import type * as FunctionProvenance from "@confect/core/FunctionProvenance";
3
+ import type * as NodeServices from "@effect/platform-node/NodeServices";
4
+ import type { Effect } from "effect";
5
+ import type * as ActionCtx from "./ActionCtx";
6
+ import type * as ActionRunner from "./ActionRunner";
7
+ import type * as Auth from "./Auth";
8
+ import type * as DatabaseReader from "./DatabaseReader";
9
+ import type * as DatabaseSchema from "./DatabaseSchema";
10
+ import type * as DatabaseWriter from "./DatabaseWriter";
11
+ import type * as DataModel from "./DataModel";
12
+ import type { ExecutionMetadata } from "./ExecutionMetadata";
13
+ import type { RequestMetadata } from "./RequestMetadata";
14
+ import type { TransactionMetadata } from "./TransactionMetadata";
15
+ import type * as MutationCtx from "./MutationCtx";
16
+ import type * as MutationRunner from "./MutationRunner";
17
+ import type { MutationTransactionContext } from "./MutationTransactionContext";
18
+ import type * as QueryCtx from "./QueryCtx";
19
+ import type * as QueryRunner from "./QueryRunner";
20
+ import type { QueryTransactionContext } from "./QueryTransactionContext";
21
+ import type * as RegisteredFunction from "./RegisteredFunction";
22
+ import type * as Scheduler from "./Scheduler";
23
+ import type { Storage } from "./Storage";
24
+ import type * as StorageActionWriter from "./StorageActionWriter";
25
+ import type * as StorageReader from "./StorageReader";
26
+ import type * as StorageWriter from "./StorageWriter";
27
+ import type * as VectorSearch from "./VectorSearch";
28
+ export type Handler<DatabaseSchema_ extends DatabaseSchema.AnyWithProps, FunctionSpec_ extends FunctionSpec.AnyWithProps, R = never> = FunctionSpec_ extends FunctionSpec.WithFunctionProvenance<FunctionSpec_, FunctionProvenance.AnyConvex> ? ConvexProvenanceHandler<FunctionSpec_> : FunctionSpec_ extends FunctionSpec.WithFunctionProvenance<FunctionSpec_, FunctionProvenance.AnyConfect> ? ConfectProvenanceHandler<DatabaseSchema_, FunctionSpec_, R> : never;
29
+ type ConvexProvenanceHandler<FunctionSpec_ extends FunctionSpec.AnyWithPropsWithFunctionProvenance<FunctionProvenance.AnyConvex>> = RegisteredFunction.ConvexRegisteredFunction<FunctionSpec_>;
30
+ type ConfectProvenanceHandler<DatabaseSchema_ extends DatabaseSchema.AnyWithProps, FunctionSpec_ extends FunctionSpec.AnyWithPropsWithFunctionProvenance<FunctionProvenance.AnyConfect>, R = never> = FunctionSpec_ extends FunctionSpec.WithFunctionType<FunctionSpec_, "query"> ? ConfectProvenanceQuery<DatabaseSchema_, FunctionSpec_, R> : FunctionSpec_ extends FunctionSpec.WithFunctionType<FunctionSpec_, "mutation"> ? ConfectProvenanceMutation<DatabaseSchema_, FunctionSpec_, R> : FunctionSpec_ extends FunctionSpec.WithRuntimeAndFunctionType<FunctionSpec_, RuntimeAndFunctionType.ConvexAction> ? ConvexRuntimeAction<DatabaseSchema_, FunctionSpec_, R> : FunctionSpec_ extends FunctionSpec.WithRuntimeAndFunctionType<FunctionSpec_, RuntimeAndFunctionType.NodeAction> ? NodeRuntimeAction<DatabaseSchema_, FunctionSpec_, R> : never;
31
+ export type QueryServices<DatabaseSchema_ extends DatabaseSchema.AnyWithProps> = DatabaseReader.DatabaseReader<DatabaseSchema_> | (DatabaseSchema_["target"]["kind"] extends "component" ? never : Auth.Auth) | StorageReader.ForScope<DatabaseSchema.Scope<DatabaseSchema_>> | ExecutionMetadata | TransactionMetadata | (DatabaseSchema_["target"]["kind"] extends "component" ? never : Storage) | QueryRunner.QueryRunner | QueryTransactionContext | QueryCtx.QueryCtx<DataModel.ToConvex<DataModel.FromSchema<DatabaseSchema_>>, DatabaseSchema.Scope<DatabaseSchema_>>;
32
+ export type MutationServices<DatabaseSchema_ extends DatabaseSchema.AnyWithProps> = DatabaseReader.DatabaseReader<DatabaseSchema_> | DatabaseWriter.DatabaseWriter<DatabaseSchema_> | (DatabaseSchema_["target"]["kind"] extends "component" ? never : Auth.Auth) | Scheduler.ForScope<DatabaseSchema.Scope<DatabaseSchema_>> | StorageReader.ForScope<DatabaseSchema.Scope<DatabaseSchema_>> | StorageWriter.ForScope<DatabaseSchema.Scope<DatabaseSchema_>> | ExecutionMetadata | TransactionMetadata | RequestMetadata | (DatabaseSchema_["target"]["kind"] extends "component" ? never : Storage) | QueryRunner.QueryRunner | MutationRunner.MutationRunner | QueryTransactionContext | MutationTransactionContext | MutationCtx.MutationCtx<DataModel.ToConvex<DataModel.FromSchema<DatabaseSchema_>>, DatabaseSchema.Scope<DatabaseSchema_>>;
33
+ /**
34
+ * Shared by both action runtimes.
35
+ */
36
+ export type ActionServices<DatabaseSchema_ extends DatabaseSchema.AnyWithProps> = Scheduler.ForScope<DatabaseSchema.Scope<DatabaseSchema_>> | (DatabaseSchema_["target"]["kind"] extends "component" ? never : Auth.Auth) | StorageReader.ForScope<DatabaseSchema.Scope<DatabaseSchema_>> | StorageWriter.ForScope<DatabaseSchema.Scope<DatabaseSchema_>> | StorageActionWriter.ForScope<DatabaseSchema.Scope<DatabaseSchema_>> | ExecutionMetadata | RequestMetadata | (DatabaseSchema_["target"]["kind"] extends "component" ? never : Storage) | QueryRunner.QueryRunner | MutationRunner.MutationRunner | ActionRunner.ActionRunner | VectorSearch.VectorSearch<DataModel.FromSchema<DatabaseSchema_>> | ActionCtx.ActionCtx<DataModel.ToConvex<DataModel.FromSchema<DatabaseSchema_>>, DatabaseSchema.Scope<DatabaseSchema_>>;
37
+ export type ConfectProvenanceQuery<DatabaseSchema_ extends DatabaseSchema.AnyWithProps, FunctionSpec_ extends FunctionSpec.AnyWithPropsWithFunctionType<RuntimeAndFunctionType.AnyQuery>, R = never> = Base<FunctionSpec_, QueryServices<DatabaseSchema_> | R>;
38
+ export type ConfectProvenanceMutation<DatabaseSchema_ extends DatabaseSchema.AnyWithProps, FunctionSpec_ extends FunctionSpec.AnyWithPropsWithFunctionType<RuntimeAndFunctionType.AnyMutation>, R = never> = Base<FunctionSpec_, MutationServices<DatabaseSchema_> | R>;
39
+ export type ConvexRuntimeAction<DatabaseSchema_ extends DatabaseSchema.AnyWithProps, FunctionSpec_ extends FunctionSpec.AnyWithPropsWithFunctionType<RuntimeAndFunctionType.AnyAction>, R = never> = Base<FunctionSpec_, ActionServices<DatabaseSchema_> | R>;
40
+ export type NodeRuntimeAction<DatabaseSchema_ extends DatabaseSchema.AnyWithProps, FunctionSpec_ extends FunctionSpec.AnyWithPropsWithFunctionType<RuntimeAndFunctionType.NodeAction>, R = never> = Base<FunctionSpec_, ActionServices<DatabaseSchema_> | NodeServices.NodeServices | R>;
41
+ type Base<FunctionSpec_ extends FunctionSpec.AnyWithProps, R> = (args: FunctionSpec.Args<FunctionSpec_>) => Effect.Effect<FunctionSpec.Returns<FunctionSpec_>, FunctionSpec.Error<FunctionSpec_>, R>;
42
+ export type Any = AnyConfectProvenance | AnyConvexProvenance;
43
+ export type AnyConfectProvenance = Base<FunctionSpec.AnyConfect, any>;
44
+ export type AnyConvexProvenance = RegisteredFunction.Any;
45
+ export type WithName<DatabaseSchema_ extends DatabaseSchema.AnyWithProps, FunctionSpec_ extends FunctionSpec.AnyWithProps, FunctionName extends string, R = never> = Handler<DatabaseSchema_, FunctionSpec.WithName<FunctionSpec_, FunctionName>, R>;
46
+ export {};
47
+ //# sourceMappingURL=Handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Handler.d.ts","sourceRoot":"","sources":["../src/Handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,KAAK,KAAK,kBAAkB,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,KAAK,YAAY,MAAM,oCAAoC,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,KAAK,SAAS,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,KAAK,YAAY,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,KAAK,IAAI,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACxD,OAAO,KA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Q,CAAC,aAAa,EAAE,YAAY,CAAC,EAClD,CAAC,CACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
+ //#region src/Handler.ts
3
+ var Handler_exports = /* @__PURE__ */ __exportAll({});
4
+ //#endregion
5
+ export { Handler_exports };
6
+
7
+ //# sourceMappingURL=Handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Handler.js","names":[],"sources":["../src/Handler.ts"],"sourcesContent":["import type { FunctionSpec, RuntimeAndFunctionType } from \"@confect/core\";\nimport type * as FunctionProvenance from \"@confect/core/FunctionProvenance\";\nimport type * as NodeServices from \"@effect/platform-node/NodeServices\";\nimport type { Effect } from \"effect\";\nimport type * as ActionCtx from \"./ActionCtx\";\nimport type * as ActionRunner from \"./ActionRunner\";\nimport type * as Auth from \"./Auth\";\nimport type * as DatabaseReader from \"./DatabaseReader\";\nimport type * as DatabaseSchema from \"./DatabaseSchema\";\nimport type * as DatabaseWriter from \"./DatabaseWriter\";\nimport type * as DataModel from \"./DataModel\";\nimport type { ExecutionMetadata } from \"./ExecutionMetadata\";\nimport type { RequestMetadata } from \"./RequestMetadata\";\nimport type { TransactionMetadata } from \"./TransactionMetadata\";\nimport type * as MutationCtx from \"./MutationCtx\";\nimport type * as MutationRunner from \"./MutationRunner\";\nimport type { MutationTransactionContext } from \"./MutationTransactionContext\";\nimport type * as QueryCtx from \"./QueryCtx\";\nimport type * as QueryRunner from \"./QueryRunner\";\nimport type { QueryTransactionContext } from \"./QueryTransactionContext\";\nimport type * as RegisteredFunction from \"./RegisteredFunction\";\nimport type * as Scheduler from \"./Scheduler\";\nimport type { Storage } from \"./Storage\";\nimport type * as StorageActionWriter from \"./StorageActionWriter\";\nimport type * as StorageReader from \"./StorageReader\";\nimport type * as StorageWriter from \"./StorageWriter\";\nimport type * as VectorSearch from \"./VectorSearch\";\n\nexport type Handler<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n FunctionSpec_ extends FunctionSpec.AnyWithProps,\n R = never,\n> =\n FunctionSpec_ extends FunctionSpec.WithFunctionProvenance<\n FunctionSpec_,\n FunctionProvenance.AnyConvex\n >\n ? ConvexProvenanceHandler<FunctionSpec_>\n : FunctionSpec_ extends FunctionSpec.WithFunctionProvenance<\n FunctionSpec_,\n FunctionProvenance.AnyConfect\n >\n ? ConfectProvenanceHandler<DatabaseSchema_, FunctionSpec_, R>\n : never;\n\ntype ConvexProvenanceHandler<\n FunctionSpec_ extends\n FunctionSpec.AnyWithPropsWithFunctionProvenance<FunctionProvenance.AnyConvex>,\n> = RegisteredFunction.ConvexRegisteredFunction<FunctionSpec_>;\n\ntype ConfectProvenanceHandler<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n FunctionSpec_ extends\n FunctionSpec.AnyWithPropsWithFunctionProvenance<FunctionProvenance.AnyConfect>,\n R = never,\n> =\n FunctionSpec_ extends FunctionSpec.WithFunctionType<FunctionSpec_, \"query\">\n ? ConfectProvenanceQuery<DatabaseSchema_, FunctionSpec_, R>\n : FunctionSpec_ extends FunctionSpec.WithFunctionType<\n FunctionSpec_,\n \"mutation\"\n >\n ? ConfectProvenanceMutation<DatabaseSchema_, FunctionSpec_, R>\n : FunctionSpec_ extends FunctionSpec.WithRuntimeAndFunctionType<\n FunctionSpec_,\n RuntimeAndFunctionType.ConvexAction\n >\n ? ConvexRuntimeAction<DatabaseSchema_, FunctionSpec_, R>\n : FunctionSpec_ extends FunctionSpec.WithRuntimeAndFunctionType<\n FunctionSpec_,\n RuntimeAndFunctionType.NodeAction\n >\n ? NodeRuntimeAction<DatabaseSchema_, FunctionSpec_, R>\n : never;\n\nexport type QueryServices<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n> =\n | DatabaseReader.DatabaseReader<DatabaseSchema_>\n | (DatabaseSchema_[\"target\"][\"kind\"] extends \"component\" ? never : Auth.Auth)\n | StorageReader.ForScope<DatabaseSchema.Scope<DatabaseSchema_>>\n | ExecutionMetadata\n | TransactionMetadata\n | (DatabaseSchema_[\"target\"][\"kind\"] extends \"component\" ? never : Storage)\n | QueryRunner.QueryRunner\n | QueryTransactionContext\n | QueryCtx.QueryCtx<\n DataModel.ToConvex<DataModel.FromSchema<DatabaseSchema_>>,\n DatabaseSchema.Scope<DatabaseSchema_>\n >;\n\nexport type MutationServices<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n> =\n | DatabaseReader.DatabaseReader<DatabaseSchema_>\n | DatabaseWriter.DatabaseWriter<DatabaseSchema_>\n | (DatabaseSchema_[\"target\"][\"kind\"] extends \"component\" ? never : Auth.Auth)\n | Scheduler.ForScope<DatabaseSchema.Scope<DatabaseSchema_>>\n | StorageReader.ForScope<DatabaseSchema.Scope<DatabaseSchema_>>\n | StorageWriter.ForScope<DatabaseSchema.Scope<DatabaseSchema_>>\n | ExecutionMetadata\n | TransactionMetadata\n | RequestMetadata\n | (DatabaseSchema_[\"target\"][\"kind\"] extends \"component\" ? never : Storage)\n | QueryRunner.QueryRunner\n | MutationRunner.MutationRunner\n | QueryTransactionContext\n | MutationTransactionContext\n | MutationCtx.MutationCtx<\n DataModel.ToConvex<DataModel.FromSchema<DatabaseSchema_>>,\n DatabaseSchema.Scope<DatabaseSchema_>\n >;\n\n/**\n * Shared by both action runtimes.\n */\nexport type ActionServices<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n> =\n | Scheduler.ForScope<DatabaseSchema.Scope<DatabaseSchema_>>\n | (DatabaseSchema_[\"target\"][\"kind\"] extends \"component\" ? never : Auth.Auth)\n | StorageReader.ForScope<DatabaseSchema.Scope<DatabaseSchema_>>\n | StorageWriter.ForScope<DatabaseSchema.Scope<DatabaseSchema_>>\n | StorageActionWriter.ForScope<DatabaseSchema.Scope<DatabaseSchema_>>\n | ExecutionMetadata\n | RequestMetadata\n | (DatabaseSchema_[\"target\"][\"kind\"] extends \"component\" ? never : Storage)\n | QueryRunner.QueryRunner\n | MutationRunner.MutationRunner\n | ActionRunner.ActionRunner\n | VectorSearch.VectorSearch<DataModel.FromSchema<DatabaseSchema_>>\n | ActionCtx.ActionCtx<\n DataModel.ToConvex<DataModel.FromSchema<DatabaseSchema_>>,\n DatabaseSchema.Scope<DatabaseSchema_>\n >;\n\nexport type ConfectProvenanceQuery<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n FunctionSpec_ extends\n FunctionSpec.AnyWithPropsWithFunctionType<RuntimeAndFunctionType.AnyQuery>,\n R = never,\n> = Base<FunctionSpec_, QueryServices<DatabaseSchema_> | R>;\n\nexport type ConfectProvenanceMutation<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n FunctionSpec_ extends\n FunctionSpec.AnyWithPropsWithFunctionType<RuntimeAndFunctionType.AnyMutation>,\n R = never,\n> = Base<FunctionSpec_, MutationServices<DatabaseSchema_> | R>;\n\nexport type ConvexRuntimeAction<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n FunctionSpec_ extends\n FunctionSpec.AnyWithPropsWithFunctionType<RuntimeAndFunctionType.AnyAction>,\n R = never,\n> = Base<FunctionSpec_, ActionServices<DatabaseSchema_> | R>;\n\nexport type NodeRuntimeAction<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n FunctionSpec_ extends\n FunctionSpec.AnyWithPropsWithFunctionType<RuntimeAndFunctionType.NodeAction>,\n R = never,\n> = Base<\n FunctionSpec_,\n ActionServices<DatabaseSchema_> | NodeServices.NodeServices | R\n>;\n\ntype Base<FunctionSpec_ extends FunctionSpec.AnyWithProps, R> = (\n args: FunctionSpec.Args<FunctionSpec_>,\n) => Effect.Effect<\n FunctionSpec.Returns<FunctionSpec_>,\n FunctionSpec.Error<FunctionSpec_>,\n R\n>;\n\nexport type Any = AnyConfectProvenance | AnyConvexProvenance;\n\nexport type AnyConfectProvenance = Base<FunctionSpec.AnyConfect, any>;\n\nexport type AnyConvexProvenance = RegisteredFunction.Any;\n\nexport type WithName<\n DatabaseSchema_ extends DatabaseSchema.AnyWithProps,\n FunctionSpec_ extends FunctionSpec.AnyWithProps,\n FunctionName extends string,\n R = never,\n> = Handler<\n DatabaseSchema_,\n FunctionSpec.WithName<FunctionSpec_, FunctionName>,\n R\n>;\n"],"mappings":""}