vona-module-a-openapi 5.0.31 → 5.0.32
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/index.js +20 -13
- package/dist/lib/utils.d.ts +3 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { getInnerTypeName, coerceWithNil } from '@cabloy/zod-query';
|
|
|
6
6
|
import { OpenApiGeneratorV3, OpenApiGeneratorV31, OpenAPIRegistry } from '@cabloy/zod-to-openapi';
|
|
7
7
|
import { Service, Scope } from 'vona-module-a-bean';
|
|
8
8
|
import { Caching } from 'vona-module-a-caching';
|
|
9
|
-
import { SymbolDecoratorRule,
|
|
9
|
+
import { SymbolDecoratorRule, SymbolOpenApiOptions } from 'vona-module-a-openapiutils';
|
|
10
10
|
import { SymbolRequestMappingHandler } from 'vona-module-a-web';
|
|
11
11
|
import { z } from 'zod';
|
|
12
12
|
import { ZodMetadata } from '@cabloy/zod-openapi';
|
|
@@ -31,17 +31,27 @@ function bodySchemaWrapperDefault(bodySchema) {
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
function getTargetDecoratorRules(target) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
function getTargetDecoratorRules(target, disableRegisterMetadata) {
|
|
35
|
+
if (!disableRegisterMetadata) {
|
|
36
|
+
registerMappedClassMetadataKey(target, SymbolDecoratorRule, {
|
|
37
|
+
partialClass: meta => {
|
|
38
|
+
return meta.optional();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
40
42
|
return appMetadata.getOwnMetadataMap(true, SymbolDecoratorRule, target);
|
|
41
43
|
}
|
|
42
44
|
function getTargetDecoratorRuleColumns(target) {
|
|
43
|
-
|
|
44
|
-
return
|
|
45
|
+
const rules = getTargetDecoratorRules(target, true);
|
|
46
|
+
return Object.keys(rules);
|
|
47
|
+
}
|
|
48
|
+
function getTargetDecoratorRuleColumnsMap(target) {
|
|
49
|
+
const columns = getTargetDecoratorRuleColumns(target);
|
|
50
|
+
const map = {};
|
|
51
|
+
for (const column of columns) {
|
|
52
|
+
map[column] = column;
|
|
53
|
+
}
|
|
54
|
+
return map;
|
|
45
55
|
}
|
|
46
56
|
function mergeFieldsOpenapiMetadata(target) {
|
|
47
57
|
// rules
|
|
@@ -623,9 +633,6 @@ function Field(...schemaLikes) {
|
|
|
623
633
|
// rule
|
|
624
634
|
const metaType = appMetadata.getDesignType(target, prop);
|
|
625
635
|
rules[prop] = makeSchemaLikes(schemaLikes, metaType);
|
|
626
|
-
//
|
|
627
|
-
const columns = getTargetDecoratorRuleColumns(target);
|
|
628
|
-
columns[prop] = prop;
|
|
629
636
|
};
|
|
630
637
|
}
|
|
631
638
|
|
|
@@ -962,4 +969,4 @@ const OrderBusinessBase = 1000;
|
|
|
962
969
|
const OrderUnknownBase = 10000;
|
|
963
970
|
const OrderMaxBase = 100000;
|
|
964
971
|
|
|
965
|
-
export { $schema, $schemaLazy, Api, Main, OrderBusinessBase, OrderCoreBase, OrderMaxBase, OrderUnknownBase, ScopeModuleAOpenapi, ServiceOpenapi, SummerCacheJson, SymbolRouteHandlersArgumentsMeta, SymbolRouteHandlersArgumentsValue, SymbolSchemaDynamicRefId, addSchemaDynamic, bodySchemaWrapperDefault, config, getSchemaDynamic, getSchemasDynamic, getTargetDecoratorRuleColumns, getTargetDecoratorRules, makeSchemaLike, makeSchemaLikes, mergeFieldsOpenapiMetadata, prepareClassType, schemaRefCustomAdapter, v };
|
|
972
|
+
export { $schema, $schemaLazy, Api, Main, OrderBusinessBase, OrderCoreBase, OrderMaxBase, OrderUnknownBase, ScopeModuleAOpenapi, ServiceOpenapi, SummerCacheJson, SymbolRouteHandlersArgumentsMeta, SymbolRouteHandlersArgumentsValue, SymbolSchemaDynamicRefId, addSchemaDynamic, bodySchemaWrapperDefault, config, getSchemaDynamic, getSchemasDynamic, getTargetDecoratorRuleColumns, getTargetDecoratorRuleColumnsMap, getTargetDecoratorRules, makeSchemaLike, makeSchemaLikes, mergeFieldsOpenapiMetadata, prepareClassType, schemaRefCustomAdapter, v };
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Constructable } from 'vona';
|
|
2
2
|
import type { TypeDecoratorRules } from 'vona-module-a-openapiutils';
|
|
3
|
-
export declare function getTargetDecoratorRules(target: object): TypeDecoratorRules;
|
|
4
|
-
export declare function getTargetDecoratorRuleColumns(target: object):
|
|
3
|
+
export declare function getTargetDecoratorRules(target: object, disableRegisterMetadata?: boolean): TypeDecoratorRules;
|
|
4
|
+
export declare function getTargetDecoratorRuleColumns(target: object): string[];
|
|
5
|
+
export declare function getTargetDecoratorRuleColumnsMap(target: object): Record<string, string>;
|
|
5
6
|
export declare function mergeFieldsOpenapiMetadata(target: Constructable): void;
|
|
6
7
|
export declare function prepareClassType<T>(classType: (() => Constructable<T>) | Constructable<T>): Constructable<T>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-openapi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.32",
|
|
5
5
|
"title": "a-openapi",
|
|
6
6
|
"vonaModule": {
|
|
7
7
|
"capabilities": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"static"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@cabloy/zod-errors-custom": "^2.0.
|
|
38
|
+
"@cabloy/zod-errors-custom": "^2.0.2",
|
|
39
39
|
"@cabloy/zod-openapi": "^1.0.1",
|
|
40
40
|
"@cabloy/zod-query": "^2.0.1",
|
|
41
41
|
"@cabloy/zod-to-openapi": "^8.1.1",
|