cabloy 5.1.98 → 5.1.99
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/.cabloy-version +1 -1
- package/.claude/hooks/contract-loop-gate.ts +151 -44
- package/CHANGELOG.md +21 -0
- package/CLAUDE.md +2 -0
- package/cabloy-docs/.vitepress/config.mjs +4 -0
- package/cabloy-docs/backend/controller-aop-guide.md +0 -1
- package/cabloy-docs/frontend/a-openapi-under-the-hood.md +1 -1
- package/cabloy-docs/frontend/generated-contract-consumption-entry-branch.md +1 -1
- package/cabloy-docs/frontend/generated-contract-consumption-list-branch.md +1 -1
- package/cabloy-docs/frontend/generated-contract-consumption-verify-playbook.md +1 -1
- package/cabloy-docs/frontend/model-resource-owner-pattern.md +1 -1
- package/cabloy-docs/frontend/model-state-guide.md +3 -1
- package/cabloy-docs/frontend/resource-entry-page-deep-dive.md +2 -2
- package/cabloy-docs/frontend/resource-list-page-deep-dive.md +1 -1
- package/cabloy-docs/frontend/rest-resource-source-reading-map.md +2 -2
- package/cabloy-docs/frontend/rest-resource-under-the-hood.md +4 -4
- package/cabloy-docs/frontend/use-state-data-best-practices.md +384 -0
- package/package.json +1 -1
- package/scripts/upgrade.ts +2 -0
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/packages-vona/vona-core/package.json +1 -1
- package/vona/packages-vona/vona-core/src/lib/bean/beanBase.ts +9 -9
- package/vona/packages-vona/vona-mock/package.json +1 -1
- package/vona/pnpm-lock.yaml +4 -4
- package/vona/src/suite/a-training/modules/training-record/src/bean/fileScene.dossierFile.ts +22 -0
- package/vona/src/suite/a-training/modules/training-record/src/bean/meta.version.ts +1 -0
- package/vona/src/suite/a-training/modules/training-record/src/config/locale/en-us.ts +1 -0
- package/vona/src/suite/a-training/modules/training-record/src/config/locale/zh-cn.ts +1 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordDossierFileView.ts +47 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordSelectResItem.tsx +13 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordView.tsx +13 -0
- package/vona/src/suite/a-training/modules/training-record/src/entity/record.tsx +16 -5
- package/vona/src/suite/a-training/modules/training-record/src/index.ts +2 -0
- package/vona/src/suite/a-training/modules/training-record/src/lib/index.ts +1 -0
- package/vona/src/suite/a-training/modules/training-record/src/lib/resolveDossierFiles.ts +34 -0
- package/vona/src/suite/a-training/modules/training-record/test/record.test.ts +209 -123
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +1 -0
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +1 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordBase.tsx +18 -1
- package/vona/src/suite/a-training/modules/training-student/src/entity/student.tsx +0 -2
- package/vona/src/suite/a-training/modules/training-student/src/model/student.ts +1 -0
- package/vona/src/suite-vendor/a-file/modules/a-file/package.json +5 -3
- package/vona/src/suite-vendor/a-file/modules/a-file/src/bean/bean.fileUploadPolicy.ts +28 -0
- package/vona/src/suite-vendor/a-file/modules/a-file/src/controller/file.ts +8 -0
- package/vona/src/suite-vendor/a-file/modules/a-file/src/dto/fileUploadPolicyRequest.ts +15 -0
- package/vona/src/suite-vendor/a-file/modules/a-file/src/dto/fileUploadPolicyResponse.ts +30 -0
- package/vona/src/suite-vendor/a-file/package.json +2 -2
- package/vona/src/suite-vendor/a-image/modules/a-image/package.json +1 -1
- package/vona/src/suite-vendor/a-image/modules/a-image/src/bean/bean.imageUploadPolicy.ts +27 -0
- package/vona/src/suite-vendor/a-image/modules/a-image/src/controller/image.ts +8 -0
- package/vona/src/suite-vendor/a-image/modules/a-image/src/dto/imageUploadPolicyRequest.ts +15 -0
- package/vona/src/suite-vendor/a-image/modules/a-image/src/dto/imageUploadPolicyResponse.ts +27 -0
- package/vona/src/suite-vendor/a-image/modules/image-native/package.json +1 -1
- package/vona/src/suite-vendor/a-image/modules/image-native/src/controller/image.ts +1 -1
- package/vona/src/suite-vendor/a-image/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/.metadata/index.ts +24 -9
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/bean.permission.ts +87 -73
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/summerCache.permissionActionByRoles.ts +27 -0
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/summerCache.permissionUser.ts +20 -0
- package/vona/src/suite-vendor/a-vona/modules/a-startup/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-startup/src/service/startup.ts +4 -3
- package/vona/src/suite-vendor/a-vona/modules/a-upload/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-upload/src/bean/interceptor.upload.ts +5 -1
- package/vona/src/suite-vendor/a-vona/modules/a-user/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-user/src/.metadata/index.ts +0 -13
- package/vona/src/suite-vendor/a-vona/modules/a-user/src/lib/passport.ts +0 -7
- package/vona/src/suite-vendor/a-vona/modules/a-version/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-version/src/bean/meta.version.ts +2 -24
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/packages-utils/zova-jsx/package.json +2 -2
- package/zova/packages-zova/zova/package.json +3 -3
- package/zova/packages-zova/zova-core/package.json +1 -1
- package/zova/packages-zova/zova-core/src/bean/beanBase.ts +9 -13
- package/zova/pnpm-lock.yaml +29 -14
- package/zova/src/suite/a-demo/modules/demo-basic/src/page/toolOne/controller.tsx +2 -2
- package/zova/src/suite/a-demo/modules/demo-todo/src/page/todo/controller.tsx +2 -2
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/component/layoutAdmin/controller.tsx +2 -2
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/controller.tsx +2 -2
- package/zova/src/suite/a-home/modules/home-login/src/page/login/controller.tsx +2 -2
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockDetails/controller.tsx +5 -1
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockTable/controller.tsx +20 -15
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/service/detail.tsx +6 -1
- package/zova/src/suite/cabloy-basic/modules/basic-file/cli/openapi.config.ts +9 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/package.json +58 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/.metadata/component/formFieldFile.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/.metadata/index.ts +222 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/.metadata/locales.ts +7 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/.metadata/this.ts +2 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/api/file.ts +121 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/api/openapi/baseURL.ts +5 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/api/openapi/index.ts +3 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/api/openapi/schemas.ts +306 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/api/openapi/types.ts +5718 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/apiSchema/file.ts +40 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/bean/tableCell.file.tsx +187 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/component/formFieldFile/controller.tsx +534 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/config/locale/en-us.ts +15 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/config/locale/zh-cn.ts +15 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/index.ts +4 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/lib/file.ts +74 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/lib/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/model/file.ts +23 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/types/file.ts +12 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/src/types/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/tsconfig.build.json +13 -0
- package/zova/src/suite/cabloy-basic/modules/basic-file/tsconfig.json +5 -0
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/.metadata/index.ts +61 -0
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/api/image.ts +38 -1
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/api/imageNativeImage.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/api/openapi/schemas.ts +52 -0
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/api/openapi/types.ts +614 -1
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/apiSchema/image.ts +10 -0
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/apiSchema/imageNativeImage.ts +13 -0
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/component/formFieldImage/controller.tsx +126 -53
- package/zova/src/suite/cabloy-basic/modules/basic-image/src/model/image.ts +23 -0
- package/zova/src/suite/cabloy-basic/modules/basic-page/src/component/blockPage/controller.tsx +44 -4
- package/zova/src/suite/cabloy-basic/modules/basic-page/src/component/blockTable/controller.tsx +17 -12
- package/zova/src/suite/cabloy-basic/modules/basic-pageentry/src/component/blockPageEntry/controller.tsx +2 -2
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/component/formFieldResourcePicker/controller.tsx +2 -2
- package/zova/src/suite/cabloy-basic/modules/basic-table/src/component/table/controller.tsx +7 -2
- package/zova/src/suite/cabloy-basic/modules/basic-table/src/component/table/render.tsx +34 -33
- package/zova/src/suite/cabloy-basic/package.json +1 -0
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/package.json +1 -1
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/model/resource.ts +5 -3
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/page/entry/controller.tsx +2 -2
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/page/resource/controller.tsx +2 -2
- package/zova/src/suite-vendor/a-cabloy/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-model/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-model/src/lib/utils.ts +17 -17
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/model/sdk.ts +8 -3
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/package.json +4 -4
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/summerCache.permission.ts +0 -17
- package/vona/src/suite-vendor/a-vona/modules/a-user/src/bean/guard.userName.ts +0 -35
|
@@ -13,7 +13,7 @@ import { hashkey, isNil } from '@cabloy/utils';
|
|
|
13
13
|
import { SchemaObject } from 'openapi3-ts/oas31';
|
|
14
14
|
import { UseScope } from 'zova';
|
|
15
15
|
import { formSceneFromFormMeta } from 'zova-module-a-form';
|
|
16
|
-
import { $
|
|
16
|
+
import { $QueryEnsureLoaded, BeanModelBase, Model } from 'zova-module-a-model';
|
|
17
17
|
import { ScopeModuleAOpenapi, SymbolOpenapiSchemaName } from 'zova-module-a-openapi';
|
|
18
18
|
|
|
19
19
|
export interface IModelOptionsResource extends IDecoratorModelOptions {}
|
|
@@ -147,7 +147,9 @@ export class ModelResource<
|
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
mutationItem<TData = void, TVariables = void>(
|
|
150
|
+
mutationItem<TData = void, TVariables = void>(
|
|
151
|
+
options: IModelResourceMutationItemOptions<TData, TVariables>,
|
|
152
|
+
) {
|
|
151
153
|
const { id, action, mutationFn, onSuccess, invalidateSelect = true } = options;
|
|
152
154
|
if (isNil(id)) throw new Error('row id cannot empty');
|
|
153
155
|
return this.$useMutationData<TData, TVariables>({
|
|
@@ -264,7 +266,7 @@ export class ModelResource<
|
|
|
264
266
|
}
|
|
265
267
|
|
|
266
268
|
private async _bootstrap() {
|
|
267
|
-
const queryBootstrap = await $
|
|
269
|
+
const queryBootstrap = await $QueryEnsureLoaded(() => this.$sdk.getBootstrap(this.resource));
|
|
268
270
|
if (!queryBootstrap?.data) {
|
|
269
271
|
throw new Error(`not found sdk of resource: ${this.resource}`);
|
|
270
272
|
}
|
|
@@ -12,7 +12,7 @@ import { BeanControllerPageBase, deepExtend, Use, usePrepareArg } from 'zova';
|
|
|
12
12
|
import { ZovaJsx } from 'zova-jsx';
|
|
13
13
|
import { Controller } from 'zova-module-a-bean';
|
|
14
14
|
import { formMetaFromFormScene } from 'zova-module-a-form';
|
|
15
|
-
import { $
|
|
15
|
+
import { $QueryEnsureLoaded } from 'zova-module-a-model';
|
|
16
16
|
import { ZPage } from 'zova-module-home-base';
|
|
17
17
|
|
|
18
18
|
import type { ModelResource } from '../../model/resource.js';
|
|
@@ -63,7 +63,7 @@ export class ControllerPageEntry extends BeanControllerPageBase {
|
|
|
63
63
|
// jsx
|
|
64
64
|
this._prepareJsx();
|
|
65
65
|
// load schema
|
|
66
|
-
await $
|
|
66
|
+
await $QueryEnsureLoaded(() => this.$$modelResource.getFormApiSchemas(this.formMeta)?.sdk);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
private _prepareJsx() {
|
package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/page/resource/controller.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
import { BeanControllerPageBase, deepExtend, Use, usePrepareArg } from 'zova';
|
|
4
4
|
import { ZovaJsx } from 'zova-jsx';
|
|
5
5
|
import { Controller } from 'zova-module-a-bean';
|
|
6
|
-
import { $
|
|
6
|
+
import { $QueryEnsureLoaded } from 'zova-module-a-model';
|
|
7
7
|
import { ZPage } from 'zova-module-home-base';
|
|
8
8
|
|
|
9
9
|
import type { ModelResource } from '../../model/resource.js';
|
|
@@ -29,7 +29,7 @@ export class ControllerPageResource extends BeanControllerPageBase {
|
|
|
29
29
|
// jsx
|
|
30
30
|
this._prepareJsx();
|
|
31
31
|
// load schema/data
|
|
32
|
-
await $
|
|
32
|
+
await $QueryEnsureLoaded(() => this.$$modelResource.apiSchemasSelect.sdk);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
private _prepareJsx() {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-suite-a-cabloy",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.42",
|
|
4
4
|
"gitHead": "4dece229b6d3f4735930e833afcb4b95ec51bf86",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "",
|
|
7
7
|
"files": [],
|
|
8
8
|
"type": "module",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"zova-module-rest-resource": "^5.1.
|
|
10
|
+
"zova-module-rest-resource": "^5.1.41"
|
|
11
11
|
},
|
|
12
12
|
"title": "a-cabloy"
|
|
13
13
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { DataQuery } from '../types/query.js';
|
|
2
2
|
|
|
3
|
-
export type
|
|
3
|
+
export type TypeQueryEnsureLoadedFn<T> = () => DataQuery<T> | undefined;
|
|
4
4
|
|
|
5
|
-
export async function $
|
|
6
|
-
return
|
|
5
|
+
export async function $QueryEnsureLoaded<T = any>(fn: TypeQueryEnsureLoadedFn<T>) {
|
|
6
|
+
return _QueryEnsureLoadedInner<T>(fn);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export async function $
|
|
10
|
-
fn1?:
|
|
11
|
-
fn2?:
|
|
12
|
-
fn3?:
|
|
13
|
-
fn4?:
|
|
14
|
-
fn5?:
|
|
15
|
-
...fns:
|
|
9
|
+
export async function $QueriesEnsureLoaded<T1 = any, T2 = any, T3 = any, T4 = any, T5 = any>(
|
|
10
|
+
fn1?: TypeQueryEnsureLoadedFn<T1>,
|
|
11
|
+
fn2?: TypeQueryEnsureLoadedFn<T2>,
|
|
12
|
+
fn3?: TypeQueryEnsureLoadedFn<T3>,
|
|
13
|
+
fn4?: TypeQueryEnsureLoadedFn<T4>,
|
|
14
|
+
fn5?: TypeQueryEnsureLoadedFn<T5>,
|
|
15
|
+
...fns: TypeQueryEnsureLoadedFn<any>[]
|
|
16
16
|
): Promise<
|
|
17
17
|
[
|
|
18
18
|
DataQuery<T1> | undefined,
|
|
@@ -24,19 +24,19 @@ export async function $QueriesAutoLoad<T1 = any, T2 = any, T3 = any, T4 = any, T
|
|
|
24
24
|
]
|
|
25
25
|
> {
|
|
26
26
|
let promises: any[] = [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
_QueryEnsureLoadedInner<T1>(fn1),
|
|
28
|
+
_QueryEnsureLoadedInner<T2>(fn2),
|
|
29
|
+
_QueryEnsureLoadedInner<T3>(fn3),
|
|
30
|
+
_QueryEnsureLoadedInner<T4>(fn4),
|
|
31
|
+
_QueryEnsureLoadedInner<T5>(fn5),
|
|
32
32
|
];
|
|
33
33
|
if (fns.length > 0) {
|
|
34
|
-
promises = promises.concat(fns.map(fn =>
|
|
34
|
+
promises = promises.concat(fns.map(fn => _QueryEnsureLoadedInner(fn)));
|
|
35
35
|
}
|
|
36
36
|
return (await Promise.all(promises)) as any;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
async function
|
|
39
|
+
async function _QueryEnsureLoadedInner<T = any>(fn?: TypeQueryEnsureLoadedFn<T>) {
|
|
40
40
|
if (!fn) return;
|
|
41
41
|
const query = fn();
|
|
42
42
|
if (query && query.data === undefined) {
|
|
@@ -3,7 +3,12 @@ import { SchemaObject } from 'openapi3-ts/oas31';
|
|
|
3
3
|
import z from 'zod';
|
|
4
4
|
import { cast, ILocaleRecord, TypeEventOff, Use, usePrepareArg } from 'zova';
|
|
5
5
|
import { IApiSchemaOptions } from 'zova-module-a-api';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
$QueryEnsureLoaded,
|
|
8
|
+
BeanModelBase,
|
|
9
|
+
IDecoratorModelOptions,
|
|
10
|
+
Model,
|
|
11
|
+
} from 'zova-module-a-model';
|
|
7
12
|
|
|
8
13
|
import { SysSdk } from '../bean/sys.sdk.js';
|
|
9
14
|
import {
|
|
@@ -60,7 +65,7 @@ export class ModelSdk extends BeanModelBase {
|
|
|
60
65
|
const bootstrap = await this.$$sysSdk.loadBootstrap(this.$fetch, resource);
|
|
61
66
|
if (!bootstrap) throw new Error('load bootstrap error');
|
|
62
67
|
if (process.env.SERVER) {
|
|
63
|
-
await $
|
|
68
|
+
await $QueryEnsureLoaded(() => this.getPermissions(resource));
|
|
64
69
|
} else {
|
|
65
70
|
await this.$refetchQueries({ queryKey: ['permissions', resource] });
|
|
66
71
|
}
|
|
@@ -98,7 +103,7 @@ export class ModelSdk extends BeanModelBase {
|
|
|
98
103
|
if (!sdk) throw new Error('load sdk error');
|
|
99
104
|
for (const schemaName of sdk.schemas) {
|
|
100
105
|
if (process.env.SERVER) {
|
|
101
|
-
await $
|
|
106
|
+
await $QueryEnsureLoaded(() => this.getSchema(schemaName));
|
|
102
107
|
} else {
|
|
103
108
|
await this.$refetchQueries({ queryKey: ['schema', schemaName] });
|
|
104
109
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.92",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "zova",
|
|
6
6
|
"keywords": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@cabloy/word-utils": "^2.1.14",
|
|
44
44
|
"defu": "^6.1.7",
|
|
45
45
|
"luxon": "^3.7.2",
|
|
46
|
-
"zova-jsx": "^1.1.
|
|
46
|
+
"zova-jsx": "^1.1.77"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@cabloy/cli": "^3.1.28",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-suite-a-zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.131",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "zova",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"zova-module-a-interceptor": "^5.1.29",
|
|
22
22
|
"zova-module-a-logger": "^5.1.26",
|
|
23
23
|
"zova-module-a-meta": "^5.1.21",
|
|
24
|
-
"zova-module-a-model": "^5.1.
|
|
25
|
-
"zova-module-a-openapi": "^5.1.
|
|
24
|
+
"zova-module-a-model": "^5.1.31",
|
|
25
|
+
"zova-module-a-openapi": "^5.1.43",
|
|
26
26
|
"zova-module-a-router": "^5.1.29",
|
|
27
27
|
"zova-module-a-routerstack": "^5.1.26",
|
|
28
28
|
"zova-module-a-routertabs": "^5.1.32",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"zova-module-a-style": "^5.1.32",
|
|
33
33
|
"zova-module-a-table": "^5.1.37",
|
|
34
34
|
"zova-module-a-zod": "^5.1.36",
|
|
35
|
-
"zova-module-a-zova": "^5.1.
|
|
35
|
+
"zova-module-a-zova": "^5.1.92"
|
|
36
36
|
},
|
|
37
37
|
"title": "a-zova"
|
|
38
38
|
}
|
package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/summerCache.permission.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ISummerCacheGet, TSummerCacheActionOptions } from 'vona-module-a-summer';
|
|
2
|
-
|
|
3
|
-
import { ServiceSummerCacheBase, SummerCache } from 'vona-module-a-summer';
|
|
4
|
-
|
|
5
|
-
export type TSummerCachePermissionKey = any;
|
|
6
|
-
export type TSummerCachePermissionData = any;
|
|
7
|
-
|
|
8
|
-
@SummerCache({ preset: 'mem' })
|
|
9
|
-
export class SummerCachePermission
|
|
10
|
-
extends ServiceSummerCacheBase<TSummerCachePermissionKey, TSummerCachePermissionData>
|
|
11
|
-
implements ISummerCacheGet<TSummerCachePermissionKey, TSummerCachePermissionData>
|
|
12
|
-
{
|
|
13
|
-
async getNative(
|
|
14
|
-
_key?: TSummerCachePermissionKey,
|
|
15
|
-
_options?: TSummerCacheActionOptions<TSummerCachePermissionKey, TSummerCachePermissionData>,
|
|
16
|
-
): Promise<TSummerCachePermissionData | undefined> {}
|
|
17
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Next } from 'vona';
|
|
2
|
-
import type { IDecoratorGuardOptions, IGuardExecute } from 'vona-module-a-aspect';
|
|
3
|
-
|
|
4
|
-
import { BeanBase } from 'vona';
|
|
5
|
-
import { Guard } from 'vona-module-a-aspect';
|
|
6
|
-
|
|
7
|
-
import type { IUserNameRecord } from '../types/user.ts';
|
|
8
|
-
|
|
9
|
-
export interface IGuardOptionsUserName extends IDecoratorGuardOptions {
|
|
10
|
-
name?: keyof IUserNameRecord | (keyof IUserNameRecord)[];
|
|
11
|
-
passWhenMatched: boolean;
|
|
12
|
-
rejectWhenDismatched: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@Guard<IGuardOptionsUserName>({
|
|
16
|
-
passWhenMatched: true,
|
|
17
|
-
rejectWhenDismatched: true,
|
|
18
|
-
})
|
|
19
|
-
export class GuardUserName extends BeanBase implements IGuardExecute {
|
|
20
|
-
async execute(options: IGuardOptionsUserName, next: Next): Promise<boolean> {
|
|
21
|
-
const result = await this._check(options);
|
|
22
|
-
if (!result) {
|
|
23
|
-
if (options.rejectWhenDismatched) return this.app.throw(403);
|
|
24
|
-
} else {
|
|
25
|
-
if (options.passWhenMatched) return true;
|
|
26
|
-
}
|
|
27
|
-
// next
|
|
28
|
-
return next();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
private async _check(options: IGuardOptionsUserName) {
|
|
32
|
-
if (!options.name) return false;
|
|
33
|
-
return this.bean.passport.checkUserName(options.name);
|
|
34
|
-
}
|
|
35
|
-
}
|