@hotmeshio/hotmesh 0.0.8 → 0.0.9

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 (355) hide show
  1. package/LICENSE +4 -7
  2. package/README.md +37 -46
  3. package/build/{esm/package.json → package.json} +4 -11
  4. package/build/{cjs/services → services}/durable/native.js +2 -2
  5. package/build/{esm/services → services}/durable/worker.d.ts +1 -3
  6. package/build/{cjs/services → services}/durable/worker.js +9 -32
  7. package/build/{cjs/services → services}/durable/workflow.js +6 -1
  8. package/build/{cjs/types → types}/durable.d.ts +4 -6
  9. package/package.json +4 -11
  10. package/services/durable/native.ts +2 -2
  11. package/services/durable/worker.ts +9 -9
  12. package/services/durable/workflow.ts +7 -1
  13. package/types/durable.ts +4 -4
  14. package/build/cjs/package.json +0 -82
  15. package/build/cjs/services/durable/worker.d.ts +0 -38
  16. package/build/esm/index.d.ts +0 -4
  17. package/build/esm/index.js +0 -3
  18. package/build/esm/modules/errors.d.ts +0 -28
  19. package/build/esm/modules/errors.js +0 -41
  20. package/build/esm/modules/key.d.ts +0 -75
  21. package/build/esm/modules/key.js +0 -111
  22. package/build/esm/modules/utils.d.ts +0 -34
  23. package/build/esm/modules/utils.js +0 -154
  24. package/build/esm/services/activities/activity.d.ts +0 -67
  25. package/build/esm/services/activities/activity.js +0 -486
  26. package/build/esm/services/activities/await.d.ts +0 -16
  27. package/build/esm/services/activities/await.js +0 -140
  28. package/build/esm/services/activities/cycle.d.ts +0 -19
  29. package/build/esm/services/activities/cycle.js +0 -74
  30. package/build/esm/services/activities/emit.d.ts +0 -9
  31. package/build/esm/services/activities/emit.js +0 -10
  32. package/build/esm/services/activities/index.d.ts +0 -17
  33. package/build/esm/services/activities/index.js +0 -16
  34. package/build/esm/services/activities/iterate.d.ts +0 -9
  35. package/build/esm/services/activities/iterate.js +0 -10
  36. package/build/esm/services/activities/trigger.d.ts +0 -22
  37. package/build/esm/services/activities/trigger.js +0 -158
  38. package/build/esm/services/activities/worker.d.ts +0 -11
  39. package/build/esm/services/activities/worker.js +0 -70
  40. package/build/esm/services/collator/index.d.ts +0 -73
  41. package/build/esm/services/collator/index.js +0 -221
  42. package/build/esm/services/compiler/deployer.d.ts +0 -36
  43. package/build/esm/services/compiler/deployer.js +0 -423
  44. package/build/esm/services/compiler/index.d.ts +0 -30
  45. package/build/esm/services/compiler/index.js +0 -82
  46. package/build/esm/services/compiler/validator.d.ts +0 -32
  47. package/build/esm/services/compiler/validator.js +0 -131
  48. package/build/esm/services/connector/clients/ioredis.d.ts +0 -13
  49. package/build/esm/services/connector/clients/ioredis.js +0 -47
  50. package/build/esm/services/connector/clients/redis.d.ts +0 -13
  51. package/build/esm/services/connector/clients/redis.js +0 -59
  52. package/build/esm/services/connector/index.d.ts +0 -5
  53. package/build/esm/services/connector/index.js +0 -27
  54. package/build/esm/services/dimension/index.d.ts +0 -29
  55. package/build/esm/services/dimension/index.js +0 -32
  56. package/build/esm/services/durable/asyncLocalStorage.d.ts +0 -3
  57. package/build/esm/services/durable/asyncLocalStorage.js +0 -2
  58. package/build/esm/services/durable/client.d.ts +0 -15
  59. package/build/esm/services/durable/client.js +0 -114
  60. package/build/esm/services/durable/connection.d.ts +0 -4
  61. package/build/esm/services/durable/connection.js +0 -47
  62. package/build/esm/services/durable/factory.d.ts +0 -3
  63. package/build/esm/services/durable/factory.js +0 -135
  64. package/build/esm/services/durable/handle.d.ts +0 -8
  65. package/build/esm/services/durable/handle.js +0 -34
  66. package/build/esm/services/durable/index.d.ts +0 -57
  67. package/build/esm/services/durable/index.js +0 -55
  68. package/build/esm/services/durable/native.d.ts +0 -4
  69. package/build/esm/services/durable/native.js +0 -43
  70. package/build/esm/services/durable/worker.js +0 -267
  71. package/build/esm/services/durable/workflow.d.ts +0 -6
  72. package/build/esm/services/durable/workflow.js +0 -132
  73. package/build/esm/services/engine/index.d.ts +0 -82
  74. package/build/esm/services/engine/index.js +0 -522
  75. package/build/esm/services/hotmesh/index.d.ts +0 -45
  76. package/build/esm/services/hotmesh/index.js +0 -131
  77. package/build/esm/services/logger/index.d.ts +0 -17
  78. package/build/esm/services/logger/index.js +0 -70
  79. package/build/esm/services/mapper/index.d.ts +0 -24
  80. package/build/esm/services/mapper/index.js +0 -72
  81. package/build/esm/services/pipe/functions/array.d.ts +0 -24
  82. package/build/esm/services/pipe/functions/array.js +0 -66
  83. package/build/esm/services/pipe/functions/bitwise.d.ts +0 -9
  84. package/build/esm/services/pipe/functions/bitwise.js +0 -21
  85. package/build/esm/services/pipe/functions/conditional.d.ts +0 -10
  86. package/build/esm/services/pipe/functions/conditional.js +0 -24
  87. package/build/esm/services/pipe/functions/date.d.ts +0 -57
  88. package/build/esm/services/pipe/functions/date.js +0 -164
  89. package/build/esm/services/pipe/functions/index.d.ts +0 -25
  90. package/build/esm/services/pipe/functions/index.js +0 -24
  91. package/build/esm/services/pipe/functions/json.d.ts +0 -5
  92. package/build/esm/services/pipe/functions/json.js +0 -9
  93. package/build/esm/services/pipe/functions/math.d.ts +0 -38
  94. package/build/esm/services/pipe/functions/math.js +0 -108
  95. package/build/esm/services/pipe/functions/number.d.ts +0 -25
  96. package/build/esm/services/pipe/functions/number.js +0 -130
  97. package/build/esm/services/pipe/functions/object.d.ts +0 -22
  98. package/build/esm/services/pipe/functions/object.js +0 -60
  99. package/build/esm/services/pipe/functions/string.d.ts +0 -23
  100. package/build/esm/services/pipe/functions/string.js +0 -66
  101. package/build/esm/services/pipe/functions/symbol.d.ts +0 -12
  102. package/build/esm/services/pipe/functions/symbol.js +0 -30
  103. package/build/esm/services/pipe/functions/unary.d.ts +0 -7
  104. package/build/esm/services/pipe/functions/unary.js +0 -15
  105. package/build/esm/services/pipe/index.d.ts +0 -30
  106. package/build/esm/services/pipe/index.js +0 -122
  107. package/build/esm/services/quorum/index.d.ts +0 -34
  108. package/build/esm/services/quorum/index.js +0 -144
  109. package/build/esm/services/reporter/index.d.ts +0 -47
  110. package/build/esm/services/reporter/index.js +0 -327
  111. package/build/esm/services/serializer/index.d.ts +0 -41
  112. package/build/esm/services/serializer/index.js +0 -251
  113. package/build/esm/services/signaler/store.d.ts +0 -15
  114. package/build/esm/services/signaler/store.js +0 -50
  115. package/build/esm/services/signaler/stream.d.ts +0 -43
  116. package/build/esm/services/signaler/stream.js +0 -314
  117. package/build/esm/services/store/cache.d.ts +0 -66
  118. package/build/esm/services/store/cache.js +0 -124
  119. package/build/esm/services/store/clients/ioredis.d.ts +0 -27
  120. package/build/esm/services/store/clients/ioredis.js +0 -93
  121. package/build/esm/services/store/clients/redis.d.ts +0 -29
  122. package/build/esm/services/store/clients/redis.js +0 -140
  123. package/build/esm/services/store/index.d.ts +0 -88
  124. package/build/esm/services/store/index.js +0 -623
  125. package/build/esm/services/stream/clients/ioredis.d.ts +0 -23
  126. package/build/esm/services/stream/clients/ioredis.js +0 -112
  127. package/build/esm/services/stream/clients/redis.d.ts +0 -23
  128. package/build/esm/services/stream/clients/redis.js +0 -116
  129. package/build/esm/services/stream/index.d.ts +0 -21
  130. package/build/esm/services/stream/index.js +0 -6
  131. package/build/esm/services/sub/clients/ioredis.d.ts +0 -20
  132. package/build/esm/services/sub/clients/ioredis.js +0 -69
  133. package/build/esm/services/sub/clients/redis.d.ts +0 -20
  134. package/build/esm/services/sub/clients/redis.js +0 -60
  135. package/build/esm/services/sub/index.d.ts +0 -18
  136. package/build/esm/services/sub/index.js +0 -6
  137. package/build/esm/services/task/index.d.ts +0 -18
  138. package/build/esm/services/task/index.js +0 -70
  139. package/build/esm/services/telemetry/index.d.ts +0 -49
  140. package/build/esm/services/telemetry/index.js +0 -217
  141. package/build/esm/services/worker/index.d.ts +0 -30
  142. package/build/esm/services/worker/index.js +0 -102
  143. package/build/esm/types/activity.d.ts +0 -92
  144. package/build/esm/types/activity.js +0 -1
  145. package/build/esm/types/app.d.ts +0 -16
  146. package/build/esm/types/app.js +0 -1
  147. package/build/esm/types/async.d.ts +0 -5
  148. package/build/esm/types/async.js +0 -1
  149. package/build/esm/types/cache.d.ts +0 -1
  150. package/build/esm/types/cache.js +0 -1
  151. package/build/esm/types/collator.d.ts +0 -8
  152. package/build/esm/types/collator.js +0 -8
  153. package/build/esm/types/durable.d.ts +0 -59
  154. package/build/esm/types/durable.js +0 -1
  155. package/build/esm/types/hook.d.ts +0 -31
  156. package/build/esm/types/hook.js +0 -6
  157. package/build/esm/types/hotmesh.d.ts +0 -82
  158. package/build/esm/types/hotmesh.js +0 -1
  159. package/build/esm/types/index.d.ts +0 -20
  160. package/build/esm/types/index.js +0 -5
  161. package/build/esm/types/ioredisclient.d.ts +0 -5
  162. package/build/esm/types/ioredisclient.js +0 -2
  163. package/build/esm/types/job.d.ts +0 -50
  164. package/build/esm/types/job.js +0 -1
  165. package/build/esm/types/logger.d.ts +0 -6
  166. package/build/esm/types/logger.js +0 -1
  167. package/build/esm/types/map.d.ts +0 -4
  168. package/build/esm/types/map.js +0 -1
  169. package/build/esm/types/pipe.d.ts +0 -4
  170. package/build/esm/types/pipe.js +0 -1
  171. package/build/esm/types/quorum.d.ts +0 -46
  172. package/build/esm/types/quorum.js +0 -1
  173. package/build/esm/types/redis.d.ts +0 -8
  174. package/build/esm/types/redis.js +0 -1
  175. package/build/esm/types/redisclient.d.ts +0 -25
  176. package/build/esm/types/redisclient.js +0 -1
  177. package/build/esm/types/serializer.d.ts +0 -33
  178. package/build/esm/types/serializer.js +0 -1
  179. package/build/esm/types/stats.d.ts +0 -83
  180. package/build/esm/types/stats.js +0 -1
  181. package/build/esm/types/stream.d.ts +0 -67
  182. package/build/esm/types/stream.js +0 -22
  183. package/build/esm/types/telemetry.d.ts +0 -1
  184. package/build/esm/types/telemetry.js +0 -1
  185. package/build/esm/types/transition.d.ts +0 -17
  186. package/build/esm/types/transition.js +0 -1
  187. package/tsconfig.cjs.json +0 -8
  188. package/tsconfig.esm.json +0 -9
  189. /package/build/{cjs/index.d.ts → index.d.ts} +0 -0
  190. /package/build/{cjs/index.js → index.js} +0 -0
  191. /package/build/{cjs/modules → modules}/errors.d.ts +0 -0
  192. /package/build/{cjs/modules → modules}/errors.js +0 -0
  193. /package/build/{cjs/modules → modules}/key.d.ts +0 -0
  194. /package/build/{cjs/modules → modules}/key.js +0 -0
  195. /package/build/{cjs/modules → modules}/utils.d.ts +0 -0
  196. /package/build/{cjs/modules → modules}/utils.js +0 -0
  197. /package/build/{cjs/services → services}/activities/activity.d.ts +0 -0
  198. /package/build/{cjs/services → services}/activities/activity.js +0 -0
  199. /package/build/{cjs/services → services}/activities/await.d.ts +0 -0
  200. /package/build/{cjs/services → services}/activities/await.js +0 -0
  201. /package/build/{cjs/services → services}/activities/cycle.d.ts +0 -0
  202. /package/build/{cjs/services → services}/activities/cycle.js +0 -0
  203. /package/build/{cjs/services → services}/activities/emit.d.ts +0 -0
  204. /package/build/{cjs/services → services}/activities/emit.js +0 -0
  205. /package/build/{cjs/services → services}/activities/index.d.ts +0 -0
  206. /package/build/{cjs/services → services}/activities/index.js +0 -0
  207. /package/build/{cjs/services → services}/activities/iterate.d.ts +0 -0
  208. /package/build/{cjs/services → services}/activities/iterate.js +0 -0
  209. /package/build/{cjs/services → services}/activities/trigger.d.ts +0 -0
  210. /package/build/{cjs/services → services}/activities/trigger.js +0 -0
  211. /package/build/{cjs/services → services}/activities/worker.d.ts +0 -0
  212. /package/build/{cjs/services → services}/activities/worker.js +0 -0
  213. /package/build/{cjs/services → services}/collator/index.d.ts +0 -0
  214. /package/build/{cjs/services → services}/collator/index.js +0 -0
  215. /package/build/{cjs/services → services}/compiler/deployer.d.ts +0 -0
  216. /package/build/{cjs/services → services}/compiler/deployer.js +0 -0
  217. /package/build/{cjs/services → services}/compiler/index.d.ts +0 -0
  218. /package/build/{cjs/services → services}/compiler/index.js +0 -0
  219. /package/build/{cjs/services → services}/compiler/validator.d.ts +0 -0
  220. /package/build/{cjs/services → services}/compiler/validator.js +0 -0
  221. /package/build/{cjs/services → services}/connector/clients/ioredis.d.ts +0 -0
  222. /package/build/{cjs/services → services}/connector/clients/ioredis.js +0 -0
  223. /package/build/{cjs/services → services}/connector/clients/redis.d.ts +0 -0
  224. /package/build/{cjs/services → services}/connector/clients/redis.js +0 -0
  225. /package/build/{cjs/services → services}/connector/index.d.ts +0 -0
  226. /package/build/{cjs/services → services}/connector/index.js +0 -0
  227. /package/build/{cjs/services → services}/dimension/index.d.ts +0 -0
  228. /package/build/{cjs/services → services}/dimension/index.js +0 -0
  229. /package/build/{cjs/services → services}/durable/asyncLocalStorage.d.ts +0 -0
  230. /package/build/{cjs/services → services}/durable/asyncLocalStorage.js +0 -0
  231. /package/build/{cjs/services → services}/durable/client.d.ts +0 -0
  232. /package/build/{cjs/services → services}/durable/client.js +0 -0
  233. /package/build/{cjs/services → services}/durable/connection.d.ts +0 -0
  234. /package/build/{cjs/services → services}/durable/connection.js +0 -0
  235. /package/build/{cjs/services → services}/durable/factory.d.ts +0 -0
  236. /package/build/{cjs/services → services}/durable/factory.js +0 -0
  237. /package/build/{cjs/services → services}/durable/handle.d.ts +0 -0
  238. /package/build/{cjs/services → services}/durable/handle.js +0 -0
  239. /package/build/{cjs/services → services}/durable/index.d.ts +0 -0
  240. /package/build/{cjs/services → services}/durable/index.js +0 -0
  241. /package/build/{cjs/services → services}/durable/native.d.ts +0 -0
  242. /package/build/{cjs/services → services}/durable/workflow.d.ts +0 -0
  243. /package/build/{cjs/services → services}/engine/index.d.ts +0 -0
  244. /package/build/{cjs/services → services}/engine/index.js +0 -0
  245. /package/build/{cjs/services → services}/hotmesh/index.d.ts +0 -0
  246. /package/build/{cjs/services → services}/hotmesh/index.js +0 -0
  247. /package/build/{cjs/services → services}/logger/index.d.ts +0 -0
  248. /package/build/{cjs/services → services}/logger/index.js +0 -0
  249. /package/build/{cjs/services → services}/mapper/index.d.ts +0 -0
  250. /package/build/{cjs/services → services}/mapper/index.js +0 -0
  251. /package/build/{cjs/services → services}/pipe/functions/array.d.ts +0 -0
  252. /package/build/{cjs/services → services}/pipe/functions/array.js +0 -0
  253. /package/build/{cjs/services → services}/pipe/functions/bitwise.d.ts +0 -0
  254. /package/build/{cjs/services → services}/pipe/functions/bitwise.js +0 -0
  255. /package/build/{cjs/services → services}/pipe/functions/conditional.d.ts +0 -0
  256. /package/build/{cjs/services → services}/pipe/functions/conditional.js +0 -0
  257. /package/build/{cjs/services → services}/pipe/functions/date.d.ts +0 -0
  258. /package/build/{cjs/services → services}/pipe/functions/date.js +0 -0
  259. /package/build/{cjs/services → services}/pipe/functions/index.d.ts +0 -0
  260. /package/build/{cjs/services → services}/pipe/functions/index.js +0 -0
  261. /package/build/{cjs/services → services}/pipe/functions/json.d.ts +0 -0
  262. /package/build/{cjs/services → services}/pipe/functions/json.js +0 -0
  263. /package/build/{cjs/services → services}/pipe/functions/math.d.ts +0 -0
  264. /package/build/{cjs/services → services}/pipe/functions/math.js +0 -0
  265. /package/build/{cjs/services → services}/pipe/functions/number.d.ts +0 -0
  266. /package/build/{cjs/services → services}/pipe/functions/number.js +0 -0
  267. /package/build/{cjs/services → services}/pipe/functions/object.d.ts +0 -0
  268. /package/build/{cjs/services → services}/pipe/functions/object.js +0 -0
  269. /package/build/{cjs/services → services}/pipe/functions/string.d.ts +0 -0
  270. /package/build/{cjs/services → services}/pipe/functions/string.js +0 -0
  271. /package/build/{cjs/services → services}/pipe/functions/symbol.d.ts +0 -0
  272. /package/build/{cjs/services → services}/pipe/functions/symbol.js +0 -0
  273. /package/build/{cjs/services → services}/pipe/functions/unary.d.ts +0 -0
  274. /package/build/{cjs/services → services}/pipe/functions/unary.js +0 -0
  275. /package/build/{cjs/services → services}/pipe/index.d.ts +0 -0
  276. /package/build/{cjs/services → services}/pipe/index.js +0 -0
  277. /package/build/{cjs/services → services}/quorum/index.d.ts +0 -0
  278. /package/build/{cjs/services → services}/quorum/index.js +0 -0
  279. /package/build/{cjs/services → services}/reporter/index.d.ts +0 -0
  280. /package/build/{cjs/services → services}/reporter/index.js +0 -0
  281. /package/build/{cjs/services → services}/serializer/index.d.ts +0 -0
  282. /package/build/{cjs/services → services}/serializer/index.js +0 -0
  283. /package/build/{cjs/services → services}/signaler/store.d.ts +0 -0
  284. /package/build/{cjs/services → services}/signaler/store.js +0 -0
  285. /package/build/{cjs/services → services}/signaler/stream.d.ts +0 -0
  286. /package/build/{cjs/services → services}/signaler/stream.js +0 -0
  287. /package/build/{cjs/services → services}/store/cache.d.ts +0 -0
  288. /package/build/{cjs/services → services}/store/cache.js +0 -0
  289. /package/build/{cjs/services → services}/store/clients/ioredis.d.ts +0 -0
  290. /package/build/{cjs/services → services}/store/clients/ioredis.js +0 -0
  291. /package/build/{cjs/services → services}/store/clients/redis.d.ts +0 -0
  292. /package/build/{cjs/services → services}/store/clients/redis.js +0 -0
  293. /package/build/{cjs/services → services}/store/index.d.ts +0 -0
  294. /package/build/{cjs/services → services}/store/index.js +0 -0
  295. /package/build/{cjs/services → services}/stream/clients/ioredis.d.ts +0 -0
  296. /package/build/{cjs/services → services}/stream/clients/ioredis.js +0 -0
  297. /package/build/{cjs/services → services}/stream/clients/redis.d.ts +0 -0
  298. /package/build/{cjs/services → services}/stream/clients/redis.js +0 -0
  299. /package/build/{cjs/services → services}/stream/index.d.ts +0 -0
  300. /package/build/{cjs/services → services}/stream/index.js +0 -0
  301. /package/build/{cjs/services → services}/sub/clients/ioredis.d.ts +0 -0
  302. /package/build/{cjs/services → services}/sub/clients/ioredis.js +0 -0
  303. /package/build/{cjs/services → services}/sub/clients/redis.d.ts +0 -0
  304. /package/build/{cjs/services → services}/sub/clients/redis.js +0 -0
  305. /package/build/{cjs/services → services}/sub/index.d.ts +0 -0
  306. /package/build/{cjs/services → services}/sub/index.js +0 -0
  307. /package/build/{cjs/services → services}/task/index.d.ts +0 -0
  308. /package/build/{cjs/services → services}/task/index.js +0 -0
  309. /package/build/{cjs/services → services}/telemetry/index.d.ts +0 -0
  310. /package/build/{cjs/services → services}/telemetry/index.js +0 -0
  311. /package/build/{cjs/services → services}/worker/index.d.ts +0 -0
  312. /package/build/{cjs/services → services}/worker/index.js +0 -0
  313. /package/build/{cjs/types → types}/activity.d.ts +0 -0
  314. /package/build/{cjs/types → types}/activity.js +0 -0
  315. /package/build/{cjs/types → types}/app.d.ts +0 -0
  316. /package/build/{cjs/types → types}/app.js +0 -0
  317. /package/build/{cjs/types → types}/async.d.ts +0 -0
  318. /package/build/{cjs/types → types}/async.js +0 -0
  319. /package/build/{cjs/types → types}/cache.d.ts +0 -0
  320. /package/build/{cjs/types → types}/cache.js +0 -0
  321. /package/build/{cjs/types → types}/collator.d.ts +0 -0
  322. /package/build/{cjs/types → types}/collator.js +0 -0
  323. /package/build/{cjs/types → types}/durable.js +0 -0
  324. /package/build/{cjs/types → types}/hook.d.ts +0 -0
  325. /package/build/{cjs/types → types}/hook.js +0 -0
  326. /package/build/{cjs/types → types}/hotmesh.d.ts +0 -0
  327. /package/build/{cjs/types → types}/hotmesh.js +0 -0
  328. /package/build/{cjs/types → types}/index.d.ts +0 -0
  329. /package/build/{cjs/types → types}/index.js +0 -0
  330. /package/build/{cjs/types → types}/ioredisclient.d.ts +0 -0
  331. /package/build/{cjs/types → types}/ioredisclient.js +0 -0
  332. /package/build/{cjs/types → types}/job.d.ts +0 -0
  333. /package/build/{cjs/types → types}/job.js +0 -0
  334. /package/build/{cjs/types → types}/logger.d.ts +0 -0
  335. /package/build/{cjs/types → types}/logger.js +0 -0
  336. /package/build/{cjs/types → types}/map.d.ts +0 -0
  337. /package/build/{cjs/types → types}/map.js +0 -0
  338. /package/build/{cjs/types → types}/pipe.d.ts +0 -0
  339. /package/build/{cjs/types → types}/pipe.js +0 -0
  340. /package/build/{cjs/types → types}/quorum.d.ts +0 -0
  341. /package/build/{cjs/types → types}/quorum.js +0 -0
  342. /package/build/{cjs/types → types}/redis.d.ts +0 -0
  343. /package/build/{cjs/types → types}/redis.js +0 -0
  344. /package/build/{cjs/types → types}/redisclient.d.ts +0 -0
  345. /package/build/{cjs/types → types}/redisclient.js +0 -0
  346. /package/build/{cjs/types → types}/serializer.d.ts +0 -0
  347. /package/build/{cjs/types → types}/serializer.js +0 -0
  348. /package/build/{cjs/types → types}/stats.d.ts +0 -0
  349. /package/build/{cjs/types → types}/stats.js +0 -0
  350. /package/build/{cjs/types → types}/stream.d.ts +0 -0
  351. /package/build/{cjs/types → types}/stream.js +0 -0
  352. /package/build/{cjs/types → types}/telemetry.d.ts +0 -0
  353. /package/build/{cjs/types → types}/telemetry.js +0 -0
  354. /package/build/{cjs/types → types}/transition.d.ts +0 -0
  355. /package/build/{cjs/types → types}/transition.js +0 -0
