@usehelical/workflows 0.0.1-alpha.12 → 0.0.1-alpha.2
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/dist/{index.d.ts → index.d.mts} +13 -2
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -0
- package/dist/{state-B89wwR8P.d.ts → state-CmpqDrnz.d.mts} +1 -13
- package/dist/workflows.d.mts +19 -0
- package/dist/workflows.mjs +7 -0
- package/dist/workflows.mjs.map +1 -0
- package/package.json +1 -3
- package/dist/chunk-WKVKC6AI.js +0 -650
- package/dist/chunk-WKVKC6AI.js.map +0 -1
- package/dist/index.js +0 -1028
- package/dist/index.js.map +0 -1
- package/dist/workflows.d.ts +0 -45
- package/dist/workflows.js +0 -334
- package/dist/workflows.js.map +0 -1
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import { W as
|
|
1
|
+
import { W as WorkflowStatus, a as WorkflowEntry, Q as QueueEntry, M as MessageDefinition, S as StateDefinition } from './state-CmpqDrnz.mjs';
|
|
2
|
+
|
|
3
|
+
interface Run<TReturn = unknown> {
|
|
4
|
+
id: string;
|
|
5
|
+
status: () => Promise<WorkflowStatus>;
|
|
6
|
+
result: () => Promise<TReturn>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type RunWorkflowOptions = {
|
|
10
|
+
timeout?: number;
|
|
11
|
+
deadline?: number;
|
|
12
|
+
};
|
|
2
13
|
|
|
3
14
|
type QueueWorkflowOptions = {
|
|
4
15
|
timeout?: number;
|
|
@@ -13,7 +24,7 @@ type CreateInstanceOptions = {
|
|
|
13
24
|
connectionString: string;
|
|
14
25
|
};
|
|
15
26
|
type CreateInstanceParams = {
|
|
16
|
-
workflows: Record<string, WorkflowEntry
|
|
27
|
+
workflows: Record<string, WorkflowEntry>;
|
|
17
28
|
queues?: Record<string, QueueEntry>;
|
|
18
29
|
options: CreateInstanceOptions;
|
|
19
30
|
};
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs","sourcesContent":[]}
|
|
@@ -34,18 +34,6 @@ declare function defineWorkflow<TArgs extends unknown[], TReturn>(fn: WorkflowFu
|
|
|
34
34
|
}): () => WorkflowDefinition<TArgs, TReturn>;
|
|
35
35
|
type WorkflowEntry<TArgs extends unknown[] = unknown[], TReturn = unknown> = () => WorkflowDefinition<TArgs, TReturn>;
|
|
36
36
|
|
|
37
|
-
interface Run<TReturn = unknown> {
|
|
38
|
-
id: string;
|
|
39
|
-
status: () => Promise<WorkflowStatus>;
|
|
40
|
-
result: () => Promise<TReturn>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
type RunWorkflowOptions = {
|
|
44
|
-
timeout?: number;
|
|
45
|
-
deadline?: number;
|
|
46
|
-
id?: string;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
37
|
type MessageDefinition<T> = {
|
|
50
38
|
name: string;
|
|
51
39
|
data?: T;
|
|
@@ -58,4 +46,4 @@ interface StateDefinition<T> {
|
|
|
58
46
|
}
|
|
59
47
|
declare function defineState<T>(name: string): StateDefinition<T>;
|
|
60
48
|
|
|
61
|
-
export { type MessageDefinition as M, type QueueEntry as Q, type
|
|
49
|
+
export { type MessageDefinition as M, type QueueEntry as Q, type StateDefinition as S, WorkflowStatus as W, type WorkflowEntry as a, type QueueDefinition as b, type QueueOptions as c, type QueueRateLimit as d, type WorkflowDefinition as e, type WorkflowFunction as f, defineMessage as g, defineQueue as h, defineState as i, defineWorkflow as j };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { M as MessageDefinition, b as QueueDefinition, Q as QueueEntry, c as QueueOptions, d as QueueRateLimit, S as StateDefinition, e as WorkflowDefinition, a as WorkflowEntry, f as WorkflowFunction, W as WorkflowStatus, g as defineMessage, h as defineQueue, i as defineState, j as defineWorkflow } from './state-CmpqDrnz.mjs';
|
|
2
|
+
|
|
3
|
+
type RetryConfig = {
|
|
4
|
+
maxRetries?: number;
|
|
5
|
+
retryDelay?: number;
|
|
6
|
+
backOffRate?: number;
|
|
7
|
+
};
|
|
8
|
+
type StepOptions = RetryConfig & {
|
|
9
|
+
name?: string;
|
|
10
|
+
};
|
|
11
|
+
type StepFunction<Args extends unknown[], R> = (...args: Args) => Promise<R> | R;
|
|
12
|
+
type StepDefinition<TArgs extends unknown[], TReturn> = {
|
|
13
|
+
fn: StepFunction<TArgs, TReturn>;
|
|
14
|
+
args: TArgs;
|
|
15
|
+
options: StepOptions;
|
|
16
|
+
};
|
|
17
|
+
declare function defineStep<TArgs extends unknown[], TReturn>(fn: StepFunction<TArgs, TReturn>, options?: StepOptions): (...args: TArgs) => StepDefinition<TArgs, TReturn>;
|
|
18
|
+
|
|
19
|
+
export { type RetryConfig, type StepDefinition, type StepFunction, defineStep };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"workflows.mjs","sourcesContent":[]}
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usehelical/workflows",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.2",
|
|
4
4
|
"description": "simple typesage durable workflows without magic",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
|
-
"type": "module",
|
|
7
6
|
"types": "./dist/index.d.ts",
|
|
8
7
|
"exports": {
|
|
9
8
|
".": {
|
|
@@ -40,7 +39,6 @@
|
|
|
40
39
|
"devDependencies": {
|
|
41
40
|
"@electric-sql/pglite": "^0.3.15",
|
|
42
41
|
"@eslint/js": "^9.39.2",
|
|
43
|
-
"@types/node": "^25.2.0",
|
|
44
42
|
"@types/pg": "^8.16.0",
|
|
45
43
|
"@vitest/coverage-v8": "^4.0.18",
|
|
46
44
|
"eslint": "^9.39.2",
|