cabloy 5.1.229 → 5.1.231
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/.github/workflows/playwright-e2e.yml +4 -2
- package/.github/workflows/vona-test-sqlite3.yml +2 -1
- package/CHANGELOG.md +23 -0
- package/package.json +1 -1
- package/repo-agent-governance/managed-assets.json +9 -9
- package/repo-agent-governance/skills/cabloy-frontend-scaffold/SKILL.md +2 -0
- package/repo-agent-governance/skills/cabloy-spec-execution/references/execution-protocol.md +4 -1
- package/repo-agent-governance/skills/cabloy-spec-execution/references/status-and-evidence.md +10 -0
- package/repo-docs/ai/verification.md +22 -0
- package/repo-docs/backend/model-guide.md +1 -0
- package/repo-docs/backend/websocket-usage-guide.md +3 -0
- package/repo-docs/frontend/controller-boundary-guide.md +1 -1
- package/repo-docs/frontend/ioc-and-beans.md +2 -1
- package/repo-docs/frontend/modules-and-suites.md +1 -0
- package/repo-docs/reference/repo-scripts.md +2 -0
- package/vona/env/.env +1 -0
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/packages-utils/zod-query/package.json +1 -1
- package/vona/packages-utils/zod-query/src/lib/query.ts +4 -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/type.ts +3 -3
- package/vona/packages-vona/vona-core/src/lib/core/testClaim.test.ts +294 -1
- package/vona/packages-vona/vona-core/src/lib/core/testClaim.ts +47 -9
- package/vona/packages-vona/vona-core/src/lib/core/testClaimFilesystem.test.ts +163 -39
- package/vona/packages-vona/vona-core/src/lib/core/testClaimFilesystemWindows.cs +16 -6
- package/vona/packages-vona/vona-core/src/lib/core/testClaimFilesystemWindows.ts +9 -4
- package/vona/packages-vona/vona-core/src/lib/utils/index.ts +1 -0
- package/vona/packages-vona/vona-core/src/lib/utils/zod-enhance.ts +8 -1
- package/vona/packages-vona/vona-mock/package.json +1 -1
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/cartItem.tsx +1 -1
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/cartOwnership.test.ts +144 -18
- package/vona/src/suite-vendor/a-auth/modules/auth-oauth/package.json +1 -1
- package/vona/src/suite-vendor/a-auth/modules/auth-oauth/src/bean/authProvider.oauth.ts +1 -0
- package/vona/src/suite-vendor/a-auth/modules/auth-oauth/src/types/index.ts +1 -0
- package/vona/src/suite-vendor/a-auth/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapi/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsColumns.ts +7 -5
- package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +1 -1
- 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 +2 -2
- package/zova/packages-zova/zova-core/src/bean/resource/component/type.ts +3 -3
- package/zova/packages-zova/zova-core/src/bean/type.ts +6 -6
- package/zova/src/suite/cabloy-basic/modules/basic-button/src/bean/behavior.perform.tsx +5 -5
- package/zova/src/suite/cabloy-basic/modules/basic-date/src/.metadata/component/date.ts +3 -1
- package/zova/src/suite/cabloy-basic/modules/basic-date/src/.metadata/component/dateRange.ts +12 -4
- package/zova/src/suite/cabloy-basic/modules/basic-pageentry/src/component/blockPageEntry/controller.tsx +8 -2
- package/zova/src/suite/cabloy-basic/modules/basic-select/src/.metadata/component/select.ts +9 -3
- package/zova/src/suite-vendor/a-zova/modules/a-behavior/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-behavior/src/types/behavior.ts +3 -3
- 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/types/detail/detailsActionBulk.ts +5 -3
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/detailsActionRow.ts +5 -3
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/resource/formActionRow.ts +5 -3
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/resource/tableActionBulk.ts +5 -3
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/resource/tableActionRow.ts +5 -3
- package/zova/src/suite-vendor/a-zova/modules/a-zod/package.json +2 -2
- 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
|
@@ -62,12 +62,17 @@ function decode(source: string): { exists?: boolean; content?: string } {
|
|
|
62
62
|
throw new Error('Windows test claim filesystem helper returned an invalid response');
|
|
63
63
|
}
|
|
64
64
|
if (!value || value.ok !== true) {
|
|
65
|
+
const code = ['EEXIST', 'ENOENT', 'EBUSY', 'EACCES', 'EUNSAFE'].includes(value?.code)
|
|
66
|
+
? value.code
|
|
67
|
+
: 'EUNSAFE';
|
|
68
|
+
const nativeCode =
|
|
69
|
+
Number.isInteger(value?.nativeCode) && value.nativeCode >= 0 && value.nativeCode <= 65535
|
|
70
|
+
? value.nativeCode
|
|
71
|
+
: 0;
|
|
65
72
|
const error = new Error(
|
|
66
|
-
|
|
67
|
-
? 'Test claim file already exists'
|
|
68
|
-
: `Unsafe Windows test claim filesystem operation (${value?.code ?? 'unknown'})`,
|
|
73
|
+
`Unsafe Windows test claim filesystem operation (${code}, nativeCode=${nativeCode})`,
|
|
69
74
|
);
|
|
70
|
-
Object.assign(error, { code
|
|
75
|
+
Object.assign(error, { code, nativeCode });
|
|
71
76
|
throw error;
|
|
72
77
|
}
|
|
73
78
|
return value;
|
|
@@ -3,6 +3,7 @@ import type z from 'zod';
|
|
|
3
3
|
import { setLocaleAdapter, setLocaleErrors, translateError } from '@cabloy/zod-errors-custom';
|
|
4
4
|
import { ZodMetadata } from '@cabloy/zod-openapi';
|
|
5
5
|
import { setParseAdapter } from '@cabloy/zod-query';
|
|
6
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
6
7
|
|
|
7
8
|
import type { ILocaleRecord } from '../bean/resource/locale/type.ts';
|
|
8
9
|
import type { VonaApplication } from '../core/application.ts';
|
|
@@ -12,6 +13,12 @@ import { useApp } from '../framework/useApp.ts';
|
|
|
12
13
|
export type ZodLocaleError = () => { localeError: z.core.$ZodErrorMap };
|
|
13
14
|
export type ZodLocaleErrors = Record<keyof ILocaleRecord, ZodLocaleError>;
|
|
14
15
|
|
|
16
|
+
const queryCoercion = new AsyncLocalStorage<boolean>();
|
|
17
|
+
|
|
18
|
+
export function runWithZodQueryCoercion<T>(enabled: boolean, fn: () => T): T {
|
|
19
|
+
return queryCoercion.run(enabled, fn);
|
|
20
|
+
}
|
|
21
|
+
|
|
15
22
|
export function zodEnhance() {
|
|
16
23
|
setLocaleAdapter((text: string, iss?: object) => {
|
|
17
24
|
const app = useApp();
|
|
@@ -23,7 +30,7 @@ export function zodEnhance() {
|
|
|
23
30
|
iss,
|
|
24
31
|
);
|
|
25
32
|
});
|
|
26
|
-
setParseAdapter(ZodMetadata);
|
|
33
|
+
setParseAdapter(ZodMetadata, () => queryCoercion.getStore() !== false);
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
export function zodSetLocaleErrors(
|
|
@@ -6,7 +6,10 @@ import { catchError } from '@cabloy/utils';
|
|
|
6
6
|
import assert from 'node:assert';
|
|
7
7
|
import { randomUUID } from 'node:crypto';
|
|
8
8
|
import { after, before, describe, it } from 'node:test';
|
|
9
|
+
import { appResource } from 'vona';
|
|
9
10
|
import { acquireTestLock, app } from 'vona-mock';
|
|
11
|
+
import { $schema } from 'vona-module-a-openapiutils';
|
|
12
|
+
import { DtoCartItem, DtoCartView } from 'vona-module-commerce-trade';
|
|
10
13
|
|
|
11
14
|
const actionPath = '/commerce/trade/cart';
|
|
12
15
|
|
|
@@ -39,22 +42,32 @@ async function performAs<
|
|
|
39
42
|
|
|
40
43
|
async function registerAndSignin(name: string) {
|
|
41
44
|
const user = await app.bean.user.register({ name }, true);
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
try {
|
|
46
|
+
const token = await app.bean.passport.signinMock(name as any);
|
|
47
|
+
return { token: token.accessToken, user };
|
|
48
|
+
} catch (error) {
|
|
49
|
+
await dropUser(user.id as number);
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
44
52
|
}
|
|
45
53
|
|
|
46
54
|
async function createSellableSku(suffix: string): Promise<ISellableSkuFixture> {
|
|
55
|
+
const fixture: Partial<ISellableSkuFixture> = {};
|
|
47
56
|
await app.bean.passport.signinMock();
|
|
48
57
|
try {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
58
|
+
fixture.categoryId = await app.bean.executor.performAction(
|
|
59
|
+
'post',
|
|
60
|
+
'/commerce/catalog/category',
|
|
61
|
+
{
|
|
62
|
+
body: { name: `cart-category-${suffix}`, published: true },
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
fixture.productId = await app.bean.executor.performAction('post', '/commerce/catalog/product', {
|
|
66
|
+
body: { categoryId: fixture.categoryId, title: `cart-product-${suffix}`, published: true },
|
|
54
67
|
});
|
|
55
|
-
|
|
68
|
+
fixture.skuId = await app.bean.executor.performAction('post', '/commerce/catalog/sku', {
|
|
56
69
|
body: {
|
|
57
|
-
productId,
|
|
70
|
+
productId: fixture.productId,
|
|
58
71
|
code: `cart-sku-${suffix}`,
|
|
59
72
|
priceCents: 100,
|
|
60
73
|
lifecycle: 'active',
|
|
@@ -62,28 +75,35 @@ async function createSellableSku(suffix: string): Promise<ISellableSkuFixture> {
|
|
|
62
75
|
});
|
|
63
76
|
await app.bean.executor.performAction('post', '/commerce/trade/stockBalance/adjustStock', {
|
|
64
77
|
body: {
|
|
65
|
-
skuId,
|
|
78
|
+
skuId: fixture.skuId,
|
|
66
79
|
delta: 10,
|
|
67
80
|
reason: `cart stock ${suffix}`,
|
|
68
81
|
correlationId: `cart-stock-${suffix}`,
|
|
69
82
|
},
|
|
70
83
|
});
|
|
71
|
-
return
|
|
84
|
+
return fixture as ISellableSkuFixture;
|
|
85
|
+
} catch (error) {
|
|
86
|
+
await dropSellableSku(fixture);
|
|
87
|
+
throw error;
|
|
72
88
|
} finally {
|
|
73
89
|
await app.bean.passport.signout();
|
|
74
90
|
}
|
|
75
91
|
}
|
|
76
92
|
|
|
77
|
-
async function dropSellableSku(fixture: ISellableSkuFixture | undefined) {
|
|
93
|
+
async function dropSellableSku(fixture: Partial<ISellableSkuFixture> | undefined) {
|
|
78
94
|
if (!fixture) return;
|
|
79
95
|
const trade = app.scope('commerce-trade');
|
|
80
96
|
const catalog = app.scope('commerce-catalog');
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
97
|
+
if (fixture.skuId !== undefined) {
|
|
98
|
+
await trade.model.stockAudit.delete({ skuId: fixture.skuId });
|
|
99
|
+
await trade.model.stockReservation.delete({ skuId: fixture.skuId });
|
|
100
|
+
await trade.model.stockBalance.delete({ skuId: fixture.skuId });
|
|
101
|
+
await catalog.model.sku.delete({ id: fixture.skuId });
|
|
102
|
+
}
|
|
103
|
+
if (fixture.productId !== undefined)
|
|
104
|
+
await catalog.model.product.delete({ id: fixture.productId });
|
|
105
|
+
if (fixture.categoryId !== undefined)
|
|
106
|
+
await catalog.model.category.delete({ id: fixture.categoryId });
|
|
87
107
|
}
|
|
88
108
|
|
|
89
109
|
async function dropUser(userId: number | undefined) {
|
|
@@ -206,6 +226,112 @@ describe('cartOwnership.test.ts', { concurrency: false }, () => {
|
|
|
206
226
|
});
|
|
207
227
|
});
|
|
208
228
|
|
|
229
|
+
it('reads an empty cart without creating business records', async () => {
|
|
230
|
+
await app.bean.executor.mockCtx(async () => {
|
|
231
|
+
let customer: Awaited<ReturnType<typeof registerAndSignin>> | undefined;
|
|
232
|
+
try {
|
|
233
|
+
customer = await registerAndSignin(`cart-empty-${createTestId()}`);
|
|
234
|
+
const trade = app.scope('commerce-trade');
|
|
235
|
+
assert.equal(await trade.model.cart.get({ userId: customer.user.id }), undefined);
|
|
236
|
+
assert.deepEqual(await performAs(customer.token, 'get', actionPath), { items: [] });
|
|
237
|
+
assert.deepEqual(await performAs(customer.token, 'get', actionPath), { items: [] });
|
|
238
|
+
assert.equal(await trade.model.cart.get({ userId: customer.user.id }), undefined);
|
|
239
|
+
} finally {
|
|
240
|
+
await app.bean.passport.signout();
|
|
241
|
+
await dropUser(customer?.user.id as number | undefined);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
it('keeps a sold-out cart DTO-valid without mutating its business records on reads', async () => {
|
|
247
|
+
await app.bean.executor.mockCtx(async () => {
|
|
248
|
+
const suffix = createTestId();
|
|
249
|
+
let sku: ISellableSkuFixture | undefined;
|
|
250
|
+
let customer: Awaited<ReturnType<typeof registerAndSignin>> | undefined;
|
|
251
|
+
try {
|
|
252
|
+
sku = await createSellableSku(suffix);
|
|
253
|
+
customer = await registerAndSignin(`cart-zero-${suffix}`);
|
|
254
|
+
const added = await performAs(customer.token, 'post', `${actionPath}/items`, {
|
|
255
|
+
body: cartItem(sku.skuId),
|
|
256
|
+
});
|
|
257
|
+
await app.bean.executor.newCtxIsolate(async () => {
|
|
258
|
+
await app.bean.passport.signinMock();
|
|
259
|
+
try {
|
|
260
|
+
await app.bean.executor.performAction(
|
|
261
|
+
'post',
|
|
262
|
+
'/commerce/trade/stockBalance/adjustStock',
|
|
263
|
+
{
|
|
264
|
+
body: {
|
|
265
|
+
skuId: sku!.skuId,
|
|
266
|
+
delta: -10,
|
|
267
|
+
reason: `cart depletion ${suffix}`,
|
|
268
|
+
correlationId: `cart-deplete-${suffix}`,
|
|
269
|
+
},
|
|
270
|
+
innerAccess: false,
|
|
271
|
+
},
|
|
272
|
+
);
|
|
273
|
+
} finally {
|
|
274
|
+
await app.bean.passport.signout();
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
const trade = app.scope('commerce-trade');
|
|
278
|
+
const before = {
|
|
279
|
+
cart: await trade.model.cart.getById(added.id),
|
|
280
|
+
items: await trade.model.cartItem.select({ where: { cartId: added.id } }),
|
|
281
|
+
stock: await trade.model.stockBalance.get({ skuId: sku.skuId }),
|
|
282
|
+
};
|
|
283
|
+
assert.equal(before.stock?.available, 0);
|
|
284
|
+
const current = await performAs(customer.token, 'get', actionPath);
|
|
285
|
+
assert.deepEqual(current, {
|
|
286
|
+
id: added.id,
|
|
287
|
+
items: [{ ...added.items[0], available: 0 }],
|
|
288
|
+
});
|
|
289
|
+
assert.deepEqual(await performAs(customer.token, 'get', actionPath), current);
|
|
290
|
+
assert.deepEqual(
|
|
291
|
+
{
|
|
292
|
+
cart: await trade.model.cart.getById(added.id),
|
|
293
|
+
items: await trade.model.cartItem.select({ where: { cartId: added.id } }),
|
|
294
|
+
stock: await trade.model.stockBalance.get({ skuId: sku.skuId }),
|
|
295
|
+
},
|
|
296
|
+
before,
|
|
297
|
+
);
|
|
298
|
+
assert.deepEqual(await $schema(DtoCartView).parseAsync(current), current);
|
|
299
|
+
for (const available of [1, 10]) {
|
|
300
|
+
assert.equal(
|
|
301
|
+
$schema(DtoCartItem).safeParse({ ...current.items[0], available }).success,
|
|
302
|
+
true,
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
for (const available of [-1, 0.5]) {
|
|
306
|
+
assert.equal(
|
|
307
|
+
$schema(DtoCartItem).safeParse({ ...current.items[0], available }).success,
|
|
308
|
+
false,
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
assert.equal(
|
|
312
|
+
$schema(DtoCartItem).safeParse({ ...current.items[0], available: 1, quantity: 0 })
|
|
313
|
+
.success,
|
|
314
|
+
false,
|
|
315
|
+
);
|
|
316
|
+
const document = await app.bean.openapi.generateJsonOfClasses(
|
|
317
|
+
[DtoCartView, DtoCartItem],
|
|
318
|
+
'V31',
|
|
319
|
+
);
|
|
320
|
+
const itemSchema = document.components!.schemas![appResource.getBeanFullName(DtoCartItem)!];
|
|
321
|
+
assert.ok('properties' in itemSchema);
|
|
322
|
+
const availableSchema = itemSchema.properties!.available;
|
|
323
|
+
assert.ok('type' in availableSchema);
|
|
324
|
+
assert.equal(availableSchema.type, 'integer');
|
|
325
|
+
assert.equal(availableSchema.minimum, 0);
|
|
326
|
+
assert.equal(availableSchema.exclusiveMinimum, undefined);
|
|
327
|
+
} finally {
|
|
328
|
+
await app.bean.passport.signout();
|
|
329
|
+
await dropUser(customer?.user.id as number | undefined);
|
|
330
|
+
await dropSellableSku(sku);
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
|
|
209
335
|
it('treats another instance cart as absent', async () => {
|
|
210
336
|
const suffix = createTestId();
|
|
211
337
|
let itemId!: number;
|
|
@@ -43,6 +43,7 @@ const app = useApp();
|
|
|
43
43
|
clientSecret: app.meta.env.AUTH_GITHUB_CLIENTSECRET || 'Shoule specify clientSecret',
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
|
+
useMockForDev: app.meta.env.AUTH_USEMOCKFORDEV !== 'false',
|
|
46
47
|
})
|
|
47
48
|
export class AuthProviderOauth extends BeanAuthProviderOauth2Base {
|
|
48
49
|
async strategy(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-suite-a-auth",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.30",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "module",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"vona-module-a-auth": "workspace:^",
|
|
11
|
-
"vona-module-auth-oauth": "^5.0.
|
|
11
|
+
"vona-module-auth-oauth": "^5.0.13",
|
|
12
12
|
"vona-module-auth-simple": "workspace:^"
|
|
13
13
|
},
|
|
14
14
|
"title": "a-auth"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-suite-a-cabloy",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.67",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"vona-module-a-cabloy": "workspace:^",
|
|
11
11
|
"vona-module-a-layoutprofile": "^5.0.2",
|
|
12
12
|
"vona-module-a-markdown": "^5.0.3",
|
|
13
|
-
"vona-module-a-rbac": "^5.0.
|
|
13
|
+
"vona-module-a-rbac": "^5.0.16",
|
|
14
14
|
"vona-module-a-socket": "workspace:^",
|
|
15
15
|
"vona-module-a-ssr": "workspace:^",
|
|
16
16
|
"vona-module-a-ssrhmr": "workspace:^"
|
|
@@ -16,11 +16,13 @@ import type {
|
|
|
16
16
|
export type TypeEntityTableColumnNames<EntityMeta extends { $table: string } | undefined> =
|
|
17
17
|
EntityMeta extends { $table: string }
|
|
18
18
|
? keyof {
|
|
19
|
-
[
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
[
|
|
20
|
+
K in keyof EntityMeta as K extends '$table' | '$comment' | '$default'
|
|
21
|
+
? never
|
|
22
|
+
: K extends string
|
|
23
|
+
? `${EntityMeta['$table']}.${K}`
|
|
24
|
+
: never
|
|
25
|
+
]: EntityMeta[K];
|
|
24
26
|
}
|
|
25
27
|
: never;
|
|
26
28
|
export type TypeEntityTableColumnNamesShort<Entity> = keyof Entity;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-jsx",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.94",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "Zova JSX",
|
|
6
6
|
"keywords": [
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@cabloy/word-utils": "^2.1.14",
|
|
51
51
|
"typestyle": "^2.4.0",
|
|
52
52
|
"vue": "^3.5.38",
|
|
53
|
-
"zova-core": "^5.1.
|
|
53
|
+
"zova-core": "^5.1.94"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.175",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "A vue3 framework with ioc",
|
|
6
6
|
"keywords": [
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"postpack": "clean-package restore"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"zova-core": "^5.1.
|
|
49
|
-
"zova-suite-a-zova": "^5.1.
|
|
48
|
+
"zova-core": "^5.1.94",
|
|
49
|
+
"zova-suite-a-zova": "^5.1.174"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-core",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.94",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "A vue3 framework with ioc",
|
|
6
6
|
"keywords": [
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@cabloy/word-utils": "^2.1.14",
|
|
63
63
|
"@cabloy/zod-errors-custom": "^2.1.10",
|
|
64
64
|
"@cabloy/zod-openapi": "^1.1.10",
|
|
65
|
-
"@cabloy/zod-query": "^2.1.
|
|
65
|
+
"@cabloy/zod-query": "^2.1.14",
|
|
66
66
|
"@types/js-cookie": "^3.0.6",
|
|
67
67
|
"@types/ms": "^2.1.0",
|
|
68
68
|
"@vue/shared": "^3.5.32",
|
|
@@ -14,9 +14,9 @@ export interface ILayoutRecord {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export type TypeComponentRecordSelector<PREFIX extends string> = {
|
|
17
|
-
[
|
|
18
|
-
? K
|
|
19
|
-
|
|
17
|
+
[
|
|
18
|
+
K in keyof IComponentRecord as K extends `${string}:${PREFIX}${string}` ? K : never
|
|
19
|
+
]: IComponentRecord[K];
|
|
20
20
|
};
|
|
21
21
|
export type TypeComponentRecordSelectorKeys<PREFIX extends string> =
|
|
22
22
|
keyof TypeComponentRecordSelector<PREFIX>;
|
|
@@ -12,9 +12,9 @@ export type IBeanRecord = IBeanRecordGeneral & IBeanRecordLocal;
|
|
|
12
12
|
export type TypeBeanRecordKeys = keyof IBeanRecord;
|
|
13
13
|
|
|
14
14
|
export type TypeBeanRecordGeneralSelector<SCENE extends keyof IBeanSceneRecord> = {
|
|
15
|
-
[
|
|
16
|
-
? K
|
|
17
|
-
|
|
15
|
+
[
|
|
16
|
+
K in keyof IBeanRecordGeneral as K extends `${string}.${SCENE}.${string}` ? K : never
|
|
17
|
+
]: IBeanRecordGeneral[K];
|
|
18
18
|
};
|
|
19
19
|
export type TypeBeanRecordGeneralSelectorKeys<SCENE extends keyof IBeanSceneRecord> =
|
|
20
20
|
keyof TypeBeanRecordGeneralSelector<SCENE>;
|
|
@@ -23,9 +23,9 @@ export type TypeBeanRecordGeneralSelectorSpecificName<
|
|
|
23
23
|
SCENE extends keyof IBeanSceneRecord,
|
|
24
24
|
NAME extends string,
|
|
25
25
|
> = {
|
|
26
|
-
[
|
|
27
|
-
? K
|
|
28
|
-
|
|
26
|
+
[
|
|
27
|
+
K in keyof IBeanRecordGeneral as K extends `${string}.${SCENE}.${NAME}` ? K : never
|
|
28
|
+
]: IBeanRecordGeneral[K];
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export type TypeBeanRecordGeneralSelectorSpecificNameKeys<
|
|
@@ -6,15 +6,15 @@ import { createVNode } from 'vue';
|
|
|
6
6
|
import { BeanBehaviorBase, Behavior } from 'zova-module-a-behavior';
|
|
7
7
|
|
|
8
8
|
export interface IBehaviorPropsInputPerform {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
class?: unknown;
|
|
10
|
+
disabled?: boolean | '' | 'true' | 'false';
|
|
11
|
+
onClick?: (e: MouseEvent) => unknown;
|
|
12
12
|
['aria-busy']?: boolean | 'true' | 'false';
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export interface IBehaviorPropsOutputPerform extends IBehaviorPropsInputPerform {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onClick?: (e: MouseEvent) => unknown;
|
|
18
18
|
['aria-busy']?: boolean | 'true' | 'false';
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -51,7 +51,9 @@ declare module 'zova-module-a-bean' {
|
|
|
51
51
|
export interface IVonaComponentRecord {
|
|
52
52
|
'basic-date:date': ControllerDateProps &
|
|
53
53
|
ControllerDateModels & {
|
|
54
|
-
[
|
|
54
|
+
[
|
|
55
|
+
KEY in keyof ControllerDateModels as TypePropValueFromModel<KEY>
|
|
56
|
+
]: ControllerDateModels[KEY];
|
|
55
57
|
} & {
|
|
56
58
|
[KEY in keyof ControllerDateModels as TypePropUpdateFromModel<KEY>]: (
|
|
57
59
|
value: ControllerDateModels[KEY],
|
|
@@ -18,18 +18,24 @@ export type ZDateRangeProps = {
|
|
|
18
18
|
controllerRef?: (ref: ControllerDateRange) => void;
|
|
19
19
|
} & ControllerDateRangeProps &
|
|
20
20
|
ControllerDateRangeModels & {
|
|
21
|
-
[
|
|
21
|
+
[
|
|
22
|
+
KEY in keyof ControllerDateRangeModels as TypePropValueFromModel<KEY>
|
|
23
|
+
]: ControllerDateRangeModels[KEY];
|
|
22
24
|
} & {
|
|
23
25
|
[KEY in keyof ControllerDateRangeModels as TypePropUpdateFromModel<KEY>]: (
|
|
24
26
|
value: ControllerDateRangeModels[KEY],
|
|
25
27
|
) => void;
|
|
26
28
|
};
|
|
27
29
|
type TypeModelArguments = {
|
|
28
|
-
[
|
|
30
|
+
[
|
|
31
|
+
KEY in keyof ControllerDateRangeModels as TypePropValueFromModel<KEY>
|
|
32
|
+
]: ControllerDateRangeModels[KEY];
|
|
29
33
|
};
|
|
30
34
|
type ControllerInnerProps = TypeControllerInnerProps<
|
|
31
35
|
ControllerDateRangeProps & {
|
|
32
|
-
[
|
|
36
|
+
[
|
|
37
|
+
KEY in keyof ControllerDateRangeModels as TypePropValueFromModel<KEY>
|
|
38
|
+
]: ControllerDateRangeModels[KEY];
|
|
33
39
|
},
|
|
34
40
|
keyof typeof ControllerDateRange.$propsDefault
|
|
35
41
|
>;
|
|
@@ -51,7 +57,9 @@ declare module 'zova-module-a-bean' {
|
|
|
51
57
|
export interface IVonaComponentRecord {
|
|
52
58
|
'basic-date:dateRange': ControllerDateRangeProps &
|
|
53
59
|
ControllerDateRangeModels & {
|
|
54
|
-
[
|
|
60
|
+
[
|
|
61
|
+
KEY in keyof ControllerDateRangeModels as TypePropValueFromModel<KEY>
|
|
62
|
+
]: ControllerDateRangeModels[KEY];
|
|
55
63
|
} & {
|
|
56
64
|
[KEY in keyof ControllerDateRangeModels as TypePropUpdateFromModel<KEY>]: (
|
|
57
65
|
value: ControllerDateRangeModels[KEY],
|
|
@@ -110,7 +110,9 @@ export class ControllerBlockPageEntry<TData extends {} = {}> extends BeanControl
|
|
|
110
110
|
return this.$$modelResource.getFormSchema(this.formMeta);
|
|
111
111
|
});
|
|
112
112
|
this.formData = this.$computed(() => {
|
|
113
|
-
return this
|
|
113
|
+
return this.projectFormData(
|
|
114
|
+
this.$$modelResource.getFormData(this.formMeta, this.entryId) as TData | undefined,
|
|
115
|
+
);
|
|
114
116
|
});
|
|
115
117
|
// jsx
|
|
116
118
|
this._prepareJsx();
|
|
@@ -151,6 +153,10 @@ export class ControllerBlockPageEntry<TData extends {} = {}> extends BeanControl
|
|
|
151
153
|
this._offDraftDiscard?.();
|
|
152
154
|
}
|
|
153
155
|
|
|
156
|
+
protected projectFormData(data: TData | undefined): TData | undefined {
|
|
157
|
+
return data;
|
|
158
|
+
}
|
|
159
|
+
|
|
154
160
|
private _setEditorBaseline(data: TData | undefined) {
|
|
155
161
|
this._baseline = data ? deepExtend({}, data) : undefined;
|
|
156
162
|
this.editorData = this._baseline;
|
|
@@ -372,7 +378,7 @@ export class ControllerBlockPageEntry<TData extends {} = {}> extends BeanControl
|
|
|
372
378
|
let baseline = this._baseline;
|
|
373
379
|
if (this._draftIdentity?.mode === 'edit') {
|
|
374
380
|
const result = await this.queryData!.refetch({ throwOnError: true });
|
|
375
|
-
baseline = result.data as TData | undefined;
|
|
381
|
+
baseline = this.projectFormData(result.data as TData | undefined);
|
|
376
382
|
}
|
|
377
383
|
if (!current()) return;
|
|
378
384
|
const schema = this._getDraftSchema();
|