@@ -1,47 +0,0 @@
1
- /*
2
- Here is an example of how the methods in this file are used:
3
-
4
- ./client.ts
5
-
6
- import { Durable } from '@hotmeshio/hotmesh';
7
- import Redis from 'ioredis';
8
- import { v4 as uuidv4 } from 'uuid';
9
-
10
- async function run() {
11
- const connection = await Durable.Connection.connect({
12
- class: Redis,
13
- options: {
14
- host: 'localhost',
15
- port: 6379,
16
- },
17
- });
18
-
19
- const client = new Durable.Client({
20
- connection,
21
- });
22
-
23
- const handle = await client.workflow.start(example, {
24
- taskQueue: 'hello-world',
25
- args: ['HotMesh'],
26
- workflowName: 'example',
27
- workflowId: uuidv4(),
28
- });
29
-
30
- console.log(`Started workflow ${handle.workflowId}`);
31
- console.log(await handle.result());
32
- }
33
-
34
- run().catch((err) => {
35
- console.error(err);
36
- process.exit(1);
37
- });
38
-
39
- */
40
- export class ConnectionService {
41
- static async connect(config) {
42
- return {
43
- class: config.class,
44
- options: { ...config.options },
45
- };
46
- }
47
- }
@@ -1,3 +0,0 @@
1
- declare const getWorkflowYAML: (topic: string, version?: string) => string;
2
- declare const getActivityYAML: (topic: string, version?: string) => string;
3
- export { getActivityYAML, getWorkflowYAML };
@@ -1,135 +0,0 @@
1
- const getWorkflowYAML = (topic, version = '1') => {
2
- return `app:
3
- id: ${topic}
4
- version: '${version}'
5
- graphs:
6
- - subscribes: ${topic}
7
- publishes: ${topic}
8
- expire: 120
9
- input:
10
- schema:
11
- type: object
12
- properties:
13
- workflowId:
14
- type: string
15
- arguments:
16
- type: array
17
- output:
18
- schema:
19
- type: object
20
- properties:
21
- response:
22
- type: any
23
-
24
- activities:
25
- t1:
26
- type: trigger
27
- stats:
28
- id: '{$self.input.data.workflowId}'
29
-
30
- a1:
31
- type: activity
32
- cycle: true
33
-
34
- w1:
35
- type: worker
36
- topic: ${topic}
37
- input:
38
- schema:
39
- type: object
40
- properties:
41
- workflowId:
42
- type: string
43
- arguments:
44
- type: array
45
- maps:
46
- workflowId: '{t1.output.data.workflowId}'
47
- arguments: '{t1.output.data.arguments}'
48
- output:
49
- schema:
50
- type: object
51
- properties:
52
- response:
53
- type: any
54
- job:
55
- maps:
56
- response: '{$self.output.data.response}'
57
-
58
- c1:
59
- type: cycle
60
- ancestor: a1
61
- transitions:
62
- t1:
63
- - to: a1
64
- a1:
65
- - to: w1
66
- w1:
67
- - to: c1
68
- conditions:
69
- code: 500
70
- `;
71
- };
72
- const getActivityYAML = (topic, version = '1') => {
73
- return `app:
74
- id: ${topic}
75
- version: '${version}'
76
- graphs:
77
- - subscribes: ${topic}
78
- input:
79
- schema:
80
- type: object
81
- properties:
82
- workflowId:
83
- type: string
84
- workflowTopic:
85
- type: string
86
- activityName:
87
- type: array
88
- arguments:
89
- type: array
90
- output:
91
- schema:
92
- type: object
93
- properties:
94
- response:
95
- type: any
96
-
97
- activities:
98
- t1:
99
- type: trigger
100
- stats:
101
- id: '{$self.input.data.workflowId}'
102
- a1:
103
- type: worker
104
- topic: ${topic}
105
- input:
106
- schema:
107
- type: object
108
- properties:
109
- workflowId:
110
- type: string
111
- workflowTopic:
112
- type: string
113
- activityName:
114
- type: array
115
- arguments:
116
- type: array
117
- maps:
118
- workflowId: '{t1.output.data.workflowId}'
119
- workflowTopic: '{t1.output.data.workflowTopic}'
120
- activityName: '{t1.output.data.activityName}'
121
- arguments: '{t1.output.data.arguments}'
122
- output:
123
- schema:
124
- type: object
125
- properties:
126
- response:
127
- type: any
128
- job:
129
- maps:
130
- response: '{$self.output.data.response}'
131
- transitions:
132
- t1:
133
- - to: a1`;
134
- };
135
- export { getActivityYAML, getWorkflowYAML };
@@ -1,8 +0,0 @@
1
- import { HotMeshService as HotMesh } from '../hotmesh';
2
- export declare class WorkflowHandleService {
3
- hotMesh: HotMesh;
4
- workflowTopic: string;
5
- workflowId: string;
6
- constructor(hotMesh: HotMesh, workflowTopic: string, workflowId: string);
7
- result(): Promise<any>;
8
- }
@@ -1,34 +0,0 @@
1
- export class WorkflowHandleService {
2
- constructor(hotMesh, workflowTopic, workflowId) {
3
- this.workflowTopic = workflowTopic;
4
- this.workflowId = workflowId;
5
- this.hotMesh = hotMesh;
6
- }
7
- async result() {
8
- let status = await this.hotMesh.getStatus(this.workflowId);
9
- const topic = `${this.workflowTopic}.${this.workflowId}`;
10
- if (status == 0) {
11
- return (await this.hotMesh.getState(this.workflowTopic, this.workflowId)).data?.response;
12
- }
13
- return new Promise((resolve, reject) => {
14
- let isResolved = false;
15
- //common fulfill/unsubscribe
16
- const complete = async (response) => {
17
- if (isResolved)
18
- return;
19
- isResolved = true;
20
- this.hotMesh.unsub(topic);
21
- resolve(response || (await this.hotMesh.getState(this.workflowTopic, this.workflowId)).data?.response);
22
- };
23
- this.hotMesh.sub(topic, async (topic, message) => {
24
- await complete(message.data?.response);
25
- });
26
- setTimeout(async () => {
27
- status = await this.hotMesh.getStatus(this.workflowId);
28
- if (status == 0) {
29
- await complete();
30
- }
31
- }, 0);
32
- });
33
- }
34
- }
@@ -1,57 +0,0 @@
1
- import { ClientService } from './client';
2
- import { ConnectionService } from './connection';
3
- import { NativeConnectionService } from './native';
4
- import { WorkerService } from './worker';
5
- import { WorkflowService } from './workflow';
6
- import { ContextType } from '../../types/durable';
7
- /**
8
- * As a durable integration platform, HotMesh
9
- * can model and emulate other durable systems
10
- * (like Temporal). As you review the code in
11
- * this file, note the following:
12
- *
13
- * 1) There is no central governing server.
14
- * HotMesh is a client-side SDK that connects to Redis
15
- * using CQRS principles to implicitly drive
16
- * orchestrations using a headless quorum. Stream
17
- * semantics guarantee that all events are
18
- * processed by the quorum of connected clients.
19
- *
20
- * 2) Every developer-defined `workflow` function
21
- * is assigned a HotMesh workflow (which runs in
22
- * the background) to support it.
23
- *
24
- * If the HotMesh workflow is not yet defined,
25
- * it will be deployed and activated on-the-fly.
26
- * (The generated DAG will have one Trigger Activity
27
- * and one Worker Activity.) The Worker Activity
28
- * is configured to catch execution errors and
29
- * return them, using a 'pending' status to
30
- * indicate that the workflow is still running.
31
- * It is possible for workflow activities to throw
32
- * errors that will force the entire workflow to
33
- * fail. This is not the case here. The workflow will
34
- * continue to run until it is completed or cancelled.
35
- *
36
- * 2) Every developer-defined `activity` function
37
- * is assigned a HotMesh workflow (which runs in
38
- * the background) to support it.
39
- *
40
- * (The generated DAG will have one Trigger Activity and one
41
- * Worker Activity.) The JOB ID for Worker Activity executions
42
- * is derived from the containing JOB ID,
43
- * allowing Activity state to be 'replayed' when the workflow
44
- * is run again. The Activity Function Runner (activity proxy)
45
- * is configured similar to how the workflow worker is and will
46
- * catch execution errors and return them to the caller, using a
47
- * 'pending' status to indicate that the activity is still running.
48
- * This allows the activity to be retried until it succeeds.
49
- */
50
- export declare const Durable: {
51
- Client: typeof ClientService;
52
- Connection: typeof ConnectionService;
53
- NativeConnection: typeof NativeConnectionService;
54
- Worker: typeof WorkerService;
55
- workflow: typeof WorkflowService;
56
- };
57
- export type { ContextType };
@@ -1,55 +0,0 @@
1
- import { ClientService } from './client';
2
- import { ConnectionService } from './connection';
3
- import { NativeConnectionService } from './native';
4
- import { WorkerService } from './worker';
5
- import { WorkflowService } from './workflow';
6
- /**
7
- * As a durable integration platform, HotMesh
8
- * can model and emulate other durable systems
9
- * (like Temporal). As you review the code in
10
- * this file, note the following:
11
- *
12
- * 1) There is no central governing server.
13
- * HotMesh is a client-side SDK that connects to Redis
14
- * using CQRS principles to implicitly drive
15
- * orchestrations using a headless quorum. Stream
16
- * semantics guarantee that all events are
17
- * processed by the quorum of connected clients.
18
- *
19
- * 2) Every developer-defined `workflow` function
20
- * is assigned a HotMesh workflow (which runs in
21
- * the background) to support it.
22
- *
23
- * If the HotMesh workflow is not yet defined,
24
- * it will be deployed and activated on-the-fly.
25
- * (The generated DAG will have one Trigger Activity
26
- * and one Worker Activity.) The Worker Activity
27
- * is configured to catch execution errors and
28
- * return them, using a 'pending' status to
29
- * indicate that the workflow is still running.
30
- * It is possible for workflow activities to throw
31
- * errors that will force the entire workflow to
32
- * fail. This is not the case here. The workflow will
33
- * continue to run until it is completed or cancelled.
34
- *
35
- * 2) Every developer-defined `activity` function
36
- * is assigned a HotMesh workflow (which runs in
37
- * the background) to support it.
38
- *
39
- * (The generated DAG will have one Trigger Activity and one
40
- * Worker Activity.) The JOB ID for Worker Activity executions
41
- * is derived from the containing JOB ID,
42
- * allowing Activity state to be 'replayed' when the workflow
43
- * is run again. The Activity Function Runner (activity proxy)
44
- * is configured similar to how the workflow worker is and will
45
- * catch execution errors and return them to the caller, using a
46
- * 'pending' status to indicate that the activity is still running.
47
- * This allows the activity to be retried until it succeeds.
48
- */
49
- export const Durable = {
50
- Client: ClientService,
51
- Connection: ConnectionService,
52
- NativeConnection: NativeConnectionService,
53
- Worker: WorkerService,
54
- workflow: WorkflowService,
55
- };
@@ -1,4 +0,0 @@
1
- import { Connection, ConnectionConfig } from "../../types/durable";
2
- export declare class NativeConnectionService {
3
- static connect(config: ConnectionConfig): Promise<Connection>;
4
- }
@@ -1,43 +0,0 @@
1
- /*
2
-
3
- Here is an example of how the methods in this file are used:
4
-
5
- ./worker.ts
6
-
7
- import { Durable: { NativeConnection, Worker } } from '@hotmeshio/hotmesh';
8
- import Redis from 'ioredis'; //OR `import * as Redis from 'redis';`
9
-
10
- import * as activities from './activities';
11
-
12
- async function run() {
13
- const connection = await NativeConnection.connect({
14
- class: Redis,
15
- options: {
16
- host: 'localhost',
17
- port: 6379,
18
- },
19
- });
20
- const worker = await Worker.create({
21
- connection,
22
- namespace: 'default',
23
- taskQueue: 'hello-world',
24
- workflowsPath: require.resolve('./workflows'),
25
- activities,
26
- });
27
- await worker.run();
28
- }
29
-
30
- run().catch((err) => {
31
- console.error(err);
32
- process.exit(1);
33
- });
34
-
35
- */
36
- export class NativeConnectionService {
37
- static async connect(config) {
38
- return {
39
- class: config.class,
40
- options: { ...config.options },
41
- };
42
- }
43
- }
@@ -1,267 +0,0 @@
1
- var _a;
2
- import { asyncLocalStorage } from './asyncLocalStorage';
3
- import { HotMeshService as HotMesh } from '../hotmesh';
4
- import { StreamStatus } from '../../types/stream';
5
- import { getWorkflowYAML, getActivityYAML } from './factory';
6
- /*
7
- Here is an example of how the methods in this file are used:
8
-
9
- ./worker.ts
10
-
11
- import { Durable: { NativeConnection, Worker } } from '@hotmeshio/hotmesh';
12
- import Redis from 'ioredis'; //OR `import * as Redis from 'redis';`
13
-
14
- import * as activities from './activities';
15
-
16
- async function run() {
17
- const connection = await NativeConnection.connect({
18
- class: Redis,
19
- options: {
20
- host: 'localhost',
21
- port: 6379,
22
- },
23
- });
24
- const worker = await Worker.create({
25
- connection,
26
- namespace: 'default',
27
- taskQueue: 'hello-world',
28
- workflowsPath: require.resolve('./workflows'),
29
- activities,
30
- });
31
- await worker.run();
32
- }
33
-
34
- run().catch((err) => {
35
- console.error(err);
36
- process.exit(1);
37
- });
38
- */
39
- class WorkerService {
40
- static async activateWorkflow(hotMesh, topic, factory) {
41
- const version = '1';
42
- const app = await hotMesh.engine.store.getApp(topic);
43
- const appVersion = app?.version;
44
- if (!appVersion) {
45
- try {
46
- await hotMesh.deploy(factory(topic, version));
47
- await hotMesh.activate(version);
48
- }
49
- catch (err) {
50
- hotMesh.engine.logger.error('durable-worker-deploy-activate-err', err);
51
- throw err;
52
- }
53
- }
54
- else if (app && !app.active) {
55
- try {
56
- await hotMesh.activate(version);
57
- }
58
- catch (err) {
59
- hotMesh.engine.logger.error('durable-worker-activate-err', err);
60
- throw err;
61
- }
62
- }
63
- }
64
- /**
65
- * The `worker` calls `registerActivities` immediately BEFORE
66
- * dynamically importing the user's workflow module. That file
67
- * contains a call, `proxyActivities`, which needs this info.
68
- *
69
- * NOTE: The `worker` and `client` both call `proxyActivities`,
70
- * as a natural result of importing worflows.ts. However,
71
- * because the worker imports the workflows dynamically AFTER
72
- * the activities are loaded, there will be items in the registry,
73
- * allowing proxyActivities to succeed.
74
- */
75
- static registerActivities(activities) {
76
- if (typeof activities === 'function') {
77
- WorkerService.activityRegistry[activities.name] = activities;
78
- }
79
- else {
80
- Object.keys(activities).forEach(key => {
81
- WorkerService.activityRegistry[activities[key].name] = activities[key];
82
- });
83
- }
84
- return WorkerService.activityRegistry;
85
- }
86
- static async create(config) {
87
- //always call `registerActivities` before `import`
88
- WorkerService.connection = config.connection;
89
- WorkerService.registerActivities(config.activities);
90
- const workflow = await import(config.workflowsPath);
91
- const [workflowFunctionName, workflowFunction] = WorkerService.resolveWorkflowTarget(workflow);
92
- const baseTopic = `${config.taskQueue}-${workflowFunctionName}`;
93
- const activityTopic = `${baseTopic}-activity`;
94
- const workflowTopic = `${baseTopic}`;
95
- //initialize supporting workflows
96
- const worker = new WorkerService();
97
- worker.activityRunner = await worker.initActivityWorkflow(config, activityTopic);
98
- await WorkerService.activateWorkflow(worker.activityRunner, activityTopic, getActivityYAML);
99
- worker.workflowRunner = await worker.initWorkerWorkflow(config, workflowTopic, workflowFunction);
100
- await WorkerService.activateWorkflow(worker.workflowRunner, workflowTopic, getWorkflowYAML);
101
- return worker;
102
- }
103
- static resolveWorkflowTarget(workflow) {
104
- let workflowFunction;
105
- if (typeof workflow === 'function') {
106
- workflowFunction = workflow;
107
- }
108
- else {
109
- const workflowFunctionNames = Object.keys(workflow);
110
- workflowFunction = workflow[workflowFunctionNames[workflowFunctionNames.length - 1]];
111
- return WorkerService.resolveWorkflowTarget(workflowFunction);
112
- }
113
- return [workflowFunction.name, workflowFunction];
114
- }
115
- async run() {
116
- this.workflowRunner.engine.logger.info('WorkerService is running');
117
- }
118
- async initActivityWorkflow(config, activityTopic) {
119
- const redisConfig = {
120
- class: config.connection.class,
121
- options: config.connection.options
122
- };
123
- const hmshInstance = await HotMesh.init({
124
- appId: activityTopic,
125
- engine: { redis: redisConfig },
126
- workers: [
127
- { topic: activityTopic,
128
- redis: redisConfig,
129
- callback: this.wrapActivityFunctions().bind(this)
130
- }
131
- ]
132
- });
133
- WorkerService.instances.set(activityTopic, hmshInstance);
134
- return hmshInstance;
135
- }
136
- wrapActivityFunctions() {
137
- return async (data) => {
138
- try {
139
- //always run the activity function when instructed; return the response
140
- const activityInput = data.data;
141
- const activityName = activityInput.activityName;
142
- const activityFunction = WorkerService.activityRegistry[activityName];
143
- const pojoResponse = await activityFunction.apply(this, activityInput.arguments);
144
- return {
145
- status: StreamStatus.SUCCESS,
146
- metadata: { ...data.metadata },
147
- data: { response: pojoResponse }
148
- };
149
- }
150
- catch (err) {
151
- this.activityRunner.engine.logger.error('durable-worker-activity-err', err);
152
- return {
153
- status: StreamStatus.ERROR,
154
- code: 500,
155
- message: err.message,
156
- metadata: { ...data.metadata },
157
- data: { error: err }
158
- };
159
- }
160
- };
161
- }
162
- async activateActivityWorkflow(hotMesh, activityTopic) {
163
- const version = '1';
164
- const app = await hotMesh.engine.store.getApp(activityTopic);
165
- const appVersion = app?.version;
166
- if (isNaN(appVersion)) {
167
- try {
168
- await hotMesh.deploy(getActivityYAML(activityTopic, version));
169
- await hotMesh.activate(version);
170
- }
171
- catch (err) {
172
- hotMesh.engine.logger.error('durable-worker-activity-deploy-activate-error', err);
173
- throw err;
174
- }
175
- }
176
- else if (app && !app.active) {
177
- try {
178
- await hotMesh.activate(version);
179
- }
180
- catch (err) {
181
- hotMesh.engine.logger.error('durable-worker-activity-activate-err', err);
182
- throw err;
183
- }
184
- }
185
- }
186
- async initWorkerWorkflow(config, workflowTopic, workflowFunction) {
187
- const redisConfig = {
188
- class: config.connection.class,
189
- options: config.connection.options
190
- };
191
- const hmshInstance = await HotMesh.init({
192
- appId: workflowTopic,
193
- engine: { redis: redisConfig },
194
- workers: [
195
- { topic: workflowTopic,
196
- redis: redisConfig,
197
- callback: this.wrapWorkflowFunction(workflowFunction, workflowTopic).bind(this)
198
- }
199
- ]
200
- });
201
- WorkerService.instances.set(workflowTopic, hmshInstance);
202
- return hmshInstance;
203
- }
204
- wrapWorkflowFunction(workflowFunction, workflowTopic) {
205
- return async (data) => {
206
- try {
207
- //incoming data payload has arguments and workflowId
208
- const workflowInput = data.data;
209
- const context = new Map();
210
- const counter = { counter: 0 };
211
- context.set('counter', counter);
212
- context.set('workflowId', workflowInput.workflowId);
213
- context.set('workflowTopic', workflowTopic);
214
- context.set('workflowName', workflowTopic.split('-').pop());
215
- context.set('workflowTrace', data.metadata.trc);
216
- context.set('workflowSpan', data.metadata.spn);
217
- const workflowResponse = await asyncLocalStorage.run(context, async () => {
218
- return await workflowFunction.apply(this, workflowInput.arguments);
219
- });
220
- return {
221
- code: 200,
222
- status: StreamStatus.SUCCESS,
223
- metadata: { ...data.metadata },
224
- data: { response: workflowResponse }
225
- };
226
- }
227
- catch (err) {
228
- return {
229
- status: StreamStatus.ERROR,
230
- code: 500,
231
- metadata: { ...data.metadata },
232
- data: { error: err }
233
- };
234
- }
235
- };
236
- }
237
- static async shutdown() {
238
- for (const [key, value] of WorkerService.instances) {
239
- const hotMesh = await value;
240
- await hotMesh.stop();
241
- }
242
- }
243
- }
244
- _a = WorkerService;
245
- WorkerService.activityRegistry = {}; //user's activities
246
- WorkerService.instances = new Map();
247
- WorkerService.getHotMesh = async (worflowTopic) => {
248
- if (WorkerService.instances.has(worflowTopic)) {
249
- return await WorkerService.instances.get(worflowTopic);
250
- }
251
- const hotMesh = HotMesh.init({
252
- appId: worflowTopic,
253
- engine: { redis: { ...WorkerService.connection } }
254
- });
255
- WorkerService.instances.set(worflowTopic, hotMesh);
256
- await WorkerService.activateWorkflow(await hotMesh, worflowTopic, getWorkflowYAML);
257
- return hotMesh;
258
- };
259
- WorkerService.Context = {
260
- info: () => {
261
- return {
262
- workflowId: '',
263
- workflowTopic: '',
264
- };
265
- },
266
- };
267
- export { WorkerService };
@@ -1,6 +0,0 @@
1
- import { ActivityConfig, ProxyType, WorkflowOptions } from "../../types/durable";
2
- export declare class WorkflowService {
3
- static executeChild<T>(options: WorkflowOptions): Promise<T>;
4
- static proxyActivities<ACT>(options?: ActivityConfig): ProxyType<ACT>;
5
- static wrapActivity<T>(activityName: string, options?: ActivityConfig): T;
6
- }