@shivaedev/contract 0.37.0 → 0.40.0

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 (388) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +53 -28
  3. package/dist/CommandGuard.d.ts.map +1 -1
  4. package/dist/CommandGuard.js +10 -3
  5. package/dist/CommandGuard.js.map +1 -1
  6. package/dist/CommandResultKeys.d.ts +4 -0
  7. package/dist/CommandResultKeys.d.ts.map +1 -0
  8. package/dist/CommandResultKeys.js +3 -0
  9. package/dist/CommandResultKeys.js.map +1 -0
  10. package/dist/adapters/LiveDispatcher.d.ts +9 -0
  11. package/dist/adapters/LiveDispatcher.d.ts.map +1 -0
  12. package/dist/adapters/LiveDispatcher.js +5 -0
  13. package/dist/adapters/LiveDispatcher.js.map +1 -0
  14. package/dist/adapters/liveHintStream.d.ts +30 -0
  15. package/dist/adapters/liveHintStream.d.ts.map +1 -0
  16. package/dist/adapters/liveHintStream.js +10 -0
  17. package/dist/adapters/liveHintStream.js.map +1 -0
  18. package/dist/adapters/openLiveHints.d.ts +30 -0
  19. package/dist/adapters/openLiveHints.d.ts.map +1 -0
  20. package/dist/adapters/openLiveHints.js +59 -0
  21. package/dist/adapters/openLiveHints.js.map +1 -0
  22. package/dist/adapters/refreshSubscription.d.ts +4 -0
  23. package/dist/adapters/refreshSubscription.d.ts.map +1 -0
  24. package/dist/adapters/refreshSubscription.js +5 -0
  25. package/dist/adapters/refreshSubscription.js.map +1 -0
  26. package/dist/adapters/resumeSocket.d.ts +1 -1
  27. package/dist/adapters/resumeSocket.d.ts.map +1 -1
  28. package/dist/adapters/resumeSocket.js +2 -2
  29. package/dist/adapters/resumeSocket.js.map +1 -1
  30. package/dist/adapters/standaloneLiveServer.d.ts +32 -0
  31. package/dist/adapters/standaloneLiveServer.d.ts.map +1 -0
  32. package/dist/adapters/standaloneLiveServer.js +13 -0
  33. package/dist/adapters/standaloneLiveServer.js.map +1 -0
  34. package/dist/adapters/withClientProtocol.d.ts +4 -0
  35. package/dist/adapters/withClientProtocol.d.ts.map +1 -0
  36. package/dist/adapters/withClientProtocol.js +6 -0
  37. package/dist/adapters/withClientProtocol.js.map +1 -0
  38. package/dist/adapters/withPolicyContext.d.ts +4 -0
  39. package/dist/adapters/withPolicyContext.d.ts.map +1 -0
  40. package/dist/adapters/withPolicyContext.js +7 -0
  41. package/dist/adapters/withPolicyContext.js.map +1 -0
  42. package/dist/aggregateLiveStatus.d.ts.map +1 -0
  43. package/dist/aggregateLiveStatus.js.map +1 -0
  44. package/dist/automaticLive.d.ts.map +1 -1
  45. package/dist/automaticLive.js +7 -7
  46. package/dist/automaticLive.js.map +1 -1
  47. package/dist/automaticQuery.d.ts.map +1 -0
  48. package/dist/{internal/automaticQuery.js → automaticQuery.js} +3 -3
  49. package/dist/automaticQuery.js.map +1 -0
  50. package/dist/bind.d.ts.map +1 -1
  51. package/dist/bind.js +2 -2
  52. package/dist/bind.js.map +1 -1
  53. package/dist/changesSuccess.d.ts.map +1 -0
  54. package/dist/changesSuccess.js.map +1 -0
  55. package/dist/{internal/clientActivity.d.ts → clientActivities.d.ts} +9 -9
  56. package/dist/clientActivities.d.ts.map +1 -0
  57. package/dist/{internal/clientActivity.js → clientActivities.js} +1 -1
  58. package/dist/clientActivities.js.map +1 -0
  59. package/dist/clientOperations.d.ts.map +1 -0
  60. package/dist/{internal/clientOperations.js → clientOperations.js} +4 -4
  61. package/dist/clientOperations.js.map +1 -0
  62. package/dist/commandPayload.d.ts.map +1 -0
  63. package/dist/commandPayload.js.map +1 -0
  64. package/dist/commandResult.d.ts +7 -0
  65. package/dist/commandResult.d.ts.map +1 -0
  66. package/dist/commandResult.js +11 -0
  67. package/dist/commandResult.js.map +1 -0
  68. package/dist/compareQueries.d.ts.map +1 -0
  69. package/dist/{internal/compareQueries.js → compareQueries.js} +5 -6
  70. package/dist/compareQueries.js.map +1 -0
  71. package/dist/connectionProtocol.d.ts.map +1 -0
  72. package/dist/connectionProtocol.js.map +1 -0
  73. package/dist/connectionReadiness.d.ts.map +1 -0
  74. package/dist/connectionReadiness.js.map +1 -0
  75. package/dist/contract.d.ts +1 -1
  76. package/dist/contract.d.ts.map +1 -1
  77. package/dist/contract.js +2 -2
  78. package/dist/contract.js.map +1 -1
  79. package/dist/declarationError.d.ts.map +1 -0
  80. package/dist/declarationError.js.map +1 -0
  81. package/dist/live-server/initialize.d.ts +6 -0
  82. package/dist/live-server/initialize.d.ts.map +1 -0
  83. package/dist/live-server/initialize.js +7 -0
  84. package/dist/live-server/initialize.js.map +1 -0
  85. package/dist/live-server/layer.d.ts +3 -0
  86. package/dist/live-server/layer.d.ts.map +1 -0
  87. package/dist/live-server/layer.js +5 -0
  88. package/dist/live-server/layer.js.map +1 -0
  89. package/dist/live-server/register.d.ts +26 -0
  90. package/dist/live-server/register.d.ts.map +1 -0
  91. package/dist/live-server/register.js +8 -0
  92. package/dist/live-server/register.js.map +1 -0
  93. package/dist/live-server/resync.d.ts +5 -0
  94. package/dist/live-server/resync.d.ts.map +1 -0
  95. package/dist/live-server/resync.js +10 -0
  96. package/dist/live-server/resync.js.map +1 -0
  97. package/dist/live-server/service.d.ts +49 -0
  98. package/dist/live-server/service.d.ts.map +1 -0
  99. package/dist/live-server/service.js +19 -0
  100. package/dist/live-server/service.js.map +1 -0
  101. package/dist/{internal/live-server → live-server}/stream.d.ts +4 -4
  102. package/dist/live-server/stream.d.ts.map +1 -0
  103. package/dist/live-server/stream.js +8 -0
  104. package/dist/live-server/stream.js.map +1 -0
  105. package/dist/live-server/subscribe.d.ts +6 -0
  106. package/dist/live-server/subscribe.d.ts.map +1 -0
  107. package/dist/live-server/subscribe.js +30 -0
  108. package/dist/live-server/subscribe.js.map +1 -0
  109. package/dist/live.d.ts.map +1 -1
  110. package/dist/live.js +5 -5
  111. package/dist/live.js.map +1 -1
  112. package/dist/liveAttempt.d.ts.map +1 -0
  113. package/dist/liveAttempt.js.map +1 -0
  114. package/dist/liveHintQueue.d.ts.map +1 -0
  115. package/dist/liveHintQueue.js.map +1 -0
  116. package/dist/liveInvalidation.d.ts.map +1 -0
  117. package/dist/liveInvalidation.js.map +1 -0
  118. package/dist/livePending.d.ts.map +1 -0
  119. package/dist/livePending.js.map +1 -0
  120. package/dist/liveRetry.d.ts.map +1 -0
  121. package/dist/liveRetry.js.map +1 -0
  122. package/dist/makeLiveServer.d.ts +5 -10
  123. package/dist/makeLiveServer.d.ts.map +1 -1
  124. package/dist/makeLiveServer.js +3 -90
  125. package/dist/makeLiveServer.js.map +1 -1
  126. package/dist/operation.d.ts +1 -1
  127. package/dist/operation.d.ts.map +1 -1
  128. package/dist/operation.js +1 -1
  129. package/dist/operation.js.map +1 -1
  130. package/dist/operationDeclaration.d.ts.map +1 -0
  131. package/dist/operationDeclaration.js.map +1 -0
  132. package/dist/policyContext.d.ts.map +1 -0
  133. package/dist/policyContext.js.map +1 -0
  134. package/dist/prependMiddleware.d.ts.map +1 -0
  135. package/dist/prependMiddleware.js.map +1 -0
  136. package/dist/queryDelivery.d.ts.map +1 -0
  137. package/dist/queryDelivery.js.map +1 -0
  138. package/dist/queryFailure.d.ts.map +1 -0
  139. package/dist/queryFailure.js.map +1 -0
  140. package/dist/queryHints.d.ts.map +1 -0
  141. package/dist/queryHints.js.map +1 -0
  142. package/dist/queryKeys.d.ts.map +1 -1
  143. package/dist/queryKeys.js +2 -2
  144. package/dist/queryKeys.js.map +1 -1
  145. package/dist/{internal/querySignals.d.ts → queryProgress.d.ts} +1 -1
  146. package/dist/queryProgress.d.ts.map +1 -0
  147. package/dist/{internal/querySignals.js → queryProgress.js} +1 -1
  148. package/dist/queryProgress.js.map +1 -0
  149. package/dist/queryReactivity.d.ts.map +1 -0
  150. package/dist/queryReactivity.js.map +1 -0
  151. package/dist/queryReadKeys.d.ts.map +1 -0
  152. package/dist/queryReadKeys.js.map +1 -0
  153. package/dist/queryResult.d.ts.map +1 -0
  154. package/dist/queryResult.js.map +1 -0
  155. package/dist/querySubscription.js +6 -12
  156. package/dist/querySubscription.js.map +1 -1
  157. package/dist/readPolicy.js +2 -3
  158. package/dist/readPolicy.js.map +1 -1
  159. package/dist/resolveQueries.d.ts.map +1 -0
  160. package/dist/resolveQueries.js.map +1 -0
  161. package/dist/resume.js +1 -1
  162. package/dist/resume.js.map +1 -1
  163. package/dist/resumeSources.d.ts.map +1 -0
  164. package/dist/resumeSources.js.map +1 -0
  165. package/dist/retryOnChange.d.ts.map +1 -0
  166. package/dist/retryOnChange.js.map +1 -0
  167. package/dist/rpcClient.d.ts.map +1 -0
  168. package/dist/{internal/rpcClient.js → rpcClient.js} +3 -2
  169. package/dist/rpcClient.js.map +1 -0
  170. package/dist/serverMetadata.d.ts +1 -1
  171. package/dist/serverMetadata.d.ts.map +1 -1
  172. package/dist/serverMetadata.js +2 -2
  173. package/dist/serverMetadata.js.map +1 -1
  174. package/dist/socketProtocol.d.ts.map +1 -0
  175. package/dist/socketProtocol.js.map +1 -0
  176. package/dist/subject.d.ts +1 -1
  177. package/dist/subject.d.ts.map +1 -1
  178. package/dist/subjectLayers.d.ts +1 -1
  179. package/dist/subjectLayers.d.ts.map +1 -1
  180. package/dist/subjectLayers.js +1 -1
  181. package/dist/subjectLayers.js.map +1 -1
  182. package/dist/subjectMiddleware.d.ts.map +1 -0
  183. package/dist/subjectMiddleware.js.map +1 -0
  184. package/dist/wrapAtom.d.ts.map +1 -0
  185. package/dist/wrapAtom.js.map +1 -0
  186. package/package.json +15 -15
  187. package/src/CommandGuard.ts +16 -6
  188. package/src/CommandResultKeys.ts +4 -0
  189. package/src/adapters/LiveDispatcher.ts +10 -0
  190. package/src/adapters/liveHintStream.ts +15 -0
  191. package/src/adapters/openLiveHints.ts +62 -0
  192. package/src/adapters/refreshSubscription.ts +6 -0
  193. package/src/adapters/resumeSocket.ts +2 -2
  194. package/src/adapters/standaloneLiveServer.ts +19 -0
  195. package/src/adapters/withClientProtocol.ts +10 -0
  196. package/src/adapters/withPolicyContext.ts +8 -0
  197. package/src/automaticLive.ts +7 -7
  198. package/src/{internal/automaticQuery.ts → automaticQuery.ts} +3 -3
  199. package/src/bind.ts +2 -2
  200. package/src/{internal/clientOperations.ts → clientOperations.ts} +4 -4
  201. package/src/commandResult.ts +15 -0
  202. package/src/{internal/compareQueries.ts → compareQueries.ts} +5 -6
  203. package/src/contract.ts +2 -2
  204. package/src/live-server/initialize.ts +7 -0
  205. package/src/live-server/layer.ts +5 -0
  206. package/src/live-server/register.ts +10 -0
  207. package/src/live-server/resync.ts +11 -0
  208. package/src/live-server/service.ts +19 -0
  209. package/src/live-server/stream.ts +10 -0
  210. package/src/live-server/subscribe.ts +47 -0
  211. package/src/live.ts +5 -5
  212. package/src/makeLiveServer.ts +3 -104
  213. package/src/operation.ts +1 -1
  214. package/src/queryKeys.ts +2 -2
  215. package/src/querySubscription.ts +9 -12
  216. package/src/readPolicy.ts +2 -3
  217. package/src/resume.ts +1 -1
  218. package/src/{internal/rpcClient.ts → rpcClient.ts} +5 -7
  219. package/src/serverMetadata.ts +2 -2
  220. package/src/subject.ts +1 -1
  221. package/src/subjectLayers.ts +1 -1
  222. package/dist/LiveServer.d.ts +0 -27
  223. package/dist/LiveServer.d.ts.map +0 -1
  224. package/dist/LiveServer.js +0 -18
  225. package/dist/LiveServer.js.map +0 -1
  226. package/dist/internal/aggregateLiveStatus.d.ts.map +0 -1
  227. package/dist/internal/aggregateLiveStatus.js.map +0 -1
  228. package/dist/internal/automaticQuery.d.ts.map +0 -1
  229. package/dist/internal/automaticQuery.js.map +0 -1
  230. package/dist/internal/changesSuccess.d.ts.map +0 -1
  231. package/dist/internal/changesSuccess.js.map +0 -1
  232. package/dist/internal/clientActivity.d.ts.map +0 -1
  233. package/dist/internal/clientActivity.js.map +0 -1
  234. package/dist/internal/clientOperations.d.ts.map +0 -1
  235. package/dist/internal/clientOperations.js.map +0 -1
  236. package/dist/internal/commandPayload.d.ts.map +0 -1
  237. package/dist/internal/commandPayload.js.map +0 -1
  238. package/dist/internal/compareQueries.d.ts.map +0 -1
  239. package/dist/internal/compareQueries.js.map +0 -1
  240. package/dist/internal/connectionProtocol.d.ts.map +0 -1
  241. package/dist/internal/connectionProtocol.js.map +0 -1
  242. package/dist/internal/connectionReadiness.d.ts.map +0 -1
  243. package/dist/internal/connectionReadiness.js.map +0 -1
  244. package/dist/internal/declarationError.d.ts.map +0 -1
  245. package/dist/internal/declarationError.js.map +0 -1
  246. package/dist/internal/live-server/resync.d.ts +0 -4
  247. package/dist/internal/live-server/resync.d.ts.map +0 -1
  248. package/dist/internal/live-server/resync.js +0 -4
  249. package/dist/internal/live-server/resync.js.map +0 -1
  250. package/dist/internal/live-server/stream.d.ts.map +0 -1
  251. package/dist/internal/live-server/stream.js +0 -5
  252. package/dist/internal/live-server/stream.js.map +0 -1
  253. package/dist/internal/live-server/subscribe.d.ts +0 -7
  254. package/dist/internal/live-server/subscribe.d.ts.map +0 -1
  255. package/dist/internal/live-server/subscribe.js +0 -8
  256. package/dist/internal/live-server/subscribe.js.map +0 -1
  257. package/dist/internal/liveAttempt.d.ts.map +0 -1
  258. package/dist/internal/liveAttempt.js.map +0 -1
  259. package/dist/internal/liveHintQueue.d.ts.map +0 -1
  260. package/dist/internal/liveHintQueue.js.map +0 -1
  261. package/dist/internal/liveInvalidation.d.ts.map +0 -1
  262. package/dist/internal/liveInvalidation.js.map +0 -1
  263. package/dist/internal/livePending.d.ts.map +0 -1
  264. package/dist/internal/livePending.js.map +0 -1
  265. package/dist/internal/liveRetry.d.ts.map +0 -1
  266. package/dist/internal/liveRetry.js.map +0 -1
  267. package/dist/internal/operationDeclaration.d.ts.map +0 -1
  268. package/dist/internal/operationDeclaration.js.map +0 -1
  269. package/dist/internal/policyContext.d.ts.map +0 -1
  270. package/dist/internal/policyContext.js.map +0 -1
  271. package/dist/internal/prependMiddleware.d.ts.map +0 -1
  272. package/dist/internal/prependMiddleware.js.map +0 -1
  273. package/dist/internal/queryDelivery.d.ts.map +0 -1
  274. package/dist/internal/queryDelivery.js.map +0 -1
  275. package/dist/internal/queryFailure.d.ts.map +0 -1
  276. package/dist/internal/queryFailure.js.map +0 -1
  277. package/dist/internal/queryHints.d.ts.map +0 -1
  278. package/dist/internal/queryHints.js.map +0 -1
  279. package/dist/internal/queryReactivity.d.ts.map +0 -1
  280. package/dist/internal/queryReactivity.js.map +0 -1
  281. package/dist/internal/queryReadKeys.d.ts.map +0 -1
  282. package/dist/internal/queryReadKeys.js.map +0 -1
  283. package/dist/internal/queryResult.d.ts.map +0 -1
  284. package/dist/internal/queryResult.js.map +0 -1
  285. package/dist/internal/querySignals.d.ts.map +0 -1
  286. package/dist/internal/querySignals.js.map +0 -1
  287. package/dist/internal/resolveQueries.d.ts.map +0 -1
  288. package/dist/internal/resolveQueries.js.map +0 -1
  289. package/dist/internal/resumeSources.d.ts.map +0 -1
  290. package/dist/internal/resumeSources.js.map +0 -1
  291. package/dist/internal/retryOnChange.d.ts.map +0 -1
  292. package/dist/internal/retryOnChange.js.map +0 -1
  293. package/dist/internal/rpcClient.d.ts.map +0 -1
  294. package/dist/internal/rpcClient.js.map +0 -1
  295. package/dist/internal/socketProtocol.d.ts.map +0 -1
  296. package/dist/internal/socketProtocol.js.map +0 -1
  297. package/dist/internal/subjectMiddleware.d.ts.map +0 -1
  298. package/dist/internal/subjectMiddleware.js.map +0 -1
  299. package/dist/internal/wrapAtom.d.ts.map +0 -1
  300. package/dist/internal/wrapAtom.js.map +0 -1
  301. package/src/LiveServer.ts +0 -18
  302. package/src/internal/live-server/resync.ts +0 -6
  303. package/src/internal/live-server/stream.ts +0 -7
  304. package/src/internal/live-server/subscribe.ts +0 -16
  305. /package/dist/{internal/aggregateLiveStatus.d.ts → aggregateLiveStatus.d.ts} +0 -0
  306. /package/dist/{internal/aggregateLiveStatus.js → aggregateLiveStatus.js} +0 -0
  307. /package/dist/{internal/automaticQuery.d.ts → automaticQuery.d.ts} +0 -0
  308. /package/dist/{internal/changesSuccess.d.ts → changesSuccess.d.ts} +0 -0
  309. /package/dist/{internal/changesSuccess.js → changesSuccess.js} +0 -0
  310. /package/dist/{internal/clientOperations.d.ts → clientOperations.d.ts} +0 -0
  311. /package/dist/{internal/commandPayload.d.ts → commandPayload.d.ts} +0 -0
  312. /package/dist/{internal/commandPayload.js → commandPayload.js} +0 -0
  313. /package/dist/{internal/compareQueries.d.ts → compareQueries.d.ts} +0 -0
  314. /package/dist/{internal/connectionProtocol.d.ts → connectionProtocol.d.ts} +0 -0
  315. /package/dist/{internal/connectionProtocol.js → connectionProtocol.js} +0 -0
  316. /package/dist/{internal/connectionReadiness.d.ts → connectionReadiness.d.ts} +0 -0
  317. /package/dist/{internal/connectionReadiness.js → connectionReadiness.js} +0 -0
  318. /package/dist/{internal/declarationError.d.ts → declarationError.d.ts} +0 -0
  319. /package/dist/{internal/declarationError.js → declarationError.js} +0 -0
  320. /package/dist/{internal/liveAttempt.d.ts → liveAttempt.d.ts} +0 -0
  321. /package/dist/{internal/liveAttempt.js → liveAttempt.js} +0 -0
  322. /package/dist/{internal/liveHintQueue.d.ts → liveHintQueue.d.ts} +0 -0
  323. /package/dist/{internal/liveHintQueue.js → liveHintQueue.js} +0 -0
  324. /package/dist/{internal/liveInvalidation.d.ts → liveInvalidation.d.ts} +0 -0
  325. /package/dist/{internal/liveInvalidation.js → liveInvalidation.js} +0 -0
  326. /package/dist/{internal/livePending.d.ts → livePending.d.ts} +0 -0
  327. /package/dist/{internal/livePending.js → livePending.js} +0 -0
  328. /package/dist/{internal/liveRetry.d.ts → liveRetry.d.ts} +0 -0
  329. /package/dist/{internal/liveRetry.js → liveRetry.js} +0 -0
  330. /package/dist/{internal/operationDeclaration.d.ts → operationDeclaration.d.ts} +0 -0
  331. /package/dist/{internal/operationDeclaration.js → operationDeclaration.js} +0 -0
  332. /package/dist/{internal/policyContext.d.ts → policyContext.d.ts} +0 -0
  333. /package/dist/{internal/policyContext.js → policyContext.js} +0 -0
  334. /package/dist/{internal/prependMiddleware.d.ts → prependMiddleware.d.ts} +0 -0
  335. /package/dist/{internal/prependMiddleware.js → prependMiddleware.js} +0 -0
  336. /package/dist/{internal/queryDelivery.d.ts → queryDelivery.d.ts} +0 -0
  337. /package/dist/{internal/queryDelivery.js → queryDelivery.js} +0 -0
  338. /package/dist/{internal/queryFailure.d.ts → queryFailure.d.ts} +0 -0
  339. /package/dist/{internal/queryFailure.js → queryFailure.js} +0 -0
  340. /package/dist/{internal/queryHints.d.ts → queryHints.d.ts} +0 -0
  341. /package/dist/{internal/queryHints.js → queryHints.js} +0 -0
  342. /package/dist/{internal/queryReactivity.d.ts → queryReactivity.d.ts} +0 -0
  343. /package/dist/{internal/queryReactivity.js → queryReactivity.js} +0 -0
  344. /package/dist/{internal/queryReadKeys.d.ts → queryReadKeys.d.ts} +0 -0
  345. /package/dist/{internal/queryReadKeys.js → queryReadKeys.js} +0 -0
  346. /package/dist/{internal/queryResult.d.ts → queryResult.d.ts} +0 -0
  347. /package/dist/{internal/queryResult.js → queryResult.js} +0 -0
  348. /package/dist/{internal/resolveQueries.d.ts → resolveQueries.d.ts} +0 -0
  349. /package/dist/{internal/resolveQueries.js → resolveQueries.js} +0 -0
  350. /package/dist/{internal/resumeSources.d.ts → resumeSources.d.ts} +0 -0
  351. /package/dist/{internal/resumeSources.js → resumeSources.js} +0 -0
  352. /package/dist/{internal/retryOnChange.d.ts → retryOnChange.d.ts} +0 -0
  353. /package/dist/{internal/retryOnChange.js → retryOnChange.js} +0 -0
  354. /package/dist/{internal/rpcClient.d.ts → rpcClient.d.ts} +0 -0
  355. /package/dist/{internal/socketProtocol.d.ts → socketProtocol.d.ts} +0 -0
  356. /package/dist/{internal/socketProtocol.js → socketProtocol.js} +0 -0
  357. /package/dist/{internal/subjectMiddleware.d.ts → subjectMiddleware.d.ts} +0 -0
  358. /package/dist/{internal/subjectMiddleware.js → subjectMiddleware.js} +0 -0
  359. /package/dist/{internal/wrapAtom.d.ts → wrapAtom.d.ts} +0 -0
  360. /package/dist/{internal/wrapAtom.js → wrapAtom.js} +0 -0
  361. /package/src/{internal/aggregateLiveStatus.ts → aggregateLiveStatus.ts} +0 -0
  362. /package/src/{internal/changesSuccess.ts → changesSuccess.ts} +0 -0
  363. /package/src/{internal/clientActivity.ts → clientActivities.ts} +0 -0
  364. /package/src/{internal/commandPayload.ts → commandPayload.ts} +0 -0
  365. /package/src/{internal/connectionProtocol.ts → connectionProtocol.ts} +0 -0
  366. /package/src/{internal/connectionReadiness.ts → connectionReadiness.ts} +0 -0
  367. /package/src/{internal/declarationError.ts → declarationError.ts} +0 -0
  368. /package/src/{internal/liveAttempt.ts → liveAttempt.ts} +0 -0
  369. /package/src/{internal/liveHintQueue.ts → liveHintQueue.ts} +0 -0
  370. /package/src/{internal/liveInvalidation.ts → liveInvalidation.ts} +0 -0
  371. /package/src/{internal/livePending.ts → livePending.ts} +0 -0
  372. /package/src/{internal/liveRetry.ts → liveRetry.ts} +0 -0
  373. /package/src/{internal/operationDeclaration.ts → operationDeclaration.ts} +0 -0
  374. /package/src/{internal/policyContext.ts → policyContext.ts} +0 -0
  375. /package/src/{internal/prependMiddleware.ts → prependMiddleware.ts} +0 -0
  376. /package/src/{internal/queryDelivery.ts → queryDelivery.ts} +0 -0
  377. /package/src/{internal/queryFailure.ts → queryFailure.ts} +0 -0
  378. /package/src/{internal/queryHints.ts → queryHints.ts} +0 -0
  379. /package/src/{internal/querySignals.ts → queryProgress.ts} +0 -0
  380. /package/src/{internal/queryReactivity.ts → queryReactivity.ts} +0 -0
  381. /package/src/{internal/queryReadKeys.ts → queryReadKeys.ts} +0 -0
  382. /package/src/{internal/queryResult.ts → queryResult.ts} +0 -0
  383. /package/src/{internal/resolveQueries.ts → resolveQueries.ts} +0 -0
  384. /package/src/{internal/resumeSources.ts → resumeSources.ts} +0 -0
  385. /package/src/{internal/retryOnChange.ts → retryOnChange.ts} +0 -0
  386. /package/src/{internal/socketProtocol.ts → socketProtocol.ts} +0 -0
  387. /package/src/{internal/subjectMiddleware.ts → subjectMiddleware.ts} +0 -0
  388. /package/src/{internal/wrapAtom.ts → wrapAtom.ts} +0 -0
