@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/activity.ts CHANGED
@@ -1,7 +1,16 @@
1
- import { MetricTypes } from "./stats";
2
- import { StreamRetryPolicy } from "./stream";
3
-
4
- type ActivityExecutionType = 'trigger' | 'await' | 'worker' | 'activity' | 'emit' | 'interrupt' | 'cycle' | 'signal' | 'hook';
1
+ import { MetricTypes } from './stats';
2
+ import { StreamRetryPolicy } from './stream';
3
+
4
+ type ActivityExecutionType =
5
+ | 'trigger'
6
+ | 'await'
7
+ | 'worker'
8
+ | 'activity'
9
+ | 'emit'
10
+ | 'interrupt'
11
+ | 'cycle'
12
+ | 'signal'
13
+ | 'hook';
5
14
 
6
15
  type Consumes = Record<string, string[]>;
7
16
 
@@ -15,20 +24,20 @@ interface BaseActivity {
15
24
  job?: Record<string, any>;
16
25
  hook?: Record<string, any>;
17
26
  telemetry?: Record<string, any>;
18
- emit?: boolean; //if true, the activity will emit a message to the `publishes` topic immediately before transitioning to adjacent activities
19
- sleep?: number; //@pipe /in seconds
20
- expire?: number; //-1 forever; 0 persists the flow until the parent flow that expired it is dismissed; 15 seconds is the default
21
- retry?: StreamRetryPolicy
22
- cycle?: boolean; //if true, the `notary` will leave leg 2 open, so it can be re/cycled
23
- collationInt?: number; //compiler
24
- consumes?: Consumes; //compiler
25
- PRODUCES?: string[]; //compiler
26
- produces?: string[]; //compiler
27
- publishes?: string; //compiler
28
- subscribes?: string; //compiler
29
- trigger?: string; //compiler
30
- parent?: string; //compiler
31
- ancestors?: string[]; //compiler
27
+ emit?: boolean; //if true, the activity will emit a message to the `publishes` topic immediately before transitioning to adjacent activities
28
+ sleep?: number; //@pipe /in seconds
29
+ expire?: number; //-1 forever; 0 persists the flow until the parent flow that expired it is dismissed; 15 seconds is the default
30
+ retry?: StreamRetryPolicy;
31
+ cycle?: boolean; //if true, the `notary` will leave leg 2 open, so it can be re/cycled
32
+ collationInt?: number; //compiler
33
+ consumes?: Consumes; //compiler
34
+ PRODUCES?: string[]; //compiler
35
+ produces?: string[]; //compiler
36
+ publishes?: string; //compiler
37
+ subscribes?: string; //compiler
38
+ trigger?: string; //compiler
39
+ parent?: string; //compiler
40
+ ancestors?: string[]; //compiler
32
41
  }
33
42
 
