@tbox.cn/app-contracts-mall 0.12.2 → 0.12.4
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/runtime.d.ts +1 -1
- package/dist/runtime.js +0 -2
- package/dist/services/mall-info.d.ts +0 -13
- package/package.json +2 -2
- package/src/runtime.ts +1 -1
- package/src/service-slots.json +4 -6
- package/src/services/mall-info.ts +0 -17
- package/tests/service-slots.test.ts +6 -7
package/dist/runtime.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { MEMBER_ACCOUNT_SERVICE, MEMBER_PROFILE_SERVICE, MEMBER_CARD_SERVICE, ME
|
|
|
12
12
|
export { PARKING_QUERY_SERVICE, PARKING_PAYMENT_SERVICE, PARKING_VEHICLE_SERVICE, PARKING_SNAPSHOT_SERVICE } from './services/parking';
|
|
13
13
|
export { PROMOTION_OFFERS_SERVICE, PROMOTION_ENTITLEMENTS_SERVICE, PROMOTION_ACTIVITIES_SERVICE, PROMOTION_ACQUISITION_SERVICE, PROMOTION_ACTIVITY_ROUTING_POLICY, } from './services/promotion';
|
|
14
14
|
export { SHOPPING_CATALOG_SERVICE, SHOPPING_SHOPS_SERVICE, SHOPPING_CATEGORIES_SERVICE, SHOPPING_DIRECTORY_SERVICE, } from './services/shopping-guide';
|
|
15
|
-
export { MALL_INFO_SERVICE
|
|
15
|
+
export { MALL_INFO_SERVICE } from './services/mall-info';
|
|
16
16
|
export { mallLocationSchema, parseMallLocation, mallUserRefSchema, parseMallUserRef } from './guard';
|
|
17
17
|
export * from './shopping-guide/cards';
|
|
18
18
|
export * from './member/cards';
|
package/dist/runtime.js
CHANGED
|
@@ -184,7 +184,6 @@ var SHOPPING_DIRECTORY_SERVICE = "shopping-guide.directory";
|
|
|
184
184
|
|
|
185
185
|
// src/services/mall-info.ts
|
|
186
186
|
var MALL_INFO_SERVICE = "mall.info";
|
|
187
|
-
var MALL_INFO_CACHE_SERVICE = "mall.info-cache";
|
|
188
187
|
|
|
189
188
|
// src/guard.ts
|
|
190
189
|
import { z } from "zod";
|
|
@@ -1204,7 +1203,6 @@ var parkingCardDataSchemas = {
|
|
|
1204
1203
|
};
|
|
1205
1204
|
export {
|
|
1206
1205
|
AUTH_LOGIN_SERVICE,
|
|
1207
|
-
MALL_INFO_CACHE_SERVICE,
|
|
1208
1206
|
MALL_INFO_SERVICE,
|
|
1209
1207
|
MALL_SCOPE_KEY,
|
|
1210
1208
|
MEMBER_ACCOUNT_SERVICE,
|
|
@@ -24,16 +24,3 @@ export interface MallInfoPort {
|
|
|
24
24
|
*/
|
|
25
25
|
getMallInfo(mallId: string): Promise<MallInfo | undefined>;
|
|
26
26
|
}
|
|
27
|
-
/** 跨模块 'mall.info-cache' 词汇(与 service-slots.json 同锁)。 */
|
|
28
|
-
export declare const MALL_INFO_CACHE_SERVICE = "mall.info-cache";
|
|
29
|
-
/**
|
|
30
|
-
* mall.info 缓存 Port(缓存 → single-flight → mall.info 槽的读面)。
|
|
31
|
-
* module-mall-core register 期注册(闭包 integrations);消费方 resolveService 直读。
|
|
32
|
-
* 缓存纪律(TTL/负缓存/LRU/single-flight/形状守卫)由实现方收口。
|
|
33
|
-
*/
|
|
34
|
-
export interface MallInfoCachePort {
|
|
35
|
-
/** 缓存名读取(同步回退通道;过期/负缓存 → undefined) */
|
|
36
|
-
cachedMallName(mallId: string): string | undefined;
|
|
37
|
-
/** 缓存 → single-flight → mall.info 槽拉取;失败/未知 → undefined(fail-soft) */
|
|
38
|
-
resolveMallInfo(mallId: string): Promise<MallInfo | undefined>;
|
|
39
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tbox.cn/app-contracts-mall",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "商圈领域契约(TIER1,types + runtime):Port 接口 + MallEventMap + 领域 DTO + scope/装配器运行时。",
|
|
6
6
|
"exports": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@tbox.cn/app-contracts": "0.12.
|
|
32
|
+
"@tbox.cn/app-contracts": "0.12.3",
|
|
33
33
|
"zod": "3.25.76"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
package/src/runtime.ts
CHANGED
|
@@ -34,7 +34,7 @@ export {
|
|
|
34
34
|
SHOPPING_CATEGORIES_SERVICE,
|
|
35
35
|
SHOPPING_DIRECTORY_SERVICE,
|
|
36
36
|
} from './services/shopping-guide';
|
|
37
|
-
export { MALL_INFO_SERVICE
|
|
37
|
+
export { MALL_INFO_SERVICE } from './services/mall-info';
|
|
38
38
|
export { mallLocationSchema, parseMallLocation, mallUserRefSchema, parseMallUserRef } from './guard';
|
|
39
39
|
export * from './shopping-guide/cards';
|
|
40
40
|
export * from './member/cards';
|
package/src/service-slots.json
CHANGED
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
"shopping-guide.categories",
|
|
21
21
|
"shopping-guide.directory",
|
|
22
22
|
"auth.alipay-login",
|
|
23
|
-
"mall.info"
|
|
24
|
-
"mall.info-cache"
|
|
23
|
+
"mall.info"
|
|
25
24
|
],
|
|
26
25
|
"meta": {
|
|
27
26
|
"member.account": { "name": "会员账户", "description": "登录与入会状态、会员外部引用" },
|
|
@@ -29,11 +28,11 @@
|
|
|
29
28
|
"member.card": { "name": "会员卡面", "description": "卡面快照:等级、消费进度、权益摘要" },
|
|
30
29
|
"member.benefits": { "name": "会员权益", "description": "权益列表与消耗进度" },
|
|
31
30
|
"member.enrollment": { "name": "会员入会", "description": "入会表单查询与入会动作" },
|
|
32
|
-
"member.snapshot": { "name": "
|
|
31
|
+
"member.snapshot": { "name": "会员聚合快览", "description": "会员域基础口聚合快览(账户/积分/入会引导,面板读;enrollment fail-soft)" },
|
|
33
32
|
"parking.query": { "name": "停车查询", "description": "费用报价、车场信息、可享权益" },
|
|
34
33
|
"parking.payment": { "name": "停车缴费", "description": "缴费下单、支付状态、记录与开票" },
|
|
35
34
|
"parking.vehicle": { "name": "车辆管理", "description": "绑定车辆、车牌管理、寻车定位" },
|
|
36
|
-
"parking.snapshot": { "name": "
|
|
35
|
+
"parking.snapshot": { "name": "停车聚合快览", "description": "停车域基础口聚合快览(绑定车辆列表 + 可选在场探测,面板读)" },
|
|
37
36
|
"promotion.offers": { "name": "营销优惠", "description": "券、团购等优惠查询" },
|
|
38
37
|
"promotion.entitlements": { "name": "营销权益", "description": "我的券与领取资格" },
|
|
39
38
|
"promotion.activities": { "name": "营销活动", "description": "活动列表详情与参与指引" },
|
|
@@ -43,7 +42,6 @@
|
|
|
43
42
|
"shopping-guide.categories": { "name": "类目浏览", "description": "楼层与类目目录" },
|
|
44
43
|
"shopping-guide.directory": { "name": "商场目录", "description": "商场、门店、楼层目录服务" },
|
|
45
44
|
"auth.alipay-login": { "name": "支付宝登录", "description": "登录换码(code2Session)" },
|
|
46
|
-
"mall.info": { "name": "商场信息", "description": "商场名称地址坐标,动态商场信息源" }
|
|
47
|
-
"mall.info-cache": { "name": "商场信息缓存", "description": "商场信息缓存读面(缓存→合并请求→槽)" }
|
|
45
|
+
"mall.info": { "name": "商场信息", "description": "商场名称地址坐标,动态商场信息源" }
|
|
48
46
|
}
|
|
49
47
|
}
|
|
@@ -29,20 +29,3 @@ export interface MallInfoPort {
|
|
|
29
29
|
*/
|
|
30
30
|
getMallInfo(mallId: string): Promise<MallInfo | undefined>;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
// ===== mall.info 缓存面(W3-3:缓存装饰跨模块暴露) =====
|
|
34
|
-
|
|
35
|
-
/** 跨模块 'mall.info-cache' 词汇(与 service-slots.json 同锁)。 */
|
|
36
|
-
export const MALL_INFO_CACHE_SERVICE = 'mall.info-cache';
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* mall.info 缓存 Port(缓存 → single-flight → mall.info 槽的读面)。
|
|
40
|
-
* module-mall-core register 期注册(闭包 integrations);消费方 resolveService 直读。
|
|
41
|
-
* 缓存纪律(TTL/负缓存/LRU/single-flight/形状守卫)由实现方收口。
|
|
42
|
-
*/
|
|
43
|
-
export interface MallInfoCachePort {
|
|
44
|
-
/** 缓存名读取(同步回退通道;过期/负缓存 → undefined) */
|
|
45
|
-
cachedMallName(mallId: string): string | undefined;
|
|
46
|
-
/** 缓存 → single-flight → mall.info 槽拉取;失败/未知 → undefined(fail-soft) */
|
|
47
|
-
resolveMallInfo(mallId: string): Promise<MallInfo | undefined>;
|
|
48
|
-
}
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
SHOPPING_CATEGORIES_SERVICE,
|
|
32
32
|
SHOPPING_DIRECTORY_SERVICE,
|
|
33
33
|
} from '../src/services/shopping-guide';
|
|
34
|
-
import { MALL_INFO_SERVICE
|
|
34
|
+
import { MALL_INFO_SERVICE } from '../src/services/mall-info';
|
|
35
35
|
import { AUTH_LOGIN_SERVICE } from '../src/assembly';
|
|
36
36
|
|
|
37
37
|
const constants = [
|
|
@@ -55,20 +55,19 @@ const constants = [
|
|
|
55
55
|
MALL_INFO_SERVICE,
|
|
56
56
|
MEMBER_SNAPSHOT_SERVICE,
|
|
57
57
|
PARKING_SNAPSHOT_SERVICE,
|
|
58
|
-
MALL_INFO_CACHE_SERVICE,
|
|
59
58
|
];
|
|
60
59
|
|
|
61
60
|
describe('service slot 词汇交叉锁(JSON 真源 ↔ TS 共址常量)', () => {
|
|
62
|
-
it('计数 =
|
|
63
|
-
expect(slotsJson.slots).toHaveLength(
|
|
64
|
-
expect(constants).toHaveLength(
|
|
61
|
+
it('计数 = 20(auth.alipay-login 与 mall.info 族含在内)', () => {
|
|
62
|
+
expect(slotsJson.slots).toHaveLength(20);
|
|
63
|
+
expect(constants).toHaveLength(20);
|
|
65
64
|
});
|
|
66
65
|
|
|
67
66
|
it('常量并集 ≡ JSON slots(互为子集;无重复无缺漏)', () => {
|
|
68
67
|
const jsonSet = new Set(slotsJson.slots);
|
|
69
68
|
const constSet = new Set(constants);
|
|
70
|
-
expect(jsonSet.size).toBe(
|
|
71
|
-
expect(constSet.size).toBe(
|
|
69
|
+
expect(jsonSet.size).toBe(20);
|
|
70
|
+
expect(constSet.size).toBe(20);
|
|
72
71
|
for (const id of jsonSet) expect(constSet.has(id), `常量缺 ${id}`).toBe(true);
|
|
73
72
|
for (const id of constSet) expect(jsonSet.has(id), `JSON 缺 ${id}`).toBe(true);
|
|
74
73
|
});
|