cabloy 5.1.134 → 5.1.136
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/skills/cabloy-backend-scaffold/SKILL.md +9 -0
- package/.claude/skills/cabloy-zova-source-reading/SKILL.md +24 -1
- package/.claude/skills/cabloy-zova-source-reading/references/analysis-modes.md +12 -0
- package/.claude/skills/cabloy-zova-source-reading/references/core-reading-paths.md +28 -0
- package/.github/workflows/playwright-e2e.yml +2 -2
- package/.github/workflows/vona-test-pg.yml +1 -1
- package/.github/workflows/vona-test-sqlite3.yml +1 -1
- package/CHANGELOG.md +38 -0
- package/CLAUDE.md +1 -0
- package/cabloy-docs/.vitepress/config.mjs +7 -0
- package/cabloy-docs/backend/markdown-guide.md +189 -0
- package/cabloy-docs/frontend/component-guide.md +6 -0
- package/cabloy-docs/frontend/css-in-js-guide.md +6 -0
- package/cabloy-docs/frontend/markdown-guide.md +258 -0
- package/cabloy-docs/frontend/page-guide.md +48 -0
- package/cabloy-docs/frontend/page-params-guide.md +4 -2
- package/cabloy-docs/frontend/page-route-guide.md +2 -2
- package/cabloy-docs/frontend/zova-router-under-the-hood.md +2 -0
- package/cabloy-docs/frontend/zova-source-reading-map.md +53 -9
- package/cabloy-docs/fullstack/a-pay-payment-suite.md +333 -0
- package/cabloy-docs/fullstack/payment-sandbox-configuration.md +285 -0
- package/e2e/specs/a-commerce/commerce.spec.ts +503 -47
- package/e2e/specs/cabloy-basic/basic.spec.ts +30 -0
- package/package.json +1 -1
- package/vona/env/.env +2 -0
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/cli/templates/init/error/boilerplate/config/errors.ts +6 -1
- package/vona/packages-cli/cli-set-api/cli/templates/tools/crudBasic/boilerplate/src/entity/{{resourceName}}.tsx_ +2 -0
- package/vona/packages-cli/cli-set-api/cli/templates/tools/crudStart/boilerplate/src/entity/{{resourceName}}.tsx_ +2 -0
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/packages-utils/localeutil/package.json +1 -1
- package/vona/packages-utils/localeutil/src/util.ts +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-mock/package.json +1 -1
- package/vona/patches/{zova-core@5.1.82.patch → zova-core@5.1.84.patch} +2 -2
- package/vona/pnpm-lock.yaml +826 -270
- package/vona/pnpm-workspace.yaml +1 -1
- package/vona/src/suite/a-commerce/modules/commerce-catalog/package.json +1 -1
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/.metadata/index.ts +99 -1
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/bean/meta.index.ts +1 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/bean/meta.version.ts +19 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/config/locale/en-us.ts +3 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/config/locale/zh-cn.ts +3 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/controller/product.ts +3 -3
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/dto/productContentUpdate.tsx +14 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/dto/productContentView.tsx +19 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/dto/productCreate.tsx +48 -3
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/dto/productPublicDetail.tsx +15 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/dto/productUpdate.tsx +48 -3
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/dto/productView.tsx +52 -3
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/entity/productContent.tsx +36 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/model/product.ts +6 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/model/productContent.ts +22 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/service/product.ts +82 -6
- package/vona/src/suite/a-commerce/modules/commerce-catalog/test/productContent.test.ts +271 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/test/productPresentation.test.ts +81 -2
- package/vona/src/suite/a-commerce/modules/commerce-payment/package.json +4 -1
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/bean/payScene.commerceOrder.ts +32 -15
- package/vona/src/suite/a-commerce/modules/commerce-payment/test/paymentAttempt.test.ts +8 -2
- package/vona/src/suite/a-commerce/modules/commerce-siteweb/src/.metadata/index.ts +8 -2
- package/vona/src/suite/a-commerce/modules/commerce-siteweb/src/.metadata/locales.ts +18 -0
- package/vona/src/suite/a-commerce/modules/commerce-siteweb/src/bean/ssrMenu.home.ts +3 -1
- package/vona/src/suite/a-commerce/modules/commerce-siteweb/src/config/locale/en-us.ts +3 -0
- package/vona/src/suite/a-commerce/modules/commerce-siteweb/src/config/locale/zh-cn.ts +3 -0
- package/vona/src/suite/a-commerce/modules/commerce-siteweb/src/index.ts +1 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/controller/checkout.ts +13 -2
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/lib/providerReference.ts +18 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/service/order.ts +43 -8
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/paymentOutcome.test.ts +74 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/providerReference.test.ts +33 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/refundLifecycle.test.ts +73 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/reservationExpiry.test.ts +2 -0
- package/vona/src/suite/a-home/modules/home-user/src/.metadata/index.ts +30 -0
- package/vona/src/suite/a-home/modules/home-user/src/bean/meta.version.ts +7 -2
- package/vona/src/suite/a-home/modules/home-user/src/config/locale/en-us.ts +4 -1
- package/vona/src/suite/a-home/modules/home-user/src/config/locale/zh-cn.ts +4 -1
- package/vona/src/suite/a-home/modules/home-user/src/config/roles.ts +4 -4
- package/vona/src/suite/a-home/modules/home-user/src/entity/role.ts +2 -2
- package/vona/src/suite/a-home/modules/home-user/src/entity/user.ts +8 -1
- package/vona/src/suite/a-home/modules/home-user/src/service/userAdapter.ts +6 -2
- package/vona/src/suite/a-home/modules/home-user/test/passportTest.test.ts +1 -0
- package/vona/src/suite/a-home/modules/home-user/test/role.test.ts +4 -4
- package/vona/src/suite-vendor/a-cabloy/modules/a-markdown/package.json +64 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-markdown/src/.metadata/index.ts +54 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-markdown/src/.metadata/this.ts +2 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-markdown/src/bean/bean.markdown.ts +137 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-markdown/src/index.ts +1 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-markdown/tsconfig.build.json +11 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-markdown/tsconfig.json +7 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/bean/bean.ssr.ts +17 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/lib/beanSsrSiteBase.ts +11 -3
- package/vona/src/suite-vendor/a-cabloy/package.json +2 -1
- package/vona/src/suite-vendor/a-cabloy/tsconfig.json +3 -0
- package/vona/src/suite-vendor/a-pay/modules/a-pay/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/bean/meta.version.ts +1 -0
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/entity/providerOperation.tsx +8 -1
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/lib/index.ts +1 -0
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/lib/providerOperationFailure.ts +8 -0
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/service/providerOperation.ts +187 -29
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/types/payment.ts +4 -0
- package/vona/src/suite-vendor/a-pay/modules/pay-mock/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-paypal/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-paypal/src/bean/payProvider.paypal.ts +0 -6
- package/vona/src/suite-vendor/a-pay/modules/pay-paypal/src/index.ts +1 -0
- package/vona/src/suite-vendor/a-pay/modules/pay-stripe/package.json +2 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-stripe/src/bean/payProvider.stripe.ts +458 -22
- package/vona/src/suite-vendor/a-pay/modules/pay-stripe/src/index.ts +1 -0
- package/vona/src/suite-vendor/a-pay/modules/pay-stripe/src/lib/stripeGateway.ts +85 -0
- package/vona/src/suite-vendor/a-pay/modules/pay-stripe/src/types/index.ts +2 -0
- package/vona/src/suite-vendor/a-pay/package.json +5 -5
- 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/bean/bean.permission.ts +1 -0
- 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/bean/bean.passport.ts +14 -0
- package/vona/src/suite-vendor/a-vona/modules/a-user/src/bean/guard.passport.ts +4 -0
- package/vona/src/suite-vendor/a-vona/modules/a-user/src/types/role.ts +3 -2
- package/vona/src/suite-vendor/a-vona/modules/a-user/src/types/user.ts +4 -0
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/packages-utils/logger/package.json +2 -2
- 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 +3 -3
- package/zova/packages-zova/zova-core/src/core/sys/resource.ts +1 -1
- package/zova/packages-zova/zova-core/src/core/sys/util.ts +8 -0
- package/zova/pnpm-lock.yaml +570 -11
- package/zova/src/front/config/config/config.cabloyCommerce.ts +0 -6
- package/zova/src/suite/a-commerce/modules/commerce-catalog/package.json +3 -1
- package/zova/src/suite/a-commerce/modules/commerce-catalog/src/api/openapi/schemas.ts +236 -36
- package/zova/src/suite/a-commerce/modules/commerce-catalog/src/api/openapi/types.ts +4962 -2402
- package/zova/src/suite/a-commerce/modules/commerce-catalog/src/config/locale/en-us.ts +1 -0
- package/zova/src/suite/a-commerce/modules/commerce-catalog/src/config/locale/zh-cn.ts +1 -0
- package/zova/src/suite/a-commerce/modules/commerce-catalog/src/page/product/controller.tsx +8 -3
- package/zova/src/suite/a-commerce/modules/commerce-member/src/.metadata/index.ts +6 -7
- package/zova/src/suite/a-commerce/modules/commerce-member/src/page/address/controller.tsx +1 -3
- package/zova/src/suite/a-commerce/modules/commerce-member/src/routes.ts +2 -3
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/.metadata/index.ts +13 -20
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/cart/controller.tsx +3 -9
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/checkout/controller.tsx +9 -11
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/order/controller.tsx +0 -1
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/orders/controller.tsx +6 -4
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/payment/controller.tsx +78 -17
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/routes.ts +10 -13
- package/zova/src/suite/a-home/modules/home-api/mock/passport.fake.ts +3 -3
- package/zova/src/suite/a-home/modules/home-api/src/.metadata/index.ts +31 -1
- package/zova/src/suite/a-home/modules/home-api/src/api/homeBaseSiteCatalog.ts +24 -0
- package/zova/src/suite/a-home/modules/home-api/src/api/openapi/schemas.ts +329 -17
- package/zova/src/suite/a-home/modules/home-api/src/api/openapi/types.ts +5866 -1829
- package/zova/src/suite/a-home/modules/home-api/src/apiSchema/homeBaseSiteCatalog.ts +13 -0
- package/zova/src/suite/a-home/modules/home-base/src/component/page/controller.tsx +1 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.header.tsx +0 -1
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/detail.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/package.json +61 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/.metadata/component/formFieldMarkdown.ts +36 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/.metadata/component/markdownHtml.ts +36 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/.metadata/index.ts +147 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/.metadata/this.ts +2 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/component/formFieldMarkdown/controller.tsx +111 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/component/formFieldMarkdown/render.tsx +40 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/component/formFieldMarkdown/style.ts +13 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/component/markdownHtml/controller.tsx +17 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/component/markdownHtml/render.tsx +9 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/component/markdownHtml/style.ts +13 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/lib/richTextContentStyle.ts +142 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/tsconfig.build.json +13 -0
- package/zova/src/suite/cabloy-basic/modules/basic-markdown/tsconfig.json +5 -0
- package/zova/src/suite/cabloy-basic/modules/basic-page/src/component/blockPage/controller.tsx +25 -3
- package/zova/src/suite/cabloy-basic/modules/basic-page/src/types/page.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-pageentry/src/types/pageEntry.ts +1 -0
- 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 +7 -0
- package/zova/src/suite-vendor/a-cabloy/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-logger/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-router/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-router/src/bean/sys.router.ts +3 -2
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/test/lib/ssrProfile.test.ts +88 -0
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/package.json +5 -5
- package/.claude/scheduled_tasks.lock +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": "src",
|
|
5
|
+
"outDir": "dist",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"emitDeclarationOnly": true,
|
|
9
|
+
"allowImportingTsExtensions": true,
|
|
10
|
+
"noEmit": false
|
|
11
|
+
},
|
|
12
|
+
"include": ["src", "src/.metadata/**/*"]
|
|
13
|
+
}
|
package/zova/src/suite/cabloy-basic/modules/basic-page/src/component/blockPage/controller.tsx
CHANGED
|
@@ -28,6 +28,7 @@ export interface ControllerBlockPageProps extends IResourceBlockOptionsBase {
|
|
|
28
28
|
blocks?: IResourceRenderBlockOptionsBlock[];
|
|
29
29
|
resource?: string;
|
|
30
30
|
pageSize?: number;
|
|
31
|
+
queryFixed?: ITableQuery;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
@Controller()
|
|
@@ -46,7 +47,8 @@ export class ControllerBlockPage<TData extends {} = {}> extends BeanControllerBa
|
|
|
46
47
|
jsxCelScope: IPageScope;
|
|
47
48
|
jsxRenderContext: IJsxRenderContextPage<TData>;
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
queryFixedData: ITableQuery;
|
|
51
|
+
queryFilterData: ITableQuery;
|
|
50
52
|
queryPaged: ITablePaged;
|
|
51
53
|
query: ITableQuery;
|
|
52
54
|
|
|
@@ -61,10 +63,24 @@ export class ControllerBlockPage<TData extends {} = {}> extends BeanControllerBa
|
|
|
61
63
|
// jsx
|
|
62
64
|
this._prepareJsx();
|
|
63
65
|
// query
|
|
66
|
+
this.queryFixedData = this.$props.queryFixed ?? {};
|
|
64
67
|
this.queryFilterData = {};
|
|
68
|
+
this.$watch(
|
|
69
|
+
() => this.$props.queryFixed,
|
|
70
|
+
queryFixed => {
|
|
71
|
+
this.setQueryFixed(queryFixed);
|
|
72
|
+
},
|
|
73
|
+
);
|
|
65
74
|
this.queryPaged = { pageNo: 1, pageSize: this.$props.pageSize };
|
|
66
75
|
this.query = this.$computed(() => {
|
|
67
|
-
|
|
76
|
+
const { where: whereFixed, ...queryFixed } = this.queryFixedData;
|
|
77
|
+
const { where: whereFilter, ...queryFilter } = this.queryFilterData;
|
|
78
|
+
return {
|
|
79
|
+
...queryFixed,
|
|
80
|
+
...queryFilter,
|
|
81
|
+
where: { ...whereFilter, ...whereFixed },
|
|
82
|
+
...this.queryPaged,
|
|
83
|
+
};
|
|
68
84
|
});
|
|
69
85
|
// load schema/data
|
|
70
86
|
await $QueriesEnsureLoaded(
|
|
@@ -121,8 +137,14 @@ export class ControllerBlockPage<TData extends {} = {}> extends BeanControllerBa
|
|
|
121
137
|
}
|
|
122
138
|
}
|
|
123
139
|
|
|
124
|
-
|
|
140
|
+
setQueryFixed(queryFixed?: ITableQuery) {
|
|
141
|
+
this.queryFixedData = queryFixed ?? {};
|
|
142
|
+
this.queryPaged.pageNo = 1;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
onFilter(data: ITableQuery) {
|
|
125
146
|
this.queryFilterData = data;
|
|
147
|
+
this.queryPaged.pageNo = 1;
|
|
126
148
|
}
|
|
127
149
|
|
|
128
150
|
public setTableRef(tableRef: BeanControllerTableBase<TData> | undefined) {
|
|
@@ -3,6 +3,7 @@ import type { IPageScope } from 'zova-module-a-openapi';
|
|
|
3
3
|
import 'zova-module-a-form';
|
|
4
4
|
import 'zova-module-a-table';
|
|
5
5
|
import 'zova-module-a-openapi';
|
|
6
|
+
|
|
6
7
|
import { ControllerBlockFilter } from '../component/blockFilter/controller.jsx';
|
|
7
8
|
import { ControllerBlockPage } from '../component/blockPage/controller.jsx';
|
|
8
9
|
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"zova-module-basic-form": "^5.0.7",
|
|
20
20
|
"zova-module-basic-image": "^5.0.0",
|
|
21
21
|
"zova-module-basic-input": "^5.0.7",
|
|
22
|
+
"zova-module-basic-markdown": "^5.0.0",
|
|
22
23
|
"zova-module-basic-metrics": "workspace:",
|
|
23
24
|
"zova-module-basic-page": "^5.0.7",
|
|
24
25
|
"zova-module-basic-pageentry": "^5.0.7",
|
|
@@ -108,6 +108,13 @@ export class ModelResource<
|
|
|
108
108
|
return this.selectGeneral(undefined, query);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
query<TData>(action: string, queryFn: () => Promise<TData>) {
|
|
112
|
+
return this.$useStateData({
|
|
113
|
+
queryKey: this.keySelect(action),
|
|
114
|
+
queryFn,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
111
118
|
queryItem<TData>(options: IModelResourceQueryItemOptions<TData>) {
|
|
112
119
|
const { id, action, queryFn, meta } = options;
|
|
113
120
|
if (isNil(id)) throw new Error('row id cannot empty');
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-suite-a-cabloy",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.45",
|
|
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.44"
|
|
11
11
|
},
|
|
12
12
|
"title": "a-cabloy"
|
|
13
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-logger",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.27",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"postpack": "clean-package restore"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@cabloy/logger": "^1.1.
|
|
37
|
+
"@cabloy/logger": "^1.1.25"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"clean-package": "^2.2.0",
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
createWebHashHistory,
|
|
17
17
|
createWebHistory,
|
|
18
18
|
} from '@cabloy/vue-router';
|
|
19
|
-
import { BeanBase, cast, deepExtend } from 'zova';
|
|
19
|
+
import { BeanBase, cast, deepExtend, isHttpUrl } from 'zova';
|
|
20
20
|
import { Sys } from 'zova-module-a-bean';
|
|
21
21
|
|
|
22
22
|
import { getCurrentRoute, getRealRouteName, getRouteMatched, isRouterName } from '../lib/utils.js';
|
|
@@ -108,7 +108,8 @@ export class SysRouter extends BeanBase {
|
|
|
108
108
|
check404?: boolean,
|
|
109
109
|
checkAliasOf?: boolean,
|
|
110
110
|
): Promise<RouteLocationResolvedGeneric | undefined> {
|
|
111
|
-
|
|
111
|
+
// url: should not has APP_PUBLIC_PATH prefix when not http url
|
|
112
|
+
const pagePath = isHttpUrl(url) ? this.sys.util.getPagePathFromAbsoluteUrl(url) : url;
|
|
112
113
|
let route = await this.ensureRoute(pagePath);
|
|
113
114
|
if (check404 && route.name === '$:/:catchAll(.*)*') return;
|
|
114
115
|
// aliasOf
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { ZovaConfigSsrProfile } from 'zova';
|
|
2
|
+
|
|
3
|
+
import assert from 'node:assert/strict';
|
|
4
|
+
import test from 'node:test';
|
|
5
|
+
|
|
6
|
+
import type { ISsrRouteProfileOptions } from '../../src/types/ssr.ts';
|
|
7
|
+
|
|
8
|
+
import { resolveSsrProfile, resolveSsrProfileOptions } from '../../src/lib/ssrProfile.ts';
|
|
9
|
+
|
|
10
|
+
const profiles = {
|
|
11
|
+
public: {
|
|
12
|
+
useCookie: true,
|
|
13
|
+
responseCache: { expires: '10m' },
|
|
14
|
+
},
|
|
15
|
+
session: {
|
|
16
|
+
useCookie: true,
|
|
17
|
+
responseCache: { expires: 0 },
|
|
18
|
+
},
|
|
19
|
+
} satisfies Record<'public' | 'session', ZovaConfigSsrProfile>;
|
|
20
|
+
|
|
21
|
+
test('SSR profiles resolve route metadata before flavor defaults', () => {
|
|
22
|
+
assert.equal(resolveSsrProfile('session', 'public'), 'session');
|
|
23
|
+
assert.equal(resolveSsrProfile('public', 'session'), 'public');
|
|
24
|
+
assert.equal(resolveSsrProfile(undefined, 'session'), 'session');
|
|
25
|
+
assert.equal(resolveSsrProfile(undefined, undefined), 'public');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('SSR profiles reject invalid values', () => {
|
|
29
|
+
assert.throws(
|
|
30
|
+
() => resolveSsrProfile('invalid' as any, 'public'),
|
|
31
|
+
/invalid SSR profile: invalid/,
|
|
32
|
+
);
|
|
33
|
+
assert.throws(() => resolveSsrProfile(undefined, 'invalid'), /invalid SSR profile: invalid/);
|
|
34
|
+
assert.throws(
|
|
35
|
+
() => resolveSsrProfileOptions('session', { public: profiles.public } as any),
|
|
36
|
+
/invalid SSR profile: session/,
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('SSR profile options enforce the public cookie boundary', () => {
|
|
41
|
+
const publicOptions = resolveSsrProfileOptions('public', profiles);
|
|
42
|
+
const sessionOptions = resolveSsrProfileOptions('session', profiles);
|
|
43
|
+
|
|
44
|
+
assert.equal(publicOptions.useCookie, false);
|
|
45
|
+
assert.equal(sessionOptions.useCookie, true);
|
|
46
|
+
assert.deepEqual(publicOptions.responseCache, { expires: '10m' });
|
|
47
|
+
assert.deepEqual(sessionOptions.responseCache, { expires: 0 });
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test('SSR route options override only the response-cache policy', () => {
|
|
51
|
+
const override = resolveSsrProfileOptions('public', profiles, {
|
|
52
|
+
responseCache: { expires: '5m' },
|
|
53
|
+
});
|
|
54
|
+
const disabled = resolveSsrProfileOptions('public', profiles, { responseCache: false });
|
|
55
|
+
|
|
56
|
+
assert.equal(override.useCookie, false);
|
|
57
|
+
assert.deepEqual(override.responseCache, { expires: '5m' });
|
|
58
|
+
assert.equal(disabled.responseCache, false);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('SSR profile options are fresh immutable snapshots', () => {
|
|
62
|
+
const routeOptions: ISsrRouteProfileOptions = {
|
|
63
|
+
responseCache: { expires: '5m' },
|
|
64
|
+
};
|
|
65
|
+
const profileOptions: Record<'public' | 'session', ZovaConfigSsrProfile> = {
|
|
66
|
+
public: { useCookie: false, responseCache: { expires: '10m' } },
|
|
67
|
+
session: { useCookie: true, responseCache: { expires: 0 } },
|
|
68
|
+
};
|
|
69
|
+
const first = resolveSsrProfileOptions('public', profileOptions, routeOptions);
|
|
70
|
+
const second = resolveSsrProfileOptions('public', profileOptions, routeOptions);
|
|
71
|
+
|
|
72
|
+
assert.notEqual(first, second);
|
|
73
|
+
assert.notEqual(first.responseCache, second.responseCache);
|
|
74
|
+
assert.ok(Object.isFrozen(first));
|
|
75
|
+
assert.ok(Object.isFrozen(first.responseCache));
|
|
76
|
+
|
|
77
|
+
(routeOptions.responseCache as { expires: string }).expires = '1m';
|
|
78
|
+
(profileOptions.public.responseCache as { expires: string }).expires = '1h';
|
|
79
|
+
assert.deepEqual(first.responseCache, { expires: '5m' });
|
|
80
|
+
assert.deepEqual(second.responseCache, { expires: '5m' });
|
|
81
|
+
|
|
82
|
+
assert.throws(() => {
|
|
83
|
+
(first as any).useCookie = true;
|
|
84
|
+
}, TypeError);
|
|
85
|
+
assert.throws(() => {
|
|
86
|
+
(first.responseCache as { expires: string }).expires = '2m';
|
|
87
|
+
}, TypeError);
|
|
88
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.100",
|
|
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.85"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@cabloy/cli": "^3.1.29",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-suite-a-zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.147",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "zova",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
"zova-module-a-form": "^5.1.46",
|
|
20
20
|
"zova-module-a-icon": "^5.1.26",
|
|
21
21
|
"zova-module-a-interceptor": "^5.1.30",
|
|
22
|
-
"zova-module-a-logger": "^5.1.
|
|
22
|
+
"zova-module-a-logger": "^5.1.27",
|
|
23
23
|
"zova-module-a-meta": "^5.1.21",
|
|
24
24
|
"zova-module-a-model": "^5.1.34",
|
|
25
25
|
"zova-module-a-openapi": "^5.1.49",
|
|
26
|
-
"zova-module-a-router": "^5.1.
|
|
26
|
+
"zova-module-a-router": "^5.1.33",
|
|
27
27
|
"zova-module-a-routerstack": "^5.1.26",
|
|
28
28
|
"zova-module-a-routertabs": "^5.1.33",
|
|
29
|
-
"zova-module-a-ssr": "^5.1.
|
|
29
|
+
"zova-module-a-ssr": "^5.1.35",
|
|
30
30
|
"zova-module-a-ssrhmr": "^5.1.22",
|
|
31
31
|
"zova-module-a-ssrserver": "^5.1.24",
|
|
32
32
|
"zova-module-a-style": "^5.1.34",
|
|
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.100"
|
|
36
36
|
},
|
|
37
37
|
"title": "a-zova"
|
|
38
38
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"sessionId":"aa2f5459-9806-45a9-a112-0437b3fc7c19","pid":45095,"procStart":"Sun Aug 9 08:20:36 2026","acquiredAt":1786451839628}
|