@twilio/conversations 3.0.0-canary.13 → 3.0.0-canary.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 (77) hide show
  1. package/README.md +22 -18
  2. package/builds/browser.js +729 -1639
  3. package/builds/browser.js.map +1 -1
  4. package/builds/lib.d.ts +72 -64
  5. package/builds/lib.js +729 -1639
  6. package/builds/lib.js.map +1 -1
  7. package/builds/twilio-conversations.js +17697 -17435
  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 +69 -65
  12. package/dist/client.js.map +1 -1
  13. package/dist/command-executor.js +38 -13
  14. package/dist/command-executor.js.map +1 -1
  15. package/dist/conversation.js +81 -13
  16. package/dist/conversation.js.map +1 -1
  17. package/dist/data/conversations.js +16 -3
  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 +5 -3
  22. package/dist/data/participants.js.map +1 -1
  23. package/dist/data/users.js +2 -2
  24. package/dist/data/users.js.map +1 -1
  25. package/dist/message-builder.js.map +1 -1
  26. package/dist/message.js +7 -9
  27. package/dist/message.js.map +1 -1
  28. package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
  29. package/dist/packages/conversations/package.json.js +1 -1
  30. package/dist/participant.js +33 -33
  31. package/dist/participant.js.map +1 -1
  32. package/dist/rest-paginator.js +11 -11
  33. package/dist/rest-paginator.js.map +1 -1
  34. package/dist/services/network.js +103 -11
  35. package/dist/services/network.js.map +1 -1
  36. package/dist/services/typing-indicator.js +13 -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 +16 -14
  43. package/docs/assets/css/main.css +0 -2660
  44. package/docs/assets/images/icons.png +0 -0
  45. package/docs/assets/images/icons@2x.png +0 -0
  46. package/docs/assets/images/widgets.png +0 -0
  47. package/docs/assets/images/widgets@2x.png +0 -0
  48. package/docs/assets/js/main.js +0 -248
  49. package/docs/assets/js/search.js +0 -1
  50. package/docs/classes/AggregatedDeliveryReceipt.html +0 -3184
  51. package/docs/classes/Client.html +0 -4239
  52. package/docs/classes/Conversation.html +0 -4354
  53. package/docs/classes/DetailedDeliveryReceipt.html +0 -3163
  54. package/docs/classes/Media.html +0 -3167
  55. package/docs/classes/Message.html +0 -3732
  56. package/docs/classes/MessageBuilder.html +0 -3277
  57. package/docs/classes/Participant.html +0 -3444
  58. package/docs/classes/PushNotification.html +0 -3130
  59. package/docs/classes/RestPaginator.html +0 -3160
  60. package/docs/classes/UnsentMessage.html +0 -3042
  61. package/docs/classes/User.html +0 -3349
  62. package/docs/index.html +0 -3505
  63. package/docs/interfaces/ClientOptions.html +0 -3034
  64. package/docs/interfaces/ConversationBindings.html +0 -3001
  65. package/docs/interfaces/ConversationEmailBinding.html +0 -3001
  66. package/docs/interfaces/ConversationLimits.html +0 -3098
  67. package/docs/interfaces/ConversationState.html +0 -3050
  68. package/docs/interfaces/ConversationUpdatedEventArgs.html +0 -3001
  69. package/docs/interfaces/CreateConversationOptions.html +0 -3066
  70. package/docs/interfaces/LastMessage.html +0 -3050
  71. package/docs/interfaces/Paginator.html +0 -3141
  72. package/docs/interfaces/ParticipantBindings.html +0 -3001
  73. package/docs/interfaces/ParticipantEmailBinding.html +0 -3001
  74. package/docs/interfaces/PushNotificationData.html +0 -3114
  75. package/docs/interfaces/SendEmailOptions.html +0 -3034
  76. package/docs/interfaces/SendMediaOptions.html +0 -3068
  77. package/docs/modules.html +0 -3506
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, error }) => {
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, error }) => {
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/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
  ```