@wazo/sdk 1.0.0-alpha.7 → 1.0.0-alpha.9
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 +16 -7
- package/dist/wazo-sdk.js +2 -2
- package/esm/api/auth.js +3 -0
- package/esm/domain/CallLog.js +2 -3
- package/esm/domain/Phone/WebRTCPhone.js +29 -27
- package/esm/simple/Auth.js +13 -3
- package/esm/simple/Phone.js +2 -2
- package/esm/state-machine/softphone-state-machine.js +1 -2
- package/esm/types/api/auth.d.ts +3 -0
- package/esm/types/api/auth.d.ts.map +1 -1
- package/esm/types/domain/CallLog.d.ts.map +1 -1
- package/esm/types/domain/Phone/WebRTCPhone.d.ts +3 -3
- package/esm/types/domain/Phone/WebRTCPhone.d.ts.map +1 -1
- package/esm/types/simple/Auth.d.ts +6 -1
- package/esm/types/simple/Auth.d.ts.map +1 -1
- package/esm/types/simple/Phone.d.ts +2 -2
- package/esm/types/simple/Phone.d.ts.map +1 -1
- package/esm/types/state-machine/softphone-state-machine.d.ts +0 -1
- package/esm/types/state-machine/softphone-state-machine.d.ts.map +1 -1
- package/esm/types/utils/sdp.d.ts.map +1 -1
- package/esm/types/voice/call.d.ts.map +1 -1
- package/esm/types/voice/softphone.d.ts.map +1 -1
- package/esm/types/web-rtc-client.d.ts +2 -1
- package/esm/types/web-rtc-client.d.ts.map +1 -1
- package/esm/utils/sdp.js +8 -7
- package/esm/voice/call.js +3 -2
- package/esm/voice/softphone.js +23 -6
- package/esm/web-rtc-client.js +31 -30
- package/lib/api/auth.js +3 -0
- package/lib/domain/CallLog.js +2 -3
- package/lib/domain/Phone/WebRTCPhone.js +29 -27
- package/lib/simple/Auth.js +15 -3
- package/lib/state-machine/softphone-state-machine.js +1 -2
- package/lib/types/api/auth.d.ts +3 -0
- package/lib/types/api/auth.d.ts.map +1 -1
- package/lib/types/domain/CallLog.d.ts.map +1 -1
- package/lib/types/domain/Phone/WebRTCPhone.d.ts +3 -3
- package/lib/types/domain/Phone/WebRTCPhone.d.ts.map +1 -1
- package/lib/types/simple/Auth.d.ts +6 -1
- package/lib/types/simple/Auth.d.ts.map +1 -1
- package/lib/types/simple/Phone.d.ts +2 -2
- package/lib/types/simple/Phone.d.ts.map +1 -1
- package/lib/types/state-machine/softphone-state-machine.d.ts +0 -1
- package/lib/types/state-machine/softphone-state-machine.d.ts.map +1 -1
- package/lib/types/utils/sdp.d.ts.map +1 -1
- package/lib/types/voice/call.d.ts.map +1 -1
- package/lib/types/voice/softphone.d.ts.map +1 -1
- package/lib/types/web-rtc-client.d.ts +2 -1
- package/lib/types/web-rtc-client.d.ts.map +1 -1
- package/lib/utils/sdp.js +7 -6
- package/lib/voice/call.js +3 -2
- package/lib/voice/softphone.js +24 -6
- package/lib/web-rtc-client.js +29 -29
- package/package.json +1 -1
- package/src/api/auth.ts +5 -0
- package/src/domain/CallLog.ts +2 -3
- package/src/domain/Phone/WebRTCPhone.ts +33 -31
- package/src/simple/Auth.ts +15 -3
- package/src/simple/Phone.ts +3 -3
- package/src/state-machine/softphone-state-machine.ts +1 -2
- package/src/utils/sdp.ts +9 -8
- package/src/voice/call.ts +4 -3
- package/src/voice/softphone.ts +30 -7
- package/src/web-rtc-client.ts +34 -29
package/README.md
CHANGED
|
@@ -272,6 +272,15 @@ const session = await Wazo.Auth.samlLogIn(samlSessionId);
|
|
|
272
272
|
|
|
273
273
|
Returns as `Wazo.domain.Session`. This object contains, among other information, the user's token.
|
|
274
274
|
|
|
275
|
+
|
|
276
|
+
```js
|
|
277
|
+
const logoutResponse = await Wazo.Auth.samlLogOut();
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Returns an object that contains a `location`
|
|
281
|
+
|
|
282
|
+
`location` is the URL to open for the user to log out from their identity provider.
|
|
283
|
+
|
|
275
284
|
#### Validating a token
|
|
276
285
|
|
|
277
286
|
```js
|
|
@@ -647,7 +656,7 @@ Depending on your environment you can import:
|
|
|
647
656
|
##### WebRTC Library
|
|
648
657
|
|
|
649
658
|
```js
|
|
650
|
-
import {
|
|
659
|
+
import { WebRTCClient } from '@wazo/sdk';
|
|
651
660
|
```
|
|
652
661
|
|
|
653
662
|
##### WebSocket Library
|
|
@@ -947,11 +956,11 @@ const results = await requester.call('dird/0.1/personal');
|
|
|
947
956
|
This sample describes the very first steps to place a call using WebRTC.
|
|
948
957
|
|
|
949
958
|
```js
|
|
950
|
-
import {
|
|
959
|
+
import { WebRTCClient } from '@wazo/sdk'; // import the library
|
|
951
960
|
|
|
952
961
|
const session = await client.auth.logIn({ ... }); // log in
|
|
953
962
|
|
|
954
|
-
const client = new
|
|
963
|
+
const client = new WebRTCClient({
|
|
955
964
|
displayName: 'From WEB',
|
|
956
965
|
host: 'stack.example.com',
|
|
957
966
|
websocketSip: 'other.url.com', // Allows to connect throught another URL than host (default to `host` is not set).
|
|
@@ -1012,7 +1021,7 @@ const uaConfigOverrides = {
|
|
|
1012
1021
|
}
|
|
1013
1022
|
}
|
|
1014
1023
|
|
|
1015
|
-
const client = new
|
|
1024
|
+
const client = new WebRTCClient(config, session, /* optional */ uaConfigOverrides);
|
|
1016
1025
|
```
|
|
1017
1026
|
|
|
1018
1027
|
#### Basic client features
|
|
@@ -1138,12 +1147,12 @@ client.close();
|
|
|
1138
1147
|
Higher level of abstraction to use the `WebRtcClient`.
|
|
1139
1148
|
|
|
1140
1149
|
```js
|
|
1141
|
-
import {
|
|
1150
|
+
import { WebRTCClient, WebRTCPhone } from '@wazo/sdk';
|
|
1142
1151
|
|
|
1143
|
-
const webRtcClient = new
|
|
1152
|
+
const webRtcClient = new WebRTCClient({/* See above for parameters */});
|
|
1144
1153
|
|
|
1145
1154
|
const phone = new WebRTCPhone(
|
|
1146
|
-
webRtcClient:
|
|
1155
|
+
webRtcClient: WebRTCClient, // Instance of WebRTCClient
|
|
1147
1156
|
audioDeviceOutput: string, // The output device used to play audio
|
|
1148
1157
|
allowVideo: boolean, // Allow to send and receive video
|
|
1149
1158
|
audioDeviceRing, // The output device used to play ringtones
|