@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/meshdata.ts DELETED
@@ -1,278 +0,0 @@
1
- import { HookOptions, WorkflowConfig, WorkflowSearchOptions } from './meshflow';
2
- import { StringStringType } from './serializer';
3
-
4
- export type CallOptions = {
5
- /**
6
- * if provided along with a `ttl`, the function will be cached
7
- */
8
- id?: string;
9
- /**
10
- * in format '1 minute', '5 minutes', '1 hour', 'infinity', etc
11
- */
12
- ttl?: string;
13
- /**
14
- * full GUID (including prefix)
15
- */
16
- $guid?: string;
17
- /**
18
- * exec, hook, proxy
19
- */
20
- $type?: string;
21
- /**
22
- * if set to false explicitly it will not await the result
23
- */
24
- await?: boolean;
25
- /**
26
- * taskQueue for the workflowId (defaults to entity)
27
- */
28
- taskQueue?: string;
29
- /**
30
- * defaults to `entity` input parameter; allows override of the workflowId prefix
31
- */
32
- prefix?: string;
33
- search?: WorkflowSearchOptions;
34
- /**
35
- * list of state field names to return (this is NOT the final response)
36
- */
37
- fields?: string[];
38
- /**
39
- * namespace for the the execution client
40
- * @default 'meshflow'
41
- */
42
- namespace?: string;
43
-
44
- /**
45
- * Custom marker data field used for adding a searchable marker to the job.
46
- * markers always begin with a dash (-). Any field that does not
47
- * begin with a dash will be removed and will not be inserted with
48
- * the initial data set.
49
- */
50
- marker?: StringStringType;
51
-
52
- /**
53
- * If provided, the job will initialize in an pending state, reserving
54
- * only the job ID (HSETNX) and persisting search and marker (if provided).
55
- * If a `resume` signal is sent before the specified number of seconds,
56
- * the job will resume as normal. If the job is not resumed within the
57
- * number of seconds provided, the job will be scrubbed. No dependencies
58
- * are set for a job in a pending state; however, dependencies will be
59
- * added after the job is resumed if necessary.
60
- */
61
- pending?: number;
62
-
63
- //flush?: boolean;
64
- };
65
-
66
- export type ConnectOptions = {
67
- /**
68
- * the task queue for the connected function for greater specificity
69
- */
70
- taskQueue?: string;
71
- /**
72
- * prefix for the workflowId (defaults to entity value if not provided)
73
- */
74
- prefix?: string;
75
- /**
76
- * optional namespace for the the worker
77
- * @default 'meshflow'
78
- */
79
- namespace?: string;
80
- /**
81
- * extended worker options
82
- */
83
- options?: WorkerOptions;
84
- /**
85
- * optional search configuration
86
- */
87
- search?: WorkflowSearchOptions;
88
- };
89
-
90
- /**
91
- * Connect a function to the operational data layer.
92
- * @template T - the return type of the connected function
93
- */
94
- export type ConnectionInput<T> = {
95
- /**
96
- * The connected function's entity identifier
97
- *
98
- * @example
99
- * user
100
- */
101
- entity: string;
102
- /**
103
- * The target function reference
104
- *
105
- * @example
106
- * function() { return "hello world" }
107
- */
108
- target: (...args: any[]) => T;
109
- /**
110
- * Extended connection options (e.g., ttl, taskQueue)
111
- * @example
112
- * { ttl: 'infinity' }
113
- */
114
- options?: ConnectOptions;
115
- };
116
-
117
- /**
118
- * Executes a remote function by its global entity identifier with specified arguments.
119
- * If options.ttl is infinity, the function will be cached indefinitely and can only be
120
- * removed by calling `flush`. During this time, the function will remain active and can
121
- * its state can be augmented by calling `set`, `incr`, `del`, etc OR by calling a
122
- * transactional 'hook' function.
123
- *
124
- * @template T The expected return type of the remote function.
125
- */
126
- export type ExecInput = {
127
- /**
128
- * the connected function's entity identifier
129
- * @example
130
- * user
131
- */
132
- entity: string;
133
- /**
134
- * the function's input arguments
135
- * @example
136
- * ['Jane', 'Doe']
137
- */
138
- args: any[];
139
- /**
140
- * Extended options for the hook function, like specifying a taskQueue or ttl
141
- * @example
142
- * { ttl: '5 minutes' }
143
- */
144
- options?: Partial<MeshDataWorkflowOptions>;
145
- };
146
-
147
- /**
148
- * Hook function inputs. Hooks augment running jobs.
149
- */
150
- export type HookInput = {
151
- /**
152
- * The target function's entity identifier
153
- * @example 'user'
154
- */
155
- entity: string;
156
- /**
157
- * The target execution id (workflowId/jobId)
158
- * @example 'jsmith123'
159
- */
160
- id: string;
161
- /**
162
- * The hook function's entity identifier
163
- * @example 'user.notify'
164
- */
165
- hookEntity: string;
166
- /**
167
- * The hook function's input arguments
168
- * @example 'notify'
169
- */
170
- hookArgs: any[];
171
- /**
172
- * Extended options for the hook function, like specifying a taskQueue
173
- * @example { taskQueue: 'priority' }
174
- */
175
- options?: Partial<HookOptions>;
176
- };
177
-
178
- export type MeshDataWorkflowOptions = {
179
- /**
180
- * The app deployment namespace
181
- */
182
- namespace?: string;
183
-
184
- /**
185
- * Target connected functions more specifically by taskQueue
186
- */
187
- taskQueue?: string;
188
-
189
- /**
190
- * The connected function's entity identifier
191
- */
192
- prefix?: string;
193
-
194
- /**
195
- * The function execution id (shorthand for workflowId)
196
- */
197
- id?: string;
198
-
199
- /**
200
- * The function execution id
201
- */
202
- workflowId?: string;
203
-
204
- /**
205
- * The function name (`entity` is a shorthand for this)
206
- */
207
- workflowName?: string;
208
-
209
- /**
210
- * The open telemetry trace context for the workflow, used for logging and tracing. If a sink is enabled, this will be sent to the sink.
211
- */
212
- workflowTrace?: string;
213
-
214
- /**
215
- * The open telemetry span context for the workflow, used for logging and tracing. If a sink is enabled, this will be sent to the sink.
216
- */
217
- workflowSpan?: string;
218
-
219
- /**
220
- * Search fields to seed function state when it first initializes
221
- */
222
- search?: WorkflowSearchOptions;
223
-
224
- /**
225
- * Extended execution options
226
- */
227
- config?: WorkflowConfig;
228
-
229
- /**
230
- * Set to 'infinity', '1 minute', '1 hour', etc
231
- */
232
- ttl?: string;
233
-
234
- /**
235
- * If set to false explicitly it will not await the result
236
- * @default true
237
- */
238
- await?: boolean;
239
-
240
- /**
241
- * Custom marker data field used for adding a searchable marker to the job.
242
- * markers always begin with a dash (-). Any field that does not
243
- * begin with a dash will be removed and will not be inserted with
244
- * the initial data set.
245
- */
246
- marker?: StringStringType;
247
-
248
- /**
249
- * If provided, the job will initialize in a pending state, reserving
250
- * only the job ID (HSETNX) and persisting search and marker (if provided).
251
- * If a `resume` signal is sent before the specified number of seconds,
252
- * the job will resume as normal. If the job is not resumed within the
253
- * number of seconds provided, the job will be scrubbed. No dependencies
254
- * are set for a job in a pending state; however, dependencies will be
255
- * added after the job is resumed (if necessary).
256
- */
257
- pending?: number;
258
-
259
- /**
260
- * sets the number of seconds a workflow may exist after completion. As the process engine is an in-memory cache, the default policy is to expire and scrub the job hash as soon as it completes.
261
- * @default 1
262
- */
263
- expire?: number;
264
-
265
- /**
266
- * set to false to optimize workflows that do not require a `signal in`.
267
- * explicitly set to true to force the workflow to remain open and persistent.
268
- * @default true
269
- */
270
- signalIn?: boolean;
271
-
272
- /**
273
- * set to `true` by the system when a workflow is started with a ttl, ensuring
274
- * that the workflow will remain active until the ttl expires and the workflow
275
- * is scrubbed. This is a system flag and should not be set by the user.
276
- */
277
- persistent?: boolean;
278
- };