@hotmeshio/hotmesh 0.0.7 → 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 (365) hide show
  1. package/LICENSE +4 -7
  2. package/README.md +37 -46
  3. package/build/{esm/package.json → package.json} +6 -11
  4. package/build/{cjs/services → services}/activities/activity.d.ts +6 -0
  5. package/build/{cjs/services → services}/activities/activity.js +83 -7
  6. package/build/{cjs/services → services}/activities/await.d.ts +2 -2
  7. package/build/{cjs/services → services}/activities/await.js +5 -5
  8. package/build/services/activities/cycle.d.ts +19 -0
  9. package/build/services/activities/cycle.js +77 -0
  10. package/build/{esm/services → services}/activities/index.d.ts +4 -2
  11. package/build/{cjs/services → services}/activities/index.js +4 -2
  12. package/build/{cjs/services → services}/activities/worker.d.ts +0 -8
  13. package/build/services/activities/worker.js +73 -0
  14. package/build/{esm/services → services}/collator/index.d.ts +18 -1
  15. package/build/{cjs/services → services}/collator/index.js +41 -11
  16. package/build/{cjs/services → services}/durable/factory.js +17 -1
  17. package/build/{cjs/services → services}/durable/native.js +2 -2
  18. package/build/{cjs/services → services}/durable/worker.d.ts +2 -3
  19. package/build/{esm/services → services}/durable/worker.js +35 -37
  20. package/build/{cjs/services → services}/durable/workflow.js +11 -2
  21. package/build/{cjs/services → services}/mapper/index.js +3 -0
  22. package/build/{cjs/services → services}/signaler/stream.js +0 -1
  23. package/build/{esm/types → types}/activity.d.ts +7 -2
  24. package/build/{cjs/types → types}/durable.d.ts +4 -6
  25. package/build/{cjs/types → types}/index.d.ts +1 -1
  26. package/package.json +6 -11
  27. package/services/activities/activity.ts +90 -7
  28. package/services/activities/await.ts +5 -5
  29. package/services/activities/cycle.ts +96 -0
  30. package/services/activities/index.ts +4 -2
  31. package/services/activities/worker.ts +2 -93
  32. package/services/collator/index.ts +43 -11
  33. package/services/durable/factory.ts +17 -1
  34. package/services/durable/native.ts +2 -2
  35. package/services/durable/worker.ts +19 -22
  36. package/services/durable/workflow.ts +11 -2
  37. package/services/mapper/index.ts +3 -0
  38. package/services/signaler/stream.ts +0 -1
  39. package/types/activity.ts +8 -1
  40. package/types/durable.ts +4 -4
  41. package/types/index.ts +1 -0
  42. package/build/cjs/package.json +0 -80
  43. package/build/cjs/services/activities/index.d.ts +0 -15
  44. package/build/cjs/services/activities/worker.js +0 -159
  45. package/build/cjs/services/collator/index.d.ts +0 -56
  46. package/build/cjs/services/durable/worker.js +0 -298
  47. package/build/cjs/types/activity.d.ts +0 -87
  48. package/build/esm/index.d.ts +0 -4
  49. package/build/esm/index.js +0 -3
  50. package/build/esm/modules/errors.d.ts +0 -28
  51. package/build/esm/modules/errors.js +0 -41
  52. package/build/esm/modules/key.d.ts +0 -75
  53. package/build/esm/modules/key.js +0 -111
  54. package/build/esm/modules/utils.d.ts +0 -34
  55. package/build/esm/modules/utils.js +0 -154
  56. package/build/esm/services/activities/activity.d.ts +0 -61
  57. package/build/esm/services/activities/activity.js +0 -410
  58. package/build/esm/services/activities/await.d.ts +0 -16
  59. package/build/esm/services/activities/await.js +0 -140
  60. package/build/esm/services/activities/emit.d.ts +0 -9
  61. package/build/esm/services/activities/emit.js +0 -10
  62. package/build/esm/services/activities/index.js +0 -14
  63. package/build/esm/services/activities/iterate.d.ts +0 -9
  64. package/build/esm/services/activities/iterate.js +0 -10
  65. package/build/esm/services/activities/trigger.d.ts +0 -22
  66. package/build/esm/services/activities/trigger.js +0 -158
  67. package/build/esm/services/activities/worker.d.ts +0 -19
  68. package/build/esm/services/activities/worker.js +0 -156
  69. package/build/esm/services/collator/index.js +0 -191
  70. package/build/esm/services/compiler/deployer.d.ts +0 -36
  71. package/build/esm/services/compiler/deployer.js +0 -423
  72. package/build/esm/services/compiler/index.d.ts +0 -30
  73. package/build/esm/services/compiler/index.js +0 -82
  74. package/build/esm/services/compiler/validator.d.ts +0 -32
  75. package/build/esm/services/compiler/validator.js +0 -131
  76. package/build/esm/services/connector/clients/ioredis.d.ts +0 -13
  77. package/build/esm/services/connector/clients/ioredis.js +0 -47
  78. package/build/esm/services/connector/clients/redis.d.ts +0 -13
  79. package/build/esm/services/connector/clients/redis.js +0 -59
  80. package/build/esm/services/connector/index.d.ts +0 -5
  81. package/build/esm/services/connector/index.js +0 -27
  82. package/build/esm/services/dimension/index.d.ts +0 -29
  83. package/build/esm/services/dimension/index.js +0 -32
  84. package/build/esm/services/durable/asyncLocalStorage.d.ts +0 -3
  85. package/build/esm/services/durable/asyncLocalStorage.js +0 -2
  86. package/build/esm/services/durable/client.d.ts +0 -15
  87. package/build/esm/services/durable/client.js +0 -114
  88. package/build/esm/services/durable/connection.d.ts +0 -4
  89. package/build/esm/services/durable/connection.js +0 -47
  90. package/build/esm/services/durable/factory.d.ts +0 -3
  91. package/build/esm/services/durable/factory.js +0 -119
  92. package/build/esm/services/durable/handle.d.ts +0 -8
  93. package/build/esm/services/durable/handle.js +0 -34
  94. package/build/esm/services/durable/index.d.ts +0 -57
  95. package/build/esm/services/durable/index.js +0 -55
  96. package/build/esm/services/durable/native.d.ts +0 -4
  97. package/build/esm/services/durable/native.js +0 -43
  98. package/build/esm/services/durable/worker.d.ts +0 -37
  99. package/build/esm/services/durable/workflow.d.ts +0 -6
  100. package/build/esm/services/durable/workflow.js +0 -128
  101. package/build/esm/services/engine/index.d.ts +0 -82
  102. package/build/esm/services/engine/index.js +0 -522
  103. package/build/esm/services/hotmesh/index.d.ts +0 -45
  104. package/build/esm/services/hotmesh/index.js +0 -131
  105. package/build/esm/services/logger/index.d.ts +0 -17
  106. package/build/esm/services/logger/index.js +0 -70
  107. package/build/esm/services/mapper/index.d.ts +0 -24
  108. package/build/esm/services/mapper/index.js +0 -69
  109. package/build/esm/services/pipe/functions/array.d.ts +0 -24
  110. package/build/esm/services/pipe/functions/array.js +0 -66
  111. package/build/esm/services/pipe/functions/bitwise.d.ts +0 -9
  112. package/build/esm/services/pipe/functions/bitwise.js +0 -21
  113. package/build/esm/services/pipe/functions/conditional.d.ts +0 -10
  114. package/build/esm/services/pipe/functions/conditional.js +0 -24
  115. package/build/esm/services/pipe/functions/date.d.ts +0 -57
  116. package/build/esm/services/pipe/functions/date.js +0 -164
  117. package/build/esm/services/pipe/functions/index.d.ts +0 -25
  118. package/build/esm/services/pipe/functions/index.js +0 -24
  119. package/build/esm/services/pipe/functions/json.d.ts +0 -5
  120. package/build/esm/services/pipe/functions/json.js +0 -9
  121. package/build/esm/services/pipe/functions/math.d.ts +0 -38
  122. package/build/esm/services/pipe/functions/math.js +0 -108
  123. package/build/esm/services/pipe/functions/number.d.ts +0 -25
  124. package/build/esm/services/pipe/functions/number.js +0 -130
  125. package/build/esm/services/pipe/functions/object.d.ts +0 -22
  126. package/build/esm/services/pipe/functions/object.js +0 -60
  127. package/build/esm/services/pipe/functions/string.d.ts +0 -23
  128. package/build/esm/services/pipe/functions/string.js +0 -66
  129. package/build/esm/services/pipe/functions/symbol.d.ts +0 -12
  130. package/build/esm/services/pipe/functions/symbol.js +0 -30
  131. package/build/esm/services/pipe/functions/unary.d.ts +0 -7
  132. package/build/esm/services/pipe/functions/unary.js +0 -15
  133. package/build/esm/services/pipe/index.d.ts +0 -30
  134. package/build/esm/services/pipe/index.js +0 -122
  135. package/build/esm/services/quorum/index.d.ts +0 -34
  136. package/build/esm/services/quorum/index.js +0 -144
  137. package/build/esm/services/reporter/index.d.ts +0 -47
  138. package/build/esm/services/reporter/index.js +0 -327
  139. package/build/esm/services/serializer/index.d.ts +0 -41
  140. package/build/esm/services/serializer/index.js +0 -251
  141. package/build/esm/services/signaler/store.d.ts +0 -15
  142. package/build/esm/services/signaler/store.js +0 -50
  143. package/build/esm/services/signaler/stream.d.ts +0 -43
  144. package/build/esm/services/signaler/stream.js +0 -315
  145. package/build/esm/services/store/cache.d.ts +0 -66
  146. package/build/esm/services/store/cache.js +0 -124
  147. package/build/esm/services/store/clients/ioredis.d.ts +0 -27
  148. package/build/esm/services/store/clients/ioredis.js +0 -93
  149. package/build/esm/services/store/clients/redis.d.ts +0 -29
  150. package/build/esm/services/store/clients/redis.js +0 -140
  151. package/build/esm/services/store/index.d.ts +0 -88
  152. package/build/esm/services/store/index.js +0 -623
  153. package/build/esm/services/stream/clients/ioredis.d.ts +0 -23
  154. package/build/esm/services/stream/clients/ioredis.js +0 -112
  155. package/build/esm/services/stream/clients/redis.d.ts +0 -23
  156. package/build/esm/services/stream/clients/redis.js +0 -116
  157. package/build/esm/services/stream/index.d.ts +0 -21
  158. package/build/esm/services/stream/index.js +0 -6
  159. package/build/esm/services/sub/clients/ioredis.d.ts +0 -20
  160. package/build/esm/services/sub/clients/ioredis.js +0 -69
  161. package/build/esm/services/sub/clients/redis.d.ts +0 -20
  162. package/build/esm/services/sub/clients/redis.js +0 -60
  163. package/build/esm/services/sub/index.d.ts +0 -18
  164. package/build/esm/services/sub/index.js +0 -6
  165. package/build/esm/services/task/index.d.ts +0 -18
  166. package/build/esm/services/task/index.js +0 -70
  167. package/build/esm/services/telemetry/index.d.ts +0 -49
  168. package/build/esm/services/telemetry/index.js +0 -217
  169. package/build/esm/services/worker/index.d.ts +0 -30
  170. package/build/esm/services/worker/index.js +0 -102
  171. package/build/esm/types/activity.js +0 -1
  172. package/build/esm/types/app.d.ts +0 -16
  173. package/build/esm/types/app.js +0 -1
  174. package/build/esm/types/async.d.ts +0 -5
  175. package/build/esm/types/async.js +0 -1
  176. package/build/esm/types/cache.d.ts +0 -1
  177. package/build/esm/types/cache.js +0 -1
  178. package/build/esm/types/collator.d.ts +0 -8
  179. package/build/esm/types/collator.js +0 -8
  180. package/build/esm/types/durable.d.ts +0 -59
  181. package/build/esm/types/durable.js +0 -1
  182. package/build/esm/types/hook.d.ts +0 -31
  183. package/build/esm/types/hook.js +0 -6
  184. package/build/esm/types/hotmesh.d.ts +0 -82
  185. package/build/esm/types/hotmesh.js +0 -1
  186. package/build/esm/types/index.d.ts +0 -20
  187. package/build/esm/types/index.js +0 -5
  188. package/build/esm/types/ioredisclient.d.ts +0 -5
  189. package/build/esm/types/ioredisclient.js +0 -2
  190. package/build/esm/types/job.d.ts +0 -50
  191. package/build/esm/types/job.js +0 -1
  192. package/build/esm/types/logger.d.ts +0 -6
  193. package/build/esm/types/logger.js +0 -1
  194. package/build/esm/types/map.d.ts +0 -4
  195. package/build/esm/types/map.js +0 -1
  196. package/build/esm/types/pipe.d.ts +0 -4
  197. package/build/esm/types/pipe.js +0 -1
  198. package/build/esm/types/quorum.d.ts +0 -46
  199. package/build/esm/types/quorum.js +0 -1
  200. package/build/esm/types/redis.d.ts +0 -8
  201. package/build/esm/types/redis.js +0 -1
  202. package/build/esm/types/redisclient.d.ts +0 -25
  203. package/build/esm/types/redisclient.js +0 -1
  204. package/build/esm/types/serializer.d.ts +0 -33
  205. package/build/esm/types/serializer.js +0 -1
  206. package/build/esm/types/stats.d.ts +0 -83
  207. package/build/esm/types/stats.js +0 -1
  208. package/build/esm/types/stream.d.ts +0 -67
  209. package/build/esm/types/stream.js +0 -22
  210. package/build/esm/types/telemetry.d.ts +0 -1
  211. package/build/esm/types/telemetry.js +0 -1
  212. package/build/esm/types/transition.d.ts +0 -17
  213. package/build/esm/types/transition.js +0 -1
  214. package/tsconfig.cjs.json +0 -8
  215. package/tsconfig.esm.json +0 -9
  216. /package/build/{cjs/index.d.ts → index.d.ts} +0 -0
  217. /package/build/{cjs/index.js → index.js} +0 -0
  218. /package/build/{cjs/modules → modules}/errors.d.ts +0 -0
  219. /package/build/{cjs/modules → modules}/errors.js +0 -0
  220. /package/build/{cjs/modules → modules}/key.d.ts +0 -0
  221. /package/build/{cjs/modules → modules}/key.js +0 -0
  222. /package/build/{cjs/modules → modules}/utils.d.ts +0 -0
  223. /package/build/{cjs/modules → modules}/utils.js +0 -0
  224. /package/build/{cjs/services → services}/activities/emit.d.ts +0 -0
  225. /package/build/{cjs/services → services}/activities/emit.js +0 -0
  226. /package/build/{cjs/services → services}/activities/iterate.d.ts +0 -0
  227. /package/build/{cjs/services → services}/activities/iterate.js +0 -0
  228. /package/build/{cjs/services → services}/activities/trigger.d.ts +0 -0
  229. /package/build/{cjs/services → services}/activities/trigger.js +0 -0
  230. /package/build/{cjs/services → services}/compiler/deployer.d.ts +0 -0
  231. /package/build/{cjs/services → services}/compiler/deployer.js +0 -0
  232. /package/build/{cjs/services → services}/compiler/index.d.ts +0 -0
  233. /package/build/{cjs/services → services}/compiler/index.js +0 -0
  234. /package/build/{cjs/services → services}/compiler/validator.d.ts +0 -0
  235. /package/build/{cjs/services → services}/compiler/validator.js +0 -0
  236. /package/build/{cjs/services → services}/connector/clients/ioredis.d.ts +0 -0
  237. /package/build/{cjs/services → services}/connector/clients/ioredis.js +0 -0
  238. /package/build/{cjs/services → services}/connector/clients/redis.d.ts +0 -0
  239. /package/build/{cjs/services → services}/connector/clients/redis.js +0 -0
  240. /package/build/{cjs/services → services}/connector/index.d.ts +0 -0
  241. /package/build/{cjs/services → services}/connector/index.js +0 -0
  242. /package/build/{cjs/services → services}/dimension/index.d.ts +0 -0
  243. /package/build/{cjs/services → services}/dimension/index.js +0 -0
  244. /package/build/{cjs/services → services}/durable/asyncLocalStorage.d.ts +0 -0
  245. /package/build/{cjs/services → services}/durable/asyncLocalStorage.js +0 -0
  246. /package/build/{cjs/services → services}/durable/client.d.ts +0 -0
  247. /package/build/{cjs/services → services}/durable/client.js +0 -0
  248. /package/build/{cjs/services → services}/durable/connection.d.ts +0 -0
  249. /package/build/{cjs/services → services}/durable/connection.js +0 -0
  250. /package/build/{cjs/services → services}/durable/factory.d.ts +0 -0
  251. /package/build/{cjs/services → services}/durable/handle.d.ts +0 -0
  252. /package/build/{cjs/services → services}/durable/handle.js +0 -0
  253. /package/build/{cjs/services → services}/durable/index.d.ts +0 -0
  254. /package/build/{cjs/services → services}/durable/index.js +0 -0
  255. /package/build/{cjs/services → services}/durable/native.d.ts +0 -0
  256. /package/build/{cjs/services → services}/durable/workflow.d.ts +0 -0
  257. /package/build/{cjs/services → services}/engine/index.d.ts +0 -0
  258. /package/build/{cjs/services → services}/engine/index.js +0 -0
  259. /package/build/{cjs/services → services}/hotmesh/index.d.ts +0 -0
  260. /package/build/{cjs/services → services}/hotmesh/index.js +0 -0
  261. /package/build/{cjs/services → services}/logger/index.d.ts +0 -0
  262. /package/build/{cjs/services → services}/logger/index.js +0 -0
  263. /package/build/{cjs/services → services}/mapper/index.d.ts +0 -0
  264. /package/build/{cjs/services → services}/pipe/functions/array.d.ts +0 -0
  265. /package/build/{cjs/services → services}/pipe/functions/array.js +0 -0
  266. /package/build/{cjs/services → services}/pipe/functions/bitwise.d.ts +0 -0
  267. /package/build/{cjs/services → services}/pipe/functions/bitwise.js +0 -0
  268. /package/build/{cjs/services → services}/pipe/functions/conditional.d.ts +0 -0
  269. /package/build/{cjs/services → services}/pipe/functions/conditional.js +0 -0
  270. /package/build/{cjs/services → services}/pipe/functions/date.d.ts +0 -0
  271. /package/build/{cjs/services → services}/pipe/functions/date.js +0 -0
  272. /package/build/{cjs/services → services}/pipe/functions/index.d.ts +0 -0
  273. /package/build/{cjs/services → services}/pipe/functions/index.js +0 -0
  274. /package/build/{cjs/services → services}/pipe/functions/json.d.ts +0 -0
  275. /package/build/{cjs/services → services}/pipe/functions/json.js +0 -0
  276. /package/build/{cjs/services → services}/pipe/functions/math.d.ts +0 -0
  277. /package/build/{cjs/services → services}/pipe/functions/math.js +0 -0
  278. /package/build/{cjs/services → services}/pipe/functions/number.d.ts +0 -0
  279. /package/build/{cjs/services → services}/pipe/functions/number.js +0 -0
  280. /package/build/{cjs/services → services}/pipe/functions/object.d.ts +0 -0
  281. /package/build/{cjs/services → services}/pipe/functions/object.js +0 -0
  282. /package/build/{cjs/services → services}/pipe/functions/string.d.ts +0 -0
  283. /package/build/{cjs/services → services}/pipe/functions/string.js +0 -0
  284. /package/build/{cjs/services → services}/pipe/functions/symbol.d.ts +0 -0
  285. /package/build/{cjs/services → services}/pipe/functions/symbol.js +0 -0
  286. /package/build/{cjs/services → services}/pipe/functions/unary.d.ts +0 -0
  287. /package/build/{cjs/services → services}/pipe/functions/unary.js +0 -0
  288. /package/build/{cjs/services → services}/pipe/index.d.ts +0 -0
  289. /package/build/{cjs/services → services}/pipe/index.js +0 -0
  290. /package/build/{cjs/services → services}/quorum/index.d.ts +0 -0
  291. /package/build/{cjs/services → services}/quorum/index.js +0 -0
  292. /package/build/{cjs/services → services}/reporter/index.d.ts +0 -0
  293. /package/build/{cjs/services → services}/reporter/index.js +0 -0
  294. /package/build/{cjs/services → services}/serializer/index.d.ts +0 -0
  295. /package/build/{cjs/services → services}/serializer/index.js +0 -0
  296. /package/build/{cjs/services → services}/signaler/store.d.ts +0 -0
  297. /package/build/{cjs/services → services}/signaler/store.js +0 -0
  298. /package/build/{cjs/services → services}/signaler/stream.d.ts +0 -0
  299. /package/build/{cjs/services → services}/store/cache.d.ts +0 -0
  300. /package/build/{cjs/services → services}/store/cache.js +0 -0
  301. /package/build/{cjs/services → services}/store/clients/ioredis.d.ts +0 -0
  302. /package/build/{cjs/services → services}/store/clients/ioredis.js +0 -0
  303. /package/build/{cjs/services → services}/store/clients/redis.d.ts +0 -0
  304. /package/build/{cjs/services → services}/store/clients/redis.js +0 -0
  305. /package/build/{cjs/services → services}/store/index.d.ts +0 -0
  306. /package/build/{cjs/services → services}/store/index.js +0 -0
  307. /package/build/{cjs/services → services}/stream/clients/ioredis.d.ts +0 -0
  308. /package/build/{cjs/services → services}/stream/clients/ioredis.js +0 -0
  309. /package/build/{cjs/services → services}/stream/clients/redis.d.ts +0 -0
  310. /package/build/{cjs/services → services}/stream/clients/redis.js +0 -0
  311. /package/build/{cjs/services → services}/stream/index.d.ts +0 -0
  312. /package/build/{cjs/services → services}/stream/index.js +0 -0
  313. /package/build/{cjs/services → services}/sub/clients/ioredis.d.ts +0 -0
  314. /package/build/{cjs/services → services}/sub/clients/ioredis.js +0 -0
  315. /package/build/{cjs/services → services}/sub/clients/redis.d.ts +0 -0
  316. /package/build/{cjs/services → services}/sub/clients/redis.js +0 -0
  317. /package/build/{cjs/services → services}/sub/index.d.ts +0 -0
  318. /package/build/{cjs/services → services}/sub/index.js +0 -0
  319. /package/build/{cjs/services → services}/task/index.d.ts +0 -0
  320. /package/build/{cjs/services → services}/task/index.js +0 -0
  321. /package/build/{cjs/services → services}/telemetry/index.d.ts +0 -0
  322. /package/build/{cjs/services → services}/telemetry/index.js +0 -0
  323. /package/build/{cjs/services → services}/worker/index.d.ts +0 -0
  324. /package/build/{cjs/services → services}/worker/index.js +0 -0
  325. /package/build/{cjs/types → types}/activity.js +0 -0
  326. /package/build/{cjs/types → types}/app.d.ts +0 -0
  327. /package/build/{cjs/types → types}/app.js +0 -0
  328. /package/build/{cjs/types → types}/async.d.ts +0 -0
  329. /package/build/{cjs/types → types}/async.js +0 -0
  330. /package/build/{cjs/types → types}/cache.d.ts +0 -0
  331. /package/build/{cjs/types → types}/cache.js +0 -0
  332. /package/build/{cjs/types → types}/collator.d.ts +0 -0
  333. /package/build/{cjs/types → types}/collator.js +0 -0
  334. /package/build/{cjs/types → types}/durable.js +0 -0
  335. /package/build/{cjs/types → types}/hook.d.ts +0 -0
  336. /package/build/{cjs/types → types}/hook.js +0 -0
  337. /package/build/{cjs/types → types}/hotmesh.d.ts +0 -0
  338. /package/build/{cjs/types → types}/hotmesh.js +0 -0
  339. /package/build/{cjs/types → types}/index.js +0 -0
  340. /package/build/{cjs/types → types}/ioredisclient.d.ts +0 -0
  341. /package/build/{cjs/types → types}/ioredisclient.js +0 -0
  342. /package/build/{cjs/types → types}/job.d.ts +0 -0
  343. /package/build/{cjs/types → types}/job.js +0 -0
  344. /package/build/{cjs/types → types}/logger.d.ts +0 -0
  345. /package/build/{cjs/types → types}/logger.js +0 -0
  346. /package/build/{cjs/types → types}/map.d.ts +0 -0
  347. /package/build/{cjs/types → types}/map.js +0 -0
  348. /package/build/{cjs/types → types}/pipe.d.ts +0 -0
  349. /package/build/{cjs/types → types}/pipe.js +0 -0
  350. /package/build/{cjs/types → types}/quorum.d.ts +0 -0
  351. /package/build/{cjs/types → types}/quorum.js +0 -0
  352. /package/build/{cjs/types → types}/redis.d.ts +0 -0
  353. /package/build/{cjs/types → types}/redis.js +0 -0
  354. /package/build/{cjs/types → types}/redisclient.d.ts +0 -0
  355. /package/build/{cjs/types → types}/redisclient.js +0 -0
  356. /package/build/{cjs/types → types}/serializer.d.ts +0 -0
  357. /package/build/{cjs/types → types}/serializer.js +0 -0
  358. /package/build/{cjs/types → types}/stats.d.ts +0 -0
  359. /package/build/{cjs/types → types}/stats.js +0 -0
  360. /package/build/{cjs/types → types}/stream.d.ts +0 -0
  361. /package/build/{cjs/types → types}/stream.js +0 -0
  362. /package/build/{cjs/types → types}/telemetry.d.ts +0 -0
  363. /package/build/{cjs/types → types}/telemetry.js +0 -0
  364. /package/build/{cjs/types → types}/transition.d.ts +0 -0
  365. /package/build/{cjs/types → types}/transition.js +0 -0
