vona-module-test-vona 5.0.20 → 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 +201 -202
- package/dist/index.js +373 -373
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BeanInfo, BeanAopBase, BeanAopMethodBase, BeanBase, cast, retry, BeanScopeBase } from 'vona';
|
|
2
|
-
import { Bean, Scope } from 'vona-module-a-bean';
|
|
3
2
|
import { Aop, AopMethod, Aspect } from 'vona-module-a-aspect';
|
|
3
|
+
import { Entity, EntityBase, Model, BeanModelBase, Database } from 'vona-module-a-database';
|
|
4
|
+
import { Api, v, Arg } from 'vona-module-a-openapi';
|
|
5
|
+
import { Bean, Service, Scope } from 'vona-module-a-bean';
|
|
4
6
|
import assert from 'node:assert';
|
|
5
7
|
import { Broadcast, BeanBroadcastBase } from 'vona-module-a-broadcast';
|
|
6
8
|
import { CacheMem, BeanCacheMemBase, CacheRedis, BeanCacheRedisBase } from 'vona-module-a-cache';
|
|
@@ -9,38 +11,14 @@ import { Meta } from 'vona-module-a-meta';
|
|
|
9
11
|
import { Queue, BeanQueueBase } from 'vona-module-a-queue';
|
|
10
12
|
import { Schedule } from 'vona-module-a-schedule';
|
|
11
13
|
import { SummerCache, BeanSummerCacheBase } from 'vona-module-a-summer';
|
|
12
|
-
import {
|
|
14
|
+
import { Dto, Controller, Web } from 'vona-module-a-web';
|
|
13
15
|
import { Passport, $getUserName } from 'vona-module-a-user';
|
|
14
|
-
import { Service, Controller, Web, Dto } from 'vona-module-a-web';
|
|
15
16
|
import { sleep } from '@cabloy/utils';
|
|
16
17
|
import { Core } from 'vona-module-a-core';
|
|
17
|
-
import { Database, Entity, EntityBase, Model, BeanModelBase } from 'vona-module-a-database';
|
|
18
18
|
import { z } from 'zod';
|
|
19
19
|
import { DtoJwtToken } from 'vona-module-a-jwt';
|
|
20
20
|
import { SymbolUploadValue } from 'vona-module-a-upload';
|
|
21
21
|
|
|
22
|
-
var locale_en_us = {
|
|
23
|
-
User: 'User',
|
|
24
|
-
UserId: 'User Id',
|
|
25
|
-
TestHelloWorld: 'Hello World',
|
|
26
|
-
TestApples: '%d apples',
|
|
27
|
-
TestApples_0: 'no apples',
|
|
28
|
-
TestApples_1: 'one apple',
|
|
29
|
-
TestNameApples_: '%s has %d apples',
|
|
30
|
-
TestNameApples_0_1: '%s has no apples',
|
|
31
|
-
TestNameApples_1_1: '%s has one apple'
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
var locale_zh_cn = {
|
|
35
|
-
User: '用户',
|
|
36
|
-
UserId: '用户Id',
|
|
37
|
-
TestHelloWorld: '您好,世界',
|
|
38
|
-
TestApples: '%d个苹果',
|
|
39
|
-
TestApples_0: '没有苹果',
|
|
40
|
-
TestNameApples_: '%s有%d个苹果',
|
|
41
|
-
TestNameApples_0_1: '%s没有苹果'
|
|
42
|
-
};
|
|
43
|
-
|
|
44
22
|
var _dec$z, _dec2$z, _class$z;
|
|
45
23
|
let AopRegExp = (_dec$z = Aop({
|
|
46
24
|
match: [/^test-vona\.service\.test\w+$/, 'testCtx'],
|
|
@@ -164,7 +142,53 @@ let AopMethodTest = (_dec$x = AopMethod({
|
|
|
164
142
|
}
|
|
165
143
|
}) || _class$x) || _class$x);
|
|
166
144
|
|
|
167
|
-
|
|
145
|
+
function _applyDecoratedDescriptor(i, e, r, n, l) {
|
|
146
|
+
var a = {};
|
|
147
|
+
return Object.keys(n).forEach(function (i) {
|
|
148
|
+
a[i] = n[i];
|
|
149
|
+
}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = true), a = r.slice().reverse().reduce(function (r, n) {
|
|
150
|
+
return n(i, e, r) || r;
|
|
151
|
+
}, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;
|
|
152
|
+
}
|
|
153
|
+
function _initializerDefineProperty(e, i, r, l) {
|
|
154
|
+
r && Object.defineProperty(e, i, {
|
|
155
|
+
enumerable: r.enumerable,
|
|
156
|
+
configurable: r.configurable,
|
|
157
|
+
writable: r.writable,
|
|
158
|
+
value: r.initializer ? r.initializer.call(l) : void 0
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
var _dec$w, _dec2$w, _dec3$g, _dec4$g, _dec5$g, _dec6$g, _class$w, _class2$g, _descriptor$2, _descriptor2$2;
|
|
163
|
+
let EntityTest = (_dec$w = Entity('testVona'), _dec2$w = BeanInfo({
|
|
164
|
+
module: "test-vona"
|
|
165
|
+
}), _dec3$g = Api.field(), _dec4$g = Reflect.metadata("design:type", String), _dec5$g = Api.field(), _dec6$g = Reflect.metadata("design:type", String), _dec$w(_class$w = _dec2$w(_class$w = (_class2$g = class EntityTest extends EntityBase {
|
|
166
|
+
constructor(...args) {
|
|
167
|
+
super(...args);
|
|
168
|
+
_initializerDefineProperty(this, "title", _descriptor$2, this);
|
|
169
|
+
_initializerDefineProperty(this, "description", _descriptor2$2, this);
|
|
170
|
+
}
|
|
171
|
+
}, _descriptor$2 = _applyDecoratedDescriptor(_class2$g.prototype, "title", [_dec3$g, _dec4$g], {
|
|
172
|
+
configurable: true,
|
|
173
|
+
enumerable: true,
|
|
174
|
+
writable: true,
|
|
175
|
+
initializer: null
|
|
176
|
+
}), _descriptor2$2 = _applyDecoratedDescriptor(_class2$g.prototype, "description", [_dec5$g, _dec6$g], {
|
|
177
|
+
configurable: true,
|
|
178
|
+
enumerable: true,
|
|
179
|
+
writable: true,
|
|
180
|
+
initializer: null
|
|
181
|
+
}), _class2$g)) || _class$w) || _class$w);
|
|
182
|
+
|
|
183
|
+
var _dec$v, _dec2$v, _class$v;
|
|
184
|
+
let ModelTest = (_dec$v = Model({
|
|
185
|
+
entity: EntityTest,
|
|
186
|
+
clientName: 'default'
|
|
187
|
+
}), _dec2$v = BeanInfo({
|
|
188
|
+
module: "test-vona"
|
|
189
|
+
}), _dec$v(_class$v = _dec2$v(_class$v = class ModelTest extends BeanModelBase {}) || _class$v) || _class$v);
|
|
190
|
+
|
|
191
|
+
var _dec$u, _dec2$u, _class$u;
|
|
168
192
|
class TestCtx0 extends BeanBase {
|
|
169
193
|
constructor(...args) {
|
|
170
194
|
super(...args);
|
|
@@ -226,58 +250,163 @@ class TestCtx1 extends TestCtx0 {
|
|
|
226
250
|
});
|
|
227
251
|
}
|
|
228
252
|
}
|
|
229
|
-
let BeanTestCtx = (_dec$
|
|
253
|
+
let BeanTestCtx = (_dec$u = Bean(), _dec2$u = BeanInfo({
|
|
230
254
|
module: "test-vona"
|
|
231
|
-
}), _dec$
|
|
255
|
+
}), _dec$u(_class$u = _dec2$u(_class$u = class BeanTestCtx extends TestCtx1 {}) || _class$u) || _class$u);
|
|
232
256
|
|
|
233
|
-
var _dec$
|
|
234
|
-
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({
|
|
235
302
|
module: "test-vona"
|
|
236
|
-
}), _dec$
|
|
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({
|
|
311
|
+
module: "test-vona"
|
|
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 {
|
|
237
366
|
async execute(data, isEmitter) {
|
|
238
367
|
// locale
|
|
239
368
|
assert.equal(this.ctx.locale, 'zh-cn');
|
|
240
369
|
// data
|
|
241
370
|
assert.equal(data.message, 'hello');
|
|
242
371
|
}
|
|
243
|
-
}) || _class$
|
|
372
|
+
}) || _class$o) || _class$o);
|
|
244
373
|
|
|
245
|
-
var _dec$
|
|
246
|
-
let CacheMemTest = (_dec$
|
|
374
|
+
var _dec$n, _dec2$n, _class$n;
|
|
375
|
+
let CacheMemTest = (_dec$n = CacheMem({
|
|
247
376
|
ttl: 1 * 1000
|
|
248
|
-
}), _dec2$
|
|
377
|
+
}), _dec2$n = BeanInfo({
|
|
249
378
|
module: "test-vona"
|
|
250
|
-
}), _dec$
|
|
379
|
+
}), _dec$n(_class$n = _dec2$n(_class$n = class CacheMemTest extends BeanCacheMemBase {}) || _class$n) || _class$n);
|
|
251
380
|
|
|
252
|
-
var _dec$
|
|
253
|
-
let CacheRedisTest = (_dec$
|
|
381
|
+
var _dec$m, _dec2$m, _class$m;
|
|
382
|
+
let CacheRedisTest = (_dec$m = CacheRedis({
|
|
254
383
|
ttl: 1 * 1000
|
|
255
|
-
}), _dec2$
|
|
384
|
+
}), _dec2$m = BeanInfo({
|
|
256
385
|
module: "test-vona"
|
|
257
|
-
}), _dec$
|
|
386
|
+
}), _dec$m(_class$m = _dec2$m(_class$m = class CacheRedisTest extends BeanCacheRedisBase {}) || _class$m) || _class$m);
|
|
258
387
|
|
|
259
|
-
var _dec$
|
|
260
|
-
let EventHelloEcho = (_dec$
|
|
388
|
+
var _dec$l, _dec2$l, _class$l;
|
|
389
|
+
let EventHelloEcho = (_dec$l = Event(), _dec2$l = BeanInfo({
|
|
261
390
|
module: "test-vona"
|
|
262
|
-
}), _dec$
|
|
391
|
+
}), _dec$l(_class$l = _dec2$l(_class$l = class EventHelloEcho extends BeanEventBase {}) || _class$l) || _class$l);
|
|
263
392
|
|
|
264
|
-
var _dec$
|
|
265
|
-
let EventListenerHelloEcho = (_dec$
|
|
393
|
+
var _dec$k, _dec2$k, _class$k;
|
|
394
|
+
let EventListenerHelloEcho = (_dec$k = EventListener({
|
|
266
395
|
match: 'test-vona:helloEcho'
|
|
267
|
-
}), _dec2$
|
|
396
|
+
}), _dec2$k = BeanInfo({
|
|
268
397
|
module: "test-vona"
|
|
269
|
-
}), _dec$
|
|
398
|
+
}), _dec$k(_class$k = _dec2$k(_class$k = class EventListenerHelloEcho extends BeanBase {
|
|
270
399
|
async execute(data, next) {
|
|
271
400
|
// next
|
|
272
401
|
const result = await next();
|
|
273
402
|
return `${data.text} ${result}`;
|
|
274
403
|
}
|
|
275
|
-
}) || _class$
|
|
404
|
+
}) || _class$k) || _class$k);
|
|
276
405
|
|
|
277
|
-
var _dec$
|
|
278
|
-
let MetaVersion = (_dec$
|
|
406
|
+
var _dec$j, _dec2$j, _class$j;
|
|
407
|
+
let MetaVersion = (_dec$j = Meta(), _dec2$j = BeanInfo({
|
|
279
408
|
module: "test-vona"
|
|
280
|
-
}), _dec$
|
|
409
|
+
}), _dec$j(_class$j = _dec2$j(_class$j = class MetaVersion extends BeanBase {
|
|
281
410
|
async update(options) {
|
|
282
411
|
if (options.version === 1) {
|
|
283
412
|
// testVona
|
|
@@ -289,47 +418,47 @@ let MetaVersion = (_dec$q = Meta(), _dec2$q = BeanInfo({
|
|
|
289
418
|
});
|
|
290
419
|
}
|
|
291
420
|
}
|
|
292
|
-
}) || _class$
|
|
421
|
+
}) || _class$j) || _class$j);
|
|
293
422
|
|
|
294
|
-
var _dec$
|
|
295
|
-
let QueueTest = (_dec$
|
|
423
|
+
var _dec$i, _dec2$i, _class$i;
|
|
424
|
+
let QueueTest = (_dec$i = Queue(), _dec2$i = BeanInfo({
|
|
296
425
|
module: "test-vona"
|
|
297
|
-
}), _dec$
|
|
426
|
+
}), _dec$i(_class$i = _dec2$i(_class$i = class QueueTest extends BeanQueueBase {
|
|
298
427
|
async execute(data, _options) {
|
|
299
428
|
return data.a + data.b;
|
|
300
429
|
}
|
|
301
|
-
}) || _class$
|
|
430
|
+
}) || _class$i) || _class$i);
|
|
302
431
|
|
|
303
|
-
var _dec$
|
|
304
|
-
let
|
|
432
|
+
var _dec$h, _dec2$h, _class$h;
|
|
433
|
+
let ScheduleTest = (_dec$h = Schedule({
|
|
305
434
|
enable: false,
|
|
306
435
|
repeat: {
|
|
307
|
-
every:
|
|
436
|
+
every: 3000
|
|
308
437
|
}
|
|
309
|
-
}), _dec2$
|
|
438
|
+
}), _dec2$h = BeanInfo({
|
|
310
439
|
module: "test-vona"
|
|
311
|
-
}), _dec$
|
|
440
|
+
}), _dec$h(_class$h = _dec2$h(_class$h = class ScheduleTest extends BeanBase {
|
|
312
441
|
async execute(job) {
|
|
313
|
-
this.$logger.silly(`Schedule
|
|
442
|
+
this.$logger.silly(`Schedule Test: iid=${this.ctx.instance.id}, every=${job?.data.options?.jobOptions?.repeat?.every}, ${new Date()}`);
|
|
314
443
|
}
|
|
315
|
-
}) || _class$
|
|
444
|
+
}) || _class$h) || _class$h);
|
|
316
445
|
|
|
317
|
-
var _dec$
|
|
318
|
-
let
|
|
446
|
+
var _dec$g, _dec2$g, _class$g;
|
|
447
|
+
let ScheduleTest3 = (_dec$g = Schedule({
|
|
319
448
|
enable: false,
|
|
320
449
|
repeat: {
|
|
321
|
-
every:
|
|
450
|
+
every: 5000
|
|
322
451
|
}
|
|
323
|
-
}), _dec2$
|
|
452
|
+
}), _dec2$g = BeanInfo({
|
|
324
453
|
module: "test-vona"
|
|
325
|
-
}), _dec$
|
|
454
|
+
}), _dec$g(_class$g = _dec2$g(_class$g = class ScheduleTest3 extends BeanBase {
|
|
326
455
|
async execute(job) {
|
|
327
|
-
this.$logger.silly(`Schedule
|
|
456
|
+
this.$logger.silly(`Schedule Test3: iid=${this.ctx.instance.id}, every=${job?.data.options?.jobOptions?.repeat?.every}, ${new Date()}`);
|
|
328
457
|
}
|
|
329
|
-
}) || _class$
|
|
458
|
+
}) || _class$g) || _class$g);
|
|
330
459
|
|
|
331
|
-
var _dec$
|
|
332
|
-
let SummerCacheTest = (_dec$
|
|
460
|
+
var _dec$f, _dec2$f, _class$f;
|
|
461
|
+
let SummerCacheTest = (_dec$f = SummerCache({
|
|
333
462
|
mode: 'all',
|
|
334
463
|
mem: {
|
|
335
464
|
max: 2,
|
|
@@ -338,58 +467,78 @@ let SummerCacheTest = (_dec$m = SummerCache({
|
|
|
338
467
|
redis: {
|
|
339
468
|
ttl: 3 * 1000
|
|
340
469
|
}
|
|
341
|
-
}), _dec2$
|
|
470
|
+
}), _dec2$f = BeanInfo({
|
|
342
471
|
module: "test-vona"
|
|
343
|
-
}), _dec$
|
|
472
|
+
}), _dec$f(_class$f = _dec2$f(_class$f = class SummerCacheTest extends BeanSummerCacheBase {
|
|
344
473
|
async getNative(key, _options) {
|
|
345
474
|
return {
|
|
346
475
|
id: key.id,
|
|
347
476
|
name: `name_${key.id}`
|
|
348
477
|
};
|
|
349
478
|
}
|
|
350
|
-
}) || _class$
|
|
351
|
-
|
|
352
|
-
function config(_app) {
|
|
353
|
-
return {};
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
function _applyDecoratedDescriptor(i, e, r, n, l) {
|
|
357
|
-
var a = {};
|
|
358
|
-
return Object.keys(n).forEach(function (i) {
|
|
359
|
-
a[i] = n[i];
|
|
360
|
-
}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = true), a = r.slice().reverse().reduce(function (r, n) {
|
|
361
|
-
return n(i, e, r) || r;
|
|
362
|
-
}, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;
|
|
363
|
-
}
|
|
364
|
-
function _initializerDefineProperty(e, i, r, l) {
|
|
365
|
-
r && Object.defineProperty(e, i, {
|
|
366
|
-
enumerable: r.enumerable,
|
|
367
|
-
configurable: r.configurable,
|
|
368
|
-
writable: r.writable,
|
|
369
|
-
value: r.initializer ? r.initializer.call(l) : void 0
|
|
370
|
-
});
|
|
371
|
-
}
|
|
479
|
+
}) || _class$f) || _class$f);
|
|
372
480
|
|
|
373
|
-
|
|
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({
|
|
483
|
+
module: "test-vona"
|
|
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 {
|
|
485
|
+
constructor() {
|
|
486
|
+
_initializerDefineProperty(this, "id", _descriptor$1, this);
|
|
487
|
+
_initializerDefineProperty(this, "email", _descriptor2$1, this);
|
|
488
|
+
}
|
|
489
|
+
}, _descriptor$1 = _applyDecoratedDescriptor(_class2$d.prototype, "id", [_dec3$d, _dec4$d], {
|
|
490
|
+
configurable: true,
|
|
491
|
+
enumerable: true,
|
|
492
|
+
writable: true,
|
|
493
|
+
initializer: null
|
|
494
|
+
}), _descriptor2$1 = _applyDecoratedDescriptor(_class2$d.prototype, "email", [_dec5$d, _dec6$d], {
|
|
495
|
+
configurable: true,
|
|
496
|
+
enumerable: true,
|
|
497
|
+
writable: true,
|
|
498
|
+
initializer: null
|
|
499
|
+
}), _class2$d)) || _class$e) || _class$e);
|
|
374
500
|
|
|
375
|
-
var _dec$
|
|
376
|
-
let
|
|
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({
|
|
503
|
+
openapi: {
|
|
504
|
+
title: $locale('User')
|
|
505
|
+
}
|
|
506
|
+
}), _dec2$d = BeanInfo({
|
|
377
507
|
module: "test-vona"
|
|
378
|
-
}), _dec$
|
|
379
|
-
|
|
380
|
-
|
|
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 {
|
|
509
|
+
constructor() {
|
|
510
|
+
_initializerDefineProperty(this, "id", _descriptor, this);
|
|
511
|
+
_initializerDefineProperty(this, "name", _descriptor2, this);
|
|
512
|
+
_initializerDefineProperty(this, "married", _descriptor3, this);
|
|
381
513
|
}
|
|
382
|
-
}
|
|
514
|
+
}, _descriptor = _applyDecoratedDescriptor(_class2$c.prototype, "id", [_dec3$c, _dec4$c], {
|
|
515
|
+
configurable: true,
|
|
516
|
+
enumerable: true,
|
|
517
|
+
writable: true,
|
|
518
|
+
initializer: null
|
|
519
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2$c.prototype, "name", [_dec5$c, _dec6$c], {
|
|
520
|
+
configurable: true,
|
|
521
|
+
enumerable: true,
|
|
522
|
+
writable: true,
|
|
523
|
+
initializer: null
|
|
524
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2$c.prototype, "married", [_dec7$c, _dec8$8], {
|
|
525
|
+
configurable: true,
|
|
526
|
+
enumerable: true,
|
|
527
|
+
writable: true,
|
|
528
|
+
initializer: null
|
|
529
|
+
}), _class2$c)) || _class$d) || _class$d);
|
|
530
|
+
|
|
531
|
+
const __ThisModule__ = 'test-vona';
|
|
383
532
|
|
|
384
|
-
var _dec$
|
|
385
|
-
let ControllerBean = (_dec$
|
|
533
|
+
var _dec$c, _dec2$c, _dec3$b, _dec4$b, _dec5$b, _dec6$b, _dec7$b, _dec8$7, _dec9$6, _dec0$6, _dec1$6, _class$c, _class2$b;
|
|
534
|
+
let ControllerBean = (_dec$c = Controller({
|
|
386
535
|
path: 'bean',
|
|
387
536
|
meta: {
|
|
388
537
|
mode: 'test'
|
|
389
538
|
}
|
|
390
|
-
}), _dec2$
|
|
539
|
+
}), _dec2$c = Api.exclude(), _dec3$b = Passport.public(), _dec4$b = BeanInfo({
|
|
391
540
|
module: "test-vona"
|
|
392
|
-
}), _dec5$
|
|
541
|
+
}), _dec5$b = Web.get('test'), _dec6$b = Reflect.metadata("design:type", Function), _dec7$b = Reflect.metadata("design:paramtypes", []), _dec8$7 = Web.get('service'), _dec9$6 = Passport.public(), _dec0$6 = Reflect.metadata("design:type", Function), _dec1$6 = Reflect.metadata("design:paramtypes", []), _dec$c(_class$c = _dec2$c(_class$c = _dec3$b(_class$c = _dec4$b(_class$c = (_class2$b = class ControllerBean extends BeanBase {
|
|
393
542
|
async test() {
|
|
394
543
|
const a = 3;
|
|
395
544
|
const b = 4;
|
|
@@ -479,17 +628,17 @@ let ControllerBean = (_dec$k = Controller({
|
|
|
479
628
|
res = this.$scope.testVona.service.test.name;
|
|
480
629
|
assert.equal(res, 'serviceTest');
|
|
481
630
|
}
|
|
482
|
-
}, _applyDecoratedDescriptor(_class2$
|
|
631
|
+
}, _applyDecoratedDescriptor(_class2$b.prototype, "test", [_dec5$b, _dec6$b, _dec7$b], Object.getOwnPropertyDescriptor(_class2$b.prototype, "test"), _class2$b.prototype), _applyDecoratedDescriptor(_class2$b.prototype, "service", [_dec8$7, _dec9$6, _dec0$6, _dec1$6], Object.getOwnPropertyDescriptor(_class2$b.prototype, "service"), _class2$b.prototype), _class2$b)) || _class$c) || _class$c) || _class$c) || _class$c);
|
|
483
632
|
|
|
484
|
-
var _dec$
|
|
485
|
-
let ControllerCacheMem = (_dec$
|
|
633
|
+
var _dec$b, _dec2$b, _dec3$a, _dec4$a, _dec5$a, _dec6$a, _dec7$a, _class$b, _class2$a;
|
|
634
|
+
let ControllerCacheMem = (_dec$b = Controller({
|
|
486
635
|
path: 'cacheMem',
|
|
487
636
|
meta: {
|
|
488
637
|
mode: 'test'
|
|
489
638
|
}
|
|
490
|
-
}), _dec2$
|
|
639
|
+
}), _dec2$b = Api.exclude(), _dec3$a = Passport.public(), _dec4$a = BeanInfo({
|
|
491
640
|
module: "test-vona"
|
|
492
|
-
}), _dec5$
|
|
641
|
+
}), _dec5$a = Web.post(), _dec6$a = Reflect.metadata("design:type", Function), _dec7$a = Reflect.metadata("design:paramtypes", []), _dec$b(_class$b = _dec2$b(_class$b = _dec3$a(_class$b = _dec4$a(_class$b = (_class2$a = class ControllerCacheMem extends BeanBase {
|
|
493
642
|
async mem() {
|
|
494
643
|
let res;
|
|
495
644
|
let value;
|
|
@@ -530,17 +679,17 @@ let ControllerCacheMem = (_dec$j = Controller({
|
|
|
530
679
|
assert.equal(value, undefined);
|
|
531
680
|
});
|
|
532
681
|
}
|
|
533
|
-
}, _applyDecoratedDescriptor(_class2$
|
|
682
|
+
}, _applyDecoratedDescriptor(_class2$a.prototype, "mem", [_dec5$a, _dec6$a, _dec7$a], Object.getOwnPropertyDescriptor(_class2$a.prototype, "mem"), _class2$a.prototype), _class2$a)) || _class$b) || _class$b) || _class$b) || _class$b);
|
|
534
683
|
|
|
535
|
-
var _dec$
|
|
536
|
-
let ControllerCacheRedis = (_dec$
|
|
684
|
+
var _dec$a, _dec2$a, _dec3$9, _dec4$9, _dec5$9, _dec6$9, _dec7$9, _class$a, _class2$9;
|
|
685
|
+
let ControllerCacheRedis = (_dec$a = Controller({
|
|
537
686
|
path: 'cacheRedis',
|
|
538
687
|
meta: {
|
|
539
688
|
mode: 'test'
|
|
540
689
|
}
|
|
541
|
-
}), _dec2$
|
|
690
|
+
}), _dec2$a = Api.exclude(), _dec3$9 = Passport.public(), _dec4$9 = BeanInfo({
|
|
542
691
|
module: "test-vona"
|
|
543
|
-
}), _dec5$
|
|
692
|
+
}), _dec5$9 = Web.post(), _dec6$9 = Reflect.metadata("design:type", Function), _dec7$9 = Reflect.metadata("design:paramtypes", []), _dec$a(_class$a = _dec2$a(_class$a = _dec3$9(_class$a = _dec4$9(_class$a = (_class2$9 = class ControllerCacheRedis extends BeanBase {
|
|
544
693
|
async redis() {
|
|
545
694
|
let res;
|
|
546
695
|
let value;
|
|
@@ -581,99 +730,69 @@ let ControllerCacheRedis = (_dec$i = Controller({
|
|
|
581
730
|
assert.equal(value, undefined);
|
|
582
731
|
});
|
|
583
732
|
}
|
|
584
|
-
}, _applyDecoratedDescriptor(_class2$
|
|
733
|
+
}, _applyDecoratedDescriptor(_class2$9.prototype, "redis", [_dec5$9, _dec6$9, _dec7$9], Object.getOwnPropertyDescriptor(_class2$9.prototype, "redis"), _class2$9.prototype), _class2$9)) || _class$a) || _class$a) || _class$a) || _class$a);
|
|
585
734
|
|
|
586
|
-
var _dec$
|
|
587
|
-
let ControllerGuardPassport = (_dec$
|
|
735
|
+
var _dec$9, _dec2$9, _dec3$8, _dec4$8, _dec5$8, _dec6$8, _dec7$8, _dec8$6, _dec9$5, _dec0$5, _dec1$5, _dec10$4, _dec11$4, _dec12$4, _dec13$4, _dec14$3, _dec15$3, _dec16$3, _class$9, _class2$8;
|
|
736
|
+
let ControllerGuardPassport = (_dec$9 = Controller('guardPassport'), _dec2$9 = BeanInfo({
|
|
588
737
|
module: "test-vona"
|
|
589
|
-
}), _dec3$
|
|
738
|
+
}), _dec3$8 = Web.get('testUserName'), _dec4$8 = Passport.userName({
|
|
590
739
|
name: 'admin'
|
|
591
|
-
}), _dec5$
|
|
740
|
+
}), _dec5$8 = Reflect.metadata("design:type", Function), _dec6$8 = Reflect.metadata("design:paramtypes", []), _dec7$8 = Web.get('testUserNameFail'), _dec8$6 = Passport.userName({
|
|
592
741
|
name: 'admin-none'
|
|
593
|
-
}), _dec9$
|
|
742
|
+
}), _dec9$5 = Reflect.metadata("design:type", Function), _dec0$5 = Reflect.metadata("design:paramtypes", []), _dec1$5 = Web.get('testRoleName'), _dec10$4 = Passport.roleName({
|
|
594
743
|
name: 'admin'
|
|
595
|
-
}), _dec11$
|
|
744
|
+
}), _dec11$4 = Reflect.metadata("design:type", Function), _dec12$4 = Reflect.metadata("design:paramtypes", []), _dec13$4 = Web.get('testRoleNameFail'), _dec14$3 = Passport.roleName({
|
|
596
745
|
name: 'admin-none'
|
|
597
|
-
}), _dec15$
|
|
746
|
+
}), _dec15$3 = Reflect.metadata("design:type", Function), _dec16$3 = Reflect.metadata("design:paramtypes", []), _dec$9(_class$9 = _dec2$9(_class$9 = (_class2$8 = class ControllerGuardPassport extends BeanBase {
|
|
598
747
|
testUserName() {}
|
|
599
748
|
testUserNameFail() {}
|
|
600
749
|
testRoleName() {}
|
|
601
750
|
testRoleNameFail() {}
|
|
602
|
-
}, _applyDecoratedDescriptor(_class2$
|
|
603
|
-
|
|
604
|
-
var _dec$g, _dec2$g, _dec3$c, _dec4$c, _dec5$c, _dec6$c, _dec7$a, _dec8$8, _class$g, _class2$c, _descriptor$2, _descriptor2$2, _descriptor3;
|
|
605
|
-
let DtoUser = (_dec$g = Dto({
|
|
606
|
-
openapi: {
|
|
607
|
-
title: $locale('User')
|
|
608
|
-
}
|
|
609
|
-
}), _dec2$g = BeanInfo({
|
|
610
|
-
module: "test-vona"
|
|
611
|
-
}), _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$a = Api.field(), _dec8$8 = Reflect.metadata("design:type", Boolean), _dec$g(_class$g = _dec2$g(_class$g = (_class2$c = class DtoUser {
|
|
612
|
-
constructor() {
|
|
613
|
-
_initializerDefineProperty(this, "id", _descriptor$2, this);
|
|
614
|
-
_initializerDefineProperty(this, "name", _descriptor2$2, this);
|
|
615
|
-
_initializerDefineProperty(this, "married", _descriptor3, this);
|
|
616
|
-
}
|
|
617
|
-
}, _descriptor$2 = _applyDecoratedDescriptor(_class2$c.prototype, "id", [_dec3$c, _dec4$c], {
|
|
618
|
-
configurable: true,
|
|
619
|
-
enumerable: true,
|
|
620
|
-
writable: true,
|
|
621
|
-
initializer: null
|
|
622
|
-
}), _descriptor2$2 = _applyDecoratedDescriptor(_class2$c.prototype, "name", [_dec5$c, _dec6$c], {
|
|
623
|
-
configurable: true,
|
|
624
|
-
enumerable: true,
|
|
625
|
-
writable: true,
|
|
626
|
-
initializer: null
|
|
627
|
-
}), _descriptor3 = _applyDecoratedDescriptor(_class2$c.prototype, "married", [_dec7$a, _dec8$8], {
|
|
628
|
-
configurable: true,
|
|
629
|
-
enumerable: true,
|
|
630
|
-
writable: true,
|
|
631
|
-
initializer: null
|
|
632
|
-
}), _class2$c)) || _class$g) || _class$g);
|
|
751
|
+
}, _applyDecoratedDescriptor(_class2$8.prototype, "testUserName", [_dec3$8, _dec4$8, _dec5$8, _dec6$8], Object.getOwnPropertyDescriptor(_class2$8.prototype, "testUserName"), _class2$8.prototype), _applyDecoratedDescriptor(_class2$8.prototype, "testUserNameFail", [_dec7$8, _dec8$6, _dec9$5, _dec0$5], Object.getOwnPropertyDescriptor(_class2$8.prototype, "testUserNameFail"), _class2$8.prototype), _applyDecoratedDescriptor(_class2$8.prototype, "testRoleName", [_dec1$5, _dec10$4, _dec11$4, _dec12$4], Object.getOwnPropertyDescriptor(_class2$8.prototype, "testRoleName"), _class2$8.prototype), _applyDecoratedDescriptor(_class2$8.prototype, "testRoleNameFail", [_dec13$4, _dec14$3, _dec15$3, _dec16$3], Object.getOwnPropertyDescriptor(_class2$8.prototype, "testRoleNameFail"), _class2$8.prototype), _class2$8)) || _class$9) || _class$9);
|
|
633
752
|
|
|
634
|
-
var _dec$
|
|
635
|
-
let ControllerOnion = (_dec$
|
|
753
|
+
var _dec$8, _dec2$8, _dec3$7, _dec4$7, _dec5$7, _dec6$7, _dec7$7, _dec8$5, _dec9$4, _dec0$4, _dec1$4, _dec10$3, _dec11$3, _dec12$3, _dec13$3, _dec14$2, _dec15$2, _dec16$2, _dec17$2, _dec18$2, _dec19$2, _dec20$2, _dec21$2, _dec22$2, _dec23$2, _dec24$2, _dec25$2, _dec26$1, _dec27$1, _dec28, _dec29, _dec30, _dec31, _dec32, _dec33, _dec34, _dec35, _dec36, _dec37, _dec38, _dec39, _dec40, _dec41, _dec42, _dec43, _dec44, _dec45, _dec46, _dec47, _dec48, _class$8, _class2$7;
|
|
754
|
+
let ControllerOnion = (_dec$8 = Controller({
|
|
636
755
|
path: 'onion',
|
|
637
756
|
tags: ['Onion'],
|
|
638
757
|
meta: {
|
|
639
|
-
mode: ['
|
|
758
|
+
mode: ['dev', 'test']
|
|
640
759
|
}
|
|
641
|
-
}), _dec2$
|
|
760
|
+
}), _dec2$8 = BeanInfo({
|
|
642
761
|
module: "test-vona"
|
|
643
|
-
}), _dec3$
|
|
762
|
+
}), _dec3$7 = Web.get('/'), _dec4$7 = Aspect.aopMethod('a-database:transaction', {
|
|
644
763
|
enable: true,
|
|
645
764
|
meta: {
|
|
646
|
-
mode: '
|
|
765
|
+
mode: 'dev'
|
|
647
766
|
}
|
|
648
|
-
}), _dec5$
|
|
767
|
+
}), _dec5$7 = Aspect.guardGlobal('a-user:passport', {
|
|
649
768
|
public: true
|
|
650
|
-
}), _dec6$
|
|
769
|
+
}), _dec6$7 = Reflect.metadata("design:type", Function), _dec7$7 = Reflect.metadata("design:paramtypes", []), _dec8$5 = Web.post('//echo'), _dec9$4 = Aspect.guardGlobal('a-user:passport', {
|
|
651
770
|
public: true
|
|
652
|
-
}), _dec0$
|
|
771
|
+
}), _dec0$4 = Aspect.middlewareGlobal('a-core:gate', {
|
|
653
772
|
gate: {
|
|
654
|
-
mode: '
|
|
773
|
+
mode: 'dev'
|
|
655
774
|
}
|
|
656
|
-
}), _dec1$
|
|
775
|
+
}), _dec1$4 = Core.gate({
|
|
657
776
|
gate: {
|
|
658
|
-
mode: '
|
|
777
|
+
mode: 'dev'
|
|
659
778
|
}
|
|
660
|
-
}), _dec10$
|
|
779
|
+
}), _dec10$3 = Aspect.aopMethod('a-database:transaction', {
|
|
661
780
|
isolationLevel: 'SERIALIZABLE',
|
|
662
781
|
readOnly: true
|
|
663
|
-
}), _dec11$
|
|
782
|
+
}), _dec11$3 = Database.transaction({
|
|
664
783
|
isolationLevel: 'READ_COMMITTED',
|
|
665
784
|
readOnly: false
|
|
666
|
-
}), _dec12$
|
|
785
|
+
}), _dec12$3 = Api.body(v.optional(), z.string()), _dec13$3 = function (target, key) {
|
|
667
786
|
return Arg.query('id', v.default(0), z.number())(target, key, 0);
|
|
668
|
-
}, _dec14$
|
|
787
|
+
}, _dec14$2 = function (target, key) {
|
|
669
788
|
return Arg.query('name', z.number().optional())(target, key, 2);
|
|
670
|
-
}, _dec15$
|
|
789
|
+
}, _dec15$2 = function (target, key) {
|
|
671
790
|
return Arg.body(v.title($locale('User')), z.object({
|
|
672
791
|
id: z.number().openapi({
|
|
673
792
|
title: $locale('UserId')
|
|
674
793
|
})
|
|
675
794
|
}))(target, key, 3);
|
|
676
|
-
}, _dec16$
|
|
795
|
+
}, _dec16$2 = Reflect.metadata("design:type", Function), _dec17$2 = Reflect.metadata("design:paramtypes", [Number, String, String, typeof DtoUser === "undefined" ? Object : DtoUser]), _dec18$2 = Web.post('echo2/:userId/:userName'), _dec19$2 = Aspect.guardGlobal('a-user:passport', {
|
|
677
796
|
public: true
|
|
678
797
|
}), _dec20$2 = function (target, key) {
|
|
679
798
|
return Arg.param('userId', v.title($locale('UserId')), v.example('example:1'))(target, key, 0);
|
|
@@ -708,7 +827,7 @@ let ControllerOnion = (_dec$f = Controller({
|
|
|
708
827
|
return Arg.query('ids', v.default([1]), v.array(Number, {
|
|
709
828
|
separator: '-'
|
|
710
829
|
}))(target, key, 0);
|
|
711
|
-
}, _dec43 = Reflect.metadata("design:type", Function), _dec44 = Reflect.metadata("design:paramtypes", [Array]), _dec45 = Web.get('echo6'), _dec46 = Passport.admin(), _dec47 = Reflect.metadata("design:type", Function), _dec48 = Reflect.metadata("design:paramtypes", []), _dec$
|
|
830
|
+
}, _dec43 = Reflect.metadata("design:type", Function), _dec44 = Reflect.metadata("design:paramtypes", [Array]), _dec45 = Web.get('echo6'), _dec46 = Passport.admin(), _dec47 = Reflect.metadata("design:type", Function), _dec48 = Reflect.metadata("design:paramtypes", []), _dec$8(_class$8 = _dec2$8(_class$8 = (_class2$7 = class ControllerOnion extends BeanBase {
|
|
712
831
|
index() {
|
|
713
832
|
return this.ctx.db.inTransaction;
|
|
714
833
|
// return 'Hello Vona';
|
|
@@ -739,25 +858,25 @@ let ControllerOnion = (_dec$f = Controller({
|
|
|
739
858
|
echo6() {
|
|
740
859
|
return this.bean.passport.isAuthenticated;
|
|
741
860
|
}
|
|
742
|
-
}, _applyDecoratedDescriptor(_class2$
|
|
861
|
+
}, _applyDecoratedDescriptor(_class2$7.prototype, "index", [_dec3$7, _dec4$7, _dec5$7, _dec6$7, _dec7$7], Object.getOwnPropertyDescriptor(_class2$7.prototype, "index"), _class2$7.prototype), _applyDecoratedDescriptor(_class2$7.prototype, "echo", [_dec8$5, _dec9$4, _dec0$4, _dec1$4, _dec10$3, _dec11$3, _dec12$3, _dec13$3, _dec14$2, _dec15$2, _dec16$2, _dec17$2], Object.getOwnPropertyDescriptor(_class2$7.prototype, "echo"), _class2$7.prototype), _applyDecoratedDescriptor(_class2$7.prototype, "echo2", [_dec18$2, _dec19$2, _dec20$2, _dec21$2, _dec22$2, _dec23$2, _dec24$2, _dec25$2], Object.getOwnPropertyDescriptor(_class2$7.prototype, "echo2"), _class2$7.prototype), _applyDecoratedDescriptor(_class2$7.prototype, "echo3", [_dec26$1, _dec27$1, _dec28, _dec29, _dec30, _dec31, _dec32], Object.getOwnPropertyDescriptor(_class2$7.prototype, "echo3"), _class2$7.prototype), _applyDecoratedDescriptor(_class2$7.prototype, "echo4", [_dec33, _dec34, _dec35, _dec36, _dec37, _dec38, _dec39], Object.getOwnPropertyDescriptor(_class2$7.prototype, "echo4"), _class2$7.prototype), _applyDecoratedDescriptor(_class2$7.prototype, "echo5", [_dec40, _dec41, _dec42, _dec43, _dec44], Object.getOwnPropertyDescriptor(_class2$7.prototype, "echo5"), _class2$7.prototype), _applyDecoratedDescriptor(_class2$7.prototype, "echo6", [_dec45, _dec46, _dec47, _dec48], Object.getOwnPropertyDescriptor(_class2$7.prototype, "echo6"), _class2$7.prototype), _class2$7)) || _class$8) || _class$8);
|
|
743
862
|
|
|
744
|
-
var _dec$
|
|
745
|
-
let ControllerPassport = (_dec$
|
|
863
|
+
var _dec$7, _dec2$7, _dec3$6, _dec4$6, _dec5$6, _dec6$6, _dec7$6, _dec8$4, _dec9$3, _dec0$3, _dec1$3, _dec10$2, _dec11$2, _dec12$2, _dec13$2, _dec14$1, _dec15$1, _dec16$1, _dec17$1, _dec18$1, _dec19$1, _dec20$1, _dec21$1, _dec22$1, _dec23$1, _dec24$1, _dec25$1, _class$7, _class2$6;
|
|
864
|
+
let ControllerPassport = (_dec$7 = Controller({
|
|
746
865
|
path: 'passport',
|
|
747
866
|
meta: {
|
|
748
867
|
mode: 'test'
|
|
749
868
|
}
|
|
750
|
-
}), _dec2$
|
|
869
|
+
}), _dec2$7 = Api.exclude(), _dec3$6 = BeanInfo({
|
|
751
870
|
module: "test-vona"
|
|
752
|
-
}), _dec4$
|
|
871
|
+
}), _dec4$6 = Web.get('echo/:name'), _dec5$6 = Passport.public(), _dec6$6 = function (target, key) {
|
|
753
872
|
return Arg.param('name')(target, key, 0);
|
|
754
|
-
}, _dec7$
|
|
873
|
+
}, _dec7$6 = function (target, key) {
|
|
755
874
|
return Arg.user()(target, key, 1);
|
|
756
|
-
}, _dec8$
|
|
875
|
+
}, _dec8$4 = Reflect.metadata("design:type", Function), _dec9$3 = Reflect.metadata("design:paramtypes", [String, typeof IUserBase === "undefined" ? Object : IUserBase]), _dec0$3 = Web.post('login'), _dec1$3 = Api.body(v.object(DtoJwtToken)), _dec10$2 = Passport.public(), _dec11$2 = function (target, key) {
|
|
757
876
|
return Arg.body('name')(target, key, 0);
|
|
758
|
-
}, _dec12$
|
|
877
|
+
}, _dec12$2 = Reflect.metadata("design:type", Function), _dec13$2 = Reflect.metadata("design:paramtypes", [String]), _dec14$1 = Web.get('isAuthenticated'), _dec15$1 = Reflect.metadata("design:type", Function), _dec16$1 = Reflect.metadata("design:paramtypes", []), _dec17$1 = Web.post('refresh'), _dec18$1 = Api.body(v.object(DtoJwtToken)), _dec19$1 = Passport.public(), _dec20$1 = function (target, key) {
|
|
759
878
|
return Arg.body('refreshToken')(target, key, 0);
|
|
760
|
-
}, _dec21$1 = Reflect.metadata("design:type", Function), _dec22$1 = Reflect.metadata("design:paramtypes", [String]), _dec23$1 = Web.post('logout'), _dec24$1 = Reflect.metadata("design:type", Function), _dec25$1 = Reflect.metadata("design:paramtypes", []), _dec$
|
|
879
|
+
}, _dec21$1 = Reflect.metadata("design:type", Function), _dec22$1 = Reflect.metadata("design:paramtypes", [String]), _dec23$1 = Web.post('logout'), _dec24$1 = Reflect.metadata("design:type", Function), _dec25$1 = Reflect.metadata("design:paramtypes", []), _dec$7(_class$7 = _dec2$7(_class$7 = _dec3$6(_class$7 = (_class2$6 = class ControllerPassport extends BeanBase {
|
|
761
880
|
echo(name, user) {
|
|
762
881
|
assert.equal(name, 'admin');
|
|
763
882
|
assert.equal($getUserName(user), 'admin');
|
|
@@ -779,19 +898,19 @@ let ControllerPassport = (_dec$e = Controller({
|
|
|
779
898
|
async logout() {
|
|
780
899
|
return await this.bean.passport.signout();
|
|
781
900
|
}
|
|
782
|
-
}, _applyDecoratedDescriptor(_class2$
|
|
901
|
+
}, _applyDecoratedDescriptor(_class2$6.prototype, "echo", [_dec4$6, _dec5$6, _dec6$6, _dec7$6, _dec8$4, _dec9$3], Object.getOwnPropertyDescriptor(_class2$6.prototype, "echo"), _class2$6.prototype), _applyDecoratedDescriptor(_class2$6.prototype, "login", [_dec0$3, _dec1$3, _dec10$2, _dec11$2, _dec12$2, _dec13$2], Object.getOwnPropertyDescriptor(_class2$6.prototype, "login"), _class2$6.prototype), _applyDecoratedDescriptor(_class2$6.prototype, "isAuthenticated", [_dec14$1, _dec15$1, _dec16$1], Object.getOwnPropertyDescriptor(_class2$6.prototype, "isAuthenticated"), _class2$6.prototype), _applyDecoratedDescriptor(_class2$6.prototype, "refresh", [_dec17$1, _dec18$1, _dec19$1, _dec20$1, _dec21$1, _dec22$1], Object.getOwnPropertyDescriptor(_class2$6.prototype, "refresh"), _class2$6.prototype), _applyDecoratedDescriptor(_class2$6.prototype, "logout", [_dec23$1, _dec24$1, _dec25$1], Object.getOwnPropertyDescriptor(_class2$6.prototype, "logout"), _class2$6.prototype), _class2$6)) || _class$7) || _class$7) || _class$7);
|
|
783
902
|
|
|
784
|
-
var _dec$
|
|
785
|
-
let ControllerPerformAction = (_dec$
|
|
903
|
+
var _dec$6, _dec2$6, _dec3$5, _dec4$5, _dec5$5, _dec6$5, _dec7$5, _dec8$3, _class$6, _class2$5;
|
|
904
|
+
let ControllerPerformAction = (_dec$6 = Controller({
|
|
786
905
|
path: 'performAction',
|
|
787
906
|
meta: {
|
|
788
907
|
mode: 'test'
|
|
789
908
|
}
|
|
790
|
-
}), _dec2$
|
|
909
|
+
}), _dec2$6 = Api.exclude(), _dec3$5 = BeanInfo({
|
|
791
910
|
module: "test-vona"
|
|
792
|
-
}), _dec4$
|
|
911
|
+
}), _dec4$5 = Web.post('echo'), _dec5$5 = Passport.public(), _dec6$5 = function (target, key) {
|
|
793
912
|
return Arg.body('id')(target, key, 0);
|
|
794
|
-
}, _dec7$
|
|
913
|
+
}, _dec7$5 = Reflect.metadata("design:type", Function), _dec8$3 = Reflect.metadata("design:paramtypes", [Number]), _dec$6(_class$6 = _dec2$6(_class$6 = _dec3$5(_class$6 = (_class2$5 = class ControllerPerformAction extends BeanBase {
|
|
795
914
|
echo(id) {
|
|
796
915
|
const url = this.scope.util.combineApiPath('performAction/echo');
|
|
797
916
|
return {
|
|
@@ -799,17 +918,17 @@ let ControllerPerformAction = (_dec$d = Controller({
|
|
|
799
918
|
url
|
|
800
919
|
};
|
|
801
920
|
}
|
|
802
|
-
}, _applyDecoratedDescriptor(_class2$
|
|
921
|
+
}, _applyDecoratedDescriptor(_class2$5.prototype, "echo", [_dec4$5, _dec5$5, _dec6$5, _dec7$5, _dec8$3], Object.getOwnPropertyDescriptor(_class2$5.prototype, "echo"), _class2$5.prototype), _class2$5)) || _class$6) || _class$6) || _class$6);
|
|
803
922
|
|
|
804
|
-
var _dec$
|
|
805
|
-
let ControllerQueue = (_dec$
|
|
923
|
+
var _dec$5, _dec2$5, _dec3$4, _dec4$4, _dec5$4, _dec6$4, _dec7$4, _dec8$2, _dec9$2, _dec0$2, _dec1$2, _class$5, _class2$4;
|
|
924
|
+
let ControllerQueue = (_dec$5 = Controller({
|
|
806
925
|
path: 'queue',
|
|
807
926
|
meta: {
|
|
808
927
|
mode: 'test'
|
|
809
928
|
}
|
|
810
|
-
}), _dec2$
|
|
929
|
+
}), _dec2$5 = Api.exclude(), _dec3$4 = BeanInfo({
|
|
811
930
|
module: "test-vona"
|
|
812
|
-
}), _dec4$
|
|
931
|
+
}), _dec4$4 = Web.post('pushAsync'), _dec5$4 = Passport.public(), _dec6$4 = Reflect.metadata("design:type", Function), _dec7$4 = Reflect.metadata("design:paramtypes", []), _dec8$2 = Web.post('push'), _dec9$2 = Passport.public(), _dec0$2 = Reflect.metadata("design:type", Function), _dec1$2 = Reflect.metadata("design:paramtypes", []), _dec$5(_class$5 = _dec2$5(_class$5 = _dec3$4(_class$5 = (_class2$4 = class ControllerQueue extends BeanBase {
|
|
813
932
|
async pushAsync() {
|
|
814
933
|
const res = await this.scope.queue.test.pushAsync({
|
|
815
934
|
a: 1,
|
|
@@ -823,17 +942,17 @@ let ControllerQueue = (_dec$c = Controller({
|
|
|
823
942
|
b: 2
|
|
824
943
|
});
|
|
825
944
|
}
|
|
826
|
-
}, _applyDecoratedDescriptor(_class2$
|
|
945
|
+
}, _applyDecoratedDescriptor(_class2$4.prototype, "pushAsync", [_dec4$4, _dec5$4, _dec6$4, _dec7$4], Object.getOwnPropertyDescriptor(_class2$4.prototype, "pushAsync"), _class2$4.prototype), _applyDecoratedDescriptor(_class2$4.prototype, "push", [_dec8$2, _dec9$2, _dec0$2, _dec1$2], Object.getOwnPropertyDescriptor(_class2$4.prototype, "push"), _class2$4.prototype), _class2$4)) || _class$5) || _class$5) || _class$5);
|
|
827
946
|
|
|
828
|
-
var _dec$
|
|
829
|
-
let ControllerSummer = (_dec$
|
|
947
|
+
var _dec$4, _dec2$4, _dec3$3, _dec4$3, _dec5$3, _dec6$3, _dec7$3, _class$4, _class2$3;
|
|
948
|
+
let ControllerSummer = (_dec$4 = Controller({
|
|
830
949
|
path: 'summer',
|
|
831
950
|
meta: {
|
|
832
951
|
mode: 'test'
|
|
833
952
|
}
|
|
834
|
-
}), _dec2$
|
|
953
|
+
}), _dec2$4 = Api.exclude(), _dec3$3 = BeanInfo({
|
|
835
954
|
module: "test-vona"
|
|
836
|
-
}), _dec4$
|
|
955
|
+
}), _dec4$3 = Web.post(), _dec5$3 = Passport.public(), _dec6$3 = Reflect.metadata("design:type", Function), _dec7$3 = Reflect.metadata("design:paramtypes", []), _dec$4(_class$4 = _dec2$4(_class$4 = _dec3$3(_class$4 = (_class2$3 = class ControllerSummer extends BeanBase {
|
|
837
956
|
async test() {
|
|
838
957
|
// name
|
|
839
958
|
const name = 'test';
|
|
@@ -976,17 +1095,17 @@ let ControllerSummer = (_dec$b = Controller({
|
|
|
976
1095
|
});
|
|
977
1096
|
assert.equal(value, undefined);
|
|
978
1097
|
}
|
|
979
|
-
}, _applyDecoratedDescriptor(_class2$
|
|
1098
|
+
}, _applyDecoratedDescriptor(_class2$3.prototype, "test", [_dec4$3, _dec5$3, _dec6$3, _dec7$3], Object.getOwnPropertyDescriptor(_class2$3.prototype, "test"), _class2$3.prototype), _class2$3)) || _class$4) || _class$4) || _class$4);
|
|
980
1099
|
|
|
981
|
-
var _dec$
|
|
982
|
-
let ControllerTail = (_dec$
|
|
1100
|
+
var _dec$3, _dec2$3, _dec3$2, _dec4$2, _dec5$2, _dec6$2, _dec7$2, _class$3, _class2$2;
|
|
1101
|
+
let ControllerTail = (_dec$3 = Controller({
|
|
983
1102
|
path: 'tail',
|
|
984
1103
|
meta: {
|
|
985
1104
|
mode: 'test'
|
|
986
1105
|
}
|
|
987
|
-
}), _dec2$
|
|
1106
|
+
}), _dec2$3 = Api.exclude(), _dec3$2 = BeanInfo({
|
|
988
1107
|
module: "test-vona"
|
|
989
|
-
}), _dec4$
|
|
1108
|
+
}), _dec4$2 = Web.post(), _dec5$2 = Passport.public(), _dec6$2 = Reflect.metadata("design:type", Function), _dec7$2 = Reflect.metadata("design:paramtypes", []), _dec$3(_class$3 = _dec2$3(_class$3 = _dec3$2(_class$3 = (_class2$2 = class ControllerTail extends BeanBase {
|
|
990
1109
|
tail() {
|
|
991
1110
|
// 1
|
|
992
1111
|
cast(this.ctx)._tail_test = 1;
|
|
@@ -1004,51 +1123,51 @@ let ControllerTail = (_dec$a = Controller({
|
|
|
1004
1123
|
// 2
|
|
1005
1124
|
cast(this.ctx)._tail_test = 2;
|
|
1006
1125
|
}
|
|
1007
|
-
}, _applyDecoratedDescriptor(_class2$
|
|
1126
|
+
}, _applyDecoratedDescriptor(_class2$2.prototype, "tail", [_dec4$2, _dec5$2, _dec6$2, _dec7$2], Object.getOwnPropertyDescriptor(_class2$2.prototype, "tail"), _class2$2.prototype), _class2$2)) || _class$3) || _class$3) || _class$3);
|
|
1008
1127
|
|
|
1009
|
-
var _dec$
|
|
1010
|
-
const tableNameFail
|
|
1011
|
-
const tableNameSuccess
|
|
1012
|
-
let ControllerTransaction = (_dec$
|
|
1128
|
+
var _dec$2, _dec2$2, _dec3$1, _dec4$1, _dec5$1, _dec6$1, _dec7$1, _dec8$1, _dec9$1, _dec0$1, _dec1$1, _dec10$1, _dec11$1, _dec12$1, _dec13$1, _class$2, _class2$1;
|
|
1129
|
+
const tableNameFail = '__tempTransactionFail';
|
|
1130
|
+
const tableNameSuccess = '__tempTransactionSuccess';
|
|
1131
|
+
let ControllerTransaction = (_dec$2 = Controller({
|
|
1013
1132
|
path: 'transaction',
|
|
1014
1133
|
meta: {
|
|
1015
1134
|
mode: 'test'
|
|
1016
1135
|
}
|
|
1017
|
-
}), _dec2$
|
|
1136
|
+
}), _dec2$2 = Api.exclude(), _dec3$1 = BeanInfo({
|
|
1018
1137
|
module: "test-vona"
|
|
1019
|
-
}), _dec4$
|
|
1138
|
+
}), _dec4$1 = Web.post('fail'), _dec5$1 = Database.transaction(), _dec6$1 = Passport.public(), _dec7$1 = function (target, key) {
|
|
1020
1139
|
return Arg.body()(target, key, 0);
|
|
1021
|
-
}, _dec8$
|
|
1140
|
+
}, _dec8$1 = Reflect.metadata("design:type", Function), _dec9$1 = Reflect.metadata("design:paramtypes", [Object]), _dec0$1 = Web.post('success'), _dec1$1 = Database.transaction(), _dec10$1 = Passport.public(), _dec11$1 = function (target, key) {
|
|
1022
1141
|
return Arg.body()(target, key, 0);
|
|
1023
|
-
}, _dec12$
|
|
1142
|
+
}, _dec12$1 = Reflect.metadata("design:type", Function), _dec13$1 = Reflect.metadata("design:paramtypes", [Object]), _dec$2(_class$2 = _dec2$2(_class$2 = _dec3$1(_class$2 = (_class2$1 = class ControllerTransaction extends BeanBase {
|
|
1024
1143
|
async fail(item) {
|
|
1025
|
-
await this.app.bean.model.update(`${tableNameFail
|
|
1026
|
-
await this.app.bean.model.update(`${tableNameFail
|
|
1144
|
+
await this.app.bean.model.update(`${tableNameFail}`, item);
|
|
1145
|
+
await this.app.bean.model.update(`${tableNameFail}error`, item);
|
|
1027
1146
|
}
|
|
1028
1147
|
async success(item) {
|
|
1029
|
-
await this.app.bean.model.update(tableNameSuccess
|
|
1148
|
+
await this.app.bean.model.update(tableNameSuccess, item);
|
|
1030
1149
|
}
|
|
1031
|
-
}, _applyDecoratedDescriptor(_class2$
|
|
1150
|
+
}, _applyDecoratedDescriptor(_class2$1.prototype, "fail", [_dec4$1, _dec5$1, _dec6$1, _dec7$1, _dec8$1, _dec9$1], Object.getOwnPropertyDescriptor(_class2$1.prototype, "fail"), _class2$1.prototype), _applyDecoratedDescriptor(_class2$1.prototype, "success", [_dec0$1, _dec1$1, _dec10$1, _dec11$1, _dec12$1, _dec13$1], Object.getOwnPropertyDescriptor(_class2$1.prototype, "success"), _class2$1.prototype), _class2$1)) || _class$2) || _class$2) || _class$2);
|
|
1032
1151
|
|
|
1033
|
-
var _dec$
|
|
1034
|
-
let ControllerUpload = (_dec$
|
|
1152
|
+
var _dec$1, _dec2$1, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec0, _dec1, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _dec21, _dec22, _dec23, _dec24, _dec25, _dec26, _dec27, _class$1, _class2;
|
|
1153
|
+
let ControllerUpload = (_dec$1 = Controller({
|
|
1035
1154
|
path: 'upload',
|
|
1036
1155
|
meta: {
|
|
1037
|
-
mode: ['test', '
|
|
1156
|
+
mode: ['test', 'dev']
|
|
1038
1157
|
}
|
|
1039
|
-
}), _dec2$
|
|
1158
|
+
}), _dec2$1 = BeanInfo({
|
|
1040
1159
|
module: "test-vona"
|
|
1041
|
-
}), _dec3
|
|
1160
|
+
}), _dec3 = Web.post('fields'), _dec4 = Passport.public(), _dec5 = Aspect.interceptor('a-upload:upload'), _dec6 = Api.contentType('application/json'), _dec7 = function (target, key) {
|
|
1042
1161
|
return Arg.fields()(target, key, 0);
|
|
1043
|
-
}, _dec8
|
|
1162
|
+
}, _dec8 = function (target, key) {
|
|
1044
1163
|
return Arg.fields('checkes', v.array(z.string()))(target, key, 1);
|
|
1045
|
-
}, _dec9
|
|
1164
|
+
}, _dec9 = function (target, key) {
|
|
1046
1165
|
return Arg.field('name', v.default('zhennann'), v.title('your name'))(target, key, 2);
|
|
1047
|
-
}, _dec0
|
|
1166
|
+
}, _dec0 = Reflect.metadata("design:type", Function), _dec1 = Reflect.metadata("design:paramtypes", [Array, Array, String]), _dec10 = Web.post('file'), _dec11 = Passport.public(), _dec12 = Aspect.interceptor('a-upload:upload'), _dec13 = Api.contentType('application/json'), _dec14 = function (target, key) {
|
|
1048
1167
|
return Arg.field('name', v.default('zhennann'))(target, key, 0);
|
|
1049
|
-
}, _dec15
|
|
1168
|
+
}, _dec15 = function (target, key) {
|
|
1050
1169
|
return Arg.file('welcome')(target, key, 1);
|
|
1051
|
-
}, _dec16
|
|
1170
|
+
}, _dec16 = Reflect.metadata("design:type", Function), _dec17 = Reflect.metadata("design:paramtypes", [String, typeof IUploadFile === "undefined" ? Object : IUploadFile]), _dec18 = Web.post('files'), _dec19 = Passport.public(), _dec20 = Aspect.interceptor('a-upload:upload'), _dec21 = Api.contentType('application/json'), _dec22 = function (target, key) {
|
|
1052
1171
|
return Arg.files(v.title('more files'))(target, key, 0);
|
|
1053
1172
|
}, _dec23 = function (target, key) {
|
|
1054
1173
|
return Arg.files('images', v.title('images'))(target, key, 1);
|
|
@@ -1056,7 +1175,7 @@ let ControllerUpload = (_dec$8 = Controller({
|
|
|
1056
1175
|
return Arg.file('welcome1', v.title('single file'))(target, key, 2);
|
|
1057
1176
|
}, _dec25 = function (target, key) {
|
|
1058
1177
|
return Arg.file('welcome2')(target, key, 3);
|
|
1059
|
-
}, _dec26 = Reflect.metadata("design:type", Function), _dec27 = Reflect.metadata("design:paramtypes", [Array, Array, typeof IUploadFile === "undefined" ? Object : IUploadFile, typeof IUploadFile === "undefined" ? Object : IUploadFile]), _dec$
|
|
1178
|
+
}, _dec26 = Reflect.metadata("design:type", Function), _dec27 = Reflect.metadata("design:paramtypes", [Array, Array, typeof IUploadFile === "undefined" ? Object : IUploadFile, typeof IUploadFile === "undefined" ? Object : IUploadFile]), _dec$1(_class$1 = _dec2$1(_class$1 = (_class2 = class ControllerUpload extends BeanBase {
|
|
1060
1179
|
fields(fields, checkes, name) {
|
|
1061
1180
|
assert.equal(fields.find(item => item.name === 'name')?.value, 'zhennann');
|
|
1062
1181
|
assert.equal(checkes.length > 0, true);
|
|
@@ -1075,152 +1194,33 @@ let ControllerUpload = (_dec$8 = Controller({
|
|
|
1075
1194
|
assert.equal(file2.name, 'welcome2');
|
|
1076
1195
|
return this.ctx[SymbolUploadValue];
|
|
1077
1196
|
}
|
|
1078
|
-
}, _applyDecoratedDescriptor(_class2
|
|
1079
|
-
|
|
1080
|
-
var _dec$7, _dec2$7, _dec3$3, _dec4$3, _dec5$3, _dec6$3, _class$7, _class2$3, _descriptor$1, _descriptor2$1;
|
|
1081
|
-
let DtoProfile = (_dec$7 = Dto(), _dec2$7 = BeanInfo({
|
|
1082
|
-
module: "test-vona"
|
|
1083
|
-
}), _dec3$3 = Api.field(), _dec4$3 = Reflect.metadata("design:type", Number), _dec5$3 = Api.field(v.email()), _dec6$3 = Reflect.metadata("design:type", String), _dec$7(_class$7 = _dec2$7(_class$7 = (_class2$3 = class DtoProfile {
|
|
1084
|
-
constructor() {
|
|
1085
|
-
_initializerDefineProperty(this, "id", _descriptor$1, this);
|
|
1086
|
-
_initializerDefineProperty(this, "email", _descriptor2$1, this);
|
|
1087
|
-
}
|
|
1088
|
-
}, _descriptor$1 = _applyDecoratedDescriptor(_class2$3.prototype, "id", [_dec3$3, _dec4$3], {
|
|
1089
|
-
configurable: true,
|
|
1090
|
-
enumerable: true,
|
|
1091
|
-
writable: true,
|
|
1092
|
-
initializer: null
|
|
1093
|
-
}), _descriptor2$1 = _applyDecoratedDescriptor(_class2$3.prototype, "email", [_dec5$3, _dec6$3], {
|
|
1094
|
-
configurable: true,
|
|
1095
|
-
enumerable: true,
|
|
1096
|
-
writable: true,
|
|
1097
|
-
initializer: null
|
|
1098
|
-
}), _class2$3)) || _class$7) || _class$7);
|
|
1197
|
+
}, _applyDecoratedDescriptor(_class2.prototype, "fields", [_dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec0, _dec1], Object.getOwnPropertyDescriptor(_class2.prototype, "fields"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "file", [_dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17], Object.getOwnPropertyDescriptor(_class2.prototype, "file"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "files", [_dec18, _dec19, _dec20, _dec21, _dec22, _dec23, _dec24, _dec25, _dec26, _dec27], Object.getOwnPropertyDescriptor(_class2.prototype, "files"), _class2.prototype), _class2)) || _class$1) || _class$1);
|
|
1099
1198
|
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
module: "test-vona"
|
|
1103
|
-
}), _dec3$2 = Api.field(), _dec4$2 = Reflect.metadata("design:type", String), _dec5$2 = Api.field(), _dec6$2 = Reflect.metadata("design:type", String), _dec$6(_class$6 = _dec2$6(_class$6 = (_class2$2 = class EntityTest extends EntityBase {
|
|
1104
|
-
constructor(...args) {
|
|
1105
|
-
super(...args);
|
|
1106
|
-
_initializerDefineProperty(this, "title", _descriptor, this);
|
|
1107
|
-
_initializerDefineProperty(this, "description", _descriptor2, this);
|
|
1108
|
-
}
|
|
1109
|
-
}, _descriptor = _applyDecoratedDescriptor(_class2$2.prototype, "title", [_dec3$2, _dec4$2], {
|
|
1110
|
-
configurable: true,
|
|
1111
|
-
enumerable: true,
|
|
1112
|
-
writable: true,
|
|
1113
|
-
initializer: null
|
|
1114
|
-
}), _descriptor2 = _applyDecoratedDescriptor(_class2$2.prototype, "description", [_dec5$2, _dec6$2], {
|
|
1115
|
-
configurable: true,
|
|
1116
|
-
enumerable: true,
|
|
1117
|
-
writable: true,
|
|
1118
|
-
initializer: null
|
|
1119
|
-
}), _class2$2)) || _class$6) || _class$6);
|
|
1120
|
-
|
|
1121
|
-
var _dec$5, _dec2$5, _class$5;
|
|
1122
|
-
let ModelTest = (_dec$5 = Model({
|
|
1123
|
-
entity: EntityTest,
|
|
1124
|
-
clientName: 'default'
|
|
1125
|
-
}), _dec2$5 = BeanInfo({
|
|
1126
|
-
module: "test-vona"
|
|
1127
|
-
}), _dec$5(_class$5 = _dec2$5(_class$5 = class ModelTest extends BeanModelBase {}) || _class$5) || _class$5);
|
|
1128
|
-
|
|
1129
|
-
var _dec$4, _dec2$4, _dec3$1, _dec4$1, _class$4, _dec5$1, _dec6$1, _dec7$1, _dec8$1, _dec9, _dec0, _dec1, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _class2$1, _class3;
|
|
1130
|
-
let ServiceAopMethodBase = (_dec$4 = Aspect.aopMethod('test-vona:test', {
|
|
1131
|
-
wrapper: '+'
|
|
1132
|
-
}), _dec2$4 = Aspect.aopMethod('test-vona:test', {
|
|
1133
|
-
wrapper: '-'
|
|
1134
|
-
}), _dec3$1 = Reflect.metadata("design:type", Function), _dec4$1 = Reflect.metadata("design:paramtypes", []), _class$4 = class ServiceAopMethodBase extends BeanBase {
|
|
1135
|
-
testSyncBase() {
|
|
1136
|
-
return 'hello';
|
|
1137
|
-
}
|
|
1138
|
-
}, _applyDecoratedDescriptor(_class$4.prototype, "testSyncBase", [_dec$4, _dec2$4, _dec3$1, _dec4$1], Object.getOwnPropertyDescriptor(_class$4.prototype, "testSyncBase"), _class$4.prototype), _class$4);
|
|
1139
|
-
let ServiceAopMethod = (_dec5$1 = Service(), _dec6$1 = BeanInfo({
|
|
1140
|
-
module: "test-vona"
|
|
1141
|
-
}), _dec7$1 = Aspect.aopMethod('test-vona:test', {
|
|
1142
|
-
wrapper: '+'
|
|
1143
|
-
}), _dec8$1 = Aspect.aopMethod('test-vona:test', {
|
|
1144
|
-
wrapper: '-'
|
|
1145
|
-
}), _dec9 = Reflect.metadata("design:type", Function), _dec0 = Reflect.metadata("design:paramtypes", []), _dec1 = Aspect.aopMethod('test-vona:test', {
|
|
1146
|
-
wrapper: '+'
|
|
1147
|
-
}), _dec10 = Aspect.aopMethod('test-vona:test', {
|
|
1148
|
-
wrapper: '-'
|
|
1149
|
-
}), _dec11 = Reflect.metadata("design:type", Function), _dec12 = Reflect.metadata("design:paramtypes", []), _dec13 = Aspect.aopMethod('test-vona:test', {
|
|
1150
|
-
wrapper: '+'
|
|
1151
|
-
}), _dec14 = Aspect.aopMethod('test-vona:test', {
|
|
1152
|
-
wrapper: '-'
|
|
1153
|
-
}), _dec15 = Reflect.metadata("design:type", Function), _dec16 = Reflect.metadata("design:paramtypes", []), _dec5$1(_class2$1 = _dec6$1(_class2$1 = (_class3 = class ServiceAopMethod extends ServiceAopMethodBase {
|
|
1154
|
-
constructor(...args) {
|
|
1155
|
-
super(...args);
|
|
1156
|
-
this._name = '';
|
|
1157
|
-
}
|
|
1158
|
-
testSync() {
|
|
1159
|
-
return 'hello';
|
|
1160
|
-
}
|
|
1161
|
-
async testAsync() {
|
|
1162
|
-
return 'hello';
|
|
1163
|
-
}
|
|
1164
|
-
get name() {
|
|
1165
|
-
return this._name;
|
|
1166
|
-
}
|
|
1167
|
-
set name(value) {
|
|
1168
|
-
this._name = value;
|
|
1169
|
-
}
|
|
1170
|
-
}, _applyDecoratedDescriptor(_class3.prototype, "testSync", [_dec7$1, _dec8$1, _dec9, _dec0], Object.getOwnPropertyDescriptor(_class3.prototype, "testSync"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "testAsync", [_dec1, _dec10, _dec11, _dec12], Object.getOwnPropertyDescriptor(_class3.prototype, "testAsync"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, "name", [_dec13, _dec14, _dec15, _dec16], Object.getOwnPropertyDescriptor(_class3.prototype, "name"), _class3.prototype), _class3)) || _class2$1) || _class2$1);
|
|
1171
|
-
|
|
1172
|
-
var _dec$3, _dec2$3, _class$3;
|
|
1173
|
-
let ServiceTestApp = (_dec$3 = Service(), _dec2$3 = BeanInfo({
|
|
1174
|
-
module: "test-vona"
|
|
1175
|
-
}), _dec$3(_class$3 = _dec2$3(_class$3 = class ServiceTestApp extends BeanBase {
|
|
1176
|
-
actionSync({
|
|
1177
|
-
a,
|
|
1178
|
-
b
|
|
1179
|
-
}) {
|
|
1180
|
-
return a + b;
|
|
1181
|
-
}
|
|
1182
|
-
async actionAsync({
|
|
1183
|
-
a,
|
|
1184
|
-
b
|
|
1185
|
-
}) {
|
|
1186
|
-
return Promise.resolve(a + b);
|
|
1187
|
-
}
|
|
1188
|
-
}) || _class$3) || _class$3);
|
|
1189
|
-
|
|
1190
|
-
var _dec$2, _dec2$2, _class$2;
|
|
1191
|
-
class ClassBeanBase extends BeanBase {
|
|
1192
|
-
actionSync({
|
|
1193
|
-
a,
|
|
1194
|
-
b
|
|
1195
|
-
}) {
|
|
1196
|
-
return a + b;
|
|
1197
|
-
}
|
|
1199
|
+
function config(_app) {
|
|
1200
|
+
return {};
|
|
1198
1201
|
}
|
|
1199
|
-
let ServiceTestClass = (_dec$2 = Service(), _dec2$2 = BeanInfo({
|
|
1200
|
-
module: "test-vona"
|
|
1201
|
-
}), _dec$2(_class$2 = _dec2$2(_class$2 = class ServiceTestClass extends ClassBeanBase {
|
|
1202
|
-
async actionAsync({
|
|
1203
|
-
a,
|
|
1204
|
-
b
|
|
1205
|
-
}) {
|
|
1206
|
-
return Promise.resolve(a + b);
|
|
1207
|
-
}
|
|
1208
|
-
}) || _class$2) || _class$2);
|
|
1209
1202
|
|
|
1210
|
-
var
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1203
|
+
var locale_en_us = {
|
|
1204
|
+
User: 'User',
|
|
1205
|
+
UserId: 'User Id',
|
|
1206
|
+
TestHelloWorld: 'Hello World',
|
|
1207
|
+
TestApples: '%d apples',
|
|
1208
|
+
TestApples_0: 'no apples',
|
|
1209
|
+
TestApples_1: 'one apple',
|
|
1210
|
+
TestNameApples_: '%s has %d apples',
|
|
1211
|
+
TestNameApples_0_1: '%s has no apples',
|
|
1212
|
+
TestNameApples_1_1: '%s has one apple'
|
|
1213
|
+
};
|
|
1214
|
+
|
|
1215
|
+
var locale_zh_cn = {
|
|
1216
|
+
User: '用户',
|
|
1217
|
+
UserId: '用户Id',
|
|
1218
|
+
TestHelloWorld: '您好,世界',
|
|
1219
|
+
TestApples: '%d个苹果',
|
|
1220
|
+
TestApples_0: '没有苹果',
|
|
1221
|
+
TestNameApples_: '%s有%d个苹果',
|
|
1222
|
+
TestNameApples_0_1: '%s没有苹果'
|
|
1223
|
+
};
|
|
1224
1224
|
|
|
1225
1225
|
var _dec, _dec2, _class;
|
|
1226
1226
|
const locales = {
|