@hotmeshio/hotmesh 0.0.60 → 0.1.0

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 (104) hide show
  1. package/README.md +1 -1
  2. package/build/modules/enums.d.ts +1 -1
  3. package/build/modules/enums.js +10 -2
  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 +5 -5
  9. package/build/modules/utils.js +20 -16
  10. package/build/package.json +41 -38
  11. package/build/services/activities/activity.js +37 -20
  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.js +3 -3
  61. package/build/services/store/clients/redis.js +24 -4
  62. package/build/services/store/index.d.ts +9 -3
  63. package/build/services/store/index.js +122 -60
  64. package/build/services/stream/clients/ioredis.js +4 -4
  65. package/build/services/stream/clients/redis.js +31 -4
  66. package/build/services/task/index.js +8 -11
  67. package/build/services/telemetry/index.js +21 -14
  68. package/build/services/worker/index.d.ts +6 -6
  69. package/build/services/worker/index.js +12 -7
  70. package/build/types/activity.d.ts +3 -3
  71. package/build/types/exporter.d.ts +2 -2
  72. package/build/types/exporter.js +0 -6
  73. package/build/types/hook.d.ts +1 -1
  74. package/build/types/hotmesh.js +0 -1
  75. package/build/types/index.d.ts +12 -12
  76. package/build/types/job.d.ts +1 -1
  77. package/build/types/logger.js +0 -1
  78. package/build/types/quorum.d.ts +1 -1
  79. package/build/types/stats.d.ts +1 -1
  80. package/build/types/stream.d.ts +1 -2
  81. package/build/types/telemetry.d.ts +1 -1
  82. package/build/types/transition.d.ts +1 -1
  83. package/package.json +41 -38
  84. package/types/activity.ts +56 -39
  85. package/types/async.ts +2 -3
  86. package/types/collator.ts +5 -5
  87. package/types/durable.ts +161 -161
  88. package/types/error.ts +37 -37
  89. package/types/exporter.ts +14 -9
  90. package/types/hook.ts +11 -4
  91. package/types/hotmesh.ts +26 -25
  92. package/types/index.ts +53 -53
  93. package/types/job.ts +33 -33
  94. package/types/logger.ts +1 -1
  95. package/types/map.ts +1 -1
  96. package/types/pipe.ts +10 -8
  97. package/types/quorum.ts +20 -13
  98. package/types/redis.ts +70 -15
  99. package/types/serializer.ts +8 -6
  100. package/types/stats.ts +22 -6
  101. package/types/stream.ts +9 -9
  102. package/types/task.ts +7 -1
  103. package/types/telemetry.ts +2 -1
  104. package/types/transition.ts +8 -8
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,134 +106,134 @@ 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
- }
109
+ };
111
110
 
