@hotmeshio/hotmesh 0.0.3 → 0.0.5

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 (363) hide show
  1. package/README.md +3 -3
  2. package/build/{package.json → cjs/package.json} +12 -5
  3. package/build/{services → cjs/services}/activities/activity.d.ts +2 -0
  4. package/build/{services → cjs/services}/activities/activity.js +27 -9
  5. package/build/{services → cjs/services}/activities/trigger.js +2 -2
  6. package/build/{services → cjs/services}/activities/worker.js +1 -0
  7. package/build/{services → cjs/services}/collator/index.d.ts +7 -5
  8. package/build/{services → cjs/services}/collator/index.js +29 -6
  9. package/build/{services → cjs/services}/compiler/deployer.d.ts +4 -3
  10. package/build/{services → cjs/services}/compiler/deployer.js +14 -0
  11. package/build/{services → cjs/services}/connector/index.js +3 -3
  12. package/build/{services → cjs/services}/dimension/index.d.ts +1 -1
  13. package/build/{services → cjs/services}/durable/client.js +2 -2
  14. package/build/{services → cjs/services}/durable/connection.js +2 -2
  15. package/build/{services → cjs/services}/durable/handle.d.ts +1 -1
  16. package/build/{services → cjs/services}/engine/index.d.ts +1 -1
  17. package/build/{services → cjs/services}/engine/index.js +22 -5
  18. package/build/{services → cjs/services}/hotmesh/index.d.ts +1 -1
  19. package/build/{services → cjs/services}/hotmesh/index.js +4 -4
  20. package/build/{services → cjs/services}/mapper/index.d.ts +3 -3
  21. package/build/{services → cjs/services}/serializer/index.d.ts +6 -1
  22. package/build/{services → cjs/services}/serializer/index.js +55 -22
  23. package/build/{services → cjs/services}/signaler/stream.js +1 -0
  24. package/build/{services → cjs/services}/store/index.d.ts +3 -3
  25. package/build/{services → cjs/services}/store/index.js +11 -24
  26. package/build/{types → cjs/types}/activity.d.ts +1 -0
  27. package/build/esm/index.d.ts +4 -0
  28. package/build/esm/index.js +3 -0
  29. package/build/esm/modules/errors.d.ts +28 -0
  30. package/build/esm/modules/errors.js +41 -0
  31. package/build/esm/modules/key.d.ts +75 -0
  32. package/build/esm/modules/key.js +111 -0
  33. package/build/esm/modules/utils.d.ts +34 -0
  34. package/build/esm/modules/utils.js +154 -0
  35. package/build/esm/package.json +80 -0
  36. package/build/esm/services/activities/activity.d.ts +61 -0
  37. package/build/esm/services/activities/activity.js +411 -0
  38. package/build/esm/services/activities/await.d.ts +16 -0
  39. package/build/esm/services/activities/await.js +140 -0
  40. package/build/esm/services/activities/emit.d.ts +9 -0
  41. package/build/esm/services/activities/emit.js +10 -0
  42. package/build/esm/services/activities/index.d.ts +15 -0
  43. package/build/esm/services/activities/index.js +14 -0
  44. package/build/esm/services/activities/iterate.d.ts +9 -0
  45. package/build/esm/services/activities/iterate.js +10 -0
  46. package/build/esm/services/activities/trigger.d.ts +22 -0
  47. package/build/esm/services/activities/trigger.js +158 -0
  48. package/build/esm/services/activities/worker.d.ts +17 -0
  49. package/build/esm/services/activities/worker.js +162 -0
  50. package/build/esm/services/collator/index.d.ts +56 -0
  51. package/build/esm/services/collator/index.js +191 -0
  52. package/build/esm/services/compiler/deployer.d.ts +36 -0
  53. package/build/esm/services/compiler/deployer.js +423 -0
  54. package/build/esm/services/compiler/index.d.ts +30 -0
  55. package/build/esm/services/compiler/index.js +82 -0
  56. package/build/esm/services/compiler/validator.d.ts +32 -0
  57. package/build/esm/services/compiler/validator.js +131 -0
  58. package/build/esm/services/connector/clients/ioredis.d.ts +13 -0
  59. package/build/esm/services/connector/clients/ioredis.js +47 -0
  60. package/build/esm/services/connector/clients/redis.d.ts +13 -0
  61. package/build/esm/services/connector/clients/redis.js +59 -0
  62. package/build/esm/services/connector/index.d.ts +5 -0
  63. package/build/esm/services/connector/index.js +27 -0
  64. package/build/esm/services/dimension/index.d.ts +29 -0
  65. package/build/esm/services/dimension/index.js +32 -0
  66. package/build/esm/services/durable/asyncLocalStorage.d.ts +3 -0
  67. package/build/esm/services/durable/asyncLocalStorage.js +2 -0
  68. package/build/esm/services/durable/client.d.ts +15 -0
  69. package/build/esm/services/durable/client.js +114 -0
  70. package/build/esm/services/durable/connection.d.ts +4 -0
  71. package/build/esm/services/durable/connection.js +47 -0
  72. package/build/esm/services/durable/factory.d.ts +3 -0
  73. package/build/esm/services/durable/factory.js +119 -0
  74. package/build/esm/services/durable/handle.d.ts +8 -0
  75. package/build/esm/services/durable/handle.js +34 -0
  76. package/build/esm/services/durable/index.d.ts +57 -0
  77. package/build/esm/services/durable/index.js +55 -0
  78. package/build/esm/services/durable/native.d.ts +4 -0
  79. package/build/esm/services/durable/native.js +43 -0
  80. package/build/esm/services/durable/worker.d.ts +36 -0
  81. package/build/esm/services/durable/worker.js +258 -0
  82. package/build/esm/services/durable/workflow.d.ts +6 -0
  83. package/build/esm/services/durable/workflow.js +128 -0
  84. package/build/esm/services/engine/index.d.ts +82 -0
  85. package/build/esm/services/engine/index.js +522 -0
  86. package/build/esm/services/hotmesh/index.d.ts +45 -0
  87. package/build/esm/services/hotmesh/index.js +131 -0
  88. package/build/esm/services/logger/index.d.ts +17 -0
  89. package/build/esm/services/logger/index.js +70 -0
  90. package/build/esm/services/mapper/index.d.ts +24 -0
  91. package/build/esm/services/mapper/index.js +69 -0
  92. package/build/esm/services/pipe/functions/array.d.ts +24 -0
  93. package/build/esm/services/pipe/functions/array.js +66 -0
  94. package/build/esm/services/pipe/functions/bitwise.d.ts +9 -0
  95. package/build/esm/services/pipe/functions/bitwise.js +21 -0
  96. package/build/esm/services/pipe/functions/conditional.d.ts +10 -0
  97. package/build/esm/services/pipe/functions/conditional.js +24 -0
  98. package/build/esm/services/pipe/functions/date.d.ts +57 -0
  99. package/build/esm/services/pipe/functions/date.js +164 -0
  100. package/build/esm/services/pipe/functions/index.d.ts +25 -0
  101. package/build/esm/services/pipe/functions/index.js +24 -0
  102. package/build/esm/services/pipe/functions/json.d.ts +5 -0
  103. package/build/esm/services/pipe/functions/json.js +9 -0
  104. package/build/esm/services/pipe/functions/math.d.ts +38 -0
  105. package/build/esm/services/pipe/functions/math.js +108 -0
  106. package/build/esm/services/pipe/functions/number.d.ts +25 -0
  107. package/build/esm/services/pipe/functions/number.js +130 -0
  108. package/build/esm/services/pipe/functions/object.d.ts +22 -0
  109. package/build/esm/services/pipe/functions/object.js +60 -0
  110. package/build/esm/services/pipe/functions/string.d.ts +23 -0
  111. package/build/esm/services/pipe/functions/string.js +66 -0
  112. package/build/esm/services/pipe/functions/symbol.d.ts +12 -0
  113. package/build/esm/services/pipe/functions/symbol.js +30 -0
  114. package/build/esm/services/pipe/functions/unary.d.ts +7 -0
  115. package/build/esm/services/pipe/functions/unary.js +15 -0
  116. package/build/esm/services/pipe/index.d.ts +30 -0
  117. package/build/esm/services/pipe/index.js +122 -0
  118. package/build/esm/services/quorum/index.d.ts +34 -0
  119. package/build/esm/services/quorum/index.js +144 -0
  120. package/build/esm/services/reporter/index.d.ts +47 -0
  121. package/build/esm/services/reporter/index.js +327 -0
  122. package/build/esm/services/serializer/index.d.ts +41 -0
  123. package/build/esm/services/serializer/index.js +251 -0
  124. package/build/esm/services/signaler/store.d.ts +15 -0
  125. package/build/esm/services/signaler/store.js +50 -0
  126. package/build/esm/services/signaler/stream.d.ts +43 -0
  127. package/build/esm/services/signaler/stream.js +315 -0
  128. package/build/esm/services/store/cache.d.ts +66 -0
  129. package/build/esm/services/store/cache.js +124 -0
  130. package/build/esm/services/store/clients/ioredis.d.ts +27 -0
  131. package/build/esm/services/store/clients/ioredis.js +93 -0
  132. package/build/esm/services/store/clients/redis.d.ts +29 -0
  133. package/build/esm/services/store/clients/redis.js +140 -0
  134. package/build/esm/services/store/index.d.ts +88 -0
  135. package/build/esm/services/store/index.js +623 -0
  136. package/build/esm/services/stream/clients/ioredis.d.ts +23 -0
  137. package/build/esm/services/stream/clients/ioredis.js +112 -0
  138. package/build/esm/services/stream/clients/redis.d.ts +23 -0
  139. package/build/esm/services/stream/clients/redis.js +116 -0
  140. package/build/esm/services/stream/index.d.ts +21 -0
  141. package/build/esm/services/stream/index.js +6 -0
  142. package/build/esm/services/sub/clients/ioredis.d.ts +20 -0
  143. package/build/esm/services/sub/clients/ioredis.js +69 -0
  144. package/build/esm/services/sub/clients/redis.d.ts +20 -0
  145. package/build/esm/services/sub/clients/redis.js +60 -0
  146. package/build/esm/services/sub/index.d.ts +18 -0
  147. package/build/esm/services/sub/index.js +6 -0
  148. package/build/esm/services/task/index.d.ts +18 -0
  149. package/build/esm/services/task/index.js +70 -0
  150. package/build/esm/services/telemetry/index.d.ts +49 -0
  151. package/build/esm/services/telemetry/index.js +217 -0
  152. package/build/esm/services/worker/index.d.ts +30 -0
  153. package/build/esm/services/worker/index.js +102 -0
  154. package/build/esm/types/activity.d.ts +87 -0
  155. package/build/esm/types/activity.js +1 -0
  156. package/build/esm/types/app.d.ts +16 -0
  157. package/build/esm/types/app.js +1 -0
  158. package/build/esm/types/async.d.ts +5 -0
  159. package/build/esm/types/async.js +1 -0
  160. package/build/esm/types/cache.d.ts +1 -0
  161. package/build/esm/types/cache.js +1 -0
  162. package/build/esm/types/collator.d.ts +8 -0
  163. package/build/esm/types/collator.js +8 -0
  164. package/build/esm/types/durable.d.ts +59 -0
  165. package/build/esm/types/durable.js +1 -0
  166. package/build/esm/types/hook.d.ts +31 -0
  167. package/build/esm/types/hook.js +6 -0
  168. package/build/esm/types/hotmesh.d.ts +82 -0
  169. package/build/esm/types/hotmesh.js +1 -0
  170. package/build/esm/types/index.d.ts +20 -0
  171. package/build/esm/types/index.js +5 -0
  172. package/build/esm/types/ioredisclient.d.ts +5 -0
  173. package/build/esm/types/ioredisclient.js +2 -0
  174. package/build/esm/types/job.d.ts +50 -0
  175. package/build/esm/types/job.js +1 -0
  176. package/build/esm/types/logger.d.ts +6 -0
  177. package/build/esm/types/logger.js +1 -0
  178. package/build/esm/types/map.d.ts +4 -0
  179. package/build/esm/types/map.js +1 -0
  180. package/build/esm/types/pipe.d.ts +4 -0
  181. package/build/esm/types/pipe.js +1 -0
  182. package/build/esm/types/quorum.d.ts +46 -0
  183. package/build/esm/types/quorum.js +1 -0
  184. package/build/esm/types/redis.d.ts +8 -0
  185. package/build/esm/types/redis.js +1 -0
  186. package/build/esm/types/redisclient.d.ts +25 -0
  187. package/build/esm/types/redisclient.js +1 -0
  188. package/build/esm/types/serializer.d.ts +33 -0
  189. package/build/esm/types/serializer.js +1 -0
  190. package/build/esm/types/stats.d.ts +83 -0
  191. package/build/esm/types/stats.js +1 -0
  192. package/build/esm/types/stream.d.ts +67 -0
  193. package/build/esm/types/stream.js +22 -0
  194. package/build/esm/types/telemetry.d.ts +1 -0
  195. package/build/esm/types/telemetry.js +1 -0
  196. package/build/esm/types/transition.d.ts +17 -0
  197. package/build/esm/types/transition.js +1 -0
  198. package/package.json +12 -5
  199. package/services/activities/activity.ts +28 -9
  200. package/services/activities/trigger.ts +2 -2
  201. package/services/activities/worker.ts +1 -0
  202. package/services/collator/index.ts +38 -13
  203. package/services/compiler/deployer.ts +24 -9
  204. package/services/connector/index.ts +3 -3
  205. package/services/dimension/index.ts +1 -1
  206. package/services/durable/client.ts +2 -2
  207. package/services/durable/connection.ts +2 -2
  208. package/services/durable/handle.ts +2 -2
  209. package/services/engine/index.ts +23 -5
  210. package/services/hotmesh/index.ts +4 -4
  211. package/services/mapper/index.ts +6 -8
  212. package/services/serializer/index.ts +57 -22
  213. package/services/signaler/stream.ts +1 -0
  214. package/services/store/index.ts +13 -25
  215. package/tsconfig.cjs.json +8 -0
  216. package/tsconfig.esm.json +9 -0
  217. package/types/activity.ts +1 -0
  218. /package/build/{index.d.ts → cjs/index.d.ts} +0 -0
  219. /package/build/{index.js → cjs/index.js} +0 -0
  220. /package/build/{modules → cjs/modules}/errors.d.ts +0 -0
  221. /package/build/{modules → cjs/modules}/errors.js +0 -0
  222. /package/build/{modules → cjs/modules}/key.d.ts +0 -0
  223. /package/build/{modules → cjs/modules}/key.js +0 -0
  224. /package/build/{modules → cjs/modules}/utils.d.ts +0 -0
  225. /package/build/{modules → cjs/modules}/utils.js +0 -0
  226. /package/build/{services → cjs/services}/activities/await.d.ts +0 -0
  227. /package/build/{services → cjs/services}/activities/await.js +0 -0
  228. /package/build/{services → cjs/services}/activities/emit.d.ts +0 -0
  229. /package/build/{services → cjs/services}/activities/emit.js +0 -0
  230. /package/build/{services → cjs/services}/activities/index.d.ts +0 -0
  231. /package/build/{services → cjs/services}/activities/index.js +0 -0
  232. /package/build/{services → cjs/services}/activities/iterate.d.ts +0 -0
  233. /package/build/{services → cjs/services}/activities/iterate.js +0 -0
  234. /package/build/{services → cjs/services}/activities/trigger.d.ts +0 -0
  235. /package/build/{services → cjs/services}/activities/worker.d.ts +0 -0
  236. /package/build/{services → cjs/services}/compiler/index.d.ts +0 -0
  237. /package/build/{services → cjs/services}/compiler/index.js +0 -0
  238. /package/build/{services → cjs/services}/compiler/validator.d.ts +0 -0
  239. /package/build/{services → cjs/services}/compiler/validator.js +0 -0
  240. /package/build/{services → cjs/services}/connector/clients/ioredis.d.ts +0 -0
  241. /package/build/{services → cjs/services}/connector/clients/ioredis.js +0 -0
  242. /package/build/{services → cjs/services}/connector/clients/redis.d.ts +0 -0
  243. /package/build/{services → cjs/services}/connector/clients/redis.js +0 -0
  244. /package/build/{services → cjs/services}/connector/index.d.ts +0 -0
  245. /package/build/{services → cjs/services}/dimension/index.js +0 -0
  246. /package/build/{services → cjs/services}/durable/asyncLocalStorage.d.ts +0 -0
  247. /package/build/{services → cjs/services}/durable/asyncLocalStorage.js +0 -0
  248. /package/build/{services → cjs/services}/durable/client.d.ts +0 -0
  249. /package/build/{services → cjs/services}/durable/connection.d.ts +0 -0
  250. /package/build/{services → cjs/services}/durable/factory.d.ts +0 -0
  251. /package/build/{services → cjs/services}/durable/factory.js +0 -0
  252. /package/build/{services → cjs/services}/durable/handle.js +0 -0
  253. /package/build/{services → cjs/services}/durable/index.d.ts +0 -0
  254. /package/build/{services → cjs/services}/durable/index.js +0 -0
  255. /package/build/{services → cjs/services}/durable/native.d.ts +0 -0
  256. /package/build/{services → cjs/services}/durable/native.js +0 -0
  257. /package/build/{services → cjs/services}/durable/worker.d.ts +0 -0
  258. /package/build/{services → cjs/services}/durable/worker.js +0 -0
  259. /package/build/{services → cjs/services}/durable/workflow.d.ts +0 -0
  260. /package/build/{services → cjs/services}/durable/workflow.js +0 -0
  261. /package/build/{services → cjs/services}/logger/index.d.ts +0 -0
  262. /package/build/{services → cjs/services}/logger/index.js +0 -0
  263. /package/build/{services → cjs/services}/mapper/index.js +0 -0
  264. /package/build/{services → cjs/services}/pipe/functions/array.d.ts +0 -0
  265. /package/build/{services → cjs/services}/pipe/functions/array.js +0 -0
  266. /package/build/{services → cjs/services}/pipe/functions/bitwise.d.ts +0 -0
  267. /package/build/{services → cjs/services}/pipe/functions/bitwise.js +0 -0
  268. /package/build/{services → cjs/services}/pipe/functions/conditional.d.ts +0 -0
  269. /package/build/{services → cjs/services}/pipe/functions/conditional.js +0 -0
  270. /package/build/{services → cjs/services}/pipe/functions/date.d.ts +0 -0
  271. /package/build/{services → cjs/services}/pipe/functions/date.js +0 -0
  272. /package/build/{services → cjs/services}/pipe/functions/index.d.ts +0 -0
  273. /package/build/{services → cjs/services}/pipe/functions/index.js +0 -0
  274. /package/build/{services → cjs/services}/pipe/functions/json.d.ts +0 -0
  275. /package/build/{services → cjs/services}/pipe/functions/json.js +0 -0
  276. /package/build/{services → cjs/services}/pipe/functions/math.d.ts +0 -0
  277. /package/build/{services → cjs/services}/pipe/functions/math.js +0 -0
  278. /package/build/{services → cjs/services}/pipe/functions/number.d.ts +0 -0
  279. /package/build/{services → cjs/services}/pipe/functions/number.js +0 -0
  280. /package/build/{services → cjs/services}/pipe/functions/object.d.ts +0 -0
  281. /package/build/{services → cjs/services}/pipe/functions/object.js +0 -0
  282. /package/build/{services → cjs/services}/pipe/functions/string.d.ts +0 -0
  283. /package/build/{services → cjs/services}/pipe/functions/string.js +0 -0
  284. /package/build/{services → cjs/services}/pipe/functions/symbol.d.ts +0 -0
  285. /package/build/{services → cjs/services}/pipe/functions/symbol.js +0 -0
  286. /package/build/{services → cjs/services}/pipe/functions/unary.d.ts +0 -0
  287. /package/build/{services → cjs/services}/pipe/functions/unary.js +0 -0
  288. /package/build/{services → cjs/services}/pipe/index.d.ts +0 -0
  289. /package/build/{services → cjs/services}/pipe/index.js +0 -0
  290. /package/build/{services → cjs/services}/quorum/index.d.ts +0 -0
  291. /package/build/{services → cjs/services}/quorum/index.js +0 -0
  292. /package/build/{services → cjs/services}/reporter/index.d.ts +0 -0
  293. /package/build/{services → cjs/services}/reporter/index.js +0 -0
  294. /package/build/{services → cjs/services}/signaler/store.d.ts +0 -0
  295. /package/build/{services → cjs/services}/signaler/store.js +0 -0
  296. /package/build/{services → cjs/services}/signaler/stream.d.ts +0 -0
  297. /package/build/{services → cjs/services}/store/cache.d.ts +0 -0
  298. /package/build/{services → cjs/services}/store/cache.js +0 -0
  299. /package/build/{services → cjs/services}/store/clients/ioredis.d.ts +0 -0
  300. /package/build/{services → cjs/services}/store/clients/ioredis.js +0 -0
  301. /package/build/{services → cjs/services}/store/clients/redis.d.ts +0 -0
  302. /package/build/{services → cjs/services}/store/clients/redis.js +0 -0
  303. /package/build/{services → cjs/services}/stream/clients/ioredis.d.ts +0 -0
  304. /package/build/{services → cjs/services}/stream/clients/ioredis.js +0 -0
  305. /package/build/{services → cjs/services}/stream/clients/redis.d.ts +0 -0
  306. /package/build/{services → cjs/services}/stream/clients/redis.js +0 -0
  307. /package/build/{services → cjs/services}/stream/index.d.ts +0 -0
  308. /package/build/{services → cjs/services}/stream/index.js +0 -0
  309. /package/build/{services → cjs/services}/sub/clients/ioredis.d.ts +0 -0
  310. /package/build/{services → cjs/services}/sub/clients/ioredis.js +0 -0
  311. /package/build/{services → cjs/services}/sub/clients/redis.d.ts +0 -0
  312. /package/build/{services → cjs/services}/sub/clients/redis.js +0 -0
  313. /package/build/{services → cjs/services}/sub/index.d.ts +0 -0
  314. /package/build/{services → cjs/services}/sub/index.js +0 -0
  315. /package/build/{services → cjs/services}/task/index.d.ts +0 -0
  316. /package/build/{services → cjs/services}/task/index.js +0 -0
  317. /package/build/{services → cjs/services}/telemetry/index.d.ts +0 -0
  318. /package/build/{services → cjs/services}/telemetry/index.js +0 -0
  319. /package/build/{services → cjs/services}/worker/index.d.ts +0 -0
  320. /package/build/{services → cjs/services}/worker/index.js +0 -0
  321. /package/build/{types → cjs/types}/activity.js +0 -0
  322. /package/build/{types → cjs/types}/app.d.ts +0 -0
  323. /package/build/{types → cjs/types}/app.js +0 -0
  324. /package/build/{types → cjs/types}/async.d.ts +0 -0
  325. /package/build/{types → cjs/types}/async.js +0 -0
  326. /package/build/{types → cjs/types}/cache.d.ts +0 -0
  327. /package/build/{types → cjs/types}/cache.js +0 -0
  328. /package/build/{types → cjs/types}/collator.d.ts +0 -0
  329. /package/build/{types → cjs/types}/collator.js +0 -0
  330. /package/build/{types → cjs/types}/durable.d.ts +0 -0
  331. /package/build/{types → cjs/types}/durable.js +0 -0
  332. /package/build/{types → cjs/types}/hook.d.ts +0 -0
  333. /package/build/{types → cjs/types}/hook.js +0 -0
  334. /package/build/{types → cjs/types}/hotmesh.d.ts +0 -0
  335. /package/build/{types → cjs/types}/hotmesh.js +0 -0
  336. /package/build/{types → cjs/types}/index.d.ts +0 -0
  337. /package/build/{types → cjs/types}/index.js +0 -0
  338. /package/build/{types → cjs/types}/ioredisclient.d.ts +0 -0
  339. /package/build/{types → cjs/types}/ioredisclient.js +0 -0
  340. /package/build/{types → cjs/types}/job.d.ts +0 -0
  341. /package/build/{types → cjs/types}/job.js +0 -0
  342. /package/build/{types → cjs/types}/logger.d.ts +0 -0
  343. /package/build/{types → cjs/types}/logger.js +0 -0
  344. /package/build/{types → cjs/types}/map.d.ts +0 -0
  345. /package/build/{types → cjs/types}/map.js +0 -0
  346. /package/build/{types → cjs/types}/pipe.d.ts +0 -0
  347. /package/build/{types → cjs/types}/pipe.js +0 -0
  348. /package/build/{types → cjs/types}/quorum.d.ts +0 -0
  349. /package/build/{types → cjs/types}/quorum.js +0 -0
  350. /package/build/{types → cjs/types}/redis.d.ts +0 -0
  351. /package/build/{types → cjs/types}/redis.js +0 -0
  352. /package/build/{types → cjs/types}/redisclient.d.ts +0 -0
  353. /package/build/{types → cjs/types}/redisclient.js +0 -0
  354. /package/build/{types → cjs/types}/serializer.d.ts +0 -0
  355. /package/build/{types → cjs/types}/serializer.js +0 -0
  356. /package/build/{types → cjs/types}/stats.d.ts +0 -0
  357. /package/build/{types → cjs/types}/stats.js +0 -0
  358. /package/build/{types → cjs/types}/stream.d.ts +0 -0
  359. /package/build/{types → cjs/types}/stream.js +0 -0
  360. /package/build/{types → cjs/types}/telemetry.d.ts +0 -0
  361. /package/build/{types → cjs/types}/telemetry.js +0 -0
  362. /package/build/{types → cjs/types}/transition.d.ts +0 -0
  363. /package/build/{types → cjs/types}/transition.js +0 -0
