@tbox.cn/app-provider-mock 0.6.2 → 0.6.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.
@@ -618,8 +618,8 @@ var MockShoppingServiceImpl = class {
618
618
  var MOCK_MALL_INFO_PROVIDER = "mock";
619
619
  var MOCK_MALL_INFO_IMPL = "mock-mall-info@1";
620
620
  var CFG5 = {
621
- name: "",
622
- // '' 哨兵 = 动态别名回退
621
+ name: "\u793A\u4F8B\u5546\u573A",
622
+ // 固定演示名(不拼 mallId——品牌区不展示)
623
623
  address: "\u793A\u4F8B\u5546\u573A\u5730\u5740\uFF08demo\uFF09",
624
624
  latitude: 30,
625
625
  longitude: 120
@@ -632,7 +632,7 @@ var mockMallInfoFactory = (input) => {
632
632
  if (!MALL_ID_RE.test(mallId)) return void 0;
633
633
  return {
634
634
  mallId,
635
- name: CFG5.name !== "" ? CFG5.name : `\u793A\u4F8B\u5546\u573A\uFF08${mallId}\uFF09`,
635
+ name: CFG5.name,
636
636
  address: CFG5.address,
637
637
  latitude: CFG5.latitude,
638
638
  longitude: CFG5.longitude
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-provider-mock",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "type": "module",
5
5
  "description": "商圈 Mock Provider 包(极简零配置):17 槽 local 供给开箱即用——免传输/凭据/实例配置/集成配置;config 消费与配置验证面见 @tbox.cn/app-provider-mocktest。",
6
6
  "exports": {
@@ -14,10 +14,10 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@tbox.cn/app-contracts": "0.12.0",
18
- "@tbox.cn/app-contracts-mall": "0.12.1",
19
- "@tbox.cn/app-agent-sdk-client": "0.1.1",
20
- "@tbox.cn/app-agent-sdk-server": "0.1.1"
17
+ "@tbox.cn/app-contracts": "0.12.2",
18
+ "@tbox.cn/app-contracts-mall": "0.12.2",
19
+ "@tbox.cn/app-agent-sdk-client": "0.1.2",
20
+ "@tbox.cn/app-agent-sdk-server": "0.1.2"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/express": "4.17.25",
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * Mock 商场基础信息 adapter(mall.info 槽供给;对齐真实厂商 mall-info adapter 通用形态)。
3
3
  *
4
- * 动态商场演示源:任意 mallId → 恒返回确定性别名(`示例商场(<mallId>)`)——
5
- * 动态 mallId 会话的品牌区 mallName 有 mock 真源(三级回退链第 2 级命中)。
4
+ * 动态商场演示源:任意 mallId → 恒返回固定演示名(`示例商场`)——
5
+ * 动态 mallId 会话的品牌区 mallName 有 mock 真源(三级回退链第 2 级命中)
6
+ * (原动态别名 `示例商场(<mallId>)` 2026-09-22 用户裁决退役——品牌区不展示 mallId)。
6
7
  * 固定 demo 地址/经纬度服务 mall-info agent tool 答问演示(融合远端 PR 363 演示语义)。
7
8
  *
8
9
  * 关键约束(对齐真实厂商 adapter 先例):
@@ -10,7 +11,7 @@
10
11
  * 记录≠校验教训:请求形状断言在 provider adapter 单测锁死)
11
12
  * - fail-soft 契约恒满足:本实现无 IO,不可能失败——契约面与真实档保持一致
12
13
  * - 演示常量零配置冻结:CFG 值 ≡ 0.4.0 缺省(2026-09-20 拆分——config 消费随
13
- * provider-mocktest 迁出)
14
+ * provider-mocktest 迁出;name 2026-09-22 随动态别名退役由 '' 哨兵改直出)
14
15
  */
15
16
  import type { MallInfo, MallInfoPort } from '@tbox.cn/app-contracts-mall';
16
17
  import type { ServiceAdapterFactory } from '@tbox.cn/app-agent-sdk-server';
@@ -18,9 +19,9 @@ import type { ServiceAdapterFactory } from '@tbox.cn/app-agent-sdk-server';
18
19
  export const MOCK_MALL_INFO_PROVIDER = 'mock';
19
20
  export const MOCK_MALL_INFO_IMPL = 'mock-mall-info@1';
20
21
 
21
- /** 演示常量(零配置冻结——0.5.0 起本包无 config 面;值 ≡ 0.4.0 缺省) */
22
+ /** 演示常量(零配置冻结——0.5.0 起本包无 config 面) */
22
23
  const CFG = {
23
- name: '', // '' 哨兵 = 动态别名回退
24
+ name: '示例商场', // 固定演示名(不拼 mallId——品牌区不展示)
24
25
  address: '示例商场地址(demo)',
25
26
  latitude: 30.0,
26
27
  longitude: 120.0,
@@ -37,11 +38,11 @@ export const mockMallInfoFactory: ServiceAdapterFactory = (input): MallInfoPort
37
38
  if (!MALL_ID_RE.test(mallId)) return undefined;
38
39
  return {
39
40
  mallId,
40
- name: CFG.name !== '' ? CFG.name : `示例商场(${mallId})`,
41
+ name: CFG.name,
41
42
  address: CFG.address,
42
43
  latitude: CFG.latitude,
43
44
  longitude: CFG.longitude,
44
45
  };
45
46
  },
46
47
  };
47
- };
48
+ };
package/tbox.module.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "id": "provider-mock",
4
- "name": "Mock",
5
- "description": "全槽本地演示供给:零配置开箱(免传输/凭据/实例配置/集成配置)",
4
+ "name": "演示数据",
5
+ "description": "平台提供演示数据,支持体验组件效果;如需接入真实业务数据,请切换自定义API",
6
6
  "version": "0.1.0",
