@hotmeshio/hotmesh 0.3.32 → 0.4.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 (207) hide show
  1. package/README.md +128 -823
  2. package/build/index.d.ts +9 -9
  3. package/build/index.js +10 -10
  4. package/build/modules/enums.d.ts +23 -23
  5. package/build/modules/enums.js +26 -26
  6. package/build/modules/errors.d.ts +16 -16
  7. package/build/modules/errors.js +28 -28
  8. package/build/modules/key.js +190 -1
  9. package/build/modules/utils.js +374 -1
  10. package/build/package.json +22 -21
  11. package/build/services/activities/activity.js +549 -1
  12. package/build/services/activities/await.js +114 -1
  13. package/build/services/activities/cycle.js +112 -1
  14. package/build/services/activities/hook.js +168 -1
  15. package/build/services/activities/index.js +20 -1
  16. package/build/services/activities/interrupt.js +158 -1
  17. package/build/services/activities/signal.js +134 -1
  18. package/build/services/activities/trigger.js +246 -1
  19. package/build/services/activities/worker.js +106 -1
  20. package/build/services/collator/index.js +293 -1
  21. package/build/services/compiler/deployer.js +488 -1
  22. package/build/services/compiler/index.js +112 -1
  23. package/build/services/compiler/validator.js +147 -1
  24. package/build/services/engine/index.js +761 -1
  25. package/build/services/exporter/index.js +126 -1
  26. package/build/services/hotmesh/index.d.ts +160 -17
  27. package/build/services/hotmesh/index.js +160 -17
  28. package/build/services/mapper/index.js +81 -1
  29. package/build/services/{meshflow → memflow}/client.d.ts +3 -3
  30. package/build/services/{meshflow → memflow}/client.js +17 -16
  31. package/build/services/{meshflow → memflow}/connection.d.ts +2 -2
  32. package/build/services/{meshflow → memflow}/connection.js +1 -1
  33. package/build/services/memflow/context.d.ts +143 -0
  34. package/build/services/memflow/context.js +299 -0
  35. package/build/services/{meshflow → memflow}/exporter.d.ts +6 -6
  36. package/build/services/memflow/exporter.js +215 -0
  37. package/build/services/{meshflow → memflow}/handle.d.ts +4 -4
  38. package/build/services/{meshflow → memflow}/handle.js +2 -2
  39. package/build/services/{meshflow → memflow}/index.d.ts +18 -13
  40. package/build/services/{meshflow → memflow}/index.js +26 -21
  41. package/build/services/{meshflow → memflow}/schemas/factory.d.ts +4 -4
  42. package/build/services/{meshflow → memflow}/schemas/factory.js +5 -5
  43. package/build/services/{meshflow → memflow}/search.d.ts +1 -1
  44. package/build/services/{meshflow → memflow}/search.js +4 -4
  45. package/build/services/{meshflow → memflow}/worker.d.ts +5 -5
  46. package/build/services/{meshflow → memflow}/worker.js +24 -24
  47. package/build/services/memflow/workflow/common.d.ts +20 -0
  48. package/build/services/memflow/workflow/common.js +47 -0
  49. package/build/services/memflow/workflow/contextMethods.d.ts +14 -0
  50. package/build/services/memflow/workflow/contextMethods.js +33 -0
  51. package/build/services/{meshflow → memflow}/workflow/execChild.js +12 -12
  52. package/build/services/memflow/workflow/execHook.d.ts +65 -0
  53. package/build/services/memflow/workflow/execHook.js +73 -0
  54. package/build/services/{meshflow → memflow}/workflow/hook.js +19 -3
  55. package/build/services/{meshflow → memflow}/workflow/index.d.ts +7 -3
  56. package/build/services/{meshflow → memflow}/workflow/index.js +7 -3
  57. package/build/services/{meshflow → memflow}/workflow/proxyActivities.d.ts +2 -2
  58. package/build/services/{meshflow → memflow}/workflow/proxyActivities.js +8 -8
  59. package/build/services/{meshflow → memflow}/workflow/sleepFor.js +2 -2
  60. package/build/services/{meshflow → memflow}/workflow/waitFor.js +2 -2
  61. package/build/services/meshdata/index.d.ts +24 -24
  62. package/build/services/meshdata/index.js +40 -40
  63. package/build/services/pipe/functions/array.js +74 -1
  64. package/build/services/pipe/functions/bitwise.js +24 -1
  65. package/build/services/pipe/functions/conditional.js +36 -1
  66. package/build/services/pipe/functions/cron.js +40 -1
  67. package/build/services/pipe/functions/date.js +171 -1
  68. package/build/services/pipe/functions/index.js +30 -1
  69. package/build/services/pipe/functions/json.js +12 -1
  70. package/build/services/pipe/functions/logical.js +12 -1
  71. package/build/services/pipe/functions/math.js +184 -1
  72. package/build/services/pipe/functions/number.js +60 -1
  73. package/build/services/pipe/functions/object.js +81 -1
  74. package/build/services/pipe/functions/string.js +69 -1
  75. package/build/services/pipe/functions/symbol.js +33 -1
  76. package/build/services/pipe/functions/unary.js +18 -1
  77. package/build/services/pipe/index.js +242 -1
  78. package/build/services/quorum/index.js +263 -1
  79. package/build/services/reporter/index.js +348 -1
  80. package/build/services/router/config/index.d.ts +11 -0
  81. package/build/services/router/config/index.js +36 -0
  82. package/build/services/router/consumption/index.d.ts +34 -0
  83. package/build/services/router/consumption/index.js +395 -0
  84. package/build/services/router/error-handling/index.d.ts +8 -0
  85. package/build/services/router/error-handling/index.js +98 -0
  86. package/build/services/router/index.d.ts +13 -16
  87. package/build/services/router/index.js +121 -1
  88. package/build/services/router/lifecycle/index.d.ts +27 -0
  89. package/build/services/router/lifecycle/index.js +80 -0
  90. package/build/services/router/telemetry/index.d.ts +11 -0
  91. package/build/services/router/telemetry/index.js +32 -0
  92. package/build/services/router/throttling/index.d.ts +23 -0
  93. package/build/services/router/throttling/index.js +76 -0
  94. package/build/services/search/index.d.ts +2 -1
  95. package/build/services/search/providers/postgres/postgres.d.ts +2 -1
  96. package/build/services/search/providers/postgres/postgres.js +149 -1
  97. package/build/services/search/providers/redis/ioredis.d.ts +1 -0
  98. package/build/services/search/providers/redis/ioredis.js +121 -1
  99. package/build/services/search/providers/redis/redis.d.ts +1 -0
  100. package/build/services/search/providers/redis/redis.js +134 -1
  101. package/build/services/serializer/index.js +282 -1
  102. package/build/services/store/providers/postgres/kvsql.d.ts +1 -1
  103. package/build/services/store/providers/postgres/kvsql.js +198 -1
  104. package/build/services/store/providers/postgres/kvtables.js +441 -1
  105. package/build/services/store/providers/postgres/kvtransaction.js +248 -1
  106. package/build/services/store/providers/postgres/kvtypes/hash.d.ts +1 -1
  107. package/build/services/store/providers/postgres/kvtypes/hash.js +1287 -1
  108. package/build/services/store/providers/postgres/kvtypes/list.js +194 -1
  109. package/build/services/store/providers/postgres/kvtypes/string.js +115 -1
  110. package/build/services/store/providers/postgres/kvtypes/zset.js +214 -1
  111. package/build/services/store/providers/postgres/postgres.js +1036 -1
  112. package/build/services/store/providers/redis/_base.js +980 -1
  113. package/build/services/store/providers/redis/ioredis.js +180 -1
  114. package/build/services/store/providers/redis/redis.js +199 -1
  115. package/build/services/store/providers/store-initializable.js +2 -1
  116. package/build/services/stream/index.d.ts +5 -0
  117. package/build/services/stream/providers/nats/nats.d.ts +1 -0
  118. package/build/services/stream/providers/nats/nats.js +225 -1
  119. package/build/services/stream/providers/postgres/kvtables.d.ts +1 -0
  120. package/build/services/stream/providers/postgres/kvtables.js +146 -1
  121. package/build/services/stream/providers/postgres/postgres.d.ts +19 -0
  122. package/build/services/stream/providers/postgres/postgres.js +519 -1
  123. package/build/services/stream/providers/redis/ioredis.d.ts +1 -0
  124. package/build/services/stream/providers/redis/ioredis.js +272 -1
  125. package/build/services/stream/providers/redis/redis.d.ts +1 -0
  126. package/build/services/stream/providers/redis/redis.js +305 -1
  127. package/build/services/stream/providers/stream-initializable.js +2 -1
  128. package/build/services/sub/providers/nats/nats.js +105 -1
  129. package/build/services/sub/providers/postgres/postgres.js +92 -1
  130. package/build/services/sub/providers/redis/ioredis.js +81 -1
  131. package/build/services/sub/providers/redis/redis.js +72 -1
  132. package/build/services/task/index.js +206 -1
  133. package/build/services/telemetry/index.js +306 -1
  134. package/build/services/worker/index.js +197 -1
  135. package/build/types/error.d.ts +5 -5
  136. package/build/types/exporter.d.ts +1 -1
  137. package/build/types/index.d.ts +3 -3
  138. package/build/types/manifest.d.ts +2 -2
  139. package/build/types/{meshflow.d.ts → memflow.d.ts} +15 -15
  140. package/build/types/meshdata.d.ts +3 -3
  141. package/build/types/postgres.d.ts +7 -0
  142. package/build/types/stream.d.ts +3 -0
  143. package/index.ts +11 -11
  144. package/package.json +22 -21
  145. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  146. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  147. package/build/services/meshflow/exporter.js +0 -1
  148. package/build/services/meshflow/workflow/common.d.ts +0 -18
  149. package/build/services/meshflow/workflow/common.js +0 -45
  150. package/typedoc.json +0 -46
  151. package/types/activity.ts +0 -268
  152. package/types/app.ts +0 -20
  153. package/types/async.ts +0 -6
  154. package/types/cache.ts +0 -1
  155. package/types/collator.ts +0 -9
  156. package/types/error.ts +0 -56
  157. package/types/exporter.ts +0 -102
  158. package/types/hook.ts +0 -44
  159. package/types/hotmesh.ts +0 -314
  160. package/types/index.ts +0 -306
  161. package/types/job.ts +0 -233
  162. package/types/logger.ts +0 -8
  163. package/types/manifest.ts +0 -70
  164. package/types/map.ts +0 -5
  165. package/types/meshcall.ts +0 -235
  166. package/types/meshdata.ts +0 -278
  167. package/types/meshflow.ts +0 -645
  168. package/types/ms.d.ts +0 -7
  169. package/types/nats.ts +0 -270
  170. package/types/pipe.ts +0 -90
  171. package/types/postgres.ts +0 -105
  172. package/types/provider.ts +0 -161
  173. package/types/quorum.ts +0 -167
  174. package/types/redis.ts +0 -404
  175. package/types/serializer.ts +0 -40
  176. package/types/stats.ts +0 -117
  177. package/types/stream.ts +0 -227
  178. package/types/task.ts +0 -7
  179. package/types/telemetry.ts +0 -16
  180. package/types/transition.ts +0 -20
  181. /package/build/services/{meshflow → memflow}/workflow/all.d.ts +0 -0
  182. /package/build/services/{meshflow → memflow}/workflow/all.js +0 -0
  183. /package/build/services/{meshflow → memflow}/workflow/context.d.ts +0 -0
  184. /package/build/services/{meshflow → memflow}/workflow/context.js +0 -0
  185. /package/build/services/{meshflow → memflow}/workflow/didRun.d.ts +0 -0
  186. /package/build/services/{meshflow → memflow}/workflow/didRun.js +0 -0
  187. /package/build/services/{meshflow → memflow}/workflow/emit.d.ts +0 -0
  188. /package/build/services/{meshflow → memflow}/workflow/emit.js +0 -0
  189. /package/build/services/{meshflow → memflow}/workflow/enrich.d.ts +0 -0
  190. /package/build/services/{meshflow → memflow}/workflow/enrich.js +0 -0
  191. /package/build/services/{meshflow → memflow}/workflow/execChild.d.ts +0 -0
  192. /package/build/services/{meshflow → memflow}/workflow/hook.d.ts +0 -0
  193. /package/build/services/{meshflow → memflow}/workflow/interrupt.d.ts +0 -0
  194. /package/build/services/{meshflow → memflow}/workflow/interrupt.js +0 -0
  195. /package/build/services/{meshflow → memflow}/workflow/isSideEffectAllowed.d.ts +0 -0
  196. /package/build/services/{meshflow → memflow}/workflow/isSideEffectAllowed.js +0 -0
  197. /package/build/services/{meshflow → memflow}/workflow/random.d.ts +0 -0
  198. /package/build/services/{meshflow → memflow}/workflow/random.js +0 -0
  199. /package/build/services/{meshflow → memflow}/workflow/searchMethods.d.ts +0 -0
  200. /package/build/services/{meshflow → memflow}/workflow/searchMethods.js +0 -0
  201. /package/build/services/{meshflow → memflow}/workflow/signal.d.ts +0 -0
  202. /package/build/services/{meshflow → memflow}/workflow/signal.js +0 -0
  203. /package/build/services/{meshflow → memflow}/workflow/sleepFor.d.ts +0 -0
  204. /package/build/services/{meshflow → memflow}/workflow/trace.d.ts +0 -0
  205. /package/build/services/{meshflow → memflow}/workflow/trace.js +0 -0
  206. /package/build/services/{meshflow → memflow}/workflow/waitFor.d.ts +0 -0
  207. /package/build/types/{meshflow.js → memflow.js} +0 -0