@@ -1,18 +1,28 @@
1
- import { CollationError } from "../../modules/errors";
2
- import { RedisMulti } from "../../types/redis";
3
- import { CollationFaultType, CollationStage } from "../../types/collator";
4
- import { ActivityDuplex } from "../../types/activity";
5
- import { HotMeshGraph } from "../../types/hotmesh";
6
- import { Activity } from "../activities/activity";
1
+ import { CollationError } from '../../modules/errors';
2
+ import { RedisMulti } from '../../types/redis';
3
+ import { CollationFaultType, CollationStage } from '../../types/collator';
4
+ import { ActivityDuplex } from '../../types/activity';
5
+ import { HotMeshGraph } from '../../types/hotmesh';
6
+ import { Activity } from '../activities/activity';
7
7
 
8
8
  class CollatorService {
9
9
 
10
10
  //max int digit count that supports `hincrby`
11
- static targetLength = 15;
11
+ static targetLength = 15;
12
+
13
+ static getDimensionalAddress(activity: Activity): Record<string, string> {
14
+ let dad = activity.context.metadata.dad || activity.metadata.dad;
15
+ //todo: unsure about this reset
16
+ // if (dad && activity.leg === 2) {
17
+ // console.log('setting dad index back to 0=>', dad);
18
+ // dad = `${dad.substring(0, dad.lastIndexOf(','))},0`;
19
+ // }
20
+ return CollatorService.getDimensionsById([...activity.config.ancestors, activity.metadata.aid], dad);
21
+ }
12
22
 
13
23
  static async notarizeEntry(activity: Activity, multi?: RedisMulti): Promise<number> {
14
24
  //decrement by -100_000_000_000_000
15
- const amount = await activity.store.collate(activity.context.metadata.jid, activity.metadata.aid, -100_000_000_000_000, multi);
25
+ const amount = await activity.store.collate(activity.context.metadata.jid, activity.metadata.aid, -100_000_000_000_000, this.getDimensionalAddress(activity), multi);
16
26
  this.verifyInteger(amount, 1, 'enter');
17
27
  return amount;
18
28
  };
@@ -20,31 +30,31 @@ class CollatorService {
20
30
  static async authorizeReentry(activity: Activity, multi?: RedisMulti): Promise<number> {
21
31
  //set second digit to 8, allowing for re-entry
22
32
  //decrement by -10_000_000_000_000
23
- const amount = await activity.store.collate(activity.context.metadata.jid, activity.metadata.aid, -10_000_000_000_000, multi);
33
+ const amount = await activity.store.collate(activity.context.metadata.jid, activity.metadata.aid, -10_000_000_000_000, this.getDimensionalAddress(activity), multi);
24
34
  //this.verifyInteger(amount, 1, 'exit');
25
35
  return amount;
26
36
  }
27
37
 
28
38
  static async notarizeEarlyCompletion(activity: Activity, multi?: RedisMulti): Promise<number> {
29
39
  //initialize both `possible` (1m) and `actualized` (1) zero dimension, while decrementing the 2nd and 3rd digits to deactivate the activity
30
- return await activity.store.collate(activity.context.metadata.jid, activity.metadata.aid, 1_000_001 - 11_000_000_000_000, multi);
40
+ return await activity.store.collate(activity.context.metadata.jid, activity.metadata.aid, 1_000_001 - 11_000_000_000_000, this.getDimensionalAddress(activity), multi);
31
41
  };
32
42
 
33
43
  static async notarizeReentry(activity: Activity, multi?: RedisMulti): Promise<number> {
34
44
  //increment by 1_000_000 (indicates re-entry and is used to drive the 'dimensional address' for adjacent activities (minus 1))
35
- const amount = await activity.store.collate(activity.context.metadata.jid, activity.metadata.aid, 1_000_000, multi);
45
+ const amount = await activity.store.collate(activity.context.metadata.jid, activity.metadata.aid, 1_000_000, this.getDimensionalAddress(activity), multi);
36
46
  this.verifyInteger(amount, 2, 'enter');
37
47
  return amount;
38
48
  };
39
49
 
40
50
  static async notarizeContinuation(activity: Activity, multi?: RedisMulti): Promise<number> {
41
51
  //keep open; actualize the leg2 dimension (+1)
42
- return await activity.store.collate(activity.context.metadata.jid, activity.metadata.aid, 1, multi);
52
+ return await activity.store.collate(activity.context.metadata.jid, activity.metadata.aid, 1, this.getDimensionalAddress(activity), multi);
43
53
  };
44
54
 
45
55
  static async notarizeCompletion(activity: Activity, multi?: RedisMulti): Promise<number> {
46
56
  //close out; actualize leg2 dimension (+1) and decrement the 3rd digit (-1_000_000_000_000)
47
- return await activity.store.collate(activity.context.metadata.jid, activity.metadata.aid, 1 - 1_000_000_000_000, multi);
57
+ return await activity.store.collate(activity.context.metadata.jid, activity.metadata.aid, 1 - 1_000_000_000_000, this.getDimensionalAddress(activity), multi);
48
58
  };
49
59
 
50
60
  static getDigitAtIndex(num: number, targetDigitIndex: number): number | null {
@@ -112,6 +122,21 @@ class CollatorService {
112
122
  }
113
123
  }
114
124
 
125
+ static getDimensionsById(ancestors: string[], dad: string): Record<string, string> {
126
+ //ancestors is an ordered list of all ancestors, starting with the trigger (['t1', 'a1', 'a2'])
127
+ //dad is the dimensional address of the ancestors list (',0,5,3')
128
+ //loop through the ancestors list and create a map of the ancestor to the dimensional address.
129
+ //return { 't1': ',0', 'a1': ',0,5', 'a1': ',0,5,3', $ADJACENT: ',0,5,3,0' };
130
+ // `adjacent` is a special key that is used to track the dimensional address of adjacent activities
131
+ const map: Record<string, string> = { '$ADJACENT': `${dad},0` };
132
+ let dadStr = dad;
133
+ ancestors.reverse().forEach((ancestor) => {
134
+ map[ancestor] = dadStr;
135
+ dadStr = dadStr.substring(0, dadStr.lastIndexOf(','));
136
+ });
137
+ return map;
138
+ }
139
+
115
140
  /**
116
141
  * All non-trigger activities are assigned a status seed by their parent
117
142
  */
@@ -1,13 +1,13 @@
1
- import { KeyStoreParams, KeyType } from "../../modules/key";
2
- import { getSymKey } from "../../modules/utils";
3
- import { CollatorService } from "../collator";
4
- import { SerializerService } from "../serializer";
1
+ import { KeyStoreParams, KeyType } from '../../modules/key';
2
+ import { getSymKey } from '../../modules/utils';
3
+ import { CollatorService } from '../collator';
4
+ import { SerializerService } from '../serializer';
5
5
  import { StoreService } from '../store';
6
- import { ActivityType } from "../../types/activity";
7
- import { HookRule } from "../../types/hook";
8
- import { HotMeshGraph, HotMeshManifest } from "../../types/hotmesh";
9
- import { RedisClient, RedisMulti } from "../../types/redis";
10
- import { StringAnyType, Symbols } from "../../types/serializer";
6
+ import { ActivityType } from '../../types/activity';
7
+ import { HookRule } from '../../types/hook';
8
+ import { HotMeshGraph, HotMeshManifest } from '../../types/hotmesh';
9
+ import { RedisClient, RedisMulti } from '../../types/redis';
10
+ import { StringAnyType, Symbols } from '../../types/serializer';
11
11
 
12
12
  const DEFAULT_METADATA_RANGE_SIZE = 26; //metadata is 26 slots ([a-z] * 1)
13
13
  const DEFAULT_DATA_RANGE_SIZE = 260; //data is 260 slots ([a-zA-Z] * 5)
@@ -63,6 +63,7 @@ class Deployer {
63
63
  for (const [activityId, activity] of Object.entries(graph.activities)) {
64
64
  const [lower, upper, symbols] = await this.store.reserveSymbolRange(activityId, DEFAULT_RANGE_SIZE, 'ACTIVITY');
65
65
  const prefix = `${activityId}/`; //activity meta/data is namespaced
66
+ this.bindSelf(activity.consumes, activity.produces, activityId);
66
67
  const newSymbols = this.bindSymbols(lower, upper, symbols, prefix, activity.produces);
67
68
  if (Object.keys(newSymbols).length) {
68
69
  await this.store.addSymbols(activityId, newSymbols);
@@ -71,6 +72,20 @@ class Deployer {
71
72
  }
72
73
  }
73
74
 
75
+ bindSelf(consumes: Record<string, string[]>, produces: string[], activityId: string) {
76
+ //bind self-referential mappings
77
+ for (const selfId of [activityId, '$self']) {
78
+ const selfConsumes = consumes[selfId];
79
+ if (selfConsumes) {
80
+ for (const path of selfConsumes) {
81
+ if (!produces.includes(path)) {
82
+ produces.push(path);
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+
74
89
  bindSymbols(startIndex: number, maxIndex: number, existingSymbols: Symbols, prefix: string, produces: string[]): Symbols {
75
90
  let newSymbols: Symbols = {};
76
91
  let currentSymbols: Symbols = {...existingSymbols};
@@ -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
  }
@@ -1,4 +1,4 @@
1
- import { HotMeshGraph } from "../../types/hotmesh";
1
+ import { HotMeshGraph } from '../../types/hotmesh';
2
2
 
3
3
  class DimensionService {
4
4
 
@@ -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}`);
@@ -1,5 +1,5 @@
1
- import { JobOutput } from "../../types/job";
2
- import { HotMeshService as HotMesh } from "../hotmesh";
1
+ import { JobOutput } from '../../types/job';
2
+ import { HotMeshService as HotMesh } from '../hotmesh';
3
3
 
4
4
  export class WorkflowHandleService {
5
5
  hotMesh: HotMesh;
@@ -63,6 +63,7 @@ import {
63
63
  StreamError,
64
64
  StreamRole,
65
65
  StreamStatus } from '../../types/stream';
66
+ import { StringStringType } from '../../types';
66
67
 
67
68
  //wait time to see if a job is complete
68
69
  const OTT_WAIT_TIME = 1000;
@@ -408,21 +409,37 @@ class EngineService {
408
409
  }
409
410
 
410
411
  // ****************** `HOOK` ACTIVITY RE-ENTRY POINT *****************
411
- async hook(topic: string, data: JobData): Promise<JobStatus | void> {
412
+ async hook(topic: string, data: JobData, dad?: string): Promise<JobStatus | void> {
412
413
  const hookRule = await this.storeSignaler.getHookRule(topic);
414
+ const [aid, schema] = await this.getSchema(`.${hookRule.to}`);
415
+ if (!dad) {
416
+ //assume dimensional address is singular (0)
417
+ // for ancestors and self if not provided
418
+ // todo: register
419
+ dad = ',0'.repeat(schema.ancestors.length + 1);
420
+ }
413
421
  const streamData: StreamData = {
414
422
  type: StreamDataType.WEBHOOK,
415
- metadata: { aid: `${hookRule.to}`, topic },
423
+ metadata: {
424
+ //jid is unknown at this point; will be resolved using the data
425
+ aid,
426
+ dad,
427
+ topic
428
+ },
416
429
  data,
417
430
  };
418
431
  await this.streamSignaler.publishMessage(null, streamData);
419
432
  }
420
433
  async hookTime(jobId: string, activityId: string): Promise<JobStatus | void> {
434
+ //the activityid is concatenated with its dimensional address (dad); split to resolve
435
+ const [aid, ...dimensions] = activityId.split(',');
436
+ const dad = `,${dimensions.join(',')}`;
421
437
  const streamData: StreamData = {
422
438
  type: StreamDataType.TIMEHOOK,
423
439
  metadata: {
424
440
  jid: jobId,
425
- aid: activityId,
441
+ aid,
442
+ dad,
426
443
  },
427
444
  data: { timestamp: Date.now() },
428
445
  };
@@ -586,12 +603,13 @@ class EngineService {
586
603
  // (e.g, if {dimensions:true}, use hscan to deliver
587
604
  // the full set of dimensional job data)
588
605
  async getState(topic: string, jobId: string): Promise<JobOutput> {
589
- const { id: appId } = await this.getVID();
590
606
  const jobSymbols = await this.store.getSymbols(`$${topic}`);
591
607
  const consumes: Consumes = {
592
608
  [`$${topic}`]: Object.keys(jobSymbols)
593
609
  }
594
- const output = await this.store.getState(jobId, consumes);
610
+ //job data exists at the 'zero' dimension; pass an empty object
611
+ const dIds = {} as StringStringType;
612
+ const output = await this.store.getState(jobId, consumes, dIds);
595
613
  if (!output) {
596
614
  throw new Error(`not found ${jobId}`);
597
615
  }
@@ -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);
@@ -161,9 +161,9 @@ class HotMeshService {
161
161
  }
162
162
 
163
163
  // ****** `HOOK` ACTIVITY RE-ENTRY POINT ******
164
- async hook(topic: string, data: JobData): Promise<JobStatus | void> {
164
+ async hook(topic: string, data: JobData, dad?: string): Promise<JobStatus | void> {
165
165
  //return collation int
166
- return await this.engine?.hook(topic, data);
166
+ return await this.engine?.hook(topic, data, dad);
167
167
  }
168
168
  async hookAll(hookTopic: string, data: JobData, query: JobStatsInput, queryFacets: string[] = []): Promise<string[]> {
169
169
  return await this.engine?.hookAll(hookTopic, data, query, queryFacets);
@@ -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,5 +79,4 @@ class MapperService {
80
79
  }
81
80
  }
82
81
 
83
-
84
- export { MapperService }
82
+ export { MapperService }
@@ -1,4 +1,5 @@
1
1
  import { getSymVal } from '../../modules/utils';
2
+ import { Consumes } from '../../types/activity';
2
3
  import {
3
4
  StringStringType,
4
5
  StringAnyType,
@@ -26,16 +27,53 @@ export const MDATA_SYMBOLS = {
26
27
  };
27
28
 
28
29
  export class SerializerService {
30
+ dIds: StringStringType;
29
31
  symKeys: SymbolMaps;
30
32
  symReverseKeys: SymbolMaps;
31
33
  symValMaps: SymbolMap;
32
34
  symValReverseMaps: SymbolMap;
33
35
 
34
36
  constructor() {
35
- this.resetSymbols({}, {});
37
+ this.resetSymbols({}, {}, {});
36
38
  }
37
39
 
38
- resetSymbols(symKeys: SymbolSets, symVals: Symbols): void {
40
+ abbreviate(consumes: Consumes, symbolNames: string[], fields: string[] = []): string[] {
41
+ for (const symbolName of symbolNames) {
42
+ const symbolSet = this.symKeys.get(symbolName);
43
+ const symbolPaths = consumes[symbolName];
44
+ for (const symbolPath of symbolPaths) {
45
+ const abbreviation = symbolSet.get(symbolPath);
46
+ if (abbreviation) {
47
+ const dimensionalIndex = this.resolveDimensionalIndex(symbolPath);
48
+ fields.push(`${abbreviation}${dimensionalIndex}`);
49
+ } else {
50
+ fields.push(symbolPath);
51
+ }
52
+ }
53
+ }
54
+ return fields;
55
+ }
56
+
57
+ resolveDimensionalIndex(path: string): string {
58
+ if (this.isJobPath(path)) {
59
+ return '';
60
+ } else {
61
+ const [activityId] = path.split('/');
62
+ if (activityId in this.dIds) {
63
+ return this.dIds[activityId];
64
+ } else if ('$ADJACENT' in this.dIds) {
65
+ //else=> pre-authorizing adjacent activity entry
66
+ return this.dIds['$ADJACENT'];
67
+ }
68
+ return ',0';
69
+ }
70
+ }
71
+
72
+ isJobPath(path: string): boolean {
73
+ return path.startsWith('data/') || path.startsWith('metadata/');
74
+ }
75
+
76
+ resetSymbols(symKeys: SymbolSets, symVals: Symbols, dIds: StringStringType): void {
39
77
  this.symKeys = new Map();
40
78
  this.symReverseKeys = new Map();
41
79
  for (const id in symKeys) {
@@ -43,6 +81,7 @@ export class SerializerService {
43
81
  }
44
82
  this.symValMaps = new Map(Object.entries(symVals));
45
83
  this.symValReverseMaps = this.getReverseValueMap(this.symValMaps);
84
+ this.dIds = dIds;
46
85
  }
47
86
 
48
87
  getReverseKeyMap(keyMap: SymbolMap, id?: string): SymbolMap {
@@ -87,25 +126,23 @@ export class SerializerService {
87
126
  if (this.symKeys.size === 0) {
88
127
  return document;
89
128
  }
90
- let result: StringStringType = { ...document };
129
+ let source: StringStringType = { ...document };
130
+ let result: StringStringType = { };
91
131
 
92
- const compressWithMap = (abbreviationMap: SymbolMap) => {
93
- for (let key in result) {
94
- let safeKey = abbreviationMap.get(key) || key;
95
- let value = result[key];
96
- let safeValue = abbreviationMap.get(value) || value;
97
- if (safeKey !== key || safeValue !== value) {
98
- result[safeKey] = safeValue;
99
- if (safeKey !== key) {
100
- delete result[key];
132
+ const compressWithMap = (abbreviationMap: SymbolMap, id: string) => {
133
+ for (let key in source) {
134
+ if (key.startsWith(`${id}/`) || (id.startsWith('$') && ['data', 'metadata'].includes(key.split('/')[0]))) {
135
+ const dimensionalIndex = this.resolveDimensionalIndex(key);
136
+ let shortKey = abbreviationMap.get(key) || key;
137
+ const shortDimensionalKey = `${shortKey}${dimensionalIndex}`;
138
+ result[shortDimensionalKey] = source[key];
101
139
  }
102
- }
103
140
  }
104
141
  };
105
142
  for (let id of ids) {
106
143
  const abbreviationMap = this.symKeys.get(id);
107
144
  if (abbreviationMap) {
108
- compressWithMap(abbreviationMap);
145
+ compressWithMap(abbreviationMap, id);
109
146
  }
110
147
  }
111
148
  return result;
@@ -120,14 +157,12 @@ export class SerializerService {
120
157
  const inflateWithMap = (abbreviationMap: SymbolMap, id: string) => {
121
158
  const reversedAbbreviationMap = this.getReverseKeyMap(abbreviationMap, id);
122
159
  for (let key in result) {
123
- let safeKey = reversedAbbreviationMap.get(key) || key;
124
- let value = result[key];
125
- let safeValue = reversedAbbreviationMap.get(value) || value;
126
- if (safeKey !== key || safeValue !== value) {
127
- result[safeKey] = safeValue;
128
- if (safeKey !== key) {
129
- delete result[key];
130
- }
160
+ //strip dimensional index from key
161
+ const shortKey = key.split(',')[0];
162
+ let longKey = reversedAbbreviationMap.get(shortKey);
163
+ if (longKey) {
164
+ result[longKey] = result[key];
165
+ delete result[key];
131
166
  }
132
167
  }
133
168
  };
@@ -150,6 +150,7 @@ class StreamSignaler {
150
150
  try {
151
151
  output = await callback(input);
152
152
  } catch (err) {
153
+ console.error(err);
153
154
  this.logger.error(`stream-call-function-error`, { stream, id, err });
154
155
  output = this.structureUnhandledError(input, err);
155
156
  }
@@ -175,9 +175,9 @@ abstract class StoreService<T, U extends AbstractRedisClient> {
175
175
  if (settings) {
176
176
  return settings;
177
177
  } else {
178
- if (bCreate) {
179
- const packageJson = await import('../../package.json');
180
- const version: string = packageJson.version;
178
+ if (bCreate) {
179
+ const packageJson = await import('../../package.json');
180
+ const version: string = packageJson['version'] || '0.0.0';
181
181
  settings = { namespace: PSNS, version } as HotMeshSettings;
182
182
  await this.setSettings(settings);
183
183
  return settings;
@@ -452,12 +452,12 @@ abstract class StoreService<T, U extends AbstractRedisClient> {
452
452
  return Number(status);
453
453
  }
454
454
 
455
- async setState({ ...state }: StringAnyType, status: number | null, jobId: string, appId: string, symbolNames: string[], multi? : U): Promise<string> {
455
+ async setState({ ...state }: StringAnyType, status: number | null, jobId: string, symbolNames: string[], dIds: StringStringType, multi? : U): Promise<string> {
456
456
  delete state['metadata/js'];
457
- const hashKey = this.mintKey(KeyType.JOB_STATE, { appId, jobId });
457
+ const hashKey = this.mintKey(KeyType.JOB_STATE, { appId: this.appId, jobId });
458
458
  const symKeys = await this.getSymbolKeys(symbolNames);
459
459
  const symVals = await this.getSymbolValues();
460
- this.serializer.resetSymbols(symKeys, symVals);
460
+ this.serializer.resetSymbols(symKeys, symVals, dIds);
461
461
 
462
462
  const hashData = this.serializer.package(state, symbolNames);
463
463
  if (status !== null) {
@@ -469,26 +469,14 @@ abstract class StoreService<T, U extends AbstractRedisClient> {
469
469
  return jobId;
470
470
  }
471
471
 
472
- async getState(jobId: string, consumes: Consumes): Promise<[StringAnyType, number] | undefined> {
473
- //todo: refactor into semantic submethods
472
+ async getState(jobId: string, consumes: Consumes, dIds: StringStringType): Promise<[StringAnyType, number] | undefined> {
473
+ //get abbreviated field list (the symbols for the paths)
474
474
  const key = this.mintKey(KeyType.JOB_STATE, { appId: this.appId, jobId });
475
475
  const symbolNames = Object.keys(consumes);
476
476
  const symKeys = await this.getSymbolKeys(symbolNames);
477
+ this.serializer.resetSymbols(symKeys, {}, dIds);
478
+ const fields = this.serializer.abbreviate(consumes, symbolNames, [':']);
477
479
 
478
- //always fetch the job status (':') when fetching state
479
- const fields = [':'];
480
- for (const symbolName of symbolNames) {
481
- const symbolSet = symKeys[symbolName];
482
- const symbolPaths = consumes[symbolName];
483
- for (const symbolPath of symbolPaths) {
484
- const abbreviation = symbolSet[symbolPath];
485
- if (abbreviation) {
486
- fields.push(abbreviation);
487
- } else {
488
- fields.push(symbolPath);
489
- }
490
- }
491
- }
492
480
  const jobDataArray = await this.redisClient[this.commands.hmget](key, fields);
493
481
  const jobData: StringAnyType = {};
494
482
  let atLeast1 = false; //if status field (':') isn't present assume 404
@@ -500,7 +488,7 @@ abstract class StoreService<T, U extends AbstractRedisClient> {
500
488
  });
501
489
  if (atLeast1) {
502
490
  const symVals = await this.getSymbolValues();
503
- this.serializer.resetSymbols(symKeys, symVals);
491
+ this.serializer.resetSymbols(symKeys, symVals, dIds);
504
492
  const state = this.serializer.unpackage(jobData, symbolNames);
505
493
  let status = 0;
506
494
  if (state[':']) {
@@ -512,13 +500,13 @@ abstract class StoreService<T, U extends AbstractRedisClient> {
512
500
  }
513
501
  }
514
502
 
515
- async collate(jobId: string, activityId: string, amount: number, multi? : U): Promise<number> {
503
+ async collate(jobId: string, activityId: string, amount: number, dIds: StringStringType, multi? : U): Promise<number> {
516
504
  const jobKey = this.mintKey(KeyType.JOB_STATE, { appId: this.appId, jobId });
517
505
  const collationKey = `${activityId}/output/metadata/as`; //activity state
518
506
  const symbolNames = [activityId];
519
507
  const symKeys = await this.getSymbolKeys(symbolNames);
520
508
  const symVals = await this.getSymbolValues();
521
- this.serializer.resetSymbols(symKeys, symVals);
509
+ this.serializer.resetSymbols(symKeys, symVals, dIds);
522
510
 
523
511
  const payload = { [collationKey]: amount.toString() }
524
512
  const hashData = this.serializer.package(payload, symbolNames);
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "module": "commonjs",
5
+ "outDir": "./build/cjs",
6
+ "resolveJsonModule": true
7
+ }
8
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "resolveJsonModule": true,
5
+ "moduleResolution": "NodeNext",
6
+ "module": "ESNext",
7
+ "outDir": "./build/esm"
8
+ }
9
+ }
package/types/activity.ts CHANGED
@@ -26,6 +26,7 @@ interface BaseActivity {
26
26
  subscribes?: string; //compiler
27
27
  trigger?: string; //compiler
28
28
  parent?: string; //compiler
29
+ ancestors?: string[]; //compiler
29
30
  }
30
31
 
31
32
  interface Measure {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes