@effect-app/infra 4.0.0-beta.247 → 4.0.0-beta.249

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 (378) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/ContextProvider.d.ts +34 -0
  3. package/dist/ContextProvider.d.ts.map +1 -0
  4. package/dist/ContextProvider.js +40 -0
  5. package/dist/Emailer/Sendgrid.d.ts +109 -145
  6. package/dist/Emailer/Sendgrid.d.ts.map +1 -1
  7. package/dist/Emailer/Sendgrid.js +4 -3
  8. package/dist/Emailer/fake.d.ts +2 -2
  9. package/dist/Emailer/fake.d.ts.map +1 -1
  10. package/dist/Emailer/fake.js +2 -2
  11. package/dist/QueueMaker/SQLQueue.d.ts +2 -2
  12. package/dist/QueueMaker/SQLQueue.d.ts.map +1 -1
  13. package/dist/QueueMaker/SQLQueue.js +4 -4
  14. package/dist/QueueMaker/memQueue.d.ts +2 -2
  15. package/dist/QueueMaker/memQueue.d.ts.map +1 -1
  16. package/dist/QueueMaker/memQueue.js +4 -4
  17. package/dist/QueueMaker/sbqueue.d.ts +2 -2
  18. package/dist/QueueMaker/sbqueue.d.ts.map +1 -1
  19. package/dist/QueueMaker/sbqueue.js +4 -4
  20. package/dist/RequestFiberSet.js +2 -2
  21. package/dist/{adapters/SQL → SQL}/Model.d.ts +2 -2
  22. package/dist/SQL/Model.d.ts.map +1 -0
  23. package/dist/SQL/Model.js +469 -0
  24. package/dist/{adapters/SQL.d.ts → SQL.d.ts} +1 -1
  25. package/dist/SQL.d.ts.map +1 -0
  26. package/dist/{adapters/SQL.js → SQL.js} +1 -1
  27. package/dist/{adapters/ServiceBus.d.ts → ServiceBus.d.ts} +1 -1
  28. package/dist/ServiceBus.d.ts.map +1 -0
  29. package/dist/ServiceBus.js +108 -0
  30. package/dist/Store/ContextMapContainer.d.ts +2 -2
  31. package/dist/Store/ContextMapContainer.d.ts.map +1 -1
  32. package/dist/Store/ContextMapContainer.js +2 -2
  33. package/dist/Store/Cosmos/query.d.ts +4 -4
  34. package/dist/Store/Cosmos/query.d.ts.map +1 -1
  35. package/dist/Store/Cosmos/query.js +1 -1
  36. package/dist/Store/Cosmos.d.ts +2 -2
  37. package/dist/Store/Cosmos.d.ts.map +1 -1
  38. package/dist/Store/Cosmos.js +3 -3
  39. package/dist/Store/Disk.d.ts +3 -3
  40. package/dist/Store/Disk.d.ts.map +1 -1
  41. package/dist/Store/Disk.js +2 -2
  42. package/dist/Store/Memory.d.ts +3 -3
  43. package/dist/Store/Memory.d.ts.map +1 -1
  44. package/dist/Store/Memory.js +2 -2
  45. package/dist/Store/SQL/Pg.d.ts +2 -2
  46. package/dist/Store/SQL/Pg.d.ts.map +1 -1
  47. package/dist/Store/SQL/Pg.js +2 -2
  48. package/dist/Store/SQL/query.d.ts +3 -3
  49. package/dist/Store/SQL/query.d.ts.map +1 -1
  50. package/dist/Store/SQL/query.js +1 -1
  51. package/dist/Store/SQL.d.ts +3 -3
  52. package/dist/Store/SQL.d.ts.map +1 -1
  53. package/dist/Store/SQL.js +2 -2
  54. package/dist/Store/codeFilter.d.ts +4 -4
  55. package/dist/Store/codeFilter.d.ts.map +1 -1
  56. package/dist/Store/codeFilter.js +1 -1
  57. package/dist/Store/index.d.ts +3 -4
  58. package/dist/Store/index.d.ts.map +1 -1
  59. package/dist/Store/index.js +2 -3
  60. package/dist/Store/utils.d.ts +2 -2
  61. package/dist/Store/utils.d.ts.map +1 -1
  62. package/dist/Store/utils.js +1 -1
  63. package/dist/{api/codec.d.ts → codec.d.ts} +1 -1
  64. package/dist/codec.d.ts.map +1 -0
  65. package/dist/codec.js +5 -0
  66. package/dist/{adapters/cosmos-client.d.ts → cosmos-client.d.ts} +1 -1
  67. package/dist/cosmos-client.d.ts.map +1 -0
  68. package/dist/cosmos-client.js +11 -0
  69. package/dist/errorReporter.d.ts +1 -1
  70. package/dist/errorReporter.d.ts.map +1 -1
  71. package/dist/errorReporter.js +2 -2
  72. package/dist/index.d.ts +3 -2
  73. package/dist/index.d.ts.map +1 -1
  74. package/dist/index.js +3 -2
  75. package/dist/{api/internal → internal}/RequestContextMiddleware.d.ts +2 -2
  76. package/dist/internal/RequestContextMiddleware.d.ts.map +1 -0
  77. package/dist/internal/RequestContextMiddleware.js +46 -0
  78. package/dist/{api/internal → internal}/auth.d.ts +1 -1
  79. package/dist/internal/auth.d.ts.map +1 -0
  80. package/dist/internal/auth.js +180 -0
  81. package/dist/{api/internal → internal}/events.d.ts +1 -1
  82. package/dist/internal/events.d.ts.map +1 -0
  83. package/dist/internal/events.js +49 -0
  84. package/dist/{api/internal → internal}/health.d.ts +1 -1
  85. package/dist/internal/health.d.ts.map +1 -0
  86. package/dist/internal/health.js +5 -0
  87. package/dist/layerUtils.d.ts +32 -0
  88. package/dist/layerUtils.d.ts.map +1 -0
  89. package/dist/layerUtils.js +17 -0
  90. package/dist/logger/jsonLogger.d.ts +1 -1
  91. package/dist/logger/jsonLogger.d.ts.map +1 -1
  92. package/dist/logger/jsonLogger.js +2 -2
  93. package/dist/logger/logFmtLogger.d.ts +1 -1
  94. package/dist/logger/logFmtLogger.d.ts.map +1 -1
  95. package/dist/logger/logFmtLogger.js +2 -2
  96. package/dist/logger/shared.d.ts +2 -2
  97. package/dist/logger/shared.d.ts.map +1 -1
  98. package/dist/logger/shared.js +2 -2
  99. package/dist/logger.d.ts +1 -1
  100. package/dist/{adapters/memQueue.d.ts → memQueue.d.ts} +1 -1
  101. package/dist/memQueue.d.ts.map +1 -0
  102. package/dist/memQueue.js +21 -0
  103. package/dist/{api/middlewares.d.ts → middlewares.d.ts} +1 -1
  104. package/dist/middlewares.d.ts.map +1 -0
  105. package/dist/{api/middlewares.js → middlewares.js} +1 -1
  106. package/dist/{adapters/mongo-client.d.ts → mongo-client.d.ts} +1 -1
  107. package/dist/mongo-client.d.ts.map +1 -0
  108. package/dist/mongo-client.js +15 -0
  109. package/dist/{adapters/redis-client.d.ts → redis-client.d.ts} +1 -1
  110. package/dist/redis-client.d.ts.map +1 -0
  111. package/dist/redis-client.js +98 -0
  112. package/dist/reportError.d.ts +4 -0
  113. package/dist/reportError.d.ts.map +1 -0
  114. package/dist/reportError.js +28 -0
  115. package/dist/{api/routing → routing}/middleware/RouterMiddleware.d.ts +1 -1
  116. package/dist/routing/middleware/RouterMiddleware.d.ts.map +1 -0
  117. package/dist/{api/routing → routing}/middleware/RouterMiddleware.js +1 -1
  118. package/dist/{api/routing → routing}/middleware/middleware.d.ts +2 -2
  119. package/dist/routing/middleware/middleware.d.ts.map +1 -0
  120. package/dist/routing/middleware/middleware.js +128 -0
  121. package/dist/{api/routing → routing}/middleware.d.ts +1 -1
  122. package/dist/routing/middleware.d.ts.map +1 -0
  123. package/dist/{api/routing → routing}/middleware.js +1 -1
  124. package/dist/{api/routing → routing}/schema/jwt.d.ts +1 -1
  125. package/dist/routing/schema/jwt.d.ts.map +1 -0
  126. package/dist/routing/schema/jwt.js +13 -0
  127. package/dist/routing/tsort.d.ts +8 -0
  128. package/dist/routing/tsort.d.ts.map +1 -0
  129. package/dist/routing/tsort.js +51 -0
  130. package/dist/{api/routing → routing}/utils.d.ts +1 -1
  131. package/dist/routing/utils.d.ts.map +1 -0
  132. package/dist/routing/utils.js +45 -0
  133. package/dist/routing.d.ts +184 -0
  134. package/dist/routing.d.ts.map +1 -0
  135. package/dist/{api/routing.js → routing.js} +1 -1
  136. package/dist/{api/setupRequest.d.ts → setupRequest.d.ts} +2 -2
  137. package/dist/setupRequest.d.ts.map +1 -0
  138. package/dist/setupRequest.js +70 -0
  139. package/dist/{api/util.d.ts → util.d.ts} +1 -1
  140. package/dist/util.d.ts.map +1 -0
  141. package/dist/util.js +14 -0
  142. package/examples/query.ts +2 -2
  143. package/package.json +84 -200
  144. package/src/Emailer/Sendgrid.ts +20 -5
  145. package/src/Emailer/fake.ts +1 -1
  146. package/src/QueueMaker/SQLQueue.ts +3 -3
  147. package/src/QueueMaker/memQueue.ts +3 -3
  148. package/src/QueueMaker/sbqueue.ts +3 -3
  149. package/src/RequestFiberSet.ts +1 -1
  150. package/src/{adapters/SQL → SQL}/Model.ts +1 -1
  151. package/src/{adapters/ServiceBus.ts → ServiceBus.ts} +1 -1
  152. package/src/Store/ContextMapContainer.ts +1 -1
  153. package/src/Store/Cosmos/query.ts +3 -3
  154. package/src/Store/Cosmos.ts +4 -4
  155. package/src/Store/Disk.ts +2 -2
  156. package/src/Store/Memory.ts +4 -4
  157. package/src/Store/SQL/Pg.ts +3 -3
  158. package/src/Store/SQL/query.ts +2 -2
  159. package/src/Store/SQL.ts +3 -3
  160. package/src/Store/codeFilter.ts +3 -3
  161. package/src/Store/index.ts +2 -4
  162. package/src/Store/utils.ts +1 -1
  163. package/src/errorReporter.ts +1 -1
  164. package/src/index.ts +2 -1
  165. package/src/{api/internal → internal}/RequestContextMiddleware.ts +3 -3
  166. package/src/{api/internal → internal}/events.ts +2 -2
  167. package/src/{api/layerUtils.ts → layerUtils.ts} +1 -1
  168. package/src/logger/jsonLogger.ts +1 -1
  169. package/src/logger/logFmtLogger.ts +1 -1
  170. package/src/logger/shared.ts +1 -1
  171. package/src/{adapters/redis-client.ts → redis-client.ts} +1 -1
  172. package/src/{api/reportError.ts → reportError.ts} +1 -1
  173. package/src/{api/routing → routing}/middleware/middleware.ts +4 -4
  174. package/src/{api/routing.ts → routing.ts} +13 -13
  175. package/src/{api/setupRequest.ts → setupRequest.ts} +3 -3
  176. package/test/auth.test.ts +1 -1
  177. package/test/contextProvider.test.ts +1 -1
  178. package/test/controller.test.ts +3 -3
  179. package/test/cosmos-query.test.ts +1 -1
  180. package/test/dist/controller.test.d.ts.map +1 -1
  181. package/test/dist/query.test.d.ts.map +1 -1
  182. package/test/dist/rawQuery.test.d.ts.map +1 -1
  183. package/test/layerUtils.test.ts +1 -1
  184. package/test/query.test.ts +4 -4
  185. package/test/rawQuery.test.ts +4 -4
  186. package/test/repository-ext.test.ts +3 -3
  187. package/test/router-generator.test.ts +3 -3
  188. package/test/routing-interruptibility.test.ts +2 -2
  189. package/test/rpc-context-map-streaming.test.ts +3 -3
  190. package/test/rpc-e2e-invalidation.test.ts +2 -2
  191. package/test/rpc-multi-middleware.test.ts +1 -1
  192. package/test/rpc-stream-fullstack.test.ts +2 -2
  193. package/test/validateSample.test.ts +3 -3
  194. package/dist/Emailer/service.d.ts +0 -64
  195. package/dist/Emailer/service.d.ts.map +0 -1
  196. package/dist/Emailer/service.js +0 -7
  197. package/dist/Emailer.d.ts +0 -2
  198. package/dist/Emailer.d.ts.map +0 -1
  199. package/dist/Emailer.js +0 -2
  200. package/dist/Model/Repository/Registry.d.ts +0 -21
  201. package/dist/Model/Repository/Registry.d.ts.map +0 -1
  202. package/dist/Model/Repository/Registry.js +0 -18
  203. package/dist/Model/Repository/ext.d.ts +0 -60
  204. package/dist/Model/Repository/ext.d.ts.map +0 -1
  205. package/dist/Model/Repository/ext.js +0 -122
  206. package/dist/Model/Repository/internal/internal.d.ts +0 -62
  207. package/dist/Model/Repository/internal/internal.d.ts.map +0 -1
  208. package/dist/Model/Repository/internal/internal.js +0 -398
  209. package/dist/Model/Repository/legacy.d.ts +0 -21
  210. package/dist/Model/Repository/legacy.d.ts.map +0 -1
  211. package/dist/Model/Repository/legacy.js +0 -2
  212. package/dist/Model/Repository/makeRepo.d.ts +0 -53
  213. package/dist/Model/Repository/makeRepo.d.ts.map +0 -1
  214. package/dist/Model/Repository/makeRepo.js +0 -27
  215. package/dist/Model/Repository/service.d.ts +0 -97
  216. package/dist/Model/Repository/service.d.ts.map +0 -1
  217. package/dist/Model/Repository/service.js +0 -2
  218. package/dist/Model/Repository/validation.d.ts +0 -71
  219. package/dist/Model/Repository/validation.d.ts.map +0 -1
  220. package/dist/Model/Repository/validation.js +0 -32
  221. package/dist/Model/Repository.d.ts +0 -7
  222. package/dist/Model/Repository.d.ts.map +0 -1
  223. package/dist/Model/Repository.js +0 -7
  224. package/dist/Model/dsl.d.ts +0 -33
  225. package/dist/Model/dsl.d.ts.map +0 -1
  226. package/dist/Model/dsl.js +0 -43
  227. package/dist/Model/filter/filterApi.d.ts +0 -30
  228. package/dist/Model/filter/filterApi.d.ts.map +0 -1
  229. package/dist/Model/filter/filterApi.js +0 -2
  230. package/dist/Model/filter/types/errors.d.ts +0 -29
  231. package/dist/Model/filter/types/errors.d.ts.map +0 -1
  232. package/dist/Model/filter/types/errors.js +0 -2
  233. package/dist/Model/filter/types/fields.d.ts +0 -15
  234. package/dist/Model/filter/types/fields.d.ts.map +0 -1
  235. package/dist/Model/filter/types/fields.js +0 -2
  236. package/dist/Model/filter/types/path/common.d.ts +0 -316
  237. package/dist/Model/filter/types/path/common.d.ts.map +0 -1
  238. package/dist/Model/filter/types/path/common.js +0 -2
  239. package/dist/Model/filter/types/path/eager.d.ts +0 -95
  240. package/dist/Model/filter/types/path/eager.d.ts.map +0 -1
  241. package/dist/Model/filter/types/path/eager.js +0 -31
  242. package/dist/Model/filter/types/path/index.d.ts +0 -4
  243. package/dist/Model/filter/types/path/index.d.ts.map +0 -1
  244. package/dist/Model/filter/types/path/index.js +0 -3
  245. package/dist/Model/filter/types/utils.d.ts +0 -79
  246. package/dist/Model/filter/types/utils.d.ts.map +0 -1
  247. package/dist/Model/filter/types/utils.js +0 -2
  248. package/dist/Model/filter/types/validator.d.ts +0 -30
  249. package/dist/Model/filter/types/validator.d.ts.map +0 -1
  250. package/dist/Model/filter/types/validator.js +0 -2
  251. package/dist/Model/filter/types.d.ts +0 -5
  252. package/dist/Model/filter/types.d.ts.map +0 -1
  253. package/dist/Model/filter/types.js +0 -7
  254. package/dist/Model/query/dsl.d.ts +0 -446
  255. package/dist/Model/query/dsl.d.ts.map +0 -1
  256. package/dist/Model/query/dsl.js +0 -339
  257. package/dist/Model/query/new-kid-interpreter.d.ts +0 -136
  258. package/dist/Model/query/new-kid-interpreter.d.ts.map +0 -1
  259. package/dist/Model/query/new-kid-interpreter.js +0 -336
  260. package/dist/Model/query.d.ts +0 -15
  261. package/dist/Model/query.d.ts.map +0 -1
  262. package/dist/Model/query.js +0 -3
  263. package/dist/Model.d.ts +0 -5
  264. package/dist/Model.d.ts.map +0 -1
  265. package/dist/Model.js +0 -5
  266. package/dist/QueueMaker/service.d.ts +0 -13
  267. package/dist/QueueMaker/service.d.ts.map +0 -1
  268. package/dist/QueueMaker/service.js +0 -4
  269. package/dist/RequestContext.d.ts +0 -103
  270. package/dist/RequestContext.d.ts.map +0 -1
  271. package/dist/RequestContext.js +0 -49
  272. package/dist/Store/service.d.ts +0 -138
  273. package/dist/Store/service.d.ts.map +0 -1
  274. package/dist/Store/service.js +0 -95
  275. package/dist/Store.d.ts +0 -2
  276. package/dist/Store.d.ts.map +0 -1
  277. package/dist/Store.js +0 -2
  278. package/dist/adapters/SQL/Model.d.ts.map +0 -1
  279. package/dist/adapters/SQL/Model.js +0 -469
  280. package/dist/adapters/SQL.d.ts.map +0 -1
  281. package/dist/adapters/ServiceBus.d.ts.map +0 -1
  282. package/dist/adapters/ServiceBus.js +0 -108
  283. package/dist/adapters/cosmos-client.d.ts.map +0 -1
  284. package/dist/adapters/cosmos-client.js +0 -11
  285. package/dist/adapters/index.d.ts +0 -8
  286. package/dist/adapters/index.d.ts.map +0 -1
  287. package/dist/adapters/index.js +0 -8
  288. package/dist/adapters/logger.d.ts +0 -9
  289. package/dist/adapters/logger.d.ts.map +0 -1
  290. package/dist/adapters/logger.js +0 -3
  291. package/dist/adapters/memQueue.d.ts.map +0 -1
  292. package/dist/adapters/memQueue.js +0 -21
  293. package/dist/adapters/mongo-client.d.ts.map +0 -1
  294. package/dist/adapters/mongo-client.js +0 -15
  295. package/dist/adapters/redis-client.d.ts.map +0 -1
  296. package/dist/adapters/redis-client.js +0 -98
  297. package/dist/api/ContextProvider.d.ts +0 -34
  298. package/dist/api/ContextProvider.d.ts.map +0 -1
  299. package/dist/api/ContextProvider.js +0 -40
  300. package/dist/api/codec.d.ts.map +0 -1
  301. package/dist/api/codec.js +0 -5
  302. package/dist/api/internal/RequestContextMiddleware.d.ts.map +0 -1
  303. package/dist/api/internal/RequestContextMiddleware.js +0 -46
  304. package/dist/api/internal/auth.d.ts.map +0 -1
  305. package/dist/api/internal/auth.js +0 -180
  306. package/dist/api/internal/events.d.ts.map +0 -1
  307. package/dist/api/internal/events.js +0 -49
  308. package/dist/api/internal/health.d.ts.map +0 -1
  309. package/dist/api/internal/health.js +0 -5
  310. package/dist/api/layerUtils.d.ts +0 -32
  311. package/dist/api/layerUtils.d.ts.map +0 -1
  312. package/dist/api/layerUtils.js +0 -17
  313. package/dist/api/middlewares.d.ts.map +0 -1
  314. package/dist/api/reportError.d.ts +0 -4
  315. package/dist/api/reportError.d.ts.map +0 -1
  316. package/dist/api/reportError.js +0 -28
  317. package/dist/api/routing/middleware/RouterMiddleware.d.ts.map +0 -1
  318. package/dist/api/routing/middleware/middleware.d.ts.map +0 -1
  319. package/dist/api/routing/middleware/middleware.js +0 -128
  320. package/dist/api/routing/middleware.d.ts.map +0 -1
  321. package/dist/api/routing/schema/jwt.d.ts.map +0 -1
  322. package/dist/api/routing/schema/jwt.js +0 -13
  323. package/dist/api/routing/tsort.d.ts +0 -8
  324. package/dist/api/routing/tsort.d.ts.map +0 -1
  325. package/dist/api/routing/tsort.js +0 -51
  326. package/dist/api/routing/utils.d.ts.map +0 -1
  327. package/dist/api/routing/utils.js +0 -45
  328. package/dist/api/routing.d.ts +0 -184
  329. package/dist/api/routing.d.ts.map +0 -1
  330. package/dist/api/setupRequest.d.ts.map +0 -1
  331. package/dist/api/setupRequest.js +0 -70
  332. package/dist/api/util.d.ts.map +0 -1
  333. package/dist/api/util.js +0 -14
  334. package/src/Emailer/service.ts +0 -62
  335. package/src/Emailer.ts +0 -1
  336. package/src/Model/Repository/Registry.ts +0 -34
  337. package/src/Model/Repository/ext.ts +0 -375
  338. package/src/Model/Repository/internal/internal.ts +0 -692
  339. package/src/Model/Repository/legacy.ts +0 -29
  340. package/src/Model/Repository/makeRepo.ts +0 -144
  341. package/src/Model/Repository/service.ts +0 -639
  342. package/src/Model/Repository/validation.ts +0 -31
  343. package/src/Model/Repository.ts +0 -6
  344. package/src/Model/dsl.ts +0 -129
  345. package/src/Model/filter/filterApi.ts +0 -60
  346. package/src/Model/filter/types/errors.ts +0 -47
  347. package/src/Model/filter/types/fields.ts +0 -50
  348. package/src/Model/filter/types/path/common.ts +0 -404
  349. package/src/Model/filter/types/path/eager.ts +0 -297
  350. package/src/Model/filter/types/path/index.ts +0 -4
  351. package/src/Model/filter/types/utils.ts +0 -128
  352. package/src/Model/filter/types/validator.ts +0 -46
  353. package/src/Model/filter/types.ts +0 -6
  354. package/src/Model/query/dsl.ts +0 -2546
  355. package/src/Model/query/new-kid-interpreter.ts +0 -484
  356. package/src/Model/query.ts +0 -13
  357. package/src/Model.ts +0 -4
  358. package/src/QueueMaker/service.ts +0 -19
  359. package/src/RequestContext.ts +0 -62
  360. package/src/Store/service.ts +0 -233
  361. package/src/Store.ts +0 -1
  362. package/src/adapters/index.ts +0 -7
  363. package/src/adapters/logger.ts +0 -3
  364. /package/src/{api/ContextProvider.ts → ContextProvider.ts} +0 -0
  365. /package/src/{adapters/SQL.ts → SQL.ts} +0 -0
  366. /package/src/{api/codec.ts → codec.ts} +0 -0
  367. /package/src/{adapters/cosmos-client.ts → cosmos-client.ts} +0 -0
  368. /package/src/{api/internal → internal}/auth.ts +0 -0
  369. /package/src/{api/internal → internal}/health.ts +0 -0
  370. /package/src/{adapters/memQueue.ts → memQueue.ts} +0 -0
  371. /package/src/{api/middlewares.ts → middlewares.ts} +0 -0
  372. /package/src/{adapters/mongo-client.ts → mongo-client.ts} +0 -0
  373. /package/src/{api/routing → routing}/middleware/RouterMiddleware.ts +0 -0
  374. /package/src/{api/routing → routing}/middleware.ts +0 -0
  375. /package/src/{api/routing → routing}/schema/jwt.ts +0 -0
  376. /package/src/{api/routing → routing}/tsort.ts +0 -0
  377. /package/src/{api/routing → routing}/utils.ts +0 -0
  378. /package/src/{api/util.ts → util.ts} +0 -0
