@tbox.cn/app-contracts-mall 0.12.4 → 0.12.5

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.
Files changed (45) hide show
  1. package/dist/assembly.d.ts +7 -7
  2. package/dist/domain/parking.d.ts +2 -2
  3. package/dist/domain/shopping-guide.d.ts +1 -1
  4. package/dist/guard.d.ts +2 -2
  5. package/dist/mall-scope-url.d.ts +1 -1
  6. package/dist/member/cards.d.ts +3 -3
  7. package/dist/parking/cards.d.ts +1 -1
  8. package/dist/promotion/cards.d.ts +6 -6
  9. package/dist/query-context.d.ts +1 -1
  10. package/dist/runtime.d.ts +2 -2
  11. package/dist/runtime.js +7 -7
  12. package/dist/scope.d.ts +7 -7
  13. package/dist/server/index.d.ts +1 -1
  14. package/dist/server/index.js +1 -1
  15. package/dist/server/request-credentials.d.ts +2 -2
  16. package/dist/services/customer-service.d.ts +4 -3
  17. package/dist/services/member.d.ts +15 -15
  18. package/dist/services/parking.d.ts +5 -5
  19. package/dist/services/promotion.d.ts +4 -3
  20. package/dist/services/shopping-guide.d.ts +3 -1
  21. package/dist/shared/cards.d.ts +2 -2
  22. package/dist/shopping-guide/cards.d.ts +11 -11
  23. package/package.json +2 -2
  24. package/src/assembly.ts +7 -7
  25. package/src/domain/parking.ts +2 -2
  26. package/src/domain/shopping-guide.ts +1 -1
  27. package/src/guard.ts +2 -2
  28. package/src/mall-scope-url.ts +1 -1
  29. package/src/member/cards.ts +3 -3
  30. package/src/parking/cards.ts +1 -1
  31. package/src/promotion/cards.ts +2 -2
  32. package/src/query-context.ts +1 -1
  33. package/src/runtime.ts +2 -2
  34. package/src/scope.ts +7 -7
  35. package/src/server/index.ts +1 -1
  36. package/src/server/mall-control-plane.ts +2 -2
  37. package/src/server/request-credentials.ts +2 -2
  38. package/src/services/customer-service.ts +4 -3
  39. package/src/services/mall-info.ts +1 -1
  40. package/src/services/member.ts +22 -22
  41. package/src/services/parking.ts +7 -7
  42. package/src/services/promotion.ts +4 -3
  43. package/src/services/shopping-guide.ts +3 -1
  44. package/src/shared/cards.ts +2 -2
  45. package/src/shopping-guide/cards.ts +7 -7
@@ -1,7 +1,7 @@
1
1
  /**
2
- * 商圈装配器(011 B2:TIER1 领域运行时):
2
+ * 商圈装配器(TIER1 领域运行时):
3
3
  * 纯函数——extractScopeKey/validateScope/extractMallScope,
4
- * SDK 原语(ScopeSessionRegistry/ProviderRegistry)组合在模板装配点完成(011 L1)。
4
+ * SDK 原语(ScopeSessionRegistry/ProviderRegistry)组合在模板装配点完成。
5
5
  *
6
6
  * 不 import app-sdk(依赖方向:contracts-mall → contracts;SDK 不依赖 TIER1)。
7
7
  *
@@ -19,7 +19,7 @@ import { type MallScope } from './scope';
19
19
  */
20
20
  export declare const AUTH_LOGIN_SERVICE = "auth.alipay-login";
21
21
  /**
22
- * mall 域装配形状(TIER0 ScopeAssemblyContract 的 TIER1 具体化;W3-3 自 module-mall-core 下沉):
22
+ * mall 域装配形状(TIER0 ScopeAssemblyContract 的 TIER1 具体化; 自 module-mall-core 下沉):
23
23
  * module-mall-core register 期注册于 ctx.domainAssemblies(SCOPE_ASSEMBLY_KIND),
24
24
  * 消费方(模板装配点/本包家页面/SDK)按本类型泛型断言查表——域模块间零包依赖
25
25
  * (workspace-dag 铁律:跨模块走注册表 + 契约类型)。
@@ -46,7 +46,7 @@ export interface MallScopeAssembly extends ScopeAssemblyContract {
46
46
  readonly scopeDefaults: Readonly<Record<string, unknown>> | undefined;
47
47
  /** 016:默认商圈 HELLO context(无 URL 参数访问时的服务端兜底;缺省 defaultMallId → undefined) */
48
48
  defaultMallContext(): Record<string, unknown> | undefined;
49
- /** D1:ENHANCE_CTX 双职责(miniAppId 回填 + mall.info 预热;fail-soft——抛错/超时原 context 继续) */
49
+ /** ENHANCE_CTX 双职责(miniAppId 回填 + mall.info 预热;fail-soft——抛错/超时原 context 继续) */
50
50
  enhanceHelloContext(context: Record<string, unknown>): Promise<Record<string, unknown>>;
51
51
  }
52
52
  /**
@@ -67,7 +67,7 @@ export interface MallRuntimeAssembly {
67
67
  extractScopeKey(ctx: RequestContext): string;
68
68
  /** scope 形状校验(SDK ScopeSessionRegistry 注入点):单一形状守卫核(白名单判定已退役) */
69
69
  validateScope(attributes: Record<string, unknown>): boolean;
70
- /** 011 D1:领域扁平 scope(回显 + ActionGrant 签发/校验单一来源) */
70
+ /** 领域扁平 scope(回显 + ActionGrant 签发/校验单一来源) */
71
71
  buildScope(attributes: Record<string, unknown>): Record<string, string>;
72
72
  /** 提取 MallScope(模块 handler 前置;无 scope → undefined 由调用方降级) */
