@94ai/nf-microphone 9.0.0 → 10.0.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.
package/lib/types.d.ts CHANGED
@@ -1,80 +1,80 @@
1
- export declare type Env = 'test' | 'dev' | 'sg' | 'gray' | 'prod';
2
- export declare type Option = {
3
- mode?: 'qiankun' | 'wujie';
4
- envMap?: Partial<Record<Env, Record<string, any>>>;
5
- env?: Env;
6
- agentId?: string;
7
- agentTag?: string;
8
- appKey?: string;
9
- appSecret?: string;
10
- timestamp?: number | string;
11
- sign?: string;
12
- extStatus?: string;
13
- origin?: string;
14
- ancestorOrigin?: string;
15
- destinationOrigin?: string;
16
- callShow?: '0' | '1';
17
- transferToLaborShow?: '0' | '1';
18
- restShow?: '0' | '1';
19
- networkDetectShow?: '0' | '1';
20
- muteShow?: '0' | '1';
21
- logShow?: '0' | '1';
22
- timingShow?: '0' | '1';
23
- signShow?: '0' | '1';
24
- lang?: 'zh' | 'en';
25
- name?: string;
26
- extensionInfo?: {
27
- status: 0 | 1;
28
- wsRegisterAddress?: string;
29
- wsProtocol?: string;
30
- accountCode?: string;
31
- };
32
- blackList?: string[];
33
- extPassword?: string;
34
- extensionNumber?: string;
35
- wsRegisterAddress?: string;
36
- wsProtocol?: string;
37
- isOem?: boolean;
38
- numberKeyBoard?: boolean;
39
- accessMode?: 'mobile' | 'pc';
40
- sipHeaders?: string[];
41
- sgGateway?: string;
42
- open?: string;
43
- sgOpen?: string;
44
- sgDomain?: string;
45
- sgBase?: string;
46
- token?: string;
47
- timeZone?: string;
48
- getOfflineInfo?: Function;
49
- changeALittleRest?: Function;
50
- quickCallWin?: Function;
51
- phoneRegex?: string;
52
- account?: string;
53
- extAccount?: string;
54
- socketHost?: string;
55
- sid?: number;
56
- uid?: number;
57
- newUserId?: number;
58
- companyId?: number;
59
- company?: string;
60
- countryId?: number;
61
- countryName?: string;
62
- authUserType?: 4 | 3 | 2 | 1;
63
- userType?: 4 | 3 | 2 | 1;
64
- recordPath?: string;
65
- constMap?: Record<string, any>;
66
- el: string;
67
- instanceMap: Record<string, any>;
68
- softphoneConnectCallBack: Function;
69
- softphoneCallRefreshCallBack: Function;
70
- softphoneSeatStatusChangeCallBack: Function;
71
- softphoneAcceptCallBack: Function;
72
- softphoneIgnoreCallBack: Function;
73
- softphoneHangupCallBack: Function;
74
- softphoneSessionStateChangeCallBack: Function;
75
- softphoneIncomingCallBack: Function;
76
- softphoneSendDtmfCallBack: Function;
77
- softphoneConnectRegisteredCallBack: Function;
78
- softphoneSignOverduedCallBack: Function;
79
- softphoneAutoIgnoreCallback: Function;
80
- };
1
+ export declare type Env = 'test' | 'dev' | 'sg' | 'gray' | 'prod';
2
+ export declare type Option = {
3
+ mode?: 'qiankun' | 'wujie';
4
+ envMap?: Partial<Record<Env, Record<string, any>>>;
5
+ env?: Env;
6
+ agentId?: string;
7
+ agentTag?: string;
8
+ appKey?: string;
9
+ appSecret?: string;
10
+ timestamp?: number | string;
11
+ sign?: string;
12
+ extStatus?: string;
13
+ origin?: string;
14
+ ancestorOrigin?: string;
15
+ destinationOrigin?: string;
16
+ callShow?: '0' | '1';
17
+ transferToLaborShow?: '0' | '1';
18
+ restShow?: '0' | '1';
19
+ networkDetectShow?: '0' | '1';
20
+ muteShow?: '0' | '1';
21
+ logShow?: '0' | '1';
22
+ timingShow?: '0' | '1';
23
+ signShow?: '0' | '1';
24
+ lang?: 'zh' | 'en';
25
+ name?: string;
26
+ extensionInfo?: {
27
+ status: 0 | 1;
28
+ wsRegisterAddress?: string;
29
+ wsProtocol?: string;
30
+ accountCode?: string;
31
+ };
32
+ blackList?: string[];
33
+ extPassword?: string;
34
+ extensionNumber?: string;
35
+ wsRegisterAddress?: string;
36
+ wsProtocol?: string;
37
+ isOem?: boolean;
38
+ numberKeyBoard?: boolean;
39
+ accessMode?: 'mobile' | 'pc';
40
+ sipHeaders?: string[];
41
+ sgGateway?: string;
42
+ open?: string;
43
+ sgOpen?: string;
44
+ sgDomain?: string;
45
+ sgBase?: string;
46
+ token?: string;
47
+ timeZone?: string;
48
+ getOfflineInfo?: Function;
49
+ changeALittleRest?: Function;
50
+ quickCallWin?: Function;
51
+ phoneRegex?: string;
52
+ account?: string;
53
+ extAccount?: string;
54
+ socketHost?: string;
55
+ sid?: number;
56
+ uid?: number;
57
+ newUserId?: number;
58
+ companyId?: number;
59
+ company?: string;
60
+ countryId?: number;
61
+ countryName?: string;
62
+ authUserType?: 4 | 3 | 2 | 1;
63
+ userType?: 4 | 3 | 2 | 1;
64
+ recordPath?: string;
65
+ constMap?: Record<string, any>;
66
+ el: string;
67
+ instanceMap: Record<string, any>;
68
+ softphoneConnectCallBack: Function;
69
+ softphoneCallRefreshCallBack: Function;
70
+ softphoneSeatStatusChangeCallBack: Function;
71
+ softphoneAcceptCallBack: Function;
72
+ softphoneIgnoreCallBack: Function;
73
+ softphoneHangupCallBack: Function;
74
+ softphoneSessionStateChangeCallBack: Function;
75
+ softphoneIncomingCallBack: Function;
76
+ softphoneSendDtmfCallBack: Function;
77
+ softphoneConnectRegisteredCallBack: Function;
78
+ softphoneSignOverduedCallBack: Function;
79
+ softphoneAutoIgnoreCallback: Function;
80
+ };
package/lib/util.d.ts CHANGED
@@ -1 +1 @@
1
- export declare function isDomainOrIP(str: string): boolean;
1
+ export declare function isDomainOrIP(str: string): boolean;
@@ -1,5 +1,5 @@
1
1
  const { addGlobalUncaughtErrorHandler, initGlobalState, registerMicroApps, loadMicroApp, start } = window.qiankun
