@effect-app/infra 0.198.2 → 0.199.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/_cjs/RequestContext.cjs +14 -9
  3. package/_cjs/RequestContext.cjs.map +1 -1
  4. package/_cjs/_ext/Array.cjs +3 -7
  5. package/_cjs/_ext/Array.cjs.map +1 -1
  6. package/_cjs/api/reportError.cjs +3 -6
  7. package/_cjs/api/reportError.cjs.map +1 -1
  8. package/_cjs/api/routing/base.cjs +27 -61
  9. package/_cjs/api/routing/base.cjs.map +1 -1
  10. package/_cjs/api/routing/defaultErrorHandler.cjs +14 -21
  11. package/_cjs/api/routing/defaultErrorHandler.cjs.map +1 -1
  12. package/_cjs/api/routing/makeRequestHandler.cjs +44 -51
  13. package/_cjs/api/routing/makeRequestHandler.cjs.map +1 -1
  14. package/_cjs/api/routing/match.cjs +6 -13
  15. package/_cjs/api/routing/match.cjs.map +1 -1
  16. package/_cjs/api/{express → routing}/schema/jwt.cjs +3 -4
  17. package/_cjs/api/routing/schema/jwt.cjs.map +1 -0
  18. package/_cjs/api/routing/schema/routing.cjs +136 -0
  19. package/_cjs/api/routing/schema/routing.cjs.map +1 -0
  20. package/_cjs/api/setupRequest.cjs +16 -22
  21. package/_cjs/api/setupRequest.cjs.map +1 -1
  22. package/_cjs/errorReporter.cjs +16 -17
  23. package/_cjs/errorReporter.cjs.map +1 -1
  24. package/_cjs/errors.cjs +2 -4
  25. package/_cjs/errors.cjs.map +1 -1
  26. package/_cjs/filter/types/path/index.cjs +0 -2
  27. package/_cjs/filter/types/path/index.cjs.map +1 -1
  28. package/_cjs/filter.cjs +35 -0
  29. package/_cjs/filter.cjs.map +1 -1
  30. package/_cjs/logger/jsonLogger.cjs +9 -15
  31. package/_cjs/logger/jsonLogger.cjs.map +1 -1
  32. package/_cjs/logger/logFmtLogger.cjs +7 -11
  33. package/_cjs/logger/logFmtLogger.cjs.map +1 -1
  34. package/_cjs/logger/shared.cjs +6 -8
  35. package/_cjs/logger/shared.cjs.map +1 -1
  36. package/_cjs/rateLimit.cjs +9 -12
  37. package/_cjs/rateLimit.cjs.map +1 -1
  38. package/_cjs/services/Emailer/Sendgrid.cjs +9 -16
  39. package/_cjs/services/Emailer/Sendgrid.cjs.map +1 -1
  40. package/_cjs/services/Emailer/fake.cjs +5 -8
  41. package/_cjs/services/Emailer/fake.cjs.map +1 -1
  42. package/_cjs/services/Emailer/service.cjs +2 -4
  43. package/_cjs/services/Emailer/service.cjs.map +1 -1
  44. package/_cjs/services/Operations/live.cjs +29 -42
  45. package/_cjs/services/Operations/live.cjs.map +1 -1
  46. package/_cjs/services/Operations/service.cjs +15 -15
  47. package/_cjs/services/Operations/service.cjs.map +1 -1
  48. package/_cjs/services/QueueMaker/errors.cjs +8 -12
  49. package/_cjs/services/QueueMaker/errors.cjs.map +1 -1
  50. package/_cjs/services/QueueMaker/memQueue.cjs +27 -33
  51. package/_cjs/services/QueueMaker/memQueue.cjs.map +1 -1
  52. package/_cjs/services/QueueMaker/sbqueue.cjs +31 -40
  53. package/_cjs/services/QueueMaker/sbqueue.cjs.map +1 -1
  54. package/_cjs/services/QueueMaker/service.cjs +7 -9
  55. package/_cjs/services/QueueMaker/service.cjs.map +1 -1
  56. package/_cjs/services/Repository/dsl.cjs +11 -14
  57. package/_cjs/services/Repository/dsl.cjs.map +1 -1
  58. package/_cjs/services/Repository/ext.cjs +62 -71
  59. package/_cjs/services/Repository/ext.cjs.map +1 -1
  60. package/_cjs/services/RepositoryBase.cjs +212 -197
  61. package/_cjs/services/RepositoryBase.cjs.map +1 -1
  62. package/_cjs/services/RequestContextContainer.cjs +17 -23
  63. package/_cjs/services/RequestContextContainer.cjs.map +1 -1
  64. package/_cjs/services/Store/ContextMapContainer.cjs +10 -16
  65. package/_cjs/services/Store/ContextMapContainer.cjs.map +1 -1
  66. package/_cjs/services/Store/Cosmos/query.cjs +5 -9
  67. package/_cjs/services/Store/Cosmos/query.cjs.map +1 -1
  68. package/_cjs/services/Store/Cosmos.cjs +58 -68
  69. package/_cjs/services/Store/Cosmos.cjs.map +1 -1
  70. package/_cjs/services/Store/Disk.cjs +34 -36
  71. package/_cjs/services/Store/Disk.cjs.map +1 -1
  72. package/_cjs/services/Store/Memory.cjs +55 -65
  73. package/_cjs/services/Store/Memory.cjs.map +1 -1
  74. package/_cjs/services/Store/codeFilter.cjs +2 -4
  75. package/_cjs/services/Store/codeFilter.cjs.map +1 -1
  76. package/_cjs/services/Store/codeFilter.test.cjs +13 -12
  77. package/_cjs/services/Store/codeFilter.test.cjs.map +1 -1
  78. package/_cjs/services/Store/filterApi/query.cjs +2 -4
  79. package/_cjs/services/Store/filterApi/query.cjs.map +1 -1
  80. package/_cjs/services/Store/index.cjs +6 -9
  81. package/_cjs/services/Store/index.cjs.map +1 -1
  82. package/_cjs/services/Store/service.cjs +5 -7
  83. package/_cjs/services/Store/service.cjs.map +1 -1
  84. package/_cjs/services/Store/utils.cjs +16 -20
  85. package/_cjs/services/Store/utils.cjs.map +1 -1
  86. package/_cjs/services/query.cjs +4 -1
  87. package/_cjs/services/query.cjs.map +1 -1
  88. package/_cjs/test.arbs.cjs +3 -4
  89. package/_cjs/test.arbs.cjs.map +1 -1
  90. package/dist/RequestContext.d.ts +20 -20
  91. package/dist/RequestContext.d.ts.map +1 -1
  92. package/dist/RequestContext.js +15 -8
  93. package/dist/_ext/Array.d.ts +2 -3
  94. package/dist/_ext/Array.d.ts.map +1 -1
  95. package/dist/_ext/Array.js +5 -5
  96. package/dist/api/reportError.d.ts +5 -5
  97. package/dist/api/reportError.d.ts.map +1 -1
  98. package/dist/api/reportError.js +6 -6
  99. package/dist/api/routing/base.d.ts +11 -15
  100. package/dist/api/routing/base.d.ts.map +1 -1
  101. package/dist/api/routing/base.js +48 -67
  102. package/dist/api/routing/defaultErrorHandler.d.ts +4 -6
  103. package/dist/api/routing/defaultErrorHandler.d.ts.map +1 -1
  104. package/dist/api/routing/defaultErrorHandler.js +26 -28
  105. package/dist/api/routing/makeRequestHandler.d.ts +6 -7
  106. package/dist/api/routing/makeRequestHandler.d.ts.map +1 -1
  107. package/dist/api/routing/makeRequestHandler.js +69 -59
  108. package/dist/api/routing/match.d.ts +7 -8
  109. package/dist/api/routing/match.d.ts.map +1 -1
  110. package/dist/api/routing/match.js +7 -11
  111. package/dist/api/routing/schema/jwt.d.ts +4 -0
  112. package/dist/api/routing/schema/jwt.d.ts.map +1 -0
  113. package/dist/api/routing/schema/jwt.js +11 -0
  114. package/dist/api/{express → routing}/schema/routing.d.ts +2 -2
  115. package/dist/api/routing/schema/routing.d.ts.map +1 -0
  116. package/dist/api/routing/schema/routing.js +123 -0
  117. package/dist/api/routing.js +3 -1
  118. package/dist/api/setupRequest.d.ts +3 -5
  119. package/dist/api/setupRequest.d.ts.map +1 -1
  120. package/dist/api/setupRequest.js +20 -24
  121. package/dist/errorReporter.d.ts +4 -4
  122. package/dist/errorReporter.d.ts.map +1 -1
  123. package/dist/errorReporter.js +20 -17
  124. package/dist/errors.d.ts +1 -1
  125. package/dist/errors.d.ts.map +1 -1
  126. package/dist/errors.js +3 -3
  127. package/dist/filter/types/path/index.d.ts +2 -2
  128. package/dist/filter/types/path/index.d.ts.map +1 -1
  129. package/dist/filter/types/path/index.js +2 -3
  130. package/dist/filter/types.js +2 -1
  131. package/dist/filter.d.ts.map +1 -1
  132. package/dist/filter.js +36 -1
  133. package/dist/logger/jsonLogger.d.ts +2 -1
  134. package/dist/logger/jsonLogger.d.ts.map +1 -1
  135. package/dist/logger/jsonLogger.js +9 -13
  136. package/dist/logger/logFmtLogger.d.ts +2 -1
  137. package/dist/logger/logFmtLogger.d.ts.map +1 -1
  138. package/dist/logger/logFmtLogger.js +9 -11
  139. package/dist/logger/shared.d.ts +2 -1
  140. package/dist/logger/shared.d.ts.map +1 -1
  141. package/dist/logger/shared.js +7 -9
  142. package/dist/rateLimit.d.ts +7 -10
  143. package/dist/rateLimit.d.ts.map +1 -1
  144. package/dist/rateLimit.js +17 -16
  145. package/dist/services/Emailer/Sendgrid.d.ts +1 -2
  146. package/dist/services/Emailer/Sendgrid.d.ts.map +1 -1
  147. package/dist/services/Emailer/Sendgrid.js +16 -20
  148. package/dist/services/Emailer/fake.d.ts +2 -2
  149. package/dist/services/Emailer/fake.d.ts.map +1 -1
  150. package/dist/services/Emailer/fake.js +10 -8
  151. package/dist/services/Emailer/service.d.ts +7 -10
  152. package/dist/services/Emailer/service.d.ts.map +1 -1
  153. package/dist/services/Emailer/service.js +3 -3
  154. package/dist/services/Operations/live.d.ts +2 -3
  155. package/dist/services/Operations/live.d.ts.map +1 -1
  156. package/dist/services/Operations/live.js +44 -51
  157. package/dist/services/Operations/service.d.ts +14 -19
  158. package/dist/services/Operations/service.d.ts.map +1 -1
  159. package/dist/services/Operations/service.js +23 -28
  160. package/dist/services/QueueMaker/errors.d.ts +5 -7
  161. package/dist/services/QueueMaker/errors.d.ts.map +1 -1
  162. package/dist/services/QueueMaker/errors.js +11 -11
  163. package/dist/services/QueueMaker/memQueue.d.ts +6 -9
  164. package/dist/services/QueueMaker/memQueue.d.ts.map +1 -1
  165. package/dist/services/QueueMaker/memQueue.js +37 -39
  166. package/dist/services/QueueMaker/sbqueue.d.ts +6 -9
  167. package/dist/services/QueueMaker/sbqueue.d.ts.map +1 -1
  168. package/dist/services/QueueMaker/sbqueue.js +41 -39
  169. package/dist/services/QueueMaker/service.d.ts +2 -4
  170. package/dist/services/QueueMaker/service.d.ts.map +1 -1
  171. package/dist/services/QueueMaker/service.js +8 -8
  172. package/dist/services/Repository/dsl.d.ts +11 -13
  173. package/dist/services/Repository/dsl.d.ts.map +1 -1
  174. package/dist/services/Repository/dsl.js +12 -13
  175. package/dist/services/Repository/ext.d.ts +34 -62
  176. package/dist/services/Repository/ext.d.ts.map +1 -1
  177. package/dist/services/Repository/ext.js +59 -70
  178. package/dist/services/RepositoryBase.d.ts +101 -71
  179. package/dist/services/RepositoryBase.d.ts.map +1 -1
  180. package/dist/services/RepositoryBase.js +229 -226
  181. package/dist/services/RequestContextContainer.d.ts +13 -21
  182. package/dist/services/RequestContextContainer.d.ts.map +1 -1
  183. package/dist/services/RequestContextContainer.js +21 -25
  184. package/dist/services/Store/ContextMapContainer.d.ts +11 -18
  185. package/dist/services/Store/ContextMapContainer.d.ts.map +1 -1
  186. package/dist/services/Store/ContextMapContainer.js +17 -18
  187. package/dist/services/Store/Cosmos/query.d.ts +3 -2
  188. package/dist/services/Store/Cosmos/query.d.ts.map +1 -1
  189. package/dist/services/Store/Cosmos/query.js +10 -11
  190. package/dist/services/Store/Cosmos.d.ts +2 -3
  191. package/dist/services/Store/Cosmos.d.ts.map +1 -1
  192. package/dist/services/Store/Cosmos.js +107 -90
  193. package/dist/services/Store/Disk.d.ts +4 -4
  194. package/dist/services/Store/Disk.d.ts.map +1 -1
  195. package/dist/services/Store/Disk.js +54 -50
  196. package/dist/services/Store/Memory.d.ts +6 -8
  197. package/dist/services/Store/Memory.d.ts.map +1 -1
  198. package/dist/services/Store/Memory.js +93 -89
  199. package/dist/services/Store/codeFilter.d.ts.map +1 -1
  200. package/dist/services/Store/codeFilter.js +3 -3
  201. package/dist/services/Store/codeFilter.test.d.ts.map +1 -1
  202. package/dist/services/Store/filterApi/query.d.ts +1 -1
  203. package/dist/services/Store/filterApi/query.d.ts.map +1 -1
  204. package/dist/services/Store/filterApi/query.js +3 -3
  205. package/dist/services/Store/index.d.ts +1 -2
  206. package/dist/services/Store/index.d.ts.map +1 -1
  207. package/dist/services/Store/index.js +7 -8
  208. package/dist/services/Store/service.d.ts +20 -23
  209. package/dist/services/Store/service.d.ts.map +1 -1
  210. package/dist/services/Store/service.js +6 -6
  211. package/dist/services/Store/utils.d.ts +3 -3
  212. package/dist/services/Store/utils.d.ts.map +1 -1
  213. package/dist/services/Store/utils.js +26 -28
  214. package/dist/services/query.d.ts +6 -6
  215. package/dist/services/query.d.ts.map +1 -1
  216. package/dist/services/query.js +5 -3
  217. package/dist/test.arbs.d.ts +0 -2
  218. package/dist/test.arbs.d.ts.map +1 -1
  219. package/dist/test.arbs.js +3 -4
  220. package/package.json +28 -168
  221. package/src/RequestContext.ts +1 -0
  222. package/src/_ext/Array.ts +5 -2
  223. package/src/api/reportError.ts +14 -10
  224. package/src/api/routing/base.ts +77 -110
  225. package/src/api/routing/defaultErrorHandler.ts +64 -54
  226. package/src/api/routing/makeRequestHandler.ts +165 -135
  227. package/src/api/routing/match.ts +14 -8
  228. package/src/api/{express → routing}/schema/jwt.ts +6 -5
  229. package/src/api/{express → routing}/schema/routing.ts +2 -1
  230. package/src/api/setupRequest.ts +30 -24
  231. package/src/errorReporter.ts +12 -11
  232. package/src/errors.ts +1 -0
  233. package/src/filter/types/path/index.ts +2 -2
  234. package/src/logger/jsonLogger.ts +6 -5
  235. package/src/logger/logFmtLogger.ts +4 -5
  236. package/src/logger/shared.ts +4 -3
  237. package/src/rateLimit.ts +37 -34
  238. package/src/services/Emailer/Sendgrid.ts +12 -10
  239. package/src/services/Emailer/fake.ts +7 -4
  240. package/src/services/Emailer/service.ts +4 -1
  241. package/src/services/Operations/live.ts +66 -59
  242. package/src/services/Operations/service.ts +41 -34
  243. package/src/services/QueueMaker/errors.ts +15 -11
  244. package/src/services/QueueMaker/memQueue.ts +59 -40
  245. package/src/services/QueueMaker/sbqueue.ts +54 -33
  246. package/src/services/QueueMaker/service.ts +7 -6
  247. package/src/services/Repository/dsl.ts +18 -14
  248. package/src/services/Repository/ext.ts +58 -50
  249. package/src/services/RepositoryBase.ts +478 -351
  250. package/src/services/RequestContextContainer.ts +30 -18
  251. package/src/services/Store/ContextMapContainer.ts +26 -13
  252. package/src/services/Store/Cosmos/query.ts +17 -11
  253. package/src/services/Store/Cosmos.ts +209 -168
  254. package/src/services/Store/Disk.ts +69 -53
  255. package/src/services/Store/Memory.ts +138 -97
  256. package/src/services/Store/{Redis.ts → Redis.ts.bak} +7 -5
  257. package/src/services/Store/codeFilter.test.ts +61 -36
  258. package/src/services/Store/codeFilter.ts +1 -0
  259. package/src/services/Store/filterApi/query.ts +1 -0
  260. package/src/services/Store/index.ts +7 -6
  261. package/src/services/Store/service.ts +4 -1
  262. package/src/services/Store/utils.ts +25 -23
  263. package/src/services/query.ts +3 -2
  264. package/src/services/simpledb/{cosmosdb.ts → cosmosdb.ts.bak} +1 -0
  265. package/src/services/simpledb/{diskdb.ts → diskdb.ts.bak} +2 -1
  266. package/src/services/simpledb/{memdb.ts → memdb.ts.bak} +3 -2
  267. package/src/services/simpledb/{mongodb.ts → mongodb.ts.bak} +1 -0
  268. package/src/services/simpledb/{redisdb.ts → redisdb.ts.bak} +17 -14
  269. package/src/services/simpledb/{shared.ts → shared.ts.bak} +2 -1
  270. package/src/services/simpledb/{simpledb.ts → simpledb.ts.bak} +6 -2
  271. package/tsconfig.json +4 -21
  272. package/tsconfig.json.bak +0 -4
  273. package/_cjs/_global.cjs +0 -6
  274. package/_cjs/_global.cjs.map +0 -1
  275. package/_cjs/_global.ext.cjs +0 -5
  276. package/_cjs/_global.ext.cjs.map +0 -1
  277. package/_cjs/_global.schema.cjs +0 -5
  278. package/_cjs/_global.schema.cjs.map +0 -1
  279. package/_cjs/api/defaultErrorHandler.cjs +0 -37
  280. package/_cjs/api/defaultErrorHandler.cjs.map +0 -1
  281. package/_cjs/api/express/schema/jwt.cjs.map +0 -1
  282. package/_cjs/api/express/schema/routing.cjs +0 -23
  283. package/_cjs/api/express/schema/routing.cjs.map +0 -1
  284. package/_cjs/api/http.cjs +0 -42
  285. package/_cjs/api/http.cjs.map +0 -1
  286. package/_cjs/services/Store/Redis.cjs +0 -73
  287. package/_cjs/services/Store/Redis.cjs.map +0 -1
  288. package/_cjs/services/simpledb/cosmosdb.cjs +0 -109
  289. package/_cjs/services/simpledb/cosmosdb.cjs.map +0 -1
  290. package/_cjs/services/simpledb/diskdb.cjs +0 -125
  291. package/_cjs/services/simpledb/diskdb.cjs.map +0 -1
  292. package/_cjs/services/simpledb/index.cjs +0 -38
  293. package/_cjs/services/simpledb/index.cjs.map +0 -1
  294. package/_cjs/services/simpledb/memdb.cjs +0 -72
  295. package/_cjs/services/simpledb/memdb.cjs.map +0 -1
  296. package/_cjs/services/simpledb/mongodb.cjs +0 -99
  297. package/_cjs/services/simpledb/mongodb.cjs.map +0 -1
  298. package/_cjs/services/simpledb/redisdb.cjs +0 -135
  299. package/_cjs/services/simpledb/redisdb.cjs.map +0 -1
  300. package/_cjs/services/simpledb/shared.cjs +0 -79
  301. package/_cjs/services/simpledb/shared.cjs.map +0 -1
  302. package/_cjs/services/simpledb/simpledb.cjs +0 -85
  303. package/_cjs/services/simpledb/simpledb.cjs.map +0 -1
  304. package/dist/_global.d.ts +0 -10
  305. package/dist/_global.d.ts.map +0 -1
  306. package/dist/_global.ext.d.ts +0 -34
  307. package/dist/_global.ext.d.ts.map +0 -1
  308. package/dist/_global.ext.js +0 -6
  309. package/dist/_global.js +0 -12
  310. package/dist/_global.schema.d.ts +0 -6
  311. package/dist/_global.schema.d.ts.map +0 -1
  312. package/dist/_global.schema.js +0 -9
  313. package/dist/api/defaultErrorHandler.d.ts +0 -6
  314. package/dist/api/defaultErrorHandler.d.ts.map +0 -1
  315. package/dist/api/defaultErrorHandler.js +0 -34
  316. package/dist/api/express/schema/jwt.d.ts +0 -6
  317. package/dist/api/express/schema/jwt.d.ts.map +0 -1
  318. package/dist/api/express/schema/jwt.js +0 -11
  319. package/dist/api/express/schema/routing.d.ts.map +0 -1
  320. package/dist/api/express/schema/routing.js +0 -10
  321. package/dist/api/http.d.ts +0 -16
  322. package/dist/api/http.d.ts.map +0 -1
  323. package/dist/api/http.js +0 -12
  324. package/dist/services/Store/Redis.d.ts +0 -6
  325. package/dist/services/Store/Redis.d.ts.map +0 -1
  326. package/dist/services/Store/Redis.js +0 -76
  327. package/dist/services/simpledb/cosmosdb.d.ts +0 -14
  328. package/dist/services/simpledb/cosmosdb.d.ts.map +0 -1
  329. package/dist/services/simpledb/cosmosdb.js +0 -103
  330. package/dist/services/simpledb/diskdb.d.ts +0 -12
  331. package/dist/services/simpledb/diskdb.d.ts.map +0 -1
  332. package/dist/services/simpledb/diskdb.js +0 -109
  333. package/dist/services/simpledb/index.d.ts +0 -7
  334. package/dist/services/simpledb/index.d.ts.map +0 -1
  335. package/dist/services/simpledb/index.js +0 -7
  336. package/dist/services/simpledb/memdb.d.ts +0 -11
  337. package/dist/services/simpledb/memdb.d.ts.map +0 -1
  338. package/dist/services/simpledb/memdb.js +0 -58
  339. package/dist/services/simpledb/mongodb.d.ts +0 -13
  340. package/dist/services/simpledb/mongodb.d.ts.map +0 -1
  341. package/dist/services/simpledb/mongodb.js +0 -68
  342. package/dist/services/simpledb/redisdb.d.ts +0 -35
  343. package/dist/services/simpledb/redisdb.d.ts.map +0 -1
  344. package/dist/services/simpledb/redisdb.js +0 -126
  345. package/dist/services/simpledb/shared.d.ts +0 -87
  346. package/dist/services/simpledb/shared.d.ts.map +0 -1
  347. package/dist/services/simpledb/shared.js +0 -52
  348. package/dist/services/simpledb/simpledb.d.ts +0 -23
  349. package/dist/services/simpledb/simpledb.d.ts.map +0 -1
  350. package/dist/services/simpledb/simpledb.js +0 -69
  351. package/src/_global.ext.ts +0 -36
  352. package/src/_global.schema.ts +0 -10
  353. package/src/_global.ts +0 -14
  354. package/src/api/defaultErrorHandler.ts +0 -59
  355. package/src/api/express/makeJsonSchema.test.ts.bak +0 -76
  356. package/src/api/express/makeJsonSchema.ts.bak +0 -166
  357. package/src/api/express/makeOpenApiSpecs.ts.bak +0 -62
  358. package/src/api/http.ts +0 -26
  359. package/tsplus.config.json +0 -9
  360. /package/src/services/simpledb/{index.ts → index.ts.bak} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Sendgrid.cjs","names":["_utils","require","_mail","_interopRequireDefault","_util","_service","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","makeSendgrid","apiKey","defaultFrom","defaultReplyTo","realMail","subjectPrefix","tsplus_module_2","sync","sgMail","setApiKey","tsplus_module_1","value","Emailer","sendMail","msg_","gen","$","msg","dropUndefinedT","from","replyTo","undefined","render","renderMessage","renderedMsg_","renderedMsg","subject","annotateLogs","logDebug","inspect","ret","async","cb","send","err","result","fail","Sendgrid","config","tsplus_module_3","effect","forceFake","makeId","to","renderFake","cc","bcc","renderFakeIfTest","isTestAddress","toLowerCase","endsWith","email","addr","name","renderMailData","eq","tsplus_module_4","mapInput","string","Array","isArray","tsplus_module_6","iterableToArray","tsplus_module_5","dedupeWith","map","x","md","join"],"sources":["../../../src/services/Emailer/Sendgrid.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAAsC,SAAAE,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAE,GAAA,CAAAL,CAAA,UAAAG,CAAA,CAAAG,GAAA,CAAAN,CAAA,OAAAO,CAAA,KAA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,SAASF,gBAAgBA,CAACK,IAA6B,EAAEV,MAAoB;EAC3E,OAAOiB,KAAK,CAACC,OAAO,CAACR,IAAI,CAAC,GACvBS,eAAA,CAAAC,eAAA,CAACC,eAAA,CAAAC,UAAA,CAAAZ,IAAI,CACHa,GAAG,CAAEC,CAAC,IAAMlB,aAAa,CAACkB,CAAC,CAAC,GAAGtB,UAAU,CAACsB,CAAC,EAAExB,MAAM,CAAC,GAAGwB,CAAE,CAAC,EAC/CX,EAAE,CAAC,IAEfP,aAAa,CAACI,IAAI,CAAC,GACnBR,UAAU,CAACQ,IAAI,EAAEV,MAAM,CAAC,GACxBU,IAAI;AACV;AAEA,SAASE,cAAcA,CAACa,EAA+B;EACrD,IAAIR,KAAK,CAACC,OAAO,CAACO,EAAE,CAAC,EAAE;IACrB,OAAOA,EAAE,CAACF,GAAG,CAACX,cAAc,CAAC,CAACc,IAAI,CAAC,IAAI,CAAC;EAC1C;EACA,IAAI,OAAOD,EAAE,KAAK,QAAQ,EAAE;IAC1B,OAAOA,EAAE;EACX;EACA,OAAOA,EAAE,CAAChB,KAAK;AACjB"}
