@twilio/conversations 2.1.0-rc.0 → 2.1.0-rc.7

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 (86) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/NOTICE.txt +679 -0
  3. package/builds/browser.js +675 -588
  4. package/builds/browser.js.map +1 -1
  5. package/builds/lib.d.ts +301 -122
  6. package/builds/lib.js +675 -588
  7. package/builds/lib.js.map +1 -1
  8. package/builds/twilio-conversations.js +853 -910
  9. package/builds/twilio-conversations.min.js +2 -14
  10. package/dist/aggregated-delivery-receipt.js +6 -1
  11. package/dist/aggregated-delivery-receipt.js.map +1 -1
  12. package/dist/client.js +165 -142
  13. package/dist/client.js.map +1 -1
  14. package/dist/command-executor.js +16 -14
  15. package/dist/command-executor.js.map +1 -1
  16. package/dist/configuration.js +14 -10
  17. package/dist/configuration.js.map +1 -1
  18. package/dist/conversation.js +212 -153
  19. package/dist/conversation.js.map +1 -1
  20. package/dist/data/conversations.js +82 -78
  21. package/dist/data/conversations.js.map +1 -1
  22. package/dist/data/messages.js +42 -38
  23. package/dist/data/messages.js.map +1 -1
  24. package/dist/data/participants.js +93 -75
  25. package/dist/data/participants.js.map +1 -1
  26. package/dist/data/users.js +24 -22
  27. package/dist/data/users.js.map +1 -1
  28. package/dist/detailed-delivery-receipt.js +1 -1
  29. package/dist/detailed-delivery-receipt.js.map +1 -1
  30. package/dist/interfaces/attributes.js +4 -4
  31. package/dist/interfaces/attributes.js.map +1 -1
  32. package/dist/interfaces/notification-types.js +5 -5
  33. package/dist/interfaces/notification-types.js.map +1 -1
  34. package/dist/logger.js +36 -15
  35. package/dist/logger.js.map +1 -1
  36. package/dist/media.js +21 -9
  37. package/dist/media.js.map +1 -1
  38. package/dist/message-builder.js +10 -9
  39. package/dist/message-builder.js.map +1 -1
  40. package/dist/message.js +131 -83
  41. package/dist/message.js.map +1 -1
  42. package/dist/packages/conversations/package.json.js +1 -1
  43. package/dist/participant.js +85 -51
  44. package/dist/participant.js.map +1 -1
  45. package/dist/push-notification.js.map +1 -1
  46. package/dist/rest-paginator.js +16 -6
  47. package/dist/rest-paginator.js.map +1 -1
  48. package/dist/services/network.js +18 -14
  49. package/dist/services/network.js.map +1 -1
  50. package/dist/services/typing-indicator.js +20 -17
  51. package/dist/services/typing-indicator.js.map +1 -1
  52. package/dist/unsent-message.js.map +1 -1
  53. package/dist/user.js +85 -59
  54. package/dist/user.js.map +1 -1
  55. package/dist/util/deferred.js +3 -1
  56. package/dist/util/deferred.js.map +1 -1
  57. package/dist/util/index.js +6 -6
  58. package/dist/util/index.js.map +1 -1
  59. package/docs/assets/js/search.js +1 -1
  60. package/docs/classes/AggregatedDeliveryReceipt.html +0 -117
  61. package/docs/classes/Client.html +24 -147
  62. package/docs/classes/Conversation.html +30 -147
  63. package/docs/classes/DetailedDeliveryReceipt.html +1 -118
  64. package/docs/classes/Media.html +0 -117
  65. package/docs/classes/Message.html +7 -124
  66. package/docs/classes/MessageBuilder.html +2 -119
  67. package/docs/classes/Participant.html +7 -124
  68. package/docs/classes/PushNotification.html +0 -117
  69. package/docs/classes/RestPaginator.html +0 -117
  70. package/docs/classes/UnsentMessage.html +0 -117
  71. package/docs/classes/User.html +7 -124
  72. package/docs/index.html +56 -0
  73. package/docs/interfaces/ClientOptions.html +0 -117
  74. package/docs/interfaces/ConversationBindings.html +0 -117
  75. package/docs/interfaces/ConversationEmailBinding.html +0 -117
  76. package/docs/interfaces/ConversationState.html +0 -117
  77. package/docs/interfaces/CreateConversationOptions.html +1 -118
  78. package/docs/interfaces/LastMessage.html +0 -117
  79. package/docs/interfaces/Paginator.html +0 -117
  80. package/docs/interfaces/ParticipantBindings.html +0 -117
  81. package/docs/interfaces/ParticipantEmailBinding.html +0 -117
  82. package/docs/interfaces/PushNotificationData.html +0 -117
  83. package/docs/interfaces/SendEmailOptions.html +0 -117
  84. package/docs/interfaces/SendMediaOptions.html +0 -117
  85. package/docs/modules.html +56 -0
  86. package/package.json +23 -17
