@hotmeshio/hotmesh 0.0.8 → 0.0.10

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 (362) hide show
  1. package/LICENSE +4 -7
  2. package/README.md +82 -85
  3. package/build/{cjs/modules → modules}/key.d.ts +2 -2
  4. package/build/{cjs/modules → modules}/key.js +3 -3
  5. package/build/{esm/package.json → package.json} +4 -11
  6. package/build/{cjs/services → services}/durable/native.js +2 -3
  7. package/build/{esm/services → services}/durable/worker.d.ts +1 -3
  8. package/build/{cjs/services → services}/durable/worker.js +9 -33
  9. package/build/{cjs/services → services}/durable/workflow.js +6 -1
  10. package/build/{cjs/services → services}/hotmesh/index.js +1 -1
  11. package/build/{cjs/services → services}/store/index.js +2 -2
  12. package/build/{cjs/services → services}/stream/clients/ioredis.js +1 -1
  13. package/build/{cjs/services → services}/stream/clients/redis.js +1 -1
  14. package/build/{cjs/services → services}/sub/clients/ioredis.js +1 -1
  15. package/build/{cjs/services → services}/sub/clients/redis.js +1 -1
  16. package/build/{cjs/types → types}/durable.d.ts +5 -7
  17. package/modules/key.ts +2 -2
  18. package/package.json +4 -11
  19. package/services/durable/native.ts +2 -3
  20. package/services/durable/worker.ts +9 -10
  21. package/services/durable/workflow.ts +7 -1
  22. package/services/hotmesh/index.ts +2 -2
  23. package/services/store/index.ts +3 -3
  24. package/services/stream/clients/ioredis.ts +2 -2
  25. package/services/stream/clients/redis.ts +2 -2
  26. package/services/sub/clients/ioredis.ts +2 -2
  27. package/services/sub/clients/redis.ts +2 -2
  28. package/types/durable.ts +5 -5
  29. package/build/cjs/package.json +0 -82
  30. package/build/cjs/services/durable/worker.d.ts +0 -38
  31. package/build/esm/index.d.ts +0 -4
  32. package/build/esm/index.js +0 -3
  33. package/build/esm/modules/errors.d.ts +0 -28
  34. package/build/esm/modules/errors.js +0 -41
  35. package/build/esm/modules/key.d.ts +0 -75
  36. package/build/esm/modules/key.js +0 -111
  37. package/build/esm/modules/utils.d.ts +0 -34
  38. package/build/esm/modules/utils.js +0 -154
  39. package/build/esm/services/activities/activity.d.ts +0 -67
  40. package/build/esm/services/activities/activity.js +0 -486
  41. package/build/esm/services/activities/await.d.ts +0 -16
  42. package/build/esm/services/activities/await.js +0 -140
  43. package/build/esm/services/activities/cycle.d.ts +0 -19
  44. package/build/esm/services/activities/cycle.js +0 -74
  45. package/build/esm/services/activities/emit.d.ts +0 -9
  46. package/build/esm/services/activities/emit.js +0 -10
  47. package/build/esm/services/activities/index.d.ts +0 -17
  48. package/build/esm/services/activities/index.js +0 -16
  49. package/build/esm/services/activities/iterate.d.ts +0 -9
  50. package/build/esm/services/activities/iterate.js +0 -10
  51. package/build/esm/services/activities/trigger.d.ts +0 -22
  52. package/build/esm/services/activities/trigger.js +0 -158
  53. package/build/esm/services/activities/worker.d.ts +0 -11
  54. package/build/esm/services/activities/worker.js +0 -70
  55. package/build/esm/services/collator/index.d.ts +0 -73
  56. package/build/esm/services/collator/index.js +0 -221
  57. package/build/esm/services/compiler/deployer.d.ts +0 -36
  58. package/build/esm/services/compiler/deployer.js +0 -423
  59. package/build/esm/services/compiler/index.d.ts +0 -30
  60. package/build/esm/services/compiler/index.js +0 -82
  61. package/build/esm/services/compiler/validator.d.ts +0 -32
  62. package/build/esm/services/compiler/validator.js +0 -131
  63. package/build/esm/services/connector/clients/ioredis.d.ts +0 -13
  64. package/build/esm/services/connector/clients/ioredis.js +0 -47
  65. package/build/esm/services/connector/clients/redis.d.ts +0 -13
  66. package/build/esm/services/connector/clients/redis.js +0 -59
  67. package/build/esm/services/connector/index.d.ts +0 -5
  68. package/build/esm/services/connector/index.js +0 -27
  69. package/build/esm/services/dimension/index.d.ts +0 -29
  70. package/build/esm/services/dimension/index.js +0 -32
  71. package/build/esm/services/durable/asyncLocalStorage.d.ts +0 -3
  72. package/build/esm/services/durable/asyncLocalStorage.js +0 -2
  73. package/build/esm/services/durable/client.d.ts +0 -15
  74. package/build/esm/services/durable/client.js +0 -114
  75. package/build/esm/services/durable/connection.d.ts +0 -4
  76. package/build/esm/services/durable/connection.js +0 -47
  77. package/build/esm/services/durable/factory.d.ts +0 -3
  78. package/build/esm/services/durable/factory.js +0 -135
  79. package/build/esm/services/durable/handle.d.ts +0 -8
  80. package/build/esm/services/durable/handle.js +0 -34
  81. package/build/esm/services/durable/index.d.ts +0 -57
  82. package/build/esm/services/durable/index.js +0 -55
  83. package/build/esm/services/durable/native.d.ts +0 -4
  84. package/build/esm/services/durable/native.js +0 -43
  85. package/build/esm/services/durable/worker.js +0 -267
  86. package/build/esm/services/durable/workflow.d.ts +0 -6
  87. package/build/esm/services/durable/workflow.js +0 -132
  88. package/build/esm/services/engine/index.d.ts +0 -82
  89. package/build/esm/services/engine/index.js +0 -522
  90. package/build/esm/services/hotmesh/index.d.ts +0 -45
  91. package/build/esm/services/hotmesh/index.js +0 -131
  92. package/build/esm/services/logger/index.d.ts +0 -17
  93. package/build/esm/services/logger/index.js +0 -70
  94. package/build/esm/services/mapper/index.d.ts +0 -24
  95. package/build/esm/services/mapper/index.js +0 -72
  96. package/build/esm/services/pipe/functions/array.d.ts +0 -24
  97. package/build/esm/services/pipe/functions/array.js +0 -66
  98. package/build/esm/services/pipe/functions/bitwise.d.ts +0 -9
  99. package/build/esm/services/pipe/functions/bitwise.js +0 -21
  100. package/build/esm/services/pipe/functions/conditional.d.ts +0 -10
  101. package/build/esm/services/pipe/functions/conditional.js +0 -24
  102. package/build/esm/services/pipe/functions/date.d.ts +0 -57
  103. package/build/esm/services/pipe/functions/date.js +0 -164
  104. package/build/esm/services/pipe/functions/index.d.ts +0 -25
  105. package/build/esm/services/pipe/functions/index.js +0 -24
  106. package/build/esm/services/pipe/functions/json.d.ts +0 -5
  107. package/build/esm/services/pipe/functions/json.js +0 -9
  108. package/build/esm/services/pipe/functions/math.d.ts +0 -38
  109. package/build/esm/services/pipe/functions/math.js +0 -108
  110. package/build/esm/services/pipe/functions/number.d.ts +0 -25
  111. package/build/esm/services/pipe/functions/number.js +0 -130
  112. package/build/esm/services/pipe/functions/object.d.ts +0 -22
  113. package/build/esm/services/pipe/functions/object.js +0 -60
  114. package/build/esm/services/pipe/functions/string.d.ts +0 -23
  115. package/build/esm/services/pipe/functions/string.js +0 -66
  116. package/build/esm/services/pipe/functions/symbol.d.ts +0 -12
  117. package/build/esm/services/pipe/functions/symbol.js +0 -30
  118. package/build/esm/services/pipe/functions/unary.d.ts +0 -7
  119. package/build/esm/services/pipe/functions/unary.js +0 -15
  120. package/build/esm/services/pipe/index.d.ts +0 -30
  121. package/build/esm/services/pipe/index.js +0 -122
  122. package/build/esm/services/quorum/index.d.ts +0 -34
  123. package/build/esm/services/quorum/index.js +0 -144
  124. package/build/esm/services/reporter/index.d.ts +0 -47
  125. package/build/esm/services/reporter/index.js +0 -327
  126. package/build/esm/services/serializer/index.d.ts +0 -41
  127. package/build/esm/services/serializer/index.js +0 -251
  128. package/build/esm/services/signaler/store.d.ts +0 -15
  129. package/build/esm/services/signaler/store.js +0 -50
  130. package/build/esm/services/signaler/stream.d.ts +0 -43
  131. package/build/esm/services/signaler/stream.js +0 -314
  132. package/build/esm/services/store/cache.d.ts +0 -66
  133. package/build/esm/services/store/cache.js +0 -124
  134. package/build/esm/services/store/clients/ioredis.d.ts +0 -27
  135. package/build/esm/services/store/clients/ioredis.js +0 -93
  136. package/build/esm/services/store/clients/redis.d.ts +0 -29
  137. package/build/esm/services/store/clients/redis.js +0 -140
  138. package/build/esm/services/store/index.d.ts +0 -88
  139. package/build/esm/services/store/index.js +0 -623
  140. package/build/esm/services/stream/clients/ioredis.d.ts +0 -23
  141. package/build/esm/services/stream/clients/ioredis.js +0 -112
  142. package/build/esm/services/stream/clients/redis.d.ts +0 -23
  143. package/build/esm/services/stream/clients/redis.js +0 -116
  144. package/build/esm/services/stream/index.d.ts +0 -21
  145. package/build/esm/services/stream/index.js +0 -6
  146. package/build/esm/services/sub/clients/ioredis.d.ts +0 -20
  147. package/build/esm/services/sub/clients/ioredis.js +0 -69
  148. package/build/esm/services/sub/clients/redis.d.ts +0 -20
  149. package/build/esm/services/sub/clients/redis.js +0 -60
  150. package/build/esm/services/sub/index.d.ts +0 -18
  151. package/build/esm/services/sub/index.js +0 -6
  152. package/build/esm/services/task/index.d.ts +0 -18
  153. package/build/esm/services/task/index.js +0 -70
  154. package/build/esm/services/telemetry/index.d.ts +0 -49
  155. package/build/esm/services/telemetry/index.js +0 -217
  156. package/build/esm/services/worker/index.d.ts +0 -30
  157. package/build/esm/services/worker/index.js +0 -102
  158. package/build/esm/types/activity.d.ts +0 -92
  159. package/build/esm/types/activity.js +0 -1
  160. package/build/esm/types/app.d.ts +0 -16
  161. package/build/esm/types/app.js +0 -1
  162. package/build/esm/types/async.d.ts +0 -5
  163. package/build/esm/types/async.js +0 -1
  164. package/build/esm/types/cache.d.ts +0 -1
  165. package/build/esm/types/cache.js +0 -1
  166. package/build/esm/types/collator.d.ts +0 -8
  167. package/build/esm/types/collator.js +0 -8
  168. package/build/esm/types/durable.d.ts +0 -59
  169. package/build/esm/types/durable.js +0 -1
  170. package/build/esm/types/hook.d.ts +0 -31
  171. package/build/esm/types/hook.js +0 -6
  172. package/build/esm/types/hotmesh.d.ts +0 -82
  173. package/build/esm/types/hotmesh.js +0 -1
  174. package/build/esm/types/index.d.ts +0 -20
  175. package/build/esm/types/index.js +0 -5
  176. package/build/esm/types/ioredisclient.d.ts +0 -5
  177. package/build/esm/types/ioredisclient.js +0 -2
  178. package/build/esm/types/job.d.ts +0 -50
  179. package/build/esm/types/job.js +0 -1
  180. package/build/esm/types/logger.d.ts +0 -6
  181. package/build/esm/types/logger.js +0 -1
  182. package/build/esm/types/map.d.ts +0 -4
  183. package/build/esm/types/map.js +0 -1
  184. package/build/esm/types/pipe.d.ts +0 -4
  185. package/build/esm/types/pipe.js +0 -1
  186. package/build/esm/types/quorum.d.ts +0 -46
  187. package/build/esm/types/quorum.js +0 -1
  188. package/build/esm/types/redis.d.ts +0 -8
  189. package/build/esm/types/redis.js +0 -1
  190. package/build/esm/types/redisclient.d.ts +0 -25
  191. package/build/esm/types/redisclient.js +0 -1
  192. package/build/esm/types/serializer.d.ts +0 -33
  193. package/build/esm/types/serializer.js +0 -1
  194. package/build/esm/types/stats.d.ts +0 -83
  195. package/build/esm/types/stats.js +0 -1
  196. package/build/esm/types/stream.d.ts +0 -67
  197. package/build/esm/types/stream.js +0 -22
  198. package/build/esm/types/telemetry.d.ts +0 -1
  199. package/build/esm/types/telemetry.js +0 -1
  200. package/build/esm/types/transition.d.ts +0 -17
  201. package/build/esm/types/transition.js +0 -1
  202. package/tsconfig.cjs.json +0 -8
  203. package/tsconfig.esm.json +0 -9
  204. /package/build/{cjs/index.d.ts → index.d.ts} +0 -0
  205. /package/build/{cjs/index.js → index.js} +0 -0
  206. /package/build/{cjs/modules → modules}/errors.d.ts +0 -0
  207. /package/build/{cjs/modules → modules}/errors.js +0 -0
  208. /package/build/{cjs/modules → modules}/utils.d.ts +0 -0
  209. /package/build/{cjs/modules → modules}/utils.js +0 -0
  210. /package/build/{cjs/services → services}/activities/activity.d.ts +0 -0
  211. /package/build/{cjs/services → services}/activities/activity.js +0 -0
  212. /package/build/{cjs/services → services}/activities/await.d.ts +0 -0
  213. /package/build/{cjs/services → services}/activities/await.js +0 -0
  214. /package/build/{cjs/services → services}/activities/cycle.d.ts +0 -0
  215. /package/build/{cjs/services → services}/activities/cycle.js +0 -0
  216. /package/build/{cjs/services → services}/activities/emit.d.ts +0 -0
  217. /package/build/{cjs/services → services}/activities/emit.js +0 -0
  218. /package/build/{cjs/services → services}/activities/index.d.ts +0 -0
  219. /package/build/{cjs/services → services}/activities/index.js +0 -0
  220. /package/build/{cjs/services → services}/activities/iterate.d.ts +0 -0
  221. /package/build/{cjs/services → services}/activities/iterate.js +0 -0
  222. /package/build/{cjs/services → services}/activities/trigger.d.ts +0 -0
  223. /package/build/{cjs/services → services}/activities/trigger.js +0 -0
  224. /package/build/{cjs/services → services}/activities/worker.d.ts +0 -0
  225. /package/build/{cjs/services → services}/activities/worker.js +0 -0
  226. /package/build/{cjs/services → services}/collator/index.d.ts +0 -0
  227. /package/build/{cjs/services → services}/collator/index.js +0 -0
  228. /package/build/{cjs/services → services}/compiler/deployer.d.ts +0 -0
  229. /package/build/{cjs/services → services}/compiler/deployer.js +0 -0
  230. /package/build/{cjs/services → services}/compiler/index.d.ts +0 -0
  231. /package/build/{cjs/services → services}/compiler/index.js +0 -0
  232. /package/build/{cjs/services → services}/compiler/validator.d.ts +0 -0
  233. /package/build/{cjs/services → services}/compiler/validator.js +0 -0
  234. /package/build/{cjs/services → services}/connector/clients/ioredis.d.ts +0 -0
  235. /package/build/{cjs/services → services}/connector/clients/ioredis.js +0 -0
  236. /package/build/{cjs/services → services}/connector/clients/redis.d.ts +0 -0
  237. /package/build/{cjs/services → services}/connector/clients/redis.js +0 -0
  238. /package/build/{cjs/services → services}/connector/index.d.ts +0 -0
  239. /package/build/{cjs/services → services}/connector/index.js +0 -0
  240. /package/build/{cjs/services → services}/dimension/index.d.ts +0 -0
  241. /package/build/{cjs/services → services}/dimension/index.js +0 -0
  242. /package/build/{cjs/services → services}/durable/asyncLocalStorage.d.ts +0 -0
  243. /package/build/{cjs/services → services}/durable/asyncLocalStorage.js +0 -0
  244. /package/build/{cjs/services → services}/durable/client.d.ts +0 -0
  245. /package/build/{cjs/services → services}/durable/client.js +0 -0
  246. /package/build/{cjs/services → services}/durable/connection.d.ts +0 -0
  247. /package/build/{cjs/services → services}/durable/connection.js +0 -0
  248. /package/build/{cjs/services → services}/durable/factory.d.ts +0 -0
  249. /package/build/{cjs/services → services}/durable/factory.js +0 -0
  250. /package/build/{cjs/services → services}/durable/handle.d.ts +0 -0
  251. /package/build/{cjs/services → services}/durable/handle.js +0 -0
  252. /package/build/{cjs/services → services}/durable/index.d.ts +0 -0
  253. /package/build/{cjs/services → services}/durable/index.js +0 -0
  254. /package/build/{cjs/services → services}/durable/native.d.ts +0 -0
  255. /package/build/{cjs/services → services}/durable/workflow.d.ts +0 -0
  256. /package/build/{cjs/services → services}/engine/index.d.ts +0 -0
  257. /package/build/{cjs/services → services}/engine/index.js +0 -0
  258. /package/build/{cjs/services → services}/hotmesh/index.d.ts +0 -0
  259. /package/build/{cjs/services → services}/logger/index.d.ts +0 -0
  260. /package/build/{cjs/services → services}/logger/index.js +0 -0
  261. /package/build/{cjs/services → services}/mapper/index.d.ts +0 -0
  262. /package/build/{cjs/services → services}/mapper/index.js +0 -0
  263. /package/build/{cjs/services → services}/pipe/functions/array.d.ts +0 -0
  264. /package/build/{cjs/services → services}/pipe/functions/array.js +0 -0
  265. /package/build/{cjs/services → services}/pipe/functions/bitwise.d.ts +0 -0
  266. /package/build/{cjs/services → services}/pipe/functions/bitwise.js +0 -0
  267. /package/build/{cjs/services → services}/pipe/functions/conditional.d.ts +0 -0
  268. /package/build/{cjs/services → services}/pipe/functions/conditional.js +0 -0
  269. /package/build/{cjs/services → services}/pipe/functions/date.d.ts +0 -0
  270. /package/build/{cjs/services → services}/pipe/functions/date.js +0 -0
  271. /package/build/{cjs/services → services}/pipe/functions/index.d.ts +0 -0
  272. /package/build/{cjs/services → services}/pipe/functions/index.js +0 -0
  273. /package/build/{cjs/services → services}/pipe/functions/json.d.ts +0 -0
  274. /package/build/{cjs/services → services}/pipe/functions/json.js +0 -0
  275. /package/build/{cjs/services → services}/pipe/functions/math.d.ts +0 -0
  276. /package/build/{cjs/services → services}/pipe/functions/math.js +0 -0
  277. /package/build/{cjs/services → services}/pipe/functions/number.d.ts +0 -0
  278. /package/build/{cjs/services → services}/pipe/functions/number.js +0 -0
  279. /package/build/{cjs/services → services}/pipe/functions/object.d.ts +0 -0
  280. /package/build/{cjs/services → services}/pipe/functions/object.js +0 -0
  281. /package/build/{cjs/services → services}/pipe/functions/string.d.ts +0 -0
  282. /package/build/{cjs/services → services}/pipe/functions/string.js +0 -0
  283. /package/build/{cjs/services → services}/pipe/functions/symbol.d.ts +0 -0
  284. /package/build/{cjs/services → services}/pipe/functions/symbol.js +0 -0
  285. /package/build/{cjs/services → services}/pipe/functions/unary.d.ts +0 -0
  286. /package/build/{cjs/services → services}/pipe/functions/unary.js +0 -0
  287. /package/build/{cjs/services → services}/pipe/index.d.ts +0 -0
  288. /package/build/{cjs/services → services}/pipe/index.js +0 -0
  289. /package/build/{cjs/services → services}/quorum/index.d.ts +0 -0
  290. /package/build/{cjs/services → services}/quorum/index.js +0 -0
  291. /package/build/{cjs/services → services}/reporter/index.d.ts +0 -0
  292. /package/build/{cjs/services → services}/reporter/index.js +0 -0
  293. /package/build/{cjs/services → services}/serializer/index.d.ts +0 -0
  294. /package/build/{cjs/services → services}/serializer/index.js +0 -0
  295. /package/build/{cjs/services → services}/signaler/store.d.ts +0 -0
  296. /package/build/{cjs/services → services}/signaler/store.js +0 -0
  297. /package/build/{cjs/services → services}/signaler/stream.d.ts +0 -0
  298. /package/build/{cjs/services → services}/signaler/stream.js +0 -0
  299. /package/build/{cjs/services → services}/store/cache.d.ts +0 -0
  300. /package/build/{cjs/services → services}/store/cache.js +0 -0
  301. /package/build/{cjs/services → services}/store/clients/ioredis.d.ts +0 -0
  302. /package/build/{cjs/services → services}/store/clients/ioredis.js +0 -0
  303. /package/build/{cjs/services → services}/store/clients/redis.d.ts +0 -0
  304. /package/build/{cjs/services → services}/store/clients/redis.js +0 -0
  305. /package/build/{cjs/services → services}/store/index.d.ts +0 -0
  306. /package/build/{cjs/services → services}/stream/clients/ioredis.d.ts +0 -0
  307. /package/build/{cjs/services → services}/stream/clients/redis.d.ts +0 -0
  308. /package/build/{cjs/services → services}/stream/index.d.ts +0 -0
  309. /package/build/{cjs/services → services}/stream/index.js +0 -0
  310. /package/build/{cjs/services → services}/sub/clients/ioredis.d.ts +0 -0
  311. /package/build/{cjs/services → services}/sub/clients/redis.d.ts +0 -0
  312. /package/build/{cjs/services → services}/sub/index.d.ts +0 -0
  313. /package/build/{cjs/services → services}/sub/index.js +0 -0
  314. /package/build/{cjs/services → services}/task/index.d.ts +0 -0
  315. /package/build/{cjs/services → services}/task/index.js +0 -0
  316. /package/build/{cjs/services → services}/telemetry/index.d.ts +0 -0
  317. /package/build/{cjs/services → services}/telemetry/index.js +0 -0
  318. /package/build/{cjs/services → services}/worker/index.d.ts +0 -0
  319. /package/build/{cjs/services → services}/worker/index.js +0 -0
  320. /package/build/{cjs/types → types}/activity.d.ts +0 -0
  321. /package/build/{cjs/types → types}/activity.js +0 -0
  322. /package/build/{cjs/types → types}/app.d.ts +0 -0
  323. /package/build/{cjs/types → types}/app.js +0 -0
  324. /package/build/{cjs/types → types}/async.d.ts +0 -0
  325. /package/build/{cjs/types → types}/async.js +0 -0
  326. /package/build/{cjs/types → types}/cache.d.ts +0 -0
  327. /package/build/{cjs/types → types}/cache.js +0 -0
  328. /package/build/{cjs/types → types}/collator.d.ts +0 -0
  329. /package/build/{cjs/types → types}/collator.js +0 -0
  330. /package/build/{cjs/types → types}/durable.js +0 -0
  331. /package/build/{cjs/types → types}/hook.d.ts +0 -0
  332. /package/build/{cjs/types → types}/hook.js +0 -0
  333. /package/build/{cjs/types → types}/hotmesh.d.ts +0 -0
  334. /package/build/{cjs/types → types}/hotmesh.js +0 -0
  335. /package/build/{cjs/types → types}/index.d.ts +0 -0
  336. /package/build/{cjs/types → types}/index.js +0 -0
  337. /package/build/{cjs/types → types}/ioredisclient.d.ts +0 -0
  338. /package/build/{cjs/types → types}/ioredisclient.js +0 -0
  339. /package/build/{cjs/types → types}/job.d.ts +0 -0
  340. /package/build/{cjs/types → types}/job.js +0 -0
  341. /package/build/{cjs/types → types}/logger.d.ts +0 -0
  342. /package/build/{cjs/types → types}/logger.js +0 -0
  343. /package/build/{cjs/types → types}/map.d.ts +0 -0
  344. /package/build/{cjs/types → types}/map.js +0 -0
  345. /package/build/{cjs/types → types}/pipe.d.ts +0 -0
  346. /package/build/{cjs/types → types}/pipe.js +0 -0
  347. /package/build/{cjs/types → types}/quorum.d.ts +0 -0
  348. /package/build/{cjs/types → types}/quorum.js +0 -0
  349. /package/build/{cjs/types → types}/redis.d.ts +0 -0
  350. /package/build/{cjs/types → types}/redis.js +0 -0
  351. /package/build/{cjs/types → types}/redisclient.d.ts +0 -0
  352. /package/build/{cjs/types → types}/redisclient.js +0 -0
  353. /package/build/{cjs/types → types}/serializer.d.ts +0 -0
  354. /package/build/{cjs/types → types}/serializer.js +0 -0
  355. /package/build/{cjs/types → types}/stats.d.ts +0 -0
  356. /package/build/{cjs/types → types}/stats.js +0 -0
  357. /package/build/{cjs/types → types}/stream.d.ts +0 -0
  358. /package/build/{cjs/types → types}/stream.js +0 -0
  359. /package/build/{cjs/types → types}/telemetry.d.ts +0 -0
  360. /package/build/{cjs/types → types}/telemetry.js +0 -0
  361. /package/build/{cjs/types → types}/transition.d.ts +0 -0
  362. /package/build/{cjs/types → types}/transition.js +0 -0
