@twilio/conversations 2.3.0-rc.0 → 2.3.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.
Files changed (67) hide show
  1. package/builds/browser.js +53 -30
  2. package/builds/browser.js.map +1 -1
  3. package/builds/lib.js +44 -30
  4. package/builds/lib.js.map +1 -1
  5. package/builds/twilio-conversations.js +54 -31
  6. package/builds/twilio-conversations.min.js +1 -1
  7. package/dist/aggregated-delivery-receipt.js +9 -0
  8. package/dist/aggregated-delivery-receipt.js.map +1 -1
  9. package/dist/client.js +9 -0
  10. package/dist/client.js.map +1 -1
  11. package/dist/command-executor.js +9 -0
  12. package/dist/command-executor.js.map +1 -1
  13. package/dist/configuration.js +9 -0
  14. package/dist/configuration.js.map +1 -1
  15. package/dist/content-client.js +9 -0
  16. package/dist/content-client.js.map +1 -1
  17. package/dist/content-template.js +9 -0
  18. package/dist/content-template.js.map +1 -1
  19. package/dist/conversation.js +9 -0
  20. package/dist/conversation.js.map +1 -1
  21. package/dist/data/conversations.js +9 -0
  22. package/dist/data/conversations.js.map +1 -1
  23. package/dist/data/messages.js +9 -0
  24. package/dist/data/messages.js.map +1 -1
  25. package/dist/data/participants.js +9 -0
  26. package/dist/data/participants.js.map +1 -1
  27. package/dist/data/users.js +9 -0
  28. package/dist/data/users.js.map +1 -1
  29. package/dist/detailed-delivery-receipt.js +9 -0
  30. package/dist/detailed-delivery-receipt.js.map +1 -1
  31. package/dist/index.js +9 -0
  32. package/dist/index.js.map +1 -1
  33. package/dist/interfaces/attributes.js +9 -0
  34. package/dist/interfaces/attributes.js.map +1 -1
  35. package/dist/interfaces/notification-types.js +9 -0
  36. package/dist/interfaces/notification-types.js.map +1 -1
  37. package/dist/logger.js +9 -0
  38. package/dist/logger.js.map +1 -1
  39. package/dist/media.js +9 -0
  40. package/dist/media.js.map +1 -1
  41. package/dist/message-builder.js +9 -0
  42. package/dist/message-builder.js.map +1 -1
  43. package/dist/message.js +34 -10
  44. package/dist/message.js.map +1 -1
  45. package/dist/node_modules/tslib/tslib.es6.js +9 -0
  46. package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
  47. package/dist/packages/conversations/package.json.js +10 -1
  48. package/dist/packages/conversations/package.json.js.map +1 -1
  49. package/dist/participant.js +9 -0
  50. package/dist/participant.js.map +1 -1
  51. package/dist/push-notification.js +9 -0
  52. package/dist/push-notification.js.map +1 -1
  53. package/dist/rest-paginator.js +9 -0
  54. package/dist/rest-paginator.js.map +1 -1
  55. package/dist/services/network.js +9 -0
  56. package/dist/services/network.js.map +1 -1
  57. package/dist/services/typing-indicator.js +9 -0
  58. package/dist/services/typing-indicator.js.map +1 -1
  59. package/dist/unsent-message.js +9 -0
  60. package/dist/unsent-message.js.map +1 -1
  61. package/dist/user.js +9 -0
  62. package/dist/user.js.map +1 -1
  63. package/dist/util/deferred.js +9 -0
  64. package/dist/util/deferred.js.map +1 -1
  65. package/dist/util/index.js +9 -0
  66. package/dist/util/index.js.map +1 -1
  67. package/package.json +9 -8
