@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
package/types/exporter.ts CHANGED
@@ -1,11 +1,16 @@
1
- import { StringAnyType } from "./serializer";
1
+ import { StringAnyType } from './serializer';
2
2
 
3
- export type ExportItem = [(string | null), string, any];
3
+ export type ExportItem = [string | null, string, any];
4
4
 
5
5
  /**
6
6
  * job export data can be large, particularly transitions the timeline
7
7
  */
8
- export type ExportFields = 'data' | 'state' | 'status' | 'timeline' | 'transitions';
8
+ export type ExportFields =
9
+ | 'data'
10
+ | 'state'
11
+ | 'status'
12
+ | 'timeline'
13
+ | 'transitions';
9
14
 
10
15
  export interface ExportOptions {
11
16
  /**
@@ -23,7 +28,7 @@ export interface ExportOptions {
23
28
  * @default true
24
29
  */
25
30
  values?: boolean;
26
- };
31
+ }
27
32
 
28
33
  export type JobAction = {
29
34
  cursor: number;
@@ -35,7 +40,7 @@ export interface JobActionExport {
35
40
  [key: string]: JobAction;
36
41
  };
37
42
  main: JobAction;
38
- };
43
+ }
39
44
 
40
45
  export interface ActivityAction {
41
46
  action: string;
@@ -61,11 +66,11 @@ export interface DependencyExport {
61
66
 
62
67
  export interface ExportTransitions {
63
68
  [key: string]: string[];
64
- };
69
+ }
65
70
 
66
71
  export interface ExportCycles {
67
72
  [key: string]: string[];
68
- };
73
+ }
69
74
 
70
75
  export type TimelineType = {
71
76
  key: string;
@@ -88,10 +93,10 @@ export interface DurableJobExport {
88
93
  status?: number;
89
94
  timeline?: TimelineType[];
90
95
  transitions?: TransitionType[];
91
- };
96
+ }
92
97
 
93
98
  export interface JobExport {
94
99
  dependencies: DependencyExport[];
95
100
  process: StringAnyType;
96
101
  status: string;
97
- };
102
+ }
package/types/hook.ts CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  interface HookCondition {
3
2
  expected: string;
4
3
  actual: string;
@@ -23,10 +22,18 @@ interface HookRules {
23
22
  [eventName: string]: HookRule[];
24
23
  }
25
24
 
26
- type HookSignal = { topic: string, resolved: string, jobId: string};
25
+ type HookSignal = { topic: string; resolved: string; jobId: string };
27
26
 
28
27
  interface HookInterface {
29
- (topic: string, data: { [key: string]: any, id: string }): Promise<void>;
28
+ (topic: string, data: { [key: string]: any; id: string }): Promise<void>;
30
29
  }
31
30
 
32
- export { HookCondition, HookConditions, HookGate, HookInterface, HookRule, HookRules, HookSignal };
31
+ export {
32
+ HookCondition,
33
+ HookConditions,
34
+ HookGate,
35
+ HookInterface,
36
+ HookRule,
37
+ HookRules,
38
+ HookSignal,
39
+ };
package/types/hotmesh.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { ILogger } from '../services/logger';
2
2
  import { HotMeshService } from '../services/hotmesh';
3
+
3
4
  import { HookRules } from './hook';
4
5
  import { RedisClass, RedisClient, RedisOptions } from './redis';
5
6
  import { StreamData, StreamDataResponse } from './stream';
@@ -28,22 +29,22 @@ enum KeyType {
28
29
  SYMVALS = 'SYMVALS',
29
30
  TIME_RANGE = 'TIME_RANGE',
30
31
  WORK_ITEMS = 'WORK_ITEMS',
31
- };
32
+ }
32
33
 
33
34
  /**
34
35
  * minting keys, requires one or more of the following parameters
35
36
  */
