Commit 11b5ca4c authored by timkinnane's avatar timkinnane
Browse files

build(npm): Change package name to org scope

parent b3f6e1bc
...@@ -33,9 +33,9 @@ Currently, there are two modules exported by the SDK: ...@@ -33,9 +33,9 @@ Currently, there are two modules exported by the SDK:
Access these modules by importing them from SDK, e.g: Access these modules by importing them from SDK, e.g:
ES6 `import { driver, methodCache } from 'rocketchat-sdk'` ES6 `import { driver, methodCache } from '@rocket.chat/sdk'`
ES5 `const { driver, methodCache } = require('rocketchat-sdk')` ES5 `const { driver, methodCache } = require('@rocket.chat/sdk')`
See [Asteroid][asteroid] docs for methods that can be called from that API. See [Asteroid][asteroid] docs for methods that can be called from that API.
...@@ -272,12 +272,12 @@ interactions (i.e. bots) locally while in development. ...@@ -272,12 +272,12 @@ interactions (i.e. bots) locally while in development.
## Use as Dependency ## Use as Dependency
`yarn add rocketchat-sdk` or `npm install --save rocketchat-sdk` `yarn add @rocket.chat/sdk` or `npm install --save @rocket.chat/sdk`
ES6 module, using async ES6 module, using async
``` ```
import * as rocketchat from 'rocketchat-sdk' import * as rocketchat from '@rocket.chat/sdk'
const asteroid = await rocketchat.driver.connect({ host: 'localhost:3000' }) const asteroid = await rocketchat.driver.connect({ host: 'localhost:3000' })
console.log('connected', asteroid) console.log('connected', asteroid)
...@@ -286,7 +286,7 @@ console.log('connected', asteroid) ...@@ -286,7 +286,7 @@ console.log('connected', asteroid)
ES5 module, using callback ES5 module, using callback
``` ```
const rocketchat = require('rocketchat-sdk') const rocketchat = require('@rocket.chat/sdk')
rocketchat.driver.connect({ host: 'localhost:3000' }, function (err, asteroid) { rocketchat.driver.connect({ host: 'localhost:3000' }, function (err, asteroid) {
if (err) console.error(err) if (err) console.error(err)
......
...@@ -7,7 +7,7 @@ import { IMessage } from '../config/messageInterfaces'; ...@@ -7,7 +7,7 @@ import { IMessage } from '../config/messageInterfaces';
/** /**
* Event Emitter for listening to connection. * Event Emitter for listening to connection.
* @example * @example
* import { driver } from 'rocketchat-sdk' * import { driver } from '@rocket.chat/sdk'
* driver.connect() * driver.connect()
* driver.events.on('connected', () => console.log('driver connected')) * driver.events.on('connected', () => console.log('driver connected'))
*/ */
...@@ -36,13 +36,13 @@ export declare function useLog(externalLog: ILogger): void; ...@@ -36,13 +36,13 @@ export declare function useLog(externalLog: ILogger): void;
* error-first-pattern. Error returned or promise rejected on timeout. * error-first-pattern. Error returned or promise rejected on timeout.
* Removes http/s protocol to get connection hostname if taken from URL. * Removes http/s protocol to get connection hostname if taken from URL.
* @example <caption>Use with callback</caption> * @example <caption>Use with callback</caption>
* import { driver } from 'rocketchat-sdk' * import { driver } from '@rocket.chat/sdk'
* driver.connect({}, (err) => { * driver.connect({}, (err) => {
* if (err) throw err * if (err) throw err
* else console.log('connected') * else console.log('connected')
* }) * })
* @example <caption>Using promise</caption> * @example <caption>Using promise</caption>
* import { driver } from 'rocketchat-sdk' * import { driver } from '@rocket.chat/sdk'
* driver.connect() * driver.connect()
* .then(() => console.log('connected')) * .then(() => console.log('connected'))
* .catch((err) => console.error(err)) * .catch((err) => console.error(err))
......
...@@ -52,7 +52,7 @@ const integrationId = process.env.INTEGRATION_ID || 'js.SDK'; ...@@ -52,7 +52,7 @@ const integrationId = process.env.INTEGRATION_ID || 'js.SDK';
/** /**
* Event Emitter for listening to connection. * Event Emitter for listening to connection.
* @example * @example
* import { driver } from 'rocketchat-sdk' * import { driver } from '@rocket.chat/sdk'
* driver.connect() * driver.connect()
* driver.events.on('connected', () => console.log('driver connected')) * driver.events.on('connected', () => console.log('driver connected'))
*/ */
...@@ -75,13 +75,13 @@ exports.useLog = useLog; ...@@ -75,13 +75,13 @@ exports.useLog = useLog;
* error-first-pattern. Error returned or promise rejected on timeout. * error-first-pattern. Error returned or promise rejected on timeout.
* Removes http/s protocol to get connection hostname if taken from URL. * Removes http/s protocol to get connection hostname if taken from URL.
* @example <caption>Use with callback</caption> * @example <caption>Use with callback</caption>
* import { driver } from 'rocketchat-sdk' * import { driver } from '@rocket.chat/sdk'
* driver.connect({}, (err) => { * driver.connect({}, (err) => {
* if (err) throw err * if (err) throw err
* else console.log('connected') * else console.log('connected')
* }) * })
* @example <caption>Using promise</caption> * @example <caption>Using promise</caption>
* import { driver } from 'rocketchat-sdk' * import { driver } from '@rocket.chat/sdk'
* driver.connect() * driver.connect()
* .then(() => console.log('connected')) * .then(() => console.log('connected'))
* .catch((err) => console.error(err)) * .catch((err) => console.error(err))
......
This diff is collapsed.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>InternalLog | rocketchat-sdk</title> <title>InternalLog | @rocket.chat/sdk</title>
<meta name="description" content=""> <meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css"> <link rel="stylesheet" href="../assets/css/main.css">
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<li class="state loading">Preparing search index...</li> <li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li> <li class="state failure">The search index is not available</li>
</ul> </ul>
<a href="../index.html" class="title">rocketchat-sdk</a> <a href="../index.html" class="title">@rocket.chat/sdk</a>
</div> </div>
<div class="table-cell" id="tsd-widgets"> <div class="table-cell" id="tsd-widgets">
<div id="tsd-filter"> <div id="tsd-filter">
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/lib/log.ts#L5">lib/log.ts:5</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/lib/log.ts#L5">lib/log.ts:5</a></li>
</ul> </ul>
</aside> </aside>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/lib/log.ts#L17">lib/log.ts:17</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/lib/log.ts#L17">lib/log.ts:17</a></li>
</ul> </ul>
</aside> </aside>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/lib/log.ts#L8">lib/log.ts:8</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/lib/log.ts#L8">lib/log.ts:8</a></li>
</ul> </ul>
</aside> </aside>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/lib/log.ts#L14">lib/log.ts:14</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/lib/log.ts#L14">lib/log.ts:14</a></li>
</ul> </ul>
</aside> </aside>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
...@@ -209,7 +209,7 @@ ...@@ -209,7 +209,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/lib/log.ts#L11">lib/log.ts:11</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/lib/log.ts#L11">lib/log.ts:11</a></li>
</ul> </ul>
</aside> </aside>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Message | rocketchat-sdk</title> <title>Message | @rocket.chat/sdk</title>
<meta name="description" content=""> <meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css"> <link rel="stylesheet" href="../assets/css/main.css">
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<li class="state loading">Preparing search index...</li> <li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li> <li class="state failure">The search index is not available</li>
</ul> </ul>
<a href="../index.html" class="title">rocketchat-sdk</a> <a href="../index.html" class="title">@rocket.chat/sdk</a>
</div> </div>
<div class="table-cell" id="tsd-widgets"> <div class="table-cell" id="tsd-widgets">
<div id="tsd-filter"> <div id="tsd-filter">
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/lib/message.ts#L13">lib/message.ts:13</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/lib/message.ts#L13">lib/message.ts:13</a></li>
</ul> </ul>
</aside> </aside>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#_id">_id</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#_id">_id</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L5">config/messageInterfaces.ts:5</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L5">config/messageInterfaces.ts:5</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#alias">alias</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#alias">alias</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L8">config/messageInterfaces.ts:8</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L8">config/messageInterfaces.ts:8</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#attachments">attachments</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#attachments">attachments</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L20">config/messageInterfaces.ts:20</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L20">config/messageInterfaces.ts:20</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#avatar">avatar</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#avatar">avatar</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L10">config/messageInterfaces.ts:10</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L10">config/messageInterfaces.ts:10</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#bot">bot</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#bot">bot</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L12">config/messageInterfaces.ts:12</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L12">config/messageInterfaces.ts:12</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -229,7 +229,7 @@ ...@@ -229,7 +229,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#editedat">editedAt</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#editedat">editedAt</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L21">config/messageInterfaces.ts:21</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L21">config/messageInterfaces.ts:21</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#editedby">editedBy</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#editedby">editedBy</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L22">config/messageInterfaces.ts:22</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L22">config/messageInterfaces.ts:22</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#emoji">emoji</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#emoji">emoji</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L9">config/messageInterfaces.ts:9</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L9">config/messageInterfaces.ts:9</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#groupable">groupable</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#groupable">groupable</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L11">config/messageInterfaces.ts:11</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L11">config/messageInterfaces.ts:11</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#location">location</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#location">location</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L16">config/messageInterfaces.ts:16</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L16">config/messageInterfaces.ts:16</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -284,7 +284,7 @@ ...@@ -284,7 +284,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#mentions">mentions</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#mentions">mentions</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L14">config/messageInterfaces.ts:14</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L14">config/messageInterfaces.ts:14</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -295,7 +295,7 @@ ...@@ -295,7 +295,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#msg">msg</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#msg">msg</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L7">config/messageInterfaces.ts:7</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L7">config/messageInterfaces.ts:7</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -306,7 +306,7 @@ ...@@ -306,7 +306,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#reactions">reactions</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#reactions">reactions</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L15">config/messageInterfaces.ts:15</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L15">config/messageInterfaces.ts:15</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -317,7 +317,7 @@ ...@@ -317,7 +317,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#rid">rid</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#rid">rid</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L4">config/messageInterfaces.ts:4</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L4">config/messageInterfaces.ts:4</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -328,7 +328,7 @@ ...@@ -328,7 +328,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#t">t</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#t">t</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L6">config/messageInterfaces.ts:6</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L6">config/messageInterfaces.ts:6</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -339,7 +339,7 @@ ...@@ -339,7 +339,7 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
<p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#urls">urls</a></p> <p>Inherited from <a href="../interfaces/_config_messageinterfaces_.imessage.html">IMessage</a>.<a href="../interfaces/_config_messageinterfaces_.imessage.html#urls">urls</a></p>
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/config/messageInterfaces.ts#L13">config/messageInterfaces.ts:13</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/config/messageInterfaces.ts#L13">config/messageInterfaces.ts:13</a></li>
</ul> </ul>
</aside> </aside>
</section> </section>
...@@ -356,7 +356,7 @@ ...@@ -356,7 +356,7 @@
<li class="tsd-description"> <li class="tsd-description">
<aside class="tsd-sources"> <aside class="tsd-sources">
<ul> <ul>
<li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/665a0d5/src/lib/message.ts#L19">lib/message.ts:19</a></li> <li>Defined in <a href="https://github.com/RocketChat/Rocket.Chat.js.SDK/blob/b3f6e1b/src/lib/message.ts#L19">lib/message.ts:19</a></li>
</ul> </ul>
</aside> </aside>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>rocketchat-sdk</title> <title>@rocket.chat/sdk</title>
<meta name="description" content=""> <meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="assets/css/main.css"> <link rel="stylesheet" href="assets/css/main.css">
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<li class="state loading">Preparing search index...</li> <li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li> <li class="state failure">The search index is not available</li>
</ul> </ul>
<a href="index.html" class="title">rocketchat-sdk</a> <a href="index.html" class="title">@rocket.chat/sdk</a>
</div> </div>
<div class="table-cell" id="tsd-widgets"> <div class="table-cell" id="tsd-widgets">
<div id="tsd-filter"> <div id="tsd-filter">
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<a href="globals.html">Globals</a> <a href="globals.html">Globals</a>
</li> </li>
</ul> </ul>
<h1> rocketchat-sdk</h1> <h1> @rocket.chat/sdk</h1>
</div> </div>
</div> </div>
</header> </header>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>rocketchat-sdk</title> <title>@rocket.chat/sdk</title>
<meta name="description" content=""> <meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="assets/css/main.css"> <link rel="stylesheet" href="assets/css/main.css">
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<li class="state loading">Preparing search index...</li> <li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li> <li class="state failure">The search index is not available</li>
</ul> </ul>
<a href="index.html" class="title">rocketchat-sdk</a> <a href="index.html" class="title">@rocket.chat/sdk</a>
</div> </div>
<div class="table-cell" id="tsd-widgets"> <div class="table-cell" id="tsd-widgets">
<div id="tsd-filter"> <div id="tsd-filter">
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<a href="globals.html">Globals</a> <a href="globals.html">Globals</a>
</li> </li>
</ul> </ul>
<h1> rocketchat-sdk</h1> <h1> @rocket.chat/sdk</h1>
</div> </div>
</div> </div>
</header> </header>
...@@ -85,8 +85,8 @@ ...@@ -85,8 +85,8 @@
<li><code>methodCache</code> - Manages results cache for calls to server (via LRU cache)</li> <li><code>methodCache</code> - Manages results cache for calls to server (via LRU cache)</li>
</ul> </ul>
<p>Access these modules by importing them from SDK, e.g:</p> <p>Access these modules by importing them from SDK, e.g:</p>
<p>ES6 <code>import { driver, methodCache } from &#39;rocketchat-sdk&#39;</code></p> <p>ES6 <code>import { driver, methodCache } from &#39;@rocket.chat/sdk&#39;</code></p>
<p>ES5 <code>const { driver, methodCache } = require(&#39;rocketchat-sdk&#39;)</code></p> <p>ES5 <code>const { driver, methodCache } = require(&#39;@rocket.chat/sdk&#39;)</code></p>
<p>See <a href="https://www.npmjs.com/package/asteroid">Asteroid</a> docs for methods that can be called from that API.</p> <p>See <a href="https://www.npmjs.com/package/asteroid">Asteroid</a> docs for methods that can be called from that API.</p>
<p>Any Rocket.Chat server method can be called via <code>driver.callMethod</code>, <p>Any Rocket.Chat server method can be called via <code>driver.callMethod</code>,
<code>driver.cacheCall</code> or <code>driver.asyncCall</code>. Server methods are not fully <code>driver.cacheCall</code> or <code>driver.asyncCall</code>. Server methods are not fully
...@@ -302,14 +302,14 @@ ...@@ -302,14 +302,14 @@
and subscription methods are functional. And it helps to manually run your SDK and subscription methods are functional. And it helps to manually run your SDK
interactions (i.e. bots) locally while in development.</p> interactions (i.e. bots) locally while in development.</p>
<h2 id="use-as-dependency">Use as Dependency</h2> <h2 id="use-as-dependency">Use as Dependency</h2>
<p><code>yarn add rocketchat-sdk</code> or <code>npm install --save rocketchat-sdk</code></p> <p><code>yarn add @rocket.chat/sdk</code> or <code>npm install --save @rocket.chat/sdk</code></p>
<p>ES6 module, using async</p> <p>ES6 module, using async</p>
<pre><code><span class="hljs-keyword">import</span> * <span class="hljs-keyword">as</span> rocketchat <span class="hljs-keyword">from</span> <span class="hljs-string">'rocketchat-sdk'</span> <pre><code><span class="hljs-keyword">import</span> * <span class="hljs-keyword">as</span> rocketchat <span class="hljs-keyword">from</span> <span class="hljs-string">'@rocket.chat/sdk'</span>
<span class="hljs-keyword">const</span> asteroid = <span class="hljs-keyword">await</span> rocketchat.driver.connect({ <span class="hljs-attr">host</span>: <span class="hljs-string">'localhost:3000'</span> }) <span class="hljs-keyword">const</span> asteroid = <span class="hljs-keyword">await</span> rocketchat.driver.connect({ <span class="hljs-attr">host</span>: <span class="hljs-string">'localhost:3000'</span> })
<span class="hljs-built_in">console</span>.log(<span class="hljs-string">'connected'</span>, asteroid) <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'connected'</span>, asteroid)
</code></pre><p>ES5 module, using callback</p> </code></pre><p>ES5 module, using callback</p>
<pre><code><span class="hljs-keyword">const</span> rocketchat = <span class="hljs-built_in">require</span>(<span class="hljs-string">'rocketchat-sdk'</span>) <pre><code><span class="hljs-keyword">const</span> rocketchat = <span class="hljs-built_in">require</span>(<span class="hljs-string">'@rocket.chat/sdk'</span>)
rocketchat.driver.connect({ <span class="hljs-attr">host</span>: <span class="hljs-string">'localhost:3000'</span> }, <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">err, asteroid</span>) </span>{ rocketchat.driver.connect({ <span class="hljs-attr">host</span>: <span class="hljs-string">'localhost:3000'</span> }, <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">err, asteroid</span>) </span>{
<span class="hljs-keyword">if</span> (err) <span class="hljs-built_in">console</span>.error(err) <span class="hljs-keyword">if</span> (err) <span class="hljs-built_in">console</span>.error(err)
......