@hotmeshio/hotmesh 0.0.4 → 0.0.6

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/README.md +2 -2
  2. package/build/{package.json → cjs/package.json} +12 -5
  3. package/build/{services → cjs/services}/activities/trigger.js +2 -2
  4. package/build/{services → cjs/services}/connector/index.js +3 -3
  5. package/build/{services → cjs/services}/durable/client.js +2 -2
  6. package/build/{services → cjs/services}/durable/connection.js +2 -2
  7. package/build/{services → cjs/services}/durable/worker.d.ts +1 -0
  8. package/build/{services → cjs/services}/durable/worker.js +13 -3
  9. package/build/{services → cjs/services}/hotmesh/index.js +2 -2
  10. package/build/{services → cjs/services}/mapper/index.d.ts +3 -3
  11. package/build/{services → cjs/services}/store/index.js +1 -1
  12. package/build/esm/index.d.ts +4 -0
  13. package/build/esm/index.js +3 -0
  14. package/build/esm/modules/errors.d.ts +28 -0
  15. package/build/esm/modules/errors.js +41 -0
  16. package/build/esm/modules/key.d.ts +75 -0
  17. package/build/esm/modules/key.js +111 -0
  18. package/build/esm/modules/utils.d.ts +34 -0
  19. package/build/esm/modules/utils.js +154 -0
  20. package/build/esm/package.json +80 -0
  21. package/build/esm/services/activities/activity.d.ts +61 -0
  22. package/build/esm/services/activities/activity.js +411 -0
  23. package/build/esm/services/activities/await.d.ts +16 -0
  24. package/build/esm/services/activities/await.js +140 -0
  25. package/build/esm/services/activities/emit.d.ts +9 -0
  26. package/build/esm/services/activities/emit.js +10 -0
  27. package/build/esm/services/activities/index.d.ts +15 -0
  28. package/build/esm/services/activities/index.js +14 -0
  29. package/build/esm/services/activities/iterate.d.ts +9 -0
  30. package/build/esm/services/activities/iterate.js +10 -0
  31. package/build/esm/services/activities/trigger.d.ts +22 -0
  32. package/build/esm/services/activities/trigger.js +158 -0
  33. package/build/esm/services/activities/worker.d.ts +17 -0
  34. package/build/esm/services/activities/worker.js +162 -0
  35. package/build/esm/services/collator/index.d.ts +56 -0
  36. package/build/esm/services/collator/index.js +191 -0
  37. package/build/esm/services/compiler/deployer.d.ts +36 -0
  38. package/build/esm/services/compiler/deployer.js +423 -0
  39. package/build/esm/services/compiler/index.d.ts +30 -0
  40. package/build/esm/services/compiler/index.js +82 -0
  41. package/build/esm/services/compiler/validator.d.ts +32 -0
  42. package/build/esm/services/compiler/validator.js +131 -0
  43. package/build/esm/services/connector/clients/ioredis.d.ts +13 -0
  44. package/build/esm/services/connector/clients/ioredis.js +47 -0
  45. package/build/esm/services/connector/clients/redis.d.ts +13 -0
  46. package/build/esm/services/connector/clients/redis.js +59 -0
  47. package/build/esm/services/connector/index.d.ts +5 -0
  48. package/build/esm/services/connector/index.js +27 -0
  49. package/build/esm/services/dimension/index.d.ts +29 -0
  50. package/build/esm/services/dimension/index.js +32 -0
  51. package/build/esm/services/durable/asyncLocalStorage.d.ts +3 -0
  52. package/build/esm/services/durable/asyncLocalStorage.js +2 -0
  53. package/build/esm/services/durable/client.d.ts +15 -0
  54. package/build/esm/services/durable/client.js +114 -0
  55. package/build/esm/services/durable/connection.d.ts +4 -0
  56. package/build/esm/services/durable/connection.js +47 -0
  57. package/build/esm/services/durable/factory.d.ts +3 -0
  58. package/build/esm/services/durable/factory.js +119 -0
  59. package/build/esm/services/durable/handle.d.ts +8 -0
  60. package/build/esm/services/durable/handle.js +34 -0
  61. package/build/esm/services/durable/index.d.ts +57 -0
  62. package/build/esm/services/durable/index.js +55 -0
  63. package/build/esm/services/durable/native.d.ts +4 -0
  64. package/build/esm/services/durable/native.js +43 -0
  65. package/build/esm/services/durable/worker.d.ts +37 -0
  66. package/build/esm/services/durable/worker.js +268 -0
  67. package/build/esm/services/durable/workflow.d.ts +6 -0
  68. package/build/esm/services/durable/workflow.js +128 -0
  69. package/build/esm/services/engine/index.d.ts +82 -0
  70. package/build/esm/services/engine/index.js +522 -0
  71. package/build/esm/services/hotmesh/index.d.ts +45 -0
  72. package/build/esm/services/hotmesh/index.js +131 -0
  73. package/build/esm/services/logger/index.d.ts +17 -0
  74. package/build/esm/services/logger/index.js +70 -0
  75. package/build/esm/services/mapper/index.d.ts +24 -0
  76. package/build/esm/services/mapper/index.js +69 -0
  77. package/build/esm/services/pipe/functions/array.d.ts +24 -0
  78. package/build/esm/services/pipe/functions/array.js +66 -0
  79. package/build/esm/services/pipe/functions/bitwise.d.ts +9 -0
  80. package/build/esm/services/pipe/functions/bitwise.js +21 -0
  81. package/build/esm/services/pipe/functions/conditional.d.ts +10 -0
  82. package/build/esm/services/pipe/functions/conditional.js +24 -0
  83. package/build/esm/services/pipe/functions/date.d.ts +57 -0
  84. package/build/esm/services/pipe/functions/date.js +164 -0
  85. package/build/esm/services/pipe/functions/index.d.ts +25 -0
  86. package/build/esm/services/pipe/functions/index.js +24 -0
  87. package/build/esm/services/pipe/functions/json.d.ts +5 -0
  88. package/build/esm/services/pipe/functions/json.js +9 -0
  89. package/build/esm/services/pipe/functions/math.d.ts +38 -0
  90. package/build/esm/services/pipe/functions/math.js +108 -0
  91. package/build/esm/services/pipe/functions/number.d.ts +25 -0
  92. package/build/esm/services/pipe/functions/number.js +130 -0
  93. package/build/esm/services/pipe/functions/object.d.ts +22 -0
  94. package/build/esm/services/pipe/functions/object.js +60 -0
  95. package/build/esm/services/pipe/functions/string.d.ts +23 -0
  96. package/build/esm/services/pipe/functions/string.js +66 -0
  97. package/build/esm/services/pipe/functions/symbol.d.ts +12 -0
  98. package/build/esm/services/pipe/functions/symbol.js +30 -0
  99. package/build/esm/services/pipe/functions/unary.d.ts +7 -0
  100. package/build/esm/services/pipe/functions/unary.js +15 -0
  101. package/build/esm/services/pipe/index.d.ts +30 -0
  102. package/build/esm/services/pipe/index.js +122 -0
  103. package/build/esm/services/quorum/index.d.ts +34 -0
  104. package/build/esm/services/quorum/index.js +144 -0
  105. package/build/esm/services/reporter/index.d.ts +47 -0
  106. package/build/esm/services/reporter/index.js +327 -0
  107. package/build/esm/services/serializer/index.d.ts +41 -0
  108. package/build/esm/services/serializer/index.js +251 -0
  109. package/build/esm/services/signaler/store.d.ts +15 -0
  110. package/build/esm/services/signaler/store.js +50 -0
  111. package/build/esm/services/signaler/stream.d.ts +43 -0
  112. package/build/esm/services/signaler/stream.js +315 -0
  113. package/build/esm/services/store/cache.d.ts +66 -0
  114. package/build/esm/services/store/cache.js +124 -0
  115. package/build/esm/services/store/clients/ioredis.d.ts +27 -0
  116. package/build/esm/services/store/clients/ioredis.js +93 -0
  117. package/build/esm/services/store/clients/redis.d.ts +29 -0
  118. package/build/esm/services/store/clients/redis.js +140 -0
  119. package/build/esm/services/store/index.d.ts +88 -0
  120. package/build/esm/services/store/index.js +623 -0
  121. package/build/esm/services/stream/clients/ioredis.d.ts +23 -0
  122. package/build/esm/services/stream/clients/ioredis.js +112 -0
  123. package/build/esm/services/stream/clients/redis.d.ts +23 -0
  124. package/build/esm/services/stream/clients/redis.js +116 -0
  125. package/build/esm/services/stream/index.d.ts +21 -0
  126. package/build/esm/services/stream/index.js +6 -0
  127. package/build/esm/services/sub/clients/ioredis.d.ts +20 -0
  128. package/build/esm/services/sub/clients/ioredis.js +69 -0
  129. package/build/esm/services/sub/clients/redis.d.ts +20 -0
  130. package/build/esm/services/sub/clients/redis.js +60 -0
  131. package/build/esm/services/sub/index.d.ts +18 -0
  132. package/build/esm/services/sub/index.js +6 -0
  133. package/build/esm/services/task/index.d.ts +18 -0
  134. package/build/esm/services/task/index.js +70 -0
  135. package/build/esm/services/telemetry/index.d.ts +49 -0
  136. package/build/esm/services/telemetry/index.js +217 -0
  137. package/build/esm/services/worker/index.d.ts +30 -0
  138. package/build/esm/services/worker/index.js +102 -0
  139. package/build/esm/types/activity.d.ts +87 -0
  140. package/build/esm/types/activity.js +1 -0
  141. package/build/esm/types/app.d.ts +16 -0
  142. package/build/esm/types/app.js +1 -0
  143. package/build/esm/types/async.d.ts +5 -0
  144. package/build/esm/types/async.js +1 -0
  145. package/build/esm/types/cache.d.ts +1 -0
  146. package/build/esm/types/cache.js +1 -0
  147. package/build/esm/types/collator.d.ts +8 -0
  148. package/build/esm/types/collator.js +8 -0
  149. package/build/esm/types/durable.d.ts +59 -0
  150. package/build/esm/types/durable.js +1 -0
  151. package/build/esm/types/hook.d.ts +31 -0
  152. package/build/esm/types/hook.js +6 -0
  153. package/build/esm/types/hotmesh.d.ts +82 -0
  154. package/build/esm/types/hotmesh.js +1 -0
  155. package/build/esm/types/index.d.ts +20 -0
  156. package/build/esm/types/index.js +5 -0
  157. package/build/esm/types/ioredisclient.d.ts +5 -0
  158. package/build/esm/types/ioredisclient.js +2 -0
  159. package/build/esm/types/job.d.ts +50 -0
  160. package/build/esm/types/job.js +1 -0
  161. package/build/esm/types/logger.d.ts +6 -0
  162. package/build/esm/types/logger.js +1 -0
  163. package/build/esm/types/map.d.ts +4 -0
  164. package/build/esm/types/map.js +1 -0
  165. package/build/esm/types/pipe.d.ts +4 -0
  166. package/build/esm/types/pipe.js +1 -0
  167. package/build/esm/types/quorum.d.ts +46 -0
  168. package/build/esm/types/quorum.js +1 -0
  169. package/build/esm/types/redis.d.ts +8 -0
  170. package/build/esm/types/redis.js +1 -0
  171. package/build/esm/types/redisclient.d.ts +25 -0
  172. package/build/esm/types/redisclient.js +1 -0
  173. package/build/esm/types/serializer.d.ts +33 -0
  174. package/build/esm/types/serializer.js +1 -0
  175. package/build/esm/types/stats.d.ts +83 -0
  176. package/build/esm/types/stats.js +1 -0
  177. package/build/esm/types/stream.d.ts +67 -0
  178. package/build/esm/types/stream.js +22 -0
  179. package/build/esm/types/telemetry.d.ts +1 -0
  180. package/build/esm/types/telemetry.js +1 -0
  181. package/build/esm/types/transition.d.ts +17 -0
  182. package/build/esm/types/transition.js +1 -0
  183. package/package.json +12 -5
  184. package/services/activities/activity.ts +1 -1
  185. package/services/activities/trigger.ts +2 -2
  186. package/services/connector/index.ts +3 -3
  187. package/services/durable/client.ts +2 -2
  188. package/services/durable/connection.ts +2 -2
  189. package/services/durable/worker.ts +13 -3
  190. package/services/hotmesh/index.ts +2 -2
  191. package/services/mapper/index.ts +6 -7
  192. package/services/store/index.ts +3 -3
  193. package/tsconfig.cjs.json +8 -0
  194. package/tsconfig.esm.json +9 -0
  195. package/build/{index.d.ts → cjs/index.d.ts} +0 -0
  196. package/build/{index.js → cjs/index.js} +0 -0
  197. package/build/{modules → cjs/modules}/errors.d.ts +0 -0
  198. package/build/{modules → cjs/modules}/errors.js +0 -0
  199. package/build/{modules → cjs/modules}/key.d.ts +0 -0
  200. package/build/{modules → cjs/modules}/key.js +0 -0
  201. package/build/{modules → cjs/modules}/utils.d.ts +0 -0
  202. package/build/{modules → cjs/modules}/utils.js +0 -0
  203. package/build/{services → cjs/services}/activities/activity.d.ts +0 -0
  204. package/build/{services → cjs/services}/activities/activity.js +1 -1
  205. /package/build/{services → cjs/services}/activities/await.d.ts +0 -0
  206. /package/build/{services → cjs/services}/activities/await.js +0 -0
  207. /package/build/{services → cjs/services}/activities/emit.d.ts +0 -0
  208. /package/build/{services → cjs/services}/activities/emit.js +0 -0
  209. /package/build/{services → cjs/services}/activities/index.d.ts +0 -0
  210. /package/build/{services → cjs/services}/activities/index.js +0 -0
  211. /package/build/{services → cjs/services}/activities/iterate.d.ts +0 -0
  212. /package/build/{services → cjs/services}/activities/iterate.js +0 -0
  213. /package/build/{services → cjs/services}/activities/trigger.d.ts +0 -0
  214. /package/build/{services → cjs/services}/activities/worker.d.ts +0 -0
  215. /package/build/{services → cjs/services}/activities/worker.js +0 -0
  216. /package/build/{services → cjs/services}/collator/index.d.ts +0 -0
  217. /package/build/{services → cjs/services}/collator/index.js +0 -0
  218. /package/build/{services → cjs/services}/compiler/deployer.d.ts +0 -0
  219. /package/build/{services → cjs/services}/compiler/deployer.js +0 -0
  220. /package/build/{services → cjs/services}/compiler/index.d.ts +0 -0
  221. /package/build/{services → cjs/services}/compiler/index.js +0 -0
  222. /package/build/{services → cjs/services}/compiler/validator.d.ts +0 -0
  223. /package/build/{services → cjs/services}/compiler/validator.js +0 -0
  224. /package/build/{services → cjs/services}/connector/clients/ioredis.d.ts +0 -0
  225. /package/build/{services → cjs/services}/connector/clients/ioredis.js +0 -0
  226. /package/build/{services → cjs/services}/connector/clients/redis.d.ts +0 -0
  227. /package/build/{services → cjs/services}/connector/clients/redis.js +0 -0
  228. /package/build/{services → cjs/services}/connector/index.d.ts +0 -0
  229. /package/build/{services → cjs/services}/dimension/index.d.ts +0 -0
  230. /package/build/{services → cjs/services}/dimension/index.js +0 -0
  231. /package/build/{services → cjs/services}/durable/asyncLocalStorage.d.ts +0 -0
  232. /package/build/{services → cjs/services}/durable/asyncLocalStorage.js +0 -0
  233. /package/build/{services → cjs/services}/durable/client.d.ts +0 -0
  234. /package/build/{services → cjs/services}/durable/connection.d.ts +0 -0
  235. /package/build/{services → cjs/services}/durable/factory.d.ts +0 -0
  236. /package/build/{services → cjs/services}/durable/factory.js +0 -0
  237. /package/build/{services → cjs/services}/durable/handle.d.ts +0 -0
  238. /package/build/{services → cjs/services}/durable/handle.js +0 -0
  239. /package/build/{services → cjs/services}/durable/index.d.ts +0 -0
  240. /package/build/{services → cjs/services}/durable/index.js +0 -0
  241. /package/build/{services → cjs/services}/durable/native.d.ts +0 -0
  242. /package/build/{services → cjs/services}/durable/native.js +0 -0
  243. /package/build/{services → cjs/services}/durable/workflow.d.ts +0 -0
  244. /package/build/{services → cjs/services}/durable/workflow.js +0 -0
  245. /package/build/{services → cjs/services}/engine/index.d.ts +0 -0
  246. /package/build/{services → cjs/services}/engine/index.js +0 -0
  247. /package/build/{services → cjs/services}/hotmesh/index.d.ts +0 -0
  248. /package/build/{services → cjs/services}/logger/index.d.ts +0 -0
  249. /package/build/{services → cjs/services}/logger/index.js +0 -0
  250. /package/build/{services → cjs/services}/mapper/index.js +0 -0
  251. /package/build/{services → cjs/services}/pipe/functions/array.d.ts +0 -0
  252. /package/build/{services → cjs/services}/pipe/functions/array.js +0 -0
  253. /package/build/{services → cjs/services}/pipe/functions/bitwise.d.ts +0 -0
  254. /package/build/{services → cjs/services}/pipe/functions/bitwise.js +0 -0
  255. /package/build/{services → cjs/services}/pipe/functions/conditional.d.ts +0 -0
  256. /package/build/{services → cjs/services}/pipe/functions/conditional.js +0 -0
  257. /package/build/{services → cjs/services}/pipe/functions/date.d.ts +0 -0
  258. /package/build/{services → cjs/services}/pipe/functions/date.js +0 -0
  259. /package/build/{services → cjs/services}/pipe/functions/index.d.ts +0 -0
  260. /package/build/{services → cjs/services}/pipe/functions/index.js +0 -0
  261. /package/build/{services → cjs/services}/pipe/functions/json.d.ts +0 -0
  262. /package/build/{services → cjs/services}/pipe/functions/json.js +0 -0
  263. /package/build/{services → cjs/services}/pipe/functions/math.d.ts +0 -0
  264. /package/build/{services → cjs/services}/pipe/functions/math.js +0 -0
  265. /package/build/{services → cjs/services}/pipe/functions/number.d.ts +0 -0
  266. /package/build/{services → cjs/services}/pipe/functions/number.js +0 -0
  267. /package/build/{services → cjs/services}/pipe/functions/object.d.ts +0 -0
  268. /package/build/{services → cjs/services}/pipe/functions/object.js +0 -0
  269. /package/build/{services → cjs/services}/pipe/functions/string.d.ts +0 -0
  270. /package/build/{services → cjs/services}/pipe/functions/string.js +0 -0
  271. /package/build/{services → cjs/services}/pipe/functions/symbol.d.ts +0 -0
  272. /package/build/{services → cjs/services}/pipe/functions/symbol.js +0 -0
  273. /package/build/{services → cjs/services}/pipe/functions/unary.d.ts +0 -0
  274. /package/build/{services → cjs/services}/pipe/functions/unary.js +0 -0
  275. /package/build/{services → cjs/services}/pipe/index.d.ts +0 -0
  276. /package/build/{services → cjs/services}/pipe/index.js +0 -0
  277. /package/build/{services → cjs/services}/quorum/index.d.ts +0 -0
  278. /package/build/{services → cjs/services}/quorum/index.js +0 -0
  279. /package/build/{services → cjs/services}/reporter/index.d.ts +0 -0
  280. /package/build/{services → cjs/services}/reporter/index.js +0 -0
  281. /package/build/{services → cjs/services}/serializer/index.d.ts +0 -0
  282. /package/build/{services → cjs/services}/serializer/index.js +0 -0
  283. /package/build/{services → cjs/services}/signaler/store.d.ts +0 -0
  284. /package/build/{services → cjs/services}/signaler/store.js +0 -0
  285. /package/build/{services → cjs/services}/signaler/stream.d.ts +0 -0
  286. /package/build/{services → cjs/services}/signaler/stream.js +0 -0
  287. /package/build/{services → cjs/services}/store/cache.d.ts +0 -0
  288. /package/build/{services → cjs/services}/store/cache.js +0 -0
  289. /package/build/{services → cjs/services}/store/clients/ioredis.d.ts +0 -0
  290. /package/build/{services → cjs/services}/store/clients/ioredis.js +0 -0
  291. /package/build/{services → cjs/services}/store/clients/redis.d.ts +0 -0
  292. /package/build/{services → cjs/services}/store/clients/redis.js +0 -0
  293. /package/build/{services → cjs/services}/store/index.d.ts +0 -0
  294. /package/build/{services → cjs/services}/stream/clients/ioredis.d.ts +0 -0
  295. /package/build/{services → cjs/services}/stream/clients/ioredis.js +0 -0
  296. /package/build/{services → cjs/services}/stream/clients/redis.d.ts +0 -0
  297. /package/build/{services → cjs/services}/stream/clients/redis.js +0 -0
  298. /package/build/{services → cjs/services}/stream/index.d.ts +0 -0
  299. /package/build/{services → cjs/services}/stream/index.js +0 -0
  300. /package/build/{services → cjs/services}/sub/clients/ioredis.d.ts +0 -0
  301. /package/build/{services → cjs/services}/sub/clients/ioredis.js +0 -0
  302. /package/build/{services → cjs/services}/sub/clients/redis.d.ts +0 -0
  303. /package/build/{services → cjs/services}/sub/clients/redis.js +0 -0
  304. /package/build/{services → cjs/services}/sub/index.d.ts +0 -0
  305. /package/build/{services → cjs/services}/sub/index.js +0 -0
  306. /package/build/{services → cjs/services}/task/index.d.ts +0 -0
  307. /package/build/{services → cjs/services}/task/index.js +0 -0
  308. /package/build/{services → cjs/services}/telemetry/index.d.ts +0 -0
  309. /package/build/{services → cjs/services}/telemetry/index.js +0 -0
  310. /package/build/{services → cjs/services}/worker/index.d.ts +0 -0
  311. /package/build/{services → cjs/services}/worker/index.js +0 -0
  312. /package/build/{types → cjs/types}/activity.d.ts +0 -0
  313. /package/build/{types → cjs/types}/activity.js +0 -0
  314. /package/build/{types → cjs/types}/app.d.ts +0 -0
  315. /package/build/{types → cjs/types}/app.js +0 -0
  316. /package/build/{types → cjs/types}/async.d.ts +0 -0
  317. /package/build/{types → cjs/types}/async.js +0 -0
  318. /package/build/{types → cjs/types}/cache.d.ts +0 -0
  319. /package/build/{types → cjs/types}/cache.js +0 -0
  320. /package/build/{types → cjs/types}/collator.d.ts +0 -0
  321. /package/build/{types → cjs/types}/collator.js +0 -0
  322. /package/build/{types → cjs/types}/durable.d.ts +0 -0
  323. /package/build/{types → cjs/types}/durable.js +0 -0
  324. /package/build/{types → cjs/types}/hook.d.ts +0 -0
  325. /package/build/{types → cjs/types}/hook.js +0 -0
  326. /package/build/{types → cjs/types}/hotmesh.d.ts +0 -0
  327. /package/build/{types → cjs/types}/hotmesh.js +0 -0
  328. /package/build/{types → cjs/types}/index.d.ts +0 -0
  329. /package/build/{types → cjs/types}/index.js +0 -0
  330. /package/build/{types → cjs/types}/ioredisclient.d.ts +0 -0
  331. /package/build/{types → cjs/types}/ioredisclient.js +0 -0
  332. /package/build/{types → cjs/types}/job.d.ts +0 -0
  333. /package/build/{types → cjs/types}/job.js +0 -0
  334. /package/build/{types → cjs/types}/logger.d.ts +0 -0
  335. /package/build/{types → cjs/types}/logger.js +0 -0
  336. /package/build/{types → cjs/types}/map.d.ts +0 -0
  337. /package/build/{types → cjs/types}/map.js +0 -0
  338. /package/build/{types → cjs/types}/pipe.d.ts +0 -0
  339. /package/build/{types → cjs/types}/pipe.js +0 -0
  340. /package/build/{types → cjs/types}/quorum.d.ts +0 -0
  341. /package/build/{types → cjs/types}/quorum.js +0 -0
  342. /package/build/{types → cjs/types}/redis.d.ts +0 -0
  343. /package/build/{types → cjs/types}/redis.js +0 -0
  344. /package/build/{types → cjs/types}/redisclient.d.ts +0 -0
  345. /package/build/{types → cjs/types}/redisclient.js +0 -0
  346. /package/build/{types → cjs/types}/serializer.d.ts +0 -0
  347. /package/build/{types → cjs/types}/serializer.js +0 -0
  348. /package/build/{types → cjs/types}/stats.d.ts +0 -0
  349. /package/build/{types → cjs/types}/stats.js +0 -0
  350. /package/build/{types → cjs/types}/stream.d.ts +0 -0
  351. /package/build/{types → cjs/types}/stream.js +0 -0
  352. /package/build/{types → cjs/types}/telemetry.d.ts +0 -0
  353. /package/build/{types → cjs/types}/telemetry.js +0 -0
  354. /package/build/{types → cjs/types}/transition.d.ts +0 -0
  355. /package/build/{types → cjs/types}/transition.js +0 -0
