@hotmeshio/hotmesh 0.3.31 → 0.4.0

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 (254) hide show
  1. package/README.md +128 -823
  2. package/build/index.d.ts +9 -9
  3. package/build/index.js +10 -10
  4. package/build/package.json +22 -21
  5. package/build/types/error.d.ts +5 -5
  6. package/build/types/exporter.d.ts +1 -1
  7. package/build/types/index.d.ts +3 -3
  8. package/build/types/manifest.d.ts +2 -2
  9. package/build/types/{meshflow.d.ts → memflow.d.ts} +15 -15
  10. package/build/types/meshdata.d.ts +3 -3
  11. package/build/types/postgres.d.ts +7 -0
  12. package/build/types/stream.d.ts +3 -0
  13. package/index.ts +11 -11
  14. package/package.json +22 -21
  15. package/typedoc.json +8 -7
  16. package/types/error.ts +5 -5
  17. package/types/exporter.ts +1 -1
  18. package/types/index.ts +7 -7
  19. package/types/manifest.ts +2 -2
  20. package/types/{meshflow.ts → memflow.ts} +15 -15
  21. package/types/meshdata.ts +3 -3
  22. package/types/postgres.ts +9 -0
  23. package/types/stream.ts +4 -0
  24. package/build/modules/enums.d.ts +0 -108
  25. package/build/modules/enums.js +0 -132
  26. package/build/modules/errors.d.ts +0 -124
  27. package/build/modules/errors.js +0 -191
  28. package/build/modules/key.d.ts +0 -66
  29. package/build/modules/key.js +0 -1
  30. package/build/modules/storage.d.ts +0 -3
  31. package/build/modules/storage.js +0 -5
  32. package/build/modules/utils.d.ts +0 -119
  33. package/build/modules/utils.js +0 -1
  34. package/build/services/activities/activity.d.ts +0 -104
  35. package/build/services/activities/activity.js +0 -1
  36. package/build/services/activities/await.d.ts +0 -12
  37. package/build/services/activities/await.js +0 -1
  38. package/build/services/activities/cycle.d.ts +0 -19
  39. package/build/services/activities/cycle.js +0 -1
  40. package/build/services/activities/hook.d.ts +0 -27
  41. package/build/services/activities/hook.js +0 -1
  42. package/build/services/activities/index.d.ts +0 -19
  43. package/build/services/activities/index.js +0 -1
  44. package/build/services/activities/interrupt.d.ts +0 -16
  45. package/build/services/activities/interrupt.js +0 -1
  46. package/build/services/activities/signal.d.ts +0 -20
  47. package/build/services/activities/signal.js +0 -1
  48. package/build/services/activities/trigger.d.ts +0 -37
  49. package/build/services/activities/trigger.js +0 -1
  50. package/build/services/activities/worker.d.ts +0 -12
  51. package/build/services/activities/worker.js +0 -1
  52. package/build/services/collator/index.d.ts +0 -111
  53. package/build/services/collator/index.js +0 -1
  54. package/build/services/compiler/deployer.d.ts +0 -40
  55. package/build/services/compiler/deployer.js +0 -1
  56. package/build/services/compiler/index.d.ts +0 -32
  57. package/build/services/compiler/index.js +0 -1
  58. package/build/services/compiler/validator.d.ts +0 -34
  59. package/build/services/compiler/validator.js +0 -1
  60. package/build/services/connector/factory.d.ts +0 -22
  61. package/build/services/connector/factory.js +0 -99
  62. package/build/services/connector/index.d.ts +0 -30
  63. package/build/services/connector/index.js +0 -54
  64. package/build/services/connector/providers/ioredis.d.ts +0 -9
  65. package/build/services/connector/providers/ioredis.js +0 -26
  66. package/build/services/connector/providers/nats.d.ts +0 -9
  67. package/build/services/connector/providers/nats.js +0 -34
  68. package/build/services/connector/providers/postgres.d.ts +0 -20
  69. package/build/services/connector/providers/postgres.js +0 -102
  70. package/build/services/connector/providers/redis.d.ts +0 -9
  71. package/build/services/connector/providers/redis.js +0 -38
  72. package/build/services/engine/index.d.ts +0 -264
  73. package/build/services/engine/index.js +0 -1
  74. package/build/services/exporter/index.d.ts +0 -44
  75. package/build/services/exporter/index.js +0 -1
  76. package/build/services/hotmesh/index.d.ts +0 -340
  77. package/build/services/hotmesh/index.js +0 -479
  78. package/build/services/logger/index.d.ts +0 -16
  79. package/build/services/logger/index.js +0 -54
  80. package/build/services/mapper/index.d.ts +0 -28
  81. package/build/services/mapper/index.js +0 -1
  82. package/build/services/meshcall/index.d.ts +0 -194
  83. package/build/services/meshcall/index.js +0 -452
  84. package/build/services/meshcall/schemas/factory.d.ts +0 -9
  85. package/build/services/meshcall/schemas/factory.js +0 -189
  86. package/build/services/meshdata/index.d.ts +0 -795
  87. package/build/services/meshdata/index.js +0 -1235
  88. package/build/services/meshflow/client.d.ts +0 -108
  89. package/build/services/meshflow/client.js +0 -371
  90. package/build/services/meshflow/connection.d.ts +0 -23
  91. package/build/services/meshflow/connection.js +0 -33
  92. package/build/services/meshflow/exporter.d.ts +0 -51
  93. package/build/services/meshflow/exporter.js +0 -1
  94. package/build/services/meshflow/handle.d.ts +0 -90
  95. package/build/services/meshflow/handle.js +0 -176
  96. package/build/services/meshflow/index.d.ts +0 -111
  97. package/build/services/meshflow/index.js +0 -117
  98. package/build/services/meshflow/schemas/factory.d.ts +0 -29
  99. package/build/services/meshflow/schemas/factory.js +0 -2492
  100. package/build/services/meshflow/search.d.ts +0 -142
  101. package/build/services/meshflow/search.js +0 -320
  102. package/build/services/meshflow/worker.d.ts +0 -124
  103. package/build/services/meshflow/worker.js +0 -514
  104. package/build/services/meshflow/workflow/all.d.ts +0 -7
  105. package/build/services/meshflow/workflow/all.js +0 -15
  106. package/build/services/meshflow/workflow/common.d.ts +0 -18
  107. package/build/services/meshflow/workflow/common.js +0 -45
  108. package/build/services/meshflow/workflow/context.d.ts +0 -6
  109. package/build/services/meshflow/workflow/context.js +0 -45
  110. package/build/services/meshflow/workflow/didRun.d.ts +0 -7
  111. package/build/services/meshflow/workflow/didRun.js +0 -22
  112. package/build/services/meshflow/workflow/emit.d.ts +0 -11
  113. package/build/services/meshflow/workflow/emit.js +0 -29
  114. package/build/services/meshflow/workflow/enrich.d.ts +0 -9
  115. package/build/services/meshflow/workflow/enrich.js +0 -17
  116. package/build/services/meshflow/workflow/execChild.d.ts +0 -18
  117. package/build/services/meshflow/workflow/execChild.js +0 -102
  118. package/build/services/meshflow/workflow/hook.d.ts +0 -9
  119. package/build/services/meshflow/workflow/hook.js +0 -40
  120. package/build/services/meshflow/workflow/index.d.ts +0 -70
  121. package/build/services/meshflow/workflow/index.js +0 -83
  122. package/build/services/meshflow/workflow/interrupt.d.ts +0 -9
  123. package/build/services/meshflow/workflow/interrupt.js +0 -24
  124. package/build/services/meshflow/workflow/isSideEffectAllowed.d.ts +0 -10
  125. package/build/services/meshflow/workflow/isSideEffectAllowed.js +0 -33
  126. package/build/services/meshflow/workflow/proxyActivities.d.ts +0 -20
  127. package/build/services/meshflow/workflow/proxyActivities.js +0 -97
  128. package/build/services/meshflow/workflow/random.d.ts +0 -6
  129. package/build/services/meshflow/workflow/random.js +0 -16
  130. package/build/services/meshflow/workflow/searchMethods.d.ts +0 -6
  131. package/build/services/meshflow/workflow/searchMethods.js +0 -25
  132. package/build/services/meshflow/workflow/signal.d.ts +0 -7
  133. package/build/services/meshflow/workflow/signal.js +0 -28
  134. package/build/services/meshflow/workflow/sleepFor.d.ts +0 -8
  135. package/build/services/meshflow/workflow/sleepFor.js +0 -35
  136. package/build/services/meshflow/workflow/trace.d.ts +0 -14
  137. package/build/services/meshflow/workflow/trace.js +0 -33
  138. package/build/services/meshflow/workflow/waitFor.d.ts +0 -8
  139. package/build/services/meshflow/workflow/waitFor.js +0 -35
  140. package/build/services/meshos/index.d.ts +0 -293
  141. package/build/services/meshos/index.js +0 -547
  142. package/build/services/pipe/functions/array.d.ts +0 -17
  143. package/build/services/pipe/functions/array.js +0 -1
  144. package/build/services/pipe/functions/bitwise.d.ts +0 -9
  145. package/build/services/pipe/functions/bitwise.js +0 -1
  146. package/build/services/pipe/functions/conditional.d.ts +0 -13
  147. package/build/services/pipe/functions/conditional.js +0 -1
  148. package/build/services/pipe/functions/cron.d.ts +0 -12
  149. package/build/services/pipe/functions/cron.js +0 -1
  150. package/build/services/pipe/functions/date.d.ts +0 -58
  151. package/build/services/pipe/functions/date.js +0 -1
  152. package/build/services/pipe/functions/index.d.ts +0 -29
  153. package/build/services/pipe/functions/index.js +0 -1
  154. package/build/services/pipe/functions/json.d.ts +0 -5
  155. package/build/services/pipe/functions/json.js +0 -1
  156. package/build/services/pipe/functions/logical.d.ts +0 -5
  157. package/build/services/pipe/functions/logical.js +0 -1
  158. package/build/services/pipe/functions/math.d.ts +0 -42
  159. package/build/services/pipe/functions/math.js +0 -1
  160. package/build/services/pipe/functions/number.d.ts +0 -21
  161. package/build/services/pipe/functions/number.js +0 -1
  162. package/build/services/pipe/functions/object.d.ts +0 -25
  163. package/build/services/pipe/functions/object.js +0 -1
  164. package/build/services/pipe/functions/string.d.ts +0 -23
  165. package/build/services/pipe/functions/string.js +0 -1
  166. package/build/services/pipe/functions/symbol.d.ts +0 -12
  167. package/build/services/pipe/functions/symbol.js +0 -1
  168. package/build/services/pipe/functions/unary.d.ts +0 -7
  169. package/build/services/pipe/functions/unary.js +0 -1
  170. package/build/services/pipe/index.d.ts +0 -48
  171. package/build/services/pipe/index.js +0 -1
  172. package/build/services/quorum/index.d.ts +0 -90
  173. package/build/services/quorum/index.js +0 -1
  174. package/build/services/reporter/index.d.ts +0 -50
  175. package/build/services/reporter/index.js +0 -1
  176. package/build/services/router/index.d.ts +0 -60
  177. package/build/services/router/index.js +0 -1
  178. package/build/services/search/factory.d.ts +0 -7
  179. package/build/services/search/factory.js +0 -24
  180. package/build/services/search/index.d.ts +0 -22
  181. package/build/services/search/index.js +0 -10
  182. package/build/services/search/providers/postgres/postgres.d.ts +0 -24
  183. package/build/services/search/providers/postgres/postgres.js +0 -1
  184. package/build/services/search/providers/redis/ioredis.d.ts +0 -18
  185. package/build/services/search/providers/redis/ioredis.js +0 -1
  186. package/build/services/search/providers/redis/redis.d.ts +0 -18
  187. package/build/services/search/providers/redis/redis.js +0 -1
  188. package/build/services/serializer/index.d.ts +0 -42
  189. package/build/services/serializer/index.js +0 -1
  190. package/build/services/store/cache.d.ts +0 -67
  191. package/build/services/store/cache.js +0 -128
  192. package/build/services/store/factory.d.ts +0 -8
  193. package/build/services/store/factory.js +0 -24
  194. package/build/services/store/index.d.ts +0 -89
  195. package/build/services/store/index.js +0 -9
  196. package/build/services/store/providers/postgres/kvsql.d.ts +0 -168
  197. package/build/services/store/providers/postgres/kvsql.js +0 -1
  198. package/build/services/store/providers/postgres/kvtables.d.ts +0 -20
  199. package/build/services/store/providers/postgres/kvtables.js +0 -1
  200. package/build/services/store/providers/postgres/kvtransaction.d.ts +0 -36
  201. package/build/services/store/providers/postgres/kvtransaction.js +0 -1
  202. package/build/services/store/providers/postgres/kvtypes/hash.d.ts +0 -60
  203. package/build/services/store/providers/postgres/kvtypes/hash.js +0 -1
  204. package/build/services/store/providers/postgres/kvtypes/list.d.ts +0 -33
  205. package/build/services/store/providers/postgres/kvtypes/list.js +0 -1
  206. package/build/services/store/providers/postgres/kvtypes/string.d.ts +0 -20
  207. package/build/services/store/providers/postgres/kvtypes/string.js +0 -1
  208. package/build/services/store/providers/postgres/kvtypes/zset.d.ts +0 -41
  209. package/build/services/store/providers/postgres/kvtypes/zset.js +0 -1
  210. package/build/services/store/providers/postgres/postgres.d.ts +0 -145
  211. package/build/services/store/providers/postgres/postgres.js +0 -1
  212. package/build/services/store/providers/redis/_base.d.ts +0 -137
  213. package/build/services/store/providers/redis/_base.js +0 -1
  214. package/build/services/store/providers/redis/ioredis.d.ts +0 -20
  215. package/build/services/store/providers/redis/ioredis.js +0 -1
  216. package/build/services/store/providers/redis/redis.d.ts +0 -18
  217. package/build/services/store/providers/redis/redis.js +0 -1
  218. package/build/services/store/providers/store-initializable.d.ts +0 -5
  219. package/build/services/store/providers/store-initializable.js +0 -1
  220. package/build/services/stream/factory.d.ts +0 -8
  221. package/build/services/stream/factory.js +0 -37
  222. package/build/services/stream/index.d.ts +0 -64
  223. package/build/services/stream/index.js +0 -11
  224. package/build/services/stream/providers/nats/nats.d.ts +0 -59
  225. package/build/services/stream/providers/nats/nats.js +0 -1
  226. package/build/services/stream/providers/postgres/kvtables.d.ts +0 -2
  227. package/build/services/stream/providers/postgres/kvtables.js +0 -1
  228. package/build/services/stream/providers/postgres/postgres.d.ts +0 -88
  229. package/build/services/stream/providers/postgres/postgres.js +0 -1
  230. package/build/services/stream/providers/redis/ioredis.d.ts +0 -60
  231. package/build/services/stream/providers/redis/ioredis.js +0 -1
  232. package/build/services/stream/providers/redis/redis.d.ts +0 -60
  233. package/build/services/stream/providers/redis/redis.js +0 -1
  234. package/build/services/stream/providers/stream-initializable.d.ts +0 -4
  235. package/build/services/stream/providers/stream-initializable.js +0 -1
  236. package/build/services/sub/factory.d.ts +0 -7
  237. package/build/services/sub/factory.js +0 -29
  238. package/build/services/sub/index.d.ts +0 -22
  239. package/build/services/sub/index.js +0 -10
  240. package/build/services/sub/providers/nats/nats.d.ts +0 -19
  241. package/build/services/sub/providers/nats/nats.js +0 -1
  242. package/build/services/sub/providers/postgres/postgres.d.ts +0 -19
  243. package/build/services/sub/providers/postgres/postgres.js +0 -1
  244. package/build/services/sub/providers/redis/ioredis.d.ts +0 -17
  245. package/build/services/sub/providers/redis/ioredis.js +0 -1
  246. package/build/services/sub/providers/redis/redis.d.ts +0 -17
  247. package/build/services/sub/providers/redis/redis.js +0 -1
  248. package/build/services/task/index.d.ts +0 -36
  249. package/build/services/task/index.js +0 -1
  250. package/build/services/telemetry/index.d.ts +0 -52
  251. package/build/services/telemetry/index.js +0 -1
  252. package/build/services/worker/index.d.ts +0 -77
  253. package/build/services/worker/index.js +0 -1
  254. /package/build/types/{meshflow.js → memflow.js} +0 -0
