@livechat/customer-sdk 3.1.0 → 3.1.2

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 (47) hide show
  1. package/README.md +32 -4
  2. package/dist/customer-sdk.cjs.js +187 -640
  3. package/dist/customer-sdk.cjs.native.js +187 -639
  4. package/dist/customer-sdk.esm.js +188 -641
  5. package/dist/customer-sdk.js +265 -867
  6. package/dist/customer-sdk.min.js +1 -1
  7. package/package.json +10 -9
  8. package/types/actions.d.ts +331 -0
  9. package/types/chatHistory.d.ts +19 -0
  10. package/types/clientDataParsers.d.ts +55 -0
  11. package/types/completionValues.d.ts +4 -0
  12. package/types/constants/clientErrorCodes.d.ts +11 -0
  13. package/types/constants/connectionStatuses.d.ts +6 -0
  14. package/types/constants/eventTypes.d.ts +8 -0
  15. package/types/constants/reduxActions.d.ts +23 -0
  16. package/types/constants/serverDisconnectionReasons.d.ts +15 -0
  17. package/types/constants/serverErrorCodes.d.ts +23 -0
  18. package/types/constants/serverPushActions.d.ts +26 -0
  19. package/types/constants/serverRequestActions.d.ts +30 -0
  20. package/types/constants/sortOrders.d.ts +3 -0
  21. package/types/constants/userTypes.d.ts +3 -0
  22. package/types/createError.d.ts +9 -0
  23. package/types/createStore.d.ts +12 -0
  24. package/types/debug.d.ts +3 -0
  25. package/types/graylog/index.d.ts +14 -0
  26. package/types/graylog/makeGrayLogRequest.d.ts +2 -0
  27. package/types/graylog/makeGrayLogRequest.native.d.ts +6 -0
  28. package/types/index.d.ts +239 -0
  29. package/types/reducer.d.ts +546 -0
  30. package/types/sendRequestAction.d.ts +4 -0
  31. package/types/sendTicketForm.d.ts +14 -0
  32. package/types/serverDataParser.d.ts +34 -0
  33. package/types/serverEventParser.d.ts +12 -0
  34. package/types/serverFrameParser.d.ts +385 -0
  35. package/types/sideEffects/checkGoals.d.ts +5 -0
  36. package/types/sideEffects/index.d.ts +12 -0
  37. package/types/sideStorage.d.ts +5 -0
  38. package/types/socketClient.d.ts +11 -0
  39. package/types/socketListener.d.ts +9 -0
  40. package/types/thunks.d.ts +4 -0
  41. package/types/types/actions.d.ts +157 -0
  42. package/types/types/clientEntities.d.ts +374 -0
  43. package/types/types/frames.d.ts +635 -0
  44. package/types/types/serverEntities.d.ts +408 -0
  45. package/types/types/state.d.ts +56 -0
  46. package/types/uploadFile.d.ts +19 -0
  47. package/types/validateFile/index.d.ts +3 -0
package/README.md CHANGED
@@ -63,7 +63,7 @@ Or use the node-style `require` call:
63
63
 
64
64
  ### Using a script tag - UMD module hosted on unpkg's CDN
65
65
 
66
- `<script src="https://unpkg.com/@livechat/customer-sdk@3.1.0"></script>`
66
+ `<script src="https://unpkg.com/@livechat/customer-sdk@3.1.1"></script>`
67
67
 
68
68
  If you just want to look around and play with the SDK, check out our
69
69
  [sample chat widget implementation](https://codesandbox.io/s/rm3prxw88n).
@@ -83,7 +83,8 @@ Other optional configuration parameters are also available:
83
83
  | licenseId | number | | Your license number, you receive this value when creating a new livechat account. |
84
84
  | clientId | string | | Your client id, you receive this value when you register your application in the LiveChat Developer Console. |
85
85
  | autoConnect | boolean | true | Optional; should the library try to reconnect on it's own. |
86
- | groupId | number | 0 | Optional; the id of the group you wish to connect to. |
86
+ | groupId | number | | Optional; the id of the group you wish to connect to. |
87
+ | uniqueGroups | boolean | false | Optional; by default, the customer's identity is the same for all groups. If you want to create a separate customer identity for each group, set this parameter to `true`. When set to `true`, passing a `groupId` is required. |
87
88
  | region | 'dal' \| 'fra' | 'dal' | Optional; the server region your license is at. |
88
89
  | redirectUri | string | | Optional; should only be used inside ReactNative, this is the URI which your webview is redirected to after authorization. |
89
90
  | customerDataProvider | () => CustomerData | | Optional; should only be used if you need to send customer data during login. In general, [`updateCustomer()`](#updateCustomer) should be prefered for sending customer data. |
@@ -358,8 +359,29 @@ customerSDK
358
359
 
359
360
  Starts the connection process to our servers. It is needed when:
360
361
 
361
- - the argument `autoConnect: false` has been passed to the `init` method
362
- - you get disconnected for a reason that suspends reconnection attempts (e.g. [`inactivity_timeout`](#inactivity_timeout))
362
+ - The `autoConnect: false` argument has been passed to the `init` method.
363
+
364
+ ```js
365
+ const customerSDK = CustomerSDK.init({
366
+ licenseId: LICENSE_ID,
367
+ clientId: CLIENT_ID,
368
+ autoConnect: false,
369
+ })
370
+
371
+ /* later in the code... */
372
+
373
+ customerSDK.connect()
374
+ ```
375
+
376
+ - You get disconnected for a reason that suspends reconnection attempts (e.g. [`inactivity_timeout`](#inactivity_timeout)).
377
+
378
+ ```js
379
+ customerSDK.on('disconnected', ({ reason }) => {
380
+ if (reason === 'inactivity_timeout') {
381
+ customerSDK.connect()
382
+ }
383
+ })
384
+ ```
363
385
 
364
386
  ## deactivateChat
365
387
 
@@ -2175,6 +2197,12 @@ customerSDK.on('disconnected', ({ reason }) => {
2175
2197
 
2176
2198
  # Changelog
2177
2199
 
2200
+ ## [v3.1.2] - 2023-02-28
2201
+
2202
+ ### Fixed
2203
+
2204
+ - Fixed situations when a value for `urlDetails.imageUrl` available in the `getUrlInfo` method could sometimes return a URL with a duplicated protocol (like "https://https://...")
2205
+
2178
2206
  ## [v3.1.0] - 2021-10-7
2179
2207
 
2180
2208
  ### Added