@hotmeshio/hotmesh 0.0.55 → 0.0.57

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 (182) hide show
  1. package/README.md +1 -1
  2. package/build/modules/enums.js +1 -10
  3. package/build/modules/key.d.ts +0 -38
  4. package/build/modules/key.js +4 -46
  5. package/build/modules/utils.d.ts +0 -8
  6. package/build/modules/utils.js +0 -14
  7. package/build/package.json +11 -4
  8. package/build/services/activities/activity.d.ts +0 -28
  9. package/build/services/activities/activity.js +1 -46
  10. package/build/services/activities/await.js +0 -4
  11. package/build/services/activities/cycle.d.ts +0 -7
  12. package/build/services/activities/cycle.js +1 -16
  13. package/build/services/activities/hook.d.ts +0 -6
  14. package/build/services/activities/hook.js +2 -12
  15. package/build/services/activities/interrupt.js +0 -8
  16. package/build/services/activities/signal.d.ts +0 -6
  17. package/build/services/activities/signal.js +0 -15
  18. package/build/services/activities/trigger.d.ts +0 -4
  19. package/build/services/activities/trigger.js +1 -7
  20. package/build/services/activities/worker.js +0 -4
  21. package/build/services/collator/index.d.ts +0 -70
  22. package/build/services/collator/index.js +1 -91
  23. package/build/services/compiler/deployer.js +6 -38
  24. package/build/services/compiler/index.d.ts +0 -15
  25. package/build/services/compiler/index.js +0 -20
  26. package/build/services/compiler/validator.d.ts +0 -3
  27. package/build/services/compiler/validator.js +0 -25
  28. package/build/services/connector/clients/ioredis.d.ts +2 -2
  29. package/build/services/connector/clients/ioredis.js +0 -2
  30. package/build/services/connector/clients/redis.d.ts +4 -4
  31. package/build/services/connector/clients/redis.js +1 -3
  32. package/build/services/connector/index.d.ts +1 -1
  33. package/build/services/connector/index.js +0 -2
  34. package/build/services/durable/client.d.ts +1 -26
  35. package/build/services/durable/client.js +0 -56
  36. package/build/services/durable/exporter.d.ts +0 -22
  37. package/build/services/durable/exporter.js +1 -30
  38. package/build/services/durable/handle.d.ts +0 -36
  39. package/build/services/durable/handle.js +0 -46
  40. package/build/services/durable/index.d.ts +0 -4
  41. package/build/services/durable/index.js +0 -4
  42. package/build/services/durable/schemas/factory.d.ts +0 -29
  43. package/build/services/durable/schemas/factory.js +0 -29
  44. package/build/services/durable/search.d.ts +1 -36
  45. package/build/services/durable/search.js +56 -56
  46. package/build/services/durable/worker.js +2 -22
  47. package/build/services/durable/workflow.d.ts +0 -114
  48. package/build/services/durable/workflow.js +1 -141
  49. package/build/services/engine/index.d.ts +1 -6
  50. package/build/services/engine/index.js +1 -43
  51. package/build/services/exporter/index.d.ts +0 -27
  52. package/build/services/exporter/index.js +0 -33
  53. package/build/services/hotmesh/index.d.ts +2 -2
  54. package/build/services/hotmesh/index.js +1 -9
  55. package/build/services/logger/index.js +0 -2
  56. package/build/services/mapper/index.d.ts +0 -14
  57. package/build/services/mapper/index.js +0 -14
  58. package/build/services/pipe/functions/date.d.ts +0 -7
  59. package/build/services/pipe/functions/date.js +0 -7
  60. package/build/services/pipe/functions/math.js +0 -2
  61. package/build/services/pipe/index.d.ts +0 -15
  62. package/build/services/pipe/index.js +2 -23
  63. package/build/services/quorum/index.d.ts +0 -7
  64. package/build/services/quorum/index.js +0 -21
  65. package/build/services/reporter/index.d.ts +0 -5
  66. package/build/services/reporter/index.js +0 -9
  67. package/build/services/router/index.d.ts +0 -9
  68. package/build/services/router/index.js +2 -38
  69. package/build/services/serializer/index.js +7 -26
  70. package/build/services/store/cache.d.ts +0 -18
  71. package/build/services/store/cache.js +0 -18
  72. package/build/services/store/clients/ioredis.d.ts +1 -1
  73. package/build/services/store/clients/ioredis.js +0 -1
  74. package/build/services/store/clients/redis.d.ts +1 -1
  75. package/build/services/store/index.d.ts +0 -55
  76. package/build/services/store/index.js +5 -81
  77. package/build/services/stream/clients/ioredis.d.ts +1 -1
  78. package/build/services/stream/clients/ioredis.js +1 -4
  79. package/build/services/stream/clients/redis.d.ts +1 -1
  80. package/build/services/sub/clients/ioredis.d.ts +1 -1
  81. package/build/services/sub/clients/redis.d.ts +1 -1
  82. package/build/services/task/index.d.ts +0 -9
  83. package/build/services/task/index.js +0 -31
  84. package/build/services/telemetry/index.d.ts +0 -7
  85. package/build/services/telemetry/index.js +1 -13
  86. package/build/services/worker/index.d.ts +0 -4
  87. package/build/services/worker/index.js +2 -6
  88. package/build/types/activity.d.ts +0 -81
  89. package/build/types/durable.d.ts +26 -177
  90. package/build/types/exporter.d.ts +0 -13
  91. package/build/types/hotmesh.d.ts +4 -16
  92. package/build/types/hotmesh.js +0 -3
  93. package/build/types/index.d.ts +4 -6
  94. package/build/types/index.js +4 -3
  95. package/build/types/job.d.ts +1 -86
  96. package/build/types/pipe.d.ts +0 -65
  97. package/build/types/quorum.d.ts +15 -10
  98. package/build/types/redis.d.ts +225 -7
  99. package/build/types/redis.js +9 -0
  100. package/build/types/stream.d.ts +0 -58
  101. package/build/types/stream.js +0 -4
  102. package/package.json +11 -4
  103. package/types/durable.ts +131 -4
  104. package/types/hotmesh.ts +3 -6
  105. package/types/index.ts +23 -10
  106. package/types/job.ts +1 -1
  107. package/types/quorum.ts +22 -0
  108. package/types/redis.ts +267 -18
  109. package/build/types/ioredisclient.d.ts +0 -5
  110. package/build/types/ioredisclient.js +0 -5
  111. package/build/types/redisclient.d.ts +0 -26
  112. package/build/types/redisclient.js +0 -2
  113. package/modules/enums.ts +0 -62
  114. package/modules/errors.ts +0 -280
  115. package/modules/key.ts +0 -101
  116. package/modules/storage.ts +0 -3
  117. package/modules/utils.ts +0 -242
  118. package/services/activities/activity.ts +0 -589
  119. package/services/activities/await.ts +0 -113
  120. package/services/activities/cycle.ts +0 -115
  121. package/services/activities/hook.ts +0 -197
  122. package/services/activities/index.ts +0 -19
  123. package/services/activities/interrupt.ts +0 -172
  124. package/services/activities/signal.ts +0 -148
  125. package/services/activities/trigger.ts +0 -295
  126. package/services/activities/worker.ts +0 -107
  127. package/services/collator/README.md +0 -102
  128. package/services/collator/index.ts +0 -291
  129. package/services/compiler/deployer.ts +0 -504
  130. package/services/compiler/index.ts +0 -98
  131. package/services/compiler/validator.ts +0 -158
  132. package/services/connector/clients/ioredis.ts +0 -57
  133. package/services/connector/clients/redis.ts +0 -72
  134. package/services/connector/index.ts +0 -42
  135. package/services/durable/client.ts +0 -266
  136. package/services/durable/connection.ts +0 -10
  137. package/services/durable/exporter.ts +0 -232
  138. package/services/durable/handle.ts +0 -160
  139. package/services/durable/index.ts +0 -27
  140. package/services/durable/schemas/factory.ts +0 -2358
  141. package/services/durable/search.ts +0 -196
  142. package/services/durable/worker.ts +0 -401
  143. package/services/durable/workflow.ts +0 -557
  144. package/services/engine/index.ts +0 -761
  145. package/services/exporter/index.ts +0 -146
  146. package/services/hotmesh/index.ts +0 -237
  147. package/services/logger/index.ts +0 -79
  148. package/services/mapper/index.ts +0 -89
  149. package/services/pipe/functions/array.ts +0 -78
  150. package/services/pipe/functions/bitwise.ts +0 -27
  151. package/services/pipe/functions/conditional.ts +0 -35
  152. package/services/pipe/functions/date.ts +0 -220
  153. package/services/pipe/functions/index.ts +0 -27
  154. package/services/pipe/functions/json.ts +0 -11
  155. package/services/pipe/functions/logical.ts +0 -11
  156. package/services/pipe/functions/math.ts +0 -217
  157. package/services/pipe/functions/number.ts +0 -75
  158. package/services/pipe/functions/object.ts +0 -98
  159. package/services/pipe/functions/string.ts +0 -86
  160. package/services/pipe/functions/symbol.ts +0 -39
  161. package/services/pipe/functions/unary.ts +0 -19
  162. package/services/pipe/index.ts +0 -216
  163. package/services/quorum/index.ts +0 -319
  164. package/services/reporter/index.ts +0 -387
  165. package/services/router/index.ts +0 -426
  166. package/services/serializer/README.md +0 -10
  167. package/services/serializer/index.ts +0 -285
  168. package/services/store/cache.ts +0 -172
  169. package/services/store/clients/ioredis.ts +0 -145
  170. package/services/store/clients/redis.ts +0 -191
  171. package/services/store/index.ts +0 -1091
  172. package/services/stream/clients/ioredis.ts +0 -157
  173. package/services/stream/clients/redis.ts +0 -158
  174. package/services/stream/index.ts +0 -58
  175. package/services/sub/clients/ioredis.ts +0 -83
  176. package/services/sub/clients/redis.ts +0 -74
  177. package/services/sub/index.ts +0 -25
  178. package/services/task/index.ts +0 -250
  179. package/services/telemetry/index.ts +0 -273
  180. package/services/worker/index.ts +0 -248
  181. package/types/ioredisclient.ts +0 -10
  182. package/types/redisclient.ts +0 -30
