@twilio/conversations 2.5.0 → 2.6.0-rc.1
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 +10730 -0
- package/builds/browser.esm.js.map +1 -0
- package/builds/browser.js +183 -9
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +6 -1
- package/builds/lib.esm.d.ts +3171 -0
- package/builds/lib.esm.js +10729 -0
- package/builds/lib.js +192 -9
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +324 -150
- 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 +207 -158
- 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 +113 -87
- package/dist/conversation.js.map +1 -1
- package/dist/data/conversations.js +42 -40
- package/dist/data/conversations.js.map +1 -1
- package/dist/data/messages.js +18 -22
- package/dist/data/messages.js.map +1 -1
- package/dist/data/participants.js +25 -23
- 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 +10 -12
- package/dist/message-recipients-client.js.map +1 -1
- package/dist/message.js +88 -75
- 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 +34 -29
- 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 +6 -4
- 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/assets/js/search.js +1 -1
- package/docs/classes/Client.html +4 -4
- package/docs/classes/Media.html +2 -2
- package/docs/classes/Message.html +8 -8
- package/docs/classes/MessageBuilder.html +2 -2
- package/docs/classes/UnsentMessage.html +2 -2
- package/docs/index.html +3 -7
- package/docs/modules.html +2 -6
- package/package.json +2 -2
- package/docs/classes/CancellablePromise.html +0 -3213
package/builds/lib.js
CHANGED
@@ -128,6 +128,15 @@ This software includes platform.js under the following license.
|
|
128
128
|
*/
|
129
129
|
'use strict';
|
130
130
|
|
131
|
+
var global =
|
132
|
+
typeof global !== "undefined"
|
133
|
+
? global
|
134
|
+
: typeof self !== "undefined"
|
135
|
+
? self
|
136
|
+
: typeof window !== "undefined"
|
137
|
+
? window
|
138
|
+
: {};
|
139
|
+
|
131
140
|
Object.defineProperty(exports, '__esModule', { value: true });
|
132
141
|
|
133
142
|
require('core-js/modules/es.reflect.to-string-tag.js');
|
@@ -145,10 +154,10 @@ var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
|
|
145
154
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
146
155
|
var _createClass = require('@babel/runtime/helpers/createClass');
|
147
156
|
var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
|
148
|
-
require('core-js/modules/es.object.to-string.js');
|
149
|
-
require('core-js/modules/es.promise.js');
|
150
157
|
require('core-js/modules/es.array.map.js');
|
158
|
+
require('core-js/modules/es.object.to-string.js');
|
151
159
|
require('core-js/modules/web.dom-collections.for-each.js');
|
160
|
+
require('core-js/modules/es.promise.js');
|
152
161
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
153
162
|
var _typeof = require('@babel/runtime/helpers/typeof');
|
154
163
|
require('core-js/modules/es.array.concat.js');
|
@@ -646,6 +655,22 @@ var User = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
646
655
|
* @event
|
647
656
|
*/
|
648
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
|
+
|
649
674
|
|
650
675
|
_createClass__default["default"](User, [{
|
651
676
|
key: "identity",
|
@@ -1318,6 +1343,24 @@ var Participant = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
1318
1343
|
* @event
|
1319
1344
|
*/
|
1320
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
|
+
|
1321
1364
|
|
1322
1365
|
_createClass__default["default"](Participant, [{
|
1323
1366
|
key: "sid",
|
@@ -2895,6 +2938,15 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
2895
2938
|
|
2896
2939
|
return _this;
|
2897
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
|
+
|
2898
2950
|
|
2899
2951
|
_createClass__default["default"](Message, [{
|
2900
2952
|
key: "sid",
|
@@ -4891,6 +4943,64 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
4891
4943
|
* Logger instance.
|
4892
4944
|
*/
|
4893
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
|
+
|
4894
5004
|
/**
|
4895
5005
|
* @param descriptor Conversation descriptor.
|
4896
5006
|
* @param sid Conversation SID.
|
@@ -7954,7 +8064,7 @@ function PushNotification(data) {
|
|
7954
8064
|
this.data = data.data || {};
|
7955
8065
|
});
|
7956
8066
|
|
7957
|
-
var version = "2.
|
8067
|
+
var version = "2.6.0-rc.1";
|
7958
8068
|
|
7959
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; }
|
7960
8070
|
|
@@ -8827,6 +8937,22 @@ var EmailRecipientDescriptor = /*#__PURE__*/_createClass__default["default"](
|
|
8827
8937
|
* Type of recipient.
|
8828
8938
|
*/
|
8829
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
|
+
|
8830
8956
|
/**
|
8831
8957
|
* @internal
|
8832
8958
|
*/
|
@@ -9280,6 +9406,46 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
|
|
9280
9406
|
* Client connection state.
|
9281
9407
|
*/
|
9282
9408
|
|
9409
|
+
/**
|
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
|
+
|
9283
9449
|
/**
|
9284
9450
|
* Returned Conversations Client instance is not yet fully initialized. Calling any
|
9285
9451
|
* operations will block until it is. Use connection events to monitor when
|
@@ -9419,6 +9585,8 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
|
|
9419
9585
|
terminal: true,
|
9420
9586
|
message: "Twilsock has disconnected."
|
9421
9587
|
});
|
9588
|
+
|
9589
|
+
_this._initializeEnsureReady((options === null || options === void 0 ? void 0 : options.throwErrorsAlways) || false);
|
9422
9590
|
};
|
9423
9591
|
|
9424
9592
|
_this._services.twilsockClient.once("connectionError", emitFailed);
|
@@ -9476,12 +9644,7 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
|
|
9476
9644
|
}, _callee, null, [[3, 11]]);
|
9477
9645
|
})));
|
9478
9646
|
|
9479
|
-
_this.
|
9480
|
-
_this._resolveEnsureReady = resolve;
|
9481
|
-
_this._rejectEnsureReady = reject;
|
9482
|
-
}).catch(function () {
|
9483
|
-
return void 0;
|
9484
|
-
}); // @todo How to process unhandled rejection here?
|
9647
|
+
_this._initializeEnsureReady((options === null || options === void 0 ? void 0 : options.throwErrorsAlways) || false);
|
9485
9648
|
|
9486
9649
|
if (startTwilsock) {
|
9487
9650
|
_this._services.twilsockClient.connect();
|
@@ -10374,6 +10537,26 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
|
|
10374
10537
|
_this5._services.notificationClient.unsubscribe(channelType, messageType);
|
10375
10538
|
});
|
10376
10539
|
}
|
10540
|
+
/**
|
10541
|
+
* Initialize the ensureReady promise.
|
10542
|
+
*/
|
10543
|
+
|
10544
|
+
}, {
|
10545
|
+
key: "_initializeEnsureReady",
|
10546
|
+
value: function _initializeEnsureReady(throwErrorsAlways) {
|
10547
|
+
var _this6 = this;
|
10548
|
+
|
10549
|
+
this._ensureReady = new Promise(function (resolve, reject) {
|
10550
|
+
_this6._resolveEnsureReady = resolve;
|
10551
|
+
_this6._rejectEnsureReady = reject;
|
10552
|
+
}).catch(function (error) {
|
10553
|
+
if (throwErrorsAlways) {
|
10554
|
+
throw error;
|
10555
|
+
} else {
|
10556
|
+
return void 0;
|
10557
|
+
}
|
10558
|
+
});
|
10559
|
+
}
|
10377
10560
|
}], [{
|
10378
10561
|
key: "create",
|
10379
10562
|
value: function () {
|