@tbox.cn/app-contracts 0.12.4 → 0.13.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.
@@ -98,8 +98,12 @@ export declare const AUTH_ERROR_CODES: {
98
98
  readonly BROWSER_LOGIN_DISABLED: "AUTH_BROWSER_LOGIN_DISABLED";
99
99
  /** 502:外部 provider 错误 */
100
100
  readonly EXTERNAL_ERROR: "AUTH_EXTERNAL_ERROR";
101
- /** 503:密钥链缺失(prod fail-fast)/ 登录槽配置缺失(显式 mock 档无物料) */
101
+ /** 503:密钥链缺失(prod fail-fast 启动拒绝——启动期语义;登录路由不再产出本码) */
102
102
  readonly MISSING_SECRET: "AUTH_MISSING_SECRET";
103
+ /** 503:登录链配置缺失(换码 env/实例/物料)——修复动作 = 补配置 */
104
+ readonly NOT_CONFIGURED: "AUTH_NOT_CONFIGURED";
105
+ /** 503:登录域选择缺失(未选择商场且无默认商圈)——修复动作 = 入口带 mallId / 配 defaultInstanceId */
106
+ readonly SCOPE_REQUIRED: "AUTH_SCOPE_REQUIRED";
103
107
  };
104
108
  export type AuthErrorCode = (typeof AUTH_ERROR_CODES)[keyof typeof AUTH_ERROR_CODES];
105
109
  /** 错误码 → HTTP 状态(客户端行为映射:401 重登录 / 403 提示 / 502 重试 / 503 配置) */
package/dist/runtime.js CHANGED
@@ -20,8 +20,12 @@ var AUTH_ERROR_CODES = {
20
20
  BROWSER_LOGIN_DISABLED: "AUTH_BROWSER_LOGIN_DISABLED",
21
21
  /** 502:外部 provider 错误 */
22
22
  EXTERNAL_ERROR: "AUTH_EXTERNAL_ERROR",
23
- /** 503:密钥链缺失(prod fail-fast)/ 登录槽配置缺失(显式 mock 档无物料) */
24
- MISSING_SECRET: "AUTH_MISSING_SECRET"
23
+ /** 503:密钥链缺失(prod fail-fast 启动拒绝——启动期语义;登录路由不再产出本码) */
24
+ MISSING_SECRET: "AUTH_MISSING_SECRET",
25
+ /** 503:登录链配置缺失(换码 env/实例/物料)——修复动作 = 补配置 */
26
+ NOT_CONFIGURED: "AUTH_NOT_CONFIGURED",
27
+ /** 503:登录域选择缺失(未选择商场且无默认商圈)——修复动作 = 入口带 mallId / 配 defaultInstanceId */
28
+ SCOPE_REQUIRED: "AUTH_SCOPE_REQUIRED"
25
29
  };
26
30
  function authCodeToStatus(code) {
27
31
  switch (code) {
@@ -36,6 +40,8 @@ function authCodeToStatus(code) {
36
40
  case AUTH_ERROR_CODES.EXTERNAL_ERROR:
37
41
  return 502;
38
42
  case AUTH_ERROR_CODES.MISSING_SECRET:
43
+ case AUTH_ERROR_CODES.NOT_CONFIGURED:
44
+ case AUTH_ERROR_CODES.SCOPE_REQUIRED:
39
45
  return 503;
40
46
  default:
41
47
  return 401;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-contracts",
3
- "version": "0.12.4",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "description": "平台契约(TIER0,types-only 为主 + 协议常量运行时值):卡片协议 / SDK adapter / 平台 DTO。",
6
6
  "exports": {