34
43
  interface Measure {
@@ -38,9 +47,9 @@ interface Measure {
38
47
 
39
48
  interface TriggerActivityStats {
40
49
  /**
41
- * dependent parent job id; including this allows the parent's
42
- * expiration/interruption events to cascade; set
43
- * `expire` in the YAML for the dependent graph
50
+ * dependent parent job id; including this allows the parent's
51
+ * expiration/interruption events to cascade; set
52
+ * `expire` in the YAML for the dependent graph
44
53
  * to 0 and provide the parent for dependent,
45
54
  * cascading interruption and cleanup
46
55
  */
@@ -96,50 +105,50 @@ interface HookActivity extends BaseActivity {
96
105
  }
97
106
 
98
107
  interface SignalActivity extends BaseActivity {
99
- type: 'signal'; //signal activities call hook/hookAll
100
- subtype: 'one' | 'all'; //trigger: hook(One) or hookAll
101
- topic: string; //e.g., 'hook.resume'
102
- key_name?: string; //e.g., 'parent_job_id'
103
- key_value?: string; //e.g., '1234567890'
104
- scrub?: boolean; //if true, the index will be deleted after use
105
- signal?: Record<string, any>; //used to define/map the signal input data (what to send/singnal into the job(s))
108
+ type: 'signal'; //signal activities call hook/hookAll
109
+ subtype: 'one' | 'all'; //trigger: hook(One) or hookAll
110
+ topic: string; //e.g., 'hook.resume'
111
+ key_name?: string; //e.g., 'parent_job_id'
112
+ key_value?: string; //e.g., '1234567890'
113
+ scrub?: boolean; //if true, the index will be deleted after use
114
+ signal?: Record<string, any>; //used to define/map the signal input data (what to send/singnal into the job(s))
106
115
  resolver?: Record<string, any>; //used to define/map the signal key resolver (the key used to lookup the job(s that are assigned to the key)
107
- status?: string; //pending, success (default), error
108
- code?: number; //202, 200 (default)
116
+ status?: string; //pending, success (default), error
117
+ code?: number; //202, 200 (default)
109
118
  }
110
119
 
111
120
  interface InterruptActivity extends BaseActivity {
112
121
  type: 'interrupt';
113
122
 
114
- /**
123
+ /**
115
124
  * Optional Reason; will be used as the error `message` when thrown
116
125
  * @default 'Job Interrupted'
117
126
  */
118
127
  reason?: string;
119
128
 
120
- /**
129
+ /**
121
130
  * throw JobInterrupted error upon interrupting
122
131
  * @default true
123
132
  */
124
133
  throw?: boolean;
125
134
 
126
- /**
135
+ /**
127
136
  * Interrupt child/descendant jobs
128
137
  * @default false
129
138
  */
130
139
  descend?: boolean;
131
140
 
132
- /**
141
+ /**
133
142
  * Target job id (if not present the current job will be targeted)
134
143
  */
135
144
  target?: string;
136
145
 
137
- /**
146
+ /**
138
147
  * Optional topic to publish the interrupt message (if not present the current job topic will be used
139
148
  */
140
149
  topic?: string;
141
150
 
142
- /**
151
+ /**
143
152
  * Optional Error Code; will be used as the error `code` when thrown
144
153
  * @default 410
145
154
  */
@@ -151,7 +160,15 @@ interface InterruptActivity extends BaseActivity {
151
160
  stack?: string;
152
161
  }
153
162
 
154
- type ActivityType = BaseActivity | TriggerActivity | AwaitActivity | WorkerActivity | InterruptActivity | HookActivity | SignalActivity | CycleActivity;
163
+ type ActivityType =
164
+ | BaseActivity
165
+ | TriggerActivity
166
+ | AwaitActivity
167
+ | WorkerActivity
168
+ | InterruptActivity
169
+ | HookActivity
170
+ | SignalActivity
171
+ | CycleActivity;
155
172
 
156
173
  type ActivityData = Record<string, any>;
157
174
 
@@ -213,7 +230,7 @@ type ActivityMetadata = {
213
230
  type ActivityContext = {
214
231
  data?: ActivityData | null;
215
232
  metadata: ActivityMetadata;
216
- hook?: ActivityData
233
+ hook?: ActivityData;
217
234
  };
218
235
 
219
236
  type ActivityDuplex = 1 | 2;
@@ -243,5 +260,5 @@ export {
243
260
  BaseActivity,
244
261
  InterruptActivity,
245
262
  TriggerActivity,
246
- WorkerActivity
263
+ WorkerActivity,
247
264
  };
package/types/async.ts CHANGED
@@ -1,7 +1,6 @@
1
-
2
1
  type AsyncSignal = {
3
- topic: string,
4
- jobId: string
2
+ topic: string;
3
+ jobId: string;
5
4
  };
6
5
 
7
6
  export { AsyncSignal };
package/types/collator.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  export type CollationStage = 'enter' | 'exit' | 'confirm';
2
2
 
3
3
  export enum CollationFaultType {
4
- MISSING = 'missing', //`as` uninitialized; leg1 entry not allowed
5
- DUPLICATE = 'duplicate', //1st digit < 8
6
- INACTIVE = 'inactive', //3rd digit is 8
7
- INVALID = 'invalid', //unknown value (corrupt for unknown reasons)
8
- FORBIDDEN = 'forbidden', //leg 1 not completed; reentry (leg 2) not allowed
4
+ MISSING = 'missing', //`as` uninitialized; leg1 entry not allowed
5
+ DUPLICATE = 'duplicate', //1st digit < 8
6
+ INACTIVE = 'inactive', //3rd digit is 8
7
+ INVALID = 'invalid', //unknown value (corrupt for unknown reasons)
8
+ FORBIDDEN = 'forbidden', //leg 1 not completed; reentry (leg 2) not allowed
9
9
  }
package/types/durable.ts CHANGED
@@ -7,19 +7,19 @@ import { StreamData, StreamError } from './stream';
7
7
  * Type definition for workflow configuration.
8
8
  */
9
9
  type WorkflowConfig = {
10
- /**
10
+ /**
11
11
  * Backoff coefficient for retry mechanism.
12
12
  * @default 10 (HMSH_DURABLE_EXP_BACKOFF)
13
13
  */
14
14
  backoffCoefficient?: number;
15
15
 
16
- /**
16
+ /**
17
17
  * Maximum number of attempts for retries.
18
18
  * @default 5 (HMSH_DURABLE_MAX_ATTEMPTS)
19
19
  */
20
20
  maximumAttempts?: number;
21
21
 
22
- /**
22
+ /**
23
23
  * Maximum interval between retries.
24
24
  * @default 120s (HMSH_DURABLE_MAX_INTERVAL)
25
25
  */
@@ -32,10 +32,9 @@ type WorkflowConfig = {
32
32
  * @default true
33
33
  */
34
34
  throwOnError?: boolean;
35
- }
35
+ };
36
36
 
37
37
  type WorkflowContext = {
38
-
39
38
  /**
40
39
  * can the workflow be retried if an error occurs
41
40
  */
@@ -46,7 +45,7 @@ type WorkflowContext = {
46
45
  * the reentrant semaphore parent counter object for object reference during increment
47
46
  */
48
47
  counter: number;
49
- }
48
+ };
50
49
 
51
50
  /**
52
51
  * the reentrant semaphore, incremented in real-time as idempotent statements are re-traversed upon reentry. Indicates the current semaphore count.
@@ -83,7 +82,7 @@ type WorkflowContext = {
83
82
  */
84
83
  workflowId: string;
85
84
 
86
- /**
85
+ /**
87
86
  * the dimensional isolation for the reentrant hook, expressed in the format `0,0`, `0,1`, etc
88
87
  */
89
88
  workflowDimension: string;
@@ -107,24 +106,14 @@ type WorkflowContext = {
107
106
  * the native HotMesh message that encapsulates the arguments, metadata, and raw data for the workflow
108
107
  */
109
108
  raw: StreamData;
110
- }
111
-
112
- type WorkflowSearchOptions = {
113
-
114
- /** FT index name (myapp:myindex) */
115
- index?: string;
116
-
117
- /** FT prefixes (['myapp:myindex:prefix1', 'myapp:myindex:prefix2']) */
118
- prefix?: string[];
109
+ };
119
110
 
120
- /**
121
- * Schema mapping each field. Each field is a key-value pair where the key is the field name
122
- * and the value is a record of field options. If the fieldName is provided,
123
- * it will be used as the indexed field name. If not provided
124
- * key will be used as the indexed field name with an underscore prefix.
125
- *
126
- */
127
- schema?: Record<string, {
111
+ /**
112
+ * The schema for the full-text-search (RediSearch) index.
113
+ */
114
+ export type WorkflowSearchSchema = Record<
115
+ string,
116
+ {
128
117
  /**
129
118
  * The FT.SEARCH field type. One of: TEXT, NUMERIC, TAG. TEXT is
130
119
  * most expensive, but also most expressive.
@@ -168,7 +157,7 @@ type WorkflowSearchOptions = {
168
157
  examples?: string[];
169
158
 
170
159
  /**
171
- * The 'nilable' setting may NOT be set to `true` for
160
+ * The 'nilable' setting may NOT be set to `true` for
172
161
  * NUMBER types as it causes an indexing error;
173
162
  * consider a custom (e.g., negative number) value to represent
174
163
  * `null` if desired for a NUMERIC field.
@@ -213,28 +202,42 @@ type WorkflowSearchOptions = {
213
202
  fieldName?: string;
214
203
  }>;
215
204
 
205
+ type WorkflowSearchOptions = {
206
+ /** FT index name (myapp:myindex) */
207
+ index?: string;
208
+
209
+ /** FT prefixes (['myapp:myindex:prefix1', 'myapp:myindex:prefix2']) */
210
+ prefix?: string[];
211
+
212
+ /**
213
+ * Schema mapping each field. Each field is a key-value pair where the key is the field name
214
+ * and the value is a record of field options. If the fieldName is provided,
215
+ * it will be used as the indexed field name. If not provided
216
+ * key will be used as the indexed field name with an underscore prefix.
217
+ *
218
+ */
219
+ schema?: WorkflowSearchSchema;
220
+
216
221
  /** Additional data as a key-value record */
217
222
  data?: StringStringType;
218
- }
219
-
223
+ };
220
224
 
221
225
  type SearchResults = {
222
226
  /**
223
227
  * the total number of results
224
228
  */
225
- count: number,
229
+ count: number;
226
230
  /**
227
231
  * the raw FT.SEARCH query string
228
232
  */
229
- query: string,
233
+ query: string;
230
234
  /**
231
235
  * the raw FT.SEARCH results as an array of objects
232
236
  */
233
- data: StringStringType[]
237
+ data: StringStringType[];
234
238
  };
235
239
 
236
240
  type WorkflowOptions = {
237
-
238
241
  /**
239
242
  * the namespace for the workflow; `durable` is the default namespace if not provided
240
243
  */
@@ -288,12 +291,12 @@ type WorkflowOptions = {
288
291
  /**
289
292
  * the full-text-search (RediSearch) options for the workflow
290
293
  */
291
- search?: WorkflowSearchOptions
294
+ search?: WorkflowSearchOptions;
292
295
 
293
296
  /**
294
297
  * marker data (begins with a -)
295
298
  */
296
- marker?: StringStringType
299
+ marker?: StringStringType;
297
300
 
298
301
  /**
299
302
  * the workflow configuration object
@@ -309,9 +312,9 @@ type WorkflowOptions = {
309
312
  * default is true; if false, will not await the execution
310
313
  */
311
314
  await?: boolean;
312
- }
315
+ };
313
316
 
314
- /**
317
+ /**
315
318
  * Options for setting up a hook.
316
319
  * 'durable' is the default namespace if not provided; similar to setting `appid` in the YAML
317
320
  */
@@ -324,80 +327,80 @@ type HookOptions = {
324
327
 
325
328
  /** Input arguments to pass into the hook */
326
329
  args: any[];
327
-
330
+
328
331
  /**
329
332
  * Optional entity name. If provided, applies as the workflowName,
330
333
  * taskQueue, and prefix. This scopes the FT.SEARCH index appropriately.
331
334
  * This is a convenience method but limits options.
332
335
  */
333
336
  entity?: string;
334
-
337
+
335
338
  /** Execution ID, also known as the job ID to hook into */
336
339
  workflowId?: string;
337
-
340
+
338
341
  /** The name of the user's hook function */
339
342
  workflowName?: string;
340
-
343
+
341
344
  /** Bind additional search terms immediately before hook reentry */
342
- search?: WorkflowSearchOptions
343
-
345
+ search?: WorkflowSearchOptions;
346
+
344
347
  /** Hook function constraints (backoffCoefficient, maximumAttempts, maximumInterval) */
345
- config?: WorkflowConfig;
346
- }
348
+ config?: WorkflowConfig;
349
+ };
347
350
 
348
- /**
351
+ /**
349
352
  * Options for sending signals in a workflow.
350
353
  */
351
354
  type SignalOptions = {
352
- /**
353
- * Task queue associated with the workflow
355
+ /**
356
+ * Task queue associated with the workflow
354
357
  */
355
358
  taskQueue: string;
356
359
 
357
- /**
358
- * Input data for the signal (any serializable object)
360
+ /**
361
+ * Input data for the signal (any serializable object)
359
362
  */
360
- data: StringAnyType;
363
+ data: StringAnyType;
361
364
 
362
- /**
363
- * Execution ID, also known as the job ID
365
+ /**
366
+ * Execution ID, also known as the job ID
364
367
  */
365
368
  workflowId: string;
366
369
 
367
- /**
368
- * Optional name of the user's workflow function
370
+ /**
371
+ * Optional name of the user's workflow function
369
372
  */
370
373
  workflowName?: string;
371
- }
374
+ };
372
375
 
373
376
  type ActivityWorkflowDataType = {
374
377
  activityName: string;
375
378
  arguments: any[];
376
379
  workflowId: string;
377
380
  workflowTopic: string;
378
- }
381
+ };
379
382
 
380
383
  type WorkflowDataType = {
381
384
  arguments: any[];
382
385
  workflowId: string;
383
386
  workflowTopic: string;
384
387
  workflowDimension?: string; //is present if hook (not main workflow)
385
- originJobId?: string; //is present if there is an originating ancestor job (should rename to originJobId)
388
+ originJobId?: string; //is present if there is an originating ancestor job (should rename to originJobId)
386
389
  canRetry?: boolean;
387
- }
390
+ };
388
391
 
389
392
  type ConnectionConfig = {
390
393
  class: Partial<RedisClass>;
391
394
  options: Partial<RedisOptions>;
392
- }
393
- type Connection = ConnectionConfig;
395
+ };
396
+ type Connection = ConnectionConfig;
394
397
 
