vona-module-a-openapi 5.0.21 → 5.0.24
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/.metadata/index.d.ts +21 -1
- package/dist/bean/summerCache.json.d.ts +7 -0
- package/dist/config/config.d.ts +1 -1
- package/dist/index.js +49 -23
- package/dist/lib/decorator/api.d.ts +1 -4
- package/dist/lib/decorator/arguments.d.ts +1 -1
- package/dist/lib/decorator/field.d.ts +1 -1
- package/dist/lib/decorator/pipesArgument.d.ts +2 -1
- package/dist/lib/schema/makeSchemaLikes.d.ts +1 -1
- package/dist/lib/schema/v/system.d.ts +2 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/service/openapi.d.ts +5 -3
- package/dist/types/decorator.d.ts +0 -4
- package/dist/types/index.d.ts +0 -1
- package/dist/types/rest.d.ts +3 -3
- package/package.json +1 -1
- package/dist/types/api.d.ts +0 -39
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** service: begin */
|
|
2
2
|
export * from '../service/openapi.ts';
|
|
3
3
|
import 'vona';
|
|
4
|
-
declare module 'vona-module-a-
|
|
4
|
+
declare module 'vona-module-a-bean' {
|
|
5
5
|
interface IServiceRecord {
|
|
6
6
|
'a-openapi:openapi': never;
|
|
7
7
|
}
|
|
@@ -25,6 +25,25 @@ declare module 'vona' {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
/** service: end */
|
|
28
|
+
/** summerCache: begin */
|
|
29
|
+
export * from '../bean/summerCache.json.ts';
|
|
30
|
+
import { type IDecoratorSummerCacheOptions } from 'vona-module-a-summer';
|
|
31
|
+
declare module 'vona-module-a-summer' {
|
|
32
|
+
interface ISummerCacheRecord {
|
|
33
|
+
'a-openapi:json': IDecoratorSummerCacheOptions;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
declare module 'vona-module-a-openapi' {
|
|
37
|
+
interface SummerCacheJson {
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** summerCache: end */
|
|
41
|
+
/** summerCache: begin */
|
|
42
|
+
import type { SummerCacheJson } from '../bean/summerCache.json.ts';
|
|
43
|
+
export interface IModuleSummerCache {
|
|
44
|
+
'json': SummerCacheJson;
|
|
45
|
+
}
|
|
46
|
+
/** summerCache: end */
|
|
28
47
|
/** config: begin */
|
|
29
48
|
export * from '../config/config.ts';
|
|
30
49
|
import type { config } from '../config/config.ts';
|
|
@@ -201,6 +220,7 @@ export interface ScopeModuleAOpenapi {
|
|
|
201
220
|
config: TypeModuleConfig<typeof config>;
|
|
202
221
|
locale: TypeModuleLocales<(typeof locales)[TypeLocaleBase]>;
|
|
203
222
|
service: IModuleService;
|
|
223
|
+
summerCache: IModuleSummerCache;
|
|
204
224
|
}
|
|
205
225
|
import 'vona';
|
|
206
226
|
declare module 'vona' {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ISummerCacheGet, TSummerCacheActionOptions } from 'vona-module-a-summer';
|
|
2
|
+
import { BeanSummerCacheBase } from 'vona-module-a-summer';
|
|
3
|
+
export type TSummerCacheJsonKey = any;
|
|
4
|
+
export type TSummerCacheJsonData = any;
|
|
5
|
+
export declare class SummerCacheJson extends BeanSummerCacheBase<TSummerCacheJsonKey, TSummerCacheJsonData> implements ISummerCacheGet<TSummerCacheJsonKey, TSummerCacheJsonData> {
|
|
6
|
+
getNative(_key?: TSummerCacheJsonKey, _options?: TSummerCacheActionOptions<TSummerCacheJsonKey, TSummerCacheJsonData>): Promise<TSummerCacheJsonData | null | undefined>;
|
|
7
|
+
}
|
package/dist/config/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OpenAPIObjectConfig as OpenAPIObjectConfigV30 } from '@asteasolutions/zod-to-openapi/dist/v3.0/openapi-generator.ts';
|
|
2
2
|
import type { OpenAPIObjectConfigV31 } from '@asteasolutions/zod-to-openapi/dist/v3.1/openapi-generator.ts';
|
|
3
3
|
import type { VonaApplication } from 'vona';
|
|
4
|
-
import type { TypeOpenApiVersion, TypeSecuritySchemes } from '
|
|
4
|
+
import type { TypeOpenApiVersion, TypeSecuritySchemes } from 'vona-module-a-openapiutils';
|
|
5
5
|
export declare function config(_app: VonaApplication): {
|
|
6
6
|
defaultVersion: TypeOpenApiVersion;
|
|
7
7
|
generateDocument: {
|
package/dist/index.js
CHANGED
|
@@ -4,13 +4,25 @@ import * as ModuleInfo from '@cabloy/module-info';
|
|
|
4
4
|
import { isEmptyObject, isNil } from '@cabloy/utils';
|
|
5
5
|
import { toUpperCaseFirstChar } from '@cabloy/word-utils';
|
|
6
6
|
import { getTypeName, coerceWithNil } from '@cabloy/zod-query';
|
|
7
|
-
import { Service,
|
|
7
|
+
import { Service, Scope } from 'vona-module-a-bean';
|
|
8
|
+
import { Caching } from 'vona-module-a-caching';
|
|
9
|
+
import { SymbolDecoratorRule, SymbolOpenApiOptions, SymbolDecoratorRuleColumn } from 'vona-module-a-openapiutils';
|
|
10
|
+
import { SymbolRequestMappingHandler } from 'vona-module-a-web';
|
|
8
11
|
import { z } from 'zod';
|
|
12
|
+
import { SummerCache, BeanSummerCacheBase } from 'vona-module-a-summer';
|
|
9
13
|
import { locales as locales$1, setErrorMapDefault, setErrorMapSchema } from '@cabloy/zod-errors-custom';
|
|
10
|
-
import { Scope } from 'vona-module-a-bean';
|
|
11
14
|
import 'openapi3-ts/oas30';
|
|
12
15
|
import 'openapi3-ts/oas31';
|
|
13
16
|
|
|
17
|
+
function _applyDecoratedDescriptor(i, e, r, n, l) {
|
|
18
|
+
var a = {};
|
|
19
|
+
return Object.keys(n).forEach(function (i) {
|
|
20
|
+
a[i] = n[i];
|
|
21
|
+
}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = true), a = r.slice().reverse().reduce(function (r, n) {
|
|
22
|
+
return n(i, e, r) || r;
|
|
23
|
+
}, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;
|
|
24
|
+
}
|
|
25
|
+
|
|
14
26
|
function bodySchemaWrapperDefault(bodySchema) {
|
|
15
27
|
return z.object({
|
|
16
28
|
code: z.string(),
|
|
@@ -19,14 +31,6 @@ function bodySchemaWrapperDefault(bodySchema) {
|
|
|
19
31
|
});
|
|
20
32
|
}
|
|
21
33
|
|
|
22
|
-
const SymbolDecoratorRule = Symbol('SymbolDecoratorRule');
|
|
23
|
-
const SymbolDecoratorRuleColumn = Symbol('SymbolDecoratorRuleColumn');
|
|
24
|
-
|
|
25
|
-
// not use z.ZodSchema
|
|
26
|
-
|
|
27
|
-
const SymbolRouteHandlersArgumentsMeta = Symbol('SymbolRouteHandlersArgumentsMeta');
|
|
28
|
-
const SymbolRouteHandlersArgumentsValue = Symbol('SymbolRouteHandlersArgumentsValue');
|
|
29
|
-
|
|
30
34
|
function $schema(classType, options) {
|
|
31
35
|
if (!classType) return z.any();
|
|
32
36
|
if (classType.parseAsync) return classType;
|
|
@@ -55,21 +59,40 @@ function $schema(classType, options) {
|
|
|
55
59
|
return schema;
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
const
|
|
62
|
+
const SymbolRouteHandlersArgumentsMeta = Symbol('SymbolRouteHandlersArgumentsMeta');
|
|
63
|
+
const SymbolRouteHandlersArgumentsValue = Symbol('SymbolRouteHandlersArgumentsValue');
|
|
59
64
|
|
|
60
|
-
var _dec$
|
|
65
|
+
var _dec$2, _dec2$2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class$2, _class2;
|
|
61
66
|
const __ArgumentTypes = ['param', 'query', 'body', 'headers', 'fields', 'field', 'files', 'file'];
|
|
62
|
-
let ServiceOpenapi = (_dec$
|
|
67
|
+
let ServiceOpenapi = (_dec$2 = Service(), _dec2$2 = BeanInfo({
|
|
63
68
|
module: "a-openapi"
|
|
64
|
-
}),
|
|
65
|
-
|
|
69
|
+
}), _dec3 = Caching.get({
|
|
70
|
+
cacheName: 'a-openapi:json',
|
|
71
|
+
cacheKeyFn: 'generateJsonCacheKey'
|
|
72
|
+
}), _dec4 = Reflect.metadata("design:type", Function), _dec5 = Reflect.metadata("design:paramtypes", [typeof K === "undefined" ? Object : K]), _dec6 = Caching.get({
|
|
73
|
+
cacheName: 'a-openapi:json',
|
|
74
|
+
cacheKeyFn: 'generateJsonOfControllerActionCacheKey'
|
|
75
|
+
}), _dec7 = Reflect.metadata("design:type", Function), _dec8 = Reflect.metadata("design:paramtypes", [typeof Constructable === "undefined" ? Object : Constructable, String, typeof K === "undefined" ? Object : K]), _dec$2(_class$2 = _dec2$2(_class$2 = (_class2 = class ServiceOpenapi extends BeanBase {
|
|
76
|
+
generateJsonCacheKey(args, prop) {
|
|
77
|
+
const version = args[0] ?? 'V31';
|
|
78
|
+
const locale = this.ctx.locale;
|
|
79
|
+
return `${prop}_${version}_${locale}`;
|
|
80
|
+
}
|
|
81
|
+
generateJsonOfControllerActionCacheKey(args, prop) {
|
|
82
|
+
const [controller, actionKey, version] = args;
|
|
83
|
+
const beanOptions = appResource.getBean(controller);
|
|
84
|
+
const beanFullName = beanOptions.beanFullName;
|
|
85
|
+
const locale = this.ctx.locale;
|
|
86
|
+
return `${prop}_${beanFullName}_${actionKey}_${version ?? 'V31'}_${locale}`;
|
|
87
|
+
}
|
|
88
|
+
async generateJson(version = 'V31') {
|
|
66
89
|
const registry = this._collectRegistry();
|
|
67
90
|
const generator = version === 'V30' ? new OpenApiGeneratorV3(registry.definitions) : new OpenApiGeneratorV31(registry.definitions);
|
|
68
91
|
const apiObj = generator.generateDocument(this.scope.config.generateDocument[version]);
|
|
69
92
|
this._translate(apiObj, 'api');
|
|
70
93
|
return apiObj;
|
|
71
94
|
}
|
|
72
|
-
generateJsonOfControllerAction(controller, actionKey, version = 'V31') {
|
|
95
|
+
async generateJsonOfControllerAction(controller, actionKey, version = 'V31') {
|
|
73
96
|
const registry = new OpenAPIRegistry();
|
|
74
97
|
const beanOptions = appResource.getBean(controller);
|
|
75
98
|
if (!beanOptions) throw new Error('invalid controller');
|
|
@@ -284,7 +307,7 @@ let ServiceOpenapi = (_dec$1 = Service(), _dec2$1 = BeanInfo({
|
|
|
284
307
|
if (!schema) continue;
|
|
285
308
|
// check schema
|
|
286
309
|
if (getTypeName(schema) === 'ZodAny') {
|
|
287
|
-
throw new Error(`Invalid
|
|
310
|
+
throw new Error(`Invalid Openapi argument type: ${info.relativeName}:${controller.name}.${actionKey}#${argumentType}`);
|
|
288
311
|
}
|
|
289
312
|
// record
|
|
290
313
|
if (argumentType === 'body') {
|
|
@@ -378,6 +401,13 @@ let ServiceOpenapi = (_dec$1 = Service(), _dec2$1 = BeanInfo({
|
|
|
378
401
|
}
|
|
379
402
|
return objHeaders;
|
|
380
403
|
}
|
|
404
|
+
}, _applyDecoratedDescriptor(_class2.prototype, "generateJson", [_dec3, _dec4, _dec5], Object.getOwnPropertyDescriptor(_class2.prototype, "generateJson"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "generateJsonOfControllerAction", [_dec6, _dec7, _dec8], Object.getOwnPropertyDescriptor(_class2.prototype, "generateJsonOfControllerAction"), _class2.prototype), _class2)) || _class$2) || _class$2);
|
|
405
|
+
|
|
406
|
+
var _dec$1, _dec2$1, _class$1;
|
|
407
|
+
let SummerCacheJson = (_dec$1 = SummerCache(), _dec2$1 = BeanInfo({
|
|
408
|
+
module: "a-openapi"
|
|
409
|
+
}), _dec$1(_class$1 = _dec2$1(_class$1 = class SummerCacheJson extends BeanSummerCacheBase {
|
|
410
|
+
async getNative(_key, _options) {}
|
|
381
411
|
}) || _class$1) || _class$1);
|
|
382
412
|
|
|
383
413
|
function config(_app) {
|
|
@@ -481,7 +511,7 @@ function getTargetDecoratorRuleColumns(target) {
|
|
|
481
511
|
registerMappedClassMetadataKey(target, SymbolDecoratorRuleColumn);
|
|
482
512
|
return appMetadata.getOwnMetadataMap(true, SymbolDecoratorRuleColumn, target);
|
|
483
513
|
}
|
|
484
|
-
function
|
|
514
|
+
function mergeFieldsOpenapiMetadata(target) {
|
|
485
515
|
// rules
|
|
486
516
|
const rules = getTargetDecoratorRules(target.prototype);
|
|
487
517
|
// beanOptions
|
|
@@ -519,10 +549,6 @@ function Field$1(...schemaLikes) {
|
|
|
519
549
|
};
|
|
520
550
|
}
|
|
521
551
|
|
|
522
|
-
function setPublic(target, prop, _descriptor, value) {
|
|
523
|
-
const options = appMetadata.getOwnMetadataMap(false, SymbolOpenApiOptions, target, prop);
|
|
524
|
-
options.public = value;
|
|
525
|
-
}
|
|
526
552
|
function httpCode(httpCode) {
|
|
527
553
|
return function (target, prop, descriptor) {
|
|
528
554
|
const options = appMetadata.getOwnMetadataMap(false, SymbolOpenApiOptions, target, prop);
|
|
@@ -805,4 +831,4 @@ const OrderBusinessBase = 1000;
|
|
|
805
831
|
const OrderUnknownBase = 10000;
|
|
806
832
|
const OrderMaxBase = 100000;
|
|
807
833
|
|
|
808
|
-
export { $locale, $schema, Api, Arg, Main, OrderBusinessBase, OrderCoreBase, OrderMaxBase, OrderUnknownBase, ScopeModuleAOpenapi, ServiceOpenapi,
|
|
834
|
+
export { $locale, $schema, Api, Arg, Main, OrderBusinessBase, OrderCoreBase, OrderMaxBase, OrderUnknownBase, ScopeModuleAOpenapi, ServiceOpenapi, SummerCacheJson, SymbolRouteHandlersArgumentsMeta, SymbolRouteHandlersArgumentsValue, bodySchemaWrapperDefault, config, createPipesArgumentDecorator, errorsAdapter, getTargetDecoratorRuleColumns, getTargetDecoratorRules, locales, makeSchemaLike, makeSchemaLikes, mergeFieldsOpenapiMetadata, v };
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { IOpenApiHeader, TypeResponseContentType } from '../../types/api.ts';
|
|
3
|
-
import type { SchemaLike, SchemaLikeCreate } from '../../types/decorator.ts';
|
|
1
|
+
import type { IOpenApiHeader, SchemaLike, SchemaLikeCreate, TypeResponseContentType } from 'vona-module-a-openapiutils';
|
|
4
2
|
import { Field } from './field.ts';
|
|
5
|
-
export declare function setPublic(target: object, prop?: MetadataKey, _descriptor?: PropertyDescriptor, value?: boolean): void;
|
|
6
3
|
declare function httpCode(httpCode: number): MethodDecorator;
|
|
7
4
|
declare function contentType(contentType: TypeResponseContentType): MethodDecorator;
|
|
8
5
|
declare function body(...schemaLikes: SchemaLike[]): MethodDecorator;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SchemaLike } from '
|
|
1
|
+
import type { SchemaLike } from 'vona-module-a-openapiutils';
|
|
2
2
|
declare function Param(): ParameterDecorator;
|
|
3
3
|
declare function Param(...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
4
4
|
declare function Param(property: string, ...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { SchemaLike } from '
|
|
1
|
+
import type { SchemaLike } from 'vona-module-a-openapiutils';
|
|
2
2
|
export declare function Field(...schemaLikes: SchemaLike[]): PropertyDecorator;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SchemaLike } from 'vona-module-a-openapiutils';
|
|
2
|
+
import type { RouteHandlerArgumentType, TypeExtractValue } from '../../types/decorator.ts';
|
|
2
3
|
export declare function createPipesArgumentDecorator(paramType: RouteHandlerArgumentType, extractValue?: TypeExtractValue): (field?: string | SchemaLike, ...schemaLikes: SchemaLike[]) => ParameterDecorator;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import type { SchemaLike } from 'vona-module-a-openapiutils';
|
|
1
2
|
import type { z } from 'zod';
|
|
2
|
-
import type { SchemaLike } from '../../types/decorator.ts';
|
|
3
3
|
export declare function makeSchemaLikes(schemaLikes: SchemaLike[], typeInit: any): z.ZodSchema;
|
|
4
4
|
export declare function makeSchemaLike(schemaLike: SchemaLike | undefined, schemaPrevious: z.ZodSchema): z.ZodSchema;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Constructable } from 'vona';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SchemaLike } from 'vona-module-a-openapiutils';
|
|
3
|
+
import type { ISchemaObjectOptions } from '../../../types/decorator.ts';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
export declare function schemaDefault<T>(defaultValue: T): (schema: z.ZodSchema) => z.ZodSchema;
|
|
5
6
|
export declare function schemaOptional(): (schema: z.ZodSchema) => z.ZodSchema;
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Constructable } from 'vona';
|
|
2
2
|
export declare function getTargetDecoratorRules(target: object): Record<PropertyKey, unknown>;
|
|
3
3
|
export declare function getTargetDecoratorRuleColumns(target: object): Record<PropertyKey, unknown>;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function mergeFieldsOpenapiMetadata(target: Constructable): void;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Constructable } from 'vona';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IOpenapiObject } from 'vona-module-a-openapiutils';
|
|
3
3
|
import { BeanBase } from 'vona';
|
|
4
4
|
export declare class ServiceOpenapi extends BeanBase {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
protected generateJsonCacheKey(args: any[], prop: string): string;
|
|
6
|
+
protected generateJsonOfControllerActionCacheKey(args: any[], prop: string): string;
|
|
7
|
+
generateJson<K extends keyof IOpenapiObject>(version?: K): Promise<IOpenapiObject[K]>;
|
|
8
|
+
generateJsonOfControllerAction<K extends keyof IOpenapiObject>(controller: Constructable, actionKey: string, version?: K): Promise<IOpenapiObject[K]>;
|
|
7
9
|
private _translate;
|
|
8
10
|
private _translateSchema;
|
|
9
11
|
private _translateStrings;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { Constructable, Type, VonaContext } from 'vona';
|
|
2
2
|
import type { z } from 'zod';
|
|
3
|
-
export declare const SymbolDecoratorRule: unique symbol;
|
|
4
|
-
export declare const SymbolDecoratorRuleColumn: unique symbol;
|
|
5
|
-
export type SchemaLikeCreate = (schema: any) => any;
|
|
6
|
-
export type SchemaLike = SchemaLikeCreate | z.ZodSchema | Constructable;
|
|
7
3
|
export interface ISchemaObjectOptions {
|
|
8
4
|
passthrough?: boolean;
|
|
9
5
|
strict?: boolean;
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/rest.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ZodOpenAPIMetadata } from '@asteasolutions/zod-to-openapi';
|
|
2
2
|
import type { CurrencyOptions } from '@zhennann/currency';
|
|
3
|
+
import type { IOpenApiOptions } from 'vona-module-a-openapiutils';
|
|
3
4
|
import type { z, ZodTypeAny } from 'zod';
|
|
4
5
|
import type { TypeResourceActionRowRecordRender } from './actions.ts';
|
|
5
|
-
import type { IOpenApiOptions } from './api.ts';
|
|
6
6
|
import type { IComponentRecord } from './component.ts';
|
|
7
7
|
import 'openapi3-ts/oas30';
|
|
8
8
|
import 'openapi3-ts/oas31';
|
|
@@ -28,9 +28,9 @@ declare module 'openapi3-ts/oas31' {
|
|
|
28
28
|
export type TypeFieldRenderComponent = (keyof IComponentRecord) | (keyof TypeResourceActionRowRecordRender) | 'text' | 'textarea' | 'select' | 'checkbox' | 'radio' | 'switch' | 'image' | 'file' | 'color' | 'password' | 'email' | 'url';
|
|
29
29
|
export type TypeFieldRenderComponentProvider = (keyof IComponentRecord) | (keyof TypeResourceActionRowRecordRender) | 'input' | 'textarea' | 'select';
|
|
30
30
|
export type TypeSchemaScene = 'table' | 'form';
|
|
31
|
-
export type
|
|
31
|
+
export type TypeOpenapiMetadata<T extends ZodTypeAny = ZodTypeAny> = Partial<ZodOpenAPIMetadata<z.input<T>>>;
|
|
32
32
|
export type TypeEntityOptionsFields<T extends {}, More extends string | undefined = never> = {
|
|
33
|
-
[key in ((keyof T) | (More extends string ? More : never))]?:
|
|
33
|
+
[key in ((keyof T) | (More extends string ? More : never))]?: TypeOpenapiMetadata | z.ZodSchema;
|
|
34
34
|
};
|
|
35
35
|
export type TypeControllerOptionsActions<T extends {}> = {
|
|
36
36
|
[key in (keyof T)]?: IOpenApiOptions;
|
package/package.json
CHANGED
package/dist/types/api.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { OpenAPIObject as OpenAPIObject30, SchemaObject as SchemaObject30 } from 'openapi3-ts/oas30';
|
|
2
|
-
import type { OpenAPIObject as OpenAPIObject31, SchemaObject as SchemaObject31 } from 'openapi3-ts/oas31';
|
|
3
|
-
import type { VonaApplication } from 'vona';
|
|
4
|
-
import type { z } from 'zod';
|
|
5
|
-
import type { SchemaLikeCreate } from './decorator.ts';
|
|
6
|
-
export declare const SymbolOpenApiOptions: unique symbol;
|
|
7
|
-
export interface IOpenApiHeader {
|
|
8
|
-
name: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface IResponseHeaders {
|
|
12
|
-
[key: string]: string | string[];
|
|
13
|
-
}
|
|
14
|
-
export interface IOpenApiOptions {
|
|
15
|
-
public?: boolean;
|
|
16
|
-
description?: string;
|
|
17
|
-
summary?: string;
|
|
18
|
-
httpCode?: number;
|
|
19
|
-
contentType?: TypeResponseContentType;
|
|
20
|
-
bodySchema?: z.ZodSchema;
|
|
21
|
-
bodySchemaWrapper?: SchemaLikeCreate | false;
|
|
22
|
-
exclude?: boolean;
|
|
23
|
-
tags?: string[];
|
|
24
|
-
operationId?: string;
|
|
25
|
-
headers?: IOpenApiHeader[];
|
|
26
|
-
setHeaders?: IResponseHeaders;
|
|
27
|
-
}
|
|
28
|
-
export type TypeGenerateJsonScene = 'api' | 'rest';
|
|
29
|
-
export type TypeOpenApiVersion = 'V30' | 'V31';
|
|
30
|
-
export interface IOpenAPIObject {
|
|
31
|
-
V30: OpenAPIObject30;
|
|
32
|
-
V31: OpenAPIObject31;
|
|
33
|
-
}
|
|
34
|
-
export interface IOpenAPISchemaObject {
|
|
35
|
-
V30: SchemaObject30;
|
|
36
|
-
V31: SchemaObject31;
|
|
37
|
-
}
|
|
38
|
-
export type TypeSecuritySchemes = Record<string, ((this: VonaApplication) => object) | object>;
|
|
39
|
-
export type TypeResponseContentType = 'application/json' | 'application/xml' | 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain' | 'text/html' | 'application/octet-stream' | 'application/pdf' | 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp' | 'image/svg+xml' | 'image/bmp' | 'image/tiff' | 'image/vnd.microsoft.icon' | 'image/vnd.wap.wbmp' | 'image/x-icon' | 'image/x-jng' | 'image/x-ms-bmp' | 'image/x-portable-bitmap' | 'image/x-portable-graymap' | 'image/x-portable-pixmap' | 'image/x-xbitmap' | 'image/x-xpixmap' | 'image/x-xwindowdump' | 'image/bmp' | 'image/x-bmp' | 'image/x-xbitmap' | 'image/x-win-bitmap' | 'image/x-windows-bmp' | 'image/ms-bmp' | 'image/x-ms-bmp' | 'image/x-icon' | 'image/x-ico' | 'image/vnd.microsoft.icon' | 'image/ico' | 'image/icon' | 'text/css' | 'text/csv' | 'text/html' | 'text/javascript' | 'text/plain' | 'text/xml' | 'application/javascript' | 'application/ecmascript' | 'application/json' | 'application/ld+json' | 'application/manifest+json' | 'application/javascript' | 'application/x-javascript' | 'application/x-json' | 'application/x-ms-application';
|