@hotmeshio/hotmesh 0.0.50 → 0.0.52

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.
package/README.md CHANGED
@@ -294,28 +294,28 @@ const hotMesh = await HotMesh.init({
294
294
  ```
295
295
 
296
296
  ### Observability
297
- Workflows and activities are run according to the rules you define, offering [Graph-Oriented](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/system_lifecycle.md#telemetry) telemetry insights into your legacy function executions.
297
+ Workflows and activities are run according to the rules you define, offering [Graph-Oriented](https://github.com/hotmeshio/sdk-typescript/blob/main/docs/system_lifecycle.md#telemetry) telemetry insights into your legacy function executions.
298
298
 
299
299
  ## FAQ
300
- Refer to the [FAQ](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/faq.md) for terminology, definitions, and an exploration of how HotMesh facilitates orchestration use cases.
300
+ Refer to the [FAQ](https://github.com/hotmeshio/sdk-typescript/blob/main/docs/faq.md) for terminology, definitions, and an exploration of how HotMesh facilitates orchestration use cases.
301
301
 
302
302
  ## Quick Start
303
- Refer to the [Quick Start](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/quickstart.md) for sample flows you can easily copy, paste, and modify to get started.
303
+ Refer to the [Quick Start](https://github.com/hotmeshio/sdk-typescript/blob/main/docs/quickstart.md) for sample flows you can easily copy, paste, and modify to get started.
304
304
 
305
305
  ## Developer Guide
306
- For more details on the complete development process, including information about schemas, APIs, and deployment, consult the [Developer Guide](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/developer_guide.md).
306
+ For more details on the complete development process, including information about schemas, APIs, and deployment, consult the [Developer Guide](https://github.com/hotmeshio/sdk-typescript/blob/main/docs/developer_guide.md).
307
307
 
308
308
  ## Model Driven Development
309
- [Model Driven Development](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/model_driven_development.md) is an established strategy for managing process-oriented tasks. Check out this guide to understand its foundational principles.
309
+ [Model Driven Development](https://github.com/hotmeshio/sdk-typescript/blob/main/docs/model_driven_development.md) is an established strategy for managing process-oriented tasks. Check out this guide to understand its foundational principles.
310
310
 
311
311
  ## Data Mapping
312
- Exchanging data between activities is central to HotMesh. For detailed information on supported functions and the functional mapping syntax (@pipes), see the [Data Mapping Overview](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/data_mapping.md).
312
+ Exchanging data between activities is central to HotMesh. For detailed information on supported functions and the functional mapping syntax (@pipes), see the [Data Mapping Overview](https://github.com/hotmeshio/sdk-typescript/blob/main/docs/data_mapping.md).
313
313
 
314
314
  ## Composition
315
- While the simplest graphs are linear, detailing a consistent sequence of non-cyclical activities, graphs can be layered to represent intricate business scenarios. Some can even be designed to accommodate long-lasting workflows that span months. For more details, check out the [Composable Workflow Guide](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/composable_workflow.md).
315
+ While the simplest graphs are linear, detailing a consistent sequence of non-cyclical activities, graphs can be layered to represent intricate business scenarios. Some can even be designed to accommodate long-lasting workflows that span months. For more details, check out the [Composable Workflow Guide](https://github.com/hotmeshio/sdk-typescript/blob/main/docs/composable_workflow.md).
316
316
 
317
317
  ## Distributed Orchestration
318
- HotMesh is a distributed orchestration engine. Refer to the [Distributed Orchestration Guide](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/distributed_orchestration.md) for a detailed breakdown of the approach.
318
+ HotMesh is a distributed orchestration engine. Refer to the [Distributed Orchestration Guide](https://github.com/hotmeshio/sdk-typescript/blob/main/docs/distributed_orchestration.md) for a detailed breakdown of the approach.
319
319
 
320
320
  ## System Lifecycle
321
- Gain insight into HotMesh's monitoring, exception handling, and alarm configurations via the [System Lifecycle Guide](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/system_lifecycle.md).
321
+ Gain insight into HotMesh's monitoring, exception handling, and alarm configurations via the [System Lifecycle Guide](https://github.com/hotmeshio/sdk-typescript/blob/main/docs/system_lifecycle.md).
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.0.50",
3
+ "version": "0.0.52",
4
4
  "description": "Unbreakable Workflows",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -312,7 +312,7 @@ class Activity {
312
312
  //`state` is a unidimensional hash; context is a tree
313
313
  const [state, status] = await this.store.getState(jid, consumes, dIds);
314
314
  this.context = (0, utils_1.restoreHierarchy)(state);
315
- this.assertGenerationalId(this.context.metadata.gid, gid);
315
+ this.assertGenerationalId(this.context?.metadata?.gid, gid);
316
316
  this.initDimensionalAddress(dad);
317
317
  this.initSelf(this.context);
318
318
  this.initPolicies(this.context);
@@ -325,7 +325,7 @@ class Activity {
325
325
  */
326
326
  assertGenerationalId(jobGID, msgGID) {
327
327
  if (msgGID !== jobGID) {
328
- throw new errors_1.GenerationalError(jobGID, msgGID, this.context.metadata.jid, this.context.metadata.aid, this.context.metadata.dad);
328
+ throw new errors_1.GenerationalError(jobGID, msgGID, this.context?.metadata?.jid ?? '', this.context?.metadata?.aid ?? '', this.context?.metadata?.dad ?? '');
329
329
  }
330
330
  }
331
331
  initDimensionalAddress(dad) {
@@ -152,7 +152,7 @@ declare abstract class StoreService<T, U extends AbstractRedisClient> {
152
152
  */
153
153
  interrupt(topic: string, jobId: string, options?: JobInterruptOptions): Promise<void>;
154
154
  scrub(jobId: string): Promise<void>;
155
- findJobs(queryString?: string, limit?: number, batchSize?: number): Promise<[string, string[]]>;
155
+ findJobs(queryString?: string, limit?: number, batchSize?: number, cursor?: string): Promise<[string, string[]]>;
156
156
  findJobFields(jobId: string, fieldMatchPattern?: string, limit?: number, batchSize?: number, cursor?: string): Promise<[string, StringStringType]>;
157
157
  }
158
158
  export { StoreService };
@@ -899,9 +899,8 @@ class StoreService {
899
899
  const jobKey = this.mintKey(key_1.KeyType.JOB_STATE, { appId: this.appId, jobId });
900
900
  await this.redisClient[this.commands.del](jobKey);
901
901
  }
902
- async findJobs(queryString = '*', limit = 1000, batchSize = 1000) {
902
+ async findJobs(queryString = '*', limit = 1000, batchSize = 1000, cursor = '0') {
903
903
  const matchKey = this.mintKey(key_1.KeyType.JOB_STATE, { appId: this.appId, jobId: queryString });
904
- let cursor = '0';
905
904
  let keys;
906
905
  const matchingKeys = [];
907
906
  do {
@@ -12,7 +12,7 @@ export { JobData, JobsData, JobMetadata, JobOutput, JobState, JobStatus, Partial
12
12
  export { MappingStatements } from './map';
13
13
  export { Pipe, PipeItem, PipeItems } from './pipe';
14
14
  export { HotMesh, HotMeshApp, HotMeshApps, HotMeshConfig, HotMeshEngine, RedisConfig, HotMeshGraph, HotMeshManifest, HotMeshSettings, HotMeshWorker, KeyStoreParams, KeyType } from './hotmesh';
15
- export { ActivateMessage, JobMessage, JobMessageCallback, PingMessage, PongMessage, QuorumMessage, QuorumMessageCallback, QuorumProfile, SubscriptionCallback, SystemHealth, ThrottleMessage, ThrottleOptions, WorkMessage } from './quorum';
15
+ export { ActivateMessage, CronMessage, JobMessage, JobMessageCallback, PingMessage, PongMessage, QuorumMessage, QuorumMessageCallback, QuorumProfile, RollCallMessage, SubscriptionCallback, SystemHealth, ThrottleMessage, ThrottleOptions, WorkMessage } from './quorum';
16
16
  export { MultiResponseFlags, RedisClient, RedisMulti } from './redis';
17
17
  export { RedisClientType, RedisMultiType } from './redisclient';
18
18
  export { JSONSchema, StringAnyType, StringScalarType, StringStringType, SymbolMap, SymbolMaps, SymbolRanges, Symbols, SymbolSets } from './serializer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.0.50",
3
+ "version": "0.0.52",
4
4
  "description": "Unbreakable Workflows",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -400,7 +400,7 @@ class Activity {
400
400
  //`state` is a unidimensional hash; context is a tree
401
401
  const [state, status] = await this.store.getState(jid, consumes, dIds);
402
402
  this.context = restoreHierarchy(state) as JobState;
403
- this.assertGenerationalId(this.context.metadata.gid, gid);
403
+ this.assertGenerationalId(this.context?.metadata?.gid, gid);
404
404
  this.initDimensionalAddress(dad);
405
405
  this.initSelf(this.context);
406
406
  this.initPolicies(this.context);
@@ -417,9 +417,9 @@ class Activity {
417
417
  throw new GenerationalError(
418
418
  jobGID,
419
419
  msgGID,
420
- this.context.metadata.jid,
421
- this.context.metadata.aid,
422
- this.context.metadata.dad
420
+ this.context?.metadata?.jid ?? '',
421
+ this.context?.metadata?.aid ?? '',
422
+ this.context?.metadata?.dad ?? ''
423
423
  );
424
424
  }
425
425
  }
@@ -1028,9 +1028,8 @@ abstract class StoreService<T, U extends AbstractRedisClient> {
1028
1028
  await this.redisClient[this.commands.del](jobKey);
1029
1029
  }
1030
1030
 
1031
- async findJobs(queryString: string = '*', limit: number = 1000, batchSize: number = 1000): Promise<[string, string[]]> {
1031
+ async findJobs(queryString: string = '*', limit: number = 1000, batchSize: number = 1000, cursor = '0'): Promise<[string, string[]]> {
1032
1032
  const matchKey = this.mintKey(KeyType.JOB_STATE, { appId: this.appId, jobId: queryString });
1033
- let cursor = '0';
1034
1033
  let keys: string[];
1035
1034
  const matchingKeys: string[] = [];
1036
1035
  do {
package/types/index.ts CHANGED
@@ -107,6 +107,7 @@ export {
107
107
  KeyType } from './hotmesh';
108
108
  export {
109
109
  ActivateMessage,
110
+ CronMessage,
110
111
  JobMessage,
111
112
  JobMessageCallback,
112
113
  PingMessage,
@@ -114,6 +115,7 @@ export {
114
115
  QuorumMessage,
115
116
  QuorumMessageCallback,
116
117
  QuorumProfile,
118
+ RollCallMessage,
117
119
  SubscriptionCallback,
118
120
  SystemHealth,
119
121
  ThrottleMessage,