package/src/Store/SQL.ts CHANGED
@@ -3,7 +3,10 @@
3
3
  import type { NonEmptyReadonlyArray } from "effect-app/Array"
4
4
  import { toNonEmptyArray } from "effect-app/Array"
5
5
  import * as Effect from "effect-app/Effect"
6
+ import type { FieldValues } from "effect-app/Model/filter/types"
7
+ import type { ComputedProjectionIrExpression } from "effect-app/Model/query"
6
8
  import * as Option from "effect-app/Option"
9
+ import { type FilterArgs, type PersistenceModelType, type StorageConfig, type Store, type StoreConfig, StoreMaker } from "effect-app/Store"
7
10
  import * as Context from "effect/Context"
8
11
  import * as Layer from "effect/Layer"
9
12
  import * as LayerMap from "effect/LayerMap"
@@ -11,11 +14,8 @@ import * as Struct from "effect/Struct"
11
14
  import { SqlClient } from "effect/unstable/sql"
12
15
  import { OptimisticConcurrencyException } from "../errors.js"
13
16
  import { InfraLogger } from "../logger.js"
14
- import type { FieldValues } from "../Model/filter/types.js"
15
- import type { ComputedProjectionIrExpression } from "../Model/query.js"
16
17
  import { annotateDb, type DbSystem } from "../otel.js"
