@twilio/conversations 2.5.0-rc.8 → 2.6.0-rc.0
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/README.md +2 -2
- package/builds/browser.esm.js +10713 -0
- package/builds/browser.esm.js.map +1 -0
- package/builds/browser.js +241 -81
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +10 -9
- package/builds/lib.esm.d.ts +3166 -0
- package/builds/lib.esm.js +10712 -0
- package/builds/lib.js +250 -81
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +11231 -11244
- package/builds/twilio-conversations.min.js +1 -1
- package/dist/aggregated-delivery-receipt.js +3 -5
- package/dist/aggregated-delivery-receipt.js.map +1 -1
- package/dist/channel-metadata-client.js +7 -9
- package/dist/channel-metadata-client.js.map +1 -1
- package/dist/client.js +201 -166
- package/dist/client.js.map +1 -1
- package/dist/command-executor.js +8 -8
- package/dist/command-executor.js.map +1 -1
- package/dist/configuration.js +12 -9
- package/dist/configuration.js.map +1 -1
- package/dist/content-client.js +11 -8
- package/dist/content-client.js.map +1 -1
- package/dist/content-template.js +3 -5
- package/dist/content-template.js.map +1 -1
- package/dist/conversation.js +130 -96
- package/dist/conversation.js.map +1 -1
- package/dist/data/conversations.js +36 -43
- package/dist/data/conversations.js.map +1 -1
- package/dist/data/messages.js +23 -21
- package/dist/data/messages.js.map +1 -1
- package/dist/data/participants.js +27 -24
- package/dist/data/participants.js.map +1 -1
- package/dist/data/users.js +15 -13
- package/dist/data/users.js.map +1 -1
- package/dist/detailed-delivery-receipt.js +3 -5
- package/dist/detailed-delivery-receipt.js.map +1 -1
- package/dist/index.js +17 -49
- package/dist/index.js.map +1 -1
- package/dist/interfaces/notification-types.js +1 -5
- package/dist/interfaces/notification-types.js.map +1 -1
- package/dist/interfaces/rules.js +13 -10
- package/dist/interfaces/rules.js.map +1 -1
- package/dist/logger.js +25 -26
- package/dist/logger.js.map +1 -1
- package/dist/media.js +11 -8
- package/dist/media.js.map +1 -1
- package/dist/message-builder.js +48 -40
- package/dist/message-builder.js.map +1 -1
- package/dist/message-recipients-client.js +11 -13
- package/dist/message-recipients-client.js.map +1 -1
- package/dist/message.js +96 -83
- package/dist/message.js.map +1 -1
- package/dist/node_modules/quick-lru/index.js +1 -5
- package/dist/node_modules/quick-lru/index.js.map +1 -1
- package/dist/node_modules/tslib/tslib.es6.js +1 -7
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/packages/conversations/package.json.js +2 -6
- package/dist/packages/conversations/package.json.js.map +1 -1
- package/dist/participant.js +40 -31
- package/dist/participant.js.map +1 -1
- package/dist/push-notification.js +5 -4
- package/dist/push-notification.js.map +1 -1
- package/dist/rest-paginator.js +9 -8
- package/dist/rest-paginator.js.map +1 -1
- package/dist/services/network.js +3 -7
- package/dist/services/network.js.map +1 -1
- package/dist/services/typing-indicator.js +11 -8
- package/dist/services/typing-indicator.js.map +1 -1
- package/dist/unsent-message.js +9 -8
- package/dist/unsent-message.js.map +1 -1
- package/dist/user.js +27 -24
- package/dist/user.js.map +1 -1
- package/dist/util/deferred.js +6 -4
- package/dist/util/deferred.js.map +1 -1
- package/dist/util/index.js +1 -9
- package/dist/util/index.js.map +1 -1
- package/docs/classes/Client.html +2 -2
- package/docs/index.html +3 -3
- package/docs/modules.html +2 -2
- package/package.json +10 -10
package/builds/browser.js
CHANGED
@@ -655,6 +655,22 @@ var User = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
655
655
|
* @event
|
656
656
|
*/
|
657
657
|
|
658
|
+
/**
|
659
|
+
* Fired when the client has subscribed to the user.
|
660
|
+
*
|
661
|
+
* Parameters:
|
662
|
+
* 1. {@link User} `user` - the user in question
|
663
|
+
* @event
|
664
|
+
*/
|
665
|
+
|
666
|
+
/**
|
667
|
+
* Fired when the client has unsubscribed from the user.
|
668
|
+
*
|
669
|
+
* Parameters:
|
670
|
+
* 1. {@link User} `user` - the user in question
|
671
|
+
* @event
|
672
|
+
*/
|
673
|
+
|
658
674
|
|
659
675
|
_createClass__default["default"](User, [{
|
660
676
|
key: "identity",
|
@@ -1327,6 +1343,24 @@ var Participant = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
1327
1343
|
* @event
|
1328
1344
|
*/
|
1329
1345
|
|
1346
|
+
/**
|
1347
|
+
* Fired when the participant has stopped typing.
|
1348
|
+
*
|
1349
|
+
* Parameters:
|
1350
|
+
* 1. {@link Participant} `participant` - the participant in question
|
1351
|
+
* @event
|
1352
|
+
*/
|
1353
|
+
|
1354
|
+
/**
|
1355
|
+
* Fired when the fields of the participant have been updated.
|
1356
|
+
*
|
1357
|
+
* Parameters:
|
1358
|
+
* 1. object `data` - info object provided with the event. It has the following properties:
|
1359
|
+
* * {@link Participant} participant - the participant in question
|
1360
|
+
* * {@link ParticipantUpdateReason}[] updateReasons - array of reasons for the update
|
1361
|
+
* @event
|
1362
|
+
*/
|
1363
|
+
|
1330
1364
|
|
1331
1365
|
_createClass__default["default"](Participant, [{
|
1332
1366
|
key: "sid",
|
@@ -1453,8 +1487,9 @@ var Participant = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
1453
1487
|
}
|
1454
1488
|
|
1455
1489
|
this.state.isTyping = true;
|
1456
|
-
this.emit(
|
1457
|
-
this.conversation.emit(
|
1490
|
+
this.emit(Participant.typingStarted, this);
|
1491
|
+
this.conversation.emit(Conversation.typingStarted, this); // @fixme layering violation
|
1492
|
+
|
1458
1493
|
this.state.typingTimeout = Number(setTimeout(function () {
|
1459
1494
|
return _this2._endTyping();
|
1460
1495
|
}, timeout));
|
@@ -1473,8 +1508,8 @@ var Participant = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
1473
1508
|
}
|
1474
1509
|
|
1475
1510
|
this.state.isTyping = false;
|
1476
|
-
this.emit(
|
1477
|
-
this.conversation.emit(
|
1511
|
+
this.emit(Participant.typingEnded, this);
|
1512
|
+
this.conversation.emit(Conversation.typingEnded, this);
|
1478
1513
|
clearInterval(this.state.typingTimeout);
|
1479
1514
|
this.state.typingTimeout = null;
|
1480
1515
|
}
|
@@ -1533,7 +1568,7 @@ var Participant = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
1533
1568
|
}
|
1534
1569
|
|
1535
1570
|
if (updateReasons.length > 0) {
|
1536
|
-
this.emit(
|
1571
|
+
this.emit(Participant.updated, {
|
1537
1572
|
participant: this,
|
1538
1573
|
updateReasons: updateReasons
|
1539
1574
|
});
|
@@ -1669,7 +1704,8 @@ var Participants = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
1669
1704
|
|
1670
1705
|
var _super = _createSuper$7(Participants);
|
1671
1706
|
|
1672
|
-
|
1707
|
+
// passed in from Conversation
|
1708
|
+
function Participants(conversation, participants, links, services) {
|
1673
1709
|
var _this;
|
1674
1710
|
|
1675
1711
|
_classCallCheck__default["default"](this, Participants);
|
@@ -1681,7 +1717,6 @@ var Participants = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
1681
1717
|
_this.conversation = conversation;
|
1682
1718
|
_this.participants = participants;
|
1683
1719
|
_this.links = links;
|
1684
|
-
_this.configuration = configuration;
|
1685
1720
|
_this.services = services;
|
1686
1721
|
return _this;
|
1687
1722
|
}
|
@@ -1732,14 +1767,14 @@ var Participants = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
1732
1767
|
mode: "open_existing"
|
1733
1768
|
}) : Promise.resolve(arg);
|
1734
1769
|
return this.rosterEntityPromise = this.rosterEntityPromise || participantsMapPromise.then(function (rosterMap) {
|
1735
|
-
rosterMap.on(
|
1770
|
+
rosterMap.on(twilioSync.SyncMap.itemAdded, function (args) {
|
1736
1771
|
log$4.debug(_this2.conversation.sid + " itemAdded: " + args.item.key);
|
1737
1772
|
|
1738
1773
|
_this2.upsertParticipant(args.item.key, args.item.data).then(function (participant) {
|
1739
|
-
_this2.emit(
|
1774
|
+
_this2.emit(Conversation.participantJoined, participant);
|
1740
1775
|
});
|
1741
1776
|
});
|
1742
|
-
rosterMap.on(
|
1777
|
+
rosterMap.on(twilioSync.SyncMap.itemRemoved, function (args) {
|
1743
1778
|
log$4.debug(_this2.conversation.sid + " itemRemoved: " + args.key);
|
1744
1779
|
var participantSid = args.key;
|
1745
1780
|
|
@@ -1755,12 +1790,14 @@ var Participants = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
1755
1790
|
return;
|
1756
1791
|
}
|
1757
1792
|
|
1758
|
-
_this2.emit(
|
1793
|
+
_this2.emit(Conversation.participantLeft, leftParticipant);
|
1759
1794
|
});
|
1760
|
-
rosterMap.on(
|
1795
|
+
rosterMap.on(twilioSync.SyncMap.itemUpdated, function (args) {
|
1761
1796
|
log$4.debug(_this2.conversation.sid + " itemUpdated: " + args.item.key);
|
1762
1797
|
|
1763
|
-
_this2.upsertParticipant(args.item.key, args.item.data)
|
1798
|
+
_this2.upsertParticipant(args.item.key, args.item.data).catch(function (e) {
|
1799
|
+
return log$4.error(e);
|
1800
|
+
});
|
1764
1801
|
});
|
1765
1802
|
var participantsPromises = [];
|
1766
1803
|
|
@@ -1854,8 +1891,8 @@ var Participants = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
1854
1891
|
};
|
1855
1892
|
participant = new Participant(data, participantSid, this.conversation, links, this.services);
|
1856
1893
|
this.participants.set(participantSid, participant);
|
1857
|
-
participant.on(
|
1858
|
-
return _this3.emit(
|
1894
|
+
participant.on(Participant.updated, function (args) {
|
1895
|
+
return _this3.emit(Conversation.participantUpdated, args);
|
1859
1896
|
});
|
1860
1897
|
return _context3.abrupt("return", participant);
|
1861
1898
|
|
@@ -2466,15 +2503,14 @@ var RestPaginator = /*#__PURE__*/function () {
|
|
2466
2503
|
/**
|
2467
2504
|
* @internal
|
2468
2505
|
*/
|
2469
|
-
function RestPaginator(items, source, prevToken, nextToken
|
2506
|
+
function RestPaginator(items, source, prevToken, nextToken) {
|
2470
2507
|
_classCallCheck__default["default"](this, RestPaginator);
|
2471
2508
|
|
2472
2509
|
this.state = {
|
2473
2510
|
prevToken: prevToken,
|
2474
2511
|
nextToken: nextToken,
|
2475
2512
|
source: source,
|
2476
|
-
items: items
|
2477
|
-
pageSize: pageSize
|
2513
|
+
items: items
|
2478
2514
|
};
|
2479
2515
|
}
|
2480
2516
|
/**
|
@@ -2512,7 +2548,7 @@ var RestPaginator = /*#__PURE__*/function () {
|
|
2512
2548
|
}, {
|
2513
2549
|
key: "nextPage",
|
2514
2550
|
value: function nextPage() {
|
2515
|
-
return this.hasNextPage ? this.state.source(this.state.nextToken
|
2551
|
+
return this.hasNextPage ? this.state.source(this.state.nextToken) : Promise.reject(new Error("No next page"));
|
2516
2552
|
}
|
2517
2553
|
/**
|
2518
2554
|
* Request the previous page. Does not modify the existing object.
|
@@ -2521,7 +2557,7 @@ var RestPaginator = /*#__PURE__*/function () {
|
|
2521
2557
|
}, {
|
2522
2558
|
key: "prevPage",
|
2523
2559
|
value: function prevPage() {
|
2524
|
-
return this.hasPrevPage ? this.state.source(this.state.prevToken
|
2560
|
+
return this.hasPrevPage ? this.state.source(this.state.prevToken) : Promise.reject(new Error("No previous page"));
|
2525
2561
|
}
|
2526
2562
|
}]);
|
2527
2563
|
|
@@ -2902,6 +2938,15 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
2902
2938
|
|
2903
2939
|
return _this;
|
2904
2940
|
}
|
2941
|
+
/**
|
2942
|
+
* Fired when the properties or the body of the message has been updated.
|
2943
|
+
*
|
2944
|
+
* Parameters:
|
2945
|
+
* 1. object `data` - info object provided with the event. It has the following properties:
|
2946
|
+
* * {@link Message} message - the message in question
|
2947
|
+
* * {@link MessageUpdateReason}[] updateReasons - array of reasons for the update
|
2948
|
+
*/
|
2949
|
+
|
2905
2950
|
|
2906
2951
|
_createClass__default["default"](Message, [{
|
2907
2952
|
key: "sid",
|
@@ -3212,7 +3257,7 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
3212
3257
|
var _getParticipant = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
|
3213
3258
|
var _this3 = this;
|
3214
3259
|
|
3215
|
-
var participant,
|
3260
|
+
var participant, errorMessage;
|
3216
3261
|
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
3217
3262
|
while (1) {
|
3218
3263
|
switch (_context.prev = _context.next) {
|
@@ -3257,26 +3302,26 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
3257
3302
|
return _context.abrupt("return", participant);
|
3258
3303
|
|
3259
3304
|
case 11:
|
3260
|
-
|
3305
|
+
errorMessage = "Participant with ";
|
3261
3306
|
|
3262
3307
|
if (this.state.participantSid) {
|
3263
|
-
|
3308
|
+
errorMessage += "SID '" + this.state.participantSid + "' ";
|
3264
3309
|
}
|
3265
3310
|
|
3266
3311
|
if (this.state.author) {
|
3267
3312
|
if (this.state.participantSid) {
|
3268
|
-
|
3313
|
+
errorMessage += "or ";
|
3269
3314
|
}
|
3270
3315
|
|
3271
|
-
|
3316
|
+
errorMessage += "identity '" + this.state.author + "' ";
|
3272
3317
|
}
|
3273
3318
|
|
3274
|
-
if (
|
3275
|
-
|
3319
|
+
if (errorMessage === "Participant with ") {
|
3320
|
+
errorMessage = "Participant ";
|
3276
3321
|
}
|
3277
3322
|
|
3278
|
-
|
3279
|
-
throw new Error(
|
3323
|
+
errorMessage += "was not found";
|
3324
|
+
throw new Error(errorMessage);
|
3280
3325
|
|
3281
3326
|
case 17:
|
3282
3327
|
case "end":
|
@@ -3613,7 +3658,7 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
3613
3658
|
pageToken: pageToken,
|
3614
3659
|
pageSize: pageSize
|
3615
3660
|
});
|
3616
|
-
}, response.body.meta.previous_token, response.body.meta.next_token
|
3661
|
+
}, response.body.meta.previous_token, response.body.meta.next_token));
|
3617
3662
|
|
3618
3663
|
case 6:
|
3619
3664
|
case "end":
|
@@ -4898,6 +4943,64 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
4898
4943
|
* Logger instance.
|
4899
4944
|
*/
|
4900
4945
|
|
4946
|
+
/**
|
4947
|
+
* Unique system identifier of the conversation.
|
4948
|
+
*/
|
4949
|
+
|
4950
|
+
/**
|
4951
|
+
* Conversation links for REST requests.
|
4952
|
+
* @internal
|
4953
|
+
*/
|
4954
|
+
|
4955
|
+
/**
|
4956
|
+
* Configuration of the client that the conversation belongs to.
|
4957
|
+
*/
|
4958
|
+
|
4959
|
+
/**
|
4960
|
+
* Conversation service objects.
|
4961
|
+
*/
|
4962
|
+
|
4963
|
+
/**
|
4964
|
+
* Internal state of the conversation.
|
4965
|
+
*/
|
4966
|
+
|
4967
|
+
/**
|
4968
|
+
* Name of the conversation entity document.
|
4969
|
+
*/
|
4970
|
+
|
4971
|
+
/**
|
4972
|
+
* Messages entity.
|
4973
|
+
*/
|
4974
|
+
|
4975
|
+
/**
|
4976
|
+
* Sync list containing messages.
|
4977
|
+
*/
|
4978
|
+
|
4979
|
+
/**
|
4980
|
+
* Map of participants.
|
4981
|
+
* @internal
|
4982
|
+
*/
|
4983
|
+
|
4984
|
+
/**
|
4985
|
+
* Participants entity.
|
4986
|
+
*/
|
4987
|
+
|
4988
|
+
/**
|
4989
|
+
* Sync map containing participants.
|
4990
|
+
*/
|
4991
|
+
|
4992
|
+
/**
|
4993
|
+
* Source of the most recent update.
|
4994
|
+
*/
|
4995
|
+
|
4996
|
+
/**
|
4997
|
+
* Promise for the conversation entity document.
|
4998
|
+
*/
|
4999
|
+
|
5000
|
+
/**
|
5001
|
+
* Conversation entity document.
|
5002
|
+
*/
|
5003
|
+
|
4901
5004
|
/**
|
4902
5005
|
* @param descriptor Conversation descriptor.
|
4903
5006
|
* @param sid Conversation SID.
|
@@ -4939,32 +5042,39 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
4939
5042
|
participants: _this._links.participants
|
4940
5043
|
};
|
4941
5044
|
_this._participants = new Map();
|
4942
|
-
_this._participantsEntity = new Participants(_assertThisInitialized__default["default"](_this), _this._participants,
|
5045
|
+
_this._participantsEntity = new Participants(_assertThisInitialized__default["default"](_this), _this._participants, // state leak
|
5046
|
+
participantsLinks, _this._services);
|
4943
5047
|
|
4944
|
-
_this._participantsEntity.on(
|
4945
|
-
return
|
5048
|
+
_this._participantsEntity.on(Conversation.participantJoined, function (participant) {
|
5049
|
+
return (// @todo update participants map here??
|
5050
|
+
_this.emit(Conversation.participantJoined, participant)
|
5051
|
+
);
|
4946
5052
|
});
|
4947
5053
|
|
4948
|
-
_this._participantsEntity.on(
|
4949
|
-
return
|
5054
|
+
_this._participantsEntity.on(Conversation.participantLeft, function (participant) {
|
5055
|
+
return (// @todo update participants map here??
|
5056
|
+
_this.emit(Conversation.participantLeft, participant)
|
5057
|
+
);
|
4950
5058
|
});
|
4951
5059
|
|
4952
|
-
_this._participantsEntity.on(
|
4953
|
-
return
|
5060
|
+
_this._participantsEntity.on(Conversation.participantUpdated, function (args) {
|
5061
|
+
return (// @todo update participants map here??
|
5062
|
+
_this.emit(Conversation.participantUpdated, args)
|
5063
|
+
);
|
4954
5064
|
});
|
4955
5065
|
|
4956
5066
|
_this._messagesEntity = new Messages(_assertThisInitialized__default["default"](_this), configuration, services);
|
4957
5067
|
|
4958
|
-
_this._messagesEntity.on(
|
5068
|
+
_this._messagesEntity.on(Conversation.messageAdded, function (message) {
|
4959
5069
|
return _this._onMessageAdded(message);
|
4960
5070
|
});
|
4961
5071
|
|
4962
|
-
_this._messagesEntity.on(
|
4963
|
-
return _this.emit(
|
5072
|
+
_this._messagesEntity.on(Conversation.messageUpdated, function (args) {
|
5073
|
+
return _this.emit(Conversation.messageUpdated, args);
|
4964
5074
|
});
|
4965
5075
|
|
4966
|
-
_this._messagesEntity.on(
|
4967
|
-
return _this.emit(
|
5076
|
+
_this._messagesEntity.on(Conversation.messageRemoved, function (message) {
|
5077
|
+
return _this.emit(Conversation.messageRemoved, message);
|
4968
5078
|
});
|
4969
5079
|
|
4970
5080
|
return _this;
|
@@ -5067,7 +5177,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
5067
5177
|
return (_this$_internalState$3 = this._internalState.notificationLevel) !== null && _this$_internalState$3 !== void 0 ? _this$_internalState$3 : "default";
|
5068
5178
|
}
|
5069
5179
|
/**
|
5070
|
-
* Conversation bindings.
|
5180
|
+
* Conversation bindings. An undocumented feature (for now).
|
5071
5181
|
* @internal
|
5072
5182
|
*/
|
5073
5183
|
|
@@ -6116,12 +6226,12 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
6116
6226
|
case 6:
|
6117
6227
|
this._entity = _context25.sent;
|
6118
6228
|
|
6119
|
-
this._entity.on(
|
6229
|
+
this._entity.on(twilioSync.SyncDocument.updated, function (args) {
|
6120
6230
|
return _this2._update(args.data);
|
6121
6231
|
});
|
6122
6232
|
|
6123
|
-
this._entity.on(
|
6124
|
-
return _this2.emit(
|
6233
|
+
this._entity.on(twilioSync.SyncDocument.removed, function () {
|
6234
|
+
return _this2.emit(Conversation.removed, _this2);
|
6125
6235
|
});
|
6126
6236
|
|
6127
6237
|
this._update(this._entity.data);
|
@@ -6289,22 +6399,16 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
6289
6399
|
while (1) {
|
6290
6400
|
switch (_context28.prev = _context28.next) {
|
6291
6401
|
case 0:
|
6292
|
-
if (
|
6293
|
-
|
6294
|
-
break;
|
6295
|
-
}
|
6296
|
-
|
6297
|
-
_context28.next = 3;
|
6298
|
-
return this._entity.close();
|
6402
|
+
if (this._entity) {
|
6403
|
+
this._entity.close();
|
6299
6404
|
|
6300
|
-
|
6301
|
-
|
6302
|
-
|
6405
|
+
this._entity = null;
|
6406
|
+
this._entityPromise = null;
|
6407
|
+
}
|
6303
6408
|
|
6304
|
-
case 5:
|
6305
6409
|
return _context28.abrupt("return", Promise.all([this._participantsEntity.unsubscribe(), this._messagesEntity.unsubscribe()]));
|
6306
6410
|
|
6307
|
-
case
|
6411
|
+
case 2:
|
6308
6412
|
case "end":
|
6309
6413
|
return _context28.stop();
|
6310
6414
|
}
|
@@ -6473,7 +6577,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
6473
6577
|
}
|
6474
6578
|
|
6475
6579
|
if (updateReasons.size > 0) {
|
6476
|
-
this.emit(
|
6580
|
+
this.emit(Conversation.updated, {
|
6477
6581
|
conversation: this,
|
6478
6582
|
updateReasons: _toConsumableArray__default["default"](updateReasons)
|
6479
6583
|
});
|
@@ -6505,7 +6609,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
6505
6609
|
_iterator.f();
|
6506
6610
|
}
|
6507
6611
|
|
6508
|
-
this.emit(
|
6612
|
+
this.emit(Conversation.messageAdded, message);
|
6509
6613
|
}
|
6510
6614
|
/**
|
6511
6615
|
* Set last read message index.
|
@@ -6815,7 +6919,7 @@ var Conversations = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
6815
6919
|
return addConversation;
|
6816
6920
|
}()
|
6817
6921
|
/**
|
6818
|
-
* Fetch conversations list and instantiate all necessary objects
|
6922
|
+
* Fetch conversations' list and instantiate all necessary objects
|
6819
6923
|
*/
|
6820
6924
|
|
6821
6925
|
}, {
|
@@ -6836,12 +6940,12 @@ var Conversations = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
6836
6940
|
|
6837
6941
|
case 3:
|
6838
6942
|
map = _context2.sent;
|
6839
|
-
map.on(
|
6943
|
+
map.on(twilioSync.SyncMap.itemAdded, function (args) {
|
6840
6944
|
log$1.debug("itemAdded: ".concat(args.item.key));
|
6841
6945
|
|
6842
6946
|
_this2._upsertConversation("sync", args.item.key, args.item.data);
|
6843
6947
|
});
|
6844
|
-
map.on(
|
6948
|
+
map.on(twilioSync.SyncMap.itemRemoved, function (args) {
|
6845
6949
|
log$1.debug("itemRemoved: ".concat(args.key));
|
6846
6950
|
var sid = args.key;
|
6847
6951
|
|
@@ -6867,7 +6971,7 @@ var Conversations = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
6867
6971
|
|
6868
6972
|
conversation.emit("removed", conversation);
|
6869
6973
|
});
|
6870
|
-
map.on(
|
6974
|
+
map.on(twilioSync.SyncMap.itemUpdated, function (args) {
|
6871
6975
|
log$1.debug("itemUpdated: ".concat(args.item.key));
|
6872
6976
|
|
6873
6977
|
_this2._upsertConversation("sync", args.item.key, args.item.data);
|
@@ -7960,7 +8064,7 @@ function PushNotification(data) {
|
|
7960
8064
|
this.data = data.data || {};
|
7961
8065
|
});
|
7962
8066
|
|
7963
|
-
var version = "2.
|
8067
|
+
var version = "2.6.0-rc.0";
|
7964
8068
|
|
7965
8069
|
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; }
|
7966
8070
|
|
@@ -8833,6 +8937,22 @@ var EmailRecipientDescriptor = /*#__PURE__*/_createClass__default["default"](
|
|
8833
8937
|
* Type of recipient.
|
8834
8938
|
*/
|
8835
8939
|
|
8940
|
+
/**
|
8941
|
+
* Sid of the message that this recipient belongs to.
|
8942
|
+
*/
|
8943
|
+
|
8944
|
+
/**
|
8945
|
+
* Email recipient level.
|
8946
|
+
*/
|
8947
|
+
|
8948
|
+
/**
|
8949
|
+
* Name of the recipient.
|
8950
|
+
*/
|
8951
|
+
|
8952
|
+
/**
|
8953
|
+
* Address of the recipient.
|
8954
|
+
*/
|
8955
|
+
|
8836
8956
|
/**
|
8837
8957
|
* @internal
|
8838
8958
|
*/
|
@@ -8987,7 +9107,7 @@ var MessageRecipientsClient = /*#__PURE__*/function () {
|
|
8987
9107
|
pageToken: pageToken,
|
8988
9108
|
pageSize: pageSize
|
8989
9109
|
});
|
8990
|
-
}, recipientsResponse.meta.previous_token, recipientsResponse.meta.next_token
|
9110
|
+
}, recipientsResponse.meta.previous_token, recipientsResponse.meta.next_token));
|
8991
9111
|
|
8992
9112
|
case 8:
|
8993
9113
|
case "end":
|
@@ -9287,7 +9407,47 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
|
|
9287
9407
|
*/
|
9288
9408
|
|
9289
9409
|
/**
|
9290
|
-
*
|
9410
|
+
* Promise that resolves on successful initialization.
|
9411
|
+
*/
|
9412
|
+
|
9413
|
+
/**
|
9414
|
+
* Options passed to the client.
|
9415
|
+
*/
|
9416
|
+
|
9417
|
+
/**
|
9418
|
+
* Client service objects.
|
9419
|
+
*/
|
9420
|
+
|
9421
|
+
/**
|
9422
|
+
* The user of the client.
|
9423
|
+
*/
|
9424
|
+
|
9425
|
+
/**
|
9426
|
+
* Resolves the {@link Client._ensureReady} promise.
|
9427
|
+
*/
|
9428
|
+
|
9429
|
+
/**
|
9430
|
+
* Rejects the {@link Client._ensureReady} promise.
|
9431
|
+
*/
|
9432
|
+
|
9433
|
+
/**
|
9434
|
+
* The current token of the client.
|
9435
|
+
*/
|
9436
|
+
|
9437
|
+
/**
|
9438
|
+
* The constructed configuration object.
|
9439
|
+
*/
|
9440
|
+
|
9441
|
+
/**
|
9442
|
+
* The Conversations entity.
|
9443
|
+
*/
|
9444
|
+
|
9445
|
+
/**
|
9446
|
+
* Promise that resolves when initial conversations are fetched.
|
9447
|
+
*/
|
9448
|
+
|
9449
|
+
/**
|
9450
|
+
* Returned Conversations Client instance is not yet fully initialized. Calling any
|
9291
9451
|
* operations will block until it is. Use connection events to monitor when
|
9292
9452
|
* client becomes fully available (connectionStateChanged with state
|
9293
9453
|
* 'connected') or not available (connectionStateChange with state 'denied',
|
@@ -9377,16 +9537,16 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
|
|
9377
9537
|
|
9378
9538
|
_this._services.twilsockClient = _this._options.twilsockClient = (_this$_options$twilso = _this._options.twilsockClient) !== null && _this$_options$twilso !== void 0 ? _this$_options$twilso : new twilsock.TwilsockClient(fpaToken, productId, _this._options);
|
9379
9539
|
|
9380
|
-
_this._services.twilsockClient.on(
|
9381
|
-
return _this.emit(
|
9540
|
+
_this._services.twilsockClient.on(Client_1.tokenAboutToExpire, function () {
|
9541
|
+
return _this.emit(Client_1.tokenAboutToExpire);
|
9382
9542
|
});
|
9383
9543
|
|
9384
|
-
_this._services.twilsockClient.on(
|
9385
|
-
return _this.emit(
|
9544
|
+
_this._services.twilsockClient.on(Client_1.tokenExpired, function () {
|
9545
|
+
return _this.emit(Client_1.tokenExpired);
|
9386
9546
|
});
|
9387
9547
|
|
9388
|
-
_this._services.twilsockClient.on(
|
9389
|
-
return _this.emit(
|
9548
|
+
_this._services.twilsockClient.on(Client_1.connectionError, function (error) {
|
9549
|
+
return _this.emit(Client_1.connectionError, error);
|
9390
9550
|
});
|
9391
9551
|
|
9392
9552
|
_this._services.twilsockClient.on("stateChanged", function (state) {
|
@@ -9395,7 +9555,7 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
|
|
9395
9555
|
if (state !== _this.connectionState) {
|
9396
9556
|
_this.connectionState = state;
|
9397
9557
|
|
9398
|
-
_this.emit(
|
9558
|
+
_this.emit(Client_1.connectionStateChanged, _this.connectionState);
|
9399
9559
|
}
|
9400
9560
|
});
|
9401
9561
|
|
@@ -9413,9 +9573,9 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
|
|
9413
9573
|
var emitFailed = function emitFailed(error) {
|
9414
9574
|
_this._rejectEnsureReady(error);
|
9415
9575
|
|
9416
|
-
_this.emit(
|
9576
|
+
_this.emit(Client_1.stateChanged, "failed");
|
9417
9577
|
|
9418
|
-
_this.emit(
|
9578
|
+
_this.emit(Client_1.initFailed, {
|
9419
9579
|
error: error
|
9420
9580
|
});
|
9421
9581
|
};
|
@@ -9468,9 +9628,9 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
|
|
9468
9628
|
|
9469
9629
|
_this._rejectEnsureReady(connectionError);
|
9470
9630
|
|
9471
|
-
_this.emit(
|
9631
|
+
_this.emit(Client_1.stateChanged, "failed");
|
9472
9632
|
|
9473
|
-
_this.emit(
|
9633
|
+
_this.emit(Client_1.initFailed, {
|
9474
9634
|
error: connectionError
|
9475
9635
|
});
|
9476
9636
|
|
@@ -9998,7 +10158,7 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
|
|
9998
10158
|
return removePushRegistrations;
|
9999
10159
|
}()
|
10000
10160
|
/**
|
10001
|
-
*
|
10161
|
+
* Parse a push notification payload.
|
10002
10162
|
*/
|
10003
10163
|
|
10004
10164
|
}, {
|
@@ -10335,8 +10495,8 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
|
|
10335
10495
|
|
10336
10496
|
this._resolveEnsureReady();
|
10337
10497
|
|
10338
|
-
this.emit(
|
10339
|
-
this.emit(
|
10498
|
+
this.emit(Client_1.stateChanged, "initialized");
|
10499
|
+
this.emit(Client_1.initialized);
|
10340
10500
|
|
10341
10501
|
case 36:
|
10342
10502
|
case "end":
|