@@ -32,18 +32,7 @@ interface Measure {
32
32
  target: string;
33
33
  }
34
34
  interface TriggerActivityStats {
35
- /**
36
- * dependent parent job id; including this allows the parent's
37
- * expiration/interruption events to cascade; set
38
- * `expire` in the YAML for the dependent graph
39
- * to 0 and provide the parent for dependent,
40
- * cascading interruption and cleanup
41
- */
42
35
  parent?: string;
43
- /**
44
- * adjacent parent job id; this is the actual adjacent
45
- * parent in the graph, but it is not used for cascading expiration
46
- */
47
36
  adjacent?: string;
48
37
  id?: {
49
38
  [key: string]: unknown;
@@ -51,19 +40,7 @@ interface TriggerActivityStats {
51
40
  key?: {
52
41
  [key: string]: unknown;
53
42
  } | string;
54
- /**
55
- * @deprecated
56
- * return 'infinity' to disable; default behavior
57
- * is to always segment keys by time to ensure
58
- * indexes (Redis LIST) never grow unbounded
59
- * as a default behavior; for now, 5m is default
60
- * and infinity can be set to override
61
- */
62
43
  granularity?: string;
63
- /**
64
- * @deprecated
65
- * what to capture
66
- */
67
44
  measures?: Measure[];
68
45
  }
69
46
  interface TriggerActivity extends BaseActivity {
@@ -102,84 +79,26 @@ interface SignalActivity extends BaseActivity {
102
79
  }
103
80
  interface InterruptActivity extends BaseActivity {
104
81
  type: 'interrupt';
105
- /**
106
- * Optional Reason; will be used as the error `message` when thrown
107
- * @default 'Job Interrupted'
108
- */
109
82
  reason?: string;
110
- /**
111
- * throw JobInterrupted error upon interrupting
112
- * @default true
113
- */
114
83
  throw?: boolean;
115
- /**
116
- * Interrupt child/descendant jobs
117
- * @default false
118
- */
119
84
  descend?: boolean;
120
- /**
121
- * Target job id (if not present the current job will be targeted)
122
- */
123
85
  target?: string;
124
- /**
125
- * Optional topic to publish the interrupt message (if not present the current job topic will be used
126
- */
127
86
  topic?: string;
128
- /**
129
- * Optional Error Code; will be used as the error `code` when thrown
130
- * @default 410
131
- */
132
87
  code?: number;
133
- /**
134
- * Optional stack trace
135
- */
136
88
  stack?: string;
137
89
  }
138
90
  type ActivityType = BaseActivity | TriggerActivity | AwaitActivity | WorkerActivity | InterruptActivity | HookActivity | SignalActivity | CycleActivity;
139
91
  type ActivityData = Record<string, any>;
140
- /**
141
- * Type definition for activity metadata.
142
- */
143
92
  type ActivityMetadata = {
144
- /**
145
- * Unique identifier for the activity.
146
- */
147
93
  aid: string;
148
- /**
149
- * Type of the activity.
150
- */
151
94
  atp: string;
152
- /**
153
- * Subtype of the activity.
154
- */
155
95
  stp: string;
156
- /**
157
- * Timestamp when the activity was created, in GMT.
158
- */
159
96
  ac: string;
160
- /**
161
- * Timestamp when the activity was last updated, in GMT.
162
- */
163
97
  au: string;
164
- /**
165
- * Optional stringified JSON containing error details such as message, code, and an optional error object.
166
- */
167
98
  err?: string;
168
- /**
169
- * OpenTelemetry span context for the first leg of the activity.
170
- */
171
99
  l1s?: string;
172
- /**
173
- * OpenTelemetry span context for the second leg of the activity.
174
- */
175
100
  l2s?: string;
176
- /**
177
- * Dimensional address, used for additional metadata.
178
- */
179
101
  dad?: string;
180
- /**
181
- * Status of the activity, could be codes representing different states.
182
- */
183
102
  as?: string;
184
103
  };
185
104
  type ActivityContext = {
@@ -2,215 +2,85 @@ import { LogLevel } from './logger';
2
2
  import { RedisClass, RedisOptions } from './redis';
3
3
  import { StringAnyType, StringStringType } from './serializer';
4
4
  import { StreamData, StreamError } from './stream';
5
- /**
6
- * Type definition for workflow configuration.
7
- */
8
5
  type WorkflowConfig = {
9
- /**
10
- * Backoff coefficient for retry mechanism.
11
- * @default 10 (HMSH_DURABLE_EXP_BACKOFF)
12
- */
13
6
  backoffCoefficient?: number;
14
- /**
15
- * Maximum number of attempts for retries.
16
- * @default 5 (HMSH_DURABLE_MAX_ATTEMPTS)
17
- */
18
7
  maximumAttempts?: number;
19
- /**
20
- * Maximum interval between retries.
21
- * @default 120s (HMSH_DURABLE_MAX_INTERVAL)
22
- */
23
8
  maximumInterval?: string;
24
- /**
25
- * Whether to throw an error on final failure after retries are exhausted
26
- * or return the error object as a standard response containing error-related
27
- * fields like `stack`, `code`, `message`.
28
- * @default true
29
- */
30
9
  throwOnError?: boolean;
31
10
  };
32
11
  type WorkflowContext = {
33
- /**
34
- * can the workflow be retried if an error occurs
35
- */
36
12
  canRetry: boolean;
37
13
  COUNTER: {
38
- /**
39
- * the reentrant semaphore parent counter object for object reference during increment
40
- */
41
14
  counter: number;
42
15
  };
43
- /**
44
- * the reentrant semaphore, incremented in real-time as idempotent statements are re-traversed upon reentry. Indicates the current semaphore count.
45
- */
46
16
  counter: number;
47
- /**
48
- * number as string for the replay cursor
49
- */
50
17
  cursor: string;
51
- /**
52
- * the replay hash of name/value pairs representing prior executions
53
- */
54
18
  replay: StringStringType;
55
- /**
56
- * the HotMesh App namespace. `durable` is the default.
57
- */
58
19
  namespace: string;
59
- /**
60
- * holds list of interruption payloads; if list is longer than 1 when the error is thrown, a `collator` subflow will be used
61
- */
62
20
  interruptionRegistry: any[];
63
- /**
64
- * entry point ancestor flow; might be the parent; will never be self
65
- */
66
21
  originJobId: string;
67
- /**
68
- * the workflow/job ID
69
- */
70
22
  workflowId: string;
71
- /**
72
- * the dimensional isolation for the reentrant hook, expressed in the format `0,0`, `0,1`, etc
73
- */
74
23
  workflowDimension: string;
75
- /**
76
- * a concatenation of the task queue and workflow name (e.g., `${taskQueueName}-${workflowName}`)
77
- */
78
24
  workflowTopic: string;
79
- /**
80
- * the open telemetry trace context for the workflow, used for logging and tracing. If a sink is enabled, this will be sent to the sink.
81
- */
82
25
  workflowTrace: string;
83
- /**
84
- * the open telemetry span context for the workflow, used for logging and tracing. If a sink is enabled, this will be sent to the sink.
85
- */
86
26
  workflowSpan: string;
87
- /**
88
- * the native HotMesh message that encapsulates the arguments, metadata, and raw data for the workflow
89
- */
90
27
  raw: StreamData;
91
28
  };
92
29
  type WorkflowSearchOptions = {
93
- /** FT index name (myapp:myindex) */
94
30
  index?: string;
95
- /** FT prefixes (['myapp:myindex:prefix1', 'myapp:myindex:prefix2']) */
96
31
  prefix?: string[];
97
- /**
98
- * Schema mapping each field to a type with an optional sortable flag
99
- */
100
32
  schema?: Record<string, {
101
33
  type: 'TEXT' | 'NUMERIC' | 'TAG';
102
34
  sortable?: boolean;
35
+ nostem?: boolean;
36
+ noindex?: boolean;
37
+ indexed?: boolean;
38
+ examples?: string[];
39
+ nilable?: boolean;
40
+ primitive?: 'string' | 'number' | 'boolean' | 'array' | 'object';
41
+ required?: boolean;
42
+ enum?: string[];
43
+ pattern?: string;
44
+ fieldName?: string;
103
45
  }>;
104
- /** Additional data as a key-value record */
105
46
  data?: StringStringType;
106
47
  };
48
+ type SearchResults = {
49
+ count: number;
50
+ query: string;
51
+ data: StringStringType[];
52
+ };
107
53
  type WorkflowOptions = {
108
- /**
109
- * the namespace for the workflow; `durable` is the default namespace if not provided
110
- */
111
54
  namespace?: string;
112
- /**
113
- * the task queue for the workflow; optional if entity is provided
114
- */
115
55
  taskQueue?: string;
116
- /**
117
- * input arguments to pass in
118
- */
119
56
  args: any[];
120
- /**
121
- * the job id
122
- */
123
57
  workflowId?: string;
124
- /**
125
- * if invoking a workflow, passing 'entity' will apply the value as the workflowName, taskQueue, and prefix, ensuring the FT.SEARCH index is properly scoped. This is a convenience method but limits options.
126
- */
127
58
  entity?: string;
128
- /**
129
- * the name of the user's workflow function; optional if 'entity' is provided
130
- */
131
59
  workflowName?: string;
132
- /**
133
- * the parent workflow id; adjacent ancestor ID
134
- */
135
60
  parentWorkflowId?: string;
136
- /**
137
- * the entry point workflow id
138
- */
139
61
  originJobId?: string;
140
- /**
141
- * OpenTelemetry trace context for the workflow
142
- */
143
62
  workflowTrace?: string;
144
- /**
145
- * OpenTelemetry span context for the workflow
146
- */
147
63
  workflowSpan?: string;
148
- /**
149
- * the full-text-search (RediSearch) options for the workflow
150
- */
151
64
  search?: WorkflowSearchOptions;
152
- /**
153
- * marker data (begins with a -)
154
- */
155
65
  marker?: StringStringType;
156
- /**
157
- * the workflow configuration object
158
- */
159
66
  config?: WorkflowConfig;
160
- /**
161
- * sets the number of seconds a workflow may exist after completion. As the process engine is an in-memory cache, the default policy is to expire and scrub the job hash as soon as it completes.
162
- */
163
67
  expire?: number;
164
- /**
165
- * default is true; if false, will not await the execution
166
- */
167
68
  await?: boolean;
168
69
  };
169
- /**
170
- * Options for setting up a hook.
171
- * 'durable' is the default namespace if not provided; similar to setting `appid` in the YAML
172
- */
173
70
  type HookOptions = {
174
- /** Optional namespace under which the hook function will be grouped */
175
71
  namespace?: string;
176
- /** Optional task queue, needed unless 'entity' is provided */
177
72
  taskQueue?: string;
178
- /** Input arguments to pass into the hook */
179
73
  args: any[];
180
- /**
181
- * Optional entity name. If provided, applies as the workflowName,
182
- * taskQueue, and prefix. This scopes the FT.SEARCH index appropriately.
183
- * This is a convenience method but limits options.
184
- */
185
74
  entity?: string;
186
- /** Execution ID, also known as the job ID to hook into */
187
75
  workflowId?: string;
188
- /** The name of the user's hook function */
189
76
  workflowName?: string;
190
- /** Bind additional search terms immediately before hook reentry */
191
77
  search?: WorkflowSearchOptions;
192
- /** Hook function constraints (backoffCoefficient, maximumAttempts, maximumInterval) */
193
78
  config?: WorkflowConfig;
194
79
  };
195
- /**
196
- * Options for sending signals in a workflow.
197
- */
198
80
  type SignalOptions = {
199
- /**
200
- * Task queue associated with the workflow
201
- */
202
81
  taskQueue: string;
203
- /**
204
- * Input data for the signal (any serializable object)
205
- */
206
82
  data: StringAnyType;
207
- /**
208
- * Execution ID, also known as the job ID
209
- */
210
83
  workflowId: string;
211
- /**
212
- * Optional name of the user's workflow function
213
- */
214
84
  workflowName?: string;
215
85
  };
216
86
  type ActivityWorkflowDataType = {
@@ -228,8 +98,8 @@ type WorkflowDataType = {
228
98
  canRetry?: boolean;
229
99
  };
230
100
  type ConnectionConfig = {
231
- class: RedisClass;
232
- options: RedisOptions;
101
+ class: Partial<RedisClass>;
102
+ options: Partial<RedisOptions>;
233
103
  };
234
104
  type Connection = ConnectionConfig;
235
105
  type ClientConfig = {
@@ -239,20 +109,11 @@ type Registry = {
239
109
  [key: string]: Function;
240
110
  };
241
111
  type WorkerConfig = {
242
- /** Connection configuration for the worker */
243
112
  connection: Connection;
244
- /**
245
- * Namespace used in the app configuration, denoted as `appid` in the YAML (e.g., 'durable')
246
- * @default durable
247
- */
248
113
  namespace?: string;
249
- /** Task queue name, denoted as `subscribes` in the YAML (e.g., 'hello-world') */
250
114
  taskQueue: string;
251
- /** Target function or a record type with a name (string) and reference function */
252
115
  workflow: Function | Record<string | symbol, Function>;
253
- /** Additional options for configuring the worker */
254
116
  options?: WorkerOptions;
255
- /** Search options for workflow execution details */
256
117
  search?: WorkflowSearchOptions;
257
118
  };
258
119
  type FindWhereQuery = {
@@ -266,6 +127,7 @@ type FindOptions = {
266
127
  taskQueue?: string;
267
128
  namespace?: string;
268
129
  index?: string;
130
+ search?: WorkflowSearchOptions;
269
131
  };
270
132
  type FindWhereOptions = {
271
133
  options?: FindOptions;
@@ -277,14 +139,17 @@ type FindWhereOptions = {
277
139
  size: number;
278
140
  };
279
141
  };
142
+ type FindJobsOptions = {
143
+ match?: string;
144
+ namespace?: string;
145
+ limit?: number;
146
+ batch?: number;
147
+ cursor?: string;
148
+ };
280
149
  type WorkerOptions = {
281
- /** Log level: debug, info, warn, error */
282
150
  logLevel?: LogLevel;
283
- /** Maximum number of attempts, default 5 (HMSH_DURABLE_MAX_ATTEMPTS) */
284
151
  maximumAttempts?: number;
285
- /** Backoff coefficient for retry logic, default 10 (HMSH_DURABLE_EXP_BACKOFF) */
286
152
  backoffCoefficient?: number;
287
- /** Maximum interval between retries, default 120s (HMSH_DURABLE_MAX_INTERVAL) */
288
153
  maximumInterval?: string;
289
154
  };
290
155
  type ContextType = {
@@ -295,29 +160,16 @@ type FunctionSignature<T> = T extends (...args: infer A) => infer R ? (...args:
295
160
  type ProxyType<ACT> = {
296
161
  [K in keyof ACT]: FunctionSignature<ACT[K]>;
297
162
  };
298
- /**
299
- * Configuration settings for activities within a workflow.
300
- */
301
163
  type ActivityConfig = {
302
- /** Start to close timeout for the activity; not yet implemented */
303
164
  startToCloseTimeout?: string;
304
- /** Configuration for specific activities, type not yet specified */
305
165
  activities?: any;
306
- /** Retry policy configuration for activities */
307
166
  retryPolicy?: {
308
- /** Maximum number of retry attempts, default is 5 (HMSH_DURABLE_MAX_ATTEMPTS) */
309
167
  maximumAttempts?: number;
310
- /** Factor by which the retry timeout increases, default is 10 (HMSH_DURABLE_MAX_INTERVAL) */
311
168
  backoffCoefficient?: number;
312
- /** Maximum interval between retries, default is '120s' (HMSH_DURABLE_EXP_BACKOFF) */
313
169
  maximumInterval?: string;
314
- /** Whether to throw an error on failure, default is true */
315
170
  throwOnError?: boolean;
316
171
  };
317
172
  };
318
- /**
319
- * The proxy response object returned from the activity proxy flow
320
- */
321
173
  type ProxyResponseType<T> = {
322
174
  data?: T;
323
175
  $error?: StreamError;
@@ -325,9 +177,6 @@ type ProxyResponseType<T> = {
325
177
  jc: string;
326
178
  ju: string;
327
179
  };
328
- /**
329
- * The child flow response object returned from the main flow during recursion
330
- */
331
180
  type ChildResponseType<T> = {
332
181
  data?: T;
333
182
  $error?: StreamError;
@@ -335,4 +184,4 @@ type ChildResponseType<T> = {
335
184
  jc: string;
336
185
  ju: string;
337
186
  };
338
- export { ActivityConfig, ActivityWorkflowDataType, ChildResponseType, ClientConfig, ContextType, ConnectionConfig, Connection, ProxyResponseType, ProxyType, Registry, SignalOptions, FindOptions, FindWhereOptions, FindWhereQuery, HookOptions, WorkerConfig, WorkflowConfig, WorkerOptions, WorkflowSearchOptions, WorkflowDataType, WorkflowOptions, WorkflowContext, };
187
+ export { ActivityConfig, ActivityWorkflowDataType, ChildResponseType, ClientConfig, ContextType, ConnectionConfig, Connection, ProxyResponseType, ProxyType, Registry, SignalOptions, FindJobsOptions, FindOptions, FindWhereOptions, FindWhereQuery, HookOptions, SearchResults, WorkerConfig, WorkflowConfig, WorkerOptions, WorkflowSearchOptions, WorkflowDataType, WorkflowOptions, WorkflowContext, };
@@ -1,22 +1,9 @@
1
1
  import { StringAnyType } from "./serializer";
2
2
  export type ExportItem = [(string | null), string, any];
3
- /**
4
- * job export data can be large, particularly transitions the timeline
5
- */
6
3
  export type ExportFields = 'data' | 'state' | 'status' | 'timeline' | 'transitions';
7
4
  export interface ExportOptions {
8
- /**
9
- * limit the export byte size by specifying an allowlist
10
- */
11
5
  allow?: Array<ExportFields>;
12
- /**
13
- * limit the export byte size by specifying a block list
14
- */
15
6
  block?: Array<ExportFields>;
16
- /**
17
- * If false, do not return timeline values (like child job response, proxy activity response, etc)
18
- * @default true
19
- */
20
7
  values?: boolean;
21
8
  }
22
9
  export type JobAction = {
@@ -4,9 +4,6 @@ import { HookRules } from './hook';
4
4
  import { RedisClass, RedisClient, RedisOptions } from './redis';
5
5
  import { StreamData, StreamDataResponse } from './stream';
6
6
  import { LogLevel } from './logger';
7
- /**
8
- * the full set of entity types that are stored in the key/value store
9
- */
10
7
  declare enum KeyType {
11
8
  APP = "APP",
12
9
  ENGINE_ID = "ENGINE",
@@ -28,9 +25,6 @@ declare enum KeyType {
28
25
  TIME_RANGE = "TIME_RANGE",
29
26
  WORK_ITEMS = "WORK_ITEMS"
30
27
  }
31
- /**
32
- * minting keys, requires one or more of the following parameters
33
- */
34
28
  type KeyStoreParams = {
35
29
  appId?: string;
36
30
  engineId?: string;
@@ -46,8 +40,8 @@ type KeyStoreParams = {
46
40
  };
47
41
  type HotMesh = typeof HotMeshService;
48
42
  type RedisConfig = {
49
- class: RedisClass;
50
- options: RedisOptions;
43
+ class: Partial<RedisClass>;
44
+ options: Partial<RedisOptions>;
51
45
  };
52
46
  type HotMeshEngine = {
53
47
  store?: RedisClient;
@@ -62,10 +56,7 @@ type HotMeshWorker = {
62
56
  store?: RedisClient;
63
57
  stream?: RedisClient;
64
58
  sub?: RedisClient;
65
- redis?: {
66
- class: RedisClass;
67
- options: RedisOptions;
68
- };
59
+ redis?: RedisConfig;
69
60
  reclaimDelay?: number;
70
61
  reclaimCount?: number;
71
62
  callback: (payload: StreamData) => Promise<StreamDataResponse | void>;
@@ -117,7 +108,4 @@ type HotMeshApp = VersionedFields & {
117
108
  type HotMeshApps = {
118
109
  [appId: string]: HotMeshApp;
119
110
  };
120
- export { HotMesh, HotMeshEngine, RedisConfig, HotMeshWorker, HotMeshSettings, HotMeshApp, //a single app in the db
121
- HotMeshApps, //object array of all apps in the db
122
- HotMeshConfig, //customer config
123
- HotMeshManifest, HotMeshGraph, KeyType, KeyStoreParams, };
111
+ export { HotMesh, HotMeshEngine, RedisConfig, HotMeshWorker, HotMeshSettings, HotMeshApp, HotMeshApps, HotMeshConfig, HotMeshManifest, HotMeshGraph, KeyType, KeyStoreParams, };
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.KeyType = void 0;
4
- /**
5
- * the full set of entity types that are stored in the key/value store
6
- */
7
4
  var KeyType;
8
5
  (function (KeyType) {
9
6
  KeyType["APP"] = "APP";
@@ -3,19 +3,17 @@ 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, FindOptions, FindWhereOptions, FindWhereQuery, HookOptions, WorkflowConfig, WorkerConfig, WorkerOptions, WorkflowContext, WorkflowSearchOptions, WorkflowDataType, WorkflowOptions, } from './durable';
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
7
  export { DurableChildErrorType, DurableProxyErrorType, DurableSleepErrorType, DurableWaitForAllErrorType, DurableWaitForErrorType } from "./error";
8
8
  export { ActivityAction, DependencyExport, DurableJobExport, ExportCycles, ExportItem, ExportOptions, ExportTransitions, JobAction, JobExport, JobActionExport, JobTimeline } from './exporter';
9
9
  export { HookCondition, HookConditions, HookGate, HookInterface, HookRule, HookRules, HookSignal } from './hook';
10
- export { RedisClientType as IORedisClientType, RedisMultiType as IORedisMultiType } from './ioredisclient';
11
10
  export { ILogger } from './logger';
12
- export { JobData, JobsData, JobMetadata, JobOutput, JobState, JobStatus, PartialJobState, ExtensionType } from './job';
11
+ export { ExtensionType, JobCompletionOptions, JobData, JobsData, JobInterruptOptions, JobMetadata, JobOutput, JobState, JobStatus, PartialJobState } from './job';
13
12
  export { MappingStatements } from './map';
14
13
  export { Pipe, PipeContext, PipeItem, PipeItems, PipeObject, ReduceObject } from './pipe';
15
14
  export { HotMesh, HotMeshApp, HotMeshApps, HotMeshConfig, HotMeshEngine, RedisConfig, HotMeshGraph, HotMeshManifest, HotMeshSettings, HotMeshWorker, KeyStoreParams, KeyType } from './hotmesh';
16
- export { ActivateMessage, CronMessage, JobMessage, JobMessageCallback, PingMessage, PongMessage, QuorumMessage, QuorumMessageCallback, QuorumProfile, RollCallMessage, SubscriptionCallback, SystemHealth, ThrottleMessage, ThrottleOptions, WorkMessage } from './quorum';
17
- export { MultiResponseFlags, RedisClient, RedisMulti } from './redis';
18
- export { RedisClientType, RedisMultiType } from './redisclient';
15
+ export { ActivateMessage, CronMessage, JobMessage, JobMessageCallback, PingMessage, PongMessage, QuorumMessage, QuorumMessageCallback, QuorumProfile, RollCallMessage, RollCallOptions, SubscriptionCallback, SubscriptionOptions, SystemHealth, ThrottleMessage, ThrottleOptions, WorkMessage } from './quorum';
16
+ export { RedisClass, RedisRedisClientType, RedisRedisClientOptions, RedisRedisClassType, IORedisClientType, RedisClient, RedisMulti, RedisRedisMultiType, IORedisClientOptions, IORedisClassType, IORedisMultiType, RedisOptions, MultiResponseFlags, isRedisClient, isIORedisClient, } from './redis';
19
17
  export { JSONSchema, StringAnyType, StringScalarType, StringStringType, SymbolMap, SymbolMaps, SymbolRanges, Symbols, SymbolSets } from './serializer';
20
18
  export { AggregatedData, CountByFacet, GetStatsOptions, IdsData, Measure, MeasureIds, MetricTypes, StatType, StatsType, IdsResponse, JobStats, JobStatsInput, JobStatsRange, StatsResponse, Segment, TimeSegment } from './stats';
21
19
  export { ReclaimedMessageType, StreamCode, StreamConfig, StreamData, StreamDataType, StreamError, StreamDataResponse, StreamRetryPolicy, StreamRole, StreamStatus } from './stream';
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ValueType = exports.trace = exports.SpanKind = exports.SpanStatusCode = exports.propagation = exports.metrics = exports.context = exports.StreamStatus = exports.StreamRole = exports.StreamDataType = exports.KeyType = exports.IORedisClientType = exports.HookGate = exports.CollationFaultType = void 0;
3
+ exports.ValueType = exports.trace = exports.SpanKind = exports.SpanStatusCode = exports.propagation = exports.metrics = exports.context = exports.StreamStatus = exports.StreamRole = exports.StreamDataType = exports.isIORedisClient = exports.isRedisClient = exports.KeyType = exports.HookGate = exports.CollationFaultType = void 0;
4
4
  var collator_1 = require("./collator");
5
5
  Object.defineProperty(exports, "CollationFaultType", { enumerable: true, get: function () { return collator_1.CollationFaultType; } });
6
6
  var hook_1 = require("./hook");
7
7
  Object.defineProperty(exports, "HookGate", { enumerable: true, get: function () { return hook_1.HookGate; } });
8
- var ioredisclient_1 = require("./ioredisclient");
9
- Object.defineProperty(exports, "IORedisClientType", { enumerable: true, get: function () { return ioredisclient_1.RedisClientType; } });
10
8
  var hotmesh_1 = require("./hotmesh");
11
9
  Object.defineProperty(exports, "KeyType", { enumerable: true, get: function () { return hotmesh_1.KeyType; } });
10
+ var redis_1 = require("./redis");
11
+ Object.defineProperty(exports, "isRedisClient", { enumerable: true, get: function () { return redis_1.isRedisClient; } });
12
+ Object.defineProperty(exports, "isIORedisClient", { enumerable: true, get: function () { return redis_1.isIORedisClient; } });
12
13
  var stream_1 = require("./stream");
13
14
  Object.defineProperty(exports, "StreamDataType", { enumerable: true, get: function () { return stream_1.StreamDataType; } });
14
15
  Object.defineProperty(exports, "StreamRole", { enumerable: true, get: function () { return stream_1.StreamRole; } });