@hotmeshio/hotmesh 0.0.60 → 0.1.1

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 (108) hide show
  1. package/README.md +1 -1
  2. package/build/modules/enums.d.ts +2 -1
  3. package/build/modules/enums.js +12 -3
  4. package/build/modules/errors.d.ts +3 -3
  5. package/build/modules/errors.js +8 -8
  6. package/build/modules/key.d.ts +1 -1
  7. package/build/modules/key.js +3 -3
  8. package/build/modules/utils.d.ts +6 -5
  9. package/build/modules/utils.js +24 -16
  10. package/build/package.json +41 -38
  11. package/build/services/activities/activity.js +40 -23
  12. package/build/services/activities/await.d.ts +1 -1
  13. package/build/services/activities/await.js +15 -7
  14. package/build/services/activities/cycle.d.ts +1 -1
  15. package/build/services/activities/cycle.js +16 -8
  16. package/build/services/activities/hook.d.ts +1 -1
  17. package/build/services/activities/hook.js +8 -4
  18. package/build/services/activities/interrupt.d.ts +1 -1
  19. package/build/services/activities/interrupt.js +14 -6
  20. package/build/services/activities/signal.d.ts +1 -1
  21. package/build/services/activities/signal.js +12 -4
  22. package/build/services/activities/trigger.d.ts +1 -1
  23. package/build/services/activities/trigger.js +19 -12
  24. package/build/services/activities/worker.d.ts +1 -1
  25. package/build/services/activities/worker.js +15 -7
  26. package/build/services/collator/index.js +12 -12
  27. package/build/services/compiler/deployer.js +17 -12
  28. package/build/services/compiler/index.js +4 -4
  29. package/build/services/compiler/validator.d.ts +3 -3
  30. package/build/services/compiler/validator.js +12 -3
  31. package/build/services/durable/client.d.ts +1 -1
  32. package/build/services/durable/client.js +18 -12
  33. package/build/services/durable/connection.d.ts +1 -1
  34. package/build/services/durable/exporter.d.ts +1 -1
  35. package/build/services/durable/exporter.js +3 -4
  36. package/build/services/durable/handle.d.ts +1 -1
  37. package/build/services/durable/handle.js +4 -1
  38. package/build/services/durable/index.d.ts +1 -1
  39. package/build/services/durable/index.js +2 -2
  40. package/build/services/durable/schemas/factory.d.ts +1 -1
  41. package/build/services/durable/search.js +19 -11
  42. package/build/services/durable/worker.js +50 -30
  43. package/build/services/durable/workflow.d.ts +5 -5
  44. package/build/services/durable/workflow.js +34 -18
  45. package/build/services/engine/index.js +33 -26
  46. package/build/services/exporter/index.d.ts +1 -1
  47. package/build/services/exporter/index.js +3 -3
  48. package/build/services/hotmesh/index.js +1 -1
  49. package/build/services/logger/index.js +1 -1
  50. package/build/services/mapper/index.js +3 -1
  51. package/build/services/pipe/functions/date.js +1 -1
  52. package/build/services/pipe/index.js +37 -10
  53. package/build/services/quorum/index.js +14 -11
  54. package/build/services/reporter/index.js +15 -12
  55. package/build/services/router/index.d.ts +2 -2
  56. package/build/services/router/index.js +73 -23
  57. package/build/services/serializer/index.js +48 -26
  58. package/build/services/store/cache.d.ts +5 -5
  59. package/build/services/store/cache.js +2 -2
  60. package/build/services/store/clients/ioredis.d.ts +6 -0
  61. package/build/services/store/clients/ioredis.js +85 -3
  62. package/build/services/store/clients/redis.d.ts +6 -0
  63. package/build/services/store/clients/redis.js +140 -4
  64. package/build/services/store/index.d.ts +9 -3
  65. package/build/services/store/index.js +121 -60
  66. package/build/services/stream/clients/ioredis.js +4 -4
  67. package/build/services/stream/clients/redis.js +31 -4
  68. package/build/services/task/index.js +8 -11
  69. package/build/services/telemetry/index.js +21 -14
  70. package/build/services/worker/index.d.ts +6 -6
  71. package/build/services/worker/index.js +12 -7
  72. package/build/types/activity.d.ts +3 -3
  73. package/build/types/durable.d.ts +81 -77
  74. package/build/types/exporter.d.ts +2 -2
  75. package/build/types/exporter.js +0 -6
  76. package/build/types/hook.d.ts +1 -1
  77. package/build/types/hotmesh.js +0 -1
  78. package/build/types/index.d.ts +13 -13
  79. package/build/types/job.d.ts +1 -1
  80. package/build/types/logger.js +0 -1
  81. package/build/types/quorum.d.ts +1 -1
  82. package/build/types/redis.d.ts +6 -1
  83. package/build/types/stats.d.ts +1 -1
  84. package/build/types/stream.d.ts +1 -2
  85. package/build/types/telemetry.d.ts +1 -1
  86. package/build/types/transition.d.ts +1 -1
  87. package/package.json +41 -38
  88. package/types/activity.ts +56 -39
  89. package/types/async.ts +2 -3
  90. package/types/collator.ts +5 -5
  91. package/types/durable.ts +90 -86
  92. package/types/error.ts +37 -37
  93. package/types/exporter.ts +14 -9
  94. package/types/hook.ts +11 -4
  95. package/types/hotmesh.ts +26 -25
  96. package/types/index.ts +54 -53
  97. package/types/job.ts +33 -33
  98. package/types/logger.ts +1 -1
  99. package/types/map.ts +1 -1
  100. package/types/pipe.ts +10 -8
  101. package/types/quorum.ts +20 -13
  102. package/types/redis.ts +96 -16
  103. package/types/serializer.ts +8 -6
  104. package/types/stats.ts +22 -6
  105. package/types/stream.ts +9 -9
  106. package/types/task.ts +7 -1
  107. package/types/telemetry.ts +2 -1
  108. package/types/transition.ts +8 -8