73
73
  extractMallScope(ctx: RequestContext): MallScope | undefined;
@@ -84,8 +84,8 @@ export declare function createMallRuntimeAssembly(controlPlane: MallDeploymentCo
84
84
  */
85
85
  export declare function createMallContextValidator(): (attributes: Record<string, unknown>) => boolean;
86
86
  /**
87
- * 014 T1:buildScope 包装——从控制平面参考表回填 mallName(自 mall 模板 deployment.ts
88
- * 迁入,单一模板统一化 W1-①)。
87
+ * buildScope 包装——从控制平面参考表回填 mallName(自 mall 模板 deployment.ts
88
+ * 迁入,单一模板统一化)。
89
89
  * scopeFlat(mallId[+miniAppId])→ HELLO_ACK.mallScope 回显,mallName 为壳品牌区
90
90
  * (ChatHeader)服务端真源。
91
91
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 停车域模型(015:POC parking 域精华沉淀,TIER1)。
3
- * 金额一律 cents(number);展示层字符串化(D11)。
3
+ * 金额一律 cents(number);展示层字符串化。
4
4
  */
5
5
  /** 停车车辆(绑定车) */
6
6
  export interface ParkingVehicle {
@@ -195,7 +195,7 @@ export interface PaymentOperation {
195
195
  readonly entryAt?: string;
196
196
  /**
197
197
  * 报价投影(建单时自报价快照,对齐 entryAt 同模式——PAID 原卡翻转要重灌终态卡数据,
198
- * 而 W4 报价缓存仅 UNPAID 态可见、届时不可达)。optional:存量 PAYING 单与旧版本
198
+ * 而 报价缓存仅 UNPAID 态可见、届时不可达)。optional:存量 PAYING 单与旧版本
199
199
  * 发起的支付无此投影,PAID 收口降级为出回执新卡(零回归语义)。
200
200
  */
201
201
  readonly quoteProjection?: {
@@ -10,7 +10,7 @@ export interface MoneyRecord {
10
10
  readonly amountMinor: number;
11
11
  readonly display: string;
12
12
  }
13
- /** 门店位置值对象(零坐标依赖,POC R5;poiId 有值时可升级为坐标导航) */
13
+ /** 门店位置值对象(零坐标依赖,POC ;poiId 有值时可升级为坐标导航) */
14
14
  export interface ShopLocationRecord {
15
15
  readonly buildingName?: string;
16
16
  readonly floorName?: string;
package/dist/guard.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * 平台存储数据不可全信——一切外部形状先过 zod。
5
5
  */
6
6
  import { z } from 'zod';
7
- /** 商圈位置(经纬度字符串化,D11:数值一律字符串化) */
7
+ /** 商圈位置(经纬度字符串化,数值一律字符串化) */
8
8
  export interface MallLocation {
9
9
  latitude: string;
10
10
  longitude: string;
@@ -31,7 +31,7 @@ export declare const mallLocationSchema: z.ZodObject<{
31
31
  }>;
32
32
  /** 解析失败返回 undefined(调用方降级「位置未知」文案) */
33
33
  export declare function parseMallLocation(raw: unknown): MallLocation | undefined;
34
- /** 商圈用户标识(D11 字符串化 user 字段守卫) */
34
+ /** 商圈用户标识(字符串化 user 字段守卫) */
35
35
  export interface MallUserRef {
36
36
  userId: string;
37
37
  /** 可选 mall 会员主体 id */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * mall scope URL 读源(客户端单一真源;自 mall 模板 platform/ 迁入,单一模板统一化 W1-①;
2
+ * mall scope URL 读源(客户端单一真源;自 mall 模板 platform/ 迁入,单一模板统一化 ;
3
3
  * search-only——hash 内参数不读,壳侧 URL 改写层若移参进 hash 则失效,接入契约显式声明)。
4
4
  *
5
5
  * mallId = 契约键(优先);plazaId = 商场通用别名兜底(壳侧词汇兼容,非 vendor 特判——
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 会员域卡片数据契约(011 K2:member 卡 zod schema,TIER1;券面 0.4.0 净删——promotion 承接)。
2
+ * 会员域卡片数据契约(member 卡 zod schema,TIER1;券面 0.4.0 净删——promotion 承接)。
3
3
  */
4
4
  import { z } from 'zod';
5
5
  export declare const memberAuthStateSchema: z.ZodEnum<["authenticated", "unauthenticated"]>;
@@ -232,7 +232,7 @@ export declare const memberCardSummaryCardDataSchema: z.ZodObject<{
232
232
  }>;
233
233
  export type MemberCardSummaryCardData = z.infer<typeof memberCardSummaryCardDataSchema>;
234
234
  /**
235
- * member-point-usage-list(011 K3:余额、厂商会员标签与积分流水)。
235
+ * member-point-usage-list(余额、厂商会员标签与积分流水)。
236
236
  */
237
237
  export declare const memberPointUsageListCardDataSchema: z.ZodObject<{
238
238
  userId: z.ZodString;
@@ -406,7 +406,7 @@ export declare const memberEnrollmentFormCardDataSchema: z.ZodObject<{
406
406
  manualNotice?: string | undefined;
407
407
  }>;
408
408
  export type MemberEnrollmentFormCardData = z.infer<typeof memberEnrollmentFormCardDataSchema>;
409
- /** member-enrollment-status(入会结果状态卡;pending 态附显式刷新按钮,R4) */
409
+ /** member-enrollment-status(入会结果状态卡;pending 态附显式刷新按钮) */
410
410
  export declare const memberEnrollmentStatusCardDataSchema: z.ZodObject<{
411
411
  userId: z.ZodString;
412
412
  attemptRef: z.ZodOptional<z.ZodString>;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 停车域卡片数据契约(015:parking 5 卡 zod schema,TIER1)。
3
- * 源:POC parking 11 卡型收敛(V6/D7);金额展示层字符串化(D11)。
3
+ * 源:POC parking 11 卡型收敛(V6/);金额展示层字符串化。
4
4
  */
5
5
  import { z } from 'zod';
6
6
  /** parking-payment:缴费确认主卡(报价 + 权益 + revision) */
@@ -52,7 +52,7 @@ export declare const promotionOfferListCardDataSchema: z.ZodObject<{
52
52
  availabilityStatus: z.ZodOptional<z.ZodEnum<["AVAILABLE", "UNAVAILABLE", "REQUIRES_ACTION", "UNKNOWN"]>>;
53
53
  validityText: z.ZodOptional<z.ZodString>;
54
54
  imageUrl: z.ZodOptional<z.ZodString>;
55
- /** 0.3.2 D4:条目动作(send:查看详情) */
55
+ /** 0.3.2 条目动作(send:查看详情) */
56
56
  itemActions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
57
57
  kind: z.ZodLiteral<"send">;
58
58
  label: z.ZodString;
@@ -436,7 +436,7 @@ export declare const promotionEntitlementListCardDataSchema: z.ZodObject<{
436
436
  usageRuleText: z.ZodOptional<z.ZodString>;
437
437
  validityText: z.ZodOptional<z.ZodString>;
438
438
  validUntilText: z.ZodOptional<z.ZodString>;
439
- /** 0.3.2 D4:条目动作(send:查看详情) */
439
+ /** 0.3.2 条目动作(send:查看详情) */
440
440
  itemActions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
441
441
  kind: z.ZodLiteral<"send">;
442
442
  label: z.ZodString;
@@ -817,7 +817,7 @@ export declare const promotionBestDealCardDataSchema: z.ZodObject<{
817
817
  availabilityStatus: z.ZodOptional<z.ZodEnum<["AVAILABLE", "UNAVAILABLE", "REQUIRES_ACTION", "UNKNOWN"]>>;
818
818
  validityText: z.ZodOptional<z.ZodString>;
819
819
  imageUrl: z.ZodOptional<z.ZodString>;
820
- /** 0.3.2 D4:条目动作(send:查看详情) */
820
+ /** 0.3.2 条目动作(send:查看详情) */
821
821
  itemActions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
822
822
  kind: z.ZodLiteral<"send">;
823
823
  label: z.ZodString;
@@ -1321,7 +1321,7 @@ export declare const promotionCardDataSchemas: {
1321
1321
  availabilityStatus: z.ZodOptional<z.ZodEnum<["AVAILABLE", "UNAVAILABLE", "REQUIRES_ACTION", "UNKNOWN"]>>;
1322
1322
  validityText: z.ZodOptional<z.ZodString>;
1323
1323
  imageUrl: z.ZodOptional<z.ZodString>;
1324
- /** 0.3.2 D4:条目动作(send:查看详情) */
1324
+ /** 0.3.2 条目动作(send:查看详情) */
1325
1325
  itemActions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1326
1326
  kind: z.ZodLiteral<"send">;
1327
1327
  label: z.ZodString;
@@ -1701,7 +1701,7 @@ export declare const promotionCardDataSchemas: {
1701
1701
  usageRuleText: z.ZodOptional<z.ZodString>;
1702
1702
  validityText: z.ZodOptional<z.ZodString>;
1703
1703
  validUntilText: z.ZodOptional<z.ZodString>;
1704
- /** 0.3.2 D4:条目动作(send:查看详情) */
1704
+ /** 0.3.2 条目动作(send:查看详情) */
1705
1705
  itemActions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1706
1706
  kind: z.ZodLiteral<"send">;
1707
1707
  label: z.ZodString;
@@ -2078,7 +2078,7 @@ export declare const promotionCardDataSchemas: {
2078
2078
  availabilityStatus: z.ZodOptional<z.ZodEnum<["AVAILABLE", "UNAVAILABLE", "REQUIRES_ACTION", "UNKNOWN"]>>;
2079
2079
  validityText: z.ZodOptional<z.ZodString>;
2080
2080
  imageUrl: z.ZodOptional<z.ZodString>;
2081
- /** 0.3.2 D4:条目动作(send:查看详情) */
2081
+ /** 0.3.2 条目动作(send:查看详情) */
2082
2082
  itemActions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2083
2083
  kind: z.ZodLiteral<"send">;
2084
2084
  label: z.ZodString;
@@ -6,7 +6,7 @@
6
6
  * 留在模块内,不在本文件。
7
7
  *
8
8
  * plazaId 边界(不可变约束):plazaId 归一是客户端 mall-scope-url 单点职责,
9
- * 本文件只认 mallId 契约键,不接受别名(四道防护见 docs/plans/mall-scope-unification)。
9
+ * 本文件只认 mallId 契约键,不接受别名(解析入口/工具面/上下文提取/装饰器四道防护一致收口)。
10
10
  */
11
11
  import type { RequestContext } from '@tbox.cn/app-contracts';
12
12
  import type { MallScope } from './scope';
package/dist/runtime.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @tbox.cn/app-contracts-mall runtime 入口(011 A5:types-only → types + runtime)。
2
+ * @tbox.cn/app-contracts-mall runtime 入口(types-only → types + runtime)。
3
3
  * 本文件为唯一运行时 JS(经 tsup/esbuild 出 dist/runtime.js);
4
4
  * 类型面仍经 tsc emitDeclarationOnly 出 dist/*.d.ts。
5
- * 依赖方向:contracts-mall → contracts(TIER0);SDK 不 import 本包(011 B3)。
5
+ * 依赖方向:contracts-mall → contracts(TIER0);SDK 不 import 本包。
6
6
  */
7
7
  export { MALL_SCOPE_KEY, mallScopeSchema, mallSlot, parseMallScope, extractMallScope, mallScopeOf, readLoginMallId } from './scope';
8
8
  export { mallScopeOrEmpty, mallSubjectIdOf, withMallScopeFromQuery, toMallQueryContext } from './query-context';
package/dist/runtime.js CHANGED
@@ -124,7 +124,7 @@ function memberGateCardOf(userId, status) {
124
124
  return {
125
125
  cardType: "member-login-cta",
126
126
  data: { title: "\u767B\u5F55\u540E\u7EE7\u7EED", ...loginUrl ? { loginUrl } : {} },
127
- // note 契约(W7,2026-09-01):主体+动作(模型据此答话转述——「点击卡片登录」)
127
+ // note 契约:主体+动作(模型据此答话转述——「点击卡片登录」)
128
128
  note: "\u672A\u767B\u5F55 \xB7 \u70B9\u51FB\u5361\u7247\u767B\u5F55"
129
129
  };
130
130
  }
@@ -408,7 +408,7 @@ var categoryListCardDataSchema = z3.object({
408
408
  iconUrl: httpsUrlSchema.optional(),
409
409
  merchantCount: z3.number().int().min(0),
410
410
  subCategories: z3.array(z3.object({ code: z3.string(), name: z3.string(), merchantCount: z3.number().int().min(0) })).optional(),
411
- /** 0.3.2 D4:类别条目动作(send 合成话术/外链) */
411
+ /** 0.3.2 类别条目动作(send 合成话术/外链) */
412
412
  itemActions: z3.array(actionDraftSchema).optional()
413
413
  })
414
414
  ),
@@ -450,7 +450,7 @@ var productComparisonCardDataSchema = z3.object({
450
450
  caveats: z3.array(z3.string())
451
451
  })
452
452
  ),
453
- /** 0.3.2 D4:刷新截止时间(ISO);到期后渲染端禁用全部条目交互 */
453
+ /** 0.3.2 刷新截止时间(ISO);到期后渲染端禁用全部条目交互 */
454
454
  refreshRequiredAt: isoDateTimeSchema.optional(),
455
455
  observedAt: isoDateTimeSchema
456
456
  });
@@ -467,7 +467,7 @@ var mallDirectoryCardDataSchema = z3.object({
467
467
  floorName: z3.string(),
468
468
  businessCategories: z3.array(z3.string()),
469
469
  merchantCount: z3.number().int().min(0),
470
- /** 0.3.2 D4:楼层条目动作(send:查看楼层门店) */
470
+ /** 0.3.2 楼层条目动作(send:查看楼层门店) */
471
471
  itemActions: z3.array(actionDraftSchema).optional()
472
472
  })
473
473
  )
@@ -496,7 +496,7 @@ var customerServiceFaqCardDataSchema = z3.object({
496
496
  answer: z3.string().min(1),
497
497
  category: z3.string().optional(),
498
498
  relevanceScore: z3.number().min(0).max(1),
499
- /** 0.3.2 D4:答案参考外链(openLink) */
499
+ /** 0.3.2 答案参考外链(openLink) */
500
500
  referenceUrl: httpsUrlSchema.optional()
501
501
  })
502
502
  ),
@@ -836,7 +836,7 @@ var offerSummarySchema = z6.object({
836
836
  availabilityStatus: z6.enum(["AVAILABLE", "UNAVAILABLE", "REQUIRES_ACTION", "UNKNOWN"]).optional(),
837
837
  validityText: z6.string().optional(),
838
838
  imageUrl: imageUrlSchema,
839
- /** 0.3.2 D4:条目动作(send:查看详情) */
839
+ /** 0.3.2 条目动作(send:查看详情) */
840
840
  itemActions: z6.array(actionDraftSchema).optional(),
841
841
  tags: z6.array(z6.string())
842
842
  });
@@ -927,7 +927,7 @@ var promotionEntitlementListCardDataSchema = z6.object({
927
927
  usageRuleText: z6.string().optional(),
928
928
  validityText: z6.string().optional(),
929
929
  validUntilText: z6.string().optional(),
930
- /** 0.3.2 D4:条目动作(send:查看详情) */
930
+ /** 0.3.2 条目动作(send:查看详情) */
931
931
  itemActions: z6.array(actionDraftSchema).optional(),
932
932
  stores: z6.array(z6.object({
933
933
  storeId: z6.string(),
package/dist/scope.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
- * 商圈 scope(011 B2:TIER1 领域语义唯一真源):
2
+ * 商圈 scope(TIER1 领域语义唯一真源):
3
3
  * MallScope 类型 + zod 解析 + ContextSlot 槽位 + RequestContext 提取器。
4
4
  *
5
- * 消费方(模块)只依赖本文件解析 attributes,不解析原始形状(011 B4);
6
- * TIER0(app-contracts)不出现任何 mall 语义(011 B1)。
5
+ * 消费方(模块)只依赖本文件解析 attributes,不解析原始形状;
6
+ * TIER0(app-contracts)不出现任何 mall 语义。
7
7
  */
8
8
  import { z } from 'zod';
9
9
  import type { RequestContext } from '@tbox.cn/app-contracts';
@@ -18,12 +18,12 @@ export interface MallScope {
18
18
  * 尽力回填的展示/定位值,非会话边界(边界恒 mallId)。
19
19
  */
20
20
  miniAppId?: string;
21
- /** 商圈 id(会话边界:跨 mall 强制新会话,011 F3) */
21
+ /** 商圈 id(会话边界:跨 mall 强制新会话) */
22
22
  mallId: string;
23
23
  /** 可选主体 id(会员体系 subject) */
24
24
  subjectId?: string;
25
25
  }
26
- /** 011 S7:服务端回显形状(= MallScope + 服务端生成的 sessionId;与输入形状分离) */
26
+ /** 服务端回显形状(= MallScope + 服务端生成的 sessionId;与输入形状分离) */
27
27
  export interface MallSessionScope extends MallScope {
28
28
  sessionId: string;
29
29
  }
@@ -50,7 +50,7 @@ export declare const mallSlot: import("@tbox.cn/app-contracts").ContextSlot<{
50
50
  miniAppId?: string | undefined;
51
51
  subjectId?: string | undefined;
52
52
  }, "mall">;
53
- /** 解析失败返回 undefined(不 throw),模块自行降级(011 B2 语义;mallSlot 薄包装) */
53
+ /** 解析失败返回 undefined(不 throw),模块自行降级(语义;mallSlot 薄包装) */
54
54
  export declare function parseMallScope(attributes: Record<string, unknown> | undefined): MallScope | undefined;
55
55
  /** 从 RequestContext 提取 MallScope(parseMallScope 包装) */
56
56
  export declare function extractMallScope(ctx: RequestContext): MallScope | undefined;
@@ -69,7 +69,7 @@ export declare function mallScopeOf(reqCtx: {
69
69
  * 对外移除已随 0.8.0 落地(0.7.3 additive 波次保留至本波次)。
70
70
  */
71
71
  /**
72
- * 登录 context 宽松读取 mallId(F2:换码器归 provider 包后的共享读取器)。
72
+ * 登录 context 宽松读取 mallId(换码器归 provider 包后的共享读取器)。
73
73
  * 登录 URL 可只带 mallId(不套 parseMallScope 全形状)——登录换码先例,与
74
74
  * MALL_SCOPE_KEY 共置单一真源;provider 包 scoped 谓词与换码体共用本入口。
75
75
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TIER1 服务端子路径出口(F2 模板中立化后):
2
+ * TIER1 服务端子路径出口(模板中立化后):
3
3
  * 请求凭证读取助手(request-credentials)+ mall 身份视图(mall-context)+
4
4
  * mall 控制平面投影(mall-control-plane)。
5
5
  * 登录换码器已整迁各 provider 包自注册
@@ -53,7 +53,7 @@ var mallAttributesSchema = z.strictObject({
53
53
  /** 展示地址(可选;推荐 Banner 展示用) */
54
54
  address: z.string().optional()
55
55
  }).optional()
56
- // 门店维度(stores)显式非目标(D13)——新行业拓扑 = 新 TIER1 投影包,不在本文件扩键
56
+ // 门店维度(stores)显式非目标——新行业拓扑 = 新 TIER1 投影包,不在本文件扩键
57
57
  });
58
58
  function parseMallAttributes(inst) {
59
59
  const result = mallAttributesSchema.safeParse(inst.attributes ?? {});
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 请求级凭证访问器(F5 单源):从 RequestContext.credentials 提取用户级凭证,
2
+ * 请求级凭证访问器(单源):从 RequestContext.credentials 提取用户级凭证,
3
3
  * 供 provider adapter factory 构造请求级薄壳 service(E2 不变式:用户凭证只入
4
4
  * service 请求层,禁止写入被缓存的 transport/authStrategy)。
5
5
  *
@@ -16,7 +16,7 @@ export declare function credentialsVisitortoken(ctx: RequestContext): string;
16
16
  /**
17
17
  * 平台 openId(ctx.credentials.attributes.openid;外部身份绑定场景)。
18
18
  * 契约唯一通道:ExternalCredentials.attributes 三元组随 external claim 流动
19
- *(identity.ts)——曾误读顶层 credentials.openid(契约无此键,恒 undefined,
19
+ * (契约类型定义于 identity.ts)——曾误读顶层 credentials.openid(契约无此键,恒 undefined,
20
20
  * 致绑定动作 OpenId 恒空),勿改回顶层读取。
21
21
  */
22
22
  export declare function credentialsOpenId(ctx: RequestContext): string;
@@ -1,7 +1,8 @@
1
1
  /**
2
- * 客服承接域 Port 契约(2026-08-31 客服模块拆分:自 shopping-guide AssistanceQueryPort
3
- * 切出 FAQ/知识库两方法;人工导购 listHumanGuides 留导购域 AssistanceQueryPort)。
4
- * 客服承接 = 本地知识库域(与 provider 远程检索面正交,恒本地装配)。
2
+ * 客服承接域 Port 契约:FAQ/知识库检索两方法。
3
+ * 客服承接 = 本地知识库域(与 provider 远程检索面正交,恒本地装配)——知识库供给走
4
+ * 资源绑定(integrations.json modules 节),非槽位 adapter;见
5
+ * module-customer-service INTEGRATION.md。
5
6
  */
6
7
  import type { ShoppingQueryContext } from './shopping-guide';
7
8
  import type { FaqEntry, KnowledgeEntry } from '../domain/shopping-guide';
@@ -2,8 +2,10 @@ import type { Points } from '../domain/points';
2
2
  import type { DiscountRule } from '../domain/discount';
3
3
  import type { Identity, RequestContext } from '@tbox.cn/app-contracts';
4
4
  /**
5
- * 会员域 Port(011 K2:6 Port 替换旧 MemberQueryPort/MemberSettlementPort,breaking 0.2.0)。
6
- * 结构类型子集接口——模块完整实现 extends 本接口,消费方仅依赖契约包。
5
+ * 会员域 Port(每服务槽一接口):账户 / 资料 / 卡面 / 权益(含积分) / 入会 五业务 Port +
6
+ * 跨模块工厂契约。结构类型子集接口——模块完整实现 extends 本接口,消费方仅依赖契约包。
7
+ * 自定义 API 接入:每个 Port = 你的后端需提供的一组能力(经 provider-custom 落地,
8
+ * 见应用根 INTEGRATION.md)。
7
9
  */
8
10
  export declare const MEMBER_ACCOUNT_SERVICE = "member.account";
9
11
  export declare const MEMBER_PROFILE_SERVICE = "member.profile";
@@ -96,7 +98,7 @@ export interface MemberBenefitsSnapshot {
96
98
  readonly observedAt: string;
97
99
  }
98
100
  export interface MemberBenefitsPort {
99
- /** 积分查询(替代旧 MemberQueryPort.queryPoints) */
101
+ /** 积分查询 */
100
102
  queryPoints(userId: string): Promise<Points>;
101
103
  /** 权益快照 */
102
104
  getBenefits(userId: string): Promise<MemberBenefitsSnapshot>;
@@ -105,9 +107,9 @@ export interface MemberBenefitsPort {
105
107
  items: ReadonlyArray<PointUsageRecord>;
106
108
  total: number;
107
109
  }>;
108
- /** 折扣查询(替代旧 MemberQueryPort.queryDiscount) */
110
+ /** 折扣规则查询(无规则时 undefined) */
109
111
  queryDiscount(userId: string): Promise<DiscountRule | undefined>;
110
- /** 结算写(替代旧 MemberSettlementPort;幂等键由调用方生成) */
112
+ /** 积分结算写(幂等键由调用方生成——同键重入应返回首果) */
111
113
  deductPoints(userId: string, amount: number, idempotencyKey: string): Promise<boolean>;
112
114
  refundPoints(userId: string, amount: number, idempotencyKey: string): Promise<boolean>;
113
115
  awardPoints(userId: string, amount: number): Promise<boolean>;
@@ -115,21 +117,20 @@ export interface MemberBenefitsPort {
115
117
  export interface PointUsageRecord {
116
118
  readonly usageRecordRef: string;
117
119
  readonly title: string;
118
- /** 字符串化金额(D11 展示层统一字符串) */
120
+ /** 字符串化金额(展示层统一字符串) */
119
121
  readonly amount: string;
120
122
  readonly usedAt?: string;
121
123
  readonly description?: string;
122
124
  }
123
125
  /**
124
- * 会员服务解析工厂(上下文统一化 Stage 2):跨模块 'member.service' 注册面。
125
- * member 模块 register 期注册 `(reqCtx) => resolveMemberBenefitsPort(reqCtx, ctx)`
126
- * (017 槽位原子化:本面 = benefits 单槽契约,benefits 方法族);
126
+ * 会员权益解析工厂:跨模块 'member.service' 注册面(benefits 单槽契约)。
127
+ * member 模块 register 期注册 `(reqCtx) => resolveMemberBenefitsPort(reqCtx, ctx)`;
127
128
  * 跨模块消费方经 ctx.resolveService<MemberBenefitsFactory>('member.service')
128
- * 结构解析后 `await factory(reqCtx)`——替代旧 'member' 全局门面(ctx.auth 并发缺陷)。
129
+ * 结构解析后 `await factory(reqCtx)`。
129
130
  * 身份/会员资格判定请走 'member.status' 注册面(outcome + account),勿经本面取 account 域数据。
130
131
  */
131
132
  export type MemberBenefitsFactory = (reqCtx: RequestContext) => Promise<MemberBenefitsPort>;
132
- /** 入会身份来源(F2:授权 profile 可信度高于手填) */
133
+ /** 入会身份来源:授权 profile 可信度高于手填 */
133
134
  export type MemberEnrollmentIdentity = 'alipay_authorized' | 'enrollment_submission';
134
135
  export interface MemberEnrollmentInput {
135
136
  readonly userId: string;
@@ -138,7 +139,7 @@ export interface MemberEnrollmentInput {
138
139
  readonly fieldValues: Readonly<Record<string, string>>;
139
140
  /** 已同意的 consent id 集合(模块侧校验必勾后传入) */
140
141
  readonly acceptedConsentIds: readonly string[];
141
- /** 幂等键(模块生成:sha256(userId\0mallId\0formVersion)) */
142
+ /** 幂等键(模块生成:userId+mallId+formVersion 摘要)——同键重入返回首果 */
142
143
  readonly idempotencyKey: string;
143
144
  readonly formVersion?: string;
144
145
  }
@@ -146,7 +147,7 @@ export type MemberEnrollmentResult = {
146
147
  readonly status: 'active';
147
148
  readonly memberRef: string;
148
149
  }
149
- /** 厂商异步确认(pending 卡 + 显式刷新收口,R4) */
150
+ /** 厂商异步确认态(pending 卡 + 显式刷新收口) */
150
151
  | {
151
152
  readonly status: 'pending_confirmation';
152
153
  readonly attemptRef: string;
@@ -166,8 +167,7 @@ export interface MemberEnrollmentPort {
166
167
  }>;
167
168
  /**
168
169
  * 入会表单定义(厂商端点拉取,如厂商 enrollmentConfig 端点);无表单端点厂商可缺省——
169
- * 调用方 typeof 守卫降级(calculateBestDeal? 同款先例)。017 R13 自 module-member
170
- * fat 接口收编。
170
+ * 调用方 typeof 守卫降级(入会走固定授权流)。
171
171
  */
172
172
  getEnrollmentFormDefinition?(userId: string): Promise<MemberEnrollmentFormDefinition>;
173
173
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
- * 停车域 Port(015:三 Port 重写,breaking 0.3.0——替换旧 ParkingQueryPort/ParkingSettlementPort)。
3
- * 结算写全部收口进 ParkingPaymentPort(厂商真实支付链);
4
- * 旧 InMemory「calcFee/useCoupon/settlePayment」模拟结算面删除(S8)。
2
+ * 停车域 Port(查询 / 缴费 / 车辆 三槽各一 Port):结算写全部收口进 ParkingPaymentPort
3
+ * (厂商真实支付链)。自定义 API 接入:每个 Port = 你的后端需提供的一组能力
4
+ * (经 provider-custom 落地,见应用根 INTEGRATION.md)。
5
5
  */
6
6
  import type { MallScope } from '../scope';
7
7
  import type { RequestContext } from '@tbox.cn/app-contracts';
@@ -26,7 +26,7 @@ export interface ParkingQueryPort {
26
26
  * 缺席 = provider 无入场查询能力(调用方 typeof 守卫,按未入场渲染)——厂商差异留在 provider 包。
27
27
  */
28
28
  probeParkedVehicles?(q: ParkingQueryContext, plateNos: readonly string[]): Promise<readonly ParkingPresence[]>;
29
- /** 计费报价(恒实时打厂商,W4;已支付态命中自动收口 PaymentOperation)。
29
+ /** 计费报价(恒实时打厂商;已支付态命中自动收口 PaymentOperation)。
30
30
  * 指定车牌/vehicleRef/barcode 时返回 ≤1 条;无车辆线索("我的车"语义)扫描绑定车队时返回所有在场有费车辆(≥1 条)。空数组 = 无在场车。 */
31
31
  queryFee(q: ParkingQueryContext, input: {
32
32
  plateNo?: string;
@@ -88,7 +88,7 @@ export interface ParkingPaymentPort {
88
88
  }>;
89
89
  /** step3:客户端结果上报(status 仅上报,不作收口依据;flowId 来自 getPaymentSign) */
90
90
  uploadResult(q: ParkingQueryContext, paymentRef: string, status: 'success' | 'cancel' | 'failure' | 'unavailable', payOrderFlowId?: string): Promise<void>;
91
- /** 权威收口唯一源(F5):厂商侧回查支付态 */
91
+ /** 权威收口唯一源:厂商侧回查支付态 */
92
92
  reconcile(q: ParkingQueryContext, paymentRef: string): Promise<'PAID' | 'PAYING' | 'CANCELLED' | 'UNKNOWN'>;
93
93
  /** 权益重选(reprice):新报价(revision 递增)。detail 透传试算业务字段(部分服务必填) */
94
94
  reprice(q: ParkingQueryContext, quoteRef: string, benefitRefs: readonly string[], detail?: {
@@ -1,8 +1,9 @@
1
1
  /**
2
- * 营销域 Port(015:四 Port 重写,breaking 0.3.0——替换旧单方法 PromotionQueryPort)。
2
+ * 营销域 Port(查询三 Port + 领取写一 Port,按读写边界拆分)——自定义 API 接入:每个
3
+ * Port = 你的后端需提供的一组能力(经 provider-custom 落地,见应用根 INTEGRATION.md)。
3
4
  * 结构类型子集接口——模块完整实现 extends 本接口,消费方仅依赖契约包。
4
- * C 端主体经 ctx.requestContext.credentials(X2);externalMemberRef 由消费方经 member 域
5
- * 状态服务解析('member.status' 判定 + externalMemberRefOf 取值,SubjectBindingPort 已 deprecated)。
5
+ * C 端主体经 ctx.requestContext.credentials;externalMemberRef 由消费方经 member 域
6
+ * 状态服务解析('member.status' 判定 + externalMemberRefOf 取值)。
6
7
  */
7
8
  import type { MallScope } from '../scope';
8
9
  import type { RequestContext } from '@tbox.cn/app-contracts';
@@ -1,5 +1,7 @@
1
1
  /**
2
- * 导购域 Port 接口(011 S7:shopping-guide 6 Port,TIER1 结构类型子集)。
2
+ * 导购域 Port 接口(检索/商户/类目/目录四远程 Port + 本地导航/协助,TIER1 结构类型子集)。
3
+ * 自定义 API 接入:远程四 Port = 你的后端需提供的能力(经 provider-custom 落地);导航/
4
+ * 协助两 Port 模块本地承接,无需后端。
3
5
  * 模块完整实现 extends 本接口;消费方(其他模块)仅依赖契约包。
4
6
  * 领域模型见 domain/shopping-guide.ts。
5
7
  */
@@ -1,10 +1,10 @@
1
1
  /**
2
- * 商圈通用卡片片段(0.3.2 D4:actionDraftSchema 单源——从 shopping-guide/cards.ts 抽出,
2
+ * 商圈通用卡片片段(0.3.2 actionDraftSchema 单源——从 shopping-guide/cards.ts 抽出,
3
3
  * 四域条目动作共用;index.ts 与 runtime.ts 均 re-export 本文件,M2 导出面)。
4
4
  */
5
5
  import { z } from 'zod';
6
6
  /**
7
- * 卡内条目动作草稿(015 F1:判别联合——仅客户端本地语义,write 变体无 token 机制支撑不进)。
7
+ * 卡内条目动作草稿(判别联合——仅客户端本地语义,write 变体无 token 机制支撑不进)。
8
8
  * - send:发消息(value 缺省用 label);link:打开 URL(tel:/https:)。
9
9
  * 渲染端经 card-action-handler 既有通道分发(零新机制);zod 判别联合天然拒未知 kind。
10
10
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
- * 导购域卡片数据契约(011 S7:shopping-guide 11 卡 zod schema,TIER1)。
3
- * 源:POC @tbox/shopping-guide contracts(TypeBox)→ zod 重写(coerce 语义按 D11 字符串化收窄)。
2
+ * 导购域卡片数据契约(shopping-guide 11 卡 zod schema,TIER1)。
3
+ * 源:POC @tbox/shopping-guide contracts(TypeBox)→ zod 重写(coerce 语义按 字符串化收窄)。
4
4
  */
5
5
  import { z } from 'zod';
6
6
  export declare const httpsUrlSchema: z.ZodString;
@@ -216,7 +216,7 @@ export declare const refinementSchema: z.ZodObject<{
216
216
  queryText: string;
217
217
  }>;
218
218
  /**
219
- * 卡内条目动作草稿(0.3.2 D4:单源移至 shared/cards.ts,本处 import + re-export 保既有消费方)。
219
+ * 卡内条目动作草稿(0.3.2 单源移至 shared/cards.ts,本处 import + re-export 保既有消费方)。
220
220
  */
221
221
  import { actionDraftSchema } from '../shared/cards';
222
222
  export { actionDraftSchema };
@@ -2587,7 +2587,7 @@ export declare const categoryListCardDataSchema: z.ZodObject<{
2587
2587
  name: string;
2588
2588
  merchantCount: number;
2589
2589
  }>, "many">>;
2590
- /** 0.3.2 D4:类别条目动作(send 合成话术/外链) */
2590
+ /** 0.3.2 类别条目动作(send 合成话术/外链) */
2591
2591
  itemActions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2592
2592
  kind: z.ZodLiteral<"send">;
2593
2593
  label: z.ZodString;
@@ -3050,7 +3050,7 @@ export declare const productComparisonCardDataSchema: z.ZodObject<{
3050
3050
  imageUrl?: string | undefined;
3051
3051
  brand?: string | undefined;
3052
3052
  }>, "many">;
3053
- /** 0.3.2 D4:刷新截止时间(ISO);到期后渲染端禁用全部条目交互 */
3053
+ /** 0.3.2 刷新截止时间(ISO);到期后渲染端禁用全部条目交互 */
3054
3054
  refreshRequiredAt: z.ZodOptional<z.ZodString>;
3055
3055
  observedAt: z.ZodString;
3056
3056
  }, "strip", z.ZodTypeAny, {
@@ -3149,7 +3149,7 @@ export declare const mallDirectoryCardDataSchema: z.ZodObject<{
3149
3149
  floorName: z.ZodString;
3150
3150
  businessCategories: z.ZodArray<z.ZodString, "many">;
3151
3151
  merchantCount: z.ZodNumber;
3152
- /** 0.3.2 D4:楼层条目动作(send:查看楼层门店) */
3152
+ /** 0.3.2 楼层条目动作(send:查看楼层门店) */
3153
3153
  itemActions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
3154
3154
  kind: z.ZodLiteral<"send">;
3155
3155
  label: z.ZodString;
@@ -3438,7 +3438,7 @@ export declare const customerServiceFaqCardDataSchema: z.ZodObject<{
3438
3438
  answer: z.ZodString;
3439
3439
  category: z.ZodOptional<z.ZodString>;
3440
3440
  relevanceScore: z.ZodNumber;
3441
- /** 0.3.2 D4:答案参考外链(openLink) */
3441
+ /** 0.3.2 答案参考外链(openLink) */
3442
3442
  referenceUrl: z.ZodOptional<z.ZodString>;
3443
3443
  }, "strip", z.ZodTypeAny, {
3444
3444
  question: string;
@@ -5625,7 +5625,7 @@ export declare const shoppingGuideCardDataSchemas: {
5625
5625
  name: string;
5626
5626
  merchantCount: number;
5627
5627
  }>, "many">>;
5628
- /** 0.3.2 D4:类别条目动作(send 合成话术/外链) */
5628
+ /** 0.3.2 类别条目动作(send 合成话术/外链) */
5629
5629
  itemActions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
5630
5630
  kind: z.ZodLiteral<"send">;
5631
5631
  label: z.ZodString;
@@ -6086,7 +6086,7 @@ export declare const shoppingGuideCardDataSchemas: {
6086
6086
  imageUrl?: string | undefined;
6087
6087
  brand?: string | undefined;
6088
6088
  }>, "many">;
6089
- /** 0.3.2 D4:刷新截止时间(ISO);到期后渲染端禁用全部条目交互 */
6089
+ /** 0.3.2 刷新截止时间(ISO);到期后渲染端禁用全部条目交互 */
6090
6090
  refreshRequiredAt: z.ZodOptional<z.ZodString>;
6091
6091
  observedAt: z.ZodString;
6092
6092
  }, "strip", z.ZodTypeAny, {
@@ -6183,7 +6183,7 @@ export declare const shoppingGuideCardDataSchemas: {
6183
6183
  floorName: z.ZodString;
6184
6184
  businessCategories: z.ZodArray<z.ZodString, "many">;
6185
6185
  merchantCount: z.ZodNumber;
6186
- /** 0.3.2 D4:楼层条目动作(send:查看楼层门店) */
6186
+ /** 0.3.2 楼层条目动作(send:查看楼层门店) */
6187
6187
  itemActions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
6188
6188
  kind: z.ZodLiteral<"send">;
6189
6189
  label: z.ZodString;
@@ -6468,7 +6468,7 @@ export declare const shoppingGuideCardDataSchemas: {
6468
6468
  answer: z.ZodString;
6469
6469
  category: z.ZodOptional<z.ZodString>;
6470
6470
  relevanceScore: z.ZodNumber;
6471
- /** 0.3.2 D4:答案参考外链(openLink) */
6471
+ /** 0.3.2 答案参考外链(openLink) */
6472
6472
  referenceUrl: z.ZodOptional<z.ZodString>;
6473
6473
  }, "strip", z.ZodTypeAny, {
6474
6474
  question: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-contracts-mall",
3
- "version": "0.12.4",
3
+ "version": "0.12.5",
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.3",
32
+ "@tbox.cn/app-contracts": "0.12.4",
33
33
  "zod": "3.25.76"
34
34
  },
35
35
  "devDependencies": {