1
+ {"version":3,"file":"Sendgrid.cjs","names":["_utils","require","_mail","_interopRequireDefault","_effectApp","_util","_service","obj","__esModule","default","makeSendgrid","apiKey","defaultFrom","defaultReplyTo","realMail","subjectPrefix","Effect","sync","sgMail","setApiKey","Secret","value","Emailer","sendMail","msg_","gen","$","msg","dropUndefinedT","from","replyTo","undefined","render","renderMessage","renderedMsg_","renderedMsg","subject","logDebug","pipe","annotateLogs","inspect","ret","async","cb","send","err","result","fail","Sendgrid","config","toLayer","forceFake","i","makeId","to","renderFake","cc","bcc","renderFakeIfTest","isTestAddress","toLowerCase","endsWith","email","addr","name","renderMailData","eq","Equivalence","mapInput","string","Array","isArray","ReadonlyArray","dedupeWith","map","x","md","join"],"sources":["../../../src/services/Emailer/Sendgrid.ts"],"sourcesContent":[null],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,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,IAAI,EAAEV,MAAM,CAAC,GACxBU,IAAI;AACV;AAEA,SAASE,cAAcA,CAACW,EAA+B;EACrD,IAAIN,KAAK,CAACC,OAAO,CAACK,EAAE,CAAC,EAAE;IACrB,OAAOA,EAAE,CAACF,GAAG,CAACT,cAAc,CAAC,CAACY,IAAI,CAAC,IAAI,CAAC;EAC1C;EACA,IAAI,OAAOD,EAAE,KAAK,QAAQ,EAAE;IAC1B,OAAOA,EAAE;EACX;EACA,OAAOA,EAAE,CAACd,KAAK;AACjB"}
@@ -4,19 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.FakeSendgrid = void 0;
7
- var tsplus_module_1 = _interopRequireWildcard(require("effect/Effect"));
8
- var tsplus_module_2 = _interopRequireWildcard(require("effect/Layer"));
7
+ var _effectApp = require("effect-app");
9
8
  var _utils = require("effect-app/utils");
10
9
  var _service = require("./service.cjs");
11
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
- const makeFake = tsplus_module_1.logDebug("FAKE Emailer Service enabled").map(() => new _service.Emailer({
10
+ const makeFake = _effectApp.Effect.logDebug("FAKE Emailer Service enabled").pipe(_effectApp.Effect.map(() => new _service.Emailer({
14
11
  sendMail(msg) {
15
- return tsplus_module_1.annotateLogs(tsplus_module_1.logDebug(`Fake send mail`), "msg", (0, _utils.pretty)(msg));
12
+ return _effectApp.Effect.logDebug(`Fake send mail`).pipe(_effectApp.Effect.annotateLogs("msg", (0, _utils.pretty)(msg)));
16
13
  }
17
- }));
14
+ })));
18
15
  /**
19
16
  * @tsplus static Emailer.Ops Fake
20
17
  */
21
- const FakeSendgrid = exports.FakeSendgrid = tsplus_module_2.effect(_service.Emailer)(makeFake);
18
+ const FakeSendgrid = exports.FakeSendgrid = _effectApp.Layer.effect(_service.Emailer, makeFake);
22
19
  //# sourceMappingURL=fake.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"fake.cjs","names":["_utils","require","_service","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","makeFake","tsplus_module_1","logDebug","map","Emailer","sendMail","msg","annotateLogs","pretty","FakeSendgrid","exports","tsplus_module_2","effect"],"sources":["../../../src/services/Emailer/fake.ts"],"sourcesContent":[null],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAsC,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAlB,CAAA,EAAAe,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAf,CAAA,CAAAe,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAN,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAiB,GAAA,CAAApB,CAAA,EAAAS,CAAA,GAAAA,CAAA;AAEtC,MAAMY,QAAQ,GAAGC,eAAA,CAAAC,QAAA,CACL,8BAA8B,CAAC,CACxCC,GAAG,CAAC,MACH,IAAIC,gBAAO,CAAC;EACVC,QAAQA,CAACC,GAAG;IACV,OAAOL,eAAA,CAAAM,YAAA,CAAAN,eAAA,CAAAC,QAAA,CAAgB,gBAAgB,CAAC,EAAc,KAAK,EAAE,IAAAM,aAAM,EAACF,GAAG,CAAC,CAAC;EAC3E;CACD,CAAC,CACH;AAEH;;;AAGO,MAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,eAAA,CAAAC,MAAA,CAAiBR,gBAAO,EAAxBJ,QAAQ,CAAiB"}
1
+ {"version":3,"file":"fake.cjs","names":["_effectApp","require","_utils","_service","makeFake","Effect","logDebug","pipe","map","Emailer","sendMail","msg","annotateLogs","pretty","FakeSendgrid","exports","Layer","effect"],"sources":["../../../src/services/Emailer/fake.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,MAAMG,QAAQ,GAAGC,iBAAM,CACpBC,QAAQ,CAAC,8BAA8B,CAAC,CACxCC,IAAI,CAACF,iBAAM,CAACG,GAAG,CAAC,MACf,IAAIC,gBAAO,CAAC;EACVC,QAAQA,CAACC,GAAG;IACV,OAAON,iBAAM,CACVC,QAAQ,CAAC,gBAAgB,CAAC,CAC1BC,IAAI,CAACF,iBAAM,CAACO,YAAY,CAAC,KAAK,EAAE,IAAAC,aAAM,EAACF,GAAG,CAAC,CAAC,CAAC;EAClD;CACD,CAAC,CACH,CAAC;AAEJ;;;AAGO,MAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,gBAAK,CAACC,MAAM,CAACR,gBAAO,EAAEL,QAAQ,CAAC"}
@@ -4,13 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Emailer = void 0;
7
- var tsplus_module_1 = _interopRequireWildcard(require("effect-app/service"));
8
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
7
+ var _service = require("effect-app/service");
10
8
  /**
11
9
  * @tsplus type Emailer
12
10
  * @tsplus companion Emailer.Ops
13
11
  */
14
- class Emailer extends tsplus_module_1.TagClassId("effect-app/Emailer")() {}
12
+ class Emailer extends (0, _service.TagClassId)("effect-app/Emailer")() {}
15
13
  exports.Emailer = Emailer;
16
14
  //# sourceMappingURL=service.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"service.cjs","names":["Emailer","tsplus_module_1","TagClassId","exports"],"sources":["../../../src/services/Emailer/service.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;AAIA;;;;AAIM,MAAOA,OAAQ,SAAQC,eAAA,CAAAC,UAAU,CAAC,oBAAoB,CAAC,EAEzD;AAAGC,OAAA,CAAAH,OAAA,GAAAA,OAAA"}
1
+ {"version":3,"file":"service.cjs","names":["_service","require","Emailer","TagClassId","exports"],"sources":["../../../src/services/Emailer/service.ts"],"sourcesContent":[null],"mappings":";;;;;;AAKA,IAAAA,QAAA,GAAAC,OAAA;AAEA;;;;AAIM,MAAOC,OAAQ,SAAQ,IAAAC,mBAAU,EAAC,oBAAoB,CAAC,EAEzD;AAAGC,OAAA,CAAAF,OAAA,GAAAA,OAAA"}
@@ -4,89 +4,76 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Live = void 0;
7
- var tsplus_module_1 = _interopRequireWildcard(require("effect/Effect"));
8
- var tsplus_module_2 = _interopRequireWildcard(require("effect-app/_ext/date"));
9
- var tsplus_module_3 = _interopRequireWildcard(require("effect/Option"));
10
- var tsplus_module_4 = _interopRequireWildcard(require("@effect-app/core/Chunk"));
11
- var tsplus_module_5 = _interopRequireWildcard(require("effect/Chunk"));
12
- var tsplus_module_6 = _interopRequireWildcard(require("effect/Exit"));
13
- var tsplus_module_7 = _interopRequireWildcard(require("effect/Cause"));
14
- var tsplus_module_8 = _interopRequireWildcard(require("effect-app/schema"));
15
- var tsplus_module_9 = _interopRequireWildcard(require("@effect/schema/Parser"));
16
- var tsplus_module_10 = _interopRequireWildcard(require("effect-app/_ext/misc"));
17
- var tsplus_module_11 = _interopRequireWildcard(require("effect/Duration"));
18
- var tsplus_module_12 = _interopRequireWildcard(require("effect/Schedule"));
19
- var tsplus_module_13 = _interopRequireWildcard(require("effect/Layer"));
7
+ var _Effect = require("@effect-app/core/Effect");
20
8
  var _errorReporter = require("@effect-app/infra/errorReporter");
9
+ var _schema = require("@effect-app/schema");
10
+ var _dateFns = require("date-fns");
11
+ var _effectApp = require("effect-app");
21
12
  var _Operations = require("effect-app/Operations");
22
13
  var _service = require("./service.cjs");
23
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
24
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
25
14
  const reportAppError = (0, _errorReporter.reportError)("Operations.Cleanup");
26
- const make = tsplus_module_1.sync(() => {
15
+ const make = _effectApp.Effect.sync(() => {
27
16
  const ops = new Map();
28
- const makeOp = tsplus_module_1.sync(() => _Operations.OperationId.make());
29
- const cleanup = tsplus_module_1.withSpan(tsplus_module_1.sync(() => {
30
- const before = tsplus_module_2.DateSubHours(new Date(), 1);
31
- tsplus_module_5.forEach(tsplus_module_4.fromIterable(ops.entries()), ([id, op]) => {
32
- const lastChanged = tsplus_module_3.fromNullable(op.updatedAt).getOrElse(() => op.createdAt);
17
+ const makeOp = _effectApp.Effect.sync(() => _Operations.OperationId.make());
18
+ const cleanup = _effectApp.Effect.sync(() => {
19
+ const before = (0, _dateFns.subHours)(new Date(), 1);
20
+ [...ops.entries()].forEach(([id, op]) => {
21
+ const lastChanged = _effectApp.Option.fromNullable(op.updatedAt).pipe(_effectApp.Option.getOrElse(() => op.createdAt));
33
22
  if (lastChanged < before) {
34
23
  ops.delete(id);
35
24
  }
36
25
  });
37
- }), "Operations.cleanup");
26
+ }).pipe(_effectApp.Effect.withSpan("Operations.cleanup"));
38
27
  function addOp(id) {
39
- return tsplus_module_1.sync(() => {
28
+ return _effectApp.Effect.sync(() => {
40
29
  ops.set(id, new _Operations.Operation({
41
30
  id
42
31
  }));
43
32
  });
44
33
  }
45
34
  function findOp(id) {
46
- return tsplus_module_1.sync(() => tsplus_module_3.fromNullable(ops.get(id)));
35
+ return _effectApp.Effect.sync(() => _effectApp.Option.fromNullable(ops.get(id)));
47
36
  }
48
37
  function finishOp(id, exit) {
49
- return findOp(id).flatMap(_ => tsplus_module_1.sync(() => {
50
- if (tsplus_module_3.isNone(_)) {
38
+ return _effectApp.Effect.flatMap(findOp(id), _ => _effectApp.Effect.sync(() => {
39
+ if (_effectApp.Option.isNone(_)) {
51
40
  throw new Error("Not found");
52
41
  }
53
- ops.set(id, {
54
- ..._.value,
42
+ ops.set(id, (0, _effectApp.copy)(_.value, {
55
43
  updatedAt: new Date(),
56
- result: tsplus_module_6.isSuccess(exit) ? new _Operations.Success() : new _Operations.Failure({
57
- message: tsplus_module_7.isInterrupted(exit.cause) ? tsplus_module_8.NonEmptyString2k("Interrupted") : tsplus_module_7.isDie(exit.cause) ? tsplus_module_8.NonEmptyString2k("Unknown error") : tsplus_module_7.failureOption(exit.cause).flatMap(_ => typeof _ === "object" && _ !== null && "message" in _ && tsplus_module_9.is(tsplus_module_8.NonEmptyString2k)(_.message) ? tsplus_module_3.some(_.message) : tsplus_module_3.none()).value ?? null
44
+ result: _effectApp.Exit.isSuccess(exit) ? new _Operations.Success() : new _Operations.Failure({
45
+ message: _effectApp.Cause.isInterrupted(exit.cause) ? (0, _schema.NonEmptyString2k)("Interrupted") : _effectApp.Cause.isDie(exit.cause) ? (0, _schema.NonEmptyString2k)("Unknown error") : _effectApp.Cause.failureOption(exit.cause).pipe(_effectApp.Option.flatMap(_ => typeof _ === "object" && _ !== null && "message" in _ && _effectApp.S.is(_schema.NonEmptyString2k)(_.message) ? _effectApp.Option.some(_.message) : _effectApp.Option.none()), _effectApp.Option.getOrNull)
58
46
  })
59
- });
47
+ }));
60
48
  }));
61
49
  }
62
50
  function update(id, progress) {
63
- return findOp(id).flatMap(_ => tsplus_module_1.sync(() => {
64
- if (tsplus_module_3.isNone(_)) {
51
+ return _effectApp.Effect.flatMap(findOp(id), _ => _effectApp.Effect.sync(() => {
52
+ if (_effectApp.Option.isNone(_)) {
65
53
  throw new Error("Not found");
66
54
  }
67
- ops.set(id, {
68
- ..._.value,
55
+ ops.set(id, (0, _effectApp.copy)(_.value, {
69
56
  updatedAt: new Date(),
70
57
  progress
71
- });
58
+ }));
72
59
  }));
73
60
  }
74
61
  return new _service.Operations({
75
62
  cleanup,
76
- register: makeOp.tap(id => tsplus_module_10.annotateLogscoped("operationId", id).andThen(tsplus_module_1.acquireRelease(addOp(id), (_, exit) => finishOp(id, exit)))),
63
+ register: _effectApp.Effect.tap(makeOp, id => _effectApp.Effect.andThen((0, _Effect.annotateLogscoped)("operationId", id), _effectApp.Effect.acquireRelease(addOp(id), (_, exit) => finishOp(id, exit)))),
77
64
  find: findOp,
78
65
  update
79
66
  });
80
67
  });
81
- const cleanupLoop = tsplus_module_1.forkScoped(tsplus_module_1.schedule(tsplus_module_1.exit(_service.Operations.flatMap(_ => _.cleanup)).flatMap(_ => {
82
- if (tsplus_module_6.isSuccess(_)) {
83
- return tsplus_module_1.unit;
68
+ const cleanupLoop = _service.Operations.pipe(_effectApp.Effect.flatMap(_ => _.cleanup), _effectApp.Effect.exit, _effectApp.Effect.flatMap(_ => {
69
+ if (_effectApp.Exit.isSuccess(_)) {
70
+ return _effectApp.Effect.unit;
84
71
  } else {
85
72
  return reportAppError(_.cause);
86
73
  }
87
- }), tsplus_module_12.fixed(tsplus_module_11.minutes(1))));
74
+ }), _effectApp.Effect.schedule(_effectApp.Schedule.fixed(_effectApp.Duration.minutes(1))), _effectApp.Effect.forkScoped);
88
75
  /**
89
76
  * @tsplus static Operations.Ops Live
90
77
  */
91
- const Live = exports.Live = tsplus_module_13.provideMerge(tsplus_module_13.scopedDiscard(cleanupLoop), tsplus_module_13.effect(_service.Operations)(make));
78
+ const Live = exports.Live = cleanupLoop.pipe(_effectApp.Layer.scopedDiscard, _effectApp.Layer.provideMerge(_effectApp.Layer.effect(_service.Operations, make)));
92
79
  //# sourceMappingURL=live.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"live.cjs","names":["_errorReporter","require","_Operations","_service","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","reportAppError","reportError","make","tsplus_module_1","sync","ops","Map","makeOp","OperationId","cleanup","withSpan","before","tsplus_module_2","DateSubHours","Date","tsplus_module_5","forEach","tsplus_module_4","fromIterable","entries","id","op","lastChanged","tsplus_module_3","fromNullable","updatedAt","getOrElse","createdAt","delete","addOp","Operation","findOp","finishOp","exit","flatMap","_","isNone","Error","value","result","tsplus_module_6","isSuccess","Success","Failure","message","tsplus_module_7","isInterrupted","cause","tsplus_module_8","NonEmptyString2k","isDie","failureOption","tsplus_module_9","is","some","none","update","progress","Operations","register","tap","tsplus_module_10","annotateLogscoped","andThen","acquireRelease","find","cleanupLoop","forkScoped","schedule","unit","tsplus_module_12","fixed","tsplus_module_11","minutes","Live","exports","tsplus_module_13","provideMerge","scopedDiscard","effect"],"sources":["../../../src/services/Operations/live.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAAyC,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,C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H;EACH;EACA,OAAO,IAAIC,mBAAU,CAAC;IACpBjD,OAAO;IACPkD,QAAQ,EAAEpD,MAAM,CACbqD,GAAG,CAAExC,EAAE,IACNyC,gBAAA,CAAAC,iBAAA,CACqB,aAAa,EAAE1C,EAAE,CAAC,CACpC2C,OAAO,CACN5D,eAAA,CAAA6D,cAAA,CAAAnC,KAAK,CAACT,EAAE,CAAC,EACP,CAACe,CAAC,EAAEF,IAAI,KAAKD,QAAQ,CAACZ,EAAE,EAAEa,IAAI,CAAC,CAChC,CACF,CACJ;IAEHgC,IAAI,EAAElC,MAAM;IACZyB;GACD,CAAC;AACJ,CAAC,CAAC;AAEF,MAAMU,WAAW,GAAA/D,eAAA,CAAAgE,UAAA,CAAGhE,eAAA,CAAAiE,QAAA,CAAAjE,eAAA,CAAA8B,IAAA,CAAAyB,mBAAU,CAC3BxB,OAAO,CAAEC,CAAC,IAAKA,CAAC,CAAC1B,OAAO,CAAC,EAEzByB,OAAO,CAAEC,CAAC,IAAI;EACb,IAAIK,eAAA,CAAAC,SAAA,CAAAN,CAAC,CAAY,EAAE;IACjB,OAAAhC,eAAA,CAAAkE,IAAA;EACF,CAAC,MAAM;IACL,OAAOrE,cAAc,CAACmC,CAAC,CAACY,KAAK,CAAC;EAChC;AACF,CAAC,CAAC,EACQuB,gBAAA,CAAAC,KAAA,CAAeC,gBAAA,CAAAC,OAAA,CAAiB,CAAC,CAAC,CAAC,CAAC,CACnC;AAEb;;;AAGO,MAAMC,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAGE,gBAAA,CAAAC,YAAA,CAAAD,gBAAA,CAAAE,aAAA,CAAAZ,WAAW,GAEfU,gBAAA,CAAAG,MAAA,CAAarB,mBAAU,EAAvBxD,IAAI,CAAoB,CAAC"}
1
+ {"version":3,"file":"live.cjs","names":["_Effect","require","_errorReporter","_schema","_dateFns","_effectApp","_Operations","_service","reportAppError","reportError","make","Effect","sync","ops","Map","makeOp","OperationId","cleanup","before","subHours","Date","entries","forEach","id","op","lastChanged","Option","fromNullable","updatedAt","pipe","getOrElse","createdAt","delete","withSpan","addOp","set","Operation","findOp","get","finishOp","exit","flatMap","_","isNone","Error","copy","value","result","Exit","isSuccess","Success","Failure","message","Cause","isInterrupted","cause","NonEmptyString2k","isDie","failureOption","S","is","some","none","getOrNull","update","progress","Operations","register","tap","andThen","annotateLogscoped","acquireRelease","find","cleanupLoop","unit","schedule","Schedule","fixed","Duration","minutes","forkScoped","Live","exports","Layer","scopedDiscard","provideMerge","effect"],"sources":["../../../src/services/Operations/live.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAEA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAEA,MAAMO,cAAc,GAAG,IAAAC,0BAAW,EAAC,oBAAoB,CAAC;AAExD,MAAMC,IAAI,GAAGC,iBAAM,CAACC,IAAI,CAAC,MAAK;EAC5B,MAAMC,GAAG,GAAG,IAAIC,GAAG,EAA0B;EAC7C,MAAMC,MAAM,GAAGJ,iBAAM,CAACC,IAAI,CAAC,MAAMI,uBAAW,CAACN,IAAI,EAAE,CAAC;EAEpD,MAAMO,OAAO,GAAGN,iBAAM,CACnBC,IAAI,CAAC,MAAK;IACT,MAAMM,MAAM,GAAG,IAAAC,iBAAQ,EAAC,IAAIC,IAAI,EAAE,EAAE,CAAC,CAAC;IACrC,CAAC,GAAGP,GAAG,CACLQ,OAAO,EAAE,CAAC,CACVC,OAAO,CAAC,CAAC,CAACC,EAAE,EAAEC,EAAE,CAAC,KAAI;MACpB,MAAMC,WAAW,GAAGC,iBAAM,CAACC,YAAY,CAACH,EAAE,CAACI,SAAS,CAAC,CAACC,IAAI,CAACH,iBAAM,CAACI,SAAS,CAAC,MAAMN,EAA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X,EAAE,CAAC,EAAE,CAACmB,CAAC,EAAEF,IAAI,KAAKD,QAAQ,CAAChB,EAAE,EAAEiB,IAAI,CAAC,CAAC,CAClE,CACJ;IAEDgC,IAAI,EAAEnC,MAAM;IACZ2B;GACD,CAAC;AACJ,CAAC,CAAC;AAEF,MAAMS,WAAW,GAAGP,mBAAU,CAC3BrC,IAAI,CACHlB,iBAAM,CAAC8B,OAAO,CAAEC,CAAC,IAAKA,CAAC,CAACzB,OAAO,CAAC,EAChCN,iBAAM,CAAC6B,IAAI,EACX7B,iBAAM,CACH8B,OAAO,CAAEC,CAAC,IAAI;EACb,IAAIM,eAAI,CAACC,SAAS,CAACP,CAAC,CAAC,EAAE;IACrB,OAAO/B,iBAAM,CAAC+D,IAAI;EACpB,CAAC,MAAM;IACL,OAAOlE,cAAc,CAACkC,CAAC,CAACa,KAAK,CAAC;EAChC;AACF,CAAC,CAAC,EACJ5C,iBAAM,CAACgE,QAAQ,CAACC,mBAAQ,CAACC,KAAK,CAACC,mBAAQ,CAACC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EACpDpE,iBAAM,CAACqE,UAAU,CAClB;AAEH;;;AAGO,MAAMC,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAGR,WAAW,CAC5B5C,IAAI,CACHsD,gBAAK,CAACC,aAAa,EACnBD,gBAAK,CAACE,YAAY,CAACF,gBAAK,CAACG,MAAM,CAACpB,mBAAU,EAAExD,IAAI,CAAC,CAAC,CACnD"}
@@ -3,50 +3,50 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.forkOperation = exports.Operations = void 0;
6
+ exports.Operations = void 0;
7
+ exports.forkOperation = forkOperation;
7
8
  exports.forkOperation2 = forkOperation2;
8
9
  exports.forkOperationFunction = forkOperationFunction;
9
10
  exports.forkOperationWithEffect = forkOperationWithEffect;
10
- var tsplus_module_1 = _interopRequireWildcard(require("effect-app/service"));
11
- var tsplus_module_2 = _interopRequireWildcard(require("effect/Effect"));
12
- var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/infra/api/reportError"));
11
+ var _effectApp = require("effect-app");
12
+ var _service = require("effect-app/service");
13
13
  var Scope = _interopRequireWildcard(require("effect/Scope"));
14
+ var _reportError = require("../../api/reportError.cjs");
14
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
- const forkOperation = exports.forkOperation = forkOperation_1;
17
17
  /**
18
18
  * @tsplus type Operations
19
19
  * @tsplus companion Operations.Ops
20
20
  */
21
- class Operations extends tsplus_module_1.TagClassId("effect-app/Operations")() {
22
- static find = tsplus_module_2.serviceFunctions(this).find;
23
- static update = tsplus_module_2.serviceFunctions(this).update;
24
- static register = tsplus_module_2.serviceConstants(this).register;
25
- static cleanup = tsplus_module_2.serviceConstants(this).cleanup;
21
+ class Operations extends (0, _service.TagClassId)("effect-app/Operations")() {
22
+ static find = _effectApp.Effect.serviceFunctions(this).find;
23
+ static update = _effectApp.Effect.serviceFunctions(this).update;
24
+ static register = _effectApp.Effect.serviceConstants(this).register;
25
+ static cleanup = _effectApp.Effect.serviceConstants(this).cleanup;
26
26
  }
27
27
  /**
28
28
  * @tsplus getter effect/io/Effect forkOperation
29
29
  */
30
30
  exports.Operations = Operations;
31
- function forkOperation_1(self) {
32
- return Operations.flatMap(Operations => Scope.make().flatMap(scope => Scope.extend(Operations.register, scope).tap(() => tsplus_module_3.forkDaemonReportRequestUnexpected(Scope.use(self, scope)))));
31
+ function forkOperation(self) {
32
+ return _effectApp.Effect.flatMap(Operations, Operations => _effectApp.Effect.flatMap(Scope.make(), scope => Operations.register.pipe(Scope.extend(scope), _effectApp.Effect.tap(() => (0, _reportError.forkDaemonReportRequestUnexpected)(Scope.use(self, scope))))));
33
33
  }
34
34
  /**
35
35
  * @tsplus getter function forkOperation
36
36
  */
37
37
  function forkOperationFunction(fnc) {
38
- return inp => forkOperation_1(fnc(inp));
38
+ return inp => fnc(inp).pipe(forkOperation);
39
39
  }
40
40
  /**
41
41
  * @tsplus static effect/io/Effect.Ops forkOperation
42
42
  */
43
43
  function forkOperation2(self) {
44
- return Operations.flatMap(Operations => Scope.make().flatMap(scope => Scope.extend(Operations.register, scope).tap(id => tsplus_module_3.forkDaemonReportRequestUnexpected(Scope.use(self(id), scope)))));
44
+ return _effectApp.Effect.flatMap(Operations, Operations => _effectApp.Effect.flatMap(Scope.make(), scope => Operations.register.pipe(Scope.extend(scope), _effectApp.Effect.tap(id => (0, _reportError.forkDaemonReportRequestUnexpected)(Scope.use(self(id), scope))))));
45
45
  }
46
46
  /**
47
47
  * @tsplus static effect/io/Effect.Ops forkOperationWithEffect
48
48
  */
49
49
  function forkOperationWithEffect(self, fnc) {
50
- return Operations.flatMap(Operations => Scope.make().flatMap(scope => Scope.extend(Operations.register, scope).tap(opId => tsplus_module_3.forkDaemonReportRequestUnexpected(Scope.use(self(opId), scope))).tap(opId => Scope.extend(tsplus_module_2.forkScoped(tsplus_module_2.interruptible(fnc(opId))), scope))));
50
+ return _effectApp.Effect.flatMap(Operations, Operations => _effectApp.Effect.flatMap(Scope.make(), scope => Operations.register.pipe(Scope.extend(scope), _effectApp.Effect.tap(opId => (0, _reportError.forkDaemonReportRequestUnexpected)(Scope.use(self(opId), scope))), _effectApp.Effect.tap(opId => _effectApp.Effect.interruptible(fnc(opId)).pipe(_effectApp.Effect.forkScoped, Scope.extend(scope))))));
51
51
  }
52
52
  //# sourceMappingURL=service.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"service.cjs","names":["Scope","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","forkOperation","exports","forkOperation_1","Operations","tsplus_module_1","TagClassId","find","tsplus_module_2","serviceFunctions","update","register","serviceConstants","cleanup","self","flatMap","make","scope","extend","tap","tsplus_module_3","forkDaemonReportRequestUnexpected","use","forkOperationFunction","fnc","inp","forkOperation2","id","forkOperationWithEffect","opId","forkScoped","interruptible"],"sources":["../../../src/services/Operations/service.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAqC,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,E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AkC,CAAC,CAChE,CACN;AACH;AAEA;;;AAGM,SAAUM,qBAAqBA,CAAeC,GAAkC;EACpF,OAAQC,GAAQ,IAAItB,eAAA,CAACqB,GAAG,CAACC,GAAG,CAAC,CAAc;AAC7C;AAEA;;;AAGM,SAAUC,cAAcA,CAAUZ,IAA4C;EAClF,OAAOV,UAAU,CAACW,OAAO,CACtBX,UAAU,IACT3B,KAAK,CACFuC,IAAI,EAAE,CACND,OAAO,CAAEE,KAAK,IACbxC,KAnDO,CAAAyC,MAAA,CAmDPd,UAAU,CACPO,QAAQ,EACDM,KAAK,CAAC,CACbE,GAAG,CAAEQ,EAAE,IAAIP,eAAA,CAAAC,iCAAA,CAAC5C,KAtDR,CAAA6C,GAAA,CAsDQR,IAAI,CAACa,EAAE,CAAC,EAAKV,KAAK,CAAC,CAAkC,CAAC,CACtE,CACN;AACH;AAEA;;;AAGM,SAAUW,uBAAuBA,CACrCd,IAA0C,EAC1CU,GAA4C;EAE5C,OAAOpB,UAAU,CAACW,OAAO,CACtBX,UAAU,IACT3B,KAAK,CACFuC,IAAI,EAAE,CACND,OAAO,CAAEE,KAAK,IACbxC,KAvEO,CAAAyC,MAAA,CAuEPd,UAAU,CACPO,QAAQ,EACDM,KAAK,CAAC,CACbE,GAAG,CAAEU,IAAI,IAAIT,eAAA,CAAAC,iCAAA,CAAC5C,KA1EV,CAAA6C,GAAA,CA0EUR,IAAI,CAACe,IAAI,CAAC,EAAKZ,KAAK,CAAC,CAAkC,CAAC,CACtEE,GAAG,CAAEU,IAAI,IAAKpD,KA3EV,CAAAyC,MAAA,CAAAV,eAAA,CAAAsB,UAAA,CAAAtB,eAAA,CAAAuB,aAAA,CA2EUP,GAAG,CAACK,IAAI,CAAC,IAAiCZ,KAAK,CAAC,CAAC,CACnE,CACN;AACH"}
1
+ {"version":3,"file":"service.cjs","names":["_effectApp","require","_service","Scope","_interopRequireWildcard","_reportError","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","Operations","TagClassId","find","Effect","serviceFunctions","update","register","serviceConstants","cleanup","exports","forkOperation","self","flatMap","make","scope","pipe","extend","tap","forkDaemonReportRequestUnexpected","use","forkOperationFunction","fnc","inp","forkOperation2","id","forkOperationWithEffect","opId","interruptible","forkScoped"],"sources":["../../../src/services/Operations/service.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAA4E,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,K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,CAAC,CAACP,IAAI,CAACL,aAAa,CAAC;AACnD;AAEA;;;AAGM,SAAUa,cAAcA,CAAUZ,IAA4C;EAClF,OAAOR,iBAAM,CAACS,OAAO,CAACZ,UAAU,EAAGA,UAAU,IAC3CG,iBAAM,CAACS,OAAO,CACZpC,KAAK,CAACqC,IAAI,EAAE,EACXC,KAAK,IACJd,UAAU,CACPM,QAAQ,CACRS,IAAI,CACHvC,KAAK,CAACwC,MAAM,CAACF,KAAK,CAAC,EACnBX,iBAAM,CACHc,GAAG,CAAEO,EAAE,IAAK,IAAAN,8CAAiC,EAAC1C,KAAK,CAAC2C,GAAG,CAACR,IAAI,CAACa,EAAE,CAAC,EAAEV,KAAK,CAAC,CAAC,CAAC,CAC9E,CACN,CAAC;AACN;AAEA;;;AAGM,SAAUW,uBAAuBA,CACrCd,IAA0C,EAC1CU,GAA4C;EAE5C,OAAOlB,iBAAM,CAACS,OAAO,CAACZ,UAAU,EAAGA,UAAU,IAC3CG,iBAAM,CAACS,OAAO,CACZpC,KAAK,CACFqC,IAAI,EAAE,EACRC,KAAK,IACJd,UAAU,CACPM,QAAQ,CACRS,IAAI,CACHvC,KAAK,CAACwC,MAAM,CAACF,KAAK,CAAC,EACnBX,iBAAM,CAACc,GAAG,CAAES,IAAI,IAAK,IAAAR,8CAAiC,EAAC1C,KAAK,CAAC2C,GAAG,CAACR,IAAI,CAACe,IAAI,CAAC,EAAEZ,KAAK,CAAC,CAAC,CAAC,EACrFX,iBAAM,CAACc,GAAG,CAAES,IAAI,IAAKvB,iBAAM,CAACwB,aAAa,CAACN,GAAG,CAACK,IAAI,CAAC,CAAC,CAACX,IAAI,CAACZ,iBAAM,CAACyB,UAAU,EAAEpD,KAAK,CAACwC,MAAM,CAACF,KAAK,CAAC,CAAC,CAAC,CACnG,CACN,CAAC;AACN"}
@@ -8,12 +8,8 @@ exports.reportFatalQueueError = void 0;
8
8
  exports.reportNonInterruptedFailure = reportNonInterruptedFailure;
9
9
  exports.reportNonInterruptedFailureCause = reportNonInterruptedFailureCause;
10
10
  exports.reportQueueError = void 0;
11
- var tsplus_module_1 = _interopRequireWildcard(require("effect/Effect"));
12
- var tsplus_module_2 = _interopRequireWildcard(require("effect/Exit"));
13
- var tsplus_module_3 = _interopRequireWildcard(require("effect/Cause"));
14
11
  var _errorReporter = require("@effect-app/infra/errorReporter");
15
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ var _effectApp = require("effect-app");
17
13
  const reportQueueError_ = (0, _errorReporter.reportError)("Queue");
18
14
  const reportQueueError = (cause, extras) => reportQueueError_(cause, extras);
19
15
  /**
@@ -27,20 +23,20 @@ const reportQueueError = (cause, extras) => reportQueueError_(cause, extras);
27
23
  */
28
24
  exports.reportQueueError = reportQueueError;
29
25
  function forkDaemonReportQueue(self) {
30
- return tsplus_module_1.daemonChildren(tsplus_module_1.fork(tsplus_module_1.tapErrorCause(self, reportNonInterruptedFailureCause({}))));
26
+ return self.pipe(_effectApp.Effect.tapErrorCause(reportNonInterruptedFailureCause({})), _effectApp.Effect.fork, _effectApp.Effect.daemonChildren);
31
27
  }
32
28
  const reportFatalQueueError = exports.reportFatalQueueError = (0, _errorReporter.reportError)("FatalQueue");
33
29
  function reportNonInterruptedFailure(context) {
34
30
  const report = reportNonInterruptedFailureCause(context);
35
- return inp => tsplus_module_1.exit(inp).flatMap(result => tsplus_module_2.match(result, {
36
- onFailure: cause => report(cause).map(() => result),
37
- onSuccess: () => tsplus_module_1.sync(() => result)
38
- }));
31
+ return inp => inp.pipe(_effectApp.Effect.exit, _effectApp.Effect.flatMap(result => _effectApp.Exit.match(result, {
32
+ onFailure: cause => _effectApp.Effect.map(report(cause), () => result),
33
+ onSuccess: () => _effectApp.Effect.sync(() => result)
34
+ })));
39
35
  }
40
36
  function reportNonInterruptedFailureCause(context) {
41
37
  return cause => {
42
- if (tsplus_module_3.isInterrupted(cause)) {
43
- return tsplus_module_1.failCause(cause);
38
+ if (_effectApp.Cause.isInterrupted(cause)) {
39
+ return _effectApp.Effect.failCause(cause);
44
40
  }
45
41
  return reportQueueError(cause, context);
46
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"errors.cjs","names":["_errorReporter","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","reportQueueError_","reportError","reportQueueError","cause","extras","exports","forkDaemonReportQueue","self","tsplus_module_1","daemonChildren","fork","tapErrorCause","reportNonInterruptedFailureCause","reportFatalQueueError","reportNonInterruptedFailure","context","report","inp","exit","flatMap","result","tsplus_module_2","match","onFailure","map","onSuccess","sync","tsplus_module_3","isInterrupted","failCause"],"sources":["../../../src/services/QueueMaker/errors.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAA6D,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,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qB,GAAAR,OAAA,CAAAQ,qBAAA,GAAG,IAAAZ,0BAAW,EAC9C,YAAY,CACb;AAEK,SAAUa,2BAA2BA,CAACC,OAAiC;EAC3E,MAAMC,MAAM,GAAGJ,gCAAgC,CAACG,OAAO,CAAC;EACxD,OAAiBE,GAAoB,IACnCT,eAAA,CAAAU,IAAA,CAAAD,GAAG,EAEAE,OAAO,CAAEC,MAAM,IACdC,eAAA,CAAAC,KAAA,CAAAF,MAAM,EAAO;IACXG,SAAS,EAAGpB,KAAK,IAAKa,MAAM,CAACb,KAAK,CAAC,CAACqB,GAAG,CAAC,MAAMJ,MAAM,CAAC;IACrDK,SAAS,EAAEA,CAAA,KAAMjB,eAAA,CAAAkB,IAAA,CAAY,MAAMN,MAAM;GAC1C,CAAC,CACH;AACP;AAEM,SAAUR,gCAAgCA,CAACG,OAAiC;EAChF,OAAWZ,KAAe,IAAkB;IAC1C,IAAIwB,eAAA,CAAAC,aAAA,CAAAzB,KAAK,CAAgB,EAAE;MACzB,OAAAK,eAAA,CAAAqB,SAAA,CAAQ1B,KAAsB;IAChC;IACA,OAAOD,gBAAgB,CAACC,KAAK,EAAEY,OAAO,CAAC;EACzC,CAAC;AACH"}
1
+ {"version":3,"file":"errors.cjs","names":["_errorReporter","require","_effectApp","reportQueueError_","reportError","reportQueueError","cause","extras","exports","forkDaemonReportQueue","self","pipe","Effect","tapErrorCause","reportNonInterruptedFailureCause","fork","daemonChildren","reportFatalQueueError","reportNonInterruptedFailure","context","report","inp","exit","flatMap","result","Exit","match","onFailure","map","onSuccess","sync","Cause","isInterrupted","failCause"],"sources":["../../../src/services/QueueMaker/errors.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,MAAME,iBAAiB,GAAG,IAAAC,0BAAW,EAAC,OAAO,CAAC;AAEvC,MAAMC,gBAAgB,GAAGA,CAAIC,KAAe,EAAEC,MAA4C,KAC/FJ,iBAAiB,CAACG,KAAK,EAAEC,MAAM,CAAC;AAElC;;;;;;;;;AAAAC,OAAA,CAAAH,gBAAA,GAAAA,gBAAA;AASM,SAAUI,qBAAqBA,CAAUC,IAAqB;EAClE,OAAOA,IAAI,CAACC,IAAI,CAACC,iBAAM,CAACC,aAAa,CAACC,gCAAgC,CAAC,EAAE,CAAC,CAAC,EAAEF,iBAAM,CAACG,IAAI,EAAEH,iBAAM,CAACI,cAAc,CAAC;AAClH;AAEO,MAAMC,qBAAqB,GAAAT,OAAA,CAAAS,qBAAA,GAAG,IAAAb,0BAAW,EAC9C,YAAY,CACb;AAEK,SAAUc,2BAA2BA,CAACC,OAAiC;EAC3E,MAAMC,MAAM,GAAGN,gCAAgC,CAACK,OAAO,CAAC;EACxD,OAAiBE,GAAoB,IACnCA,GAAG,CAACV,IAAI,CACNC,iBAAM,CACHU,IAAI,EACPV,iBAAM,CACHW,OAAO,CAAEC,MAAM,IACdC,eAAI,CAACC,KAAK,CAACF,MAAM,EAAE;IACjBG,SAAS,EAAGrB,KAAK,IAAKM,iBAAM,CAACgB,GAAG,CAACR,MAAM,CAACd,KAAK,CAAC,EAAE,MAAMkB,MAAM,CAAC;IAC7DK,SAAS,EAAEA,CAAA,KAAMjB,iBAAM,CAACkB,IAAI,CAAC,MAAMN,MAAM;GAC1C,CAAC,CACH,CACJ;AACL;AAEM,SAAUV,gCAAgCA,CAACK,OAAiC;EAChF,OAAWb,KAAe,IAAkB;IAC1C,IAAIyB,gBAAK,CAACC,aAAa,CAAC1B,KAAK,CAAC,EAAE;MAC9B,OAAOM,iBAAM,CAACqB,SAAS,CAAC3B,KAAqB,CAAC;IAChD;IACA,OAAOD,gBAAgB,CAACC,KAAK,EAAEa,OAAO,CAAC;EACzC,CAAC;AACH"}
@@ -4,84 +4,78 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.makeMemQueue = makeMemQueue;
7
- var tsplus_module_1 = _interopRequireWildcard(require("effect-app/schema"));
8
- var tsplus_module_2 = _interopRequireWildcard(require("@effect/schema/Schema"));
9
- var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/Function"));
10
- var tsplus_module_4 = _interopRequireWildcard(require("effect/Effect"));
11
- var tsplus_module_5 = _interopRequireWildcard(require("@effect-app/infra/services/QueueMaker/errors"));
12
- var tsplus_module_6 = _interopRequireWildcard(require("@effect-app/core/utils"));
13
- var tsplus_module_7 = _interopRequireWildcard(require("@effect-app/infra/api/setupRequest"));
14
- var tsplus_module_8 = _interopRequireWildcard(require("effect/Fiber"));
15
7
  var _memQueue = require("@effect-app/infra-adapters/memQueue");
16
8
  var _RequestContext = require("@effect-app/infra/RequestContext");
9
+ var _schema = require("@effect-app/schema");
17
10
  var _effect = require("effect");
11
+ var _effectApp = require("effect-app");
18
12
  var _ids = require("effect-app/ids");
13
+ var _utils = require("effect-app/utils");
14
+ var _setupRequest = require("../../api/setupRequest.cjs");
19
15
  var _RequestContextContainer = require("../RequestContextContainer.cjs");
20
- var _errors2 = require("./errors.cjs");
16
+ var _errors = require("./errors.cjs");
21
17
  var _service = require("./service.cjs");
22
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
23
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
18
  /**
25
19
  * @tsplus static QueueMaker.Ops makeMem
26
20
  */
27
21
  function makeMemQueue(queueName, queueDrainName, schema, drainSchema) {
28
- return tsplus_module_4.gen(function* ($) {
22
+ return _effectApp.Effect.gen(function* ($) {
29
23
  const mem = yield* $(_memQueue.MemQueue);
30
24
  const q = yield* $(mem.getOrCreateQueue(queueName));
31
25
  const qDrain = yield* $(mem.getOrCreateQueue(queueDrainName));
32
26
  const rcc = yield* $(_RequestContextContainer.RequestContextContainer);
33
- const wireSchema = tsplus_module_1.struct({
27
+ const wireSchema = (0, _schema.struct)({
34
28
  body: schema,
35
29
  meta: _service.QueueMeta
36
30
  });
37
- const drainW = tsplus_module_1.struct({
31
+ const drainW = (0, _schema.struct)({
38
32
  body: drainSchema,
39
33
  meta: _service.QueueMeta
40
34
  });
41
- const parseDrain = tsplus_module_3.flow(tsplus_module_2.decodeUnknown(drainW), _ => _.orDie);
35
+ const parseDrain = (0, _effectApp.flow)(_effectApp.S.decodeUnknown(drainW), _effectApp.Effect.orDie);
42
36
  return {
43
- publish: (...messages) => tsplus_module_4.gen(function* ($) {
37
+ publish: (...messages) => _effectApp.Effect.gen(function* ($) {
44
38
  const requestContext = yield* $(rcc.requestContext);
45
- const currentSpan = yield* $(tsplus_module_4.currentSpan.orDie);
39
+ const currentSpan = yield* $(_effectApp.Effect.currentSpan.pipe(_effectApp.Effect.orDie));
46
40
  const span = _effect.Tracer.externalSpan(currentSpan);
47
- return yield* $(tsplus_module_5.forkDaemonReportQueue(messages.forEachEffect(m =>
41
+ return yield* $(_effectApp.Effect.forEach(messages, m =>
48
42
  // we JSON encode, because that is what the wire also does, and it reveals holes in e.g unknown encoders (Date->String)
49
- tsplus_module_2.encode(wireSchema)({
43
+ _effectApp.S.encode(wireSchema)({
50
44
  body: m,
51
45
  meta: {
52
46
  requestContext,
53
47
  span
54
48
  }
55
- }).orDie.andThen(JSON.stringify)
49
+ }).pipe(_effectApp.Effect.orDie, _effectApp.Effect.andThen(JSON.stringify),
56
50
  // .tap((msg) => info("Publishing Mem Message: " + utils.inspect(msg)))
57
- .flatMap(_ => q.offer(_)).asUnit)));
51
+ _effectApp.Effect.flatMap(_ => q.offer(_)), _effectApp.Effect.asUnit)).pipe(_errors.forkDaemonReportQueue));
58
52
  }),
59
- makeDrain: handleEvent => tsplus_module_4.gen(function* ($) {
60
- const silenceAndReportError = (0, _errors2.reportNonInterruptedFailure)({
53
+ makeDrain: handleEvent => _effectApp.Effect.gen(function* ($) {
54
+ const silenceAndReportError = (0, _errors.reportNonInterruptedFailure)({
61
55
  name: "MemQueue.drain." + queueDrainName
62
56
  });
63
57
  const processMessage = msg =>
64
58
  // we JSON parse, because that is what the wire also does, and it reveals holes in e.g unknown encoders (Date->String)
65
- tsplus_module_4.sync(() => JSON.parse(msg)).flatMap(parseDrain).orDie.flatMap(({
59
+ _effectApp.Effect.sync(() => JSON.parse(msg)).pipe(_effectApp.Effect.flatMap(parseDrain), _effectApp.Effect.orDie, _effectApp.Effect.flatMap(({
66
60
  body,
67
61
  meta
68
- }) => tsplus_module_4.withSpan(tsplus_module_7.setupRequestContext(tsplus_module_4.zipRight(tsplus_module_4.logDebug(`$$ [${queueDrainName}] Processing incoming message`).pipe(tsplus_module_4.annotateLogs({
69
- body: tsplus_module_6.RecordPretty(tsplus_module_6.object$(body)),
70
- meta: tsplus_module_6.RecordPretty(tsplus_module_6.object$(meta))
71
- })), handleEvent(body)).pipe(silenceAndReportError), _RequestContext.RequestContext.inherit(meta.requestContext, {
62
+ }) => _effectApp.Effect.logDebug(`$$ [${queueDrainName}] Processing incoming message`).pipe(_effectApp.Effect.annotateLogs({
63
+ body: (0, _utils.pretty)(body),
64
+ meta: (0, _utils.pretty)(meta)
65
+ }), _effectApp.Effect.zipRight(handleEvent(body)), silenceAndReportError, _ => (0, _setupRequest.setupRequestContext)(_, _RequestContext.RequestContext.inherit(meta.requestContext, {
72
66
  id: (0, _ids.RequestId)(body.id),
73
67
  locale: "en",
74
- name: tsplus_module_1.NonEmptyString255(body._tag)
75
- })), "queue.drain", {
68
+ name: (0, _schema.NonEmptyString255)(body._tag)
69
+ })), _effectApp.Effect.withSpan("queue.drain", {
76
70
  attributes: {
77
71
  "queue.name": queueDrainName
78
72
  },
79
73
  parent: meta.span ? _effect.Tracer.externalSpan(meta.span) : undefined
80
- }));
81
- return yield* $(tsplus_module_4.forkScoped(tsplus_module_4.forever(qDrain.take.flatMap(x => tsplus_module_4.fork(tsplus_module_4.uninterruptible(processMessage(x))).flatMap(_ => tsplus_module_8.join(_)))
74
+ }))));
75
+ return yield* $(qDrain.take.pipe(_effectApp.Effect.flatMap(x => processMessage(x).pipe(_effectApp.Effect.uninterruptible, _effectApp.Effect.fork, _effectApp.Effect.flatMap(_effectApp.Fiber.join))),
82
76
  // TODO: normally a failed item would be returned to the queue and retried up to X times.
83
77
  // .flatMap(_ => _._tag === "Failure" && !isInterrupted ? qDrain.offer(x) : Effect.unit) // TODO: retry count tracking and max retries.
84
- .pipe(silenceAndReportError))));
78
+ silenceAndReportError, _effectApp.Effect.forever, _effectApp.Effect.forkScoped));
85
79
  })
86
80
  };
87
81
  });
@@ -1 +1 @@
1
- {"version":3,"file":"memQueue.cjs","names":["_memQueue","require","_RequestContext","_effect","_ids","_RequestContextContainer","_errors2","_service","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","makeMemQueue","queueName","queueDrainName","schema","drainSchema","tsplus_module_4","gen","$","mem","MemQueue","q","getOrCreateQueue","qDrain","rcc","RequestContextContainer","wireSchema","tsplus_module_1","struct","body","meta","QueueMeta","drainW","parseDrain","tsplus_module_3","flow","tsplus_module_2","decodeUnknown","_","orDie","publish","messages","requestContext","currentSpan","span","Tracer","externalSpan","tsplus_module_5","forkDaemonReportQueue","forEachEffect","m","encode","andThen","JSON","stringify","flatMap","offer","asUnit","makeDrain","handleEvent","silenceAndReportError","reportNonInterruptedFailure","name","processMessage","msg","sync","parse","withSpan","tsplus_module_7","setupRequestContext","zipRight","logDebug","pipe","annotateLogs","tsplus_module_6","RecordPretty","object$","RequestContext","inherit","id","RequestId","locale","NonEmptyString255","_tag","attributes","parent","undefined","forkScoped","forever","take","x","fork","uninterruptible","tsplus_module_8","join"],"sources":["../../../src/services/QueueMaker/memQueue.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,wBAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAAwD,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAlB,CAAA,EAAAe,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA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AA,CAAAD,eAAA,CAAAE,OAAA,CAAE/C,IAAI,EAAU;UAAEC,IAAI,EAAA4C,eAAA,CAAAC,YAAA,CAAAD,eAAA,CAAAE,OAAA,CAAE9C,IAAI;QAAU,CAAE,CAAC,CAAC,EAChE6B,WAAW,CAAC9B,IAAI,CAAC,CAAC,CAC3B2C,IAAI,CAACZ,qBAAqB,CAAC,EACPiB,8BAAc,CAACC,OAAO,CAAChD,IAAI,CAACY,cAAc,EAAE;UAC/DqC,EAAE,EAAE,IAAAC,cAAS,EAACnD,IAAI,CAACkD,EAAE,CAAC;UACtBE,MAAM,EAAE,IAAa;UACrBnB,IAAI,EAAEnC,eAAA,CAAAuD,iBAAiB,CAACrD,IAAI,CAACsD,IAAI;SAClC,CAAC,CAAC,EACO,aAAa,EAAE;UACvBC,UAAU,EAAE;YAAE,YAAY,EAAEvE;UAAc,CAAE;UAC5CwE,MAAM,EAAEvD,IAAI,CAACc,IAAI,GACbC,cAAM,CAACC,YAAY,CAAChB,IAAI,CAACc,IAAI,CAAC,GAC9B0C;SACL,CAAC,CACL;QACL,OAAO,OAAOpE,CAAC,CAAAF,eAAA,CAAAuE,UAAA,CAAAvE,eAAA,CAAAwE,OAAA,CACbjE,MAAM,CACHkE,IAAI,CACJlC,OAAO,CAAEmC,CAAC,IAAK1E,eAAA,CAAA2E,IAAA,CAAA3E,eAAA,CAAA4E,eAAA,CAAA7B,cAAc,CAAC2B,CAAC,CAAC,GAAsBnC,OAAO,CAAEjB,CAAC,IAAIuD,eAAA,CAAAC,IAAA,CAACxD,CAAC,CAAK,CAAC;QAC7E;QACA;QAAA,CACCkC,IAAI,CAACZ,qBAAqB,CAAC,GAG/B;MACH,CAAC;KAC+B;EACtC,CAAC,CAAC;AACJ"}
1
+ {"version":3,"file":"memQueue.cjs","names":["_memQueue","require","_RequestContext","_schema","_effect","_effectApp","_ids","_utils","_setupRequest","_RequestContextContainer","_errors","_service","makeMemQueue","queueName","queueDrainName","schema","drainSchema","Effect","gen","$","mem","MemQueue","q","getOrCreateQueue","qDrain","rcc","RequestContextContainer","wireSchema","struct","body","meta","QueueMeta","drainW","parseDrain","flow","S","decodeUnknown","orDie","publish","messages","requestContext","currentSpan","pipe","span","Tracer","externalSpan","forEach","m","encode","andThen","JSON","stringify","flatMap","_","offer","asUnit","forkDaemonReportQueue","makeDrain","handleEvent","silenceAndReportError","reportNonInterruptedFailure","name","processMessage","msg","sync","parse","logDebug","annotateLogs","pretty","zipRight","setupRequestContext","RequestContext","inherit","id","RequestId","locale","NonEmptyString255","_tag","withSpan","attributes","parent","undefined","take","x","uninterruptible","fork","Fiber","join","forever","forkScoped"],"sources":["../../../src/services/QueueMaker/memQueue.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,wBAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAEA;;;AAGM,SAAUW,YAAYA,CAM1BC,SAAiB,EACjBC,cAAsB,EACtBC,MAA2B,EAC3BC,WAA0C;EAE1C,OAAOC,iBAAM,CAACC,GAAG,CAAC,WAAUC,CAAC;IAC3B,MAAMC,GAAG,GAAG,OAAOD,CAAC,CAACE,kBAAQ,CAAC;IAC9B,MAAMC,CAAC,GAAG,OAAOH,CAAC,CAACC,GAAG,CAACG,gBAAgB,CAACV,SAAS,CAAC,CAAC;IACnD,MAAMW,MAAM,GAAG,OAAOL,CAAC,CAACC,GAAG,CAACG,gBAAgB,CAACT,cAAc,CAAC,CAAC;IAC7D,MAAMW,GAAG,GAAG,OAAON,CAAC,CAACO,gD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