vona-module-test-vona 5.0.21 → 5.0.22
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 +56 -56
- package/dist/index.js +164 -164
- package/package.json +1 -1
|
@@ -96,6 +96,61 @@ declare module 'vona' {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
/** bean: end */
|
|
99
|
+
/** service: begin */
|
|
100
|
+
export * from '../service/aopMethod.ts';
|
|
101
|
+
export * from '../service/test.ts';
|
|
102
|
+
export * from '../service/testApp.ts';
|
|
103
|
+
export * from '../service/testClass.ts';
|
|
104
|
+
export * from '../service/transaction.ts';
|
|
105
|
+
import 'vona';
|
|
106
|
+
declare module 'vona-module-a-bean' {
|
|
107
|
+
interface IServiceRecord {
|
|
108
|
+
'test-vona:aopMethod': never;
|
|
109
|
+
'test-vona:test': never;
|
|
110
|
+
'test-vona:testApp': never;
|
|
111
|
+
'test-vona:testClass': never;
|
|
112
|
+
'test-vona:transaction': never;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
declare module 'vona-module-test-vona' {
|
|
116
|
+
interface ServiceAopMethod {
|
|
117
|
+
}
|
|
118
|
+
interface ServiceTest {
|
|
119
|
+
}
|
|
120
|
+
interface ServiceTestApp {
|
|
121
|
+
}
|
|
122
|
+
interface ServiceTestClass {
|
|
123
|
+
}
|
|
124
|
+
interface ServiceTransaction {
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/** service: end */
|
|
128
|
+
/** service: begin */
|
|
129
|
+
import type { ServiceAopMethod } from '../service/aopMethod.ts';
|
|
130
|
+
import type { ServiceTest } from '../service/test.ts';
|
|
131
|
+
import type { ServiceTestApp } from '../service/testApp.ts';
|
|
132
|
+
import type { ServiceTestClass } from '../service/testClass.ts';
|
|
133
|
+
import type { ServiceTransaction } from '../service/transaction.ts';
|
|
134
|
+
export interface IModuleService {
|
|
135
|
+
'aopMethod': ServiceAopMethod;
|
|
136
|
+
'test': ServiceTest;
|
|
137
|
+
'testApp': ServiceTestApp;
|
|
138
|
+
'testClass': ServiceTestClass;
|
|
139
|
+
'transaction': ServiceTransaction;
|
|
140
|
+
}
|
|
141
|
+
/** service: end */
|
|
142
|
+
/** service: begin */
|
|
143
|
+
import 'vona';
|
|
144
|
+
declare module 'vona' {
|
|
145
|
+
interface IBeanRecordGeneral {
|
|
146
|
+
'test-vona.service.aopMethod': ServiceAopMethod;
|
|
147
|
+
'test-vona.service.test': ServiceTest;
|
|
148
|
+
'test-vona.service.testApp': ServiceTestApp;
|
|
149
|
+
'test-vona.service.testClass': ServiceTestClass;
|
|
150
|
+
'test-vona.service.transaction': ServiceTransaction;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/** service: end */
|
|
99
154
|
/** broadcast: begin */
|
|
100
155
|
export * from '../bean/broadcast.test.ts';
|
|
101
156
|
import { type IDecoratorBroadcastOptions } from 'vona-module-a-broadcast';
|
|
@@ -286,61 +341,6 @@ declare module 'vona-module-test-vona' {
|
|
|
286
341
|
}
|
|
287
342
|
}
|
|
288
343
|
/** dto: end */
|
|
289
|
-
/** service: begin */
|
|
290
|
-
export * from '../service/aopMethod.ts';
|
|
291
|
-
export * from '../service/test.ts';
|
|
292
|
-
export * from '../service/testApp.ts';
|
|
293
|
-
export * from '../service/testClass.ts';
|
|
294
|
-
export * from '../service/transaction.ts';
|
|
295
|
-
import 'vona';
|
|
296
|
-
declare module 'vona-module-a-web' {
|
|
297
|
-
interface IServiceRecord {
|
|
298
|
-
'test-vona:aopMethod': never;
|
|
299
|
-
'test-vona:test': never;
|
|
300
|
-
'test-vona:testApp': never;
|
|
301
|
-
'test-vona:testClass': never;
|
|
302
|
-
'test-vona:transaction': never;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
declare module 'vona-module-test-vona' {
|
|
306
|
-
interface ServiceAopMethod {
|
|
307
|
-
}
|
|
308
|
-
interface ServiceTest {
|
|
309
|
-
}
|
|
310
|
-
interface ServiceTestApp {
|
|
311
|
-
}
|
|
312
|
-
interface ServiceTestClass {
|
|
313
|
-
}
|
|
314
|
-
interface ServiceTransaction {
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
/** service: end */
|
|
318
|
-
/** service: begin */
|
|
319
|
-
import type { ServiceAopMethod } from '../service/aopMethod.ts';
|
|
320
|
-
import type { ServiceTest } from '../service/test.ts';
|
|
321
|
-
import type { ServiceTestApp } from '../service/testApp.ts';
|
|
322
|
-
import type { ServiceTestClass } from '../service/testClass.ts';
|
|
323
|
-
import type { ServiceTransaction } from '../service/transaction.ts';
|
|
324
|
-
export interface IModuleService {
|
|
325
|
-
'aopMethod': ServiceAopMethod;
|
|
326
|
-
'test': ServiceTest;
|
|
327
|
-
'testApp': ServiceTestApp;
|
|
328
|
-
'testClass': ServiceTestClass;
|
|
329
|
-
'transaction': ServiceTransaction;
|
|
330
|
-
}
|
|
331
|
-
/** service: end */
|
|
332
|
-
/** service: begin */
|
|
333
|
-
import 'vona';
|
|
334
|
-
declare module 'vona' {
|
|
335
|
-
interface IBeanRecordGeneral {
|
|
336
|
-
'test-vona.service.aopMethod': ServiceAopMethod;
|
|
337
|
-
'test-vona.service.test': ServiceTest;
|
|
338
|
-
'test-vona.service.testApp': ServiceTestApp;
|
|
339
|
-
'test-vona.service.testClass': ServiceTestClass;
|
|
340
|
-
'test-vona.service.transaction': ServiceTransaction;
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
/** service: end */
|
|
344
344
|
/** controller: begin */
|
|
345
345
|
export * from '../controller/bean.ts';
|
|
346
346
|
export * from '../controller/cacheMem.ts';
|
|
@@ -534,13 +534,13 @@ export interface ScopeModuleTestVona {
|
|
|
534
534
|
locale: TypeModuleLocales<(typeof locales)[TypeLocaleBase]>;
|
|
535
535
|
entity: IModuleEntity;
|
|
536
536
|
model: IModuleModel;
|
|
537
|
+
service: IModuleService;
|
|
537
538
|
broadcast: IModuleBroadcast;
|
|
538
539
|
cacheMem: IModuleCacheMem;
|
|
539
540
|
cacheRedis: IModuleCacheRedis;
|
|
540
541
|
event: IModuleEvent;
|
|
541
542
|
queue: IModuleQueue;
|
|
542
543
|
summerCache: IModuleSummerCache;
|
|
543
|
-
service: IModuleService;
|
|
544
544
|
}
|
|
545
545
|
import 'vona';
|
|
546
546
|
declare module 'vona' {
|
package/dist/index.js
CHANGED
|
@@ -2,7 +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 { Bean, Scope } from 'vona-module-a-bean';
|
|
5
|
+
import { Bean, Service, Scope } from 'vona-module-a-bean';
|
|
6
6
|
import assert from 'node:assert';
|
|
7
7
|
import { Broadcast, BeanBroadcastBase } from 'vona-module-a-broadcast';
|
|
8
8
|
import { CacheMem, BeanCacheMemBase, CacheRedis, BeanCacheRedisBase } from 'vona-module-a-cache';
|
|
@@ -11,7 +11,7 @@ import { Meta } from 'vona-module-a-meta';
|
|
|
11
11
|
import { Queue, BeanQueueBase } from 'vona-module-a-queue';
|
|
12
12
|
import { Schedule } from 'vona-module-a-schedule';
|
|
13
13
|
import { SummerCache, BeanSummerCacheBase } from 'vona-module-a-summer';
|
|
14
|
-
import { Dto,
|
|
14
|
+
import { Dto, Controller, Web } from 'vona-module-a-web';
|
|
15
15
|
import { Passport, $getUserName } from 'vona-module-a-user';
|
|
16
16
|
import { sleep } from '@cabloy/utils';
|
|
17
17
|
import { Core } from 'vona-module-a-core';
|
|
@@ -254,54 +254,159 @@ let BeanTestCtx = (_dec$u = Bean(), _dec2$u = BeanInfo({
|
|
|
254
254
|
module: "test-vona"
|
|
255
255
|
}), _dec$u(_class$u = _dec2$u(_class$u = class BeanTestCtx extends TestCtx1 {}) || _class$u) || _class$u);
|
|
256
256
|
|
|
257
|
-
var _dec$t, _dec2$t, _class$t;
|
|
258
|
-
let
|
|
257
|
+
var _dec$t, _dec2$t, _dec3$f, _dec4$f, _class$t, _dec5$f, _dec6$f, _dec7$e, _dec8$a, _dec9$7, _dec0$7, _dec1$7, _dec10$5, _dec11$5, _dec12$5, _dec13$5, _dec14$4, _dec15$4, _dec16$4, _class2$f, _class3;
|
|
258
|
+
let ServiceAopMethodBase = (_dec$t = Aspect.aopMethod('test-vona:test', {
|
|
259
|
+
wrapper: '+'
|
|
260
|
+
}), _dec2$t = Aspect.aopMethod('test-vona:test', {
|
|
261
|
+
wrapper: '-'
|
|
262
|
+
}), _dec3$f = Reflect.metadata("design:type", Function), _dec4$f = Reflect.metadata("design:paramtypes", []), _class$t = class ServiceAopMethodBase extends BeanBase {
|
|
263
|
+
testSyncBase() {
|
|
264
|
+
return 'hello';
|
|
265
|
+
}
|
|
266
|
+
}, _applyDecoratedDescriptor(_class$t.prototype, "testSyncBase", [_dec$t, _dec2$t, _dec3$f, _dec4$f], Object.getOwnPropertyDescriptor(_class$t.prototype, "testSyncBase"), _class$t.prototype), _class$t);
|
|
267
|
+
let ServiceAopMethod = (_dec5$f = Service(), _dec6$f = BeanInfo({
|
|
268
|
+
module: "test-vona"
|
|
269
|
+
}), _dec7$e = Aspect.aopMethod('test-vona:test', {
|
|
270
|
+
wrapper: '+'
|
|
271
|
+
}), _dec8$a = Aspect.aopMethod('test-vona:test', {
|
|
272
|
+
wrapper: '-'
|
|
273
|
+
}), _dec9$7 = Reflect.metadata("design:type", Function), _dec0$7 = Reflect.metadata("design:paramtypes", []), _dec1$7 = Aspect.aopMethod('test-vona:test', {
|
|
274
|
+
wrapper: '+'
|
|
275
|
+
}), _dec10$5 = Aspect.aopMethod('test-vona:test', {
|
|
276
|
+
wrapper: '-'
|
|
277
|
+
}), _dec11$5 = Reflect.metadata("design:type", Function), _dec12$5 = Reflect.metadata("design:paramtypes", []), _dec13$5 = Aspect.aopMethod('test-vona:test', {
|
|
278
|
+
wrapper: '+'
|
|
279
|
+
}), _dec14$4 = Aspect.aopMethod('test-vona:test', {
|
|
280
|
+
wrapper: '-'
|
|
281
|
+
}), _dec15$4 = Reflect.metadata("design:type", Function), _dec16$4 = Reflect.metadata("design:paramtypes", []), _dec5$f(_class2$f = _dec6$f(_class2$f = (_class3 = class ServiceAopMethod extends ServiceAopMethodBase {
|
|
282
|
+
constructor(...args) {
|
|
283
|
+
super(...args);
|
|
284
|
+
this._name = '';
|
|
285
|
+
}
|
|
286
|
+
testSync() {
|
|
287
|
+
return 'hello';
|
|
288
|
+
}
|
|
289
|
+
async testAsync() {
|
|
290
|
+
return 'hello';
|
|
291
|
+
}
|
|
292
|
+
get name() {
|
|
293
|
+
return this._name;
|
|
294
|
+
}
|
|
295
|
+
set name(value) {
|
|
296
|
+
this._name = value;
|
|
297
|
+
}
|
|
298
|
+
}, _applyDecoratedDescriptor(_class3.prototype, "testSync", [_dec7$e, _dec8$a, _dec9$7, _dec0$7], Object.getOwnPropertyDescriptor(_class3.prototype, "testSync"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "testAsync", [_dec1$7, _dec10$5, _dec11$5, _dec12$5], Object.getOwnPropertyDescriptor(_class3.prototype, "testAsync"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "name", [_dec13$5, _dec14$4, _dec15$4, _dec16$4], Object.getOwnPropertyDescriptor(_class3.prototype, "name"), _class3.prototype), _class3)) || _class2$f) || _class2$f);
|
|
299
|
+
|
|
300
|
+
var _dec$s, _dec2$s, _class$s;
|
|
301
|
+
let ServiceTest = (_dec$s = Service(), _dec2$s = BeanInfo({
|
|
302
|
+
module: "test-vona"
|
|
303
|
+
}), _dec$s(_class$s = _dec2$s(_class$s = class ServiceTest extends BeanBase {
|
|
304
|
+
get name() {
|
|
305
|
+
return 'serviceTest';
|
|
306
|
+
}
|
|
307
|
+
}) || _class$s) || _class$s);
|
|
308
|
+
|
|
309
|
+
var _dec$r, _dec2$r, _class$r;
|
|
310
|
+
let ServiceTestApp = (_dec$r = Service(), _dec2$r = BeanInfo({
|
|
259
311
|
module: "test-vona"
|
|
260
|
-
}), _dec$
|
|
312
|
+
}), _dec$r(_class$r = _dec2$r(_class$r = class ServiceTestApp extends BeanBase {
|
|
313
|
+
actionSync({
|
|
314
|
+
a,
|
|
315
|
+
b
|
|
316
|
+
}) {
|
|
317
|
+
return a + b;
|
|
318
|
+
}
|
|
319
|
+
async actionAsync({
|
|
320
|
+
a,
|
|
321
|
+
b
|
|
322
|
+
}) {
|
|
323
|
+
return Promise.resolve(a + b);
|
|
324
|
+
}
|
|
325
|
+
}) || _class$r) || _class$r);
|
|
326
|
+
|
|
327
|
+
var _dec$q, _dec2$q, _class$q;
|
|
328
|
+
class ClassBeanBase extends BeanBase {
|
|
329
|
+
actionSync({
|
|
330
|
+
a,
|
|
331
|
+
b
|
|
332
|
+
}) {
|
|
333
|
+
return a + b;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
let ServiceTestClass = (_dec$q = Service(), _dec2$q = BeanInfo({
|
|
337
|
+
module: "test-vona"
|
|
338
|
+
}), _dec$q(_class$q = _dec2$q(_class$q = class ServiceTestClass extends ClassBeanBase {
|
|
339
|
+
async actionAsync({
|
|
340
|
+
a,
|
|
341
|
+
b
|
|
342
|
+
}) {
|
|
343
|
+
return Promise.resolve(a + b);
|
|
344
|
+
}
|
|
345
|
+
}) || _class$q) || _class$q);
|
|
346
|
+
|
|
347
|
+
var _dec$p, _dec2$p, _dec3$e, _dec4$e, _dec5$e, _dec6$e, _dec7$d, _dec8$9, _class$p, _class2$e;
|
|
348
|
+
const tableNameFail$1 = '__tempTransactionFail';
|
|
349
|
+
const tableNameSuccess$1 = '__tempTransactionSuccess';
|
|
350
|
+
let ServiceTransaction = (_dec$p = Service(), _dec2$p = BeanInfo({
|
|
351
|
+
module: "test-vona"
|
|
352
|
+
}), _dec3$e = Database.transaction(), _dec4$e = Reflect.metadata("design:type", Function), _dec5$e = Reflect.metadata("design:paramtypes", [Object]), _dec6$e = Database.transaction(), _dec7$d = Reflect.metadata("design:type", Function), _dec8$9 = Reflect.metadata("design:paramtypes", [Object]), _dec$p(_class$p = _dec2$p(_class$p = (_class2$e = class ServiceTransaction extends BeanBase {
|
|
353
|
+
async fail(item) {
|
|
354
|
+
await this.app.bean.model.update(`${tableNameFail$1}`, item);
|
|
355
|
+
await this.app.bean.model.update(`${tableNameFail$1}error`, item);
|
|
356
|
+
}
|
|
357
|
+
async success(item) {
|
|
358
|
+
await this.app.bean.model.update(tableNameSuccess$1, item);
|
|
359
|
+
}
|
|
360
|
+
}, _applyDecoratedDescriptor(_class2$e.prototype, "fail", [_dec3$e, _dec4$e, _dec5$e], Object.getOwnPropertyDescriptor(_class2$e.prototype, "fail"), _class2$e.prototype), _applyDecoratedDescriptor(_class2$e.prototype, "success", [_dec6$e, _dec7$d, _dec8$9], Object.getOwnPropertyDescriptor(_class2$e.prototype, "success"), _class2$e.prototype), _class2$e)) || _class$p) || _class$p);
|
|
361
|
+
|
|
362
|
+
var _dec$o, _dec2$o, _class$o;
|
|
363
|
+
let BroadcastTest = (_dec$o = Broadcast(), _dec2$o = BeanInfo({
|
|
364
|
+
module: "test-vona"
|
|
365
|
+
}), _dec$o(_class$o = _dec2$o(_class$o = class BroadcastTest extends BeanBroadcastBase {
|
|
261
366
|
async execute(data, isEmitter) {
|
|
262
367
|
// locale
|
|
263
368
|
assert.equal(this.ctx.locale, 'zh-cn');
|
|
264
369
|
// data
|
|
265
370
|
assert.equal(data.message, 'hello');
|
|
266
371
|
}
|
|
267
|
-
}) || _class$
|
|
372
|
+
}) || _class$o) || _class$o);
|
|
268
373
|
|
|
269
|
-
var _dec$
|
|
270
|
-
let CacheMemTest = (_dec$
|
|
374
|
+
var _dec$n, _dec2$n, _class$n;
|
|
375
|
+
let CacheMemTest = (_dec$n = CacheMem({
|
|
271
376
|
ttl: 1 * 1000
|
|
272
|
-
}), _dec2$
|
|
377
|
+
}), _dec2$n = BeanInfo({
|
|
273
378
|
module: "test-vona"
|
|
274
|
-
}), _dec$
|
|
379
|
+
}), _dec$n(_class$n = _dec2$n(_class$n = class CacheMemTest extends BeanCacheMemBase {}) || _class$n) || _class$n);
|
|
275
380
|
|
|
276
|
-
var _dec$
|
|
277
|
-
let CacheRedisTest = (_dec$
|
|
381
|
+
var _dec$m, _dec2$m, _class$m;
|
|
382
|
+
let CacheRedisTest = (_dec$m = CacheRedis({
|
|
278
383
|
ttl: 1 * 1000
|
|
279
|
-
}), _dec2$
|
|
384
|
+
}), _dec2$m = BeanInfo({
|
|
280
385
|
module: "test-vona"
|
|
281
|
-
}), _dec$
|
|
386
|
+
}), _dec$m(_class$m = _dec2$m(_class$m = class CacheRedisTest extends BeanCacheRedisBase {}) || _class$m) || _class$m);
|
|
282
387
|
|
|
283
|
-
var _dec$
|
|
284
|
-
let EventHelloEcho = (_dec$
|
|
388
|
+
var _dec$l, _dec2$l, _class$l;
|
|
389
|
+
let EventHelloEcho = (_dec$l = Event(), _dec2$l = BeanInfo({
|
|
285
390
|
module: "test-vona"
|
|
286
|
-
}), _dec$
|
|
391
|
+
}), _dec$l(_class$l = _dec2$l(_class$l = class EventHelloEcho extends BeanEventBase {}) || _class$l) || _class$l);
|
|
287
392
|
|
|
288
|
-
var _dec$
|
|
289
|
-
let EventListenerHelloEcho = (_dec$
|
|
393
|
+
var _dec$k, _dec2$k, _class$k;
|
|
394
|
+
let EventListenerHelloEcho = (_dec$k = EventListener({
|
|
290
395
|
match: 'test-vona:helloEcho'
|
|
291
|
-
}), _dec2$
|
|
396
|
+
}), _dec2$k = BeanInfo({
|
|
292
397
|
module: "test-vona"
|
|
293
|
-
}), _dec$
|
|
398
|
+
}), _dec$k(_class$k = _dec2$k(_class$k = class EventListenerHelloEcho extends BeanBase {
|
|
294
399
|
async execute(data, next) {
|
|
295
400
|
// next
|
|
296
401
|
const result = await next();
|
|
297
402
|
return `${data.text} ${result}`;
|
|
298
403
|
}
|
|
299
|
-
}) || _class$
|
|
404
|
+
}) || _class$k) || _class$k);
|
|
300
405
|
|
|
301
|
-
var _dec$
|
|
302
|
-
let MetaVersion = (_dec$
|
|
406
|
+
var _dec$j, _dec2$j, _class$j;
|
|
407
|
+
let MetaVersion = (_dec$j = Meta(), _dec2$j = BeanInfo({
|
|
303
408
|
module: "test-vona"
|
|
304
|
-
}), _dec$
|
|
409
|
+
}), _dec$j(_class$j = _dec2$j(_class$j = class MetaVersion extends BeanBase {
|
|
305
410
|
async update(options) {
|
|
306
411
|
if (options.version === 1) {
|
|
307
412
|
// testVona
|
|
@@ -313,47 +418,47 @@ let MetaVersion = (_dec$o = Meta(), _dec2$o = BeanInfo({
|
|
|
313
418
|
});
|
|
314
419
|
}
|
|
315
420
|
}
|
|
316
|
-
}) || _class$
|
|
421
|
+
}) || _class$j) || _class$j);
|
|
317
422
|
|
|
318
|
-
var _dec$
|
|
319
|
-
let QueueTest = (_dec$
|
|
423
|
+
var _dec$i, _dec2$i, _class$i;
|
|
424
|
+
let QueueTest = (_dec$i = Queue(), _dec2$i = BeanInfo({
|
|
320
425
|
module: "test-vona"
|
|
321
|
-
}), _dec$
|
|
426
|
+
}), _dec$i(_class$i = _dec2$i(_class$i = class QueueTest extends BeanQueueBase {
|
|
322
427
|
async execute(data, _options) {
|
|
323
428
|
return data.a + data.b;
|
|
324
429
|
}
|
|
325
|
-
}) || _class$
|
|
430
|
+
}) || _class$i) || _class$i);
|
|
326
431
|
|
|
327
|
-
var _dec$
|
|
328
|
-
let ScheduleTest = (_dec$
|
|
432
|
+
var _dec$h, _dec2$h, _class$h;
|
|
433
|
+
let ScheduleTest = (_dec$h = Schedule({
|
|
329
434
|
enable: false,
|
|
330
435
|
repeat: {
|
|
331
436
|
every: 3000
|
|
332
437
|
}
|
|
333
|
-
}), _dec2$
|
|
438
|
+
}), _dec2$h = BeanInfo({
|
|
334
439
|
module: "test-vona"
|
|
335
|
-
}), _dec$
|
|
440
|
+
}), _dec$h(_class$h = _dec2$h(_class$h = class ScheduleTest extends BeanBase {
|
|
336
441
|
async execute(job) {
|
|
337
442
|
this.$logger.silly(`Schedule Test: iid=${this.ctx.instance.id}, every=${job?.data.options?.jobOptions?.repeat?.every}, ${new Date()}`);
|
|
338
443
|
}
|
|
339
|
-
}) || _class$
|
|
444
|
+
}) || _class$h) || _class$h);
|
|
340
445
|
|
|
341
|
-
var _dec$
|
|
342
|
-
let ScheduleTest3 = (_dec$
|
|
446
|
+
var _dec$g, _dec2$g, _class$g;
|
|
447
|
+
let ScheduleTest3 = (_dec$g = Schedule({
|
|
343
448
|
enable: false,
|
|
344
449
|
repeat: {
|
|
345
450
|
every: 5000
|
|
346
451
|
}
|
|
347
|
-
}), _dec2$
|
|
452
|
+
}), _dec2$g = BeanInfo({
|
|
348
453
|
module: "test-vona"
|
|
349
|
-
}), _dec$
|
|
454
|
+
}), _dec$g(_class$g = _dec2$g(_class$g = class ScheduleTest3 extends BeanBase {
|
|
350
455
|
async execute(job) {
|
|
351
456
|
this.$logger.silly(`Schedule Test3: iid=${this.ctx.instance.id}, every=${job?.data.options?.jobOptions?.repeat?.every}, ${new Date()}`);
|
|
352
457
|
}
|
|
353
|
-
}) || _class$
|
|
458
|
+
}) || _class$g) || _class$g);
|
|
354
459
|
|
|
355
|
-
var _dec$
|
|
356
|
-
let SummerCacheTest = (_dec$
|
|
460
|
+
var _dec$f, _dec2$f, _class$f;
|
|
461
|
+
let SummerCacheTest = (_dec$f = SummerCache({
|
|
357
462
|
mode: 'all',
|
|
358
463
|
mem: {
|
|
359
464
|
max: 2,
|
|
@@ -362,171 +467,66 @@ let SummerCacheTest = (_dec$k = SummerCache({
|
|
|
362
467
|
redis: {
|
|
363
468
|
ttl: 3 * 1000
|
|
364
469
|
}
|
|
365
|
-
}), _dec2$
|
|
470
|
+
}), _dec2$f = BeanInfo({
|
|
366
471
|
module: "test-vona"
|
|
367
|
-
}), _dec$
|
|
472
|
+
}), _dec$f(_class$f = _dec2$f(_class$f = class SummerCacheTest extends BeanSummerCacheBase {
|
|
368
473
|
async getNative(key, _options) {
|
|
369
474
|
return {
|
|
370
475
|
id: key.id,
|
|
371
476
|
name: `name_${key.id}`
|
|
372
477
|
};
|
|
373
478
|
}
|
|
374
|
-
}) || _class$
|
|
479
|
+
}) || _class$f) || _class$f);
|
|
375
480
|
|
|
376
|
-
var _dec$
|
|
377
|
-
let DtoProfile = (_dec$
|
|
481
|
+
var _dec$e, _dec2$e, _dec3$d, _dec4$d, _dec5$d, _dec6$d, _class$e, _class2$d, _descriptor$1, _descriptor2$1;
|
|
482
|
+
let DtoProfile = (_dec$e = Dto(), _dec2$e = BeanInfo({
|
|
378
483
|
module: "test-vona"
|
|
379
|
-
}), _dec3$
|
|
484
|
+
}), _dec3$d = Api.field(), _dec4$d = Reflect.metadata("design:type", Number), _dec5$d = Api.field(v.email()), _dec6$d = Reflect.metadata("design:type", String), _dec$e(_class$e = _dec2$e(_class$e = (_class2$d = class DtoProfile {
|
|
380
485
|
constructor() {
|
|
381
486
|
_initializerDefineProperty(this, "id", _descriptor$1, this);
|
|
382
487
|
_initializerDefineProperty(this, "email", _descriptor2$1, this);
|
|
383
488
|
}
|
|
384
|
-
}, _descriptor$1 = _applyDecoratedDescriptor(_class2$
|
|
489
|
+
}, _descriptor$1 = _applyDecoratedDescriptor(_class2$d.prototype, "id", [_dec3$d, _dec4$d], {
|
|
385
490
|
configurable: true,
|
|
386
491
|
enumerable: true,
|
|
387
492
|
writable: true,
|
|
388
493
|
initializer: null
|
|
389
|
-
}), _descriptor2$1 = _applyDecoratedDescriptor(_class2$
|
|
494
|
+
}), _descriptor2$1 = _applyDecoratedDescriptor(_class2$d.prototype, "email", [_dec5$d, _dec6$d], {
|
|
390
495
|
configurable: true,
|
|
391
496
|
enumerable: true,
|
|
392
497
|
writable: true,
|
|
393
498
|
initializer: null
|
|
394
|
-
}), _class2$
|
|
499
|
+
}), _class2$d)) || _class$e) || _class$e);
|
|
395
500
|
|
|
396
|
-
var _dec$
|
|
397
|
-
let DtoUser = (_dec$
|
|
501
|
+
var _dec$d, _dec2$d, _dec3$c, _dec4$c, _dec5$c, _dec6$c, _dec7$c, _dec8$8, _class$d, _class2$c, _descriptor, _descriptor2, _descriptor3;
|
|
502
|
+
let DtoUser = (_dec$d = Dto({
|
|
398
503
|
openapi: {
|
|
399
504
|
title: $locale('User')
|
|
400
505
|
}
|
|
401
|
-
}), _dec2$
|
|
506
|
+
}), _dec2$d = BeanInfo({
|
|
402
507
|
module: "test-vona"
|
|
403
|
-
}), _dec3$
|
|
508
|
+
}), _dec3$c = Api.field(v.title($locale('UserId')), v.tableIdentity()), _dec4$c = Reflect.metadata("design:type", typeof TableIdentity === "undefined" ? Object : TableIdentity), _dec5$c = Api.field(v.min(3)), _dec6$c = Reflect.metadata("design:type", String), _dec7$c = Api.field(), _dec8$8 = Reflect.metadata("design:type", Boolean), _dec$d(_class$d = _dec2$d(_class$d = (_class2$c = class DtoUser {
|
|
404
509
|
constructor() {
|
|
405
510
|
_initializerDefineProperty(this, "id", _descriptor, this);
|
|
406
511
|
_initializerDefineProperty(this, "name", _descriptor2, this);
|
|
407
512
|
_initializerDefineProperty(this, "married", _descriptor3, this);
|
|
408
513
|
}
|
|
409
|
-
}, _descriptor = _applyDecoratedDescriptor(_class2$
|
|
514
|
+
}, _descriptor = _applyDecoratedDescriptor(_class2$c.prototype, "id", [_dec3$c, _dec4$c], {
|
|
410
515
|
configurable: true,
|
|
411
516
|
enumerable: true,
|
|
412
517
|
writable: true,
|
|
413
518
|
initializer: null
|
|
414
|
-
}), _descriptor2 = _applyDecoratedDescriptor(_class2$
|
|
519
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2$c.prototype, "name", [_dec5$c, _dec6$c], {
|
|
415
520
|
configurable: true,
|
|
416
521
|
enumerable: true,
|
|
417
522
|
writable: true,
|
|
418
523
|
initializer: null
|
|
419
|
-
}), _descriptor3 = _applyDecoratedDescriptor(_class2$
|
|
524
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2$c.prototype, "married", [_dec7$c, _dec8$8], {
|
|
420
525
|
configurable: true,
|
|
421
526
|
enumerable: true,
|
|
422
527
|
writable: true,
|
|
423
528
|
initializer: null
|
|
424
|
-
}), _class2$
|
|
425
|
-
|
|
426
|
-
var _dec$h, _dec2$h, _dec3$d, _dec4$d, _class$h, _dec5$d, _dec6$d, _dec7$d, _dec8$9, _dec9$7, _dec0$7, _dec1$7, _dec10$5, _dec11$5, _dec12$5, _dec13$5, _dec14$4, _dec15$4, _dec16$4, _class2$d, _class3;
|
|
427
|
-
let ServiceAopMethodBase = (_dec$h = Aspect.aopMethod('test-vona:test', {
|
|
428
|
-
wrapper: '+'
|
|
429
|
-
}), _dec2$h = Aspect.aopMethod('test-vona:test', {
|
|
430
|
-
wrapper: '-'
|
|
431
|
-
}), _dec3$d = Reflect.metadata("design:type", Function), _dec4$d = Reflect.metadata("design:paramtypes", []), _class$h = class ServiceAopMethodBase extends BeanBase {
|
|
432
|
-
testSyncBase() {
|
|
433
|
-
return 'hello';
|
|
434
|
-
}
|
|
435
|
-
}, _applyDecoratedDescriptor(_class$h.prototype, "testSyncBase", [_dec$h, _dec2$h, _dec3$d, _dec4$d], Object.getOwnPropertyDescriptor(_class$h.prototype, "testSyncBase"), _class$h.prototype), _class$h);
|
|
436
|
-
let ServiceAopMethod = (_dec5$d = Service(), _dec6$d = BeanInfo({
|
|
437
|
-
module: "test-vona"
|
|
438
|
-
}), _dec7$d = Aspect.aopMethod('test-vona:test', {
|
|
439
|
-
wrapper: '+'
|
|
440
|
-
}), _dec8$9 = Aspect.aopMethod('test-vona:test', {
|
|
441
|
-
wrapper: '-'
|
|
442
|
-
}), _dec9$7 = Reflect.metadata("design:type", Function), _dec0$7 = Reflect.metadata("design:paramtypes", []), _dec1$7 = Aspect.aopMethod('test-vona:test', {
|
|
443
|
-
wrapper: '+'
|
|
444
|
-
}), _dec10$5 = Aspect.aopMethod('test-vona:test', {
|
|
445
|
-
wrapper: '-'
|
|
446
|
-
}), _dec11$5 = Reflect.metadata("design:type", Function), _dec12$5 = Reflect.metadata("design:paramtypes", []), _dec13$5 = Aspect.aopMethod('test-vona:test', {
|
|
447
|
-
wrapper: '+'
|
|
448
|
-
}), _dec14$4 = Aspect.aopMethod('test-vona:test', {
|
|
449
|
-
wrapper: '-'
|
|
450
|
-
}), _dec15$4 = Reflect.metadata("design:type", Function), _dec16$4 = Reflect.metadata("design:paramtypes", []), _dec5$d(_class2$d = _dec6$d(_class2$d = (_class3 = class ServiceAopMethod extends ServiceAopMethodBase {
|
|
451
|
-
constructor(...args) {
|
|
452
|
-
super(...args);
|
|
453
|
-
this._name = '';
|
|
454
|
-
}
|
|
455
|
-
testSync() {
|
|
456
|
-
return 'hello';
|
|
457
|
-
}
|
|
458
|
-
async testAsync() {
|
|
459
|
-
return 'hello';
|
|
460
|
-
}
|
|
461
|
-
get name() {
|
|
462
|
-
return this._name;
|
|
463
|
-
}
|
|
464
|
-
set name(value) {
|
|
465
|
-
this._name = value;
|
|
466
|
-
}
|
|
467
|
-
}, _applyDecoratedDescriptor(_class3.prototype, "testSync", [_dec7$d, _dec8$9, _dec9$7, _dec0$7], Object.getOwnPropertyDescriptor(_class3.prototype, "testSync"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "testAsync", [_dec1$7, _dec10$5, _dec11$5, _dec12$5], Object.getOwnPropertyDescriptor(_class3.prototype, "testAsync"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "name", [_dec13$5, _dec14$4, _dec15$4, _dec16$4], Object.getOwnPropertyDescriptor(_class3.prototype, "name"), _class3.prototype), _class3)) || _class2$d) || _class2$d);
|
|
468
|
-
|
|
469
|
-
var _dec$g, _dec2$g, _class$g;
|
|
470
|
-
let ServiceTest = (_dec$g = Service(), _dec2$g = BeanInfo({
|
|
471
|
-
module: "test-vona"
|
|
472
|
-
}), _dec$g(_class$g = _dec2$g(_class$g = class ServiceTest extends BeanBase {
|
|
473
|
-
get name() {
|
|
474
|
-
return 'serviceTest';
|
|
475
|
-
}
|
|
476
|
-
}) || _class$g) || _class$g);
|
|
477
|
-
|
|
478
|
-
var _dec$f, _dec2$f, _class$f;
|
|
479
|
-
let ServiceTestApp = (_dec$f = Service(), _dec2$f = BeanInfo({
|
|
480
|
-
module: "test-vona"
|
|
481
|
-
}), _dec$f(_class$f = _dec2$f(_class$f = class ServiceTestApp extends BeanBase {
|
|
482
|
-
actionSync({
|
|
483
|
-
a,
|
|
484
|
-
b
|
|
485
|
-
}) {
|
|
486
|
-
return a + b;
|
|
487
|
-
}
|
|
488
|
-
async actionAsync({
|
|
489
|
-
a,
|
|
490
|
-
b
|
|
491
|
-
}) {
|
|
492
|
-
return Promise.resolve(a + b);
|
|
493
|
-
}
|
|
494
|
-
}) || _class$f) || _class$f);
|
|
495
|
-
|
|
496
|
-
var _dec$e, _dec2$e, _class$e;
|
|
497
|
-
class ClassBeanBase extends BeanBase {
|
|
498
|
-
actionSync({
|
|
499
|
-
a,
|
|
500
|
-
b
|
|
501
|
-
}) {
|
|
502
|
-
return a + b;
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
let ServiceTestClass = (_dec$e = Service(), _dec2$e = BeanInfo({
|
|
506
|
-
module: "test-vona"
|
|
507
|
-
}), _dec$e(_class$e = _dec2$e(_class$e = class ServiceTestClass extends ClassBeanBase {
|
|
508
|
-
async actionAsync({
|
|
509
|
-
a,
|
|
510
|
-
b
|
|
511
|
-
}) {
|
|
512
|
-
return Promise.resolve(a + b);
|
|
513
|
-
}
|
|
514
|
-
}) || _class$e) || _class$e);
|
|
515
|
-
|
|
516
|
-
var _dec$d, _dec2$d, _dec3$c, _dec4$c, _dec5$c, _dec6$c, _dec7$c, _dec8$8, _class$d, _class2$c;
|
|
517
|
-
const tableNameFail$1 = '__tempTransactionFail';
|
|
518
|
-
const tableNameSuccess$1 = '__tempTransactionSuccess';
|
|
519
|
-
let ServiceTransaction = (_dec$d = Service(), _dec2$d = BeanInfo({
|
|
520
|
-
module: "test-vona"
|
|
521
|
-
}), _dec3$c = Database.transaction(), _dec4$c = Reflect.metadata("design:type", Function), _dec5$c = Reflect.metadata("design:paramtypes", [Object]), _dec6$c = Database.transaction(), _dec7$c = Reflect.metadata("design:type", Function), _dec8$8 = Reflect.metadata("design:paramtypes", [Object]), _dec$d(_class$d = _dec2$d(_class$d = (_class2$c = class ServiceTransaction extends BeanBase {
|
|
522
|
-
async fail(item) {
|
|
523
|
-
await this.app.bean.model.update(`${tableNameFail$1}`, item);
|
|
524
|
-
await this.app.bean.model.update(`${tableNameFail$1}error`, item);
|
|
525
|
-
}
|
|
526
|
-
async success(item) {
|
|
527
|
-
await this.app.bean.model.update(tableNameSuccess$1, item);
|
|
528
|
-
}
|
|
529
|
-
}, _applyDecoratedDescriptor(_class2$c.prototype, "fail", [_dec3$c, _dec4$c, _dec5$c], Object.getOwnPropertyDescriptor(_class2$c.prototype, "fail"), _class2$c.prototype), _applyDecoratedDescriptor(_class2$c.prototype, "success", [_dec6$c, _dec7$c, _dec8$8], Object.getOwnPropertyDescriptor(_class2$c.prototype, "success"), _class2$c.prototype), _class2$c)) || _class$d) || _class$d);
|
|
529
|
+
}), _class2$c)) || _class$d) || _class$d);
|
|
530
530
|
|
|
531
531
|
const __ThisModule__ = 'test-vona';
|
|
532
532
|
|