@laplace.live/internal 1.3.19 → 1.3.20

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": "@laplace.live/internal",
3
- "version": "1.3.19",
3
+ "version": "1.3.20",
4
4
  "module": "src/index.d.ts",
5
5
  "exports": {
6
6
  ".": "./src/index.d.ts",
@@ -255,4 +255,332 @@ export declare namespace Danmakus {
255
255
  live: LiveItem
256
256
  danmakus: DanmakuProps[]
257
257
  }
258
+
259
+ /* ----------------------------------------------------------------------------
260
+ * v3 API (`/api/v3/*`)
261
+ * @link https://ukamnads.icu/swagger/v3/swagger.json
262
+ * -------------------------------------------------------------------------- */
263
+
264
+ /**
265
+ * v3 弹幕负载类型 `DanmakuRecordV3.payloadKind`
266
+ * - 0: 普通消息
267
+ * - 1: 礼物
268
+ * - 2: 上舰
269
+ * - 3: SuperChat
270
+ * - 4: 进入直播间
271
+ * - 5: 标题变动
272
+ * - 6: 分区变动
273
+ * - 7: 直播中止
274
+ * - 8: 直播继续
275
+ * - 9: 用户封禁
276
+ * - 10: 盲盒
277
+ */
278
+ export type DanmakuPayloadKindV3 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10
279
+
280
+ /**
281
+ * v3 弹幕事件类型 `DanmakuRecordV3.type`
282
+ * 0-10 与 {@link DanmakuPayloadKindV3} 含义一致,11/12 为 v3 新增类型(spec 未标注具体含义)
283
+ */
284
+ export type DanmakuTypeV3 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
285
+
286
+ /** 用户分析任务状态 `UserAnalyzeJobV3Summary.status`(spec 未标注枚举含义) */
287
+ export type UserAnalyzeJobStatusV3 = 0 | 1 | 2 | 3 | 4
288
+
289
+ /** 用户分析任务事件类型 `UserAnalyzeEventV3.type`(spec 未标注枚举含义) */
290
+ export type UserAnalyzeEventTypeV3 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
291
+
292
+ /** v3 频道信息 (`APIChannelInfo`) */
293
+ export interface ChannelInfoV3 {
294
+ uId: number
295
+ uName: string
296
+ roomId: number
297
+ faceUrl: string
298
+ frameUrl: string
299
+ isLiving: boolean
300
+ isDeleted: boolean
301
+ title: string
302
+ tags: string[]
303
+ lastLiveDate: number
304
+ lastLiveDanmakuCount: number
305
+ totalDanmakuCount: number
306
+ totalIncome: number
307
+ totalLiveCount: number
308
+ totalLiveSecond: number
309
+ addDate: Date
310
+ /** present only when the channel is currently living */
311
+ livingInfo?: LiveInfoV3
312
+ commentCount: number
313
+ fansCount: number
314
+ followCount: number
315
+ lastUpdateStatAt: number
316
+ lastLiveIncome: number
317
+ recordingStatus?: ChannelRecordingStatusV3
318
+ }
319
+
320
+ /** v3 录播状态 (`APIChannelRecordingStatus`) */
321
+ export interface ChannelRecordingStatusV3 {
322
+ publicUsers: ChannelRecordingUserV3[]
323
+ privateCount: number
324
+ }
325
+
326
+ /** Item of `ChannelRecordingStatusV3` (`APIChannelRecordingUser`) */
327
+ export interface ChannelRecordingUserV3 {
328
+ accountId: number
329
+ name: string
330
+ }
331
+
332
+ /** v3 单场直播信息 (`APILiveInfo`) */
333
+ export interface LiveInfoV3 {
334
+ liveId: string
335
+ isFinish: boolean
336
+ isFull: boolean
337
+ isMerged: boolean
338
+ parentArea: string
339
+ area: string
340
+ coverUrl: string
341
+ danmakusCount: number
342
+ startDate: number
343
+ /** null while the live is still ongoing */
344
+ stopDate: number
345
+ title: string
346
+ totalIncome: number
347
+ watchCount: number
348
+ likeCount: number
349
+ payCount: number
350
+ interactionCount: number
351
+ /** nullable */
352
+ onlineRank: number
353
+ maxOnlineCount: number
354
+ commentCount: number
355
+ extra?: LiveExtraDataV3
356
+ versions?: LiveVersionInfoV3[]
357
+ }
358
+
359
+ /** v3 直播版本信息 (`APILiveVersionInfo`) */
360
+ export interface LiveVersionInfoV3 {
361
+ live: LiveInfoV3
362
+ userName: string
363
+ userId: number
364
+ isOfficial: boolean
365
+ isFull: boolean
366
+ rangeDanmakusCount: number
367
+ }
368
+
369
+ /** v3 直播扩展数据 (`LiveResponeExtraData`) */
370
+ export interface LiveExtraDataV3 {
371
+ wordCloud: { [key: string]: number }
372
+ onlineRank: { [key: string]: number }
373
+ blockUsers: number[]
374
+ }
375
+
376
+ /** v3 弹幕发送者 (`ActorV3`) */
377
+ export interface ActorV3 {
378
+ uid: number
379
+ name: string
380
+ }
381
+
382
+ /** v3 直播间表情 (`RoomEmojiV3`) */
383
+ export interface RoomEmojiV3 {
384
+ name: string
385
+ resource: string
386
+ }
387
+
388
+ /**
389
+ * v3 弹幕负载 (`DanmakuPayloadV3`)
390
+ *
391
+ * 各字段按 {@link DanmakuRecordV3.payloadKind} 的不同而有所取舍,多数字段可缺省。
392
+ */
393
+ export interface DanmakuPayloadV3 {
394
+ rawText?: string
395
+ roomEmojiId?: number
396
+ name?: string
397
+ count?: number
398
+ price?: number
399
+ mysteryBoxName?: string
400
+ mysteryBoxPrice?: number
401
+ previousTitle?: string
402
+ currentTitle?: string
403
+ previousParentArea?: string
404
+ previousArea?: string
405
+ currentParentArea?: string
406
+ currentArea?: string
407
+ text?: string
408
+ }
409
+
410
+ /** v3 弹幕记录 (`DanmakuRecordV3`) */
411
+ export interface DanmakuRecordV3 {
412
+ ts: number
413
+ type: DanmakuTypeV3
414
+ /** index into `DanmakuFrameV3.actors`, nullable */
415
+ actorId?: number
416
+ /** 如存在,这条弹幕由用户补充上传,非本站直接采集 */
417
+ uploadAccountId?: number
418
+ payloadKind: DanmakuPayloadKindV3
419
+ payload: DanmakuPayloadV3
420
+ }
421
+
422
+ /** v3 弹幕帧(共享 actor / emoji 池的弹幕集合)(`DanmakuFrameV3`) */
423
+ export interface DanmakuFrameV3 {
424
+ actors: ActorV3[]
425
+ roomEmojis: RoomEmojiV3[]
426
+ records: DanmakuRecordV3[]
427
+ }
428
+
429
+ /**
430
+ * 单场直播信息
431
+ * @link https://ukamnads.icu/api/v3/lives/{liveId}?include=extra
432
+ */
433
+ export interface LiveV3Props {
434
+ /** 200: success */
435
+ code: number
436
+ message: string
437
+ data: LiveV3Data
438
+ }
439
+
440
+ /** Data of `LiveV3Props` (`LiveResponseV3`) */
441
+ export interface LiveV3Data {
442
+ channel: ChannelInfoV3
443
+ live: LiveInfoV3
444
+ }
445
+
446
+ /**
447
+ * 单场直播弹幕(分页)
448
+ * @link https://ukamnads.icu/api/v3/lives/{liveId}/danmakus?offset=0&limit=2000
449
+ */
450
+ export interface LiveDanmakusV3Props {
451
+ /** 200: success */
452
+ code: number
453
+ message: string
454
+ data: LiveDanmakusV3Data
455
+ }
456
+
457
+ /** Data of `LiveDanmakusV3Props` (`LiveDanmakusPageV3`) */
458
+ export interface LiveDanmakusV3Data {
459
+ total: number
460
+ offset: number
461
+ limit: number
462
+ hasMore: boolean
463
+ frame: DanmakuFrameV3
464
+ }
465
+
466
+ /**
467
+ * 用户观看/事件历史(分页)
468
+ * @link https://ukamnads.icu/api/v3/users/{userId}/history?page=1&pageSize=10
469
+ */
470
+ export interface UserHistoryV3Props {
471
+ /** 200: success */
472
+ code: number
473
+ message: string
474
+ data: UserHistoryV3Data
475
+ }
476
+
477
+ /** Data of `UserHistoryV3Props` (`UserHistoryResponseV3`) */
478
+ export interface UserHistoryV3Data {
479
+ total: number
480
+ page: number
481
+ pageSize: number
482
+ hasMore: boolean
483
+ items: UserHistoryItemV3[]
484
+ }
485
+
486
+ /** Item of `UserHistoryV3Data` (`UserHistoryItemV3`) */
487
+ export interface UserHistoryItemV3 {
488
+ channel: ChannelInfoV3
489
+ live: LiveInfoV3
490
+ danmakus: DanmakuFrameV3
491
+ }
492
+
493
+ /**
494
+ * 用户首屏聚合数据(历史 + 看过的主播 + 封禁记录)
495
+ * @link https://ukamnads.icu/api/v3/users/{userId}/bootstrap?page=1&pageSize=10
496
+ */
497
+ export interface UserBootstrapV3Props {
498
+ /** 200: success */
499
+ code: number
500
+ message: string
501
+ data: UserBootstrapV3Data
502
+ }
503
+
504
+ /** Data of `UserBootstrapV3Props` (`UserBootstrapResponseV3`) */
505
+ export interface UserBootstrapV3Data {
506
+ history: UserHistoryV3Data
507
+ watchedChannels: WatchedChannelSummaryV3[]
508
+ blocks: UserBlockHistoryItemV3[]
509
+ historyUserNames: string[]
510
+ }
511
+
512
+ /** Item of `UserBootstrapV3Data.watchedChannels` (`WatchedChannelSummaryV3`) */
513
+ export interface WatchedChannelSummaryV3 {
514
+ uName: string
515
+ uId: number
516
+ faceUrl: string
517
+ count: number
518
+ }
519
+
520
+ /** Item of `UserBootstrapV3Data.blocks` (`UserBlockHistoryItemV3`) */
521
+ export interface UserBlockHistoryItemV3 {
522
+ uName: string
523
+ uId: number
524
+ faceUrl: string
525
+ date: number
526
+ liveId: string
527
+ }
528
+
529
+ /**
530
+ * 内置表情元数据
531
+ * @link https://ukamnads.icu/api/v3/meta/emoicons
532
+ */
533
+ export interface EmoiconsMetaV3Props {
534
+ /** 200: success */
535
+ code: number
536
+ message: string
537
+ data: EmoiconsMetaV3Data
538
+ }
539
+
540
+ /** Data of `EmoiconsMetaV3Props` (`EmoiconsMetaResponseV3`) */
541
+ export interface EmoiconsMetaV3Data {
542
+ version: number
543
+ builtinEmojis: BuiltinEmojiMetaV3[]
544
+ }
545
+
546
+ /** Item of `EmoiconsMetaV3Data.builtinEmojis` (`BuiltinEmojiMetaV3`) */
547
+ export interface BuiltinEmojiMetaV3 {
548
+ token: string
549
+ url: string
550
+ }
551
+
552
+ /**
553
+ * 创建用户分析任务请求体
554
+ * @link https://ukamnads.icu/api/v3/user-analysis-jobs
555
+ */
556
+ export interface CreateUserAnalyzeJobV3Request {
557
+ userId: number
558
+ startTime: number
559
+ endTime: number
560
+ }
561
+
562
+ /** Response of `POST /api/v3/user-analysis-jobs` (`CreateUserAnalyzeJobResponse`) */
563
+ export interface CreateUserAnalyzeJobV3Response {
564
+ jobId: string
565
+ }
566
+
567
+ /**
568
+ * 用户分析任务状态
569
+ * @link https://ukamnads.icu/api/v3/user-analysis-jobs/{jobId}
570
+ */
571
+ export interface UserAnalyzeJobV3Summary {
572
+ jobId: string
573
+ status: UserAnalyzeJobStatusV3
574
+ latestEvent: UserAnalyzeEventV3
575
+ }
576
+
577
+ /** Progress event of a user analysis job (`UserAnalyzeEvent`) */
578
+ export interface UserAnalyzeEventV3 {
579
+ type: UserAnalyzeEventTypeV3
580
+ message: string
581
+ progress: number
582
+ loadedLives: number
583
+ totalLives: number
584
+ loadedDanmakus: number
585
+ }
258
586
  }