@twilio/conversations 2.0.0 → 2.0.1-rc.10
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 +94 -0
- package/README.md +4 -12
- package/{dist → builds}/browser.js +12 -20
- package/builds/browser.js.map +1 -0
- package/{dist → builds}/lib.d.ts +0 -0
- package/{dist → builds}/lib.js +12 -20
- package/builds/lib.js.map +1 -0
- package/{dist → builds}/twilio-conversations.js +1941 -1281
- package/builds/twilio-conversations.min.js +156 -0
- package/dist/aggregated-delivery-receipt.js +227 -0
- package/dist/aggregated-delivery-receipt.js.map +1 -0
- package/dist/client.js +872 -0
- package/dist/client.js.map +1 -0
- package/dist/command-executor.js +203 -0
- package/dist/command-executor.js.map +1 -0
- package/dist/configuration.js +196 -0
- package/dist/configuration.js.map +1 -0
- package/dist/conversation.js +973 -0
- package/dist/conversation.js.map +1 -0
- package/dist/data/conversations.js +443 -0
- package/dist/data/conversations.js.map +1 -0
- package/dist/data/messages.js +341 -0
- package/dist/data/messages.js.map +1 -0
- package/dist/data/participants.js +313 -0
- package/dist/data/participants.js.map +1 -0
- package/dist/data/users.js +228 -0
- package/dist/data/users.js.map +1 -0
- package/dist/detailed-delivery-receipt.js +154 -0
- package/dist/detailed-delivery-receipt.js.map +1 -0
- package/dist/index.js +168 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/notification-types.js +143 -0
- package/dist/interfaces/notification-types.js.map +1 -0
- package/dist/logger.js +190 -0
- package/dist/logger.js.map +1 -0
- package/dist/media.js +213 -0
- package/dist/media.js.map +1 -0
- package/dist/message-builder.js +209 -0
- package/dist/message-builder.js.map +1 -0
- package/dist/message.js +450 -0
- package/dist/message.js.map +1 -0
- package/dist/node_modules/tslib/tslib.es6.js +161 -0
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/packages/conversations/package.json.js +136 -0
- package/dist/packages/conversations/package.json.js.map +1 -0
- package/dist/participant.js +346 -0
- package/dist/participant.js.map +1 -0
- package/dist/push-notification.js +152 -0
- package/dist/push-notification.js.map +1 -0
- package/dist/rest-paginator.js +175 -0
- package/dist/rest-paginator.js.map +1 -0
- package/dist/services/network.js +205 -0
- package/dist/services/network.js.map +1 -0
- package/dist/services/typing-indicator.js +235 -0
- package/dist/services/typing-indicator.js.map +1 -0
- package/dist/unsent-message.js +159 -0
- package/dist/unsent-message.js.map +1 -0
- package/dist/user.js +392 -0
- package/dist/user.js.map +1 -0
- package/dist/util/deferred.js +154 -0
- package/dist/util/deferred.js.map +1 -0
- package/dist/util/index.js +206 -0
- package/dist/util/index.js.map +1 -0
- package/{dist/docs → docs}/assets/css/main.css +0 -0
- package/{dist/docs → docs}/assets/images/icons.png +0 -0
- package/{dist/docs → docs}/assets/images/icons@2x.png +0 -0
- package/{dist/docs → docs}/assets/images/widgets.png +0 -0
- package/{dist/docs → docs}/assets/images/widgets@2x.png +0 -0
- package/{dist/docs → docs}/assets/js/main.js +0 -0
- package/{dist/docs → docs}/assets/js/search.js +0 -0
- package/{dist/docs → docs}/classes/AggregatedDeliveryReceipt.html +0 -0
- package/{dist/docs → docs}/classes/Client.html +0 -0
- package/{dist/docs → docs}/classes/Conversation.html +0 -0
- package/{dist/docs → docs}/classes/DetailedDeliveryReceipt.html +0 -0
- package/{dist/docs → docs}/classes/Media.html +0 -0
- package/{dist/docs → docs}/classes/Message.html +0 -0
- package/{dist/docs → docs}/classes/MessageBuilder.html +0 -0
- package/{dist/docs → docs}/classes/Participant.html +0 -0
- package/{dist/docs → docs}/classes/PushNotification.html +0 -0
- package/{dist/docs → docs}/classes/RestPaginator.html +0 -0
- package/{dist/docs → docs}/classes/UnsentMessage.html +0 -0
- package/{dist/docs → docs}/classes/User.html +0 -0
- package/{dist/docs → docs}/index.html +4 -10
- package/{dist/docs → docs}/interfaces/ClientOptions.html +0 -0
- package/{dist/docs → docs}/interfaces/ConversationState.html +0 -0
- package/{dist/docs → docs}/interfaces/CreateConversationOptions.html +0 -0
- package/{dist/docs → docs}/interfaces/LastMessage.html +0 -0
- package/{dist/docs → docs}/interfaces/Paginator.html +0 -0
- package/{dist/docs → docs}/interfaces/PushNotificationData.html +0 -0
- package/{dist/docs → docs}/interfaces/SendEmailOptions.html +0 -0
- package/{dist/docs → docs}/interfaces/SendMediaOptions.html +0 -0
- package/{dist/docs → docs}/modules.html +4 -10
- package/package.json +27 -27
- package/dist/browser.js.map +0 -1
- package/dist/lib.js.map +0 -1
- package/dist/post-install.js +0 -29
- package/dist/react-native.js +0 -4039
- package/dist/react-native.js.map +0 -1
- package/dist/twilio-conversations.min.js +0 -156
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,100 @@
|
|
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.10](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.1-rc.9...@twilio/conversations@2.0.1-rc.10) (2021-11-16)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* Fix import isomorphic form data to conversations ([22d0712](https://github.com/twilio/rtd-sdk-monorepo-js/commit/22d0712e50b74690788642382a5f9d091d9c349d))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
### [2.0.1-rc.9](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.1-rc.8...@twilio/conversations@2.0.1-rc.9) (2021-11-12)
|
16
|
+
|
17
|
+
**Note:** Version bump only for package @twilio/conversations
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
### [2.0.1-rc.8](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.1-rc.7...@twilio/conversations@2.0.1-rc.8) (2021-11-12)
|
24
|
+
|
25
|
+
**Note:** Version bump only for package @twilio/conversations
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
### [2.0.1-rc.7](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.1-rc.6...@twilio/conversations@2.0.1-rc.7) (2021-11-12)
|
32
|
+
|
33
|
+
**Note:** Version bump only for package @twilio/conversations
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
### [2.0.1-rc.6](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.1-rc.5...@twilio/conversations@2.0.1-rc.6) (2021-11-11)
|
40
|
+
|
41
|
+
|
42
|
+
### Bug Fixes
|
43
|
+
|
44
|
+
* Remove the post-install script in favour of the "react-native" option ([0fe352d](https://github.com/twilio/rtd-sdk-monorepo-js/commit/0fe352d45e50cec78e880affee589009055d5338))
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
### [2.0.1-rc.5](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.1-rc.4...@twilio/conversations@2.0.1-rc.5) (2021-11-10)
|
49
|
+
|
50
|
+
|
51
|
+
### Bug Fixes
|
52
|
+
|
53
|
+
* Fix the post-install script (yet again) ([c8cb1ee](https://github.com/twilio/rtd-sdk-monorepo-js/commit/c8cb1ee501d1c793497985592d2c1ae97162a219))
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
### [2.0.1-rc.4](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.1-rc.3...@twilio/conversations@2.0.1-rc.4) (2021-11-09)
|
58
|
+
|
59
|
+
|
60
|
+
### Bug Fixes
|
61
|
+
|
62
|
+
* Fix getChannelBySid returning wrong channels issue ([3eeaf1f](https://github.com/twilio/rtd-sdk-monorepo-js/commit/3eeaf1fc64d77c48305ff7c43b8a92c81e6ead7b))
|
63
|
+
* Fix the post-install script to be runnable cross-platform ([a16eede](https://github.com/twilio/rtd-sdk-monorepo-js/commit/a16eede598dd3dbdda1997fbd2033fa2254f113f))
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
### [2.0.1-rc.3](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.1-rc.2...@twilio/conversations@2.0.1-rc.3) (2021-10-26)
|
68
|
+
|
69
|
+
|
70
|
+
### Bug Fixes
|
71
|
+
|
72
|
+
* Bump Node required version to current LTS (14) ([ee272b3](https://github.com/twilio/rtd-sdk-monorepo-js/commit/ee272b350f4556a454a18a8aa192c37b54aaaeeb))
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
### [2.0.1-rc.2](https://github.com/twilio/rtd-sdk-monorepo-js/compare/@twilio/conversations@2.0.1-rc.1...@twilio/conversations@2.0.1-rc.2) (2021-10-25)
|
77
|
+
|
78
|
+
**Note:** Version bump only for package @twilio/conversations
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
### [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)
|
85
|
+
|
86
|
+
**Note:** Version bump only for package @twilio/conversations
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
### [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)
|
93
|
+
|
94
|
+
**Note:** Version bump only for package @twilio/conversations
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
6
100
|
## [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)
|
7
101
|
|
8
102
|
|
package/README.md
CHANGED
@@ -7,7 +7,7 @@ Visit our official site for more detalis: [https://www.twilio.com/conversations]
|
|
7
7
|
|
8
8
|
Instantiating and using
|
9
9
|
------------
|
10
|
-
To use the library you need [to generate a token](https://www.twilio.com/docs/conversations/create-tokens) and pass it to the
|
10
|
+
To use the library you need [to generate a token](https://www.twilio.com/docs/conversations/create-tokens) and pass it to the Conversations Client constructor.
|
11
11
|
|
12
12
|
### NPM
|
13
13
|
```
|
@@ -48,17 +48,9 @@ directly in your web app using a `<script>` tag.
|
|
48
48
|
```html
|
49
49
|
<script src="https://media.twiliocdn.com/sdk/js/conversations/v2.0/twilio-conversations.min.js"></script>
|
50
50
|
```
|
51
|
-
Using this method, `twilio-conversations.js` will set a browser global `Twilio.Conversations` through which you can use the client
|
51
|
+
Using this method, `twilio-conversations.js` will set a browser global `Twilio.Conversations` through which you can use the client:
|
52
52
|
```
|
53
|
-
Twilio.Conversations.Client
|
54
|
-
// Use client
|
55
|
-
});
|
56
|
-
```
|
57
|
-
|
58
|
-
or, if you prefer `async`/`await` syntax:
|
59
|
-
```
|
60
|
-
let client = await Twilio.Conversations.Client.create(token);
|
61
|
-
// Use client
|
53
|
+
const client = new Twilio.Conversations.Client(token);
|
62
54
|
```
|
63
55
|
|
64
56
|
### Security
|
@@ -72,7 +64,7 @@ number. While less flexible it is significantly more secure, which is required b
|
|
72
64
|
To consume securely use the following script snippet format:
|
73
65
|
|
74
66
|
```html
|
75
|
-
<script src="https://media.twiliocdn.com/sdk/js/conversations/releases/2.0.
|
67
|
+
<script src="https://media.twiliocdn.com/sdk/js/conversations/releases/2.0.1/twilio-conversations.min.js"
|
76
68
|
integrity="sha256-<HASH FROM THE CHANGELOGS PAGE>"
|
77
69
|
crossorigin="anonymous"></script>
|
78
70
|
```
|
@@ -130,6 +130,7 @@ This software includes platform.js under the following license.
|
|
130
130
|
|
131
131
|
Object.defineProperty(exports, '__esModule', { value: true });
|
132
132
|
|
133
|
+
require('isomorphic-form-data');
|
133
134
|
require('core-js/modules/es.reflect.construct.js');
|
134
135
|
require('core-js/modules/es.object.keys.js');
|
135
136
|
require('core-js/modules/es.symbol.js');
|
@@ -161,9 +162,9 @@ require('core-js/modules/web.dom-collections.iterator.js');
|
|
161
162
|
require('core-js/modules/es.regexp.exec.js');
|
162
163
|
require('core-js/modules/es.string.replace.js');
|
163
164
|
require('core-js/modules/es.array.join.js');
|
164
|
-
var JsonDiff = require('rfc6902');
|
165
165
|
var declarativeTypeValidator = require('@twilio/declarative-type-validator');
|
166
166
|
var replayEventEmitter = require('@twilio/replay-event-emitter');
|
167
|
+
var isEqual = require('lodash.isequal');
|
167
168
|
require('core-js/modules/es.array.slice.js');
|
168
169
|
require('core-js/modules/es.function.name.js');
|
169
170
|
require('core-js/modules/es.symbol.description.js');
|
@@ -244,7 +245,7 @@ var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallChec
|
|
244
245
|
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
245
246
|
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
|
246
247
|
var loglevelLog__namespace = /*#__PURE__*/_interopNamespace(loglevelLog);
|
247
|
-
var
|
248
|
+
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
248
249
|
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
249
250
|
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
250
251
|
|
@@ -459,21 +460,12 @@ var Configuration = function Configuration() {
|
|
459
460
|
}
|
460
461
|
};
|
461
462
|
|
462
|
-
/**
|
463
|
-
* Checks if objects are equal
|
464
|
-
*/
|
465
|
-
|
466
|
-
function isDeepEqual(o1, o2) {
|
467
|
-
return JsonDiff__namespace.createPatch(o1, o2).length === 0;
|
468
|
-
}
|
469
463
|
/**
|
470
464
|
* Deep-clone an object. Note that this does not work on object containing
|
471
465
|
* functions.
|
472
466
|
* @param {object} obj - the object to deep-clone
|
473
467
|
* @returns {object}
|
474
468
|
*/
|
475
|
-
|
476
|
-
|
477
469
|
function deepClone(obj) {
|
478
470
|
return JSON.parse(JSON.stringify(obj));
|
479
471
|
}
|
@@ -719,7 +711,7 @@ var User = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
719
711
|
case 9:
|
720
712
|
updateAttributes = parseAttributes(value.value, "Retrieved malformed attributes from the server for user: ".concat(this.state.identity), log$8);
|
721
713
|
|
722
|
-
if (!
|
714
|
+
if (!isEqual__default['default'](this.state.attributes, updateAttributes)) {
|
723
715
|
this.state.attributes = updateAttributes;
|
724
716
|
updateReasons.push('attributes');
|
725
717
|
}
|
@@ -1432,7 +1424,7 @@ var Participant = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
1432
1424
|
var updateReasons = [];
|
1433
1425
|
var updateAttributes = parseAttributes(data.attributes, 'Retrieved malformed attributes from the server for participant: ' + this.state.sid, log$7);
|
1434
1426
|
|
1435
|
-
if (data.attributes && !
|
1427
|
+
if (data.attributes && !isEqual__default['default'](this.state.attributes, updateAttributes)) {
|
1436
1428
|
this.state.attributes = updateAttributes;
|
1437
1429
|
updateReasons.push('attributes');
|
1438
1430
|
}
|
@@ -2647,7 +2639,7 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
2647
2639
|
|
2648
2640
|
var updatedAttributes = parseAttributes(data.attributes, "Got malformed attributes for the message ".concat(this.sid), log$5);
|
2649
2641
|
|
2650
|
-
if (!
|
2642
|
+
if (!isEqual__default['default'](this.state.attributes, updatedAttributes)) {
|
2651
2643
|
this.state.attributes = updatedAttributes;
|
2652
2644
|
updateReasons.push('attributes');
|
2653
2645
|
}
|
@@ -4210,7 +4202,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
4210
4202
|
break;
|
4211
4203
|
|
4212
4204
|
case fieldMappings.attributes:
|
4213
|
-
if (
|
4205
|
+
if (isEqual__default['default'](this.channelState.attributes, update.attributes)) {
|
4214
4206
|
break;
|
4215
4207
|
}
|
4216
4208
|
|
@@ -4246,7 +4238,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
4246
4238
|
updateReasons.add(localKey);
|
4247
4239
|
}
|
4248
4240
|
|
4249
|
-
if (
|
4241
|
+
if (isEqual__default['default'](this.channelState.lastMessage, {})) {
|
4250
4242
|
delete this.channelState.lastMessage;
|
4251
4243
|
}
|
4252
4244
|
|
@@ -4259,7 +4251,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
4259
4251
|
state.dateUpdated = new Date(state.dateUpdated);
|
4260
4252
|
}
|
4261
4253
|
|
4262
|
-
if (
|
4254
|
+
if (isEqual__default['default'](this.channelState.state, state)) {
|
4263
4255
|
break;
|
4264
4256
|
}
|
4265
4257
|
|
@@ -5687,7 +5679,7 @@ var Conversations = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
5687
5679
|
conversationsMap = _context4.sent;
|
5688
5680
|
_context4.next = 5;
|
5689
5681
|
return conversationsMap.getItems({
|
5690
|
-
|
5682
|
+
key: sid
|
5691
5683
|
});
|
5692
5684
|
|
5693
5685
|
case 5:
|
@@ -5925,7 +5917,7 @@ var Conversations = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
5925
5917
|
updateData.lastConsumedMessageIndex = data.lastConsumedMessageIndex;
|
5926
5918
|
}
|
5927
5919
|
|
5928
|
-
if (!
|
5920
|
+
if (!isEqual__default['default'](updateData, {})) {
|
5929
5921
|
conversation._update(updateData);
|
5930
5922
|
}
|
5931
5923
|
|
@@ -6608,7 +6600,7 @@ function PushNotification(data) {
|
|
6608
6600
|
this.data = data.data || {};
|
6609
6601
|
};
|
6610
6602
|
|
6611
|
-
var version = "2.0.
|
6603
|
+
var version = "2.0.1-rc.10";
|
6612
6604
|
|
6613
6605
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
6614
6606
|
|