@uploadista/client-core 0.0.17 → 0.0.18-beta.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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadista/client-core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.18-beta.1",
|
|
5
5
|
"description": "Platform-agnostic core upload client logic for Uploadista",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Uploadista",
|
|
@@ -33,13 +33,16 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"js-base64": "3.7.8",
|
|
36
|
-
"
|
|
37
|
-
|
|
36
|
+
"@uploadista/core": "0.0.18-beta.1"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"zod": "^4.0.0"
|
|
38
40
|
},
|
|
39
41
|
"devDependencies": {
|
|
40
42
|
"tsdown": "0.16.6",
|
|
41
43
|
"vitest": "4.0.13",
|
|
42
|
-
"
|
|
44
|
+
"zod": "4.1.13",
|
|
45
|
+
"@uploadista/typescript-config": "0.0.18-beta.1"
|
|
43
46
|
},
|
|
44
47
|
"scripts": {
|
|
45
48
|
"build": "tsdown",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { inputTypeRegistry } from "@uploadista/core/flow";
|
|
2
2
|
import type { Flow } from "@uploadista/core/flow";
|
|
3
3
|
import { beforeAll, describe, expect, it } from "vitest";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -19,7 +19,7 @@ const mockFlow: Flow = {
|
|
|
19
19
|
id: "input-1",
|
|
20
20
|
name: "File Input",
|
|
21
21
|
type: "input",
|
|
22
|
-
|
|
22
|
+
inputTypeId: "streaming-input-v1",
|
|
23
23
|
input: null,
|
|
24
24
|
output: [],
|
|
25
25
|
},
|
|
@@ -27,7 +27,7 @@ const mockFlow: Flow = {
|
|
|
27
27
|
id: "input-2",
|
|
28
28
|
name: "Data Input",
|
|
29
29
|
type: "input",
|
|
30
|
-
|
|
30
|
+
inputTypeId: "custom-data-input-v1",
|
|
31
31
|
input: null,
|
|
32
32
|
output: [],
|
|
33
33
|
},
|
|
@@ -48,10 +48,9 @@ beforeAll(() => {
|
|
|
48
48
|
// streaming-input-v1 is already registered by core package
|
|
49
49
|
|
|
50
50
|
// Register a custom test input type
|
|
51
|
-
if (!
|
|
52
|
-
|
|
51
|
+
if (!inputTypeRegistry.has("custom-data-input-v1")) {
|
|
52
|
+
inputTypeRegistry.register({
|
|
53
53
|
id: "custom-data-input-v1",
|
|
54
|
-
category: "input",
|
|
55
54
|
schema: z.object({
|
|
56
55
|
title: z.string(),
|
|
57
56
|
count: z.number().min(0),
|
|
@@ -115,7 +114,7 @@ describe("validateFlowInputs", () => {
|
|
|
115
114
|
id: "input-unknown",
|
|
116
115
|
name: "Unknown Input",
|
|
117
116
|
type: "input",
|
|
118
|
-
|
|
117
|
+
inputTypeId: "unregistered-type-v1",
|
|
119
118
|
input: null,
|
|
120
119
|
output: [],
|
|
121
120
|
},
|
|
@@ -187,7 +186,7 @@ describe("validateFlowInputs", () => {
|
|
|
187
186
|
}
|
|
188
187
|
});
|
|
189
188
|
|
|
190
|
-
it("uses default
|
|
189
|
+
it("uses default inputTypeId when not specified", () => {
|
|
191
190
|
const flowWithDefaultType: Flow = {
|
|
192
191
|
...mockFlow,
|
|
193
192
|
nodes: [
|
|
@@ -195,7 +194,7 @@ describe("validateFlowInputs", () => {
|
|
|
195
194
|
id: "input-default",
|
|
196
195
|
name: "Default Input",
|
|
197
196
|
type: "input",
|
|
198
|
-
//
|
|
197
|
+
// inputTypeId not specified - should default to streaming-input-v1
|
|
199
198
|
input: null,
|
|
200
199
|
output: [],
|
|
201
200
|
},
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { FlowData } from "@uploadista/core/flow";
|
|
8
|
-
import type { FlowInputs } from "../types/flow-inputs";
|
|
9
8
|
import { UploadistaError } from "../error";
|
|
9
|
+
import type { FlowInputs } from "../types/flow-inputs";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Validation error details for a specific input node.
|
|
@@ -30,7 +30,7 @@ export type InputValidationResult =
|
|
|
30
30
|
*
|
|
31
31
|
* This function:
|
|
32
32
|
* 1. Fetches flow metadata to get input node types
|
|
33
|
-
* 2. Looks up each node type in the
|
|
33
|
+
* 2. Looks up each node type in the inputTypeRegistry
|
|
34
34
|
* 3. Validates each input against its node's schema using Zod
|
|
35
35
|
* 4. Returns validation errors before any network calls
|
|
36
36
|
*
|
|
@@ -91,7 +91,6 @@ export function validateFlowInputs(
|
|
|
91
91
|
nodeType: node.type,
|
|
92
92
|
error: `Input data for node "${nodeId}" is null or undefined`,
|
|
93
93
|
});
|
|
94
|
-
continue;
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
// Note: Schema validation is done server-side.
|