395
398
  type ClientConfig = {
396
399
  connection: Connection;
397
- }
400
+ };
398
401
 
399
- type Registry = {
400
- [key: string]: Function
402
+ type Registry = {
403
+ [key: string]: Function;
401
404
  };
402
405
  type WorkerConfig = {
403
406
  /** Connection configuration for the worker */
@@ -420,15 +423,14 @@ type WorkerConfig = {
420
423
 
421
424
  /** Search options for workflow execution details */
422
425
  search?: WorkflowSearchOptions;
423
- }
424
-
426
+ };
425
427
 
426
428
  type FindWhereQuery = {
427
429
  field: string;
428
430
  is: '=' | '==' | '>=' | '<=' | '[]';
429
431
  value: string | boolean | number | [number, number];
430
432
  type?: string; //default is TEXT
431
- }
433
+ };
432
434
 
433
435
  type FindOptions = {
434
436
  workflowName?: string; //also the function name
@@ -436,7 +438,7 @@ type FindOptions = {
436
438
  namespace?: string;
437
439
  index?: string;
438
440
  search?: WorkflowSearchOptions;
439
- }
441
+ };
440
442
 
441
443
  type FindWhereOptions = {
442
444
  options?: FindOptions;
@@ -444,10 +446,10 @@ type FindWhereOptions = {
444
446
  query: FindWhereQuery[];
445
447
  return?: string[];
446
448
  limit?: {
447
- start: number,
448
- size: number
449
- }
450
- }
449
+ start: number;
450
+ size: number;
451
+ };
452
+ };
451
453
 
