@djvlc/openapi-user-client 1.4.0 → 1.6.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.
@@ -0,0 +1,61 @@
1
+ # 响应组件索引
2
+
3
+ BadRequest:
4
+ description: 请求参数错误
5
+ content:
6
+ application/json:
7
+ schema:
8
+ $ref: '../schemas/_index.yaml#/ErrorResponse'
9
+ example:
10
+ code: BAD_REQUEST
11
+ message: 请求参数无效
12
+
13
+ NotFound:
14
+ description: 资源不存在
15
+ content:
16
+ application/json:
17
+ schema:
18
+ $ref: '../schemas/_index.yaml#/ErrorResponse'
19
+ example:
20
+ code: NOT_FOUND
21
+ message: 资源不存在
22
+
23
+ UnprocessableEntity:
24
+ description: 请求无法处理
25
+ content:
26
+ application/json:
27
+ schema:
28
+ $ref: '../schemas/_index.yaml#/ErrorResponse'
29
+ example:
30
+ code: UNPROCESSABLE_ENTITY
31
+ message: 参数验证失败
32
+
33
+ InternalError:
34
+ description: 服务器内部错误
35
+ content:
36
+ application/json:
37
+ schema:
38
+ $ref: '../schemas/_index.yaml#/ErrorResponse'
39
+ example:
40
+ code: INTERNAL_ERROR
41
+ message: 服务器内部错误
42
+
43
+ ServiceUnavailable:
44
+ description: 服务不可用
45
+ content:
46
+ application/json:
47
+ schema:
48
+ $ref: '../schemas/_index.yaml#/ErrorResponse'
49
+ example:
50
+ code: SERVICE_UNAVAILABLE
51
+ message: 页面暂时不可用
52
+
53
+ GatewayTimeout:
54
+ description: 网关超时
55
+ content:
56
+ application/json:
57
+ schema:
58
+ $ref: '../schemas/_index.yaml#/ErrorResponse'
59
+ example:
60
+ code: GATEWAY_TIMEOUT
61
+ message: 查询超时
@@ -0,0 +1,631 @@
1
+ # Schema 组件索引
2
+
3
+ # ============================================================================
4
+ # 通用
5
+ # ============================================================================
6
+
7
+ ErrorResponse:
8
+ type: object
9
+ required: [code, message]
10
+ properties:
11
+ code:
12
+ type: string
13
+ description: 错误码
14
+ message:
15
+ type: string
16
+ description: 错误消息
17
+ details:
18
+ type: array
19
+ items:
20
+ type: object
21
+ properties:
22
+ field:
23
+ type: string
24
+ message:
25
+ type: string
26
+ description: 错误详情
27
+
28
+ # ============================================================================
29
+ # 页面相关
30
+ # ============================================================================
31
+
32
+ PageResponse:
33
+ type: object
34
+ required: [data]
35
+ properties:
36
+ data:
37
+ type: object
38
+ required: [pageId, version, meta]
39
+ properties:
40
+ pageId:
41
+ type: string
42
+ description: 页面 ID
43
+ version:
44
+ type: string
45
+ description: 页面版本
46
+ meta:
47
+ type: object
48
+ properties:
49
+ title:
50
+ type: string
51
+ description: 页面标题
52
+ description:
53
+ type: string
54
+ description: 页面描述
55
+ integrity:
56
+ type: string
57
+ description: 完整性哈希
58
+
59
+ ResolvePageRequest:
60
+ type: object
61
+ properties:
62
+ context:
63
+ $ref: '#/ResolveContext'
64
+ options:
65
+ type: object
66
+ properties:
67
+ prefetchData:
68
+ type: boolean
69
+ default: true
70
+ description: 是否预取数据
71
+ includeManifests:
72
+ type: boolean
73
+ default: true
74
+ description: 是否包含资源清单
75
+ locale:
76
+ type: string
77
+ description: 语言环境
78
+
79
+ ResolveContext:
80
+ type: object
81
+ description: 页面解析上下文
82
+ properties:
83
+ userId:
84
+ type: string
85
+ description: 用户 ID
86
+ sessionId:
87
+ type: string
88
+ description: 会话 ID
89
+ deviceType:
90
+ type: string
91
+ enum: [mobile, tablet, desktop]
92
+ description: 设备类型
93
+ urlParams:
94
+ type: object
95
+ additionalProperties:
96
+ type: string
97
+ description: URL 参数
98
+ routeParams:
99
+ type: object
100
+ additionalProperties:
101
+ type: string
102
+ description: 路由参数
103
+ customData:
104
+ type: object
105
+ additionalProperties: true
106
+ description: 自定义上下文数据
107
+
108
+ ResolvePageResponse:
109
+ type: object
110
+ required: [data]
111
+ properties:
112
+ data:
113
+ type: object
114
+ required: [pageId, version, schema]
115
+ properties:
116
+ pageId:
117
+ type: string
118
+ description: 页面 ID
119
+ version:
120
+ type: string
121
+ description: 页面版本
122
+ schema:
123
+ type: object
124
+ description: 解析后的页面 Schema
125
+ manifests:
126
+ $ref: '#/ResourceManifests'
127
+ prefetchedData:
128
+ type: object
129
+ additionalProperties: true
130
+ description: 预取的数据
131
+
132
+ ResourceManifests:
133
+ type: object
134
+ properties:
135
+ components:
136
+ type: array
137
+ items:
138
+ $ref: '#/ComponentManifest'
139
+ description: 组件资源清单
140
+ actions:
141
+ type: array
142
+ items:
143
+ $ref: '#/ActionManifest'
144
+ description: 动作资源清单
145
+ queries:
146
+ type: array
147
+ items:
148
+ $ref: '#/QueryManifest'
149
+ description: 查询资源清单
150
+
151
+ ComponentManifest:
152
+ type: object
153
+ required: [componentType, version, entryUrl]
154
+ properties:
155
+ componentType:
156
+ type: string
157
+ description: 组件类型
158
+ version:
159
+ type: string
160
+ description: 组件版本
161
+ entryUrl:
162
+ type: string
163
+ format: uri
164
+ description: 组件入口 URL
165
+ integrity:
166
+ type: string
167
+ description: 完整性哈希
168
+
169
+ ActionManifest:
170
+ type: object
171
+ required: [actionId, version]
172
+ properties:
173
+ actionId:
174
+ type: string
175
+ description: 动作 ID
176
+ version:
177
+ type: string
178
+ description: 动作版本
179
+ type:
180
+ type: string
181
+ enum: [builtin, custom]
182
+ description: 动作类型
183
+
184
+ QueryManifest:
185
+ type: object
186
+ required: [queryId, version]
187
+ properties:
188
+ queryId:
189
+ type: string
190
+ description: 查询 ID
191
+ version:
192
+ type: string
193
+ description: 查询版本
194
+ cacheTtl:
195
+ type: integer
196
+ description: 缓存 TTL(秒)
197
+
198
+ # ============================================================================
199
+ # 动作相关
200
+ # ============================================================================
201
+
202
+ ExecuteActionRequest:
203
+ type: object
204
+ required: [params]
205
+ properties:
206
+ params:
207
+ type: object
208
+ additionalProperties: true
209
+ description: 动作参数
210
+ context:
211
+ $ref: '#/ActionContext'
212
+ options:
213
+ type: object
214
+ properties:
215
+ timeout:
216
+ type: integer
217
+ minimum: 1000
218
+ maximum: 30000
219
+ default: 10000
220
+ description: 执行超时(毫秒)
221
+ idempotencyKey:
222
+ type: string
223
+ description: 幂等键
224
+
225
+ ActionContext:
226
+ type: object
227
+ description: 动作执行上下文
228
+ properties:
229
+ pageId:
230
+ type: string
231
+ description: 页面 ID
232
+ componentId:
233
+ type: string
234
+ description: 触发组件 ID
235
+ eventName:
236
+ type: string
237
+ description: 触发事件名
238
+ state:
239
+ type: object
240
+ additionalProperties: true
241
+ description: 当前页面状态
242
+
243
+ ExecuteActionResponse:
244
+ type: object
245
+ required: [data]
246
+ properties:
247
+ data:
248
+ type: object
249
+ properties:
250
+ success:
251
+ type: boolean
252
+ description: 是否成功
253
+ result:
254
+ description: 执行结果
255
+ effects:
256
+ type: array
257
+ items:
258
+ $ref: '#/ActionEffect'
259
+ description: 副作用列表
260
+
261
+ ActionEffect:
262
+ type: object
263
+ required: [type]
264
+ properties:
265
+ type:
266
+ type: string
267
+ enum: [setState, navigate, showToast, refreshData, custom]
268
+ description: 副作用类型
269
+ payload:
270
+ type: object
271
+ additionalProperties: true
272
+ description: 副作用参数
273
+
274
+ ValidateActionRequest:
275
+ type: object
276
+ required: [params]
277
+ properties:
278
+ params:
279
+ type: object
280
+ additionalProperties: true
281
+ description: 待验证的参数
282
+
283
+ ValidateActionResponse:
284
+ type: object
285
+ required: [data]
286
+ properties:
287
+ data:
288
+ type: object
289
+ required: [valid]
290
+ properties:
291
+ valid:
292
+ type: boolean
293
+ description: 是否有效
294
+ errors:
295
+ type: array
296
+ items:
297
+ type: object
298
+ properties:
299
+ path:
300
+ type: string
301
+ description: 参数路径
302
+ message:
303
+ type: string
304
+ description: 错误消息
305
+ description: 验证错误
306
+
307
+ # ============================================================================
308
+ # 查询相关
309
+ # ============================================================================
310
+
311
+ ExecuteQueryRequest:
312
+ type: object
313
+ properties:
314
+ params:
315
+ type: object
316
+ additionalProperties: true
317
+ description: 查询参数
318
+ context:
319
+ $ref: '#/ResolveContext'
320
+ options:
321
+ type: object
322
+ properties:
323
+ timeout:
324
+ type: integer
325
+ minimum: 1000
326
+ maximum: 60000
327
+ default: 30000
328
+ description: 查询超时(毫秒)
329
+ cache:
330
+ type: boolean
331
+ default: true
332
+ description: 是否使用缓存
333
+ cacheKey:
334
+ type: string
335
+ description: 自定义缓存键
336
+
337
+ ExecuteQueryResponse:
338
+ type: object
339
+ required: [data]
340
+ properties:
341
+ data:
342
+ description: 查询结果数据
343
+ meta:
344
+ type: object
345
+ properties:
346
+ cached:
347
+ type: boolean
348
+ description: 是否来自缓存
349
+ cachedAt:
350
+ type: string
351
+ format: date-time
352
+ description: 缓存时间
353
+ executionTime:
354
+ type: integer
355
+ description: 执行时间(毫秒)
356
+ pagination:
357
+ type: object
358
+ properties:
359
+ page:
360
+ type: integer
361
+ limit:
362
+ type: integer
363
+ total:
364
+ type: integer
365
+ hasMore:
366
+ type: boolean
367
+
368
+ # ============================================================================
369
+ # 通用分页
370
+ # ============================================================================
371
+
372
+ PaginationMeta:
373
+ type: object
374
+ required: [page, limit, total, totalPages]
375
+ properties:
376
+ page:
377
+ type: integer
378
+ minimum: 1
379
+ description: 当前页码
380
+ limit:
381
+ type: integer
382
+ minimum: 1
383
+ maximum: 100
384
+ description: 每页数量
385
+ total:
386
+ type: integer
387
+ minimum: 0
388
+ description: 总记录数
389
+ totalPages:
390
+ type: integer
391
+ minimum: 0
392
+ description: 总页数
393
+
394
+ # ============================================================================
395
+ # Activity 用户活动相关
396
+ # ============================================================================
397
+
398
+ PublicActivityInfo:
399
+ type: object
400
+ required: [id, name, type, status]
401
+ properties:
402
+ id:
403
+ type: string
404
+ description: 活动 ID
405
+ name:
406
+ type: string
407
+ description: 活动名称
408
+ type:
409
+ type: string
410
+ enum: [signin, lottery, redpack, coupon, custom]
411
+ description: 活动类型
412
+ status:
413
+ type: string
414
+ enum: [active, ended]
415
+ description: 活动状态
416
+ description:
417
+ type: string
418
+ description: 活动描述
419
+ startTime:
420
+ type: string
421
+ format: date-time
422
+ description: 开始时间
423
+ endTime:
424
+ type: string
425
+ format: date-time
426
+ description: 结束时间
427
+ rules:
428
+ type: object
429
+ additionalProperties: true
430
+ description: 活动规则(公开部分)
431
+ rewards:
432
+ type: array
433
+ items:
434
+ type: object
435
+ properties:
436
+ name:
437
+ type: string
438
+ description:
439
+ type: string
440
+ icon:
441
+ type: string
442
+ description: 奖励列表
443
+
444
+ UserActivityState:
445
+ type: object
446
+ required: [activityId, userId]
447
+ properties:
448
+ activityId:
449
+ type: string
450
+ description: 活动 ID
451
+ userId:
452
+ type: string
453
+ description: 用户 ID
454
+ participated:
455
+ type: boolean
456
+ description: 是否已参与
457
+ participatedAt:
458
+ type: string
459
+ format: date-time
460
+ description: 参与时间
461
+ remainingChances:
462
+ type: integer
463
+ description: 剩余抽奖次数
464
+ totalRewards:
465
+ type: integer
466
+ description: 已获得奖励数
467
+ progress:
468
+ type: object
469
+ additionalProperties: true
470
+ description: 活动进度
471
+ customData:
472
+ type: object
473
+ additionalProperties: true
474
+ description: 自定义数据
475
+
476
+ SigninCalendar:
477
+ type: object
478
+ required: [year, month, records]
479
+ properties:
480
+ year:
481
+ type: integer
482
+ description: 年份
483
+ month:
484
+ type: integer
485
+ minimum: 1
486
+ maximum: 12
487
+ description: 月份
488
+ records:
489
+ type: array
490
+ items:
491
+ type: object
492
+ properties:
493
+ day:
494
+ type: integer
495
+ minimum: 1
496
+ maximum: 31
497
+ signedIn:
498
+ type: boolean
499
+ reward:
500
+ type: object
501
+ properties:
502
+ name:
503
+ type: string
504
+ amount:
505
+ type: number
506
+ description: 签到记录
507
+ consecutiveDays:
508
+ type: integer
509
+ description: 连续签到天数
510
+ totalDays:
511
+ type: integer
512
+ description: 本月签到总天数
513
+
514
+ ClaimRecordInfo:
515
+ type: object
516
+ required: [id, rewardType, status, createdAt]
517
+ properties:
518
+ id:
519
+ type: string
520
+ description: 记录 ID
521
+ activityId:
522
+ type: string
523
+ description: 活动 ID
524
+ rewardType:
525
+ type: string
526
+ description: 奖励类型
527
+ rewardName:
528
+ type: string
529
+ description: 奖励名称
530
+ rewardValue:
531
+ type: number
532
+ description: 奖励值
533
+ status:
534
+ type: string
535
+ enum: [pending, claimed, expired]
536
+ description: 领取状态
537
+ createdAt:
538
+ type: string
539
+ format: date-time
540
+ description: 创建时间
541
+ claimedAt:
542
+ type: string
543
+ format: date-time
544
+ description: 领取时间
545
+ expiresAt:
546
+ type: string
547
+ format: date-time
548
+ description: 过期时间
549
+
550
+ LotteryRecordInfo:
551
+ type: object
552
+ required: [id, prizeId, status, createdAt]
553
+ properties:
554
+ id:
555
+ type: string
556
+ description: 记录 ID
557
+ activityId:
558
+ type: string
559
+ description: 活动 ID
560
+ prizeId:
561
+ type: string
562
+ description: 奖品 ID
563
+ prizeName:
564
+ type: string
565
+ description: 奖品名称
566
+ prizeType:
567
+ type: string
568
+ enum: [physical, virtual, coupon, points, none]
569
+ description: 奖品类型
570
+ status:
571
+ type: string
572
+ enum: [won, notWon, claimed, shipped]
573
+ description: 状态
574
+ createdAt:
575
+ type: string
576
+ format: date-time
577
+ description: 抽奖时间
578
+ claimedAt:
579
+ type: string
580
+ format: date-time
581
+ description: 领取时间
582
+
583
+ # ============================================================================
584
+ # Track 埋点相关
585
+ # ============================================================================
586
+
587
+ TrackRequest:
588
+ type: object
589
+ required: [eventName]
590
+ properties:
591
+ eventName:
592
+ type: string
593
+ minLength: 1
594
+ maxLength: 255
595
+ description: 事件名称
596
+ eventType:
597
+ type: string
598
+ enum: [page_view, click, exposure, custom]
599
+ default: custom
600
+ description: 事件类型
601
+ properties:
602
+ type: object
603
+ additionalProperties: true
604
+ description: 事件属性
605
+ timestamp:
606
+ type: string
607
+ format: date-time
608
+ description: 事件时间(默认为服务器接收时间)
609
+ context:
610
+ type: object
611
+ properties:
612
+ pageId:
613
+ type: string
614
+ componentId:
615
+ type: string
616
+ sessionId:
617
+ type: string
618
+ deviceType:
619
+ type: string
620
+ description: 上下文信息
621
+
622
+ TrackBatchRequest:
623
+ type: object
624
+ required: [events]
625
+ properties:
626
+ events:
627
+ type: array
628
+ items:
629
+ $ref: '#/TrackRequest'
630
+ maxItems: 100
631
+ description: 事件列表(最多 100 个)