@workplane/types 0.3.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.
- package/dist/index.d.ts +81 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/package.json +31 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
type TaskStatus = "queued" | "assigned" | "running" | "succeeded" | "failed" | "cancelled";
|
|
2
|
+
type RunStatus = TaskStatus;
|
|
3
|
+
interface TaskRecord {
|
|
4
|
+
id: string;
|
|
5
|
+
kind: string;
|
|
6
|
+
adapter: string;
|
|
7
|
+
payload: Record<string, unknown>;
|
|
8
|
+
requires: string[];
|
|
9
|
+
status: TaskStatus;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
updatedAt: string;
|
|
12
|
+
}
|
|
13
|
+
interface RunRecord {
|
|
14
|
+
id: string;
|
|
15
|
+
taskId: string;
|
|
16
|
+
nodeId: string;
|
|
17
|
+
attempt: number;
|
|
18
|
+
status: RunStatus;
|
|
19
|
+
startedAt: string | null;
|
|
20
|
+
endedAt: string | null;
|
|
21
|
+
error: string | null;
|
|
22
|
+
}
|
|
23
|
+
interface NodeRecord {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
capabilities: string[];
|
|
27
|
+
status: "online" | "offline";
|
|
28
|
+
lastHeartbeatAt: string | null;
|
|
29
|
+
}
|
|
30
|
+
interface CreateTaskInput {
|
|
31
|
+
kind: string;
|
|
32
|
+
adapter: string;
|
|
33
|
+
payload: Record<string, unknown>;
|
|
34
|
+
requires?: string[];
|
|
35
|
+
}
|
|
36
|
+
interface RunLogInput {
|
|
37
|
+
stream: "stdout" | "stderr" | "system";
|
|
38
|
+
message: string;
|
|
39
|
+
stepName?: string;
|
|
40
|
+
}
|
|
41
|
+
interface ArtifactRecord {
|
|
42
|
+
id: string;
|
|
43
|
+
runId: string;
|
|
44
|
+
type: string;
|
|
45
|
+
name: string;
|
|
46
|
+
path: string;
|
|
47
|
+
metadata: Record<string, unknown> | null;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
}
|
|
50
|
+
interface ArtifactInput {
|
|
51
|
+
type: string;
|
|
52
|
+
name: string;
|
|
53
|
+
path: string;
|
|
54
|
+
metadata?: Record<string, unknown>;
|
|
55
|
+
}
|
|
56
|
+
type InputEventKind = "stdin" | "signal" | "resize";
|
|
57
|
+
interface RunInputEvent {
|
|
58
|
+
id: number;
|
|
59
|
+
runId: string;
|
|
60
|
+
sequence: number;
|
|
61
|
+
kind: InputEventKind;
|
|
62
|
+
payload: Record<string, unknown>;
|
|
63
|
+
createdAt: string;
|
|
64
|
+
deliveredAt: string | null;
|
|
65
|
+
}
|
|
66
|
+
interface AppendInputEventInput {
|
|
67
|
+
kind: InputEventKind;
|
|
68
|
+
payload: Record<string, unknown>;
|
|
69
|
+
}
|
|
70
|
+
interface ServerWorkflows {
|
|
71
|
+
createTask: (input: CreateTaskInput) => Promise<TaskRecord>;
|
|
72
|
+
retryTask: (taskId: string) => Promise<TaskRecord | null>;
|
|
73
|
+
cancelTask: (taskId: string) => Promise<TaskRecord | null>;
|
|
74
|
+
updateRunStatus: (runId: string, status: RunStatus, error?: string) => Promise<RunRecord | null>;
|
|
75
|
+
appendRunLogs: (runId: string, logs: RunLogInput[]) => Promise<number>;
|
|
76
|
+
createArtifact: (runId: string, input: ArtifactInput) => Promise<ArtifactRecord>;
|
|
77
|
+
appendInputEvent: (runId: string, input: AppendInputEventInput) => Promise<RunInputEvent>;
|
|
78
|
+
markInputDelivered: (runId: string, sequence: number) => Promise<void>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type { AppendInputEventInput, ArtifactInput, ArtifactRecord, CreateTaskInput, InputEventKind, NodeRecord, RunInputEvent, RunLogInput, RunRecord, RunStatus, ServerWorkflows, TaskRecord, TaskStatus };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@workplane/types",
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/MindStaq/workplane.git"
|
|
10
|
+
},
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public",
|
|
26
|
+
"registry": "https://registry.npmjs.org/"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsup"
|
|
30
|
+
}
|
|
31
|
+
}
|