@tbox.cn/app-contracts-mall 0.13.1 → 0.14.0

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/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  pnpm add @tbox.cn/app-contracts-mall
9
9
  ```
10
10
 
11
- 发布包同时提供两种消费形态:直接安装使用 `dist` 编译产物;模板中的 `@app/contracts-mall` shim 默认转发发布包,`tbox-app module add` 自动依赖本包时将其替换为本地源码包。显式使用 `--mode sdk` 时仍保持发布态消费。
11
+ 发布包同时提供两种消费形态:直接安装使用 `dist` 编译产物;模板中的 `@app/contracts-mall` shim 默认转发发布包,`npx --yes @tbox.cn/app-cli module add` 自动依赖本包时将其替换为本地源码包。显式使用 `--mode sdk` 时仍保持发布态消费。
12
12
 
13
13
  ## 入口
14
14
 
@@ -4,8 +4,8 @@ import type { Identity, RequestContext } from '@tbox.cn/app-contracts';
4
4
  /**
5
5
  * 会员域 Port(每服务槽一接口):账户 / 资料 / 卡面 / 权益(含积分) / 入会 五业务 Port +
6
6
  * 跨模块工厂契约。结构类型子集接口——模块完整实现 extends 本接口,消费方仅依赖契约包。
7
- * 自定义 API 接入:每个 Port = 你的后端需提供的一组能力(经 provider-custom 落地,
8
- * 见应用根 INTEGRATION.md)。
7
+ * 自定义 API 接入:每个 Port = 你的后端需提供的一组能力(经 provider-custom 落地,指引:
8
+ * npx --yes @tbox.cn/app-cli skills get provider-custom)。
9
9
  */
10
10
  export declare const MEMBER_ACCOUNT_SERVICE = "member.account";
11
11
  export declare const MEMBER_PROFILE_SERVICE = "member.profile";
@@ -251,7 +251,7 @@ export interface MemberGateBlock {
251
251
  * 实现方(member.status 工厂)应自收口异常;本函数对抛错实现兜底为软放行(横切面鲁棒性)。
252
252
  */
253
253
  export declare function resolveMemberGate(factory: MemberStatusFactory | undefined, reqCtx: RequestContext): Promise<MemberGateBlock | undefined>;
254
- /** 跨模块 'member.snapshot' 词汇(与 service-slots.json 同锁)。 */
254
+ /** 跨模块 'member.snapshot' 词汇(运行时 ctx.services 注册键——聚合快照槽已退词汇真源 service-slots.json,非 provider 槽)。 */
255
255
  export declare const MEMBER_SNAPSHOT_SERVICE = "member.snapshot";
256
256
  /**
257
257
  * 会员快览 Port(linked-panel 消费面:账户/授权三态 + 积分 + 入会引导)。
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 停车域 Port(查询 / 缴费 / 车辆 三槽各一 Port):结算写全部收口进 ParkingPaymentPort
3
3
  * (厂商真实支付链)。自定义 API 接入:每个 Port = 你的后端需提供的一组能力
4
- * (经 provider-custom 落地,见应用根 INTEGRATION.md)。
4
+ * (经 provider-custom 落地,指引:npx --yes @tbox.cn/app-cli skills get provider-custom)。
5
5
  */
6
6
  import type { MallScope } from '../scope';
7
7
  import type { RequestContext } from '@tbox.cn/app-contracts';
@@ -105,7 +105,7 @@ export interface ParkingVehiclePort {
105
105
  vehicleRef?: string;
106
106
  }): Promise<void>;
107
107
  }
108
- /** 跨模块 'parking.snapshot' 词汇(与 service-slots.json 同锁)。 */
108
+ /** 跨模块 'parking.snapshot' 词汇(运行时 ctx.services 注册键——聚合快照槽已退词汇真源 service-slots.json,非 provider 槽)。 */
109
109
  export declare const PARKING_SNAPSHOT_SERVICE = "parking.snapshot";
110
110
  /**
111
111
  * 停车快览 Port(linked-panel 消费面:绑定车辆列表 + 在场探测)。
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * 营销域 Port(查询三 Port + 领取写一 Port,按读写边界拆分)——自定义 API 接入:每个
3
- * Port = 你的后端需提供的一组能力(经 provider-custom 落地,见应用根 INTEGRATION.md)。
3
+ * Port = 你的后端需提供的一组能力(经 provider-custom 落地,指引:
4
+ * npx --yes @tbox.cn/app-cli skills get provider-custom)。
4
5
  * 结构类型子集接口——模块完整实现 extends 本接口,消费方仅依赖契约包。
5
6
  * C 端主体经 ctx.requestContext.credentials;externalMemberRef 由消费方经 member 域
6
7
  * 状态服务解析('member.status' 判定 + externalMemberRefOf 取值)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-contracts-mall",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
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.13.1",
32
+ "@tbox.cn/app-contracts": "0.13.3",
33
33
  "zod": "3.25.76"
34
34
  },
35
35
  "devDependencies": {
@@ -6,11 +6,9 @@
6
6
  "member.card",
7
7
  "member.benefits",
8
8
  "member.enrollment",
9
- "member.snapshot",
10
9
  "parking.query",
11
10
  "parking.payment",
12
11
  "parking.vehicle",
13
- "parking.snapshot",
14
12
  "promotion.offers",
15
13
  "promotion.entitlements",
16
14
  "promotion.activities",
@@ -28,11 +26,9 @@
28
26
  "member.card": { "name": "会员卡与等级", "description": "获取会员卡、会员等级、成长进度和权益摘要" },
29
27
  "member.benefits": { "name": "会员权益", "description": "查询会员可享权益、使用状态和剩余次数" },
30
28
  "member.enrollment": { "name": "在线入会", "description": "获取入会所需信息,并支持用户在线注册成为会员" },
31
- "member.snapshot": { "name": "会员首页概览", "description": "汇总会员身份、积分和入会状态,供首页快速展示" },
32
29
  "parking.query": { "name": "停车费用查询", "description": "查询停车场信息、当前停车费用和可用优惠" },
33
30
  "parking.payment": { "name": "停车缴费与开票", "description": "创建停车缴费订单,查询支付状态和记录,并支持申请发票" },
34
31
  "parking.vehicle": { "name": "车辆管理与寻车", "description": "绑定或解绑常用车牌,并查询车辆所在位置" },
35
- "parking.snapshot": { "name": "停车首页概览", "description": "汇总车辆和当前停车状态,供首页快速展示" },
36
32
  "promotion.offers": { "name": "营销优惠", "description": "券、团购等优惠查询" },
37
33
  "promotion.entitlements": { "name": "营销权益", "description": "我的券与领取资格" },
38
34
  "promotion.activities": { "name": "营销活动", "description": "活动列表详情与参与指引" },
@@ -5,8 +5,8 @@ import type { Identity, RequestContext } from '@tbox.cn/app-contracts';
5
5
  /**
6
6
  * 会员域 Port(每服务槽一接口):账户 / 资料 / 卡面 / 权益(含积分) / 入会 五业务 Port +
7
7
  * 跨模块工厂契约。结构类型子集接口——模块完整实现 extends 本接口,消费方仅依赖契约包。
8
- * 自定义 API 接入:每个 Port = 你的后端需提供的一组能力(经 provider-custom 落地,
9
- * 见应用根 INTEGRATION.md)。
8
+ * 自定义 API 接入:每个 Port = 你的后端需提供的一组能力(经 provider-custom 落地,指引:
9
+ * npx --yes @tbox.cn/app-cli skills get provider-custom)。
10
10
  */
11
11
 
12
12
  // ===== 会员域 service slot 词汇(与 service-slots.json 同锁) =====
@@ -367,7 +367,7 @@ export async function resolveMemberGate(
367
367
 
368
368
  // ===== 11. 跨模块会员快览(首页联单面板消费面) =====
369
369
 
370
- /** 跨模块 'member.snapshot' 词汇(与 service-slots.json 同锁)。 */
370
+ /** 跨模块 'member.snapshot' 词汇(运行时 ctx.services 注册键——聚合快照槽已退词汇真源 service-slots.json,非 provider 槽)。 */
371
371
  export const MEMBER_SNAPSHOT_SERVICE = 'member.snapshot';
372
372
 
373
373
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 停车域 Port(查询 / 缴费 / 车辆 三槽各一 Port):结算写全部收口进 ParkingPaymentPort
3
3
  * (厂商真实支付链)。自定义 API 接入:每个 Port = 你的后端需提供的一组能力
4
- * (经 provider-custom 落地,见应用根 INTEGRATION.md)。
4
+ * (经 provider-custom 落地,指引:npx --yes @tbox.cn/app-cli skills get provider-custom)。
5
5
  */
6
6
  import type { MallScope } from '../scope';
7
7
  import type { RequestContext } from '@tbox.cn/app-contracts';
@@ -167,7 +167,7 @@ export interface ParkingVehiclePort {
167
167
 
168
168
  // ===== 4. 跨模块停车快览(首页联单面板消费面) =====
169
169
 
170
- /** 跨模块 'parking.snapshot' 词汇(与 service-slots.json 同锁)。 */
170
+ /** 跨模块 'parking.snapshot' 词汇(运行时 ctx.services 注册键——聚合快照槽已退词汇真源 service-slots.json,非 provider 槽)。 */
171
171
  export const PARKING_SNAPSHOT_SERVICE = 'parking.snapshot';
172
172
 
173
173
  /**
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * 营销域 Port(查询三 Port + 领取写一 Port,按读写边界拆分)——自定义 API 接入:每个
3
- * Port = 你的后端需提供的一组能力(经 provider-custom 落地,见应用根 INTEGRATION.md)。
3
+ * Port = 你的后端需提供的一组能力(经 provider-custom 落地,指引:
4
+ * npx --yes @tbox.cn/app-cli skills get provider-custom)。
4
5
  * 结构类型子集接口——模块完整实现 extends 本接口,消费方仅依赖契约包。
5
6
  * C 端主体经 ctx.requestContext.credentials;externalMemberRef 由消费方经 member 域
6
7
  * 状态服务解析('member.status' 判定 + externalMemberRefOf 取值)。
@@ -11,13 +11,11 @@ import {
11
11
  MEMBER_CARD_SERVICE,
12
12
  MEMBER_BENEFITS_SERVICE,
13
13
  MEMBER_ENROLLMENT_SERVICE,
14
- MEMBER_SNAPSHOT_SERVICE,
15
14
  } from '../src/services/member';
16
15
  import {
17
16
  PARKING_QUERY_SERVICE,
18
17
  PARKING_PAYMENT_SERVICE,
19
18
  PARKING_VEHICLE_SERVICE,
20
- PARKING_SNAPSHOT_SERVICE,
21
19
  } from '../src/services/parking';
22
20
  import {
23
21
  PROMOTION_OFFERS_SERVICE,
@@ -53,21 +51,19 @@ const constants = [
53
51
  SHOPPING_DIRECTORY_SERVICE,
54
52
  AUTH_LOGIN_SERVICE,
55
53
  MALL_INFO_SERVICE,
56
- MEMBER_SNAPSHOT_SERVICE,
57
- PARKING_SNAPSHOT_SERVICE,
58
54
  ];
59
55
 
60
56
  describe('service slot 词汇交叉锁(JSON 真源 ↔ TS 共址常量)', () => {
61
- it('计数 = 20(auth.alipay-login 与 mall.info 族含在内)', () => {
62
- expect(slotsJson.slots).toHaveLength(20);
63
- expect(constants).toHaveLength(20);
57
+ it('计数 = 18(auth.alipay-login 与 mall.info 族含在内;聚合快照槽已退词汇——运行时 ctx.services 键不受影响)', () => {
58
+ expect(slotsJson.slots).toHaveLength(18);
59
+ expect(constants).toHaveLength(18);
64
60
  });
65
61
 
66
62
  it('常量并集 ≡ JSON slots(互为子集;无重复无缺漏)', () => {
67
63
  const jsonSet = new Set(slotsJson.slots);
68
64
  const constSet = new Set(constants);
69
- expect(jsonSet.size).toBe(20);
70
- expect(constSet.size).toBe(20);
65
+ expect(jsonSet.size).toBe(18);
66
+ expect(constSet.size).toBe(18);
71
67
  for (const id of jsonSet) expect(constSet.has(id), `常量缺 ${id}`).toBe(true);
72
68
  for (const id of constSet) expect(jsonSet.has(id), `JSON 缺 ${id}`).toBe(true);
73
69
  });