@twilio/conversations 2.2.0-rc.12 → 2.2.0-rc.14
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/CHANGELOG.md +35 -0
- package/README.md +20 -16
- package/builds/browser.js +26 -26
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +17 -12
- package/builds/lib.js +26 -26
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +39 -31
- package/builds/twilio-conversations.min.js +1 -1
- package/dist/aggregated-delivery-receipt.js +1 -1
- package/dist/aggregated-delivery-receipt.js.map +1 -1
- package/dist/client.js +1 -4
- package/dist/client.js.map +1 -1
- package/dist/conversation.js +11 -4
- package/dist/conversation.js.map +1 -1
- package/dist/message.js +7 -9
- package/dist/message.js.map +1 -1
- package/dist/packages/conversations/package.json.js +1 -1
- package/docs/classes/AggregatedDeliveryReceipt.html +1 -1
- package/docs/classes/Client.html +0 -4
- package/docs/classes/Conversation.html +9 -4
- package/docs/classes/Message.html +5 -5
- package/docs/index.html +20 -16
- package/docs/modules.html +20 -16
- package/package.json +7 -7
@@ -3722,20 +3722,25 @@ img {
|
|
3722
3722
|
</aside>
|
3723
3723
|
<div class="tsd-comment tsd-typography">
|
3724
3724
|
<div class="lead">
|
3725
|
-
<p>Get unread messages
|
3725
|
+
<p>Get count of unread messages for the user if they are a participant of this
|
3726
3726
|
conversation. Rejects if the user is not a participant of the conversation.</p>
|
3727
3727
|
</div>
|
3728
3728
|
<p>Use this method to obtain the number of unread messages together with
|
3729
3729
|
<a href="Conversation.html#updateLastReadMessageIndex">Conversation.updateLastReadMessageIndex</a> instead of relying on the
|
3730
3730
|
message indices which may have gaps. See <a href="Message.html#index">Message.index</a> for details.</p>
|
3731
3731
|
<p>This method is semi-realtime. This means that this data will be eventually
|
3732
|
-
correct, but will also be possibly incorrect for a few seconds. The
|
3732
|
+
correct, but it will also be possibly incorrect for a few seconds. The
|
3733
3733
|
Conversations system does not provide real time events for counter values
|
3734
3734
|
changes.</p>
|
3735
3735
|
<p>This is useful for any UI badges, but it is not recommended to build any
|
3736
3736
|
core application logic based on these counters being accurate in real time.</p>
|
3737
|
+
<p>If the read horizon is not set, this function will return null. This could mean
|
3738
|
+
that all messages in the conversation are unread, or that the read horizon system
|
3739
|
+
is not being used. How to interpret this <code>null</code> value is up to the customer application.</p>
|
3737
3740
|
</div>
|
3738
3741
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4>
|
3742
|
+
<p>Number of unread messages based on the current read horizon set for
|
3743
|
+
the user or <code>null</code> if the read horizon is not set.</p>
|
3739
3744
|
</li>
|
3740
3745
|
</ul>
|
3741
3746
|
</section>
|
@@ -3907,7 +3912,7 @@ img {
|
|
3907
3912
|
</div>
|
3908
3913
|
</div>
|
3909
3914
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4>
|
3910
|
-
<p>
|
3915
|
+
<p>New count of unread messages after this update.</p>
|
3911
3916
|
</li>
|
3912
3917
|
</ul>
|
3913
3918
|
</section>
|
@@ -4043,7 +4048,7 @@ img {
|
|
4043
4048
|
</li>
|
4044
4049
|
</ul>
|
4045
4050
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4>
|
4046
|
-
<p>
|
4051
|
+
<p>New count of unread messages after this update.</p>
|
4047
4052
|
</li>
|
4048
4053
|
</ul>
|
4049
4054
|
</section>
|
@@ -3043,13 +3043,13 @@ img {
|
|
3043
3043
|
</aside>
|
3044
3044
|
<div class="tsd-comment tsd-typography">
|
3045
3045
|
<div class="lead">
|
3046
|
-
<p>Index of
|
3047
|
-
By design of the Conversations system, the message indices may have arbitrary gaps between them,
|
3048
|
-
that does not necessarily mean they were deleted or otherwise modified - just that
|
3049
|
-
messages may have some non-contiguous indices even if they are being sent immediately one after another.</p>
|
3046
|
+
<p>Index of this message in the conversation's list of messages.</p>
|
3050
3047
|
</div>
|
3048
|
+
<p>By design, the message indices may have arbitrary gaps between them,
|
3049
|
+
that does not necessarily mean they were deleted or otherwise modified - just that
|
3050
|
+
messages may have some non-contiguous indices even if they are being sent immediately one after another.</p>
|
3051
3051
|
<p>Trying to use indices for some calculations is going to be unreliable.</p>
|
3052
|
-
<p>To calculate the number of unread messages it is better to use the
|
3052
|
+
<p>To calculate the number of unread messages, it is better to use the Read Horizon API.
|
3053
3053
|
See <a href="Conversation.html#getUnreadMessagesCount">Conversation.getUnreadMessagesCount</a> for details.</p>
|
3054
3054
|
</div>
|
3055
3055
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
|
package/docs/index.html
CHANGED
@@ -2857,29 +2857,33 @@ img {
|
|
2857
2857
|
<p>Using this method, you can <code>require</code> <code>twilio-conversations</code> and then use the
|
2858
2858
|
client:</p>
|
2859
2859
|
<pre><code><span style="color: #0000FF">const</span><span style="color: #000000"> { </span><span style="color: #0070C1">Client</span><span style="color: #000000"> } = </span><span style="color: #795E26">require</span><span style="color: #000000">(</span><span style="color: #A31515">'@twilio/conversations'</span><span style="color: #000000">);</span>
|
2860
|
+
|
2860
2861
|
<span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">client</span><span style="color: #000000"> = </span><span style="color: #0000FF">new</span><span style="color: #000000"> </span><span style="color: #795E26">Client</span><span style="color: #000000">(</span><span style="color: #001080">token</span><span style="color: #000000">);</span>
|
2861
|
-
|
2862
|
-
<span style="color: #008000">//
|
2863
|
-
<span style="color: #001080">client</span><span style="color: #000000">.</span><span style="color: #795E26">on</span><span style="color: #000000">(</span><span style="color: #A31515">'
|
2864
|
-
<span style="color: #000000"> </span><span style="color: #
|
2865
|
-
<span style="color: #000000"> </span><span style="color: #008000">// Use the client</span>
|
2866
|
-
<span style="color: #000000"> }</span>
|
2867
|
-
<span style="color: #000000"> </span>
|
2868
|
-
<span style="color: #000000"> </span><span style="color: #AF00DB">if</span><span style="color: #000000"> (</span><span style="color: #001080">error</span><span style="color: #000000">) {</span>
|
2869
|
-
<span style="color: #000000"> </span><span style="color: #008000">// Handle error</span>
|
2870
|
-
<span style="color: #000000"> }</span>
|
2862
|
+
|
2863
|
+
<span style="color: #008000">// Before you use the client, subscribe to the `'initialized'` event.</span>
|
2864
|
+
<span style="color: #001080">client</span><span style="color: #000000">.</span><span style="color: #795E26">on</span><span style="color: #000000">(</span><span style="color: #A31515">'initialized'</span><span style="color: #000000">, () </span><span style="color: #0000FF">=></span><span style="color: #000000"> {</span>
|
2865
|
+
<span style="color: #000000"> </span><span style="color: #008000">// Use the client.</span>
|
2871
2866
|
<span style="color: #000000">}</span>
|
2867
|
+
|
2868
|
+
<span style="color: #008000">// To catch client initialization errors, subscribe to the `'initFailed'` event.</span>
|
2869
|
+
<span style="color: #001080">client</span><span style="color: #000000">.</span><span style="color: #795E26">on</span><span style="color: #000000">(</span><span style="color: #A31515">'initFailed'</span><span style="color: #000000">, ({ </span><span style="color: #001080">error</span><span style="color: #000000"> }) </span><span style="color: #0000FF">=></span><span style="color: #000000"> {</span>
|
2870
|
+
<span style="color: #000000"> </span><span style="color: #008000">// Handle the error.</span>
|
2871
|
+
<span style="color: #000000">});</span>
|
2872
2872
|
</code></pre>
|
2873
2873
|
<p>The SDK could also be imported using the ES module syntax:</p>
|
2874
2874
|
<pre><code><span style="color: #AF00DB">import</span><span style="color: #000000"> { </span><span style="color: #001080">Client</span><span style="color: #000000"> } </span><span style="color: #AF00DB">from</span><span style="color: #000000"> </span><span style="color: #A31515">'@twilio/conversations'</span><span style="color: #000000">;</span>
|
2875
|
+
|
2875
2876
|
<span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">client</span><span style="color: #000000"> = </span><span style="color: #0000FF">new</span><span style="color: #000000"> </span><span style="color: #795E26">Client</span><span style="color: #000000">(</span><span style="color: #001080">token</span><span style="color: #000000">);</span>
|
2876
|
-
|
2877
|
-
<span style="color: #008000">//
|
2878
|
-
<span style="color: #001080">client</span><span style="color: #000000">.</span><span style="color: #795E26">on</span><span style="color: #000000">(</span><span style="color: #A31515">'
|
2879
|
-
<span style="color: #000000"> </span><span style="color: #
|
2880
|
-
<span style="color: #000000"> </span><span style="color: #008000">// Use the client</span>
|
2881
|
-
<span style="color: #000000"> }</span>
|
2877
|
+
|
2878
|
+
<span style="color: #008000">// Before you use the client, subscribe to the `'initialized'` event.</span>
|
2879
|
+
<span style="color: #001080">client</span><span style="color: #000000">.</span><span style="color: #795E26">on</span><span style="color: #000000">(</span><span style="color: #A31515">'initialized'</span><span style="color: #000000">, () </span><span style="color: #0000FF">=></span><span style="color: #000000"> {</span>
|
2880
|
+
<span style="color: #000000"> </span><span style="color: #008000">// Use the client.</span>
|
2882
2881
|
<span style="color: #000000">}</span>
|
2882
|
+
|
2883
|
+
<span style="color: #008000">// To catch client initialization errors, subscribe to the `'initFailed'` event.</span>
|
2884
|
+
<span style="color: #001080">client</span><span style="color: #000000">.</span><span style="color: #795E26">on</span><span style="color: #000000">(</span><span style="color: #A31515">'initFailed'</span><span style="color: #000000">, ({ </span><span style="color: #001080">error</span><span style="color: #000000"> }) </span><span style="color: #0000FF">=></span><span style="color: #000000"> {</span>
|
2885
|
+
<span style="color: #000000"> </span><span style="color: #008000">// Handle the error.</span>
|
2886
|
+
<span style="color: #000000">});</span>
|
2883
2887
|
</code></pre>
|
2884
2888
|
<a href="#cdn" id="cdn" style="color: inherit; text-decoration: none;">
|
2885
2889
|
<h3>CDN</h3>
|
package/docs/modules.html
CHANGED
@@ -2859,29 +2859,33 @@ img {
|
|
2859
2859
|
<p>Using this method, you can <code>require</code> <code>twilio-conversations</code> and then use the
|
2860
2860
|
client:</p>
|
2861
2861
|
<pre><code><span style="color: #0000FF">const</span><span style="color: #000000"> { </span><span style="color: #0070C1">Client</span><span style="color: #000000"> } = </span><span style="color: #795E26">require</span><span style="color: #000000">(</span><span style="color: #A31515">'@twilio/conversations'</span><span style="color: #000000">);</span>
|
2862
|
+
|
2862
2863
|
<span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">client</span><span style="color: #000000"> = </span><span style="color: #0000FF">new</span><span style="color: #000000"> </span><span style="color: #795E26">Client</span><span style="color: #000000">(</span><span style="color: #001080">token</span><span style="color: #000000">);</span>
|
2863
|
-
|
2864
|
-
<span style="color: #008000">//
|
2865
|
-
<span style="color: #001080">client</span><span style="color: #000000">.</span><span style="color: #795E26">on</span><span style="color: #000000">(</span><span style="color: #A31515">'
|
2866
|
-
<span style="color: #000000"> </span><span style="color: #
|
2867
|
-
<span style="color: #000000"> </span><span style="color: #008000">// Use the client</span>
|
2868
|
-
<span style="color: #000000"> }</span>
|
2869
|
-
<span style="color: #000000"> </span>
|
2870
|
-
<span style="color: #000000"> </span><span style="color: #AF00DB">if</span><span style="color: #000000"> (</span><span style="color: #001080">error</span><span style="color: #000000">) {</span>
|
2871
|
-
<span style="color: #000000"> </span><span style="color: #008000">// Handle error</span>
|
2872
|
-
<span style="color: #000000"> }</span>
|
2864
|
+
|
2865
|
+
<span style="color: #008000">// Before you use the client, subscribe to the `'initialized'` event.</span>
|
2866
|
+
<span style="color: #001080">client</span><span style="color: #000000">.</span><span style="color: #795E26">on</span><span style="color: #000000">(</span><span style="color: #A31515">'initialized'</span><span style="color: #000000">, () </span><span style="color: #0000FF">=></span><span style="color: #000000"> {</span>
|
2867
|
+
<span style="color: #000000"> </span><span style="color: #008000">// Use the client.</span>
|
2873
2868
|
<span style="color: #000000">}</span>
|
2869
|
+
|
2870
|
+
<span style="color: #008000">// To catch client initialization errors, subscribe to the `'initFailed'` event.</span>
|
2871
|
+
<span style="color: #001080">client</span><span style="color: #000000">.</span><span style="color: #795E26">on</span><span style="color: #000000">(</span><span style="color: #A31515">'initFailed'</span><span style="color: #000000">, ({ </span><span style="color: #001080">error</span><span style="color: #000000"> }) </span><span style="color: #0000FF">=></span><span style="color: #000000"> {</span>
|
2872
|
+
<span style="color: #000000"> </span><span style="color: #008000">// Handle the error.</span>
|
2873
|
+
<span style="color: #000000">});</span>
|
2874
2874
|
</code></pre>
|
2875
2875
|
<p>The SDK could also be imported using the ES module syntax:</p>
|
2876
2876
|
<pre><code><span style="color: #AF00DB">import</span><span style="color: #000000"> { </span><span style="color: #001080">Client</span><span style="color: #000000"> } </span><span style="color: #AF00DB">from</span><span style="color: #000000"> </span><span style="color: #A31515">'@twilio/conversations'</span><span style="color: #000000">;</span>
|
2877
|
+
|
2877
2878
|
<span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">client</span><span style="color: #000000"> = </span><span style="color: #0000FF">new</span><span style="color: #000000"> </span><span style="color: #795E26">Client</span><span style="color: #000000">(</span><span style="color: #001080">token</span><span style="color: #000000">);</span>
|
2878
|
-
|
2879
|
-
<span style="color: #008000">//
|
2880
|
-
<span style="color: #001080">client</span><span style="color: #000000">.</span><span style="color: #795E26">on</span><span style="color: #000000">(</span><span style="color: #A31515">'
|
2881
|
-
<span style="color: #000000"> </span><span style="color: #
|
2882
|
-
<span style="color: #000000"> </span><span style="color: #008000">// Use the client</span>
|
2883
|
-
<span style="color: #000000"> }</span>
|
2879
|
+
|
2880
|
+
<span style="color: #008000">// Before you use the client, subscribe to the `'initialized'` event.</span>
|
2881
|
+
<span style="color: #001080">client</span><span style="color: #000000">.</span><span style="color: #795E26">on</span><span style="color: #000000">(</span><span style="color: #A31515">'initialized'</span><span style="color: #000000">, () </span><span style="color: #0000FF">=></span><span style="color: #000000"> {</span>
|
2882
|
+
<span style="color: #000000"> </span><span style="color: #008000">// Use the client.</span>
|
2884
2883
|
<span style="color: #000000">}</span>
|
2884
|
+
|
2885
|
+
<span style="color: #008000">// To catch client initialization errors, subscribe to the `'initFailed'` event.</span>
|
2886
|
+
<span style="color: #001080">client</span><span style="color: #000000">.</span><span style="color: #795E26">on</span><span style="color: #000000">(</span><span style="color: #A31515">'initFailed'</span><span style="color: #000000">, ({ </span><span style="color: #001080">error</span><span style="color: #000000"> }) </span><span style="color: #0000FF">=></span><span style="color: #000000"> {</span>
|
2887
|
+
<span style="color: #000000"> </span><span style="color: #008000">// Handle the error.</span>
|
2888
|
+
<span style="color: #000000">});</span>
|
2885
2889
|
</code></pre>
|
2886
2890
|
<a href="#cdn" id="cdn" style="color: inherit; text-decoration: none;">
|
2887
2891
|
<h3>CDN</h3>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@twilio/conversations",
|
3
|
-
"version": "2.2.0-rc.
|
3
|
+
"version": "2.2.0-rc.14",
|
4
4
|
"description": "Twilio Conversations client library",
|
5
5
|
"main": "./builds/lib.js",
|
6
6
|
"browser": "./builds/browser.js",
|
@@ -36,12 +36,12 @@
|
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
38
|
"@babel/runtime": "^7.17.0",
|
39
|
-
"@twilio/declarative-type-validator": "^0.2.
|
40
|
-
"@twilio/deprecation-decorator": "^0.
|
41
|
-
"@twilio/mcs-client": "^0.6.
|
42
|
-
"@twilio/notifications": "^2.0.
|
43
|
-
"@twilio/operation-retrier": "^4.0.
|
44
|
-
"@twilio/replay-event-emitter": "^0.3.
|
39
|
+
"@twilio/declarative-type-validator": "^0.2.1-rc.1",
|
40
|
+
"@twilio/deprecation-decorator": "^0.2.0-rc.0",
|
41
|
+
"@twilio/mcs-client": "^0.6.1-rc.1",
|
42
|
+
"@twilio/notifications": "^2.0.1-rc.1",
|
43
|
+
"@twilio/operation-retrier": "^4.0.9-rc.1",
|
44
|
+
"@twilio/replay-event-emitter": "^0.3.1-rc.1",
|
45
45
|
"core-js": "^3.17.3",
|
46
46
|
"iso8601-duration": "=1.2.0",
|
47
47
|
"isomorphic-form-data": "^2.0.0",
|