@wazo/sdk 0.38.2 → 0.38.5

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 (50) hide show
  1. package/README.md +57 -10
  2. package/dist/wazo-sdk.js +5 -5
  3. package/esm/__tests__/web-rtc-client.test.js +8 -0
  4. package/esm/checker/Checker.js +8 -0
  5. package/esm/checker/checks/index.js +8 -0
  6. package/esm/checker/checks/webrtc-transport.js +8 -0
  7. package/esm/checker/checks/webrtc.js +8 -0
  8. package/esm/domain/__tests__/Line.test.js +5 -5
  9. package/esm/index.js +48 -11
  10. package/esm/lib/WazoSessionDescriptionHandler.js +8 -0
  11. package/esm/simple/Auth.js +48 -11
  12. package/esm/simple/Configuration.js +48 -11
  13. package/esm/simple/Phone.js +48 -11
  14. package/esm/simple/Softphone.js +40 -11
  15. package/esm/simple/index.js +48 -11
  16. package/esm/simple/room/LocalParticipant.js +48 -11
  17. package/esm/simple/room/Participant.js +48 -11
  18. package/esm/simple/room/RemoteParticipant.js +48 -11
  19. package/esm/simple/room/Room.js +48 -11
  20. package/esm/simple/room/SipRoom.js +48 -11
  21. package/esm/simple/room/Stream.js +48 -11
  22. package/esm/simple/room/__tests__/RemoteParticipant.test.js +48 -11
  23. package/esm/simple/utils.js +48 -11
  24. package/esm/web-rtc-client.js +8 -0
  25. package/lib/__tests__/web-rtc-client.test.js +8 -0
  26. package/lib/checker/Checker.js +8 -0
  27. package/lib/checker/checks/index.js +8 -0
  28. package/lib/checker/checks/webrtc-transport.js +8 -0
  29. package/lib/checker/checks/webrtc.js +8 -0
  30. package/lib/domain/__tests__/Line.test.js +5 -5
  31. package/lib/index.js +48 -11
  32. package/lib/lib/WazoSessionDescriptionHandler.js +8 -0
  33. package/lib/simple/Auth.js +48 -11
  34. package/lib/simple/Configuration.js +48 -11
  35. package/lib/simple/Phone.js +48 -11
  36. package/lib/simple/Softphone.js +40 -11
  37. package/lib/simple/index.js +48 -11
  38. package/lib/simple/room/LocalParticipant.js +48 -11
  39. package/lib/simple/room/Participant.js +48 -11
  40. package/lib/simple/room/RemoteParticipant.js +48 -11
  41. package/lib/simple/room/Room.js +48 -11
  42. package/lib/simple/room/SipRoom.js +48 -11
  43. package/lib/simple/room/Stream.js +48 -11
  44. package/lib/simple/room/__tests__/RemoteParticipant.test.js +48 -11
  45. package/lib/simple/utils.js +48 -11
  46. package/lib/web-rtc-client.js +8 -0
  47. package/package.json +1 -1
  48. package/src/domain/__tests__/Line.test.js +5 -5
  49. package/src/lib/WazoSessionDescriptionHandler.js +8 -0
  50. package/src/simple/Softphone.js +40 -11
package/README.md CHANGED
@@ -615,6 +615,8 @@ Wazo.Softphone.init({
615
615
  wrapUpDuration, // How long (in seconds) should the softphone display the card after the call (optional).
616
616
  // When the user changes anything on the card, this timeout is canceled
617
617
  enableAgent, // display the agent tab in the tab bar (defaults to true).
618
+ tenantId, // Tenant id used for LDAP connection
619
+ debug, // Set to `true` to display wording customization labels
618
620
  });
619
621
  ```
620
622
 
@@ -653,10 +655,14 @@ Wazo.Softphone.setCardValue(field, value);
653
655
  ```
654
656
 
655
657
  #### Customizing page style
658
+
659
+ You can inspect the iframe with your dev tool console to figure out how to override styles.
660
+
656
661
  ```js
657
662
  Wazo.Softphone.injectCss(`
