@twilio/conversations 2.1.0-rc.8 → 2.1.0-rc.9
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 +8 -0
- package/builds/browser.js +5 -1
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +3 -0
- package/builds/lib.js +5 -1
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +77 -58
- package/builds/twilio-conversations.min.js +2 -2
- package/dist/conversation.js +3 -0
- package/dist/conversation.js.map +1 -1
- package/dist/packages/conversations/package.json.js +1 -1
- package/docs/assets/js/search.js +1 -1
- package/docs/classes/Conversation.html +23 -0
- package/package.json +2 -2
@@ -22949,7 +22949,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
22949
22949
|
}).length;
|
22950
22950
|
log$1$1.debug("Attempting '".concat(action, "' request (c:").concat(correlationId, "):"), requests);
|
22951
22951
|
var requestBody = {
|
22952
|
-
event_protocol_version:
|
22952
|
+
event_protocol_version: 4,
|
22953
22953
|
action: action,
|
22954
22954
|
correlation_id: correlationId,
|
22955
22955
|
retried_requests: retriedRequests,
|
@@ -23026,71 +23026,86 @@ this.Twilio.Conversations = (function (exports) {
|
|
23026
23026
|
key: "acceptMessage",
|
23027
23027
|
value: function acceptMessage(message, isStrictlyOrdered) {
|
23028
23028
|
log$1$1.trace('Subscriptions received', message);
|
23029
|
+
var eventType = message.event_type;
|
23030
|
+
var events = typeof message.events !== 'undefined' ? message.events : [message.event];
|
23031
|
+
var correlationId = message.correlation_id;
|
23029
23032
|
|
23030
|
-
if (
|
23031
|
-
this.latestPokeResponseArrivalTimestampByCorrelationId.set(
|
23033
|
+
if (correlationId) {
|
23034
|
+
this.latestPokeResponseArrivalTimestampByCorrelationId.set(correlationId, new Date().getTime());
|
23032
23035
|
}
|
23033
23036
|
|
23034
|
-
var
|
23037
|
+
var _iterator4 = _createForOfIteratorHelper$3(events),
|
23038
|
+
_step4;
|
23035
23039
|
|
23036
|
-
|
23037
|
-
|
23038
|
-
|
23039
|
-
|
23040
|
+
try {
|
23041
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
23042
|
+
var event = _step4.value;
|
23043
|
+
var matchedEventType = void 0;
|
23040
23044
|
|
23041
|
-
|
23042
|
-
|
23043
|
-
|
23045
|
+
switch (message.event_type) {
|
23046
|
+
case 'subscription_established':
|
23047
|
+
this.applySubscriptionEstablishedMessage(event, correlationId);
|
23048
|
+
break;
|
23044
23049
|
|
23045
|
-
|
23046
|
-
|
23047
|
-
|
23050
|
+
case 'subscription_canceled':
|
23051
|
+
this.applySubscriptionCancelledMessage(event, correlationId);
|
23052
|
+
break;
|
23048
23053
|
|
23049
|
-
|
23050
|
-
|
23051
|
-
|
23054
|
+
case 'subscription_failed':
|
23055
|
+
this.applySubscriptionFailedMessage(event, correlationId);
|
23056
|
+
break;
|
23052
23057
|
|
23053
|
-
|
23054
|
-
|
23055
|
-
typedSid =
|
23056
|
-
break;
|
23058
|
+
case (matchedEventType = eventType.match(/^(?:map|list|document|stream|live_query)_/) || {}).input:
|
23059
|
+
{
|
23060
|
+
var typedSid = void 0;
|
23057
23061
|
|
23058
|
-
|
23059
|
-
|
23060
|
-
|
23062
|
+
switch (matchedEventType[0]) {
|
23063
|
+
case 'map_':
|
23064
|
+
typedSid = event.map_sid;
|
23065
|
+
break;
|
23061
23066
|
|
23062
|
-
|
23063
|
-
|
23064
|
-
|
23067
|
+
case 'list_':
|
23068
|
+
typedSid = event.list_sid;
|
23069
|
+
break;
|
23065
23070
|
|
23066
|
-
|
23067
|
-
|
23068
|
-
|
23071
|
+
case 'document_':
|
23072
|
+
typedSid = event.document_sid;
|
23073
|
+
break;
|
23069
23074
|
|
23070
|
-
|
23071
|
-
|
23072
|
-
|
23073
|
-
// to this type in legacy clients, which we have to support now; hence a hack)
|
23075
|
+
case 'stream_':
|
23076
|
+
typedSid = event.stream_sid;
|
23077
|
+
break;
|
23074
23078
|
|
23075
|
-
|
23079
|
+
case 'live_query_':
|
23080
|
+
typedSid = event.query_id; // hack to mark replay events for LiveQuery as strictly ordered, due to lack of special type of notification for them
|
23081
|
+
// (normally only replay events would have `twilio.sync.event` type, but LiveQuery non-replay events were also assigned
|
23082
|
+
// to this type in legacy clients, which we have to support now; hence a hack)
|
23083
|
+
|
23084
|
+
isStrictlyOrdered = false; // explicitly override it due to code in router.ts does not know about LiveQueries
|
23085
|
+
|
23086
|
+
if (message.strictly_ordered === true) {
|
23087
|
+
isStrictlyOrdered = true;
|
23088
|
+
}
|
23089
|
+
|
23090
|
+
break;
|
23076
23091
|
|
23077
|
-
|
23078
|
-
|
23092
|
+
default:
|
23093
|
+
typedSid = undefined;
|
23079
23094
|
}
|
23080
23095
|
|
23096
|
+
this.applyEventToSubscribedEntity(typedSid, event, eventType, isStrictlyOrdered);
|
23081
23097
|
break;
|
23098
|
+
}
|
23082
23099
|
|
23083
|
-
|
23084
|
-
|
23085
|
-
|
23086
|
-
|
23087
|
-
this.applyEventToSubscribedEntity(typedSid, message, isStrictlyOrdered);
|
23100
|
+
default:
|
23101
|
+
log$1$1.debug("Dropping unknown message type ".concat(eventType));
|
23102
|
+
break;
|
23088
23103
|
}
|
23089
|
-
|
23090
|
-
|
23091
|
-
|
23092
|
-
|
23093
|
-
|
23104
|
+
}
|
23105
|
+
} catch (err) {
|
23106
|
+
_iterator4.e(err);
|
23107
|
+
} finally {
|
23108
|
+
_iterator4.f();
|
23094
23109
|
}
|
23095
23110
|
}
|
23096
23111
|
}, {
|
@@ -23155,7 +23170,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
23155
23170
|
}
|
23156
23171
|
}, {
|
23157
23172
|
key: "applyEventToSubscribedEntity",
|
23158
|
-
value: function applyEventToSubscribedEntity(sid,
|
23173
|
+
value: function applyEventToSubscribedEntity(sid, event, eventType, isStrictlyOrdered) {
|
23159
23174
|
var _this4 = this;
|
23160
23175
|
|
23161
23176
|
if (!sid) {
|
@@ -23173,8 +23188,8 @@ this.Twilio.Conversations = (function (exports) {
|
|
23173
23188
|
var subscriptionIntent = this.subscriptions.get(sid);
|
23174
23189
|
|
23175
23190
|
if (subscriptionIntent) {
|
23176
|
-
|
23177
|
-
subscriptionIntent.update(
|
23191
|
+
event.type = eventType;
|
23192
|
+
subscriptionIntent.update(event, isStrictlyOrdered);
|
23178
23193
|
} else {
|
23179
23194
|
log$1$1.debug("Message dropped for SID '".concat(sid, "', for which there is no subscription."));
|
23180
23195
|
}
|
@@ -23216,12 +23231,12 @@ this.Twilio.Conversations = (function (exports) {
|
|
23216
23231
|
|
23217
23232
|
var failedSubscriptions = [];
|
23218
23233
|
|
23219
|
-
var
|
23220
|
-
|
23234
|
+
var _iterator5 = _createForOfIteratorHelper$3(this.persisted.values()),
|
23235
|
+
_step5;
|
23221
23236
|
|
23222
23237
|
try {
|
23223
|
-
for (
|
23224
|
-
var _it =
|
23238
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
23239
|
+
var _it = _step5.value;
|
23225
23240
|
|
23226
23241
|
_it.reset();
|
23227
23242
|
|
@@ -23230,9 +23245,9 @@ this.Twilio.Conversations = (function (exports) {
|
|
23230
23245
|
}
|
23231
23246
|
}
|
23232
23247
|
} catch (err) {
|
23233
|
-
|
23248
|
+
_iterator5.e(err);
|
23234
23249
|
} finally {
|
23235
|
-
|
23250
|
+
_iterator5.f();
|
23236
23251
|
}
|
23237
23252
|
|
23238
23253
|
this.persisted.clear();
|
@@ -30415,7 +30430,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
30415
30430
|
|
30416
30431
|
__decorate([declarativeTypeValidator.validateTypes(declarativeTypeValidator.nonEmptyString), __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", void 0)], InstantQuery.prototype, "updateIndexName", null);
|
30417
30432
|
|
30418
|
-
var version$1 = "3.0
|
30433
|
+
var version$1 = "3.1.0-rc.0";
|
30419
30434
|
|
30420
30435
|
function _createSuper$9(Derived) {
|
30421
30436
|
var hasNativeReflectConstruct = _isNativeReflectConstruct$a();
|
@@ -37707,6 +37722,10 @@ this.Twilio.Conversations = (function (exports) {
|
|
37707
37722
|
get: function get() {
|
37708
37723
|
return this.channelState.bindings;
|
37709
37724
|
}
|
37725
|
+
/**
|
37726
|
+
* Current conversation limits.
|
37727
|
+
*/
|
37728
|
+
|
37710
37729
|
}, {
|
37711
37730
|
key: "limits",
|
37712
37731
|
get: function get() {
|
@@ -40414,7 +40433,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
40414
40433
|
this.data = data.data || {};
|
40415
40434
|
};
|
40416
40435
|
|
40417
|
-
var version = "2.1.0-rc.
|
40436
|
+
var version = "2.1.0-rc.9";
|
40418
40437
|
|
40419
40438
|
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; }
|
40420
40439
|
|