@djvlc/openapi-user-client 1.7.13 → 1.7.15

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.
@@ -69,6 +69,12 @@ paths:
69
69
  - cacheTtlSeconds: 缓存 TTL(建议 10~30 秒)
70
70
  - snapshot: 完整快照(仅当 includeSnapshot=1 时返回)
71
71
  parameters:
72
+ - name: X-Trace-Id
73
+ in: header
74
+ required: false
75
+ schema:
76
+ type: string
77
+ description: 链路追踪 ID(OTel,全链路透传)
72
78
  - name: pageId
73
79
  in: query
74
80
  required: true
@@ -155,6 +161,21 @@ paths:
155
161
  - setState: 状态更新(内置)
156
162
  - showToast: 提示消息(内置)
157
163
  - custom: 自定义动作
164
+ parameters:
165
+ - name: Idempotency-Key
166
+ in: header
167
+ required: false
168
+ schema:
169
+ type: string
170
+ minLength: 16
171
+ maxLength: 128
172
+ description: 幂等键(与 body.idempotencyKey 二选一,推荐 header 传递)
173
+ - name: X-Trace-Id
174
+ in: header
175
+ required: false
176
+ schema:
177
+ type: string
178
+ description: 链路追踪 ID(OTel,全链路透传)
158
179
  requestBody:
159
180
  required: true
160
181
  content:
@@ -822,36 +843,103 @@ components:
822
843
  type: string
823
844
  example: uuid-string
824
845
  description: 请求 ID(可选)
846
+ KillSwitchItem:
847
+ type: object
848
+ required:
849
+ - targetType
850
+ - targetId
851
+ - enabled
852
+ description: Kill-Switch 条目
853
+ properties:
854
+ targetType:
855
+ type: string
856
+ enum:
857
+ - action
858
+ - component
859
+ - feature
860
+ - page
861
+ - query
862
+ description: 目标类型
863
+ targetId:
864
+ type: string
865
+ description: 目标 ID(actionType/componentName/featureKey/pageId/queryId)
866
+ enabled:
867
+ type: boolean
868
+ description: 是否启用(true = 被关闭)
869
+ reason:
870
+ type: string
871
+ description: 关闭原因
872
+ enabledAt:
873
+ type: string
874
+ format: date-time
875
+ description: 关闭时间(ISO8601)
876
+ enabledBy:
877
+ type: string
878
+ description: 关闭操作者
879
+ userMessage:
880
+ type: string
881
+ description: 用户提示消息
882
+ BlockedComponentItem:
883
+ type: object
884
+ required:
885
+ - name
886
+ - reason
887
+ description: 被阻断的组件条目
888
+ properties:
889
+ name:
890
+ type: string
891
+ description: 组件名称
892
+ version:
893
+ type: string
894
+ pattern: ^\d+\.\d+\.\d+$
895
+ description: 组件版本(可选,不指定则阻断所有版本)
896
+ reason:
897
+ type: string
898
+ description: 阻断原因
899
+ blockedAt:
900
+ type: string
901
+ format: date-time
902
+ description: 阻断时间(ISO8601)
903
+ blockedBy:
904
+ type: string
905
+ description: 阻断操作者
906
+ fallbackVersion:
907
+ type: string
908
+ pattern: ^\d+\.\d+\.\d+$
909
+ description: 降级版本(可选)
910
+ urgent:
911
+ type: boolean
912
+ description: 是否紧急阻断
825
913
  OpsConfig:
826
914
  type: object
827
- description: 运维配置(运行时下发)
915
+ description: 运维配置(运行时下发,与 types/page/snapshot.ts OpsConfig 对齐)
828
916
  required:
829
917
  - killSwitch
830
918
  - blockedComponents
831
919
  - flags
832
920
  properties:
921
+ configVersionId:
922
+ type: string
923
+ description: 配置版本 ID(用于缓存失效)
833
924
  killSwitch:
834
925
  type: array
835
926
  items:
836
- type: string
837
- description: Kill Switch 列表(被阻断的 actionType/componentType)
927
+ $ref: '#/components/schemas/KillSwitchItem'
928
+ description: Kill-Switch 列表(被紧急关闭的功能/动作)
838
929
  blockedComponents:
839
930
  type: array
840
931
  items:
841
- type: object
842
- properties:
843
- componentName:
844
- type: string
845
- componentVersion:
846
- type: string
847
- reason:
848
- type: string
932
+ $ref: '#/components/schemas/BlockedComponentItem'
849
933
  description: 被阻断的组件列表
850
934
  flags:
851
935
  type: object
852
936
  additionalProperties:
853
937
  type: boolean
854
938
  description: 功能开关(Feature Flags)
939
+ expiresAt:
940
+ type: string
941
+ format: date-time
942
+ description: 配置过期时间(ISO8601)
855
943
  ResolvePageResponse:
856
944
  allOf:
857
945
  - $ref: '#/components/schemas/SuccessResponse'
@@ -899,6 +987,13 @@ components:
899
987
  maximum: 300
900
988
  default: 30
901
989
  description: 缓存 TTL(秒),建议 10~30 秒
990
+ traceId:
991
+ type: string
992
+ description: 链路追踪 ID(全链路透传,与 types 可观测原则一致)
993
+ runtimeVersion:
994
+ type: string
995
+ pattern: ^\d+\.\d+\.\d+$
996
+ description: 运行时版本(SemVer,与 manifest.runtime.version 一致)
902
997
  rolloutMatch:
903
998
  type: object
904
999
  description: 灰度匹配信息(可选,用于调试)
@@ -1076,7 +1171,7 @@ components:
1076
1171
  data:
1077
1172
  type: object
1078
1173
  additionalProperties: true
1079
- description: 错误详情(验证错误时使用 ApiErrorDetail[],其他情况使用 unknown,放在 data 字段中)
1174
+ description: 错误详情(Record<string, unknown>,与 types ApiErrorResponse.data 一致)
1080
1175
  timestamp:
1081
1176
  type: integer
1082
1177
  format: int64
@@ -1094,7 +1189,7 @@ components:
1094
1189
  type: string
1095
1190
  example: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
1096
1191
  description: 链路追踪 ID(可选,用于分布式追踪)
1097
- ActionContext:
1192
+ ActionClientContext:
1098
1193
  type: object
1099
1194
  description: 动作执行上下文(ActionClientContext,问题追溯必须字段)
1100
1195
  required:
@@ -1160,7 +1255,7 @@ components:
1160
1255
  additionalProperties: true
1161
1256
  description: 动作参数(Record<string, JsonValue>)
1162
1257
  context:
1163
- $ref: '#/components/schemas/ActionContext'
1258
+ $ref: '#/components/schemas/ActionClientContext'
1164
1259
  description: 客户端上下文(ActionClientContext,必填)
1165
1260
  idempotencyKey:
1166
1261
  type: string
@@ -1230,6 +1325,19 @@ components:
1230
1325
  retryAfter:
1231
1326
  type: integer
1232
1327
  description: 建议重试延迟(毫秒)
1328
+ riskDecision:
1329
+ type: object
1330
+ description: 风控决策(可选,风控拒绝时返回)
1331
+ properties:
1332
+ allowed:
1333
+ type: boolean
1334
+ description: 是否放行
1335
+ reason:
1336
+ type: string
1337
+ description: 拒绝原因(如 RISK_BLOCKED)
1338
+ code:
1339
+ type: string
1340
+ description: 风控错误码
1233
1341
  IdempotencyConflictResponse:
1234
1342
  type: object
1235
1343
  required:
@@ -1757,15 +1865,18 @@ components:
1757
1865
  type: object
1758
1866
  required:
1759
1867
  - page
1760
- - limit
1868
+ - pageSize
1761
1869
  - total
1762
1870
  - totalPages
1871
+ - hasNext
1872
+ - hasPrev
1873
+ description: 分页元数据(PaginationMeta)
1763
1874
  properties:
1764
1875
  page:
1765
1876
  type: integer
1766
1877
  minimum: 1
