vona-module-test-vona 5.0.13 → 5.0.15

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.
Files changed (41) hide show
  1. package/dist/index.js +1220 -1
  2. package/package.json +2 -2
  3. package/dist/.metadata/index.js +0 -109
  4. package/dist/.metadata/this.js +0 -2
  5. package/dist/bean/aop.regExp.js +0 -35
  6. package/dist/bean/aop.simple.js +0 -59
  7. package/dist/bean/aopMethod.test.js +0 -42
  8. package/dist/bean/bean.testCtx.js +0 -54
  9. package/dist/bean/broadcast.test.js +0 -23
  10. package/dist/bean/cacheMem.test.js +0 -13
  11. package/dist/bean/cacheRedis.test.js +0 -13
  12. package/dist/bean/event.helloEcho.js +0 -13
  13. package/dist/bean/eventListener.helloEcho.js +0 -19
  14. package/dist/bean/meta.version.js +0 -25
  15. package/dist/bean/queue.test.js +0 -16
  16. package/dist/bean/schedule.test.js +0 -17
  17. package/dist/bean/schedule.test3.js +0 -17
  18. package/dist/bean/summerCache.test.js +0 -28
  19. package/dist/config/config.js +0 -3
  20. package/dist/config/locale/en-us.js +0 -11
  21. package/dist/config/locale/zh-cn.js +0 -9
  22. package/dist/controller/bean.js +0 -93
  23. package/dist/controller/cacheMem.js +0 -60
  24. package/dist/controller/cacheRedis.js +0 -60
  25. package/dist/controller/onion.js +0 -132
  26. package/dist/controller/passport.js +0 -82
  27. package/dist/controller/performAction.js +0 -35
  28. package/dist/controller/queue.js +0 -42
  29. package/dist/controller/summer.js +0 -120
  30. package/dist/controller/tail.js +0 -43
  31. package/dist/controller/transaction.js +0 -51
  32. package/dist/controller/upload.js +0 -80
  33. package/dist/dto/profile.js +0 -27
  34. package/dist/dto/user.js +0 -33
  35. package/dist/entity/test.js +0 -27
  36. package/dist/model/test.js +0 -14
  37. package/dist/service/aopMethod.js +0 -63
  38. package/dist/service/test.js +0 -17
  39. package/dist/service/testApp.js +0 -20
  40. package/dist/service/testClass.js +0 -22
  41. package/dist/service/transaction.js +0 -39
