@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
@@ -0,0 +1,217 @@
1
+ import packageJson from '../../package.json';
2
+ import { MapperService } from '../mapper';
3
+ import { StreamDataType, StreamRole } from '../../types/stream';
4
+ import { SpanKind, trace, context, SpanStatusCode } from '../../types/telemetry';
5
+ class TelemetryService {
6
+ constructor(appId, config, metadata, context) {
7
+ this.leg = 1;
8
+ this.appId = appId;
9
+ //these are REQUIRED for job and activity spans
10
+ this.config = config;
11
+ this.metadata = metadata;
12
+ this.context = context;
13
+ }
14
+ getJobParentSpanId() {
15
+ return this.context.metadata.spn;
16
+ }
17
+ getActivityParentSpanId(leg) {
18
+ if (leg === 1) {
19
+ return this.context[this.config.parent].output?.metadata?.l2s;
20
+ }
21
+ else {
22
+ return this.context['$self'].output?.metadata?.l1s;
23
+ }
24
+ }
25
+ getTraceId() {
26
+ return this.context.metadata.trc;
27
+ }
28
+ startJobSpan() {
29
+ const spanName = `JOB/${this.appId}/${this.config.subscribes}/1`;
30
+ const traceId = this.getTraceId();
31
+ const spanId = this.getJobParentSpanId();
32
+ const attributes = this.getSpanAttrs(1);
33
+ const span = this.startSpan(traceId, spanId, spanName, attributes);
34
+ this.jobSpan = span;
35
+ this.setTelemetryContext(span, 1);
36
+ return this;
37
+ }
38
+ startActivitySpan(leg = this.leg) {
39
+ const spanName = `${this.config.type.toUpperCase()}/${this.appId}/${this.metadata.aid}/${leg}`;
40
+ const traceId = this.getTraceId();
41
+ const spanId = this.getActivityParentSpanId(leg);
42
+ const attributes = this.getSpanAttrs(leg);
43
+ const span = this.startSpan(traceId, spanId, spanName, attributes);
44
+ this.setTelemetryContext(span, leg);
45
+ this.span = span;
46
+ return this;
47
+ }
48
+ startStreamSpan(data, role) {
49
+ let type;
50
+ if (role === StreamRole.SYSTEM) {
51
+ type = 'SYSTEM';
52
+ }
53
+ else if (role === StreamRole.WORKER) {
54
+ type = 'EXECUTE';
55
+ }
56
+ else if (data.type === StreamDataType.RESULT || data.type === StreamDataType.RESPONSE) {
57
+ type = 'FANIN';
58
+ }
59
+ else {
60
+ type = 'FANOUT';
61
+ }
62
+ const topic = data.metadata.topic ? `/${data.metadata.topic}` : '';
63
+ const spanName = `${type}/${this.appId}/${data.metadata.aid}${topic}`;
64
+ const attributes = this.getStreamSpanAttrs(data);
65
+ const span = this.startSpan(data.metadata.trc, data.metadata.spn, spanName, attributes);
66
+ this.span = span;
67
+ return this;
68
+ }
69
+ startSpan(traceId, spanId, spanName, attributes) {
70
+ this.traceId = traceId;
71
+ this.spanId = spanId;
72
+ const tracer = trace.getTracer(packageJson.name, packageJson.version);
73
+ let parentContext = this.getParentSpanContext();
74
+ const span = tracer.startSpan(spanName, { kind: SpanKind.CLIENT, attributes, root: !parentContext }, parentContext);
75
+ return span;
76
+ }
77
+ mapActivityAttributes() {
78
+ //export user-defined span attributes (app.activity.data.*)
79
+ if (this.config.telemetry) {
80
+ const telemetryAtts = new MapperService(this.config.telemetry, this.context).mapRules();
81
+ const namespacedAtts = {
82
+ ...Object.keys(telemetryAtts).reduce((result, key) => {
83
+ if (['string', 'boolean', 'number'].includes(typeof telemetryAtts[key])) {
84
+ result[`app.activity.data.${key}`] = telemetryAtts[key];
85
+ }
86
+ return result;
87
+ }, {})
88
+ };
89
+ this.span.setAttributes(namespacedAtts);
90
+ }
91
+ }
92
+ setActivityAttributes(attributes) {
93
+ this.span.setAttributes(attributes);
94
+ }
95
+ setStreamAttributes(attributes) {
96
+ this.span.setAttributes(attributes);
97
+ }
98
+ setJobAttributes(attributes) {
99
+ this.jobSpan.setAttributes(attributes);
100
+ }
101
+ endJobSpan() {
102
+ this.endSpan(this.jobSpan);
103
+ }
104
+ endActivitySpan() {
105
+ this.endSpan(this.span);
106
+ }
107
+ endStreamSpan() {
108
+ this.endSpan(this.span);
109
+ }
110
+ endSpan(span) {
111
+ span && span.end();
112
+ }
113
+ getParentSpanContext() {
114
+ if (this.traceId && this.spanId) {
115
+ const restoredSpanContext = {
116
+ traceId: this.traceId,
117
+ spanId: this.spanId,
118
+ isRemote: true,
119
+ traceFlags: 1, // (todo: revisit sampling strategy/config)
120
+ };
121
+ const parentContext = trace.setSpanContext(context.active(), restoredSpanContext);
122
+ return parentContext;
123
+ }
124
+ }
125
+ getSpanAttrs(leg) {
126
+ return {
127
+ ...Object.keys(this.context.metadata).reduce((result, key) => {
128
+ if (key !== 'trc') {
129
+ result[`app.job.${key}`] = this.context.metadata[key];
130
+ }
131
+ return result;
132
+ }, {}),
133
+ ...Object.keys(this.metadata).reduce((result, key) => {
134
+ result[`app.activity.${key}`] = this.metadata[key];
135
+ return result;
136
+ }, {}),
137
+ 'app.activity.leg': leg,
138
+ };
139
+ }
140
+ ;
141
+ getStreamSpanAttrs(input) {
142
+ return {
143
+ ...Object.keys(input.metadata).reduce((result, key) => {
144
+ if (key !== 'trc' && key !== 'spn') {
145
+ result[`app.stream.${key}`] = input.metadata[key];
146
+ }
147
+ return result;
148
+ }, {})
149
+ };
150
+ }
151
+ ;
152
+ setTelemetryContext(span, leg) {
153
+ if (!this.context.metadata.trc) {
154
+ this.context.metadata.trc = span.spanContext().traceId;
155
+ }
156
+ if (leg === 1) {
157
+ if (!this.context['$self'].output.metadata) {
158
+ this.context['$self'].output.metadata = {};
159
+ }
160
+ this.context['$self'].output.metadata.l1s = span.spanContext().spanId;
161
+ }
162
+ else {
163
+ if (!this.context['$self'].output.metadata) {
164
+ this.context['$self'].output.metadata = {};
165
+ }
166
+ this.context['$self'].output.metadata.l2s = span.spanContext().spanId;
167
+ }
168
+ }
169
+ setActivityError(message) {
170
+ this.span.setStatus({ code: SpanStatusCode.ERROR, message });
171
+ }
172
+ setStreamError(message) {
173
+ this.span.setStatus({ code: SpanStatusCode.ERROR, message });
174
+ }
175
+ /**
176
+ * Adds the paths (HGET) necessary to restore telemetry state for an activity
177
+ * @param consumes
178
+ * @param config
179
+ * @param metadata
180
+ * @param leg
181
+ */
182
+ static addTargetTelemetryPaths(consumes, config, metadata, leg) {
183
+ if (leg === 1) {
184
+ if (!(config.parent in consumes)) {
185
+ consumes[config.parent] = [];
186
+ }
187
+ consumes[config.parent].push(`${config.parent}/output/metadata/l2s`);
188
+ }
189
+ else {
190
+ if (!(metadata.aid in consumes)) {
191
+ consumes[metadata.aid] = [];
192
+ }
193
+ consumes[metadata.aid].push(`${metadata.aid}/output/metadata/l1s`);
194
+ }
195
+ }
196
+ static bindJobTelemetryToState(state, config, context) {
197
+ if (config.type === 'trigger') {
198
+ state['metadata/trc'] = context.metadata.trc;
199
+ }
200
+ }
201
+ static bindActivityTelemetryToState(state, config, metadata, context, leg) {
202
+ if (config.type === 'trigger') {
203
+ state[`${metadata.aid}/output/metadata/l1s`] = context['$self'].output.metadata.l1s;
204
+ state[`${metadata.aid}/output/metadata/l2s`] = context['$self'].output.metadata.l2s;
205
+ }
206
+ else if (config.type === 'activity' && leg === 1) {
207
+ //activities run non-duplexed and only have a single leg
208
+ state[`${metadata.aid}/output/metadata/l1s`] = context['$self'].output.metadata.l1s;
209
+ state[`${metadata.aid}/output/metadata/l2s`] = context['$self'].output.metadata.l1s;
210
+ }
211
+ else {
212
+ const target = `l${leg}s`;
213
+ state[`${metadata.aid}/output/metadata/${target}`] = context['$self'].output.metadata[target];
214
+ }
215
+ }
216
+ }
217
+ export { TelemetryService };
@@ -0,0 +1,30 @@
1
+ import { ILogger } from "../logger";
2
+ import { StreamSignaler } from "../signaler/stream";
3
+ import { StoreService } from '../store';
4
+ import { StreamService } from '../stream';
5
+ import { SubService } from '../sub';
6
+ import { HotMeshConfig, HotMeshWorker } from "../../types/hotmesh";
7
+ import { SubscriptionCallback } from "../../types/quorum";
8
+ import { RedisClient, RedisMulti } from "../../types/redis";
9
+ declare class WorkerService {
10
+ namespace: string;
11
+ appId: string;
12
+ guid: string;
13
+ topic: string;
14
+ config: HotMeshConfig;
15
+ store: StoreService<RedisClient, RedisMulti> | null;
16
+ stream: StreamService<RedisClient, RedisMulti> | null;
17
+ subscribe: SubService<RedisClient, RedisMulti> | null;
18
+ streamSignaler: StreamSignaler | null;
19
+ logger: ILogger;
20
+ reporting: boolean;
21
+ static init(namespace: string, appId: string, guid: string, config: HotMeshConfig, logger: ILogger): Promise<WorkerService[]>;
22
+ verifyWorkerFields(worker: HotMeshWorker): void;
23
+ initStoreChannel(service: WorkerService, store: RedisClient): Promise<void>;
24
+ initSubChannel(service: WorkerService, sub: RedisClient): Promise<void>;
25
+ initStreamChannel(service: WorkerService, stream: RedisClient): Promise<void>;
26
+ initStreamSignaler(worker: HotMeshWorker, logger: ILogger): StreamSignaler;
27
+ subscriptionHandler(): SubscriptionCallback;
28
+ throttle(delayInMillis: number): Promise<void>;
29
+ }
30
+ export { WorkerService };
@@ -0,0 +1,102 @@
1
+ import { KeyType } from "../../modules/key";
2
+ import { StreamSignaler } from "../signaler/stream";
3
+ import { RedisStoreService as RedisStore } from '../store/clients/redis';
4
+ import { IORedisStoreService as IORedisStore } from '../store/clients/ioredis';
5
+ import { RedisStreamService as RedisStream } from '../stream/clients/redis';
6
+ import { IORedisStreamService as IORedisStream } from '../stream/clients/ioredis';
7
+ import { IORedisSubService as IORedisSub } from '../sub/clients/ioredis';
8
+ import { RedisSubService as RedisSub } from '../sub/clients/redis';
9
+ import { StreamRole } from "../../types/stream";
10
+ import { identifyRedisType } from "../../modules/utils";
11
+ import { ConnectorService } from "../connector";
12
+ class WorkerService {
13
+ constructor() {
14
+ this.reporting = false;
15
+ }
16
+ static async init(namespace, appId, guid, config, logger) {
17
+ const services = [];
18
+ if (Array.isArray(config.workers)) {
19
+ for (const worker of config.workers) {
20
+ await ConnectorService.initRedisClients(worker.redis?.class, worker.redis?.options, worker);
21
+ const service = new WorkerService();
22
+ service.verifyWorkerFields(worker);
23
+ service.namespace = namespace;
24
+ service.appId = appId;
25
+ service.guid = guid;
26
+ service.topic = worker.topic;
27
+ service.config = config;
28
+ service.logger = logger;
29
+ await service.initStoreChannel(service, worker.store);
30
+ await service.initSubChannel(service, worker.sub);
31
+ await service.subscribe.subscribe(KeyType.QUORUM, service.subscriptionHandler(), appId);
32
+ await service.subscribe.subscribe(KeyType.QUORUM, service.subscriptionHandler(), appId, service.topic);
33
+ await service.subscribe.subscribe(KeyType.QUORUM, service.subscriptionHandler(), appId, service.guid);
34
+ await service.initStreamChannel(service, worker.stream);
35
+ service.streamSignaler = service.initStreamSignaler(worker, logger);
36
+ const key = service.stream.mintKey(KeyType.STREAMS, { appId: service.appId, topic: worker.topic });
37
+ await service.streamSignaler.consumeMessages(key, 'WORKER', service.guid, worker.callback);
38
+ services.push(service);
39
+ }
40
+ }
41
+ return services;
42
+ }
43
+ verifyWorkerFields(worker) {
44
+ if ((!identifyRedisType(worker.store) ||
45
+ !identifyRedisType(worker.stream) ||
46
+ !identifyRedisType(worker.sub)) ||
47
+ !(worker.topic && worker.callback)) {
48
+ throw new Error('worker must include `store`, `stream`, and `sub` fields along with a callback function and topic.');
49
+ }
50
+ }
51
+ async initStoreChannel(service, store) {
52
+ if (identifyRedisType(store) === 'redis') {
53
+ service.store = new RedisStore(store);
54
+ }
55
+ else {
56
+ service.store = new IORedisStore(store);
57
+ }
58
+ await service.store.init(service.namespace, service.appId, service.logger);
59
+ }
60
+ async initSubChannel(service, sub) {
61
+ if (identifyRedisType(sub) === 'redis') {
62
+ service.subscribe = new RedisSub(sub);
63
+ }
64
+ else {
65
+ service.subscribe = new IORedisSub(sub);
66
+ }
67
+ await service.subscribe.init(service.namespace, service.appId, service.guid, service.logger);
68
+ }
69
+ async initStreamChannel(service, stream) {
70
+ if (identifyRedisType(stream) === 'redis') {
71
+ service.stream = new RedisStream(stream);
72
+ }
73
+ else {
74
+ service.stream = new IORedisStream(stream);
75
+ }
76
+ await service.stream.init(service.namespace, service.appId, service.logger);
77
+ }
78
+ initStreamSignaler(worker, logger) {
79
+ return new StreamSignaler({
80
+ namespace: this.namespace,
81
+ appId: this.appId,
82
+ guid: this.guid,
83
+ role: StreamRole.WORKER,
84
+ topic: worker.topic,
85
+ reclaimDelay: worker.reclaimDelay,
86
+ reclaimCount: worker.reclaimCount,
87
+ }, this.stream, this.store, logger);
88
+ }
89
+ subscriptionHandler() {
90
+ const self = this;
91
+ return async (topic, message) => {
92
+ self.logger.debug('worker-event-received', { topic, type: message.type });
93
+ if (message.type === 'throttle') {
94
+ self.throttle(message.throttle);
95
+ }
96
+ };
97
+ }
98
+ async throttle(delayInMillis) {
99
+ this.streamSignaler.setThrottle(delayInMillis);
100
+ }
101
+ }
102
+ export { WorkerService };
@@ -0,0 +1,87 @@
1
+ import { MetricTypes } from "./stats";
2
+ import { StreamRetryPolicy } from "./stream";
3
+ type ActivityExecutionType = 'trigger' | 'await' | 'worker' | 'activity' | 'emit' | 'iterate';
4
+ type Consumes = Record<string, string[]>;
5
+ interface BaseActivity {
6
+ title?: string;
7
+ type?: ActivityExecutionType;
8
+ subtype?: string;
9
+ input?: Record<string, any>;
10
+ output?: Record<string, any>;
11
+ settings?: Record<string, any>;
12
+ job?: Record<string, any>;
13
+ hook?: Record<string, any>;
14
+ telemetry?: Record<string, any>;
15
+ sleep?: number;
16
+ expire?: number;
17
+ retry?: StreamRetryPolicy;
18
+ collationInt?: number;
19
+ consumes?: Consumes;
20
+ PRODUCES?: string[];
21
+ produces?: string[];
22
+ publishes?: string;
23
+ subscribes?: string;
24
+ trigger?: string;
25
+ parent?: string;
26
+ ancestors?: string[];
27
+ }
28
+ interface Measure {
29
+ measure: MetricTypes;
30
+ target: string;
31
+ }
32
+ interface TriggerActivityStats {
33
+ id?: {
34
+ [key: string]: unknown;
35
+ } | string;
36
+ key?: {
37
+ [key: string]: unknown;
38
+ } | string;
39
+ measures?: Measure[];
40
+ }
41
+ interface TriggerActivity extends BaseActivity {
42
+ type: 'trigger';
43
+ stats?: TriggerActivityStats;
44
+ }
45
+ interface AwaitActivity extends BaseActivity {
46
+ type: 'await';
47
+ eventName: string;
48
+ timeout: number;
49
+ }
50
+ interface WorkerActivity extends BaseActivity {
51
+ type: 'worker';
52
+ topic: string;
53
+ timeout: number;
54
+ }
55
+ interface EmitActivity extends BaseActivity {
56
+ type: 'emit';
57
+ }
58
+ interface IterateActivity extends BaseActivity {
59
+ type: 'iterate';
60
+ }
61
+ type ActivityType = BaseActivity | TriggerActivity | AwaitActivity | WorkerActivity | EmitActivity | IterateActivity;
62
+ type ActivityData = Record<string, any>;
63
+ type ActivityMetadata = {
64
+ aid: string;
65
+ atp: string;
66
+ stp: string;
67
+ ac: string;
68
+ au: string;
69
+ err?: string;
70
+ l1s?: string;
71
+ l2s?: string;
72
+ dad?: string;
73
+ as?: string;
74
+ };
75
+ type ActivityContext = {
76
+ data?: ActivityData | null;
77
+ metadata: ActivityMetadata;
78
+ hook?: ActivityData;
79
+ };
80
+ type ActivityDuplex = 1 | 2;
81
+ type ActivityDataType = {
82
+ data?: Record<string, unknown>;
83
+ metadata?: Record<string, unknown>;
84
+ hook?: Record<string, unknown>;
85
+ };
86
+ type ActivityLeg = 1 | 2;
87
+ export { ActivityContext, ActivityData, ActivityDataType, ActivityDuplex, ActivityLeg, ActivityMetadata, ActivityType, Consumes, TriggerActivityStats, AwaitActivity, BaseActivity, EmitActivity, IterateActivity, TriggerActivity, WorkerActivity };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ interface App {
2
+ name: string;
3
+ title: string;
4
+ description: string;
5
+ }
6
+ type AppVID = {
7
+ version: string;
8
+ id: string;
9
+ };
10
+ type AppTransitions = {
11
+ [key: string]: Record<string, unknown>;
12
+ };
13
+ type AppSubscriptions = {
14
+ [key: string]: string;
15
+ };
16
+ export { App, AppVID, AppTransitions, AppSubscriptions };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ type AsyncSignal = {
2
+ topic: string;
3
+ jobId: string;
4
+ };
5
+ export { AsyncSignal };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export type CacheMode = 'nocache' | 'cache';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export type CollationStage = 'enter' | 'exit' | 'confirm';
2
+ export declare enum CollationFaultType {
3
+ MISSING = "missing",
4
+ DUPLICATE = "duplicate",
5
+ INACTIVE = "inactive",
6
+ INVALID = "invalid",
7
+ FORBIDDEN = "forbidden"
8
+ }
@@ -0,0 +1,8 @@
1
+ export var CollationFaultType;
2
+ (function (CollationFaultType) {
3
+ CollationFaultType["MISSING"] = "missing";
4
+ CollationFaultType["DUPLICATE"] = "duplicate";
5
+ CollationFaultType["INACTIVE"] = "inactive";
6
+ CollationFaultType["INVALID"] = "invalid";
7
+ CollationFaultType["FORBIDDEN"] = "forbidden";
8
+ })(CollationFaultType || (CollationFaultType = {}));
@@ -0,0 +1,59 @@
1
+ import { RedisClass, RedisOptions } from './redis';
2
+ type WorkflowOptions = {
3
+ taskQueue: string;
4
+ args: any[];
5
+ workflowId: string;
6
+ workflowName?: string;
7
+ workflowTrace?: string;
8
+ workflowSpan?: string;
9
+ };
10
+ type ActivityDataType = {
11
+ activityName: string;
12
+ arguments: any[];
13
+ workflowId: string;
14
+ workflowTopic: string;
15
+ };
16
+ type WorkflowDataType = {
17
+ arguments: any[];
18
+ workflowId: string;
19
+ workflowTopic: string;
20
+ };
21
+ type ConnectionConfig = {
22
+ class: RedisClass;
23
+ options: RedisOptions;
24
+ };
25
+ type Connection = ConnectionConfig;
26
+ type NativeConnection = ConnectionConfig;
27
+ type ClientConfig = {
28
+ connection: Connection;
29
+ };
30
+ type Registry = {
31
+ [key: string]: Function;
32
+ };
33
+ type WorkerConfig = {
34
+ connection: Connection;
35
+ namespace: string;
36
+ taskQueue: string;
37
+ workflowsPath: string;
38
+ activities: {
39
+ [key: string]: Function;
40
+ };
41
+ };
42
+ type ContextType = {
43
+ workflowId: string;
44
+ workflowTopic: string;
45
+ };
46
+ type FunctionSignature<T> = T extends (...args: infer A) => infer R ? (...args: A) => R : never;
47
+ type ProxyType<ACT> = {
48
+ [K in keyof ACT]: FunctionSignature<ACT[K]>;
49
+ };
50
+ type ActivityConfig = {
51
+ startToCloseTimeout: string;
52
+ retryPolicy: {
53
+ initialInterval: string;
54
+ maximumAttempts: number;
55
+ backoffCoefficient: number;
56
+ maximumInterval: string;
57
+ };
58
+ };
59
+ export { ActivityConfig, ActivityDataType, ClientConfig, ContextType, ConnectionConfig, Connection, NativeConnection, ProxyType, Registry, WorkerConfig, WorkflowDataType, WorkflowOptions, };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,31 @@
1
+ interface HookCondition {
2
+ expected: string;
3
+ actual: string;
4
+ }
5
+ declare enum HookGate {
6
+ AND = "and",
7
+ OR = "or"
8
+ }
9
+ interface HookConditions {
10
+ gate?: HookGate;
11
+ match: HookCondition[];
12
+ }
13
+ interface HookRule {
14
+ to: string;
15
+ conditions: HookConditions;
16
+ }
17
+ interface HookRules {
18
+ [eventName: string]: HookRule[];
19
+ }
20
+ type HookSignal = {
21
+ topic: string;
22
+ resolved: string;
23
+ jobId: string;
24
+ };
25
+ interface HookInterface {
26
+ (topic: string, data: {
27
+ [key: string]: any;
28
+ id: string;
29
+ }): Promise<void>;
30
+ }
31
+ export { HookCondition, HookConditions, HookGate, HookInterface, HookRule, HookRules, HookSignal };
@@ -0,0 +1,6 @@
1
+ var HookGate;
2
+ (function (HookGate) {
3
+ HookGate["AND"] = "and";
4
+ HookGate["OR"] = "or";
5
+ })(HookGate || (HookGate = {}));
6
+ export { HookGate };
@@ -0,0 +1,82 @@
1
+ import { ILogger } from '../services/logger';
2
+ import { HotMeshService } from '../services/hotmesh';
3
+ import { HookRules } from './hook';
4
+ import { RedisClass, RedisClient, RedisOptions } from './redis';
5
+ import { StreamData, StreamDataResponse } from './stream';
6
+ type HotMesh = typeof HotMeshService;
7
+ type RedisConfig = {
8
+ class: RedisClass;
9
+ options: RedisOptions;
10
+ };
11
+ type HotMeshEngine = {
12
+ store?: RedisClient;
13
+ stream?: RedisClient;
14
+ sub?: RedisClient;
15
+ redis?: RedisConfig;
16
+ reclaimDelay?: number;
17
+ reclaimCount?: number;
18
+ };
19
+ type HotMeshWorker = {
20
+ topic: string;
21
+ store?: RedisClient;
22
+ stream?: RedisClient;
23
+ sub?: RedisClient;
24
+ redis?: {
25
+ class: RedisClass;
26
+ options: RedisOptions;
27
+ };
28
+ reclaimDelay?: number;
29
+ reclaimCount?: number;
30
+ callback: (payload: StreamData) => Promise<StreamDataResponse | void>;
31
+ };
32
+ type HotMeshConfig = {
33
+ appId: string;
34
+ namespace?: string;
35
+ name?: string;
36
+ logger?: ILogger;
37
+ logLevel?: 'silly' | 'debug' | 'info' | 'warn' | 'error' | 'silent';
38
+ engine?: HotMeshEngine;
39
+ workers?: HotMeshWorker[];
40
+ };
41
+ type HotMeshGraph = {
42
+ subscribes: string;
43
+ publishes?: string;
44
+ expire?: number;
45
+ output?: {
46
+ schema: Record<string, any>;
47
+ };
48
+ input?: {
49
+ schema: Record<string, any>;
50
+ };
51
+ activities: Record<string, any>;
52
+ transitions?: Record<string, any>;
53
+ hooks?: HookRules;
54
+ };
55
+ type HotMeshSettings = {
56
+ namespace: string;
57
+ version: string;
58
+ };
59
+ type HotMeshManifest = {
60
+ app: {
61
+ id: string;
62
+ version: string;
63
+ settings: Record<string, any>;
64
+ graphs: HotMeshGraph[];
65
+ };
66
+ };
67
+ type VersionedFields = {
68
+ [K in `versions/${string}`]: any;
69
+ };
70
+ type HotMeshApp = VersionedFields & {
71
+ id: string;
72
+ version: string;
73
+ settings?: string;
74
+ active?: boolean;
75
+ };
76
+ type HotMeshApps = {
77
+ [appId: string]: HotMeshApp;
78
+ };
79
+ export { HotMesh, HotMeshEngine, RedisConfig, HotMeshWorker, HotMeshSettings, HotMeshApp, //a single app in the db
80
+ HotMeshApps, //object array of all apps in the db
81
+ HotMeshConfig, //customer config
82
+ HotMeshManifest, HotMeshGraph };
@@ -0,0 +1 @@
1
+ export {};