658
- body {
659
- background-color: #eee;
663
+ # Reduce dialer number font size
664
+ .keypad-number, .keypad-number::placeholder {
665
+ font-size: 20px;
660
666
  }
661
667
  `);
662
668
  ```
@@ -664,11 +670,36 @@ Wazo.Softphone.injectCss(`
664
670
  #### Override appearance
665
671
  ```js
666
672
  Softphone.customizeAppearance({
667
- // Theme
673
+ // Theme, default values :
674
+ primary: '#203890',
675
+ button: '#292C87',
676
+ black: '#000',
677
+ white: '#fff',
678
+ greenButton: '#7ed865',
679
+ greenButtonHover: '#6ebf5a',
680
+ redButton: '#FA5846',
681
+ redButtonHover: '#FF604F',
682
+ buttonText: '#fff',
683
+ error: '#E80539',
684
+ secondary: '#203890',
685
+ grey: '#8A95A0',
686
+ secondGrey: '#eee',
687
+ headerColor: '#888',
688
+ avatar: '#bdbdbd',
689
+ divider: 'rgba(0, 0, 0, 0.12)',
690
+ placeholder: 'rgba(22, 44, 66, 0.5)',
691
+ hovered: '#6181F4',
668
692
  }, {
669
693
  // Translation
694
+ // Set `debug: true` to know where to change translations, eg:
695
+ en: {
696
+ user: {
697
+ login: 'My login button', // will be displayed as `user:login` in the button when settings `debug: true` in the init() method
698
+ },
699
+ },
670
700
  }, {
671
701
  // Assets
702
+ // logo: [url to your logo],
672
703
  });
673
704
  ```
674
705
 
@@ -742,6 +773,22 @@ Softphone.onCallIncoming = call => {
742
773
  // You can make action here like redirecting to the contact page (by using `call.number).
743
774
  };
744
775
 
776
+ Softphone.onCallLocallyAnswered = call => {
777
+ // Invoked when the user accepts the call locally
778
+ };
779
+
780
+ Softphone.onCallEstablished = call => {
781
+ // Invoked when the call is up
782
+ };
783
+
784
+ Softphone.onOutgoingCallMade = call => {
785
+ // Invoked when the user makes a call
786
+ };
787
+
788
+ Softphone.onCallRejected = call => {
789
+ // Invoked when the user rejects an incoming call
790
+ };
791
+
745
792
  Softphone.onCallEnded = (call, card, direction) => {
746
793
  // Invoked when the call is ended
747
794
  };
@@ -750,10 +797,6 @@ Softphone.onCardSaved = card => {
750
797
  // Invoked when the user save the card at the end of the call
751
798
  };
752
799
 
753
- Softphone.onCallMade = call => {
754
- // Invoked when an outgoing call is made
755
- };
756
-
757
800
  Softphone.onSearchOptions = (fieldId: string, query: string) => {
758
801
  // Invoked when the user is making a search from an Autocomplete field in the card form
759
802
  // We need to call `onOptionsResults` here to send results to the softphone
@@ -843,6 +886,10 @@ Softphone.onAuthenticated = session => {
843
886
  Softphone.onLoggedOut = session => {
844
887
  // Invoked when the user is is logged out in the softphone
845
888
  };
889
+
890
+ Softphone.onIFrameLoaded = session => {
891
+ // Invoked when the iframe is loaded
892
+ };
846
893
  ```
847
894
 
848
895
  ## Advanced API
@@ -881,7 +928,7 @@ import { WazoWebSocketClient } from '@wazo/sdk';
881
928
 
882
929
  ```js
883
930
  const client = new WazoApiClient({
884
- server: 'stack.dev.wazo.io', // required string
931
+ server: 'stack.example.com', // required string
885
932
  agent: null, // http(s).Agent instance, allows custom proxy, unsecured https, certificate etc.
886
933
  clientId: null, // Set an identifier for your app when using refreshToken
887
934
  isMobile: false,
@@ -1149,7 +1196,7 @@ Use this generic method to request endpoints directly.
1149
1196
 
1150
1197
  ```js
1151
1198
  const requester = new ApiRequester({
1152
- server: 'stack.dev.wazo.io', // Engine server
1199
+ server: 'stack.example.com', // Engine server
1153
1200
  refreshTokenCallback: () => {}, // Called when the token is refreshed
1154
1201
  clientId: 'my-id', // ClientId used for refreshToken
1155
1202
  agent: null, // http(s).Agent instance, allows custom proxy, unsecured https, certificate etc.
@@ -1171,7 +1218,7 @@ const session = await client.auth.logIn({ ... }); // log in
1171
1218
 
1172
1219
  const client = new WazoWebRTCClient({
1173
1220
  displayName: 'From WEB',
1174
- host: 'stack.dev.wazo.io',
1221
+ host: 'stack.example.com',
1175
1222
  websocketSip: 'other.url.com', // Allows to connect throught another URL than host (default to `host` is not set).
1176
1223
  media: {
1177
1224
  audio: boolean,