vona-module-test-vona 5.0.90 → 5.0.92
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.
|
@@ -126,15 +126,15 @@ export type EntityTestMeta = TypeEntityMeta<EntityTest, EntityTestTableName>;
|
|
|
126
126
|
export type EntityUserMeta = TypeEntityMeta<EntityUser, EntityUserTableName>;
|
|
127
127
|
declare module 'vona-module-a-orm' {
|
|
128
128
|
interface ITableRecord {
|
|
129
|
-
'testVonaCategory':
|
|
130
|
-
'testVonaOrder':
|
|
131
|
-
'testVonaPost':
|
|
132
|
-
'testVonaPostContent':
|
|
133
|
-
'testVonaProduct':
|
|
134
|
-
'testVonaRole':
|
|
135
|
-
'testVonaRoleUser':
|
|
136
|
-
'testVonaTest':
|
|
137
|
-
'testVonaUser':
|
|
129
|
+
'testVonaCategory': EntityCategoryMeta;
|
|
130
|
+
'testVonaOrder': EntityOrderMeta;
|
|
131
|
+
'testVonaPost': EntityPostMeta;
|
|
132
|
+
'testVonaPostContent': EntityPostContentMeta;
|
|
133
|
+
'testVonaProduct': EntityProductMeta;
|
|
134
|
+
'testVonaRole': EntityRoleMeta;
|
|
135
|
+
'testVonaRoleUser': EntityRoleUserMeta;
|
|
136
|
+
'testVonaTest': EntityTestMeta;
|
|
137
|
+
'testVonaUser': EntityUserMeta;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
declare module 'vona-module-test-vona' {
|
|
@@ -37,4 +37,4 @@ export declare const locales: {
|
|
|
37
37
|
Amount: string;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
export declare function $locale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K):
|
|
40
|
+
export declare function $locale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K): import("vona").ILocaleMagic<`test-vona::${K}`>;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BeanInfo, BeanAopBase, BeanAopMethodBase, BeanBase, $Class, cast, retry, BeanScopeBase } from 'vona';
|
|
1
|
+
import { BeanInfo, BeanAopBase, BeanAopMethodBase, $makeLocaleMagic, BeanBase, $Class, cast, retry, BeanScopeBase } from 'vona';
|
|
2
2
|
import { Aop, AopMethod, Aspect } from 'vona-module-a-aspect';
|
|
3
3
|
import { Api, v } from 'vona-module-a-openapiutils';
|
|
4
4
|
import { Entity, EntityBase, Model, $relation, BeanModelBase, $relationDynamic, $Dto } from 'vona-module-a-orm';
|
|
@@ -242,7 +242,7 @@ const locales = {
|
|
|
242
242
|
'zh-cn': locale_zh_cn
|
|
243
243
|
};
|
|
244
244
|
function $locale(key) {
|
|
245
|
-
return `test-vona::${key}
|
|
245
|
+
return $makeLocaleMagic(`test-vona::${key}`);
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
var _dec$1p, _dec2$1p, _dec3$D, _dec4$D, _dec5$A, _dec6$z, _dec7$t, _dec8$p, _class$1p, _class2$D, _descriptor$i, _descriptor2$f, _descriptor3$9;
|
package/package.json
CHANGED
package/src/.metadata/index.ts
CHANGED
|
@@ -150,15 +150,15 @@ export type EntityTestMeta=TypeEntityMeta<EntityTest,EntityTestTableName>;
|
|
|
150
150
|
export type EntityUserMeta=TypeEntityMeta<EntityUser,EntityUserTableName>;
|
|
151
151
|
declare module 'vona-module-a-orm' {
|
|
152
152
|
export interface ITableRecord {
|
|
153
|
-
'testVonaCategory':
|
|
154
|
-
'testVonaOrder':
|
|
155
|
-
'testVonaPost':
|
|
156
|
-
'testVonaPostContent':
|
|
157
|
-
'testVonaProduct':
|
|
158
|
-
'testVonaRole':
|
|
159
|
-
'testVonaRoleUser':
|
|
160
|
-
'testVonaTest':
|
|
161
|
-
'testVonaUser':
|
|
153
|
+
'testVonaCategory': EntityCategoryMeta;
|
|
154
|
+
'testVonaOrder': EntityOrderMeta;
|
|
155
|
+
'testVonaPost': EntityPostMeta;
|
|
156
|
+
'testVonaPostContent': EntityPostContentMeta;
|
|
157
|
+
'testVonaProduct': EntityProductMeta;
|
|
158
|
+
'testVonaRole': EntityRoleMeta;
|
|
159
|
+
'testVonaRoleUser': EntityRoleUserMeta;
|
|
160
|
+
'testVonaTest': EntityTestMeta;
|
|
161
|
+
'testVonaUser': EntityUserMeta;
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
declare module 'vona-module-test-vona' {
|
package/src/.metadata/locales.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TypeLocaleBase } from 'vona';
|
|
2
|
+
import { $makeLocaleMagic } from 'vona';
|
|
2
3
|
import locale_en_us from '../config/locale/en-us.ts';
|
|
3
4
|
import locale_zh_cn from '../config/locale/zh-cn.ts';
|
|
4
5
|
|
|
@@ -7,6 +8,6 @@ export const locales = {
|
|
|
7
8
|
'zh-cn': locale_zh_cn,
|
|
8
9
|
};
|
|
9
10
|
|
|
10
|
-
export function $locale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K)
|
|
11
|
-
return `test-vona::${key}
|
|
11
|
+
export function $locale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K) {
|
|
12
|
+
return $makeLocaleMagic(`test-vona::${key}`);
|
|
12
13
|
}
|
package/test/utils/celjs.test.ts
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import assert from 'node:assert';
|
|
2
2
|
import { describe, it } from 'node:test';
|
|
3
3
|
import { cel, evaluateExpressions } from '@cabloy/utils';
|
|
4
|
-
import { cast } from 'vona';
|
|
5
4
|
import { app } from 'vona-mock';
|
|
6
5
|
|
|
7
6
|
describe('celjs.test.ts', () => {
|
|
8
7
|
it('action:celjs', async () => {
|
|
9
8
|
await app.bean.executor.mockCtx(async () => {
|
|
10
9
|
//
|
|
11
|
-
|
|
12
|
-
assert.equal(evaluateExpressions(cel('self.app.config.server.workers'), { self: beanJwt, app: cast(beanJwt).app, ctx: cast(beanJwt).ctx }) > 0, true);
|
|
13
|
-
assert.equal(evaluateExpressions(cel('app.config.server.workers'), { self: beanJwt, app: cast(beanJwt).app, ctx: cast(beanJwt).ctx }) > 0, true);
|
|
14
|
-
assert.equal(evaluateExpressions(cel('ctx.app.config.server.workers'), { self: beanJwt, app: cast(beanJwt).app, ctx: cast(beanJwt).ctx }) > 0, true);
|
|
10
|
+
assert.equal(evaluateExpressions(cel('app.config.server.workers'), { app: { ...app } }) > 0, true);
|
|
15
11
|
// map
|
|
16
12
|
assert.deepEqual(evaluateExpressions(cel('{"a": 1, "b": true}')), { a: 1, b: true });
|
|
17
13
|
assert.deepEqual(evaluateExpressions(cel('{"id": 1, "name": "tom"}')), { id: 1, name: 'tom' });
|
|
@@ -21,6 +17,11 @@ describe('celjs.test.ts', () => {
|
|
|
21
17
|
// +
|
|
22
18
|
assert.equal(evaluateExpressions(cel('1+"a"')), '1a');
|
|
23
19
|
assert.equal(evaluateExpressions(cel('"a"+1')), 'a1');
|
|
20
|
+
// optional
|
|
21
|
+
assert.equal(evaluateExpressions(cel('a.?b.hasValue()'), { a: {} }), false);
|
|
22
|
+
assert.equal(evaluateExpressions(cel('a.?b.value()'), { a: { b: 1 } }), 1);
|
|
23
|
+
assert.equal(evaluateExpressions(cel('get(a, "b.c")'), { a: { b: 1 } }), undefined);
|
|
24
|
+
assert.equal(evaluateExpressions(cel('get(a, "b.c")'), { a: { b: { c: 1 } } }), 1);
|
|
24
25
|
});
|
|
25
26
|
});
|
|
26
27
|
});
|