17
18
  import { storeId } from "./Memory.js"
18
- import { type FilterArgs, type PersistenceModelType, type StorageConfig, type Store, type StoreConfig, StoreMaker } from "./service.js"
19
19
  import { buildWhereSQLQuery, logQuery, type SQLDialect, sqliteDialect } from "./SQL/query.js"
20
20
  import { makeETag } from "./utils.js"
21
21
 
@@ -1,12 +1,12 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  /* eslint-disable @typescript-eslint/no-unsafe-argument */
3
3
  import * as Array from "effect-app/Array"
4
+ import type { FilterR, FilterResult } from "effect-app/Model/filter/filterApi"
5
+ import type { FieldValues } from "effect-app/Model/filter/types"
4
6
  import * as Option from "effect-app/Option"
7
+ import type { Filter } from "effect-app/Store"
5
8
  import { assertUnreachable } from "effect-app/utils"
6
- import type { FilterR, FilterResult } from "../Model/filter/filterApi.js"
7
- import type { FieldValues } from "../Model/filter/types.js"
8
9
  import { get } from "./Memory.js"
9
- import type { Filter } from "./service.js"
10
10
  import { compare, greaterThan, greaterThanExclusive, lowerThan, lowerThanExclusive } from "./utils.js"
11
11
 
12
12
  const vAsArr = (v: string) => v as unknown as any[]
