@loopstack/loopstack-studio 0.23.1 → 0.25.0
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/api/config.js +3 -3
- package/dist/api/index.js +10 -12
- package/dist/api/processor.js +1 -1
- package/dist/api/secrets.js +16 -0
- package/dist/api/workflows.js +7 -1
- package/dist/components/dynamic-form/ArrayController.js +68 -64
- package/dist/components/dynamic-form/CodeContent.js +3 -3
- package/dist/components/dynamic-form/Form.js +46 -40
- package/dist/components/dynamic-form/FormElement.js +1 -1
- package/dist/components/dynamic-form/FormElementHeader.js +2 -2
- package/dist/components/dynamic-form/ObjectController.js +24 -21
- package/dist/components/dynamic-form/fields/BaseFieldWrapper.js +1 -1
- package/dist/components/dynamic-form/fields/CodeViewField.js +36 -36
- package/dist/components/dynamic-form/fields/InputField.js +20 -19
- package/dist/components/dynamic-form/fields/RadioField.js +18 -18
- package/dist/components/dynamic-form/fields/SelectField.js +19 -19
- package/dist/components/dynamic-form/fields/TextareaField.js +17 -17
- package/dist/components/feedback/LoadingCentered.js +1 -1
- package/dist/components/layout/MainLayout.js +18 -31
- package/dist/components/layout/StudioSidebar.js +169 -109
- package/dist/components/loopstack-elements/link.js +77 -76
- package/dist/components/loopstack-elements/tool.js +171 -0
- package/dist/components/page/PageBreadcrumbs.js +79 -32
- package/dist/components/ui-widgets/UiActions.js +10 -4
- package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +8 -6
- package/dist/components/ui-widgets/widgets/SubmitButton.js +8 -6
- package/dist/features/code-explorer/components/FileContentViewer.js +92 -100
- package/dist/features/dashboard/RunItem.js +1 -1
- package/dist/features/debug/components/ConfigFlowViewer.js +2 -2
- package/dist/features/debug/components/{PipelineDebugHeader.js → WorkflowDebugHeader.js} +5 -5
- package/dist/features/debug/components/{PipelineDebugLegend.js → WorkflowDebugLegend.js} +2 -2
- package/dist/features/debug/components/{PipelineFlowViewer.js → WorkflowFlowViewer.js} +9 -9
- package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +46 -0
- package/dist/features/debug/index.js +2 -2
- package/dist/features/debug/lib/flow-utils.js +142 -150
- package/dist/features/documents/DocumentRenderer.js +66 -30
- package/dist/features/documents/components/DocumentItem.js +2 -2
- package/dist/features/documents/components/DocumentList.js +18 -11
- package/dist/features/documents/document-details/DocumentDetails.js +4 -4
- package/dist/features/documents/renderers/AiMessage.js +12 -12
- package/dist/features/documents/renderers/ChoicesRenderer.js +92 -0
- package/dist/features/documents/renderers/ClaudeMessage.js +1 -1
- package/dist/features/documents/renderers/ConfirmPromptRenderer.js +56 -0
- package/dist/features/documents/renderers/DocumentFormRenderer.js +95 -65
- package/dist/features/documents/renderers/LinkMessageRenderer.js +8 -10
- package/dist/features/documents/renderers/SecretInputRenderer.js +87 -0
- package/dist/features/documents/renderers/TextPromptRenderer.js +57 -0
- package/dist/features/documents/renderers/useDocumentTransition.js +30 -0
- package/dist/features/oauth/OAuthPromptRenderer.js +20 -20
- package/dist/features/runs/Runs.js +8 -8
- package/dist/features/workbench/Workbench.js +35 -35
- package/dist/features/workbench/WorkflowItem.js +10 -9
- package/dist/features/workbench/WorkflowList.js +56 -73
- package/dist/features/workbench/components/NewRunDialog.js +18 -18
- package/dist/features/workbench/components/WorkbenchFilesPanel.js +33 -26
- package/dist/features/workbench/components/WorkbenchFloatingPanel.js +13 -44
- package/dist/features/workbench/components/WorkbenchFlowPanel.js +27 -29
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +17 -17
- package/dist/features/workbench/components/WorkbenchPreviewPanel.js +2 -2
- package/dist/features/workbench/components/WorkbenchSecretsPanel.js +182 -0
- package/dist/features/workbench/components/WorkbenchSettingsModal.js +16 -41
- package/dist/features/workbench/components/WorkflowForms.js +14 -13
- package/dist/features/workbench/components/WorkflowHistoryItem.js +60 -81
- package/dist/features/workbench/components/{PipelineHistoryList.js → WorkflowHistoryList.js} +5 -5
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +56 -54
- package/dist/features/workbench/hooks/useWorkflowData.js +10 -10
- package/dist/features/workbench/hooks/useWorkflowListState.js +8 -45
- package/dist/features/workbench/index.js +2 -3
- package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +132 -117
- package/dist/features/workbench/providers/ScrollProvider.js +2 -2
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +4 -4
- package/dist/features/workspaces/Workspaces.js +1 -1
- package/dist/features/workspaces/components/CreateWorkspace.js +12 -12
- package/dist/features/workspaces/components/ExecutionTimeline.js +22 -21
- package/dist/features/workspaces/components/{NewPipelineRunDialog.js → NewWorkflowRunDialog.js} +6 -6
- package/dist/features/workspaces/components/{PipelineForm.js → WorkflowRunForm.js} +31 -31
- package/dist/features/workspaces/components/WorkspaceHomePage.js +11 -11
- package/dist/features/workspaces/components/{pipeline-form → workflow-form}/ArgumentsView.js +1 -1
- package/dist/features/workspaces/components/{pipeline-form → workflow-form}/SelectionView.js +16 -16
- package/dist/hooks/index.js +3 -3
- package/dist/hooks/query-keys.js +34 -68
- package/dist/hooks/useConfig.js +5 -5
- package/dist/hooks/useProcessor.js +5 -5
- package/dist/hooks/useSecrets.js +69 -0
- package/dist/hooks/useWorkflows.js +155 -68
- package/dist/index.d.ts +158 -116
- package/dist/index.js +5 -5
- package/dist/packages/contracts/dist/enums/index.js +11 -12
- package/dist/packages/contracts/dist/enums/workflow-state.enum.js +1 -1
- package/dist/pages/DashboardPage.js +87 -35
- package/dist/pages/DebugWorkflowDetailsPage.js +8 -8
- package/dist/pages/DebugWorkflowsPage.js +10 -10
- package/dist/pages/EmbedWorkbenchPage.js +39 -45
- package/dist/pages/PreviewWorkbenchPage.js +130 -255
- package/dist/pages/RunsListPage.js +1 -1
- package/dist/pages/StudioLandingPage.js +13 -13
- package/dist/pages/WorkbenchPage.js +6 -6
- package/dist/pages/WorkflowDebugPage.js +114 -0
- package/dist/pages/WorkspacePage.js +4 -2
- package/dist/providers/InvalidationEventsProvider.js +19 -19
- package/dist/providers/SseProvider.js +0 -1
- package/dist/routing/LocalRouter.js +14 -17
- package/dist/types/ai.types.js +13 -0
- package/package.json +2 -3
- package/dist/api/namespaces.js +0 -7
- package/dist/api/pipelines.js +0 -13
- package/dist/components/ai-elements/tool.js +0 -158
- package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +0 -41
- package/dist/features/workbench/NavigationItems.js +0 -52
- package/dist/features/workbench/WorkbenchNavigation.js +0 -38
- package/dist/features/workbench/components/NavigationItem.js +0 -68
- package/dist/features/workbench/hooks/useIntersectionObserver.js +0 -44
- package/dist/hooks/useNamespaceTree.js +0 -27
- package/dist/hooks/useNamespaces.js +0 -25
- package/dist/hooks/usePipelines.js +0 -161
- package/dist/node_modules/@ai-sdk/provider/dist/index.js +0 -65
- package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +0 -1008
- package/dist/node_modules/ai/dist/index.js +0 -1083
- package/dist/node_modules/zod/v3/ZodError.js +0 -79
- package/dist/node_modules/zod/v3/errors.js +0 -6
- package/dist/node_modules/zod/v3/helpers/errorUtil.js +0 -5
- package/dist/node_modules/zod/v3/helpers/parseUtil.js +0 -90
- package/dist/node_modules/zod/v3/helpers/util.js +0 -72
- package/dist/node_modules/zod/v3/locales/en.js +0 -58
- package/dist/node_modules/zod/v3/types.js +0 -2425
- package/dist/node_modules/zod/v4/classic/errors.js +0 -21
- package/dist/node_modules/zod/v4/classic/iso.js +0 -29
- package/dist/node_modules/zod/v4/classic/parse.js +0 -4
- package/dist/node_modules/zod/v4/classic/schemas.js +0 -392
- package/dist/node_modules/zod/v4/core/api.js +0 -532
- package/dist/node_modules/zod/v4/core/checks.js +0 -283
- package/dist/node_modules/zod/v4/core/core.js +0 -44
- package/dist/node_modules/zod/v4/core/doc.js +0 -21
- package/dist/node_modules/zod/v4/core/errors.js +0 -40
- package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -305
- package/dist/node_modules/zod/v4/core/parse.js +0 -66
- package/dist/node_modules/zod/v4/core/regexes.js +0 -28
- package/dist/node_modules/zod/v4/core/registries.js +0 -38
- package/dist/node_modules/zod/v4/core/schemas.js +0 -863
- package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -220
- package/dist/node_modules/zod/v4/core/util.js +0 -267
- package/dist/node_modules/zod/v4/core/versions.js +0 -6
- package/dist/packages/contracts/dist/enums/pipeline-state.js +0 -10
- package/dist/pages/PipelineDebugPage.js +0 -115
- /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/StateNode.js +0 -0
- /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/WorkflowTransitionEdge.js +0 -0
- /package/dist/features/workspaces/components/{pipeline-form → workflow-form}/HeaderSection.js +0 -0
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { util } from "./helpers/util.js";
|
|
2
|
-
const ZodIssueCode = util.arrayToEnum([
|
|
3
|
-
"invalid_type",
|
|
4
|
-
"invalid_literal",
|
|
5
|
-
"custom",
|
|
6
|
-
"invalid_union",
|
|
7
|
-
"invalid_union_discriminator",
|
|
8
|
-
"invalid_enum_value",
|
|
9
|
-
"unrecognized_keys",
|
|
10
|
-
"invalid_arguments",
|
|
11
|
-
"invalid_return_type",
|
|
12
|
-
"invalid_date",
|
|
13
|
-
"invalid_string",
|
|
14
|
-
"too_small",
|
|
15
|
-
"too_big",
|
|
16
|
-
"invalid_intersection_types",
|
|
17
|
-
"not_multiple_of",
|
|
18
|
-
"not_finite"
|
|
19
|
-
]);
|
|
20
|
-
var ZodError = class t extends Error {
|
|
21
|
-
get errors() {
|
|
22
|
-
return this.issues;
|
|
23
|
-
}
|
|
24
|
-
constructor(e) {
|
|
25
|
-
super(), this.issues = [], this.addIssue = (e) => {
|
|
26
|
-
this.issues = [...this.issues, e];
|
|
27
|
-
}, this.addIssues = (e = []) => {
|
|
28
|
-
this.issues = [...this.issues, ...e];
|
|
29
|
-
};
|
|
30
|
-
let t = new.target.prototype;
|
|
31
|
-
Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
|
|
32
|
-
}
|
|
33
|
-
format(e) {
|
|
34
|
-
let t = e || function(e) {
|
|
35
|
-
return e.message;
|
|
36
|
-
}, n = { _errors: [] }, r = (e) => {
|
|
37
|
-
for (let i of e.issues) if (i.code === "invalid_union") i.unionErrors.map(r);
|
|
38
|
-
else if (i.code === "invalid_return_type") r(i.returnTypeError);
|
|
39
|
-
else if (i.code === "invalid_arguments") r(i.argumentsError);
|
|
40
|
-
else if (i.path.length === 0) n._errors.push(t(i));
|
|
41
|
-
else {
|
|
42
|
-
let e = n, r = 0;
|
|
43
|
-
for (; r < i.path.length;) {
|
|
44
|
-
let n = i.path[r];
|
|
45
|
-
r === i.path.length - 1 ? (e[n] = e[n] || { _errors: [] }, e[n]._errors.push(t(i))) : e[n] = e[n] || { _errors: [] }, e = e[n], r++;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
return r(this), n;
|
|
50
|
-
}
|
|
51
|
-
static assert(e) {
|
|
52
|
-
if (!(e instanceof t)) throw Error(`Not a ZodError: ${e}`);
|
|
53
|
-
}
|
|
54
|
-
toString() {
|
|
55
|
-
return this.message;
|
|
56
|
-
}
|
|
57
|
-
get message() {
|
|
58
|
-
return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
|
|
59
|
-
}
|
|
60
|
-
get isEmpty() {
|
|
61
|
-
return this.issues.length === 0;
|
|
62
|
-
}
|
|
63
|
-
flatten(e = (e) => e.message) {
|
|
64
|
-
let t = Object.create(null), n = [];
|
|
65
|
-
for (let r of this.issues) if (r.path.length > 0) {
|
|
66
|
-
let n = r.path[0];
|
|
67
|
-
t[n] = t[n] || [], t[n].push(e(r));
|
|
68
|
-
} else n.push(e(r));
|
|
69
|
-
return {
|
|
70
|
-
formErrors: n,
|
|
71
|
-
fieldErrors: t
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
get formErrors() {
|
|
75
|
-
return this.flatten();
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
ZodError.create = (e) => new ZodError(e);
|
|
79
|
-
export { ZodError, ZodIssueCode };
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import en_default from "../locales/en.js";
|
|
2
|
-
import { getErrorMap } from "../errors.js";
|
|
3
|
-
const makeIssue = (e) => {
|
|
4
|
-
let { data: i, path: a, errorMaps: o, issueData: s } = e, c = [...a, ...s.path || []], l = {
|
|
5
|
-
...s,
|
|
6
|
-
path: c
|
|
7
|
-
};
|
|
8
|
-
if (s.message !== void 0) return {
|
|
9
|
-
...s,
|
|
10
|
-
path: c,
|
|
11
|
-
message: s.message
|
|
12
|
-
};
|
|
13
|
-
let u = "", d = o.filter((e) => !!e).slice().reverse();
|
|
14
|
-
for (let e of d) u = e(l, {
|
|
15
|
-
data: i,
|
|
16
|
-
defaultError: u
|
|
17
|
-
}).message;
|
|
18
|
-
return {
|
|
19
|
-
...s,
|
|
20
|
-
path: c,
|
|
21
|
-
message: u
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
function addIssueToContext(o, s) {
|
|
25
|
-
let c = getErrorMap(), l = makeIssue({
|
|
26
|
-
issueData: s,
|
|
27
|
-
data: o.data,
|
|
28
|
-
path: o.path,
|
|
29
|
-
errorMaps: [
|
|
30
|
-
o.common.contextualErrorMap,
|
|
31
|
-
o.schemaErrorMap,
|
|
32
|
-
c,
|
|
33
|
-
c === en_default ? void 0 : en_default
|
|
34
|
-
].filter((e) => !!e)
|
|
35
|
-
});
|
|
36
|
-
o.common.issues.push(l);
|
|
37
|
-
}
|
|
38
|
-
var ParseStatus = class e {
|
|
39
|
-
constructor() {
|
|
40
|
-
this.value = "valid";
|
|
41
|
-
}
|
|
42
|
-
dirty() {
|
|
43
|
-
this.value === "valid" && (this.value = "dirty");
|
|
44
|
-
}
|
|
45
|
-
abort() {
|
|
46
|
-
this.value !== "aborted" && (this.value = "aborted");
|
|
47
|
-
}
|
|
48
|
-
static mergeArray(e, i) {
|
|
49
|
-
let a = [];
|
|
50
|
-
for (let o of i) {
|
|
51
|
-
if (o.status === "aborted") return INVALID;
|
|
52
|
-
o.status === "dirty" && e.dirty(), a.push(o.value);
|
|
53
|
-
}
|
|
54
|
-
return {
|
|
55
|
-
status: e.value,
|
|
56
|
-
value: a
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
static async mergeObjectAsync(i, a) {
|
|
60
|
-
let o = [];
|
|
61
|
-
for (let e of a) {
|
|
62
|
-
let i = await e.key, a = await e.value;
|
|
63
|
-
o.push({
|
|
64
|
-
key: i,
|
|
65
|
-
value: a
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
return e.mergeObjectSync(i, o);
|
|
69
|
-
}
|
|
70
|
-
static mergeObjectSync(e, i) {
|
|
71
|
-
let a = {};
|
|
72
|
-
for (let o of i) {
|
|
73
|
-
let { key: i, value: s } = o;
|
|
74
|
-
if (i.status === "aborted" || s.status === "aborted") return INVALID;
|
|
75
|
-
i.status === "dirty" && e.dirty(), s.status === "dirty" && e.dirty(), i.value !== "__proto__" && (s.value !== void 0 || o.alwaysSet) && (a[i.value] = s.value);
|
|
76
|
-
}
|
|
77
|
-
return {
|
|
78
|
-
status: e.value,
|
|
79
|
-
value: a
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
const INVALID = Object.freeze({ status: "aborted" }), DIRTY = (e) => ({
|
|
84
|
-
status: "dirty",
|
|
85
|
-
value: e
|
|
86
|
-
}), OK = (e) => ({
|
|
87
|
-
status: "valid",
|
|
88
|
-
value: e
|
|
89
|
-
}), isAborted = (e) => e.status === "aborted", isDirty = (e) => e.status === "dirty", isValid = (e) => e.status === "valid", isAsync = (e) => typeof Promise < "u" && e instanceof Promise;
|
|
90
|
-
export { DIRTY, INVALID, OK, ParseStatus, addIssueToContext, isAborted, isAsync, isDirty, isValid, makeIssue };
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
var util;
|
|
2
|
-
(function(e) {
|
|
3
|
-
e.assertEqual = (e) => {};
|
|
4
|
-
function t(e) {}
|
|
5
|
-
e.assertIs = t;
|
|
6
|
-
function n(e) {
|
|
7
|
-
throw Error();
|
|
8
|
-
}
|
|
9
|
-
e.assertNever = n, e.arrayToEnum = (e) => {
|
|
10
|
-
let t = {};
|
|
11
|
-
for (let n of e) t[n] = n;
|
|
12
|
-
return t;
|
|
13
|
-
}, e.getValidEnumValues = (t) => {
|
|
14
|
-
let n = e.objectKeys(t).filter((e) => typeof t[t[e]] != "number"), r = {};
|
|
15
|
-
for (let e of n) r[e] = t[e];
|
|
16
|
-
return e.objectValues(r);
|
|
17
|
-
}, e.objectValues = (t) => e.objectKeys(t).map(function(e) {
|
|
18
|
-
return t[e];
|
|
19
|
-
}), e.objectKeys = typeof Object.keys == "function" ? (e) => Object.keys(e) : (e) => {
|
|
20
|
-
let t = [];
|
|
21
|
-
for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && t.push(n);
|
|
22
|
-
return t;
|
|
23
|
-
}, e.find = (e, t) => {
|
|
24
|
-
for (let n of e) if (t(n)) return n;
|
|
25
|
-
}, e.isInteger = typeof Number.isInteger == "function" ? (e) => Number.isInteger(e) : (e) => typeof e == "number" && Number.isFinite(e) && Math.floor(e) === e;
|
|
26
|
-
function r(e, t = " | ") {
|
|
27
|
-
return e.map((e) => typeof e == "string" ? `'${e}'` : e).join(t);
|
|
28
|
-
}
|
|
29
|
-
e.joinValues = r, e.jsonStringifyReplacer = (e, t) => typeof t == "bigint" ? t.toString() : t;
|
|
30
|
-
})(util ||= {});
|
|
31
|
-
var objectUtil;
|
|
32
|
-
(function(e) {
|
|
33
|
-
e.mergeShapes = (e, t) => ({
|
|
34
|
-
...e,
|
|
35
|
-
...t
|
|
36
|
-
});
|
|
37
|
-
})(objectUtil ||= {});
|
|
38
|
-
const ZodParsedType = util.arrayToEnum([
|
|
39
|
-
"string",
|
|
40
|
-
"nan",
|
|
41
|
-
"number",
|
|
42
|
-
"integer",
|
|
43
|
-
"float",
|
|
44
|
-
"boolean",
|
|
45
|
-
"date",
|
|
46
|
-
"bigint",
|
|
47
|
-
"symbol",
|
|
48
|
-
"function",
|
|
49
|
-
"undefined",
|
|
50
|
-
"null",
|
|
51
|
-
"array",
|
|
52
|
-
"object",
|
|
53
|
-
"unknown",
|
|
54
|
-
"promise",
|
|
55
|
-
"void",
|
|
56
|
-
"never",
|
|
57
|
-
"map",
|
|
58
|
-
"set"
|
|
59
|
-
]), getParsedType = (e) => {
|
|
60
|
-
switch (typeof e) {
|
|
61
|
-
case "undefined": return ZodParsedType.undefined;
|
|
62
|
-
case "string": return ZodParsedType.string;
|
|
63
|
-
case "number": return Number.isNaN(e) ? ZodParsedType.nan : ZodParsedType.number;
|
|
64
|
-
case "boolean": return ZodParsedType.boolean;
|
|
65
|
-
case "function": return ZodParsedType.function;
|
|
66
|
-
case "bigint": return ZodParsedType.bigint;
|
|
67
|
-
case "symbol": return ZodParsedType.symbol;
|
|
68
|
-
case "object": return Array.isArray(e) ? ZodParsedType.array : e === null ? ZodParsedType.null : e.then && typeof e.then == "function" && e.catch && typeof e.catch == "function" ? ZodParsedType.promise : typeof Map < "u" && e instanceof Map ? ZodParsedType.map : typeof Set < "u" && e instanceof Set ? ZodParsedType.set : typeof Date < "u" && e instanceof Date ? ZodParsedType.date : ZodParsedType.object;
|
|
69
|
-
default: return ZodParsedType.unknown;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
export { ZodParsedType, getParsedType, util };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { ZodParsedType, util } from "../helpers/util.js";
|
|
2
|
-
import { ZodIssueCode } from "../ZodError.js";
|
|
3
|
-
var en_default = (r, i) => {
|
|
4
|
-
let a;
|
|
5
|
-
switch (r.code) {
|
|
6
|
-
case ZodIssueCode.invalid_type:
|
|
7
|
-
a = r.received === ZodParsedType.undefined ? "Required" : `Expected ${r.expected}, received ${r.received}`;
|
|
8
|
-
break;
|
|
9
|
-
case ZodIssueCode.invalid_literal:
|
|
10
|
-
a = `Invalid literal value, expected ${JSON.stringify(r.expected, util.jsonStringifyReplacer)}`;
|
|
11
|
-
break;
|
|
12
|
-
case ZodIssueCode.unrecognized_keys:
|
|
13
|
-
a = `Unrecognized key(s) in object: ${util.joinValues(r.keys, ", ")}`;
|
|
14
|
-
break;
|
|
15
|
-
case ZodIssueCode.invalid_union:
|
|
16
|
-
a = "Invalid input";
|
|
17
|
-
break;
|
|
18
|
-
case ZodIssueCode.invalid_union_discriminator:
|
|
19
|
-
a = `Invalid discriminator value. Expected ${util.joinValues(r.options)}`;
|
|
20
|
-
break;
|
|
21
|
-
case ZodIssueCode.invalid_enum_value:
|
|
22
|
-
a = `Invalid enum value. Expected ${util.joinValues(r.options)}, received '${r.received}'`;
|
|
23
|
-
break;
|
|
24
|
-
case ZodIssueCode.invalid_arguments:
|
|
25
|
-
a = "Invalid function arguments";
|
|
26
|
-
break;
|
|
27
|
-
case ZodIssueCode.invalid_return_type:
|
|
28
|
-
a = "Invalid function return type";
|
|
29
|
-
break;
|
|
30
|
-
case ZodIssueCode.invalid_date:
|
|
31
|
-
a = "Invalid date";
|
|
32
|
-
break;
|
|
33
|
-
case ZodIssueCode.invalid_string:
|
|
34
|
-
typeof r.validation == "object" ? "includes" in r.validation ? (a = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (a = `${a} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? a = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? a = `Invalid input: must end with "${r.validation.endsWith}"` : util.assertNever(r.validation) : a = r.validation === "regex" ? "Invalid" : `Invalid ${r.validation}`;
|
|
35
|
-
break;
|
|
36
|
-
case ZodIssueCode.too_small:
|
|
37
|
-
a = r.type === "array" ? `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" || r.type === "bigint" ? `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : "Invalid input";
|
|
38
|
-
break;
|
|
39
|
-
case ZodIssueCode.too_big:
|
|
40
|
-
a = r.type === "array" ? `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : "Invalid input";
|
|
41
|
-
break;
|
|
42
|
-
case ZodIssueCode.custom:
|
|
43
|
-
a = "Invalid input";
|
|
44
|
-
break;
|
|
45
|
-
case ZodIssueCode.invalid_intersection_types:
|
|
46
|
-
a = "Intersection results could not be merged";
|
|
47
|
-
break;
|
|
48
|
-
case ZodIssueCode.not_multiple_of:
|
|
49
|
-
a = `Number must be a multiple of ${r.multipleOf}`;
|
|
50
|
-
break;
|
|
51
|
-
case ZodIssueCode.not_finite:
|
|
52
|
-
a = "Number must be finite";
|
|
53
|
-
break;
|
|
54
|
-
default: a = i.defaultError, util.assertNever(r);
|
|
55
|
-
}
|
|
56
|
-
return { message: a };
|
|
57
|
-
};
|
|
58
|
-
export { en_default as default };
|