@twilio/conversations 2.0.0-rc.1 → 2.0.1-rc.1

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 (35) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +22 -17
  3. package/dist/browser.js +2348 -2683
  4. package/dist/browser.js.map +1 -1
  5. package/dist/docs/assets/js/search.js +1 -1
  6. package/dist/docs/classes/AggregatedDeliveryReceipt.html +22 -6
  7. package/dist/docs/classes/Client.html +78 -33
  8. package/dist/docs/classes/Conversation.html +33 -17
  9. package/dist/docs/classes/DetailedDeliveryReceipt.html +22 -6
  10. package/dist/docs/classes/Media.html +23 -7
  11. package/dist/docs/classes/Message.html +23 -7
  12. package/dist/docs/classes/MessageBuilder.html +3280 -0
  13. package/dist/docs/classes/Participant.html +23 -7
  14. package/dist/docs/classes/PushNotification.html +24 -8
  15. package/dist/docs/classes/RestPaginator.html +28 -9
  16. package/dist/docs/classes/UnsentMessage.html +3144 -0
  17. package/dist/docs/classes/User.html +25 -9
  18. package/dist/docs/index.html +86 -38
  19. package/dist/docs/interfaces/ClientOptions.html +22 -6
  20. package/dist/docs/interfaces/ConversationState.html +22 -6
  21. package/dist/docs/interfaces/CreateConversationOptions.html +22 -6
  22. package/dist/docs/interfaces/LastMessage.html +22 -6
  23. package/dist/docs/interfaces/Paginator.html +3243 -0
  24. package/dist/docs/interfaces/PushNotificationData.html +3168 -0
  25. package/dist/docs/interfaces/SendEmailOptions.html +22 -6
  26. package/dist/docs/interfaces/SendMediaOptions.html +24 -7
  27. package/dist/docs/modules.html +85 -37
  28. package/dist/lib.d.ts +250 -59
  29. package/dist/lib.js +2278 -2142
  30. package/dist/lib.js.map +1 -1
  31. package/dist/react-native.js +502 -879
  32. package/dist/react-native.js.map +1 -1
  33. package/dist/twilio-conversations.js +25174 -23917
  34. package/dist/twilio-conversations.min.js +14 -2
  35. package/package.json +11 -9
