@hotmeshio/hotmesh 0.0.19 → 0.0.21
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 +4 -4
- package/build/modules/errors.d.ts +2 -1
- package/build/modules/errors.js +2 -1
- package/build/package.json +2 -1
- package/build/services/activities/activity.d.ts +2 -2
- package/build/services/activities/activity.js +10 -8
- package/build/services/activities/hook.d.ts +2 -1
- package/build/services/activities/hook.js +12 -9
- package/build/services/activities/signal.d.ts +4 -0
- package/build/services/activities/signal.js +16 -2
- package/build/services/durable/client.d.ts +15 -5
- package/build/services/durable/client.js +37 -14
- package/build/services/durable/factory.d.ts +2 -16
- package/build/services/durable/factory.js +276 -46
- package/build/services/durable/handle.d.ts +1 -1
- package/build/services/durable/handle.js +18 -5
- package/build/services/durable/search.d.ts +8 -1
- package/build/services/durable/search.js +36 -10
- package/build/services/durable/worker.d.ts +7 -9
- package/build/services/durable/worker.js +29 -23
- package/build/services/durable/workflow.d.ts +23 -2
- package/build/services/durable/workflow.js +143 -37
- package/build/services/engine/index.d.ts +2 -2
- package/build/services/engine/index.js +7 -12
- package/build/services/hotmesh/index.d.ts +2 -2
- package/build/services/hotmesh/index.js +2 -2
- package/build/services/signaler/store.d.ts +2 -2
- package/build/services/signaler/store.js +17 -7
- package/build/services/signaler/stream.js +1 -0
- package/build/services/store/clients/redis.js +1 -1
- package/build/services/store/index.js +3 -0
- package/build/services/telemetry/index.js +7 -1
- package/build/types/activity.d.ts +5 -3
- package/build/types/durable.d.ts +13 -2
- package/build/types/hook.d.ts +0 -1
- package/build/types/index.d.ts +1 -1
- package/modules/errors.ts +4 -2
- package/package.json +2 -1
- package/services/activities/activity.ts +10 -8
- package/services/activities/hook.ts +13 -10
- package/services/activities/signal.ts +17 -3
- package/services/durable/client.ts +40 -15
- package/services/durable/factory.ts +274 -46
- package/services/durable/handle.ts +18 -5
- package/services/durable/search.ts +38 -10
- package/services/durable/worker.ts +30 -24
- package/services/durable/workflow.ts +158 -40
- package/services/engine/index.ts +8 -12
- package/services/hotmesh/index.ts +3 -3
- package/services/signaler/store.ts +18 -8
- package/services/signaler/stream.ts +1 -0
- package/services/store/clients/redis.ts +1 -1
- package/services/store/index.ts +2 -0
- package/services/telemetry/index.ts +6 -1
- package/types/activity.ts +10 -8
- package/types/durable.ts +14 -1
- package/types/hook.ts +0 -1
- package/types/index.ts +1 -0
package/types/activity.ts
CHANGED
|
@@ -70,14 +70,16 @@ interface HookActivity extends BaseActivity {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
interface SignalActivity extends BaseActivity {
|
|
73
|
-
type: 'signal';
|
|
74
|
-
subtype: 'one' | 'all';
|
|
75
|
-
topic: string;
|
|
76
|
-
key_name
|
|
77
|
-
key_value
|
|
78
|
-
scrub
|
|
79
|
-
signal?: Record<string, any>; //used to define/map the signal input data
|
|
80
|
-
resolver?: Record<string, any>; //used to define/map the signal key resolver
|
|
73
|
+
type: 'signal'; //signal activities call hook/hookAll
|
|
74
|
+
subtype: 'one' | 'all'; //trigger: hook(One) or hookAll
|
|
75
|
+
topic: string; //e.g., 'hook.resume'
|
|
76
|
+
key_name?: string; //e.g., 'parent_job_id'
|
|
77
|
+
key_value?: string; //e.g., '1234567890'
|
|
78
|
+
scrub?: boolean; //if true, the index will be deleted after use
|
|
79
|
+
signal?: Record<string, any>; //used to define/map the signal input data (what to send/singnal into the job(s))
|
|
80
|
+
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)
|
|
81
|
+
status?: string; //pending, success (default), error
|
|
82
|
+
code?: number; //202, 200 (default)
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
interface IterateActivity extends BaseActivity {
|
package/types/durable.ts
CHANGED
|
@@ -15,9 +15,10 @@ type WorkflowSearchOptions = {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
type WorkflowOptions = {
|
|
18
|
+
namespace?: string; //'durable' is the default namespace if not provided; similar to setting `appid` in the YAML
|
|
18
19
|
taskQueue: string;
|
|
19
20
|
args: any[]; //input arguments to pass in
|
|
20
|
-
workflowId
|
|
21
|
+
workflowId?: string; //execution id (the job id)
|
|
21
22
|
workflowName?: string; //the name of the user's workflow function
|
|
22
23
|
parentWorkflowId?: string; //system reserved; the id of the parent; if present the flow will not self-clean until the parent that spawned it self-cleans
|
|
23
24
|
workflowTrace?: string;
|
|
@@ -26,6 +27,16 @@ type WorkflowOptions = {
|
|
|
26
27
|
config?: WorkflowConfig;
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
type HookOptions = {
|
|
31
|
+
namespace?: string; //'durable' is the default namespace if not provided; similar to setting `appid` in the YAML
|
|
32
|
+
taskQueue: string;
|
|
33
|
+
args: any[]; //input arguments to pass into the hook
|
|
34
|
+
workflowId: string; //execution id (the job id to hook into)
|
|
35
|
+
workflowName?: string; //the name of the user's hook function
|
|
36
|
+
search?: WorkflowSearchOptions //bind additional search terms immediately before hook reentry
|
|
37
|
+
config?: WorkflowConfig; //hook function constraints (backoffCoefficient, maximumAttempts, maximumInterval, initialInterval)
|
|
38
|
+
}
|
|
39
|
+
|
|
29
40
|
type SignalOptions = {
|
|
30
41
|
taskQueue: string;
|
|
31
42
|
data: Record<string, any>; //input data (any serializable object)
|
|
@@ -71,6 +82,7 @@ type WorkerConfig = {
|
|
|
71
82
|
}
|
|
72
83
|
|
|
73
84
|
type WorkerOptions = {
|
|
85
|
+
logLevel?: string; //debug, info, warn, error
|
|
74
86
|
maxSystemRetries?: number; //1-3 (10ms, 100ms, 1_000ms)
|
|
75
87
|
backoffCoefficient?: number; //2-10ish
|
|
76
88
|
}
|
|
@@ -107,6 +119,7 @@ export {
|
|
|
107
119
|
ProxyType,
|
|
108
120
|
Registry,
|
|
109
121
|
SignalOptions,
|
|
122
|
+
HookOptions,
|
|
110
123
|
WorkerConfig,
|
|
111
124
|
WorkflowConfig,
|
|
112
125
|
WorkerOptions,
|
package/types/hook.ts
CHANGED