vona-module-a-openapiutils 5.1.3 → 5.1.5
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/LICENSE +0 -0
- package/dist/.metadata/locales.d.ts.map +1 -1
- package/dist/index.js +42 -173
- package/dist/index.js.map +1 -1
- package/dist/lib/decorator/api.d.ts.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/resource.d.ts +3 -0
- package/dist/lib/resource.d.ts.map +1 -0
- package/dist/lib/schema/index.d.ts +1 -0
- package/dist/lib/schema/index.d.ts.map +1 -1
- package/dist/lib/schema/makeMetadata.d.ts +2 -2
- package/dist/lib/schema/makeMetadata.d.ts.map +1 -1
- package/dist/lib/schema/makeSchemaLikes.d.ts.map +1 -1
- package/dist/lib/schema/v/filter.d.ts +1 -2
- package/dist/lib/schema/v/filter.d.ts.map +1 -1
- package/dist/lib/schema/v/helpers.d.ts.map +1 -1
- package/dist/lib/schema/v/openapi.d.ts +3 -3
- package/dist/lib/schema/v/openapi.d.ts.map +1 -1
- package/dist/lib/schema/v/serializer.d.ts.map +1 -1
- package/dist/lib/schema/v/system.d.ts.map +1 -1
- package/dist/lib/schema/v/utils.d.ts.map +1 -1
- package/dist/lib/schema/v/zod.d.ts.map +1 -1
- package/dist/lib/schema/v.d.ts +3 -12
- package/dist/lib/schema/v.d.ts.map +1 -1
- package/dist/lib/schema/visible.d.ts +4 -0
- package/dist/lib/schema/visible.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -4
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/web.d.ts.map +1 -1
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +8 -13
- package/src/.metadata/locales.ts +6 -1
- package/src/lib/decorator/api.ts +82 -13
- package/src/lib/index.ts +1 -0
- package/src/lib/resource.ts +5 -0
- package/src/lib/schema/index.ts +1 -0
- package/src/lib/schema/makeMetadata.ts +5 -3
- package/src/lib/schema/makeSchemaLikes.ts +23 -7
- package/src/lib/schema/v/filter.ts +36 -0
- package/src/lib/schema/v/helpers.ts +32 -7
- package/src/lib/schema/v/openapi.ts +6 -3
- package/src/lib/schema/v/serializer.ts +12 -4
- package/src/lib/schema/v/system.ts +4 -1
- package/src/lib/schema/v/utils.ts +5 -1
- package/src/lib/schema/v/zod.ts +18 -4
- package/src/lib/schema/v.ts +5 -14
- package/src/lib/schema/visible.ts +14 -0
- package/src/lib/utils.ts +15 -7
- package/src/lib/web.ts +4 -1
- package/src/types/api.ts +8 -2
- package/src/types/index.ts +0 -2
- package/dist/lib/schema/v/component.d.ts +0 -5
- package/dist/lib/schema/v/component.d.ts.map +0 -1
- package/dist/lib/schema/v/rest.d.ts +0 -9
- package/dist/lib/schema/v/rest.d.ts.map +0 -1
- package/dist/types/component.d.ts +0 -12
- package/dist/types/component.d.ts.map +0 -1
- package/dist/types/order.d.ts +0 -8
- package/dist/types/order.d.ts.map +0 -1
- package/src/lib/schema/v/component.ts +0 -78
- package/src/lib/schema/v/filter.tsx +0 -40
- package/src/lib/schema/v/rest.ts +0 -50
- package/src/types/component.ts +0 -19
- package/src/types/order.ts +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v.d.ts","sourceRoot":"","sources":["../../../src/lib/schema/v.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"v.d.ts","sourceRoot":"","sources":["../../../src/lib/schema/v.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,EACV,eAAe,EACf,SAAS,EACT,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,WAAW,EACX,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,kBAAkB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEjE,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visible.d.ts","sourceRoot":"","sources":["../../../src/lib/schema/visible.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAIzB,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EACrD,OAAO,CAAC,EAAE,OAAO,EACjB,KAAK,CAAC,EAAE,eAAe,IAEN,QAAQ,CAAC,KAAG,CAAC,CAI/B"}
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { Constructable, ILocaleMagic } from 'vona';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ISchemaObjectExtensionField, TypeSchemaOrderLevel } from 'vona-module-a-openapi';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import type { TypeDecoratorRules } from '../types/decorator.ts';
|
|
5
|
-
import type { TypeSchemaOrderLevel } from '../types/order.ts';
|
|
6
5
|
export declare function getTargetDecoratorRules(target: object, disableRegisterMetadata?: boolean): TypeDecoratorRules;
|
|
7
6
|
export declare function getTargetDecoratorRuleColumns(target: object): string[];
|
|
8
7
|
export declare function getTargetDecoratorRuleColumnsMap(target: object): Record<string, string>;
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function mergeFieldOpenapiMetadata(target: object, prop: string, fieldRule?:
|
|
8
|
+
export declare function mergeDtoFieldsOpenapiMetadata(target: Constructable): void;
|
|
9
|
+
export declare function mergeFieldOpenapiMetadata(target: object, prop: string, fieldRule?: ISchemaObjectExtensionField | z.ZodType): TypeDecoratorRules;
|
|
11
10
|
export declare function prepareClassType<T>(classType: (() => Constructable<T>) | Constructable<T>): Constructable<T>;
|
|
12
11
|
export declare function normalizeErrorParams(params?: string | ILocaleMagic | any, errorDefault?: any): any;
|
|
13
12
|
export declare function $order(order: number, level?: TypeSchemaOrderLevel): number;
|
package/dist/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,KAAK,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAK/F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAKhE,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,uBAAuB,CAAC,EAAE,OAAO,GAChC,kBAAkB,CASpB;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAGtE;AAED,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOvF;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,aAAa,QAUlE;AAGD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,2BAA2B,GAAG,CAAC,CAAC,OAAO,GAClD,kBAAkB,CA6BpB;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,SAAS,EAAE,CAAC,MAAM,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,GACrD,aAAa,CAAC,CAAC,CAAC,CAElB;AAED,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,GAAG,EAAE,YAAY,CAAC,EAAE,GAAG,OAO5F;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,oBAAoB,UAGjE"}
|
package/dist/lib/web.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../src/lib/web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIxD,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,cAAc,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAEnE;AAED,wBAAgB,gCAAgC,CAAC,CAAC,SAAS,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../src/lib/web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIxD,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,cAAc,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAEnE;AAED,wBAAgB,gCAAgC,CAAC,CAAC,SAAS,MAAM,cAAc,EAC7E,IAAI,EAAE,CAAC,EACP,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5C,MAAM,CAER"}
|
package/dist/types/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,IAAI,eAAe,EAChC,YAAY,IAAI,cAAc,EAC/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,aAAa,IAAI,eAAe,EAChC,YAAY,IAAI,cAAc,EAC/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;CAClC;AAED,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,MAAM,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,KAAK,CAAC;AAC/C,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,eAAe,CAAC;IACrB,GAAG,EAAE,eAAe,CAAC;CACtB;AACD,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,cAAc,CAAC;IACpB,GAAG,EAAE,cAAc,CAAC;CACrB;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,eAAe,KAAK,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;AAE/F,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,UAAU,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,gBAAgB,GAAG,KAAK,CAAC;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAED,MAAM,MAAM,uBAAuB,GAC/B,kBAAkB,GAClB,iBAAiB,GACjB,mCAAmC,GACnC,qBAAqB,GACrB,YAAY,GACZ,WAAW,GACX,0BAA0B,GAC1B,iBAAiB,GACjB,WAAW,GACX,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,eAAe,GACf,WAAW,GACX,YAAY,GACZ,0BAA0B,GAC1B,oBAAoB,GACpB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,yBAAyB,GACzB,0BAA0B,GAC1B,yBAAyB,GACzB,iBAAiB,GACjB,iBAAiB,GACjB,qBAAqB,GACrB,WAAW,GACX,aAAa,GACb,iBAAiB,GACjB,oBAAoB,GACpB,qBAAqB,GACrB,cAAc,GACd,gBAAgB,GAChB,cAAc,GACd,aAAa,GACb,0BAA0B,GAC1B,WAAW,GACX,YAAY,GACZ,UAAU,GACV,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,YAAY,GACZ,UAAU,GACV,wBAAwB,GACxB,wBAAwB,GACxB,kBAAkB,GAClB,qBAAqB,GACrB,2BAA2B,GAC3B,wBAAwB,GACxB,0BAA0B,GAC1B,oBAAoB,GACpB,8BAA8B,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-openapiutils",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.5",
|
|
4
|
+
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
4
5
|
"description": "",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"Vona Module"
|
|
@@ -22,19 +23,13 @@
|
|
|
22
23
|
},
|
|
23
24
|
"./package.json": "./package.json"
|
|
24
25
|
},
|
|
25
|
-
"
|
|
26
|
-
"clean": "rimraf dist tsconfig.build.tsbuildinfo",
|
|
27
|
-
"tsc:publish": "npm run clean && vona :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
28
|
-
"prepublishOnly": "npm run tsc:publish",
|
|
29
|
-
"prepack": "clean-package",
|
|
30
|
-
"postpack": "clean-package restore && npm run clean"
|
|
31
|
-
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"@zhennann/currency": "^2.0.0"
|
|
34
|
-
},
|
|
26
|
+
"dependencies": {},
|
|
35
27
|
"title": "a-openapiutils",
|
|
36
28
|
"vonaModule": {
|
|
37
29
|
"dependencies": {}
|
|
38
30
|
},
|
|
39
|
-
"
|
|
40
|
-
|
|
31
|
+
"scripts": {
|
|
32
|
+
"clean": "rimraf dist tsconfig.build.tsbuildinfo",
|
|
33
|
+
"tsc:publish": "npm run clean && vona :bin:buildModule --sourcemap && tsc -p tsconfig.build.json"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/src/.metadata/locales.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { TypeLocaleBase } from 'vona';
|
|
2
|
+
|
|
2
3
|
import { $makeLocaleMagic } from 'vona';
|
|
4
|
+
|
|
3
5
|
import locale_en_us from '../config/locale/en-us.ts';
|
|
4
6
|
import locale_zh_cn from '../config/locale/zh-cn.ts';
|
|
5
7
|
|
|
@@ -8,6 +10,9 @@ export const locales = {
|
|
|
8
10
|
'zh-cn': locale_zh_cn,
|
|
9
11
|
};
|
|
10
12
|
|
|
11
|
-
export function $locale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
13
|
+
export function $locale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
14
|
+
key: K,
|
|
15
|
+
...args: any[]
|
|
16
|
+
): any {
|
|
12
17
|
return $makeLocaleMagic(`a-openapiutils::${key}`, ...args);
|
|
13
18
|
}
|
package/src/lib/decorator/api.ts
CHANGED
|
@@ -11,7 +11,12 @@ import { Field } from './field.ts';
|
|
|
11
11
|
|
|
12
12
|
function httpCode(httpCode: number): MethodDecorator {
|
|
13
13
|
return function (target: object, prop?: MetadataKey, descriptor?: PropertyDescriptor) {
|
|
14
|
-
const options = appMetadata.getOwnMetadataMap(
|
|
14
|
+
const options = appMetadata.getOwnMetadataMap(
|
|
15
|
+
false,
|
|
16
|
+
SymbolOpenApiOptions,
|
|
17
|
+
target,
|
|
18
|
+
prop,
|
|
19
|
+
) as IOpenapiOptions;
|
|
15
20
|
options.httpCode = httpCode;
|
|
16
21
|
return descriptor;
|
|
17
22
|
} as any;
|
|
@@ -19,7 +24,12 @@ function httpCode(httpCode: number): MethodDecorator {
|
|
|
19
24
|
|
|
20
25
|
function contentType(contentType: TypeResponseContentType): MethodDecorator {
|
|
21
26
|
return function (target: object, prop?: MetadataKey, descriptor?: PropertyDescriptor) {
|
|
22
|
-
const options = appMetadata.getOwnMetadataMap(
|
|
27
|
+
const options = appMetadata.getOwnMetadataMap(
|
|
28
|
+
false,
|
|
29
|
+
SymbolOpenApiOptions,
|
|
30
|
+
target,
|
|
31
|
+
prop,
|
|
32
|
+
) as IOpenapiOptions;
|
|
23
33
|
options.contentType = contentType;
|
|
24
34
|
return descriptor;
|
|
25
35
|
} as any;
|
|
@@ -31,19 +41,32 @@ function body(...schemaLikes: SchemaLike[]): MethodDecorator {
|
|
|
31
41
|
const metaType = appMetadata.getDesignReturntype(target, prop);
|
|
32
42
|
const schema = makeSchemaLikes(schemaLikes, metaType);
|
|
33
43
|
// options
|
|
34
|
-
const options = appMetadata.getOwnMetadataMap(
|
|
44
|
+
const options = appMetadata.getOwnMetadataMap(
|
|
45
|
+
false,
|
|
46
|
+
SymbolOpenApiOptions,
|
|
47
|
+
target,
|
|
48
|
+
prop,
|
|
49
|
+
) as IOpenapiOptions;
|
|
35
50
|
options.bodySchema = schema;
|
|
36
51
|
return descriptor;
|
|
37
52
|
} as any;
|
|
38
53
|
}
|
|
39
54
|
|
|
40
|
-
function bodyCustom(
|
|
55
|
+
function bodyCustom(
|
|
56
|
+
bodySchemaWrapper: SchemaLikeCreate | false,
|
|
57
|
+
...schemaLikes: SchemaLike[]
|
|
58
|
+
): MethodDecorator {
|
|
41
59
|
return function (target: object, prop?: MetadataKey, descriptor?: PropertyDescriptor) {
|
|
42
60
|
// schema
|
|
43
61
|
const metaType = appMetadata.getDesignReturntype(target, prop);
|
|
44
62
|
const schema = makeSchemaLikes(schemaLikes, metaType);
|
|
45
63
|
// options
|
|
46
|
-
const options = appMetadata.getOwnMetadataMap(
|
|
64
|
+
const options = appMetadata.getOwnMetadataMap(
|
|
65
|
+
false,
|
|
66
|
+
SymbolOpenApiOptions,
|
|
67
|
+
target,
|
|
68
|
+
prop,
|
|
69
|
+
) as IOpenapiOptions;
|
|
47
70
|
options.bodySchema = schema;
|
|
48
71
|
options.bodySchemaWrapper = bodySchemaWrapper;
|
|
49
72
|
return descriptor;
|
|
@@ -52,7 +75,12 @@ function bodyCustom(bodySchemaWrapper: SchemaLikeCreate | false, ...schemaLikes:
|
|
|
52
75
|
|
|
53
76
|
function exclude(): ClassDecorator & MethodDecorator {
|
|
54
77
|
return function (target: object, prop?: MetadataKey, descriptor?: PropertyDescriptor) {
|
|
55
|
-
const options = appMetadata.getOwnMetadataMap(
|
|
78
|
+
const options = appMetadata.getOwnMetadataMap(
|
|
79
|
+
false,
|
|
80
|
+
SymbolOpenApiOptions,
|
|
81
|
+
target,
|
|
82
|
+
prop,
|
|
83
|
+
) as IOpenapiOptions;
|
|
56
84
|
options.exclude = true;
|
|
57
85
|
return descriptor;
|
|
58
86
|
} as any;
|
|
@@ -60,7 +88,12 @@ function exclude(): ClassDecorator & MethodDecorator {
|
|
|
60
88
|
|
|
61
89
|
function tags(tags: string[]): ClassDecorator & MethodDecorator {
|
|
62
90
|
return function (target: object, prop?: MetadataKey, descriptor?: PropertyDescriptor) {
|
|
63
|
-
const options = appMetadata.getOwnMetadataMap(
|
|
91
|
+
const options = appMetadata.getOwnMetadataMap(
|
|
92
|
+
false,
|
|
93
|
+
SymbolOpenApiOptions,
|
|
94
|
+
target,
|
|
95
|
+
prop,
|
|
96
|
+
) as IOpenapiOptions;
|
|
64
97
|
options.tags = tags;
|
|
65
98
|
return descriptor;
|
|
66
99
|
} as any;
|
|
@@ -68,7 +101,12 @@ function tags(tags: string[]): ClassDecorator & MethodDecorator {
|
|
|
68
101
|
|
|
69
102
|
function header(header: IOpenapiHeader): ClassDecorator & MethodDecorator {
|
|
70
103
|
return function (target: object, prop?: MetadataKey, descriptor?: PropertyDescriptor) {
|
|
71
|
-
const options = appMetadata.getOwnMetadataMap(
|
|
104
|
+
const options = appMetadata.getOwnMetadataMap(
|
|
105
|
+
false,
|
|
106
|
+
SymbolOpenApiOptions,
|
|
107
|
+
target,
|
|
108
|
+
prop,
|
|
109
|
+
) as IOpenapiOptions;
|
|
72
110
|
if (!options.headers) options.headers = [];
|
|
73
111
|
options.headers.push(header);
|
|
74
112
|
return descriptor;
|
|
@@ -77,7 +115,12 @@ function header(header: IOpenapiHeader): ClassDecorator & MethodDecorator {
|
|
|
77
115
|
|
|
78
116
|
function headers(headers: IOpenapiHeader[]): ClassDecorator & MethodDecorator {
|
|
79
117
|
return function (target: object, prop?: MetadataKey, descriptor?: PropertyDescriptor) {
|
|
80
|
-
const options = appMetadata.getOwnMetadataMap(
|
|
118
|
+
const options = appMetadata.getOwnMetadataMap(
|
|
119
|
+
false,
|
|
120
|
+
SymbolOpenApiOptions,
|
|
121
|
+
target,
|
|
122
|
+
prop,
|
|
123
|
+
) as IOpenapiOptions;
|
|
81
124
|
if (!options.headers) options.headers = [];
|
|
82
125
|
options.headers.push(...headers);
|
|
83
126
|
return descriptor;
|
|
@@ -88,7 +131,12 @@ function setHeader(field: { [key: string]: string | string[] }): ClassDecorator
|
|
|
88
131
|
function setHeader(field: string, val: string | string[]): ClassDecorator & MethodDecorator;
|
|
89
132
|
function setHeader(field: any, val?: any): ClassDecorator & MethodDecorator {
|
|
90
133
|
return function (target: object, prop?: MetadataKey, descriptor?: PropertyDescriptor) {
|
|
91
|
-
const options = appMetadata.getOwnMetadataMap(
|
|
134
|
+
const options = appMetadata.getOwnMetadataMap(
|
|
135
|
+
false,
|
|
136
|
+
SymbolOpenApiOptions,
|
|
137
|
+
target,
|
|
138
|
+
prop,
|
|
139
|
+
) as IOpenapiOptions;
|
|
92
140
|
if (!options.setHeaders) options.setHeaders = {};
|
|
93
141
|
if (typeof field === 'string') {
|
|
94
142
|
options.setHeaders[field] = val;
|
|
@@ -99,9 +147,30 @@ function setHeader(field: any, val?: any): ClassDecorator & MethodDecorator {
|
|
|
99
147
|
} as any;
|
|
100
148
|
}
|
|
101
149
|
|
|
102
|
-
export const Api = {
|
|
150
|
+
export const Api = {
|
|
151
|
+
field: Field,
|
|
152
|
+
httpCode,
|
|
153
|
+
contentType,
|
|
154
|
+
body,
|
|
155
|
+
bodyCustom,
|
|
156
|
+
exclude,
|
|
157
|
+
tags,
|
|
158
|
+
header,
|
|
159
|
+
headers,
|
|
160
|
+
setHeader,
|
|
161
|
+
};
|
|
103
162
|
|
|
104
|
-
export function setPublic(
|
|
105
|
-
|
|
163
|
+
export function setPublic(
|
|
164
|
+
target: object,
|
|
165
|
+
prop?: MetadataKey,
|
|
166
|
+
_descriptor?: PropertyDescriptor,
|
|
167
|
+
value?: boolean,
|
|
168
|
+
) {
|
|
169
|
+
const options = appMetadata.getOwnMetadataMap(
|
|
170
|
+
false,
|
|
171
|
+
SymbolOpenApiOptions,
|
|
172
|
+
target,
|
|
173
|
+
prop,
|
|
174
|
+
) as IOpenapiOptions;
|
|
106
175
|
options.public = value;
|
|
107
176
|
}
|
package/src/lib/index.ts
CHANGED
package/src/lib/schema/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ISchemaObjectExtensionField } from 'vona-module-a-openapi';
|
|
2
2
|
|
|
3
3
|
import { ZodMetadata } from '@cabloy/zod-openapi';
|
|
4
4
|
|
|
@@ -6,7 +6,9 @@ import type { SchemaLike } from '../../types/decorator.ts';
|
|
|
6
6
|
|
|
7
7
|
import { $makeSchema } from './makeSchemaLikes.ts';
|
|
8
8
|
|
|
9
|
-
export function $makeMetadata<T>(
|
|
9
|
+
export function $makeMetadata<T>(
|
|
10
|
+
...schemaLikes: SchemaLike<T>[]
|
|
11
|
+
): ISchemaObjectExtensionField | undefined {
|
|
10
12
|
const schema = $makeSchema(...schemaLikes);
|
|
11
|
-
return ZodMetadata.getOpenapiMetadata(schema);
|
|
13
|
+
return ZodMetadata.getOpenapiMetadata(schema) as ISchemaObjectExtensionField;
|
|
12
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Constructable } from 'vona';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ISchemaObjectExtensionField, ISchemaObjectOptions } from 'vona-module-a-openapi';
|
|
3
3
|
|
|
4
4
|
import { isClass } from '@cabloy/utils';
|
|
5
5
|
import { appMetadata, appResource, cast } from 'vona';
|
|
@@ -15,7 +15,10 @@ export function $makeSchema<T>(...schemaLikes: SchemaLike<T>[]): z.ZodType<T> {
|
|
|
15
15
|
return makeSchemaLikes(schemaLikes, undefined);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export function makeSchemaLikes<T>(
|
|
18
|
+
export function makeSchemaLikes<T>(
|
|
19
|
+
schemaLikes: SchemaLike<T> | SchemaLike<T>[],
|
|
20
|
+
typeInit: any,
|
|
21
|
+
): z.ZodType<T> {
|
|
19
22
|
if (!Array.isArray(schemaLikes)) schemaLikes = [schemaLikes];
|
|
20
23
|
// default schema
|
|
21
24
|
let argSchema: z.ZodType<T> = $schema(typeInit);
|
|
@@ -27,12 +30,20 @@ export function makeSchemaLikes<T>(schemaLikes: SchemaLike<T> | SchemaLike<T>[],
|
|
|
27
30
|
return argSchema;
|
|
28
31
|
}
|
|
29
32
|
|
|
30
|
-
export function makeSchemaLike<T>(
|
|
33
|
+
export function makeSchemaLike<T>(
|
|
34
|
+
schemaLike: SchemaLike<T> | undefined,
|
|
35
|
+
schemaPrevious: z.ZodType<T>,
|
|
36
|
+
): z.ZodType<T> {
|
|
31
37
|
if (!schemaLike) return schemaPrevious;
|
|
32
38
|
if (Object.prototype.hasOwnProperty.call(schemaLike, 'parseAsync')) {
|
|
33
39
|
// schema
|
|
34
40
|
return schemaLike as z.ZodType<T>;
|
|
35
|
-
} else if (
|
|
41
|
+
} else if (
|
|
42
|
+
isClass(schemaLike) ||
|
|
43
|
+
['String', 'Number', 'Boolean', 'Date', 'BigInt', 'Array'].includes(
|
|
44
|
+
cast<Function>(schemaLike).name,
|
|
45
|
+
)
|
|
46
|
+
) {
|
|
36
47
|
// class
|
|
37
48
|
return $schema(cast<Constructable>(schemaLike)) as z.ZodType<T>;
|
|
38
49
|
} else {
|
|
@@ -48,7 +59,10 @@ export function $schema(classType: BooleanConstructor): z.ZodBoolean;
|
|
|
48
59
|
export function $schema(classType: DateConstructor): z.ZodDate;
|
|
49
60
|
export function $schema(classType: BigIntConstructor): z.ZodBigInt;
|
|
50
61
|
export function $schema(classType: ArrayConstructor): z.ZodArray<z.ZodAny>;
|
|
51
|
-
export function $schema<T>(
|
|
62
|
+
export function $schema<T>(
|
|
63
|
+
classType: Constructable<T>,
|
|
64
|
+
options?: ISchemaObjectOptions,
|
|
65
|
+
): z.ZodType<T>;
|
|
52
66
|
export function $schema(classType: any, options?: ISchemaObjectOptions): any {
|
|
53
67
|
if (!classType) return z.any();
|
|
54
68
|
if (classType.parseAsync) return classType;
|
|
@@ -59,7 +73,9 @@ export function $schema(classType: any, options?: ISchemaObjectOptions): any {
|
|
|
59
73
|
if (classType.name === 'BigInt') return z.bigint();
|
|
60
74
|
if (classType.name === 'Array') return z.array(z.any());
|
|
61
75
|
// check if object
|
|
62
|
-
const rules = classType.prototype
|
|
76
|
+
const rules = classType.prototype
|
|
77
|
+
? appMetadata.getMetadata(SymbolDecoratorRule, classType.prototype)
|
|
78
|
+
: undefined;
|
|
63
79
|
if (!rules) {
|
|
64
80
|
// not object
|
|
65
81
|
return z.any();
|
|
@@ -79,7 +95,7 @@ export function $schema(classType: any, options?: ISchemaObjectOptions): any {
|
|
|
79
95
|
if (pipes) {
|
|
80
96
|
schema = makeSchemaLikes(pipes, schema) as any;
|
|
81
97
|
}
|
|
82
|
-
const openapi:
|
|
98
|
+
const openapi: ISchemaObjectExtensionField = cast(beanOptions.options)?.openapi;
|
|
83
99
|
schema = schema.openapi(beanOptions.beanFullName, openapi);
|
|
84
100
|
}
|
|
85
101
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { IFilterTransformRecord, ISchemaObjectExtensionFieldFilter } from 'vona-module-a-web';
|
|
2
|
+
import type z from 'zod';
|
|
3
|
+
|
|
4
|
+
export function schemaFilter(options: ISchemaObjectExtensionFieldFilter) {
|
|
5
|
+
return function (schema: z.ZodType): z.ZodType {
|
|
6
|
+
return schema.openapi({
|
|
7
|
+
filter: options,
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function schemaFilterTransform<T extends keyof IFilterTransformRecord>(
|
|
13
|
+
filterTransformName: T,
|
|
14
|
+
options?: Partial<IFilterTransformRecord[T]>,
|
|
15
|
+
) {
|
|
16
|
+
return function (schema: z.ZodType): z.ZodType {
|
|
17
|
+
return schema.openapi({
|
|
18
|
+
filter: {
|
|
19
|
+
transform: [filterTransformName, options],
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// export function schemaFilterDateRange(options?: Partial<IFilterTransformOptionsDateRange>) {
|
|
26
|
+
// const separator = options?.separator;
|
|
27
|
+
// const fnFilterRender = schemaRenderComponent(
|
|
28
|
+
// 'dataRange',
|
|
29
|
+
// separator ? { separator } : undefined,
|
|
30
|
+
// 'filter',
|
|
31
|
+
// );
|
|
32
|
+
// const fnFilterTransform = schemaFilterTransform('a-web:dateRange', options);
|
|
33
|
+
// return function (schema: z.ZodType): z.ZodType {
|
|
34
|
+
// return fnFilterTransform(fnFilterRender(schema));
|
|
35
|
+
// };
|
|
36
|
+
// }
|
|
@@ -35,22 +35,44 @@ export function schemaIPv6(params?: string | ILocaleMagic | z.core.$ZodIPv6Param
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export function schemaMin(
|
|
38
|
+
export function schemaMin(
|
|
39
|
+
min: number,
|
|
40
|
+
params?:
|
|
41
|
+
| string
|
|
42
|
+
| ILocaleMagic
|
|
43
|
+
| z.core.$ZodCheckMinLengthParams
|
|
44
|
+
| z.core.$ZodCheckGreaterThanParams,
|
|
45
|
+
) {
|
|
39
46
|
return function (schema: z.ZodString | z.ZodNumber): z.ZodString | z.ZodNumber {
|
|
40
47
|
if (schema.type === 'string') {
|
|
41
|
-
return schema.min(
|
|
48
|
+
return schema.min(
|
|
49
|
+
min,
|
|
50
|
+
normalizeErrorParams(params) as string | z.core.$ZodCheckMinLengthParams,
|
|
51
|
+
);
|
|
42
52
|
} else {
|
|
43
|
-
return schema.min(
|
|
53
|
+
return schema.min(
|
|
54
|
+
min,
|
|
55
|
+
normalizeErrorParams(params) as string | z.core.$ZodCheckGreaterThanParams,
|
|
56
|
+
);
|
|
44
57
|
}
|
|
45
58
|
};
|
|
46
59
|
}
|
|
47
60
|
|
|
48
|
-
export function schemaMax(
|
|
61
|
+
export function schemaMax(
|
|
62
|
+
max: number,
|
|
63
|
+
params?: string | ILocaleMagic | z.core.$ZodCheckMaxLengthParams | z.core.$ZodCheckLessThanParams,
|
|
64
|
+
) {
|
|
49
65
|
return function (schema: z.ZodString | z.ZodNumber): z.ZodString | z.ZodNumber {
|
|
50
66
|
if (schema.type === 'string') {
|
|
51
|
-
return schema.max(
|
|
67
|
+
return schema.max(
|
|
68
|
+
max,
|
|
69
|
+
normalizeErrorParams(params) as string | z.core.$ZodCheckMaxLengthParams,
|
|
70
|
+
);
|
|
52
71
|
} else {
|
|
53
|
-
return schema.max(
|
|
72
|
+
return schema.max(
|
|
73
|
+
max,
|
|
74
|
+
normalizeErrorParams(params) as string | z.core.$ZodCheckLessThanParams,
|
|
75
|
+
);
|
|
54
76
|
}
|
|
55
77
|
};
|
|
56
78
|
}
|
|
@@ -85,7 +107,10 @@ export function schemaUppercase(params?: string | ILocaleMagic | z.core.$ZodChec
|
|
|
85
107
|
};
|
|
86
108
|
}
|
|
87
109
|
|
|
88
|
-
export function schemaRegex(
|
|
110
|
+
export function schemaRegex(
|
|
111
|
+
regex: RegExp,
|
|
112
|
+
params?: string | ILocaleMagic | z.core.$ZodCheckRegexParams,
|
|
113
|
+
) {
|
|
89
114
|
return function (schema: z.ZodString): z.ZodString {
|
|
90
115
|
return schema.regex(regex, normalizeErrorParams(params));
|
|
91
116
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { ILocaleMagic } from 'vona';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ISchemaObjectExtensionField } from 'vona-module-a-openapi';
|
|
3
3
|
import type { z } from 'zod';
|
|
4
4
|
|
|
5
|
-
export function schemaOpenapi<T extends z.ZodType>(metadata:
|
|
6
|
-
export function schemaOpenapi<T extends z.ZodType>(
|
|
5
|
+
export function schemaOpenapi<T extends z.ZodType>(metadata: ISchemaObjectExtensionField): T;
|
|
6
|
+
export function schemaOpenapi<T extends z.ZodType>(
|
|
7
|
+
refId: string,
|
|
8
|
+
metadata?: ISchemaObjectExtensionField,
|
|
9
|
+
): T;
|
|
7
10
|
export function schemaOpenapi<T extends z.ZodType>(refId: any, metadata?: any) {
|
|
8
11
|
return function (schema: T): T {
|
|
9
12
|
return schema.openapi(refId, metadata);
|
|
@@ -23,7 +23,9 @@ export function schemaSerializerTransform<T extends keyof ISerializerTransformRe
|
|
|
23
23
|
|
|
24
24
|
export function schemaSerializerExclude(options: Partial<ISerializerTransformOptionsExclude>);
|
|
25
25
|
export function schemaSerializerExclude(exclude?: boolean);
|
|
26
|
-
export function schemaSerializerExclude(
|
|
26
|
+
export function schemaSerializerExclude(
|
|
27
|
+
param?: boolean | Partial<ISerializerTransformOptionsExclude>,
|
|
28
|
+
) {
|
|
27
29
|
let options: Partial<ISerializerTransformOptionsExclude>;
|
|
28
30
|
if (!param || typeof param === 'boolean') {
|
|
29
31
|
options = { exclude: param };
|
|
@@ -39,7 +41,9 @@ export function schemaSerializerExclude(param?: boolean | Partial<ISerializerTra
|
|
|
39
41
|
};
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
export function schemaSerializerReplace(
|
|
44
|
+
export function schemaSerializerReplace(
|
|
45
|
+
options: ISerializerTransformRecord['a-serialization:replace'],
|
|
46
|
+
) {
|
|
43
47
|
return function (schema: z.ZodType): z.ZodType {
|
|
44
48
|
return schema.openapi({
|
|
45
49
|
serializerTransforms: {
|
|
@@ -51,7 +55,9 @@ export function schemaSerializerReplace(options: ISerializerTransformRecord['a-s
|
|
|
51
55
|
|
|
52
56
|
export function schemaSerializerGetter(options: Partial<ISerializerTransformOptionsGetter>);
|
|
53
57
|
export function schemaSerializerGetter(getter: TypeSerializerTransformGetter);
|
|
54
|
-
export function schemaSerializerGetter(
|
|
58
|
+
export function schemaSerializerGetter(
|
|
59
|
+
param: TypeSerializerTransformGetter | Partial<ISerializerTransformOptionsGetter>,
|
|
60
|
+
) {
|
|
55
61
|
let options: Partial<ISerializerTransformOptionsGetter>;
|
|
56
62
|
if (typeof param === 'function') {
|
|
57
63
|
options = { getter: param };
|
|
@@ -69,7 +75,9 @@ export function schemaSerializerGetter(param: TypeSerializerTransformGetter | Pa
|
|
|
69
75
|
|
|
70
76
|
export function schemaSerializerCustom(options: Partial<ISerializerTransformOptionsCustom>);
|
|
71
77
|
export function schemaSerializerCustom(getter: TypeSerializerTransformCustom);
|
|
72
|
-
export function schemaSerializerCustom(
|
|
78
|
+
export function schemaSerializerCustom(
|
|
79
|
+
param: TypeSerializerTransformCustom | Partial<ISerializerTransformOptionsCustom>,
|
|
80
|
+
) {
|
|
73
81
|
let options: Partial<ISerializerTransformOptionsCustom>;
|
|
74
82
|
if (typeof param === 'function') {
|
|
75
83
|
options = { custom: param };
|
|
@@ -35,7 +35,10 @@ export function schemaObject<T>(classType: Constructable<T>, options?: ISchemaOb
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export function schemaArray(
|
|
38
|
+
export function schemaArray(
|
|
39
|
+
schemaLike?: SchemaLike,
|
|
40
|
+
params?: z.core.$ZodArrayParams & { separator?: string },
|
|
41
|
+
) {
|
|
39
42
|
return function (schema: z.ZodType): z.ZodType {
|
|
40
43
|
return z.preprocess(
|
|
41
44
|
val => {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { TypeSchemaScene } from 'vona-module-a-openapi';
|
|
2
2
|
import type z from 'zod';
|
|
3
3
|
|
|
4
|
-
export function _generalSchemaRest<T extends z.ZodType>(
|
|
4
|
+
export function _generalSchemaRest<T extends z.ZodType>(
|
|
5
|
+
schema: T,
|
|
6
|
+
options: any,
|
|
7
|
+
scene?: TypeSchemaScene,
|
|
8
|
+
) {
|
|
5
9
|
return schema.openapi(scene ? { rest: { [scene]: options } } : { rest: options });
|
|
6
10
|
}
|
package/src/lib/schema/v/zod.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
IZodRefineExecute,
|
|
3
|
+
IZodRefineRecord,
|
|
4
|
+
IZodTransformExecute,
|
|
5
|
+
IZodTransformRecord,
|
|
6
|
+
} from 'vona-module-a-zod';
|
|
2
7
|
import type z from 'zod';
|
|
3
8
|
|
|
4
9
|
import { beanFullNameFromOnionName, useApp } from 'vona';
|
|
5
10
|
|
|
6
|
-
export function schemaZodRefine<T extends keyof IZodRefineRecord>(
|
|
11
|
+
export function schemaZodRefine<T extends keyof IZodRefineRecord>(
|
|
12
|
+
zodRefineName: T,
|
|
13
|
+
options?: Partial<IZodRefineRecord[T]>,
|
|
14
|
+
) {
|
|
7
15
|
return function (schema: z.ZodType): z.ZodType {
|
|
8
16
|
return schema.superRefine(async (value, refinementCtx) => {
|
|
9
17
|
const app = useApp();
|
|
@@ -19,11 +27,17 @@ export function schemaZodRefine<T extends keyof IZodRefineRecord>(zodRefineName:
|
|
|
19
27
|
};
|
|
20
28
|
}
|
|
21
29
|
|
|
22
|
-
export function schemaZodTransform<T extends keyof IZodTransformRecord>(
|
|
30
|
+
export function schemaZodTransform<T extends keyof IZodTransformRecord>(
|
|
31
|
+
zodTransformName: T,
|
|
32
|
+
options?: Partial<IZodTransformRecord[T]>,
|
|
33
|
+
) {
|
|
23
34
|
return function (schema: z.ZodType): z.ZodType {
|
|
24
35
|
return schema.transform(async value => {
|
|
25
36
|
const app = useApp();
|
|
26
|
-
const options2 = app.bean.onion.zodTransform.getOnionOptionsDynamic(
|
|
37
|
+
const options2 = app.bean.onion.zodTransform.getOnionOptionsDynamic(
|
|
38
|
+
zodTransformName,
|
|
39
|
+
options,
|
|
40
|
+
);
|
|
27
41
|
// execute
|
|
28
42
|
const beanFullName = beanFullNameFromOnionName(zodTransformName, 'zodTransform');
|
|
29
43
|
const beanInstance = app.bean._getBean(beanFullName) as IZodTransformExecute;
|