@twilio/conversations 2.2.0-rc.10 → 2.2.0-rc.13

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,34 @@
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.2.0-rc.13](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.2.0-rc.12...@twilio/conversations@2.2.0-rc.13) (2022-09-13)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Remove unused parameter from initialized event ([de54b9e](https://github.com/twilio/rtd-sdk-monorepo-js/commit/de54b9ec29ad358bcb6d946fb96e4fc4be3f45ce))
12
+ * SyncError getting minified. RTDSDK-3717 ([0b99992](https://github.com/twilio/rtd-sdk-monorepo-js/commit/0b99992ed6c684d74c7b19c45956d293aa5662fd))
13
+
14
+
15
+
16
+ ## [2.2.0-rc.12](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.2.0-rc.11...@twilio/conversations@2.2.0-rc.12) (2022-08-23)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * Fix 2.2.0 release blockers ([f54f564](https://github.com/twilio/rtd-sdk-monorepo-js/commit/f54f56421d7e8f14476abfbf6a315a84d203c88c))
22
+ * Fix faulty event emits on token update. RTDSDK-3699 ([4c40f39](https://github.com/twilio/rtd-sdk-monorepo-js/commit/4c40f39334ab6a62379c4b5c25c6a4f8cc168959))
23
+
24
+
25
+
26
+ ## [2.2.0-rc.11](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.2.0-rc.10...@twilio/conversations@2.2.0-rc.11) (2022-07-26)
27
+
28
+ **Note:** Version bump only for package @twilio/conversations
29
+
30
+
31
+
32
+
33
+
6
34
  ## [2.2.0-rc.10](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.2.0-rc.9...@twilio/conversations@2.2.0-rc.10) (2022-07-26)
7
35
 
8
36
  **Note:** Version bump only for package @twilio/conversations
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
  ```
package/builds/browser.js CHANGED
@@ -7326,7 +7326,7 @@ function PushNotification(data) {
7326
7326
  this.data = data.data || {};
7327
7327
  });
7328
7328
 
7329
- var version = "2.2.0-rc.10";
7329
+ var version = "2.2.0-rc.13";
7330
7330
 
7331
7331
  function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7332
7332
 
@@ -7738,9 +7738,6 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
7738
7738
 
7739
7739
  /**
7740
7740
  * Fired when the client has completed initialization successfully.
7741
- *
7742
- * Parameters:
7743
- * 1. object `data` - Optional info object provided with the event
7744
7741
  * @event
7745
7742
  */
7746
7743
 
@@ -7939,11 +7936,11 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
7939
7936
  });
7940
7937
  };
7941
7938
 
7942
- _this._services.twilsockClient.on("connectionError", emitFailed);
7939
+ _this._services.twilsockClient.once("connectionError", emitFailed);
7943
7940
 
7944
- _this._services.twilsockClient.on("disconnected", emitDisconnected);
7941
+ _this._services.twilsockClient.once("disconnected", emitDisconnected);
7945
7942
 
7946
- _this._services.twilsockClient.on("connected", /*#__PURE__*/_asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
7943
+ _this._services.twilsockClient.once("connected", /*#__PURE__*/_asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
7947
7944
  var startupEvent, connectionError;
7948
7945
  return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
7949
7946
  while (1) {
@@ -8806,7 +8803,7 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
8806
8803
  this._resolveEnsureReady();
8807
8804
 
8808
8805
  this.emit("stateChanged", "initialized");
8809
- this.emit("initialized", {});
8806
+ this.emit("initialized");
8810
8807
 
8811
8808
  case 34:
8812
8809
  case "end":