@hotmeshio/hotmesh 0.0.52 → 0.0.54

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