@@ -38,7 +38,10 @@ class WorkerService {
38
38
  await service.subscribe.subscribe(key_1.KeyType.QUORUM, service.subscriptionHandler(), appId, service.guid);
39
39
  await service.initStreamChannel(service, worker.stream);
40
40
  service.router = service.initRouter(worker, logger);
41
- const key = service.stream.mintKey(key_1.KeyType.STREAMS, { appId: service.appId, topic: worker.topic });
41
+ const key = service.stream.mintKey(key_1.KeyType.STREAMS, {
42
+ appId: service.appId,
43
+ topic: worker.topic,
44
+ });
42
45
  await service.router.consumeMessages(key, 'WORKER', service.guid, worker.callback);
43
46
  service.inited = (0, utils_1.formatISODate)(new Date());
44
47
  services.push(service);
@@ -47,9 +50,9 @@ class WorkerService {
47
50
  return services;
48
51
  }
49
52
  verifyWorkerFields(worker) {
50
- if ((!(0, utils_1.identifyRedisType)(worker.store) ||
53
+ if (!(0, utils_1.identifyRedisType)(worker.store) ||
51
54
  !(0, utils_1.identifyRedisType)(worker.stream) ||
52
- !(0, utils_1.identifyRedisType)(worker.sub)) ||
55
+ !(0, utils_1.identifyRedisType)(worker.sub) ||
53
56
  !(worker.topic && worker.callback)) {
54
57
  throw new Error('worker must include `store`, `stream`, and `sub` fields along with a callback function and topic.');
55
58
  }
@@ -97,7 +100,8 @@ class WorkerService {
97
100
  return async (topic, message) => {
98
101
  self.logger.debug('worker-event-received', { topic, type: message.type });
99
102
  if (message.type === 'throttle') {
100
- if (message.topic !== null) { //undefined allows passthrough
103
+ if (message.topic !== null) {
104
+ //undefined allows passthrough
101
105
  self.throttle(message.throttle);
102
106
  }
103
107
  }
@@ -105,7 +109,8 @@ class WorkerService {
105
109
  self.sayPong(self.appId, self.guid, message.originator, message.details);
106
110
  }
107
111
  else if (message.type === 'rollcall') {
108
- if (message.topic !== null) { //undefined allows passthrough
112
+ if (message.topic !== null) {
113
+ //undefined allows passthrough
109
114
  self.doRollCall(message);
110
115
  }
111
116
  }
@@ -117,10 +122,10 @@ class WorkerService {
117
122
  */
118
123
  async doRollCall(message) {
119
124
  let iteration = 0;
120
- let max = !isNaN(message.max) ? message.max : enums_1.HMSH_QUORUM_ROLLCALL_CYCLES;
125
+ const max = !isNaN(message.max) ? message.max : enums_1.HMSH_QUORUM_ROLLCALL_CYCLES;
121
126
  if (this.rollCallInterval)
122
127
  clearTimeout(this.rollCallInterval);
123
- const base = (message.interval / 2);
128
+ const base = message.interval / 2;
124
129
  const amount = base + Math.ceil(Math.random() * base);
125
130
  do {
126
131
  await (0, utils_1.sleepFor)(Math.ceil(Math.random() * 1000));
@@ -1,5 +1,5 @@
1
- import { MetricTypes } from "./stats";
2
- import { StreamRetryPolicy } from "./stream";
1
+ import { MetricTypes } from './stats';
2
+ import { StreamRetryPolicy } from './stream';
3
3
  type ActivityExecutionType = 'trigger' | 'await' | 'worker' | 'activity' | 'emit' | 'interrupt' | 'cycle' | 'signal' | 'hook';
4
4
  type Consumes = Record<string, string[]>;
5
5
  interface BaseActivity {
@@ -194,4 +194,4 @@ type ActivityDataType = {
194
194
  hook?: Record<string, unknown>;
195
195
  };
196
196
  type ActivityLeg = 1 | 2;
197
- export { ActivityContext, ActivityData, ActivityDataType, ActivityDuplex, ActivityLeg, ActivityMetadata, ActivityType, Consumes, TriggerActivityStats, AwaitActivity, CycleActivity, HookActivity, SignalActivity, BaseActivity, InterruptActivity, TriggerActivity, WorkerActivity };
197
+ export { ActivityContext, ActivityData, ActivityDataType, ActivityDuplex, ActivityLeg, ActivityMetadata, ActivityType, Consumes, TriggerActivityStats, AwaitActivity, CycleActivity, HookActivity, SignalActivity, BaseActivity, InterruptActivity, TriggerActivity, WorkerActivity, };
@@ -89,6 +89,86 @@ type WorkflowContext = {
89
89
  */
90
90
  raw: StreamData;
91
91
  };
92
+ /**
93
+ * The schema for the full-text-search (RediSearch) index.
94
+ */
95
+ export type WorkflowSearchSchema = Record<string, {
96
+ /**
97
+ * The FT.SEARCH field type. One of: TEXT, NUMERIC, TAG. TEXT is
98
+ * most expensive, but also most expressive.
99
+ */
100
+ type: 'TEXT' | 'NUMERIC' | 'TAG';
101
+ /**
102
+ * FT.SEARCH SORTABLE field. If true, results may be sorted according to this field
103
+ * @default false
104
+ */
105
+ sortable?: boolean;
106
+ /**
107
+ * FT.SEARCH NOSTEM field. applies to TEXT fields types.
108
+ * If true, the text field index will not stem words
109
+ * @default false
110
+ */
111
+ nostem?: boolean;
112
+ /**
113
+ * FT.SEARCH NOINDEX field. If true and if the field is sortable, the field will aid
114
+ * in sorting results but not be directly indexed as a standalone
115
+ * @default false
116
+ */
117
+ noindex?: boolean;
118
+ /**
119
+ * if true, the field is indexed and searchable within the FT.SEARCH index
120
+ * This is different from `noindex` which is FT.SEARCH specific and relates
121
+ * to sorting and indexing. This is a general flag for the field that will
122
+ * enable or disable indexing and searching entirely. Use for fields with
123
+ * absolutely no meaning to query or sorting but which are important
124
+ * nonetheless as part of the data record that is saved and returned.
125
+ * @default true
126
+ */
127
+ indexed?: boolean;
128
+ /**
129
+ * An array of possible values for the field
130
+ */
131
+ examples?: string[];
132
+ /**
133
+ * The 'nilable' setting may NOT be set to `true` for
134
+ * NUMBER types as it causes an indexing error;
135
+ * consider a custom (e.g., negative number) value to represent
136
+ * `null` if desired for a NUMERIC field.
137
+ * Set to true only if the field is a TEXT or TAG type and
138
+ * you wish to save the string `null` as a value to search
139
+ * on (the tag, {null}, or the string, (null)
140
+ * @default false
141
+ */
142
+ nilable?: boolean;
143
+ /**
144
+ * possible scalar/primitive types for the field. Use when
145
+ * serializing and restoring data to ensure the field is
146
+ * properly typed. If not provided, the field will be
147
+ * treated as a string.
148
+ */
149
+ primitive?: 'string' | 'number' | 'boolean' | 'array' | 'object';
150
+ /**
151
+ * if true, the field is required to be present in the data record
152
+ * @default false
153
+ */
154
+ required?: boolean;
155
+ /**
156
+ * an enumerated list of allowed values; if field is nilable, it is implied
157
+ * and therefore not necessary to include `null` in the list
158
+ * @default []
159
+ */
160
+ enum?: string[];
161
+ /**
162
+ * a regular expression pattern for the field
163
+ * @default '.*'
164
+ * @example '^[a-zA-Z0-9_]*$'
165
+ */
166
+ pattern?: string;
167
+ /**
168
+ * literal value to use for the indexed field name (without including the standard underscore (_) prefix isolate)
169
+ */
170
+ fieldName?: string;
171
+ }>;
92
172
  type WorkflowSearchOptions = {
93
173
  /** FT index name (myapp:myindex) */
94
174
  index?: string;
@@ -101,83 +181,7 @@ type WorkflowSearchOptions = {
101
181
  * key will be used as the indexed field name with an underscore prefix.
102
182
  *
103
183
  */
104
- schema?: Record<string, {
105
- /**
106
- * The FT.SEARCH field type. One of: TEXT, NUMERIC, TAG. TEXT is
107
- * most expensive, but also most expressive.
108
- */
109
- type: 'TEXT' | 'NUMERIC' | 'TAG';
110
- /**
111
- * FT.SEARCH SORTABLE field. If true, results may be sorted according to this field
112
- * @default false
113
- */
114
- sortable?: boolean;
115
- /**
116
- * FT.SEARCH NOSTEM field. applies to TEXT fields types.
117
- * If true, the text field index will not stem words
118
- * @default false
119
- */
120
- nostem?: boolean;
121
- /**
122
- * FT.SEARCH NOINDEX field. If true and if the field is sortable, the field will aid
123
- * in sorting results but not be directly indexed as a standalone
124
- * @default false
125
- */
126
- noindex?: boolean;
127
- /**
128
- * if true, the field is indexed and searchable within the FT.SEARCH index
129
- * This is different from `noindex` which is FT.SEARCH specific and relates
130
- * to sorting and indexing. This is a general flag for the field that will
131
- * enable or disable indexing and searching entirely. Use for fields with
132
- * absolutely no meaning to query or sorting but which are important
133
- * nonetheless as part of the data record that is saved and returned.
134
- * @default true
135
- */
136
- indexed?: boolean;
137
- /**
138
- * An array of possible values for the field
139
- */
140
- examples?: string[];
141
- /**
142
- * The 'nilable' setting may NOT be set to `true` for
143
- * NUMBER types as it causes an indexing error;
144
- * consider a custom (e.g., negative number) value to represent
145
- * `null` if desired for a NUMERIC field.
146
- * Set to true only if the field is a TEXT or TAG type and
147
- * you wish to save the string `null` as a value to search
148
- * on (the tag, {null}, or the string, (null)
149
- * @default false
150
- */
151
- nilable?: boolean;
152
- /**
153
- * possible scalar/primitive types for the field. Use when
154
- * serializing and restoring data to ensure the field is
155
- * properly typed. If not provided, the field will be
156
- * treated as a string.
157
- */
158
- primitive?: 'string' | 'number' | 'boolean' | 'array' | 'object';
159
- /**
160
- * if true, the field is required to be present in the data record
161
- * @default false
162
- */
163
- required?: boolean;
164
- /**
165
- * an enumerated list of allowed values; if field is nilable, it is implied
166
- * and therefore not necessary to include `null` in the list
167
- * @default []
168
- */
169
- enum?: string[];
170
- /**
171
- * a regular expression pattern for the field
172
- * @default '.*'
173
- * @example '^[a-zA-Z0-9_]*$'
174
- */
175
- pattern?: string;
176
- /**
177
- * literal value to use for the indexed field name (without including the standard underscore (_) prefix isolate)
178
- */
179
- fieldName?: string;
180
- }>;
184
+ schema?: WorkflowSearchSchema;
181
185
  /** Additional data as a key-value record */
182
186
  data?: StringStringType;
183
187
  };
@@ -1,5 +1,5 @@
1
- import { StringAnyType } from "./serializer";
2
- export type ExportItem = [(string | null), string, any];
1
+ import { StringAnyType } from './serializer';
2
+ export type ExportItem = [string | null, string, any];
3
3
  /**
4
4
  * job export data can be large, particularly transitions the timeline
5
5
  */
@@ -1,8 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- ;
4
- ;
5
- ;
6
- ;
7
- ;
8
- ;
@@ -28,4 +28,4 @@ interface HookInterface {
28
28
  id: string;
29
29
  }): Promise<void>;
30
30
  }
31
- export { HookCondition, HookConditions, HookGate, HookInterface, HookRule, HookRules, HookSignal };
31
+ export { HookCondition, HookConditions, HookGate, HookInterface, HookRule, HookRules, HookSignal, };
@@ -27,4 +27,3 @@ var KeyType;
27
27
  KeyType["WORK_ITEMS"] = "WORK_ITEMS";
28
28
  })(KeyType || (KeyType = {}));
29
29
  exports.KeyType = KeyType;
30
- ;
@@ -1,22 +1,22 @@
1
- export { ActivityType, ActivityDataType, ActivityContext, ActivityData, ActivityDuplex, ActivityLeg, ActivityMetadata, Consumes, AwaitActivity, BaseActivity, CycleActivity, HookActivity, WorkerActivity, InterruptActivity, SignalActivity, TriggerActivity, TriggerActivityStats } from './activity';
1
+ export { ActivityType, ActivityDataType, ActivityContext, ActivityData, ActivityDuplex, ActivityLeg, ActivityMetadata, Consumes, AwaitActivity, BaseActivity, CycleActivity, HookActivity, WorkerActivity, InterruptActivity, SignalActivity, TriggerActivity, TriggerActivityStats, } from './activity';
2
2
  export { App, AppVID, AppTransitions, AppSubscriptions } from './app';
3
3
  export { AsyncSignal } from './async';
4
4
  export { CacheMode } from './cache';
5
5
  export { CollationFaultType, CollationStage } from './collator';
6
- export { ActivityConfig, ActivityWorkflowDataType, ChildResponseType, ClientConfig, ContextType, ConnectionConfig, Connection, ProxyResponseType, ProxyType, Registry, SignalOptions, FindJobsOptions, FindOptions, FindWhereOptions, FindWhereQuery, HookOptions, SearchResults, WorkflowConfig, WorkerConfig, WorkerOptions, WorkflowContext, WorkflowSearchOptions, WorkflowDataType, WorkflowOptions, } from './durable';
7
- export { DurableChildErrorType, DurableProxyErrorType, DurableSleepErrorType, DurableWaitForAllErrorType, DurableWaitForErrorType } from "./error";
8
- export { ActivityAction, DependencyExport, DurableJobExport, ExportCycles, ExportItem, ExportOptions, ExportTransitions, JobAction, JobExport, JobActionExport, JobTimeline } from './exporter';
9
- export { HookCondition, HookConditions, HookGate, HookInterface, HookRule, HookRules, HookSignal } from './hook';
6
+ export { ActivityConfig, ActivityWorkflowDataType, ChildResponseType, ClientConfig, ContextType, ConnectionConfig, Connection, ProxyResponseType, ProxyType, Registry, SignalOptions, FindJobsOptions, FindOptions, FindWhereOptions, FindWhereQuery, HookOptions, SearchResults, WorkflowConfig, WorkerConfig, WorkerOptions, WorkflowContext, WorkflowSearchOptions, WorkflowSearchSchema, WorkflowDataType, WorkflowOptions, } from './durable';
7
+ export { DurableChildErrorType, DurableProxyErrorType, DurableSleepErrorType, DurableWaitForAllErrorType, DurableWaitForErrorType, } from './error';
8
+ export { ActivityAction, DependencyExport, DurableJobExport, ExportCycles, ExportItem, ExportOptions, ExportTransitions, JobAction, JobExport, JobActionExport, JobTimeline, } from './exporter';
9
+ export { HookCondition, HookConditions, HookGate, HookInterface, HookRule, HookRules, HookSignal, } from './hook';
10
10
  export { ILogger } from './logger';
11
- export { ExtensionType, JobCompletionOptions, JobData, JobsData, JobInterruptOptions, JobMetadata, JobOutput, JobState, JobStatus, PartialJobState } from './job';
11
+ export { ExtensionType, JobCompletionOptions, JobData, JobsData, JobInterruptOptions, JobMetadata, JobOutput, JobState, JobStatus, PartialJobState, } from './job';
12
12
  export { MappingStatements } from './map';
13
- export { Pipe, PipeContext, PipeItem, PipeItems, PipeObject, ReduceObject } from './pipe';
14
- export { HotMesh, HotMeshApp, HotMeshApps, HotMeshConfig, HotMeshEngine, RedisConfig, HotMeshGraph, HotMeshManifest, HotMeshSettings, HotMeshWorker, KeyStoreParams, KeyType } from './hotmesh';
15
- export { ActivateMessage, CronMessage, JobMessage, JobMessageCallback, PingMessage, PongMessage, QuorumMessage, QuorumMessageCallback, QuorumProfile, RollCallMessage, RollCallOptions, SubscriptionCallback, SubscriptionOptions, SystemHealth, ThrottleMessage, ThrottleOptions, WorkMessage } from './quorum';
13
+ export { Pipe, PipeContext, PipeItem, PipeItems, PipeObject, ReduceObject, } from './pipe';
14
+ export { HotMesh, HotMeshApp, HotMeshApps, HotMeshConfig, HotMeshEngine, RedisConfig, HotMeshGraph, HotMeshManifest, HotMeshSettings, HotMeshWorker, KeyStoreParams, KeyType, } from './hotmesh';
15
+ export { ActivateMessage, CronMessage, JobMessage, JobMessageCallback, PingMessage, PongMessage, QuorumMessage, QuorumMessageCallback, QuorumProfile, RollCallMessage, RollCallOptions, SubscriptionCallback, SubscriptionOptions, SystemHealth, ThrottleMessage, ThrottleOptions, WorkMessage, } from './quorum';
16
16
  export { RedisClass, RedisRedisClientType, RedisRedisClientOptions, RedisRedisClassType, IORedisClientType, RedisClient, RedisMulti, RedisRedisMultiType, IORedisClientOptions, IORedisClassType, IORedisMultiType, RedisOptions, MultiResponseFlags, isRedisClient, isIORedisClient, } from './redis';
17
- export { JSONSchema, StringAnyType, StringScalarType, StringStringType, SymbolMap, SymbolMaps, SymbolRanges, Symbols, SymbolSets } from './serializer';
18
- export { AggregatedData, CountByFacet, GetStatsOptions, IdsData, Measure, MeasureIds, MetricTypes, StatType, StatsType, IdsResponse, JobStats, JobStatsInput, JobStatsRange, StatsResponse, Segment, TimeSegment } from './stats';
19
- export { ReclaimedMessageType, StreamCode, StreamConfig, StreamData, StreamDataType, StreamError, StreamDataResponse, StreamRetryPolicy, StreamRole, StreamStatus } from './stream';
20
- export { context, Context, Counter, Meter, metrics, propagation, SpanContext, Span, SpanStatus, SpanStatusCode, SpanKind, trace, Tracer, ValueType } from './telemetry';
17
+ export { JSONSchema, StringAnyType, StringScalarType, StringStringType, SymbolMap, SymbolMaps, SymbolRanges, Symbols, SymbolSets, } from './serializer';
18
+ export { AggregatedData, CountByFacet, GetStatsOptions, IdsData, Measure, MeasureIds, MetricTypes, StatType, StatsType, IdsResponse, JobStats, JobStatsInput, JobStatsRange, StatsResponse, Segment, TimeSegment, } from './stats';
19
+ export { ReclaimedMessageType, StreamCode, StreamConfig, StreamData, StreamDataType, StreamError, StreamDataResponse, StreamRetryPolicy, StreamRole, StreamStatus, } from './stream';
20
+ export { context, Context, Counter, Meter, metrics, propagation, SpanContext, Span, SpanStatus, SpanStatusCode, SpanKind, trace, Tracer, ValueType, } from './telemetry';
21
21
  export { WorkListTaskType } from './task';
22
22
  export { TransitionMatch, TransitionRule, Transitions } from './transition';
@@ -1,4 +1,4 @@
1
- import { StringStringType } from "./serializer";
1
+ import { StringStringType } from './serializer';
2
2
  type JobData = Record<string, unknown | Record<string, unknown>>;
3
3
  type JobsData = Record<string, unknown>;
4
4
  type ActivityData = {
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- ;
@@ -1,4 +1,4 @@
1
- import { JobOutput } from "./job";
1
+ import { JobOutput } from './job';
2
2
  interface CPULoad {
3
3
  [cpu: string]: string;
4
4
  }
@@ -72,12 +72,17 @@ interface RedisRedisMultiType {
72
72
  HGET(key: string, itemId: string): this;
73
73
  HGETALL(key: string): this;
74
74
  HINCRBYFLOAT(key: string, itemId: string, value: number): this;
75
- HMGET(key: string, itemIds: string[]): Promise<string[]>;
75
+ HMPUSH(key: string, values: Record<string, string>): this;
76
+ RPUSH(key: string, items: string[]): this;
77
+ HMGET(key: string, itemIds: string[]): this;
76
78
  HSET(key: string, values: Record<string, string>): this;
77
79
  LPUSH(key: string, items: string[]): this;
78
80
  LRANGE(key: string, start: number, end: number): this;
79
81
  RPUSH(key: string, items: string[]): this;
80
82
  SET(key: string, value: string): this;
83
+ XCLAIM(key: string, group: string, consumer: string, minIdleTime: number, id: string, ...args: string[]): this;
84
+ XGROUP(command: 'CREATE' | string, key: string, groupName: string, id: string, mkStream?: 'MKSTREAM'): this;
85
+ XPENDING(key: string, group: string, start?: string, end?: string, count?: number, consumer?: string): this;
81
86
  ZADD(key: string, values: {
82
87
  score: string;
83
88
  value: string;
@@ -81,4 +81,4 @@ interface IdsResponse {
81
81
  counts: CountByFacet[];
82
82
  segments: TimeSegment[];
83
83
  }
84
- export { StatsType, StatType, MetricTypes, JobStats, JobStatsRange, JobStatsInput, GetStatsOptions, StatsResponse, AggregatedData, Measure, Segment, IdsData, MeasureIds, TimeSegment, IdsResponse, CountByFacet };
84
+ export { StatsType, StatType, MetricTypes, JobStats, JobStatsRange, JobStatsInput, GetStatsOptions, StatsResponse, AggregatedData, Measure, Segment, IdsData, MeasureIds, TimeSegment, IdsResponse, CountByFacet, };
@@ -91,8 +91,7 @@ export interface StreamData {
91
91
  stack?: string;
92
92
  }
93
93
  /** Extends StreamData for responses, allowing for inheritance of the base properties */
94
- export interface StreamDataResponse extends StreamData {
95
- }
94
+ export type StreamDataResponse = StreamData;
96
95
  export declare enum StreamRole {
97
96
  WORKER = "worker",
98
97
  ENGINE = "engine",
@@ -1 +1 @@
1
- export { context, Context, Counter, Meter, metrics, propagation, SpanContext, Span, SpanStatus, SpanStatusCode, SpanKind, trace, Tracer, ValueType } from '@opentelemetry/api';
1
+ export { context, Context, Counter, Meter, metrics, propagation, SpanContext, Span, SpanStatus, SpanStatusCode, SpanKind, trace, Tracer, ValueType, } from '@opentelemetry/api';
@@ -1,4 +1,4 @@
1
- import { Pipe } from "./pipe";
1
+ import { Pipe } from './pipe';
2
2
  export type TransitionMatch = {
3
3
  expected: boolean | string | number | null;
4
4
  actual: boolean | string | number | null | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.0.60",
3
+ "version": "0.1.1",
4
4
  "description": "Unbreakable Workflows",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -13,63 +13,63 @@
13
13
  "access": "public"
14
14
  },
15
15
  "scripts": {
16
- "clean": "rimraf ./build",
17
16
  "build": "tsc --build tsconfig.json",
17
+ "clean": "rimraf ./build",
18
18
  "clean-build": "npm run clean && npm run build",
19
19
  "lint": "eslint . --ext .ts",
20
20
  "lint:fix": "eslint . --fix --ext .ts",
21
21
  "start": "ts-node src/index.ts",
22
22
  "test": "NODE_ENV=test jest --detectOpenHandles --forceExit --verbose",
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",
25
- "test:pipe": "NODE_ENV=test jest ./tests/unit/services/pipe/index.test.ts --detectOpenHandles --forceExit --verbose",
23
+ "test:await": "NODE_ENV=test jest ./tests/functional/awaiter/index.test.ts --detectOpenHandles --forceExit --verbose",
26
24
  "test:compile": "NODE_ENV=test jest ./tests/functional/compile/index.test.ts --detectOpenHandles --forceExit --verbose",
27
- "test:cycle": "NODE_ENV=test jest ./tests/functional/cycle/index.test.ts --detectOpenHandles --forceExit --verbose",
28
- "test:trigger": "NODE_ENV=test jest ./tests/unit/services/activities/trigger.test.ts --detectOpenHandles --forceExit --verbose",
29
25
  "test:connect": "NODE_ENV=test jest ./tests/unit/services/connector/index.test.ts --detectOpenHandles --forceExit --verbose",
30
- "test:connect:redis": "NODE_ENV=test jest ./tests/unit/services/connector/clients/redis.test.ts --detectOpenHandles --forceExit --verbose",
31
26
  "test:connect:ioredis": "NODE_ENV=test jest ./tests/unit/services/connector/clients/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
32
- "test:functional": "NODE_ENV=test jest ./tests/functional/*/index.test.ts --detectOpenHandles --forceExit --verbose",
27
+ "test:connect:redis": "NODE_ENV=test jest ./tests/unit/services/connector/clients/redis.test.ts --detectOpenHandles --forceExit --verbose",
28
+ "test:cycle": "NODE_ENV=test jest ./tests/functional/cycle/index.test.ts --detectOpenHandles --forceExit --verbose",
29
+ "test:durable": "NODE_ENV=test jest ./tests/durable/*/index.test.ts --detectOpenHandles --forceExit --verbose",
30
+ "test:durable:basic": "NODE_ENV=test jest ./tests/durable/basic/index.test.ts --detectOpenHandles --forceExit --verbose",
31
+ "test:durable:collision": "NODE_ENV=test jest ./tests/durable/collision/index.test.ts --detectOpenHandles --forceExit --verbose",
32
+ "test:durable:fatal": "NODE_ENV=test jest ./tests/durable/fatal/index.test.ts --detectOpenHandles --forceExit --verbose",
33
+ "test:durable:goodbye": "NODE_ENV=test jest ./tests/durable/goodbye/index.test.ts --detectOpenHandles --forceExit --verbose",
34
+ "test:durable:hello": "NODE_ENV=test jest ./tests/durable/helloworld/index.test.ts --detectOpenHandles --forceExit --verbose",
35
+ "test:durable:hook": "NODE_ENV=test jest ./tests/durable/hook/index.test.ts --detectOpenHandles --forceExit --verbose",
36
+ "test:durable:interrupt": "NODE_ENV=test jest ./tests/durable/interrupt/index.test.ts --detectOpenHandles --forceExit --verbose",
37
+ "test:durable:loopactivity": "NODE_ENV=test jest ./tests/durable/loopactivity/index.test.ts --detectOpenHandles --forceExit --verbose",
38
+ "test:durable:nested": "NODE_ENV=test jest ./tests/durable/nested/index.test.ts --detectOpenHandles --forceExit --verbose",
39
+ "test:durable:retry": "NODE_ENV=test jest ./tests/durable/retry/index.test.ts --detectOpenHandles --forceExit --verbose",
40
+ "test:durable:sleep": "NODE_ENV=test jest ./tests/durable/sleep/index.test.ts --detectOpenHandles --forceExit --verbose",
41
+ "test:durable:signal": "NODE_ENV=test jest ./tests/durable/signal/index.test.ts --detectOpenHandles --forceExit --verbose",
42
+ "test:durable:unknown": "NODE_ENV=test jest ./tests/durable/unknown/index.test.ts --detectOpenHandles --forceExit --verbose",
33
43
  "test:emit": "NODE_ENV=test jest ./tests/functional/emit/index.test.ts --detectOpenHandles --forceExit --verbose",
34
- "test:reentrant": "NODE_ENV=test jest ./tests/functional/reentrant/index.test.ts --detectOpenHandles --forceExit --verbose",
35
- "test:await": "NODE_ENV=test jest ./tests/functional/awaiter/index.test.ts --detectOpenHandles --forceExit --verbose",
44
+ "test:functional": "NODE_ENV=test jest ./tests/functional/*/index.test.ts --detectOpenHandles --forceExit --verbose",
45
+ "test:hmsh": "NODE_ENV=test jest ./tests/functional/index.test.ts --detectOpenHandles --verbose",
36
46
  "test:hook": "NODE_ENV=test jest ./tests/functional/hook/index.test.ts --detectOpenHandles --forceExit --verbose",
37
- "test:signal": "NODE_ENV=test jest ./tests/functional/signal/index.test.ts --detectOpenHandles --forceExit --verbose",
38
47
  "test:interrupt": "NODE_ENV=test jest ./tests/functional/interrupt/index.test.ts --detectOpenHandles --forceExit --verbose",
39
48
  "test:parallel": "NODE_ENV=test jest ./tests/functional/parallel/index.test.ts --detectOpenHandles --forceExit --verbose",
40
- "test:sequence": "NODE_ENV=test jest ./tests/functional/sequence/index.test.ts --detectOpenHandles --forceExit --verbose",
49
+ "test:pipe": "NODE_ENV=test jest ./tests/unit/services/pipe/index.test.ts --detectOpenHandles --forceExit --verbose",
41
50
  "test:quorum": "NODE_ENV=test jest ./tests/functional/quorum/index.test.ts --detectOpenHandles --forceExit --verbose",
42
51
  "test:reclaim": "NODE_ENV=test jest ./tests/functional/reclaim/index.test.ts --detectOpenHandles --forceExit --verbose",
43
52
  "test:redeploy": "NODE_ENV=test jest ./tests/functional/redeploy/index.test.ts --detectOpenHandles --forceExit --verbose",
53
+ "test:reentrant": "NODE_ENV=test jest ./tests/functional/reentrant/index.test.ts --detectOpenHandles --forceExit --verbose",
44
54
  "test:retry": "NODE_ENV=test jest ./tests/functional/retry/index.test.ts --detectOpenHandles --forceExit --verbose",
55
+ "test:sequence": "NODE_ENV=test jest ./tests/functional/sequence/index.test.ts --detectOpenHandles --forceExit --verbose",
56
+ "test:signal": "NODE_ENV=test jest ./tests/functional/signal/index.test.ts --detectOpenHandles --forceExit --verbose",
45
57
  "test:status": "NODE_ENV=test jest ./tests/functional/status/index.test.ts --detectOpenHandles --forceExit --verbose",
46
- "test:store:redis": "NODE_ENV=test jest ./tests/functional/store/clients/redis.test.ts --detectOpenHandles --forceExit --verbose",
47
58
  "test:store:ioredis": "NODE_ENV=test jest ./tests/functional/store/clients/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
48
- "test:stream:redis": "NODE_ENV=test jest ./tests/functional/stream/clients/redis.test.ts --detectOpenHandles --forceExit --verbose",
59
+ "test:store:redis": "NODE_ENV=test jest ./tests/functional/store/clients/redis.test.ts --detectOpenHandles --forceExit --verbose",
49
60
  "test:stream:ioredis": "NODE_ENV=test jest ./tests/functional/stream/clients/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
50
- "test:sub:redis": "NODE_ENV=test jest ./tests/functional/sub/clients/redis.test.ts --detectOpenHandles --forceExit --verbose",
61
+ "test:stream:redis": "NODE_ENV=test jest ./tests/functional/stream/clients/redis.test.ts --detectOpenHandles --forceExit --verbose",
51
62
  "test:sub:ioredis": "NODE_ENV=test jest ./tests/functional/sub/clients/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
52
- "test:durable": "NODE_ENV=test jest ./tests/durable/*/index.test.ts --detectOpenHandles --forceExit --verbose",
53
- "test:durable:basic": "NODE_ENV=test jest ./tests/durable/basic/index.test.ts --detectOpenHandles --forceExit --verbose",
54
- "test:durable:collision": "NODE_ENV=test jest ./tests/durable/collision/index.test.ts --detectOpenHandles --forceExit --verbose",
55
- "test:durable:hello": "NODE_ENV=test jest ./tests/durable/helloworld/index.test.ts --detectOpenHandles --forceExit --verbose",
56
- "test:durable:interrupt": "NODE_ENV=test jest ./tests/durable/interrupt/index.test.ts --detectOpenHandles --forceExit --verbose",
57
- "test:durable:goodbye": "NODE_ENV=test jest ./tests/durable/goodbye/index.test.ts --detectOpenHandles --forceExit --verbose",
58
- "test:durable:hook": "NODE_ENV=test jest ./tests/durable/hook/index.test.ts --detectOpenHandles --forceExit --verbose",
59
- "test:durable:retry": "NODE_ENV=test jest ./tests/durable/retry/index.test.ts --detectOpenHandles --forceExit --verbose",
60
- "test:durable:fatal": "NODE_ENV=test jest ./tests/durable/fatal/index.test.ts --detectOpenHandles --forceExit --verbose",
61
- "test:durable:unknown": "NODE_ENV=test jest ./tests/durable/unknown/index.test.ts --detectOpenHandles --forceExit --verbose",
62
- "test:durable:sleep": "NODE_ENV=test jest ./tests/durable/sleep/index.test.ts --detectOpenHandles --forceExit --verbose",
63
- "test:durable:signal": "NODE_ENV=test jest ./tests/durable/signal/index.test.ts --detectOpenHandles --forceExit --verbose",
64
- "test:durable:loopactivity": "NODE_ENV=test jest ./tests/durable/loopactivity/index.test.ts --detectOpenHandles --forceExit --verbose",
65
- "test:durable:nested": "NODE_ENV=test jest ./tests/durable/nested/index.test.ts --detectOpenHandles --forceExit --verbose"
63
+ "test:sub:redis": "NODE_ENV=test jest ./tests/functional/sub/clients/redis.test.ts --detectOpenHandles --forceExit --verbose",
64
+ "test:trigger": "NODE_ENV=test jest ./tests/unit/services/activities/trigger.test.ts --detectOpenHandles --forceExit --verbose",
65
+ "test:unit": "NODE_ENV=test jest ./tests/unit/*/*/index.test.ts --detectOpenHandles --forceExit --verbose"
66
66
  },
67
67
  "keywords": [
68
+ "workflow",
68
69
  "durable workflow",
69
- "HotMesh",
70
- "service mesh",
71
- "workflows",
72
70
  "operational data",
71
+ "service mesh",
72
+ "HotMesh",
73
73
  "Redis",
74
74
  "OLAP",
75
75
  "OLTP",
@@ -89,9 +89,12 @@
89
89
  "devDependencies": {
90
90
  "@types/jest": "^29.5.0",
91
91
  "@types/node": "^18.15.11",
92
- "@typescript-eslint/eslint-plugin": "^5.56.0",
93
- "@typescript-eslint/parser": "^5.56.0",
94
- "eslint": "^8.36.0",
92
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
93
+ "@typescript-eslint/parser": "^5.62.0",
94
+ "eslint": "^8.57.0",
95
+ "eslint-config-prettier": "^9.1.0",
96
+ "eslint-plugin-import": "^2.29.1",
97
+ "eslint-plugin-prettier": "^5.1.3",
95
98
  "ioredis": "^5.3.2",
96
99
  "jest": "^29.5.0",
97
100
  "redis": "^4.6.13",
@@ -102,7 +105,7 @@
102
105
  "typescript": "^5.0.4"
103
106
  },
104
107
  "peerDependencies": {
105
- "redis": "^4.0.0",
106
- "ioredis": "^4.0.0 || ^5.0.0"
108
+ "ioredis": "^4.0.0 || ^5.0.0",
109
+ "redis": "^4.0.0"
107
110
  }
108
111
  }