112
111
  type WorkflowSearchOptions = {
113
-
114
112
  /** FT index name (myapp:myindex) */
115
113
  index?: string;
116
114
 
117
115
  /** FT prefixes (['myapp:myindex:prefix1', 'myapp:myindex:prefix2']) */
118
116
  prefix?: string[];
119
117
 
120
- /**
118
+ /**
121
119
  * Schema mapping each field. Each field is a key-value pair where the key is the field name
122
120
  * and the value is a record of field options. If the fieldName is provided,
123
121
  * it will be used as the indexed field name. If not provided
124
122
  * key will be used as the indexed field name with an underscore prefix.
125
- *
126
- */
127
- schema?: Record<string, {
128
- /**
129
- * The FT.SEARCH field type. One of: TEXT, NUMERIC, TAG. TEXT is
130
- * most expensive, but also most expressive.
131
- */
132
- type: 'TEXT' | 'NUMERIC' | 'TAG';
133
-
134
- /**
135
- * FT.SEARCH SORTABLE field. If true, results may be sorted according to this field
136
- * @default false
137
- */
138
- sortable?: boolean;
139
-
140
- /**
141
- * FT.SEARCH NOSTEM field. applies to TEXT fields types.
142
- * If true, the text field index will not stem words
143
- * @default false
144
- */
145
- nostem?: boolean;
146
-
147
- /**
148
- * FT.SEARCH NOINDEX field. If true and if the field is sortable, the field will aid
149
- * in sorting results but not be directly indexed as a standalone
150
- * @default false
151
- */
152
- noindex?: boolean;
153
-
154
- /**
155
- * if true, the field is indexed and searchable within the FT.SEARCH index
156
- * This is different from `noindex` which is FT.SEARCH specific and relates
157
- * to sorting and indexing. This is a general flag for the field that will
158
- * enable or disable indexing and searching entirely. Use for fields with
159
- * absolutely no meaning to query or sorting but which are important
160
- * nonetheless as part of the data record that is saved and returned.
161
- * @default true
162
- */
163
- indexed?: boolean;
164
-
165
- /**
166
- * An array of possible values for the field
167
- */
168
- examples?: string[];
169
-
170
- /**
171
- * The 'nilable' setting may NOT be set to `true` for
172
- * NUMBER types as it causes an indexing error;
173
- * consider a custom (e.g., negative number) value to represent
174
- * `null` if desired for a NUMERIC field.
175
- * Set to true only if the field is a TEXT or TAG type and
176
- * you wish to save the string `null` as a value to search
177
- * on (the tag, {null}, or the string, (null)
178
- * @default false
179
- */
180
- nilable?: boolean;
181
-
182
- /**
183
- * possible scalar/primitive types for the field. Use when
184
- * serializing and restoring data to ensure the field is
185
- * properly typed. If not provided, the field will be
186
- * treated as a string.
187
- */
188
- primitive?: 'string' | 'number' | 'boolean' | 'array' | 'object';
189
-
190
- /**
191
- * if true, the field is required to be present in the data record
192
- * @default false
193
- */
194
- required?: boolean;
195
-
196
- /**
197
- * an enumerated list of allowed values; if field is nilable, it is implied
198
- * and therefore not necessary to include `null` in the list
199
- * @default []
200
- */
201
- enum?: string[];
202
-
203
- /**
204
- * a regular expression pattern for the field
205
- * @default '.*'
206
- * @example '^[a-zA-Z0-9_]*$'
207
- */
208
- pattern?: string;
209
-
210
- /**
211
- * literal value to use for the indexed field name (without including the standard underscore (_) prefix isolate)
212
- */
213
- fieldName?: string;
214
- }>;
123
+ *
124
+ */
125
+ schema?: Record<
126
+ string,
127
+ {
128
+ /**
129
+ * The FT.SEARCH field type. One of: TEXT, NUMERIC, TAG. TEXT is
130
+ * most expensive, but also most expressive.
131
+ */
132
+ type: 'TEXT' | 'NUMERIC' | 'TAG';
133
+
134
+ /**
135
+ * FT.SEARCH SORTABLE field. If true, results may be sorted according to this field
136
+ * @default false
137
+ */
138
+ sortable?: boolean;
139
+
140
+ /**
141
+ * FT.SEARCH NOSTEM field. applies to TEXT fields types.
142
+ * If true, the text field index will not stem words
143
+ * @default false
144
+ */
145
+ nostem?: boolean;
146
+
147
+ /**
148
+ * FT.SEARCH NOINDEX field. If true and if the field is sortable, the field will aid
149
+ * in sorting results but not be directly indexed as a standalone
150
+ * @default false
151
+ */
152
+ noindex?: boolean;
153
+
154
+ /**
155
+ * if true, the field is indexed and searchable within the FT.SEARCH index
156
+ * This is different from `noindex` which is FT.SEARCH specific and relates
157
+ * to sorting and indexing. This is a general flag for the field that will
158
+ * enable or disable indexing and searching entirely. Use for fields with
159
+ * absolutely no meaning to query or sorting but which are important
160
+ * nonetheless as part of the data record that is saved and returned.
161
+ * @default true
162
+ */
163
+ indexed?: boolean;
164
+
165
+ /**
166
+ * An array of possible values for the field
167
+ */
168
+ examples?: string[];
169
+
170
+ /**
171
+ * The 'nilable' setting may NOT be set to `true` for
172
+ * NUMBER types as it causes an indexing error;
173
+ * consider a custom (e.g., negative number) value to represent
174
+ * `null` if desired for a NUMERIC field.
175
+ * Set to true only if the field is a TEXT or TAG type and
176
+ * you wish to save the string `null` as a value to search
177
+ * on (the tag, {null}, or the string, (null)
178
+ * @default false
179
+ */
180
+ nilable?: boolean;
181
+
182
+ /**
183
+ * possible scalar/primitive types for the field. Use when
184
+ * serializing and restoring data to ensure the field is
185
+ * properly typed. If not provided, the field will be
186
+ * treated as a string.
187
+ */
188
+ primitive?: 'string' | 'number' | 'boolean' | 'array' | 'object';
189
+
190
+ /**
191
+ * if true, the field is required to be present in the data record
192
+ * @default false
193
+ */
194
+ required?: boolean;
195
+
196
+ /**
197
+ * an enumerated list of allowed values; if field is nilable, it is implied
198
+ * and therefore not necessary to include `null` in the list
199
+ * @default []
200
+ */
201
+ enum?: string[];
202
+
203
+ /**
204
+ * a regular expression pattern for the field
205
+ * @default '.*'
206
+ * @example '^[a-zA-Z0-9_]*$'
207
+ */
208
+ pattern?: string;
209
+
210
+ /**
211
+ * literal value to use for the indexed field name (without including the standard underscore (_) prefix isolate)
212
+ */
213
+ fieldName?: string;
214
+ }
215
+ >;
215
216
 
216
217
  /** Additional data as a key-value record */
217
218
  data?: StringStringType;
218
- }
219
-
219
+ };
220
220
 