package/types/activity.ts DELETED
@@ -1,268 +0,0 @@
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';
14
-
15
- type Consumes = Record<string, string[]>;
16
-
17
- interface BaseActivity {
18
- title?: string;
19
- type?: ActivityExecutionType;
20
- subtype?: string;
21
- statusThreshold?: number; //default is 0; set to 1 to ensure not last standing; message will be ignored as if too late to process
22
- statusThresholdType?: 'stop' | 'throw' | 'stall'; //default is stop; must explicitly set to throw to throw an error or stall to stall
23
- input?: Record<string, any>;
24
- output?: Record<string, any>;
25
- settings?: Record<string, any>;
26
- job?: Record<string, any>;
27
- hook?: Record<string, any>;
28
- telemetry?: Record<string, any>;
29
- emit?: boolean; //if true, the activity will emit a message to the `publishes` topic immediately before transitioning to adjacent activities
30
- sleep?: number; //@pipe /in seconds
31
- expire?: number; //-1 forever; 0 persists the flow until the parent flow that expired it is dismissed; 15 seconds is the default (copied from the YAML at compile time)
32
- persistent?: boolean; //if true, the job will persist beyond completion (copied from the YAML at compile time)
33
- persist?: boolean; //when true, the activity will emit the job completed event and start the `persistence countdown`, using the 'expire' value
34
- retry?: StreamRetryPolicy;
35
- cycle?: boolean; //if true, the `notary` will leave leg 2 open, so it can be re/cycled
36
- collationInt?: number; //compiler
37
- consumes?: Consumes; //compiler
38
- PRODUCES?: string[]; //compiler
39
- produces?: string[]; //compiler
40
- publishes?: string; //compiler
41
- subscribes?: string; //compiler
42
- trigger?: string; //compiler
43
- parent?: string; //compiler
44
- ancestors?: string[]; //compiler
45
- }
46
-
47
- interface Measure {
48
- measure: MetricTypes;
49
- target: string;
50
- }
51
-
52
- interface TriggerActivityStats {
53
- /**
54
- * dependent parent job id; including this allows the parent's
55
- * expiration/interruption events to cascade; set
56
- * `expire` in the YAML for the dependent graph
57
- * to 0 and provide the parent for dependent,
58
- * cascading interruption and cleanup
59
- */
60
- parent?: string;
61
- /**
62
- * adjacent parent job id; this is the actual adjacent
63
- * parent in the graph, but it is not used for cascading expiration
64
- */
65
- adjacent?: string;
66
- id?: { [key: string]: unknown } | string;
67
- key?: { [key: string]: unknown } | string;
68
- /**
69
- * @deprecated
70
- * return 'infinity' to disable; default behavior
71
- * is to always segment keys by time to ensure
72
- * indexes (Redis LIST) never grow unbounded
73
- * as a default behavior; for now, 5m is default
74
- * and infinity can be set to override
75
- */
76
- granularity?: string;
77
- /**
78
- * @deprecated
79
- * what to capture
80
- */
81
- measures?: Measure[];
82
- }
83
-
84
- interface TriggerActivity extends BaseActivity {
85
- type: 'trigger';
86
- stats?: TriggerActivityStats;
87
- }
88
-
89
- interface AwaitActivity extends BaseActivity {
90
- type: 'await';
91
- eventName: string;
92
- timeout: number;
93
- await?: boolean; //if exlicitly false do not await the response
94
- }
95
-
96
- interface WorkerActivity extends BaseActivity {
97
- type: 'worker';
98
- topic: string;
99
- timeout: number;
100
- }
101
-
102
- interface CycleActivity extends BaseActivity {
103
- type: 'cycle';
104
- ancestor: string; //ancestor activity id
105
- }
106
-
107
- interface HookActivity extends BaseActivity {
108
- type: 'hook';
109
- }
110
-
111
- interface SignalActivity extends BaseActivity {
112
- type: 'signal'; //signal activities call hook/hookAll
113
- subtype: 'one' | 'all'; //trigger: hook(One) or hookAll
114
- topic: string; //e.g., 'hook.resume'
115
- key_name?: string; //e.g., 'parent_job_id'
116
- key_value?: string; //e.g., '1234567890'
117
- scrub?: boolean; //if true, the index will be deleted after use
118
- signal?: Record<string, any>; //used to define/map the signal input data (what to send/singnal into the job(s))
119
- 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)
120
- status?: string; //pending, success (default), error
121
- code?: number; //202, 200 (default)
122
- }
123
-
124
- interface InterruptActivity extends BaseActivity {
125
- type: 'interrupt';
126
-
127
- /**
128
- * Optional Reason; will be used as the error `message` when thrown
129
- * @default 'Job Interrupted'
130
- */
131
- reason?: string;
132
-
133
- /**
134
- * throw JobInterrupted error upon interrupting
135
- * @default true
136
- */
137
- throw?: boolean;
138
-
139
- /**
140
- * Interrupt child/descendant jobs
141
- * @default false
142
- */
143
- descend?: boolean;
144
-
145
- /**
146
- * Target job id (if not present the current job will be targeted)
147
- */
148
- target?: string;
149
-
150
- /**
151
- * Optional topic to publish the interrupt message (if not present the current job topic will be used
152
- */
153
- topic?: string;
154
-
155
- /**
156
- * Optional Error Code; will be used as the error `code` when thrown
157
- * @default 410
158
- */
159
- code?: number;
160
-
161
- /**
162
- * Optional stack trace
163
- */
164
- stack?: string;
165
- }
166
-
167
- type ActivityType =
168
- | BaseActivity
169
- | TriggerActivity
170
- | AwaitActivity
171
- | WorkerActivity
172
- | InterruptActivity
173
- | HookActivity
174
- | SignalActivity
175
- | CycleActivity;
176
-
177
- type ActivityData = Record<string, any>;
178
-
179
- /**
180
- * Type definition for activity metadata.
181
- */
182
- type ActivityMetadata = {
183
- /**
184
- * Unique identifier for the activity.
185
- */
186
- aid: string;
187
-
188
- /**
189
- * Type of the activity.
190
- */
191
- atp: string;
192
-
193
- /**
194
- * Subtype of the activity.
195
- */
196
- stp: string;
197
-
198
- /**
199
- * Timestamp when the activity was created, in GMT.
200
- */
201
- ac: string;
202
-
203
- /**
204
- * Timestamp when the activity was last updated, in GMT.
205
- */
206
- au: string;
207
-
208
- /**
209
- * Optional stringified JSON containing error details such as message, code, and an optional error object.
210
- */
211
- err?: string;
212
-
213
- /**
214
- * OpenTelemetry span context for the first leg of the activity.
215
- */
216
- l1s?: string;
217
-
218
- /**
219
- * OpenTelemetry span context for the second leg of the activity.
220
- */
221
- l2s?: string;
222
-
223
- /**
224
- * Dimensional address, used for additional metadata.
225
- */
226
- dad?: string;
227
-
228
- /**
229
- * Status of the activity, could be codes representing different states.
230
- */
231
- as?: string;
232
- };
233
-
234
- type ActivityContext = {
235
- data?: ActivityData | null;
236
- metadata: ActivityMetadata;
237
- hook?: ActivityData;
238
- };
239
-
240
- type ActivityDuplex = 1 | 2;
241
-
242
- type ActivityDataType = {
243
- data?: Record<string, unknown>;
244
- metadata?: Record<string, unknown>;
245
- hook?: Record<string, unknown>;
246
- };
247
-
248
- type ActivityLeg = 1 | 2;
249
-
250
- export {
251
- ActivityContext,
252
- ActivityData,
253
- ActivityDataType,
254
- ActivityDuplex,
255
- ActivityLeg,
256
- ActivityMetadata,
257
- ActivityType,
258
- Consumes,
259
- TriggerActivityStats,
260
- AwaitActivity,
261
- CycleActivity,
262
- HookActivity,
263
- SignalActivity,
264
- BaseActivity,
265
- InterruptActivity,
266
- TriggerActivity,
267
- WorkerActivity,
268
- };
package/types/app.ts DELETED
@@ -1,20 +0,0 @@
1
- interface App {
2
- name: string;
3
- title: string;
4
- description: string;
5
- }
6
-
7
- type AppVID = {
8
- version: string;
9
- id: string;
10
- };
11
-
12
- type AppTransitions = {
13
- [key: string]: Record<string, unknown>;
14
- };
15
-
16
- type AppSubscriptions = {
17
- [key: string]: string;
18
- };
19
-
20
- export { App, AppVID, AppTransitions, AppSubscriptions };
package/types/async.ts DELETED
@@ -1,6 +0,0 @@
1
- type AsyncSignal = {
2
- topic: string;
3
- jobId: string;
4
- };
5
-
6
- export { AsyncSignal };
package/types/cache.ts DELETED
@@ -1 +0,0 @@
1
- export type CacheMode = 'nocache' | 'cache';
package/types/collator.ts DELETED
@@ -1,9 +0,0 @@
1
- export type CollationStage = 'enter' | 'exit' | 'confirm';
2
-
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
9
- }
package/types/error.ts DELETED
@@ -1,56 +0,0 @@
1
- export type MeshFlowChildErrorType = {
2
- arguments: string[];
3
- await?: boolean;
4
- backoffCoefficient?: number;
5
- index: number;
6
- expire?: number;
7
- persistent?: boolean;
8
- signalIn?: boolean;
9
- maximumAttempts?: number;
10
- maximumInterval?: number;
11
- originJobId: string | null;
12
- parentWorkflowId: string;
13
- workflowDimension: string;
14
- workflowId: string;
15
- workflowTopic: string;
16
- };
17
-
18
- export type MeshFlowWaitForAllErrorType = {
19
- items: string[];
20
- workflowId: string;
21
- workflowTopic: string;
22
- parentWorkflowId: string;
23
- originJobId: string | null;
24
- size: number;
25
- index: number;
26
- workflowDimension: string;
27
- };
28
-
29
- export type MeshFlowProxyErrorType = {
30
- arguments: string[];
31
- activityName: string;
32
- backoffCoefficient?: number;
33
- index: number;
34
- expire?: number;
35
- maximumAttempts?: number;
36
- maximumInterval?: number;
37
- originJobId: string | null;
38
- parentWorkflowId: string;
39
- workflowDimension: string;
40
- workflowId: string;
41
- workflowTopic: string;
42
- };
43
-
44
- export type MeshFlowWaitForErrorType = {
45
- signalId: string;
46
- index: number;
47
- workflowDimension: string;
48
- workflowId: string;
49
- };
50
-
51
- export type MeshFlowSleepErrorType = {
52
- duration: number;
53
- index: number;
54
- workflowDimension: string;
55
- workflowId: string;
56
- };
package/types/exporter.ts DELETED
@@ -1,102 +0,0 @@
1
- import { StringAnyType } from './serializer';
2
-
3
- export type ExportItem = [string | null, string, any];
4
-
5
- /**
6
- * job export data can be large, particularly transitions the timeline
7
- */
8
- export type ExportFields =
9
- | 'data'
10
- | 'state'
11
- | 'status'
12
- | 'timeline'
13
- | 'transitions';
14
-
15
- export interface ExportOptions {
16
- /**
17
- * limit the export byte size by specifying an allowlist
18
- */
19
- allow?: Array<ExportFields>;
20
-
21
- /**
22
- * limit the export byte size by specifying a block list
23
- */
24
- block?: Array<ExportFields>;
25
-
26
- /**
27
- * If false, do not return timeline values (like child job response, proxy activity response, etc)
28
- * @default true
29
- */
30
- values?: boolean;
31
- }
32
-
33
- export type JobAction = {
34
- cursor: number;
35
- items: ExportItem[];
36
- };
37
-
38
- export interface JobActionExport {
39
- hooks: {
40
- [key: string]: JobAction;
41
- };
42
- main: JobAction;
43
- }
44
-
45
- export interface ActivityAction {
46
- action: string;
47
- target: string;
48
- }
49
-
50
- export interface JobTimeline {
51
- activity: string; //activity name
52
- dimension: string; //dimensional isolate path
53
- duplex: 'entry' | 'exit'; //activity entry or exit
54
- timestamp: string; //actually a number but too many digits for JS
55
- created?: string; //actually a number but too many digits for JS
56
- updated?: string; //actually a number but too many digits for JS
57
- actions?: ActivityAction[];
58
- }
59
-
60
- export interface DependencyExport {
61
- type: string;
62
- topic: string;
63
- gid: string;
64
- jid: string;
65
- }
66
-
67
- export interface ExportTransitions {
68
- [key: string]: string[];
69
- }
70
-
71
- export interface ExportCycles {
72
- [key: string]: string[];
73
- }
74
-
75
- export type TimelineType = {
76
- key: string;
77
- value: Record<string, any> | string | number | null;
78
- index: number;
79
- secondary?: number;
80
- dimension?: string;
81
- };
82
-
83
- export interface TransitionType {
84
- activity: string;
85
- dimensions: string;
86
- created: string;
87
- updated: string;
88
- }
89
-
90
- export interface MeshFlowJobExport {
91
- data?: StringAnyType;
92
- state?: StringAnyType;
93
- status?: number;
94
- timeline?: TimelineType[];
95
- transitions?: TransitionType[];
96
- }
97
-
98
- export interface JobExport {
99
- dependencies: DependencyExport[];
100
- process: StringAnyType;
101
- status: string;
102
- }
package/types/hook.ts DELETED
@@ -1,44 +0,0 @@
1
- interface HookCondition {
2
- expected: string;
3
- actual: string;
4
- }
5
-
6
- enum HookGate {
7
- AND = 'and',
8
- OR = 'or',
9
- }
10
-
11
- interface HookConditions {
12
- gate?: HookGate;
13
- match: HookCondition[];
14
- }
15
-
16
- interface HookRule {
17
- to: string;
18
- conditions: HookConditions;
19
- }
20
-
21
- interface HookRules {
22
- [eventName: string]: HookRule[];
23
- }
24
-
25
- type HookSignal = {
26
- topic: string;
27
- resolved: string;
28
- jobId: string;
29
- expire: number;
30
- };
31
-
32
- interface HookInterface {
33
- (topic: string, data: { [key: string]: any; id: string }): Promise<void>;
34
- }
35
-
36
- export {
37
- HookCondition,
38
- HookConditions,
39
- HookGate,
40
- HookInterface,
41
- HookRule,
42
- HookRules,
43
- HookSignal,
44
- };