@@ -2,11 +2,11 @@ import { Cause, type Duration, Option, Predicate } from "effect";
2
2
  import * as AsyncResult from "effect/reactivity/AsyncResult";
3
3
  import * as Atom from "effect/reactivity/Atom";
4
4
  import type { LiveBound, LiveConnection } from "#automaticLive.ts";
5
- import { queryFailure } from "#internal/queryFailure.ts";
6
- import { queryResult } from "#internal/queryResult.ts";
7
- import { recordCompletion, recordSubscription } from "#internal/querySignals.ts";
8
5
  import type { LiveStatus } from "#live.ts";
9
6
  import { queryCoalesceWindow } from "#queryCoalesceWindow.ts";
7
+ import { queryFailure } from "#queryFailure.ts";
8
+ import { recordCompletion, recordSubscription } from "#queryProgress.ts";
9
+ import { queryResult } from "#queryResult.ts";
10
10
  import type { QuerySignals } from "#querySignals.ts";
11
11
 
12
12
  interface GateOptions<A, E> {
package/src/bind.ts CHANGED
@@ -9,13 +9,13 @@ import type { Rpc, RpcGroup } from "effect/rpc";
9
9
  import type { RpcClientError } from "effect/rpc/RpcClientError";
10
10
  import { bindingOwner } from "#adapters/bindingOwner.ts";
11
11
  import { automaticLive, type LiveBound, LiveConnection } from "#automaticLive.ts";
12
+ import { clientOperations } from "#clientOperations.ts";
12
13
  import type { ClientOptions, MadeClient } from "#clientOptions.ts";
13
14
  import type { Contract, Declared } from "#contract.ts";
14
- import { clientOperations } from "#internal/clientOperations.ts";
15
- import { type RpcSource, rpcClient } from "#internal/rpcClient.ts";
16
15
  import type { CommandShape, QueryShape, StreamShape } from "#operation.ts";
17
16
  import type { Tag } from "#operationRpc.ts";
18
17
  import type { ResumeSource, ResumeWindow } from "#resume.ts";
18
+ import { type RpcSource, rpcClient } from "#rpcClient.ts";
19
19
 
20
20
  export type Failure<R extends Rpc.Any> =
21
21
  R extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer TMiddleware, infer _Requires>
@@ -9,12 +9,12 @@ import type { BindingOwner } from "#adapters/bindingOwner.ts";
9
9
  import { clientId } from "#adapters/clientId.ts";
10
10
  import type { automaticLive } from "#automaticLive.ts";
11
11
  import type { QueryOptions } from "#bind.ts";
12
+ import { clientActivities } from "#clientActivities.ts";
12
13
  import { clientInvalidationKeys, clientReadKeys } from "#clientKeys.ts";
13
- import { clientActivities } from "#internal/clientActivity.ts";
14
- import { commandPayload } from "#internal/commandPayload.ts";
15
- import { waitForConnection } from "#internal/connectionReadiness.ts";
16
- import { queryReactivity } from "#internal/queryReactivity.ts";
14
+ import { commandPayload } from "#commandPayload.ts";
15
+ import { waitForConnection } from "#connectionReadiness.ts";
17
16
  import type { CommandShape, QueryShape } from "#operation.ts";
17
+ import { queryReactivity } from "#queryReactivity.ts";
18
18
  import { shareQuerySignals } from "#querySignals.ts";
19
19
 
20
20
  type ErasedClient = AtomRpc.AtomRpcClient<unknown, string, Rpc.Rpc<string, Schema.Top, Schema.Top, Schema.Top>>;
@@ -0,0 +1,15 @@
1
+ import { Effect, Option, Ref } from "effect";
2
+ import type { Key } from "@shivaedev/changes/keys.ts";
3
+ import { CommandResultKeys } from "#CommandResultKeys.ts";
4
+
5
+ export const commandResult = Effect.fnUntraced(function* <A>(value: {
6
+ readonly result: A;
7
+ readonly invalidates: readonly Key[];
8
+ }): Effect.fn.Return<A> {
9
+ const keys = yield* Effect.serviceOption(CommandResultKeys);
10
+ if (Option.isNone(keys)) {
11
+ return yield* Effect.die("commandResult requires the command guard");
12
+ }
13
+ yield* Ref.update(keys.value, (previous) => [...previous, ...value.invalidates]);
14
+ return value.result;
15
+ });
@@ -1,8 +1,8 @@
1
- import { Crypto, Effect, Schema } from "effect";
2
- import * as Hex from "effect/encoding/Hex";
1
+ import { Effect, Schema } from "effect";
2
+ import { Digest } from "effect/crypto";
3
3
  import type { Key } from "@shivaedev/changes/keys.ts";
4
- import { changedHint } from "#internal/queryHints.ts";
5
4
  import type { LiveHint } from "#live.ts";
5
+ import { changedHint } from "#queryHints.ts";
6
6
  import type { QueryRerun, QuerySubscription } from "#querySubscription.ts";
7
7
  import type { QueryResult, QueryUnchanged, QueryUpdate } from "#queryUpdate.ts";
8
8
  import type { QueryRequest } from "#serverMetadata.ts";
@@ -36,9 +36,8 @@ export function compareQueries<E, R>(subscription: QuerySubscription<unknown, un
36
36
  }
37
37
  const value = yield* read(request);
38
38
  const encoded = yield* Schema.encodeUnknownEffect(Schema.toCodecJson(request.query.success))(value).pipe(Effect.orDie);
39
- const crypto = yield* Crypto.Crypto;
40
- const digest = yield* crypto.digest("SHA-256", new TextEncoder().encode(JSON.stringify(encoded))).pipe(Effect.orDie);
41
- const hash = Hex.encode(digest);
39
+ const digest = yield* Digest.Digest;
40
+ const hash = yield* digest.digestHex(Digest.sha256, new TextEncoder().encode(JSON.stringify(encoded)));
42
41
  if (hash === hashes.get(index)) {
43
42
  return { _tag: "Unchanged", queryIndex: index } satisfies QueryUnchanged;
44
43
  }
package/src/contract.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { Schema } from "effect";
2
2
  import { Rpc, RpcGroup, type RpcMiddleware } from "effect/rpc";
3
- import { declarationError, type Unique } from "#internal/declarationError.ts";
4
- import { subjectMiddleware } from "#internal/subjectMiddleware.ts";
3
+ import { declarationError, type Unique } from "#declarationError.ts";
5
4
  import type { CommandShape, QueryShape, StreamShape } from "#operation.ts";
6
5
  import type { OperationRpc } from "#operationRpc.ts";
7
6
  import { ReadPolicyGuard } from "#ReadPolicyGuard.ts";
8
7
  import { QueryReadDenied } from "#readPolicyErrors.ts";
9
8
  import { changesRpc, KeyScope, operationAnnotations } from "#serverMetadata.ts";
10
9
  import type { SubjectDeclaration, WithSubject } from "#subject.ts";
10
+ import { subjectMiddleware } from "#subjectMiddleware.ts";
11
11
 
12
12
  export type QueryServices<TQuery> = TQuery extends QueryShape<unknown, infer R> ? R : never;
13
13
 
@@ -0,0 +1,7 @@
1
+ import { Effect, Random, Ref } from "effect";
2
+
3
+ export const initialize = Effect.gen(function* () {
4
+ const openStreams = yield* Ref.make(0);
5
+ const resyncKey = `@shivaedev/contract/resync/${yield* Random.nextInt}`;
6
+ return { openStreams, resyncKey };
7
+ });
@@ -0,0 +1,5 @@
1
+ import { Layer } from "effect";
2
+ import { LiveDispatcher } from "#adapters/LiveDispatcher.ts";
3
+ import { LiveServer } from "./service.ts";
4
+
5
+ export const liveServerLayer = LiveServer.layer.pipe(Layer.provide(LiveDispatcher.layer));
@@ -0,0 +1,10 @@
1
+ import { Effect } from "effect";
2
+ import type { Key } from "@shivaedev/changes/keys.ts";
3
+ import { liveHintStream } from "#adapters/liveHintStream.ts";
4
+ import type { initialize } from "./initialize.ts";
5
+
6
+ export function register(state: Effect.Success<typeof initialize>) {
7
+ return Effect.fn("LiveServer.register")(function* (keys: readonly Key[]) {
8
+ return yield* liveHintStream(state, keys);
9
+ });
10
+ }
@@ -0,0 +1,11 @@
1
+ import { Effect, Ref } from "effect";
2
+ import * as Reactivity from "effect/reactivity/Reactivity";
3
+ import type { initialize } from "./initialize.ts";
4
+
5
+ export function resync(state: Effect.Success<typeof initialize>) {
6
+ return Effect.fn("LiveServer.resync")(function* () {
7
+ const reactivity = yield* Reactivity.Reactivity;
8
+ yield* Effect.sync(() => reactivity.invalidateUnsafe([state.resyncKey]));
9
+ return yield* Ref.get(state.openStreams);
10
+ });
11
+ }
@@ -0,0 +1,19 @@
1
+ import { Random } from "effect";
2
+ import * as Reactivity from "effect/reactivity/Reactivity";
3
+ import { defineService } from "@shivaedev/service/defineService.ts";
4
+ import { LiveDispatcher } from "#adapters/LiveDispatcher.ts";
5
+ import { initialize } from "./initialize.ts";
6
+ import { register } from "./register.ts";
7
+ import { resync } from "./resync.ts";
8
+ import { stream } from "./stream.ts";
9
+
10
+ export const LiveServer = defineService({
11
+ id: "@shivaedev/contract/LiveServer",
12
+ initialize,
13
+ methods: (state) => ({
14
+ register: register(state),
15
+ resync: resync(state),
16
+ stream: stream(state),
17
+ }),
18
+ requires: [Reactivity.Reactivity, LiveDispatcher, Random.Random],
19
+ });
@@ -0,0 +1,10 @@
1
+ import { Effect, Stream } from "effect";
2
+ import type { Key } from "@shivaedev/changes/keys.ts";
3
+ import { liveHintStream } from "#adapters/liveHintStream.ts";
4
+ import type { initialize } from "./initialize.ts";
5
+
6
+ export function stream(state: Effect.Success<typeof initialize>) {
7
+ return Effect.fn("LiveServer.stream")(function* (keys: readonly Key[]) {
8
+ return (yield* liveHintStream(state, keys)).pipe(Stream.flatMap((registration) => registration.stream));
9
+ });
10
+ }
@@ -0,0 +1,47 @@
1
+ import { Effect, Stream } from "effect";
2
+ import { refreshSubscription } from "#adapters/refreshSubscription.ts";
3
+ import { compareQueries } from "#compareQueries.ts";
4
+ import type { LiveHint } from "#live.ts";
5
+ import type { QueryRerun, QuerySubscription } from "#querySubscription.ts";
6
+ import type { QueryUpdate, SubscriptionHint } from "#queryUpdate.ts";
7
+ import { QueryReadDenied } from "#readPolicyErrors.ts";
8
+ import { LiveServer } from "./service.ts";
9
+
10
+ function subscribeQueries<E, R, TRead extends QueryRerun<unknown, unknown> | undefined = undefined>(
11
+ subscription: QuerySubscription<E, R>,
12
+ read?: TRead & (QueryRerun<E, R> | undefined),
13
+ ): Effect.Effect<
14
+ Stream.Stream<TRead extends undefined ? SubscriptionHint : QueryUpdate, E | QueryReadDenied, R>,
15
+ never,
16
+ typeof LiveServer.Identifier
17
+ >;
18
+ function subscribeQueries<E, R>(subscription: QuerySubscription<E, R>, read?: QueryRerun<E, R>) {
19
+ return Effect.fnUntraced(function* () {
20
+ const server = yield* LiveServer;
21
+ const hints = yield* server.register(subscription.keys);
22
+ return hints.pipe(
23
+ Stream.flatMap((registration) => {
24
+ let scopes = subscription.scopes;
25
+ let compare = compareQueries(subscription, read);
26
+ const next = Effect.fnUntraced(function* (hint: LiveHint) {
27
+ if (!(yield* subscription.authorized)) {
28
+ compare = compareQueries(subscription, read);
29
+ return [new QueryReadDenied({ message: "Read no longer allowed for subscribed queries" })];
30
+ }
31
+ const updates = yield* compare(hint, scopes);
32
+ if (subscription.readScopes !== undefined) {
33
+ scopes = yield* subscription.readScopes;
34
+ registration.replaceKeys(scopes.flat());
35
+ }
36
+ return updates;
37
+ });
38
+ return registration.stream.pipe(
39
+ Stream.mapEffect((hint) => refreshSubscription(subscription, next(hint))),
40
+ Stream.flatMap(Stream.fromIterable),
41
+ );
42
+ }),
43
+ );
44
+ })();
45
+ }
46
+
47
+ export const subscribe = Effect.fn("LiveServer.subscribe")(subscribeQueries);
package/src/live.ts CHANGED
@@ -4,13 +4,13 @@ import type * as AtomRegistry from "effect/reactivity/AtomRegistry";
4
4
  import * as Reactivity from "effect/reactivity/Reactivity";
5
5
  import { Key } from "@shivaedev/changes/keys.ts";
6
6
  import { clientInvalidationKeys, clientReadKeys, type KeyContext } from "#clientKeys.ts";
7
- import { liveAttempt } from "#internal/liveAttempt.ts";
8
- import { invalidateLive } from "#internal/liveInvalidation.ts";
9
- import { livePending } from "#internal/livePending.ts";
10
- import { liveRetry } from "#internal/liveRetry.ts";
11
- import { retryOnChange } from "#internal/retryOnChange.ts";
7
+ import { liveAttempt } from "#liveAttempt.ts";
8
+ import { invalidateLive } from "#liveInvalidation.ts";
9
+ import { livePending } from "#livePending.ts";
10
+ import { liveRetry } from "#liveRetry.ts";
12
11
  import type { SubscriptionHint } from "#queryUpdate.ts";
13
12
  import type { QueryReadDenied } from "#readPolicyErrors.ts";
13
+ import { retryOnChange } from "#retryOnChange.ts";
14
14
 
15
15
  export const LiveHint = Schema.Union([
16
16
  Schema.Struct({ _tag: Schema.Literal("Changed"), keys: Schema.Array(Key), queryIndexes: Schema.optional(Schema.Array(Schema.Number)) }),
@@ -1,105 +1,4 @@
1
- import { Effect, Queue, Random, Scheduler, Stream } from "effect";
2
- import * as Reactivity from "effect/reactivity/Reactivity";
3
- import { type Key, readKeys } from "@shivaedev/changes/keys.ts";
4
- import { compareQueries } from "#internal/compareQueries.ts";
5
- import { liveHintQueue } from "#internal/liveHintQueue.ts";
6
- import type { LiveHint } from "#live.ts";
7
- import type { QueryRerun, QuerySubscription } from "#querySubscription.ts";
8
- import type { QueryUpdate, SubscriptionHint } from "#queryUpdate.ts";
9
- import { QueryReadDenied } from "#readPolicyErrors.ts";
1
+ import { Effect } from "effect";
2
+ import { standaloneLiveServer } from "#adapters/standaloneLiveServer.ts";
10
3
 
11
- export const makeLiveServer = Effect.gen(function* () {
12
- const reactivity = yield* Reactivity.Reactivity;
13
- const dispatcher = (yield* Scheduler.Scheduler).makeDispatcher();
14
- let openStreams = 0;
15
- const resyncKey = `@shivaedev/contract/resync/${yield* Random.nextInt}`;
16
- function open(keys: readonly Key[]) {
17
- return Effect.gen(function* () {
18
- const { offer, queue } = yield* liveHintQueue;
19
- const pending = new Map<string, Key>();
20
- let scheduled = false;
21
- let resync = false;
22
- let active = true;
23
- function flush() {
24
- if (scheduled) {
25
- return;
26
- }
27
- scheduled = true;
28
- dispatcher.scheduleTask(() => {
29
- scheduled = false;
30
- if (active) {
31
- offer(resync ? { _tag: "Resync" } : { _tag: "Changed", keys: [...pending.values()] });
32
- }
33
- pending.clear();
34
- resync = false;
35
- }, 0);
36
- }
37
- let cancelKeys: (() => void)[] = [];
38
- function replaceKeys(current: readonly Key[]) {
39
- for (const stop of cancelKeys) {
40
- stop();
41
- }
42
- cancelKeys = current.map((key) => {
43
- const own = readKeys([key]);
44
- return reactivity.registerUnsafe(own, () => {
45
- pending.set(own[0] ?? "", key);
46
- flush();
47
- });
48
- });
49
- }
50
- replaceKeys(keys);
51
- const cancel = [
52
- reactivity.registerUnsafe([resyncKey], () => {
53
- resync = true;
54
- flush();
55
- }),
56
- ];
57
- openStreams += 1;
58
- yield* Effect.addFinalizer(() =>
59
- Effect.sync(() => {
60
- active = false;
61
- openStreams -= 1;
62
- for (const stop of [...cancelKeys, ...cancel]) {
63
- stop();
64
- }
65
- }),
66
- );
67
- yield* Queue.offer(queue, { _tag: "Resync" });
68
- return { replaceKeys, stream: Stream.fromQueue(queue) };
69
- });
70
- }
71
- const resync = Effect.sync(() => {
72
- reactivity.invalidateUnsafe([resyncKey]);
73
- return openStreams;
74
- });
75
- function subscribe<E, R>(subscription: QuerySubscription<E, R>): Stream.Stream<SubscriptionHint, E | QueryReadDenied, R>;
76
- function subscribe<E, R>(subscription: QuerySubscription<E, R>, read: QueryRerun<E, R>): Stream.Stream<QueryUpdate, E | QueryReadDenied, R>;
77
- function subscribe<E, R>(subscription: QuerySubscription<E, R>, read?: QueryRerun<E, R>) {
78
- return Stream.unwrap(
79
- Effect.gen(function* () {
80
- const registration = yield* open(subscription.keys);
81
- let scopes = subscription.scopes;
82
- let compare = compareQueries(subscription, read);
83
- const next = Effect.fnUntraced(function* (hint: LiveHint) {
84
- if (!(yield* subscription.authorized)) {
85
- compare = compareQueries(subscription, read);
86
- return [new QueryReadDenied({ message: "Read no longer allowed for subscribed queries" })];
87
- }
88
- const updates = yield* compare(hint, scopes);
89
- if (subscription.readScopes !== undefined) {
90
- scopes = yield* subscription.readScopes;
91
- registration.replaceKeys(scopes.flat());
92
- }
93
- return updates;
94
- });
95
- return registration.stream.pipe(
96
- Stream.mapEffect((hint) =>
97
- Effect.flatMap(subscription.refresh ?? Effect.context<never>(), (current) => Effect.provideContext(next(hint), current)),
98
- ),
99
- Stream.flatMap(Stream.fromIterable),
100
- );
101
- }),
102
- );
103
- }
104
- return { resync, stream: (keys: readonly Key[]) => Stream.unwrap(Effect.map(open(keys), ({ stream }) => stream)), subscribe };
105
- });
4
+ export const makeLiveServer = Effect.fn("LiveServer.makeLiveServer")(() => standaloneLiveServer)();
package/src/operation.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { Option, Schema } from "effect";
2
2
  import type { Key } from "@shivaedev/changes/keys.ts";
3
3
  import type { Bivariant } from "@shivaedev/types/Bivariant.ts";
4
- import { type Declaration, type Loose, operation, type QueryDeclaration } from "#internal/operationDeclaration.ts";
4
+ import { type Declaration, type Loose, operation, type QueryDeclaration } from "#operationDeclaration.ts";
5
5
  import type { QueryServerReads } from "#QueryServerReads.ts";
6
6
  import type { QueryReadPolicy, Viewer } from "#readPolicy.ts";
7
7
  import type { Reject, RejectedBy, RejectionSpecs, Rejections, RejectionUnion } from "#rejection.ts";
package/src/queryKeys.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { Effect, Option } from "effect";
2
2
  import type { Key } from "@shivaedev/changes/keys.ts";
3
3
  import type { QueryServices } from "#contract.ts";
4
- import { queryReadKeys } from "#internal/queryReadKeys.ts";
5
- import { resolveQueries } from "#internal/resolveQueries.ts";
6
4
  import type { QueryShape } from "#operation.ts";
5
+ import { queryReadKeys } from "#queryReadKeys.ts";
7
6
  import { checkQuery, type Viewer } from "#readPolicy.ts";
8
7
  import type { MissingReadPolicy, QueryReadDenied } from "#readPolicyErrors.ts";
8
+ import { resolveQueries } from "#resolveQueries.ts";
9
9
  import type { QueryReference } from "#serverMetadata.ts";
10
10
 
11
11
  export function queryKeys<const TQueries extends readonly QueryShape[]>(
@@ -1,8 +1,8 @@
1
1
  import { Context, Effect, type Option } from "effect";
2
2
  import { Rpc } from "effect/rpc";
3
3
  import type { Key } from "@shivaedev/changes/keys.ts";
4
- import { policyContext } from "#internal/policyContext.ts";
5
- import { queryReadKeys } from "#internal/queryReadKeys.ts";
4
+ import { withPolicyContext } from "#adapters/withPolicyContext.ts";
5
+ import { queryReadKeys } from "#queryReadKeys.ts";
6
6
  import { checkQuery, type PolicyChannels, type Viewer } from "#readPolicy.ts";
7
7
  import type { MissingReadPolicy, QueryReadDenied } from "#readPolicyErrors.ts";
8
8
  import { ChangesQueries, type QueryReference, type QueryRequest } from "#serverMetadata.ts";
@@ -34,17 +34,14 @@ export function querySubscription(rpc: Rpc.Any, references: readonly QueryRefere
34
34
  const policies = yield* Effect.forEach(
35
35
  queries,
36
36
  Effect.fnUntraced(function* ({ query, payload }) {
37
- const context = yield* policyContext(Rpc.make(`${prefix}${query.name}`));
37
+ const policyRpc = Rpc.make(`${prefix}${query.name}`);
38
38
  return {
39
- check: Effect.provideContext(checkQuery(query, payload, viewer), context),
40
- keys: Effect.gen(function* () {
41
- const current = yield* policyContext(Rpc.make(`${prefix}${query.name}`));
42
- return yield* queryReadKeys(query, payload, viewer).pipe(Effect.provideContext(current));
43
- }),
44
- permitted: Effect.gen(function* () {
45
- const current = yield* policyContext(Rpc.make(`${prefix}${query.name}`));
46
- return yield* Effect.suspend(() => query.readPolicy?.(payload, viewer) ?? Effect.succeed(false)).pipe(Effect.provideContext(current));
47
- }),
39
+ check: withPolicyContext(policyRpc, checkQuery(query, payload, viewer)),
40
+ keys: withPolicyContext(policyRpc, queryReadKeys(query, payload, viewer)),
41
+ permitted: withPolicyContext(
42
+ policyRpc,
43
+ Effect.suspend(() => query.readPolicy?.(payload, viewer) ?? Effect.succeed(false)),
44
+ ),
48
45
  };
49
46
  }),
50
47
  );
package/src/readPolicy.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Context, Effect, Option, type Stream, type Types } from "effect";
2
2
  import type { Rpc } from "effect/rpc";
3
- import { policyContext } from "#internal/policyContext.ts";
3
+ import { withPolicyContext } from "#adapters/withPolicyContext.ts";
4
4
  import type { QueryShape } from "#operation.ts";
5
5
  import { isPermissionReadPolicy } from "#permissionReadPolicy.ts";
6
6
  import { MissingReadPolicy, QueryReadDenied } from "#readPolicyErrors.ts";
@@ -49,8 +49,7 @@ export function authorizeReads(
49
49
  return Effect.fnUntraced(function* () {
50
50
  const definition = Context.getOption(request.rpc.annotations, QueryDefinition);
51
51
  if (Option.isSome(definition)) {
52
- const context = yield* policyContext(request.rpc);
53
- yield* checkQuery(definition.value.definition, request.payload, viewer).pipe(Effect.provideContext(context));
52
+ yield* withPolicyContext(request.rpc, checkQuery(definition.value.definition, request.payload, viewer));
54
53
  }
55
54
  return yield* Effect.provideService(effect, CurrentViewer, viewer);
56
55
  })();
package/src/resume.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as Atom from "effect/reactivity/Atom";
2
- import { resumeSources } from "#internal/resumeSources.ts";
2
+ import { resumeSources } from "#resumeSources.ts";
3
3
 
4
4
  export type ResumeSource = (resume: () => void) => () => void;
5
5
 
@@ -3,10 +3,11 @@ import * as Atom from "effect/reactivity/Atom";
3
3
  import * as AtomRpc from "effect/reactivity/AtomRpc";
4
4
  import { type Rpc, RpcClient, RpcGroup } from "effect/rpc";
5
5
  import type { RpcClientError } from "effect/rpc/RpcClientError";
6
+ import { withClientProtocol } from "#adapters/withClientProtocol.ts";
6
7
  import { Activity } from "#clientActivity.ts";
7
8
  import type { ClientOptions } from "#clientOptions.ts";
8
9
  import type { ResumeWindow } from "#resume.ts";
9
- import { clientActivities, makeActivity } from "./clientActivity.ts";
10
+ import { clientActivities, makeActivity } from "./clientActivities.ts";
10
11
  import { connectionProtocol, protocolConnections } from "./connectionProtocol.ts";
11
12
  import { commandConnections } from "./connectionReadiness.ts";
12
13
  import { socketProtocol } from "./socketProtocol.ts";
@@ -75,12 +76,9 @@ export function rpcClient(name: string, source: RpcSource, options: ClientOption
75
76
  runtime: options.runtime,
76
77
  });
77
78
  clientActivities.set(Client, activity);
78
- const directClient = Effect.flatMap(Layer.build(protocol), (context) =>
79
- make.pipe(
80
- Effect.map((flat) =>
81
- Object.fromEntries([...group.requests.keys()].map((tag) => [tag, (payload: never, callOptions: never) => flat(tag, payload, callOptions)])),
82
- ),
83
- Effect.provideContext(context),
79
+ const directClient = withClientProtocol(protocol, make).pipe(
80
+ Effect.map((flat) =>
81
+ Object.fromEntries([...group.requests.keys()].map((tag) => [tag, (payload: never, callOptions: never) => flat(tag, payload, callOptions)])),
84
82
  ),
85
83
  );
86
84
  const layer = Layer.effect(Client, make).pipe(Layer.provide(protocol));
@@ -1,10 +1,10 @@
1
1
  import { Context, type Effect, Schema } from "effect";
2
2
  import { Rpc, type RpcSchema } from "effect/rpc";
3
+ import { changesSuccess } from "#changesSuccess.ts";
3
4
  import type { QueryServices } from "#contract.ts";
4
- import { changesSuccess } from "#internal/changesSuccess.ts";
5
- import { resolveQueries } from "#internal/resolveQueries.ts";
6
5
  import type { CommandShape, QueryShape, StreamShape } from "#operation.ts";
7
6
  import { MissingReadPolicy, QueryReadDenied } from "#readPolicyErrors.ts";
7
+ import { resolveQueries } from "#resolveQueries.ts";
8
8
  import { WebSocketRequired } from "#WebSocketRequired.ts";
9
9
 
10
10
  export class QueryDefinition extends Context.Service<QueryDefinition, { readonly definition: QueryShape }>()("@shivaedev/contract/QueryDefinition") {}
package/src/subject.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Effect, Schema } from "effect";
2
2
  import type { Rpc, RpcMiddleware } from "effect/rpc";
3
- import type { subjectMiddleware } from "#internal/subjectMiddleware.ts";
3
+ import type { subjectMiddleware } from "#subjectMiddleware.ts";
4
4
 
5
5
  export interface SubjectDeclaration {
6
6
  readonly error: Schema.Top;
@@ -1,7 +1,7 @@
1
1
  import { type Context, type Effect, Layer } from "effect";
2
2
  import { Rpc, type RpcGroup, type RpcMiddleware } from "effect/rpc";
3
- import { SUBJECT_TYPE_ID } from "#internal/subjectMiddleware.ts";
4
3
  import type { SubjectDeclaration } from "#subject.ts";
4
+ import { SUBJECT_TYPE_ID } from "#subjectMiddleware.ts";
5
5
 
6
6
  type Middleware<R extends Rpc.Any> = R extends { readonly middlewares: ReadonlySet<infer TMiddleware> }
7
7
  ? Extract<TMiddleware, { readonly [SUBJECT_TYPE_ID]: SubjectDeclaration }>
@@ -1,27 +0,0 @@
1
- import * as Reactivity from "effect/reactivity/Reactivity";
2
- export declare const LiveServer: import("effect/Context").Service<"@shivaedev/contract/LiveServer", Readonly<{
3
- readonly resync: () => import("effect/Effect").Effect<number, never, never>;
4
- readonly stream: (keys: readonly import("@shivaedev/changes/keys.ts").Key[]) => import("effect/Effect").Effect<import("effect/Stream").Stream<{
5
- readonly _tag: "Changed";
6
- readonly keys: readonly ({
7
- readonly _tag: "Bucket";
8
- readonly collection: string;
9
- readonly field: string;
10
- readonly value: string | number;
11
- } | {
12
- readonly _tag: "List";
13
- readonly collection: string;
14
- } | {
15
- readonly _tag: "Item";
16
- readonly collection: string;
17
- readonly id: string | number;
18
- })[];
19
- readonly queryIndexes?: readonly number[] | undefined;
20
- } | {
21
- readonly _tag: "Resync";
22
- }, never, never>, never, never>;
23
- readonly subscribe: <E, R, TRead extends import("./querySubscription.ts").QueryRerun<unknown, unknown> | undefined = undefined>(subscription: import("./querySubscription.ts").QuerySubscription<E, R>, read?: (TRead & (import("./querySubscription.ts").QueryRerun<E, R> | undefined)) | undefined) => import("effect/Effect").Effect<import("effect/Stream").Stream<TRead extends undefined ? import("./queryUpdate.ts").SubscriptionHint : import("./queryUpdate.ts").QueryUpdate, E | import("./readPolicyErrors.ts").QueryReadDenied, R>>;
24
- }>> & {
25
- readonly layer: import("effect/Layer").Layer<"@shivaedev/contract/LiveServer", never, Reactivity.Reactivity>;
26
- };
27
- //# sourceMappingURL=LiveServer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LiveServer.d.ts","sourceRoot":"","sources":["../src/LiveServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAQ3D,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;CASrB,CAAC"}
@@ -1,18 +0,0 @@
1
- import * as Reactivity from "effect/reactivity/Reactivity";
2
- import { defineService } from "@shivaedev/service/defineService.ts";
3
- import { genericMethod } from "@shivaedev/service/genericMethod.ts";
4
- import { resync } from "#internal/live-server/resync.ts";
5
- import { stream } from "#internal/live-server/stream.ts";
6
- import { subscribe } from "#internal/live-server/subscribe.ts";
7
- import { makeLiveServer } from "#makeLiveServer.ts";
8
- export const LiveServer = defineService({
9
- id: "@shivaedev/contract/LiveServer",
10
- initialize: makeLiveServer,
11
- methods: (server) => ({
12
- resync: resync(server),
13
- stream: stream(server),
14
- subscribe: genericMethod(subscribe(server)),
15
- }),
16
- requires: [Reactivity.Reactivity],
17
- });
18
- //# sourceMappingURL=LiveServer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LiveServer.js","sourceRoot":"","sources":["../src/LiveServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;IACvC,EAAE,EAAE,gCAAgC;IACpC,UAAU,EAAE,cAAc;IAC1B,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;QACtB,SAAS,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;KAC3C,CAAC;IACF,QAAQ,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;CACjC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"aggregateLiveStatus.d.ts","sourceRoot":"","sources":["../../src/internal/aggregateLiveStatus.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,UAAU,CAAC,OAAO,CAAC,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAiB/F"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"aggregateLiveStatus.js","sourceRoot":"","sources":["../../src/internal/aggregateLiveStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,MAAM,UAAU,mBAAmB,CAAC,MAAsC;IACzE,IAAI,UAAU,GAAsC,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AAU,EAAE,EAC1E,OAAO,EAAE,QAAQ,GACf,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,QAAQ,EAAE,OAAO,eAAe,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"changesSuccess.js","sourceRoot":"","sources":["../../src/internal/changesSuccess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAiB9G,MAAM,UAAU,cAAc,CAAC,OAA8B;IAC5D,OAAO,MAAM,CAAC,KAAK,CAAC;QACnB,QAAQ;QACR,eAAe;QACf,GAAG,OAAO;aACR,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,mBAAmB,CAAC;aACrD,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;YACnB,cAAc;YACd,MAAM,CAAC,MAAM,CAAC;gBACb,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;gBAC9B,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;gBACjC,UAAU,EAAE,MAAM,CAAC,MAAM;gBACzB,KAAK,EAAE,KAAK,CAAC,OAAO;aACpB,CAAC;SACF,CAAC;KACH,CAAC,CAAC;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"clientActivity.d.ts","sourceRoot":"","sources":["../../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