ue-softphone-sdk 2.0.3 → 2.1.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.
@@ -0,0 +1,20 @@
1
+ // rollup.config.mjs
2
+ import terser from "@rollup/plugin-terser";
3
+ import resolve from "@rollup/plugin-node-resolve";
4
+ import typescript from "@rollup/plugin-typescript";
5
+ import commonjs from "@rollup/plugin-commonjs";
6
+ import nodePolyfills from "rollup-plugin-polyfill-node";
7
+
8
+ export default {
9
+ input: "src/new-index.ts",
10
+ output: [
11
+ {
12
+ name: "ueSoftphone",
13
+ file: "dist/lib/ue-soft-phone.min.js",
14
+ format: "iife",
15
+ name: "ueSoftPhone",
16
+ plugins: [terser()]
17
+ }
18
+ ],
19
+ plugins: [commonjs(), typescript(), resolve(), nodePolyfills(/* options */)]
20
+ };
package/nginx.conf ADDED
@@ -0,0 +1,56 @@
1
+ user nginx;
2
+ worker_processes 2;
3
+
4
+ error_log /var/log/nginx/error.log warn;
5
+ pid /var/run/nginx.pid;
6
+
7
+ events {
8
+ worker_connections 4096;
9
+ }
10
+
11
+ http {
12
+ include /etc/nginx/mime.types;
13
+ default_type application/octet-stream;
14
+
15
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
16
+ '$status $body_bytes_sent "$http_referer" '
17
+ '"$http_user_agent" "$http_x_forwarded_for"';
18
+
19
+ access_log /var/log/nginx/access.log main;
20
+
21
+
22
+ sendfile on;
23
+ #tcp_nopush on;
24
+
25
+ keepalive_timeout 65;
26
+
27
+ gzip on;
28
+ gzip_min_length 1k;
29
+ gzip_buffers 4 16k;
30
+ gzip_comp_level 2;
31
+ gzip_types application/json application/javascript text/plain application/x-javascript text/css application/xml text/javascript image/jpeg image/gif image/png;
32
+ gzip_vary off;
33
+
34
+ # include /etc/nginx/conf.d/*.conf;
35
+ server {
36
+ listen 3000;
37
+ client_max_body_size 20m;
38
+ proxy_buffers 16 1024k;
39
+ proxy_buffer_size 1024k;
40
+ server_name localhost;
41
+ root /usr/share/nginx/html;
42
+ # location ~*index.html {
43
+ # add_header Cache-Control no-store;
44
+ # root /usr/share/nginx/html;
45
+ # try_files $uri $uri/ /index.html =404;
46
+ # }
47
+ location / {
48
+ add_header Cache-Control no-store;
49
+ root /usr/share/nginx/html;
50
+ try_files $uri $uri/ /index.html =404;
51
+ }
52
+ location ~ ^(.*)\/\.svn\/ {
53
+ return 404;
54
+ }
55
+ }
56
+ }
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "ue-softphone-sdk",
3
- "version": "2.0.3",
3
+ "version": "2.1.0",
4
4
  "description": "ue-softphone-sdk",
5
5
  "main": "dist/ue-softphone-sdk.js",
6
6
  "scripts": {
7
7
  "build": "rollup -c --bundleConfigAsCjs",
8
+ "build:js": "rollup -c new-rollup.config.mjs",
8
9
  "dev": "rollup -c -w --bundleConfigAsCjs"
9
10
  },
10
11
  "keywords": [],
@@ -24,6 +25,13 @@
24
25
  "rollup": "^3.26.0",
25
26
  "rollup-plugin-terser": "^7.0.2",
26
27
  "rollup-plugin-typescript2": "^0.35.0",
28
+ "@rollup/plugin-commonjs": "^25.0.4",
29
+ "@rollup/plugin-json": "^6.0.0",
30
+ "@rollup/plugin-node-resolve": "^15.1.0",
31
+ "@rollup/plugin-terser": "^0.4.3",
32
+ "@rollup/plugin-typescript": "^11.1.2",
33
+ "rollup-plugin-polyfill-node": "^0.12.0",
34
+ "tslib": "^2.6.1",
27
35
  "typescript": "^5.1.6"
28
36
  }
29
37
  }
package/src/index.ts CHANGED
@@ -2,14 +2,13 @@
2
2
  * @Author: cuixuecheng
3
3
  * @Date: 2023-02-21 18:40:21
4
4
  * @LastEditors: 杨钰宸
5
- * @LastEditTime: 2023-08-01 16:50:11
5
+ * @LastEditTime: 2023-08-03 10:01:36
6
6
  * @Description:
7
7
  */
8
8
 
9
9
  // @ts-ignore: Unreachable code error
10
10
  /**package.json 版本号 */
11
11
  // @ts-ignore: Unreachable code error
12
- export const ueSdkVersion = typeof _SDK_VERSION === "object" ? _SDK_VERSION : {};
13
12
  // import { Parameters } from './grammar/parameters.js'
14
13
  import io from "socket.io-client";
15
14
  import WebPhoneSdk from "./webPhoneSdk";
@@ -396,6 +395,7 @@ export default class ueSoftphone {
396
395
  loginInfo.data.pushServer,
397
396
  loginInfo.data.agent
398
397
  );
398
+ debugger;
399
399
  if (loginType === "WEBRTC") {
400
400
  this.getWebrtcInfo(server, options);
401
401
  }
@@ -2836,7 +2836,7 @@ class ueWebsocket {
2836
2836
  private ws: any;
2837
2837
  constructor(server: string, proto: any) {
2838
2838
  //@ts-ignore
2839
- this.ws = io.connect(server, proto);
2839
+ this.ws = io.connect(`wss://${server}`, proto);
2840
2840
  }
2841
2841
  public on(type: string, callback: Function) {
2842
2842
  if (type === "connect") {