452
454
  type FindJobsOptions = {
453
455
  /** The workflow name; include an asterisk for wilcard search; refer to Redis SCAN for the allowed format */
@@ -464,7 +466,7 @@ type FindJobsOptions = {
464
466
 
465
467
  /** The start cursor; defaults to 0 */
466
468
  cursor?: string;
467
- }
469
+ };
468
470
 
469
471
  type WorkerOptions = {
470
472
  /** Log level: debug, info, warn, error */
@@ -478,14 +480,16 @@ type WorkerOptions = {
478
480
 
479
481
  /** Maximum interval between retries, default 120s (HMSH_DURABLE_MAX_INTERVAL) */
480
482
  maximumInterval?: string;
481
- }
483
+ };
482
484
 
483
485
  type ContextType = {
484
- workflowId: string
485
- workflowTopic: string
486
+ workflowId: string;
487
+ workflowTopic: string;
486
488
  };
487
489
 
488
- type FunctionSignature<T> = T extends (...args: infer A) => infer R ? (...args: A) => R : never;
490
+ type FunctionSignature<T> = T extends (...args: infer A) => infer R
491
+ ? (...args: A) => R
492
+ : never;
489
493
  type ProxyType<ACT> = {
490
494
  [K in keyof ACT]: FunctionSignature<ACT[K]>;
491
495
  };
