@yagolive/event-kit 1.0.1 → 1.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## @1.0.2 (2026-05-26)
4
+
5
+ ### 新增
6
+
7
+ - **AgencyInvite Action**: 新增工会邀请动作类型
8
+ - `ActionType.AGENCY_INVITE` = `'agency_invite'`
9
+ - `AgencyInvite` 数据类:必填字段 `id`(number)、`type`('to_be_member' | 'to_be_subagency');可选字段 `title`、`message`、`agencyInfo`(嵌套对象)、`accepted`(boolean)、`text`
10
+ - `AgencyInvite.AgencyInfo` 内部类:`id`、`name`、`ownerId`、`ownerName`
11
+ - `AgencyInvite.AgencyInviteType` 枚举:`TO_BE_MEMBER`、`TO_BE_SUBAGENCY`
12
+ - `ActionCreator.buildAgencyInvite(id, type)`、`createAgencyInviteAction(id, type)`、`createAgencyInviteActionWithData(agencyInvite)`
13
+ - `ActionBridge.agencyInvite(id, type)`、`buildAgencyInvite(id, type)`、`createAgencyInviteAction(id, type)`、`createAgencyInviteActionWithData(agencyInvite)`
14
+
15
+ ### Action 类型完整列表
16
+
17
+ | 类型 | 字段 | 说明 |
18
+ |------|------|------|
19
+ | jump | path: string, text?: string | 页面跳转 |
20
+ | navigate | screen: string, params?: Record, text?: string | 导航到指定屏幕 |
21
+ | replace | screen: string, params?: Record, text?: string | 替换当前页面 |
22
+ | goback | text?: string | 返回上一页 |
23
+ | enter_room | id?: number, match?: string, callbacks?: Record, useReplace?: boolean, text?: string | 进入房间 |
24
+ | live_detect | text?: string | 活体检测 |
25
+ | onelink | url: string, share?: boolean, text?: string | 分享链接 |
26
+ | agency_invite | id: number, type: string, title?: string, message?: string, agencyInfo?: AgencyInfo, accepted?: boolean, text?: string | 工会邀请 |
27
+
28
+ ---
29
+
3
30
  ## @1.0.1 (2026-05-22)
4
31
 
5
32
  ### 新增
package/README.md CHANGED
@@ -165,8 +165,8 @@ import { ActionCreator } from '@yagolive/event-kit';
165
165
 
166
166
  | 属性 | 类型 | 说明 |
167
167
  |------|------|------|
168
- | `ActionData` | Object | 包含所有数据类型类:Jump, Navigate, Replace, EnterRoom, LiveDetect, Onelink |
169
- | `ActionType` | Object | Action 类型枚举:JUMP, NAVIGATE, REPLACE, ENTER_ROOM, LIVE_DETECT, ONELINK |
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 |
170
170
 
171
171
  #### 工厂方法
172
172
 
@@ -183,6 +183,9 @@ import { ActionCreator } from '@yagolive/event-kit';
183
183
  | `createReplaceAction(screen)` | screen: string | Action | 创建替换导航 Action |
184
184
  | `createReplaceActionWithParams(screen, params)` | screen: string, params: Object | Action | 创建替换导航 Action(带参数) |
185
185
  | `createReplaceActionWithData(replace)` | replace: Replace | Action | 从 Replace 对象创建 Action |
186
+ | `buildGoback()` | - | Goback | 构建 Goback 对象(链式配置) |
187
+ | `createGobackAction()` | - | Action | 创建返回上一页 Action |
188
+ | `createGobackActionWithData(goback)` | goback: Goback | Action | 从 Goback 对象创建 Action |
186
189
  | `buildEnterRoom()` | - | EnterRoom | 构建 EnterRoom 对象(链式配置) |
187
190
  | `createEnterRoomAction(id)` | id: number | Action | 创建进房 Action |
188
191
  | `createEnterRoomActionWithData(enterRoom)` | enterRoom: EnterRoom | Action | 从 EnterRoom 对象创建 Action |
@@ -192,6 +195,9 @@ import { ActionCreator } from '@yagolive/event-kit';
192
195
  | `buildOnelink(url?)` | url?: string | Onelink | 构建 Onelink 对象(链式配置) |
193
196
  | `createOnelinkAction(url)` | url: string | Action | 创建 Onelink Action |
194
197
  | `createOnelinkActionWithData(onelink)` | onelink: Onelink | Action | 从 Onelink 对象创建 Action |
