@yagolive/event-kit 1.0.3 → 1.0.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # Changelog
2
2
 
3
+ ## @1.0.5 (2026-06-08)
4
+
5
+ ### 新增
6
+
7
+ - **Recharge Action**: 新增充值操作动作类型
8
+ - `ActionType.RECHARGE` = `'recharge'`
9
+ - `Recharge` 数据类:仅含 `text` 可选字段(继承自 `Base`)
10
+ - `ActionCreator.buildRecharge()`、`createRechargeAction()`、`createRechargeActionWithData()`
11
+ - `ActionBridge.recharge()`、`buildRecharge()`、`createRechargeAction()`、`createRechargeActionWithData()`
12
+
13
+ ### Action 类型完整列表
14
+
15
+ | 类型 | 字段 | 说明 |
16
+ |------|------|------|
17
+ | jump | path: string, text?: string | 页面跳转 |
18
+ | navigate | screen: string, params?: Record, text?: string | 导航到指定屏幕 |
19
+ | replace | screen: string, params?: Record, text?: string | 替换当前页面 |
20
+ | goback | text?: string | 返回上一页 |
21
+ | enter_room | id?: number, match?: string, callbacks?: Record, useReplace?: boolean, text?: string | 进入房间 |
22
+ | live_detect | text?: string | 活体检测 |
23
+ | onelink | url: string, share?: boolean, text?: string | 分享链接 |
24
+ | agency_invite | id: number, type: string, title?: string, message?: string, agencyInfo?: AgencyInfo, accepted?: boolean, text?: string | 工会邀请 |
25
+ | recharge | text?: string | 充值操作 |
26
+
27
+ ---
28
+
29
+ ## @1.0.4 (2026-05-28)
30
+
31
+ ### 修改
32
+
33
+ - **EnterRoom.match 字段类型规范化**: 明确 `match` 字段类型为 `BSRoomMatchType` 枚举值
34
+ - 支持的匹配类型:`'recommend'`(推荐房间列表)、`'follow'`(关注)、`'agency'`(本公会的公会房)
35
+ - 移除了之前兼容的 `'hot'`、`'top3'` 字符串值
36
+ - JS/d.ts 类型保持 `string | null`,确保向后兼容性
37
+ - 测试页面新增 `testEnterRoomWithMatch()` 函数用于测试匹配模式
38
+
39
+ ### Action 类型完整列表
40
+
41
+ | 类型 | 字段 | 说明 |
42
+ |------|------|------|
43
+ | jump | path: string, text?: string | 页面跳转 |
44
+ | navigate | screen: string, params?: Record, text?: string | 导航到指定屏幕 |
45
+ | replace | screen: string, params?: Record, text?: string | 替换当前页面 |
46
+ | goback | text?: string | 返回上一页 |
47
+ | enter_room | id?: number, match?: string, callbacks?: Record, useReplace?: boolean, text?: string | 进入房间 |
48
+ | live_detect | text?: string | 活体检测 |
49
+ | onelink | url: string, share?: boolean, text?: string | 分享链接 |
50
+ | agency_invite | id: number, type: string, title?: string, message?: string, agencyInfo?: AgencyInfo, accepted?: boolean, text?: string | 工会邀请 |
51
+
52
+ ---
53
+
3
54
  ## @1.0.3 (2026-05-27)
4
55
 
5
56
  ### 修改
package/README.md CHANGED
@@ -21,6 +21,10 @@ YAGO App Action 创建与通信工具库,支持浏览器、React、Vue 等多
21
21
  └─────────────────────────────────────────────────────┘
22
22
  ```
23
23
 
24
+ ## 更新日志
25
+
26
+ 详细更新日志请查看 [CHANGELOG](./CHANGELOG.md)。
27
+
24
28
  ## 安装
25
29
 
26
30
  ```bash
@@ -165,8 +169,8 @@ import { ActionCreator } from '@yagolive/event-kit';
165
169
 
166
170
  | 属性 | 类型 | 说明 |
167
171
  |------|------|------|
168
- | `ActionData` | Object | 包含所有数据类型类:Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite |
169
- | `ActionType` | Object | Action 类型枚举:JUMP, NAVIGATE, REPLACE, GOBACK, ENTER_ROOM, LIVE_DETECT, ONELINK, AGENCY_INVITE |
172
+ | `ActionData` | Object | 包含所有数据类型类:Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite, Recharge |
173
+ | `ActionType` | Object | Action 类型枚举:JUMP, NAVIGATE, REPLACE, GOBACK, ENTER_ROOM, LIVE_DETECT, ONELINK, AGENCY_INVITE, RECHARGE |
170
174
 
