@hotmeshio/hotmesh 0.0.52 → 0.0.53

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 (126) hide show
  1. package/README.md +22 -18
  2. package/build/index.d.ts +1 -2
  3. package/build/index.js +1 -3
  4. package/build/modules/enums.d.ts +8 -3
  5. package/build/modules/enums.js +16 -8
  6. package/build/modules/errors.d.ts +98 -18
  7. package/build/modules/errors.js +90 -33
  8. package/build/package.json +7 -2
  9. package/build/services/activities/activity.d.ts +8 -0
  10. package/build/services/activities/activity.js +63 -14
  11. package/build/services/activities/await.js +6 -6
  12. package/build/services/activities/cycle.d.ts +2 -2
  13. package/build/services/activities/cycle.js +5 -5
  14. package/build/services/activities/hook.js +4 -4
  15. package/build/services/activities/interrupt.d.ts +3 -3
  16. package/build/services/activities/interrupt.js +15 -6
  17. package/build/services/activities/signal.d.ts +2 -2
  18. package/build/services/activities/signal.js +4 -4
  19. package/build/services/activities/trigger.js +12 -3
  20. package/build/services/activities/worker.js +6 -6
  21. package/build/services/compiler/deployer.js +33 -5
  22. package/build/services/compiler/validator.d.ts +2 -0
  23. package/build/services/compiler/validator.js +5 -1
  24. package/build/services/durable/client.d.ts +7 -1
  25. package/build/services/durable/client.js +56 -30
  26. package/build/services/durable/exporter.d.ts +7 -72
  27. package/build/services/durable/exporter.js +105 -295
  28. package/build/services/durable/handle.d.ts +11 -6
  29. package/build/services/durable/handle.js +59 -46
  30. package/build/services/durable/index.d.ts +0 -2
  31. package/build/services/durable/index.js +0 -2
  32. package/build/services/durable/schemas/factory.d.ts +33 -0
  33. package/build/services/durable/schemas/factory.js +2356 -0
  34. package/build/services/durable/search.js +8 -8
  35. package/build/services/durable/worker.js +117 -25
  36. package/build/services/durable/workflow.d.ts +46 -43
  37. package/build/services/durable/workflow.js +273 -277
  38. package/build/services/engine/index.js +3 -0
  39. package/build/services/exporter/index.d.ts +2 -4
  40. package/build/services/exporter/index.js +4 -5
  41. package/build/services/mapper/index.d.ts +6 -2
  42. package/build/services/mapper/index.js +6 -2
  43. package/build/services/pipe/functions/array.d.ts +2 -10
  44. package/build/services/pipe/functions/array.js +30 -28
  45. package/build/services/pipe/functions/conditional.d.ts +1 -0
  46. package/build/services/pipe/functions/conditional.js +3 -0
  47. package/build/services/pipe/functions/date.d.ts +1 -0
  48. package/build/services/pipe/functions/date.js +4 -0
  49. package/build/services/pipe/functions/index.d.ts +2 -0
  50. package/build/services/pipe/functions/index.js +2 -0
  51. package/build/services/pipe/functions/logical.d.ts +5 -0
  52. package/build/services/pipe/functions/logical.js +12 -0
  53. package/build/services/pipe/functions/object.d.ts +3 -0
  54. package/build/services/pipe/functions/object.js +25 -7
  55. package/build/services/pipe/index.d.ts +20 -3
  56. package/build/services/pipe/index.js +82 -16
  57. package/build/services/router/index.js +14 -3
  58. package/build/services/serializer/index.d.ts +3 -2
  59. package/build/services/serializer/index.js +11 -4
  60. package/build/services/store/clients/ioredis.js +6 -6
  61. package/build/services/store/clients/redis.js +7 -7
  62. package/build/services/store/index.d.ts +2 -0
  63. package/build/services/store/index.js +4 -1
  64. package/build/services/stream/clients/ioredis.js +8 -8
  65. package/build/services/stream/clients/redis.js +1 -1
  66. package/build/types/activity.d.ts +60 -5
  67. package/build/types/durable.d.ts +168 -33
  68. package/build/types/exporter.d.ts +26 -4
  69. package/build/types/index.d.ts +2 -2
  70. package/build/types/job.d.ts +69 -5
  71. package/build/types/pipe.d.ts +81 -3
  72. package/build/types/stream.d.ts +61 -1
  73. package/build/types/stream.js +4 -0
  74. package/index.ts +1 -2
  75. package/modules/enums.ts +16 -8
  76. package/modules/errors.ts +174 -32
  77. package/package.json +7 -2
  78. package/services/activities/activity.ts +63 -14
  79. package/services/activities/await.ts +6 -6
  80. package/services/activities/cycle.ts +7 -6
  81. package/services/activities/hook.ts +4 -4
  82. package/services/activities/interrupt.ts +19 -9
  83. package/services/activities/signal.ts +6 -5
  84. package/services/activities/trigger.ts +16 -4
  85. package/services/activities/worker.ts +7 -7
  86. package/services/compiler/deployer.ts +33 -6
  87. package/services/compiler/validator.ts +7 -3
  88. package/services/durable/client.ts +47 -14
  89. package/services/durable/exporter.ts +110 -318
  90. package/services/durable/handle.ts +63 -50
  91. package/services/durable/index.ts +0 -2
  92. package/services/durable/schemas/factory.ts +2358 -0
  93. package/services/durable/search.ts +8 -8
  94. package/services/durable/worker.ts +128 -29
  95. package/services/durable/workflow.ts +304 -288
  96. package/services/engine/index.ts +4 -0
  97. package/services/exporter/index.ts +10 -12
  98. package/services/mapper/index.ts +6 -2
  99. package/services/pipe/functions/array.ts +24 -37
  100. package/services/pipe/functions/conditional.ts +4 -0
  101. package/services/pipe/functions/date.ts +6 -0
  102. package/services/pipe/functions/index.ts +7 -5
  103. package/services/pipe/functions/logical.ts +11 -0
  104. package/services/pipe/functions/object.ts +26 -7
  105. package/services/pipe/index.ts +99 -21
  106. package/services/quorum/index.ts +1 -3
  107. package/services/router/index.ts +14 -3
  108. package/services/serializer/index.ts +12 -5
  109. package/services/store/clients/ioredis.ts +6 -6
  110. package/services/store/clients/redis.ts +7 -7
  111. package/services/store/index.ts +4 -1
  112. package/services/stream/clients/ioredis.ts +8 -8
  113. package/services/stream/clients/redis.ts +1 -1
  114. package/types/activity.ts +87 -15
  115. package/types/durable.ts +246 -73
  116. package/types/exporter.ts +31 -5
  117. package/types/index.ts +6 -7
  118. package/types/job.ts +130 -36
  119. package/types/pipe.ts +84 -3
  120. package/types/stream.ts +82 -23
  121. package/build/services/durable/factory.d.ts +0 -17
  122. package/build/services/durable/factory.js +0 -817
  123. package/build/services/durable/meshos.d.ts +0 -127
  124. package/build/services/durable/meshos.js +0 -380
  125. package/services/durable/factory.ts +0 -818
  126. package/services/durable/meshos.ts +0 -441
