vona-module-a-web 5.0.15 → 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/.metadata/index.d.ts +38 -39
- package/dist/index.js +27 -30
- package/dist/lib/decorator/bean.d.ts +0 -1
- package/dist/lib/decorator/request.d.ts +1 -1
- package/dist/types/index.d.ts +0 -1
- package/package.json +1 -8
- package/cli/service/boilerplate/{{beanName}}.ts_ +0 -5
- package/dist/types/service.d.ts +0 -13
|
@@ -1,51 +1,26 @@
|
|
|
1
|
-
import type { BeanScopeUtil, TypeModuleConfig } from 'vona';
|
|
2
|
-
import type { IDecoratorStartupOptions } from 'vona-module-a-startup';
|
|
3
|
-
/** bean: end */
|
|
4
1
|
/** bean: begin */
|
|
5
|
-
import type { BeanRouter } from '../bean/bean.router.ts';
|
|
6
|
-
import type { config } from '../config/config.ts';
|
|
7
|
-
/** service: end */
|
|
8
|
-
/** service: begin */
|
|
9
|
-
import type { ServiceWeb } from '../service/web.ts';
|
|
10
|
-
/** main: end */
|
|
11
|
-
/** scope: begin */
|
|
12
|
-
import { BeanScopeBase } from 'vona';
|
|
13
|
-
/** service: end */
|
|
14
|
-
/** service: begin */
|
|
15
|
-
/** bean: begin */
|
|
16
|
-
import 'vona';
|
|
17
|
-
import 'vona';
|
|
18
|
-
import 'vona';
|
|
19
|
-
import 'vona';
|
|
20
|
-
import 'vona';
|
|
21
2
|
export * from '../bean/bean.router.ts';
|
|
3
|
+
import 'vona';
|
|
22
4
|
declare module 'vona' {
|
|
23
5
|
}
|
|
24
6
|
declare module 'vona-module-a-web' {
|
|
25
7
|
interface BeanRouter {
|
|
26
8
|
}
|
|
27
9
|
}
|
|
10
|
+
/** bean: end */
|
|
11
|
+
/** bean: begin */
|
|
12
|
+
import type { BeanRouter } from '../bean/bean.router.ts';
|
|
13
|
+
import 'vona';
|
|
28
14
|
declare module 'vona' {
|
|
29
15
|
interface IBeanRecordGlobal {
|
|
30
|
-
router: BeanRouter;
|
|
16
|
+
'router': BeanRouter;
|
|
31
17
|
}
|
|
32
18
|
}
|
|
33
19
|
/** bean: end */
|
|
34
|
-
/**
|
|
35
|
-
export * from '../
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
'a-web:listen': IDecoratorStartupOptions;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
declare module 'vona-module-a-web' {
|
|
42
|
-
interface StartupListen {
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
/** service: end */
|
|
46
|
-
/** config: begin */
|
|
47
|
-
export * from '../config/config.ts';
|
|
48
|
-
declare module 'vona-module-a-web' {
|
|
20
|
+
/** service: begin */
|
|
21
|
+
export * from '../service/web.ts';
|
|
22
|
+
import 'vona';
|
|
23
|
+
declare module 'vona-module-a-bean' {
|
|
49
24
|
interface IServiceRecord {
|
|
50
25
|
'a-web:web': never;
|
|
51
26
|
}
|
|
@@ -54,20 +29,43 @@ declare module 'vona-module-a-web' {
|
|
|
54
29
|
interface ServiceWeb {
|
|
55
30
|
}
|
|
56
31
|
}
|
|
32
|
+
/** service: end */
|
|
33
|
+
/** service: begin */
|
|
34
|
+
import type { ServiceWeb } from '../service/web.ts';
|
|
57
35
|
export interface IModuleService {
|
|
58
|
-
web: ServiceWeb;
|
|
36
|
+
'web': ServiceWeb;
|
|
59
37
|
}
|
|
38
|
+
/** service: end */
|
|
39
|
+
/** service: begin */
|
|
40
|
+
import 'vona';
|
|
60
41
|
declare module 'vona' {
|
|
61
42
|
interface IBeanRecordGeneral {
|
|
62
43
|
'a-web.service.web': ServiceWeb;
|
|
63
44
|
}
|
|
64
45
|
}
|
|
46
|
+
/** service: end */
|
|
47
|
+
/** startup: begin */
|
|
48
|
+
export * from '../bean/startup.listen.ts';
|
|
49
|
+
import { type IDecoratorStartupOptions } from 'vona-module-a-startup';
|
|
50
|
+
declare module 'vona-module-a-startup' {
|
|
51
|
+
interface IStartupRecord {
|
|
52
|
+
'a-web:listen': IDecoratorStartupOptions;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
declare module 'vona-module-a-web' {
|
|
56
|
+
interface StartupListen {
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/** startup: end */
|
|
60
|
+
/** config: begin */
|
|
61
|
+
export * from '../config/config.ts';
|
|
62
|
+
import type { config } from '../config/config.ts';
|
|
65
63
|
/** config: end */
|
|
66
64
|
/** main: begin */
|
|
67
65
|
export * from '../main.ts';
|
|
68
|
-
/**
|
|
69
|
-
/**
|
|
70
|
-
|
|
66
|
+
/** main: end */
|
|
67
|
+
/** scope: begin */
|
|
68
|
+
import { BeanScopeBase, type BeanScopeUtil, type TypeModuleConfig } from 'vona';
|
|
71
69
|
export declare class ScopeModuleAWeb extends BeanScopeBase {
|
|
72
70
|
}
|
|
73
71
|
export interface ScopeModuleAWeb {
|
|
@@ -75,6 +73,7 @@ export interface ScopeModuleAWeb {
|
|
|
75
73
|
config: TypeModuleConfig<typeof config>;
|
|
76
74
|
service: IModuleService;
|
|
77
75
|
}
|
|
76
|
+
import 'vona';
|
|
78
77
|
declare module 'vona' {
|
|
79
78
|
interface IBeanScopeRecord {
|
|
80
79
|
'a-web': ScopeModuleAWeb;
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { appMetadata, BeanInfo, BeanBase, appResource, deepExtend, compose, cast, BeanSimple, BeanScopeBase, createBeanDecorator } from 'vona';
|
|
2
|
-
import { Bean, Scope } from 'vona-module-a-bean';
|
|
3
2
|
import * as ModuleInfo from '@cabloy/module-info';
|
|
3
|
+
import { Bean, Service, Scope } from 'vona-module-a-bean';
|
|
4
4
|
import { SymbolUseOnionOptions } from 'vona-module-a-onion';
|
|
5
|
-
import { SymbolRouteHandlersArgumentsValue, SymbolRouteHandlersArgumentsMeta,
|
|
5
|
+
import { SymbolRouteHandlersArgumentsValue, SymbolRouteHandlersArgumentsMeta, mergeFieldsOpenAPIMetadata } from 'vona-module-a-openapi';
|
|
6
6
|
import { valid } from 'vona-module-a-validation';
|
|
7
7
|
import { SymbolUploadValue } from 'vona-module-a-upload';
|
|
8
8
|
import http from 'node:http';
|
|
9
9
|
import { Startup } from 'vona-module-a-startup';
|
|
10
10
|
import Router from 'find-my-way';
|
|
11
11
|
import { SymbolRouterMiddleware } from 'vona-module-a-executor';
|
|
12
|
-
import {
|
|
12
|
+
import { SymbolOpenApiOptions } from 'vona-module-a-openapiutils';
|
|
13
13
|
import { combineParamsAndQuery } from '@cabloy/utils';
|
|
14
14
|
|
|
15
15
|
async function middlewareGuard(ctx, next) {
|
|
@@ -383,11 +383,30 @@ async function routeTailDoneMiddleware(ctx, next) {
|
|
|
383
383
|
// }
|
|
384
384
|
|
|
385
385
|
var _dec$2, _dec2$2, _class$2;
|
|
386
|
-
let
|
|
386
|
+
let ServiceWeb = (_dec$2 = Service(), _dec2$2 = BeanInfo({
|
|
387
|
+
module: "a-web"
|
|
388
|
+
}), _dec$2(_class$2 = _dec2$2(_class$2 = class ServiceWeb extends BeanBase {
|
|
389
|
+
combineControllerActionApiPath(controller, actionKey, prefix, simplify) {
|
|
390
|
+
// beanOptions
|
|
391
|
+
const beanOptions = appResource.getBean(controller);
|
|
392
|
+
if (!beanOptions) return undefined;
|
|
393
|
+
// controllerPath
|
|
394
|
+
const controllerOptions = beanOptions.options;
|
|
395
|
+
const controllerPath = controllerOptions.path;
|
|
396
|
+
// actionPath
|
|
397
|
+
const handlerMetadata = appMetadata.getMetadata(SymbolRequestMappingHandler, controller.prototype, actionKey);
|
|
398
|
+
const actionPath = handlerMetadata.path || '';
|
|
399
|
+
// combine
|
|
400
|
+
return this.app.util.combineApiPathControllerAndAction(beanOptions.module, controllerPath, actionPath, prefix, simplify);
|
|
401
|
+
}
|
|
402
|
+
}) || _class$2) || _class$2);
|
|
403
|
+
|
|
404
|
+
var _dec$1, _dec2$1, _class$1;
|
|
405
|
+
let StartupListen = (_dec$1 = Startup({
|
|
387
406
|
after: true
|
|
388
|
-
}), _dec2$
|
|
407
|
+
}), _dec2$1 = BeanInfo({
|
|
389
408
|
module: "a-web"
|
|
390
|
-
}), _dec$
|
|
409
|
+
}), _dec$1(_class$1 = _dec2$1(_class$1 = class StartupListen extends BeanBase {
|
|
391
410
|
async execute() {
|
|
392
411
|
if (!this.app.config.server.listen.disable) {
|
|
393
412
|
this.app.server = this._listen(this.app.config.server.listen.port, this.app.config.server.listen.hostname);
|
|
@@ -413,7 +432,7 @@ let StartupListen = (_dec$2 = Startup({
|
|
|
413
432
|
}); // not set instanceName
|
|
414
433
|
};
|
|
415
434
|
}
|
|
416
|
-
}) || _class$
|
|
435
|
+
}) || _class$1) || _class$1);
|
|
417
436
|
|
|
418
437
|
function config(_app) {
|
|
419
438
|
return {
|
|
@@ -488,25 +507,6 @@ function routerMiddleware(router) {
|
|
|
488
507
|
};
|
|
489
508
|
}
|
|
490
509
|
|
|
491
|
-
var _dec$1, _dec2$1, _class$1;
|
|
492
|
-
let ServiceWeb = (_dec$1 = Service$1(), _dec2$1 = BeanInfo({
|
|
493
|
-
module: "a-web"
|
|
494
|
-
}), _dec$1(_class$1 = _dec2$1(_class$1 = class ServiceWeb extends BeanBase {
|
|
495
|
-
combineControllerActionApiPath(controller, actionKey, prefix, simplify) {
|
|
496
|
-
// beanOptions
|
|
497
|
-
const beanOptions = appResource.getBean(controller);
|
|
498
|
-
if (!beanOptions) return undefined;
|
|
499
|
-
// controllerPath
|
|
500
|
-
const controllerOptions = beanOptions.options;
|
|
501
|
-
const controllerPath = controllerOptions.path;
|
|
502
|
-
// actionPath
|
|
503
|
-
const handlerMetadata = appMetadata.getMetadata(SymbolRequestMappingHandler$1, controller.prototype, actionKey);
|
|
504
|
-
const actionPath = handlerMetadata.path || '';
|
|
505
|
-
// combine
|
|
506
|
-
return this.app.util.combineApiPathControllerAndAction(beanOptions.module, controllerPath, actionPath, prefix, simplify);
|
|
507
|
-
}
|
|
508
|
-
}) || _class$1) || _class$1);
|
|
509
|
-
|
|
510
510
|
var _dec, _dec2, _class;
|
|
511
511
|
let ScopeModuleAWeb = (_dec = Scope(), _dec2 = BeanInfo({
|
|
512
512
|
module: "a-web"
|
|
@@ -535,9 +535,6 @@ function Controller(path, options) {
|
|
|
535
535
|
mergeActionsOpenAPIMetadata(target);
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
|
-
function Service() {
|
|
539
|
-
return createBeanDecorator('service');
|
|
540
|
-
}
|
|
541
538
|
function Dto(options) {
|
|
542
539
|
return createBeanDecorator('dto', options, false, false, target => {
|
|
543
540
|
mergeFieldsOpenAPIMetadata(target);
|
|
@@ -614,4 +611,4 @@ function $apiPathAndCombineParamsAndQuery(path, options) {
|
|
|
614
611
|
return combineParamsAndQuery(path, options);
|
|
615
612
|
}
|
|
616
613
|
|
|
617
|
-
export { $apiPath, $apiPathAndCombineParamsAndQuery, BeanRouter, Controller, Dto, Main, RequestMapping, ScopeModuleAWeb,
|
|
614
|
+
export { $apiPath, $apiPathAndCombineParamsAndQuery, BeanRouter, Controller, Dto, Main, RequestMapping, ScopeModuleAWeb, ServiceWeb, StartupListen, SymbolRequestMappingHandler, Web, config, mergeActionsOpenAPIMetadata };
|
|
@@ -3,6 +3,5 @@ import type { IDecoratorControllerOptions } from '../../types/controller.ts';
|
|
|
3
3
|
import type { IDecoratorDtoOptions } from '../../types/dto.ts';
|
|
4
4
|
export declare function Controller<T extends IDecoratorControllerOptions>(options?: T): ClassDecorator;
|
|
5
5
|
export declare function Controller<T extends IDecoratorControllerOptions>(path?: string, options?: Omit<T, 'path'>): ClassDecorator;
|
|
6
|
-
export declare function Service(): ClassDecorator;
|
|
7
6
|
export declare function Dto<T extends IDecoratorDtoOptions<any>>(options?: Omit<T, '_fieldsMore_'>): ClassDecorator;
|
|
8
7
|
export declare function mergeActionsOpenAPIMetadata(target: Constructable): void;
|
package/dist/types/index.d.ts
CHANGED
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.
|
|
4
|
+
"version": "5.0.17",
|
|
5
5
|
"title": "a-web",
|
|
6
6
|
"vonaModule": {
|
|
7
7
|
"capabilities": {
|
|
@@ -17,13 +17,6 @@
|
|
|
17
17
|
"boilerplate": "cli/dto/boilerplate",
|
|
18
18
|
"metadataCustom": "cli/dto/metadata/generate.ts"
|
|
19
19
|
},
|
|
20
|
-
"service": {
|
|
21
|
-
"sceneIsolate": true,
|
|
22
|
-
"scopeResource": true,
|
|
23
|
-
"beanGeneral": true,
|
|
24
|
-
"optionsGlobalInterfaceFrom": "vona-module-a-web",
|
|
25
|
-
"boilerplate": "cli/service/boilerplate"
|
|
26
|
-
},
|
|
27
20
|
"controller": {
|
|
28
21
|
"sceneIsolate": true,
|
|
29
22
|
"optionsGlobalInterfaceName": "IDecoratorControllerOptions",
|
package/dist/types/service.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ServiceOnion } from 'vona-module-a-onion';
|
|
2
|
-
export interface IServiceRecord {
|
|
3
|
-
}
|
|
4
|
-
declare module 'vona-module-a-onion' {
|
|
5
|
-
interface BeanOnion {
|
|
6
|
-
service: ServiceOnion<never, keyof IServiceRecord>;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
declare module 'vona' {
|
|
10
|
-
interface IBeanSceneRecord {
|
|
11
|
-
service: never;
|
|
12
|
-
}
|
|
13
|
-
}
|