1767
1878
  description: 当前页码
1768
- limit:
1879
+ pageSize:
1769
1880
  type: integer
1770
1881
  minimum: 1
1771
1882
  maximum: 100
@@ -1778,6 +1889,12 @@ components:
1778
1889
  type: integer
1779
1890
  minimum: 0
1780
1891
  description: 总页数
1892
+ hasNext:
1893
+ type: boolean
1894
+ description: 是否有下一页
1895
+ hasPrev:
1896
+ type: boolean
1897
+ description: 是否有上一页
1781
1898
  LotteryRecordInfo:
1782
1899
  type: object
1783
1900
  required:
@@ -2069,21 +2186,6 @@ components:
2069
2186
  cacheTtl:
2070
2187
  type: integer
2071
2188
  description: 缓存 TTL(秒)
2072
- ErrorDetail:
2073
- type: object
2074
- required:
2075
- - message
2076
- description: 错误详情(ApiErrorDetail,与 types/src/common/api.ts 保持一致)
2077
- properties:
2078
- field:
2079
- type: string
2080
- description: 字段路径(可选)
2081
- message:
2082
- type: string
2083
- description: 错误消息(必填)
2084
- code:
2085
- type: string
2086
- description: 错误码(可选)
2087
2189
  PageResponse:
2088
2190
  allOf:
2089
2191
  - $ref: '#/components/schemas/SuccessResponse'
@@ -2144,9 +2246,9 @@ components:
2144
2246
  code: VALIDATION_INVALID_PARAMS
2145
2247
  message: 请求参数无效
2146
2248
  data:
2147
- - field: pageId
2148
- message: 页面 ID 不能为空
2149
- code: REQUIRED
2249
+ field: pageId
2250
+ message: 页面 ID 不能为空
2251
+ code: REQUIRED
2150
2252
  timestamp: 1702300000000
2151
2253
  path: /api/user/pages/resolve
2152
2254
  requestId: uuid-string
@@ -11,9 +11,9 @@ BadRequest:
11
11
  code: VALIDATION_INVALID_PARAMS
12
12
  message: 请求参数无效
13
13
  data:
14
- - field: pageId
15
- message: 页面 ID 不能为空
16
- code: REQUIRED
14
+ field: pageId
15
+ message: 页面 ID 不能为空
16
+ code: REQUIRED
17
17
  timestamp: 1702300000000
18
18
  path: /api/user/pages/resolve
19
19
  requestId: uuid-string
@@ -63,7 +63,7 @@ ErrorResponse:
63
63
  data:
64
64
  type: object
65
65
  additionalProperties: true
66
- description: 错误详情(验证错误时使用 ApiErrorDetail[],其他情况使用 unknown,放在 data 字段中)
66
+ description: 错误详情(Record<string, unknown>,与 types ApiErrorResponse.data 一致)
67
67
  timestamp:
68
68
  type: integer
69
69
  format: int64
@@ -82,21 +82,6 @@ ErrorResponse:
82
82
  example: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
83
83
  description: 链路追踪 ID(可选,用于分布式追踪)
84
84
 
85
- ErrorDetail:
86
- type: object
87
- required: [message]
88
- description: 错误详情(ApiErrorDetail,与 types/src/common/api.ts 保持一致)
89
- properties:
90
- field:
91
- type: string
92
- description: 字段路径(可选)
93
- message:
94
- type: string
95
- description: 错误消息(必填)
96
- code:
97
- type: string
98
- description: 错误码(可选)
99
-
100
85
  # ============================================================================
101
86
  # 页面相关
102
87
  # ============================================================================
@@ -168,6 +153,13 @@ ResolvePageResponse:
168
153
  maximum: 300
169
154
  default: 30
170
155
  description: 缓存 TTL(秒),建议 10~30 秒
156
+ traceId:
157
+ type: string
158
+ description: 链路追踪 ID(全链路透传,与 types 可观测原则一致)
159
+ runtimeVersion:
160
+ type: string
161
+ pattern: '^\d+\.\d+\.\d+$'
162
+ description: 运行时版本(SemVer,与 manifest.runtime.version 一致)
171
163
  rolloutMatch:
172
164
  type: object
173
165
  description: 灰度匹配信息(可选,用于调试)
@@ -395,33 +387,94 @@ QueryManifest:
395
387
  type: integer
396
388
  description: 缓存 TTL(秒)
397
389
 
390
+ # 与 types/page/snapshot.ts KillSwitchItem 对齐
391
+ KillSwitchItem:
392
+ type: object
393
+ required: [targetType, targetId, enabled]
394
+ description: Kill-Switch 条目
395
+ properties:
396
+ targetType:
397
+ type: string
398
+ enum: [action, component, feature, page, query]
399
+ description: 目标类型
400
+ targetId:
401
+ type: string
402
+ description: 目标 ID(actionType/componentName/featureKey/pageId/queryId)
403
+ enabled:
404
+ type: boolean
405
+ description: 是否启用(true = 被关闭)
406
+ reason:
407
+ type: string
408
+ description: 关闭原因
409
+ enabledAt:
410
+ type: string
411
+ format: date-time
412
+ description: 关闭时间(ISO8601)
413
+ enabledBy:
414
+ type: string
415
+ description: 关闭操作者
416
+ userMessage:
417
+ type: string
418
+ description: 用户提示消息
419
+
420
+ # 与 types/page/snapshot.ts BlockedComponentItem 对齐
421
+ BlockedComponentItem:
422
+ type: object
423
+ required: [name, reason]
424
+ description: 被阻断的组件条目
425
+ properties:
426
+ name:
427
+ type: string
428
+ description: 组件名称
429
+ version:
430
+ type: string
431
+ pattern: '^\d+\.\d+\.\d+$'
432
+ description: 组件版本(可选,不指定则阻断所有版本)
433
+ reason:
434
+ type: string
435
+ description: 阻断原因
436
+ blockedAt:
437
+ type: string
438
+ format: date-time
439
+ description: 阻断时间(ISO8601)
440
+ blockedBy:
441
+ type: string
442
+ description: 阻断操作者
443
+ fallbackVersion:
444
+ type: string
445
+ pattern: '^\d+\.\d+\.\d+$'
446
+ description: 降级版本(可选)
447
+ urgent:
448
+ type: boolean
449
+ description: 是否紧急阻断
450
+
398
451
  OpsConfig:
399
452
  type: object
400
- description: 运维配置(运行时下发)
453
+ description: 运维配置(运行时下发,与 types/page/snapshot.ts OpsConfig 对齐)
401
454
  required: [killSwitch, blockedComponents, flags]
402
455
  properties:
456
+ configVersionId:
457
+ type: string
458
+ description: 配置版本 ID(用于缓存失效)
403
459
  killSwitch:
404
460
  type: array
405
461
  items:
406
- type: string
407
- description: Kill Switch 列表(被阻断的 actionType/componentType)
462
+ $ref: '#/KillSwitchItem'
463
+ description: Kill-Switch 列表(被紧急关闭的功能/动作)
408
464
  blockedComponents:
409
465
  type: array
410
466
  items:
411
- type: object
412
- properties:
413
- componentName:
414
- type: string
415
- componentVersion:
416
- type: string
417
- reason:
418
- type: string
467
+ $ref: '#/BlockedComponentItem'
419
468
  description: 被阻断的组件列表
420
469
  flags:
421
470
  type: object
422
471
  additionalProperties:
423
472
  type: boolean
424
473
  description: 功能开关(Feature Flags)
474
+ expiresAt:
475
+ type: string
476
+ format: date-time
477
+ description: 配置过期时间(ISO8601)
425
478
 
426
479
  # ============================================================================
427
480
  # Action Gateway 动作相关
@@ -444,7 +497,7 @@ ExecuteActionRequest:
444
497
  additionalProperties: true
445
498
  description: 动作参数(Record<string, JsonValue>)
446
499
  context:
447
- $ref: '#/ActionContext'
500
+ $ref: '#/ActionClientContext'
448
501
  description: 客户端上下文(ActionClientContext,必填)