221
221
  type SearchResults = {
222
222
  /**
223
223
  * the total number of results
224
224
  */
225
- count: number,
225
+ count: number;
226
226
  /**
227
227
  * the raw FT.SEARCH query string
228
228
  */
229
- query: string,
229
+ query: string;
230
230
  /**
231
231
  * the raw FT.SEARCH results as an array of objects
232
232
  */
233
- data: StringStringType[]
233
+ data: StringStringType[];
234
234
  };
235
235
 
236
236
  type WorkflowOptions = {
237
-
238
237
  /**
239
238
  * the namespace for the workflow; `durable` is the default namespace if not provided
240
239
  */
@@ -288,12 +287,12 @@ type WorkflowOptions = {
288
287
  /**
289
288
  * the full-text-search (RediSearch) options for the workflow
290
289
  */
291
- search?: WorkflowSearchOptions
290
+ search?: WorkflowSearchOptions;
292
291
 
293
292
  /**
294
293
  * marker data (begins with a -)
295
294
  */
296
- marker?: StringStringType
295
+ marker?: StringStringType;
297
296
 
298
297
  /**
299
298
  * the workflow configuration object
@@ -309,9 +308,9 @@ type WorkflowOptions = {
309
308
  * default is true; if false, will not await the execution
310
309
  */
311
310
  await?: boolean;
312
- }
311
+ };
313
312
 
314
- /**
313
+ /**
315
314
  * Options for setting up a hook.
316
315
  * 'durable' is the default namespace if not provided; similar to setting `appid` in the YAML
317
316
  */
@@ -324,80 +323,80 @@ type HookOptions = {
324
323
 
325
324
  /** Input arguments to pass into the hook */
326
325
  args: any[];
327
-
326
+
328
327
  /**
329
328
  * Optional entity name. If provided, applies as the workflowName,
330
329
  * taskQueue, and prefix. This scopes the FT.SEARCH index appropriately.
331
330
  * This is a convenience method but limits options.
332
331
  */
333
332
  entity?: string;
334
-
333
+
335
334
  /** Execution ID, also known as the job ID to hook into */
336
335
  workflowId?: string;
337
-
336
+
338
337
  /** The name of the user's hook function */
339
338
  workflowName?: string;
340
-
339
+
341
340
  /** Bind additional search terms immediately before hook reentry */
342
- search?: WorkflowSearchOptions
343
-
341
+ search?: WorkflowSearchOptions;
342
+
344
343
  /** Hook function constraints (backoffCoefficient, maximumAttempts, maximumInterval) */
345
- config?: WorkflowConfig;
346
- }
344
+ config?: WorkflowConfig;
345
+ };
347
346
 
348
- /**
347
+ /**
349
348
  * Options for sending signals in a workflow.
350
349
  */
351
350
  type SignalOptions = {
352
- /**
353
- * Task queue associated with the workflow
351
+ /**
352
+ * Task queue associated with the workflow
354
353
  */
355
354
  taskQueue: string;
356
355
 
357
- /**
358
- * Input data for the signal (any serializable object)
356
+ /**
357
+ * Input data for the signal (any serializable object)
359
358
  */
360
- data: StringAnyType;
359
+ data: StringAnyType;
361
360
 
362
- /**
363
- * Execution ID, also known as the job ID
361
+ /**
362
+ * Execution ID, also known as the job ID
364
363
  */
365
364
  workflowId: string;
366
365
 
367
- /**
368
- * Optional name of the user's workflow function
366
+ /**
367
+ * Optional name of the user's workflow function
369
368
  */
370
369
  workflowName?: string;
371
- }
370
+ };
372
371
 
