@flowgram.ai/runtime-js 0.2.22 → 0.2.24

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.mts CHANGED
@@ -4,7 +4,7 @@ declare enum FlowGramAPIName {
4
4
  TaskReport = "TaskReport",
5
5
  TaskResult = "TaskResult",
6
6
  TaskCancel = "TaskCancel",
7
- Validation = "Validation"
7
+ TaskValidate = "TaskValidate"
8
8
  }
9
9
 
10
10
  /**
@@ -14,6 +14,16 @@ declare enum FlowGramAPIName {
14
14
  type WorkflowInputs = Record<string, any>;
15
15
  type WorkflowOutputs = Record<string, any>;
16
16
 
17
+ /**
18
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
19
+ * SPDX-License-Identifier: MIT
20
+ */
21
+
22
+ interface ValidationResult {
23
+ valid: boolean;
24
+ errors?: string[];
25
+ }
26
+
17
27
  /**
18
28
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
19
29
  * SPDX-License-Identifier: MIT
@@ -44,11 +54,35 @@ interface SnapshotData {
44
54
  outputs: WorkflowOutputs;
45
55
  data: any;
46
56
  branch?: string;
57
+ error?: string;
47
58
  }
48
59
  interface Snapshot extends SnapshotData {
49
60
  id: string;
50
61
  }
51
62
 
63
+ /**
64
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
65
+ * SPDX-License-Identifier: MIT
66
+ */
67
+ declare enum WorkflowMessageType {
68
+ Log = "log",
69
+ Info = "info",
70
+ Debug = "debug",
71
+ Error = "error",
72
+ Warn = "warning"
73
+ }
74
+ interface MessageData {
75
+ message: string;
76
+ nodeID?: string;
77
+ timestamp?: number;
78
+ }
79
+ interface IMessage extends MessageData {
80
+ id: string;
81
+ type: WorkflowMessageType;
82
+ timestamp: number;
83
+ }
84
+ type WorkflowMessages = Record<WorkflowMessageType, IMessage[]>;
85
+
52
86
  /**
53
87
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
54
88
  * SPDX-License-Identifier: MIT
@@ -58,12 +92,14 @@ interface NodeReport extends StatusData {
58
92
  id: string;
59
93
  snapshots: Snapshot[];
60
94
  }
95
+ type WorkflowReports = Record<string, NodeReport>;
61
96
  interface IReport {
62
97
  id: string;
63
98
  inputs: WorkflowInputs;
64
99
  outputs: WorkflowOutputs;
65
100
  workflowStatus: StatusData;
66
- reports: Record<string, NodeReport>;
101
+ reports: WorkflowReports;
102
+ messages: WorkflowMessages;
67
103
  }
68
104
 
69
105
  /**
@@ -89,6 +125,18 @@ interface TaskReportInput {
89
125
  }
90
126
  type TaskReportOutput = IReport | undefined;
91
127
 
128
+ /**
129
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
130
+ * SPDX-License-Identifier: MIT
131
+ */
132
+
133
+ interface TaskValidateInput {
134
+ inputs: WorkflowInputs;
135
+ schema: string;
136
+ }
137
+ interface TaskValidateOutput extends ValidationResult {
138
+ }
139
+
92
140
  /**
93
141
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
94
142
  * SPDX-License-Identifier: MIT
@@ -111,6 +159,13 @@ type TaskCancelOutput = {
111
159
  success: boolean;
112
160
  };
113
161
 
162
+ /**
163
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
164
+ * SPDX-License-Identifier: MIT
165
+ */
166
+
167
+ declare const TaskValidateAPI: (input: TaskValidateInput) => Promise<TaskValidateOutput>;
168
+
114
169
  /**
115
170
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
116
171
  * SPDX-License-Identifier: MIT
@@ -146,4 +201,4 @@ declare const TaskCancelAPI: (input: TaskCancelInput) => Promise<TaskCancelOutpu
146
201
 
147
202
  declare const WorkflowRuntimeAPIs: Record<FlowGramAPIName, (i: any) => any>;
148
203
 
149
- export { TaskCancelAPI, TaskReportAPI, TaskResultAPI, TaskRunAPI, WorkflowRuntimeAPIs };
204
+ export { TaskCancelAPI, TaskReportAPI, TaskResultAPI, TaskRunAPI, TaskValidateAPI, WorkflowRuntimeAPIs };
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ declare enum FlowGramAPIName {
4
4
  TaskReport = "TaskReport",
5
5
  TaskResult = "TaskResult",
6
6
  TaskCancel = "TaskCancel",
7
- Validation = "Validation"
7
+ TaskValidate = "TaskValidate"
8
8
  }
9
9
 
10
10
  /**
@@ -14,6 +14,16 @@ declare enum FlowGramAPIName {
14
14
  type WorkflowInputs = Record<string, any>;
15
15
  type WorkflowOutputs = Record<string, any>;
16
16
 
17
+ /**
18
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
19
+ * SPDX-License-Identifier: MIT
20
+ */
21
+
22
+ interface ValidationResult {
23
+ valid: boolean;
24
+ errors?: string[];
25
+ }
26
+
17
27
  /**
18
28
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
19
29
  * SPDX-License-Identifier: MIT
@@ -44,11 +54,35 @@ interface SnapshotData {
44
54
  outputs: WorkflowOutputs;
45
55
  data: any;
46
56
  branch?: string;
57
+ error?: string;
47
58
  }
48
59
  interface Snapshot extends SnapshotData {
49
60
  id: string;
50
61
  }
51
62
 
63
+ /**
64
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
65
+ * SPDX-License-Identifier: MIT
66
+ */
67
+ declare enum WorkflowMessageType {
68
+ Log = "log",
69
+ Info = "info",
70
+ Debug = "debug",
71
+ Error = "error",
72
+ Warn = "warning"
73
+ }
74
+ interface MessageData {
75
+ message: string;
76
+ nodeID?: string;
77
+ timestamp?: number;
78
+ }
79
+ interface IMessage extends MessageData {
80
+ id: string;
81
+ type: WorkflowMessageType;
82
+ timestamp: number;
83
+ }
84
+ type WorkflowMessages = Record<WorkflowMessageType, IMessage[]>;
85
+
52
86
  /**
53
87
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
54
88
  * SPDX-License-Identifier: MIT
@@ -58,12 +92,14 @@ interface NodeReport extends StatusData {
58
92
  id: string;
59
93
  snapshots: Snapshot[];
60
94
  }
95
+ type WorkflowReports = Record<string, NodeReport>;
61
96
  interface IReport {
62
97
  id: string;
63
98
  inputs: WorkflowInputs;
64
99
  outputs: WorkflowOutputs;
65
100
  workflowStatus: StatusData;
66
- reports: Record<string, NodeReport>;
101
+ reports: WorkflowReports;
102
+ messages: WorkflowMessages;
67
103
  }
68
104
 
69
105
  /**
@@ -89,6 +125,18 @@ interface TaskReportInput {
89
125
  }
90
126
  type TaskReportOutput = IReport | undefined;
91
127
 
128
+ /**
129
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
130
+ * SPDX-License-Identifier: MIT
131
+ */
132
+
133
+ interface TaskValidateInput {
134
+ inputs: WorkflowInputs;
135
+ schema: string;
136
+ }
137
+ interface TaskValidateOutput extends ValidationResult {
138
+ }
139
+
92
140
  /**
93
141
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
94
142
  * SPDX-License-Identifier: MIT
@@ -111,6 +159,13 @@ type TaskCancelOutput = {
111
159
  success: boolean;
112
160
  };
113
161
 
162
+ /**
163
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
164
+ * SPDX-License-Identifier: MIT
165
+ */
166
+
167
+ declare const TaskValidateAPI: (input: TaskValidateInput) => Promise<TaskValidateOutput>;
168
+
114
169
  /**
115
170
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
116
171
  * SPDX-License-Identifier: MIT
@@ -146,4 +201,4 @@ declare const TaskCancelAPI: (input: TaskCancelInput) => Promise<TaskCancelOutpu
146
201
 
147
202
  declare const WorkflowRuntimeAPIs: Record<FlowGramAPIName, (i: any) => any>;
148
203
 
149
- export { TaskCancelAPI, TaskReportAPI, TaskResultAPI, TaskRunAPI, WorkflowRuntimeAPIs };
204
+ export { TaskCancelAPI, TaskReportAPI, TaskResultAPI, TaskRunAPI, TaskValidateAPI, WorkflowRuntimeAPIs };