171
175
  #### 工厂方法
172
176
 
@@ -198,6 +202,9 @@ import { ActionCreator } from '@yagolive/event-kit';
198
202
  | `buildAgencyInvite(id, type)` | id: number, type: string | AgencyInvite | 构建 AgencyInvite 对象(链式配置) |
199
203
  | `createAgencyInviteAction(id, type)` | id: number, type: string | Action | 创建工会邀请 Action |
200
204
  | `createAgencyInviteActionWithData(agencyInvite)` | agencyInvite: AgencyInvite | Action | 从 AgencyInvite 对象创建 Action |
205
+ | `buildRecharge()` | - | Recharge | 构建 Recharge 对象(链式配置) |
206
+ | `createRechargeAction()` | - | Action | 创建充值 Action |
207
+ | `createRechargeActionWithData(recharge)` | recharge: Recharge | Action | 从 Recharge 对象创建 Action |
201
208
 
202
209
  #### 使用示例
203
210
 
@@ -239,6 +246,7 @@ ActionType.ENTER_ROOM // 'enter_room'
239
246
  ActionType.LIVE_DETECT // 'live_detect'
240
247
  ActionType.ONELINK // 'onelink'
241
248
  ActionType.AGENCY_INVITE // 'agency_invite'
249
+ ActionType.RECHARGE // 'recharge'
242
250
  ```
243
251
 
244
252
  ### ActionBridge
@@ -309,6 +317,9 @@ new ActionBridge(adapter, options?)
309
317
  | `agencyInvite(id, type)` | id: number, type: string | Promise | 工会邀请 |
310
318
  | `buildAgencyInvite(id, type)` | id: number, type: string | AgencyInvite | 构建 AgencyInvite 对象(链式配置) |
311
319
  | `createAgencyInviteActionWithData(agencyInvite)` | agencyInvite: AgencyInvite | Action | 从 AgencyInvite 对象创建 Action(不自动发送) |
320
+ | `recharge()` | - | Promise | 充值操作 |
321
+ | `buildRecharge()` | - | Recharge | 构建 Recharge 对象(链式配置) |
322
+ | `createRechargeActionWithData(recharge)` | recharge: Recharge | Action | 从 Recharge 对象创建 Action(不自动发送) |
312
323
 
313
324
  #### 静态方法
314
325
 
@@ -668,6 +679,15 @@ Onelink Action 数据。
668
679
  | `setOwnerName(ownerName)` | ownerName: string | 设置工会长名称,返回 this |
669
680
  | `setOwnerAvatar(ownerAvatar)` | ownerAvatar: string | 设置工会长头像 URL,返回 this |
670
681
 
682
+ ### Recharge
683
+
684
+ 充值操作 Action 数据。
685
+
686
+ | 方法 | 参数 | 说明 |
687
+ |------|------|------|
688
+ | `constructor()` | - | 创建充值数据 |
689
+ | `setText(text)` | text: string | 设置显示文本,返回 this |
690
+
671
691
  ### Action
672
692
 
673
693
  Action 对象,封装类型和数据。
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * YAGO Event Kit - Action Bridge (Full)
3
- * @version 1.0.3
3
+ * @version 1.0.5
4
4
  *
5
5
  * Generated by build script - do not edit manually.
6
6
  * Supports: Browser script tag, CommonJS, AMD
@@ -493,6 +493,26 @@ AgencyInvite.AgencyInfo = AgencyInfo;
493
493
  AgencyInvite.AgencyInviteType = AgencyInviteType;
494
494
  var AgencyInvite_default = AgencyInvite;
495
495
 
496
+ // src/core/types/Recharge.js
497
+ var Recharge = class {
498
+ constructor() {
499
+ this.text = null;
500
+ }
501
+ getText() {
502
+ return this.text;
503
+ }
504
+ setText(text) {
505
+ this.text = text;
506
+ return this;
507
+ }
508
+ toMap() {
509
+ var map = {};
510
+ if (this.text != null) map.text = this.text;
511
+ return map;
512
+ }
513
+ };
514
+ var Recharge_default = Recharge;
515
+
496
516
  // src/core/types/Action.js
497
517
  var Action = class {
498
518
  constructor(type, data) {
@@ -538,7 +558,8 @@ var ActionType = {
538
558
  ENTER_ROOM: "enter_room",
539
559
  LIVE_DETECT: "live_detect",
540
560
  ONELINK: "onelink",
541
- AGENCY_INVITE: "agency_invite"
561
+ AGENCY_INVITE: "agency_invite",
562
+ RECHARGE: "recharge"
542
563
  };
543
564
  var ActionData = {
544
565
  Jump: Jump_default,
@@ -548,7 +569,8 @@ var ActionData = {
548
569
  EnterRoom: EnterRoom_default,
549
570
  LiveDetect: LiveDetect_default,
550
571
  Onelink: Onelink_default,
551
- AgencyInvite: AgencyInvite_default
572
+ AgencyInvite: AgencyInvite_default,
573
+ Recharge: Recharge_default
552
574
  };
553
575
  var ActionCreator = {
554
576
  ActionData,
@@ -640,6 +662,16 @@ var ActionCreator = {
640
662
  },
641
663
  createAgencyInviteActionWithData(agencyInvite) {
642
664
  return new Action_default(ActionType.AGENCY_INVITE, agencyInvite);
665
+ },
666
+ // Recharge
667
+ buildRecharge() {
668
+ return new Recharge_default();
669
+ },
670
+ createRechargeAction() {
671
+ return new Action_default(ActionType.RECHARGE, new Recharge_default());
672
+ },
673
+ createRechargeActionWithData(recharge) {
674
+ return new Action_default(ActionType.RECHARGE, recharge);
643
675
  }
644
676
  };
645
677
 
@@ -915,6 +947,18 @@ var ActionBridge = class _ActionBridge {
915
947
  createAgencyInviteActionWithData(agencyInvite) {
916
948
  return ActionCreator.createAgencyInviteActionWithData(agencyInvite);
917
949
  }
950
+ recharge() {
951
+ return this._adapter.sendAction(ActionCreator.createRechargeAction());
952
+ }
953
+ buildRecharge() {
954
+ return ActionCreator.buildRecharge();
955
+ }
956
+ createRechargeAction() {
957
+ return ActionCreator.createRechargeAction();
958
+ }
959
+ createRechargeActionWithData(recharge) {
960
+ return ActionCreator.createRechargeActionWithData(recharge);
961
+ }
918
962
  destroy() {
919
963
  if (typeof this._adapter.destroy === "function") {
920
964
  this._adapter.destroy();
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * YAGO Event Kit - Action Creator (Core Only)
3
- * @version 1.0.3
3
+ * @version 1.0.5
4
4
  *
5
5
  * Generated by build script - do not edit manually.
6
6
  * Supports: Browser script tag, CommonJS, AMD
@@ -493,6 +493,26 @@ AgencyInvite.AgencyInfo = AgencyInfo;
493
493
  AgencyInvite.AgencyInviteType = AgencyInviteType;
494
494
  var AgencyInvite_default = AgencyInvite;
495
495
 
496
+ // src/core/types/Recharge.js
497
+ var Recharge = class {
498
+ constructor() {
499
+ this.text = null;
500
+ }
501
+ getText() {
502
+ return this.text;
503
+ }
504
+ setText(text) {
505
+ this.text = text;
506
+ return this;
507
+ }
508
+ toMap() {
509
+ var map = {};
510
+ if (this.text != null) map.text = this.text;
511
+ return map;
512
+ }
513
+ };
514
+ var Recharge_default = Recharge;
515
+
496
516
  // src/core/types/Action.js
497
517
  var Action = class {
498
518
  constructor(type, data) {
@@ -538,7 +558,8 @@ var ActionType = {
538
558
  ENTER_ROOM: "enter_room",
539
559
  LIVE_DETECT: "live_detect",
540
560
  ONELINK: "onelink",
541
- AGENCY_INVITE: "agency_invite"
561
+ AGENCY_INVITE: "agency_invite",
562
+ RECHARGE: "recharge"
542
563
  };
543
564
  var ActionData = {
544
565
  Jump: Jump_default,
@@ -548,7 +569,8 @@ var ActionData = {
548
569
  EnterRoom: EnterRoom_default,
549
570
  LiveDetect: LiveDetect_default,
550
571
  Onelink: Onelink_default,
551
- AgencyInvite: AgencyInvite_default
572
+ AgencyInvite: AgencyInvite_default,
573
+ Recharge: Recharge_default
552
574
  };
553
575
  var ActionCreator = {
554
576
  ActionData,
@@ -640,6 +662,16 @@ var ActionCreator = {
640
662
  },
641
663
  createAgencyInviteActionWithData(agencyInvite) {
642
664
  return new Action_default(ActionType.AGENCY_INVITE, agencyInvite);
665
+ },
666
+ // Recharge
667
+ buildRecharge() {
668
+ return new Recharge_default();
669
+ },
670
+ createRechargeAction() {
671
+ return new Action_default(ActionType.RECHARGE, new Recharge_default());
672
+ },
673
+ createRechargeActionWithData(recharge) {
674
+ return new Action_default(ActionType.RECHARGE, recharge);
643
675
  }
644
676
  };
645
677
 
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
2
  "name": "@yagolive/event-kit",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "YAGO Event Kit - 跨环境 Action 创建与通信工具库,支持浏览器、React、Vue",
5
5
  "main": "src/index.js",
6
- "browser": "build/js/action_bridge.umd.js",
6
+ "browser": "dist/js/action_bridge.umd.js",
7
7
  "types": "src/index.d.ts",
8
8
  "files": [
9
9
  "src/",
10
- "build/",
10
+ "dist/",
11
11
  "CHANGELOG.md"
12
12
  ],
13
13
  "exports": {
14
14
  ".": {
15
15
  "types": "./src/index.d.ts",
16
- "browser": "./build/js/action_bridge.umd.js",
16
+ "browser": "./dist/js/action_bridge.umd.js",
17
17
  "import": "./src/index.js",
18
18
  "require": "./src/index.js",
19
19
  "default": "./src/index.js"
20
20
  },
21
21
  "./core": {
22
22
  "types": "./src/core/index.d.ts",
23
- "browser": "./build/js/action_creator.umd.js",
23
+ "browser": "./dist/js/action_creator.umd.js",
24
24
  "import": "./src/core/index.js",
25
25
  "require": "./src/core/index.js",
26
26
  "default": "./src/core/index.js"
@@ -167,6 +167,20 @@ export default class ActionBridge {
167
167
  return ActionCreator.createAgencyInviteActionWithData(agencyInvite);
168
168
  }
169
169
 
170
+ recharge() {
171
+ return this._adapter.sendAction(ActionCreator.createRechargeAction());
172
+ }
173
+
174
+ buildRecharge() {
175
+ return ActionCreator.buildRecharge();
176
+ }
177
+ createRechargeAction() {
178
+ return ActionCreator.createRechargeAction();
179
+ }
180
+ createRechargeActionWithData(recharge) {
181
+ return ActionCreator.createRechargeActionWithData(recharge);
182
+ }
183
+
170
184
  destroy() {
171
185
  if (typeof this._adapter.destroy === 'function') {
172
186
  this._adapter.destroy();
@@ -1,5 +1,5 @@
1
1
  import {
2
- Action, Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite,
2
+ Action, Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite, Recharge,
3
3
  ActionType, ActionData, ActionCreator,
4
4
  } from '../core/index.js';
5
5
  import { IActionAdapter, RNWebViewAdapter, MockAdapter, AdapterOptions } from '../adapters/index.js';
@@ -56,6 +56,11 @@ export declare class ActionBridge {
56
56
  createAgencyInviteAction(id: number, type: string): Action;
57
57
  createAgencyInviteActionWithData(agencyInvite: AgencyInvite): Action;
58
58
 
59
+ recharge(): Promise<any>;
60
+ buildRecharge(): Recharge;
61
+ createRechargeAction(): Action;
62
+ createRechargeActionWithData(recharge: Recharge): Action;
63
+
59
64
  destroy(): void;
60
65
 
61
66
  static ActionCreator: typeof ActionCreator;
@@ -6,6 +6,7 @@ import Goback from './types/Goback.js';
6
6
  import LiveDetect from './types/LiveDetect.js';
7
7
  import Onelink from './types/Onelink.js';
8
8
  import AgencyInvite from './types/AgencyInvite.js';
9
+ import Recharge from './types/Recharge.js';
9
10
  import Action from './types/Action.js';
10
11
 
11
12
  const ActionType = {
@@ -17,6 +18,7 @@ const ActionType = {
17
18
  LIVE_DETECT: 'live_detect',
18
19
  ONELINK: 'onelink',
19
20
  AGENCY_INVITE: 'agency_invite',
21
+ RECHARGE: 'recharge',
20
22
  };
21
23
 
22
24
  const ActionData = {
@@ -28,6 +30,7 @@ const ActionData = {
28
30
  LiveDetect,
29
31
  Onelink,
30
32
  AgencyInvite,
33
+ Recharge,
31
34
  };
32
35
 
33
36
  const ActionCreator = {
@@ -147,6 +150,19 @@ const ActionCreator = {
147
150
  createAgencyInviteActionWithData(agencyInvite) {
148
151
  return new Action(ActionType.AGENCY_INVITE, agencyInvite);
149
152
  },
153
+
154
+ // Recharge
155
+ buildRecharge() {
156
+ return new Recharge();
157
+ },
158
+
159
+ createRechargeAction() {
160
+ return new Action(ActionType.RECHARGE, new Recharge());
161
+ },
162
+
163
+ createRechargeActionWithData(recharge) {
164
+ return new Action(ActionType.RECHARGE, recharge);
165
+ },
150
166
  };
151
167
 
152
168
  export { ActionCreator, ActionData, ActionType };
@@ -183,6 +183,14 @@ export class AgencyInvite {
183
183
  toMap(): Record<string, any>;
184
184
  }
185
185
 
186
+ export class Recharge {
187
+ constructor();
188
+ text: string | null;
189
+ getText(): string | null;
190
+ setText(text: string): this;
191
+ toMap(): Record<string, any>;
192
+ }
193
+
186
194
  export class Action {
187
195
  constructor(type: ActionTypeValue, data: any);
188
196
  type: ActionTypeValue;
@@ -196,7 +204,7 @@ export class Action {
196
204
  toJson(): string;
197
205
  }
198
206
 
199
- export type ActionTypeValue = 'jump' | 'navigate' | 'replace' | 'goback' | 'enter_room' | 'live_detect' | 'onelink' | 'agency_invite';
207
+ export type ActionTypeValue = 'jump' | 'navigate' | 'replace' | 'goback' | 'enter_room' | 'live_detect' | 'onelink' | 'agency_invite' | 'recharge';
200
208
 
201
209
  export const ActionType: {
202
210
  JUMP: 'jump';
@@ -207,6 +215,7 @@ export const ActionType: {
207
215
  LIVE_DETECT: 'live_detect';
208
216
  ONELINK: 'onelink';
209
217
  AGENCY_INVITE: 'agency_invite';
218
+ RECHARGE: 'recharge';
210
219
  };
211
220
 
212
221
  export const ActionData: {
@@ -218,6 +227,7 @@ export const ActionData: {
218
227
  LiveDetect: typeof LiveDetect;
219
228
  Onelink: typeof Onelink;
220
229
  AgencyInvite: typeof AgencyInvite;
230
+ Recharge: typeof Recharge;
221
231
  };
222
232
 
223
233
  export const ActionCreator: {
@@ -249,4 +259,7 @@ export const ActionCreator: {
249
259
  buildAgencyInvite(id: number, type: string): AgencyInvite;
250
260
  createAgencyInviteAction(id: number, type: string): Action;
251
261
  createAgencyInviteActionWithData(agencyInvite: AgencyInvite): Action;
262
+ buildRecharge(): Recharge;
263
+ createRechargeAction(): Action;
264
+ createRechargeActionWithData(recharge: Recharge): Action;
252
265
  };
package/src/core/index.js CHANGED
@@ -7,4 +7,5 @@ export { default as EnterRoom } from './types/EnterRoom.js';
7
7
  export { default as LiveDetect } from './types/LiveDetect.js';
8
8
  export { default as Onelink } from './types/Onelink.js';
9
9
  export { default as AgencyInvite } from './types/AgencyInvite.js';
10
+ export { default as Recharge } from './types/Recharge.js';
10
11
  export { default as Action } from './types/Action.js';
@@ -0,0 +1,16 @@
1
+ class Recharge {
2
+ constructor() {
3
+ this.text = null;
4
+ }
5
+
6
+ getText() { return this.text; }
7
+ setText(text) { this.text = text; return this; }
8
+
9
+ toMap() {
10
+ var map = {};
11
+ if (this.text != null) map.text = this.text;
12
+ return map;
13
+ }
14
+ }
15
+
16
+ export default Recharge;
package/src/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { ActionBridge } from './bridge/index.js';
2
- export { ActionCreator, ActionData, ActionType, Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite, Action } from './core/index.js';
2
+ export { ActionCreator, ActionData, ActionType, Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite, Recharge, Action } from './core/index.js';
3
3
  export { RNWebViewAdapter, MockAdapter, IActionAdapter, MockCall } from './adapters/index.js';
4
4
  export { ActionBridgeProvider, useActionBridge } from './integrations/react/index.js';
package/src/index.js CHANGED
@@ -9,4 +9,5 @@ export { EnterRoom } from './core/index.js';
9
9
  export { LiveDetect } from './core/index.js';
10
10
  export { Onelink } from './core/index.js';
11
11
  export { AgencyInvite } from './core/index.js';
12
+ export { Recharge } from './core/index.js';
12
13
  export { Action } from './core/index.js';