@@ -1,817 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_COEFFICIENT = exports.APP_ID = exports.APP_VERSION = exports.getWorkflowYAML = void 0;
4
- /**
5
- * NOTE: Using `maxSystemRetries = 3` and `backoffCoefficient = 10`, errant
6
- * workflows will be retried on the following schedule (8 times in 27 hours):
7
- * => 10ms, 100ms, 1000ms, 10s, 100s, 1_000s, 10_000s, 100_000s
8
- * TODO: Max Interval, Min Interval, Initial Interval
9
- *
10
- * ERROR CODES:
11
- * 594: waitforsignal
12
- * 592: sleepFor
13
- * 596, 597, 598: fatal
14
- * 599: retry
15
- */
16
- const getWorkflowYAML = (app, version) => {
17
- return `app:
18
- id: ${app}
19
- version: '${version}'
20
- graphs:
21
- - subscribes: ${app}.execute
22
- publishes: ${app}.executed
23
- expire:
24
- '@pipe':
25
- - ['{t1.output.data.originJobId}', 0, '{t1.output.data.expire}']
26
- - ['{@conditional.ternary}']
27
-
28
- input:
29
- schema:
30
- type: object
31
- properties:
32
- parentWorkflowId:
33
- type: string
34
- originJobId:
35
- type: string
36
- workflowId:
37
- type: string
38
- arguments:
39
- type: array
40
- workflowTopic:
41
- type: string
42
- backoffCoefficient:
43
- type: number
44
- expire:
45
- type: number
46
- output:
47
- schema:
48
- type: object
49
- properties:
50
- response:
51
- type: any
52
- done:
53
- type: boolean
54
-
55
- activities:
56
- t1:
57
- title: Main Flow Trigger
58
- type: trigger
59
- stats:
60
- id: '{$self.input.data.workflowId}'
61
- key: '{$self.input.data.parentWorkflowId}'
62
- parent: '{$self.input.data.originJobId}'
63
- adjacent: '{$self.input.data.parentWorkflowId}'
64
- job:
65
- maps:
66
- done: false
67
-
68
- a1:
69
- title: Main Flow Pivot - All Cycling Descendants Point Here
70
- type: hook
71
- cycle: true
72
- output:
73
- schema:
74
- type: object
75
- properties:
76
- duration:
77
- type: number
78
- maps:
79
- duration: '{t1.output.data.backoffCoefficient}'
80
-
81
- w1:
82
- title: Main Worker - Calls Workflow Functions
83
- type: worker
84
- topic: '{t1.output.data.workflowTopic}'
85
- emit: '{$job.data.done}'
86
- retry:
87
- '599': [2]
88
- input:
89
- schema:
90
- type: object
91
- properties:
92
- workflowId:
93
- type: string
94
- originJobId:
95
- type: string
96
- arguments:
97
- type: array
98
- maps:
99
- workflowId: '{t1.output.data.workflowId}'
100
- originJobId: '{t1.output.data.originJobId}'
101
- arguments: '{t1.output.data.arguments}'
102
- output:
103
- schema:
104
- type: object
105
- properties:
106
- response:
107
- type: any
108
- 594:
109
- schema:
110
- type: object
111
- properties:
112
- index:
113
- type: number
114
- description: the index of the first signal in the array
115
- signals:
116
- type: array
117
- description: remaining signal ids
118
- items:
119
- type: object
120
- properties:
121
- signal:
122
- type: string
123
- index:
124
- type: number
125
- maps:
126
- index: '{$self.output.data.index}'
127
- signals: '{$self.output.data.signals}'
128
- 592:
129
- schema:
130
- type: object
131
- properties:
132
- duration:
133
- type: number
134
- description: sleepFor duration in seconds
135
- index:
136
- type: number
137
- description: the current index
138
- maps:
139
- duration: '{$self.output.data.duration}'
140
- index: '{$self.output.data.index}'
141
-
142
- job:
143
- maps:
144
- response: '{$self.output.data.response}'
145
- done: '{$self.output.data.done}'
146
-
147
- sig:
148
- title: Signal In - Receive signals
149
- type: hook
150
- hook:
151
- type: object
152
- properties:
153
- id:
154
- type: string
155
- arguments:
156
- type: array
157
- workflowTopic:
158
- type: string
159
- job:
160
- maps:
161
- workflowId: '{t1.output.data.workflowId}'
162
-
163
- siga1:
164
- title: Signal In Flow Pivot - Cycling Descendants Point Here
165
- type: hook
166
- cycle: true
167
- output:
168
- schema:
169
- type: object
170
- properties:
171
- duration:
172
- type: number
173
- maps:
174
- duration: '{t1.output.data.backoffCoefficient}'
175
-
176
- sigw1:
177
- title: Signal In - Worker
178
- type: worker
179
- topic: '{sig.hook.data.workflowTopic}'
180
- retry:
181
- '599': [2]
182
- input:
183
- schema:
184
- type: object
185
- properties:
186
- workflowId:
187
- type: string
188
- originJobId:
189
- type: string
190
- workflowDimension:
191
- type: string
192
- arguments:
193
- type: array
194
- maps:
195
- workflowId: '{t1.output.data.workflowId}'
196
- originJobId: '{t1.output.data.originJobId}'
197
- workflowDimension: '{sig.output.metadata.dad}'
198
- arguments: '{sig.hook.data.arguments}'
199
- output:
200
- schema:
201
- type: object
202
- 594:
203
- schema:
204
- type: object
205
- properties:
206
- index:
207
- type: number
208
- description: the index of the first signal in the array
209
- signals:
210
- type: array
211
- description: remaining signal ids
212
- items:
213
- type: object
214
- properties:
215
- signal:
216
- type: string
217
- index:
218
- type: number
219
- maps:
220
- index: '{$self.output.data.index}'
221
- signals: '{$self.output.data.signals}'
222
- 592:
223
- schema:
224
- type: object
225
- properties:
226
- duration:
227
- type: number
228
- description: sleepFor duration in seconds
229
- index:
230
- type: number
231
- description: the current index
232
- maps:
233
- duration: '{$self.output.data.duration}'
234
- index: '{$self.output.data.index}'
235
-
236
- siga594:
237
- title: Signal In - Wait for signals
238
- type: await
239
- topic: ${app}.wfsc.execute
240
- input:
241
- schema:
242
- type: object
243
- properties:
244
- index:
245
- type: number
246
- signals:
247
- type: array
248
- description: signal ids
249
- items:
250
- type: object
251
- properties:
252
- signal:
253
- type: string
254
- index:
255
- type: number
256
- parentWorkflowId:
257
- type: string
258
- originJobId:
259
- type: string
260
- cycleWorkflowId:
261
- type: string
262
- baseWorkflowId:
263
- type: string
264
- description: index will be appended later
265
- maps:
266
- signals: '{sigw1.output.data.signals}'
267
- parentWorkflowId: '{$job.metadata.jid}'
268
- originJobId:
269
- '@pipe':
270
- - ['{t1.output.data.originJobId}', '{t1.output.data.originJobId}', '{$job.metadata.jid}']
271
- - ['{@conditional.ternary}']
272
- cycleWorkflowId:
273
- '@pipe':
274
- - ['-', '{$job.metadata.jid}', '-$wfc', '{sig.output.metadata.dad}', '-', '{sigw1.output.data.index}']
275
- - ['{@string.concat}']
276
- baseWorkflowId:
277
- '@pipe':
278
- - ['-', '{$job.metadata.jid}', '-$wfs', '{sig.output.metadata.dad}', '-']
279
- - ['{@string.concat}']
280
- output:
281
- schema:
282
- type: object
283
- properties:
284
- done:
285
- type: boolean
286
- maps:
287
- done: '{sigw1.output.data.done}'
288
-
289
- sigc594:
290
- title: Signal In - Goto Activity siga1
291
- type: cycle
292
- ancestor: siga1
293
- input:
294
- maps:
295
- duration: '{siga1.output.data.duration}'
296
-
297
- siga592:
298
- title: Signal In - Sleep For a duration and then cycle/goto
299
- type: hook
300
- sleep: '{sigw1.output.data.duration}'
301
-
302
- sigc592:
303
- title: Signal In - Goto Activity a1 after sleeping for a duration
304
- type: cycle
305
- ancestor: siga1
306
- input:
307
- maps:
308
- duration: '{siga1.output.data.duration}'
309
-
310
- siga599:
311
- title: Signal In - Sleep exponentially longer and retry
312
- type: hook
313
- sleep: '{siga1.output.data.duration}'
314
-
315
- sigc599:
316
- title: Signal In - Goto Activity siga1
317
- type: cycle
318
- ancestor: siga1
319
- input:
320
- maps:
321
- duration:
322
- '@pipe':
323
- - ['{siga1.output.data.duration}', '{t1.output.data.backoffCoefficient}']
324
- - ['{@math.multiply}']
325
-
326
- a594:
327
- title: Wait for signals
328
- type: await
329
- topic: ${app}.wfsc.execute
330
- input:
331
- schema:
332
- type: object
333
- properties:
334
- index:
335
- type: number
336
- signals:
337
- type: array
338
- description: signal ids
339
- items:
340
- type: object
341
- properties:
342
- signal:
343
- type: string
344
- index:
345
- type: number
346
- parentWorkflowId:
347
- type: string
348
- originJobId:
349
- type: string
350
- cycleWorkflowId:
351
- type: string
352
- baseWorkflowId:
353
- type: string
354
- description: index will be appended later
355
- maps:
356
- signals: '{w1.output.data.signals}'
357
- parentWorkflowId: '{$job.metadata.jid}'
358
- originJobId:
359
- '@pipe':
360
- - ['{t1.output.data.originJobId}', '{t1.output.data.originJobId}', '{$job.metadata.jid}']
361
- - ['{@conditional.ternary}']
362
- cycleWorkflowId:
363
- '@pipe':
364
- - ['-', '{$job.metadata.jid}', '-$wfc-', '{w1.output.data.index}']
365
- - ['{@string.concat}']
366
- baseWorkflowId:
367
- '@pipe':
368
- - ['-', '{$job.metadata.jid}', '-$wfs-']
369
- - ['{@string.concat}']
370
- output:
371
- schema:
372
- type: object
373
- properties:
374
- done:
375
- type: boolean
376
- maps:
377
- done: '{w1.output.data.done}'
378
-
379
- c594:
380
- title: Goto Activity a1
381
- type: cycle
382
- ancestor: a1
383
- input:
384
- maps:
385
- duration: '{a1.output.data.duration}'
386
-
387
- a592:
388
- title: Sleep For a duration and then cycle/goto
389
- type: hook
390
- sleep: '{w1.output.data.duration}'
391
-
392
- c592:
393
- title: Goto Activity a1 after sleeping for a duration
394
- type: cycle
395
- ancestor: a1
396
- input:
397
- maps:
398
- duration: '{a1.output.data.duration}'
399
-
400
- a599:
401
- title: Sleep exponentially longer before retrying
402
- type: hook
403
- sleep: '{a1.output.data.duration}'
404
-
405
- c599:
406
- title: Goto Activity a1
407
- type: cycle
408
- ancestor: a1
409
- input:
410
- maps:
411
- duration:
412
- '@pipe':
413
- - ['{a1.output.data.duration}', '{t1.output.data.backoffCoefficient}']
414
- - ['{@math.multiply}']
415
-
416
- s5:
417
- title: Close Signal In Channel
418
- type: signal
419
- subtype: one
420
- topic: ${app}.flow.signal
421
- signal:
422
- schema:
423
- type: object
424
- properties:
425
- id:
426
- type: string
427
- maps:
428
- id: '{$job.metadata.jid}'
429
-
430
- transitions:
431
- t1:
432
- - to: a1
433
- - to: sig
434
- sig:
435
- - to: siga1
436
- conditions:
437
- code: 202
438
- siga1:
439
- - to: sigw1
440
- sigw1:
441
- - to: siga594
442
- conditions:
443
- code: 594
444
- - to: siga592
445
- conditions:
446
- code: 592
447
- - to: siga599
448
- conditions:
449
- code: 599
450
- siga594:
451
- - to: sigc594
452
- siga592:
453
- - to: sigc592
454
- siga599:
455
- - to: sigc599
456
- a1:
457
- - to: w1
458
- w1:
459
- - to: a594
460
- conditions:
461
- code: 594
462
- - to: a592
463
- conditions:
464
- code: 592
465
- - to: a599
466
- conditions:
467
- code: 599
468
- - to: s5
469
- conditions:
470
- code: [200, 598, 597, 596]
471
- a594:
472
- - to: c594
473
- a592:
474
- - to: c592
475
- a599:
476
- - to: c599
477
-
478
- hooks:
479
- ${app}.flow.signal:
480
- - to: sig
481
- conditions:
482
- match:
483
- - expected: '{t1.output.data.workflowId}'
484
- actual: '{$self.hook.data.id}'
485
-
486
- - subscribes: ${app}.activity.execute
487
- publishes: ${app}.activity.executed
488
-
489
- expire: 0
490
-
491
- input:
492
- schema:
493
- type: object
494
- properties:
495
- parentWorkflowId:
496
- type: string
497
- originJobId:
498
- type: string
499
- workflowId:
500
- type: string
501
- workflowTopic:
502
- type: string
503
- activityName:
504
- type: string
505
- arguments:
506
- type: array
507
- output:
508
- schema:
509
- type: object
510
- properties:
511
- response:
512
- type: any
513
- done:
514
- type: boolean
515
-
516
- activities:
517
- t1a:
518
- title: Activity Flow Trigger
519
- type: trigger
520
- stats:
521
- id: '{$self.input.data.workflowId}'
522
- key: '{$self.input.data.parentWorkflowId}'
523
- parent: '{$self.input.data.originJobId}'
524
- adjacent: '{$self.input.data.parentWorkflowId}'
525
-
526
- w1a:
527
- title: Activity Worker - Calls Activity Functions
528
- type: worker
529
- topic: '{t1a.output.data.workflowTopic}'
530
- input:
531
- schema:
532
- type: object
533
- properties:
534
- parentWorkflowId:
535
- type: string
536
- workflowId:
537
- type: string
538
- workflowTopic:
539
- type: string
540
- activityName:
541
- type: string
542
- arguments:
543
- type: array
544
- maps:
545
- parentWorkflowId: '{t1a.output.data.parentWorkflowId}'
546
- workflowId: '{t1a.output.data.workflowId}'
547
- workflowTopic: '{t1a.output.data.workflowTopic}'
548
- activityName: '{t1a.output.data.activityName}'
549
- arguments: '{t1a.output.data.arguments}'
550
- output:
551
- schema:
552
- type: object
553
- properties:
554
- response:
555
- type: any
556
- job:
557
- maps:
558
- response: '{$self.output.data.response}'
559
- done: true
560
-
561
- transitions:
562
- t1a:
563
- - to: w1a
564
-
565
- - subscribes: ${app}.wfsc.execute
566
- publishes: ${app}.wfsc.executed
567
-
568
- expire: 0
569
-
570
- input:
571
- schema:
572
- type: object
573
- properties:
574
- index:
575
- type: number
576
- signals:
577
- type: array
578
- description: signal ids
579
- items:
580
- type: object
581
- properties:
582
- signal:
583
- type: string
584
- index:
585
- type: number
586
- parentWorkflowId:
587
- type: string
588
- originJobId:
589
- type: string
590
- cycleWorkflowId:
591
- type: string
592
- baseWorkflowId:
593
- type: string
594
- description: index will be appended later
595
- output:
596
- schema:
597
- type: object
598
- properties:
599
- done:
600
- type: boolean
601
-
602
- activities:
603
- t1wc:
604
- title: Cycler workflow that creates signal workflows
605
- type: trigger
606
- stats:
607
- id: '{$self.input.data.cycleWorkflowId}'
608
- parent: '{$self.input.data.originJobId}'
609
- adjacent: '{$self.input.data.parentWorkflowId}'
610
-
611
- a1wc:
612
- title: Pivot - All Cycling Descendants Point Here
613
- type: hook
614
- cycle: true
615
- output:
616
- schema:
617
- type: object
618
- properties:
619
- targetLength:
620
- type: number
621
- targetSignal:
622
- type: object
623
- properties:
624
- signal:
625
- type: string
626
- index:
627
- type: number
628
- signals:
629
- type: array
630
- items:
631
- type: object
632
- properties:
633
- signal:
634
- type: string
635
- index:
636
- type: number
637
- maps:
638
- targetLength:
639
- '@pipe':
640
- - ['{t1wc.output.data.signals}']
641
- - ['{@array.length}']
642
- targetSignal:
643
- '@pipe':
644
- - ['{t1wc.output.data.signals}', 0]
645
- - ['{@array.get}']
646
- signals:
647
- '@pipe':
648
- - ['{t1wc.output.data.signals}', 1]
649
- - ['{@array.slice}']
650
- a2wc:
651
- title: Precalculate targetLength
652
- type: hook
653
- output:
654
- schema:
655
- type: object
656
- properties:
657
- targetLength:
658
- type: number
659
- maps:
660
- targetLength: '{a1wc.output.data.targetLength}'
661
-
662
- c1wc:
663
- title: Goto Activity a1wc - Spawn Signal children
664
- type: cycle
665
- ancestor: a1wc
666
- input:
667
- maps:
668
- targetLength:
669
- '@pipe':
670
- - ['{a1wc.output.data.signals}']
671
- - ['{@array.length}']
672
- targetSignal:
673
- '@pipe':
674
- - ['{a1wc.output.data.signals}', 0]
675
- - ['{@array.get}']
676
- signals:
677
- '@pipe':
678
- - ['{a1wc.output.data.signals}', 1]
679
- - ['{@array.slice}']
680
-
681
- a3wc:
682
- title: Call WFS workflow
683
- type: await
684
- topic: ${app}.wfs.execute
685
- input:
686
- schema:
687
- type: object
688
- properties:
689
- parentWorkflowId:
690
- type: string
691
- description: used to forge the cleanup key
692
- originJobId:
693
- type: string
694
- description: used for dependency cleanup
695
- signalId:
696
- type: string
697
- description: used to forge the custom hookid
698
- workflowId:
699
- type: string
700
- description: the baseId + index
701
- maps:
702
- parentWorkflowId: '{t1wc.output.data.parentWorkflowId}'
703
- originJobId: '{t1wc.output.data.originJobId}'
704
- signalId: '{a1wc.output.data.targetSignal.signal}'
705
- workflowId:
706
- '@pipe':
707
- - ['{t1wc.output.data.baseWorkflowId}', '{a1wc.output.data.targetSignal.index}']
708
- - ['{@string.concat}']
709
- output:
710
- schema:
711
- type: object
712
- properties:
713
- done:
714
- type: boolean
715
- maps:
716
- done: '{w1.output.data.done}'
717
-
718
- transitions:
719
- t1wc:
720
- - to: a1wc
721
- a1wc:
722
- - to: a2wc
723
- a2wc:
724
- - to: c1wc
725
- conditions:
726
- match:
727
- - expected: true
728
- actual:
729
- '@pipe':
730
- - ['{a1wc.output.data.targetLength}', 0]
731
- - ['{@conditional.greater_than}']
732
- - to: a3wc
733
- conditions:
734
- match:
735
- - expected: true
736
- actual:
737
- '@pipe':
738
- - ['{a1wc.output.data.targetLength}', 0]
739
- - ['{@conditional.greater_than}']
740
-
741
- - subscribes: ${app}.wfs.execute
742
- publishes: ${app}.wfs.executed
743
-
744
- expire: 0
745
-
746
- input:
747
- schema:
748
- type: object
749
- properties:
750
- parentWorkflowId:
751
- type: string
752
- description: used to forge the cleanup key
753
- originJobId:
754
- type: string
755
- description: used for dependency cleanup
756
- workflowId:
757
- type: string
758
- description: used to forge the cleanup hookid
759
- signalId:
760
- type: string
761
- description: used to forge the custom hookid
762
- output:
763
- schema:
764
- type: object
765
- properties:
766
- done:
767
- type: boolean
768
- workflowId:
769
- type: string
770
- signalData:
771
- type: object
772
-
773
- activities:
774
- t1ww:
775
- title: WFS - Wait For Signal Trigger
776
- type: trigger
777
- stats:
778
- id: '{$self.input.data.workflowId}'
779
- key: '{$self.input.data.parentWorkflowId}'
780
- parent: '{$self.input.data.originJobId}'
781
- adjacent: '{$self.input.data.parentWorkflowId}'
782
-
783
- a1ww:
784
- title: WFS - signal entry point
785
- type: hook
786
- hook:
787
- type: object
788
- properties:
789
- signalData:
790
- type: object
791
- job:
792
- maps:
793
- signalData: '{$self.hook.data}'
794
- workflowId: '{t1ww.output.data.workflowId}'
795
- signalId: '{t1ww.output.data.signalId}'
796
- done: true
797
-
798
- transitions:
799
- t1ww:
800
- - to: a1ww
801
-
802
- hooks:
803
- ${app}.wfs.signal:
804
- - to: a1ww
805
- conditions:
806
- match:
807
- - expected: '{t1ww.output.data.signalId}'
808
- actual: '{$self.hook.data.id}'
809
- `;
810
- };
811
- exports.getWorkflowYAML = getWorkflowYAML;
812
- const APP_VERSION = '1';
813
- exports.APP_VERSION = APP_VERSION;
814
- const APP_ID = 'durable';
815
- exports.APP_ID = APP_ID;
816
- const DEFAULT_COEFFICIENT = 10;
817
- exports.DEFAULT_COEFFICIENT = DEFAULT_COEFFICIENT;