@twilio/conversations 2.6.5 → 2.6.6-canary.14
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/builds/browser.esm.js +51 -2
- package/builds/browser.esm.js.map +1 -1
- package/builds/browser.js +61 -13
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +0 -1
- package/builds/lib.esm.d.ts +0 -1
- package/builds/lib.esm.js +51 -2
- package/builds/lib.js +61 -13
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +14748 -15156
- package/builds/twilio-conversations.js.map +1 -1
- package/builds/twilio-conversations.min.js +1 -1
- package/builds/twilio-conversations.min.js.map +1 -1
- package/dist/conversation.js +1 -2
- package/dist/conversation.js.map +1 -1
- package/dist/data/conversations.js +1 -2
- package/dist/data/conversations.js.map +1 -1
- package/dist/message.js +1 -2
- package/dist/message.js.map +1 -1
- package/dist/packages/conversations/package.json.js +1 -1
- package/dist/participant.js +1 -2
- package/dist/participant.js.map +1 -1
- package/dist/user.js +1 -2
- package/dist/user.js.map +1 -1
- package/dist/util/index.js +36 -1
- package/dist/util/index.js.map +1 -1
- package/package.json +5 -6
- package/docs/assets/css/main.css +0 -2660
- package/docs/assets/images/icons.png +0 -0
- package/docs/assets/images/icons@2x.png +0 -0
- package/docs/assets/images/widgets.png +0 -0
- package/docs/assets/images/widgets@2x.png +0 -0
- package/docs/assets/js/main.js +0 -248
- package/docs/assets/js/search.js +0 -1
- package/docs/classes/AggregatedDeliveryReceipt.html +0 -3184
- package/docs/classes/CancellablePromise.html +0 -3213
- package/docs/classes/ChannelMetadata.html +0 -3050
- package/docs/classes/Client.html +0 -4310
- package/docs/classes/ContentTemplate.html +0 -3116
- package/docs/classes/ContentTemplateVariable.html +0 -3116
- package/docs/classes/Conversation.html +0 -4391
- package/docs/classes/DetailedDeliveryReceipt.html +0 -3163
- package/docs/classes/EmailRecipientDescriptor.html +0 -3098
- package/docs/classes/Media.html +0 -3167
- package/docs/classes/Message.html +0 -3826
- package/docs/classes/MessageBuilder.html +0 -3318
- package/docs/classes/Participant.html +0 -3444
- package/docs/classes/PushNotification.html +0 -3130
- package/docs/classes/RestPaginator.html +0 -3160
- package/docs/classes/UnknownRecipientDescriptor.html +0 -3067
- package/docs/classes/UnsentMessage.html +0 -3042
- package/docs/classes/User.html +0 -3349
- package/docs/index.html +0 -4373
- package/docs/interfaces/ClientOptions.html +0 -3066
- package/docs/interfaces/ConversationBindings.html +0 -3001
- package/docs/interfaces/ConversationEmailBinding.html +0 -3001
- package/docs/interfaces/ConversationLimits.html +0 -3098
- package/docs/interfaces/ConversationState.html +0 -3050
- package/docs/interfaces/ConversationUpdatedEventArgs.html +0 -3001
- package/docs/interfaces/CreateConversationOptions.html +0 -3083
- package/docs/interfaces/LastMessage.html +0 -3050
- package/docs/interfaces/Paginator.html +0 -3141
- package/docs/interfaces/ParticipantBindings.html +0 -3001
- package/docs/interfaces/ParticipantEmailBinding.html +0 -3001
- package/docs/interfaces/PushNotificationData.html +0 -3114
- package/docs/interfaces/SendEmailOptions.html +0 -3034
- package/docs/interfaces/SendMediaOptions.html +0 -3068
- package/docs/modules.html +0 -4374
package/builds/browser.js
CHANGED
|
@@ -176,7 +176,6 @@ var declarativeTypeValidator = require('@twilio/declarative-type-validator');
|
|
|
176
176
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
177
177
|
require('core-js/modules/es.array.includes.js');
|
|
178
178
|
var replayEventEmitter = require('@twilio/replay-event-emitter');
|
|
179
|
-
var isEqual = require('lodash.isequal');
|
|
180
179
|
require('core-js/modules/es.array.slice.js');
|
|
181
180
|
require('core-js/modules/es.function.name.js');
|
|
182
181
|
require('core-js/modules/es.regexp.test.js');
|
|
@@ -262,7 +261,6 @@ var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regenerat
|
|
|
262
261
|
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
|
|
263
262
|
var loglevelLog__namespace = /*#__PURE__*/_interopNamespace(loglevelLog);
|
|
264
263
|
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
265
|
-
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
266
264
|
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
267
265
|
var _wrapNativeSuper__default = /*#__PURE__*/_interopDefaultLegacy(_wrapNativeSuper);
|
|
268
266
|
|
|
@@ -575,6 +573,56 @@ var UriBuilder = /*#__PURE__*/function () {
|
|
|
575
573
|
|
|
576
574
|
return UriBuilder;
|
|
577
575
|
}();
|
|
576
|
+
/**
|
|
577
|
+
* Deep equality check for objects
|
|
578
|
+
* @param a - first value to compare
|
|
579
|
+
* @param b - second value to compare
|
|
580
|
+
* @returns true if values are deeply equal
|
|
581
|
+
*/
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
function isEqual(a, b) {
|
|
585
|
+
if (a === b) {
|
|
586
|
+
return true;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
if (a === null || b === null || a === undefined || b === undefined) {
|
|
590
|
+
return a === b;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
if (_typeof__default["default"](a) !== _typeof__default["default"](b)) {
|
|
594
|
+
return false;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
if (_typeof__default["default"](a) !== "object") {
|
|
598
|
+
return a === b;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
602
|
+
if (a.length !== b.length) {
|
|
603
|
+
return false;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
return a.every(function (item, index) {
|
|
607
|
+
return isEqual(item, b[index]);
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
612
|
+
return false;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
var aKeys = Object.keys(a);
|
|
616
|
+
var bKeys = Object.keys(b);
|
|
617
|
+
|
|
618
|
+
if (aKeys.length !== bKeys.length) {
|
|
619
|
+
return false;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
return aKeys.every(function (key) {
|
|
623
|
+
return isEqual(a[key], b[key]);
|
|
624
|
+
});
|
|
625
|
+
}
|
|
578
626
|
|
|
579
627
|
var json = declarativeTypeValidator.custom(function (value) {
|
|
580
628
|
return [["string", "number", "boolean", "object"].includes(_typeof__default["default"](value)), "a JSON type"];
|
|
@@ -765,7 +813,7 @@ var User = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
|
765
813
|
case 9:
|
|
766
814
|
updateAttributes = parseAttributes(value.value, "Retrieved malformed attributes from the server for user: ".concat(this.state.identity), log$6);
|
|
767
815
|
|
|
768
|
-
if (!
|
|
816
|
+
if (!isEqual(this.state.attributes, updateAttributes)) {
|
|
769
817
|
this.state.attributes = updateAttributes;
|
|
770
818
|
updateReasons.push("attributes");
|
|
771
819
|
}
|
|
@@ -1524,7 +1572,7 @@ var Participant = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
|
1524
1572
|
var updateReasons = [];
|
|
1525
1573
|
var updateAttributes = parseAttributes(data.attributes, "Retrieved malformed attributes from the server for participant: " + this.state.sid, log$5);
|
|
1526
1574
|
|
|
1527
|
-
if (data.attributes && !
|
|
1575
|
+
if (data.attributes && !isEqual(this.state.attributes, updateAttributes)) {
|
|
1528
1576
|
this.state.attributes = updateAttributes;
|
|
1529
1577
|
updateReasons.push("attributes");
|
|
1530
1578
|
}
|
|
@@ -1562,7 +1610,7 @@ var Participant = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
|
1562
1610
|
}
|
|
1563
1611
|
}
|
|
1564
1612
|
|
|
1565
|
-
if (data.bindings && !
|
|
1613
|
+
if (data.bindings && !isEqual(this.state.bindings, data.bindings)) {
|
|
1566
1614
|
this.state.bindings = data.bindings;
|
|
1567
1615
|
updateReasons.push("bindings");
|
|
1568
1616
|
}
|
|
@@ -3197,7 +3245,7 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
|
3197
3245
|
|
|
3198
3246
|
var updatedAttributes = parseAttributes(data.attributes, "Got malformed attributes for the message ".concat(this.sid), log$3);
|
|
3199
3247
|
|
|
3200
|
-
if (!
|
|
3248
|
+
if (!isEqual(this.state.attributes, updatedAttributes)) {
|
|
3201
3249
|
this.state.attributes = updatedAttributes;
|
|
3202
3250
|
updateReasons.push("attributes");
|
|
3203
3251
|
}
|
|
@@ -3232,7 +3280,7 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
|
3232
3280
|
return !(el === null);
|
|
3233
3281
|
});
|
|
3234
3282
|
|
|
3235
|
-
if (!
|
|
3283
|
+
if (!isEqual(input, current) || !isEqual((_classPrivateMethodGe2 = _classPrivateMethodGet(this, _wrapMedia, _wrapMedia2).call(this, data.media)) === null || _classPrivateMethodGe2 === void 0 ? void 0 : _classPrivateMethodGe2._state(), (_this$state$media = this.state.media) === null || _this$state$media === void 0 ? void 0 : _this$state$media._state())) {
|
|
3236
3284
|
var _data$medias3, _data$media2;
|
|
3237
3285
|
|
|
3238
3286
|
_classPrivateMethodGet(this, _assignMedias, _assignMedias2).call(this, (_data$medias3 = data.medias) !== null && _data$medias3 !== void 0 ? _data$medias3 : null, (_data$media2 = data.media) !== null && _data$media2 !== void 0 ? _data$media2 : null);
|
|
@@ -6551,7 +6599,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
|
6551
6599
|
break;
|
|
6552
6600
|
|
|
6553
6601
|
case fieldMappings.attributes:
|
|
6554
|
-
if (
|
|
6602
|
+
if (isEqual(this._internalState.attributes, update.attributes)) {
|
|
6555
6603
|
break;
|
|
6556
6604
|
}
|
|
6557
6605
|
|
|
@@ -6587,7 +6635,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
|
6587
6635
|
updateReasons.add(localKey);
|
|
6588
6636
|
}
|
|
6589
6637
|
|
|
6590
|
-
if (
|
|
6638
|
+
if (isEqual(this._internalState.lastMessage, {})) {
|
|
6591
6639
|
delete this._internalState.lastMessage;
|
|
6592
6640
|
}
|
|
6593
6641
|
|
|
@@ -6600,7 +6648,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
|
6600
6648
|
state.dateUpdated = new Date(state.dateUpdated);
|
|
6601
6649
|
}
|
|
6602
6650
|
|
|
6603
|
-
if (
|
|
6651
|
+
if (isEqual(this._internalState.state, state)) {
|
|
6604
6652
|
break;
|
|
6605
6653
|
}
|
|
6606
6654
|
|
|
@@ -6609,7 +6657,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
|
6609
6657
|
break;
|
|
6610
6658
|
|
|
6611
6659
|
case fieldMappings.bindings:
|
|
6612
|
-
if (
|
|
6660
|
+
if (isEqual(this._internalState.bindings, update.bindings)) {
|
|
6613
6661
|
break;
|
|
6614
6662
|
}
|
|
6615
6663
|
|
|
@@ -7388,7 +7436,7 @@ var Conversations = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
|
7388
7436
|
updateData.lastConsumedMessageIndex = data.lastConsumedMessageIndex;
|
|
7389
7437
|
}
|
|
7390
7438
|
|
|
7391
|
-
if (!
|
|
7439
|
+
if (!isEqual(updateData, {})) {
|
|
7392
7440
|
conversation._update(updateData);
|
|
7393
7441
|
}
|
|
7394
7442
|
|
|
@@ -8124,7 +8172,7 @@ function PushNotification(data) {
|
|
|
8124
8172
|
this.data = data.data || {};
|
|
8125
8173
|
});
|
|
8126
8174
|
|
|
8127
|
-
var version = "2.
|
|
8175
|
+
var version = "2.7.0";
|
|
8128
8176
|
|
|
8129
8177
|
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; }
|
|
8130
8178
|
|