@@ -219,7 +219,12 @@ class AggregatedDeliveryReceipt {
219
219
  const isReadSame = this.read === data.read;
220
220
  const isUndeliveredSame = this.undelivered === data.undelivered;
221
221
  const isFailedSame = this.failed === data.failed;
222
- return isTotalSame && isSentSame && isDeliveredSame && isReadSame && isUndeliveredSame && isFailedSame;
222
+ return (isTotalSame &&
223
+ isSentSame &&
224
+ isDeliveredSame &&
225
+ isReadSame &&
226
+ isUndeliveredSame &&
227
+ isFailedSame);
223
228
  }
224
229
  }
225
230
 
@@ -1 +1 @@
1
- {"version":3,"file":"aggregated-delivery-receipt.js","sources":["../src/aggregated-delivery-receipt.ts"],"sourcesContent":["/**\n * Signifies the amount of participants which have the status for the message.\n */\ntype DeliveryAmount = 'none' | 'some' | 'all';\n\ninterface AggregatedDeliveryDescriptor {\n total: number;\n delivered: DeliveryAmount;\n failed: DeliveryAmount;\n read: DeliveryAmount;\n sent: DeliveryAmount;\n undelivered: DeliveryAmount;\n}\n\n/**\n * Contains aggregated information about delivery statuses of a message across all participants\n * of a conversation.\n *\n * At any moment during the message delivery to a participant, the message can have zero or more of following\n * delivery statuses:\n * * Message is considered as **sent** to a participant if the nearest upstream carrier accepted the message.\n * * Message is considered as **delivered** to a participant if Twilio has received confirmation of message\n * delivery from the upstream carrier, and, where available, the destination handset.\n * * Message considered as **undelivered** to a participant if Twilio has received a delivery receipt\n * indicating that the message was not delivered. This can happen for many reasons including carrier content\n * filtering and the availability of the destination handset.\n * * Message considered as **read** by a participant if the message has been delivered and opened by the\n * recipient in a conversation. The recipient must have enabled the read receipts.\n * * Message considered as **failed** to be delivered to a participant if the message could not be sent.\n * This can happen for various reasons including queue overflows, account suspensions and media\n * errors (in the case of MMS for instance).\n *\n * {@link AggregatedDeliveryReceipt} class contains an aggregated value {@link DeliveryAmount} for each delivery status.\n */\nclass AggregatedDeliveryReceipt {\n\n private state: AggregatedDeliveryDescriptor;\n\n /**\n * @internal\n */\n constructor(data: AggregatedDeliveryDescriptor) {\n this.state = data;\n }\n\n /**\n * Maximum number of delivery events expected for the message.\n */\n public get total(): number {\n return this.state.total;\n }\n\n /**\n * Message is considered as **sent** to a participant if the nearest upstream carrier accepted the message.\n *\n * @return Amount of participants that have the **sent** delivery status for the message.\n */\n public get sent(): DeliveryAmount {\n return this.state.sent;\n }\n\n /**\n * Message is considered as **delivered** to a participant if Twilio has received confirmation of message\n * delivery from the upstream carrier, and, where available, the destination handset.\n *\n * @return Amount of participants that have the **delivered** delivery status for the message.\n */\n public get delivered(): DeliveryAmount {\n return this.state.delivered;\n }\n\n /**\n * Message is considered as **read** by a participant, if the message has been delivered and opened by the\n * recipient in a conversation. The recipient must have enabled the read receipts.\n *\n * @return Amount of participants that have the **read** delivery status for the message.\n */\n public get read(): DeliveryAmount {\n return this.state.read;\n }\n\n /**\n * Message is considered as **undelivered** to a participant if Twilio has received a delivery receipt\n * indicating that the message was not delivered. This can happen for many reasons including carrier content\n * filtering and the availability of the destination handset.\n *\n * @return Ammount of participants that have the **undelivered** delivery status for the message.\n */\n public get undelivered(): DeliveryAmount {\n return this.state.undelivered;\n }\n\n /**\n * Message is considered as **failed** to be delivered to a participant if the message could not be sent.\n * This can happen for various reasons including queue overflows, account suspensions and media\n * errors (in the case of MMS for instance). Twilio does not charge you for failed messages.\n *\n * @return Amount of participants that have the **failed** delivery status for the message.\n */\n public get failed(): DeliveryAmount {\n return this.state.failed;\n }\n\n _update(data: AggregatedDeliveryDescriptor): void {\n this.state = data;\n }\n\n _isEquals(data: AggregatedDeliveryDescriptor): boolean {\n const isTotalSame = this.total === data.total;\n const isSentSame = this.sent === data.sent;\n const isDeliveredSame = this.delivered === data.delivered;\n const isReadSame = this.read === data.read;\n const isUndeliveredSame = this.undelivered === data.undelivered;\n const isFailedSame = this.failed === data.failed;\n\n return isTotalSame && isSentSame && isDeliveredSame && isReadSame && isUndeliveredSame && isFailedSame;\n }\n}\n\nexport {\n AggregatedDeliveryReceipt,\n AggregatedDeliveryDescriptor,\n DeliveryA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AAW,CAAC;QAChE,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC;QAEjD,OAAO,WAAW,IAAI,UAAU,IAAI,eAAe,IAAI,UAAU,IAAI,iBAAiB,IAAI,YAAY,CAAC;KACxG;;;;;"}
1
+ {"version":3,"file":"aggregated-delivery-receipt.js","sources":["../src/aggregated-delivery-receipt.ts"],"sourcesContent":["/**\n * Signifies the amount of participants which have the status for the message.\n */\ntype DeliveryAmount = \"none\" | \"some\" | \"all\";\n\ninterface AggregatedDeliveryDescriptor {\n total: number;\n delivered: DeliveryAmount;\n failed: DeliveryAmount;\n read: DeliveryAmount;\n sent: DeliveryAmount;\n undelivered: DeliveryAmount;\n}\n\n/**\n * Contains aggregated information about delivery statuses of a message across all participants\n * of a conversation.\n *\n * At any moment during the message delivery to a participant, the message can have zero or more of following\n * delivery statuses:\n * * Message is considered as **sent** to a participant if the nearest upstream carrier accepted the message.\n * * Message is considered as **delivered** to a participant if Twilio has received confirmation of message\n * delivery from the upstream carrier, and, where available, the destination handset.\n * * Message considered as **undelivered** to a participant if Twilio has received a delivery receipt\n * indicating that the message was not delivered. This can happen for many reasons including carrier content\n * filtering and the availability of the destination handset.\n * * Message considered as **read** by a participant if the message has been delivered and opened by the\n * recipient in a conversation. The recipient must have enabled the read receipts.\n * * Message considered as **failed** to be delivered to a participant if the message could not be sent.\n * This can happen for various reasons including queue overflows, account suspensions and media\n * errors (in the case of MMS for instance).\n *\n * {@link AggregatedDeliveryReceipt} class contains an aggregated value {@link DeliveryAmount} for each delivery status.\n */\nclass AggregatedDeliveryReceipt {\n private state: AggregatedDeliveryDescriptor;\n\n /**\n * @internal\n */\n constructor(data: AggregatedDeliveryDescriptor) {\n this.state = data;\n }\n\n /**\n * Maximum number of delivery events expected for the message.\n */\n public get total(): number {\n return this.state.total;\n }\n\n /**\n * Message is considered as **sent** to a participant if the nearest upstream carrier accepted the message.\n *\n * @return Amount of participants that have the **sent** delivery status for the message.\n */\n public get sent(): DeliveryAmount {\n return this.state.sent;\n }\n\n /**\n * Message is considered as **delivered** to a participant if Twilio has received confirmation of message\n * delivery from the upstream carrier, and, where available, the destination handset.\n *\n * @return Amount of participants that have the **delivered** delivery status for the message.\n */\n public get delivered(): DeliveryAmount {\n return this.state.delivered;\n }\n\n /**\n * Message is considered as **read** by a participant, if the message has been delivered and opened by the\n * recipient in a conversation. The recipient must have enabled the read receipts.\n *\n * @return Amount of participants that have the **read** delivery status for the message.\n */\n public get read(): DeliveryAmount {\n return this.state.read;\n }\n\n /**\n * Message is considered as **undelivered** to a participant if Twilio has received a delivery receipt\n * indicating that the message was not delivered. This can happen for many reasons including carrier content\n * filtering and the availability of the destination handset.\n *\n * @return Ammount of participants that have the **undelivered** delivery status for the message.\n */\n public get undelivered(): DeliveryAmount {\n return this.state.undelivered;\n }\n\n /**\n * Message is considered as **failed** to be delivered to a participant if the message could not be sent.\n * This can happen for various reasons including queue overflows, account suspensions and media\n * errors (in the case of MMS for instance). Twilio does not charge you for failed messages.\n *\n * @return Amount of participants that have the **failed** delivery status for the message.\n */\n public get failed(): DeliveryAmount {\n return this.state.failed;\n }\n\n _update(data: AggregatedDeliveryDescriptor): void {\n this.state = data;\n }\n\n _isEquals(data: AggregatedDeliveryDescriptor): boolean {\n const isTotalSame = this.total === data.total;\n const isSentSame = this.sent === data.sent;\n const isDeliveredSame = this.delivered === data.delivered;\n const isReadSame = this.read === data.read;\n const isUndeliveredSame = this.undelivered === data.undelivered;\n const isFailedSame = this.failed === data.failed;\n\n return (\n isTotalSame &&\n isSentSame &&\n isDeliveredSame &&\n isReadSame &&\n isUndeliveredSame &&\n isFailedSame\n );\n }\n}\n\nexport {\n AggregatedDeliveryReceipt,\n AggregatedDeliveryDescriptor,\n DeliveryAmount,\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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