@@ -1,5 +1,5 @@
1
1
  import { v4 as uuidv4 } from 'uuid';
2
- import { PSNS } from '../../modules/key';
2
+ import { HMNS } from '../../modules/key';
3
3
  import { EngineService } from '../engine';
4
4
  import { LoggerService, ILogger } from '../logger';
5
5
  import { StreamSignaler } from '../signaler/stream';
@@ -33,7 +33,7 @@ class HotMeshService {
33
33
 
34
34
  verifyAndSetNamespace(namespace?: string) {
35
35
  if (!namespace) {
36
- this.namespace = PSNS;
36
+ this.namespace = HMNS;
37
37
  } else if (!namespace.match(/^[A-Za-z0-9-]+$/)) {
38
38
  throw new Error(`config.namespace [${namespace}] is invalid`);
39
39
  } else {
@@ -2,7 +2,7 @@ import {
2
2
  KeyService,
3
3
  KeyStoreParams,
4
4
  KeyType,
5
- PSNS} from '../../modules/key';
5
+ HMNS} from '../../modules/key';
6
6
  import { ILogger } from '../logger';
7
7
  import { MDATA_SYMBOLS, SerializerService as Serializer } from '../serializer';
8
8
  import { Cache } from './cache';
@@ -119,7 +119,7 @@ abstract class StoreService<T, U extends AbstractRedisClient> {
119
119
  this.redisClient = redisClient;
120
120
  }
121
121
 
122
- async init(namespace = PSNS, appId: string, logger: ILogger): Promise<HotMeshApps> {
122
+ async init(namespace = HMNS, appId: string, logger: ILogger): Promise<HotMeshApps> {
123
123
  this.namespace = namespace;
124
124
  this.appId = appId;
125
125
  this.logger = logger;
@@ -178,7 +178,7 @@ abstract class StoreService<T, U extends AbstractRedisClient> {
178
178
  if (bCreate) {
179
179
  const packageJson = await import('../../package.json');
180
180
  const version: string = packageJson['version'] || '0.0.0';
181
- settings = { namespace: PSNS, version } as HotMeshSettings;
181
+ settings = { namespace: HMNS, version } as HotMeshSettings;
182
182
  await this.setSettings(settings);
183
183
  return settings;
184
184
  }
@@ -1,4 +1,4 @@
1
- import { KeyService, KeyStoreParams, KeyType, PSNS } from '../../../modules/key';
1
+ import { KeyService, KeyStoreParams, KeyType, HMNS } from '../../../modules/key';
2
2
  import { ILogger } from '../../logger';
3
3
  import { StreamService } from '../index';
4
4
  import { RedisClientType, RedisMultiType } from '../../../types/ioredisclient';
@@ -14,7 +14,7 @@ class IORedisStreamService extends StreamService<RedisClientType, RedisMultiType
14
14
  super(redisClient);
15
15
  }
16
16
 
17
- async init(namespace = PSNS, appId: string, logger: ILogger): Promise<void> {
17
+ async init(namespace = HMNS, appId: string, logger: ILogger): Promise<void> {
18
18
  this.namespace = namespace;
19
19
  this.logger = logger;
20
20
  this.appId = appId;
@@ -1,4 +1,4 @@
1
- import { KeyService, KeyStoreParams, KeyType, PSNS } from '../../../modules/key';
1
+ import { KeyService, KeyStoreParams, KeyType, HMNS } from '../../../modules/key';
2
2
  import { ILogger } from '../../logger';
3
3
  import { StreamService } from '../index';
4
4
  import { RedisClientType, RedisMultiType } from '../../../types/redisclient';
@@ -14,7 +14,7 @@ class RedisStreamService extends StreamService<RedisClientType, RedisMultiType>
14
14
  super(redisClient);
15
15
  }
16
16
 
17
- async init(namespace = PSNS, appId: string, logger: ILogger): Promise<void> {
17
+ async init(namespace = HMNS, appId: string, logger: ILogger): Promise<void> {
18
18
  this.namespace = namespace;
19
19
  this.logger = logger;
20
20
  this.appId = appId;
@@ -1,4 +1,4 @@
1
- import { KeyService, KeyStoreParams, KeyType, PSNS } from '../../../modules/key';
1
+ import { KeyService, KeyStoreParams, KeyType, HMNS } from '../../../modules/key';
2
2
  import { ILogger } from '../../logger';
3
3
  import { SubService } from '../index';
4
4
  import { RedisClientType, RedisMultiType } from '../../../types/ioredisclient';
@@ -14,7 +14,7 @@ class IORedisSubService extends SubService<RedisClientType, RedisMultiType> {
14
14
  super(redisClient);
15
15
  }
16
16
 
17
- async init(namespace = PSNS, appId: string, engineId: string, logger: ILogger): Promise<void> {
17
+ async init(namespace = HMNS, appId: string, engineId: string, logger: ILogger): Promise<void> {
18
18
  this.namespace = namespace;
19
19
  this.logger = logger;
20
20
  this.appId = appId;
@@ -1,4 +1,4 @@
1
- import { KeyService, KeyStoreParams, KeyType, PSNS } from '../../../modules/key';
1
+ import { KeyService, KeyStoreParams, KeyType, HMNS } from '../../../modules/key';
2
2
  import { ILogger } from '../../logger';
3
3
  import { SubService } from '../index';
4
4
  import { RedisClientType, RedisMultiType } from '../../../types/redisclient';
@@ -14,7 +14,7 @@ class RedisSubService extends SubService<RedisClientType, RedisMultiType> {
14
14
  super(redisClient);
15
15
  }
16
16
 
17
- async init(namespace = PSNS, appId: string, engineId: string, logger: ILogger): Promise<void> {
17
+ async init(namespace = HMNS, appId: string, engineId: string, logger: ILogger): Promise<void> {
18
18
  this.namespace = namespace;
19
19
  this.logger = logger;
20
20
  this.appId = appId;
package/types/durable.ts CHANGED
@@ -39,10 +39,9 @@ type Registry = {
39
39
 
40
40
  type WorkerConfig = {
41
41
  connection: Connection;
42
- namespace: string; //`appid` in the YAML (e.g, 'default')
42
+ namespace?: string; //`appid` in the YAML (e.g, 'default')
43
43
  taskQueue: string; //`subscribes` in the YAML (e.g, 'hello-world')
44
- workflowsPath: string; //resolved abs path to dyn import()
45
- activities: { [key: string]: Function }; //vanilla activity exports
44
+ workflow: Function //target function to run
46
45
  }
47
46
 
48
47
  type ContextType = {
@@ -56,8 +55,9 @@ type ProxyType<ACT> = {
56
55
  };
57
56
 
58
57
  type ActivityConfig = {
59
- startToCloseTimeout: string;
60
- retryPolicy: {
58
+ startToCloseTimeout?: string;
59
+ activities?: any;
60
+ retryPolicy?: {
61
61
  initialInterval: string;
62
62
  maximumAttempts: number;
63
63
  backoffCoefficient: number;
@@ -1,82 +0,0 @@
1
- {
2
- "name": "@hotmeshio/hotmesh",
3
- "version": "0.0.8",
4
- "description": "Durable Workflows",
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
- },
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/hotmeshio/sdk-typescript.git"
15
- },
16
- "homepage": "https://github.com/hotmeshio/sdk-typescript#readme",
17
- "publishConfig": {
18
- "access": "public"
19
- },
20
- "scripts": {
21
- "clean": "rimraf ./build",
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",
25
- "clean-build": "npm run clean && npm run build",
26
- "lint": "eslint . --ext .ts",
27
- "lint:fix": "eslint . --fix --ext .ts",
28
- "start": "ts-node src/index.ts",
29
- "test": "NODE_ENV=test jest --detectOpenHandles --forceExit --verbose",
30
- "test:hmsh": "NODE_ENV=test jest ./tests/functional/index.test.ts --detectOpenHandles --verbose",
31
- "test:compile": "NODE_ENV=test jest ./tests/functional/compile/index.test.ts --detectOpenHandles --forceExit --verbose",
32
- "test:cycle": "NODE_ENV=test jest ./tests/functional/cycle/index.test.ts --detectOpenHandles --forceExit --verbose",
33
- "test:connect": "NODE_ENV=test jest ./tests/unit/services/connector/index.test.ts --detectOpenHandles --forceExit --verbose",
34
- "test:connect:redis": "NODE_ENV=test jest ./tests/unit/services/connector/clients/redis.test.ts --detectOpenHandles --forceExit --verbose",
35
- "test:connect:ioredis": "NODE_ENV=test jest ./tests/unit/services/connector/clients/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
36
- "test:parallel": "NODE_ENV=test jest ./tests/functional/parallel/index.test.ts --detectOpenHandles --forceExit --verbose",
37
- "test:sequence": "NODE_ENV=test jest ./tests/functional/sequence/index.test.ts --detectOpenHandles --forceExit --verbose",
38
- "test:quorum": "NODE_ENV=test jest ./tests/functional/quorum/index.test.ts --detectOpenHandles --forceExit --verbose",
39
- "test:reclaim": "NODE_ENV=test jest ./tests/functional/reclaim/index.test.ts --detectOpenHandles --forceExit --verbose",
40
- "test:redeploy": "NODE_ENV=test jest ./tests/functional/redeploy/index.test.ts --detectOpenHandles --forceExit --verbose",
41
- "test:retry": "NODE_ENV=test jest ./tests/functional/retry/index.test.ts --detectOpenHandles --forceExit --verbose",
42
- "test:status": "NODE_ENV=test jest ./tests/functional/status/index.test.ts --detectOpenHandles --forceExit --verbose",
43
- "test:store:redis": "NODE_ENV=test jest ./tests/functional/store/clients/redis.test.ts --detectOpenHandles --forceExit --verbose",
44
- "test:store:ioredis": "NODE_ENV=test jest ./tests/functional/store/clients/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
45
- "test:stream:redis": "NODE_ENV=test jest ./tests/functional/stream/clients/redis.test.ts --detectOpenHandles --forceExit --verbose",
46
- "test:stream:ioredis": "NODE_ENV=test jest ./tests/functional/stream/clients/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
47
- "test:sub:redis": "NODE_ENV=test jest ./tests/functional/sub/clients/redis.test.ts --detectOpenHandles --forceExit --verbose",
48
- "test:sub:ioredis": "NODE_ENV=test jest ./tests/functional/sub/clients/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
49
- "test:durable": "NODE_ENV=test jest ./tests/durable/*/index.test.ts --detectOpenHandles --forceExit --verbose",
50
- "test:durable:hello": "NODE_ENV=test jest ./tests/durable/helloworld/index.test.ts --detectOpenHandles --forceExit --verbose",
51
- "test:durable:goodbye": "NODE_ENV=test jest ./tests/durable/goodbye/index.test.ts --detectOpenHandles --forceExit --verbose",
52
- "test:durable:retry": "NODE_ENV=test jest ./tests/durable/retry/index.test.ts --detectOpenHandles --forceExit --verbose",
53
- "test:durable:loopactivity": "NODE_ENV=test jest ./tests/durable/loopactivity/index.test.ts --detectOpenHandles --forceExit --verbose",
54
- "test:durable:nested": "NODE_ENV=test jest ./tests/durable/nested/index.test.ts --detectOpenHandles --forceExit --verbose"
55
- },
56
- "keywords": [],
57
- "author": "luke.birdeau@gmail.com",
58
- "license": "SEE LICENSE IN LICENSE",
59
- "dependencies": {
60
- "@apidevtools/json-schema-ref-parser": "^10.1.0",
61
- "@opentelemetry/api": "^1.4.1",
62
- "js-yaml": "^4.1.0",
63
- "ms": "^2.1.3",
64
- "uuid": "^9.0.1",
65
- "winston": "^3.8.2"
66
- },
67
- "devDependencies": {
68
- "@types/jest": "^29.5.0",
69
- "@types/node": "^18.15.11",
70
- "@typescript-eslint/eslint-plugin": "^5.56.0",
71
- "@typescript-eslint/parser": "^5.56.0",
72
- "eslint": "^8.36.0",
73
- "ioredis": "^5.3.2",
74
- "jest": "^29.5.0",
75
- "redis": "^4.6.6",
76
- "rimraf": "^4.4.1",
77
- "ts-jest": "^29.0.5",
78
- "ts-node": "^10.9.1",
79
- "ts-node-dev": "^2.0.0",
80
- "typescript": "^5.0.4"
81
- }
82
- }
@@ -1,38 +0,0 @@
1
- import { HotMeshService as HotMesh } from '../hotmesh';
2
- import { Connection, Registry, WorkerConfig } from "../../types/durable";
3
- export declare class WorkerService {
4
- static activityRegistry: Registry;
5
- static connection: Connection;
6
- static instances: Map<string, HotMesh | Promise<HotMesh>>;
7
- workflowRunner: HotMesh;
8
- activityRunner: HotMesh;
9
- static getHotMesh: (worflowTopic: string) => Promise<HotMesh>;
10
- static activateWorkflow(hotMesh: HotMesh, topic: string, factory: Function): Promise<void>;
11
- /**
12
- * The `worker` calls `registerActivities` immediately BEFORE
13
- * dynamically importing the user's workflow module. That file
14
- * contains a call, `proxyActivities`, which needs this info.
15
- *
16
- * NOTE: The `worker` and `client` both call `proxyActivities`,
17
- * as a natural result of importing worflows.ts. However,
18
- * because the worker imports the workflows dynamically AFTER
19
- * the activities are loaded, there will be items in the registry,
20
- * allowing proxyActivities to succeed.
21
- */
22
- static registerActivities<ACT>(activities: ACT): Registry;
23
- static create(config: WorkerConfig): Promise<WorkerService>;
24
- static resolveWorkflowTarget(workflow: object | Function): [string, Function];
25
- run(): Promise<void>;
26
- initActivityWorkflow(config: WorkerConfig, activityTopic: string): Promise<HotMesh>;
27
- wrapActivityFunctions(): Function;
28
- activateActivityWorkflow(hotMesh: HotMesh, activityTopic: string): Promise<void>;
29
- initWorkerWorkflow(config: WorkerConfig, workflowTopic: string, workflowFunction: Function): Promise<HotMesh>;
30
- static Context: {
31
- info: () => {
32
- workflowId: string;
33
- workflowTopic: string;
34
- };
35
- };
36
- wrapWorkflowFunction(workflowFunction: Function, workflowTopic: string): Function;
37
- static shutdown(): Promise<void>;
38
- }
@@ -1,4 +0,0 @@
1
- import { Durable } from './services/durable';
2
- import { HotMeshService as HotMesh } from './services/hotmesh';
3
- import { HotMeshConfig } from './types/hotmesh';
4
- export { Durable, HotMesh, HotMeshConfig };
@@ -1,3 +0,0 @@
1
- import { Durable } from './services/durable';
2
- import { HotMeshService as HotMesh } from './services/hotmesh';
3
- export { Durable, HotMesh };
@@ -1,28 +0,0 @@
1
- import { ActivityDuplex } from "../types/activity";
2
- import { CollationFaultType, CollationStage } from "../types/collator";
3
- declare class GetStateError extends Error {
4
- constructor();
5
- }
6
- declare class SetStateError extends Error {
7
- constructor();
8
- }
9
- declare class MapDataError extends Error {
10
- constructor();
11
- }
12
- declare class RegisterTimeoutError extends Error {
13
- constructor();
14
- }
15
- declare class DuplicateJobError extends Error {
16
- constructor(jobId: string);
17
- }
18
- declare class ExecActivityError extends Error {
19
- constructor();
20
- }
21
- declare class CollationError extends Error {
22
- status: number;
23
- leg: ActivityDuplex;
24
- stage: CollationStage;
25
- fault: CollationFaultType;
26
- constructor(status: number, leg: ActivityDuplex, stage: CollationStage, fault?: CollationFaultType);
27
- }
28
- export { CollationError, DuplicateJobError, GetStateError, SetStateError, MapDataError, RegisterTimeoutError, ExecActivityError };
@@ -1,41 +0,0 @@
1
- class GetStateError extends Error {
2
- constructor() {
3
- super("Error occurred while getting job state");
4
- }
5
- }
6
- class SetStateError extends Error {
7
- constructor() {
8
- super("Error occurred while setting job state");
9
- }
10
- }
11
- class MapDataError extends Error {
12
- constructor() {
13
- super("Error occurred while mapping data");
14
- }
15
- }
16
- class RegisterTimeoutError extends Error {
17
- constructor() {
18
- super("Error occurred while registering activity timeout");
19
- }
20
- }
21
- class DuplicateJobError extends Error {
22
- constructor(jobId) {
23
- super("Duplicate job");
24
- this.message = `Duplicate job: ${jobId}`;
25
- }
26
- }
27
- class ExecActivityError extends Error {
28
- constructor() {
29
- super("Error occurred while executing activity");
30
- }
31
- }
32
- class CollationError extends Error {
33
- constructor(status, leg, stage, fault) {
34
- super("collation-error");
35
- this.leg = leg;
36
- this.status = status;
37
- this.stage = stage;
38
- this.fault = fault;
39
- }
40
- }
41
- export { CollationError, DuplicateJobError, GetStateError, SetStateError, MapDataError, RegisterTimeoutError, ExecActivityError };
@@ -1,75 +0,0 @@
1
- /**
2
- * Keys
3
- *
4
- * hmsh -> {hash} hotmesh config {version: "0.0.1", namespace: "hmsh"}
5
- * hmsh:a:<appid> -> {hash} app profile { "id": "appid", "version": "2", "versions/1": "GMT", "versions/2": "GMT"}
6
- * hmsh:<appid>:e:<engineId> -> {string} setnx to ensure only one engine of given id
7
- * hmsh:<appid>:w: -> {zset} work items/tasks an engine must do like garbage collect or hook a set of matching records (hookAll)
8
- * hmsh:<appid>:t: -> {zset} an ordered set of list (work lists) ids
9
- * hmsh:<appid>:t:<timeValue?> -> {list} a worklist of `jobId+activityId` items that should be awakened
10
- * hmsh:<appid>:q: -> {hash} quorum-wide messages
11
- * hmsh:<appid>:q:<ngnid> -> {hash} engine-targeted messages (targeted quorum-oriented message)
12
- * hmsh:<appid>:j:<jobid> -> {hash} job data
13
- * hmsh:<appid>:j:<jobid>:<activityid> -> {hash} job activity data (a1)
14
- * hmsh:<appid>:s:<jobkey>:<dateTime> -> {hash} job stats (general)
15
- * hmsh:<appid>:s:<jobkey>:<dateTime>:mdn:<field/path>:<fieldvalue> -> {zset} job stats (median)
16
- * hmsh:<appid>:s:<jobkey>:<dateTime>:index:<field/path>:<fieldvalue> -> {list} job stats (index of jobid[])
17
- * hmsh:<appid>:v:<version>:activities -> {hash} schemas [cache]
18
- * hmsh:<appid>:v:<version>:transitions -> {hash} transitions [cache]
19
- * hmsh:<appid>:v:<version>:subscriptions -> {hash} subscriptions [cache]
20
- * hmsh:<appid>:x: -> {xstream} when an engine is sent or reads a buffered task (engines read from their custom topic)
21
- * hmsh:<appid>:x:<topic> -> {xstream} when a worker is sent or reads a buffered task (workers read from their custom topic)
22
- * hmsh:<appid>:hooks -> {hash} hook patterns/rules; set at compile time
23
- * hmsh:<appid>:signals -> {hash} dynamic hook signals (hget/hdel) when resolving (always self-clean); added/removed at runtime
24
- * hmsh:<appid>:sym:keys: -> {hash} list of symbol ranges and :cursor assigned at version deploy time for job keys
25
- * hmsh:<appid>:sym:keys:<activityid|$subscribes> -> {hash} list of symbols based upon schema enums (initially) and adaptively optimized (later) during runtime; if '$subscribes' is used as the activityid, it is a top-level `job` symbol set (for job keys)
26
- * hmsh:<appid>:sym:vals: -> {hash} list of symbols for job values across all app versions
27
- */
28
- declare const PSNS = "hmsh";
29
- declare enum KeyType {
30
- APP = 0,
31
- ENGINE_ID = 1,
32
- HOOKS = 2,
33
- JOB_STATE = 3,
34
- JOB_STATS_GENERAL = 4,
35
- JOB_STATS_MEDIAN = 5,
36
- JOB_STATS_INDEX = 6,
37
- HOTMESH = 7,
38
- QUORUM = 8,
39
- SCHEMAS = 9,
40
- SIGNALS = 10,
41
- STREAMS = 11,
42
- SUBSCRIPTIONS = 12,
43
- SUBSCRIPTION_PATTERNS = 13,
44
- SYMKEYS = 14,
45
- SYMVALS = 15,
46
- TIME_RANGE = 16,
47
- WORK_ITEMS = 17
48
- }
49
- type KeyStoreParams = {
50
- appId?: string;
51
- engineId?: string;
52
- appVersion?: string;
53
- jobId?: string;
54
- activityId?: string;
55
- jobKey?: string;
56
- dateTime?: string;
57
- facet?: string;
58
- topic?: string;
59
- timeValue?: number;
60
- };
61
- declare class KeyService {
62
- /**
63
- * returns a key that can be used to access a value in the key/value store
64
- * appropriate for the given key type; the keys have an implicit hierarchy
65
- * and are used to organize data in the store in a tree-like structure
66
- * via the use of colons as separators. The top-level entity is the hmsh manifest.
67
- * This file will reveal the full scope of what is on the server (apps, versions, etc)
68
- * @param namespace
69
- * @param keyType
70
- * @param params
71
- * @returns {string}
72
- */
73
- static mintKey(namespace: string, keyType: KeyType, params: KeyStoreParams): string;
74
- }
75
- export { KeyService, KeyType, KeyStoreParams, PSNS };
@@ -1,111 +0,0 @@
1
- /**
2
- * Keys
3
- *
4
- * hmsh -> {hash} hotmesh config {version: "0.0.1", namespace: "hmsh"}
5
- * hmsh:a:<appid> -> {hash} app profile { "id": "appid", "version": "2", "versions/1": "GMT", "versions/2": "GMT"}
6
- * hmsh:<appid>:e:<engineId> -> {string} setnx to ensure only one engine of given id
7
- * hmsh:<appid>:w: -> {zset} work items/tasks an engine must do like garbage collect or hook a set of matching records (hookAll)
8
- * hmsh:<appid>:t: -> {zset} an ordered set of list (work lists) ids
9
- * hmsh:<appid>:t:<timeValue?> -> {list} a worklist of `jobId+activityId` items that should be awakened
10
- * hmsh:<appid>:q: -> {hash} quorum-wide messages
11
- * hmsh:<appid>:q:<ngnid> -> {hash} engine-targeted messages (targeted quorum-oriented message)
12
- * hmsh:<appid>:j:<jobid> -> {hash} job data
13
- * hmsh:<appid>:j:<jobid>:<activityid> -> {hash} job activity data (a1)
14
- * hmsh:<appid>:s:<jobkey>:<dateTime> -> {hash} job stats (general)
15
- * hmsh:<appid>:s:<jobkey>:<dateTime>:mdn:<field/path>:<fieldvalue> -> {zset} job stats (median)
16
- * hmsh:<appid>:s:<jobkey>:<dateTime>:index:<field/path>:<fieldvalue> -> {list} job stats (index of jobid[])
17
- * hmsh:<appid>:v:<version>:activities -> {hash} schemas [cache]
18
- * hmsh:<appid>:v:<version>:transitions -> {hash} transitions [cache]
19
- * hmsh:<appid>:v:<version>:subscriptions -> {hash} subscriptions [cache]
20
- * hmsh:<appid>:x: -> {xstream} when an engine is sent or reads a buffered task (engines read from their custom topic)
21
- * hmsh:<appid>:x:<topic> -> {xstream} when a worker is sent or reads a buffered task (workers read from their custom topic)
22
- * hmsh:<appid>:hooks -> {hash} hook patterns/rules; set at compile time
23
- * hmsh:<appid>:signals -> {hash} dynamic hook signals (hget/hdel) when resolving (always self-clean); added/removed at runtime
24
- * hmsh:<appid>:sym:keys: -> {hash} list of symbol ranges and :cursor assigned at version deploy time for job keys
25
- * hmsh:<appid>:sym:keys:<activityid|$subscribes> -> {hash} list of symbols based upon schema enums (initially) and adaptively optimized (later) during runtime; if '$subscribes' is used as the activityid, it is a top-level `job` symbol set (for job keys)
26
- * hmsh:<appid>:sym:vals: -> {hash} list of symbols for job values across all app versions
27
- */
28
- //default namespace for hotmesh
29
- const PSNS = "hmsh";
30
- //these are the entity types that are stored in the key/value store
31
- var KeyType;
32
- (function (KeyType) {
33
- KeyType[KeyType["APP"] = 0] = "APP";
34
- KeyType[KeyType["ENGINE_ID"] = 1] = "ENGINE_ID";
35
- KeyType[KeyType["HOOKS"] = 2] = "HOOKS";
36
- KeyType[KeyType["JOB_STATE"] = 3] = "JOB_STATE";
37
- KeyType[KeyType["JOB_STATS_GENERAL"] = 4] = "JOB_STATS_GENERAL";
38
- KeyType[KeyType["JOB_STATS_MEDIAN"] = 5] = "JOB_STATS_MEDIAN";
39
- KeyType[KeyType["JOB_STATS_INDEX"] = 6] = "JOB_STATS_INDEX";
40
- KeyType[KeyType["HOTMESH"] = 7] = "HOTMESH";
41
- KeyType[KeyType["QUORUM"] = 8] = "QUORUM";
42
- KeyType[KeyType["SCHEMAS"] = 9] = "SCHEMAS";
43
- KeyType[KeyType["SIGNALS"] = 10] = "SIGNALS";
44
- KeyType[KeyType["STREAMS"] = 11] = "STREAMS";
45
- KeyType[KeyType["SUBSCRIPTIONS"] = 12] = "SUBSCRIPTIONS";
46
- KeyType[KeyType["SUBSCRIPTION_PATTERNS"] = 13] = "SUBSCRIPTION_PATTERNS";
47
- KeyType[KeyType["SYMKEYS"] = 14] = "SYMKEYS";
48
- KeyType[KeyType["SYMVALS"] = 15] = "SYMVALS";
49
- KeyType[KeyType["TIME_RANGE"] = 16] = "TIME_RANGE";
50
- KeyType[KeyType["WORK_ITEMS"] = 17] = "WORK_ITEMS";
51
- })(KeyType || (KeyType = {}));
52
- class KeyService {
53
- /**
54
- * returns a key that can be used to access a value in the key/value store
55
- * appropriate for the given key type; the keys have an implicit hierarchy
56
- * and are used to organize data in the store in a tree-like structure
57
- * via the use of colons as separators. The top-level entity is the hmsh manifest.
58
- * This file will reveal the full scope of what is on the server (apps, versions, etc)
59
- * @param namespace
60
- * @param keyType
61
- * @param params
62
- * @returns {string}
63
- */
64
- static mintKey(namespace, keyType, params) {
65
- switch (keyType) {
66
- case KeyType.HOTMESH:
67
- return namespace;
68
- case KeyType.ENGINE_ID:
69
- return `${namespace}:${params.appId}:e:${params.engineId}`;
70
- case KeyType.WORK_ITEMS:
71
- return `${namespace}:${params.appId}:w:`;
72
- case KeyType.TIME_RANGE:
73
- return `${namespace}:${params.appId}:t:${params.timeValue || ''}`;
74
- case KeyType.APP:
75
- return `${namespace}:a:${params.appId || ''}`;
76
- case KeyType.QUORUM:
77
- return `${namespace}:${params.appId}:q:${params.engineId || ''}`;
78
- case KeyType.JOB_STATE:
79
- return `${namespace}:${params.appId}:j:${params.jobId}`;
80
- case KeyType.JOB_STATS_GENERAL:
81
- return `${namespace}:${params.appId}:s:${params.jobKey}:${params.dateTime}`;
82
- case KeyType.JOB_STATS_MEDIAN:
83
- return `${namespace}:${params.appId}:s:${params.jobKey}:${params.dateTime}:${params.facet}`;
84
- case KeyType.JOB_STATS_INDEX:
85
- return `${namespace}:${params.appId}:s:${params.jobKey}:${params.dateTime}:${params.facet}`;
86
- case KeyType.SCHEMAS:
87
- return `${namespace}:${params.appId}:v:${params.appVersion}:schemas`;
88
- case KeyType.SUBSCRIPTIONS:
89
- return `${namespace}:${params.appId}:v:${params.appVersion}:subscriptions`;
90
- case KeyType.SUBSCRIPTION_PATTERNS:
91
- return `${namespace}:${params.appId}:v:${params.appVersion}:transitions`;
92
- case KeyType.HOOKS:
93
- //`hooks` provide the pattern to resolve a value
94
- return `${namespace}:${params.appId}:hooks`;
95
- case KeyType.SIGNALS:
96
- //`signals` provide the registry of resolved values that link back to paused jobs
97
- return `${namespace}:${params.appId}:signals`;
98
- case KeyType.SYMKEYS:
99
- //`symbol keys` provide the registry of replacement values for job keys
100
- return `${namespace}:${params.appId}:sym:keys:${params.activityId || ''}`;
101
- case KeyType.SYMVALS:
102
- //`symbol vals` provide the registry of replacement values for job vals
103
- return `${namespace}:${params.appId}:sym:vals:`;
104
- case KeyType.STREAMS:
105
- return `${namespace}:${params.appId || ''}:x:${params.topic || ''}`;
106
- default:
107
- throw new Error("Invalid key type.");
108
- }
109
- }
110
- }
111
- export { KeyService, KeyType, PSNS };
@@ -1,34 +0,0 @@
1
- /// <reference types="node" />
2
- import { StoreService } from "../services/store";
3
- import { AppSubscriptions, AppTransitions, AppVID } from "../types/app";
4
- import { RedisClient, RedisMulti } from "../types/redis";
5
- import { StringAnyType } from "../types/serializer";
6
- import { StreamCode, StreamStatus } from "../types/stream";
7
- export declare function sleepFor(ms: number): Promise<unknown>;
8
- export declare function identifyRedisType(redisInstance: any): 'redis' | 'ioredis' | null;
9
- export declare function identifyRedisTypeFromClass(redisClass: any): 'redis' | 'ioredis' | null;
10
- export declare function matchesStatusCode(code: StreamCode, pattern: string | RegExp): boolean;
11
- export declare function matchesStatus(status: StreamStatus, targetStatus: StreamStatus): boolean;
12
- export declare function XSleepFor(ms: number): {
13
- promise: Promise<unknown>;
14
- timerId: NodeJS.Timeout;
15
- };
16
- export declare function findTopKey(obj: AppTransitions, input: string): string | null;
17
- export declare function findSubscriptionForTrigger(obj: AppSubscriptions, value: string): string | null;
18
- /**
19
- * Get the subscription topic for the flow to which @activityId belongs.
20
- * TODO: resolve this value in the compiler...do not call this at runtime
21
- */
22
- export declare function getSubscriptionTopic(activityId: string, store: StoreService<RedisClient, RedisMulti>, appVID: AppVID): Promise<string | undefined>;
23
- /**
24
- * returns the 12-digit format of the iso timestamp (e.g, 202101010000)
25
- */
26
- export declare function getTimeSeries(granularity: string): string;
27
- export declare function formatISODate(input: Date | string): string;
28
- export declare function getSymKey(number: number): string;
29
- export declare function getSymVal(number: number): string;
30
- export declare function getIndexedHash<T>(hash: T, target: string): [number, T];
31
- export declare function getValueByPath(obj: {
32
- [key: string]: any;
33
- }, path: string): any;
34
- export declare function restoreHierarchy(obj: StringAnyType): StringAnyType;