@antelopejs/dms 0.22.1 → 0.22.2-next.1023.gd4e59bf
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/implementations/dms-builder/engine/cell-displays.js +2 -2
- package/dist/implementations/dms-builder/engine/cell-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/column-groups.d.ts +5 -12
- package/dist/implementations/dms-builder/engine/connection-access-config.js +3 -1
- package/dist/implementations/dms-builder/engine/connection-access-config.js.map +1 -1
- package/dist/implementations/dms-builder/engine/database-access.js +2 -2
- package/dist/implementations/dms-builder/engine/database-access.js.map +1 -1
- package/dist/implementations/dms-builder/engine/database-check-input.d.ts +8 -15
- package/dist/implementations/dms-builder/engine/driver-probe.d.ts +3 -11
- package/dist/implementations/dms-builder/engine/driver-probe.js +4 -4
- package/dist/implementations/dms-builder/engine/driver-probe.js.map +1 -1
- package/dist/implementations/dms-builder/engine/probe-answer.d.ts +17 -34
- package/dist/implementations/dms-builder/engine/probe-child.js +12 -10
- package/dist/implementations/dms-builder/engine/probe-child.js.map +1 -1
- package/dist/implementations/dms-builder/engine/probe-protocol.d.ts +7 -33
- package/dist/implementations/dms-builder/engine/probe-protocol.js +1 -1
- package/dist/implementations/dms-builder/engine/probe-protocol.js.map +1 -1
- package/dist/implementations/dms-builder/engine/theme-draft.js +3 -3
- package/dist/implementations/dms-builder/engine/theme-draft.js.map +1 -1
- package/dist/mcp/access.d.ts +4 -1
- package/dist/mcp/bridge.d.ts +3 -1
- package/dist/mcp/hidden-values.d.ts +1 -1
- package/dist/mcp/hidden-values.js.map +1 -1
- package/dist/mcp/json.d.ts +1 -1
- package/dist/mcp/page-verify/page-probe.d.ts +7 -123
- package/dist/mcp/page-verify/playwright.d.ts +7 -23
- package/dist/mcp/page-verify/render.js +3 -1
- package/dist/mcp/page-verify/render.js.map +1 -1
- package/dist/mcp/redact.js.map +1 -1
- package/dist/mcp/tool.d.ts +1 -1
- package/dist/mcp/tool.js +15 -2
- package/dist/mcp/tool.js.map +1 -1
- package/dist/mcp/tools/builder-queries.d.ts +8 -3
- package/dist/mcp/tools/builder-resources.d.ts +2 -8
- package/dist/mcp/tools/builder-resources.js +1 -1
- package/dist/mcp/tools/builder-resources.js.map +1 -1
- package/dist/mcp/tools/builder-shared.d.ts +1 -1
- package/dist/mcp/tools/builder-shared.js.map +1 -1
- package/dist/mcp/tools/builder-table-view.d.ts +65 -211
- package/dist/mcp/tools/json-patch.d.ts +10 -56
- package/dist/mcp/tools/mockup-support.d.ts +2 -2
- package/dist/mcp/tools/theme-schemas.d.ts +19 -173
- package/dist/mockup/anchor.d.ts +7 -31
- package/dist/mockup/anchor.js.map +1 -1
- package/dist/mockup/annotations-file.d.ts +15 -73
- package/dist/mockup/annotations.d.ts +11 -101
- package/dist/mockup/apply-to-page.js +4 -1
- package/dist/mockup/apply-to-page.js.map +1 -1
- package/dist/mockup/controller-blocks.js +3 -3
- package/dist/mockup/controller-blocks.js.map +1 -1
- package/dist/mockup/files.d.ts +1 -5
- package/dist/mockup/fixtures.d.ts +11 -19
- package/dist/mockup/generate.d.ts +4 -56
- package/dist/mockup/generate.js +1 -1
- package/dist/mockup/generate.js.map +1 -1
- package/dist/mockup/history.d.ts +9 -21
- package/dist/mockup/model.d.ts +103 -772
- package/dist/mockup/model.js +2 -2
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/presence.d.ts +1 -1
- package/dist/mockup/table-columns.d.ts +1 -25
- package/dist/mockup/table-columns.js +2 -2
- package/dist/mockup/table-columns.js.map +1 -1
- package/dist/mockup/table-options.d.ts +62 -399
- package/dist/pages/settings/users/profile.d.ts +2 -9
- package/dist/routes/auth/oauth/providers.js.map +1 -1
- package/dist/routes/auth/switch-tenant.d.ts +1 -7
- package/dist/store/catalog.d.ts +3 -9
- package/dist/store/catalog.js +1 -1
- package/dist/store/catalog.js.map +1 -1
- package/dist/store/interfaces.js +10 -4
- package/dist/store/interfaces.js.map +1 -1
- package/dist/store/internal/frontend/frontend-ready.d.ts +2 -20
- package/dist/store/runtime.d.ts +1 -7
- package/dist/validation/account-deletion.schema.d.ts +1 -7
- package/dist/validation/auth.schema.d.ts +26 -121
- package/dist/validation/file.schema.d.ts +4 -20
- package/dist/validation/member-invite.schema.d.ts +4 -36
- package/dist/validation/member-ownership.schema.d.ts +1 -5
- package/dist/validation/onboarding/register-admin.schema.d.ts +6 -22
- package/dist/validation/regional-preferences.schema.d.ts +11 -17
- package/dist/validation/role-editor.schema.d.ts +6 -28
- package/dist/validation/security.schema.d.ts +4 -24
- package/dist/validation/store.schema.d.ts +3 -30
- package/dist/validation/store.schema.js +1 -1
- package/dist/validation/store.schema.js.map +1 -1
- package/dist/validation/user-notification-preferences.schema.d.ts +1 -1
- package/frontend-vue/layers/dms-core/app/build/composables/api-error.ts +4 -1
- package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +21 -12
- package/frontend-vue/layers/dms-core/app/composables/useFormValidation.ts +6 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentValidation.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formValidation.ts +9 -8
- package/frontend-vue/package.json +2 -3
- package/package.json +5 -6
|
@@ -90,10 +90,19 @@ export interface ValidationIssue {
|
|
|
90
90
|
path?: unknown;
|
|
91
91
|
message?: unknown;
|
|
92
92
|
code?: unknown;
|
|
93
|
-
|
|
93
|
+
format?: unknown;
|
|
94
94
|
minimum?: unknown;
|
|
95
|
-
|
|
95
|
+
origin?: unknown;
|
|
96
|
+
/** zod 3's `origin`, in an issue list a module still on zod 3 sends. */
|
|
96
97
|
type?: unknown;
|
|
98
|
+
/** zod 3's `format`, in an issue list a module still on zod 3 sends. */
|
|
99
|
+
validation?: unknown;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** What a size issue measured, as zod 4 (`origin`) or zod 3 (`type`) names it. */
|
|
103
|
+
function sizeOrigin(issue: ValidationIssue): string | undefined {
|
|
104
|
+
const origin = issue.origin ?? issue.type;
|
|
105
|
+
return origin === undefined ? undefined : String(origin);
|
|
97
106
|
}
|
|
98
107
|
|
|
99
108
|
const HTTP_BAD_REQUEST = 400;
|
|
@@ -124,8 +133,8 @@ const FIELD_ERROR_KEYS = {
|
|
|
124
133
|
tooLarge: "$dms.field_errors.too_large",
|
|
125
134
|
} as const;
|
|
126
135
|
|
|
127
|
-
/** Issue
|
|
128
|
-
const
|
|
136
|
+
/** Issue origins whose size is a count (characters, items), not a value. */
|
|
137
|
+
const COUNTED_ORIGINS = new Set(["string", "array", "set"]);
|
|
129
138
|
|
|
130
139
|
const DATA_API_CODES: Readonly<
|
|
131
140
|
Record<ReturnType<typeof resolveApiErrorMessage>, ApiFieldError["message"]>
|
|
@@ -177,7 +186,8 @@ function isI18nKey(message: string): boolean {
|
|
|
177
186
|
|
|
178
187
|
/** A zod issue's own message when it is a key, else a generic one. */
|
|
179
188
|
function tooSmallMessage(issue: ValidationIssue): string {
|
|
180
|
-
|
|
189
|
+
const origin = sizeOrigin(issue);
|
|
190
|
+
if (origin !== undefined && !COUNTED_ORIGINS.has(origin)) {
|
|
181
191
|
return FIELD_ERROR_KEYS.tooSmall;
|
|
182
192
|
}
|
|
183
193
|
return isNumber(issue.minimum) && issue.minimum <= 1
|
|
@@ -194,18 +204,17 @@ export function validationIssueMessage(issue: ValidationIssue): string {
|
|
|
194
204
|
return issue.message;
|
|
195
205
|
}
|
|
196
206
|
switch (issue.code) {
|
|
197
|
-
case "invalid_type":
|
|
198
|
-
return issue.received === "undefined" || issue.received === "null"
|
|
199
|
-
? FIELD_ERROR_KEYS.required
|
|
200
|
-
: FIELD_ERROR_KEYS.invalid;
|
|
201
207
|
case "too_small":
|
|
202
208
|
return tooSmallMessage(issue);
|
|
203
|
-
case "too_big":
|
|
204
|
-
|
|
209
|
+
case "too_big": {
|
|
210
|
+
const origin = sizeOrigin(issue);
|
|
211
|
+
return origin !== undefined && !COUNTED_ORIGINS.has(origin)
|
|
205
212
|
? FIELD_ERROR_KEYS.tooLarge
|
|
206
213
|
: FIELD_ERROR_KEYS.tooLong;
|
|
214
|
+
}
|
|
215
|
+
case "invalid_format":
|
|
207
216
|
case "invalid_string":
|
|
208
|
-
return issue.validation === "email"
|
|
217
|
+
return (issue.format ?? issue.validation) === "email"
|
|
209
218
|
? FIELD_ERROR_KEYS.invalidEmail
|
|
210
219
|
: FIELD_ERROR_KEYS.invalid;
|
|
211
220
|
default:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Ref, watch } from "vue";
|
|
2
2
|
import type { Form } from "@nuxt/ui";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ZodType, z } from "zod";
|
|
4
4
|
import {
|
|
5
5
|
type I18nTranslate,
|
|
6
6
|
resolveApiMessage,
|
|
@@ -96,8 +96,8 @@ export function formIssueMessage(
|
|
|
96
96
|
return isBlankValue(data) ? REQUIRED_MESSAGE : validationIssueMessage(issue);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
const issueErrorMap: ZodErrorMap = (issue
|
|
100
|
-
message: formIssueMessage(issue,
|
|
99
|
+
const issueErrorMap: z.core.$ZodErrorMap = (issue) => ({
|
|
100
|
+
message: formIssueMessage(issue, issue.input),
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
/**
|
|
@@ -106,7 +106,7 @@ const issueErrorMap: ZodErrorMap = (issue, context) => ({
|
|
|
106
106
|
* a message already in prose is kept.
|
|
107
107
|
*/
|
|
108
108
|
export function localizeSchema<Output, Input>(
|
|
109
|
-
schema: ZodType<Output,
|
|
109
|
+
schema: ZodType<Output, Input>,
|
|
110
110
|
translate: Translate,
|
|
111
111
|
): LocalizedSchema<Output> {
|
|
112
112
|
const resolve = (message: string) =>
|
|
@@ -117,7 +117,7 @@ export function localizeSchema<Output, Input>(
|
|
|
117
117
|
vendor: "dms",
|
|
118
118
|
validate: async (value) => {
|
|
119
119
|
const result = await schema.safeParseAsync(value, {
|
|
120
|
-
|
|
120
|
+
error: issueErrorMap,
|
|
121
121
|
});
|
|
122
122
|
return result.success
|
|
123
123
|
? { value: result.data }
|
|
@@ -134,7 +134,7 @@ export function localizeSchema<Output, Input>(
|
|
|
134
134
|
|
|
135
135
|
/** {@link localizeSchema} with the current locale. */
|
|
136
136
|
export function useLocalizedSchema<Output, Input>(
|
|
137
|
-
schema: ZodType<Output,
|
|
137
|
+
schema: ZodType<Output, Input>,
|
|
138
138
|
): LocalizedSchema<Output> {
|
|
139
139
|
const { t } = useI18n();
|
|
140
140
|
return localizeSchema(schema, (key, params = {}) => t(key, params));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, provide, reactive, toValue, watch } from "vue";
|
|
2
|
-
import type {
|
|
2
|
+
import type { z } from "zod";
|
|
3
3
|
import { isObject } from "#dms-core/app/utils/type-check";
|
|
4
4
|
import {
|
|
5
5
|
formIssueMessage,
|
|
@@ -32,8 +32,8 @@ interface FormValidationSource
|
|
|
32
32
|
|
|
33
33
|
/** Form.vue's localized schema and validation for controls with custom events. */
|
|
34
34
|
export function formComponentValidation(source: FormValidationSource) {
|
|
35
|
-
const issueErrorMap: ZodErrorMap = (issue
|
|
36
|
-
message: source.processApiMessage(formIssueMessage(issue,
|
|
35
|
+
const issueErrorMap: z.core.$ZodErrorMap = (issue) => ({
|
|
36
|
+
message: source.processApiMessage(formIssueMessage(issue, issue.input)),
|
|
37
37
|
});
|
|
38
38
|
const localizedSchema = computed(() => {
|
|
39
39
|
const schema = source.validationSchema.value;
|
|
@@ -57,7 +57,7 @@ export function formComponentValidation(source: FormValidationSource) {
|
|
|
57
57
|
fields: validationFields,
|
|
58
58
|
requiredMessage: source.processApiMessage(REQUIRED_MESSAGE),
|
|
59
59
|
locale: source.locale(),
|
|
60
|
-
parseParams: {
|
|
60
|
+
parseParams: { error: issueErrorMap },
|
|
61
61
|
controlErrors,
|
|
62
62
|
},
|
|
63
63
|
),
|
|
@@ -56,7 +56,7 @@ export interface FormValidationContext {
|
|
|
56
56
|
/** The language a localized field shows: its required error goes there. */
|
|
57
57
|
locale?: string;
|
|
58
58
|
/** Passed to zod (the error map wording its issues). */
|
|
59
|
-
parseParams?:
|
|
59
|
+
parseParams?: z.core.ParseContext<z.core.$ZodIssue>;
|
|
60
60
|
/**
|
|
61
61
|
* Errors controls report on their own value (a duration or JSON that
|
|
62
62
|
* cannot be read), by field id, already translated: the field is refused
|
|
@@ -102,8 +102,8 @@ function requiredPath(
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/** An issue saying the value is not of a branch's type at all. */
|
|
105
|
-
function isTypeMismatch(issue: z.ZodIssue
|
|
106
|
-
return issue.code === "invalid_type" && issue.path.length ===
|
|
105
|
+
function isTypeMismatch(issue: z.core.$ZodIssue): boolean {
|
|
106
|
+
return issue.code === "invalid_type" && issue.path.length === 0;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/**
|
|
@@ -114,14 +114,15 @@ function isTypeMismatch(issue: z.ZodIssue, path: PropertyKey[]): boolean {
|
|
|
114
114
|
* issues replace it: an address part missing, a range end not picked. A
|
|
115
115
|
* union with several such branches keeps its issue.
|
|
116
116
|
*/
|
|
117
|
-
export function unwrapUnionIssue(issue: z.ZodIssue): z.ZodIssue[] {
|
|
117
|
+
export function unwrapUnionIssue(issue: z.core.$ZodIssue): z.core.$ZodIssue[] {
|
|
118
118
|
if (issue.code !== "invalid_union") return [issue];
|
|
119
|
-
const branches = issue.
|
|
120
|
-
(
|
|
121
|
-
!error.issues.every((inner) => isTypeMismatch(inner, issue.path)),
|
|
119
|
+
const branches = issue.errors.filter(
|
|
120
|
+
(branch) => !branch.every(isTypeMismatch),
|
|
122
121
|
);
|
|
123
122
|
if (branches.length !== 1) return [issue];
|
|
124
|
-
return branches[0]!.
|
|
123
|
+
return branches[0]!.flatMap((inner) =>
|
|
124
|
+
unwrapUnionIssue({ ...inner, path: [...issue.path, ...inner.path] }),
|
|
125
|
+
);
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
/**
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"tailwind-variants": "^3.1.1",
|
|
77
77
|
"ufo": "^1.6.1",
|
|
78
78
|
"vue3-apexcharts": "1.10.0",
|
|
79
|
-
"zod": "^
|
|
79
|
+
"zod": "^4.5.0"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@antelopejs/core": "~1.24.5",
|
|
@@ -102,8 +102,7 @@
|
|
|
102
102
|
"vitest": "^4.1.8",
|
|
103
103
|
"vue": "^3.5.18",
|
|
104
104
|
"vue-i18n": "^11.1.12",
|
|
105
|
-
"vue-tsc": "3.1.1"
|
|
106
|
-
"zod-to-json-schema": "~3.24.6"
|
|
105
|
+
"vue-tsc": "3.1.1"
|
|
107
106
|
},
|
|
108
107
|
"peerDependencies": {
|
|
109
108
|
"@nuxt/ui": "4.10.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.2-next.1023.gd4e59bf",
|
|
4
4
|
"description": "AntelopeJS DMS. Plug in your PostgreSQL, MySQL, MariaDB, MongoDB or RethinkDB database and your coding agent builds a back office and analytics dashboard as typed TypeScript. Real-time updates on the data the DMS manages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -89,6 +89,8 @@
|
|
|
89
89
|
"@antelopejs/interface-data-api": ">=0.8.0 <0.9.0",
|
|
90
90
|
"@antelopejs/interface-database": ">=0.4.0 <0.5.0",
|
|
91
91
|
"@antelopejs/interface-database-decorators": ">=0.5.2 <0.6.0",
|
|
92
|
+
"@antelopejs/interface-dms": "0.15.1-next.1023.gd4e59bf",
|
|
93
|
+
"@antelopejs/interface-dms-builder": "^0.6.2",
|
|
92
94
|
"@antelopejs/interface-email": ">=0.2.1 <0.3.0",
|
|
93
95
|
"@antelopejs/interface-file-storage": ">=0.1.4 <0.2.0",
|
|
94
96
|
"@csstools/css-tokenizer": "4.0.0",
|
|
@@ -110,10 +112,7 @@
|
|
|
110
112
|
"striptags": "^3.2.0",
|
|
111
113
|
"ts-morph": "^28.0.0",
|
|
112
114
|
"ua-parser-js": "^2.0.9",
|
|
113
|
-
"zod": "^
|
|
114
|
-
"zod-to-json-schema": "~3.24.6",
|
|
115
|
-
"@antelopejs/interface-dms": "^0.15.0",
|
|
116
|
-
"@antelopejs/interface-dms-builder": "^0.6.2"
|
|
115
|
+
"zod": "^4.5.0"
|
|
117
116
|
},
|
|
118
117
|
"devDependencies": {
|
|
119
118
|
"@antelopejs/api": "~1.7.8",
|
|
@@ -213,7 +212,7 @@
|
|
|
213
212
|
"optional": true
|
|
214
213
|
}
|
|
215
214
|
},
|
|
216
|
-
"gitHead": "
|
|
215
|
+
"gitHead": "d4e59bf92a5e6d7cfe8ccdafc1b0d711eabbab75",
|
|
217
216
|
"scripts": {
|
|
218
217
|
"build": "pnpm --filter @antelopejs/interface-dms --filter @antelopejs/interface-dms-builder build && rimraf dist && antelopejs-tsc && tsc-alias && tsc -p e2e/tsconfig.types.json",
|
|
219
218
|
"dev": "ajs project run --inspect -w -p playground",
|