@twilio/conversations 3.0.0-canary.9 → 3.0.0-canary2.100

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 (42) hide show
  1. package/README.md +22 -18
  2. package/builds/browser.js +1018 -2070
  3. package/builds/browser.js.map +1 -1
  4. package/builds/lib.d.ts +69 -67
  5. package/builds/lib.js +1018 -2070
  6. package/builds/lib.js.map +1 -1
  7. package/builds/twilio-conversations.js +24737 -25259
  8. package/builds/twilio-conversations.min.js +1 -1
  9. package/dist/aggregated-delivery-receipt.js +1 -1
  10. package/dist/aggregated-delivery-receipt.js.map +1 -1
  11. package/dist/client.js +85 -69
  12. package/dist/client.js.map +1 -1
  13. package/dist/command-executor.js +30 -12
  14. package/dist/command-executor.js.map +1 -1
  15. package/dist/conversation.js +87 -19
  16. package/dist/conversation.js.map +1 -1
  17. package/dist/data/conversations.js +20 -4
  18. package/dist/data/conversations.js.map +1 -1
  19. package/dist/data/messages.js +13 -19
  20. package/dist/data/messages.js.map +1 -1
  21. package/dist/data/participants.js +6 -4
  22. package/dist/data/participants.js.map +1 -1
  23. package/dist/data/users.js +4 -2
  24. package/dist/data/users.js.map +1 -1
  25. package/dist/index.js +5 -0
  26. package/dist/index.js.map +1 -1
  27. package/dist/message-builder.js.map +1 -1
  28. package/dist/message.js +15 -12
  29. package/dist/message.js.map +1 -1
  30. package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
  31. package/dist/packages/conversations/package.json.js +1 -1
  32. package/dist/participant.js.map +1 -1
  33. package/dist/push-notification.js.map +1 -1
  34. package/dist/services/network.js +38 -15
  35. package/dist/services/network.js.map +1 -1
  36. package/dist/services/typing-indicator.js +7 -5
  37. package/dist/services/typing-indicator.js.map +1 -1
  38. package/dist/unsent-message.js.map +1 -1
  39. package/dist/user.js +1 -1
  40. package/dist/user.js.map +1 -1
  41. package/dist/util/index.js.map +1 -1
  42. package/package.json +18 -16
package/README.md CHANGED
@@ -18,31 +18,35 @@ Using this method, you can `require` `twilio-conversations` and then use the
18
18
  client:
19
19
  ```
20
20
  const { Client } = require('@twilio/conversations');
21
+
21
22
  const client = new Client(token);
22
- // Before you use the client, subscribe to the `'stateChanged'` event and wait
23
- // for the `'initialized'` state to be reported.
24
- client.on('stateChanged', ({ state, error }) => {
25
- if (state === 'initialized') {
26
- // Use the client
27
- }
28
-
29
- if (error) {
30
- // Handle error
31
- }
23
+
24
+ // Before you use the client, subscribe to the `'initialized'` event.
25
+ client.on('initialized', () => {
26
+ // Use the client.
32
27
  }
28
+
29
+ // To catch client initialization errors, subscribe to the `'initFailed'` event.
30
+ client.on('initFailed', ({ error }) => {
31
+ // Handle the error.
32
+ });
33
33
  ```
34
34
 
35
35
  The SDK could also be imported using the ES module syntax:
36
36
  ```
37
37
  import { Client } from '@twilio/conversations';
38
+
38
39
  const client = new Client(token);
39
- // Before you use the client, subscribe to the `'stateChanged'` event and wait
40
- // for the `'initialized'` state to be reported.
41
- client.on('stateChanged', (state) => {
42
- if (state === 'initialized') {
43
- // Use the client
44
- }
40
+
41
+ // Before you use the client, subscribe to the `'initialized'` event.
42
+ client.on('initialized', () => {
43
+ // Use the client.
45
44
  }
45
+
46
+ // To catch client initialization errors, subscribe to the `'initFailed'` event.
47
+ client.on('initFailed', ({ error }) => {
48
+ // Handle the error.
49
+ });
46
50
  ```
47
51
 
48
52
  ### CDN
@@ -50,7 +54,7 @@ client.on('stateChanged', (state) => {
50
54
  Releases of `twilio-conversations.js` are hosted on a CDN, and you can include these
51
55
  directly in your web app using a `<script>` tag.
52
56
  ```html
53
- <script src="https://media.twiliocdn.com/sdk/js/conversations/v3.0.0/twilio-conversations.min.js"></script>
57
+ <script src="https://media.twiliocdn.com/sdk/js/conversations/v2.2/twilio-conversations.min.js"></script>
54
58
  ```
55
59
  Using this method, `twilio-conversations.js` will set a browser global `Twilio.Conversations` through which you can use the client:
56
60
  ```
@@ -68,7 +72,7 @@ number. While less flexible it is significantly more secure, which is required b
68
72
  To consume securely use the following script snippet format:
69
73
 
70
74
  ```html
71
- <script src="https://media.twiliocdn.com/sdk/js/conversations/releases/3.0.0/twilio-conversations.min.js"
75
+ <script src="https://media.twiliocdn.com/sdk/js/conversations/releases/2.2.0/twilio-conversations.min.js"
72
76
  integrity="sha256-<HASH FROM THE CHANGELOGS PAGE>"
73
77
  crossorigin="anonymous"></script>
74
78
  ```