vona-module-a-web 5.0.11 → 5.0.12

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
@@ -192,16 +192,16 @@ function _collectArgumentMiddlewares(onionPipe, argMeta) {
192
192
  }
193
193
 
194
194
  const SymbolRequestMappingHandler = Symbol('SymbolRequestMappingHandler');
195
- let RequestMethod = /*#__PURE__*/function (RequestMethod) {
196
- RequestMethod["GET"] = "get";
197
- RequestMethod["POST"] = "post";
198
- RequestMethod["PUT"] = "put";
199
- RequestMethod["DELETE"] = "delete";
200
- RequestMethod["PATCH"] = "patch";
201
- RequestMethod["OPTIONS"] = "options";
202
- RequestMethod["HEAD"] = "head";
203
- return RequestMethod;
204
- }({});
195
+
196
+ // export enum RequestMethod {
197
+ // GET = 'get',
198
+ // POST = 'post',
199
+ // PUT = 'put',
200
+ // DELETE = 'delete',
201
+ // PATCH = 'patch',
202
+ // OPTIONS = 'options',
203
+ // HEAD = 'head',
204
+ // }
205
205
 
206
206
  var _dec$3, _dec2$3, _class$3;
207
207
  const SymbolRouteComposeMiddlewaresCache = Symbol('SymbolRouteComposeMiddlewaresCache');
@@ -250,7 +250,7 @@ let BeanRouter = (_dec$3 = Bean(), _dec2$3 = BeanInfo({
250
250
  if (!appMetadata.hasMetadata(SymbolRequestMappingHandler, controller.prototype, actionKey)) return;
251
251
  const handlerMetadata = appMetadata.getMetadata(SymbolRequestMappingHandler, controller.prototype, actionKey);
252
252
  const actionPath = handlerMetadata.path || '';
253
- const actionMethod = handlerMetadata.method || RequestMethod.GET;
253
+ const actionMethod = handlerMetadata.method || 'get';
254
254
  // routePath
255
255
  const routePath = app.util.combineApiPathControllerAndAction(info.relativeName, controllerPath, actionPath, true, true);
256
256
  const routePathRaw = app.util.combineApiPathControllerAndActionRaw(info.relativeName, controllerPath, actionPath, true);
@@ -554,13 +554,13 @@ function mergeActionsOpenAPIMetadata(target) {
554
554
  }
555
555
 
556
556
  const defaultMetadata = {
557
- method: RequestMethod.GET,
557
+ method: 'get',
558
558
  path: '',
559
559
  options: undefined
560
560
  };
561
561
  function RequestMapping(metadata = defaultMetadata) {
562
562
  const path = metadata.path || '';
563
- const method = metadata.method || RequestMethod.GET;
563
+ const method = metadata.method || 'get';
564
564
  const options = metadata.options;
565
565
  return (target, prop, descriptor) => {
566
566
  appMetadata.defineMetadata(SymbolRequestMappingHandler, {
@@ -587,13 +587,13 @@ function createMappingDecorator(method) {
587
587
  });
588
588
  };
589
589
  }
590
- const Post = createMappingDecorator(RequestMethod.POST);
591
- const Get = createMappingDecorator(RequestMethod.GET);
592
- const Delete = createMappingDecorator(RequestMethod.DELETE);
593
- const Put = createMappingDecorator(RequestMethod.PUT);
594
- const Patch = createMappingDecorator(RequestMethod.PATCH);
595
- const Options = createMappingDecorator(RequestMethod.OPTIONS);
596
- const Head = createMappingDecorator(RequestMethod.HEAD);
590
+ const Post = createMappingDecorator('post');
591
+ const Get = createMappingDecorator('get');
592
+ const Delete = createMappingDecorator('delete');
593
+ const Put = createMappingDecorator('put');
594
+ const Patch = createMappingDecorator('patch');
595
+ const Options = createMappingDecorator('options');
596
+ const Head = createMappingDecorator('head');
597
597
  const Web = {
598
598
  post: Post,
599
599
  get: Get,
@@ -611,4 +611,4 @@ function $apiPathAndCombineParamsAndQuery(path, options) {
611
611
  return combineParamsAndQuery(path, options);
612
612
  }
613
613
 
614
- export { $apiPath, $apiPathAndCombineParamsAndQuery, BeanRouter, Controller, Dto, Main, RequestMapping, RequestMethod, ScopeModuleAWeb, Service, ServiceWeb, StartupListen, SymbolRequestMappingHandler, Web, config, mergeActionsOpenAPIMetadata };
614
+ export { $apiPath, $apiPathAndCombineParamsAndQuery, BeanRouter, Controller, Dto, Main, RequestMapping, ScopeModuleAWeb, Service, ServiceWeb, StartupListen, SymbolRequestMappingHandler, Web, config, mergeActionsOpenAPIMetadata };
@@ -1,8 +1,8 @@
1
1
  import type { IOpenApiOptions } from 'vona-module-a-openapi';
2
- import { RequestMethod } from '../../types/request.ts';
2
+ import type { TypeRequestMethod } from '../../types/request.ts';
3
3
  export interface RequestMappingMetadata {
4
4
  path?: string;
5
- method?: RequestMethod;
5
+ method?: TypeRequestMethod;
6
6
  options?: IOpenApiOptions;
7
7
  }
8
8
  export declare function RequestMapping(metadata?: RequestMappingMetadata): MethodDecorator;
@@ -1,11 +1,2 @@
1
1
  export declare const SymbolRequestMappingHandler: unique symbol;
2
2
  export type TypeRequestMethod = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'options' | 'head';
3
- export declare enum RequestMethod {
4
- GET = "get",
5
- POST = "post",
6
- PUT = "put",
7
- DELETE = "delete",
8
- PATCH = "patch",
9
- OPTIONS = "options",
10
- HEAD = "head"
11
- }
@@ -1,6 +1,6 @@
1
1
  import type Router from 'find-my-way';
2
2
  import type { Constructable } from 'vona';
3
- import type { RequestMethod } from './request.ts';
3
+ import type { TypeRequestMethod } from './request.ts';
4
4
  export interface ContextRouteMetadata {
5
5
  meta: any;
6
6
  }
@@ -12,7 +12,7 @@ export interface ContextRoute {
12
12
  controllerBeanFullName: string;
13
13
  action: string;
14
14
  route: ContextRouteMetadata;
15
- routeMethod: RequestMethod;
15
+ routeMethod: TypeRequestMethod;
16
16
  routePath: string | RegExp;
17
17
  routePathRaw: string | RegExp;
18
18
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-a-web",
3
3
  "type": "module",
4
- "version": "5.0.11",
4
+ "version": "5.0.12",
5
5
  "title": "a-web",
6
6
  "vonaModule": {
7
7
  "capabilities": {