@@ -1,14 +1,14 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import * as Effect from "effect-app/Effect"
3
3
  import * as Layer from "effect-app/Layer"
4
+ import { RepositoryRegistryLive } from "effect-app/Model"
5
+ import type { StorageConfig } from "effect-app/Store"
4
6
  import * as Redacted from "effect/Redacted"
5
7
  import type { SqlClient } from "effect/unstable/sql"
6
8
  import { CosmosStoreLayer } from "./Cosmos.js"
7
9
  import { DiskStoreLayer } from "./Disk.js"
8
10
  import { MemoryStoreLive } from "./Memory.js"
9
11
  // import { RedisStoreLayer } from "./Redis.js"
10
- import { RepositoryRegistryLive } from "../Model.js"
11
- import type { StorageConfig } from "./service.js"
12
12
  import { SQLiteStoreLayer } from "./SQL.js"
13
13
  import { PgStoreLayer } from "./SQL/Pg.js"
14
14
 
@@ -46,5 +46,3 @@ export function StoreMakerLayer(
46
46
  })
47
47
  .pipe(Layer.unwrap, Layer.merge(RepositoryRegistryLive))
48
48
  }
49
-
50
- export * from "./service.js"
@@ -1,8 +1,8 @@
1
1
  import crypto from "crypto"
2
2
  import * as Effect from "effect-app/Effect"
3
3
  import * as Option from "effect-app/Option"
4
+ import type { PersistenceModelType, SupportedValues2 } from "effect-app/Store"
4
5
  import { OptimisticConcurrencyException } from "../errors.js"
5
- import type { PersistenceModelType, SupportedValues2 } from "./service.js"
6
6
 
