vona-module-test-vona 5.0.24 → 5.0.27
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 +11 -0
- package/dist/index.js +38 -28
- package/dist/model/testDynamicTable.d.ts +4 -0
- package/package.json +1 -1
|
@@ -52,6 +52,11 @@ export interface IModuleEntity {
|
|
|
52
52
|
/** entity: end */
|
|
53
53
|
/** entity: begin */
|
|
54
54
|
export type EntityTestTableName = 'testVona';
|
|
55
|
+
declare module 'vona-module-a-database' {
|
|
56
|
+
interface ITableRecord {
|
|
57
|
+
'testVona': never;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
55
60
|
declare module 'vona-module-test-vona' {
|
|
56
61
|
interface IEntityOptionsTest {
|
|
57
62
|
fields?: TypeEntityOptionsFields<EntityTest, IEntityOptionsTest['_fieldsMore_']>;
|
|
@@ -60,21 +65,27 @@ declare module 'vona-module-test-vona' {
|
|
|
60
65
|
/** entity: end */
|
|
61
66
|
/** model: begin */
|
|
62
67
|
export * from '../model/test.ts';
|
|
68
|
+
export * from '../model/testDynamicTable.ts';
|
|
63
69
|
import { type IDecoratorModelOptions } from 'vona-module-a-database';
|
|
64
70
|
declare module 'vona-module-a-database' {
|
|
65
71
|
interface IModelRecord {
|
|
66
72
|
'test-vona:test': IDecoratorModelOptions;
|
|
73
|
+
'test-vona:testDynamicTable': IDecoratorModelOptions;
|
|
67
74
|
}
|
|
68
75
|
}
|
|
69
76
|
declare module 'vona-module-test-vona' {
|
|
70
77
|
interface ModelTest {
|
|
71
78
|
}
|
|
79
|
+
interface ModelTestDynamicTable {
|
|
80
|
+
}
|
|
72
81
|
}
|
|
73
82
|
/** model: end */
|
|
74
83
|
/** model: begin */
|
|
75
84
|
import type { ModelTest } from '../model/test.ts';
|
|
85
|
+
import type { ModelTestDynamicTable } from '../model/testDynamicTable.ts';
|
|
76
86
|
export interface IModuleModel {
|
|
77
87
|
'test': ModelTest;
|
|
88
|
+
'testDynamicTable': ModelTestDynamicTable;
|
|
78
89
|
}
|
|
79
90
|
/** model: end */
|
|
80
91
|
/** bean: begin */
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { BeanInfo, BeanAopBase, BeanAopMethodBase, BeanBase, cast, retry, BeanSc
|
|
|
2
2
|
import { Aop, AopMethod, Aspect } from 'vona-module-a-aspect';
|
|
3
3
|
import { Entity, EntityBase, Model, BeanModelBase, Database } from 'vona-module-a-database';
|
|
4
4
|
import { Api, v, Arg } from 'vona-module-a-openapi';
|
|
5
|
+
import moment from 'moment';
|
|
5
6
|
import { Bean, Service, Scope } from 'vona-module-a-bean';
|
|
6
7
|
import { getKeyHash, CacheMem, BeanCacheMemBase, CacheRedis, BeanCacheRedisBase } from 'vona-module-a-cache';
|
|
7
8
|
import { Caching } from 'vona-module-a-caching';
|
|
@@ -20,15 +21,15 @@ import { z } from 'zod';
|
|
|
20
21
|
import { DtoJwtToken } from 'vona-module-a-jwt';
|
|
21
22
|
import { SymbolUploadValue } from 'vona-module-a-upload';
|
|
22
23
|
|
|
23
|
-
var _dec$
|
|
24
|
-
let AopRegExp = (_dec$
|
|
24
|
+
var _dec$B, _dec2$B, _class$B;
|
|
25
|
+
let AopRegExp = (_dec$B = Aop({
|
|
25
26
|
match: [/^test-vona\.service\.test\w+$/, 'testCtx'],
|
|
26
27
|
meta: {
|
|
27
28
|
mode: 'test'
|
|
28
29
|
}
|
|
29
|
-
}), _dec2$
|
|
30
|
+
}), _dec2$B = BeanInfo({
|
|
30
31
|
module: "test-vona"
|
|
31
|
-
}), _dec$
|
|
32
|
+
}), _dec$B(_class$B = _dec2$B(_class$B = class AopRegExp extends BeanAopBase {
|
|
32
33
|
__get_name__(next) {
|
|
33
34
|
const value = next();
|
|
34
35
|
return `${value}:regexpaop`;
|
|
@@ -50,24 +51,24 @@ let AopRegExp = (_dec$A = Aop({
|
|
|
50
51
|
const result = await next();
|
|
51
52
|
return `${result}:regexpaop`;
|
|
52
53
|
}
|
|
53
|
-
}) || _class$
|
|
54
|
+
}) || _class$B) || _class$B);
|
|
54
55
|
|
|
55
|
-
var _dec$
|
|
56
|
+
var _dec$A, _dec2$A, _class$A;
|
|
56
57
|
class AopSimpleBase extends BeanAopBase {
|
|
57
58
|
actionSync(_args, next) {
|
|
58
59
|
const result = next();
|
|
59
60
|
return `${result}:simpleaop`;
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
|
-
let AopSimple = (_dec$
|
|
63
|
+
let AopSimple = (_dec$A = Aop({
|
|
63
64
|
match: 'testCtx',
|
|
64
65
|
dependencies: 'test-vona:regExp',
|
|
65
66
|
meta: {
|
|
66
67
|
mode: 'test'
|
|
67
68
|
}
|
|
68
|
-
}), _dec2$
|
|
69
|
+
}), _dec2$A = BeanInfo({
|
|
69
70
|
module: "test-vona"
|
|
70
|
-
}), _dec$
|
|
71
|
+
}), _dec$A(_class$A = _dec2$A(_class$A = class AopSimple extends AopSimpleBase {
|
|
71
72
|
// magic
|
|
72
73
|
__get__(prop, next) {
|
|
73
74
|
const value = next();
|
|
@@ -107,14 +108,14 @@ let AopSimple = (_dec$z = Aop({
|
|
|
107
108
|
const result = await next();
|
|
108
109
|
return `${result}:simpleaop`;
|
|
109
110
|
}
|
|
110
|
-
}) || _class$
|
|
111
|
+
}) || _class$A) || _class$A);
|
|
111
112
|
|
|
112
|
-
var _dec$
|
|
113
|
-
let AopMethodTest = (_dec$
|
|
113
|
+
var _dec$z, _dec2$z, _class$z;
|
|
114
|
+
let AopMethodTest = (_dec$z = AopMethod({
|
|
114
115
|
wrapper: ''
|
|
115
|
-
}), _dec2$
|
|
116
|
+
}), _dec2$z = BeanInfo({
|
|
116
117
|
module: "test-vona"
|
|
117
|
-
}), _dec$
|
|
118
|
+
}), _dec$z(_class$z = _dec2$z(_class$z = class AopMethodTest extends BeanAopMethodBase {
|
|
118
119
|
get(options, next, _receiver, _prop) {
|
|
119
120
|
const res = next();
|
|
120
121
|
return this._wrapper(options.wrapper, res);
|
|
@@ -141,7 +142,7 @@ let AopMethodTest = (_dec$y = AopMethod({
|
|
|
141
142
|
if (index === data.length - wrapper.length) data = data.substring(0, index);
|
|
142
143
|
return data;
|
|
143
144
|
}
|
|
144
|
-
}) || _class$
|
|
145
|
+
}) || _class$z) || _class$z);
|
|
145
146
|
|
|
146
147
|
function _applyDecoratedDescriptor(i, e, r, n, l) {
|
|
147
148
|
var a = {};
|
|
@@ -160,10 +161,10 @@ function _initializerDefineProperty(e, i, r, l) {
|
|
|
160
161
|
});
|
|
161
162
|
}
|
|
162
163
|
|
|
163
|
-
var _dec$
|
|
164
|
-
let EntityTest = (_dec$
|
|
164
|
+
var _dec$y, _dec2$y, _dec3$h, _dec4$h, _dec5$h, _dec6$h, _class$y, _class2$h, _descriptor$2, _descriptor2$2;
|
|
165
|
+
let EntityTest = (_dec$y = Entity('testVona'), _dec2$y = BeanInfo({
|
|
165
166
|
module: "test-vona"
|
|
166
|
-
}), _dec3$h = Api.field(), _dec4$h = Reflect.metadata("design:type", String), _dec5$h = Api.field(), _dec6$h = Reflect.metadata("design:type", String), _dec$
|
|
167
|
+
}), _dec3$h = Api.field(), _dec4$h = Reflect.metadata("design:type", String), _dec5$h = Api.field(), _dec6$h = Reflect.metadata("design:type", String), _dec$y(_class$y = _dec2$y(_class$y = (_class2$h = class EntityTest extends EntityBase {
|
|
167
168
|
constructor(...args) {
|
|
168
169
|
super(...args);
|
|
169
170
|
_initializerDefineProperty(this, "title", _descriptor$2, this);
|
|
@@ -179,15 +180,26 @@ let EntityTest = (_dec$x = Entity('testVona'), _dec2$x = BeanInfo({
|
|
|
179
180
|
enumerable: true,
|
|
180
181
|
writable: true,
|
|
181
182
|
initializer: null
|
|
182
|
-
}), _class2$h)) || _class$
|
|
183
|
+
}), _class2$h)) || _class$y) || _class$y);
|
|
183
184
|
|
|
184
|
-
var _dec$
|
|
185
|
-
let ModelTest = (_dec$
|
|
185
|
+
var _dec$x, _dec2$x, _class$x;
|
|
186
|
+
let ModelTest = (_dec$x = Model({
|
|
186
187
|
entity: EntityTest,
|
|
187
188
|
clientName: 'default'
|
|
189
|
+
}), _dec2$x = BeanInfo({
|
|
190
|
+
module: "test-vona"
|
|
191
|
+
}), _dec$x(_class$x = _dec2$x(_class$x = class ModelTest extends BeanModelBase {}) || _class$x) || _class$x);
|
|
192
|
+
|
|
193
|
+
var _dec$w, _dec2$w, _class$w;
|
|
194
|
+
let ModelTestDynamicTable = (_dec$w = Model({
|
|
195
|
+
entity: EntityTest,
|
|
196
|
+
table(ctx, defaultTable) {
|
|
197
|
+
if (ctx.instanceName !== '') return defaultTable;
|
|
198
|
+
return `${defaultTable}_${moment().format('YYYYMMDD')}`;
|
|
199
|
+
}
|
|
188
200
|
}), _dec2$w = BeanInfo({
|
|
189
201
|
module: "test-vona"
|
|
190
|
-
}), _dec$w(_class$w = _dec2$w(_class$w = class
|
|
202
|
+
}), _dec$w(_class$w = _dec2$w(_class$w = class ModelTestDynamicTable extends BeanModelBase {}) || _class$w) || _class$w);
|
|
191
203
|
|
|
192
204
|
var _dec$v, _dec2$v, _class$v;
|
|
193
205
|
class TestCtx0 extends BeanBase {
|
|
@@ -315,7 +327,7 @@ let ServiceCaching = (_dec$t = Service(), _dec2$t = BeanInfo({
|
|
|
315
327
|
}), _dec7$e = Reflect.metadata("design:type", Function), _dec8$a = Reflect.metadata("design:paramtypes", [Number]), _dec9$7 = Caching.get({
|
|
316
328
|
cacheName: 'test-vona:test',
|
|
317
329
|
cacheProp: 'test',
|
|
318
|
-
cacheKey: '
|
|
330
|
+
cacheKey: 'cel://join([get(self,"$beanFullName"),options.cacheProp,hashkey(args)],"_")'
|
|
319
331
|
}), _dec0$7 = Reflect.metadata("design:type", Function), _dec1$7 = Reflect.metadata("design:paramtypes", [Number]), _dec10$5 = Caching.get({
|
|
320
332
|
cacheName: 'test-vona:test',
|
|
321
333
|
cacheProp: 'test'
|
|
@@ -327,8 +339,8 @@ let ServiceCaching = (_dec$t = Service(), _dec2$t = BeanInfo({
|
|
|
327
339
|
}), _dec14$4 = Reflect.metadata("design:type", Function), _dec15$4 = Reflect.metadata("design:paramtypes", [Number, typeof TSummerCacheTestData === "undefined" ? Object : TSummerCacheTestData]), _dec16$4 = Caching.set({
|
|
328
340
|
cacheName: 'test-vona:test',
|
|
329
341
|
cacheProp: 'test',
|
|
330
|
-
cacheKey: '
|
|
331
|
-
cacheValue: '
|
|
342
|
+
cacheKey: 'cel://join([get(self,"$beanFullName"),options.cacheProp,hashkey([args[0]])],"_")',
|
|
343
|
+
cacheValue: 'cel://{"id": args[1].id, "name": args[1].name}'
|
|
332
344
|
}), _dec17$3 = Reflect.metadata("design:type", Function), _dec18$3 = Reflect.metadata("design:paramtypes", [Number, typeof TSummerCacheTestData === "undefined" ? Object : TSummerCacheTestData]), _dec19$3 = Caching.set({
|
|
333
345
|
cacheName: 'test-vona:test',
|
|
334
346
|
cacheProp: 'test',
|
|
@@ -348,8 +360,6 @@ let ServiceCaching = (_dec$t = Service(), _dec2$t = BeanInfo({
|
|
|
348
360
|
cacheValueSet(_value, args, _prop, _options) {
|
|
349
361
|
return args[args.length - 1];
|
|
350
362
|
}
|
|
351
|
-
|
|
352
|
-
// cacheKey: '#!# concat(prop,args[0])'
|
|
353
363
|
async get(id) {
|
|
354
364
|
return {
|
|
355
365
|
id,
|
|
@@ -1324,4 +1334,4 @@ function $locale(key) {
|
|
|
1324
1334
|
}
|
|
1325
1335
|
/** scope: end */
|
|
1326
1336
|
|
|
1327
|
-
export { $locale, AopMethodTest, AopRegExp, AopSimple, BeanTestCtx, BroadcastTest, CacheMemTest, CacheRedisTest, ControllerBean, ControllerCacheMem, ControllerCacheRedis, ControllerGuardPassport, ControllerOnion, ControllerPassport, ControllerPerformAction, ControllerQueue, ControllerSummer, ControllerTail, ControllerTransaction, ControllerUpload, DtoProfile, DtoUser, EntityTest, EventHelloEcho, EventListenerHelloEcho, MetaVersion, ModelTest, QueueTest, ScheduleTest, ScheduleTest3, ScopeModuleTestVona, ServiceAopMethod, ServiceCaching, ServiceTest, ServiceTestApp, ServiceTestClass, ServiceTransaction, SummerCacheTest, config, locales };
|
|
1337
|
+
export { $locale, AopMethodTest, AopRegExp, AopSimple, BeanTestCtx, BroadcastTest, CacheMemTest, CacheRedisTest, ControllerBean, ControllerCacheMem, ControllerCacheRedis, ControllerGuardPassport, ControllerOnion, ControllerPassport, ControllerPerformAction, ControllerQueue, ControllerSummer, ControllerTail, ControllerTransaction, ControllerUpload, DtoProfile, DtoUser, EntityTest, EventHelloEcho, EventListenerHelloEcho, MetaVersion, ModelTest, ModelTestDynamicTable, QueueTest, ScheduleTest, ScheduleTest3, ScopeModuleTestVona, ServiceAopMethod, ServiceCaching, ServiceTest, ServiceTestApp, ServiceTestClass, ServiceTransaction, SummerCacheTest, config, locales };
|