@@ -130,6 +130,15 @@ this.Twilio = this.Twilio || {};
130
130
  this.Twilio.Conversations = (function (exports) {
131
131
  'use strict';
132
132
 
133
+ var global =
134
+ typeof global !== "undefined"
135
+ ? global
136
+ : typeof self !== "undefined"
137
+ ? self
138
+ : typeof window !== "undefined"
139
+ ? window
140
+ : {};
141
+
133
142
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
134
143
 
135
144
  function getAugmentedNamespace(n) {
@@ -34850,7 +34859,7 @@ this.Twilio.Conversations = (function (exports) {
34850
34859
  return Network;
34851
34860
  }();
34852
34861
 
34853
- var version = "0.6.4-rc.0";
34862
+ var version = "0.6.4-rc.1";
34854
34863
 
34855
34864
  var _class;
34856
34865
 
@@ -36984,10 +36993,14 @@ this.Twilio.Conversations = (function (exports) {
36984
36993
 
36985
36994
  function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
36986
36995
  var log$3 = Logger.scope("Message");
36996
+
36997
+ var XHR = // eslint-disable-next-line @typescript-eslint/no-var-requires
36998
+ global["XMLHttpRequest"] || require("xmlhttprequest").XMLHttpRequest;
36987
36999
  /**
36988
37000
  * A message in a conversation.
36989
37001
  */
36990
37002
 
37003
+
36991
37004
  var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
36992
37005
  _inherits$4(Message, _ReplayEventEmitter);
36993
37006
 
@@ -37754,7 +37767,7 @@ this.Twilio.Conversations = (function (exports) {
37754
37767
 
37755
37768
  return new browser$1.CancellablePromise( /*#__PURE__*/function () {
37756
37769
  var _ref2 = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1.mark(function _callee9(resolve, reject, onCancel) {
37757
- var bodies, twilioPrefix, filteredMedias, contentMedia, urlPromise, url, abortController, responsePromise, json, response, blob, text, dataType;
37770
+ var bodies, twilioPrefix, filteredMedias, contentMedia, urlPromise, url, jsonStringPromise, json, jsonString, dataType;
37758
37771
  return _regeneratorRuntime$1.wrap(function _callee9$(_context9) {
37759
37772
  while (1) {
37760
37773
  switch (_context9.prev = _context9.next) {
@@ -37823,49 +37836,59 @@ this.Twilio.Conversations = (function (exports) {
37823
37836
  return _context9.abrupt("return");
37824
37837
 
37825
37838
  case 28:
37826
- abortController = new AbortController();
37827
- responsePromise = fetch(url, {
37828
- signal: abortController.signal
37829
- });
37830
- onCancel(function () {
37831
- abortController.abort();
37832
- });
37833
- _context9.prev = 31;
37834
- _context9.next = 34;
37835
- return responsePromise;
37839
+ jsonStringPromise = new Promise(function (resolve, reject) {
37840
+ var _url;
37836
37841
 
37837
- case 34:
37838
- response = _context9.sent;
37839
- _context9.next = 37;
37840
- return response.blob();
37842
+ var isCancelled = false;
37843
+ var xhr = new XHR();
37844
+ xhr.open("GET", (_url = url) !== null && _url !== void 0 ? _url : "", true);
37845
+ xhr.responseType = "text";
37841
37846
 
37842
- case 37:
37843
- blob = _context9.sent;
37844
- _context9.next = 40;
37845
- return blob.text();
37847
+ xhr.onreadystatechange = function () {
37848
+ if (xhr.readyState !== 4 || isCancelled) {
37849
+ return;
37850
+ }
37846
37851
 
37847
- case 40:
37848
- text = _context9.sent;
37849
- json = JSON.parse(text);
37850
- _context9.next = 48;
37852
+ resolve(xhr.responseText);
37853
+ };
37854
+
37855
+ xhr.onerror = function () {
37856
+ reject(xhr.statusText);
37857
+ };
37858
+
37859
+ onCancel(function () {
37860
+ isCancelled = true;
37861
+ xhr.abort();
37862
+ reject(new Error("XHR has been aborted"));
37863
+ });
37864
+ xhr.send();
37865
+ });
37866
+ _context9.prev = 29;
37867
+ _context9.next = 32;
37868
+ return jsonStringPromise;
37869
+
37870
+ case 32:
37871
+ jsonString = _context9.sent;
37872
+ json = JSON.parse(jsonString);
37873
+ _context9.next = 40;
37851
37874
  break;
37852
37875
 
37853
- case 44:
37854
- _context9.prev = 44;
37855
- _context9.t1 = _context9["catch"](31);
37876
+ case 36:
37877
+ _context9.prev = 36;
37878
+ _context9.t1 = _context9["catch"](29);
37856
37879
  reject(_context9.t1);
37857
37880
  return _context9.abrupt("return");
37858
37881
 
37859
- case 48:
37882
+ case 40:
37860
37883
  dataType = contentMedia.contentType.replace(twilioPrefix, "").replace(".", "/");
37861
37884
  resolve(parseVariant(dataType, json.data));
37862
37885
 
37863
- case 50:
37886
+ case 42:
37864
37887
  case "end":
37865
37888
  return _context9.stop();
37866
37889
  }
37867
37890
  }
37868
- }, _callee9, null, [[15, 21], [31, 44]]);
37891
+ }, _callee9, null, [[15, 21], [29, 36]]);
37869
37892
  }));
37870
37893
 
37871
37894
  return function (_x8, _x9, _x10) {
@@ -41951,7 +41974,7 @@ this.Twilio.Conversations = (function (exports) {
41951
41974
  this.data = data.data || {};
41952
41975
  });
41953
41976
 
41954
- var version = "2.3.0-rc.0";
41977
+ var version = "2.3.0-rc.1";
41955
41978
 
41956
41979
  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; }
41957
41980