36
37
  type KeyStoreParams = {
37
- appId?: string; //app id is a uuid for a hotmesh app
38
- engineId?: string; //unique auto-generated guid for an ephemeral engine instance
39
- appVersion?: string; //(e.g. "1.0.0", "1", "1.0")
40
- jobId?: string; //a customer-defined id for job; must be unique for the entire app
41
- activityId?: string; //activity id is a uuid for a given hotmesh app
42
- jobKey?: string; //a customer-defined label for a job that serves to categorize events
43
- dateTime?: string; //UTC date time: YYYY-MM-DDTHH:MM (20203-04-12T00:00); serves as a time-series bucket for the job_key
44
- facet?: string; //data path starting at root with values separated by colons (e.g. "object/type:bar")
45
- topic?: string; //topic name (e.g., "foo" or "" for top-level)
46
- timeValue?: number; //time value (rounded to minute) (for delete range)
38
+ appId?: string; //app id is a uuid for a hotmesh app
39
+ engineId?: string; //unique auto-generated guid for an ephemeral engine instance
40
+ appVersion?: string; //(e.g. "1.0.0", "1", "1.0")
41
+ jobId?: string; //a customer-defined id for job; must be unique for the entire app
42
+ activityId?: string; //activity id is a uuid for a given hotmesh app
43
+ jobKey?: string; //a customer-defined label for a job that serves to categorize events
44
+ dateTime?: string; //UTC date time: YYYY-MM-DDTHH:MM (20203-04-12T00:00); serves as a time-series bucket for the job_key
45
+ facet?: string; //data path starting at root with values separated by colons (e.g. "object/type:bar")
46
+ topic?: string; //topic name (e.g., "foo" or "" for top-level)
47
+ timeValue?: number; //time value (rounded to minute) (for delete range)
47
48
  scoutType?: 'signal' | 'time' | 'activate'; //a single member of the quorum serves as the 'scout' for the group, triaging tasks for the collective
48
49
  };
49
50
 
@@ -52,27 +53,27 @@ type HotMesh = typeof HotMeshService;
52
53
  type RedisConfig = {
53
54
  class: Partial<RedisClass>;
54
55
  options: Partial<RedisOptions>;
55
- }
56
+ };
56
57
 
57
58
  type HotMeshEngine = {
58
- store?: RedisClient; //set by hotmesh using instanced `redis` class
59
+ store?: RedisClient; //set by hotmesh using instanced `redis` class
59
60
  stream?: RedisClient; //set by hotmesh using instanced `redis` class
60
- sub?: RedisClient; //set by hotmesh using instanced `redis` class
61
+ sub?: RedisClient; //set by hotmesh using instanced `redis` class
61
62
  redis?: RedisConfig;
62
63
  reclaimDelay?: number; //milliseconds
63
64
  reclaimCount?: number;
64
- }
65
+ };
65
66
 
66
67
  type HotMeshWorker = {
67
68
  topic: string;
68
- store?: RedisClient; //set by hotmesh using instanced `redis` class
69
+ store?: RedisClient; //set by hotmesh using instanced `redis` class
69
70
  stream?: RedisClient; //set by hotmesh using instanced `redis` class
70
- sub?: RedisClient; //set by hotmesh using instanced `redis` class
71
+ sub?: RedisClient; //set by hotmesh using instanced `redis` class
71
72
  redis?: RedisConfig;
72
73
  reclaimDelay?: number; //milliseconds
73
74
  reclaimCount?: number; //max number of times to reclaim a stream
74
- callback: (payload: StreamData) => Promise<StreamDataResponse|void>;
75
- }
75
+ callback: (payload: StreamData) => Promise<StreamDataResponse | void>;
76
+ };
76
77
 
77
78
  type HotMeshConfig = {
78
79
  appId: string;
@@ -82,7 +83,7 @@ type HotMeshConfig = {
82
83
  logLevel?: LogLevel;
83
84
  engine?: HotMeshEngine;
84
85
  workers?: HotMeshWorker[];
85
- }
86
+ };
86
87
 