373
372
  type ActivityWorkflowDataType = {
374
373
  activityName: string;
375
374
  arguments: any[];
376
375
  workflowId: string;
377
376
  workflowTopic: string;
378
- }
377
+ };
379
378
 
380
379
  type WorkflowDataType = {
381
380
  arguments: any[];
382
381
  workflowId: string;
383
382
  workflowTopic: string;
384
383
  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)
384
+ originJobId?: string; //is present if there is an originating ancestor job (should rename to originJobId)
386
385
  canRetry?: boolean;
387
- }
386
+ };
388
387
 
389
388
  type ConnectionConfig = {
390
389
  class: Partial<RedisClass>;
391
390
  options: Partial<RedisOptions>;
392
- }
393
- type Connection = ConnectionConfig;
391
+ };
392
+ type Connection = ConnectionConfig;
394
393
 
395
394
  type ClientConfig = {
396
395
  connection: Connection;
397
- }
396
+ };
398
397
 
399
- type Registry = {
400
- [key: string]: Function
398
+ type Registry = {
399
+ [key: string]: Function;
401
400
  };
402
401
  type WorkerConfig = {
403
402
  /** Connection configuration for the worker */
@@ -420,15 +419,14 @@ type WorkerConfig = {
420
419
 
421
420
  /** Search options for workflow execution details */
422
421
  search?: WorkflowSearchOptions;
423
- }
424
-
422
+ };
425
423
 
426
424
  type FindWhereQuery = {
427
425
  field: string;
428
426
  is: '=' | '==' | '>=' | '<=' | '[]';
429
427
  value: string | boolean | number | [number, number];
430
428
  type?: string; //default is TEXT
431
- }
429
+ };
432
430
 
433
431
  type FindOptions = {
434
432
  workflowName?: string; //also the function name
@@ -436,7 +434,7 @@ type FindOptions = {
436
434
  namespace?: string;
437
435
  index?: string;
438
436
  search?: WorkflowSearchOptions;
439
- }
437
+ };
440
438
 
441
439
  type FindWhereOptions = {
442
440
  options?: FindOptions;
@@ -444,10 +442,10 @@ type FindWhereOptions = {
444
442
  query: FindWhereQuery[];
445
443
  return?: string[];
446
444
  limit?: {
447
- start: number,
448
- size: number
449
- }
450
- }
445
+ start: number;
446
+ size: number;
447
+ };
448
+ };
451
449
 
452
450
  type FindJobsOptions = {
453
451
  /** The workflow name; include an asterisk for wilcard search; refer to Redis SCAN for the allowed format */
@@ -464,7 +462,7 @@ type FindJobsOptions = {
464
462
 
465
463
  /** The start cursor; defaults to 0 */
466
464
  cursor?: string;
467
- }
465
+ };
468
466
 
469
467
  type WorkerOptions = {
470
468
  /** Log level: debug, info, warn, error */
@@ -478,14 +476,16 @@ type WorkerOptions = {
478
476
 
479
477
  /** Maximum interval between retries, default 120s (HMSH_DURABLE_MAX_INTERVAL) */
480
478
  maximumInterval?: string;
481
- }
479
+ };
482
480
 
483
481
  type ContextType = {
484
- workflowId: string
485
- workflowTopic: string
482
+ workflowId: string;
483
+ workflowTopic: string;
486
484
  };
487
485
 
488
- type FunctionSignature<T> = T extends (...args: infer A) => infer R ? (...args: A) => R : never;
486
+ type FunctionSignature<T> = T extends (...args: infer A) => infer R
487
+ ? (...args: A) => R
488
+ : never;
489
489
  type ProxyType<ACT> = {
490
490
  [K in keyof ACT]: FunctionSignature<ACT[K]>;
491
491
  };
@@ -517,22 +517,22 @@ type ActivityConfig = {
517
517
  * The proxy response object returned from the activity proxy flow
518
518
  */
519
519
  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
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;
525
525
  };
526
526
 
527
527
  /**
528
528
  * The child flow response object returned from the main flow during recursion
529
529
  */
530
530
  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
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;
536
536
  };
537
537
 
538
538
  export {
@@ -543,7 +543,7 @@ export {
543
543
  ContextType,
544
544
  ConnectionConfig,
545
545
  Connection,
546
- ProxyResponseType,
546
+ ProxyResponseType,
547
547
  ProxyType,
548
548
  Registry,
549
549
  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
  };
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
+ }