@@ -517,22 +521,22 @@ type ActivityConfig = {
517
521
  * The proxy response object returned from the activity proxy flow
518
522
  */
519
523
  type ProxyResponseType<T> = {
520
- data?: T, //expected data
521
- $error?: StreamError,
522
- done?: boolean, //non-existent if error was thrown in transition (not during execution)
523
- jc: string,
524
- ju: string
524
+ data?: T; //expected data
525
+ $error?: StreamError;
526
+ done?: boolean; //non-existent if error was thrown in transition (not during execution)
527
+ jc: string;
528
+ ju: string;
525
529
  };
526
530
 
527
531
  /**
528
532
  * The child flow response object returned from the main flow during recursion
529
533
  */
530
534
  type ChildResponseType<T> = {
531
- data?: T, //expected data
532
- $error?: StreamError,
533
- done?: boolean, //non-existent if error was thrown in transition (not during execution)
534
- jc: string,
535
- ju: string
535
+ data?: T; //expected data
536
+ $error?: StreamError;
537
+ done?: boolean; //non-existent if error was thrown in transition (not during execution)
538
+ jc: string;
539
+ ju: string;
536
540
  };
537
541
 
538
542
  export {
@@ -543,7 +547,7 @@ export {
543
547
  ContextType,
544
548
  ConnectionConfig,
545
549
  Connection,
546
- ProxyResponseType,
550
+ ProxyResponseType,
547
551
  ProxyType,
548
552
  Registry,
549
553
  SignalOptions,
package/types/error.ts CHANGED
@@ -1,52 +1,52 @@
1
1
  export type DurableChildErrorType = {
2
- arguments: string[],
3
- await?: boolean,
4
- backoffCoefficient?: number,
5
- index: number,
6
- maximumAttempts?: number,
7
- maximumInterval?: number,
8
- originJobId: string | null,
9
- parentWorkflowId: string,
10
- workflowDimension: string,
11
- workflowId: string,
12
- workflowTopic: string,
2
+ arguments: string[];
3
+ await?: boolean;
4
+ backoffCoefficient?: number;
5
+ index: number;
6
+ maximumAttempts?: number;
7
+ maximumInterval?: number;
8
+ originJobId: string | null;
9
+ parentWorkflowId: string;
10
+ workflowDimension: string;
11
+ workflowId: string;
12
+ workflowTopic: string;
13
13
  };
14
14
 
15
15
  export type DurableWaitForAllErrorType = {
16
- items: string[],
17
- workflowId: string,
18
- workflowTopic: string,
19
- parentWorkflowId: string,
20
- originJobId: string | null,
21
- size: number,
22
- index: number,
23
- workflowDimension: string
16
+ items: string[];
17
+ workflowId: string;
18
+ workflowTopic: string;
19
+ parentWorkflowId: string;
20
+ originJobId: string | null;
21
+ size: number;
22
+ index: number;
23
+ workflowDimension: string;
24
24
  };
25
25
 
26
26
  export type DurableProxyErrorType = {
27
- arguments: string[],
28
- activityName: string,
29
- backoffCoefficient?: number,
30
- index: number,
31
- maximumAttempts?: number,
32
- maximumInterval?: number,
33
- originJobId: string | null,
34
- parentWorkflowId: string,
35
- workflowDimension: string,
36
- workflowId: string,
37
- workflowTopic: string,
27
+ arguments: string[];
28
+ activityName: string;
29
+ backoffCoefficient?: number;
30
+ index: number;
31
+ maximumAttempts?: number;
32
+ maximumInterval?: number;
33
+ originJobId: string | null;
34
+ parentWorkflowId: string;
35
+ workflowDimension: string;
36
+ workflowId: string;
37
+ workflowTopic: string;
38
38
  };
39
39
 
40
40
  export type DurableWaitForErrorType = {
41
- signalId: string,
42
- index: number,
43
- workflowDimension: string
41
+ signalId: string;
42
+ index: number;
43
+ workflowDimension: string;
44
44
  workflowId: string;
45
45
  };
46
46
 
47
47
  export type DurableSleepErrorType = {
48
- duration: number,
49
- index: number,
50
- workflowDimension: string,
51
- workflowId: string,
48
+ duration: number;
49
+ index: number;
50
+ workflowDimension: string;
51
+ workflowId: string;
52
52
  };