vona-module-a-openapiutils 5.0.16 → 5.0.17

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 CHANGED
@@ -41,10 +41,9 @@ const OrderLevelBaseMap = {
41
41
 
42
42
  const SymbolRouteHandlersArgumentsMeta = Symbol('SymbolRouteHandlersArgumentsMeta');
43
43
  const SymbolRouteHandlersArgumentsValue = Symbol('SymbolRouteHandlersArgumentsValue');
44
-
45
44
  const SymbolOpenApiOptions = Symbol('SymbolOpenApiOptions');
46
-
47
45
  const SymbolDecoratorRule = Symbol('SymbolDecoratorRule');
46
+ const SymbolControllerResource = Symbol('SymbolControllerResource');
48
47
 
49
48
  function getTargetDecoratorRules(target, disableRegisterMetadata) {
50
49
  if (!disableRegisterMetadata) {
@@ -768,6 +767,13 @@ function setPublic(target, prop, _descriptor, value) {
768
767
  options.public = value;
769
768
  }
770
769
 
770
+ function Resource() {
771
+ return function (target) {
772
+ // controller resource
773
+ appMetadata.defineMetadata(SymbolControllerResource, true, target);
774
+ };
775
+ }
776
+
771
777
  function bodySchemaWrapperDefault(bodySchema) {
772
778
  return z.object({
773
779
  code: z.string(),
@@ -786,4 +792,4 @@ function $makeFilterTransform(filterTransformName, options) {
786
792
  return [filterTransformName, options];
787
793
  }
788
794
 
789
- export { $apiPath, $apiPathAndCombineParamsAndQuery, $locale, $makeFilterTransform, $makeSchema, $schema, $schemaLazy, Api, OrderBusinessBase, OrderCoreBase, OrderLevelBaseMap, OrderMaxBase, OrderUnknownBase, ScopeModuleAOpenapiutils, SymbolDecoratorRule, SymbolOpenApiOptions, SymbolRouteHandlersArgumentsMeta, SymbolRouteHandlersArgumentsValue, SymbolSchemaDynamicRefId, addSchemaDynamic, bodySchemaWrapperDefault, getSchemaDynamic, getSchemasDynamic, getTargetDecoratorRuleColumns, getTargetDecoratorRuleColumnsMap, getTargetDecoratorRules, locales, makeSchemaLike, makeSchemaLikes, mergeFieldOpenapiMetadata, mergeFieldsOpenapiMetadata, normalizeErrorParams, prepareClassType, setPublic, v };
795
+ export { $apiPath, $apiPathAndCombineParamsAndQuery, $locale, $makeFilterTransform, $makeSchema, $schema, $schemaLazy, Api, OrderBusinessBase, OrderCoreBase, OrderLevelBaseMap, OrderMaxBase, OrderUnknownBase, Resource, ScopeModuleAOpenapiutils, SymbolControllerResource, SymbolDecoratorRule, SymbolOpenApiOptions, SymbolRouteHandlersArgumentsMeta, SymbolRouteHandlersArgumentsValue, SymbolSchemaDynamicRefId, addSchemaDynamic, bodySchemaWrapperDefault, getSchemaDynamic, getSchemasDynamic, getTargetDecoratorRuleColumns, getTargetDecoratorRuleColumnsMap, getTargetDecoratorRules, locales, makeSchemaLike, makeSchemaLikes, mergeFieldOpenapiMetadata, mergeFieldsOpenapiMetadata, normalizeErrorParams, prepareClassType, setPublic, v };
@@ -1,2 +1,5 @@
1
1
  export declare const SymbolRouteHandlersArgumentsMeta: unique symbol;
2
2
  export declare const SymbolRouteHandlersArgumentsValue: unique symbol;
3
+ export declare const SymbolOpenApiOptions: unique symbol;
4
+ export declare const SymbolDecoratorRule: unique symbol;
5
+ export declare const SymbolControllerResource: unique symbol;
@@ -1,5 +1,5 @@
1
1
  import type { MetadataKey } from 'vona';
2
- import type { IOpenApiHeader, TypeResponseContentType } from '../../types/api.ts';
2
+ import type { IOpenapiHeader, TypeResponseContentType } from '../../types/api.ts';
3
3
  import type { SchemaLike, SchemaLikeCreate } from '../../types/decorator.ts';
4
4
  import { Field } from './field.ts';
5
5
  declare function httpCode(httpCode: number): MethodDecorator;
@@ -8,8 +8,8 @@ declare function body(...schemaLikes: SchemaLike[]): MethodDecorator;
8
8
  declare function bodyCustom(bodySchemaWrapper: SchemaLikeCreate | false, ...schemaLikes: SchemaLike[]): MethodDecorator;
9
9
  declare function exclude(): ClassDecorator & MethodDecorator;
10
10
  declare function tags(tags: string[]): ClassDecorator & MethodDecorator;
11
- declare function header(header: IOpenApiHeader): ClassDecorator & MethodDecorator;
12
- declare function headers(headers: IOpenApiHeader[]): ClassDecorator & MethodDecorator;
11
+ declare function header(header: IOpenapiHeader): ClassDecorator & MethodDecorator;
12
+ declare function headers(headers: IOpenapiHeader[]): ClassDecorator & MethodDecorator;
13
13
  declare function setHeader(field: {
14
14
  [key: string]: string | string[];
15
15
  }): ClassDecorator & MethodDecorator;
@@ -1 +1,2 @@
1
1
  export * from './api.ts';
2
+ export * from './resource.ts';
@@ -0,0 +1 @@
1
+ export declare function Resource(): ClassDecorator;
@@ -3,8 +3,7 @@ import type { OpenAPIObject as OpenAPIObject31, SchemaObject as SchemaObject31 }
3
3
  import type { ILocaleMagic, VonaApplication } from 'vona';
4
4
  import type z from 'zod';
5
5
  import type { SchemaLikeCreate } from './decorator.ts';
6
- export declare const SymbolOpenApiOptions: unique symbol;
7
- export interface IOpenApiHeader {
6
+ export interface IOpenapiHeader {
8
7
  name: string;
9
8
  description?: string;
10
9
  }
@@ -22,7 +21,7 @@ export interface IOpenapiSchemaObject {
22
21
  V31: SchemaObject31;
23
22
  }
24
23
  export type TypeSecuritySchemes = Record<string, ((this: VonaApplication) => object) | object>;
25
- export interface IOpenApiOptions {
24
+ export interface IOpenapiOptions {
26
25
  public?: boolean;
27
26
  description?: string | ILocaleMagic;
28
27
  summary?: string | ILocaleMagic;
@@ -33,7 +32,7 @@ export interface IOpenApiOptions {
33
32
  exclude?: boolean;
34
33
  tags?: string[];
35
34
  operationId?: string;
36
- headers?: IOpenApiHeader[];
35
+ headers?: IOpenapiHeader[];
37
36
  setHeaders?: IResponseHeaders;
38
37
  }
39
38
  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';
@@ -3,4 +3,3 @@ import type z from 'zod';
3
3
  export type SchemaLikeCreate = (schema: any) => any;
4
4
  export type SchemaLike<T = unknown> = SchemaLikeCreate | z.ZodType<T> | Constructable;
5
5
  export type TypeDecoratorRules = Record<string, z.ZodType | undefined>;
6
- export declare const SymbolDecoratorRule: unique symbol;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-a-openapiutils",
3
3
  "type": "module",
4
- "version": "5.0.16",
4
+ "version": "5.0.17",
5
5
  "title": "a-openapiutils",
6
6
  "vonaModule": {
7
7
  "dependencies": {}