449
502
  idempotencyKey:
450
503
  type: string
@@ -452,7 +505,7 @@ ExecuteActionRequest:
452
505
  maxLength: 128
453
506
  description: 幂等键(部分策略需要客户端提供,防重复提交)
454
507
 
455
- ActionContext:
508
+ ActionClientContext:
456
509
  type: object
457
510
  description: 动作执行上下文(ActionClientContext,问题追溯必须字段)
458
511
  required: [pageVersionId]
@@ -527,6 +580,19 @@ ExecuteActionResponse:
527
580
  retryAfter:
528
581
  type: integer
529
582
  description: 建议重试延迟(毫秒)
583
+ riskDecision:
584
+ type: object
585
+ description: 风控决策(可选,风控拒绝时返回)
586
+ properties:
587
+ allowed:
588
+ type: boolean
589
+ description: 是否放行
590
+ reason:
591
+ type: string
592
+ description: 拒绝原因(如 RISK_BLOCKED)
593
+ code:
594
+ type: string
595
+ description: 风控错误码
530
596
 
531
597
  ActionEffect:
532
598
  type: object
@@ -781,15 +847,17 @@ BatchQueryResponse:
781
847
  # 通用分页
782
848
  # ============================================================================
783
849
 
850
+ # 与 types/src/common/api.ts PaginationMeta 严格一致
784
851
  PaginationMeta:
785
852
  type: object
786
- required: [page, limit, total, totalPages]
853
+ required: [page, pageSize, total, totalPages, hasNext, hasPrev]
854
+ description: 分页元数据(PaginationMeta)
787
855
  properties:
788
856
  page:
789
857
  type: integer
790
858
  minimum: 1
791
859
  description: 当前页码
792
- limit:
860
+ pageSize:
793
861
  type: integer
794
862
  minimum: 1
795
863
  maximum: 100
@@ -802,6 +870,12 @@ PaginationMeta:
802
870
  type: integer
803
871
  minimum: 0
804
872
  description: 总页数
873
+ hasNext:
874
+ type: boolean
875
+ description: 是否有下一页
876
+ hasPrev:
877
+ type: boolean
878
+ description: 是否有上一页
805
879
 
806
880
  # ============================================================================
807
881
  # Tenant 租户相关
@@ -30,6 +30,21 @@ execute:
30
30
  - setState: 状态更新(内置)
31
31
  - showToast: 提示消息(内置)
32
32
  - custom: 自定义动作
33
+ parameters:
34
+ - name: Idempotency-Key
35
+ in: header
36
+ required: false
37
+ schema:
38
+ type: string
39
+ minLength: 16
40
+ maxLength: 128
41
+ description: 幂等键(与 body.idempotencyKey 二选一,推荐 header 传递)
42
+ - name: X-Trace-Id
43
+ in: header
44
+ required: false
45
+ schema:
46
+ type: string
47
+ description: 链路追踪 ID(OTel,全链路透传)
33
48
  requestBody:
34
49
  required: true
35
50
  content:
@@ -22,6 +22,12 @@ resolve:
22
22
  - cacheTtlSeconds: 缓存 TTL(建议 10~30 秒)
23
23
  - snapshot: 完整快照(仅当 includeSnapshot=1 时返回)
24
24
  parameters:
25
+ - name: X-Trace-Id
26
+ in: header
27
+ required: false
28
+ schema:
29
+ type: string
30
+ description: 链路追踪 ID(OTel,全链路透传)
25
31
  - name: pageId
26
32
  in: query
27
33
  required: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djvlc/openapi-user-client",
3
- "version": "1.7.13",
3
+ "version": "1.7.15",
4
4
  "description": "DJV Low-code Platform - User API 客户端(自动生成)",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -25,7 +25,7 @@
25
25
  "typecheck": "tsc --noEmit"
26
26
  },
27
27
  "dependencies": {
28
- "@djvlc/openapi-client-core": "1.2.11"
28
+ "@djvlc/openapi-client-core": "1.2.12"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^20.0.0",