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 +21 -21
- package/dist/lib/decorator/request.d.ts +2 -2
- package/dist/types/request.d.ts +0 -9
- package/dist/types/router.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -192,16 +192,16 @@ function _collectArgumentMiddlewares(onionPipe, argMeta) {
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
const SymbolRequestMappingHandler = Symbol('SymbolRequestMappingHandler');
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
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 ||
|
|
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:
|
|
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 ||
|
|
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(
|
|
591
|
-
const Get = createMappingDecorator(
|
|
592
|
-
const Delete = createMappingDecorator(
|
|
593
|
-
const Put = createMappingDecorator(
|
|
594
|
-
const Patch = createMappingDecorator(
|
|
595
|
-
const Options = createMappingDecorator(
|
|
596
|
-
const Head = createMappingDecorator(
|
|
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,
|
|
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 {
|
|
2
|
+
import type { TypeRequestMethod } from '../../types/request.ts';
|
|
3
3
|
export interface RequestMappingMetadata {
|
|
4
4
|
path?: string;
|
|
5
|
-
method?:
|
|
5
|
+
method?: TypeRequestMethod;
|
|
6
6
|
options?: IOpenApiOptions;
|
|
7
7
|
}
|
|
8
8
|
export declare function RequestMapping(metadata?: RequestMappingMetadata): MethodDecorator;
|
package/dist/types/request.d.ts
CHANGED
|
@@ -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
|
-
}
|
package/dist/types/router.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type Router from 'find-my-way';
|
|
2
2
|
import type { Constructable } from 'vona';
|
|
3
|
-
import type {
|
|
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:
|
|
15
|
+
routeMethod: TypeRequestMethod;
|
|
16
16
|
routePath: string | RegExp;
|
|
17
17
|
routePathRaw: string | RegExp;
|
|
18
18
|
}
|