@hotmeshio/hotmesh 0.0.54 → 0.0.56
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.
- package/README.md +0 -3
- package/build/modules/enums.js +1 -10
- package/build/modules/key.d.ts +0 -38
- package/build/modules/key.js +4 -46
- package/build/modules/utils.d.ts +0 -8
- package/build/modules/utils.js +0 -14
- package/build/package.json +11 -4
- package/build/services/activities/activity.d.ts +0 -28
- package/build/services/activities/activity.js +1 -46
- package/build/services/activities/await.js +0 -4
- package/build/services/activities/cycle.d.ts +0 -7
- package/build/services/activities/cycle.js +1 -16
- package/build/services/activities/hook.d.ts +0 -6
- package/build/services/activities/hook.js +2 -12
- package/build/services/activities/interrupt.js +0 -8
- package/build/services/activities/signal.d.ts +0 -6
- package/build/services/activities/signal.js +0 -15
- package/build/services/activities/trigger.d.ts +0 -4
- package/build/services/activities/trigger.js +1 -7
- package/build/services/activities/worker.js +0 -4
- package/build/services/collator/index.d.ts +0 -70
- package/build/services/collator/index.js +1 -91
- package/build/services/compiler/deployer.js +6 -38
- package/build/services/compiler/index.d.ts +0 -15
- package/build/services/compiler/index.js +0 -20
- package/build/services/compiler/validator.d.ts +0 -3
- package/build/services/compiler/validator.js +0 -25
- package/build/services/connector/clients/ioredis.d.ts +2 -2
- package/build/services/connector/clients/ioredis.js +0 -2
- package/build/services/connector/clients/redis.d.ts +4 -4
- package/build/services/connector/clients/redis.js +1 -3
- package/build/services/connector/index.d.ts +1 -1
- package/build/services/connector/index.js +0 -2
- package/build/services/durable/client.d.ts +1 -26
- package/build/services/durable/client.js +0 -56
- package/build/services/durable/exporter.d.ts +0 -22
- package/build/services/durable/exporter.js +1 -30
- package/build/services/durable/handle.d.ts +0 -36
- package/build/services/durable/handle.js +0 -46
- package/build/services/durable/index.d.ts +0 -4
- package/build/services/durable/index.js +0 -4
- package/build/services/durable/schemas/factory.d.ts +0 -29
- package/build/services/durable/schemas/factory.js +0 -29
- package/build/services/durable/search.d.ts +1 -36
- package/build/services/durable/search.js +57 -56
- package/build/services/durable/worker.js +2 -22
- package/build/services/durable/workflow.d.ts +0 -114
- package/build/services/durable/workflow.js +4 -144
- package/build/services/engine/index.d.ts +1 -6
- package/build/services/engine/index.js +1 -43
- package/build/services/exporter/index.d.ts +0 -27
- package/build/services/exporter/index.js +0 -33
- package/build/services/hotmesh/index.d.ts +2 -2
- package/build/services/hotmesh/index.js +1 -9
- package/build/services/logger/index.js +0 -2
- package/build/services/mapper/index.d.ts +0 -14
- package/build/services/mapper/index.js +0 -14
- package/build/services/pipe/functions/date.d.ts +0 -7
- package/build/services/pipe/functions/date.js +0 -7
- package/build/services/pipe/functions/math.js +0 -2
- package/build/services/pipe/index.d.ts +0 -15
- package/build/services/pipe/index.js +2 -23
- package/build/services/quorum/index.d.ts +0 -7
- package/build/services/quorum/index.js +0 -21
- package/build/services/reporter/index.d.ts +0 -5
- package/build/services/reporter/index.js +0 -9
- package/build/services/router/index.d.ts +0 -9
- package/build/services/router/index.js +2 -38
- package/build/services/serializer/index.js +7 -26
- package/build/services/store/cache.d.ts +0 -18
- package/build/services/store/cache.js +0 -18
- package/build/services/store/clients/ioredis.d.ts +1 -1
- package/build/services/store/clients/ioredis.js +0 -1
- package/build/services/store/clients/redis.d.ts +1 -1
- package/build/services/store/index.d.ts +0 -55
- package/build/services/store/index.js +5 -81
- package/build/services/stream/clients/ioredis.d.ts +1 -1
- package/build/services/stream/clients/ioredis.js +1 -4
- package/build/services/stream/clients/redis.d.ts +1 -1
- package/build/services/sub/clients/ioredis.d.ts +1 -1
- package/build/services/sub/clients/redis.d.ts +1 -1
- package/build/services/task/index.d.ts +0 -9
- package/build/services/task/index.js +0 -31
- package/build/services/telemetry/index.d.ts +0 -7
- package/build/services/telemetry/index.js +1 -13
- package/build/services/worker/index.d.ts +0 -4
- package/build/services/worker/index.js +2 -6
- package/build/types/activity.d.ts +0 -81
- package/build/types/durable.d.ts +25 -177
- package/build/types/exporter.d.ts +0 -13
- package/build/types/hotmesh.d.ts +4 -16
- package/build/types/hotmesh.js +0 -3
- package/build/types/index.d.ts +4 -6
- package/build/types/index.js +4 -3
- package/build/types/job.d.ts +1 -86
- package/build/types/pipe.d.ts +0 -65
- package/build/types/quorum.d.ts +15 -10
- package/build/types/redis.d.ts +225 -7
- package/build/types/redis.js +9 -0
- package/build/types/stream.d.ts +0 -58
- package/build/types/stream.js +0 -4
- package/package.json +11 -4
- package/types/durable.ts +121 -3
- package/types/hotmesh.ts +3 -6
- package/types/index.ts +23 -10
- package/types/job.ts +1 -1
- package/types/quorum.ts +22 -0
- package/types/redis.ts +267 -18
- package/build/types/ioredisclient.d.ts +0 -5
- package/build/types/ioredisclient.js +0 -5
- package/build/types/redisclient.d.ts +0 -26
- package/build/types/redisclient.js +0 -2
- package/modules/enums.ts +0 -62
- package/modules/errors.ts +0 -280
- package/modules/key.ts +0 -101
- package/modules/storage.ts +0 -3
- package/modules/utils.ts +0 -242
- package/services/activities/activity.ts +0 -589
- package/services/activities/await.ts +0 -113
- package/services/activities/cycle.ts +0 -115
- package/services/activities/hook.ts +0 -197
- package/services/activities/index.ts +0 -19
- package/services/activities/interrupt.ts +0 -172
- package/services/activities/signal.ts +0 -148
- package/services/activities/trigger.ts +0 -295
- package/services/activities/worker.ts +0 -107
- package/services/collator/README.md +0 -102
- package/services/collator/index.ts +0 -291
- package/services/compiler/deployer.ts +0 -504
- package/services/compiler/index.ts +0 -98
- package/services/compiler/validator.ts +0 -158
- package/services/connector/clients/ioredis.ts +0 -57
- package/services/connector/clients/redis.ts +0 -72
- package/services/connector/index.ts +0 -42
- package/services/durable/client.ts +0 -266
- package/services/durable/connection.ts +0 -10
- package/services/durable/exporter.ts +0 -232
- package/services/durable/handle.ts +0 -160
- package/services/durable/index.ts +0 -27
- package/services/durable/schemas/factory.ts +0 -2358
- package/services/durable/search.ts +0 -196
- package/services/durable/worker.ts +0 -401
- package/services/durable/workflow.ts +0 -557
- package/services/engine/index.ts +0 -761
- package/services/exporter/index.ts +0 -146
- package/services/hotmesh/index.ts +0 -237
- package/services/logger/index.ts +0 -79
- package/services/mapper/index.ts +0 -89
- package/services/pipe/functions/array.ts +0 -78
- package/services/pipe/functions/bitwise.ts +0 -27
- package/services/pipe/functions/conditional.ts +0 -35
- package/services/pipe/functions/date.ts +0 -220
- package/services/pipe/functions/index.ts +0 -27
- package/services/pipe/functions/json.ts +0 -11
- package/services/pipe/functions/logical.ts +0 -11
- package/services/pipe/functions/math.ts +0 -217
- package/services/pipe/functions/number.ts +0 -75
- package/services/pipe/functions/object.ts +0 -98
- package/services/pipe/functions/string.ts +0 -86
- package/services/pipe/functions/symbol.ts +0 -39
- package/services/pipe/functions/unary.ts +0 -19
- package/services/pipe/index.ts +0 -216
- package/services/quorum/index.ts +0 -319
- package/services/reporter/index.ts +0 -387
- package/services/router/index.ts +0 -426
- package/services/serializer/README.md +0 -10
- package/services/serializer/index.ts +0 -285
- package/services/store/cache.ts +0 -172
- package/services/store/clients/ioredis.ts +0 -145
- package/services/store/clients/redis.ts +0 -191
- package/services/store/index.ts +0 -1091
- package/services/stream/clients/ioredis.ts +0 -157
- package/services/stream/clients/redis.ts +0 -158
- package/services/stream/index.ts +0 -58
- package/services/sub/clients/ioredis.ts +0 -83
- package/services/sub/clients/redis.ts +0 -74
- package/services/sub/index.ts +0 -25
- package/services/task/index.ts +0 -250
- package/services/telemetry/index.ts +0 -273
- package/services/worker/index.ts +0 -248
- package/types/ioredisclient.ts +0 -10
- package/types/redisclient.ts +0 -30
|
@@ -32,18 +32,7 @@ interface Measure {
|
|
|
32
32
|
target: string;
|
|
33
33
|
}
|
|
34
34
|
interface TriggerActivityStats {
|
|
35
|
-
/**
|
|
36
|
-
* dependent parent job id; including this allows the parent's
|
|
37
|
-
* expiration/interruption events to cascade; set
|
|
38
|
-
* `expire` in the YAML for the dependent graph
|
|
39
|
-
* to 0 and provide the parent for dependent,
|
|
40
|
-
* cascading interruption and cleanup
|
|
41
|
-
*/
|
|
42
35
|
parent?: string;
|
|
43
|
-
/**
|
|
44
|
-
* adjacent parent job id; this is the actual adjacent
|
|
45
|
-
* parent in the graph, but it is not used for cascading expiration
|
|
46
|
-
*/
|
|
47
36
|
adjacent?: string;
|
|
48
37
|
id?: {
|
|
49
38
|
[key: string]: unknown;
|
|
@@ -51,19 +40,7 @@ interface TriggerActivityStats {
|
|
|
51
40
|
key?: {
|
|
52
41
|
[key: string]: unknown;
|
|
53
42
|
} | string;
|
|
54
|
-
/**
|
|
55
|
-
* @deprecated
|
|
56
|
-
* return 'infinity' to disable; default behavior
|
|
57
|
-
* is to always segment keys by time to ensure
|
|
58
|
-
* indexes (Redis LIST) never grow unbounded
|
|
59
|
-
* as a default behavior; for now, 5m is default
|
|
60
|
-
* and infinity can be set to override
|
|
61
|
-
*/
|
|
62
43
|
granularity?: string;
|
|
63
|
-
/**
|
|
64
|
-
* @deprecated
|
|
65
|
-
* what to capture
|
|
66
|
-
*/
|
|
67
44
|
measures?: Measure[];
|
|
68
45
|
}
|
|
69
46
|
interface TriggerActivity extends BaseActivity {
|
|
@@ -102,84 +79,26 @@ interface SignalActivity extends BaseActivity {
|
|
|
102
79
|
}
|
|
103
80
|
interface InterruptActivity extends BaseActivity {
|
|
104
81
|
type: 'interrupt';
|
|
105
|
-
/**
|
|
106
|
-
* Optional Reason; will be used as the error `message` when thrown
|
|
107
|
-
* @default 'Job Interrupted'
|
|
108
|
-
*/
|
|
109
82
|
reason?: string;
|
|
110
|
-
/**
|
|
111
|
-
* throw JobInterrupted error upon interrupting
|
|
112
|
-
* @default true
|
|
113
|
-
*/
|
|
114
83
|
throw?: boolean;
|
|
115
|
-
/**
|
|
116
|
-
* Interrupt child/descendant jobs
|
|
117
|
-
* @default false
|
|
118
|
-
*/
|
|
119
84
|
descend?: boolean;
|
|
120
|
-
/**
|
|
121
|
-
* Target job id (if not present the current job will be targeted)
|
|
122
|
-
*/
|
|
123
85
|
target?: string;
|
|
124
|
-
/**
|
|
125
|
-
* Optional topic to publish the interrupt message (if not present the current job topic will be used
|
|
126
|
-
*/
|
|
127
86
|
topic?: string;
|
|
128
|
-
/**
|
|
129
|
-
* Optional Error Code; will be used as the error `code` when thrown
|
|
130
|
-
* @default 410
|
|
131
|
-
*/
|
|
132
87
|
code?: number;
|
|
133
|
-
/**
|
|
134
|
-
* Optional stack trace
|
|
135
|
-
*/
|
|
136
88
|
stack?: string;
|
|
137
89
|
}
|
|
138
90
|
type ActivityType = BaseActivity | TriggerActivity | AwaitActivity | WorkerActivity | InterruptActivity | HookActivity | SignalActivity | CycleActivity;
|
|
139
91
|
type ActivityData = Record<string, any>;
|
|
140
|
-
/**
|
|
141
|
-
* Type definition for activity metadata.
|
|
142
|
-
*/
|
|
143
92
|
type ActivityMetadata = {
|
|
144
|
-
/**
|
|
145
|
-
* Unique identifier for the activity.
|
|
146
|
-
*/
|
|
147
93
|
aid: string;
|
|
148
|
-
/**
|
|
149
|
-
* Type of the activity.
|
|
150
|
-
*/
|
|
151
94
|
atp: string;
|
|
152
|
-
/**
|
|
153
|
-
* Subtype of the activity.
|
|
154
|
-
*/
|
|
155
95
|
stp: string;
|
|
156
|
-
/**
|
|
157
|
-
* Timestamp when the activity was created, in GMT.
|
|
158
|
-
*/
|
|
159
96
|
ac: string;
|
|
160
|
-
/**
|
|
161
|
-
* Timestamp when the activity was last updated, in GMT.
|
|
162
|
-
*/
|
|
163
97
|
au: string;
|
|
164
|
-
/**
|
|
165
|
-
* Optional stringified JSON containing error details such as message, code, and an optional error object.
|
|
166
|
-
*/
|
|
167
98
|
err?: string;
|
|
168
|
-
/**
|
|
169
|
-
* OpenTelemetry span context for the first leg of the activity.
|
|
170
|
-
*/
|
|
171
99
|
l1s?: string;
|
|
172
|
-
/**
|
|
173
|
-
* OpenTelemetry span context for the second leg of the activity.
|
|
174
|
-
*/
|
|
175
100
|
l2s?: string;
|
|
176
|
-
/**
|
|
177
|
-
* Dimensional address, used for additional metadata.
|
|
178
|
-
*/
|
|
179
101
|
dad?: string;
|
|
180
|
-
/**
|
|
181
|
-
* Status of the activity, could be codes representing different states.
|
|
182
|
-
*/
|
|
183
102
|
as?: string;
|
|
184
103
|
};
|
|
185
104
|
type ActivityContext = {
|
package/build/types/durable.d.ts
CHANGED
|
@@ -2,215 +2,84 @@ import { LogLevel } from './logger';
|
|
|
2
2
|
import { RedisClass, RedisOptions } from './redis';
|
|
3
3
|
import { StringAnyType, StringStringType } from './serializer';
|
|
4
4
|
import { StreamData, StreamError } from './stream';
|
|
5
|
-
/**
|
|
6
|
-
* Type definition for workflow configuration.
|
|
7
|
-
*/
|
|
8
5
|
type WorkflowConfig = {
|
|
9
|
-
/**
|
|
10
|
-
* Backoff coefficient for retry mechanism.
|
|
11
|
-
* @default 10 (HMSH_DURABLE_EXP_BACKOFF)
|
|
12
|
-
*/
|
|
13
6
|
backoffCoefficient?: number;
|
|
14
|
-
/**
|
|
15
|
-
* Maximum number of attempts for retries.
|
|
16
|
-
* @default 5 (HMSH_DURABLE_MAX_ATTEMPTS)
|
|
17
|
-
*/
|
|
18
7
|
maximumAttempts?: number;
|
|
19
|
-
/**
|
|
20
|
-
* Maximum interval between retries.
|
|
21
|
-
* @default 120s (HMSH_DURABLE_MAX_INTERVAL)
|
|
22
|
-
*/
|
|
23
8
|
maximumInterval?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Whether to throw an error on final failure after retries are exhausted
|
|
26
|
-
* or return the error object as a standard response containing error-related
|
|
27
|
-
* fields like `stack`, `code`, `message`.
|
|
28
|
-
* @default true
|
|
29
|
-
*/
|
|
30
9
|
throwOnError?: boolean;
|
|
31
10
|
};
|
|
32
11
|
type WorkflowContext = {
|
|
33
|
-
/**
|
|
34
|
-
* can the workflow be retried if an error occurs
|
|
35
|
-
*/
|
|
36
12
|
canRetry: boolean;
|
|
37
13
|
COUNTER: {
|
|
38
|
-
/**
|
|
39
|
-
* the reentrant semaphore parent counter object for object reference during increment
|
|
40
|
-
*/
|
|
41
14
|
counter: number;
|
|
42
15
|
};
|
|
43
|
-
/**
|
|
44
|
-
* the reentrant semaphore, incremented in real-time as idempotent statements are re-traversed upon reentry. Indicates the current semaphore count.
|
|
45
|
-
*/
|
|
46
16
|
counter: number;
|
|
47
|
-
/**
|
|
48
|
-
* number as string for the replay cursor
|
|
49
|
-
*/
|
|
50
17
|
cursor: string;
|
|
51
|
-
/**
|
|
52
|
-
* the replay hash of name/value pairs representing prior executions
|
|
53
|
-
*/
|
|
54
18
|
replay: StringStringType;
|
|
55
|
-
/**
|
|
56
|
-
* the HotMesh App namespace. `durable` is the default.
|
|
57
|
-
*/
|
|
58
19
|
namespace: string;
|
|
59
|
-
/**
|
|
60
|
-
* holds list of interruption payloads; if list is longer than 1 when the error is thrown, a `collator` subflow will be used
|
|
61
|
-
*/
|
|
62
20
|
interruptionRegistry: any[];
|
|
63
|
-
/**
|
|
64
|
-
* entry point ancestor flow; might be the parent; will never be self
|
|
65
|
-
*/
|
|
66
21
|
originJobId: string;
|
|
67
|
-
/**
|
|
68
|
-
* the workflow/job ID
|
|
69
|
-
*/
|
|
70
22
|
workflowId: string;
|
|
71
|
-
/**
|
|
72
|
-
* the dimensional isolation for the reentrant hook, expressed in the format `0,0`, `0,1`, etc
|
|
73
|
-
*/
|
|
74
23
|
workflowDimension: string;
|
|
75
|
-
/**
|
|
76
|
-
* a concatenation of the task queue and workflow name (e.g., `${taskQueueName}-${workflowName}`)
|
|
77
|
-
*/
|
|
78
24
|
workflowTopic: string;
|
|
79
|
-
/**
|
|
80
|
-
* 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.
|
|
81
|
-
*/
|
|
82
25
|
workflowTrace: string;
|
|
83
|
-
/**
|
|
84
|
-
* 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.
|
|
85
|
-
*/
|
|
86
26
|
workflowSpan: string;
|
|
87
|
-
/**
|
|
88
|
-
* the native HotMesh message that encapsulates the arguments, metadata, and raw data for the workflow
|
|
89
|
-
*/
|
|
90
27
|
raw: StreamData;
|
|
91
28
|
};
|
|
92
29
|
type WorkflowSearchOptions = {
|
|
93
|
-
/** FT index name (myapp:myindex) */
|
|
94
30
|
index?: string;
|
|
95
|
-
/** FT prefixes (['myapp:myindex:prefix1', 'myapp:myindex:prefix2']) */
|
|
96
31
|
prefix?: string[];
|
|
97
|
-
/**
|
|
98
|
-
* Schema mapping each field to a type with an optional sortable flag
|
|
99
|
-
*/
|
|
100
32
|
schema?: Record<string, {
|
|
101
33
|
type: 'TEXT' | 'NUMERIC' | 'TAG';
|
|
102
34
|
sortable?: boolean;
|
|
35
|
+
nostem?: boolean;
|
|
36
|
+
noindex?: boolean;
|
|
37
|
+
indexed?: boolean;
|
|
38
|
+
examples?: string[];
|
|
39
|
+
nilable?: boolean;
|
|
40
|
+
primitive?: 'string' | 'number' | 'boolean' | 'array' | 'object';
|
|
41
|
+
required?: boolean;
|
|
42
|
+
enum?: string[];
|
|
43
|
+
pattern?: string;
|
|
103
44
|
}>;
|
|
104
|
-
/** Additional data as a key-value record */
|
|
105
45
|
data?: StringStringType;
|
|
106
46
|
};
|
|
47
|
+
type SearchResults = {
|
|
48
|
+
count: number;
|
|
49
|
+
query: string;
|
|
50
|
+
data: StringStringType[];
|
|
51
|
+
};
|
|
107
52
|
type WorkflowOptions = {
|
|
108
|
-
/**
|
|
109
|
-
* the namespace for the workflow; `durable` is the default namespace if not provided
|
|
110
|
-
*/
|
|
111
53
|
namespace?: string;
|
|
112
|
-
/**
|
|
113
|
-
* the task queue for the workflow; optional if entity is provided
|
|
114
|
-
*/
|
|
115
54
|
taskQueue?: string;
|
|
116
|
-
/**
|
|
117
|
-
* input arguments to pass in
|
|
118
|
-
*/
|
|
119
55
|
args: any[];
|
|
120
|
-
/**
|
|
121
|
-
* the job id
|
|
122
|
-
*/
|
|
123
56
|
workflowId?: string;
|
|
124
|
-
/**
|
|
125
|
-
* if invoking a workflow, passing 'entity' will apply the value as the workflowName, taskQueue, and prefix, ensuring the FT.SEARCH index is properly scoped. This is a convenience method but limits options.
|
|
126
|
-
*/
|
|
127
57
|
entity?: string;
|
|
128
|
-
/**
|
|
129
|
-
* the name of the user's workflow function; optional if 'entity' is provided
|
|
130
|
-
*/
|
|
131
58
|
workflowName?: string;
|
|
132
|
-
/**
|
|
133
|
-
* the parent workflow id; adjacent ancestor ID
|
|
134
|
-
*/
|
|
135
59
|
parentWorkflowId?: string;
|
|
136
|
-
/**
|
|
137
|
-
* the entry point workflow id
|
|
138
|
-
*/
|
|
139
60
|
originJobId?: string;
|
|
140
|
-
/**
|
|
141
|
-
* OpenTelemetry trace context for the workflow
|
|
142
|
-
*/
|
|
143
61
|
workflowTrace?: string;
|
|
144
|
-
/**
|
|
145
|
-
* OpenTelemetry span context for the workflow
|
|
146
|
-
*/
|
|
147
62
|
workflowSpan?: string;
|
|
148
|
-
/**
|
|
149
|
-
* the full-text-search (RediSearch) options for the workflow
|
|
150
|
-
*/
|
|
151
63
|
search?: WorkflowSearchOptions;
|
|
152
|
-
/**
|
|
153
|
-
* marker data (begins with a -)
|
|
154
|
-
*/
|
|
155
64
|
marker?: StringStringType;
|
|
156
|
-
/**
|
|
157
|
-
* the workflow configuration object
|
|
158
|
-
*/
|
|
159
65
|
config?: WorkflowConfig;
|
|
160
|
-
/**
|
|
161
|
-
* 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.
|
|
162
|
-
*/
|
|
163
66
|
expire?: number;
|
|
164
|
-
/**
|
|
165
|
-
* default is true; if false, will not await the execution
|
|
166
|
-
*/
|
|
167
67
|
await?: boolean;
|
|
168
68
|
};
|
|
169
|
-
/**
|
|
170
|
-
* Options for setting up a hook.
|
|
171
|
-
* 'durable' is the default namespace if not provided; similar to setting `appid` in the YAML
|
|
172
|
-
*/
|
|
173
69
|
type HookOptions = {
|
|
174
|
-
/** Optional namespace under which the hook function will be grouped */
|
|
175
70
|
namespace?: string;
|
|
176
|
-
/** Optional task queue, needed unless 'entity' is provided */
|
|
177
71
|
taskQueue?: string;
|
|
178
|
-
/** Input arguments to pass into the hook */
|
|
179
72
|
args: any[];
|
|
180
|
-
/**
|
|
181
|
-
* Optional entity name. If provided, applies as the workflowName,
|
|
182
|
-
* taskQueue, and prefix. This scopes the FT.SEARCH index appropriately.
|
|
183
|
-
* This is a convenience method but limits options.
|
|
184
|
-
*/
|
|
185
73
|
entity?: string;
|
|
186
|
-
/** Execution ID, also known as the job ID to hook into */
|
|
187
74
|
workflowId?: string;
|
|
188
|
-
/** The name of the user's hook function */
|
|
189
75
|
workflowName?: string;
|
|
190
|
-
/** Bind additional search terms immediately before hook reentry */
|
|
191
76
|
search?: WorkflowSearchOptions;
|
|
192
|
-
/** Hook function constraints (backoffCoefficient, maximumAttempts, maximumInterval) */
|
|
193
77
|
config?: WorkflowConfig;
|
|
194
78
|
};
|
|
195
|
-
/**
|
|
196
|
-
* Options for sending signals in a workflow.
|
|
197
|
-
*/
|
|
198
79
|
type SignalOptions = {
|
|
199
|
-
/**
|
|
200
|
-
* Task queue associated with the workflow
|
|
201
|
-
*/
|
|
202
80
|
taskQueue: string;
|
|
203
|
-
/**
|
|
204
|
-
* Input data for the signal (any serializable object)
|
|
205
|
-
*/
|
|
206
81
|
data: StringAnyType;
|
|
207
|
-
/**
|
|
208
|
-
* Execution ID, also known as the job ID
|
|
209
|
-
*/
|
|
210
82
|
workflowId: string;
|
|
211
|
-
/**
|
|
212
|
-
* Optional name of the user's workflow function
|
|
213
|
-
*/
|
|
214
83
|
workflowName?: string;
|
|
215
84
|
};
|
|
216
85
|
type ActivityWorkflowDataType = {
|
|
@@ -228,8 +97,8 @@ type WorkflowDataType = {
|
|
|
228
97
|
canRetry?: boolean;
|
|
229
98
|
};
|
|
230
99
|
type ConnectionConfig = {
|
|
231
|
-
class: RedisClass
|
|
232
|
-
options: RedisOptions
|
|
100
|
+
class: Partial<RedisClass>;
|
|
101
|
+
options: Partial<RedisOptions>;
|
|
233
102
|
};
|
|
234
103
|
type Connection = ConnectionConfig;
|
|
235
104
|
type ClientConfig = {
|
|
@@ -239,20 +108,11 @@ type Registry = {
|
|
|
239
108
|
[key: string]: Function;
|
|
240
109
|
};
|
|
241
110
|
type WorkerConfig = {
|
|
242
|
-
/** Connection configuration for the worker */
|
|
243
111
|
connection: Connection;
|
|
244
|
-
/**
|
|
245
|
-
* Namespace used in the app configuration, denoted as `appid` in the YAML (e.g., 'durable')
|
|
246
|
-
* @default durable
|
|
247
|
-
*/
|
|
248
112
|
namespace?: string;
|
|
249
|
-
/** Task queue name, denoted as `subscribes` in the YAML (e.g., 'hello-world') */
|
|
250
113
|
taskQueue: string;
|
|
251
|
-
/** Target function or a record type with a name (string) and reference function */
|
|
252
114
|
workflow: Function | Record<string | symbol, Function>;
|
|
253
|
-
/** Additional options for configuring the worker */
|
|
254
115
|
options?: WorkerOptions;
|
|
255
|
-
/** Search options for workflow execution details */
|
|
256
116
|
search?: WorkflowSearchOptions;
|
|
257
117
|
};
|
|
258
118
|
type FindWhereQuery = {
|
|
@@ -266,6 +126,7 @@ type FindOptions = {
|
|
|
266
126
|
taskQueue?: string;
|
|
267
127
|
namespace?: string;
|
|
268
128
|
index?: string;
|
|
129
|
+
search?: WorkflowSearchOptions;
|
|
269
130
|
};
|
|
270
131
|
type FindWhereOptions = {
|
|
271
132
|
options?: FindOptions;
|
|
@@ -277,14 +138,17 @@ type FindWhereOptions = {
|
|
|
277
138
|
size: number;
|
|
278
139
|
};
|
|
279
140
|
};
|
|
141
|
+
type FindJobsOptions = {
|
|
142
|
+
match?: string;
|
|
143
|
+
namespace?: string;
|
|
144
|
+
limit?: number;
|
|
145
|
+
batch?: number;
|
|
146
|
+
cursor?: string;
|
|
147
|
+
};
|
|
280
148
|
type WorkerOptions = {
|
|
281
|
-
/** Log level: debug, info, warn, error */
|
|
282
149
|
logLevel?: LogLevel;
|
|
283
|
-
/** Maximum number of attempts, default 5 (HMSH_DURABLE_MAX_ATTEMPTS) */
|
|
284
150
|
maximumAttempts?: number;
|
|
285
|
-
/** Backoff coefficient for retry logic, default 10 (HMSH_DURABLE_EXP_BACKOFF) */
|
|
286
151
|
backoffCoefficient?: number;
|
|
287
|
-
/** Maximum interval between retries, default 120s (HMSH_DURABLE_MAX_INTERVAL) */
|
|
288
152
|
maximumInterval?: string;
|
|
289
153
|
};
|
|
290
154
|
type ContextType = {
|
|
@@ -295,29 +159,16 @@ type FunctionSignature<T> = T extends (...args: infer A) => infer R ? (...args:
|
|
|
295
159
|
type ProxyType<ACT> = {
|
|
296
160
|
[K in keyof ACT]: FunctionSignature<ACT[K]>;
|
|
297
161
|
};
|
|
298
|
-
/**
|
|
299
|
-
* Configuration settings for activities within a workflow.
|
|
300
|
-
*/
|
|
301
162
|
type ActivityConfig = {
|
|
302
|
-
/** Start to close timeout for the activity; not yet implemented */
|
|
303
163
|
startToCloseTimeout?: string;
|
|
304
|
-
/** Configuration for specific activities, type not yet specified */
|
|
305
164
|
activities?: any;
|
|
306
|
-
/** Retry policy configuration for activities */
|
|
307
165
|
retryPolicy?: {
|
|
308
|
-
/** Maximum number of retry attempts, default is 5 (HMSH_DURABLE_MAX_ATTEMPTS) */
|
|
309
166
|
maximumAttempts?: number;
|
|
310
|
-
/** Factor by which the retry timeout increases, default is 10 (HMSH_DURABLE_MAX_INTERVAL) */
|
|
311
167
|
backoffCoefficient?: number;
|
|
312
|
-
/** Maximum interval between retries, default is '120s' (HMSH_DURABLE_EXP_BACKOFF) */
|
|
313
168
|
maximumInterval?: string;
|
|
314
|
-
/** Whether to throw an error on failure, default is true */
|
|
315
169
|
throwOnError?: boolean;
|
|
316
170
|
};
|
|
317
171
|
};
|
|
318
|
-
/**
|
|
319
|
-
* The proxy response object returned from the activity proxy flow
|
|
320
|
-
*/
|
|
321
172
|
type ProxyResponseType<T> = {
|
|
322
173
|
data?: T;
|
|
323
174
|
$error?: StreamError;
|
|
@@ -325,9 +176,6 @@ type ProxyResponseType<T> = {
|
|
|
325
176
|
jc: string;
|
|
326
177
|
ju: string;
|
|
327
178
|
};
|
|
328
|
-
/**
|
|
329
|
-
* The child flow response object returned from the main flow during recursion
|
|
330
|
-
*/
|
|
331
179
|
type ChildResponseType<T> = {
|
|
332
180
|
data?: T;
|
|
333
181
|
$error?: StreamError;
|
|
@@ -335,4 +183,4 @@ type ChildResponseType<T> = {
|
|
|
335
183
|
jc: string;
|
|
336
184
|
ju: string;
|
|
337
185
|
};
|
|
338
|
-
export { ActivityConfig, ActivityWorkflowDataType, ChildResponseType, ClientConfig, ContextType, ConnectionConfig, Connection, ProxyResponseType, ProxyType, Registry, SignalOptions, FindOptions, FindWhereOptions, FindWhereQuery, HookOptions, WorkerConfig, WorkflowConfig, WorkerOptions, WorkflowSearchOptions, WorkflowDataType, WorkflowOptions, WorkflowContext, };
|
|
186
|
+
export { ActivityConfig, ActivityWorkflowDataType, ChildResponseType, ClientConfig, ContextType, ConnectionConfig, Connection, ProxyResponseType, ProxyType, Registry, SignalOptions, FindJobsOptions, FindOptions, FindWhereOptions, FindWhereQuery, HookOptions, SearchResults, WorkerConfig, WorkflowConfig, WorkerOptions, WorkflowSearchOptions, WorkflowDataType, WorkflowOptions, WorkflowContext, };
|
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { StringAnyType } from "./serializer";
|
|
2
2
|
export type ExportItem = [(string | null), string, any];
|
|
3
|
-
/**
|
|
4
|
-
* job export data can be large, particularly transitions the timeline
|
|
5
|
-
*/
|
|
6
3
|
export type ExportFields = 'data' | 'state' | 'status' | 'timeline' | 'transitions';
|
|
7
4
|
export interface ExportOptions {
|
|
8
|
-
/**
|
|
9
|
-
* limit the export byte size by specifying an allowlist
|
|
10
|
-
*/
|
|
11
5
|
allow?: Array<ExportFields>;
|
|
12
|
-
/**
|
|
13
|
-
* limit the export byte size by specifying a block list
|
|
14
|
-
*/
|
|
15
6
|
block?: Array<ExportFields>;
|
|
16
|
-
/**
|
|
17
|
-
* If false, do not return timeline values (like child job response, proxy activity response, etc)
|
|
18
|
-
* @default true
|
|
19
|
-
*/
|
|
20
7
|
values?: boolean;
|
|
21
8
|
}
|
|
22
9
|
export type JobAction = {
|
package/build/types/hotmesh.d.ts
CHANGED
|
@@ -4,9 +4,6 @@ import { HookRules } from './hook';
|
|
|
4
4
|
import { RedisClass, RedisClient, RedisOptions } from './redis';
|
|
5
5
|
import { StreamData, StreamDataResponse } from './stream';
|
|
6
6
|
import { LogLevel } from './logger';
|
|
7
|
-
/**
|
|
8
|
-
* the full set of entity types that are stored in the key/value store
|
|
9
|
-
*/
|
|
10
7
|
declare enum KeyType {
|
|
11
8
|
APP = "APP",
|
|
12
9
|
ENGINE_ID = "ENGINE",
|
|
@@ -28,9 +25,6 @@ declare enum KeyType {
|
|
|
28
25
|
TIME_RANGE = "TIME_RANGE",
|
|
29
26
|
WORK_ITEMS = "WORK_ITEMS"
|
|
30
27
|
}
|
|
31
|
-
/**
|
|
32
|
-
* minting keys, requires one or more of the following parameters
|
|
33
|
-
*/
|
|
34
28
|
type KeyStoreParams = {
|
|
35
29
|
appId?: string;
|
|
36
30
|
engineId?: string;
|
|
@@ -46,8 +40,8 @@ type KeyStoreParams = {
|
|
|
46
40
|
};
|
|
47
41
|
type HotMesh = typeof HotMeshService;
|
|
48
42
|
type RedisConfig = {
|
|
49
|
-
class: RedisClass
|
|
50
|
-
options: RedisOptions
|
|
43
|
+
class: Partial<RedisClass>;
|
|
44
|
+
options: Partial<RedisOptions>;
|
|
51
45
|
};
|
|
52
46
|
type HotMeshEngine = {
|
|
53
47
|
store?: RedisClient;
|
|
@@ -62,10 +56,7 @@ type HotMeshWorker = {
|
|
|
62
56
|
store?: RedisClient;
|
|
63
57
|
stream?: RedisClient;
|
|
64
58
|
sub?: RedisClient;
|
|
65
|
-
redis?:
|
|
66
|
-
class: RedisClass;
|
|
67
|
-
options: RedisOptions;
|
|
68
|
-
};
|
|
59
|
+
redis?: RedisConfig;
|
|
69
60
|
reclaimDelay?: number;
|
|
70
61
|
reclaimCount?: number;
|
|
71
62
|
callback: (payload: StreamData) => Promise<StreamDataResponse | void>;
|
|
@@ -117,7 +108,4 @@ type HotMeshApp = VersionedFields & {
|
|
|
117
108
|
type HotMeshApps = {
|
|
118
109
|
[appId: string]: HotMeshApp;
|
|
119
110
|
};
|
|
120
|
-
export { HotMesh, HotMeshEngine, RedisConfig, HotMeshWorker, HotMeshSettings, HotMeshApp,
|
|
121
|
-
HotMeshApps, //object array of all apps in the db
|
|
122
|
-
HotMeshConfig, //customer config
|
|
123
|
-
HotMeshManifest, HotMeshGraph, KeyType, KeyStoreParams, };
|
|
111
|
+
export { HotMesh, HotMeshEngine, RedisConfig, HotMeshWorker, HotMeshSettings, HotMeshApp, HotMeshApps, HotMeshConfig, HotMeshManifest, HotMeshGraph, KeyType, KeyStoreParams, };
|
package/build/types/hotmesh.js
CHANGED
package/build/types/index.d.ts
CHANGED
|
@@ -3,19 +3,17 @@ export { App, AppVID, AppTransitions, AppSubscriptions } from './app';
|
|
|
3
3
|
export { AsyncSignal } from './async';
|
|
4
4
|
export { CacheMode } from './cache';
|
|
5
5
|
export { CollationFaultType, CollationStage } from './collator';
|
|
6
|
-
export { ActivityConfig, ActivityWorkflowDataType, ChildResponseType, ClientConfig, ContextType, ConnectionConfig, Connection, ProxyResponseType, ProxyType, Registry, SignalOptions, FindOptions, FindWhereOptions, FindWhereQuery, HookOptions, WorkflowConfig, WorkerConfig, WorkerOptions, WorkflowContext, WorkflowSearchOptions, WorkflowDataType, WorkflowOptions, } from './durable';
|
|
6
|
+
export { ActivityConfig, ActivityWorkflowDataType, ChildResponseType, ClientConfig, ContextType, ConnectionConfig, Connection, ProxyResponseType, ProxyType, Registry, SignalOptions, FindJobsOptions, FindOptions, FindWhereOptions, FindWhereQuery, HookOptions, SearchResults, WorkflowConfig, WorkerConfig, WorkerOptions, WorkflowContext, WorkflowSearchOptions, WorkflowDataType, WorkflowOptions, } from './durable';
|
|
7
7
|
export { DurableChildErrorType, DurableProxyErrorType, DurableSleepErrorType, DurableWaitForAllErrorType, DurableWaitForErrorType } from "./error";
|
|
8
8
|
export { ActivityAction, DependencyExport, DurableJobExport, ExportCycles, ExportItem, ExportOptions, ExportTransitions, JobAction, JobExport, JobActionExport, JobTimeline } from './exporter';
|
|
9
9
|
export { HookCondition, HookConditions, HookGate, HookInterface, HookRule, HookRules, HookSignal } from './hook';
|
|
10
|
-
export { RedisClientType as IORedisClientType, RedisMultiType as IORedisMultiType } from './ioredisclient';
|
|
11
10
|
export { ILogger } from './logger';
|
|
12
|
-
export { JobData, JobsData, JobMetadata, JobOutput, JobState, JobStatus, PartialJobState
|
|
11
|
+
export { ExtensionType, JobCompletionOptions, JobData, JobsData, JobInterruptOptions, JobMetadata, JobOutput, JobState, JobStatus, PartialJobState } from './job';
|
|
13
12
|
export { MappingStatements } from './map';
|
|
14
13
|
export { Pipe, PipeContext, PipeItem, PipeItems, PipeObject, ReduceObject } from './pipe';
|
|
15
14
|
export { HotMesh, HotMeshApp, HotMeshApps, HotMeshConfig, HotMeshEngine, RedisConfig, HotMeshGraph, HotMeshManifest, HotMeshSettings, HotMeshWorker, KeyStoreParams, KeyType } from './hotmesh';
|
|
16
|
-
export { ActivateMessage, CronMessage, JobMessage, JobMessageCallback, PingMessage, PongMessage, QuorumMessage, QuorumMessageCallback, QuorumProfile, RollCallMessage, SubscriptionCallback, SystemHealth, ThrottleMessage, ThrottleOptions, WorkMessage } from './quorum';
|
|
17
|
-
export {
|
|
18
|
-
export { RedisClientType, RedisMultiType } from './redisclient';
|
|
15
|
+
export { ActivateMessage, CronMessage, JobMessage, JobMessageCallback, PingMessage, PongMessage, QuorumMessage, QuorumMessageCallback, QuorumProfile, RollCallMessage, RollCallOptions, SubscriptionCallback, SubscriptionOptions, SystemHealth, ThrottleMessage, ThrottleOptions, WorkMessage } from './quorum';
|
|
16
|
+
export { RedisClass, RedisRedisClientType, RedisRedisClientOptions, RedisRedisClassType, IORedisClientType, RedisClient, RedisMulti, RedisRedisMultiType, IORedisClientOptions, IORedisClassType, IORedisMultiType, RedisOptions, MultiResponseFlags, isRedisClient, isIORedisClient, } from './redis';
|
|
19
17
|
export { JSONSchema, StringAnyType, StringScalarType, StringStringType, SymbolMap, SymbolMaps, SymbolRanges, Symbols, SymbolSets } from './serializer';
|
|
20
18
|
export { AggregatedData, CountByFacet, GetStatsOptions, IdsData, Measure, MeasureIds, MetricTypes, StatType, StatsType, IdsResponse, JobStats, JobStatsInput, JobStatsRange, StatsResponse, Segment, TimeSegment } from './stats';
|
|
21
19
|
export { ReclaimedMessageType, StreamCode, StreamConfig, StreamData, StreamDataType, StreamError, StreamDataResponse, StreamRetryPolicy, StreamRole, StreamStatus } from './stream';
|
package/build/types/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValueType = exports.trace = exports.SpanKind = exports.SpanStatusCode = exports.propagation = exports.metrics = exports.context = exports.StreamStatus = exports.StreamRole = exports.StreamDataType = exports.
|
|
3
|
+
exports.ValueType = exports.trace = exports.SpanKind = exports.SpanStatusCode = exports.propagation = exports.metrics = exports.context = exports.StreamStatus = exports.StreamRole = exports.StreamDataType = exports.isIORedisClient = exports.isRedisClient = exports.KeyType = exports.HookGate = exports.CollationFaultType = void 0;
|
|
4
4
|
var collator_1 = require("./collator");
|
|
5
5
|
Object.defineProperty(exports, "CollationFaultType", { enumerable: true, get: function () { return collator_1.CollationFaultType; } });
|
|
6
6
|
var hook_1 = require("./hook");
|
|
7
7
|
Object.defineProperty(exports, "HookGate", { enumerable: true, get: function () { return hook_1.HookGate; } });
|
|
8
|
-
var ioredisclient_1 = require("./ioredisclient");
|
|
9
|
-
Object.defineProperty(exports, "IORedisClientType", { enumerable: true, get: function () { return ioredisclient_1.RedisClientType; } });
|
|
10
8
|
var hotmesh_1 = require("./hotmesh");
|
|
11
9
|
Object.defineProperty(exports, "KeyType", { enumerable: true, get: function () { return hotmesh_1.KeyType; } });
|
|
10
|
+
var redis_1 = require("./redis");
|
|
11
|
+
Object.defineProperty(exports, "isRedisClient", { enumerable: true, get: function () { return redis_1.isRedisClient; } });
|
|
12
|
+
Object.defineProperty(exports, "isIORedisClient", { enumerable: true, get: function () { return redis_1.isIORedisClient; } });
|
|
12
13
|
var stream_1 = require("./stream");
|
|
13
14
|
Object.defineProperty(exports, "StreamDataType", { enumerable: true, get: function () { return stream_1.StreamDataType; } });
|
|
14
15
|
Object.defineProperty(exports, "StreamRole", { enumerable: true, get: function () { return stream_1.StreamRole; } });
|