@@ -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,37 +0,0 @@
1
- import { HotMeshService as HotMesh } from '../hotmesh';
2
- import { Connection, Registry, WorkerConfig } from "../../types/durable";
3
- export declare class WorkerService {
4
- static activityRegistry: Registry;
5
- static connection: Connection;
6
- static instances: Map<string, HotMesh | Promise<HotMesh>>;
7
- workflowRunner: HotMesh;
8
- static getHotMesh: (worflowTopic: string) => Promise<HotMesh>;
9
- static activateWorkflow(hotMesh: HotMesh, topic: string, factory: Function): Promise<void>;
10
- /**
11
- * The `worker` calls `registerActivities` immediately BEFORE
12
- * dynamically importing the user's workflow module. That file
13
- * contains a call, `proxyActivities`, which needs this info.
14
- *
15
- * NOTE: The `worker` and `client` both call `proxyActivities`,
16
- * as a natural result of importing worflows.ts. However,
17
- * because the worker imports the workflows dynamically AFTER
18
- * the activities are loaded, there will be items in the registry,
19
- * allowing proxyActivities to succeed.
20
- */
21
- static registerActivities<ACT>(activities: ACT): Registry;
22
- static create(config: WorkerConfig): Promise<WorkerService>;
23
- static resolveWorkflowTarget(workflow: object | Function): [string, Function];
24
- run(): Promise<void>;
25
- initActivityWorkflow(config: WorkerConfig, activityTopic: string): Promise<HotMesh>;
26
- wrapActivityFunctions(): Function;
27
- activateActivityWorkflow(hotMesh: HotMesh, activityTopic: string): Promise<void>;
28
- initWorkerWorkflow(config: WorkerConfig, workflowTopic: string, workflowFunction: Function): Promise<HotMesh>;
29
- static Context: {
30
- info: () => {
31
- workflowId: string;
32
- workflowTopic: string;
33
- };
34
- };
35
- wrapWorkflowFunction(workflowFunction: Function, workflowTopic: string): Function;
36
- static shutdown(): Promise<void>;
37
- }
@@ -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
- }
@@ -1,128 +0,0 @@
1
- import ms from 'ms';
2
- import { asyncLocalStorage } from './asyncLocalStorage';
3
- import { WorkerService } from './worker';
4
- import { ClientService as Client } from './client';
5
- import { ConnectionService as Connection } from './connection';
6
- /*
7
- `proxyActivities` returns a wrapped instance of the
8
- target activity, so that when the workflow calls a
9
- proxied activity, it is actually calling the proxy
10
- function, which in turn calls the activity function.
11
-
12
- `proxyActivities` must be called AFTER the activities
13
- have been registered in order to work properly.
14
- If the activities are not already registered,
15
- `proxyActivities` will throw an error. This is OK.
16
-
17
- The `client` (client.ts) is equivalent to the
18
- HotMesh `engine`. The jobs it creates will be
19
- put in the taskQueue. When the `worker` (worker.ts)
20
- is eventually initialized (if it happens to be inited later),
21
- it will see the items in the queue and process them. If it happens
22
- to already be inited, the jobs will immediately be dequeued and
23
- processed. In either case, the jobs will be processed.
24
-
25
- Here is an example of how the methods in this file are used:
26
-
27
- ./workflows.ts
28
-
29
- import { Durable } from '@hotmeshio/hotmesh';
30
- import type * as activities from './activities';
31
- const { greet } = Durable.workflow.proxyActivities<typeof activities>({
32
- startToCloseTimeout: '1 minute',
33
- retryPolicy: {
34
- initialInterval: '5 seconds', // Initial delay between retries
35
- maximumAttempts: 3, // Max number of retry attempts
36
- backoffCoefficient: 2.0, // Backoff factor for delay between retries: delay = initialInterval * (backoffCoefficient ^ retry_attempt)
37
- maximumInterval: '30 seconds', // Max delay between retries
38
- },
39
- });
40
-
41
- export async function example(name: string): Promise<string> {
42
- return await greet(name);
43
- }
44
- */
45
- export class WorkflowService {
46
- static async executeChild(options) {
47
- const store = asyncLocalStorage.getStore();
48
- if (!store) {
49
- throw new Error('durable-store-not-found');
50
- }
51
- const workflowId = store.get('workflowId');
52
- const workflowTrace = store.get('workflowTrace');
53
- const workflowSpan = store.get('workflowSpan');
54
- const client = new Client({
55
- connection: await Connection.connect(WorkerService.connection),
56
- });
57
- //todo: should I allow-cross/app callback (pj:'@DURABLE@hello-world@<pjid>'/pa: <paid>/pd: <pdad>)
58
- const handle = await client.workflow.start({
59
- ...options,
60
- workflowId: `${workflowId}${options.workflowId}`,
61
- workflowTrace,
62
- workflowSpan,
63
- });
64
- const result = await handle.result();
65
- return result;
66
- }
67
- static proxyActivities(options) {
68
- const proxy = {};
69
- const keys = Object.keys(WorkerService.activityRegistry);
70
- if (keys.length) {
71
- keys.forEach((key) => {
72
- const activityFunction = WorkerService.activityRegistry[key];
73
- proxy[key] = WorkflowService.wrapActivity(key, options);
74
- });
75
- }
76
- return proxy;
77
- }
78
- static wrapActivity(activityName, options) {
79
- return async function () {
80
- const store = asyncLocalStorage.getStore();
81
- if (!store) {
82
- throw new Error('durable-store-not-found');
83
- }
84
- const COUNTER = store.get('counter');
85
- //increment by state (not value) to avoid race conditions
86
- const execIndex = COUNTER.counter = COUNTER.counter + 1;
87
- const workflowId = store.get('workflowId');
88
- const workflowTopic = store.get('workflowTopic');
89
- const trc = store.get('workflowTrace');
90
- const spn = store.get('workflowSpan');
91
- const activityTopic = `${workflowTopic}-activity`;
92
- const activityJobId = `${workflowId}-${activityName}-${execIndex}`;
93
- let activityState;
94
- try {
95
- const hmshInstance = await WorkerService.getHotMesh(activityTopic);
96
- activityState = await hmshInstance.getState(activityTopic, activityJobId);
97
- if (activityState.metadata.js == 1) {
98
- //return immediately
99
- return activityState.data?.response;
100
- }
101
- //one time subscription
102
- return await new Promise((resolve, reject) => {
103
- hmshInstance.sub(activityTopic, async (topic, message) => {
104
- const response = message.data?.response;
105
- hmshInstance.unsub(activityTopic);
106
- // Resolve the Promise when the callback is triggered with a message
107
- resolve(response);
108
- });
109
- });
110
- }
111
- catch (e) {
112
- //expected; thrown by `getState` when the job cannot be found
113
- const duration = ms(options?.startToCloseTimeout || '1 minute');
114
- const payload = {
115
- arguments: Array.from(arguments),
116
- workflowId: activityJobId,
117
- workflowTopic,
118
- activityName,
119
- };
120
- //start the job
121
- const hmshInstance = await WorkerService.getHotMesh(activityTopic);
122
- const context = { metadata: { trc, spn }, data: {} };
123
- const jobOutput = await hmshInstance.pubsub(activityTopic, payload, context, duration);
124
- return jobOutput.data.response;
125
- }
126
- };
127
- }
128
- }
@@ -1,82 +0,0 @@
1
- import { Activity } from '../activities/activity';
2
- import { ILogger } from '../logger';
3
- import { StoreSignaler } from '../signaler/store';
4
- import { StreamSignaler } from '../signaler/stream';
5
- import { StoreService } from '../store';
6
- import { StreamService } from '../stream';
7
- import { SubService } from '../sub';
8
- import { TaskService } from '../task';
9
- import { AppVID } from '../../types/app';
10
- import { ActivityType } from '../../types/activity';
11
- import { CacheMode } from '../../types/cache';
12
- import { JobState, JobData, JobMetadata, JobOutput, JobStatus } from '../../types/job';
13
- import { HotMeshApps, HotMeshConfig, HotMeshManifest, HotMeshSettings } from '../../types/hotmesh';
14
- import { JobMessageCallback } from '../../types/quorum';
15
- import { RedisClient, RedisMulti } from '../../types/redis';
16
- import { GetStatsOptions, IdsResponse, JobStatsInput, StatsResponse } from '../../types/stats';
17
- import { StreamData, StreamDataResponse, StreamError } from '../../types/stream';
18
- declare class EngineService {
19
- namespace: string;
20
- apps: HotMeshApps | null;
21
- appId: string;
22
- guid: string;
23
- store: StoreService<RedisClient, RedisMulti> | null;
24
- stream: StreamService<RedisClient, RedisMulti> | null;
25
- subscribe: SubService<RedisClient, RedisMulti> | null;
26
- storeSignaler: StoreSignaler | null;
27
- streamSignaler: StreamSignaler | null;
28
- task: TaskService | null;
29
- logger: ILogger;
30
- cacheMode: CacheMode;
31
- untilVersion: string | null;
32
- jobCallbacks: Record<string, JobMessageCallback>;
33
- reporting: boolean;
34
- jobId: number;
35
- static init(namespace: string, appId: string, guid: string, config: HotMeshConfig, logger: ILogger): Promise<EngineService>;
36
- verifyEngineFields(config: HotMeshConfig): void;
37
- initStoreChannel(store: RedisClient): Promise<void>;
38
- initSubChannel(sub: RedisClient): Promise<void>;
39
- initStreamChannel(stream: RedisClient): Promise<void>;
40
- initStreamSignaler(config: HotMeshConfig): StreamSignaler;
41
- getVID(vid?: AppVID): Promise<AppVID>;
42
- setCacheMode(cacheMode: CacheMode, untilVersion: string): void;
43
- routeToSubscribers(topic: string, message: JobOutput): Promise<void>;
44
- processWebHooks(): Promise<void>;
45
- processTimeHooks(): Promise<void>;
46
- throttle(delayInMillis: number): Promise<void>;
47
- initActivity(topic: string, data?: JobData, context?: JobState): Promise<Activity>;
48
- getSchema(topic: string): Promise<[activityId: string, schema: ActivityType]>;
49
- getSettings(): Promise<HotMeshSettings>;
50
- isPrivate(topic: string): boolean;
51
- plan(pathOrYAML: string): Promise<HotMeshManifest>;
52
- deploy(pathOrYAML: string): Promise<HotMeshManifest>;
53
- getStats(topic: string, query: JobStatsInput): Promise<StatsResponse>;
54
- getIds(topic: string, query: JobStatsInput, queryFacets?: any[]): Promise<IdsResponse>;
55
- resolveQuery(topic: string, query: JobStatsInput): Promise<GetStatsOptions>;
56
- processStreamMessage(streamData: StreamDataResponse): Promise<void>;
57
- execAdjacentParent(context: JobState, jobOutput: JobOutput): Promise<string>;
58
- hasParentJob(context: JobState): boolean;
59
- resolveError(metadata: JobMetadata): StreamError | undefined;
60
- scrub(jobId: string): Promise<void>;
61
- hook(topic: string, data: JobData, dad?: string): Promise<JobStatus | void>;
62
- hookTime(jobId: string, activityId: string): Promise<JobStatus | void>;
63
- hookAll(hookTopic: string, data: JobData, query: JobStatsInput, queryFacets?: string[]): Promise<string[]>;
64
- pub(topic: string, data: JobData, context?: JobState): Promise<string>;
65
- sub(topic: string, callback: JobMessageCallback): Promise<void>;
66
- unsub(topic: string): Promise<void>;
67
- psub(wild: string, callback: JobMessageCallback): Promise<void>;
68
- punsub(wild: string): Promise<void>;
69
- pubsub(topic: string, data: JobData, context?: JobState | null, timeout?: number): Promise<JobOutput>;
70
- resolveOneTimeSubscription(context: JobState, jobOutput: JobOutput): Promise<void>;
71
- getPublishesTopic(context: JobState): Promise<string>;
72
- resolvePersistentSubscriptions(context: JobState, jobOutput: JobOutput): Promise<void>;
73
- add(streamData: StreamData | StreamDataResponse): Promise<string>;
74
- registerJobCallback(jobId: string, jobCallback: JobMessageCallback): void;
75
- delistJobCallback(jobId: string): void;
76
- hasOneTimeSubscription(context: JobState): boolean;
77
- runJobCompletionTasks(context: JobState): Promise<void>;
78
- getStatus(jobId: string): Promise<JobStatus>;
79
- getState(topic: string, jobId: string): Promise<JobOutput>;
80
- compress(terms: string[]): Promise<boolean>;
81
- }
82
- export { EngineService };