@hotmeshio/hotmesh 0.0.58 → 0.0.59
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
|
@@ -295,28 +295,28 @@ const hotMesh = await HotMesh.init({
|
|
|
295
295
|
```
|
|
296
296
|
|
|
297
297
|
### Observability
|
|
298
|
-
Workflows and activities are run according to the rules you define, offering [Graph-Oriented](https://github.com/hotmeshio/sdk-typescript/
|
|
298
|
+
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.
|
|
299
299
|
|
|
300
300
|
## FAQ
|
|
301
|
-
Refer to the [FAQ](https://github.com/hotmeshio/sdk-typescript/
|
|
301
|
+
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.
|
|
302
302
|
|
|
303
303
|
## Quick Start
|
|
304
|
-
Refer to the [Quick Start](https://github.com/hotmeshio/sdk-typescript/
|
|
304
|
+
Refer to the [Quick Start](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/quickstart.md) for sample YAML workflows you can copy, paste, and modify to get started.
|
|
305
305
|
|
|
306
306
|
## Developer Guide
|
|
307
|
-
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/
|
|
307
|
+
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).
|
|
308
308
|
|
|
309
309
|
## Model Driven Development
|
|
310
|
-
[Model Driven Development](https://github.com/hotmeshio/sdk-typescript/
|
|
310
|
+
[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.
|
|
311
311
|
|
|
312
312
|
## Data Mapping
|
|
313
|
-
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/
|
|
313
|
+
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).
|
|
314
314
|
|
|
315
315
|
## Composition
|
|
316
|
-
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/
|
|
316
|
+
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).
|
|
317
317
|
|
|
318
318
|
## Distributed Orchestration
|
|
319
|
-
HotMesh is a distributed orchestration engine. Refer to the [Distributed Orchestration Guide](https://github.com/hotmeshio/sdk-typescript/
|
|
319
|
+
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.
|
|
320
320
|
|
|
321
321
|
## System Lifecycle
|
|
322
|
-
Gain insight into HotMesh's monitoring, exception handling, and alarm configurations via the [System Lifecycle Guide](https://github.com/hotmeshio/sdk-typescript/
|
|
322
|
+
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).
|
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotmeshio/hotmesh",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.59",
|
|
4
4
|
"description": "Unbreakable Workflows",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"start": "ts-node src/index.ts",
|
|
22
22
|
"test": "NODE_ENV=test jest --detectOpenHandles --forceExit --verbose",
|
|
23
23
|
"test:hmsh": "NODE_ENV=test jest ./tests/functional/index.test.ts --detectOpenHandles --verbose",
|
|
24
|
+
"test:unit": "NODE_ENV=test jest ./tests/unit/*/*/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
24
25
|
"test:pipe": "NODE_ENV=test jest ./tests/unit/services/pipe/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
25
26
|
"test:compile": "NODE_ENV=test jest ./tests/functional/compile/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
26
27
|
"test:cycle": "NODE_ENV=test jest ./tests/functional/cycle/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
@@ -236,7 +236,7 @@ class WorkerService {
|
|
|
236
236
|
const workflowInput = data.data;
|
|
237
237
|
const execIndex = counter.counter - interruptionRegistry.length + 1;
|
|
238
238
|
const { workflowId, workflowTopic, workflowDimension, originJobId } = workflowInput;
|
|
239
|
-
const collatorFlowId = (0, utils_1.guid)()
|
|
239
|
+
const collatorFlowId = `${(0, utils_1.guid)()}$C`;
|
|
240
240
|
return {
|
|
241
241
|
status: stream_1.StreamStatus.SUCCESS,
|
|
242
242
|
code: enums_1.HMSH_CODE_DURABLE_ALL,
|
|
@@ -18,6 +18,7 @@ declare class Pipe {
|
|
|
18
18
|
* @returns {any} the result of the pipe
|
|
19
19
|
*/
|
|
20
20
|
process(resolved?: unknown[] | null): any;
|
|
21
|
+
cloneUnknown<T>(value: T): T;
|
|
21
22
|
/**
|
|
22
23
|
* Transforms iterable `input` into a single value. Vars $output, $item, $key
|
|
23
24
|
* and $input are available. The final statement in the iterator (the reduction)
|
|
@@ -47,6 +47,27 @@ class Pipe {
|
|
|
47
47
|
}
|
|
48
48
|
return resolved[0];
|
|
49
49
|
}
|
|
50
|
+
cloneUnknown(value) {
|
|
51
|
+
if (value === null || typeof value !== 'object') {
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
if (value instanceof Date) {
|
|
55
|
+
return new Date(value.getTime());
|
|
56
|
+
}
|
|
57
|
+
if (value instanceof RegExp) {
|
|
58
|
+
return new RegExp(value);
|
|
59
|
+
}
|
|
60
|
+
if (Array.isArray(value)) {
|
|
61
|
+
return value.map(item => this.cloneUnknown(item));
|
|
62
|
+
}
|
|
63
|
+
const clonedObj = {};
|
|
64
|
+
for (const key in value) {
|
|
65
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
66
|
+
clonedObj[key] = this.cloneUnknown(value[key]);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return clonedObj;
|
|
70
|
+
}
|
|
50
71
|
/**
|
|
51
72
|
* Transforms iterable `input` into a single value. Vars $output, $item, $key
|
|
52
73
|
* and $input are available. The final statement in the iterator (the reduction)
|
|
@@ -59,7 +80,7 @@ class Pipe {
|
|
|
59
80
|
* @private
|
|
60
81
|
*/
|
|
61
82
|
reduce(input) {
|
|
62
|
-
let resolved = input[1] ?? null;
|
|
83
|
+
let resolved = this.cloneUnknown(input[1] ?? null);
|
|
63
84
|
if (Array.isArray(input[0])) {
|
|
64
85
|
for (let index = 0; index < input[0].length; index++) {
|
|
65
86
|
this.context = { $input: input[0], $output: resolved, $item: input[0][index], $key: index.toString(), $index: index };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotmeshio/hotmesh",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.59",
|
|
4
4
|
"description": "Unbreakable Workflows",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"start": "ts-node src/index.ts",
|
|
22
22
|
"test": "NODE_ENV=test jest --detectOpenHandles --forceExit --verbose",
|
|
23
23
|
"test:hmsh": "NODE_ENV=test jest ./tests/functional/index.test.ts --detectOpenHandles --verbose",
|
|
24
|
+
"test:unit": "NODE_ENV=test jest ./tests/unit/*/*/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
24
25
|
"test:pipe": "NODE_ENV=test jest ./tests/unit/services/pipe/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
25
26
|
"test:compile": "NODE_ENV=test jest ./tests/functional/compile/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
26
27
|
"test:cycle": "NODE_ENV=test jest ./tests/functional/cycle/index.test.ts --detectOpenHandles --forceExit --verbose",
|