7
7
  export const makeETag = <E extends PersistenceModelType<{}>>(
8
8
  { _etag, ...e }: E
@@ -3,9 +3,9 @@ import * as Effect from "effect-app/Effect"
3
3
  import { dropUndefined, LogLevelToSentry } from "effect-app/utils"
4
4
  import * as Cause from "effect/Cause"
5
5
  import type * as LogLevel from "effect/LogLevel"
6
- import { getRC } from "./api/setupRequest.js"
7
6
  import { CauseException, tryToJson, tryToReport } from "./errors.js"
8
7
  import { InfraLogger } from "./logger.js"
8
+ import { getRC } from "./setupRequest.js"
9
9
 
10
10
  const tryCauseException = <E>(cause: Cause.Cause<E>, name: string): CauseException<E> => {
11
11
  try {
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
- export * as Model from "./Model.js"
1
+ export * from "./logger.js"
2
+ export * from "./Store/index.js"
@@ -1,11 +1,11 @@
1
1
  import * as Effect from "effect-app/Effect"
2
2
  import { HttpMiddleware, HttpServerRequest, HttpServerResponse } from "effect-app/http"
3
3
  import * as Layer from "effect-app/Layer"
4
+ import { Locale, LocaleRef, RequestContext, spanAttributes } from "effect-app/RequestContext"
4
5
  import { NonEmptyString255 } from "effect-app/Schema"
5
- import { Locale, LocaleRef, RequestContext, spanAttributes } from "../../RequestContext.js"
6
- import { ContextMapContainer } from "../../Store/ContextMapContainer.js"
7
- import { storeId } from "../../Store/Memory.js"
8
6
  import { provideOnRequestScope } from "../setupRequest.js"
7
+ import { ContextMapContainer } from "../Store/ContextMapContainer.js"
8
+ import { storeId } from "../Store/Memory.js"
9
9
 
10
10
  export const RequestContextMiddleware = (defaultLocale: Locale = "en") =>
11
11
  HttpMiddleware.make((app) =>
@@ -5,9 +5,9 @@ import * as Duration from "effect/Duration"
5
5
  import { pipe } from "effect/Function"
6
6
  import * as Schedule from "effect/Schedule"
7
7
  import * as Stream from "effect/Stream"
8
- import { reportError } from "../../errorReporter.js"
9
- import { storeId } from "../../Store/Memory.js"
8
+ import { reportError } from "../errorReporter.js"
10
9
  import { setupStreamingRequestContextFromCurrent } from "../setupRequest.js"
10
+ import { storeId } from "../Store/Memory.js"
11
11
 
12
12
  // Tell the client to retry every 10 seconds if connectivity is lost
13
13
  const setRetry = Stream.succeed("retry: 10000")
@@ -4,7 +4,7 @@ import * as Context from "effect-app/Context"
4
4
  import * as Effect from "effect-app/Effect"
5
5
  import type * as Layer from "effect-app/Layer"
6
6
  import * as Option from "effect-app/Option"
7
- import { InfraLogger } from "../logger.js"
7
+ import { InfraLogger } from "./logger.js"
8
8
 
9
9
  // TODO: These LayerUtils are flaky, like in dependencies as a readonly array, it breaks when there are two entries
10
10
  // we should look at Service.MakeDeps[E/RIn/ROut] etc.
@@ -1,8 +1,8 @@
1
1
  import * as Array from "effect-app/Array"
2
+ import { spanAttributes } from "effect-app/RequestContext"
2
3
  import * as Cause from "effect/Cause"
3
4
  import * as Logger from "effect/Logger"
4
5
  import { CurrentLogAnnotations, CurrentLogSpans } from "effect/References"
5
- import { spanAttributes } from "../RequestContext.js"
6
6
  import { getRequestContextFromFiber } from "./shared.js"
7
7
 
8
8
  export const jsonLogger = Logger.make<unknown, void>(
@@ -1,5 +1,5 @@
1
+ import { spanAttributes } from "effect-app/RequestContext"
1
2
  import * as Logger from "effect/Logger"
2
- import { spanAttributes } from "../RequestContext.js"
3
3
  import { getRequestContextFromFiber } from "./shared.js"
4
4
 
5
5
  export const logfmtLogger = Logger.make<unknown, void>(
@@ -1,7 +1,7 @@
1
1
  import * as Option from "effect-app/Option"
2
+ import { LocaleRef, RequestContext } from "effect-app/RequestContext"
2
3
  import { NonEmptyString255 } from "effect-app/Schema"
3
4
  import type * as Fiber from "effect/Fiber"
4
- import { LocaleRef, RequestContext } from "../RequestContext.js"
5
5
  import { storeId } from "../Store/Memory.js"
6
6
 
7
7
  export function getRequestContextFromFiber(fiber: Fiber.Fiber<unknown, unknown>) {
@@ -8,7 +8,7 @@ import Redlock from "redlock"
8
8
 
9
9
  export class ConnectionException extends Data.TaggedError("ConnectionException")<{ cause: Error; message: string }> {
10
10
  constructor(cause: Error) {
11
- super({ message: "A connection error ocurred", cause })
11
+ super({ message: "A connection error occurred", cause })
12
12
  }
13
13
  }
14
14
 
@@ -1,6 +1,6 @@
1
1
  import * as Effect from "effect-app/Effect"
2
2
  import * as Cause from "effect/Cause"
3
- import { logError, reportError } from "../errorReporter.js"
3
+ import { logError, reportError } from "./errorReporter.js"
4
4
 
5
5
  // const onExitReportError = (name: string, unknownOnly?: boolean) => {
6
6
  // const report = reportError(name)
@@ -10,9 +10,9 @@ import * as Effect from "effect/Effect"
10
10
  import * as Layer from "effect/Layer"
11
11
  import * as Schema from "effect/Schema"
12
12
  import { type Rpc } from "effect/unstable/rpc"
13
- import { logError, reportError } from "../../../errorReporter.js"
14
- import { InfraLogger } from "../../../logger.js"
15
- import { WithNsTransaction } from "../../../Store/SQL.js"
13
+ import { logError, reportError } from "../../errorReporter.js"
14
+ import { InfraLogger } from "../../logger.js"
15
+ import { WithNsTransaction } from "../../Store/SQL.js"
16
16
 
17
17
  const logRequestError = logError("Request")
18
18
  const reportRequestError = reportError("Request")
@@ -35,7 +35,7 @@ const isOptimisticConcurrencyException = (input: unknown) =>
35
35
  typeof input === "object" && input !== null && "_tag" in input && input._tag === "OptimisticConcurrencyException"
36
36
 
37
37
  export const RequestType = Context.Reference<"command" | "query">(
38
- "@effect-app/infra/api/routing/RequestType",
38
+ "@effect-app/infra/routing/RequestType",
39
39
  { defaultValue: () => "query" }
40
40
  )
41
41
 
@@ -73,8 +73,8 @@ type GetSuccess<T> = T extends { success: S.Top } ? T["success"] : typeof S.Void
73
73
  type GetFailure<T extends { error?: S.Top }> = T["error"] extends never ? typeof S.Never : T["error"]
74
74
 
75
75
  type GetSuccessShape<Action extends { success?: S.Top }, RT extends RequestType> = {
76
- d: S.Schema.Type<GetSuccess<Action>>
77
- raw: S.Codec.Encoded<GetSuccess<Action>>
76
+ d: GetSuccess<Action>["Type"]
77
+ raw: GetSuccess<Action>["Encoded"]
78
78
  }[RT]
79
79
 
80
80
  interface HandlerBase<Action extends AnyRequestModule, RT extends RequestType, A, E, R> {
@@ -82,7 +82,7 @@ interface HandlerBase<Action extends AnyRequestModule, RT extends RequestType, A
82
82
  _tag: RT
83
83
  stack: string
84
84
  handler: (
85
- req: S.Schema.Type<Action>,
85
+ req: Action["Type"],
86
86
  headers: HttpHeaders.Headers
87
87
  ) => Effect.Effect<A, E, R> | Stream.Stream<A, E, R>
88
88
  }
@@ -92,7 +92,7 @@ export interface Handler<Action extends AnyRequestModule, RT extends RequestType
92
92
  Action,
93
93
  RT,
94
94
  GetSuccessShape<Action, RT>,
95
- S.Schema.Type<GetFailure<Action>> | S.SchemaError,
95
+ GetFailure<Action>["Type"] | S.SchemaError,
96
96
  R
97
97
  >
98
98
  {}
@@ -123,7 +123,7 @@ type EffectMatch<
123
123
  RT extends RequestType,
124
124
  Key extends keyof Resource
125
125
  > = <A extends GetSuccessShape<Resource[Key], RT>, R2 = never, E = never>(
126
- f: (req: S.Schema.Type<Resource[Key]>) => Effect.Effect<A, E, R2>
126
+ f: (req: Resource[Key]["Type"]) => Effect.Effect<A, E, R2>
127
127
  ) => Handler<
128
128
  Resource[Key],
129
129
  RT,
@@ -139,7 +139,7 @@ type StreamMatch<
139
139
  RT extends RequestType,
140
140
  Key extends keyof Resource
141
141
  > = <A extends GetSuccessShape<Resource[Key], RT>, R2 = never, E = never>(
142
- f: (req: S.Schema.Type<Resource[Key]>) => Stream.Stream<A, E, R2>
142
+ f: (req: Resource[Key]["Type"]) => Stream.Stream<A, E, R2>
143
143
  ) => Handler<
144
144
  Resource[Key],
145
145
  RT,
@@ -171,7 +171,7 @@ export type RouteMatcher<
171
171
  & Match<Resource, RequestContextMap, RequestTypes.DECODED, Key>
172
172
  & {
173
173
  success: Resource[Key]["success"]
174
- successRaw: S.Codec<S.Codec.Encoded<Resource[Key]["success"]>>
174
+ successRaw: S.Codec<Resource[Key]["success"]["Encoded"]>
175
175
  error: Resource[Key]["error"]
176
176
  /**
177
177
  * Requires the Encoded shape (e.g directly undecoded from DB, so that we don't do multiple Decode/Encode)
@@ -266,11 +266,11 @@ export const makeRouter = <Live extends Layer.Layer<any, any, any> = Layer.Layer
266
266
  Action extends AnyRequestModule,
267
267
  RT extends RequestType
268
268
  > = (
269
- req: S.Schema.Type<Action>
269
+ req: Action["Type"]
270
270
  ) => Generator<
271
271
  Effect.Effect<
272
272
  any,
273
- S.Schema.Type<GetFailure<Action>> | S.SchemaError,
273
+ GetFailure<Action>["Type"] | S.SchemaError,
274
274
  // the actual implementation of the handler may just require the dynamic context provided by the middleware
275
275
  // and the per request context provided by the context provider
276
276
  HandlerContext<Action>
@@ -283,10 +283,10 @@ export const makeRouter = <Live extends Layer.Layer<any, any, any> = Layer.Layer
283
283
  Action extends AnyRequestModule,
284
284
  RT extends RequestType
285
285
  > = (
286
- req: S.Schema.Type<Action>
286
+ req: Action["Type"]
287
287
  ) => Effect.Effect<
288
288
  GetSuccessShape<Action, RT>,
289
- S.Schema.Type<GetFailure<Action>> | S.SchemaError,
289
+ GetFailure<Action>["Type"] | S.SchemaError,
290
290
  // the actual implementation of the handler may just require the dynamic context provided by the middleware
291
291
  // and the per request context provided by the context provider
292
292
  HandlerContext<Action>
@@ -296,10 +296,10 @@ export const makeRouter = <Live extends Layer.Layer<any, any, any> = Layer.Layer
296
296
  Action extends AnyRequestModule,
297
297
  RT extends RequestType
298
298
  > = (
299
- req: S.Schema.Type<Action>
299
+ req: Action["Type"]
300
300
  ) => Stream.Stream<
301
301
  GetSuccessShape<Action, RT>,
302
- S.Schema.Type<GetFailure<Action>> | S.SchemaError,
302
+ GetFailure<Action>["Type"] | S.SchemaError,
303
303
  HandlerContext<Action>
304
304
  >
305
305
 
@@ -1,12 +1,12 @@
1
1
  import * as Effect from "effect-app/Effect"
2
2
  import * as Layer from "effect-app/Layer"
3
3
  import * as Option from "effect-app/Option"
4
+ import { LocaleRef, RequestContext, spanAttributes } from "effect-app/RequestContext"
4
5
  import { NonEmptyString255 } from "effect-app/Schema"
5
6
  import * as Tracer from "effect/Tracer"
6
7
  import { SqlClient } from "effect/unstable/sql"
7
- import { LocaleRef, RequestContext, spanAttributes } from "../RequestContext.js"
8
- import { ContextMapContainer } from "../Store/ContextMapContainer.js"
9
- import { storeId } from "../Store/Memory.js"
8
+ import { ContextMapContainer } from "./Store/ContextMapContainer.js"
9
+ import { storeId } from "./Store/Memory.js"
10
10
 
11
11
  const withSqlTransaction = <R, E, A>(self: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>
12
12
  Effect.serviceOption(SqlClient.SqlClient).pipe(
package/test/auth.test.ts CHANGED
@@ -2,7 +2,7 @@ import { describe, expect, it } from "@effect/vitest"
2
2
  import * as Effect from "effect-app/Effect"
3
3
  import { HttpHeaders } from "effect-app/http"
4
4
  import { SignJWT } from "jose"
5
- import { checkJWTI, InvalidRequestError, InvalidTokenError, UnauthorizedError } from "../src/api/internal/auth.js"
5
+ import { checkJWTI, InvalidRequestError, InvalidTokenError, UnauthorizedError } from "../src/internal/auth.js"
6
6
 
7
7
  const issuer = "https://issuer.example.com/"
8
8
  const audience = "effect-app"
@@ -5,7 +5,7 @@ import * as Context from "effect-app/Context"
5
5
  import * as Effect from "effect-app/Effect"
6
6
  import * as Layer from "effect-app/Layer"
7
7
  import * as Scope from "effect/Scope"
8
- import { ContextProvider, mergeContextProviders, MergedContextProvider } from "../src/api/ContextProvider.js"
8
+ import { ContextProvider, mergeContextProviders, MergedContextProvider } from "../src/ContextProvider.js"
9
9
  import { CustomError1, Some, SomeElse, SomeService } from "./fixtures.js"
10
10
 
11
11
  // @effect-diagnostics-next-line missingEffectServiceDependency:off
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
3
- import { type MakeContext, type MakeErrors, makeRouter } from "@effect-app/infra/api/routing"
3
+ import { type MakeContext, type MakeErrors, makeRouter } from "@effect-app/infra/routing"
4
4
  import { expect, expectTypeOf, it } from "@effect/vitest"
5
5
  import { InvalidStateError, makeRpcClient, UnauthorizedError } from "effect-app/client"
6
6
  import * as Context from "effect-app/Context"
@@ -13,8 +13,8 @@ import * as S from "effect-app/Schema"
13
13
  import { TypeTestId } from "effect-app/TypeTest"
14
14
  import * as Scope from "effect/Scope"
15
15
  import { type RpcSerialization } from "effect/unstable/rpc"
16
- import { DefaultGenericMiddlewaresLive, DevModeMiddlewareLive } from "../src/api/routing/middleware.js"
17
- import { sort } from "../src/api/routing/tsort.js"
16
+ import { DefaultGenericMiddlewaresLive, DevModeMiddlewareLive } from "../src/routing/middleware.js"
17
+ import { sort } from "../src/routing/tsort.js"
18
18
  import { AllowAnonymous, AllowAnonymousLive, CustomError1, RequestContextMap, RequireRoles, RequireRolesLive, Some, SomeElse, SomeService, Test, TestLive } from "./fixtures.js"
19
19
 
20
20
  class MyContextProvider extends RpcX.RpcMiddleware.Tag<MyContextProvider, {
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { and, computed, make, projectComputed, relation, toFilter, where } from "effect-app/Model/query"
2
3
  import * as S from "effect-app/Schema"
3
4
  import { describe, expect, it } from "vitest"
4
- import { and, computed, make, projectComputed, relation, toFilter, where } from "../src/Model/query.js"
5
5
  import { buildWhereCosmosQuery3 } from "../src/Store/Cosmos/query.js"
6
6
 
7
7
  class Order extends S.Class<Order>("Order")({
@@ -1 +1 @@
1
- {"version":3,"file":"controller.test.d.ts","sourceRoot":"","sources":["../controller.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAc,MAAM,+BAA+B,CAAA;AAE7F,OAAO,EAAoC,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACvF,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAC7C,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAC3C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA;AAEzC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,CAAC,MAAM,mBAAmB,CAAA;AAEtC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAG3D,OAAO,EAAE,cAAc,EAAsB,YAAY,EAAqB,YAAY,EAAoB,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAY,MAAM,eAAe,CAAA;;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ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,CAAC,MAAM,mBAAmB,CAAA;;;;;;;;;;;;;;;;;AAmBtC,qBAAa,SAAU,SAAQ,cAM7B;CAAG;AACL,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC,CAAC;IAElC,UAAiB,OAAQ,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,SAAS,CAAC;KAAG;CACtE"}
1
+ {"version":3,"file":"query.test.d.ts","sourceRoot":"","sources":["../query.test.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,CAAC,MAAM,mBAAmB,CAAA;;;;;;;;;;;;;;;;;AAgBtC,qBAAa,SAAU,SAAQ,cAM7B;CAAG;AACL,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC,CAAC;IAElC,UAAiB,OAAQ,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,SAAS,CAAC;KAAG;CACtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"rawQuery.test.d.ts","sourceRoot":"","sources":["../rawQuery.test.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAA;AAavD,eAAO,MAAM,EAAE,6CAWb,CAAA"}
1
+ {"version":3,"file":"rawQuery.test.d.ts","sourceRoot":"","sources":["../rawQuery.test.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAA;AAUvD,eAAO,MAAM,EAAE,6CAWb,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { expectTypeOf, it } from "@effect/vitest"
2
2
  import type * as Layer from "effect/Layer"
3
- import { type LayerUtils } from "../src/api/layerUtils.js"
3
+ import { type LayerUtils } from "../src/layerUtils.js"
4
4
 
5
5
  it("works", () => {
6
6
  // not supported atm, resolves to unknown!
@@ -4,6 +4,9 @@
4
4
  import * as Context from "effect-app/Context"
5
5
  import * as Effect from "effect-app/Effect"
6
6
  import * as Layer from "effect-app/Layer"
7
+ import { and, computed, count, expr, make, one, or, order, page, project, projectComputed, type QueryEnd, type QueryProjection, type QueryWhere, relation, toFilter, where } from "effect-app/Model/query"
8
+ import { makeRepo } from "effect-app/Model/Repository"
9
+ import { RepositoryRegistryLive } from "effect-app/Model/Repository/Registry"
7
10
  import * as Option from "effect-app/Option"
8
11
  import * as S from "effect-app/Schema"
9
12
  import { flow, pipe } from "effect/Function"
@@ -11,10 +14,7 @@ import * as SchemaTransformation from "effect/SchemaTransformation"
11
14
  import * as Struct from "effect/Struct"
12
15
  import { inspect } from "util"
13
16
  import { expect, expectTypeOf, it } from "vitest"
14
- import { setupRequestContextFromCurrent } from "../src/api/setupRequest.js"
15
- import { and, computed, count, expr, make, one, or, order, page, project, projectComputed, type QueryEnd, type QueryProjection, type QueryWhere, relation, toFilter, where } from "../src/Model/query.js"
16
- import { makeRepo } from "../src/Model/Repository.js"
17
- import { RepositoryRegistryLive } from "../src/Model/Repository/Registry.js"
17
+ import { setupRequestContextFromCurrent } from "../src/setupRequest.js"
18
18
  import { memFilter, MemoryStoreLive } from "../src/Store/Memory.js"
19
19
  import { SomeService } from "./fixtures.js"
20
20
 
@@ -5,6 +5,9 @@ import * as Config from "effect-app/Config"
5
5
  import * as Context from "effect-app/Context"
6
6
  import * as Effect from "effect-app/Effect"
7
7
  import * as Layer from "effect-app/Layer"
8
+ import { and, computed, or, project, projectComputed, relation, where, whereEvery, whereSome } from "effect-app/Model/query"
9
+ import { makeRepo } from "effect-app/Model/Repository/makeRepo"
10
+ import { RepositoryRegistryLive } from "effect-app/Model/Repository/Registry"
8
11
  import * as S from "effect-app/Schema"
9
12
  import { LogLevels } from "effect-app/utils"
10
13
  import { flow } from "effect/Function"
@@ -13,10 +16,7 @@ import * as Redacted from "effect/Redacted"
13
16
  import * as References from "effect/References"
14
17
  import * as Result from "effect/Result"
15
18
  import * as Struct from "effect/Struct"
16
- import { setupRequestContextFromCurrent } from "../src/api/setupRequest.js"
17
- import { and, computed, or, project, projectComputed, relation, where, whereEvery, whereSome } from "../src/Model/query.js"
18
- import { makeRepo } from "../src/Model/Repository/makeRepo.js"
19
- import { RepositoryRegistryLive } from "../src/Model/Repository/Registry.js"
19
+ import { setupRequestContextFromCurrent } from "../src/setupRequest.js"
20
20
  import { CosmosStoreLayer } from "../src/Store/Cosmos.js"
21
21
  import { MemoryStoreLive } from "../src/Store/Memory.js"
22
22
  import { SQLiteStoreLayer } from "../src/Store/SQL.js"
@@ -1,10 +1,10 @@
1
1
  import { describe, expect, it } from "@effect/vitest"
2
2
  import * as Effect from "effect-app/Effect"
3
3
  import * as Layer from "effect-app/Layer"
4
+ import { makeRepo } from "effect-app/Model/Repository"
5
+ import { RepositoryRegistryLive } from "effect-app/Model/Repository/Registry"
4
6
  import * as S from "effect-app/Schema"
5
- import { setupRequestContextFromCurrent } from "../src/api/setupRequest.js"
6
- import { makeRepo } from "../src/Model/Repository.js"
7
- import { RepositoryRegistryLive } from "../src/Model/Repository/Registry.js"
7
+ import { setupRequestContextFromCurrent } from "../src/setupRequest.js"
8
8
  import { MemoryStoreLive } from "../src/Store/Memory.js"
9
9
 
10
10
  class BatchItem extends S.Class<BatchItem>("BatchItem")({
@@ -1,11 +1,11 @@
1
- import { type MakeContext, type MakeErrors, makeRouter } from "@effect-app/infra/api/routing"
2
- import { makeAllDSL, makeOneDSL } from "@effect-app/infra/Model"
1
+ import { type MakeContext, type MakeErrors, makeRouter } from "@effect-app/infra/routing"
3
2
  import { expectTypeOf, it } from "@effect/vitest"
4
3
  import { InvalidStateError, makeRpcClient, UnauthorizedError } from "effect-app/client"
5
4
  import * as Context from "effect-app/Context"
6
5
  import * as Effect from "effect-app/Effect"
7
6
  import * as Layer from "effect-app/Layer"
8
7
  import { DefaultGenericMiddlewares } from "effect-app/middleware"
8
+ import { makeAllDSL, makeOneDSL } from "effect-app/Model"
9
9
  import { type FixEnv } from "effect-app/Pure"
10
10
  import * as RpcX from "effect-app/rpc"
11
11
  import { MiddlewareMaker } from "effect-app/rpc"
@@ -13,7 +13,7 @@ import * as S from "effect-app/Schema"
13
13
  import { type TypeTestId } from "effect-app/TypeTest"
14
14
  import { type ConfigError } from "effect/Config"
15
15
  import { type RpcSerialization } from "effect/unstable/rpc/RpcSerialization"
16
- import { DefaultGenericMiddlewaresLive, DevModeMiddlewareLive } from "../src/api/routing/middleware.js"
16
+ import { DefaultGenericMiddlewaresLive, DevModeMiddlewareLive } from "../src/routing/middleware.js"
17
17
  import { AllowAnonymous, AllowAnonymousLive, RequestContextMap, RequireRoles, RequireRolesLive, Some, SomeElse, SomeService, Test, TestLive } from "./fixtures.js"
18
18
 
19
19
  // Inline minimal context provider (provides `Some`)
@@ -6,8 +6,8 @@ import * as Fiber from "effect/Fiber"
6
6
  import * as Layer from "effect/Layer"
7
7
  import * as Ref from "effect/Ref"
8
8
  import { Rpc, RpcGroup, RpcTest } from "effect/unstable/rpc"
9
- import { applyRequestTypeInterruptibility } from "../src/api/routing.js"
10
- import { ConfigureInterruptibilityMiddlewareLive, RequestType } from "../src/api/routing/middleware.js"
9
+ import { applyRequestTypeInterruptibility } from "../src/routing.js"
10
+ import { ConfigureInterruptibilityMiddlewareLive, RequestType } from "../src/routing/middleware.js"
11
11
 
12
12
  const InterruptibilityRpcs = RpcGroup.make(
13
13
  Rpc
@@ -49,9 +49,9 @@ import * as Stream from "effect/Stream"
49
49
  import { FetchHttpClient } from "effect/unstable/http"
50
50
  import { RpcSerialization } from "effect/unstable/rpc"
51
51
  import { createServer } from "http"
52
- import { RequestContextMiddleware } from "../src/api/internal/RequestContextMiddleware.js"
53
- import { makeRouter } from "../src/api/routing.js"
54
- import { DefaultGenericMiddlewaresLive } from "../src/api/routing/middleware.js"
52
+ import { RequestContextMiddleware } from "../src/internal/RequestContextMiddleware.js"
53
+ import { makeRouter } from "../src/routing.js"
54
+ import { DefaultGenericMiddlewaresLive } from "../src/routing/middleware.js"
55
55
  import { getContextMap } from "../src/Store/ContextMapContainer.js"
56
56
  import { AllowAnonymous, AllowAnonymousLive, RequestContextMap, RequireRoles, RequireRolesLive, SomeElseMiddleware, SomeElseMiddlewareLive, SomeService, Test, TestLive } from "./fixtures.js"
57
57
 
@@ -29,8 +29,8 @@ import * as Stream from "effect/Stream"
29
29
  import { FetchHttpClient } from "effect/unstable/http"
30
30
  import { RpcSerialization } from "effect/unstable/rpc"
31
31
  import { createServer } from "http"
32
- import { makeRouter } from "../src/api/routing.js"
33
- import { DefaultGenericMiddlewaresLive } from "../src/api/routing/middleware.js"
32
+ import { makeRouter } from "../src/routing.js"
33
+ import { DefaultGenericMiddlewaresLive } from "../src/routing/middleware.js"
34
34
  import { AllowAnonymous, AllowAnonymousLive, RequestContextMap, RequireRoles, RequireRolesLive, SomeElseMiddleware, SomeElseMiddlewareLive, SomeService, Test, TestLive } from "./fixtures.js"
35
35
 
36
36
  // ---------------------------------------------------------------------------
@@ -14,7 +14,7 @@ import * as Result from "effect/Result"
14
14
  import { FetchHttpClient } from "effect/unstable/http"
15
15
  import { Rpc, RpcClient, RpcGroup, RpcSerialization, RpcServer, RpcTest } from "effect/unstable/rpc"
16
16
  import { createServer } from "http"
17
- import { DefaultGenericMiddlewaresLive } from "../src/api/routing.js"
17
+ import { DefaultGenericMiddlewaresLive } from "../src/routing.js"
18
18
  import { AllowAnonymous, AllowAnonymousLive, RequestContextMap, RequireRoles, RequireRolesLive, Some, SomeElseMiddleware, SomeElseMiddlewareLive, SomeMiddleware, SomeMiddlewareLive, SomeService, Test, TestLive, UserProfile } from "./fixtures.js"
19
19
 
20
20
  const incomplete = RpcX
@@ -25,8 +25,8 @@ import * as Stream from "effect/Stream"
25
25
  import { FetchHttpClient } from "effect/unstable/http"
26
26
  import { RpcSerialization } from "effect/unstable/rpc"
27
27
  import { createServer } from "http"
28
- import { makeRouter } from "../src/api/routing.js"
29
- import { DefaultGenericMiddlewaresLive } from "../src/api/routing/middleware.js"
28
+ import { makeRouter } from "../src/routing.js"
29
+ import { DefaultGenericMiddlewaresLive } from "../src/routing/middleware.js"
30
30
  import { AllowAnonymous, AllowAnonymousLive, RequestContextMap, RequireRoles, RequireRolesLive, SomeElseMiddleware, SomeElseMiddlewareLive, SomeService, Test, TestLive } from "./fixtures.js"
31
31
 
32
32
  // ---------------------------------------------------------------------------
@@ -1,10 +1,10 @@
1
1
  import * as Effect from "effect-app/Effect"
2
2
  import * as Layer from "effect-app/Layer"
3
+ import { makeRepo, ValidationError, ValidationResult } from "effect-app/Model/Repository"
4
+ import { RepositoryRegistryLive } from "effect-app/Model/Repository/Registry"
3
5
  import * as S from "effect-app/Schema"
4
6
  import { describe, expect, it } from "vitest"
5
- import { setupRequestContextFromCurrent } from "../src/api/setupRequest.js"
6
- import { makeRepo, ValidationError, ValidationResult } from "../src/Model/Repository.js"
7
- import { RepositoryRegistryLive } from "../src/Model/Repository/Registry.js"
7
+ import { setupRequestContextFromCurrent } from "../src/setupRequest.js"
8
8
  import { MemoryStoreLive } from "../src/Store/Memory.js"
9
9
 
10
10
  const TestStoreLive = Layer.merge(MemoryStoreLive, RepositoryRegistryLive)