@tbox.cn/app-module-member 0.8.7 → 0.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-module-member",
3
- "version": "0.8.7",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "description": "商圈会员模块:会员账户、会员卡、积分流水与入会流程(codegen 源)。",
6
6
  "exports": {
@@ -18,9 +18,9 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@tbox.cn/app-sdk": "0.19.0",
22
- "@tbox.cn/app-contracts": "0.10.0",
23
- "@tbox.cn/app-contracts-mall": "0.10.0"
21
+ "@tbox.cn/app-sdk": "0.20.0",
22
+ "@tbox.cn/app-contracts": "0.11.0",
23
+ "@tbox.cn/app-contracts-mall": "0.11.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "zod": "3.25.76",
package/tbox.module.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "module-member",
4
+ "title": "会员积分",
5
+ "description": "会员信息与会员卡、积分余额与流水、入会引导(两步授权)",
4
6
  "version": "0.3.0",
5
7
  "kind": "business",
6
8
  "risk": {
@@ -20,7 +20,7 @@ const state = createInMemoryStateStore();
20
20
  const ctxFake = { state } as never;
21
21
  const actions = createMemberActions(ctxFake, async () => member);
22
22
  const reqCtx = (userId = 'u_1'): RequestContext =>
23
- ({ identity: { userId, source: 'dev' }, attributes: { mall: { miniAppId: 'app', mallId: 'mall-1', subjectId: 's1' } } }) as never;
23
+ ({ identity: { userId, source: 'local' }, attributes: { mall: { miniAppId: 'app', mallId: 'mall-1', subjectId: 's1' } } }) as never;
24
24
 
25
25
  describe('入会链:授权 → 预填 → 提交 → 刷新', () => {
26
26
  it('阶段 1:request-alipay-authorization 返回 authorization effect(resultActionId 指向回调动作)', async () => {
@@ -19,7 +19,7 @@ import {
19
19
 
20
20
  function requestContext(mallId = 'mall-demo', token = 'user-token'): RequestContext {
21
21
  return {
22
- identity: { userId: 'u_1001', source: 'dev' },
22
+ identity: { userId: 'u_1001', source: 'local' },
23
23
  credentials: { provider: 'dev', token },
24
24
  attributes: { mall: { miniAppId: 'demo-app', mallId } },
25
25
  };
@@ -7,7 +7,7 @@ function authenticatedContext(userId = 'user-1', mallId = 'mall-1') {
7
7
  const memory = createInMemoryMemoryStore();
8
8
  const ctx = createServerContext({ memory });
9
9
  const reqCtx = {
10
- identity: { userId, source: 'dev' as const },
10
+ identity: { userId, source: 'local' as const },
11
11
  attributes: { mall: { mallId, miniAppId: 'app-1', subjectId: 'subject-1' } },
12
12
  };
13
13
  return { ctx, memory, reqCtx };
@@ -63,7 +63,7 @@ describe('会员偏好长期记忆', () => {
63
63
  'intent',
64
64
  { content: '我常带娃来玩' },
65
65
  disabled,
66
- { identity: { userId: 'user-1', source: 'dev' as const } },
66
+ { identity: { userId: 'user-1', source: 'local' as const } },
67
67
  );
68
68
  expect(disabledResult.text).toContain('暂不可用');
69
69
  });
@@ -53,7 +53,7 @@ function memberPortsOf(getStub: () => Promise<MemberService>): import('../src/se
53
53
 
54
54
  function requestContext(mallId = 'mall-demo', token = 'user-token', provider = 'dev'): RequestContext {
55
55
  return {
56
- identity: { userId: 'u_1001', source: 'dev' },
56
+ identity: { userId: 'u_1001', source: 'local' },
57
57
  credentials: { provider, token },
58
58
  attributes: { mall: { miniAppId: 'demo-app', mallId } },
59
59
  };
@@ -363,7 +363,7 @@ describe('module-member 槽位轴工具链', () => {
363
363
  // 上下文统一化:userId 来自运行身份(reqCtx.identity.userId)不再经 LLM 传参——
364
364
  // 数值形态字符串由 requestContext 的 userId 承载(注入面关闭后该用例锁「字符串不数值化」)
365
365
  const numericCtx = createToolExecContext({
366
- identity: { userId: '17000001019327925', source: 'dev' },
366
+ identity: { userId: '17000001019327925', source: 'local' },
367
367
  attributes: { mall: { miniAppId: 'demo-app', mallId: 'mall-demo' } },
368
368
  });
369
369
  const tool = ctx.tools.resolve('queryMemberInfo') as unknown as { execute(input: unknown, execCtx?: ToolExecContextLike): Promise<Record<string, unknown>> };
@@ -529,7 +529,7 @@ describe('module-member 槽位轴工具链', () => {
529
529
  });
530
530
 
531
531
  describe('createMemberHandler 查询路径门禁(意图与工具路径一致:不再对非 active 态答「积分 0」)', () => {
532
- const handlerReqCtx = (source: 'dev' | 'anonymous' = 'dev'): RequestContext =>
532
+ const handlerReqCtx = (source: 'local' | 'anonymous' = 'local'): RequestContext =>
533
533
  ({
534
534
  identity: { userId: 'u_1001', source },
535
535
  attributes: { mall: { miniAppId: 'demo-app', mallId: 'mall-demo' } },
@@ -28,7 +28,7 @@ import {
28
28
 
29
29
  const makeReqCtx = () =>
30
30
  ({
31
- identity: { userId: 'u_1', source: 'dev' },
31
+ identity: { userId: 'u_1', source: 'local' },
32
32
  conversationId: 'conv_snapshot',
33
33
  attributes: { mall: { miniAppId: 'app', mallId: 'mall-1' } },
34
34
  }) as unknown as RequestContext;
@@ -7,7 +7,7 @@ import type { RequestContext } from '@tbox.cn/app-contracts';
7
7
  import type { ServerContext } from '@tbox.cn/app-sdk/server';
8
8
  import { resolveMemberStatus, MEMBER_QUERY_NOTICES } from '../src/server/status';
9
9
 
10
- const reqCtx = (source: 'dev' | 'anonymous' = 'dev'): RequestContext =>
10
+ const reqCtx = (source: 'local' | 'anonymous' = 'local'): RequestContext =>
11
11
  ({
12
12
  identity: { userId: 'u_1001', source },
13
13
  attributes: { mall: { miniAppId: 'demo-app', mallId: 'mall-demo' } },