cabloy 5.1.57 → 5.1.58
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/CHANGELOG.md +12 -0
- package/cabloy-docs/.vitepress/config.mjs +1 -0
- package/cabloy-docs/backend/dto-guide.md +7 -0
- package/cabloy-docs/backend/orm-select-guide.md +2 -0
- package/cabloy-docs/backend/validation-guide.md +8 -0
- package/cabloy-docs/fullstack/comparison-with-other-frameworks.md +1 -0
- package/cabloy-docs/fullstack/framework-performance.md +89 -0
- package/cabloy-docs/fullstack/introduction.md +1 -0
- package/cabloy-docs/fullstack/quickstart.md +19 -3
- package/cabloy-docs/fullstack/vona-zova-integration.md +2 -0
- package/cabloy-docs/index.md +8 -0
- package/package.json +1 -1
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/packages-utils/zod-query/package.json +1 -1
- package/vona/packages-utils/zod-query/src/index.ts +1 -0
- package/vona/packages-utils/zod-query/src/lib/query.ts +31 -12
- package/vona/packages-utils/zod-query/src/lib/zod-is-type.ts +48 -6
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/packages-vona/vona-core/package.json +1 -1
- package/vona/packages-vona/vona-mock/package.json +1 -1
- package/vona/pnpm-lock.yaml +482 -477
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapi/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/src/lib/schema/v/system.ts +6 -0
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/src/lib/schema/v.ts +2 -0
- package/vona/src/suite-vendor/a-vona/modules/a-web/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-web/src/bean/filterTransform.base.ts +6 -0
- package/vona/src/suite-vendor/a-vona/modules/a-web/src/bean/filterTransform.dateRange.ts +1 -0
- package/vona/src/suite-vendor/a-vona/modules/a-web/src/bean/pipe.filter.ts +5 -5
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/packages-utils/zova-jsx/package.json +2 -2
- package/zova/packages-zova/zova/package.json +3 -3
- package/zova/packages-zova/zova-core/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-zod/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/package.json +3 -3
|
@@ -22,6 +22,12 @@ export function schemaOptional() {
|
|
|
22
22
|
return schemaRequired(false);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
export function schemaNullable() {
|
|
26
|
+
return function (schema: z.ZodType): z.ZodType {
|
|
27
|
+
return schema.nullable();
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
25
31
|
export function schemaRequired(
|
|
26
32
|
required: boolean = true,
|
|
27
33
|
params?: string | ILocaleMagic | z.core.$ZodStringParams,
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
schemaDefault,
|
|
29
29
|
schemaLazy,
|
|
30
30
|
schemaLooseObject,
|
|
31
|
+
schemaNullable,
|
|
31
32
|
schemaObject,
|
|
32
33
|
schemaOptional,
|
|
33
34
|
schemaRequired,
|
|
@@ -38,6 +39,7 @@ import { schemaZodRefine, schemaZodTransform } from './v/zod.ts';
|
|
|
38
39
|
export const v = {
|
|
39
40
|
required: schemaRequired,
|
|
40
41
|
optional: schemaOptional,
|
|
42
|
+
nullable: schemaNullable,
|
|
41
43
|
default: schemaDefault,
|
|
42
44
|
object: schemaObject,
|
|
43
45
|
strictObject: schemaStrictObject,
|
|
@@ -27,6 +27,12 @@ export class FilterTransformBase extends BeanBase implements IFilterTransformWhe
|
|
|
27
27
|
op = '_eq_';
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
+
if (value === null) {
|
|
31
|
+
if (op === '_is_' || op === '_isNot_') {
|
|
32
|
+
return { [op]: null };
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
30
36
|
let where;
|
|
31
37
|
if (op === '_eq_') {
|
|
32
38
|
where = value;
|
|
@@ -22,6 +22,7 @@ export class FilterTransformDateRange extends BeanBase implements IFilterTransfo
|
|
|
22
22
|
options: IFilterTransformOptionsDateRange,
|
|
23
23
|
): Promise<any | undefined> {
|
|
24
24
|
const { value } = info;
|
|
25
|
+
if (value === null) return null;
|
|
25
26
|
const [dateStartStr, dateEndStr] = value.split(options.separator);
|
|
26
27
|
if (!dateStartStr && !dateEndStr) return;
|
|
27
28
|
//
|
|
@@ -12,6 +12,7 @@ import type { ValidatorOptions } from 'vona-module-a-validation';
|
|
|
12
12
|
|
|
13
13
|
import { isNil, isNilOrEmptyString } from '@cabloy/utils';
|
|
14
14
|
import { ZodMetadata } from '@cabloy/zod-openapi';
|
|
15
|
+
import { isNullableSchema } from '@cabloy/zod-query';
|
|
15
16
|
import { BeanBase, beanFullNameFromOnionName, cast } from 'vona';
|
|
16
17
|
import { createArgumentPipe, Pipe } from 'vona-module-a-aspect';
|
|
17
18
|
|
|
@@ -139,7 +140,6 @@ export class PipeFilter
|
|
|
139
140
|
value: any,
|
|
140
141
|
options: IPipeOptionsFilter,
|
|
141
142
|
) {
|
|
142
|
-
if (isNilOrEmptyString(fieldValue)) return;
|
|
143
143
|
if (__FieldsSystem.includes(key)) return;
|
|
144
144
|
const fieldSchema = ZodMetadata.getFieldSchema(options.schema, key);
|
|
145
145
|
if (!fieldSchema) return;
|
|
@@ -148,6 +148,9 @@ export class PipeFilter
|
|
|
148
148
|
const openapi: ISchemaObjectExtensionField | undefined = ZodMetadata.getOpenapiMetadata(
|
|
149
149
|
fieldSchema,
|
|
150
150
|
) as ISchemaObjectExtensionField | undefined;
|
|
151
|
+
const [transformName] = openapi?.filter?.transform ?? ['a-web:base', undefined];
|
|
152
|
+
const fieldNullable = fieldValue === null && isNullableSchema(fieldSchema);
|
|
153
|
+
if (isNilOrEmptyString(fieldValue) && !fieldNullable) return;
|
|
151
154
|
// name
|
|
152
155
|
const originalName = openapi?.filter?.originalName ?? key;
|
|
153
156
|
let fullName: string;
|
|
@@ -165,10 +168,7 @@ export class PipeFilter
|
|
|
165
168
|
// check where
|
|
166
169
|
if (Object.prototype.hasOwnProperty.call(params.where, fullName)) return;
|
|
167
170
|
// filter transform
|
|
168
|
-
const [
|
|
169
|
-
'a-web:base',
|
|
170
|
-
undefined,
|
|
171
|
-
];
|
|
171
|
+
const [, transformOptions] = openapi?.filter?.transform ?? ['a-web:base', undefined];
|
|
172
172
|
const transformOptions2 = this.bean.onion.filterTransform.getOnionOptionsDynamic(
|
|
173
173
|
transformName as keyof IFilterTransformRecord,
|
|
174
174
|
transformOptions,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-jsx",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.61",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "Zova JSX",
|
|
6
6
|
"keywords": [
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@cabloy/word-utils": "^2.1.14",
|
|
51
51
|
"typestyle": "^2.4.0",
|
|
52
52
|
"vue": "^3.5.38",
|
|
53
|
-
"zova-core": "^5.1.
|
|
53
|
+
"zova-core": "^5.1.55"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.100",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "A vue3 framework with ioc",
|
|
6
6
|
"keywords": [
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"postpack": "clean-package restore"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"zova-core": "^5.1.
|
|
49
|
-
"zova-suite-a-zova": "^5.1.
|
|
48
|
+
"zova-core": "^5.1.55",
|
|
49
|
+
"zova-suite-a-zova": "^5.1.99"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-core",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.55",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "A vue3 framework with ioc",
|
|
6
6
|
"keywords": [
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@cabloy/word-utils": "^2.1.14",
|
|
63
63
|
"@cabloy/zod-errors-custom": "^2.1.9",
|
|
64
64
|
"@cabloy/zod-openapi": "^1.1.9",
|
|
65
|
-
"@cabloy/zod-query": "^2.1.
|
|
65
|
+
"@cabloy/zod-query": "^2.1.9",
|
|
66
66
|
"@types/js-cookie": "^3.0.6",
|
|
67
67
|
"@vue/shared": "^3.5.32",
|
|
68
68
|
"deep-equal": "^2.2.3",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-zod",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.28",
|
|
4
4
|
"gitHead": "09d901d17140a80ee0764211b441cda72fd94663",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@cabloy/zod-errors-custom": "^2.1.9",
|
|
38
38
|
"@cabloy/zod-openapi": "^1.1.9",
|
|
39
|
-
"@cabloy/zod-query": "^2.1.
|
|
39
|
+
"@cabloy/zod-query": "^2.1.9",
|
|
40
40
|
"zod": "^4.4.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.67",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "zova",
|
|
6
6
|
"keywords": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@cabloy/word-utils": "^2.1.14",
|
|
44
44
|
"defu": "^6.1.7",
|
|
45
45
|
"luxon": "^3.7.2",
|
|
46
|
-
"zova-jsx": "^1.1.
|
|
46
|
+
"zova-jsx": "^1.1.61"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@cabloy/cli": "^3.1.17",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-suite-a-zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.99",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "zova",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"zova-module-a-ssrserver": "^5.1.19",
|
|
32
32
|
"zova-module-a-style": "^5.1.29",
|
|
33
33
|
"zova-module-a-table": "^5.1.30",
|
|
34
|
-
"zova-module-a-zod": "^5.1.
|
|
35
|
-
"zova-module-a-zova": "^5.1.
|
|
34
|
+
"zova-module-a-zod": "^5.1.28",
|
|
35
|
+
"zova-module-a-zova": "^5.1.67"
|
|
36
36
|
},
|
|
37
37
|
"title": "a-zova"
|
|
38
38
|
}
|