@@ -1,340 +0,0 @@
1
- import { EngineService } from '../engine';
2
- import { ILogger } from '../logger';
3
- import { QuorumService } from '../quorum';
4
- import { WorkerService } from '../worker';
5
- import { JobState, JobData, JobOutput, JobStatus, JobInterruptOptions, ExtensionType } from '../../types/job';
6
- import { HotMeshConfig, HotMeshManifest } from '../../types/hotmesh';
7
- import { JobExport } from '../../types/exporter';
8
- import { JobMessageCallback, QuorumMessage, QuorumMessageCallback, QuorumProfile, ThrottleOptions } from '../../types/quorum';
9
- import { StringAnyType, StringStringType } from '../../types/serializer';
10
- import { JobStatsInput, GetStatsOptions, IdsResponse, StatsResponse } from '../../types/stats';
11
- import { StreamCode, StreamData, StreamDataResponse, StreamStatus } from '../../types/stream';
12
- /**
13
- * This example shows the full lifecycle of a HotMesh engine instance,
14
- * including: initialization, deployment, activation and execution.
15
- *
16
- * Engine routers are self-managing, but subscribe to the 'quorum' channel
17
- * to establish consensus as necessary for distributed processing.
18
- * Completed workflows are always soft-deleted with a configurable
19
- * retention period.
20
- *
21
- * @example
22
- * ```typescript
23
- * import { Client as Postgres } from 'pg';
24
- * import { HotMesh } from '@hotmeshio/hotmesh';
25
- *
26
- * const hotMesh = await HotMesh.init({
27
- * appId: 'abc',
28
- * engine: {
29
- * connection: {
30
- * class: Postgres,
31
- * options: {
32
- * connectionString: 'postgresql://usr:pwd@localhost:5432/db',
33
- * }
34
- * }
35
- * }
36
- * });
37
- *
38
- * await hotMesh.deploy(`
39
- * app:
40
- * id: abc
41
- * version: '1'
42
- * graphs:
43
- * - subscribes: abc.test
44
- * activities:
45
- * t1:
46
- * type: trigger
47
- * `);
48
- *
49
- * await hotMesh.activate('1');
50
- *
51
- * await hotMesh.pubsub('abc.test');
52
- *
53
- * await HotMesh.stop();
54
- * ```
55
- */
56
- declare class HotMesh {
57
- namespace: string;
58
- appId: string;
59
- guid: string;
60
- /**
61
- * @private
62
- */
63
- engine: EngineService | null;
64
- /**
65
- * @private
66
- */
67
- quorum: QuorumService | null;
68
- /**
69
- * @private
70
- */
71
- workers: WorkerService[];
72
- logger: ILogger;
73
- static disconnecting: boolean;
74
- /**
75
- * @private
76
- */
77
- verifyAndSetNamespace(namespace?: string): void;
78
- /**
79
- * @private
80
- */
81
- verifyAndSetAppId(appId: string): void;
82
- /**
83
- * Instance initializer. Workers are configured
84
- * similarly to the engine, but as an array with
85
- * multiple worker objects.
86
- *
87
- * @example
88
- * ```typescript
89
- * const config: HotMeshConfig = {
90
- * appId: 'myapp',
91
- * engine: {
92
- * connection: {
93
- * class: Postgres,
94
- * options: {
95
- * connectionString: 'postgresql://usr:pwd@localhost:5432/db',
96
- * }
97
- * }
98
- * },
99
- * workers [...]
100
- * };
101
- * const hotMesh = await HotMesh.init(config);
102
- * ```
103
- */
104
- static init(config: HotMeshConfig): Promise<HotMesh>;
105
- /**
106
- * returns a guid using the same core guid
107
- * generator used by the HotMesh (nanoid)
108
- */
109
- static guid(): string;
110
- /**
111
- * @private
112
- */
113
- initEngine(config: HotMeshConfig, logger: ILogger): Promise<void>;
114
- /**
115
- * @private
116
- */
117
- initQuorum(config: HotMeshConfig, engine: EngineService, logger: ILogger): Promise<void>;
118
- /**
119
- * @private
120
- */
121
- constructor();
122
- /**
123
- * @private
124
- */
125
- doWork(config: HotMeshConfig, logger: ILogger): Promise<void>;
126
- /**
127
- * Starts a workflow
128
- * @example
129
- * ```typescript
130
- * await hotMesh.pub('a.b.c', { key: 'value' });
131
- * ```
132
- */
133
- pub(topic: string, data?: JobData, context?: JobState, extended?: ExtensionType): Promise<string>;
134
- /**
135
- * Subscribe (listen) to all output and interim emissions of a single
136
- * workflow topic. NOTE: Postgres does not support patterned
137
- * unsubscription, so this method is not supported for Postgres.
138
- *
139
- * @example
140
- * ```typescript
141
- * await hotMesh.psub('a.b.c', (topic, message) => {
142
- * console.log(message);
143
- * });
144
- * ```
145
- */
146
- sub(topic: string, callback: JobMessageCallback): Promise<void>;
147
- /**
148
- * Stop listening in on a single workflow topic
149
- */
150
- unsub(topic: string): Promise<void>;
151
- /**
152
- * Listen to all output and interim emissions of a workflow topic
153
- * matching a wildcard pattern.
154
- * @example
155
- * ```typescript
156
- * await hotMesh.psub('a.b.c*', (topic, message) => {
157
- * console.log(message);
158
- * });
159
- * ```
160
- */
161
- psub(wild: string, callback: JobMessageCallback): Promise<void>;
162
- /**
163
- * Patterned unsubscribe. NOTE: Postgres does not support patterned
164
- * unsubscription, so this method is not supported for Postgres.
165
- */
166
- punsub(wild: string): Promise<void>;
167
- /**
168
- * Starts a workflow and awaits the response
169
- * @example
170
- * ```typescript
171
- * await hotMesh.pubsub('a.b.c', { key: 'value' });
172
- * ```
173
- */
174
- pubsub(topic: string, data?: JobData, context?: JobState | null, timeout?: number): Promise<JobOutput>;
175
- /**
176
- * Add a transition message to the workstream, resuming leg 2 of a paused
177
- * reentrant activity (e.g., await, worker, hook)
178
- */
179
- add(streamData: StreamData | StreamDataResponse): Promise<string>;
180
- /**
181
- * Request a roll call from the quorum (engine and workers)
182
- */
183
- rollCall(delay?: number): Promise<QuorumProfile[]>;
184
- /**
185
- * Sends a throttle message to the quorum (engine and/or workers)
186
- * to limit the rate of processing. Pass `-1` to throttle indefinitely.
187
- * The value must be a non-negative integer and not exceed `MAX_DELAY` ms.
188
- *
189
- * When throttling is set, the quorum will pause for the specified time
190
- * before processing the next message. Target specific engines and
191
- * workers by passing a `guid` and/or `topic`. Pass no arguments to
192
- * throttle the entire quorum.
193
- *
194
- * In this example, all processing has been paused indefinitely for
195
- * the entire quorum. This is equivalent to an emergency stop.
196
- *
197
- * HotMesh is a stateless sequence engine, so the throttle can be adjusted up
198
- * and down with no loss of data.
199
- *
200
- *
201
- * @example
202
- * ```typescript
203
- * await hotMesh.throttle({ throttle: -1 });
204
- * ```
205
- */
206
- throttle(options: ThrottleOptions): Promise<boolean>;
207
- /**
208
- * Publish a message to the quorum (engine and/or workers)
209
- */
210
- pubQuorum(quorumMessage: QuorumMessage): Promise<boolean>;
211
- /**
212
- * Subscribe to quorum events (engine and workers)
213
- */
214
- subQuorum(callback: QuorumMessageCallback): Promise<void>;
215
- /**
216
- * Unsubscribe from quorum events (engine and workers)
217
- */
218
- unsubQuorum(callback: QuorumMessageCallback): Promise<void>;
219
- /**
220
- * Preview changes and provide an analysis of risk
221
- * prior to deployment
222
- * @private
223
- */
224
- plan(path: string): Promise<HotMeshManifest>;
225
- /**
226
- * When the app YAML descriptor file is ready, the `deploy` function can be called.
227
- * This function is responsible for merging all referenced YAML source
228
- * files and writing the JSON output to the file system and to the provider backend. It
229
- * is also possible to embed the YAML in-line as a string.
230
- *
231
- * *The version will not be active until activation is explicitly called.*
232
- */
233
- deploy(pathOrYAML: string): Promise<HotMeshManifest>;
234
- /**
235
- * Once the app YAML file is deployed to the provider backend, the `activate` function can be
236
- * called to enable it for the entire quorum at the same moment.
237
- *
238
- * The approach is to establish the coordinated health of the system through series
239
- * of call/response exchanges. Once it is established that the quorum is healthy,
240
- * the quorum is instructed to run their engine in `no-cache` mode, ensuring
241
- * that the provider backend is consulted for the active app version each time a
242
- * call is processed. This ensures that all engines are running the same version
243
- * of the app, switching over at the same moment and then enabling `cache` mode
244
- * to improve performance.
245
- *
246
- * *Add a delay for the quorum to reach consensus if traffic is busy, but
247
- * also consider throttling traffic flow to an acceptable level.*
248
- */
249
- activate(version: string, delay?: number): Promise<boolean>;
250
- /**
251
- * Returns the job state as a JSON object, useful
252
- * for understanding dependency chains
253
- */
254
- export(jobId: string): Promise<JobExport>;
255
- /**
256
- * Returns all data (HGETALL) for a job.
257
- */
258
- getRaw(jobId: string): Promise<StringStringType>;
259
- /**
260
- * Reporter-related method to get the status of a job
261
- * @private
262
- */
263
- getStats(topic: string, query: JobStatsInput): Promise<StatsResponse>;
264
- /**
265
- * Returns the status of a job. This is a numeric
266
- * semaphore value that indicates the job's state.
267
- * Any non-positive value indicates a completed job.
268
- * Jobs with a value of `-1` are pending and will
269
- * automatically be scrubbed after a set period.
270
- * Jobs a value around -1billion have been interrupted
271
- * and will be scrubbed after a set period. Jobs with
272
- * a value of 0 completed normally. Jobs with a
273
- * positive value are still running.
274
- */
275
- getStatus(jobId: string): Promise<JobStatus>;
276
- /**
277
- * Returns the job state (data and metadata) for a job.
278
- */
279
- getState(topic: string, jobId: string): Promise<JobOutput>;
280
- /**
281
- * Returns searchable/queryable data for a job. In this
282
- * example a literal field is also searched (the colon
283
- * is used to track job status and is a reserved field;
284
- * it can be read but not written).
285
- *
286
- * @example
287
- * ```typescript
288
- * const fields = ['fred', 'barney', '":"'];
289
- * const queryState = await hotMesh.getQueryState('123', fields);
290
- * //returns { fred: 'flintstone', barney: 'rubble', ':': '1' }
291
- * ```
292
- */
293
- getQueryState(jobId: string, fields: string[]): Promise<StringAnyType>;
294
- /**
295
- * @private
296
- */
297
- getIds(topic: string, query: JobStatsInput, queryFacets?: any[]): Promise<IdsResponse>;
298
- /**
299
- * @private
300
- */
301
- resolveQuery(topic: string, query: JobStatsInput): Promise<GetStatsOptions>;
302
- /**
303
- * Interrupt an active job
304
- */
305
- interrupt(topic: string, jobId: string, options?: JobInterruptOptions): Promise<string>;
306
- /**
307
- * Immediately deletes (DEL) a completed job from the system.
308
- *
309
- * *Scrubbed jobs must be complete with a non-positive `status` value*
310
- */
311
- scrub(jobId: string): Promise<void>;
312
- /**
313
- * Re/entry point for an active job. This is used to resume a paused job
314
- * and close the reentry point or leave it open for subsequent reentry.
315
- * Because `hooks` are public entry points, they include a `topic`
316
- * which is established in the app YAML file.
317
- *
318
- * When this method is called, a hook rule will be located to establish
319
- * the exact activity and activity dimension for reentry.
320
- */
321
- hook(topic: string, data: JobData, status?: StreamStatus, code?: StreamCode): Promise<string>;
322
- /**
323
- * @private
324
- */
325
- hookAll(hookTopic: string, data: JobData, query: JobStatsInput, queryFacets?: string[]): Promise<string[]>;
326
- /**
327
- * Stop all points of presence, workers and engines
328
- */
329
- static stop(): Promise<void>;
330
- /**
331
- * Stop this point of presence, workers and engines
332
- */
333
- stop(): void;
334
- /**
335
- * @private
336
- * @deprecated
337
- */
338
- compress(terms: string[]): Promise<boolean>;
339
- }
340
- export { HotMesh };