2
- const { bus, setupApp } = window.wujie
2
+ const { bus, setupApp, startApp } = window.wujie
3
3
  class SoftphoneManager {
4
4
  nfMicrophoneInstance
5
5
  option = {
@@ -515,20 +515,17 @@ class SoftphoneManager {
515
515
  const shared = new Shared('default')
516
516
  if (props.getOfflineInfo) {
517
517
  shared.getOfflineInfo = async (data) => {
518
- return await props.getOfflineInfo
519
- !(data)
518
+ return await props.getOfflineInfo(data)
520
519
  }
521
520
  }
522
521
  if (props.changeALittleRest) {
523
522
  shared.changeALittleRest = async (data) => {
524
- return await props.changeALittleRest
525
- !(data)
523
+ return await props.changeALittleRest(data)
526
524
  }
527
525
  }
528
526
  if (props.quickCallWin) {
529
527
  shared.quickCallWin = async (data) => {
530
- return await props.quickCallWin
531
- !(data)
528
+ return await props.quickCallWin(data)
532
529
  }
533
530
  }
534
531
  (Object.keys(props.envMap).reduce((res, currentValue) => {
@@ -1,6 +1,6 @@
1
- import { isDomainOrIP } from 'packages/nf-microphone/lib/util'
1
+ import { isDomainOrIP } from './util'
2
2
  import { addGlobalUncaughtErrorHandler, initGlobalState, registerMicroApps, loadMicroApp, start } from 'qiankun'
3
- import { bus, setupApp } from 'wujie'
3
+ import { bus, setupApp, startApp } from 'wujie'
4
4
  import { Option } from './types'
5
5
  import CryptoJS from 'crypto-js'
6
6
  // @ts-ignore
@@ -16,9 +16,7 @@ import {
16
16
  ref
17
17
  } from 'vue-demi'
18
18
  import {
19
- registerMicroApps,
20
19
  loadMicroApp,
21
- start,
22
20
  addGlobalUncaughtErrorHandler,
23
21
  initGlobalState
24
22
  } from 'qiankun'
@@ -219,16 +217,6 @@ class Shared {
219
217
  this.key = key
220
218
  }
221
219
 
222
- /**
223
- * 获取 UserInfo
224
- */
225
- getUserInfo() {
226
- return {}
227
- }
228
-
229
- setUserInfo(data) {
230
- }
231
-
232
220
  /**
233
221
  * 获取分机信息
234
222
  */
@@ -604,43 +592,6 @@ class MicroManager {
604
592
  (new SoftphoneNotity()).useWujieSoftphoneNotity()
605
593
  }
606
594
 
607
- registerQiankunMicroApps() {
608
- const appConfig = this.getMicroAppConfig()[0]
609
- appConfig.props.shared.getUserInfo = getUserInfo
610
- appConfig.props.shared.setUserInfo = setUserInfo
611
-
612
- registerMicroApps([appConfig], {
613
- // qiankun 生命周期钩子 - 加载前
614
- beforeLoad: [(app) => {
615
- // 加载子应用前,加载进度条
616
- // NProgress.start()
617
- return Promise.resolve()
618
- }],
619
- // qiankun 生命周期钩子 - 挂载后
620
- afterMount: [(app) => {
621
- // 加载子应用前,进度条加载完成
622
- // NProgress.done()
623
- return Promise.resolve()
624
- }],
625
- // qiankun 生命周期钩子 - 卸载后
626
- afterUnmount: [app => {
627
- return Promise.resolve()
628
- }]
629
- })
630
- this.initState()
631
- }
632
-
633
- startQiankun() {
634
- this.registerQiankunMicroApps()
635
- start({
636
- singular: false,
637
- prefetch: 'all',
638
- sandbox: {
639
- experimentalStyleIsolation: true
640
- }
641
- })
642
- }
643
-
644
595
  startWujie() {
645
596
  this.registerWujieMicroApps()
646
597
  // @ts-ignore
@@ -650,13 +601,6 @@ class MicroManager {
650
601
  })
651
602
  }
652
603
 
653
- startMicrotask() {
654
- if (this.mode === 'wujie') {
655
- this.startWujie()
656
- } else {
657
- this.startQiankun()
658
- }
659
- }
660
604
  }
661
605
  const nfMicrophoneInstance = new MicroManager()
662
606
  // 通知
@@ -859,7 +803,7 @@ const setUserInfo = (userInfo) => {
859
803
  }
860
804
 
861
805
  onMounted(() => {
862
- // 注册软电话微应用
806
+ // 组件仅直接挂载应用;注册式启动由独立 SoftphoneManager 管理。
863
807
  if (props.mode === 'qiankun') {
864
808
  nfMicrophoneInstance.loadQiankunMicroApps()
865
809
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-microphone",
3
- "version": "9.0.0",
3
+ "version": "10.0.0",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>",
@@ -14,11 +14,12 @@
14
14
  "url": "http://gitlab.94ai.pro/ui/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/nf-theme-chalk": "^9.0.0",
17
+ "@94ai/nf-theme-chalk": "^10.0.0",
18
18
  "crypto-js": "^4.2.0",
19
19
  "qiankun": "^2.10.16",
20
20
  "vue-demi": "^0.14.5",
21
- "wujie": "^1.0.22"
21
+ "wujie": "^1.0.22",
22
+ "@94ai/vue2-runtime-helpers": "1.0.1"
22
23
  },
23
24
  "peerDependenciesMeta": {
24
25
  "@vue/composition-api": {
@@ -27,11 +28,10 @@
27
28
  },
28
29
  "peerDependencies": {
29
30
  "@vue/composition-api": "^1.0.0-rc.1",
30
- "element-ui": ">=2.13.2",
31
- "vue": "^2.0.0 || >=3.0.0"
31
+ "vue": "^2.0.0 || >=3.0.0",
32
+ "element-ui": ">=2.13.2"
32
33
  },
33
34
  "types": "lib/index.d.ts",
34
35
  "main": "lib/nf-microphone.cjs.js",
35
- "module": "lib/nf-microphone.esm-bundler.js",
36
- "gitHead": "afe3016f0e42dfb7fedf6cbbe400ec08bf4b8662"
36
+ "module": "lib/nf-microphone.esm-bundler.js"
37
37
  }