7
7
  "kind": "business",
8
8
  "risk": {
@@ -118,7 +118,7 @@ describe('F2 端到端:provider-mock 经槽位轴解析', () => {
118
118
  })) as { getDirectory(ctx: unknown): Promise<{ mallId: string; buildings: unknown[] } | null> };
119
119
  expect((await shoppingDirectory.getDirectory({ scope: { mallId: 'mall-demo' } } as never))?.mallId).toBe('mall-demo');
120
120
 
121
- // mall.info(融合语义:动态别名 + demo 位置字段——mall-info agent tool 演示数据面)
121
+ // mall.info(融合语义:固定演示名 + demo 位置字段——mall-info agent tool 演示数据面)
122
122
  const mallInfo = (await ctx.integrations!.resolveService({
123
123
  service: 'mall.info',
124
124
  scope: { mallId: 'mall-demo' },
@@ -126,7 +126,7 @@ describe('F2 端到端:provider-mock 经槽位轴解析', () => {
126
126
  })) as { getMallInfo(mallId: string): Promise<{ mallId: string; name: string } | undefined> };
127
127
  await expect(mallInfo.getMallInfo('mall-demo')).resolves.toMatchObject({
128
128
  mallId: 'mall-demo',
129
- name: '示例商场(mall-demo)',
129
+ name: '示例商场',
130
130
  });
131
131
  });
132
132
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * mock mall.info adapter 单测(mall.info 槽供给;对齐真实厂商 mall-info 单测通用形态)。
3
- * 请求形状断言(记录≠校验教训):mallId 形状守卫——合法 id 恒返回确定性别名;
3
+ * 请求形状断言(记录≠校验教训):mallId 形状守卫——合法 id 恒返回固定演示名;
4
4
  * 畸形 id(注入类字符/超长)→ undefined,零上游调用(mock 无 IO,守卫即终态)。
5
5
  */
6
6
  import { describe, expect, it } from 'vitest';
@@ -18,18 +18,18 @@ function makePort(config: unknown = {}) {
18
18
  }
19
19
 
20
20
  describe('mockMallInfoFactory:请求形状守卫', () => {
21
- it('合法 mallId → 确定性别名 + demo 位置(动态商场品牌区真源 + agent tool 演示数据面)', async () => {
21
+ it('合法 mallId → 固定演示名 + demo 位置(动态商场品牌区真源 + agent tool 演示数据面;跨 id 名一致不拼 mallId)', async () => {
22
22
  const port = makePort();
23
23
  const info = await port.getMallInfo('1102588');
24
24
  expect(info).toEqual({
25
25
  mallId: '1102588',
26
- name: '示例商场(1102588)',
26
+ name: '示例商场',
27
27
  address: '示例商场地址(demo)',
28
28
  latitude: 30.0,
29
29
  longitude: 120.0,
30
30
  });
31
31
  const info2 = await port.getMallInfo('demo-mall_1');
32
- expect(info2?.name).toBe('示例商场(demo-mall_1)');
32
+ expect(info2?.name).toBe('示例商场');
33
33
  });
34
34
 
35
35
  it('畸形 mallId → undefined(形状守卫——防注入类字符/超长)', async () => {