@twilio/conversations 1.3.0-rc8 → 2.0.0-rc.4

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 (282) hide show
  1. package/CHANGELOG.md +210 -0
  2. package/README.md +22 -17
  3. package/dist/browser.js +7873 -0
  4. package/dist/browser.js.map +1 -0
  5. package/dist/docs/assets/css/main.css +2660 -0
  6. package/dist/docs/assets/images/icons.png +0 -0
  7. package/dist/docs/assets/images/icons@2x.png +0 -0
  8. package/dist/docs/assets/images/widgets.png +0 -0
  9. package/dist/docs/assets/images/widgets@2x.png +0 -0
  10. package/dist/docs/assets/js/main.js +248 -0
  11. package/dist/docs/assets/js/search.js +1 -0
  12. package/dist/docs/classes/AggregatedDeliveryReceipt.html +3286 -0
  13. package/dist/docs/classes/Client.html +4181 -0
  14. package/dist/docs/classes/Conversation.html +4397 -0
  15. package/dist/docs/classes/DetailedDeliveryReceipt.html +3265 -0
  16. package/dist/docs/classes/Media.html +3295 -0
  17. package/dist/docs/classes/Message.html +3713 -0
  18. package/dist/docs/classes/MessageBuilder.html +3280 -0
  19. package/dist/docs/classes/Participant.html +3517 -0
  20. package/dist/docs/classes/PushNotification.html +3232 -0
  21. package/dist/docs/classes/RestPaginator.html +3262 -0
  22. package/dist/docs/classes/UnsentMessage.html +3144 -0
  23. package/dist/docs/classes/User.html +3451 -0
  24. package/dist/docs/index.html +3394 -212
  25. package/dist/docs/interfaces/ClientOptions.html +3136 -0
  26. package/dist/docs/interfaces/ConversationState.html +3152 -0
  27. package/dist/docs/interfaces/CreateConversationOptions.html +3168 -0
  28. package/dist/docs/interfaces/LastMessage.html +3152 -0
  29. package/dist/docs/interfaces/Paginator.html +3243 -0
  30. package/dist/docs/interfaces/PushNotificationData.html +3168 -0
  31. package/dist/docs/interfaces/SendEmailOptions.html +3136 -0
  32. package/dist/docs/interfaces/SendMediaOptions.html +3170 -0
  33. package/dist/docs/modules.html +3425 -0
  34. package/dist/lib.d.ts +1952 -0
  35. package/dist/lib.js +7873 -0
  36. package/dist/lib.js.map +1 -0
  37. package/dist/post-install.js +29 -0
  38. package/dist/react-native.js +4038 -0
  39. package/dist/react-native.js.map +1 -0
  40. package/dist/twilio-conversations.js +40912 -0
  41. package/dist/twilio-conversations.min.js +156 -0
  42. package/package.json +59 -48
  43. package/.circleci/config.yml +0 -650
  44. package/.deepsource.toml +0 -6
  45. package/.env.example +0 -13
  46. package/browser/aggregateddeliveryreceipt.js +0 -152
  47. package/browser/client.js +0 -991
  48. package/browser/configuration.js +0 -80
  49. package/browser/conversation.js +0 -1826
  50. package/browser/data/conversations.js +0 -632
  51. package/browser/data/messages.js +0 -522
  52. package/browser/data/participants.js +0 -411
  53. package/browser/data/users.js +0 -281
  54. package/browser/detaileddeliveryreceipt.js +0 -44
  55. package/browser/index.js +0 -4
  56. package/browser/interfaces/limits.js +0 -3
  57. package/browser/interfaces/notificationtypes.js +0 -21
  58. package/browser/interfaces/paginator.js +0 -53
  59. package/browser/interfaces/responsecodes.js +0 -20
  60. package/browser/interfaces/transport.js +0 -3
  61. package/browser/logger.js +0 -141
  62. package/browser/media.js +0 -198
  63. package/browser/message.js +0 -685
  64. package/browser/participant.js +0 -415
  65. package/browser/pushnotification.js +0 -49
  66. package/browser/restpaginator.js +0 -74
  67. package/browser/services/network.js +0 -223
  68. package/browser/services/readhorizon.js +0 -181
  69. package/browser/services/typingindicator.js +0 -142
  70. package/browser/session.js +0 -505
  71. package/browser/sessionerror.js +0 -93
  72. package/browser/sri.json +0 -1
  73. package/browser/synclist.js +0 -90
  74. package/browser/synclistdescriptor.js +0 -29
  75. package/browser/syncpaginator.js +0 -63
  76. package/browser/user.js +0 -431
  77. package/browser/util/deferred.js +0 -56
  78. package/browser/util/index.js +0 -108
  79. package/dist/@twilio/conversations.js +0 -35533
  80. package/dist/@twilio/conversations.min.js +0 -204
  81. package/dist/docs/AggregatedDeliveryReceipt.html +0 -948
  82. package/dist/docs/Client.html +0 -5075
  83. package/dist/docs/Conversation.html +0 -6018
  84. package/dist/docs/DetailedDeliveryReceipt.html +0 -641
  85. package/dist/docs/Media.html +0 -694
  86. package/dist/docs/Message.html +0 -1934
  87. package/dist/docs/Paginator.html +0 -605
  88. package/dist/docs/Participant.html +0 -1510
  89. package/dist/docs/PushNotification.html +0 -836
  90. package/dist/docs/SessionError.html +0 -379
  91. package/dist/docs/User.html +0 -1315
  92. package/dist/docs/classes.list.html +0 -4431
  93. package/dist/docs/fonts/glyphicons-halflings-regular.eot +0 -0
  94. package/dist/docs/fonts/glyphicons-halflings-regular.svg +0 -288
  95. package/dist/docs/fonts/glyphicons-halflings-regular.ttf +0 -0
  96. package/dist/docs/fonts/glyphicons-halflings-regular.woff +0 -0
  97. package/dist/docs/fonts/glyphicons-halflings-regular.woff2 +0 -0
  98. package/dist/docs/img/glyphicons-halflings-white.png +0 -0
  99. package/dist/docs/img/glyphicons-halflings.png +0 -0
  100. package/dist/docs/quicksearch.html +0 -31
  101. package/dist/docs/scripts/docstrap.lib.js +0 -11
  102. package/dist/docs/scripts/fulltext-search-ui.js +0 -89
  103. package/dist/docs/scripts/fulltext-search.js +0 -36
  104. package/dist/docs/scripts/lunr.min.js +0 -6
  105. package/dist/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
  106. package/dist/docs/scripts/prettify/jquery.min.js +0 -6
  107. package/dist/docs/scripts/prettify/lang-css.js +0 -21
  108. package/dist/docs/scripts/prettify/prettify.js +0 -496
  109. package/dist/docs/scripts/sunlight.js +0 -1157
  110. package/dist/docs/scripts/toc.js +0 -203
  111. package/dist/docs/styles/darkstrap.css +0 -960
  112. package/dist/docs/styles/prettify-tomorrow.css +0 -132
  113. package/dist/docs/styles/site.cerulean.css +0 -7008
  114. package/dist/docs/styles/site.cosmo.css +0 -7061
  115. package/dist/docs/styles/site.cyborg.css +0 -7048
  116. package/dist/docs/styles/site.darkly.css +0 -7171
  117. package/dist/docs/styles/site.darkstrap.css +0 -5638
  118. package/dist/docs/styles/site.dibs-bootstrap.css +0 -5899
  119. package/dist/docs/styles/site.flatly.css +0 -7147
  120. package/dist/docs/styles/site.journal.css +0 -6973
  121. package/dist/docs/styles/site.lumen.css +0 -7298
  122. package/dist/docs/styles/site.paper.css +0 -7623
  123. package/dist/docs/styles/site.readable.css +0 -6997
  124. package/dist/docs/styles/site.sandstone.css +0 -7035
  125. package/dist/docs/styles/site.simplex.css +0 -7023
  126. package/dist/docs/styles/site.slate.css +0 -7343
  127. package/dist/docs/styles/site.spacelab.css +0 -7055
  128. package/dist/docs/styles/site.superhero.css +0 -7131
  129. package/dist/docs/styles/site.united.css +0 -6895
  130. package/dist/docs/styles/site.yeti.css +0 -7195
  131. package/dist/docs/styles/sunlight.dark.css +0 -345
  132. package/dist/docs/styles/sunlight.default.css +0 -344
  133. package/dist/sri.json +0 -1
  134. package/lib/aggregateddeliveryreceipt.d.ts +0 -98
  135. package/lib/aggregateddeliveryreceipt.js +0 -112
  136. package/lib/client.d.ts +0 -317
  137. package/lib/client.js +0 -633
  138. package/lib/configuration.d.ts +0 -21
  139. package/lib/configuration.js +0 -41
  140. package/lib/conversation.d.ts +0 -460
  141. package/lib/conversation.js +0 -940
  142. package/lib/data/conversations.d.ts +0 -57
  143. package/lib/data/conversations.js +0 -296
  144. package/lib/data/messages.d.ts +0 -75
  145. package/lib/data/messages.js +0 -208
  146. package/lib/data/participants.d.ts +0 -94
  147. package/lib/data/participants.js +0 -204
  148. package/lib/data/users.d.ts +0 -42
  149. package/lib/data/users.js +0 -113
  150. package/lib/detaileddeliveryreceipt.d.ts +0 -45
  151. package/lib/detaileddeliveryreceipt.js +0 -34
  152. package/lib/index.d.ts +0 -1
  153. package/lib/index.js +0 -3
  154. package/lib/interfaces/limits.d.ts +0 -8
  155. package/lib/interfaces/limits.js +0 -2
  156. package/lib/interfaces/notificationtypes.d.ts +0 -8
  157. package/lib/interfaces/notificationtypes.js +0 -11
  158. package/lib/interfaces/paginator.d.ts +0 -52
  159. package/lib/interfaces/paginator.js +0 -28
  160. package/lib/interfaces/responsecodes.d.ts +0 -8
  161. package/lib/interfaces/responsecodes.js +0 -10
  162. package/lib/interfaces/transport.d.ts +0 -13
  163. package/lib/interfaces/transport.js +0 -2
  164. package/lib/logger.d.ts +0 -18
  165. package/lib/logger.js +0 -35
  166. package/lib/media.d.ts +0 -52
  167. package/lib/media.js +0 -69
  168. package/lib/message.d.ts +0 -136
  169. package/lib/message.js +0 -305
  170. package/lib/participant.d.ts +0 -142
  171. package/lib/participant.js +0 -219
  172. package/lib/pushnotification.d.ts +0 -48
  173. package/lib/pushnotification.js +0 -39
  174. package/lib/restpaginator.d.ts +0 -19
  175. package/lib/restpaginator.js +0 -36
  176. package/lib/services/network.d.ts +0 -22
  177. package/lib/services/network.js +0 -87
  178. package/lib/services/readhorizon.d.ts +0 -28
  179. package/lib/services/readhorizon.js +0 -112
  180. package/lib/services/typingindicator.d.ts +0 -50
  181. package/lib/services/typingindicator.js +0 -102
  182. package/lib/session.d.ts +0 -63
  183. package/lib/session.js +0 -213
  184. package/lib/sessionerror.d.ts +0 -12
  185. package/lib/sessionerror.js +0 -24
  186. package/lib/sri.json +0 -1
  187. package/lib/synclist.d.ts +0 -24
  188. package/lib/synclist.js +0 -28
  189. package/lib/synclistdescriptor.d.ts +0 -27
  190. package/lib/synclistdescriptor.js +0 -19
  191. package/lib/syncpaginator.d.ts +0 -22
  192. package/lib/syncpaginator.js +0 -37
  193. package/lib/user.d.ts +0 -98
  194. package/lib/user.js +0 -219
  195. package/lib/util/deferred.d.ts +0 -12
  196. package/lib/util/deferred.js +0 -22
  197. package/lib/util/index.d.ts +0 -28
  198. package/lib/util/index.js +0 -82
  199. package/tools/rtd-sdk-cdn-pin/.gitrepo +0 -12
  200. package/tools/rtd-sdk-cdn-pin/README.md +0 -54
  201. package/tools/rtd-sdk-cdn-pin/bintray-settings.xml.template +0 -16
  202. package/tools/rtd-sdk-cdn-pin/cdn-common/cdn-prepare.sh +0 -67
  203. package/tools/rtd-sdk-cdn-pin/cdn-pin-latest.sh +0 -19
  204. package/tools/rtd-sdk-cdn-pin/cdn-pin.sh +0 -19
  205. package/tools/rtd-sdk-cdn-pin/cdn-upload.sh +0 -13
  206. package/tools/rtd-sdk-cdn-pin/fetch/common/fetch-bintray-android.sh +0 -34
  207. package/tools/rtd-sdk-cdn-pin/fetch/common/fetch-npm.sh +0 -18
  208. package/tools/rtd-sdk-cdn-pin/fetch/twilio-chat-android.sh +0 -5
  209. package/tools/rtd-sdk-cdn-pin/fetch/twilio-chat-js.sh +0 -5
  210. package/tools/rtd-sdk-cdn-pin/fetch/twilio-conversations-android.sh +0 -6
  211. package/tools/rtd-sdk-cdn-pin/fetch/twilio-conversations-js.sh +0 -5
  212. package/tools/rtd-sdk-cdn-pin/fetch/twilio-sync-android.sh +0 -5
  213. package/tools/rtd-sdk-cdn-pin/fetch/twilio-sync-js.sh +0 -5
  214. package/tools/rtd-sdk-cdn-pin/fetch-artifact.sh +0 -26
  215. package/tools/sdk-release-tool/.gitrepo +0 -12
  216. package/tools/sdk-release-tool/Makefile +0 -49
  217. package/tools/sdk-release-tool/README.md +0 -275
  218. package/tools/sdk-release-tool/delete +0 -3
  219. package/tools/sdk-release-tool/download +0 -3
  220. package/tools/sdk-release-tool/get-cors +0 -3
  221. package/tools/sdk-release-tool/list +0 -3
  222. package/tools/sdk-release-tool/pin +0 -3
  223. package/tools/sdk-release-tool/pin-latest +0 -3
  224. package/tools/sdk-release-tool/requirements.txt +0 -4
  225. package/tools/sdk-release-tool/sdk-release-tool +0 -3
  226. package/tools/sdk-release-tool/sdk_release_tools/__init__.py +0 -0
  227. package/tools/sdk-release-tool/sdk_release_tools/__main__.py +0 -110
  228. package/tools/sdk-release-tool/sdk_release_tools/aws.py +0 -70
  229. package/tools/sdk-release-tool/sdk_release_tools/cli.py +0 -181
  230. package/tools/sdk-release-tool/sdk_release_tools/log.py +0 -24
  231. package/tools/sdk-release-tool/sdk_release_tools/ops.py +0 -295
  232. package/tools/sdk-release-tool/sdk_release_tools/rpm.py +0 -28
  233. package/tools/sdk-release-tool/sdk_release_tools/util.py +0 -186
  234. package/tools/sdk-release-tool/sdk_release_tools/versions.py +0 -362
  235. package/tools/sdk-release-tool/signal-sdk-js.json +0 -28
  236. package/tools/sdk-release-tool/tests/test_versions.py +0 -94
  237. package/tools/sdk-release-tool/twilio-accessmanager-android.json +0 -19
  238. package/tools/sdk-release-tool/twilio-accessmanager-ios.json +0 -26
  239. package/tools/sdk-release-tool/twilio-auth-ios.json +0 -29
  240. package/tools/sdk-release-tool/twilio-authenticator-ios.json +0 -29
  241. package/tools/sdk-release-tool/twilio-chat-android-2.json +0 -19
  242. package/tools/sdk-release-tool/twilio-chat-android.json +0 -22
  243. package/tools/sdk-release-tool/twilio-chat-ios.json +0 -26
  244. package/tools/sdk-release-tool/twilio-chat-js.json +0 -27
  245. package/tools/sdk-release-tool/twilio-client-android-aar.json +0 -22
  246. package/tools/sdk-release-tool/twilio-client-android.json +0 -22
  247. package/tools/sdk-release-tool/twilio-client-ios.json +0 -20
  248. package/tools/sdk-release-tool/twilio-client-js.json +0 -17
  249. package/tools/sdk-release-tool/twilio-client-sounds-js.json +0 -14
  250. package/tools/sdk-release-tool/twilio-common-android-maven.json +0 -16
  251. package/tools/sdk-release-tool/twilio-common-android.json +0 -22
  252. package/tools/sdk-release-tool/twilio-common-ios-rtc.json +0 -25
  253. package/tools/sdk-release-tool/twilio-common-ios.json +0 -25
  254. package/tools/sdk-release-tool/twilio-common-js.json +0 -19
  255. package/tools/sdk-release-tool/twilio-conversations-android.json +0 -22
  256. package/tools/sdk-release-tool/twilio-conversations-ios.json +0 -26
  257. package/tools/sdk-release-tool/twilio-conversations-js.json +0 -27
  258. package/tools/sdk-release-tool/twilio-flex-js.json +0 -20
  259. package/tools/sdk-release-tool/twilio-flex-webchat-js.json +0 -16
  260. package/tools/sdk-release-tool/twilio-frame-chat-android.json +0 -22
  261. package/tools/sdk-release-tool/twilio-frame-chat-ios.json +0 -23
  262. package/tools/sdk-release-tool/twilio-frame-chat-js.json +0 -23
  263. package/tools/sdk-release-tool/twilio-ip-messaging-android-maven.json +0 -16
  264. package/tools/sdk-release-tool/twilio-ip-messaging-android.json +0 -22
  265. package/tools/sdk-release-tool/twilio-ip-messaging-ios.json +0 -25
  266. package/tools/sdk-release-tool/twilio-ip-messaging-js.json +0 -21
  267. package/tools/sdk-release-tool/twilio-sync-android.json +0 -22
  268. package/tools/sdk-release-tool/twilio-sync-ios.json +0 -26
  269. package/tools/sdk-release-tool/twilio-sync-js.json +0 -39
  270. package/tools/sdk-release-tool/twilio-taskrouter-js.json +0 -17
  271. package/tools/sdk-release-tool/twilio-video-android.json +0 -22
  272. package/tools/sdk-release-tool/twilio-video-cpp-linux-cross-rootfs.json +0 -13
  273. package/tools/sdk-release-tool/twilio-video-cpp.json +0 -33
  274. package/tools/sdk-release-tool/twilio-video-ios.json +0 -25
  275. package/tools/sdk-release-tool/twilio-video-js.json +0 -19
  276. package/tools/sdk-release-tool/twilio-video-jsdocs.json +0 -14
  277. package/tools/sdk-release-tool/twilio-voice-android.json +0 -22
  278. package/tools/sdk-release-tool/twilio-voice-ios.json +0 -29
  279. package/tools/sdk-release-tool/unpin +0 -3
  280. package/tools/sdk-release-tool/unpin-latest +0 -3
  281. package/tools/sdk-release-tool/upload +0 -3
  282. package/twilio-chat.js.iml +0 -9
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
4
-
5
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
6
-
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
-
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- /**
11
- * @classdesc Represents a delivery receipt of a {@link Message}.
12
- *
13
- * @property {String} sid - The unique identifier for Delivery Receipt
14
- * @property {String} messageSid - The unique identifier for Conversation Message
15
- * @property {String} conversationSid - The unique identifier for Conversation
16
- * @property {String} channelMessageSid - The unique identifier for the ‘channel’ message e.g WAxx for Whatsapp, SMxx for SMS
17
- * @property {String} participantSid - Participant's unique identifier
18
- * @property {DetailedDeliveryReceipt#Status} status - Message delivery status
19
- * @property {number | null} errorCode - Numeric error code mapped from Status callback code. Information about the error codes can be found
20
- * <a href="https://www.twilio.com/docs/sms/api/message-resource#delivery-related-errors">here</a>.
21
- * @property {String} dateCreated - When Delivery Receipt was created
22
- * @property {String} dateUpdated - When Delivery Receipt was updated
23
- */
24
-
25
- var DetailedDeliveryReceipt =
26
- /**
27
- * Signifies the message delivery status.
28
- * @typedef {('sent'|'delivered'|'failed'|'read'|'undelivered'|'queued')} DetailedDeliveryReceipt#Status
29
- */
30
- function DetailedDeliveryReceipt(descriptor) {
31
- (0, _classCallCheck3.default)(this, DetailedDeliveryReceipt);
32
-
33
- this.sid = descriptor.sid;
34
- this.messageSid = descriptor.message_sid;
35
- this.conversationSid = descriptor.conversation_sid;
36
- this.channelMessageSid = descriptor.channel_message_sid;
37
- this.participantSid = descriptor.participant_sid;
38
- this.status = descriptor.status || 'queued';
39
- this.errorCode = descriptor.error_code || 0;
40
- this.dateCreated = descriptor.date_created;
41
- this.dateUpdated = descriptor.date_updated;
42
- };
43
-
44
- exports.DetailedDeliveryReceipt = DetailedDeliveryReceipt;
package/browser/index.js DELETED
@@ -1,4 +0,0 @@
1
- 'use strict';
2
-
3
- var chat = require('./client');
4
- module.exports = chat;
@@ -1,3 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
4
-
5
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
6
-
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
-
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
-
11
- var NotificationTypes = function NotificationTypes() {
12
- (0, _classCallCheck3.default)(this, NotificationTypes);
13
- };
14
-
15
- exports.NotificationTypes = NotificationTypes;
16
- NotificationTypes.TYPING_INDICATOR = 'twilio.ipmsg.typing_indicator';
17
- NotificationTypes.NEW_MESSAGE = 'twilio.conversations.new_message';
18
- NotificationTypes.ADDED_TO_CONVERSATION = 'twilio.conversations.added_to_conversation';
19
- // static readonly INVITED_TO_CHANNEL = 'twilio.channel.invited_to_channel';
20
- NotificationTypes.REMOVED_FROM_CONVERSATION = 'twilio.conversations.removed_from_conversation';
21
- NotificationTypes.CONSUMPTION_UPDATE = 'twilio.channel.consumption_update';
@@ -1,53 +0,0 @@
1
- 'use strict';
2
-
3
- var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
4
-
5
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
6
-
7
- var _createClass2 = require('babel-runtime/helpers/createClass');
8
-
9
- var _createClass3 = _interopRequireDefault(_createClass2);
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- /**
15
- * @classdesc Pagination helper class.
16
- * @alias Paginator
17
- * @property {Array} items Array of elements of type T on current page
18
- * @property {boolean} hasNextPage Indicates the existence of next page
19
- * @property {boolean} hasPrevPage Indicates the existence of previous page
20
- */
21
-
22
- var SamplePaginator = function () {
23
- function SamplePaginator() {
24
- (0, _classCallCheck3.default)(this, SamplePaginator);
25
- }
26
-
27
- (0, _createClass3.default)(SamplePaginator, [{
28
- key: 'nextPage',
29
-
30
- /**
31
- * Request next page.
32
- * Does not modify existing object.
33
- * @return {Promise<Paginator<T>>}
34
- */
35
- value: function nextPage() {
36
- throw new Error('Method not implemented.');
37
- }
38
- /**
39
- * Request previous page.
40
- * Does not modify existing object.
41
- * @return {Promise<Paginator<T>>}
42
- */
43
-
44
- }, {
45
- key: 'prevPage',
46
- value: function prevPage() {
47
- throw new Error('Method not implemented.');
48
- }
49
- }]);
50
- return SamplePaginator;
51
- }();
52
-
53
- exports.SamplePaginator = SamplePaginator;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
4
-
5
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
6
-
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
-
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
-
11
- var ResponseCodes = function ResponseCodes() {
12
- (0, _classCallCheck3.default)(this, ResponseCodes);
13
- };
14
-
15
- exports.ResponseCodes = ResponseCodes;
16
- ResponseCodes.HTTP_200_OK = 200;
17
- ResponseCodes.HTTP_400_BAD_REQUEST = 400;
18
- ResponseCodes.HTTP_404_NOT_FOUND = 404;
19
- ResponseCodes.ACCESS_FORBIDDEN_FOR_IDENTITY = 54007;
20
- ResponseCodes.LIST_NOT_FOUND = 54150;
@@ -1,3 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true });
package/browser/logger.js DELETED
@@ -1,141 +0,0 @@
1
- "use strict";
2
-
3
- var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
4
-
5
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
6
-
7
- var _createClass2 = require("babel-runtime/helpers/createClass");
8
-
9
- var _createClass3 = _interopRequireDefault(_createClass2);
10
-
11
- var _from = require("babel-runtime/core-js/array/from");
12
-
13
- var _from2 = _interopRequireDefault(_from);
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
-
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- var loglevelLog = require("loglevel");
19
- function prepareLine(prefix, args) {
20
- return [new Date().toISOString() + " Conversations " + prefix + ":"].concat((0, _from2.default)(args));
21
- }
22
- var log = loglevelLog.getLogger('twilio-conversations'); // twilio-conversations is used by Flex SDK. Please DO NOT change
23
-
24
- var Logger = function () {
25
- function Logger(prefix) {
26
- (0, _classCallCheck3.default)(this, Logger);
27
-
28
- this.prefix = '';
29
- this.prefix = prefix !== null && prefix !== undefined && prefix.length > 0 ? prefix + ' ' : '';
30
- }
31
-
32
- (0, _createClass3.default)(Logger, [{
33
- key: "setLevel",
34
- value: function setLevel(level) {
35
- log.setLevel(level);
36
- }
37
- }, {
38
- key: "trace",
39
- value: function trace() {
40
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
41
- args[_key] = arguments[_key];
42
- }
43
-
44
- log.trace.apply(null, prepareLine(this.prefix + 'T', args));
45
- }
46
- }, {
47
- key: "debug",
48
- value: function debug() {
49
- for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
50
- args[_key2] = arguments[_key2];
51
- }
52
-
53
- log.debug.apply(null, prepareLine(this.prefix + 'D', args));
54
- }
55
- }, {
56
- key: "info",
57
- value: function info() {
58
- for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
59
- args[_key3] = arguments[_key3];
60
- }
61
-
62
- log.info.apply(null, prepareLine(this.prefix + 'I', args));
63
- }
64
- }, {
65
- key: "warn",
66
- value: function warn() {
67
- for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
68
- args[_key4] = arguments[_key4];
69
- }
70
-
71
- log.warn.apply(null, prepareLine(this.prefix + 'W', args));
72
- }
73
- }, {
74
- key: "error",
75
- value: function error() {
76
- for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
77
- args[_key5] = arguments[_key5];
78
- }
79
-
80
- log.error.apply(null, prepareLine(this.prefix + 'E', args));
81
- }
82
- }], [{
83
- key: "scope",
84
- value: function scope(prefix) {
85
- return new Logger(prefix);
86
- }
87
- }, {
88
- key: "setLevel",
89
- value: function setLevel(level) {
90
- log.setLevel(level);
91
- }
92
- }, {
93
- key: "trace",
94
- value: function trace() {
95
- for (var _len6 = arguments.length, args = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
96
- args[_key6] = arguments[_key6];
97
- }
98
-
99
- log.trace.apply(null, prepareLine('T', args));
100
- }
101
- }, {
102
- key: "debug",
103
- value: function debug() {
104
- for (var _len7 = arguments.length, args = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
105
- args[_key7] = arguments[_key7];
106
- }
107
-
108
- log.debug.apply(null, prepareLine('D', args));
109
- }
110
- }, {
111
- key: "info",
112
- value: function info() {
113
- for (var _len8 = arguments.length, args = Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
114
- args[_key8] = arguments[_key8];
115
- }
116
-
117
- log.info.apply(null, prepareLine('I', args));
118
- }
119
- }, {
120
- key: "warn",
121
- value: function warn() {
122
- for (var _len9 = arguments.length, args = Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
123
- args[_key9] = arguments[_key9];
124
- }
125
-
126
- log.warn.apply(null, prepareLine('W', args));
127
- }
128
- }, {
129
- key: "error",
130
- value: function error() {
131
- for (var _len10 = arguments.length, args = Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
132
- args[_key10] = arguments[_key10];
133
- }
134
-
135
- log.error.apply(null, prepareLine('E', args));
136
- }
137
- }]);
138
- return Logger;
139
- }();
140
-
141
- exports.Logger = Logger;
package/browser/media.js DELETED
@@ -1,198 +0,0 @@
1
- "use strict";
2
-
3
- var _regenerator = require("babel-runtime/regenerator");
4
-
5
- var _regenerator2 = _interopRequireDefault(_regenerator);
6
-
7
- var _asyncToGenerator2 = require("babel-runtime/helpers/asyncToGenerator");
8
-
9
- var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
10
-
11
- var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
12
-
13
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
14
-
15
- var _createClass2 = require("babel-runtime/helpers/createClass");
16
-
17
- var _createClass3 = _interopRequireDefault(_createClass2);
18
-
19
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
-
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- var twilio_mcs_client_1 = require("twilio-mcs-client");
23
- /**
24
- * @classdesc A Media represents media information of a Message in a Conversation.
25
- * @property {String} sid - The server-assigned unique identifier for Media
26
- * @property {String} category - media category, can be one of the {MediaCategory} values.
27
- * @property {String} [filename] - file name if present, null otherwise
28
- * @property {String} contentType - content type of media
29
- * @property {Number} size - Size of media, bytes
30
- s */
31
-
32
- var Media = function () {
33
- function Media(data, services) {
34
- (0, _classCallCheck3.default)(this, Media);
35
-
36
- this.mcsMedia = null;
37
- this.services = services;
38
- if (data instanceof twilio_mcs_client_1.McsMedia) {
39
- this.mcsMedia = data;
40
- }
41
- this.state = {
42
- sid: data.sid,
43
- category: data.category,
44
- filename: data.filename,
45
- contentType: data.contentType,
46
- size: data.size
47
- };
48
- }
49
-
50
- (0, _createClass3.default)(Media, [{
51
- key: "getContentTemporaryUrl",
52
-
53
- /**
54
- * Returns direct content URL for the media.
55
- *
56
- * This URL is impermanent, it will expire in several minutes and cannot be cached.
57
- * If the URL becomes expired, you need to request a new one.
58
- * Each call to this function produces a new temporary URL.
59
- *
60
- * @returns {Promise<String>}
61
- */
62
- value: function () {
63
- var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
64
- return _regenerator2.default.wrap(function _callee$(_context) {
65
- while (1) {
66
- switch (_context.prev = _context.next) {
67
- case 0:
68
- _context.next = 2;
69
- return this._fetchMcsMedia();
70
-
71
- case 2:
72
- return _context.abrupt("return", this.mcsMedia.getContentUrl());
73
-
74
- case 3:
75
- case "end":
76
- return _context.stop();
77
- }
78
- }
79
- }, _callee, this);
80
- }));
81
-
82
- function getContentTemporaryUrl() {
83
- return _ref.apply(this, arguments);
84
- }
85
-
86
- return getContentTemporaryUrl;
87
- }()
88
- /**
89
- * Returns cached direct content URL for the media.
90
- *
91
- * This URL will expire in several minutes. This function does not refresh the URL and can be used to query it several times
92
- * without causing network traffic.
93
- * If the URL becomes expired, you need to request a new one using getContentTemporaryUrl().
94
- *
95
- * @returns {Promise<String>}
96
- */
97
-
98
- }, {
99
- key: "getCachedTemporaryUrl",
100
- value: function () {
101
- var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() {
102
- return _regenerator2.default.wrap(function _callee2$(_context2) {
103
- while (1) {
104
- switch (_context2.prev = _context2.next) {
105
- case 0:
106
- _context2.next = 2;
107
- return this._fetchMcsMedia();
108
-
109
- case 2:
110
- return _context2.abrupt("return", this.mcsMedia.getCachedContentUrl());
111
-
112
- case 3:
113
- case "end":
114
- return _context2.stop();
115
- }
116
- }
117
- }, _callee2, this);
118
- }));
119
-
120
- function getCachedTemporaryUrl() {
121
- return _ref2.apply(this, arguments);
122
- }
123
-
124
- return getCachedTemporaryUrl;
125
- }()
126
- }, {
127
- key: "_fetchMcsMedia",
128
- value: function () {
129
- var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() {
130
- return _regenerator2.default.wrap(function _callee3$(_context3) {
131
- while (1) {
132
- switch (_context3.prev = _context3.next) {
133
- case 0:
134
- if (this.mcsMedia) {
135
- _context3.next = 8;
136
- break;
137
- }
138
-
139
- if (!this.services.mcsClient) {
140
- _context3.next = 7;
141
- break;
142
- }
143
-
144
- _context3.next = 4;
145
- return this.services.mcsClient.get(this.state.sid);
146
-
147
- case 4:
148
- this.mcsMedia = _context3.sent;
149
- _context3.next = 8;
150
- break;
151
-
152
- case 7:
153
- throw new Error('Media Content Service is unavailable');
154
-
155
- case 8:
156
- case "end":
157
- return _context3.stop();
158
- }
159
- }
160
- }, _callee3, this);
161
- }));
162
-
163
- function _fetchMcsMedia() {
164
- return _ref3.apply(this, arguments);
165
- }
166
-
167
- return _fetchMcsMedia;
168
- }()
169
- }, {
170
- key: "sid",
171
- get: function get() {
172
- return this.state.sid;
173
- }
174
- }, {
175
- key: "filename",
176
- get: function get() {
177
- return this.state.filename;
178
- }
179
- }, {
180
- key: "contentType",
181
- get: function get() {
182
- return this.state.contentType;
183
- }
184
- }, {
185
- key: "category",
186
- get: function get() {
187
- return this.state.category;
188
- }
189
- }, {
190
- key: "size",
191
- get: function get() {
192
- return this.state.size;
193
- }
194
- }]);
195
- return Media;
196
- }();
197
-
198
- exports.Media = Media;