@wazo/sdk 0.39.0-beta.2 → 0.39.0-beta.20
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/README.md +69 -7
- package/dist/wazo-sdk.js +4 -4
- package/esm/__tests__/api-client.test.js +6 -0
- package/esm/api/chatd.js +17 -3
- package/esm/api/dird.js +2 -2
- package/esm/api-client.js +4 -0
- package/esm/domain/Contact.js +10 -4
- package/esm/domain/Phone/WebRTCPhone.js +32 -25
- package/esm/domain/Session.js +24 -0
- package/esm/domain/__tests__/Contact.test.js +200 -48
- package/esm/lib/WazoSessionDescriptionHandler.js +14 -11
- package/esm/service/IssueReporter.js +12 -2
- package/esm/service/__tests__/IssueReporter.test.js +12 -0
- package/esm/service/getApiClient.js +9 -0
- package/esm/simple/Auth.js +40 -5
- package/esm/simple/Phone.js +3 -1
- package/esm/simple/Websocket.js +1 -0
- package/esm/simple/room/Room.js +1 -1
- package/esm/simple/room/Stream.js +3 -3
- package/esm/types/api/chatd.d.ts +1 -1
- package/esm/types/api/chatd.d.ts.map +1 -1
- package/esm/types/api/dird.d.ts.map +1 -1
- package/esm/types/api-client.d.ts +3 -2
- package/esm/types/api-client.d.ts.map +1 -1
- package/esm/types/domain/Contact.d.ts +1 -1
- package/esm/types/domain/Contact.d.ts.map +1 -1
- package/esm/types/domain/Phone/WebRTCPhone.d.ts.map +1 -1
- package/esm/types/domain/Session.d.ts +2 -0
- package/esm/types/domain/Session.d.ts.map +1 -1
- package/esm/types/domain/types.d.ts +40 -14
- package/esm/types/domain/types.d.ts.map +1 -1
- package/esm/types/index.d.ts +2 -0
- package/esm/types/index.d.ts.map +1 -1
- package/esm/types/lib/WazoSessionDescriptionHandler.d.ts.map +1 -1
- package/esm/types/service/IssueReporter.d.ts +1 -0
- package/esm/types/service/IssueReporter.d.ts.map +1 -1
- package/esm/types/service/getApiClient.d.ts +2 -0
- package/esm/types/service/getApiClient.d.ts.map +1 -1
- package/esm/types/simple/Auth.d.ts.map +1 -1
- package/esm/types/simple/Phone.d.ts +3 -2
- package/esm/types/simple/Phone.d.ts.map +1 -1
- package/esm/types/simple/Websocket.d.ts.map +1 -1
- package/esm/types/simple/index.d.ts +1 -0
- package/esm/types/simple/index.d.ts.map +1 -1
- package/esm/types/utils/api-requester.d.ts +5 -1
- package/esm/types/utils/api-requester.d.ts.map +1 -1
- package/esm/types/web-rtc-client.d.ts +14 -29
- package/esm/types/web-rtc-client.d.ts.map +1 -1
- package/esm/types/websocket-client.d.ts +5 -1
- package/esm/types/websocket-client.d.ts.map +1 -1
- package/esm/utils/__tests__/api-requester.test.js +5 -0
- package/esm/utils/api-requester.js +23 -5
- package/esm/web-rtc-client.js +164 -86
- package/esm/websocket-client.js +9 -2
- package/lib/__tests__/api-client.test.js +6 -0
- package/lib/api/chatd.js +23 -7
- package/lib/api/dird.js +2 -2
- package/lib/api-client.js +4 -0
- package/lib/domain/Contact.js +10 -4
- package/lib/domain/Phone/WebRTCPhone.js +32 -25
- package/lib/domain/Session.js +23 -0
- package/lib/domain/__tests__/Contact.test.js +175 -50
- package/lib/lib/WazoSessionDescriptionHandler.js +15 -12
- package/lib/service/IssueReporter.js +12 -2
- package/lib/service/__tests__/IssueReporter.test.js +12 -0
- package/lib/service/getApiClient.js +12 -1
- package/lib/simple/Auth.js +34 -4
- package/lib/simple/Phone.js +3 -1
- package/lib/simple/Websocket.js +1 -0
- package/lib/simple/room/Room.js +1 -1
- package/lib/simple/room/Stream.js +3 -3
- package/lib/types/api/chatd.d.ts +1 -1
- package/lib/types/api/chatd.d.ts.map +1 -1
- package/lib/types/api/dird.d.ts.map +1 -1
- package/lib/types/api-client.d.ts +3 -2
- package/lib/types/api-client.d.ts.map +1 -1
- package/lib/types/domain/Contact.d.ts +1 -1
- package/lib/types/domain/Contact.d.ts.map +1 -1
- package/lib/types/domain/Phone/WebRTCPhone.d.ts.map +1 -1
- package/lib/types/domain/Session.d.ts +2 -0
- package/lib/types/domain/Session.d.ts.map +1 -1
- package/lib/types/domain/types.d.ts +40 -14
- package/lib/types/domain/types.d.ts.map +1 -1
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/lib/WazoSessionDescriptionHandler.d.ts.map +1 -1
- package/lib/types/service/IssueReporter.d.ts +1 -0
- package/lib/types/service/IssueReporter.d.ts.map +1 -1
- package/lib/types/service/getApiClient.d.ts +2 -0
- package/lib/types/service/getApiClient.d.ts.map +1 -1
- package/lib/types/simple/Auth.d.ts.map +1 -1
- package/lib/types/simple/Phone.d.ts +3 -2
- package/lib/types/simple/Phone.d.ts.map +1 -1
- package/lib/types/simple/Websocket.d.ts.map +1 -1
- package/lib/types/simple/index.d.ts +1 -0
- package/lib/types/simple/index.d.ts.map +1 -1
- package/lib/types/utils/api-requester.d.ts +5 -1
- package/lib/types/utils/api-requester.d.ts.map +1 -1
- package/lib/types/web-rtc-client.d.ts +14 -29
- package/lib/types/web-rtc-client.d.ts.map +1 -1
- package/lib/types/websocket-client.d.ts +5 -1
- package/lib/types/websocket-client.d.ts.map +1 -1
- package/lib/utils/__tests__/api-requester.test.js +5 -0
- package/lib/utils/api-requester.js +19 -5
- package/lib/web-rtc-client.js +169 -85
- package/lib/websocket-client.js +8 -2
- package/package.json +5 -2
- package/src/__tests__/api-client.test.ts +8 -0
- package/src/api/chatd.ts +22 -4
- package/src/api/dird.ts +3 -2
- package/src/api-client.ts +8 -2
- package/src/domain/Contact.ts +11 -4
- package/src/domain/Phone/WebRTCPhone.ts +34 -28
- package/src/domain/Session.ts +28 -0
- package/src/domain/__tests__/Contact.test.ts +213 -54
- package/src/domain/types.ts +42 -14
- package/src/lib/WazoSessionDescriptionHandler.ts +15 -11
- package/src/service/IssueReporter.ts +13 -2
- package/src/service/__tests__/IssueReporter.test.ts +14 -0
- package/src/service/getApiClient.ts +12 -0
- package/src/simple/Auth.ts +58 -6
- package/src/simple/Phone.ts +13 -4
- package/src/simple/Websocket.ts +1 -0
- package/src/simple/room/Room.ts +1 -1
- package/src/simple/room/Stream.ts +3 -3
- package/src/types/global.d.ts +1 -0
- package/src/utils/__tests__/api-requester.test.ts +6 -0
- package/src/utils/api-requester.ts +31 -4
- package/src/web-rtc-client.ts +192 -122
- package/src/websocket-client.ts +14 -1
package/README.md
CHANGED
|
@@ -833,14 +833,14 @@ client.confd.listApplications();
|
|
|
833
833
|
|
|
834
834
|
Use Dird to interact with directories.
|
|
835
835
|
```js
|
|
836
|
-
client.dird.search(context, term);
|
|
836
|
+
client.dird.search(context: string, term: string, offset: number, limit: number);
|
|
837
837
|
client.dird.listPersonalContacts();
|
|
838
|
-
client.dird.addContact(newContact);
|
|
839
|
-
client.dird.editContact(contact);
|
|
840
|
-
client.dird.deleteContact(contactUuid);
|
|
841
|
-
client.dird.listFavorites(context);
|
|
842
|
-
client.dird.markAsFavorite(source, sourceId);
|
|
843
|
-
client.dird.removeFavorite(source, sourceId);
|
|
838
|
+
client.dird.addContact(newContact: NewContact);
|
|
839
|
+
client.dird.editContact(contact: Contact);
|
|
840
|
+
client.dird.deleteContact(contactUuid: UUID);
|
|
841
|
+
client.dird.listFavorites(context: string);
|
|
842
|
+
client.dird.markAsFavorite(source: string, sourceId: string);
|
|
843
|
+
client.dird.removeFavorite(source: string, sourceId: string);
|
|
844
844
|
```
|
|
845
845
|
|
|
846
846
|
#### Agentd
|
|
@@ -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.
|