@@ -1,80 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- var __param = (this && this.__param) || function (paramIndex, decorator) {
11
- return function (target, key) { decorator(target, key, paramIndex); }
12
- };
13
- import assert from 'node:assert';
14
- import { BeanBase } from 'vona';
15
- import { Aspect } from 'vona-module-a-aspect';
16
- import { Api, Arg, v } from 'vona-module-a-openapi';
17
- import { SymbolUploadValue } from 'vona-module-a-upload';
18
- import { Passport } from 'vona-module-a-user';
19
- import { Controller, Web } from 'vona-module-a-web';
20
- import { z } from 'zod';
21
- let ControllerUpload = class ControllerUpload extends BeanBase {
22
- fields(fields, checkes, name) {
23
- assert.equal(fields.find(item => item.name === 'name')?.value, 'zhennann');
24
- assert.equal(checkes.length > 0, true);
25
- assert.equal(name, 'zhennann');
26
- return this.ctx[SymbolUploadValue];
27
- }
28
- file(name, file) {
29
- assert.equal(name, 'zhennann');
30
- assert.equal(file.name, 'welcome');
31
- return this.ctx[SymbolUploadValue];
32
- }
33
- files(files, images, file1, file2) {
34
- assert.equal(files.find(item => item.name === 'welcome1')?.name, 'welcome1');
35
- assert.equal(images.find(item => item.name === 'images')?.name, 'images');
36
- assert.equal(file1.name, 'welcome1');
37
- assert.equal(file2.name, 'welcome2');
38
- return this.ctx[SymbolUploadValue];
39
- }
40
- };
41
- __decorate([
42
- Web.post('fields'),
43
- Passport.public(),
44
- Aspect.interceptor('a-upload:upload'),
45
- Api.contentType('application/json'),
46
- __param(0, Arg.fields()),
47
- __param(1, Arg.fields('checkes', v.array(z.string()))),
48
- __param(2, Arg.field('name', v.default('zhennann'), v.title('your name'))),
49
- __metadata("design:type", Function),
50
- __metadata("design:paramtypes", [Array, Array, String]),
51
- __metadata("design:returntype", void 0)
52
- ], ControllerUpload.prototype, "fields", null);
53
- __decorate([
54
- Web.post('file'),
55
- Passport.public(),
56
- Aspect.interceptor('a-upload:upload'),
57
- Api.contentType('application/json'),
58
- __param(0, Arg.field('name', v.default('zhennann'))),
59
- __param(1, Arg.file('welcome')),
60
- __metadata("design:type", Function),
61
- __metadata("design:paramtypes", [String, Object]),
62
- __metadata("design:returntype", void 0)
63
- ], ControllerUpload.prototype, "file", null);
64
- __decorate([
65
- Web.post('files'),
66
- Passport.public(),
67
- Aspect.interceptor('a-upload:upload'),
68
- Api.contentType('application/json'),
69
- __param(0, Arg.files(v.title('more files'))),
70
- __param(1, Arg.files('images', v.title('images'))),
71
- __param(2, Arg.file('welcome1', v.title('single file'))),
72
- __param(3, Arg.file('welcome2')),
73
- __metadata("design:type", Function),
74
- __metadata("design:paramtypes", [Array, Array, Object, Object]),
75
- __metadata("design:returntype", void 0)
76
- ], ControllerUpload.prototype, "files", null);
77
- ControllerUpload = __decorate([
78
- Controller({ path: 'upload', meta: { mode: ['test', 'local'] } })
79
- ], ControllerUpload);
80
- export { ControllerUpload };
@@ -1,27 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { Api, v } from 'vona-module-a-openapi';
11
- import { Dto } from 'vona-module-a-web';
12
- let DtoProfile = class DtoProfile {
13
- id;
14
- email;
15
- };
16
- __decorate([
17
- Api.field(),
18
- __metadata("design:type", Number)
19
- ], DtoProfile.prototype, "id", void 0);
20
- __decorate([
21
- Api.field(v.email()),
22
- __metadata("design:type", String)
23
- ], DtoProfile.prototype, "email", void 0);
24
- DtoProfile = __decorate([
25
- Dto()
26
- ], DtoProfile);
27
- export { DtoProfile };
package/dist/dto/user.js DELETED
@@ -1,33 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { Api, v } from 'vona-module-a-openapi';
11
- import { Dto } from 'vona-module-a-web';
12
- import { $locale } from "../.metadata/index.js";
13
- let DtoUser = class DtoUser {
14
- id;
15
- name;
16
- married;
17
- };
18
- __decorate([
19
- Api.field(v.title($locale('UserId')), v.tableIdentity()),
20
- __metadata("design:type", Object)
21
- ], DtoUser.prototype, "id", void 0);
22
- __decorate([
23
- Api.field(v.min(3)),
24
- __metadata("design:type", String)
25
- ], DtoUser.prototype, "name", void 0);
26
- __decorate([
27
- Api.field(),
28
- __metadata("design:type", Boolean)
29
- ], DtoUser.prototype, "married", void 0);
30
- DtoUser = __decorate([
31
- Dto({ openapi: { title: $locale('User') } })
32
- ], DtoUser);
33
- export { DtoUser };
@@ -1,27 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { Entity, EntityBase } from 'vona-module-a-database';
11
- import { Api } from 'vona-module-a-openapi';
12
- let EntityTest = class EntityTest extends EntityBase {
13
- title;
14
- description;
15
- };
16
- __decorate([
17
- Api.field(),
18
- __metadata("design:type", String)
19
- ], EntityTest.prototype, "title", void 0);
20
- __decorate([
21
- Api.field(),
22
- __metadata("design:type", String)
23
- ], EntityTest.prototype, "description", void 0);
24
- EntityTest = __decorate([
25
- Entity('testVona')
26
- ], EntityTest);
27
- export { EntityTest };
@@ -1,14 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { BeanModelBase, Model } from 'vona-module-a-database';
8
- import { EntityTest } from "../entity/test.js";
9
- let ModelTest = class ModelTest extends BeanModelBase {
10
- };
11
- ModelTest = __decorate([
12
- Model({ entity: EntityTest, clientName: 'default' })
13
- ], ModelTest);
14
- export { ModelTest };
@@ -1,63 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { BeanBase } from 'vona';
11
- import { Aspect } from 'vona-module-a-aspect';
12
- import { Service } from 'vona-module-a-web';
13
- class ServiceAopMethodBase extends BeanBase {
14
- testSyncBase() {
15
- return 'hello';
16
- }
17
- }
18
- __decorate([
19
- Aspect.aopMethod('test-vona:test', { wrapper: '+' }),
20
- Aspect.aopMethod('test-vona:test', { wrapper: '-' }),
21
- __metadata("design:type", Function),
22
- __metadata("design:paramtypes", []),
23
- __metadata("design:returntype", void 0)
24
- ], ServiceAopMethodBase.prototype, "testSyncBase", null);
25
- let ServiceAopMethod = class ServiceAopMethod extends ServiceAopMethodBase {
26
- _name = '';
27
- testSync() {
28
- return 'hello';
29
- }
30
- async testAsync() {
31
- return 'hello';
32
- }
33
- get name() {
34
- return this._name;
35
- }
36
- set name(value) {
37
- this._name = value;
38
- }
39
- };
40
- __decorate([
41
- Aspect.aopMethod('test-vona:test', { wrapper: '+' }),
42
- Aspect.aopMethod('test-vona:test', { wrapper: '-' }),
43
- __metadata("design:type", Function),
44
- __metadata("design:paramtypes", []),
45
- __metadata("design:returntype", void 0)
46
- ], ServiceAopMethod.prototype, "testSync", null);
47
- __decorate([
48
- Aspect.aopMethod('test-vona:test', { wrapper: '+' }),
49
- Aspect.aopMethod('test-vona:test', { wrapper: '-' }),
50
- __metadata("design:type", Function),
51
- __metadata("design:paramtypes", []),
52
- __metadata("design:returntype", Promise)
53
- ], ServiceAopMethod.prototype, "testAsync", null);
54
- __decorate([
55
- Aspect.aopMethod('test-vona:test', { wrapper: '+' }),
56
- Aspect.aopMethod('test-vona:test', { wrapper: '-' }),
57
- __metadata("design:type", Object),
58
- __metadata("design:paramtypes", [Object])
59
- ], ServiceAopMethod.prototype, "name", null);
60
- ServiceAopMethod = __decorate([
61
- Service()
62
- ], ServiceAopMethod);
63
- export { ServiceAopMethod };
@@ -1,17 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { BeanBase } from 'vona';
8
- import { Service } from 'vona-module-a-web';
9
- let ServiceTest = class ServiceTest extends BeanBase {
10
- get name() {
11
- return 'serviceTest';
12
- }
13
- };
14
- ServiceTest = __decorate([
15
- Service()
16
- ], ServiceTest);
17
- export { ServiceTest };
@@ -1,20 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { BeanBase } from 'vona';
8
- import { Service } from 'vona-module-a-web';
9
- let ServiceTestApp = class ServiceTestApp extends BeanBase {
10
- actionSync({ a, b }) {
11
- return a + b;
12
- }
13
- async actionAsync({ a, b }) {
14
- return Promise.resolve(a + b);
15
- }
16
- };
17
- ServiceTestApp = __decorate([
18
- Service()
19
- ], ServiceTestApp);
20
- export { ServiceTestApp };
@@ -1,22 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { BeanBase } from 'vona';
8
- import { Service } from 'vona-module-a-web';
9
- class ClassBeanBase extends BeanBase {
10
- actionSync({ a, b }) {
11
- return a + b;
12
- }
13
- }
14
- let ServiceTestClass = class ServiceTestClass extends ClassBeanBase {
15
- async actionAsync({ a, b }) {
16
- return Promise.resolve(a + b);
17
- }
18
- };
19
- ServiceTestClass = __decorate([
20
- Service()
21
- ], ServiceTestClass);
22
- export { ServiceTestClass };
@@ -1,39 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { BeanBase } from 'vona';
11
- import { Database } from 'vona-module-a-database';
12
- import { Service } from 'vona-module-a-web';
13
- const tableNameFail = '__tempTransactionFail';
14
- const tableNameSuccess = '__tempTransactionSuccess';
15
- let ServiceTransaction = class ServiceTransaction extends BeanBase {
16
- async fail(item) {
17
- await this.app.bean.model.update(`${tableNameFail}`, item);
18
- await this.app.bean.model.update(`${tableNameFail}error`, item);
19
- }
20
- async success(item) {
21
- await this.app.bean.model.update(tableNameSuccess, item);
22
- }
23
- };
24
- __decorate([
25
- Database.transaction(),
26
- __metadata("design:type", Function),
27
- __metadata("design:paramtypes", [Object]),
28
- __metadata("design:returntype", Promise)
29
- ], ServiceTransaction.prototype, "fail", null);
30
- __decorate([
31
- Database.transaction(),
32
- __metadata("design:type", Function),
33
- __metadata("design:paramtypes", [Object]),
34
- __metadata("design:returntype", Promise)
35
- ], ServiceTransaction.prototype, "success", null);
36
- ServiceTransaction = __decorate([
37
- Service()
38
- ], ServiceTransaction);
39
- export { ServiceTransaction };