ue-softphone-sdk-beta 3.0.16

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,45 @@
1
+ /*
2
+ * @Author: cuixuecheng
3
+ * @Date: 2023-07-02 11:46:31
4
+ * @LastEditors: cuixuecheng
5
+ * @LastEditTime: 2023-07-02 12:24:46
6
+ * @Description:
7
+ */
8
+ import babel from "@rollup/plugin-babel";
9
+ import terser from "@rollup/plugin-terser";
10
+ import typescript from "@rollup/plugin-typescript";
11
+
12
+ const extensions = [".js", ".ts"];
13
+
14
+ export default {
15
+ input: "src/index.ts",
16
+ output:[
17
+ {
18
+ file: "dist/ue-softphone-sdk.js",
19
+ format: "cjs",
20
+ name: "ueSoftphone"
21
+ },
22
+ {
23
+ file: "dist/ue-softphone-sdk.js",
24
+ format: "esm",
25
+ name: "ueSoftphone"
26
+ },
27
+ {
28
+ file: "dist/ue-softphone-sdk.js",
29
+ format: "umd",
30
+ name: "ueSoftphone"
31
+ }
32
+ ],
33
+ watch: {
34
+ include: "src/**"
35
+ },
36
+ plugins: [
37
+ typescript(),
38
+ babel({
39
+ extensions,
40
+ babelHelpers: "bundled",
41
+ exclude: "node_modules/**"
42
+ }),
43
+ terser()
44
+ ]
45
+ };
Binary file
@@ -0,0 +1,10 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_8143_50466)">
3
+ <path d="M14.7107 12.4247C13.4562 11.3331 11.8178 10.6724 10.0232 10.6724C8.22856 10.6724 6.59017 11.3331 5.33347 12.4269C5.29877 12.4582 5.27752 12.5017 5.27419 12.5483C5.27086 12.5949 5.28571 12.641 5.31561 12.6769L6.11918 13.6345C6.18392 13.7104 6.29776 13.7193 6.37365 13.6546C7.34686 12.7974 8.62365 12.2796 10.0232 12.2796C11.4228 12.2796 12.6995 12.7974 13.6728 13.6523C13.7486 13.7171 13.8625 13.7081 13.9272 13.6323L14.7308 12.6747C14.7933 12.601 14.7844 12.4894 14.7107 12.4247ZM17.3312 9.29743C15.3513 7.64788 12.8045 6.65458 10.0232 6.65458C7.24195 6.65458 4.69508 7.64788 2.71293 9.29743C2.67667 9.32802 2.65398 9.3717 2.6498 9.41895C2.64561 9.4662 2.66029 9.51319 2.69061 9.54967L3.49418 10.5073C3.55668 10.5831 3.67052 10.5921 3.74418 10.5296C5.44731 9.1144 7.63704 8.26172 10.0232 8.26172C12.4094 8.26172 14.5991 9.1144 16.3 10.5296C16.3759 10.5921 16.4875 10.5831 16.55 10.5073L17.3536 9.54967C17.4161 9.47377 17.4071 9.35993 17.3312 9.29743ZM19.9361 6.19475C17.2263 3.97154 13.7576 2.63672 9.97856 2.63672C6.2241 2.63672 2.77767 3.95368 0.0745416 6.15011C0.0559703 6.16503 0.040572 6.18352 0.0292538 6.20448C0.0179355 6.22544 0.0109261 6.24846 0.00863805 6.27217C0.00635001 6.29588 0.0088297 6.31981 0.0159311 6.34255C0.0230325 6.36529 0.034612 6.38638 0.0499878 6.40458L0.853559 7.36217C0.916059 7.43583 1.02767 7.44699 1.10133 7.38672C3.52767 5.4202 6.61472 4.24386 9.97856 4.24386C13.367 4.24386 16.4741 5.43806 18.9071 7.42913C18.983 7.49163 19.0946 7.48047 19.1571 7.40458L19.9607 6.44699C20.0254 6.37109 20.0143 6.25725 19.9361 6.19475ZM8.57231 15.9403C8.57231 16.3192 8.72282 16.6825 8.99073 16.9504C9.25864 17.2184 9.622 17.3689 10.0009 17.3689C10.3798 17.3689 10.7431 17.2184 11.011 16.9504C11.2789 16.6825 11.4295 16.3192 11.4295 15.9403C11.4295 15.5614 11.2789 15.198 11.011 14.9301C10.7431 14.6622 10.3798 14.5117 10.0009 14.5117C9.622 14.5117 9.25864 14.6622 8.99073 14.9301C8.72282 15.198 8.57231 15.5614 8.57231 15.9403Z" fill="#1C92E9"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_8143_50466">
7
+ <rect width="20" height="20" fill="white"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14.7107 12.4247C13.4562 11.3331 11.8178 10.6724 10.0232 10.6724C8.22856 10.6724 6.59017 11.3331 5.33347 12.4269C5.29877 12.4582 5.27752 12.5017 5.27419 12.5483C5.27086 12.5949 5.28571 12.641 5.31561 12.6769L6.11918 13.6345C6.18392 13.7104 6.29776 13.7193 6.37365 13.6546C7.34686 12.7974 8.62365 12.2796 10.0232 12.2796C11.4228 12.2796 12.6995 12.7974 13.6728 13.6523C13.7486 13.7171 13.8625 13.7081 13.9272 13.6323L14.7308 12.6747C14.7933 12.601 14.7844 12.4894 14.7107 12.4247ZM17.3312 9.29743C15.3513 7.64788 12.8045 6.65458 10.0232 6.65458C7.24195 6.65458 4.69508 7.64788 2.71293 9.29743C2.67667 9.32802 2.65398 9.3717 2.6498 9.41895C2.64561 9.4662 2.66029 9.51319 2.69061 9.54967L3.49418 10.5073C3.55668 10.5831 3.67052 10.5921 3.74418 10.5296C5.44731 9.1144 7.63704 8.26172 10.0232 8.26172C12.4094 8.26172 14.5991 9.1144 16.3 10.5296C16.3759 10.5921 16.4875 10.5831 16.55 10.5073L17.3536 9.54967C17.4161 9.47377 17.4071 9.35993 17.3312 9.29743ZM19.9361 6.19475C17.2263 3.97154 13.7576 2.63672 9.97856 2.63672C6.2241 2.63672 2.77767 3.95368 0.0745416 6.15011C0.0559703 6.16503 0.040572 6.18352 0.0292538 6.20448C0.0179355 6.22544 0.0109261 6.24846 0.00863805 6.27217C0.00635001 6.29588 0.0088297 6.31981 0.0159311 6.34255C0.0230325 6.36529 0.034612 6.38638 0.0499878 6.40458L0.853559 7.36217C0.916059 7.43583 1.02767 7.44699 1.10133 7.38672C3.52767 5.4202 6.61472 4.24386 9.97856 4.24386C13.367 4.24386 16.4741 5.43806 18.9071 7.42913C18.983 7.49163 19.0946 7.48047 19.1571 7.40458L19.9607 6.44699C20.0254 6.37109 20.0143 6.25725 19.9361 6.19475ZM8.57231 15.9403C8.57231 16.3192 8.72282 16.6825 8.99073 16.9504C9.25864 17.2184 9.622 17.3689 10.0009 17.3689C10.3798 17.3689 10.7431 17.2184 11.011 16.9504C11.2789 16.6825 11.4295 16.3192 11.4295 15.9403C11.4295 15.5614 11.2789 15.198 11.011 14.9301C10.7431 14.6622 10.3798 14.5117 10.0009 14.5117C9.622 14.5117 9.25864 14.6622 8.99073 14.9301C8.72282 15.198 8.57231 15.5614 8.57231 15.9403Z" fill="#D9D9D9"/>
3
+ <path d="M14.71 12.4263C13.4556 11.3348 11.8172 10.6741 10.0225 10.6741C8.2279 10.6741 6.58951 11.3348 5.33281 12.4286C5.29811 12.4599 5.27686 12.5034 5.27354 12.55C5.27021 12.5966 5.28505 12.6427 5.31496 12.6786L6.11853 13.6362C6.18326 13.7121 6.2971 13.721 6.37299 13.6562C7.3462 12.7991 8.62299 12.2813 10.0225 12.2813C11.4221 12.2813 12.6989 12.7991 13.6721 13.654C13.748 13.7188 13.8618 13.7098 13.9266 13.6339L14.7301 12.6763C14.7926 12.6027 14.7837 12.4911 14.71 12.4263ZM17.3306 9.29911C15.3507 7.64955 12.8038 6.65625 10.0225 6.65625C7.24129 6.65625 4.69442 7.64955 2.71228 9.29911C2.67602 9.32969 2.65332 9.37337 2.64914 9.42062C2.64496 9.46788 2.65963 9.51486 2.68995 9.55134L3.49353 10.5089C3.55603 10.5848 3.66987 10.5937 3.74353 10.5312C5.44665 9.11607 7.63638 8.26339 10.0225 8.26339C12.4087 8.26339 14.5984 9.11607 16.2993 10.5312C16.3752 10.5937 16.4868 10.5848 16.5493 10.5089L17.3529 9.55134C17.4154 9.47545 17.4065 9.36161 17.3306 9.29911ZM8.57165 15.942C8.57165 16.3208 8.72216 16.6842 8.99007 16.9521C9.25798 17.22 9.62134 17.3705 10.0002 17.3705C10.3791 17.3705 10.7425 17.22 11.0104 16.9521C11.2783 16.6842 11.4288 16.3208 11.4288 15.942C11.4288 15.5631 11.2783 15.1997 11.0104 14.9318C10.7425 14.6639 10.3791 14.5134 10.0002 14.5134C9.62134 14.5134 9.25798 14.6639 8.99007 14.9318C8.72216 15.1997 8.57165 15.5631 8.57165 15.942Z" fill="#FAAD14"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14.7107 12.4247C13.4562 11.3331 11.8178 10.6724 10.0232 10.6724C8.22856 10.6724 6.59017 11.3331 5.33347 12.4269C5.29877 12.4582 5.27752 12.5017 5.27419 12.5483C5.27086 12.5949 5.28571 12.641 5.31561 12.6769L6.11918 13.6345C6.18392 13.7104 6.29776 13.7193 6.37365 13.6546C7.34686 12.7974 8.62365 12.2796 10.0232 12.2796C11.4228 12.2796 12.6995 12.7974 13.6728 13.6523C13.7486 13.7171 13.8625 13.7081 13.9272 13.6323L14.7308 12.6747C14.7933 12.601 14.7844 12.4894 14.7107 12.4247ZM17.3312 9.29743C15.3513 7.64788 12.8045 6.65458 10.0232 6.65458C7.24195 6.65458 4.69508 7.64788 2.71293 9.29743C2.67667 9.32802 2.65398 9.3717 2.6498 9.41895C2.64561 9.4662 2.66029 9.51319 2.69061 9.54967L3.49418 10.5073C3.55668 10.5831 3.67052 10.5921 3.74418 10.5296C5.44731 9.1144 7.63704 8.26172 10.0232 8.26172C12.4094 8.26172 14.5991 9.1144 16.3 10.5296C16.3759 10.5921 16.4875 10.5831 16.55 10.5073L17.3536 9.54967C17.4161 9.47377 17.4071 9.35993 17.3312 9.29743ZM19.9361 6.19475C17.2263 3.97154 13.7576 2.63672 9.97856 2.63672C6.2241 2.63672 2.77767 3.95368 0.0745416 6.15011C0.0559703 6.16503 0.040572 6.18352 0.0292538 6.20448C0.0179355 6.22544 0.0109261 6.24846 0.00863805 6.27217C0.00635001 6.29588 0.0088297 6.31981 0.0159311 6.34255C0.0230325 6.36529 0.034612 6.38638 0.0499878 6.40458L0.853559 7.36217C0.916059 7.43583 1.02767 7.44699 1.10133 7.38672C3.52767 5.4202 6.61472 4.24386 9.97856 4.24386C13.367 4.24386 16.4741 5.43806 18.9071 7.42913C18.983 7.49163 19.0946 7.48047 19.1571 7.40458L19.9607 6.44699C20.0254 6.37109 20.0143 6.25725 19.9361 6.19475ZM8.57231 15.9403C8.57231 16.3192 8.72282 16.6825 8.99073 16.9504C9.25864 17.2184 9.622 17.3689 10.0009 17.3689C10.3798 17.3689 10.7431 17.2184 11.011 16.9504C11.2789 16.6825 11.4295 16.3192 11.4295 15.9403C11.4295 15.5614 11.2789 15.198 11.011 14.9301C10.7431 14.6622 10.3798 14.5117 10.0009 14.5117C9.622 14.5117 9.25864 14.6622 8.99073 14.9301C8.72282 15.198 8.57231 15.5614 8.57231 15.9403Z" fill="#D9D9D9"/>
3
+ <path d="M14.7104 12.4241C13.4559 11.3326 11.8175 10.6719 10.0229 10.6719C8.22826 10.6719 6.58987 11.3326 5.33317 12.4263C5.29847 12.4576 5.27723 12.5011 5.2739 12.5477C5.27057 12.5943 5.28541 12.6404 5.31532 12.6763L6.11889 13.6339C6.18362 13.7098 6.29746 13.7187 6.37335 13.654C7.34657 12.7969 8.62335 12.279 10.0229 12.279C11.4225 12.279 12.6992 12.7969 13.6725 13.6518C13.7484 13.7165 13.8622 13.7076 13.9269 13.6317L14.7305 12.6741C14.793 12.6004 14.7841 12.4888 14.7104 12.4241ZM8.57201 15.9397C8.57201 16.3186 8.72252 16.682 8.99043 16.9499C9.25834 17.2178 9.6217 17.3683 10.0006 17.3683C10.3795 17.3683 10.7428 17.2178 11.0107 16.9499C11.2786 16.682 11.4292 16.3186 11.4292 15.9397C11.4292 15.5609 11.2786 15.1975 11.0107 14.9296C10.7428 14.6617 10.3795 14.5112 10.0006 14.5112C9.6217 14.5112 9.25834 14.6617 8.99043 14.9296C8.72252 15.1975 8.57201 15.5609 8.57201 15.9397Z" fill="#F5222D"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14.7107 12.4247C13.4562 11.3331 11.8178 10.6724 10.0232 10.6724C8.22856 10.6724 6.59017 11.3331 5.33347 12.4269C5.29877 12.4582 5.27752 12.5017 5.27419 12.5483C5.27086 12.5949 5.28571 12.641 5.31561 12.6769L6.11918 13.6345C6.18392 13.7104 6.29776 13.7193 6.37365 13.6546C7.34686 12.7974 8.62365 12.2796 10.0232 12.2796C11.4228 12.2796 12.6995 12.7974 13.6728 13.6523C13.7486 13.7171 13.8625 13.7081 13.9272 13.6323L14.7308 12.6747C14.7933 12.601 14.7844 12.4894 14.7107 12.4247ZM17.3312 9.29743C15.3513 7.64788 12.8045 6.65458 10.0232 6.65458C7.24195 6.65458 4.69508 7.64788 2.71293 9.29743C2.67667 9.32802 2.65398 9.3717 2.6498 9.41895C2.64561 9.4662 2.66029 9.51319 2.69061 9.54967L3.49418 10.5073C3.55668 10.5831 3.67052 10.5921 3.74418 10.5296C5.44731 9.1144 7.63704 8.26172 10.0232 8.26172C12.4094 8.26172 14.5991 9.1144 16.3 10.5296C16.3759 10.5921 16.4875 10.5831 16.55 10.5073L17.3536 9.54967C17.4161 9.47377 17.4071 9.35993 17.3312 9.29743ZM19.9361 6.19475C17.2263 3.97154 13.7576 2.63672 9.97856 2.63672C6.2241 2.63672 2.77767 3.95368 0.0745416 6.15011C0.0559703 6.16503 0.040572 6.18352 0.0292538 6.20448C0.0179355 6.22544 0.0109261 6.24846 0.00863805 6.27217C0.00635001 6.29588 0.0088297 6.31981 0.0159311 6.34255C0.0230325 6.36529 0.034612 6.38638 0.0499878 6.40458L0.853559 7.36217C0.916059 7.43583 1.02767 7.44699 1.10133 7.38672C3.52767 5.4202 6.61472 4.24386 9.97856 4.24386C13.367 4.24386 16.4741 5.43806 18.9071 7.42913C18.983 7.49163 19.0946 7.48047 19.1571 7.40458L19.9607 6.44699C20.0254 6.37109 20.0143 6.25725 19.9361 6.19475ZM8.57231 15.9403C8.57231 16.3192 8.72282 16.6825 8.99073 16.9504C9.25864 17.2184 9.622 17.3689 10.0009 17.3689C10.3798 17.3689 10.7431 17.2184 11.011 16.9504C11.2789 16.6825 11.4295 16.3192 11.4295 15.9403C11.4295 15.5614 11.2789 15.198 11.011 14.9301C10.7431 14.6622 10.3798 14.5117 10.0009 14.5117C9.622 14.5117 9.25864 14.6622 8.99073 14.9301C8.72282 15.198 8.57231 15.5614 8.57231 15.9403Z" fill="#D9D9D9"/>
3
+ <path d="M8.57227 15.9403C8.57227 16.3192 8.72278 16.6825 8.99068 16.9504C9.25859 17.2184 9.62196 17.3689 10.0008 17.3689C10.3797 17.3689 10.7431 17.2184 11.011 16.9504C11.2789 16.6825 11.4294 16.3192 11.4294 15.9403C11.4294 15.5614 11.2789 15.198 11.011 14.9301C10.7431 14.6622 10.3797 14.5117 10.0008 14.5117C9.62196 14.5117 9.25859 14.6622 8.99068 14.9301C8.72278 15.198 8.57227 15.5614 8.57227 15.9403Z" fill="#A8071A"/>
4
+ </svg>
Binary file
@@ -0,0 +1,119 @@
1
+ /*
2
+ * @Author: Wangtao
3
+ * @Date: 2023-09-22 18:41:02
4
+ * @LastEditors: Wangtao
5
+ * @LastEditTime: 2024-02-04 17:35:34
6
+ */
7
+
8
+ window.ueSimpleSoftphone = {
9
+ initState: false,
10
+ isInit: false,
11
+ isInitApp: false,
12
+ initParams: {},
13
+ init: function (options) {
14
+ if (!options.accountId) {
15
+ console.error('accountId is null')
16
+ return
17
+ }
18
+ if (!options.agentNumber) {
19
+ console.error('agentNumber is null')
20
+ return
21
+ }
22
+ if (!options.password) {
23
+ console.error('password is null')
24
+ return
25
+ }
26
+ if (!options.loginType) {
27
+ console.error('loginType is null')
28
+ return
29
+ }
30
+ window.ueSimpleSoftphone.initParams.accountId = options.accountId
31
+ window.ueSimpleSoftphone.initParams.agentNumber = options.agentNumber
32
+ window.ueSimpleSoftphone.initParams.password = options.password
33
+ window.ueSimpleSoftphone.initParams.loginType = options.loginType
34
+ window.ueSimpleSoftphone.initParams.server = options.server || ''
35
+ window.ueSimpleSoftphone.initParams.isOpenCallQueue = options.isOpenCallQueue || false
36
+ window.ueSimpleSoftphone.initParams.isOpenNetwork = options.isOpenNetwork || false
37
+ window.ueSimpleSoftphone.initParams.openNlsTranslation = options.openNlsTranslation || false
38
+ window.ueSimpleSoftphone.isInit = true
39
+ if (options.listenCallEvent && typeof options.listenCallEvent === 'function') {
40
+ window.ueSimpleSoftphone.backEventFunction = options.listenCallEvent
41
+ }
42
+ if (window.ueSimpleSoftphone.initState && !window.ueSimpleSoftphone.isInitApp) {
43
+ window.ueSimpleSoftphone.initApp()
44
+ }
45
+ },
46
+ initApp: function () {
47
+ Vue.createApp({
48
+ components: {
49
+ demo: myLib
50
+ }
51
+ }).mount('#ue-app')
52
+ window.ueSimpleSoftphone.isInitApp = true
53
+ }
54
+ }
55
+ function loadModule(url) {
56
+ return new Promise(function (resolve, reject) {
57
+ var script = document.createElement('script')
58
+ script.src = url
59
+
60
+ script.onload = function () {
61
+ resolve()
62
+ }
63
+
64
+ script.onerror = function () {
65
+ reject()
66
+ }
67
+
68
+ document.head.appendChild(script)
69
+ })
70
+ }
71
+
72
+ function getAudio(id) {
73
+ var el = document.getElementById(id)
74
+ if (!(el instanceof HTMLAudioElement)) {
75
+ // 没有音频dom,重新创建一个
76
+ // throw new Error(`Element '${id}' not found or not an audio element.`)
77
+ var audio = new Audio()
78
+ audio.controls = true
79
+ audio.autoplay = true
80
+ audio.id = 'm7remoteAudio'
81
+ audio.style.display = 'none'
82
+ document.body.appendChild(audio)
83
+ return document.getElementById(id)
84
+ } else {
85
+ return el
86
+ }
87
+ }
88
+
89
+ const nowDate = new Date().getTime()
90
+ loadModule(`./ue.global.js?time=${nowDate}`).then(() => {
91
+ window.onload = function () {
92
+ document.body.insertAdjacentHTML(
93
+ 'beforeend',
94
+ `<div id="ue-app">
95
+ <demo></demo>
96
+ </div>`
97
+ )
98
+ var audioElement = getAudio('m7remoteAudio')
99
+ // var script = document.createElement('script');
100
+ // script.src = 'https://unpkg.com/vue@3.3.4/dist/vue.global.js'; // 替换为要执行的 JavaScript 文件的 URL
101
+ // document.head.appendChild(script);
102
+ // softphone.useasy.cn
103
+ // 测试1 softphone.useasy.cn
104
+ loadModule(`./ue.min.js?time=${nowDate}`).then(() => {
105
+ fetch(`./ue.lib.css?time=${nowDate}`)
106
+ .then((response) => response.text())
107
+ .then((content) => {
108
+ var style = document.createElement('style')
109
+ style.type = 'text/css'
110
+ style.innerHTML = content
111
+ document.getElementsByTagName('head')[0].appendChild(style)
112
+ window.ueSimpleSoftphone.initState = true
113
+ if (window.ueSimpleSoftphone.isInit && !window.ueSimpleSoftphone.isInitApp) {
114
+ window.ueSimpleSoftphone.initApp()
115
+ }
116
+ })
117
+ })
118
+ }
119
+ })