@twilio/conversations 2.0.0-rc.3 → 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.
- package/CHANGELOG.md +9 -0
- package/README.md +20 -15
- package/dist/browser.js +9 -2
- package/dist/browser.js.map +1 -1
- package/dist/docs/index.html +20 -13
- package/dist/docs/interfaces/PushNotificationData.html +1 -1
- package/dist/docs/interfaces/SendMediaOptions.html +2 -1
- package/dist/docs/modules.html +20 -13
- package/dist/lib.d.ts +10 -2
- package/dist/lib.js +9 -2
- package/dist/lib.js.map +1 -1
- package/dist/react-native.js +9 -2
- package/dist/react-native.js.map +1 -1
- package/dist/twilio-conversations.js +9 -2
- package/dist/twilio-conversations.min.js +1 -1
- package/package.json +1 -1
package/dist/docs/index.html
CHANGED
@@ -2824,21 +2824,28 @@ img {
|
|
2824
2824
|
</a>
|
2825
2825
|
<pre><code><span style="color: #001080">npm</span><span style="color: #000000"> </span><span style="color: #001080">install</span><span style="color: #000000"> --</span><span style="color: #001080">save</span><span style="color: #000000"> @</span><span style="color: #001080">twilio</span><span style="color: #000000">/</span><span style="color: #001080">conversations</span>
|
2826
2826
|
</code></pre>
|
2827
|
-
<p>Using this method, you can <code>require</code> <code>twilio-conversations</code> and then use the
|
2828
|
-
|
2829
|
-
<span style="color: #
|
2830
|
-
<span style="color: #
|
2831
|
-
<span style="color: #
|
2832
|
-
|
2833
|
-
|
2834
|
-
|
2835
|
-
<span style="color: #
|
2836
|
-
<span style="color: #
|
2827
|
+
<p>Using this method, you can <code>require</code> <code>twilio-conversations</code> and then use the
|
2828
|
+
client:</p>
|
2829
|
+
<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>
|
2830
|
+
<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>
|
2831
|
+
<span style="color: #008000">// Before you use the client, subscribe to the `'stateChanged'` event and wait </span>
|
2832
|
+
<span style="color: #008000">// for the `'initialized'` state to be reported.</span>
|
2833
|
+
<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">'stateChanged'</span><span style="color: #000000">, (</span><span style="color: #001080">state</span><span style="color: #000000">) </span><span style="color: #0000FF">=></span><span style="color: #000000"> {</span>
|
2834
|
+
<span style="color: #000000"> </span><span style="color: #AF00DB">if</span><span style="color: #000000"> (</span><span style="color: #001080">state</span><span style="color: #000000"> === </span><span style="color: #A31515">'initialized'</span><span style="color: #000000">) {</span>
|
2835
|
+
<span style="color: #000000"> </span><span style="color: #008000">// Use the client</span>
|
2836
|
+
<span style="color: #000000"> }</span>
|
2837
|
+
<span style="color: #000000">}</span>
|
2837
2838
|
</code></pre>
|
2838
2839
|
<p>The SDK could also be imported using the ES module syntax:</p>
|
2839
|
-
<pre><code><span style="color: #AF00DB">import</span><span style="color: #000000"> { </span><span style="color: #001080">
|
2840
|
-
<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: #
|
2841
|
-
<span style="color: #008000">//
|
2840
|
+
<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>
|
2841
|
+
<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>
|
2842
|
+
<span style="color: #008000">// Before you use the client, subscribe to the `'stateChanged'` event and wait </span>
|
2843
|
+
<span style="color: #008000">// for the `'initialized'` state to be reported.</span>
|
2844
|
+
<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">'stateChanged'</span><span style="color: #000000">, (</span><span style="color: #001080">state</span><span style="color: #000000">) </span><span style="color: #0000FF">=></span><span style="color: #000000"> {</span>
|
2845
|
+
<span style="color: #000000"> </span><span style="color: #AF00DB">if</span><span style="color: #000000"> (</span><span style="color: #001080">state</span><span style="color: #000000"> === </span><span style="color: #A31515">'initialized'</span><span style="color: #000000">) {</span>
|
2846
|
+
<span style="color: #000000"> </span><span style="color: #008000">// Use the client</span>
|
2847
|
+
<span style="color: #000000"> }</span>
|
2848
|
+
<span style="color: #000000">}</span>
|
2842
2849
|
</code></pre>
|
2843
2850
|
<a href="#cdn" id="cdn" style="color: inherit; text-decoration: none;">
|
2844
2851
|
<h3>CDN</h3>
|
@@ -2826,7 +2826,8 @@ img {
|
|
2826
2826
|
<div class="tsd-comment tsd-typography">
|
2827
2827
|
<div class="lead">
|
2828
2828
|
<p>Configuration for attaching a media file to a message.
|
2829
|
-
|
2829
|
+
These options can be passed to <a href="../classes/Conversation.html#sendMessage">Conversation.sendMessage</a> and
|
2830
|
+
<a href="../classes/MessageBuilder.html#addMedia">MessageBuilder.addMedia</a>.</p>
|
2830
2831
|
</div>
|
2831
2832
|
</div>
|
2832
2833
|
</section>
|
package/dist/docs/modules.html
CHANGED
@@ -2826,21 +2826,28 @@ img {
|
|
2826
2826
|
</a>
|
2827
2827
|
<pre><code><span style="color: #001080">npm</span><span style="color: #000000"> </span><span style="color: #001080">install</span><span style="color: #000000"> --</span><span style="color: #001080">save</span><span style="color: #000000"> @</span><span style="color: #001080">twilio</span><span style="color: #000000">/</span><span style="color: #001080">conversations</span>
|
2828
2828
|
</code></pre>
|
2829
|
-
<p>Using this method, you can <code>require</code> <code>twilio-conversations</code> and then use the
|
2830
|
-
|
2831
|
-
<
|
2832
|
-
<span style="color: #
|
2833
|
-
<span style="color: #
|
2834
|
-
|
2835
|
-
|
2836
|
-
|
2837
|
-
<span style="color: #
|
2838
|
-
<span style="color: #
|
2829
|
+
<p>Using this method, you can <code>require</code> <code>twilio-conversations</code> and then use the
|
2830
|
+
client:</p>
|
2831
|
+
<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>
|
2832
|
+
<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>
|
2833
|
+
<span style="color: #008000">// Before you use the client, subscribe to the `'stateChanged'` event and wait </span>
|
2834
|
+
<span style="color: #008000">// for the `'initialized'` state to be reported.</span>
|
2835
|
+
<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">'stateChanged'</span><span style="color: #000000">, (</span><span style="color: #001080">state</span><span style="color: #000000">) </span><span style="color: #0000FF">=></span><span style="color: #000000"> {</span>
|
2836
|
+
<span style="color: #000000"> </span><span style="color: #AF00DB">if</span><span style="color: #000000"> (</span><span style="color: #001080">state</span><span style="color: #000000"> === </span><span style="color: #A31515">'initialized'</span><span style="color: #000000">) {</span>
|
2837
|
+
<span style="color: #000000"> </span><span style="color: #008000">// Use the client</span>
|
2838
|
+
<span style="color: #000000"> }</span>
|
2839
|
+
<span style="color: #000000">}</span>
|
2839
2840
|
</code></pre>
|
2840
2841
|
<p>The SDK could also be imported using the ES module syntax:</p>
|
2841
|
-
<pre><code><span style="color: #AF00DB">import</span><span style="color: #000000"> { </span><span style="color: #001080">
|
2842
|
-
<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: #
|
2843
|
-
<span style="color: #008000">//
|
2842
|
+
<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>
|
2843
|
+
<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>
|
2844
|
+
<span style="color: #008000">// Before you use the client, subscribe to the `'stateChanged'` event and wait </span>
|
2845
|
+
<span style="color: #008000">// for the `'initialized'` state to be reported.</span>
|
2846
|
+
<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">'stateChanged'</span><span style="color: #000000">, (</span><span style="color: #001080">state</span><span style="color: #000000">) </span><span style="color: #0000FF">=></span><span style="color: #000000"> {</span>
|
2847
|
+
<span style="color: #000000"> </span><span style="color: #AF00DB">if</span><span style="color: #000000"> (</span><span style="color: #001080">state</span><span style="color: #000000"> === </span><span style="color: #A31515">'initialized'</span><span style="color: #000000">) {</span>
|
2848
|
+
<span style="color: #000000"> </span><span style="color: #008000">// Use the client</span>
|
2849
|
+
<span style="color: #000000"> }</span>
|
2850
|
+
<span style="color: #000000">}</span>
|
2844
2851
|
</code></pre>
|
2845
2852
|
<a href="#cdn" id="cdn" style="color: inherit; text-decoration: none;">
|
2846
2853
|
<h3>CDN</h3>
|
package/dist/lib.d.ts
CHANGED
@@ -1009,7 +1009,8 @@ interface ConversationUpdatedEventArgs {
|
|
1009
1009
|
}
|
1010
1010
|
/**
|
1011
1011
|
* Configuration for attaching a media file to a message.
|
1012
|
-
* These options can be passed to {@link Conversation.sendMessage}
|
1012
|
+
* These options can be passed to {@link Conversation.sendMessage} and
|
1013
|
+
* {@link MessageBuilder.addMedia}.
|
1013
1014
|
*/
|
1014
1015
|
interface SendMediaOptions {
|
1015
1016
|
/**
|
@@ -1431,7 +1432,7 @@ interface PushNotificationData {
|
|
1431
1432
|
*/
|
1432
1433
|
messageIndex?: number;
|
1433
1434
|
/**
|
1434
|
-
* SID of the message in the conversation.
|
1435
|
+
* SID of the message in the conversation.
|
1435
1436
|
*/
|
1436
1437
|
messageSid?: string;
|
1437
1438
|
}
|
@@ -1815,6 +1816,13 @@ declare class Client extends ReplayEventEmitter<ClientEvents> {
|
|
1815
1816
|
* The factory method will automatically trigger connection.
|
1816
1817
|
* Do not use it if you need finer-grained control.
|
1817
1818
|
*
|
1819
|
+
* Since this method returns an already-initialized client, some of the events
|
1820
|
+
* will be lost because they happen *before* the initialization. It is
|
1821
|
+
* recommended that `client.onWithReplay` is used as opposed to `client.on`
|
1822
|
+
* for subscribing to client events. The `client.onWithReplay` will re-emit
|
1823
|
+
* the most recent value for a given event if it emitted before the
|
1824
|
+
* subscription.
|
1825
|
+
*
|
1818
1826
|
* @param token Access token.
|
1819
1827
|
* @param options Options to customize the client.
|
1820
1828
|
* @returns Returns a fully initialized client.
|
package/dist/lib.js
CHANGED
@@ -4393,7 +4393,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
4393
4393
|
while (1) {
|
4394
4394
|
switch (_context5.prev = _context5.next) {
|
4395
4395
|
case 0:
|
4396
|
-
return _context5.abrupt("return", this.participantsEntity.addNonChatParticipant(proxyAddress, address, attributes
|
4396
|
+
return _context5.abrupt("return", this.participantsEntity.addNonChatParticipant(proxyAddress, address, attributes));
|
4397
4397
|
|
4398
4398
|
case 1:
|
4399
4399
|
case "end":
|
@@ -6608,7 +6608,7 @@ function PushNotification(data) {
|
|
6608
6608
|
this.data = data.data || {};
|
6609
6609
|
};
|
6610
6610
|
|
6611
|
-
var version = "2.0.0-rc.
|
6611
|
+
var version = "2.0.0-rc.4";
|
6612
6612
|
|
6613
6613
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
6614
6614
|
|
@@ -7692,6 +7692,13 @@ exports.Client = Client_1 = (_temp = _class = /*#__PURE__*/function (_ReplayEven
|
|
7692
7692
|
* The factory method will automatically trigger connection.
|
7693
7693
|
* Do not use it if you need finer-grained control.
|
7694
7694
|
*
|
7695
|
+
* Since this method returns an already-initialized client, some of the events
|
7696
|
+
* will be lost because they happen *before* the initialization. It is
|
7697
|
+
* recommended that `client.onWithReplay` is used as opposed to `client.on`
|
7698
|
+
* for subscribing to client events. The `client.onWithReplay` will re-emit
|
7699
|
+
* the most recent value for a given event if it emitted before the
|
7700
|
+
* subscription.
|
7701
|
+
*
|
7695
7702
|
* @param token Access token.
|
7696
7703
|
* @param options Options to customize the client.
|
7697
7704
|
* @returns Returns a fully initialized client.
|