@@ -0,0 +1,20 @@
1
+ export { ActivityType, ActivityDataType, ActivityContext, ActivityData, ActivityDuplex, ActivityLeg, ActivityMetadata, Consumes, AwaitActivity, BaseActivity, EmitActivity, WorkerActivity, IterateActivity, TriggerActivity, TriggerActivityStats } from './activity';
2
+ export { App, AppVID, AppTransitions, AppSubscriptions } from './app';
3
+ export { AsyncSignal } from './async';
4
+ export { CacheMode } from './cache';
5
+ export { CollationFaultType, CollationStage } from './collator';
6
+ export { HookCondition, HookConditions, HookGate, HookInterface, HookRule, HookRules, HookSignal } from './hook';
7
+ export { RedisClientType as IORedisClientType, RedisMultiType as IORedisMultiType } from './ioredisclient';
8
+ export { ILogger } from './logger';
9
+ export { JobData, JobsData, JobMetadata, JobOutput, JobState, JobStatus, PartialJobState } from './job';
10
+ export { MappingStatements } from './map';
11
+ export { Pipe, PipeItem, PipeItems } from './pipe';
12
+ export { HotMesh, HotMeshApp, HotMeshApps, HotMeshConfig, HotMeshEngine, RedisConfig, HotMeshGraph, HotMeshManifest, HotMeshSettings, HotMeshWorker } from './hotmesh';
13
+ export { ActivateMessage, JobMessage, JobMessageCallback, PingMessage, PongMessage, QuorumMessage, SubscriptionCallback, ThrottleMessage, WorkMessage } from './quorum';
14
+ export { MultiResponseFlags, RedisClient, RedisMulti } from './redis';
15
+ export { RedisClientType, RedisMultiType } from './redisclient';
16
+ export { JSONSchema, StringAnyType, StringScalarType, StringStringType, SymbolMap, SymbolMaps, SymbolRanges, Symbols, SymbolSets } from './serializer';
17
+ export { AggregatedData, CountByFacet, GetStatsOptions, IdsData, Measure, MeasureIds, MetricTypes, StatType, StatsType, IdsResponse, JobStats, JobStatsInput, JobStatsRange, StatsResponse, Segment, TimeSegment } from './stats';
18
+ export { ReclaimedMessageType, StreamCode, StreamConfig, StreamData, StreamDataType, StreamError, StreamDataResponse, StreamRetryPolicy, StreamRole, StreamStatus } from './stream';
19
+ export { context, Context, Counter, Meter, metrics, propagation, SpanContext, Span, SpanStatus, SpanStatusCode, SpanKind, trace, Tracer, ValueType } from './telemetry';
20
+ export { TransitionMatch, TransitionRule, Transitions } from './transition';
@@ -0,0 +1,5 @@
1
+ export { CollationFaultType } from './collator';
2
+ export { HookGate } from './hook';
3
+ export { RedisClientType as IORedisClientType } from './ioredisclient';
4
+ export { StreamDataType, StreamRole, StreamStatus } from './stream';
5
+ export { context, metrics, propagation, SpanStatusCode, SpanKind, trace, ValueType } from './telemetry';
@@ -0,0 +1,5 @@
1
+ import { Redis, ChainableCommander, RedisOptions } from 'ioredis';
2
+ type RedisClassType = {
3
+ new (options: RedisOptions): Redis;
4
+ };
5
+ export { RedisClassType, Redis as RedisClientType, ChainableCommander as RedisMultiType, RedisOptions as RedisClientOptions, };
@@ -0,0 +1,2 @@
1
+ import { Redis } from 'ioredis';
2
+ export { Redis as RedisClientType, };
@@ -0,0 +1,50 @@
1
+ type JobData = Record<string, unknown | Record<string, unknown>>;
2
+ type JobsData = Record<string, unknown>;
3
+ type ActivityData = {
4
+ data: Record<string, unknown>;
5
+ metadata?: Record<string, unknown>;
6
+ };
7
+ type JobMetadata = {
8
+ key?: string;
9
+ jid: string;
10
+ dad: string;
11
+ aid: string;
12
+ pj?: string;
13
+ pd?: string;
14
+ pa?: string;
15
+ ngn?: string;
16
+ app: string;
17
+ vrs: string;
18
+ tpc: string;
19
+ ts: string;
20
+ jc: string;
21
+ ju: string;
22
+ js: JobStatus;
23
+ atp: string;
24
+ stp: string;
25
+ spn: string;
26
+ trc: string;
27
+ err?: string;
28
+ expire?: number;
29
+ };
30
+ type JobStatus = number;
31
+ type JobState = {
32
+ metadata: JobMetadata;
33
+ data: JobData;
34
+ [activityId: symbol]: {
35
+ input: ActivityData;
36
+ output: ActivityData;
37
+ hook: ActivityData;
38
+ settings: ActivityData;
39
+ errors: ActivityData;
40
+ };
41
+ };
42
+ type JobOutput = {
43
+ metadata: JobMetadata;
44
+ data: JobData;
45
+ };
46
+ type PartialJobState = {
47
+ metadata: JobMetadata | Pick<JobMetadata, 'jid' | 'dad' | 'aid'>;
48
+ data: JobData;
49
+ };
50
+ export { JobState, JobStatus, JobData, JobsData, JobMetadata, PartialJobState, JobOutput };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface ILogger {
2
+ info(message: string, ...meta: any[]): void;
3
+ error(message: string, ...meta: any[]): void;
4
+ warn(message: string, ...meta: any[]): void;
5
+ debug(message: string, ...meta: any[]): void;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ type MappingStatements = {
2
+ [activityId: string]: string[];
3
+ };
4
+ export { MappingStatements };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ type PipeItem = string | boolean | number | null;
2
+ type PipeItems = PipeItem[];
3
+ type Pipe = (PipeItem[] | Pipe)[];
4
+ export { Pipe, PipeItem, PipeItems };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,46 @@
1
+ import { JobOutput } from "./job";
2
+ /**
3
+ * The types in this file are used to define those messages that are sent
4
+ * to hotmesh client instances when a new version is about to be activated.
5
+ * These messages serve to coordinate the cache invalidation and switch-over
6
+ * to the new version without any downtime and a coordinating parent server.
7
+ */
8
+ export type QuorumMessage = PingMessage | PongMessage | ActivateMessage | WorkMessage | JobMessage | ThrottleMessage;
9
+ export interface PingMessage {
10
+ type: 'ping';
11
+ originator: string;
12
+ }
13
+ export interface WorkMessage {
14
+ type: 'work';
15
+ originator: string;
16
+ }
17
+ export interface PongMessage {
18
+ type: 'pong';
19
+ originator: string;
20
+ guid: string;
21
+ }
22
+ export interface ActivateMessage {
23
+ type: 'activate';
24
+ cache_mode: 'nocache' | 'cache';
25
+ until_version: string;
26
+ }
27
+ export interface JobMessage {
28
+ type: 'job';
29
+ topic: string;
30
+ job: JobOutput;
31
+ }
32
+ export interface ThrottleMessage {
33
+ type: 'throttle';
34
+ guid?: string;
35
+ topic?: string;
36
+ throttle: number;
37
+ }
38
+ export interface JobMessageCallback {
39
+ (topic: string, message: JobOutput): void;
40
+ }
41
+ export interface SubscriptionCallback {
42
+ (topic: string, message: Record<string, any>): void;
43
+ }
44
+ export interface QuorumMessageCallback {
45
+ (topic: string, message: QuorumMessage): void;
46
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { RedisClassType, RedisClientType as RCT, RedisMultiType as RMT, RedisClientOptions as RCO } from './redisclient';
2
+ import { RedisClassType as IORRedisClassType, RedisClientType as IORCT, RedisMultiType as IORMT, RedisClientOptions as IORCO } from './ioredisclient';
3
+ type RedisClass = RedisClassType | IORRedisClassType;
4
+ type RedisClient = RCT | IORCT;
5
+ type RedisMulti = RMT | IORMT;
6
+ type RedisOptions = RCO | IORCO;
7
+ type MultiResponseFlags = (string | number)[];
8
+ export { RedisClass, RedisClient, RedisMulti, RedisOptions, MultiResponseFlags, };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import { createClient, RedisClientOptions } from 'redis';
2
+ type RedisClientType = ReturnType<typeof createClient>;
3
+ interface RedisMultiType {
4
+ XADD(key: string, id: string, fields: any): this;
5
+ XACK(key: string, group: string, id: string): this;
6
+ XDEL(key: string, id: string): this;
7
+ HDEL(key: string, itemId: string): this;
8
+ HGET(key: string, itemId: string): this;
9
+ HGETALL(key: string): this;
10
+ HINCRBYFLOAT(key: string, itemId: string, value: number): this;
11
+ HMGET(key: string, itemIds: string[]): this;
12
+ HSET(key: string, values: Record<string, string>): this;
13
+ LRANGE(key: string, start: number, end: number): this;
14
+ RPUSH(key: string, value: string): this;
15
+ ZADD(key: string, values: {
16
+ score: string;
17
+ value: string;
18
+ }): this;
19
+ sendCommand(command: string[]): Promise<any>;
20
+ exec: () => Promise<unknown[]>;
21
+ }
22
+ type RedisClassType = {
23
+ createClient: (options: RedisClientOptions) => any;
24
+ };
25
+ export { RedisClassType, RedisClientType, RedisMultiType, RedisClientOptions, };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ export interface JSONSchema {
2
+ type?: string;
3
+ enum?: string[];
4
+ examples?: any[];
5
+ properties?: {
6
+ [key: string]: JSONSchema;
7
+ };
8
+ items?: JSONSchema;
9
+ description?: string;
10
+ 'x-train'?: boolean;
11
+ }
12
+ export type SymbolRanges = {
13
+ [key: string]: number;
14
+ };
15
+ export type Symbols = {
16
+ [key: string]: string;
17
+ };
18
+ export type SymbolSets = {
19
+ [key: string]: {
20
+ [key: string]: string;
21
+ };
22
+ };
23
+ export type StringStringType = {
24
+ [key: string]: string;
25
+ };
26
+ export type StringAnyType = {
27
+ [key: string]: any;
28
+ };
29
+ export type StringScalarType = {
30
+ [key: string]: boolean | number | string;
31
+ };
32
+ export type SymbolMap = Map<string, string>;
33
+ export type SymbolMaps = Map<string, SymbolMap>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,83 @@
1
+ type MetricTypes = 'count' | 'sum' | 'avg' | 'mdn' | 'max' | 'min' | 'index';
2
+ interface StatType {
3
+ target: string;
4
+ metric: MetricTypes;
5
+ value: number | string;
6
+ }
7
+ interface Measure {
8
+ target: string;
9
+ type: string;
10
+ value: number;
11
+ }
12
+ interface Segment {
13
+ time: string;
14
+ count: number;
15
+ measures: Measure[];
16
+ }
17
+ interface StatsType {
18
+ general: StatType[];
19
+ index: StatType[];
20
+ median: StatType[];
21
+ }
22
+ interface JobStats {
23
+ count?: number;
24
+ [field: string]: number;
25
+ }
26
+ interface JobStatsRange {
27
+ [key: string]: JobStats;
28
+ }
29
+ interface JobStatsInput {
30
+ data: Record<string, unknown>;
31
+ range?: string;
32
+ start?: string;
33
+ end?: string;
34
+ sparse?: boolean;
35
+ }
36
+ interface GetStatsOptions {
37
+ key: string;
38
+ granularity: string;
39
+ range?: string;
40
+ start?: string;
41
+ end?: string;
42
+ sparse?: boolean;
43
+ }
44
+ interface StatsResponse {
45
+ key: string;
46
+ granularity: string;
47
+ range: string;
48
+ end: string | Date;
49
+ count: number;
50
+ measures: Measure[];
51
+ segments?: Segment[];
52
+ }
53
+ interface AggregatedData {
54
+ [key: string]: number;
55
+ }
56
+ interface IdsData {
57
+ [target: string]: string[];
58
+ }
59
+ interface MeasureIds {
60
+ time: string;
61
+ target: string;
62
+ count: number;
63
+ type: 'ids';
64
+ ids: string[];
65
+ }
66
+ interface TimeSegment {
67
+ time: string;
68
+ measures: MeasureIds[];
69
+ }
70
+ interface CountByFacet {
71
+ facet: string;
72
+ count: number;
73
+ }
74
+ interface IdsResponse {
75
+ key: string;
76
+ facets: string[];
77
+ granularity: string;
78
+ range: string;
79
+ start: string;
80
+ counts: CountByFacet[];
81
+ segments: TimeSegment[];
82
+ }
83
+ export { StatsType, StatType, MetricTypes, JobStats, JobStatsRange, JobStatsInput, GetStatsOptions, StatsResponse, AggregatedData, Measure, Segment, IdsData, MeasureIds, TimeSegment, IdsResponse, CountByFacet };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,67 @@
1
+ export interface StreamRetryPolicy {
2
+ [key: string]: [number, 'x'];
3
+ }
4
+ export type StreamCode = number;
5
+ export type StreamError = {
6
+ message: string;
7
+ code: number;
8
+ job_id?: string;
9
+ stack?: string;
10
+ name?: string;
11
+ error?: Record<string, unknown>;
12
+ };
13
+ export declare enum StreamStatus {
14
+ SUCCESS = "success",
15
+ ERROR = "error",
16
+ PENDING = "pending"
17
+ }
18
+ export declare enum StreamDataType {
19
+ TIMEHOOK = "timehook",
20
+ WEBHOOK = "webhook",
21
+ AWAIT = "await",
22
+ RESULT = "result",
23
+ WORKER = "worker",
24
+ RESPONSE = "response",
25
+ TRANSITION = "transition"
26
+ }
27
+ export interface StreamData {
28
+ metadata: {
29
+ topic?: string;
30
+ jid?: string;
31
+ dad?: string;
32
+ aid: string;
33
+ trc?: string;
34
+ spn?: string;
35
+ try?: number;
36
+ };
37
+ type?: StreamDataType;
38
+ data: Record<string, unknown>;
39
+ policies?: {
40
+ retry?: StreamRetryPolicy;
41
+ };
42
+ status?: StreamStatus;
43
+ code?: number;
44
+ }
45
+ export interface StreamDataResponse extends StreamData {
46
+ }
47
+ export declare enum StreamRole {
48
+ WORKER = "worker",
49
+ ENGINE = "engine",
50
+ SYSTEM = "system"
51
+ }
52
+ export type ReclaimedMessageType = [
53
+ messageId: string,
54
+ details: [
55
+ key: string,
56
+ value: string
57
+ ]
58
+ ][];
59
+ export type StreamConfig = {
60
+ namespace: string;
61
+ appId: string;
62
+ guid: string;
63
+ role: StreamRole;
64
+ topic?: string;
65
+ reclaimDelay?: number;
66
+ reclaimCount?: number;
67
+ };
@@ -0,0 +1,22 @@
1
+ export var StreamStatus;
2
+ (function (StreamStatus) {
3
+ StreamStatus["SUCCESS"] = "success";
4
+ StreamStatus["ERROR"] = "error";
5
+ StreamStatus["PENDING"] = "pending";
6
+ })(StreamStatus || (StreamStatus = {}));
7
+ export var StreamDataType;
8
+ (function (StreamDataType) {
9
+ StreamDataType["TIMEHOOK"] = "timehook";
10
+ StreamDataType["WEBHOOK"] = "webhook";
11
+ StreamDataType["AWAIT"] = "await";
12
+ StreamDataType["RESULT"] = "result";
13
+ StreamDataType["WORKER"] = "worker";
14
+ StreamDataType["RESPONSE"] = "response";
15
+ StreamDataType["TRANSITION"] = "transition";
16
+ })(StreamDataType || (StreamDataType = {}));
17
+ export var StreamRole;
18
+ (function (StreamRole) {
19
+ StreamRole["WORKER"] = "worker";
20
+ StreamRole["ENGINE"] = "engine";
21
+ StreamRole["SYSTEM"] = "system";
22
+ })(StreamRole || (StreamRole = {}));
@@ -0,0 +1 @@
1
+ export { context, Context, Counter, Meter, metrics, propagation, SpanContext, Span, SpanStatus, SpanStatusCode, SpanKind, trace, Tracer, ValueType } from '@opentelemetry/api';
@@ -0,0 +1 @@
1
+ export { context, metrics, propagation, SpanStatusCode, SpanKind, trace, ValueType } from '@opentelemetry/api';
@@ -0,0 +1,17 @@
1
+ import { Pipe } from "./pipe";
2
+ export type TransitionMatch = {
3
+ expected: boolean | string | number | null;
4
+ actual: boolean | string | number | null | {
5
+ '@pipe': Pipe;
6
+ };
7
+ };
8
+ export type TransitionRule = {
9
+ gate?: 'and' | 'or';
10
+ code?: string;
11
+ match: Array<TransitionMatch>;
12
+ };
13
+ export type Transitions = {
14
+ [key: string]: {
15
+ [key: string]: TransitionRule;
16
+ };
17
+ };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Durable Workflows",
5
- "main": "build/index.js",
6
- "types": "build/index.d.ts",
5
+ "main": "build/cjs/index.js",
6
+ "module": "build/esm/index.js",
7
+ "types": "build/cjs/index.d.ts",
8
+ "exports": {
9
+ "import": "./build/esm/index.js",
10
+ "require": "./build/cjs/index.js"
11
+ },
7
12
  "repository": {
8
13
  "type": "git",
9
14
  "url": "https://github.com/hotmeshio/sdk-typescript.git"
@@ -14,7 +19,9 @@
14
19
  },
15
20
  "scripts": {
16
21
  "clean": "rimraf ./build",
17
- "build": "tsc --build tsconfig.json",
22
+ "build:cjs": "tsc --build tsconfig.cjs.json",
23
+ "build:esm": "tsc --build tsconfig.esm.json",
24
+ "build": "npm run build:cjs && npm run build:esm",
18
25
  "clean-build": "npm run clean && npm run build",
19
26
  "lint": "eslint . --ext .ts",
20
27
  "lint:fix": "eslint . --fix --ext .ts",
@@ -52,7 +59,7 @@
52
59
  "@opentelemetry/api": "^1.4.1",
53
60
  "js-yaml": "^4.1.0",
54
61
  "ms": "^2.1.3",
55
- "nanoid": "^3.3.6",
62
+ "uuid": "^9.0.1",
56
63
  "winston": "^3.8.2"
57
64
  },
58
65
  "devDependencies": {
@@ -391,8 +391,8 @@ class Activity {
391
391
  TelemetryService.addTargetTelemetryPaths(consumes, this.config, this.metadata, this.leg);
392
392
  let { dad, jid } = this.context.metadata;
393
393
  jobId = jobId || jid;
394
- //`state` is a flat hash
395
394
  const dIds = CollatorService.getDimensionsById([...this.config.ancestors, this.metadata.aid], dad);
395
+ //`state` is a flat hash
396
396
  const [state, status] = await this.store.getState(jobId, consumes, dIds);
397
397
  //`context` is a tree
398
398
  this.context = restoreHierarchy(state) as JobState;
@@ -1,4 +1,4 @@
1
- import { nanoid } from 'nanoid';
1
+ import { v4 as uuidv4 } from 'uuid';
2
2
  import { DuplicateJobError } from '../../modules/errors';
3
3
  import { formatISODate, getTimeSeries } from '../../modules/utils';
4
4
  import { Activity } from './activity';
@@ -161,7 +161,7 @@ class Trigger extends Activity {
161
161
 
162
162
  resolveJobId(context: Partial<JobState>): string {
163
163
  const jobId = this.config.stats?.id;
164
- return jobId ? Pipe.resolve(jobId, context) : nanoid();
164
+ return jobId ? Pipe.resolve(jobId, context) : uuidv4();
165
165
  }
166
166
 
167
167
  resolveJobKey(context: Partial<JobState>): string {
@@ -1,4 +1,4 @@
1
- import { nanoid } from 'nanoid';
1
+ import { v4 as uuidv4 } from 'uuid';
2
2
 
3
3
  import { identifyRedisTypeFromClass } from '../../modules/utils';
4
4
  import { RedisConnection as IORedisConnection } from '../connector/clients/ioredis';
@@ -23,14 +23,14 @@ export class ConnectorService {
23
23
  if (identifyRedisTypeFromClass(Redis) === 'redis') {
24
24
  for (let i = 1; i <= 3; i++) {
25
25
  instances.push(RedisConnection.connect(
26
- nanoid(),
26
+ uuidv4(),
27
27
  Redis as RedisClassType,
28
28
  options as RedisClientOptions));
29
29
  }
30
30
  } else {
31
31
  for (let i = 1; i <= 3; i++) {
32
32
  instances.push(IORedisConnection.connect(
33
- nanoid(),
33
+ uuidv4(),
34
34
  Redis as IORedisClassType,
35
35
  options as IORedisClientOptions));
36
36
  }
@@ -12,7 +12,7 @@ Here is an example of how the methods in this file are used:
12
12
  import { Durable } from '@hotmeshio/hotmesh';
13
13
  import Redis from 'ioredis';
14
14
  import { example } from './workflows';
15
- import { nanoid } from 'nanoid';
15
+ import { v4 as uuidv4 } from 'uuid';
16
16
 
17
17
  async function run() {
18
18
  const connection = await Durable.Connection.connect({
@@ -31,7 +31,7 @@ async function run() {
31
31
  args: ['HotMesh'],
32
32
  taskQueue: 'hello-world',
33
33
  workflowName: 'example',
34
- workflowId: 'workflow-' + nanoid(),
34
+ workflowId: 'workflow-' + uuidv4(),
35
35
  });
36
36
 
37
37
  console.log(`Started workflow ${handle.workflowId}`);
@@ -7,7 +7,7 @@ Here is an example of how the methods in this file are used:
7
7
 
8
8
  import { Durable } from '@hotmeshio/hotmesh';
9
9
  import Redis from 'ioredis';
10
- import { nanoid } from 'nanoid';
10
+ import { v4 as uuidv4 } from 'uuid';
11
11
 
12
12
  async function run() {
13
13
  const connection = await Durable.Connection.connect({
@@ -26,7 +26,7 @@ async function run() {
26
26
  taskQueue: 'hello-world',
27
27
  args: ['HotMesh'],
28
28
  workflowName: 'example',
29
- workflowId: nanoid(),
29
+ workflowId: uuidv4(),
30
30
  });
31
31
 
32
32
  console.log(`Started workflow ${handle.workflowId}`);
@@ -104,9 +104,7 @@ export class WorkerService {
104
104
  WorkerService.registerActivities<typeof config.activities>(config.activities);
105
105
  //import the user's workflow file (triggers activity functions to be wrapped)
106
106
  const workflow = await import(config.workflowsPath);
107
- const workflowFunctionNames = Object.keys(workflow);
108
- const workflowFunctionName = workflowFunctionNames[workflowFunctionNames.length - 1];
109
- const workflowFunction = workflow[workflowFunctionName];
107
+ const [workflowFunctionName, workflowFunction] = WorkerService.resolveWorkflowTarget(workflow);
110
108
  const baseTopic = `${config.taskQueue}-${workflowFunctionName}`;
111
109
  const activityTopic = `${baseTopic}-activity`;
112
110
  const workflowTopic = `${baseTopic}`;
@@ -121,6 +119,18 @@ export class WorkerService {
121
119
  return worker;
122
120
  }
123
121
 
122
+ static resolveWorkflowTarget(workflow: object | Function): [string, Function] {
123
+ let workflowFunction: Function;
124
+ if (typeof workflow === 'function') {
125
+ workflowFunction = workflow;
126
+ } else {
127
+ const workflowFunctionNames = Object.keys(workflow);
128
+ workflowFunction = workflow[workflowFunctionNames[workflowFunctionNames.length - 1]];
129
+ return WorkerService.resolveWorkflowTarget(workflowFunction);
130
+ }
131
+ return [workflowFunction.name, workflowFunction];
132
+ }
133
+
124
134
  async run() {
125
135
  if (this.workflowRunner) {
126
136
  this.workflowRunner.engine.logger.info('WorkerService is running');
@@ -1,4 +1,4 @@
1
- import { nanoid } from 'nanoid';
1
+ import { v4 as uuidv4 } from 'uuid';
2
2
  import { PSNS } from '../../modules/key';
3
3
  import { EngineService } from '../engine';
4
4
  import { LoggerService, ILogger } from '../logger';
@@ -53,7 +53,7 @@ class HotMeshService {
53
53
 
54
54
  static async init(config: HotMeshConfig) {
55
55
  const instance = new HotMeshService();
56
- instance.guid = nanoid();
56
+ instance.guid = uuidv4();
57
57
  instance.verifyAndSetNamespace(config.namespace);
58
58
  instance.verifyAndSetAppId(config.appId);
59
59
  instance.logger = new LoggerService(config.appId, instance.guid, config.name || '', config.logLevel);
@@ -1,9 +1,8 @@
1
- import { matchesStatus, matchesStatusCode } from "../../modules/utils";
2
- import { Pipe } from "../pipe";
3
- import { JobState } from "../../types/job";
4
- import { Pipe as PipeType } from "../../types/pipe";
5
- import { TransitionMatch, TransitionRule } from "../../types/transition";
6
- import { StreamCode, StreamStatus } from "../../types";
1
+ import { Pipe } from '../pipe';
2
+ import { JobState } from '../../types/job';
3
+ import { Pipe as PipeType } from '../../types/pipe';
4
+ import { TransitionMatch, TransitionRule } from '../../types/transition';
5
+ import { StreamCode } from '../../types';
7
6
 
8
7
  type RuleType = null | undefined | boolean | string | number | Date | Record<string, any>;
9
8
 
@@ -80,4 +79,4 @@ class MapperService {
80
79
  }
81
80
  }
82
81
 
83
- export { MapperService }
82
+ export { MapperService }