@wazo/sdk 0.39.0-beta.1 → 0.39.0-beta.11

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.
Files changed (52) hide show
  1. package/README.md +62 -0
  2. package/dist/wazo-sdk.js +2 -2
  3. package/esm/api/chatd.js +17 -3
  4. package/esm/api/confd.js +1 -1
  5. package/esm/api-client.js +1 -0
  6. package/esm/domain/Contact.js +6 -1
  7. package/esm/domain/Phone/WebRTCPhone.js +33 -21
  8. package/esm/lib/WazoSessionDescriptionHandler.js +6 -6
  9. package/esm/simple/Auth.js +3 -2
  10. package/esm/simple/room/Room.js +1 -1
  11. package/esm/simple/room/Stream.js +3 -3
  12. package/esm/types/api/chatd.d.ts +1 -1
  13. package/esm/types/api/chatd.d.ts.map +1 -1
  14. package/esm/types/api-client.d.ts +2 -2
  15. package/esm/types/api-client.d.ts.map +1 -1
  16. package/esm/types/domain/Contact.d.ts.map +1 -1
  17. package/esm/types/domain/Phone/WebRTCPhone.d.ts.map +1 -1
  18. package/esm/types/simple/Auth.d.ts.map +1 -1
  19. package/esm/types/web-rtc-client.d.ts +9 -0
  20. package/esm/types/web-rtc-client.d.ts.map +1 -1
  21. package/esm/web-rtc-client.js +132 -68
  22. package/lib/api/chatd.js +23 -7
  23. package/lib/api/confd.js +1 -1
  24. package/lib/api-client.js +1 -0
  25. package/lib/domain/Contact.js +6 -1
  26. package/lib/domain/Phone/WebRTCPhone.js +33 -21
  27. package/lib/lib/WazoSessionDescriptionHandler.js +6 -6
  28. package/lib/simple/Auth.js +3 -2
  29. package/lib/simple/room/Room.js +1 -1
  30. package/lib/simple/room/Stream.js +3 -3
  31. package/lib/types/api/chatd.d.ts +1 -1
  32. package/lib/types/api/chatd.d.ts.map +1 -1
  33. package/lib/types/api-client.d.ts +2 -2
  34. package/lib/types/api-client.d.ts.map +1 -1
  35. package/lib/types/domain/Contact.d.ts.map +1 -1
  36. package/lib/types/domain/Phone/WebRTCPhone.d.ts.map +1 -1
  37. package/lib/types/simple/Auth.d.ts.map +1 -1
  38. package/lib/types/web-rtc-client.d.ts +9 -0
  39. package/lib/types/web-rtc-client.d.ts.map +1 -1
  40. package/lib/web-rtc-client.js +156 -83
  41. package/package.json +3 -2
  42. package/src/api/chatd.ts +22 -4
  43. package/src/api/confd.ts +1 -1
  44. package/src/api-client.ts +4 -2
  45. package/src/domain/Contact.ts +7 -1
  46. package/src/domain/Phone/WebRTCPhone.ts +38 -23
  47. package/src/lib/WazoSessionDescriptionHandler.ts +6 -6
  48. package/src/simple/Auth.ts +5 -3
  49. package/src/simple/room/Room.ts +1 -1
  50. package/src/simple/room/Stream.ts +3 -3
  51. package/src/web-rtc-client.ts +148 -74
  52. package/src/global.d.ts +0 -5
package/README.md CHANGED
@@ -1449,3 +1449,65 @@ ws.updateToken(newToken: string);
1449
1449
  ```js
1450
1450
  ws.close();
1451
1451
  ```
1452
+
1453
+
1454
+ # Usage with webpack 5
1455
+
1456
+ As webpack 5 dropped some polyfill, you have to add them:
1457
+
1458
+ ```sh
1459
+ yarn add -D assert buffer https-browserify url stream-http stream-browserify browserify-zlib process
1460
+ ```
1461
+
1462
+ If you have used `create-react-app` to create your app, you can customize the webpack configuration with `react-app-rewired` :
1463
+
1464
+ ```sh
1465
+ yarn add -D react-app-rewired
1466
+ ```
1467
+
1468
+ Create a `config-overrides.js` file :
1469
+ ```js
1470
+ const webpack = require('webpack');
1471
+ module.exports = function override(config, env) {
1472
+ config.resolve.fallback = {
1473
+ ...config.resolve.fallback,
1474
+ assert: require.resolve("assert"),
1475
+ buffer: require.resolve('buffer'),
1476
+ https: require.resolve('https-browserify'),
1477
+ url: require.resolve('url'),
1478
+ http: require.resolve('stream-http'),
1479
+ stream: require.resolve('stream-browserify'),
1480
+ zlib: require.resolve('browserify-zlib'),
1481
+ };
1482
+
1483
+ config.plugins.push(
1484
+ new webpack.ProvidePlugin({
1485
+ process: 'process/browser',
1486
+ Buffer: ['buffer', 'Buffer'],
1487
+ }),
1488
+ );
1489
+
1490
+ config.module.rules.push({
1491
+ test: /\.m?js/,
1492
+ resolve: {
1493
+ fullySpecified: false
1494
+ }
1495
+ })
1496
+
1497
+ return config;
1498
+ }
1499
+ ```
1500
+
1501
+ Then edit in `package.json` :
1502
+ ```json
1503
+ "scripts": {
1504
+ // ...
1505
+ "start": "react-app-rewired start",
1506
+ "build": "react-app-rewired build",
1507
+ "test": "react-app-rewired test",
1508
+ "eject": "react-app-rewired eject"
1509
+ // ...
1510
+ },
1511
+ ```
1512
+
1513
+ Please refer to https://github.com/facebook/create-react-app/issues/11756 for more details.