package/CHANGELOG.md CHANGED
@@ -3,6 +3,73 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [2.0.1-rc.1](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.1-rc.0...@twilio/conversations@2.0.1-rc.1) (2021-10-22)
7
+
8
+ **Note:** Version bump only for package @twilio/conversations
9
+
10
+
11
+
12
+
13
+
14
+ ### [2.0.1-rc.0](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.0...@twilio/conversations@2.0.1-rc.0) (2021-10-22)
15
+
16
+ **Note:** Version bump only for package @twilio/conversations
17
+
18
+
19
+
20
+
21
+
22
+ ## [2.0.0](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.0-rc.4...@twilio/conversations@2.0.0) (2021-10-19)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * Add an export to NotificationTypes ([0986564](https://github.com/twilio/rtd-sdk-monorepo-js/commit/09865645750f8ae2f930471284de9d9f7445f1e8))
28
+
29
+
30
+
31
+ ## [2.0.0-rc.4](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.0-rc.3...@twilio/conversations@2.0.0-rc.4) (2021-10-14)
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * Fix passing JSON attributes into conversation.addNonChatParticipant ([c3da243](https://github.com/twilio/rtd-sdk-monorepo-js/commit/c3da243469f5c33663c756d9f714a38240c4dd48))
37
+
38
+
39
+
40
+ ## [2.0.0-rc.3](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.0-rc.2...@twilio/conversations@2.0.0-rc.3) (2021-10-13)
41
+
42
+ **Note:** Version bump only for package @twilio/conversations
43
+
44
+
45
+
46
+
47
+
48
+ ## [2.0.0-rc.2](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.0-rc.1...@twilio/conversations@2.0.0-rc.2) (2021-10-13)
49
+
50
+
51
+ ### ⚠ BREAKING CHANGES
52
+
53
+ * Disallow null Conversation.updateFriendlyName
54
+ * Disallow null for client options
55
+ * Remove default exports from Conversations
56
+ * Client.reachabilityEnabled can now throw an error.
57
+
58
+ ### Bug Fixes
59
+
60
+ * Add missing exports ([74d08ce](https://github.com/twilio/rtd-sdk-monorepo-js/commit/74d08ce00a8a4cf0b961dde3570f5c7bd7a1e1f9))
61
+ * Allow all JSON values as properties in addNonChatParticipant ([ddbea1c](https://github.com/twilio/rtd-sdk-monorepo-js/commit/ddbea1c0d0d26b488661ef123883316f7926b456))
62
+ * Disallow null Conversation.updateFriendlyName ([7e4b556](https://github.com/twilio/rtd-sdk-monorepo-js/commit/7e4b5563e2a016f1904d9b37cfc063592712f0a6))
63
+ * Disallow null for client options ([c5435f9](https://github.com/twilio/rtd-sdk-monorepo-js/commit/c5435f9fb9dadf11483e2c7884c334a040c06330))
64
+ * Fix client user initialization problem ([043546d](https://github.com/twilio/rtd-sdk-monorepo-js/commit/043546d872300fda4db70d9c04461f944dfa5936))
65
+ * Remove default exports from Conversations ([38e2e24](https://github.com/twilio/rtd-sdk-monorepo-js/commit/38e2e24512425da4ba0f1670dcf37d8ccf1ac67e))
66
+ * Reset currentState on push unregister ([590991c](https://github.com/twilio/rtd-sdk-monorepo-js/commit/590991c841a78b3c7e88a05629090a2de5a8f9da))
67
+ * Resubscribe to push notification on re-register ([709847f](https://github.com/twilio/rtd-sdk-monorepo-js/commit/709847f8462890214197cf1af769f41b56bfbccc))
68
+ * Throw an error if reachabilityEnabled was accessed before client init ([3fd3293](https://github.com/twilio/rtd-sdk-monorepo-js/commit/3fd32937d7e42d6df815efab35ded3b93a671556))
69
+ * UnsentMessage.send now returns a proper value ([c71a0a9](https://github.com/twilio/rtd-sdk-monorepo-js/commit/c71a0a9a9618c09f5d02dbee6bc2d122d9008383))
70
+
71
+
72
+
6
73
  ## [2.0.0-rc.1](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.0-rc.0...@twilio/conversations@2.0.0-rc.1) (2021-10-04)
7
74
 
8
75
 
package/README.md CHANGED
@@ -14,26 +14,31 @@ To use the library you need [to generate a token](https://www.twilio.com/docs/co
14
14
  npm install --save @twilio/conversations
15
15
  ```
16
16
 
17
- Using this method, you can `require` `twilio-conversations` and then use the client:
17
+ Using this method, you can `require` `twilio-conversations` and then use the
18
+ client:
18
19
  ```
19
- const Conversations = require('@twilio/conversations');
20
- Conversations.Client.create(token).then(client => {
21
- // Use client
22
- });
23
- ```
24
-
25
- Or, if you prefer `async`/`await` syntax:
26
- ```
27
- const Conversations = require('@twilio/conversations');
28
- const client = await Conversations.Client.create(token);
29
- // Use client
20
+ const { Client } = require('@twilio/conversations');
21
+ 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) => {
25
+ if (state === 'initialized') {
26
+ // Use the client
27
+ }
28
+ }
30
29
  ```
31
30
 
32
31
  The SDK could also be imported using the ES module syntax:
33
32
  ```
34
- import Conversations from '@twilio/conversations';
35
- const client = await Conversations.Client.create(token);
36
- // Use client
33
+ import { Client } from '@twilio/conversations';
34
+ const client = new Client(token);
35
+ // Before you use the client, subscribe to the `'stateChanged'` event and wait
36
+ // for the `'initialized'` state to be reported.
37
+ client.on('stateChanged', (state) => {
38
+ if (state === 'initialized') {
39
+ // Use the client
40
+ }
41
+ }
37
42
  ```
38
43
 
39
44
  ### CDN
@@ -41,7 +46,7 @@ const client = await Conversations.Client.create(token);
41
46
  Releases of `twilio-conversations.js` are hosted on a CDN, and you can include these
42
47
  directly in your web app using a `<script>` tag.
43
48
  ```html
44
- <script src="https://media.twiliocdn.com/sdk/js/conversations/v1.2/twilio-conversations.min.js"></script>
49
+ <script src="https://media.twiliocdn.com/sdk/js/conversations/v2.0/twilio-conversations.min.js"></script>
45
50
  ```
46
51
  Using this method, `twilio-conversations.js` will set a browser global `Twilio.Conversations` through which you can use the client :
47
52
  ```
@@ -67,7 +72,7 @@ number. While less flexible it is significantly more secure, which is required b
67
72
  To consume securely use the following script snippet format:
68
73
 
69
74
  ```html
70
- <script src="https://media.twiliocdn.com/sdk/js/conversations/releases/1.2.0/twilio-conversations.min.js"
75
+ <script src="https://media.twiliocdn.com/sdk/js/conversations/releases/2.0.0/twilio-conversations.min.js"
71
76
  integrity="sha256-<HASH FROM THE CHANGELOGS PAGE>"
72
77
  crossorigin="anonymous"></script>
73
78
  ```