198
+ | `buildAgencyInvite(id, type)` | id: number, type: string | AgencyInvite | 构建 AgencyInvite 对象(链式配置) |
199
+ | `createAgencyInviteAction(id, type)` | id: number, type: string | Action | 创建工会邀请 Action |
200
+ | `createAgencyInviteActionWithData(agencyInvite)` | agencyInvite: AgencyInvite | Action | 从 AgencyInvite 对象创建 Action |
195
201
 
196
202
  #### 使用示例
197
203
 
@@ -228,9 +234,11 @@ import { ActionType } from '@yagolive/event-kit';
228
234
  ActionType.JUMP // 'jump'
229
235
  ActionType.NAVIGATE // 'navigate'
230
236
  ActionType.REPLACE // 'replace'
237
+ ActionType.GOBACK // 'goback'
231
238
  ActionType.ENTER_ROOM // 'enter_room'
232
239
  ActionType.LIVE_DETECT // 'live_detect'
233
240
  ActionType.ONELINK // 'onelink'
241
+ ActionType.AGENCY_INVITE // 'agency_invite'
234
242
  ```
235
243
 
236
244
  ### ActionBridge
@@ -285,6 +293,9 @@ new ActionBridge(adapter, options?)
285
293
  | `replace(screen, params?)` | screen: string, params?: Object | Promise | 替换当前页面 |
286
294
  | `buildReplace(screen?, params?)` | screen?: string, params?: Object | Replace | 构建 Replace 对象(链式配置) |
287
295
  | `createReplaceActionWithData(replace)` | replace: Replace | Action | 从 Replace 对象创建 Action(不自动发送) |
296
+ | `goback()` | - | Promise | 返回上一页 |
297
+ | `buildGoback()` | - | Goback | 构建 Goback 对象(链式配置) |
298
+ | `createGobackActionWithData(goback)` | goback: Goback | Action | 从 Goback 对象创建 Action(不自动发送) |
288
299
  | `enterRoom(id)` | id: number | Promise | 进入房间 |
289
300
  | `buildEnterRoom()` | - | EnterRoom | 构建 EnterRoom 对象(链式配置) |
290
301
  | `createEnterRoomAction(id)` | id: number | Action | 创建进房 Action(不自动发送) |
@@ -295,6 +306,9 @@ new ActionBridge(adapter, options?)
295
306
  | `onelink(url)` | url: string | Promise | 打开 Onelink |
296
307
  | `buildOnelink(url?)` | url?: string | Onelink | 构建 Onelink 对象(链式配置) |
297
308
  | `createOnelinkActionWithData(onelink)` | onelink: Onelink | Action | 从 Onelink 对象创建 Action(不自动发送) |
309
+ | `agencyInvite(id, type)` | id: number, type: string | Promise | 工会邀请 |
310
+ | `buildAgencyInvite(id, type)` | id: number, type: string | AgencyInvite | 构建 AgencyInvite 对象(链式配置) |
311
+ | `createAgencyInviteActionWithData(agencyInvite)` | agencyInvite: AgencyInvite | Action | 从 AgencyInvite 对象创建 Action(不自动发送) |
298
312
 
299
313
  #### 静态方法
300
314
 
@@ -567,6 +581,15 @@ export default {
567
581
 
568
582
  替换导航 Action 数据,继承自 Navigate,API 相同。
569
583
 
584
+ ### Goback
585
+
586
+ 返回上一页 Action 数据。
587
+
588
+ | 方法 | 参数 | 说明 |
589
+ |------|------|------|
590
+ | `constructor()` | - | 创建返回数据 |
591
+ | `setText(text)` | text: string | 设置显示文本,返回 this |
592
+
570
593
  ### EnterRoom
571
594
 
572
595
  进房 Action 数据。
@@ -613,6 +636,37 @@ Onelink Action 数据。
613
636
  | `setUrl(url)` | url: string (必填) | 设置链接 URL,返回 this |
614
637
  | `setShare(share)` | share: boolean | 设置是否显示分享弹窗,返回 this |
615
638
 
639
+ ### AgencyInvite
640
+
641
+ 工会邀请 Action 数据。
642
+
643
+ | 方法 | 参数 | 说明 |
644
+ |------|------|------|
645
+ | `constructor(id, type)` | id: number (必填), type: string (必填) | 创建工会邀请数据 |
646
+ | `setText(text)` | text: string | 设置显示文本,返回 this |
647
+ | `setId(id)` | id: number | 设置邀请 ID,返回 this |
648
+ | `setType(type)` | type: string | 设置邀请类型('to_be_member' \| 'to_be_subagency'),返回 this |
649
+ | `setTitle(title)` | title: string | 设置邀请标题,返回 this |
650
+ | `setMessage(message)` | message: string | 设置邀请内容,返回 this |
651
+ | `setAgencyInfo(agencyInfo)` | agencyInfo: AgencyInfo | 设置工会信息,返回 this |
652
+ | `setAccepted(accepted)` | accepted: boolean | 设置邀请状态,返回 this |
653
+
654
+ **静态属性:**
655
+
656
+ | 属性 | 说明 |
657
+ |------|------|
658
+ | `AgencyInvite.AgencyInviteType` | 邀请类型枚举:TO_BE_MEMBER, TO_BE_SUBAGENCY |
659
+ | `AgencyInvite.AgencyInfo` | 工会信息内部类 |
660
+
661
+ **AgencyInfo 内部类:**
662
+
663
+ | 方法 | 参数 | 说明 |
664
+ |------|------|------|
665
+ | `setId(id)` | id: string | 设置工会 ID,返回 this |
666
+ | `setName(name)` | name: string | 设置工会名称,返回 this |
667
+ | `setOwnerId(ownerId)` | ownerId: string | 设置工会长 ID,返回 this |
668
+ | `setOwnerName(ownerName)` | ownerName: string | 设置工会长名称,返回 this |
669
+
616
670
  ### Action
617
671
 
618
672
  Action 对象,封装类型和数据。
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * YAGO Event Kit - Action Bridge (Full)
3
- * @version 1.0.1
3
+ * @version 1.0.2
4
4
  *
5
5
  * Generated by build script - do not edit manually.
6
6
  * Supports: Browser script tag, CommonJS, AMD
@@ -358,6 +358,132 @@ var Onelink = class {
358
358
  };
359
359
  var Onelink_default = Onelink;
360
360
 
361
+ // src/core/types/AgencyInvite.js
362
+ var AgencyInfo = class {
363
+ constructor() {
364
+ this.id = null;
365
+ this.name = null;
366
+ this.ownerId = null;
367
+ this.ownerName = null;
368
+ }
369
+ getId() {
370
+ return this.id;
371
+ }
372
+ setId(id) {
373
+ this.id = id;
374
+ return this;
375
+ }
376
+ getName() {
377
+ return this.name;
378
+ }
379
+ setName(name) {
380
+ this.name = name;
381
+ return this;
382
+ }
383
+ getOwnerId() {
384
+ return this.ownerId;
385
+ }
386
+ setOwnerId(ownerId) {
387
+ this.ownerId = ownerId;
388
+ return this;
389
+ }
390
+ getOwnerName() {
391
+ return this.ownerName;
392
+ }
393
+ setOwnerName(ownerName) {
394
+ this.ownerName = ownerName;
395
+ return this;
396
+ }
397
+ toMap() {
398
+ const map = {};
399
+ if (this.id != null) map.id = this.id;
400
+ if (this.name != null) map.name = this.name;
401
+ if (this.ownerId != null) map.ownerId = this.ownerId;
402
+ if (this.ownerName != null) map.ownerName = this.ownerName;
403
+ return map;
404
+ }
405
+ };
406
+ var AgencyInviteType = {
407
+ TO_BE_MEMBER: "to_be_member",
408
+ TO_BE_SUBAGENCY: "to_be_subagency"
409
+ };
410
+ var AgencyInvite = class {
411
+ constructor(id, type) {
412
+ if (id == null) throw new Error("id cannot be null");
413
+ if (type == null) throw new Error("type cannot be null");
414
+ this.text = null;
415
+ this.id = id;
416
+ this.type = type;
417
+ this.title = null;
418
+ this.message = null;
419
+ this.agencyInfo = null;
420
+ this.accepted = null;
421
+ }
422
+ getText() {
423
+ return this.text;
424
+ }
425
+ setText(text) {
426
+ this.text = text;
427
+ return this;
428
+ }
429
+ getId() {
430
+ return this.id;
431
+ }
432
+ setId(id) {
433
+ this.id = id;
434
+ return this;
435
+ }
436
+ getType() {
437
+ return this.type;
438
+ }
439
+ setType(type) {
440
+ this.type = type;
441
+ return this;
442
+ }
443
+ getTitle() {
444
+ return this.title;
445
+ }
446
+ setTitle(title) {
447
+ this.title = title;
448
+ return this;
449
+ }
450
+ getMessage() {
451
+ return this.message;
452
+ }
453
+ setMessage(message) {
454
+ this.message = message;
455
+ return this;
456
+ }
457
+ getAgencyInfo() {
458
+ return this.agencyInfo;
459
+ }
460
+ setAgencyInfo(agencyInfo) {
461
+ this.agencyInfo = agencyInfo;
462
+ return this;
463
+ }
464
+ getAccepted() {
465
+ return this.accepted;
466
+ }
467
+ setAccepted(accepted) {
468
+ this.accepted = accepted;
469
+ return this;
470
+ }
471
+ toMap() {
472
+ const map = {};
473
+ if (this.text != null) map.text = this.text;
474
+ if (this.id != null) map.id = this.id;
475
+ if (this.type != null) map.type = this.type;
476
+ if (this.title != null) map.title = this.title;
477
+ if (this.message != null) map.message = this.message;
478
+ if (this.agencyInfo != null) map.agencyInfo = this.agencyInfo.toMap();
479
+ if (this.accepted != null) map.accepted = this.accepted;
480
+ return map;
481
+ }
482
+ };
483
+ AgencyInvite.AgencyInfo = AgencyInfo;
484
+ AgencyInvite.AgencyInviteType = AgencyInviteType;
485
+ var AgencyInvite_default = AgencyInvite;
486
+
361
487
  // src/core/types/Action.js
362
488
  var Action = class {
363
489
  constructor(type, data) {
@@ -402,7 +528,8 @@ var ActionType = {
402
528
  GOBACK: "goback",
403
529
  ENTER_ROOM: "enter_room",
404
530
  LIVE_DETECT: "live_detect",
405
- ONELINK: "onelink"
531
+ ONELINK: "onelink",
532
+ AGENCY_INVITE: "agency_invite"
406
533
  };
407
534
  var ActionData = {
408
535
  Jump: Jump_default,
@@ -411,7 +538,8 @@ var ActionData = {
411
538
  Goback: Goback_default,
412
539
  EnterRoom: EnterRoom_default,
413
540
  LiveDetect: LiveDetect_default,
414
- Onelink: Onelink_default
541
+ Onelink: Onelink_default,
542
+ AgencyInvite: AgencyInvite_default
415
543
  };
416
544
  var ActionCreator = {
417
545
  ActionData,
@@ -493,6 +621,16 @@ var ActionCreator = {
493
621
  },
494
622
  createOnelinkActionWithData(onelink) {
495
623
  return new Action_default(ActionType.ONELINK, onelink);
624
+ },
625
+ // AgencyInvite
626
+ buildAgencyInvite(id, type) {
627
+ return new AgencyInvite_default(id, type);
628
+ },
629
+ createAgencyInviteAction(id, type) {
630
+ return new Action_default(ActionType.AGENCY_INVITE, new AgencyInvite_default(id, type));
631
+ },
632
+ createAgencyInviteActionWithData(agencyInvite) {
633
+ return new Action_default(ActionType.AGENCY_INVITE, agencyInvite);
496
634
  }
497
635
  };
498
636
 
@@ -756,6 +894,18 @@ var ActionBridge = class _ActionBridge {
756
894
  createOnelinkActionWithData(onelink) {
757
895
  return ActionCreator.createOnelinkActionWithData(onelink);
758
896
  }
897
+ agencyInvite(id, type) {
898
+ return this._adapter.sendAction(ActionCreator.createAgencyInviteAction(id, type));
899
+ }
900
+ buildAgencyInvite(id, type) {
901
+ return ActionCreator.buildAgencyInvite(id, type);
902
+ }
903
+ createAgencyInviteAction(id, type) {
904
+ return ActionCreator.createAgencyInviteAction(id, type);
905
+ }
906
+ createAgencyInviteActionWithData(agencyInvite) {
907
+ return ActionCreator.createAgencyInviteActionWithData(agencyInvite);
908
+ }
759
909
  destroy() {
760
910
  if (typeof this._adapter.destroy === "function") {
761
911
  this._adapter.destroy();
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * YAGO Event Kit - Action Creator (Core Only)
3
- * @version 1.0.1
3
+ * @version 1.0.2
4
4
  *
5
5
  * Generated by build script - do not edit manually.
6
6
  * Supports: Browser script tag, CommonJS, AMD
@@ -358,6 +358,132 @@ var Onelink = class {
358
358
  };
359
359
  var Onelink_default = Onelink;
360
360
 
361
+ // src/core/types/AgencyInvite.js
362
+ var AgencyInfo = class {
363
+ constructor() {
364
+ this.id = null;
365
+ this.name = null;
366
+ this.ownerId = null;
367
+ this.ownerName = null;
368
+ }
369
+ getId() {
370
+ return this.id;
371
+ }
372
+ setId(id) {
373
+ this.id = id;
374
+ return this;
375
+ }
376
+ getName() {
377
+ return this.name;
378
+ }
379
+ setName(name) {
380
+ this.name = name;
381
+ return this;
382
+ }
383
+ getOwnerId() {
384
+ return this.ownerId;
385
+ }
386
+ setOwnerId(ownerId) {
387
+ this.ownerId = ownerId;
388
+ return this;
389
+ }
390
+ getOwnerName() {
391
+ return this.ownerName;
392
+ }
393
+ setOwnerName(ownerName) {
394
+ this.ownerName = ownerName;
395
+ return this;
396
+ }
397
+ toMap() {
398
+ const map = {};
399
+ if (this.id != null) map.id = this.id;
400
+ if (this.name != null) map.name = this.name;
401
+ if (this.ownerId != null) map.ownerId = this.ownerId;
402
+ if (this.ownerName != null) map.ownerName = this.ownerName;
403
+ return map;
404
+ }
405
+ };
406
+ var AgencyInviteType = {
407
+ TO_BE_MEMBER: "to_be_member",
408
+ TO_BE_SUBAGENCY: "to_be_subagency"
409
+ };
410
+ var AgencyInvite = class {
411
+ constructor(id, type) {
412
+ if (id == null) throw new Error("id cannot be null");
413
+ if (type == null) throw new Error("type cannot be null");
414
+ this.text = null;
415
+ this.id = id;
416
+ this.type = type;
417
+ this.title = null;
418
+ this.message = null;
419
+ this.agencyInfo = null;
420
+ this.accepted = null;
421
+ }
422
+ getText() {
423
+ return this.text;
424
+ }
425
+ setText(text) {
426
+ this.text = text;
427
+ return this;
428
+ }
429
+ getId() {
430
+ return this.id;
431
+ }
432
+ setId(id) {
433
+ this.id = id;
434
+ return this;
435
+ }
436
+ getType() {
437
+ return this.type;
438
+ }
439
+ setType(type) {
440
+ this.type = type;
441
+ return this;
442
+ }
443
+ getTitle() {
444
+ return this.title;
445
+ }
446
+ setTitle(title) {
447
+ this.title = title;
448
+ return this;
449
+ }
450
+ getMessage() {
451
+ return this.message;
452
+ }
453
+ setMessage(message) {
454
+ this.message = message;
455
+ return this;
456
+ }
457
+ getAgencyInfo() {
458
+ return this.agencyInfo;
459
+ }
460
+ setAgencyInfo(agencyInfo) {
461
+ this.agencyInfo = agencyInfo;
462
+ return this;
463
+ }
464
+ getAccepted() {
465
+ return this.accepted;
466
+ }
467
+ setAccepted(accepted) {
468
+ this.accepted = accepted;
469
+ return this;
470
+ }
471
+ toMap() {
472
+ const map = {};
473
+ if (this.text != null) map.text = this.text;
474
+ if (this.id != null) map.id = this.id;
475
+ if (this.type != null) map.type = this.type;
476
+ if (this.title != null) map.title = this.title;
477
+ if (this.message != null) map.message = this.message;
478
+ if (this.agencyInfo != null) map.agencyInfo = this.agencyInfo.toMap();
479
+ if (this.accepted != null) map.accepted = this.accepted;
480
+ return map;
481
+ }
482
+ };
483
+ AgencyInvite.AgencyInfo = AgencyInfo;
484
+ AgencyInvite.AgencyInviteType = AgencyInviteType;
485
+ var AgencyInvite_default = AgencyInvite;
486
+
361
487
  // src/core/types/Action.js
362
488
  var Action = class {
363
489
  constructor(type, data) {
@@ -402,7 +528,8 @@ var ActionType = {
402
528
  GOBACK: "goback",
403
529
  ENTER_ROOM: "enter_room",
404
530
  LIVE_DETECT: "live_detect",
405
- ONELINK: "onelink"
531
+ ONELINK: "onelink",
532
+ AGENCY_INVITE: "agency_invite"
406
533
  };
407
534
  var ActionData = {
408
535
  Jump: Jump_default,
@@ -411,7 +538,8 @@ var ActionData = {
411
538
  Goback: Goback_default,
412
539
  EnterRoom: EnterRoom_default,
413
540
  LiveDetect: LiveDetect_default,
414
- Onelink: Onelink_default
541
+ Onelink: Onelink_default,
542
+ AgencyInvite: AgencyInvite_default
415
543
  };
416
544
  var ActionCreator = {
417
545
  ActionData,
@@ -493,6 +621,16 @@ var ActionCreator = {
493
621
  },
494
622
  createOnelinkActionWithData(onelink) {
495
623
  return new Action_default(ActionType.ONELINK, onelink);
624
+ },
625
+ // AgencyInvite
626
+ buildAgencyInvite(id, type) {
627
+ return new AgencyInvite_default(id, type);
628
+ },
629
+ createAgencyInviteAction(id, type) {
630
+ return new Action_default(ActionType.AGENCY_INVITE, new AgencyInvite_default(id, type));
631
+ },
632
+ createAgencyInviteActionWithData(agencyInvite) {
633
+ return new Action_default(ActionType.AGENCY_INVITE, agencyInvite);
496
634
  }
497
635
  };
498
636
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yagolive/event-kit",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "YAGO Event Kit - 跨环境 Action 创建与通信工具库,支持浏览器、React、Vue",
5
5
  "main": "src/index.js",
6
6
  "browser": "build/js/action_bridge.umd.js",
@@ -153,6 +153,20 @@ export default class ActionBridge {
153
153
  return ActionCreator.createOnelinkActionWithData(onelink);
154
154
  }
155
155
 
156
+ agencyInvite(id, type) {
157
+ return this._adapter.sendAction(ActionCreator.createAgencyInviteAction(id, type));
158
+ }
159
+
160
+ buildAgencyInvite(id, type) {
161
+ return ActionCreator.buildAgencyInvite(id, type);
162
+ }
163
+ createAgencyInviteAction(id, type) {
164
+ return ActionCreator.createAgencyInviteAction(id, type);
165
+ }
166
+ createAgencyInviteActionWithData(agencyInvite) {
167
+ return ActionCreator.createAgencyInviteActionWithData(agencyInvite);
168
+ }
169
+
156
170
  destroy() {
157
171
  if (typeof this._adapter.destroy === 'function') {
158
172
  this._adapter.destroy();
@@ -1,5 +1,5 @@
1
1
  import {
2
- Action, Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink,
2
+ Action, Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite,
3
3
  ActionType, ActionData, ActionCreator,
4
4
  } from '../core/index.js';
5
5
  import { IActionAdapter, RNWebViewAdapter, MockAdapter, AdapterOptions } from '../adapters/index.js';
@@ -51,6 +51,11 @@ export declare class ActionBridge {
51
51
  createOnelinkAction(url: string): Action;
52
52
  createOnelinkActionWithData(onelink: Onelink): Action;
53
53
 
54
+ agencyInvite(id: number, type: string): Promise<any>;
55
+ buildAgencyInvite(id: number, type: string): AgencyInvite;
56
+ createAgencyInviteAction(id: number, type: string): Action;
57
+ createAgencyInviteActionWithData(agencyInvite: AgencyInvite): Action;
58
+
54
59
  destroy(): void;
55
60
 
56
61
  static ActionCreator: typeof ActionCreator;
@@ -5,6 +5,7 @@ import EnterRoom from './types/EnterRoom.js';
5
5
  import Goback from './types/Goback.js';
6
6
  import LiveDetect from './types/LiveDetect.js';
7
7
  import Onelink from './types/Onelink.js';
8
+ import AgencyInvite from './types/AgencyInvite.js';
8
9
  import Action from './types/Action.js';
9
10
 
10
11
  const ActionType = {
@@ -15,6 +16,7 @@ const ActionType = {
15
16
  ENTER_ROOM: 'enter_room',
16
17
  LIVE_DETECT: 'live_detect',
17
18
  ONELINK: 'onelink',
19
+ AGENCY_INVITE: 'agency_invite',
18
20
  };
19
21
 
20
22
  const ActionData = {
@@ -25,6 +27,7 @@ const ActionData = {
25
27
  EnterRoom,
26
28
  LiveDetect,
27
29
  Onelink,
30
+ AgencyInvite,
28
31
  };
29
32
 
30
33
  const ActionCreator = {
@@ -131,6 +134,19 @@ const ActionCreator = {
131
134
  createOnelinkActionWithData(onelink) {
132
135
  return new Action(ActionType.ONELINK, onelink);
133
136
  },
137
+
138
+ // AgencyInvite
139
+ buildAgencyInvite(id, type) {
140
+ return new AgencyInvite(id, type);
141
+ },
142
+
143
+ createAgencyInviteAction(id, type) {
144
+ return new Action(ActionType.AGENCY_INVITE, new AgencyInvite(id, type));
145
+ },
146
+
147
+ createAgencyInviteActionWithData(agencyInvite) {
148
+ return new Action(ActionType.AGENCY_INVITE, agencyInvite);
149
+ },
134
150
  };
135
151
 
136
152
  export { ActionCreator, ActionData, ActionType };
@@ -131,6 +131,55 @@ export class Onelink {
131
131
  toMap(): Record<string, any>;
132
132
  }
133
133
 
134
+ export class AgencyInfo {
135
+ id: string | null;
136
+ name: string | null;
137
+ ownerId: string | null;
138
+ ownerName: string | null;
139
+ getId(): string | null;
140
+ setId(id: string): this;
141
+ getName(): string | null;
142
+ setName(name: string): this;
143
+ getOwnerId(): string | null;
144
+ setOwnerId(ownerId: string): this;
145
+ getOwnerName(): string | null;
146
+ setOwnerName(ownerName: string): this;
147
+ toMap(): Record<string, any>;
148
+ }
149
+
150
+ export const AgencyInviteType: {
151
+ TO_BE_MEMBER: 'to_be_member';
152
+ TO_BE_SUBAGENCY: 'to_be_subagency';
153
+ };
154
+
155
+ export class AgencyInvite {
156
+ constructor(id: number, type: string);
157
+ text: string | null;
158
+ id: number;
159
+ type: string;
160
+ title: string | null;
161
+ message: string | null;
162
+ agencyInfo: AgencyInfo | null;
163
+ accepted: boolean | null;
164
+ static AgencyInfo: typeof AgencyInfo;
165
+ static AgencyInviteType: typeof AgencyInviteType;
166
+ getText(): string | null;
167
+ setText(text: string): this;
168
+ getId(): number;
169
+ setId(id: number): this;
170
+ getType(): string;
171
+ setType(type: string): this;
172
+ getTitle(): string | null;
173
+ setTitle(title: string): this;
174
+ getMessage(): string | null;
175
+ setMessage(message: string): this;
176
+ getAgencyInfo(): AgencyInfo | null;
177
+ setAgencyInfo(agencyInfo: AgencyInfo): this;
178
+ getAccepted(): boolean | null;
179
+ setAccepted(accepted: boolean): this;
180
+ toMap(): Record<string, any>;
181
+ }
182
+
134
183
  export class Action {
135
184
  constructor(type: ActionTypeValue, data: any);
136
185
  type: ActionTypeValue;
@@ -144,7 +193,7 @@ export class Action {
144
193
  toJson(): string;
145
194
  }
146
195
 
147
- export type ActionTypeValue = 'jump' | 'navigate' | 'replace' | 'goback' | 'enter_room' | 'live_detect' | 'onelink';
196
+ export type ActionTypeValue = 'jump' | 'navigate' | 'replace' | 'goback' | 'enter_room' | 'live_detect' | 'onelink' | 'agency_invite';
148
197
 
149
198
  export const ActionType: {
150
199
  JUMP: 'jump';
@@ -154,6 +203,7 @@ export const ActionType: {
154
203
  ENTER_ROOM: 'enter_room';
155
204
  LIVE_DETECT: 'live_detect';
156
205
  ONELINK: 'onelink';
206
+ AGENCY_INVITE: 'agency_invite';
157
207
  };
158
208
 
159
209
  export const ActionData: {
@@ -164,6 +214,7 @@ export const ActionData: {
164
214
  EnterRoom: typeof EnterRoom;
165
215
  LiveDetect: typeof LiveDetect;
166
216
  Onelink: typeof Onelink;
217
+ AgencyInvite: typeof AgencyInvite;
167
218
  };
168
219
 
169
220
  export const ActionCreator: {
@@ -192,4 +243,7 @@ export const ActionCreator: {
192
243
  buildOnelink(url: string): Onelink;
193
244
  createOnelinkAction(url: string): Action;
194
245
  createOnelinkActionWithData(onelink: Onelink): Action;
246
+ buildAgencyInvite(id: number, type: string): AgencyInvite;
247
+ createAgencyInviteAction(id: number, type: string): Action;
248
+ createAgencyInviteActionWithData(agencyInvite: AgencyInvite): Action;
195
249
  };
package/src/core/index.js CHANGED
@@ -6,4 +6,5 @@ export { default as Goback } from './types/Goback.js';
6
6
  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
+ export { default as AgencyInvite } from './types/AgencyInvite.js';
9
10
  export { default as Action } from './types/Action.js';
@@ -0,0 +1,60 @@
1
+ class AgencyInfo {
2
+ constructor() { this.id = null; this.name = null; this.ownerId = null; this.ownerName = null; }
3
+ getId() { return this.id; } setId(id) { this.id = id; return this; }
4
+ getName() { return this.name; } setName(name) { this.name = name; return this; }
5
+ getOwnerId() { return this.ownerId; } setOwnerId(ownerId) { this.ownerId = ownerId; return this; }
6
+ getOwnerName() { return this.ownerName; } setOwnerName(ownerName) { this.ownerName = ownerName; return this; }
7
+
8
+ toMap() {
9
+ const map = {};
10
+ if (this.id != null) map.id = this.id;
11
+ if (this.name != null) map.name = this.name;
12
+ if (this.ownerId != null) map.ownerId = this.ownerId;
13
+ if (this.ownerName != null) map.ownerName = this.ownerName;
14
+ return map;
15
+ }
16
+ }
17
+
18
+ const AgencyInviteType = {
19
+ TO_BE_MEMBER: 'to_be_member',
20
+ TO_BE_SUBAGENCY: 'to_be_subagency',
21
+ };
22
+
23
+ class AgencyInvite {
24
+ constructor(id, type) {
25
+ if (id == null) throw new Error('id cannot be null');
26
+ if (type == null) throw new Error('type cannot be null');
27
+ this.text = null;
28
+ this.id = id;
29
+ this.type = type;
30
+ this.title = null;
31
+ this.message = null;
32
+ this.agencyInfo = null;
33
+ this.accepted = null;
34
+ }
35
+
36
+ getText() { return this.text; } setText(text) { this.text = text; return this; }
37
+ getId() { return this.id; } setId(id) { this.id = id; return this; }
38
+ getType() { return this.type; } setType(type) { this.type = type; return this; }
39
+ getTitle() { return this.title; } setTitle(title) { this.title = title; return this; }
40
+ getMessage() { return this.message; } setMessage(message) { this.message = message; return this; }
41
+ getAgencyInfo() { return this.agencyInfo; } setAgencyInfo(agencyInfo) { this.agencyInfo = agencyInfo; return this; }
42
+ getAccepted() { return this.accepted; } setAccepted(accepted) { this.accepted = accepted; return this; }
43
+
44
+ toMap() {
45
+ const map = {};
46
+ if (this.text != null) map.text = this.text;
47
+ if (this.id != null) map.id = this.id;
48
+ if (this.type != null) map.type = this.type;
49
+ if (this.title != null) map.title = this.title;
50
+ if (this.message != null) map.message = this.message;
51
+ if (this.agencyInfo != null) map.agencyInfo = this.agencyInfo.toMap();
52
+ if (this.accepted != null) map.accepted = this.accepted;
53
+ return map;
54
+ }
55
+ }
56
+
57
+ AgencyInvite.AgencyInfo = AgencyInfo;
58
+ AgencyInvite.AgencyInviteType = AgencyInviteType;
59
+
60
+ export default AgencyInvite;
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, Action } from './core/index.js';
2
+ export { ActionCreator, ActionData, ActionType, Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite, 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
@@ -8,4 +8,5 @@ export { Goback } from './core/index.js';
8
8
  export { EnterRoom } from './core/index.js';
9
9
  export { LiveDetect } from './core/index.js';
10
10
  export { Onelink } from './core/index.js';
11
+ export { AgencyInvite } from './core/index.js';
11
12
  export { Action } from './core/index.js';