@hotmeshio/hotmesh 0.3.4 → 0.3.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Unbreakable Workflows",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -53,7 +53,7 @@ class ClientService {
53
53
  };
54
54
  this.workflow = {
55
55
  start: async (options) => {
56
- const taskQueueName = options.entity ?? options.taskQueue;
56
+ const taskQueueName = options.taskQueue ?? options.entity;
57
57
  const workflowName = options.entity ?? options.workflowName;
58
58
  const trc = options.workflowTrace;
59
59
  const spn = options.workflowSpan;
@@ -86,7 +86,7 @@ class ClientService {
86
86
  return await (await this.getHotMeshClient(topic, namespace)).hook(topic, { id: signalId, data });
87
87
  },
88
88
  hook: async (options) => {
89
- const workflowTopic = `${options.taskQueue}-${options.workflowName}`;
89
+ const workflowTopic = `${options.taskQueue ?? options.entity}-${options.entity ?? options.workflowName}`;
90
90
  const payload = {
91
91
  arguments: [...options.args],
92
92
  id: options.workflowId,
@@ -116,7 +116,7 @@ class WorkflowService {
116
116
  }
117
117
  return result.$error;
118
118
  }
119
- else if (result.data) {
119
+ else {
120
120
  return result.data;
121
121
  }
122
122
  }
@@ -283,7 +283,7 @@ class WorkflowService {
283
283
  const targetWorkflowId = options.workflowId ?? workflowId;
284
284
  let targetTopic;
285
285
  if (options.entity || (options.taskQueue && options.workflowName)) {
286
- targetTopic = `${options.entity ?? options.taskQueue}-${options.entity ?? options.workflowName}`;
286
+ targetTopic = `${options.taskQueue ?? options.entity}-${options.entity ?? options.workflowName}`;
287
287
  }
288
288
  else {
289
289
  targetTopic = workflowTopic;
@@ -291,8 +291,10 @@ class WorkflowService {
291
291
  const payload = {
292
292
  arguments: [...options.args],
293
293
  id: targetWorkflowId,
294
- workflowTopic,
294
+ workflowTopic: targetTopic,
295
295
  backoffCoefficient: options.config?.backoffCoefficient || enums_1.HMSH_MESHFLOW_EXP_BACKOFF,
296
+ maximumAttempts: options.config?.maximumAttempts || enums_1.HMSH_MESHFLOW_MAX_ATTEMPTS,
297
+ maximumInterval: (0, utils_1.s)(options?.config?.maximumInterval ?? enums_1.HMSH_MESHFLOW_MAX_INTERVAL),
296
298
  };
297
299
  return await hotMeshClient.hook(`${namespace}.flow.signal`, payload, stream_1.StreamStatus.PENDING, 202);
298
300
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Unbreakable Workflows",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",