@hotmeshio/hotmesh 0.3.2 → 0.3.3

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
@@ -10,7 +10,7 @@ npm install @hotmeshio/hotmesh
10
10
  You have a Redis instance? Good. You're ready to go.
11
11
 
12
12
  ## Learn
13
- [📄 Docs](https://hotmeshio.github.io/sdk-typescript/) | [💼 Projects](https://github.com/hotmeshio/samples-typescript) | [🎥 Overview (3m)](https://www.loom.com/share/211bd4b4038d42f0ba34374ef5b6f961?sid=7b889a56-f60f-4ccc-84e7-8c2697e548a9) | [🎥 Transactional Workflow (9m)](https://www.loom.com/share/54ffd5266baf4ac6b287578abfd1d821?sid=0db2cef8-ef0d-4e02-a0b7-a1ee14f476ce)
13
+ [📄 Docs](https://hotmeshio.github.io/sdk-typescript/) | [💼 Sample Projects](https://github.com/hotmeshio/samples-typescript) | [🎥 Intro (3m)](https://www.loom.com/share/211bd4b4038d42f0ba34374ef5b6f961?sid=7b889a56-f60f-4ccc-84e7-8c2697e548a9) | [🎥 Transactional Workflow (9m)](https://www.loom.com/share/54ffd5266baf4ac6b287578abfd1d821?sid=0db2cef8-ef0d-4e02-a0b7-a1ee14f476ce)
14
14
 
15
15
  ## MeshCall | Connect Everything
16
16
  [MeshCall](https://hotmeshio.github.io/sdk-typescript/classes/services_meshcall.MeshCall.html) connects your services as a singular mesh, exposing functions as idempotent endpoints. Function responses are cacheable and functions can even run as idempotent cron jobs. Make blazing fast interservice calls that return in milliseconds without the overhead of HTTP.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Unbreakable Workflows",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -43,7 +43,7 @@ class MeshCall {
43
43
  await hotMesh.activate(version);
44
44
  }
45
45
  catch (error) {
46
- hotMesh.engine.logger.error('durable-client-activate-err', { error });
46
+ hotMesh.engine.logger.error('meshcall-client-activate-err', { error });
47
47
  throw error;
48
48
  }
49
49
  }
@@ -53,7 +53,7 @@ class MeshCall {
53
53
  await hotMesh.activate(version);
54
54
  }
55
55
  catch (error) {
56
- hotMesh.engine.logger.error('durable-client-deploy-activate-err', {
56
+ hotMesh.engine.logger.error('meshcall-client-deploy-activate-err', {
57
57
  ...error,
58
58
  });
59
59
  throw error;
@@ -13,7 +13,7 @@ class MeshData {
13
13
  this.instances = new Map();
14
14
  this.mesh = {
15
15
  sub: async (callback, options = {}) => {
16
- const hotMesh = await this.getHotMesh(options.namespace || 'durable');
16
+ const hotMesh = await this.getHotMesh(options.namespace || 'meshflow');
17
17
  const callbackWrapper = (topic, message) => {
18
18
  if (message.type === 'pong' && !message.originator) {
19
19
  if (message.profile?.worker_topic) {
@@ -37,11 +37,11 @@ class MeshData {
37
37
  await hotMesh.quorum?.sub(callbackWrapper);
38
38
  },
39
39
  pub: async (message, options = {}) => {
40
- const hotMesh = await this.getHotMesh(options.namespace || 'durable');
40
+ const hotMesh = await this.getHotMesh(options.namespace || 'meshflow');
41
41
  await hotMesh.quorum?.pub(message);
42
42
  },
43
43
  unsub: async (callback, options = {}) => {
44
- const hotMesh = await this.getHotMesh(options.namespace || 'durable');
44
+ const hotMesh = await this.getHotMesh(options.namespace || 'meshflow');
45
45
  await hotMesh.quorum?.unsub(callback);
46
46
  },
47
47
  };
@@ -132,7 +132,7 @@ class MeshData {
132
132
  }
133
133
  return `${entity}${id}`;
134
134
  }
135
- async getHotMesh(namespace = 'durable') {
135
+ async getHotMesh(namespace = 'meshflow') {
136
136
  let hotMesh = await this.instances.get(namespace);
137
137
  if (!hotMesh) {
138
138
  hotMesh = hotmesh_1.HotMesh.init({
@@ -257,10 +257,10 @@ class MeshData {
257
257
  return await this.getClient().workflow.signal(guid, payload, namespace);
258
258
  }
259
259
  async rollCall(options = {}) {
260
- return (await this.getHotMesh(options.namespace || 'durable')).rollCall(options.delay || 1000);
260
+ return (await this.getHotMesh(options.namespace || 'meshflow')).rollCall(options.delay || 1000);
261
261
  }
262
262
  async throttle(options) {
263
- return (await this.getHotMesh(options.namespace || 'durable')).throttle(options);
263
+ return (await this.getHotMesh(options.namespace || 'meshflow')).throttle(options);
264
264
  }
265
265
  async hook({ entity, id, hookEntity, hookArgs, options = {}, }) {
266
266
  const workflowId = MeshData.mintGuid(entity, id);
@@ -428,7 +428,7 @@ class MeshData {
428
428
  return (await hotMesh.engine?.store?.findJobs(options.match, options.limit, options.batch, options.cursor));
429
429
  }
430
430
  async find(entity, options, ...args) {
431
- return await this.getClient().workflow.search(options.taskQueue ?? entity, options.workflowName ?? entity, options.namespace || 'durable', options.index ?? options.search?.index ?? this.search.index ?? '', ...args);
431
+ return await this.getClient().workflow.search(options.taskQueue ?? entity, options.workflowName ?? entity, options.namespace || 'meshflow', options.index ?? options.search?.index ?? this.search.index ?? '', ...args);
432
432
  }
433
433
  async findWhere(entity, options) {
434
434
  const targetSearch = options.options?.search ?? this.search;
@@ -117,7 +117,7 @@ class ClientService {
117
117
  return await this.search(hotMeshClient, index, query);
118
118
  }
119
119
  catch (error) {
120
- hotMeshClient.engine.logger.error('durable-client-search-err', {
120
+ hotMeshClient.engine.logger.error('meshflow-client-search-err', {
121
121
  ...error,
122
122
  });
123
123
  throw error;
@@ -153,7 +153,7 @@ class ClientService {
153
153
  await hotMesh.activate(version);
154
154
  }
155
155
  catch (error) {
156
- hotMesh.engine.logger.error('durable-client-activate-err', { error });
156
+ hotMesh.engine.logger.error('meshflow-client-activate-err', { error });
157
157
  throw error;
158
158
  }
159
159
  }
@@ -163,7 +163,7 @@ class ClientService {
163
163
  await hotMesh.activate(version);
164
164
  }
165
165
  catch (error) {
166
- hotMesh.engine.logger.error('durable-client-deploy-activate-err', {
166
+ hotMesh.engine.logger.error('meshflow-client-deploy-activate-err', {
167
167
  ...error,
168
168
  });
169
169
  throw error;
@@ -1,4 +1,4 @@
1
1
  declare const APP_VERSION = "4";
2
- declare const APP_ID = "durable";
2
+ declare const APP_ID = "meshflow";
3
3
  declare const getWorkflowYAML: (app: string, version: string) => string;
4
4
  export { getWorkflowYAML, APP_VERSION, APP_ID };
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.APP_ID = exports.APP_VERSION = exports.getWorkflowYAML = void 0;
4
4
  const APP_VERSION = '4';
5
5
  exports.APP_VERSION = APP_VERSION;
6
- const APP_ID = 'durable';
6
+ const APP_ID = 'meshflow';
7
7
  exports.APP_ID = APP_ID;
8
8
  const getWorkflowYAML = (app, version) => {
9
9
  return `app:
@@ -53,7 +53,7 @@ class Search {
53
53
  await store.exec('FT.CREATE', `${search.index}`, 'ON', 'HASH', 'PREFIX', prefixes.length.toString(), ...prefixes, 'SCHEMA', ...schema);
54
54
  }
55
55
  catch (error) {
56
- hotMeshClient.engine.logger.info('durable-client-search-err', {
56
+ hotMeshClient.engine.logger.info('meshflow-client-search-err', {
57
57
  ...error,
58
58
  });
59
59
  }
@@ -66,7 +66,7 @@ class Search {
66
66
  return searchIndexes;
67
67
  }
68
68
  catch (error) {
69
- hotMeshClient.engine.logger.info('durable-client-search-list-err', {
69
+ hotMeshClient.engine.logger.info('meshflow-client-search-list-err', {
70
70
  ...error,
71
71
  });
72
72
  return [];
@@ -104,7 +104,7 @@ class Search {
104
104
  return value;
105
105
  }
106
106
  catch (error) {
107
- this.hotMeshClient.logger.error('durable-search-get-error', { ...error });
107
+ this.hotMeshClient.logger.error('meshflow-search-get-error', { ...error });
108
108
  return '';
109
109
  }
110
110
  }
@@ -134,7 +134,7 @@ class Search {
134
134
  return returnValues;
135
135
  }
136
136
  catch (error) {
137
- this.hotMeshClient.logger.error('durable-search-mget-error', {
137
+ this.hotMeshClient.logger.error('meshflow-search-mget-error', {
138
138
  ...error,
139
139
  });
140
140
  return [];
@@ -21,7 +21,7 @@ class WorkerService {
21
21
  await hotMesh.activate(factory_1.APP_VERSION);
22
22
  }
23
23
  catch (err) {
24
- hotMesh.engine.logger.error('durable-worker-deploy-activate-err', err);
24
+ hotMesh.engine.logger.error('meshflow-worker-deploy-activate-err', err);
25
25
  throw err;
26
26
  }
27
27
  }
@@ -30,7 +30,7 @@ class WorkerService {
30
30
  await hotMesh.activate(factory_1.APP_VERSION);
31
31
  }
32
32
  catch (err) {
33
- hotMesh.engine.logger.error('durable-worker-activate-err', err);
33
+ hotMesh.engine.logger.error('meshflow-worker-activate-err', err);
34
34
  throw err;
35
35
  }
36
36
  }
@@ -81,7 +81,7 @@ class WorkerService {
81
81
  }
82
82
  }
83
83
  async run() {
84
- this.workflowRunner.engine.logger.info('durable-worker-running');
84
+ this.workflowRunner.engine.logger.info('meshflow-worker-running');
85
85
  }
86
86
  async initActivityWorker(config, activityTopic) {
87
87
  const redisConfig = {
@@ -121,7 +121,7 @@ class WorkerService {
121
121
  };
122
122
  }
123
123
  catch (err) {
124
- this.activityRunner.engine.logger.error('durable-worker-activity-err', {
124
+ this.activityRunner.engine.logger.error('meshflow-worker-activity-err', {
125
125
  name: err.name,
126
126
  message: err.message,
127
127
  stack: err.stack,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Unbreakable Workflows",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
package/types/meshdata.ts CHANGED
@@ -36,9 +36,10 @@ export type CallOptions = {
36
36
  */
37
37
  fields?: string[];
38
38
  /**
39
- * namespace for the the execution client; how it appears in Redis (defaults to 'durable')
39
+ * namespace for the the execution client
40
+ * @default 'meshflow'
40
41
  */
41
- namespace?: string; //optional namespace for the workflowId (defaults to 'durable')
42
+ namespace?: string;
42
43
 
43
44
  /**
44
45
  * Custom marker data field used for adding a searchable marker to the job.
@@ -72,9 +73,10 @@ export type ConnectOptions = {
72
73
  */
73
74
  prefix?: string;
74
75
  /**
75
- * optional namespace for the the worker; how it appears in Redis (defaults to 'durable')
76
+ * optional namespace for the the worker
77
+ * @default 'meshflow'
76
78
  */
77
- namespace?: string; //optional namespace for the workflowId (defaults to 'durable')
79
+ namespace?: string;
78
80
  /**
79
81
  * extended worker options
80
82
  */
@@ -175,7 +177,7 @@ export type HookInput = {
175
177
 
176
178
  export type MeshDataWorkflowOptions = {
177
179
  /**
178
- * The app deployment namespace; how it appears in redis (e.g., 'durable')
180
+ * The app deployment namespace; how it appears in redis (e.g., 'meshflow')
179
181
  */
180
182
  namespace?: string;
181
183
 
@@ -225,7 +227,7 @@ export type MeshDataWorkflowOptions = {
225
227
  config?: WorkflowConfig;
226
228
 
227
229
  /**
228
- * Set to 'infinity' to make the function durable; otherwise, '1 minute', '1 hour', etc
230
+ * Set to 'infinity', '1 minute', '1 hour', etc
229
231
  */
230
232
  ttl?: string;
231
233
 
package/types/meshflow.ts CHANGED
@@ -65,7 +65,8 @@ type WorkflowContext = {
65
65
  replay: StringStringType;
66
66
 
67
67
  /**
68
- * the HotMesh App namespace. `durable` is the default.
68
+ * the HotMesh App namespace
69
+ * @default meshflow
69
70
  */
70
71
  namespace: string;
71
72
 
@@ -252,7 +253,8 @@ type SearchResults = {
252
253
 
253
254
  type WorkflowOptions = {
254
255
  /**
255
- * the namespace for the workflow; `durable` is the default namespace if not provided
256
+ * the namespace for the workflow
257
+ * @default meshflow
256
258
  */
257
259
  namespace?: string;
258
260
 
@@ -358,7 +360,8 @@ type WorkflowOptions = {
358
360
 
359
361
  /**
360
362
  * Options for setting up a hook.
361
- * 'durable' is the default namespace if not provided; similar to setting `appid` in the YAML
363
+ * 'meshflow' is the default namespace if not provided;
364
+ * similar to setting `appid` in the YAML
362
365
  */
363
366
  type HookOptions = {
364
367
  /** Optional namespace under which the hook function will be grouped */
@@ -450,8 +453,8 @@ type WorkerConfig = {
450
453
  connection: Connection;
451
454
 
452
455
  /**
453
- * Namespace used in the app configuration, denoted as `appid` in the YAML (e.g., 'durable')
454
- * @default durable
456
+ * Namespace used in the app configuration, denoted as `appid` in the YAML
457
+ * @default meshflow
455
458
  */
456
459
  namespace?: string;
457
460
 
@@ -505,7 +508,10 @@ type FindJobsOptions = {
505
508
  /** The workflow name; include an asterisk for wilcard search; refer to Redis SCAN for the allowed format */
506
509
  match?: string;
507
510
 
508
- /** application namespace; defaults to 'durable' */
511
+ /**
512
+ * application namespace
513
+ * @default meshflow
514
+ */
509
515
  namespace?: string;
510
516
 
511
517
  /** The suggested response limit. Reduce batch size to reduce the likelihood of large overages. */