@djvlc/openapi-user-client 1.7.0 → 1.7.2

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.
@@ -1,14 +1,23 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
3
  title: DJVLC User API
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  description: |
6
- DJVLC 低代码平台用户端 API
6
+ DJVLC 低代码平台用户端 API(数据面)
7
7
 
8
8
  提供以下功能:
9
- - 页面获取(解析页面 Schema
10
- - 动作执行(调用业务逻辑)
11
- - 数据查询(获取数据源)
9
+ - 页面解析(Page Resolve
10
+ - 动作执行(Action Gateway - 统一入口)
11
+ - 数据查询(Data Proxy - 统一入口)
12
+ - 活动状态查询
13
+ - 埋点上报(Track)
14
+ - 租户解析(Tenant Resolver)
15
+ - 健康检查(Health)
16
+
17
+ 核心原则:
18
+ - 所有业务动作只走 Action Gateway(鉴权/风控/幂等/审计/签名)
19
+ - 所有数据访问只走 Data Proxy(白名单/裁剪/脱敏/缓存)
20
+ - 全链路可追溯:pageVersionId + componentVersionId + actionId + traceId
12
21
  contact:
13
22
  name: DJVLC Team
14
23
  email: dev@djvlc.com
@@ -23,15 +32,19 @@ security:
23
32
  - ApiKey: []
24
33
  tags:
25
34
  - name: Pages
26
- description: 页面获取
35
+ description: 页面解析(Page Resolve)
27
36
  - name: Actions
28
- description: 动作执行
37
+ description: 动作执行(Action Gateway)
29
38
  - name: Queries
30
- description: 数据查询
39
+ description: 数据查询(Data Proxy)
31
40
  - name: Activities
32
- description: 活动状态
41
+ description: 活动状态查询
33
42
  - name: Track
34
43
  description: 埋点上报
44
+ - name: Tenant
45
+ description: 租户解析
46
+ - name: Health
47
+ description: 健康检查
35
48
  paths:
36
49
  /pages/{pageId}:
37
50
  get:
@@ -59,9 +72,9 @@ paths:
59
72
  application/json:
60
73
  schema:
61
74
  type: object
62
- required: &ref_12
75
+ required: &ref_16
63
76
  - data
64
- properties: &ref_13
77
+ properties: &ref_17
65
78
  data:
66
79
  type: object
67
80
  required:
@@ -113,6 +126,9 @@ paths:
113
126
  message:
114
127
  type: string
115
128
  description: 错误详情
129
+ traceId:
130
+ type: string
131
+ description: 追踪 ID
116
132
  example:
117
133
  code: NOT_FOUND
118
134
  message: 资源不存在
@@ -154,17 +170,20 @@ paths:
154
170
  application/json:
155
171
  schema:
156
172
  type: object
157
- properties: &ref_14
173
+ properties: &ref_19
158
174
  context:
159
175
  type: object
160
176
  description: 页面解析上下文
161
- properties: &ref_5
177
+ properties: &ref_18
162
178
  userId:
163
179
  type: string
164
180
  description: 用户 ID
165
181
  sessionId:
166
182
  type: string
167
183
  description: 会话 ID
184
+ deviceId:
185
+ type: string
186
+ description: 设备 ID
168
187
  deviceType:
169
188
  type: string
170
189
  enum:
@@ -172,6 +191,9 @@ paths:
172
191
  - tablet
173
192
  - desktop
174
193
  description: 设备类型
194
+ channel:
195
+ type: string
196
+ description: 渠道标识
175
197
  urlParams:
176
198
  type: object
177
199
  additionalProperties:
@@ -207,37 +229,40 @@ paths:
207
229
  application/json:
208
230
  schema:
209
231
  type: object
210
- required: &ref_22
232
+ required: &ref_28
211
233
  - data
212
- properties: &ref_23
234
+ properties: &ref_29
213
235
  data:
214
236
  type: object
215
237
  required:
216
238
  - pageId
217
- - version
239
+ - pageVersionId
218
240
  - schema
219
241
  properties:
220
242
  pageId:
221
243
  type: string
222
244
  description: 页面 ID
223
- version:
245
+ pageVersionId:
224
246
  type: string
225
- description: 页面版本
247
+ description: 页面版本 ID(不可变)
248
+ schemaVersion:
249
+ type: string
250
+ description: Schema 版本
226
251
  schema:
227
252
  type: object
228
253
  description: 解析后的页面 Schema
229
254
  manifests:
230
255
  type: object
231
- properties: &ref_21
256
+ properties: &ref_26
232
257
  components:
233
258
  type: array
234
259
  items:
235
260
  type: object
236
- required: &ref_15
261
+ required: &ref_20
237
262
  - componentType
238
263
  - version
239
264
  - entryUrl
240
- properties: &ref_16
265
+ properties: &ref_21
241
266
  componentType:
242
267
  type: string
243
268
  description: 组件类型
@@ -248,45 +273,70 @@ paths:
248
273
  type: string
249
274
  format: uri
250
275
  description: 组件入口 URL
276
+ styleUrl:
277
+ type: string
278
+ format: uri
279
+ description: 样式文件 URL
251
280
  integrity:
252
281
  type: string
253
- description: 完整性哈希
282
+ description: SRI 完整性哈希
283
+ blocked:
284
+ type: boolean
285
+ description: 是否被阻断
286
+ fallback:
287
+ type: string
288
+ description: 降级组件类型
254
289
  description: 组件资源清单
255
290
  actions:
256
291
  type: array
257
292
  items:
258
293
  type: object
259
- required: &ref_17
294
+ required: &ref_22
260
295
  - actionId
261
- - version
262
- properties: &ref_18
296
+ - actionDefinitionVersionId
297
+ properties: &ref_23
263
298
  actionId:
264
299
  type: string
265
300
  description: 动作 ID
266
- version:
301
+ actionDefinitionVersionId:
267
302
  type: string
268
- description: 动作版本
269
- type:
303
+ description: 动作定义版本 ID
304
+ actionType:
270
305
  type: string
271
306
  enum:
272
- - builtin
307
+ - claim
308
+ - signin
309
+ - lottery
310
+ - reserve
311
+ - bind
312
+ - task_complete
313
+ - vote
314
+ - share
315
+ - form_submit
316
+ - navigate
317
+ - setState
318
+ - showToast
319
+ - refreshData
273
320
  - custom
274
321
  description: 动作类型
322
+ builtin:
323
+ type: boolean
324
+ description: 是否内置动作
275
325
  description: 动作资源清单
276
326
  queries:
277
327
  type: array
278
328
  items:
279
329
  type: object
280
- required: &ref_19
330
+ required: &ref_24
281
331
  - queryId
282
- - version
283
- properties: &ref_20
332
+ - queryVersionId
333
+ properties: &ref_25
284
334
  queryId:
285
335
  type: string
286
336
  description: 查询 ID
287
- version:
337
+ queryVersionId:
288
338
  type: string
289
- description: 查询版本
339
+ description: 查询定义版本 ID
290
340
  cacheTtl:
291
341
  type: integer
292
342
  description: 缓存 TTL(秒)
@@ -295,6 +345,22 @@ paths:
295
345
  type: object
296
346
  additionalProperties: true
297
347
  description: 预取的数据
348
+ opsConfig:
349
+ type: object
350
+ description: 运维配置
351
+ properties: &ref_27
352
+ killSwitch:
353
+ type: boolean
354
+ description: Kill Switch 是否启用
355
+ fallbackUrl:
356
+ type: string
357
+ format: uri
358
+ description: 降级跳转 URL
359
+ blockedComponents:
360
+ type: array
361
+ items:
362
+ type: string
363
+ description: 被阻断的组件列表
298
364
  '400':
299
365
  description: 请求参数错误
300
366
  content: &ref_4
@@ -312,55 +378,118 @@ paths:
312
378
  '503':
313
379
  description: 服务不可用
314
380
  content: *ref_3
315
- /actions/{actionId}/execute:
381
+ /actions/execute:
316
382
  post:
317
383
  tags:
318
384
  - Actions
319
385
  operationId: executeAction
320
- summary: 执行动作
386
+ summary: 执行动作(统一入口)
321
387
  description: |
322
- 执行指定的动作,返回执行结果。
388
+ Action Gateway 唯一入口,所有业务动作都通过此接口执行。
323
389
 
324
- 支持:
325
- - 自定义动作(通过 actionDefinitionVersionId)
326
- - 内置动作(setState, navigate, etc.)
327
- parameters:
328
- - name: actionId
329
- in: path
330
- required: true
331
- schema:
332
- type: string
333
- description: 动作 ID 或动作定义版本 ID
390
+ 执行流程(Pipeline):
391
+ 1. Auth(登录态/票据/签名)
392
+ 2. Risk(限流、黑名单、设备指纹、验证码开关)
393
+ 3. Idempotency(幂等键检查)
394
+ 4. Execute(执行器:Claim/Signin/Lottery...)
395
+ 5. Audit(审计落库 + outbox)
396
+ 6. Normalize(统一错误码/返回)
397
+
398
+ 支持的动作类型:
399
+ - claim: 领取
400
+ - signin: 签到
401
+ - lottery: 抽奖
402
+ - reserve: 预约
403
+ - bind: 绑定
404
+ - task_complete: 任务完成
405
+ - vote: 投票
406
+ - share: 分享
407
+ - form_submit: 表单提交
408
+ - navigate: 页面跳转(内置)
409
+ - setState: 状态更新(内置)
410
+ - showToast: 提示消息(内置)
411
+ - custom: 自定义动作
334
412
  requestBody:
335
413
  required: true
336
414
  content:
337
415
  application/json:
338
416
  schema:
339
417
  type: object
340
- required: &ref_25
418
+ required: &ref_32
419
+ - actionType
341
420
  - params
342
- properties: &ref_26
421
+ properties: &ref_33
422
+ actionType:
423
+ type: string
424
+ enum:
425
+ - claim
426
+ - signin
427
+ - lottery
428
+ - reserve
429
+ - bind
430
+ - task_complete
431
+ - vote
432
+ - share
433
+ - form_submit
434
+ - navigate
435
+ - setState
436
+ - showToast
437
+ - refreshData
438
+ - custom
439
+ description: 动作类型
440
+ actionDefinitionVersionId:
441
+ type: string
442
+ description: 动作定义版本 ID(custom 类型必填)
343
443
  params:
344
444
  type: object
345
445
  additionalProperties: true
346
446
  description: 动作参数
347
447
  context:
348
448
  type: object
349
- description: 动作执行上下文
350
- properties: &ref_24
351
- pageId:
449
+ description: 动作执行上下文(问题追溯必须字段)
450
+ required: &ref_30
451
+ - pageVersionId
452
+ properties: &ref_31
453
+ pageVersionId:
454
+ type: string
455
+ description: 页面版本 ID(不可变)
456
+ componentVersionId:
457
+ type: string
458
+ description: 触发组件版本 ID
459
+ actionId:
460
+ type: string
461
+ description: 动作实例 ID
462
+ traceId:
463
+ type: string
464
+ description: 分布式追踪 ID(OTel)
465
+ uid:
352
466
  type: string
353
- description: 页面 ID
354
- componentId:
467
+ description: 用户 ID
468
+ deviceId:
469
+ type: string
470
+ description: 设备 ID
471
+ channel:
472
+ type: string
473
+ description: 渠道标识
474
+ sessionId:
355
475
  type: string
356
- description: 触发组件 ID
476
+ description: 会话 ID
357
477
  eventName:
358
478
  type: string
359
479
  description: 触发事件名
480
+ timestamp:
481
+ type: string
482
+ format: date-time
483
+ description: 触发时间
360
484
  state:
361
485
  type: object
362
486
  additionalProperties: true
363
487
  description: 当前页面状态
488
+ idempotencyKey:
489
+ type: string
490
+ minLength: 16
491
+ maxLength: 128
492
+ description: 幂等键(防重复提交)
364
493
  options:
365
494
  type: object
366
495
  properties:
@@ -370,9 +499,10 @@ paths:
370
499
  maximum: 30000
371
500
  default: 10000
372
501
  description: 执行超时(毫秒)
373
- idempotencyKey:
374
- type: string
375
- description: 幂等键
502
+ skipRisk:
503
+ type: boolean
504
+ default: false
505
+ description: 是否跳过风控(需特殊权限)
376
506
  responses:
377
507
  '200':
378
508
  description: 执行成功
@@ -380,24 +510,28 @@ paths:
380
510
  application/json:
381
511
  schema:
382
512
  type: object
383
- required: &ref_29
513
+ required: &ref_36
514
+ - success
384
515
  - data
385
- properties: &ref_30
516
+ properties: &ref_37
517
+ success:
518
+ type: boolean
519
+ description: 是否成功
386
520
  data:
387
521
  type: object
388
522
  properties:
389
- success:
390
- type: boolean
391
- description: 是否成功
523
+ actionId:
524
+ type: string
525
+ description: 动作执行 ID
392
526
  result:
393
527
  description: 执行结果
394
528
  effects:
395
529
  type: array
396
530
  items:
397
531
  type: object
398
- required: &ref_27
532
+ required: &ref_34
399
533
  - type
400
- properties: &ref_28
534
+ properties: &ref_35
401
535
  type:
402
536
  type: string
403
537
  enum:
@@ -405,6 +539,8 @@ paths:
405
539
  - navigate
406
540
  - showToast
407
541
  - refreshData
542
+ - openDialog
543
+ - closeDialog
408
544
  - custom
409
545
  description: 副作用类型
410
546
  payload:
@@ -412,15 +548,74 @@ paths:
412
548
  additionalProperties: true
413
549
  description: 副作用参数
414
550
  description: 副作用列表
551
+ meta:
552
+ type: object
553
+ properties:
554
+ executionTime:
555
+ type: integer
556
+ description: 执行时间(毫秒)
557
+ traceId:
558
+ type: string
559
+ description: 追踪 ID
560
+ idempotent:
561
+ type: boolean
562
+ description: 是否幂等命中
415
563
  '400':
416
564
  description: 请求参数错误
417
565
  content: *ref_4
418
- '404':
419
- description: 资源不存在
420
- content: *ref_2
566
+ '401':
567
+ description: 未认证
568
+ content: &ref_5
569
+ application/json:
570
+ schema:
571
+ type: object
572
+ required: *ref_0
573
+ properties: *ref_1
574
+ example:
575
+ code: UNAUTHORIZED
576
+ message: 请先登录
577
+ '403':
578
+ description: 无权限
579
+ content: &ref_6
580
+ application/json:
581
+ schema:
582
+ type: object
583
+ required: *ref_0
584
+ properties: *ref_1
585
+ example:
586
+ code: FORBIDDEN
587
+ message: 无访问权限
588
+ '409':
589
+ description: 幂等冲突(重复请求)
590
+ content:
591
+ application/json:
592
+ schema:
593
+ type: object
594
+ required: &ref_38
595
+ - success
596
+ - data
597
+ properties: &ref_39
598
+ success:
599
+ type: boolean
600
+ example: true
601
+ data:
602
+ type: object
603
+ properties:
604
+ idempotent:
605
+ type: boolean
606
+ example: true
607
+ originalActionId:
608
+ type: string
609
+ description: 原始动作执行 ID
610
+ originalResult:
611
+ description: 原始执行结果
612
+ originalExecutedAt:
613
+ type: string
614
+ format: date-time
615
+ description: 原始执行时间
421
616
  '422':
422
617
  description: 请求无法处理
423
- content: &ref_6
618
+ content: &ref_7
424
619
  application/json:
425
620
  schema:
426
621
  type: object
@@ -429,9 +624,20 @@ paths:
429
624
  example:
430
625
  code: UNPROCESSABLE_ENTITY
431
626
  message: 参数验证失败
627
+ '429':
628
+ description: 请求过于频繁
629
+ content: &ref_71
630
+ application/json:
631
+ schema:
632
+ type: object
633
+ required: *ref_0
634
+ properties: *ref_1
635
+ example:
636
+ code: TOO_MANY_REQUESTS
637
+ message: 请求过于频繁,请稍后再试
432
638
  '500':
433
639
  description: 服务器内部错误
434
- content: &ref_7
640
+ content: &ref_8
435
641
  application/json:
436
642
  schema:
437
643
  type: object
@@ -440,29 +646,31 @@ paths:
440
646
  example:
441
647
  code: INTERNAL_ERROR
442
648
  message: 服务器内部错误
443
- /actions/{actionId}/validate:
649
+ /actions/validate:
444
650
  post:
445
651
  tags:
446
652
  - Actions
447
653
  operationId: validateActionParams
448
654
  summary: 验证动作参数
449
- description: 验证动作参数是否符合 Schema 定义(不执行动作)
450
- parameters:
451
- - name: actionId
452
- in: path
453
- required: true
454
- schema:
455
- type: string
456
- description: 动作 ID 或动作定义版本 ID
655
+ description: |
656
+ 验证动作参数是否符合 Schema 定义(不执行动作)。
657
+ 用于前端表单提交前的预校验。
457
658
  requestBody:
458
659
  required: true
459
660
  content:
460
661
  application/json:
461
662
  schema:
462
663
  type: object
463
- required: &ref_31
664
+ required: &ref_40
665
+ - actionType
464
666
  - params
465
- properties: &ref_32
667
+ properties: &ref_41
668
+ actionType:
669
+ type: string
670
+ description: 动作类型
671
+ actionDefinitionVersionId:
672
+ type: string
673
+ description: 动作定义版本 ID
466
674
  params:
467
675
  type: object
468
676
  additionalProperties: true
@@ -474,9 +682,9 @@ paths:
474
682
  application/json:
475
683
  schema:
476
684
  type: object
477
- required: &ref_33
685
+ required: &ref_42
478
686
  - data
479
- properties: &ref_34
687
+ properties: &ref_43
480
688
  data:
481
689
  type: object
482
690
  required:
@@ -496,45 +704,108 @@ paths:
496
704
  message:
497
705
  type: string
498
706
  description: 错误消息
707
+ code:
708
+ type: string
709
+ description: 错误码
499
710
  description: 验证错误
711
+ '400':
712
+ description: 请求参数错误
713
+ content: *ref_4
714
+ /actions/definitions:
715
+ get:
716
+ tags:
717
+ - Actions
718
+ operationId: getActionDefinition
719
+ summary: 获取动作定义
720
+ description: 获取指定动作定义版本的详细信息(用于 Runtime 渲染动作配置)
721
+ parameters:
722
+ - name: actionDefinitionVersionId
723
+ in: query
724
+ required: true
725
+ schema:
726
+ type: string
727
+ description: 动作定义版本 ID
728
+ responses:
729
+ '200':
730
+ description: 成功
731
+ content:
732
+ application/json:
733
+ schema:
734
+ type: object
735
+ required: &ref_44
736
+ - data
737
+ properties: &ref_45
738
+ data:
739
+ type: object
740
+ properties:
741
+ actionDefinitionVersionId:
742
+ type: string
743
+ actionType:
744
+ type: string
745
+ name:
746
+ type: string
747
+ paramsSchema:
748
+ type: object
749
+ description: 参数 JSON Schema
750
+ resultSchema:
751
+ type: object
752
+ description: 结果 JSON Schema
500
753
  '404':
501
754
  description: 资源不存在
502
755
  content: *ref_2
503
- /queries/{queryId}/execute:
756
+ /data/query:
504
757
  post:
505
758
  tags:
506
759
  - Queries
507
- operationId: executeQuery
508
- summary: 执行数据查询
760
+ operationId: queryData
761
+ summary: 执行数据查询(Data Proxy 统一入口)
509
762
  description: |
510
- 执行指定的数据查询,返回查询结果。
763
+ Data Proxy 统一入口,所有数据查询都通过此接口执行。
511
764
 
512
- 支持:
513
- - 参数化查询
514
- - 结果缓存
515
- - 分页
516
- parameters:
517
- - name: queryId
518
- in: path
519
- required: true
520
- schema:
521
- type: string
522
- description: 查询 ID 或查询定义版本 ID
765
+ 功能:
766
+ - 白名单校验(queryVersionId 属于该 app/workspace)
767
+ - 字段裁剪、脱敏
768
+ - 缓存(短 TTL)
769
+ - 失败降级(兜底结构)
770
+ - 审计(可选,或采样)
771
+
772
+ 支持的数据源类型:
773
+ - http: HTTP 接口
774
+ - graphql: GraphQL 查询
775
+ - database: 数据库查询(受限)
776
+ - internal: 内部服务
777
+ - aggregation: 聚合查询
523
778
  requestBody:
524
779
  required: true
525
780
  content:
526
781
  application/json:
527
782
  schema:
528
783
  type: object
529
- properties: &ref_35
784
+ required: &ref_46
785
+ - queryVersionId
786
+ properties: &ref_47
787
+ queryVersionId:
788
+ type: string
789
+ description: 查询定义版本 ID
530
790
  params:
531
791
  type: object
532
792
  additionalProperties: true
533
793
  description: 查询参数
534
794
  context:
535
795
  type: object
536
- description: 页面解析上下文
537
- properties: *ref_5
796
+ properties: &ref_9
797
+ pageVersionId:
798
+ type: string
799
+ description: 页面版本 ID
800
+ uid:
801
+ type: string
802
+ description: 用户 ID
803
+ sessionId:
804
+ type: string
805
+ description: 会话 ID
806
+ traceId:
807
+ type: string
808
+ description: 分布式追踪 ID
538
809
  options:
539
810
  type: object
540
811
  properties:
@@ -558,9 +829,12 @@ paths:
558
829
  application/json:
559
830
  schema:
560
831
  type: object
561
- required: &ref_36
832
+ required: &ref_48
833
+ - success
562
834
  - data
563
- properties: &ref_37
835
+ properties: &ref_49
836
+ success:
837
+ type: boolean
564
838
  data:
565
839
  description: 查询结果数据
566
840
  meta:
@@ -576,6 +850,9 @@ paths:
576
850
  executionTime:
577
851
  type: integer
578
852
  description: 执行时间(毫秒)
853
+ traceId:
854
+ type: string
855
+ description: 追踪 ID
579
856
  pagination:
580
857
  type: object
581
858
  properties:
@@ -590,18 +867,24 @@ paths:
590
867
  '400':
591
868
  description: 请求参数错误
592
869
  content: *ref_4
870
+ '401':
871
+ description: 未认证
872
+ content: *ref_5
873
+ '403':
874
+ description: 无权限
875
+ content: *ref_6
593
876
  '404':
594
877
  description: 资源不存在
595
878
  content: *ref_2
596
879
  '422':
597
880
  description: 请求无法处理
598
- content: *ref_6
881
+ content: *ref_7
599
882
  '500':
600
883
  description: 服务器内部错误
601
- content: *ref_7
884
+ content: *ref_8
602
885
  '504':
603
886
  description: 网关超时
604
- content: &ref_50
887
+ content: &ref_72
605
888
  application/json:
606
889
  schema:
607
890
  type: object
@@ -610,6 +893,119 @@ paths:
610
893
  example:
611
894
  code: GATEWAY_TIMEOUT
612
895
  message: 查询超时
896
+ /data/query/batch:
897
+ post:
898
+ tags:
899
+ - Queries
900
+ operationId: batchQueryData
901
+ summary: 批量执行数据查询
902
+ description: |
903
+ 批量执行多个数据查询,用于页面初始化时预取多个数据源。
904
+ 所有查询并行执行,部分失败不影响其他查询返回。
905
+ requestBody:
906
+ required: true
907
+ content:
908
+ application/json:
909
+ schema:
910
+ type: object
911
+ required: &ref_50
912
+ - queries
913
+ properties: &ref_51
914
+ queries:
915
+ type: array
916
+ items:
917
+ type: object
918
+ required:
919
+ - queryVersionId
920
+ properties:
921
+ queryVersionId:
922
+ type: string
923
+ params:
924
+ type: object
925
+ alias:
926
+ type: string
927
+ description: 查询别名(用于结果映射)
928
+ maxItems: 20
929
+ description: 查询列表(最多 20 个)
930
+ context:
931
+ type: object
932
+ properties: *ref_9
933
+ responses:
934
+ '200':
935
+ description: 批量查询结果
936
+ content:
937
+ application/json:
938
+ schema:
939
+ type: object
940
+ required: &ref_52
941
+ - success
942
+ - data
943
+ properties: &ref_53
944
+ success:
945
+ type: boolean
946
+ data:
947
+ type: object
948
+ additionalProperties:
949
+ type: object
950
+ properties:
951
+ success:
952
+ type: boolean
953
+ data:
954
+ description: 查询结果
955
+ error:
956
+ type: object
957
+ properties:
958
+ code:
959
+ type: string
960
+ message:
961
+ type: string
962
+ description: 按 alias 或 queryVersionId 索引的结果
963
+ '400':
964
+ description: 请求参数错误
965
+ content: *ref_4
966
+ /data/definitions:
967
+ get:
968
+ tags:
969
+ - Queries
970
+ operationId: getQueryDefinition
971
+ summary: 获取查询定义
972
+ description: 获取指定数据查询定义版本的详细信息
973
+ parameters:
974
+ - name: queryVersionId
975
+ in: query
976
+ required: true
977
+ schema:
978
+ type: string
979
+ description: 查询定义版本 ID
980
+ responses:
981
+ '200':
982
+ description: 成功
983
+ content:
984
+ application/json:
985
+ schema:
986
+ type: object
987
+ required: &ref_54
988
+ - data
989
+ properties: &ref_55
990
+ data:
991
+ type: object
992
+ properties:
993
+ queryVersionId:
994
+ type: string
995
+ name:
996
+ type: string
997
+ paramsSchema:
998
+ type: object
999
+ description: 参数 JSON Schema
1000
+ resultSchema:
1001
+ type: object
1002
+ description: 结果 JSON Schema
1003
+ cacheTtl:
1004
+ type: integer
1005
+ description: 缓存 TTL(秒)
1006
+ '404':
1007
+ description: 资源不存在
1008
+ content: *ref_2
613
1009
  /activities/{activityId}:
614
1010
  get:
615
1011
  tags:
@@ -641,12 +1037,12 @@ paths:
641
1037
  type: boolean
642
1038
  data:
643
1039
  type: object
644
- required: &ref_38
1040
+ required: &ref_56
645
1041
  - id
646
1042
  - name
647
1043
  - type
648
1044
  - status
649
- properties: &ref_39
1045
+ properties: &ref_57
650
1046
  id:
651
1047
  type: string
652
1048
  description: 活动 ID
@@ -656,10 +1052,14 @@ paths:
656
1052
  type:
657
1053
  type: string
658
1054
  enum:
1055
+ - claim
659
1056
  - signin
660
1057
  - lottery
661
- - redpack
662
- - coupon
1058
+ - reserve
1059
+ - task
1060
+ - vote
1061
+ - share
1062
+ - bind
663
1063
  - custom
664
1064
  description: 活动类型
665
1065
  status:
@@ -730,10 +1130,10 @@ paths:
730
1130
  type: boolean
731
1131
  data:
732
1132
  type: object
733
- required: &ref_40
1133
+ required: &ref_58
734
1134
  - activityId
735
1135
  - userId
736
- properties: &ref_41
1136
+ properties: &ref_59
737
1137
  activityId:
738
1138
  type: string
739
1139
  description: 活动 ID
@@ -804,11 +1204,11 @@ paths:
804
1204
  type: boolean
805
1205
  data:
806
1206
  type: object
807
- required: &ref_42
1207
+ required: &ref_60
808
1208
  - year
809
1209
  - month
810
1210
  - records
811
- properties: &ref_43
1211
+ properties: &ref_61
812
1212
  year:
813
1213
  type: integer
814
1214
  description: 年份
@@ -880,12 +1280,12 @@ paths:
880
1280
  type: array
881
1281
  items:
882
1282
  type: object
883
- required: &ref_44
1283
+ required: &ref_62
884
1284
  - id
885
1285
  - rewardType
886
1286
  - status
887
1287
  - createdAt
888
- properties: &ref_45
1288
+ properties: &ref_63
889
1289
  id:
890
1290
  type: string
891
1291
  description: 记录 ID
@@ -922,12 +1322,12 @@ paths:
922
1322
  description: 过期时间
923
1323
  meta:
924
1324
  type: object
925
- required: &ref_8
1325
+ required: &ref_10
926
1326
  - page
927
1327
  - limit
928
1328
  - total
929
1329
  - totalPages
930
- properties: &ref_9
1330
+ properties: &ref_11
931
1331
  page:
932
1332
  type: integer
933
1333
  minimum: 1
@@ -983,12 +1383,12 @@ paths:
983
1383
  type: array
984
1384
  items:
985
1385
  type: object
986
- required: &ref_46
1386
+ required: &ref_64
987
1387
  - id
988
1388
  - prizeId
989
1389
  - status
990
1390
  - createdAt
991
- properties: &ref_47
1391
+ properties: &ref_65
992
1392
  id:
993
1393
  type: string
994
1394
  description: 记录 ID
@@ -1028,8 +1428,8 @@ paths:
1028
1428
  description: 领取时间
1029
1429
  meta:
1030
1430
  type: object
1031
- required: *ref_8
1032
- properties: *ref_9
1431
+ required: *ref_10
1432
+ properties: *ref_11
1033
1433
  security:
1034
1434
  - BearerAuth: []
1035
1435
  /track:
@@ -1051,9 +1451,9 @@ paths:
1051
1451
  application/json:
1052
1452
  schema:
1053
1453
  type: object
1054
- required: &ref_10
1454
+ required: &ref_12
1055
1455
  - eventName
1056
- properties: &ref_11
1456
+ properties: &ref_13
1057
1457
  eventName:
1058
1458
  type: string
1059
1459
  minLength: 1
@@ -1079,14 +1479,16 @@ paths:
1079
1479
  context:
1080
1480
  type: object
1081
1481
  properties:
1082
- pageId:
1482
+ pageVersionId:
1083
1483
  type: string
1084
- componentId:
1484
+ componentVersionId:
1085
1485
  type: string
1086
1486
  sessionId:
1087
1487
  type: string
1088
1488
  deviceType:
1089
1489
  type: string
1490
+ traceId:
1491
+ type: string
1090
1492
  description: 上下文信息
1091
1493
  responses:
1092
1494
  '202':
@@ -1126,15 +1528,15 @@ paths:
1126
1528
  application/json:
1127
1529
  schema:
1128
1530
  type: object
1129
- required: &ref_48
1531
+ required: &ref_66
1130
1532
  - events
1131
- properties: &ref_49
1533
+ properties: &ref_67
1132
1534
  events:
1133
1535
  type: array
1134
1536
  items:
1135
1537
  type: object
1136
- required: *ref_10
1137
- properties: *ref_11
1538
+ required: *ref_12
1539
+ properties: *ref_13
1138
1540
  maxItems: 100
1139
1541
  description: 事件列表(最多 100 个)
1140
1542
  responses:
@@ -1168,12 +1570,305 @@ paths:
1168
1570
  '400':
1169
1571
  description: 请求参数错误
1170
1572
  content: *ref_4
1573
+ /tenant/resolve:
1574
+ post:
1575
+ tags:
1576
+ - Tenant
1577
+ summary: 解析租户信息
1578
+ operationId: resolveTenant
1579
+ description: |
1580
+ 根据 appKey 或 host 解析租户/应用信息。
1581
+
1582
+ 用于:
1583
+ - Runtime 初始化时获取应用配置
1584
+ - 多租户场景下的应用隔离
1585
+ requestBody:
1586
+ required: true
1587
+ content:
1588
+ application/json:
1589
+ schema:
1590
+ type: object
1591
+ properties:
1592
+ appKey:
1593
+ type: string
1594
+ description: 应用密钥
1595
+ host:
1596
+ type: string
1597
+ description: 请求来源域名
1598
+ channel:
1599
+ type: string
1600
+ description: 渠道标识
1601
+ anyOf:
1602
+ - required:
1603
+ - appKey
1604
+ - required:
1605
+ - host
1606
+ responses:
1607
+ '200':
1608
+ description: 解析成功
1609
+ content:
1610
+ application/json:
1611
+ schema:
1612
+ type: object
1613
+ properties:
1614
+ success:
1615
+ type: boolean
1616
+ data:
1617
+ type: object
1618
+ required: &ref_68
1619
+ - appId
1620
+ - appName
1621
+ - status
1622
+ properties: &ref_69
1623
+ appId:
1624
+ type: string
1625
+ description: 应用 ID
1626
+ appName:
1627
+ type: string
1628
+ description: 应用名称
1629
+ status:
1630
+ type: string
1631
+ enum:
1632
+ - active
1633
+ - suspended
1634
+ - disabled
1635
+ description: 应用状态
1636
+ workspaceId:
1637
+ type: string
1638
+ description: 工作空间 ID
1639
+ cdnDomain:
1640
+ type: string
1641
+ format: uri
1642
+ description: CDN 域名
1643
+ apiDomain:
1644
+ type: string
1645
+ format: uri
1646
+ description: API 域名
1647
+ '400':
1648
+ description: 请求参数错误
1649
+ content: *ref_4
1650
+ '404':
1651
+ description: 租户不存在
1652
+ content:
1653
+ application/json:
1654
+ schema:
1655
+ type: object
1656
+ required: *ref_0
1657
+ properties: *ref_1
1658
+ security: []
1659
+ /tenant/config:
1660
+ get:
1661
+ tags:
1662
+ - Tenant
1663
+ summary: 获取租户配置
1664
+ operationId: getTenantConfig
1665
+ description: |
1666
+ 获取当前租户的运行时配置。
1667
+
1668
+ 包括:
1669
+ - 功能开关
1670
+ - 主题配置
1671
+ - CDN 域名
1672
+ - 阻断组件列表
1673
+ - Kill Switch 状态
1674
+ parameters:
1675
+ - name: X-App-Id
1676
+ in: header
1677
+ required: true
1678
+ schema:
1679
+ type: string
1680
+ description: 应用 ID
1681
+ responses:
1682
+ '200':
1683
+ description: 成功
1684
+ content:
1685
+ application/json:
1686
+ schema:
1687
+ type: object
1688
+ properties:
1689
+ success:
1690
+ type: boolean
1691
+ data:
1692
+ type: object
1693
+ properties: &ref_70
1694
+ features:
1695
+ type: object
1696
+ additionalProperties:
1697
+ type: boolean
1698
+ description: 功能开关
1699
+ theme:
1700
+ type: object
1701
+ additionalProperties: true
1702
+ description: 主题配置
1703
+ cdnDomain:
1704
+ type: string
1705
+ format: uri
1706
+ description: CDN 域名
1707
+ runtimeVersion:
1708
+ type: string
1709
+ description: 推荐的 Runtime 版本
1710
+ blockedComponents:
1711
+ type: array
1712
+ items:
1713
+ type: object
1714
+ properties:
1715
+ componentType:
1716
+ type: string
1717
+ version:
1718
+ type: string
1719
+ reason:
1720
+ type: string
1721
+ description: 阻断的组件列表
1722
+ killSwitch:
1723
+ type: object
1724
+ properties:
1725
+ enabled:
1726
+ type: boolean
1727
+ pageIds:
1728
+ type: array
1729
+ items:
1730
+ type: string
1731
+ description: 被 Kill 的页面 ID 列表
1732
+ fallbackUrl:
1733
+ type: string
1734
+ format: uri
1735
+ description: Kill Switch 配置
1736
+ '401':
1737
+ description: 未认证
1738
+ content: *ref_5
1739
+ '404':
1740
+ description: 资源不存在
1741
+ content: *ref_2
1742
+ /health:
1743
+ get:
1744
+ tags:
1745
+ - Health
1746
+ summary: 健康检查
1747
+ operationId: healthCheck
1748
+ description: |
1749
+ 综合健康检查,包含所有依赖服务状态。
1750
+
1751
+ 返回:
1752
+ - 服务状态(healthy/degraded/unhealthy)
1753
+ - 版本信息
1754
+ - 运行时间
1755
+ - 依赖服务状态
1756
+ responses:
1757
+ '200':
1758
+ description: 服务健康
1759
+ content:
1760
+ application/json:
1761
+ schema:
1762
+ type: object
1763
+ required: &ref_14
1764
+ - status
1765
+ - version
1766
+ properties: &ref_15
1767
+ status:
1768
+ type: string
1769
+ enum:
1770
+ - healthy
1771
+ - degraded
1772
+ - unhealthy
1773
+ description: 服务状态
1774
+ version:
1775
+ type: string
1776
+ description: 服务版本
1777
+ uptime:
1778
+ type: integer
1779
+ description: 运行时间(秒)
1780
+ timestamp:
1781
+ type: string
1782
+ format: date-time
1783
+ description: 检查时间
1784
+ dependencies:
1785
+ type: object
1786
+ additionalProperties:
1787
+ type: object
1788
+ properties:
1789
+ status:
1790
+ type: string
1791
+ enum:
1792
+ - healthy
1793
+ - degraded
1794
+ - unhealthy
1795
+ latency:
1796
+ type: integer
1797
+ description: 延迟(毫秒)
1798
+ message:
1799
+ type: string
1800
+ description: 依赖服务状态
1801
+ '503':
1802
+ description: 服务不健康
1803
+ content:
1804
+ application/json:
1805
+ schema:
1806
+ type: object
1807
+ required: *ref_14
1808
+ properties: *ref_15
1809
+ security: []
1810
+ /health/ready:
1811
+ get:
1812
+ tags:
1813
+ - Health
1814
+ summary: 就绪检查
1815
+ operationId: readinessCheck
1816
+ description: |
1817
+ Kubernetes readiness probe。
1818
+ 检查服务是否准备好接收流量。
1819
+ responses:
1820
+ '200':
1821
+ description: 服务就绪
1822
+ content:
1823
+ application/json:
1824
+ schema:
1825
+ type: object
1826
+ properties:
1827
+ ready:
1828
+ type: boolean
1829
+ example: true
1830
+ '503':
1831
+ description: 服务未就绪
1832
+ content:
1833
+ application/json:
1834
+ schema:
1835
+ type: object
1836
+ properties:
1837
+ ready:
1838
+ type: boolean
1839
+ example: false
1840
+ reason:
1841
+ type: string
1842
+ security: []
1843
+ /health/live:
1844
+ get:
1845
+ tags:
1846
+ - Health
1847
+ summary: 存活检查
1848
+ operationId: livenessCheck
1849
+ description: |
1850
+ Kubernetes liveness probe。
1851
+ 检查服务是否存活。
1852
+ responses:
1853
+ '200':
1854
+ description: 服务存活
1855
+ content:
1856
+ application/json:
1857
+ schema:
1858
+ type: object
1859
+ properties:
1860
+ alive:
1861
+ type: boolean
1862
+ example: true
1863
+ '503':
1864
+ description: 服务不存活
1865
+ security: []
1171
1866
  components:
1172
1867
  schemas:
1173
1868
  PageResponse:
1174
1869
  type: object
1175
- required: *ref_12
1176
- properties: *ref_13
1870
+ required: *ref_16
1871
+ properties: *ref_17
1177
1872
  ErrorResponse:
1178
1873
  type: object
1179
1874
  required: *ref_0
@@ -1181,92 +1876,132 @@ components:
1181
1876
  ResolveContext:
1182
1877
  type: object
1183
1878
  description: 页面解析上下文
1184
- properties: *ref_5
1879
+ properties: *ref_18
1185
1880
  ResolvePageRequest:
1186
1881
  type: object
1187
- properties: *ref_14
1882
+ properties: *ref_19
1188
1883
  ComponentManifest:
1189
1884
  type: object
1190
- required: *ref_15
1191
- properties: *ref_16
1885
+ required: *ref_20
1886
+ properties: *ref_21
1192
1887
  ActionManifest:
1193
1888
  type: object
1194
- required: *ref_17
1195
- properties: *ref_18
1889
+ required: *ref_22
1890
+ properties: *ref_23
1196
1891
  QueryManifest:
1197
1892
  type: object
1198
- required: *ref_19
1199
- properties: *ref_20
1893
+ required: *ref_24
1894
+ properties: *ref_25
1200
1895
  ResourceManifests:
1201
1896
  type: object
1202
- properties: *ref_21
1897
+ properties: *ref_26
1898
+ OpsConfig:
1899
+ type: object
1900
+ description: 运维配置
1901
+ properties: *ref_27
1203
1902
  ResolvePageResponse:
1204
1903
  type: object
1205
- required: *ref_22
1206
- properties: *ref_23
1904
+ required: *ref_28
1905
+ properties: *ref_29
1207
1906
  ActionContext:
1208
1907
  type: object
1209
- description: 动作执行上下文
1210
- properties: *ref_24
1908
+ description: 动作执行上下文(问题追溯必须字段)
1909
+ required: *ref_30
1910
+ properties: *ref_31
1211
1911
  ExecuteActionRequest:
1212
1912
  type: object
1213
- required: *ref_25
1214
- properties: *ref_26
1913
+ required: *ref_32
1914
+ properties: *ref_33
1215
1915
  ActionEffect:
1216
1916
  type: object
1217
- required: *ref_27
1218
- properties: *ref_28
1219
- ExecuteActionResponse:
1220
- type: object
1221
- required: *ref_29
1222
- properties: *ref_30
1223
- ValidateActionRequest:
1224
- type: object
1225
- required: *ref_31
1226
- properties: *ref_32
1227
- ValidateActionResponse:
1228
- type: object
1229
- required: *ref_33
1230
- properties: *ref_34
1231
- ExecuteQueryRequest:
1232
- type: object
1917
+ required: *ref_34
1233
1918
  properties: *ref_35
1234
- ExecuteQueryResponse:
1919
+ ExecuteActionResponse:
1235
1920
  type: object
1236
1921
  required: *ref_36
1237
1922
  properties: *ref_37
1238
- PublicActivityInfo:
1923
+ IdempotencyConflictResponse:
1239
1924
  type: object
1240
1925
  required: *ref_38
1241
1926
  properties: *ref_39
1242
- UserActivityState:
1927
+ ValidateActionRequest:
1243
1928
  type: object
1244
1929
  required: *ref_40
1245
1930
  properties: *ref_41
1246
- SigninCalendar:
1931
+ ValidateActionResponse:
1247
1932
  type: object
1248
1933
  required: *ref_42
1249
1934
  properties: *ref_43
1250
- ClaimRecordInfo:
1935
+ ActionDefinitionResponse:
1251
1936
  type: object
1252
1937
  required: *ref_44
1253
1938
  properties: *ref_45
1254
- PaginationMeta:
1939
+ QueryContext:
1255
1940
  type: object
1256
- required: *ref_8
1257
1941
  properties: *ref_9
1258
- LotteryRecordInfo:
1942
+ QueryDataRequest:
1259
1943
  type: object
1260
1944
  required: *ref_46
1261
1945
  properties: *ref_47
1262
- TrackRequest:
1946
+ QueryDataResponse:
1947
+ type: object
1948
+ required: *ref_48
1949
+ properties: *ref_49
1950
+ BatchQueryRequest:
1951
+ type: object
1952
+ required: *ref_50
1953
+ properties: *ref_51
1954
+ BatchQueryResponse:
1955
+ type: object
1956
+ required: *ref_52
1957
+ properties: *ref_53
1958
+ QueryDefinitionResponse:
1959
+ type: object
1960
+ required: *ref_54
1961
+ properties: *ref_55
1962
+ PublicActivityInfo:
1963
+ type: object
1964
+ required: *ref_56
1965
+ properties: *ref_57
1966
+ UserActivityState:
1967
+ type: object
1968
+ required: *ref_58
1969
+ properties: *ref_59
1970
+ SigninCalendar:
1971
+ type: object
1972
+ required: *ref_60
1973
+ properties: *ref_61
1974
+ ClaimRecordInfo:
1975
+ type: object
1976
+ required: *ref_62
1977
+ properties: *ref_63
1978
+ PaginationMeta:
1263
1979
  type: object
1264
1980
  required: *ref_10
1265
1981
  properties: *ref_11
1982
+ LotteryRecordInfo:
1983
+ type: object
1984
+ required: *ref_64
1985
+ properties: *ref_65
1986
+ TrackRequest:
1987
+ type: object
1988
+ required: *ref_12
1989
+ properties: *ref_13
1266
1990
  TrackBatchRequest:
1267
1991
  type: object
1268
- required: *ref_48
1269
- properties: *ref_49
1992
+ required: *ref_66
1993
+ properties: *ref_67
1994
+ TenantInfo:
1995
+ type: object
1996
+ required: *ref_68
1997
+ properties: *ref_69
1998
+ TenantConfig:
1999
+ type: object
2000
+ properties: *ref_70
2001
+ HealthResponse:
2002
+ type: object
2003
+ required: *ref_14
2004
+ properties: *ref_15
1270
2005
  responses:
1271
2006
  NotFound:
1272
2007
  description: 资源不存在
@@ -1277,15 +2012,24 @@ components:
1277
2012
  BadRequest:
1278
2013
  description: 请求参数错误
1279
2014
  content: *ref_4
2015
+ Unauthorized:
2016
+ description: 未认证
2017
+ content: *ref_5
2018
+ Forbidden:
2019
+ description: 无权限
2020
+ content: *ref_6
1280
2021
  UnprocessableEntity:
1281
2022
  description: 请求无法处理
1282
- content: *ref_6
2023
+ content: *ref_7
2024
+ TooManyRequests:
2025
+ description: 请求过于频繁
2026
+ content: *ref_71
1283
2027
  InternalError:
1284
2028
  description: 服务器内部错误
1285
- content: *ref_7
2029
+ content: *ref_8
1286
2030
  GatewayTimeout:
1287
2031
  description: 网关超时
1288
- content: *ref_50
2032
+ content: *ref_72
1289
2033
  securitySchemes:
1290
2034
  BearerAuth:
1291
2035
  type: http
@@ -1297,3 +2041,16 @@ components:
1297
2041
  in: header
1298
2042
  name: X-API-Key
1299
2043
  description: API 密钥
2044
+ parameters:
2045
+ X-Trace-Id:
2046
+ name: X-Trace-Id
2047
+ in: header
2048
+ schema:
2049
+ type: string
2050
+ description: 分布式追踪 ID(OTel)
2051
+ X-App-Id:
2052
+ name: X-App-Id
2053
+ in: header
2054
+ schema:
2055
+ type: string
2056
+ description: 应用/租户 ID