87
88
  type HotMeshGraph = {
88
89
  subscribes: string;
@@ -118,10 +119,10 @@ type VersionedFields = {
118
119
  };
119
120
 
120
121
  type HotMeshApp = VersionedFields & {
121
- id: string; // customer's chosen app id
122
- version: string; // customer's chosen version scheme (semver, etc)
122
+ id: string; // customer's chosen app id
123
+ version: string; // customer's chosen version scheme (semver, etc)
123
124
  settings?: string; // stringified JSON for app settings
124
- active?: boolean; // is the app active?
125
+ active?: boolean; // is the app active?
125
126
  };
126
127
 
127
128
  type HotMeshApps = {
@@ -134,8 +135,8 @@ export {
134
135
  RedisConfig,
135
136
  HotMeshWorker,
136
137
  HotMeshSettings,
137
- HotMeshApp, //a single app in the db
138
- HotMeshApps, //object array of all apps in the db
138
+ HotMeshApp, //a single app in the db
139
+ HotMeshApps, //object array of all apps in the db
139
140
  HotMeshConfig, //customer config
140
141
  HotMeshManifest,
141
142
  HotMeshGraph,
package/types/index.ts CHANGED
@@ -15,50 +15,46 @@ export {
15
15
  InterruptActivity,
16
16
  SignalActivity,
17
17
  TriggerActivity,
18
- TriggerActivityStats } from './activity';
19
- export {
20
- App,
21
- AppVID,
22
- AppTransitions,
23
- AppSubscriptions
24
- } from './app';
18
+ TriggerActivityStats,
19
+ } from './activity';
20
+ export { App, AppVID, AppTransitions, AppSubscriptions } from './app';
25
21
  export { AsyncSignal } from './async';
26
22
  export { CacheMode } from './cache';
27
- export {
28
- CollationFaultType,
29
- CollationStage } from './collator';
30
- export {
31
- ActivityConfig,
32
- ActivityWorkflowDataType,
33
- ChildResponseType,
34
- ClientConfig,
35
- ContextType,
36
- ConnectionConfig,
37
- Connection,
38
- ProxyResponseType,
39
- ProxyType,
40
- Registry,
41
- SignalOptions,
42
- FindJobsOptions,
43
- FindOptions,
44
- FindWhereOptions,
45
- FindWhereQuery,
46
- HookOptions,
47
- SearchResults,
48
- WorkflowConfig,
49
- WorkerConfig,
50
- WorkerOptions,
51
- WorkflowContext,
52
- WorkflowSearchOptions,
53
- WorkflowDataType,
54
- WorkflowOptions,
55
- } from './durable';
23
+ export { CollationFaultType, CollationStage } from './collator';
24
+ export {
25
+ ActivityConfig,
26
+ ActivityWorkflowDataType,
27
+ ChildResponseType,
28
+ ClientConfig,
29
+ ContextType,
30
+ ConnectionConfig,
31
+ Connection,
32
+ ProxyResponseType,
33
+ ProxyType,
34
+ Registry,
35
+ SignalOptions,
36
+ FindJobsOptions,
37
+ FindOptions,
38
+ FindWhereOptions,
39
+ FindWhereQuery,
40
+ HookOptions,
41
+ SearchResults,
42
+ WorkflowConfig,
43
+ WorkerConfig,
44
+ WorkerOptions,
45
+ WorkflowContext,
46
+ WorkflowSearchOptions,
47
+ WorkflowSearchSchema,
48
+ WorkflowDataType,
49
+ WorkflowOptions,
50
+ } from './durable';
56
51
  export {
57
52
  DurableChildErrorType,
58
53
  DurableProxyErrorType,
59
54
  DurableSleepErrorType,
60
55
  DurableWaitForAllErrorType,
61
- DurableWaitForErrorType } from "./error";
56
+ DurableWaitForErrorType,
57
+ } from './error';
62
58
  export {
63
59
  ActivityAction,
64
60
  DependencyExport,
@@ -70,7 +66,8 @@ export {
70
66
  JobAction,
71
67
  JobExport,
72
68
  JobActionExport,
73
- JobTimeline } from './exporter';
69
+ JobTimeline,
70
+ } from './exporter';
74
71
  export {
75
72
  HookCondition,
76
73
  HookConditions,
@@ -78,7 +75,7 @@ export {
78
75
  HookInterface,
79
76
  HookRule,
80
77
  HookRules,
81
- HookSignal
78
+ HookSignal,
82
79
  } from './hook';
83
80
  export { ILogger } from './logger';
84
81
  export {
@@ -91,7 +88,8 @@ export {
91
88
  JobOutput,
92
89
  JobState,
93
90
  JobStatus,
94
- PartialJobState } from './job';
91
+ PartialJobState,
92
+ } from './job';
95
93
  export { MappingStatements } from './map';
96
94
  export {
97
95
  Pipe,
@@ -99,7 +97,8 @@ export {
99
97
  PipeItem,
100
98
  PipeItems,
101
99
  PipeObject,
102
- ReduceObject } from './pipe';
100
+ ReduceObject,
101
+ } from './pipe';
103
102
  export {
104
103
  HotMesh,
105
104
  HotMeshApp,
@@ -112,7 +111,8 @@ export {
112
111
  HotMeshSettings,
113
112
  HotMeshWorker,
114
113
  KeyStoreParams,
115
- KeyType } from './hotmesh';
114
+ KeyType,
115
+ } from './hotmesh';
116
116
  export {
117
117
  ActivateMessage,
118
118
  CronMessage,
@@ -130,7 +130,8 @@ export {
130
130
  SystemHealth,
131
131
  ThrottleMessage,
132
132
  ThrottleOptions,
133
- WorkMessage } from './quorum';
133
+ WorkMessage,
134
+ } from './quorum';
134
135
  export {
135
136
  RedisClass,
136
137
  RedisRedisClientType,
@@ -157,7 +158,8 @@ export {
157
158
  SymbolMaps,
158
159
  SymbolRanges,
159
160
  Symbols,
160
- SymbolSets } from './serializer';
161
+ SymbolSets,
162
+ } from './serializer';
161
163
  export {
162
164
  AggregatedData,
163
165
  CountByFacet,
@@ -174,7 +176,8 @@ export {
174
176
  JobStatsRange,
175
177
  StatsResponse,
176
178
  Segment,
177
- TimeSegment } from './stats';
179
+ TimeSegment,
180
+ } from './stats';
178
181
  export {
179
182
  ReclaimedMessageType,
180
183
  StreamCode,
@@ -185,7 +188,8 @@ export {
185
188
  StreamDataResponse,
186
189
  StreamRetryPolicy,
187
190
  StreamRole,
188
- StreamStatus } from './stream';
191
+ StreamStatus,
192
+ } from './stream';
189
193
  export {
190
194
  context,
191
195
  Context,
@@ -200,10 +204,7 @@ export {
200
204
  SpanKind,
201
205
  trace,
202
206
  Tracer,
203
- ValueType } from './telemetry';
204
- export {
205
- WorkListTaskType } from './task'
206
- export {
207
- TransitionMatch,
208
- TransitionRule,
209
- Transitions } from './transition';
207
+ ValueType,
208
+ } from './telemetry';
209
+ export { WorkListTaskType } from './task';
210
+ export { TransitionMatch, TransitionRule, Transitions } from './transition';
package/types/job.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { StringStringType } from "./serializer";
1
+ import { StringStringType } from './serializer';
2
2
 
3
- type JobData = Record<string, unknown|Record<string, unknown>>;
3
+ type JobData = Record<string, unknown | Record<string, unknown>>;
4
4
  type JobsData = Record<string, unknown>;
5
5
 
6
6
  type ActivityData = {
@@ -11,75 +11,75 @@ type ActivityData = {
11
11
  type JobMetadata = {
12
12
  /** job_key */
13
13
  key?: string;
14
-
14
+
15
15
  /** system assigned guid that corresponds to the transition message guid that spawned reentry */
16
16
  guid?: string;
17
-
17
+
18
18
  /** system assigned guid; ensured created/deleted/created jobs are unique */
19
19
  gid: string;
20
-
20
+
21
21
  /** job_id (jid+dad+aid) is composite key for activity */
22
22
  jid: string;
23
-
23
+
24
24
  /** dimensional address for the activity (,0,0,1) */
25
25
  dad: string;
26
-
26
+
27
27
  /** activity_id as in the YAML file */
28
28
  aid: string;
29
-
29
+
30
30
  /** parent_job_id (pj+pd+pa) is composite key for parent activity */
31
31
  pj?: string;
32
-
32
+
33
33
  /** parent_generational_id (system assigned at trigger inception); pg is the parent job's gid (just in case user created/deleted/created a job with same jid) */
34
34
  pg?: string;
35
-
35
+
36
36
  /** parent_dimensional_address */
37
37
  pd?: string;
38
-
38
+
39
39
  /** parent_activity_id */
40
40
  pa?: string;
41
-
41
+
42
42
  /** sever the dependency chain if true (startChild/vs/execChild) */
43
43
  px?: boolean;
44
-
44
+
45
45
  /** engine guid (one time subscriptions) */
46
46
  ngn?: string;
47
-
47
+
48
48
  /** app_id */
49
49
  app: string;
50
-
50
+
51
51
  /** app version */
52
52
  vrs: string;
53
-
53
+
54
54
  /** subscription topic */
55
55
  tpc: string;
56
-
56
+
57
57
  /** 201203120005 (slice of time) //time series */
58
58
  ts: string;
59
-
59
+
60
60
  /** GMT created //job_created */
61
61
  jc: string;
62
-
62
+
63
63
  /** GMT updated //job_updated */
64
64
  ju: string;
65
-
65
+
66
66
  js: JobStatus;
67
-
67
+
68
68
  /** activity_type */
69
69
  atp: string;
70
-
70
+
71
71
  /** activity_subtype */
72
72
  stp: string;
73
-
73
+
74
74
  /** open telemetry span context */
75
75
  spn: string;
76
-
76
+
77
77
  /** open telemetry trace context */
78
78
  trc: string;
79
-
79
+
80
80
  /** stringified job error json: {message: string, code: number, error?} */
81
81
  err?: string;
82
-
82
+
83
83
  /** process data expire policy */
84
84
  expire?: number;
85
85
  };
@@ -106,7 +106,7 @@ type ExtensionType = {
106
106
  * the initial data set.
107
107
  */
108
108
  marker?: StringStringType;
109
- }
109
+ };
110
110
 
111
111
  /**
112
112
  * job_status semaphore
@@ -126,19 +126,19 @@ type JobState = {
126
126
  };
127
127
 
128
128
  type JobInterruptOptions = {
129
- /**
129
+ /**
130
130
  * optional Reason; will be used as the error `message` when thrown
131
131
  * @default 'Job Interrupted'
132
132
  */
133
133
  reason?: string;
134
134
 
135
- /**
135
+ /**
136
136
  * throw JobInterrupted error upon interrupting
137
137
  * @default true
138
138
  */
139
139
  throw?: boolean;
140
140
 
141
- /**
141
+ /**
142
142
  * interrupt child/descendant jobs
143
143
  * @default false
144
144
  */
@@ -157,7 +157,7 @@ type JobInterruptOptions = {
157
157
  */
158
158
  expire?: number;
159
159
 
160
- /**
160
+ /**
161
161
  * Optional Error Code; will be used as the error `code` when thrown
162
162
  * @default 410
163
163
  */
@@ -188,10 +188,10 @@ type PartialJobState = {
188
188
  type JobCompletionOptions = {
189
189
  /** default false */
190
190
  emit?: boolean;
191
-
191
+
192
192
  /** default undefined */
193
193
  interrupt?: boolean;
194
-
194
+
195
195
  /**
196
196
  * in seconds to wait before deleting/expiring job hash
197
197
  * @default 1 second
package/types/logger.ts CHANGED
@@ -3,6 +3,6 @@ export interface ILogger {
3
3
  error(message: string, ...meta: any[]): void;
4
4
  warn(message: string, ...meta: any[]): void;
5
5
  debug(message: string, ...meta: any[]): void;
6
- };
6
+ }
7
7
 
8
8
  export type LogLevel = 'silly' | 'debug' | 'info' | 'warn' | 'error' | 'silent';
package/types/map.ts CHANGED
@@ -2,4 +2,4 @@ type MappingStatements = {
2
2
  [activityId: string]: string[];
3
3
  };
4
4
 
5
- export { MappingStatements };
5
+ export { MappingStatements };
package/types/pipe.ts CHANGED
@@ -1,4 +1,4 @@
1
- /**
1
+ /**
2
2
  * Represents a single cell value in a pipeline row
3
3
  * If the value is a string, the value will be a literal OR mapping expression
4
4
  */
@@ -22,20 +22,20 @@ type PipeObject = { '@pipe': Array<PipeItem[] | PipeObject | ReduceObject> };
22
22
  * But it also iterates and produces output. The context variables,
23
23
  * `$input`, `$output`, `$item`, `$key`, and `$index` are available.
24
24
  * @example
25
- *
25
+ *
26
26
  * // Example of a reduce expression. The optional object is empty and
27
27
  * // serves as the $output during iteration. The last step in the iteration
28
28
  * // sets $output. if ther are no more iterations, the $output is returned
29
- * // and provided to the next step in the pipeline.
30
- *
29
+ * // and provided to the next step in the pipeline.
30
+ *
31
31
  * // If data is:
32
32
  * // { response: ['a', 'b', 'c'] }
33
- *
33
+ *
34
34
  * // The reduced/transformed expression will be:
35
35
  * // { 'a': 0, 'b': 1, 'c': 2 }
36
- *
36
+ *
37
37
  * // Arrays and objects may be iterated over and transformed.
38
- *
38
+ *
39
39
  * //YAML
40
40
  * '@pipe':
41
41
  * - ['{data.response}', {}]
@@ -48,7 +48,9 @@ type PipeObject = { '@pipe': Array<PipeItem[] | PipeObject | ReduceObject> };
48
48
  * - ['{$index}']
49
49
  * - ['{@object.set}']
50
50
  */
51
- type ReduceObject = { '@reduce': Array<PipeItem[] | PipeObject | ReduceObject> };
51
+ type ReduceObject = {
52
+ '@reduce': Array<PipeItem[] | PipeObject | ReduceObject>;
53
+ };
52
54
 
53
55
  /**
54
56
  * Represents a sequence in the pipeline that can include arrays of `PipeItem`, `PipeObject`, or `ReduceObject`.
package/types/quorum.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { JobOutput } from "./job";
1
+ import { JobOutput } from './job';
2
2
 
3
3
  interface CPULoad {
4
4
  [cpu: string]: string;
@@ -71,7 +71,7 @@ interface QuorumMessageBase {
71
71
  export interface PingMessage extends QuorumMessageBase {
72
72
  type: 'ping';
73
73
  originator: string; //guid
74
- details?: boolean; //if true, all endpoints will include their profile
74
+ details?: boolean; //if true, all endpoints will include their profile
75
75
  }
76
76
 
77
77
  export interface WorkMessage extends QuorumMessageBase {
@@ -86,9 +86,9 @@ export interface CronMessage extends QuorumMessageBase {
86
86
 
87
87
  export interface PongMessage extends QuorumMessageBase {
88
88
  type: 'pong';
89
- guid: string; //call initiator
90
- originator: string; //clone of originator guid passed in ping
91
- entity?: string; //optional entity
89
+ guid: string; //call initiator
90
+ originator: string; //clone of originator guid passed in ping
91
+ entity?: string; //optional entity
92
92
  profile?: QuorumProfile; //contains details about the engine/worker
93
93
  }
94
94
 
@@ -102,25 +102,25 @@ export interface JobMessage extends QuorumMessageBase {
102
102
  type: 'job';
103
103
  entity?: string;
104
104
  topic: string; //this comes from the 'publishes' field in the YAML
105
- job: JobOutput
105
+ job: JobOutput;
106
106
  }
107
107
 
108
108
  export interface ThrottleMessage extends QuorumMessageBase {
109
109
  type: 'throttle';
110
110
  guid?: string; //target engine AND workers with this guid
111
111
  entity?: string;
112
- topic?: string; //target worker(s) matching this topic (pass null to only target the engine, pass undefined to target engine and workers)
112
+ topic?: string; //target worker(s) matching this topic (pass null to only target the engine, pass undefined to target engine and workers)
113
113
  throttle: number; //0-n; millis
114
114
  }
115
115
 
116
116
  export interface RollCallMessage extends QuorumMessageBase {
117
117
  type: 'rollcall';
118
- guid?: string; //target the engine quorum
118
+ guid?: string; //target the engine quorum
119
119
  entity?: string;
120
- topic?: string | null; //target a worker if string; suppress if `null`;
120
+ topic?: string | null; //target a worker if string; suppress if `null`;
121
121
  interval: number; //every 'n' seconds
122
- max?: number; //max broadcasts
123
- signature?: boolean; //include bound worker function in broadcast
122
+ max?: number; //max broadcasts
123
+ signature?: boolean; //include bound worker function in broadcast
124
124
  }
125
125
 
126
126
  export interface JobMessageCallback {
@@ -144,11 +144,18 @@ export type SubscriptionOptions = {
144
144
  namespace?: string;
145
145
  };
146
146
 
147
-
148
147
  /**
149
148
  * The types in this file are used to define those messages that are sent
150
149
  * to hotmesh client instances when a new version is about to be activated.
151
150
  * These messages serve to coordinate the cache invalidation and switch-over
152
151
  * to the new version without any downtime and a coordinating parent server.
153
152
  */
154
- export type QuorumMessage = PingMessage | PongMessage | ActivateMessage | WorkMessage | JobMessage | ThrottleMessage | RollCallMessage | CronMessage;
153
+ export type QuorumMessage =
154
+ | PingMessage
155
+ | PongMessage
156
+ | ActivateMessage
157
+ | WorkMessage
158
+ | JobMessage
159
+ | ThrottleMessage
160
+ | RollCallMessage
161
+ | CronMessage;