Partially get rid of nested sdk

This commit is contained in:
Juan Cruz Viotti 2015-01-08 09:04:37 -03:00
parent 8ac36ced4d
commit 12f46be691
91 changed files with 39 additions and 24150 deletions

View File

@ -1,393 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='javascript/application.js'></script>
<script src='javascript/search.js'></script>
<link rel='stylesheet' href='stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path=''></div>
<div id='header'>
<div id='menu'>
</div>
</div>
<div id='content'>
<h1 class='noborder title'></h1>
<div id='listing'>
<h1 class='alphaindex'>Alphabetical Index</h1>
<h2>Extra File Listing</h2>
<ul id='files'>
<li>
<a href='extra/README.md.html' title='README.md'>
README.md
</a>
</li>
</ul>
<h2>Class Listing A-Z</h2>
<div class='index'>
<ul>
<li class='letter'>d</li>
<ul>
<li>
<a href='class/DirectoryDoesntExist.html'>
DirectoryDoesntExist
</a>
</li>
</ul>
</ul>
<ul>
<li class='letter'>i</li>
<ul>
<li>
<a href='class/InvalidConfigFile.html'>
InvalidConfigFile
</a>
</li>
<li>
<a href='class/InvalidCredentials.html'>
InvalidCredentials
</a>
</li>
<li>
<a href='class/InvalidKey.html'>
InvalidKey
</a>
</li>
<li>
<a href='class/InvalidPath.html'>
InvalidPath
</a>
</li>
</ul>
</ul>
<ul>
<li class='letter'>n</li>
<ul>
<li>
<a href='class/NotFound.html'>
NotFound
</a>
</li>
<li>
<a href='class/NotAny.html'>
NotAny
</a>
</li>
</ul>
</ul>
<ul>
<li class='letter'>p</li>
<ul>
<li>
<a href='class/PinejsClientRequest.html'>
PinejsClientRequest
</a>
</li>
</ul>
</ul>
</div>
<h2>File Listing A-Z</h2>
<div class='index'>
<ul>
<li class='letter'>a</li>
<ul>
<li>
<a href='file/lib/resin/auth/auth.coffee.html'>
auth.coffee
</a>
<small>
(lib&#47;resin&#47;auth)
</small>
</li>
<li>
<a href='file/lib/resin/models/application.coffee.html'>
application.coffee
</a>
<small>
(lib&#47;resin&#47;models)
</small>
</li>
</ul>
</ul>
<ul>
<li class='letter'>c</li>
<ul>
<li>
<a href='file/lib/resin/config/config.coffee.html'>
config.coffee
</a>
<small>
(lib&#47;resin&#47;config)
</small>
</li>
</ul>
</ul>
<ul>
<li class='letter'>d</li>
<ul>
<li>
<a href='file/lib/resin/data/data-prefix.coffee.html'>
data-prefix.coffee
</a>
<small>
(lib&#47;resin&#47;data)
</small>
</li>
<li>
<a href='file/lib/resin/data/data.coffee.html'>
data.coffee
</a>
<small>
(lib&#47;resin&#47;data)
</small>
</li>
<li>
<a href='file/lib/resin/device/device.coffee.html'>
device.coffee
</a>
<small>
(lib&#47;resin&#47;device)
</small>
</li>
<li>
<a href='file/lib/resin/models/device.coffee.html'>
device.coffee
</a>
<small>
(lib&#47;resin&#47;models)
</small>
</li>
</ul>
</ul>
<ul>
<li class='letter'>e</li>
<ul>
<li>
<a href='file/lib/resin/errors/errors.coffee.html'>
errors.coffee
</a>
<small>
(lib&#47;resin&#47;errors)
</small>
</li>
<li>
<a href='file/lib/resin/models/environment-variables.coffee.html'>
environment-variables.coffee
</a>
<small>
(lib&#47;resin&#47;models)
</small>
</li>
</ul>
</ul>
<ul>
<li class='letter'>g</li>
<ul>
<li>
<a href='file/lib/resin/vcs/git/git.coffee.html'>
git.coffee
</a>
<small>
(lib&#47;resin&#47;vcs&#47;git)
</small>
</li>
</ul>
</ul>
<ul>
<li class='letter'>h</li>
<ul>
<li>
<a href='file/lib/resin/helpers/helpers.coffee.html'>
helpers.coffee
</a>
<small>
(lib&#47;resin&#47;helpers)
</small>
</li>
</ul>
</ul>
<ul>
<li class='letter'>i</li>
<ul>
<li>
<a href='file/lib/resin/index.coffee.html'>
index.coffee
</a>
<small>
(lib&#47;resin)
</small>
</li>
<li>
<a href='file/lib/resin/models/index.coffee.html'>
index.coffee
</a>
<small>
(lib&#47;resin&#47;models)
</small>
</li>
</ul>
</ul>
<ul>
<li class='letter'>l</li>
<ul>
<li>
<a href='file/lib/resin/log/log.coffee.html'>
log.coffee
</a>
<small>
(lib&#47;resin&#47;log)
</small>
</li>
</ul>
</ul>
<ul>
<li class='letter'>o</li>
<ul>
<li>
<a href='file/lib/resin/os/os.coffee.html'>
os.coffee
</a>
<small>
(lib&#47;resin&#47;os)
</small>
</li>
</ul>
</ul>
<ul>
<li class='letter'>s</li>
<ul>
<li>
<a href='file/lib/resin/server/server.coffee.html'>
server.coffee
</a>
<small>
(lib&#47;resin&#47;server)
</small>
</li>
<li>
<a href='file/lib/resin/settings.coffee.html'>
settings.coffee
</a>
<small>
(lib&#47;resin)
</small>
</li>
</ul>
</ul>
<ul>
<li class='letter'>t</li>
<ul>
<li>
<a href='file/lib/resin/token/token.coffee.html'>
token.coffee
</a>
<small>
(lib&#47;resin&#47;token)
</small>
</li>
</ul>
</ul>
<ul>
<li class='letter'>v</li>
<ul>
<li>
<a href='file/lib/resin/vcs/vcs.coffee.html'>
vcs.coffee
</a>
<small>
(lib&#47;resin&#47;vcs)
</small>
</li>
</ul>
</ul>
<ul>
<li class='letter'>w</li>
<ul>
<li>
<a href='file/lib/resin/os/windows/windows.coffee.html'>
windows.coffee
</a>
<small>
(lib&#47;resin&#47;os&#47;windows)
</small>
</li>
</ul>
</ul>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,161 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>DirectoryDoesntExist</span>
</div>
</div>
<div id='content'>
<h1>
Class:
DirectoryDoesntExist
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;errors&#47;errors.coffee</td>
</tr>
<tr>
<td>Inherits:</td>
<td>
TypedError
</td>
</tr>
</table>
<h2>Variables Summary</h2>
<dl class='constants'>
<dt id='code-variable'>
code
=
</dt>
<dd>
<pre><code class='coffeescript'>1</code></pre>
<div class='docstring'>
<p>Error code</p>
</div>
<div class='tags'>
</div>
</dd>
</dl>
<h2>Constructor Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='constructor-dynamic'>
#
(void)
<b>constructor</b><span>(directory)</span>
<br>
</p>
<div class='docstring'>
<p>Construct a Directory Doesn&#39;t Exist error</p><pre><code>throw new resin.errors.DirectoryDoesntExist(&#39;/tmp&#39;)
Error: Directory doesn&#39;t exist: /tmp
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>directory</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the name of the directory that doesn&#39;t exist </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,161 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>InvalidConfigFile</span>
</div>
</div>
<div id='content'>
<h1>
Class:
InvalidConfigFile
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;errors&#47;errors.coffee</td>
</tr>
<tr>
<td>Inherits:</td>
<td>
TypedError
</td>
</tr>
</table>
<h2>Variables Summary</h2>
<dl class='constants'>
<dt id='code-variable'>
code
=
</dt>
<dd>
<pre><code class='coffeescript'>1</code></pre>
<div class='docstring'>
<p>Error code</p>
</div>
<div class='tags'>
</div>
</dd>
</dl>
<h2>Constructor Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='constructor-dynamic'>
#
(void)
<b>constructor</b><span>(file)</span>
<br>
</p>
<div class='docstring'>
<p>Construct an Invalid Config File error</p><pre><code>throw new resin.errors.InvalidConfigFile(&#39;/opt/resin.conf&#39;)
Error: Invalid configuration file: /opt/resin.conf
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>file</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the name of the invalid configuration file </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,148 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>InvalidCredentials</span>
</div>
</div>
<div id='content'>
<h1>
Class:
InvalidCredentials
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;errors&#47;errors.coffee</td>
</tr>
<tr>
<td>Inherits:</td>
<td>
TypedError
</td>
</tr>
</table>
<h2>Variables Summary</h2>
<dl class='constants'>
<dt id='code-variable'>
code
=
</dt>
<dd>
<pre><code class='coffeescript'>1</code></pre>
<div class='docstring'>
<p>Error code</p>
</div>
<div class='tags'>
</div>
</dd>
</dl>
<h2>Constructor Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='constructor-dynamic'>
#
(void)
<b>constructor</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Construct an Invalid Credentials error</p><pre><code>throw new resin.errors.InvalidCredentials()
Error: Invalid credentials
</code></pre>
</div>
<div class='tags'>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,148 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>InvalidKey</span>
</div>
</div>
<div id='content'>
<h1>
Class:
InvalidKey
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;errors&#47;errors.coffee</td>
</tr>
<tr>
<td>Inherits:</td>
<td>
TypedError
</td>
</tr>
</table>
<h2>Variables Summary</h2>
<dl class='constants'>
<dt id='code-variable'>
code
=
</dt>
<dd>
<pre><code class='coffeescript'>1</code></pre>
<div class='docstring'>
<p>Error code</p>
</div>
<div class='tags'>
</div>
</dd>
</dl>
<h2>Constructor Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='constructor-dynamic'>
#
(void)
<b>constructor</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Construct an Invalid Key error</p><pre><code>throw new resin.errors.InvalidKey()
Error: Invalid key
</code></pre>
</div>
<div class='tags'>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,161 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>InvalidPath</span>
</div>
</div>
<div id='content'>
<h1>
Class:
InvalidPath
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;errors&#47;errors.coffee</td>
</tr>
<tr>
<td>Inherits:</td>
<td>
TypedError
</td>
</tr>
</table>
<h2>Variables Summary</h2>
<dl class='constants'>
<dt id='code-variable'>
code
=
</dt>
<dd>
<pre><code class='coffeescript'>1</code></pre>
<div class='docstring'>
<p>Error code</p>
</div>
<div class='tags'>
</div>
</dd>
</dl>
<h2>Constructor Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='constructor-dynamic'>
#
(void)
<b>constructor</b><span>(path)</span>
<br>
</p>
<div class='docstring'>
<p>Construct an Invalid Path error</p><pre><code>throw new resin.errors.InvalidPath(&#39;/tmp&#39;)
Error: Invalid path: /tmp
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>path</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the name of the invalid path </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,161 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>NotAny</span>
</div>
</div>
<div id='content'>
<h1>
Class:
NotAny
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;errors&#47;errors.coffee</td>
</tr>
<tr>
<td>Inherits:</td>
<td>
TypedError
</td>
</tr>
</table>
<h2>Variables Summary</h2>
<dl class='constants'>
<dt id='code-variable'>
code
=
</dt>
<dd>
<pre><code class='coffeescript'>0</code></pre>
<div class='docstring'>
<p>Error code</p>
</div>
<div class='tags'>
</div>
</dd>
</dl>
<h2>Constructor Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='constructor-dynamic'>
#
(void)
<b>constructor</b><span>(name)</span>
<br>
</p>
<div class='docstring'>
<p>Construct an Not Any error</p><pre><code>throw new resin.errors.NotAny(&#39;applications&#39;)
Error: You don&#39;t have any applications
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>name</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>name of the thing that the user doesn&#39;t have </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,161 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>NotFound</span>
</div>
</div>
<div id='content'>
<h1>
Class:
NotFound
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;errors&#47;errors.coffee</td>
</tr>
<tr>
<td>Inherits:</td>
<td>
TypedError
</td>
</tr>
</table>
<h2>Variables Summary</h2>
<dl class='constants'>
<dt id='code-variable'>
code
=
</dt>
<dd>
<pre><code class='coffeescript'>1</code></pre>
<div class='docstring'>
<p>Error code</p>
</div>
<div class='tags'>
</div>
</dd>
</dl>
<h2>Constructor Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='constructor-dynamic'>
#
(void)
<b>constructor</b><span>(name)</span>
<br>
</p>
<div class='docstring'>
<p>Construct a Not Found error</p><pre><code>throw new resin.errors.NotFound(&#39;application&#39;)
Error: Couldn&#39;t find application
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>name</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>name of the thing that was not found </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,165 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>PinejsClientRequest</span>
</div>
</div>
<div id='content'>
<h1>
Class:
PinejsClientRequest
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;models&#47;_pine.coffee</td>
</tr>
<tr>
<td>Inherits:</td>
<td>
PinejsClientCore
</td>
</tr>
</table>
<h2>Instance Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#_request-dynamic'>
#
(void)
<b>_request</b><span>(params)</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Trigger a request to the resin.io API <p>Makes use of <a href="https://bitbucket.org/rulemotion/pinejs-client-js">pinejs-client-js</a></p>
</span>
</li>
</ul>
<h2>Instance Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='_request-dynamic'>
#
(void)
<b>_request</b><span>(params)</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
You shouldn&#39;t make use of this method directly, but through models
</div>
<p>Trigger a request to the resin.io API</p><p>Makes use of <a href="https://bitbucket.org/rulemotion/pinejs-client-js">pinejs-client-js</a></p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>params</span>
<span class='type'>
(
<tt>Object</tt>
)
</span>
&mdash;
<span class='desc'>request params (same as node-request params) </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,132 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='javascript/application.js'></script>
<script src='javascript/search.js'></script>
<link rel='stylesheet' href='stylesheets/application.css' type='text/css'>
</head>
<body class='list'>
<div class='list tree' id='content'>
<h1 class='full_list_header'>Class List</h1>
<nav>
<a target='_self' href='class_list.html'>
Classes
</a>
<a target='_self' href='file_list.html'>
Files
</a>
<a target='_self' href='method_list.html'>
Methods
</a>
<a target='_self' href='extra_list.html'>
Extras
</a>
</nav>
<div id='search'>
Search:
<input type='text'>
</div>
<ul>
<li>
<a href='class/NotFound.html' target='main'>
NotFound
</a>
<small class='parent'>
<
TypedError
</small>
<small class='namespace'>
</small>
</li>
<li>
<a href='class/InvalidConfigFile.html' target='main'>
InvalidConfigFile
</a>
<small class='parent'>
<
TypedError
</small>
<small class='namespace'>
</small>
</li>
<li>
<a href='class/InvalidCredentials.html' target='main'>
InvalidCredentials
</a>
<small class='parent'>
<
TypedError
</small>
<small class='namespace'>
</small>
</li>
<li>
<a href='class/InvalidKey.html' target='main'>
InvalidKey
</a>
<small class='parent'>
<
TypedError
</small>
<small class='namespace'>
</small>
</li>
<li>
<a href='class/InvalidPath.html' target='main'>
InvalidPath
</a>
<small class='parent'>
<
TypedError
</small>
<small class='namespace'>
</small>
</li>
<li>
<a href='class/DirectoryDoesntExist.html' target='main'>
DirectoryDoesntExist
</a>
<small class='parent'>
<
TypedError
</small>
<small class='namespace'>
</small>
</li>
<li>
<a href='class/NotAny.html' target='main'>
NotAny
</a>
<small class='parent'>
<
TypedError
</small>
<small class='namespace'>
</small>
</li>
<li>
<a href='class/PinejsClientRequest.html' target='main'>
PinejsClientRequest
</a>
<small class='parent'>
<
PinejsClientCore
</small>
<small class='namespace'>
</small>
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,137 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>README.md</span>
</div>
</div>
<div id='content'>
<nav class='toc'>
<p class='title'>
<a class='hide_toc' href='#'>
<strong>Table of Contents</strong>
</a>
<small>
(<a class='float_toc' href='#'>left</a>)
</small>
</p>
</nav>
<div id='filecontents'>
<h1 id="resin-cli">Resin CLI</h1><p>Take a look at the spec for features, roadmap and progress <a href="https://docs.google.com/a/resin.io/document/d/1mPBWy9wwLiNd25VcIvp3HEWJNjoXkALfMLMblXaGoh8/edit?usp=sharing">https://docs.google.com/a/resin.io/document/d/1mPBWy9wwLiNd25VcIvp3HEWJNjoXkALfMLMblXaGoh8/edit?usp=sharing</a>.</p><h2 id="installing">Installing</h2>
<pre><code class="lang-sh">$ git clone git@bitbucket.org:rulemotion/resin-cli.git
$ cd resin-cli
$ npm install
</code></pre>
<h3 id="if-you-want-to-have-resin-on-your-path-">If you want to have resin on your PATH:</h3>
<pre><code class="lang-sh">$ npm install -g
</code></pre>
<h3 id="if-you-want-to-run-it-locally-">If you want to run it locally:</h3>
<pre><code class="lang-sh">$ ./bin/resin
</code></pre><p>Or:</p><pre><code class="lang-sh">$ coffee lib/app.coffee
</code></pre>
<h2 id="tests">Tests</h2><p>You can run the <a href="http://mochajs.org/">Mocha</a> test suite, you can do:</p><pre><code class="lang-sh">$ gulp test
</code></pre>
<h2 id="development-mode">Development mode</h2><p>The following command will watch for any changes and will run a linter and the whole test suite:</p><pre><code class="lang-sh">$ gulp watch
</code></pre><p>If you set <code>DEBUG</code> environment variable, errors will print with a stack trace:</p><pre><code class="lang-sh">$ DEBUG=true resin ...
</code></pre>
<h2 id="documentation">Documentation</h2><p>You can renegerate the documentation with:</p><pre><code class="lang-sh">$ npm run-script doc
</code></pre>
<h2 id="manual-pages">Manual pages</h2><p>UNIX manual pages reside in <code>doc/</code></p><p>You can regenerate UNIX <code>roff</code> manual pages from markdown with:</p><pre><code class="lang-sh">$ npm run-script man
</code></pre><p>If you add a new <code>man</code> page, remember to add the <code>roff</code> filename to the <code>man</code> array in <code>package.json</code>.</p><h2 id="caveats">Caveats</h2>
<ul>
<li>Some interactive widgets don&#39;t work on <a href="https://cygwin.com/">Cygwin</a>. If you&#39;re running Windows, it&#39;s preferrable that you use <code>cmd.exe</code>.</li>
<li>Most commands require an <code>&lt;id&gt;</code> argument, however <a href="https://github.com/tj/commander.js">Commander</a> refuses to show that in the help page. This will be fixed soon.</li>
</ul>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,41 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='javascript/application.js'></script>
<script src='javascript/search.js'></script>
<link rel='stylesheet' href='stylesheets/application.css' type='text/css'>
</head>
<body class='list'>
<div class='list tree' id='content'>
<h1 class='full_list_header'>File List</h1>
<nav>
<a target='_self' href='class_list.html'>
Classes
</a>
<a target='_self' href='file_list.html'>
Files
</a>
<a target='_self' href='method_list.html'>
Methods
</a>
<a target='_self' href='extra_list.html'>
Extras
</a>
</nav>
<div id='search'>
Search:
<input type='text'>
</div>
<ul>
<li>
<a href='extra/README.md.html' target='main'>
README.md
</a>
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,470 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>auth</span>
&raquo;
<span class='title'>auth.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
auth.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;auth</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#authenticate-'>
~
(void)
<b>authenticate</b><span>(credentials, callback)</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Authenticate with the server <pre><code>resin.auth.authenticate credentials, (error, token) -&gt; throw error if error? console.log(token)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#login-'>
~
(void)
<b>login</b><span>(credentials, callback)</span>
</a>
</span>
<span class='desc'>
Login to Resin.io <p>Is the login is successful, the token is persisted between sessions.</p>
</span>
</li>
<li>
<span class='signature'>
<a href='#isLoggedIn-'>
~
(void)
<b>isLoggedIn</b><span>(callback)</span>
</a>
</span>
<span class='desc'>
Check if you&#39;re logged in <pre><code>resin.auth.isLoggedIn (isLoggedIn) -&gt; if isLoggedIn
console.log(&#39;I\&#39;m in!&#39;) else
console.log(&#39;Too bad!&#39;)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#getToken-'>
~
(void)
<b>getToken</b><span>(callback)</span>
</a>
</span>
<span class='desc'>
Get current logged in user&#39;s token <pre><code>resin.auth.getToken (error, token) -&gt; throw error if error? console.log(token)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#logout-'>
~
(void)
<b>logout</b><span>(callback)</span>
</a>
</span>
<span class='desc'>
Logout from Resin.io <pre><code>resin.auth.logout (error) -&gt; throw error if error? console.log(&#39;I\&#39;m out!&#39;)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#parseCredentials-'>
~
(void)
<b>parseCredentials</b><span>(credentials, callback)</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Parse colon separated credentials <pre><code>resin.auth.parseCredentials &#39;johndoe:secret&#39;, (error, credentials) -&gt; throw error if error? console.log(credentials.username) console.log(credentials.password)
</code></pre>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='authenticate-'>
~
(void)
<b>authenticate</b><span>(credentials, callback)</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
You should use login() when possible, as it takes care of saving the token as well.
</div>
<p>Authenticate with the server</p><pre><code>resin.auth.authenticate credentials, (error, token) -&gt; throw error if error? console.log(token)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>credentials</span>
<span class='type'>
(
<tt>Object</tt>
)
</span>
&mdash;
<span class='desc'>in the form of username, password </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback (error, token) </span>
</li>
</ul>
<h3>
Options Hash:
(credentials):
</h3>
<ul class='options'>
<li>
<span class='name'>username</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the username </span>
</li>
<li>
<span class='name'>password</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>user password </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='login-'>
~
(void)
<b>login</b><span>(credentials, callback)</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
This function saves the token to the directory configured in dataPrefix
</div>
<p>Login to Resin.io</p><p>Is the login is successful, the token is persisted between sessions.</p><pre><code>resin.auth.login credentials, (error) -&gt; throw error if error? console.log(&#39;I\&#39;m logged in!&#39;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>credentials</span>
<span class='type'>
(
<tt>Object</tt>
)
</span>
&mdash;
<span class='desc'>in the form of username, password </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback (error) </span>
</li>
</ul>
<h3>
Options Hash:
(credentials):
</h3>
<ul class='options'>
<li>
<span class='name'>username</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the username </span>
</li>
<li>
<span class='name'>password</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>user password </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='isLoggedIn-'>
~
(void)
<b>isLoggedIn</b><span>(callback)</span>
<br>
</p>
<div class='docstring'>
<p>Check if you&#39;re logged in</p><pre><code>resin.auth.isLoggedIn (isLoggedIn) -&gt; if isLoggedIn
console.log(&#39;I\&#39;m in!&#39;) else
console.log(&#39;Too bad!&#39;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback (isLoggedIn) </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='getToken-'>
~
(void)
<b>getToken</b><span>(callback)</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
This function simply delegates to resin.token.getToken() for convenience
</div>
<p>Get current logged in user&#39;s token</p><pre><code>resin.auth.getToken (error, token) -&gt; throw error if error? console.log(token)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback (error, isLoggedIn) </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='logout-'>
~
(void)
<b>logout</b><span>(callback)</span>
<br>
</p>
<div class='docstring'>
<div class='note todo'>
<strong>TODO:</strong>
Maybe we should post to /logout or something to invalidate the token on the server?
</div>
<p>Logout from Resin.io</p><pre><code>resin.auth.logout (error) -&gt; throw error if error? console.log(&#39;I\&#39;m out!&#39;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback (error) </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='parseCredentials-'>
~
(void)
<b>parseCredentials</b><span>(credentials, callback)</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<div class='note todo'>
<strong>TODO:</strong>
This should be moved somewhere else, as it only used by the auth actions
</div>
<p>Parse colon separated credentials</p><pre><code>resin.auth.parseCredentials &#39;johndoe:secret&#39;, (error, credentials) -&gt; throw error if error? console.log(credentials.username) console.log(credentials.password)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>colon</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>separated credentials (username:password) </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback (error, credentials) </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,197 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>config</span>
&raquo;
<span class='title'>config.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
config.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;config</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#loadUserConfig-'>
~
(Object)
<b>loadUserConfig</b><span>(configFile)</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Read JSON configuration file <p>User config loading should be sync, as we need to
extend this module with the result before exporting</p><pre><code>contents = resin.config.loadUserConfig(&#39;/Users/me/resin-custom.json&#39;)
console.log(contents.remoteUrl)
</code></pre>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='loadUserConfig-'>
~
(Object)
<b>loadUserConfig</b><span>(configFile)</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<p>Read JSON configuration file</p><p>User config loading should be sync, as we need to
extend this module with the result before exporting</p><pre><code>contents = resin.config.loadUserConfig(&#39;/Users/me/resin-custom.json&#39;)
console.log(contents.remoteUrl)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>configFile</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>configuration file path </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt><a href='../../../../class/InvalidConfigFile.html'>InvalidConfigFile</a></tt>
)
&mdash;
<span class='desc'>Will throw an error if file doesn&#39;t exist </span>
</li>
<li>
<span class='type'></span>
(
<tt><a href='../../../../class/InvalidConfigFile.html'>InvalidConfigFile</a></tt>
)
&mdash;
<span class='desc'>Will throw an error if file is not JSON </span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>Object</tt>
)
&mdash;
<span class='desc'>Parsed configuration file </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,247 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>data</span>
&raquo;
<span class='title'>data-prefix.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
data-prefix.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;data</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#get-'>
~
(String)
<b>get</b><span>()</span>
</a>
</span>
<span class='desc'>
Get current prefix <pre><code>prefix = resin.data.prefix.get()
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#set-'>
~
(void)
<b>set</b><span>(newPrefix, callback)</span>
</a>
</span>
<span class='desc'>
Set prefix <pre><code>resin.data.prefix.set &#39;/opt/resin&#39;, (error) -&gt; throw error if error?
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#clear-'>
~
(void)
<b>clear</b><span>()</span>
</a>
</span>
<span class='desc'>
Clear prefix <pre><code>resin.data.prefix.clear()
</code></pre>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='get-'>
~
(String)
<b>get</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Get current prefix</p><pre><code>prefix = resin.data.prefix.get()
</code></pre>
</div>
<div class='tags'>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>String</tt>
)
&mdash;
<span class='desc'>prefix </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='set-'>
~
(void)
<b>set</b><span>(newPrefix, callback)</span>
<br>
</p>
<div class='docstring'>
<p>Set prefix</p><pre><code>resin.data.prefix.set &#39;/opt/resin&#39;, (error) -&gt; throw error if error?
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>newPrefix</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>new prefix </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback (error) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt>Error</tt>
)
&mdash;
<span class='desc'>Will throw if prefix is not a valid path </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='clear-'>
~
(void)
<b>clear</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Clear prefix</p><pre><code>resin.data.prefix.clear()
</code></pre>
</div>
<div class='tags'>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,115 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>data</span>
&raquo;
<span class='title'>data.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
data.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;data</td>
</tr>
</table>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,264 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>device</span>
&raquo;
<span class='title'>device.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
device.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;device</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#getDisplayName-'>
~
(String)
<b>getDisplayName</b><span>(device)</span>
</a>
</span>
<span class='desc'>
Get display name for a device <p>For a list of supported devices, see getSupportedDevices()</p><pre><code>console.log resin.device.getDisplayName(&#39;raspberry-pi&#39;)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#getDeviceSlug-'>
~
(String)
<b>getDeviceSlug</b><span>(device)</span>
</a>
</span>
<span class='desc'>
Get device slug <pre><code>console.log resin.device.getDeviceSlug(&#39;Raspberry Pi&#39;)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#getSupportedDevices-'>
~
(Array&lt;String&gt;)
<b>getSupportedDevices</b><span>()</span>
</a>
</span>
<span class='desc'>
Get a list of supported devices <pre><code>devices = resin.device.getSupportedDevices()
console.log(devices)
</code></pre>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='getDisplayName-'>
~
(String)
<b>getDisplayName</b><span>(device)</span>
<br>
</p>
<div class='docstring'>
<p>Get display name for a device</p><p>For a list of supported devices, see getSupportedDevices()</p><pre><code>console.log resin.device.getDisplayName(&#39;raspberry-pi&#39;) # Raspberry Pi
console.log resin.device.getDisplayName(&#39;rpi&#39;) # Raspberry Pi
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>device</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>device name </span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>String</tt>
)
&mdash;
<span class='desc'>device display name or &#39;Unknown&#39; </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='getDeviceSlug-'>
~
(String)
<b>getDeviceSlug</b><span>(device)</span>
<br>
</p>
<div class='docstring'>
<p>Get device slug</p><pre><code>console.log resin.device.getDeviceSlug(&#39;Raspberry Pi&#39;) # raspberry-pi
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>device</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>device name </span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>String</tt>
)
&mdash;
<span class='desc'>device slug or &#39;unknown&#39; </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='getSupportedDevices-'>
~
(Array&lt;String&gt;)
<b>getSupportedDevices</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Get a list of supported devices</p><pre><code>devices = resin.device.getSupportedDevices()
console.log(devices)
</code></pre>
</div>
<div class='tags'>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>Array&lt;String&gt;</tt>
)
&mdash;
<span class='desc'>a list of all supported devices, by their display names </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,172 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>errors</span>
&raquo;
<span class='title'>errors.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
errors.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;errors</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#handle-'>
~
(void)
<b>handle</b><span>(error, exit = true)</span>
</a>
</span>
<span class='desc'>
Handle error instances <p>Prints the message to stderr and aborts the program with the corresponding error code, or 0 if none.</p>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='handle-'>
~
(void)
<b>handle</b><span>(error, exit = true)</span>
<br>
</p>
<div class='docstring'>
<p>Handle error instances</p><p>Prints the message to stderr and aborts the program with the corresponding error code, or 0 if none.</p><pre><code>error = new Error(&#39;My Error&#39;)
shouldExit = false
resin.errors.handle(error, shouldExit)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>error</span>
<span class='type'>
(
<tt>Error</tt>
)
</span>
&mdash;
<span class='desc'>the error instance </span>
</li>
<li>
<span class='name'>exit</span>
<span class='type'>
(
<tt>Boolean</tt>
)
</span>
&mdash;
<span class='desc'>whether to exit or not (defaults to true) </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,183 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>helpers</span>
&raquo;
<span class='title'>helpers.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
helpers.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;helpers</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#prefixObjectValuesWithPath-'>
~
(void)
<b>prefixObjectValuesWithPath</b><span>(prefix, object)</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Prefix relative value paths with another path <pre><code>object = dataPrefix: &#39;resin&#39;
object = prefixObjectValuesWithPath(&#39;/opt&#39;, object)
console.log(object.dataPrefix)
</code></pre>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='prefixObjectValuesWithPath-'>
~
(void)
<b>prefixObjectValuesWithPath</b><span>(prefix, object)</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
Absolute values will be omitted
</div>
<p>Prefix relative value paths with another path</p><pre><code>object = dataPrefix: &#39;resin&#39;
object = prefixObjectValuesWithPath(&#39;/opt&#39;, object)
console.log(object.dataPrefix) # /opt/resin
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>prefix</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>path prefix </span>
</li>
<li>
<span class='name'>object</span>
<span class='type'>
(
<tt>Object</tt>
)
</span>
&mdash;
<span class='desc'>object containing relative paths as values </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,136 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../javascript/application.js'></script>
<script src='../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>index.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
index.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin</td>
</tr>
</table>
<h2>Variables Summary</h2>
<dl class='constants'>
<dt id='module.exports-variable'>
module.exports
=
</dt>
<dd>
<pre><code class='coffeescript'>{
server: require(&#39;.&#47;server&#47;server&#39;),
models: require(&#39;.&#47;models&#39;),
log: require(&#39;.&#47;log&#47;log&#39;),
errors: require(&#39;.&#47;errors&#47;errors&#39;),
token: require(&#39;.&#47;token&#47;token&#39;),
data: require(&#39;.&#47;data&#47;data&#39;),
auth: require(&#39;.&#47;auth&#47;auth&#39;),
device: require(&#39;.&#47;device&#47;device&#39;),
os: require(&#39;.&#47;os&#47;os&#39;),
vcs: require(&#39;.&#47;vcs&#47;vcs&#39;),
settings: require(&#39;.&#47;settings&#39;)
}</code></pre>
</dd>
</dl>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,426 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>log</span>
&raquo;
<span class='title'>log.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
log.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;log</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#setQuiet-'>
~
(void)
<b>setQuiet</b><span>(quiet)</span>
</a>
</span>
<span class='desc'>
Change log quietness <pre><code>resin.log.setQuiet(true)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#isQuiet-'>
~
(Boolean)
<b>isQuiet</b><span>()</span>
</a>
</span>
<span class='desc'>
Check quietness <pre><code>resin.log.isQuiet()
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#error-'>
~
(void)
<b>error</b><span>(args...)</span>
</a>
</span>
<span class='desc'>
Log an error <pre><code>resin.log.error(&#39;Something went wrong!&#39;)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#warning-'>
~
(void)
<b>warning</b><span>(args...)</span>
</a>
</span>
<span class='desc'>
Log a warning <pre><code>resin.log.warning(&#39;Something might happened!&#39;)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#info-'>
~
(void)
<b>info</b><span>(args...)</span>
</a>
</span>
<span class='desc'>
Log info <pre><code>resin.log.info(&#39;Look!&#39;)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#out-'>
~
(void)
<b>out</b><span>(args...)</span>
</a>
</span>
<span class='desc'>
Log out <pre><code>resin.log.out(&#39;Hello World!&#39;)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#array-'>
~
(void)
<b>array</b><span>(array, logFunction)</span>
</a>
</span>
<span class='desc'>
Log an array <p>It will iterate trough the array, calling logFunction for every item</p>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='setQuiet-'>
~
(void)
<b>setQuiet</b><span>(quiet)</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
If quiet is true, only resin.log.info will be quieted
</div>
<p>Change log quietness</p><pre><code>resin.log.setQuiet(true)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>quiet</span>
<span class='type'>
(
<tt>Boolean</tt>
)
</span>
&mdash;
<span class='desc'>quietness </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='isQuiet-'>
~
(Boolean)
<b>isQuiet</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Check quietness</p><pre><code>resin.log.isQuiet()
</code></pre>
</div>
<div class='tags'>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>Boolean</tt>
)
&mdash;
<span class='desc'>is quiet </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='error-'>
~
(void)
<b>error</b><span>(args...)</span>
<br>
</p>
<div class='docstring'>
<p>Log an error</p><pre><code>resin.log.error(&#39;Something went wrong!&#39;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>message</span>
<span class='type'>
(
<tt>...String</tt>
)
</span>
&mdash;
<span class='desc'>message </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='warning-'>
~
(void)
<b>warning</b><span>(args...)</span>
<br>
</p>
<div class='docstring'>
<p>Log a warning</p><pre><code>resin.log.warning(&#39;Something might happened!&#39;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>message</span>
<span class='type'>
(
<tt>...String</tt>
)
</span>
&mdash;
<span class='desc'>message </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='info-'>
~
(void)
<b>info</b><span>(args...)</span>
<br>
</p>
<div class='docstring'>
<p>Log info</p><pre><code>resin.log.info(&#39;Look!&#39;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>message</span>
<span class='type'>
(
<tt>...String</tt>
)
</span>
&mdash;
<span class='desc'>message </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='out-'>
~
(void)
<b>out</b><span>(args...)</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
This will not be quieted even if setQuiet is set to true
</div>
<p>Log out</p><pre><code>resin.log.out(&#39;Hello World!&#39;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>message</span>
<span class='type'>
(
<tt>...String</tt>
)
</span>
&mdash;
<span class='desc'>message </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='array-'>
~
(void)
<b>array</b><span>(array, logFunction)</span>
<br>
</p>
<div class='docstring'>
<p>Log an array</p><p>It will iterate trough the array, calling logFunction for every item</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>array</span>
<span class='type'>
(
<tt>Array</tt>
)
</span>
&mdash;
<span class='desc'>array </span>
</li>
<li>
<span class='name'>logFunction</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>log function (e.g: resin.log.info) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt>Error</tt>
)
&mdash;
<span class='desc'>Will throw if logFunction is not a function </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,125 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>models</span>
&raquo;
<span class='title'>_pine.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
_pine.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;models</td>
</tr>
<tr>
<td>
Classes:
</td>
<td>
<a href='../../../../class/PinejsClientRequest.html'>
PinejsClientRequest
</a>
</td>
</tr>
</table>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,404 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>models</span>
&raquo;
<span class='title'>application.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
application.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;models</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#getAll-'>
~
(void)
<b>getAll</b><span>(callback)</span>
</a>
</span>
<span class='desc'>
Get all applications <pre><code>resin.models.application.getAll (error, applications) -&gt; throw error if error? console.log(applications)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#get-'>
~
(void)
<b>get</b><span>(id, callback)</span>
</a>
</span>
<span class='desc'>
Get a single application <pre><code>resin.models.application.get 51, (error, application) -&gt; throw error if error? console.log(application)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#create-'>
~
(void)
<b>create</b><span>(name, deviceType, callback)</span>
</a>
</span>
<span class='desc'>
Create an application <pre><code>resin.models.application.create &#39;My App&#39;, &#39;raspberry-pi&#39;, (error, id) -&gt; throw error if error? console.log(id)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#remove-'>
~
(void)
<b>remove</b><span>(id, callback)</span>
</a>
</span>
<span class='desc'>
Remove application <pre><code>resin.models.application.remove 51, (error) -&gt; throw error if error?
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#restart-'>
~
(void)
<b>restart</b><span>(id, callback)</span>
</a>
</span>
<span class='desc'>
Restart application <pre><code>resin.models.application.restart 51, (error) -&gt; throw error if error?
</code></pre>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='getAll-'>
~
(void)
<b>getAll</b><span>(callback)</span>
<br>
</p>
<div class='docstring'>
<p>Get all applications</p><pre><code>resin.models.application.getAll (error, applications) -&gt; throw error if error? console.log(applications)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, applications) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt><a href='../../../../class/NotAny.html'>NotAny</a></tt>
)
&mdash;
<span class='desc'>Will throw if no applications were found </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='get-'>
~
(void)
<b>get</b><span>(id, callback)</span>
<br>
</p>
<div class='docstring'>
<p>Get a single application</p><pre><code>resin.models.application.get 51, (error, application) -&gt; throw error if error? console.log(application)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>id</span>
<span class='type'>
(
<tt>String, Number</tt>
)
</span>
&mdash;
<span class='desc'>application id </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, application) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt><a href='../../../../class/NotFound.html'>NotFound</a></tt>
)
&mdash;
<span class='desc'>Will throw if application was not found </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='create-'>
~
(void)
<b>create</b><span>(name, deviceType, callback)</span>
<br>
</p>
<div class='docstring'>
<p>Create an application</p><pre><code>resin.models.application.create &#39;My App&#39;, &#39;raspberry-pi&#39;, (error, id) -&gt; throw error if error? console.log(id)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>name</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>application name </span>
</li>
<li>
<span class='name'>deviceType</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>device type (slug form) </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, id) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt><a href='../../../../class/NotFound.html'>NotFound</a></tt>
)
&mdash;
<span class='desc'>Will throw if the request doesn&#39;t returns an id </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='remove-'>
~
(void)
<b>remove</b><span>(id, callback)</span>
<br>
</p>
<div class='docstring'>
<p>Remove application</p><pre><code>resin.models.application.remove 51, (error) -&gt; throw error if error?
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>id</span>
<span class='type'>
(
<tt>String, Number</tt>
)
</span>
&mdash;
<span class='desc'>application id </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error) </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='restart-'>
~
(void)
<b>restart</b><span>(id, callback)</span>
<br>
</p>
<div class='docstring'>
<p>Restart application</p><pre><code>resin.models.application.restart 51, (error) -&gt; throw error if error?
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>id</span>
<span class='type'>
(
<tt>String, Number</tt>
)
</span>
&mdash;
<span class='desc'>application id </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error) </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,394 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>models</span>
&raquo;
<span class='title'>device.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
device.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;models</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#getAll-'>
~
(void)
<b>getAll</b><span>(callback)</span>
</a>
</span>
<span class='desc'>
Get all devices <pre><code>resin.models.devices.getAll (error, devices) -&gt; throw error if error? console.log(devices)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#getAllByApplication-'>
~
(void)
<b>getAllByApplication</b><span>(applicationId, callback)</span>
</a>
</span>
<span class='desc'>
Get all devices by application <pre><code>resin.models.devices.getAllByApplication (error, devices) -&gt; throw error if error? console.log(devices)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#get-'>
~
(void)
<b>get</b><span>(deviceId, callback)</span>
</a>
</span>
<span class='desc'>
Get a single device <pre><code>resin.models.device.get 51, (error, device) -&gt; throw error if error? console.log(device)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#remove-'>
~
(void)
<b>remove</b><span>(id, callback)</span>
</a>
</span>
<span class='desc'>
Remove device <pre><code>resin.models.device.remove 51, (error) -&gt; throw error if error?
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#identify-'>
~
(void)
<b>identify</b><span>(uuid, callback)</span>
</a>
</span>
<span class='desc'>
Identify device <pre><code>resin.models.device.identify &#39;23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a21369ac0f00db828&#39;, (error) -&gt; throw error if error?
</code></pre>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='getAll-'>
~
(void)
<b>getAll</b><span>(callback)</span>
<br>
</p>
<div class='docstring'>
<p>Get all devices</p><pre><code>resin.models.devices.getAll (error, devices) -&gt; throw error if error? console.log(devices)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, devices) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt><a href='../../../../class/NotAny.html'>NotAny</a></tt>
)
&mdash;
<span class='desc'>Will throw if no devices were found </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='getAllByApplication-'>
~
(void)
<b>getAllByApplication</b><span>(applicationId, callback)</span>
<br>
</p>
<div class='docstring'>
<p>Get all devices by application</p><pre><code>resin.models.devices.getAllByApplication (error, devices) -&gt; throw error if error? console.log(devices)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>applicationId</span>
<span class='type'>
(
<tt>String, Number</tt>
)
</span>
&mdash;
<span class='desc'>application id </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, devices) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt><a href='../../../../class/NotAny.html'>NotAny</a></tt>
)
&mdash;
<span class='desc'>Will throw if no devices were found </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='get-'>
~
(void)
<b>get</b><span>(deviceId, callback)</span>
<br>
</p>
<div class='docstring'>
<p>Get a single device</p><pre><code>resin.models.device.get 51, (error, device) -&gt; throw error if error? console.log(device)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>id</span>
<span class='type'>
(
<tt>String, Number</tt>
)
</span>
&mdash;
<span class='desc'>device id </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, device) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt><a href='../../../../class/NotFound.html'>NotFound</a></tt>
)
&mdash;
<span class='desc'>Will throw if device was not found </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='remove-'>
~
(void)
<b>remove</b><span>(id, callback)</span>
<br>
</p>
<div class='docstring'>
<p>Remove device</p><pre><code>resin.models.device.remove 51, (error) -&gt; throw error if error?
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>id</span>
<span class='type'>
(
<tt>String, Number</tt>
)
</span>
&mdash;
<span class='desc'>device id </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error) </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='identify-'>
~
(void)
<b>identify</b><span>(uuid, callback)</span>
<br>
</p>
<div class='docstring'>
<p>Identify device</p><pre><code>resin.models.device.identify &#39;23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a21369ac0f00db828&#39;, (error) -&gt; throw error if error?
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>uuid</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>device uuid </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error) </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,232 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>models</span>
&raquo;
<span class='title'>environment-variables.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
environment-variables.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;models</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#getAllByApplication-'>
~
(void)
<b>getAllByApplication</b><span>(applicationId, callback)</span>
</a>
</span>
<span class='desc'>
Get all environment variables by application <pre><code>resin.models.environmentVariables.getAll (error, environmentVariables) -&gt; throw error if error? console.log(environmentVariables)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#remove-'>
~
(void)
<b>remove</b><span>(id, callback)</span>
</a>
</span>
<span class='desc'>
Remove environment variable <pre><code>resin.models.environmentVariables.remove 51, (error) -&gt; throw error if error?
</code></pre>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='getAllByApplication-'>
~
(void)
<b>getAllByApplication</b><span>(applicationId, callback)</span>
<br>
</p>
<div class='docstring'>
<p>Get all environment variables by application</p><pre><code>resin.models.environmentVariables.getAll (error, environmentVariables) -&gt; throw error if error? console.log(environmentVariables)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>applicationId</span>
<span class='type'>
(
<tt>String, Number</tt>
)
</span>
&mdash;
<span class='desc'>application id </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, environmentVariables) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt><a href='../../../../class/NotFound.html'>NotFound</a></tt>
)
&mdash;
<span class='desc'>Will throw if no environment variable was found </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='remove-'>
~
(void)
<b>remove</b><span>(id, callback)</span>
<br>
</p>
<div class='docstring'>
<p>Remove environment variable</p><pre><code>resin.models.environmentVariables.remove 51, (error) -&gt; throw error if error?
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>id</span>
<span class='type'>
(
<tt>String, Number</tt>
)
</span>
&mdash;
<span class='desc'>environment variable id </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error) </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,130 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>models</span>
&raquo;
<span class='title'>index.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
index.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;models</td>
</tr>
</table>
<h2>Variables Summary</h2>
<dl class='constants'>
<dt id='module.exports-variable'>
module.exports
=
</dt>
<dd>
<pre><code class='coffeescript'>{
application: require(&#39;.&#47;application&#39;),
device: require(&#39;.&#47;device&#39;),
environmentVariables: require(&#39;.&#47;environment-variables&#39;)
}</code></pre>
</dd>
</dl>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,234 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>os</span>
&raquo;
<span class='title'>os.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
os.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;os</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#generateCacheName-'>
~
(String)
<b>generateCacheName</b><span>(id, connectionParams)</span>
</a>
</span>
<span class='desc'>
Generate os cache name <p>It generates an unique name for a certain instance of the os
with id and connection params embedded in the filename.</p>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='generateCacheName-'>
~
(String)
<b>generateCacheName</b><span>(id, connectionParams)</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
For security reasons, the wifiSsid is omitted from the filename
</div>
<div class='note'>
<strong>Note:</strong>
The original filename extension (*.zip in this case) is lost in the renaming process
</div>
<p>Generate os cache name</p><p>It generates an unique name for a certain instance of the os
with id and connection params embedded in the filename.</p><pre><code>result = resin.os.generateCacheName(51, { network: &#39;ethernet&#39; })
console.log(result)
# 51-ethernet-1418040928724
result = resin.os.generateCacheName(51, { network: &#39;wifi&#39; wifiKey: &#39;MyWifi&#39; wifiSsid: &#39;secret&#39;
})
console.log(result)
# 51-wifi-MyWifi-1418040928724
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>id</span>
<span class='type'>
(
<tt>String, Number</tt>
)
</span>
&mdash;
<span class='desc'>application id </span>
</li>
<li>
<span class='name'>connectionParams</span>
<span class='type'>
(
<tt>Object</tt>
)
</span>
&mdash;
<span class='desc'>connection parameters </span>
</li>
</ul>
<h3>
Options Hash:
(connectionParams):
</h3>
<ul class='options'>
<li>
<span class='name'>network</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>network type </span>
</li>
<li>
<span class='name'>wifiKey</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>wifi key </span>
</li>
<li>
<span class='name'>wifiSsid</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>wifi ssid </span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>String</tt>
)
&mdash;
<span class='desc'>os cache name </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,182 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../../javascript/application.js'></script>
<script src='../../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>os</span>
&raquo;
<span class='title'>windows</span>
&raquo;
<span class='title'>windows.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
windows.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;os&#47;windows</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#parseWmicDiskDriveGet-'>
~
(Object)
<b>parseWmicDiskDriveGet</b><span>(output)</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Parse wmic diskdrive get output <pre><code>result = resin.os.windows.parseWmicDiskDriveGet(output)
for item in result console.log(&quot;#{item.id} - #{item.caption}&quot;)
</code></pre>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='parseWmicDiskDriveGet-'>
~
(Object)
<b>parseWmicDiskDriveGet</b><span>(output)</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
This only parses output from <code>wmic diskdrive get DeviceID, Caption</code>
</div>
<p>Parse wmic diskdrive get output</p><pre><code>result = resin.os.windows.parseWmicDiskDriveGet(output)
for item in result console.log(&quot;#{item.id} - #{item.caption}&quot;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>output</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>wmic diskdrive get DeviceID, Caption output </span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>Object</tt>
)
&mdash;
<span class='desc'>parsed result containing id and caption </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,305 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>server</span>
&raquo;
<span class='title'>server.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
server.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;server</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#request-'>
~
(void)
<b>request</b><span>(options = {}, outerCallback, onProgress)</span>
</a>
</span>
<span class='desc'>
Send an HTTP request to resin.io <pre><code>resin.server.request { method: &#39;GET&#39; url: &#39;/foobar&#39;
}, (error, response, body) -&gt; throw error if error? console.log(body)
resin.server.request { method: &#39;POST&#39; url: &#39;/foobar&#39; json:
name: &#39;My FooBar&#39;
}, (error, response, body) -&gt; throw error if error? assert(response.statusCode is 201)
resin.server.request { method: &#39;GET&#39; url: &#39;/download&#39; pipe: fs.createWriteStream(&#39;/tmp/download&#39;)
}, (error) -&gt; throw error if error?
, (state) -&gt; console.log(&quot;Received: #{state.received}&quot;) console.log(&quot;Total: #{state.total}&quot;) console.log(&quot;Is Complete? #{state.complete}&quot;)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#createFacadeFunction-'>
~
(void)
<b>createFacadeFunction</b><span>(method)</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Generate shorthand functions for every method
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='request-'>
~
(void)
<b>request</b><span>(options = {}, outerCallback, onProgress)</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
If the user is logged in, the token gets automatically added to Authorization header
</div>
<div class='note'>
<strong>Note:</strong>
If the response is JSON, it will attempt to parse it
</div>
<p>Send an HTTP request to resin.io</p><pre><code>resin.server.request { method: &#39;GET&#39; url: &#39;/foobar&#39;
}, (error, response, body) -&gt; throw error if error? console.log(body)
resin.server.request { method: &#39;POST&#39; url: &#39;/foobar&#39; json:
name: &#39;My FooBar&#39;
}, (error, response, body) -&gt; throw error if error? assert(response.statusCode is 201)
resin.server.request { method: &#39;GET&#39; url: &#39;/download&#39; pipe: fs.createWriteStream(&#39;/tmp/download&#39;)
}, (error) -&gt; throw error if error?
, (state) -&gt; console.log(&quot;Received: #{state.received}&quot;) console.log(&quot;Total: #{state.total}&quot;) console.log(&quot;Is Complete? #{state.complete}&quot;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>options</span>
<span class='type'>
(
<tt>Object</tt>
)
</span>
&mdash;
<span class='desc'>request options </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, response, body) </span>
</li>
<li>
<span class='name'>onProgress</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>on progress callback(state) (optional) </span>
</li>
</ul>
<h3>
Options Hash:
(options):
</h3>
<ul class='options'>
<li>
<span class='name'>url</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>relative url </span>
</li>
<li>
<span class='name'>json</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>request body </span>
</li>
<li>
<span class='name'>method</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>HTTP method </span>
</li>
<li>
<span class='name'>headers</span>
<span class='type'>
(
<tt>Object</tt>
)
</span>
&mdash;
<span class='desc'>custom HTTP headers </span>
</li>
<li>
<span class='name'>pipe</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>define this function if you want to stream the response </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt>Error</tt>
)
&mdash;
<span class='desc'>Will throw if you don&#39;t have internet connection </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='createFacadeFunction-'>
~
(void)
<b>createFacadeFunction</b><span>(method)</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<div class='note todo'>
<strong>TODO:</strong>
Find a way to document all of the methods directly
</div>
<p>Generate shorthand functions for every method</p>
</div>
<div class='tags'>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,156 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../javascript/application.js'></script>
<script src='../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>settings.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
settings.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin</td>
</tr>
</table>
<h2>Variables Summary</h2>
<dl class='constants'>
<dt id='settings-variable'>
settings
=
</dt>
<dd>
<pre><code class='coffeescript'>{
remoteUrl: &#39;https:&#47;&#47;staging.resin.io&#39;,
apiPrefix: &#39;&#47;ewa&#47;&#39;,
dataPrefix: path.join(userHome, &#39;.resin&#39;),
sshKeyWidth: 43,
gitRemote: &#39;resin&#39;,
directories: {
plugins: &#39;plugins&#39;,
os: &#39;os&#39;
},
localConfig: &#39;.resinconf&#39;,
files: {
config: &#39;config&#39;
},
pubnub: {
subscribe_key: &#39;sub-c-bbc12eba-ce4a-11e3-9782-02ee2ddab7fe&#39;,
publish_key: &#39;pub-c-6cbce8db-bfd1-4fdf-a8c8-53671ae2b226&#39;,
ssl: true
},
events: {
deviceLogs: &#39;device-&lt;%= uuid %&gt;-logs&#39;
},
urls: {
signup: &#39;&#47;signup&#39;,
preferences: &#39;&#47;preferences&#39;,
keys: &#39;&#47;user&#47;keys&#39;,
identify: &#39;&#47;blink&#39;,
authenticate: &#39;&#47;login_&#39;,
applicationRestart: &#39;&#47;application&#47;&lt;%= id %&gt;&#47;restart&#39;,
sshKey: &#39;&#47;user&#47;keys&#47;&lt;%= id %&gt;&#39;,
download: &#39;&#47;download&#39;
}
}</code></pre>
</dd>
</dl>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,313 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>token</span>
&raquo;
<span class='title'>token.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
token.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;token</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#saveToken-'>
~
(void)
<b>saveToken</b><span>(newToken, callback)</span>
</a>
</span>
<span class='desc'>
Save token <p>The token is saved to $(dataPrefix)/token, which usually equals to $HOME/.resin/token</p><pre><code>resin.token.saveToken myToken, (error) -&gt; throw error if error?
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#hasToken-'>
~
(void)
<b>hasToken</b><span>(callback)</span>
</a>
</span>
<span class='desc'>
Check if we have any token saved <pre><code>resin.token.hasToken (hasToken) -&gt; if hasToken
console.log(&#39;It\&#39;s there!&#39;) else
console.log(&#39;It\&#39;s not there!&#39;)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#getToken-'>
~
(void)
<b>getToken</b><span>(callback)</span>
</a>
</span>
<span class='desc'>
Get saved token value <pre><code>resin.token.getToken (error, token) -&gt; throw error if error? if token?
console.log(&quot;My token is: #{token}&quot;)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#clearToken-'>
~
(void)
<b>clearToken</b><span>(callback)</span>
</a>
</span>
<span class='desc'>
Remove token from the filesystem <pre><code>resin.token.clearToken (error) -&gt; throw error if error?
</code></pre>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='saveToken-'>
~
(void)
<b>saveToken</b><span>(newToken, callback)</span>
<br>
</p>
<div class='docstring'>
<div class='note todo'>
<strong>TODO:</strong>
We should make the token more secure
</div>
<div class='note'>
<strong>Note:</strong>
The token is saved as plain text.
</div>
<p>Save token</p><p>The token is saved to $(dataPrefix)/token, which usually equals to $HOME/.resin/token</p><pre><code>resin.token.saveToken myToken, (error) -&gt; throw error if error?
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>newToken</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the token </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error) </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='hasToken-'>
~
(void)
<b>hasToken</b><span>(callback)</span>
<br>
</p>
<div class='docstring'>
<p>Check if we have any token saved</p><pre><code>resin.token.hasToken (hasToken) -&gt; if hasToken
console.log(&#39;It\&#39;s there!&#39;) else
console.log(&#39;It\&#39;s not there!&#39;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(hasToken) </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='getToken-'>
~
(void)
<b>getToken</b><span>(callback)</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
If the key doesn&#39;t exist, undefined and no error is returned
</div>
<p>Get saved token value</p><pre><code>resin.token.getToken (error, token) -&gt; throw error if error? if token?
console.log(&quot;My token is: #{token}&quot;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, token) </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='clearToken-'>
~
(void)
<b>clearToken</b><span>(callback)</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
If the token doesn&#39;t exist, no action is performed
</div>
<p>Remove token from the filesystem</p><pre><code>resin.token.clearToken (error) -&gt; throw error if error?
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error) </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,745 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../../javascript/application.js'></script>
<script src='../../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>vcs</span>
&raquo;
<span class='title'>git</span>
&raquo;
<span class='title'>git.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
git.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;vcs&#47;git</td>
</tr>
</table>
<h2>Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#getGitDirectory-'>
~
(String)
<b>getGitDirectory</b><span>(directory)</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Get git directory for a certain path <p>By git directory, we mean the hidden .git folder that every git repository have</p><pre><code>result = getGitDirectory(&#39;/opt/projects/myapp&#39;)
console.log(result)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#getCurrentGitDirectory-'>
~
(String)
<b>getCurrentGitDirectory</b><span>()</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Get current git directory <p>Get the path to the .git directory in the current directory</p><pre><code>$ cd /Users/me/Projects/foobar &amp;&amp; resin ...
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#isGitRepository-'>
~
(void)
<b>isGitRepository</b><span>(directory, callback)</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Check if a directory is a git repository <pre><code>isGitRepository &#39;my/git/repo&#39;, (error, isGitRepository) -&gt; throw error if error? if isGitRepository
console.log(&#39;Yes, it\&#39;s a git repo!&#39;) else
console.log(&#39;I should use git here!&#39;)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#getRepositoryInstance-'>
~
(void)
<b>getRepositoryInstance</b><span>(directory, callback)</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Get repository instance <p>An instance of a <a href="https://github.com/tuvistavie/node-git-cli">gitCli</a> repository, for internal usage.</p>
</span>
</li>
<li>
<span class='signature'>
<a href='#isValidGitApplication-'>
~
(Boolean)
<b>isValidGitApplication</b><span>(application)</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Check if an application is a git app <pre><code>resin.models.application.get 91, (error, application) -&gt; throw error if error? result = isValidGitApplication(application) console.log(result)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#hasRemote-'>
~
(void)
<b>hasRemote</b><span>(repository, name, callback)</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Check if a repository has a certain remote <pre><code>repository = getRepositoryInstance(&#39;my/git/repo&#39;)
hasRemote repository, &#39;origin&#39;, (error, hasRemote) -&gt; throw error if error? if hasRemote
console.log(&#39;It has an origin remote!&#39;) else
console.log(&#39;It doesn\&#39;t has an origin remote!&#39;)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#addRemote-'>
~
(void)
<b>addRemote</b><span>(repository, name, url, callback)</span>
</a>
</span>
<span class='note private title'>Private</span>
<span class='desc'>
Add a remote to a git repository <pre><code>repository = getRepositoryInstance(&#39;my/git/repo&#39;)
addRemote repository, &#39;resin&#39;, &#39;git@git.resin.io:johndoe/app.git&#39;, (error) -&gt; throw error if error?
$ cd my/git/repo &amp;&amp; git remote -v
resin git@git.resin.io:johndoe/app.git (fetch)
resin git@git.resin.io:johndoe/app.git (push)
</code></pre>
</span>
</li>
<li>
<span class='signature'>
<a href='#initProjectWithApplication-'>
~
(void)
<b>initProjectWithApplication</b><span>(application, directory, callback)</span>
</a>
</span>
<span class='desc'>
Initialize an application project <ul>
<li>Add the corresponding git remote.</li>
</ul>
</span>
</li>
<li>
<span class='signature'>
<a href='#isResinProject-'>
~
(void)
<b>isResinProject</b><span>(directory, callback)</span>
</a>
</span>
<span class='desc'>
Check if an application was already initialized <p>It checks if we have a resin remote added already.</p>
</span>
</li>
</ul>
<h2>Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='getGitDirectory-'>
~
(String)
<b>getGitDirectory</b><span>(directory)</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
This function doesn&#39;t check if the path is valid, it only constructs it.
</div>
<p>Get git directory for a certain path</p><p>By git directory, we mean the hidden .git folder that every git repository have</p><pre><code>result = getGitDirectory(&#39;/opt/projects/myapp&#39;)
console.log(result)
# /opt/projects/myapp/.git
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>directory</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the directory path </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt>Error</tt>
)
&mdash;
<span class='desc'>Will throw if directory is not a string </span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>String</tt>
)
&mdash;
<span class='desc'>the absolute path to the child .git directory </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='getCurrentGitDirectory-'>
~
(String)
<b>getCurrentGitDirectory</b><span>()</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<div class='note'>
<strong>Note:</strong>
The current directory is determined by from where you ran the app
</div>
<p>Get current git directory</p><p>Get the path to the .git directory in the current directory</p><pre><code>$ cd /Users/me/Projects/foobar &amp;&amp; resin ...
result = getCurrentGitDirectory()
console.log(result)
# /Users/me/Projects/foobar/.git
</code></pre>
</div>
<div class='tags'>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>String</tt>
)
&mdash;
<span class='desc'>the absolute path to the current directory&#39;s .git folder </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='isGitRepository-'>
~
(void)
<b>isGitRepository</b><span>(directory, callback)</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<p>Check if a directory is a git repository</p><pre><code>isGitRepository &#39;my/git/repo&#39;, (error, isGitRepository) -&gt; throw error if error? if isGitRepository
console.log(&#39;Yes, it\&#39;s a git repo!&#39;) else
console.log(&#39;I should use git here!&#39;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>directory</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the directory </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, isGitRepository) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt><a href='../../../../../class/DirectoryDoesntExist.html'>DirectoryDoesntExist</a></tt>
)
&mdash;
<span class='desc'>Will throw if directory doesn&#39;t exist </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='getRepositoryInstance-'>
~
(void)
<b>getRepositoryInstance</b><span>(directory, callback)</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<p>Get repository instance</p><p>An instance of a <a href="https://github.com/tuvistavie/node-git-cli">gitCli</a> repository, for internal usage.</p><pre><code>getRepositoryInstance &#39;my/git/repo&#39;, (error, repository) -&gt; throw error if error? # I can now use gitCli functions on `repository`
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>directory</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the directory </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, repository) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt>Error</tt>
)
&mdash;
<span class='desc'>Will throw if directory is not a git repository. </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='isValidGitApplication-'>
~
(Boolean)
<b>isValidGitApplication</b><span>(application)</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<div class='note todo'>
<strong>TODO:</strong>
We should also test that the string contained in git_repository is a valid url.
</div>
<div class='note'>
<strong>Note:</strong>
All it does is check if the application object contains a valid git_repository field.
</div>
<p>Check if an application is a git app</p><pre><code>resin.models.application.get 91, (error, application) -&gt; throw error if error? result = isValidGitApplication(application) console.log(result) # True
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>application</span>
<span class='type'>
(
<tt>Object</tt>
)
</span>
&mdash;
<span class='desc'>an application from resin API </span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>Boolean</tt>
)
&mdash;
<span class='desc'>wheter is a valid git application or not </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='hasRemote-'>
~
(void)
<b>hasRemote</b><span>(repository, name, callback)</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<div class='note todo'>
<strong>TODO:</strong>
We should extract the logic that lists all remotes into a separate function.
</div>
<p>Check if a repository has a certain remote</p><pre><code>repository = getRepositoryInstance(&#39;my/git/repo&#39;)
hasRemote repository, &#39;origin&#39;, (error, hasRemote) -&gt; throw error if error? if hasRemote
console.log(&#39;It has an origin remote!&#39;) else
console.log(&#39;It doesn\&#39;t has an origin remote!&#39;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>repository</span>
<span class='type'>
(
<tt>Object</tt>
)
</span>
&mdash;
<span class='desc'>a repository instance from getRepositoryInstance() </span>
</li>
<li>
<span class='name'>name</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the name of the remote to check for </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, hasRemote) </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='addRemote-'>
~
(void)
<b>addRemote</b><span>(repository, name, url, callback)</span>
<span class='note private'>Private</span>
<br>
</p>
<div class='docstring'>
<div class='note todo'>
<strong>TODO:</strong>
We should check the validity of all arguments.
</div>
<div class='note todo'>
<strong>TODO:</strong>
This function should be better tested
</div>
<p>Add a remote to a git repository</p><pre><code>repository = getRepositoryInstance(&#39;my/git/repo&#39;)
addRemote repository, &#39;resin&#39;, &#39;git@git.resin.io:johndoe/app.git&#39;, (error) -&gt; throw error if error?
$ cd my/git/repo &amp;&amp; git remote -v
resin git@git.resin.io:johndoe/app.git (fetch)
resin git@git.resin.io:johndoe/app.git (push)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>repository</span>
<span class='type'>
(
<tt>Object</tt>
)
</span>
&mdash;
<span class='desc'>a repository instance from getRepositoryInstance() </span>
</li>
<li>
<span class='name'>name</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the name of the remote to add </span>
</li>
<li>
<span class='name'>url</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>url of the new remote </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt>Error</tt>
)
&mdash;
<span class='desc'>Will throw if name is not a string </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='initProjectWithApplication-'>
~
(void)
<b>initProjectWithApplication</b><span>(application, directory, callback)</span>
<br>
</p>
<div class='docstring'>
<div class='note todo'>
<strong>TODO:</strong>
This function should be better tested
</div>
<div class='note'>
<strong>Note:</strong>
The directory should already be a git repo (maybe we should take care of git init as well here if necessary?)
</div>
<p>Initialize an application project</p><ul>
<li>Add the corresponding git remote.</li>
</ul>
<pre><code>resin.models.application.get 91, (error, application) -&gt; throw error if error?
initProjectWithApplication application, &#39;my/new/project&#39;, (error) -&gt;
throw error if error?
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>application</span>
<span class='type'>
(
<tt>Object</tt>
)
</span>
&mdash;
<span class='desc'>an application from resin API </span>
</li>
<li>
<span class='name'>directory</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the directory to initialize </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt>Error</tt>
)
&mdash;
<span class='desc'>Will throw if application is not a valid application </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='isResinProject-'>
~
(void)
<b>isResinProject</b><span>(directory, callback)</span>
<br>
</p>
<div class='docstring'>
<div class='note todo'>
<strong>TODO:</strong>
Find a way to test this function
</div>
<p>Check if an application was already initialized</p><p>It checks if we have a resin remote added already.</p><pre><code>isResinProject &#39;my/resin/app&#39;, (error, initialized) -&gt; if initialized
console.log(&#39;It\&#39;s already a resin app!&#39;) else
console.log(&#39;It\&#39;s just a boring project! It should be resinified!&#39;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>directory</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the directory </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, isResinProject) </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,230 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../../../../javascript/application.js'></script>
<script src='../../../../javascript/search.js'></script>
<link rel='stylesheet' href='../../../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../../../extra/README.md.html' title='Resin'>
Resin
</a>
&raquo;
<a href='../../../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>lib</span>
&raquo;
<span class='title'>resin</span>
&raquo;
<span class='title'>vcs</span>
&raquo;
<span class='title'>vcs.coffee</span>
</div>
</div>
<div id='content'>
<h1>
File:
vcs.coffee
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>lib&#47;resin&#47;vcs</td>
</tr>
</table>
<h2>Variables Summary</h2>
<dl class='constants'>
<dt id='exports.initProjectWithApplication-variable'>
exports.initProjectWithApplication
=
</dt>
<dd>
<pre><code class='coffeescript'>git</code></pre>
<div class='docstring'>
<div class='note todo'>
<strong>TODO:</strong>
This function should be better tested
</div>
<div class='note'>
<strong>Note:</strong>
The directory should already be a git repo (maybe we should take care of git init as well here if necessary?)
</div>
<p>Initialize an application project</p><ul>
<li>Add the corresponding git remote.</li>
</ul>
<pre><code>resin.models.application.get 91, (error, application) -&gt; throw error if error?
resin.vcs.initProjectWithApplication application, &#39;my/new/project&#39;, (error) -&gt;
throw error if error?
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>application</span>
<span class='type'>
(
<tt>Object</tt>
)
</span>
&mdash;
<span class='desc'>an application from resin API </span>
</li>
<li>
<span class='name'>directory</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the directory to initialize </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error) </span>
</li>
</ul>
<h3>Throws:</h3>
<ul class='throw'>
<li>
<span class='type'></span>
(
<tt>Error</tt>
)
&mdash;
<span class='desc'>Will throw if application is not a valid application </span>
</li>
</ul>
</div>
</dd>
<dt id='exports.isResinProject-variable'>
exports.isResinProject
=
</dt>
<dd>
<pre><code class='coffeescript'>git</code></pre>
<div class='docstring'>
<div class='note todo'>
<strong>TODO:</strong>
Find a way to test this function
</div>
<p>Check if an application was already initialized</p><p>It checks if we have a resin remote added already.</p><pre><code>resin.vcs.isResinProject &#39;my/resin/app&#39;, (error, initialized) -&gt; if initialized
console.log(&#39;It\&#39;s already a resin app!&#39;) else
console.log(&#39;It\&#39;s just a boring project! It should be resinified!&#39;)
</code></pre>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>directory</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
&mdash;
<span class='desc'>the directory </span>
</li>
<li>
<span class='name'>callback</span>
<span class='type'>
(
<tt>Function</tt>
)
</span>
&mdash;
<span class='desc'>callback(error, isResinProject) </span>
</li>
</ul>
</div>
</dd>
</dl>
</div>
<div id='footer'>
December 12, 14 09:26:32 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,332 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='javascript/application.js'></script>
<script src='javascript/search.js'></script>
<link rel='stylesheet' href='stylesheets/application.css' type='text/css'>
</head>
<body class='list'>
<div class='list tree' id='content'>
<h1 class='full_list_header'>File List</h1>
<nav>
<a target='_self' href='class_list.html'>
Classes
</a>
<a target='_self' href='file_list.html'>
Files
</a>
<a target='_self' href='method_list.html'>
Methods
</a>
<a target='_self' href='extra_list.html'>
Extras
</a>
</nav>
<div id='search'>
Search:
<input type='text'>
</div>
<ul>
<li>
<span>
lib
</span>
</li>
<ul>
<li>
<span>
resin
</span>
</li>
<ul>
<li>
<span>
auth
</span>
</li>
<ul>
<li>
<a href='file/lib/resin/auth/auth.coffee.html' target='main'>
auth.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;auth
</small>
</li>
</ul>
<li>
<span>
config
</span>
</li>
<ul>
<li>
<a href='file/lib/resin/config/config.coffee.html' target='main'>
config.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;config
</small>
</li>
</ul>
<li>
<span>
data
</span>
</li>
<ul>
<li>
<a href='file/lib/resin/data/data-prefix.coffee.html' target='main'>
data-prefix.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;data
</small>
</li>
<li>
<a href='file/lib/resin/data/data.coffee.html' target='main'>
data.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;data
</small>
</li>
</ul>
<li>
<span>
device
</span>
</li>
<ul>
<li>
<a href='file/lib/resin/device/device.coffee.html' target='main'>
device.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;device
</small>
</li>
</ul>
<li>
<span>
errors
</span>
</li>
<ul>
<li>
<a href='file/lib/resin/errors/errors.coffee.html' target='main'>
errors.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;errors
</small>
</li>
</ul>
<li>
<span>
helpers
</span>
</li>
<ul>
<li>
<a href='file/lib/resin/helpers/helpers.coffee.html' target='main'>
helpers.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;helpers
</small>
</li>
</ul>
<li>
<a href='file/lib/resin/index.coffee.html' target='main'>
index.coffee
</a>
<small class='namespace'>
lib&#47;resin
</small>
</li>
<li>
<span>
log
</span>
</li>
<ul>
<li>
<a href='file/lib/resin/log/log.coffee.html' target='main'>
log.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;log
</small>
</li>
</ul>
<li>
<span>
models
</span>
</li>
<ul>
<li>
<a href='file/lib/resin/models/_pine.coffee.html' target='main'>
_pine.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;models
</small>
</li>
<li>
<a href='file/lib/resin/models/application.coffee.html' target='main'>
application.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;models
</small>
</li>
<li>
<a href='file/lib/resin/models/device.coffee.html' target='main'>
device.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;models
</small>
</li>
<li>
<a href='file/lib/resin/models/environment-variables.coffee.html' target='main'>
environment-variables.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;models
</small>
</li>
<li>
<a href='file/lib/resin/models/index.coffee.html' target='main'>
index.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;models
</small>
</li>
</ul>
<li>
<span>
os
</span>
</li>
<ul>
<li>
<a href='file/lib/resin/os/os.coffee.html' target='main'>
os.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;os
</small>
</li>
<li>
<span>
windows
</span>
</li>
<ul>
<li>
<a href='file/lib/resin/os/windows/windows.coffee.html' target='main'>
windows.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;os&#47;windows
</small>
</li>
</ul>
</ul>
<li>
<span>
server
</span>
</li>
<ul>
<li>
<a href='file/lib/resin/server/server.coffee.html' target='main'>
server.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;server
</small>
</li>
</ul>
<li>
<a href='file/lib/resin/settings.coffee.html' target='main'>
settings.coffee
</a>
<small class='namespace'>
lib&#47;resin
</small>
</li>
<li>
<span>
token
</span>
</li>
<ul>
<li>
<a href='file/lib/resin/token/token.coffee.html' target='main'>
token.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;token
</small>
</li>
</ul>
<li>
<span>
vcs
</span>
</li>
<ul>
<li>
<span>
git
</span>
</li>
<ul>
<li>
<a href='file/lib/resin/vcs/git/git.coffee.html' target='main'>
git.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;vcs&#47;git
</small>
</li>
</ul>
<li>
<a href='file/lib/resin/vcs/vcs.coffee.html' target='main'>
vcs.coffee
</a>
<small class='namespace'>
lib&#47;resin&#47;vcs
</small>
</li>
</ul>
</ul>
</ul>
</ul>
</div>
</body>
</html>

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='javascript/application.js'></script>
<script src='javascript/search.js'></script>
<link rel='stylesheet' href='stylesheets/application.css' type='text/css'>
</head>
<frameset cols='25%, *'>
<frame name='list' src='class_list.html'></frame>
<frame name='main' src='extra/README.md.html'></frame>
</frameset>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,507 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='javascript/application.js'></script>
<script src='javascript/search.js'></script>
<link rel='stylesheet' href='stylesheets/application.css' type='text/css'>
</head>
<body class='list'>
<div class='list' id='content'>
<h1 class='full_list_header'>Method List</h1>
<nav>
<a target='_self' href='class_list.html'>
Classes
</a>
<a target='_self' href='file_list.html'>
Files
</a>
<a target='_self' href='method_list.html'>
Methods
</a>
<a target='_self' href='extra_list.html'>
Extras
</a>
</nav>
<div id='search'>
Search:
<input type='text'>
</div>
<ul>
<li>
<a href='class/PinejsClientRequest.html#_request-dynamic' target='main' title='_request'>
#_request
</a>
<small>
(PinejsClientRequest)
</small>
</li>
<li>
<a href='file/lib/resin/vcs/git/git.coffee.html#addRemote-' target='main' title='addRemote'>
~addRemote
</a>
<small>
(lib&#47;resin&#47;vcs&#47;git&#47;git.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/log/log.coffee.html#array-' target='main' title='array'>
~array
</a>
<small>
(lib&#47;resin&#47;log&#47;log.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/auth/auth.coffee.html#authenticate-' target='main' title='authenticate'>
~authenticate
</a>
<small>
(lib&#47;resin&#47;auth&#47;auth.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/data/data-prefix.coffee.html#clear-' target='main' title='clear'>
~clear
</a>
<small>
(lib&#47;resin&#47;data&#47;data-prefix.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/token/token.coffee.html#clearToken-' target='main' title='clearToken'>
~clearToken
</a>
<small>
(lib&#47;resin&#47;token&#47;token.coffee)
</small>
</li>
<li>
<a href='class/InvalidPath.html#constructor-dynamic' target='main' title='constructor'>
#constructor
</a>
<small>
(InvalidPath)
</small>
</li>
<li>
<a href='class/NotFound.html#constructor-dynamic' target='main' title='constructor'>
#constructor
</a>
<small>
(NotFound)
</small>
</li>
<li>
<a href='class/NotAny.html#constructor-dynamic' target='main' title='constructor'>
#constructor
</a>
<small>
(NotAny)
</small>
</li>
<li>
<a href='class/InvalidConfigFile.html#constructor-dynamic' target='main' title='constructor'>
#constructor
</a>
<small>
(InvalidConfigFile)
</small>
</li>
<li>
<a href='class/DirectoryDoesntExist.html#constructor-dynamic' target='main' title='constructor'>
#constructor
</a>
<small>
(DirectoryDoesntExist)
</small>
</li>
<li>
<a href='class/InvalidKey.html#constructor-dynamic' target='main' title='constructor'>
#constructor
</a>
<small>
(InvalidKey)
</small>
</li>
<li>
<a href='class/InvalidCredentials.html#constructor-dynamic' target='main' title='constructor'>
#constructor
</a>
<small>
(InvalidCredentials)
</small>
</li>
<li>
<a href='file/lib/resin/models/application.coffee.html#create-' target='main' title='create'>
~create
</a>
<small>
(lib&#47;resin&#47;models&#47;application.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/server/server.coffee.html#createFacadeFunction-' target='main' title='createFacadeFunction'>
~createFacadeFunction
</a>
<small>
(lib&#47;resin&#47;server&#47;server.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/log/log.coffee.html#error-' target='main' title='error'>
~error
</a>
<small>
(lib&#47;resin&#47;log&#47;log.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/os/os.coffee.html#generateCacheName-' target='main' title='generateCacheName'>
~generateCacheName
</a>
<small>
(lib&#47;resin&#47;os&#47;os.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/models/device.coffee.html#get-' target='main' title='get'>
~get
</a>
<small>
(lib&#47;resin&#47;models&#47;device.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/models/application.coffee.html#get-' target='main' title='get'>
~get
</a>
<small>
(lib&#47;resin&#47;models&#47;application.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/data/data-prefix.coffee.html#get-' target='main' title='get'>
~get
</a>
<small>
(lib&#47;resin&#47;data&#47;data-prefix.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/models/device.coffee.html#getAll-' target='main' title='getAll'>
~getAll
</a>
<small>
(lib&#47;resin&#47;models&#47;device.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/models/application.coffee.html#getAll-' target='main' title='getAll'>
~getAll
</a>
<small>
(lib&#47;resin&#47;models&#47;application.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/models/device.coffee.html#getAllByApplication-' target='main' title='getAllByApplication'>
~getAllByApplication
</a>
<small>
(lib&#47;resin&#47;models&#47;device.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/models/environment-variables.coffee.html#getAllByApplication-' target='main' title='getAllByApplication'>
~getAllByApplication
</a>
<small>
(lib&#47;resin&#47;models&#47;environment-variables.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/vcs/git/git.coffee.html#getCurrentGitDirectory-' target='main' title='getCurrentGitDirectory'>
~getCurrentGitDirectory
</a>
<small>
(lib&#47;resin&#47;vcs&#47;git&#47;git.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/device/device.coffee.html#getDeviceSlug-' target='main' title='getDeviceSlug'>
~getDeviceSlug
</a>
<small>
(lib&#47;resin&#47;device&#47;device.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/device/device.coffee.html#getDisplayName-' target='main' title='getDisplayName'>
~getDisplayName
</a>
<small>
(lib&#47;resin&#47;device&#47;device.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/vcs/git/git.coffee.html#getGitDirectory-' target='main' title='getGitDirectory'>
~getGitDirectory
</a>
<small>
(lib&#47;resin&#47;vcs&#47;git&#47;git.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/vcs/git/git.coffee.html#getRepositoryInstance-' target='main' title='getRepositoryInstance'>
~getRepositoryInstance
</a>
<small>
(lib&#47;resin&#47;vcs&#47;git&#47;git.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/device/device.coffee.html#getSupportedDevices-' target='main' title='getSupportedDevices'>
~getSupportedDevices
</a>
<small>
(lib&#47;resin&#47;device&#47;device.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/token/token.coffee.html#getToken-' target='main' title='getToken'>
~getToken
</a>
<small>
(lib&#47;resin&#47;token&#47;token.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/auth/auth.coffee.html#getToken-' target='main' title='getToken'>
~getToken
</a>
<small>
(lib&#47;resin&#47;auth&#47;auth.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/errors/errors.coffee.html#handle-' target='main' title='handle'>
~handle
</a>
<small>
(lib&#47;resin&#47;errors&#47;errors.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/vcs/git/git.coffee.html#hasRemote-' target='main' title='hasRemote'>
~hasRemote
</a>
<small>
(lib&#47;resin&#47;vcs&#47;git&#47;git.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/token/token.coffee.html#hasToken-' target='main' title='hasToken'>
~hasToken
</a>
<small>
(lib&#47;resin&#47;token&#47;token.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/models/device.coffee.html#identify-' target='main' title='identify'>
~identify
</a>
<small>
(lib&#47;resin&#47;models&#47;device.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/log/log.coffee.html#info-' target='main' title='info'>
~info
</a>
<small>
(lib&#47;resin&#47;log&#47;log.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/vcs/git/git.coffee.html#initProjectWithApplication-' target='main' title='initProjectWithApplication'>
~initProjectWithApplication
</a>
<small>
(lib&#47;resin&#47;vcs&#47;git&#47;git.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/vcs/git/git.coffee.html#isGitRepository-' target='main' title='isGitRepository'>
~isGitRepository
</a>
<small>
(lib&#47;resin&#47;vcs&#47;git&#47;git.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/auth/auth.coffee.html#isLoggedIn-' target='main' title='isLoggedIn'>
~isLoggedIn
</a>
<small>
(lib&#47;resin&#47;auth&#47;auth.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/log/log.coffee.html#isQuiet-' target='main' title='isQuiet'>
~isQuiet
</a>
<small>
(lib&#47;resin&#47;log&#47;log.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/vcs/git/git.coffee.html#isResinProject-' target='main' title='isResinProject'>
~isResinProject
</a>
<small>
(lib&#47;resin&#47;vcs&#47;git&#47;git.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/vcs/git/git.coffee.html#isValidGitApplication-' target='main' title='isValidGitApplication'>
~isValidGitApplication
</a>
<small>
(lib&#47;resin&#47;vcs&#47;git&#47;git.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/config/config.coffee.html#loadUserConfig-' target='main' title='loadUserConfig'>
~loadUserConfig
</a>
<small>
(lib&#47;resin&#47;config&#47;config.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/auth/auth.coffee.html#login-' target='main' title='login'>
~login
</a>
<small>
(lib&#47;resin&#47;auth&#47;auth.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/auth/auth.coffee.html#logout-' target='main' title='logout'>
~logout
</a>
<small>
(lib&#47;resin&#47;auth&#47;auth.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/log/log.coffee.html#out-' target='main' title='out'>
~out
</a>
<small>
(lib&#47;resin&#47;log&#47;log.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/auth/auth.coffee.html#parseCredentials-' target='main' title='parseCredentials'>
~parseCredentials
</a>
<small>
(lib&#47;resin&#47;auth&#47;auth.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/os/windows/windows.coffee.html#parseWmicDiskDriveGet-' target='main' title='parseWmicDiskDriveGet'>
~parseWmicDiskDriveGet
</a>
<small>
(lib&#47;resin&#47;os&#47;windows&#47;windows.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/helpers/helpers.coffee.html#prefixObjectValuesWithPath-' target='main' title='prefixObjectValuesWithPath'>
~prefixObjectValuesWithPath
</a>
<small>
(lib&#47;resin&#47;helpers&#47;helpers.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/models/device.coffee.html#remove-' target='main' title='remove'>
~remove
</a>
<small>
(lib&#47;resin&#47;models&#47;device.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/models/environment-variables.coffee.html#remove-' target='main' title='remove'>
~remove
</a>
<small>
(lib&#47;resin&#47;models&#47;environment-variables.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/models/application.coffee.html#remove-' target='main' title='remove'>
~remove
</a>
<small>
(lib&#47;resin&#47;models&#47;application.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/server/server.coffee.html#request-' target='main' title='request'>
~request
</a>
<small>
(lib&#47;resin&#47;server&#47;server.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/models/application.coffee.html#restart-' target='main' title='restart'>
~restart
</a>
<small>
(lib&#47;resin&#47;models&#47;application.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/token/token.coffee.html#saveToken-' target='main' title='saveToken'>
~saveToken
</a>
<small>
(lib&#47;resin&#47;token&#47;token.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/data/data-prefix.coffee.html#set-' target='main' title='set'>
~set
</a>
<small>
(lib&#47;resin&#47;data&#47;data-prefix.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/log/log.coffee.html#setQuiet-' target='main' title='setQuiet'>
~setQuiet
</a>
<small>
(lib&#47;resin&#47;log&#47;log.coffee)
</small>
</li>
<li>
<a href='file/lib/resin/log/log.coffee.html#warning-' target='main' title='warning'>
~warning
</a>
<small>
(lib&#47;resin&#47;log&#47;log.coffee)
</small>
</li>
</ul>
</div>
</body>
</html>

View File

@ -1,36 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='javascript/application.js'></script>
<script src='javascript/search.js'></script>
<link rel='stylesheet' href='stylesheets/application.css' type='text/css'>
</head>
<body class='list'>
<div class='list tree' id='content'>
<h1 class='full_list_header'>Mixin List</h1>
<nav>
<a target='_self' href='class_list.html'>
Classes
</a>
<a target='_self' href='file_list.html'>
Files
</a>
<a target='_self' href='method_list.html'>
Methods
</a>
<a target='_self' href='extra_list.html'>
Extras
</a>
</nav>
<div id='search'>
Search:
<input type='text'>
</div>
<ul>
</ul>
</div>
</body>
</html>

View File

@ -1,745 +0,0 @@
pre code{display:block;padding:.5em;background:#f0f0f0}pre code,pre .subst,pre .tag .title,pre .lisp .title,pre .clojure .built_in,pre .nginx .title{color:black}pre .string,pre .title,pre .constant,pre .parent,pre .tag .value,pre .rules .value,pre .rules .value .number,pre .preprocessor,pre .haml .symbol,pre .ruby .symbol,pre .ruby .symbol .string,pre .aggregate,pre .template_tag,pre .django .variable,pre .smalltalk .class,pre .addition,pre .flow,pre .stream,pre .bash .variable,pre .apache .tag,pre .apache .cbracket,pre .tex .command,pre .tex .special,pre .erlang_repl .function_or_atom,pre .asciidoc .header,pre .markdown .header,pre .coffeescript .attribute{color:#800}pre .comment,pre .annotation,pre .template_comment,pre .diff .header,pre .chunk,pre .asciidoc .blockquote,pre .markdown .blockquote{color:#888}pre .number,pre .date,pre .regexp,pre .literal,pre .hexcolor,pre .smalltalk .symbol,pre .smalltalk .char,pre .go .constant,pre .change,pre .lasso .variable,pre .asciidoc .bullet,pre .markdown .bullet,pre .asciidoc .link_url,pre .markdown .link_url{color:#080}pre .label,pre .javadoc,pre .ruby .string,pre .decorator,pre .filter .argument,pre .localvars,pre .array,pre .attr_selector,pre .important,pre .pseudo,pre .pi,pre .haml .bullet,pre .doctype,pre .deletion,pre .envvar,pre .shebang,pre .apache .sqbracket,pre .nginx .built_in,pre .tex .formula,pre .erlang_repl .reserved,pre .prompt,pre .asciidoc .link_label,pre .markdown .link_label,pre .vhdl .attribute,pre .clojure .attribute,pre .asciidoc .attribute,pre .lasso .attribute,pre .coffeescript .property{color:#88F}pre .keyword,pre .id,pre .title,pre .built_in,pre .aggregate,pre .css .tag,pre .javadoctag,pre .phpdoc,pre .yardoctag,pre .smalltalk .class,pre .winutils,pre .bash .variable,pre .apache .tag,pre .go .typename,pre .tex .command,pre .asciidoc .strong,pre .markdown .strong,pre .request,pre .status{font-weight:bold}pre .asciidoc .emphasis,pre .markdown .emphasis{font-style:italic}pre .nginx .built_in{font-weight:normal}pre .coffeescript .javascript,pre .javascript .xml,pre .lasso .markup,pre .tex .formula,pre .xml .javascript,pre .xml .vbscript,pre .xml .css,pre .xml .cdata{opacity:.5}
body {
padding: 0 5px;
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
font-size: 13px;
}
h1 {
font-size: 25px;
margin: 0.8em 0 0.5em;
padding-top: 4px;
border-top: 1px dotted #d5d5d5;
}
h2 {
padding: 0;
padding-bottom: 3px;
border-bottom: 1px #aaa solid;
font-size: 1.4em;
margin: 1.8em 0 0.5em;
}
#base {
display: none;
}
#fuzzySearch {
-webkit-box-shadow: rgba(0,0,0,0.5) 0px 10px 30px 10px;
box-shadow: rgba(0,0,0,0.5) 0px 10px 30px 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
position: fixed;
z-index: 8000;
left: 0;
right: 0;
top: 25px;
width: 80%;
height: 45px;
margin: 0 auto;
display: none;
background-color: #fff;
padding-top: 25px;
padding-bottom: 25px;
}
#fuzzySearch input {
margin-left: 10%;
-webkit-border-radius: 5px;
border-radius: 5px;
width: 80%;
border: 2px solid #05a;
font-size: 20px;
padding: 5px;
}
#fuzzySearch ol {
list-style-type: none;
margin: 10px 0 0 0;
padding: 0;
}
#fuzzySearch ol li {
padding: 3px;
}
#fuzzySearch ol li.stripe {
background: #f0f0f0;
}
#fuzzySearch ol li.selected {
background: #05a;
}
#fuzzySearch ol li.selected a {
color: #fff;
}
#fuzzySearch ol li.selected a:visited {
color: #fff;
}
#fuzzySearch ol li.selected a:hover {
color: #05a;
}
#fuzzySearch ol li.selected a span {
color: #05a;
}
#fuzzySearch ol li a {
color: #05a;
font-size: 18px;
text-decoration: none;
}
#fuzzySearch ol li a:visited {
color: #05a;
}
#fuzzySearch ol li a:hover {
background: #ffffa5;
}
#fuzzySearch ol li a span {
background-color: #ff0;
}
#fuzzySearch ol li small {
font-size: 14px;
padding-left: 10px;
color: #888;
}
#help {
-webkit-box-shadow: rgba(0,0,0,0.5) 0px 10px 30px 10px;
box-shadow: rgba(0,0,0,0.5) 0px 10px 30px 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
position: fixed;
z-index: 8000;
left: 0;
right: 0;
top: 50%;
width: 500px;
height: 460px;
margin: 0 auto;
margin-top: -265px;
display: none;
padding: 25px;
background-color: #fff;
}
#help ul {
list-style-type: none;
margin: 0;
padding: 0;
}
#help ul li {
height: 35px;
font-weight: bold;
}
#help ul li span {
-webkit-box-shadow: rgba(0,0,0,0.5) 1px 1px 2px;
box-shadow: rgba(0,0,0,0.5) 1px 1px 2px;
-webkit-border-radius: 3px;
border-radius: 3px;
display: block;
float: left;
width: 50px;
padding: 5px;
margin-right: 20px;
background: #eee;
text-align: center;
}
#content a:link,
#content a:visited {
text-decoration: none;
color: #05a;
}
#content a:hover {
background: #ffffa5;
}
#content #filecontents img {
border: 0;
}
#content #filecontents li {
line-height: 25px;
}
#content #filecontents table {
padding: 0;
border-collapse: collapse;
border-spacing: 0;
}
#content #filecontents table tr {
border-top: 1px solid #ccc;
background-color: #fff;
margin: 0;
padding: 0;
}
#content #filecontents table tr td {
border: 1px solid #ccc;
text-align: left;
margin: 0;
padding: 6px 13px;
}
#content table.box {
font-size: 1em;
line-height: 2;
border-spacing: 0;
border-collapse: collapse;
}
#content table.box tr {
background-color: #fff;
}
#content table.box tr:first-child {
background-color: #eee;
}
#content table.box tr td {
border: 1px solid #aaa;
}
#content table.box tr td:first-child {
width: 100px;
padding-right: 10px;
text-align: right;
font-weight: bold;
}
#content table.box tr td:last-child {
min-width: 420px;
padding-left: 10px;
padding-right: 10px;
}
#content h1 .note,
#content li .note,
#content .properties .note,
#content .method_details .signature .note {
font-weight: normal;
padding: 3px 5px;
position: relative;
top: -3px;
text-transform: capitalize;
display: inline;
}
#content .method_details .signature .note {
font-size: 0.6em;
top: -1px;
}
#content h1 .note {
font-size: 0.5em;
}
#content li .note {
top: 0px;
font-size: 0.9em;
}
#content .properties .note {
top: 0px;
font-size: 0.85em;
}
#content ul.summary,
#content .properties {
list-style: none;
font-family: monospace;
font-size: 1em;
line-height: 1.5em;
}
#content ul.summary li,
#content .properties li {
margin-bottom: 5px;
}
#content ul.summary .signature,
#content .properties .signature {
-webkit-border-radius: 3px;
border-radius: 3px;
padding: 1px 10px;
color: #05a;
background: #eaeaff;
border: 1px solid #dfdfe5;
}
#content ul.summary .signature a:hover,
#content .properties .signature a:hover {
background: transparent;
}
#content ul.summary li[deprecated] .signature,
#content .properties li[deprecated] .signature {
text-decoration: line-through;
}
#content ul.summary .signature + .note.title,
#content .properties .signature + .note.title {
margin-left: 7px;
}
#content ul.summary .desc,
#content .properties .desc {
margin-left: 32px;
display: block;
font-family: sans-serif;
}
#content ul.summary .desc p,
#content .properties .desc p {
padding: 0;
margin: 0;
}
#content dl.constants dt {
font-weight: bold;
}
#content dl.constants,
#content dl.properties {
margin-left: 40px;
}
#content dl.constants dt,
#content dl.properties dt {
font-size: 1.1em;
margin-bottom: 5px;
}
#content dl.constants dt .docstring,
#content dl.properties dt .docstring {
margin-left: 32px;
font-size: 0.9em;
font-weight: normal;
}
#content dl.constants dd,
#content dl.properties dd {
margin-bottom: 18px;
}
#content .method_details {
border-top: 1px dotted #aaa;
margin-top: 15px;
padding-top: 0;
}
#content .method_details:first-child {
border: none;
}
#content .method_details p.signature {
-webkit-border-radius: 3px;
border-radius: 3px;
font-size: 1.1em;
font-weight: normal;
font-family: Monaco, Consolas, Courier, monospace;
padding: 6px 10px;
margin-top: 18px;
background: #e5e8ff;
border: 1px solid #d8d8e5;
}
#content .tags {
font-size: 13px;
}
#content .tags h3 {
font-size: 1em;
margin-bottom: 3px;
}
#content .tags ul {
margin-top: 0px;
padding-left: 30px;
list-style: square;
}
#content .tags ul .name {
font-family: monospace;
font-weight: bold;
}
#content .tags .overloads h3 {
margin-bottom: 0px;
}
#content .tags .overloads .overload {
margin-left: 20px;
}
#content .tags .overloads .overload p.signature {
padding-top: 2px;
padding-bottom: 2px;
}
#content .tags .events h3 {
margin-bottom: 0px;
}
#content .tags .events .event {
margin-left: 20px;
}
#content .tags .events .event p.signature {
padding-top: 2px;
padding-bottom: 2px;
}
#content .note {
-webkit-border-radius: 3px;
border-radius: 3px;
margin-top: 10px;
color: #222;
background: #e3e4e3;
border: 1px solid #d5d5d5;
padding: 7px 10px;
display: block;
}
#content .deprecated {
background: #ffe5e5;
border-color: #e9dada;
}
#content .writeonly {
background: #d3ff97;
border-color: #c3eb8b;
}
#content .readonly {
background: #ffe5e5;
border-color: #e9dada;
}
#content .bound {
background: #d3ff97;
border-color: #c3eb8b;
}
#content .todo {
background: #ffffc5;
border-color: #ececaa;
}
#content .private {
background: #d5d5d5;
border-color: #c5c5c5;
}
#content .constructor {
color: #fff;
background: #6a98d6;
border-color: #6689d6;
}
#content h3.inherited,
#content h3.included,
#content h3.extended {
font-style: italic;
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
font-weight: normal;
padding: 0;
margin: 0;
margin-top: 12px;
margin-bottom: 3px;
font-size: 13px;
}
#content p.inherited,
#content p.included,
#content p.extended {
word-spacing: 5px;
font-size: 1.2em;
padding: 0;
margin: 0;
margin-left: 25px;
}
#content p.inherited a,
#content p.included a,
#content p.extended a {
font-family: monospace;
font-size: 0.9em;
}
#footer {
margin-top: 15px;
border-top: 1px solid #ccc;
text-align: center;
padding: 7px 0;
font-size: 12px;
color: #999;
}
#footer a:link,
#footer a:visited {
color: #999;
text-decoration: none;
border-bottom: 1px dotted #bbd;
}
#footer a:hover {
color: #05a;
}
#menu {
font-size: 1.3em;
color: #bbb;
top: -5px;
position: relative;
}
#menu .title,
#menu a {
font-size: 0.7em;
}
#menu .title a {
font-size: 1em;
}
#menu .title {
color: #555;
}
#menu a:link,
#menu a:visited {
color: #333;
text-decoration: none;
border-bottom: 1px dotted #bbd;
}
#menu a:hover {
color: #05a;
}
#header nav {
float: right;
color: #000;
font-size: 0.7em;
}
#header nav ul {
list-style-type: none;
margin: 4px !important;
}
#header nav ul,
#header nav ul li {
margin: 0px;
padding: 0px;
display: inline;
}
#header nav a {
font-size: 1em;
}
#header #search {
float: right;
margin-top: -3px;
}
#header #search a:link,
#header #search a:visited {
-webkit-box-shadow: #ddd -1px 1px 3px;
box-shadow: #ddd -1px 1px 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
display: block;
float: left;
margin-right: 4px;
padding: 8px 10px;
color: #05a;
background: #eaf0ff;
text-decoration: none;
border: 1px solid #d8d8e5;
}
#header #search a:hover {
background: #f5faff;
color: #06b;
}
#header #search a.active {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
padding-bottom: 20px;
color: #fff;
background: #568;
border: 1px solid #457;
}
#header #search a.inactive {
color: #999;
}
#search_frame {
-webkit-box-shadow: #aaa -7px 5px 25px;
box-shadow: #aaa -7px 5px 25px;
display: none;
position: absolute;
overflow-y: scroll;
z-index: 9999;
top: 36px;
right: 18px;
width: 500px;
height: 80%;
background: #fff;
border: 1px solid #999;
border-collapse: collapse;
}
.alphaindex {
margin-top: 0;
font-size: 22px;
}
.noborder {
border-top: 0px;
margin-top: 0;
padding-top: 4px;
}
.title {
margin-bottom: 10px;
}
#files {
padding: 0;
font-size: 1.1em;
}
#files li {
list-style: none;
display: inline;
padding: 7px 12px;
line-height: 35px;
background: #f0f0f0;
margin-right: 5px;
}
.index {
-webkit-column-count: 3;
-moz-column-count: 3;
column-count: 3;
-webkit-column-width: 33%;
-moz-column-width: 33%;
column-width: 33%;
}
.index > ul {
margin: 0;
padding: 0;
padding-bottom: 10px;
font-size: 1.1em;
list-style: none;
}
.index > ul > li.letter {
-webkit-column-break-after: avoid;
font-size: 1.4em;
padding-bottom: 10px;
text-transform: uppercase;
}
.index > ul > ul {
margin: 0;
padding-left: 20px;
}
.index > ul > ul small {
color: #666;
font-size: 0.7em;
}
body.list {
padding: 0;
margin: 0;
}
body #content.list #search {
position: relative;
margin-top: 5px;
margin-left: 10px;
}
#content.list.tree > ul {
margin-top: 13px !important;
}
#content.list.tree ul {
font-size: 16px;
margin: 0;
padding: 0;
}
#content.list.tree ul li {
margin: 0;
padding: 5px;
color: #000;
font-size: 1em;
list-style: none;
white-space: nowrap;
overflow: hidden;
cursor: pointer;
}
#content.list.tree ul li.namespace {
overflow: visible;
}
#content.list.tree ul li > a.toggle {
display: block;
float: left;
width: 10px;
height: 10px;
margin-top: 5px;
margin-left: 5px;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC");
background-repeat: no-repeat;
background-position: 0px -10px;
}
#content.list.tree ul li > a.toggle.collapsed {
background-position: 0px 0px;
}
#content.list.tree ul li > span,
#content.list.tree ul li a {
margin-left: 20px;
text-decoration: none;
}
#content.list.tree ul li > a.toggle + span,
#content.list.tree ul li a.toggle + a {
margin-left: 5px;
}
#content.list.tree ul li small {
color: #888;
white-space: nowrap;
}
#content.list.tree ul li small.namespace {
display: none;
}
#content.list.tree ul li.result a.toggle {
visibility: hidden;
}
#content.list.tree ul li.result small.namespace {
display: inline;
}
#content.list.tree ul li.result small.parent {
display: none;
}
#content.list {
padding: 0;
margin: 0;
}
#content.list h1 {
padding: 12px 10px;
padding-bottom: 10px;
margin: 0;
font-size: 1.4em;
}
#content.list a:hover {
background: transparent;
}
#content.list nav {
margin-left: 10px;
}
#content.list #search {
color: #888;
}
#content.list #search input {
-webkit-border-radius: 3px;
border-radius: 3px;
border: 1px solid #bbb;
}
#content.list a {
color: #05a;
cursor: pointer;
text-decoration: none;
}
#content.list a:hover {
text-decoration: underline;
}
#content.list ul {
padding: 0;
list-style: none;
margin-left: 0;
}
#content.list ul li[deprecated] {
text-decoration: line-through;
}
#content.list ul li {
padding: 5px;
padding-left: 12px;
margin: 0;
font-size: 1.1em;
list-style: none;
color: #888;
cursor: pointer;
}
#content.list ul li.stripe {
background: #f0f0f0;
}
#content.list ul li:hover {
background: #ddd;
}
nav.toc {
-webkit-box-shadow: #bbb -2px 2px 6px;
box-shadow: #bbb -2px 2px 6px;
overflow: hidden;
float: right;
z-index: 500;
right: 0px;
max-width: 300px;
padding: 20px;
padding-right: 30px;
margin-left: 20px;
margin-bottom: 20px;
background: #fff;
border: 1px solid #ddd;
}
nav.toc p.title {
margin-top: 5px;
}
nav.toc ol {
padding-left: 1.8em;
}
nav.toc li {
font-size: 1.1em;
line-height: 1.7em;
}
nav.toc > ol > li {
font-size: 1.1em;
font-weight: bold;
}
nav.toc ol > ol {
font-size: 0.9em;
}
nav.toc.inline {
-webkit-box-shadow: #fff 0px 0px 0px;
box-shadow: #fff 0px 0px 0px;
position: relative;
float: none;
padding: 0;
margin: 5px 0 0 0;
border: 0px;
}
nav.toc.inline.hidden {
background: none;
padding: 0;
text-align: left;
}
nav.toc.hidden {
height: 26px;
width: 140px;
padding: 5px;
background: #f6f6f6;
text-align: center;
}
nav.toc.hidden p.title small {
display: none;
}

View File

@ -1,7 +1,7 @@
_ = require('lodash')
async = require('async')
gitCli = require('git-cli')
resin = require('../resin')
resin = require('resin-sdk')
ui = require('../ui')
log = require('../log/log')
errors = require('../errors/errors')

View File

@ -1,7 +1,7 @@
_ = require('lodash')
url = require('url')
async = require('async')
resin = require('../resin')
resin = require('resin-sdk')
ui = require('../ui')
log = require('../log/log')
errors = require('../errors/errors')

View File

@ -1,6 +1,6 @@
_ = require('lodash-contrib')
async = require('async')
resin = require('../resin')
resin = require('resin-sdk')
ui = require('../ui')
log = require('../log/log')
errors = require('../errors/errors')

View File

@ -1,5 +1,5 @@
_ = require('lodash')
resin = require('../resin')
resin = require('resin-sdk')
ui = require('../ui')
permissions = require('../permissions/permissions')
log = require('../log/log')

View File

@ -3,7 +3,7 @@ fs = require('fs')
path = require('path')
_ = require('lodash')
gitCli = require('git-cli')
resin = require('../resin')
resin = require('resin-sdk')
permissions = require('../permissions/permissions')
ui = require('../ui')
log = require('../log/log')

View File

@ -1,6 +1,6 @@
_ = require('lodash')
_.str = require('underscore.string')
resin = require('../resin')
resin = require('resin-sdk')
capitano = require('capitano')
log = require('../log/log')

View File

@ -2,7 +2,7 @@ _ = require('lodash')
_.str = require('underscore.string')
async = require('async')
fs = require('fs')
resin = require('../resin')
resin = require('resin-sdk')
helpers = require('../helpers/helpers')
ui = require('../ui')
log = require('../log/log')

View File

@ -1,6 +1,6 @@
_ = require('lodash')
PubNub = require('pubnub')
resin = require('../resin')
resin = require('resin-sdk')
helpers = require('../helpers/helpers')
permissions = require('../permissions/permissions')
log = require('../log/log')

View File

@ -2,7 +2,7 @@ async = require('async')
permissions = require('../permissions/permissions')
errors = require('../errors/errors')
helpers = require('../helpers/helpers')
resin = require('../resin')
resin = require('resin-sdk')
exports.set = permissions.user (params, options) ->
if not options.device?

View File

@ -3,7 +3,7 @@ async = require('async')
path = require('path')
mkdirp = require('mkdirp')
ProgressBar = require('progress')
resin = require('../resin')
resin = require('resin-sdk')
connection = require('../connection/connection')
log = require('../log/log')
permissions = require('../permissions/permissions')

View File

@ -1,6 +1,6 @@
open = require('open')
url = require('url')
resin = require('../resin')
resin = require('resin-sdk')
permissions = require('../permissions/permissions')
exports.preferences = permissions.user ->

View File

@ -1,6 +1,6 @@
_ = require('lodash')
capitano = require('capitano')
resin = require('./resin')
resin = require('resin-sdk')
packageJSON = require('../package.json')
actions = require('./actions')
log = require('./log/log')

View File

@ -1,5 +1,5 @@
_ = require('lodash')
resin = require('../resin')
resin = require('resin-sdk')
exports.isDeviceUUIDValid = (uuid, callback) ->
resin.models.device.getAll (error, devices) ->

View File

@ -2,7 +2,7 @@ expect = require('chai').expect
sinon = require('sinon')
_ = require('lodash')
helpers = require('./helpers')
resin = require('../resin')
resin = require('resin-sdk')
describe 'Helpers:', ->

View File

@ -1,4 +1,4 @@
resin = require('../resin')
resin = require('resin-sdk')
exports.user = (fn, onError) ->
return ->

View File

@ -2,7 +2,7 @@ _ = require('lodash')
nock = require('nock')
sinon = require('sinon')
expect = require('chai').expect
resin = require('../resin')
resin = require('resin-sdk')
permissions = require('./permissions')
johnDoeFixture = require('../../tests/fixtures/johndoe')
mock = require('../../tests/utils/mock')

View File

@ -1,3 +0,0 @@
# A wrapper around isOnline in order
# to be able to stub it with Sinon
exports.isOnline = require('is-online')

View File

@ -1,37 +0,0 @@
expect = require('chai').expect
_ = require('lodash')
sinon = require('sinon')
connection = require('./connection')
describe 'Connection:', ->
describe '#isOnline()', ->
stubIsOnline = (expectations, args...) ->
isOnlineStub = sinon.stub(connection, 'isOnline')
isOnlineStub.yields(args...)
connection.isOnline (error, isOnline) ->
expectations.apply(null, arguments)
isOnlineStub.restore()
it 'should be able to return true', (done) ->
stubIsOnline (error, isOnline) ->
expect(error).to.not.exist
expect(isOnline).to.be.true
done()
, null, true
it 'should be able to return false', (done) ->
stubIsOnline (error, isOnline) ->
expect(error).to.not.exist
expect(isOnline).to.be.false
done()
, null, false
it 'should be able to return an error', (done) ->
stubIsOnline (error, isOnline) ->
expect(error).to.be.an.instanceof(Error)
expect(isOnline).to.not.exist
done()
, new Error()

View File

@ -1,125 +0,0 @@
TypedError = require('typed-error')
exports.NotFound = class NotFound extends TypedError
# Construct a Not Found error
#
# @param {String} name name of the thing that was not found
#
# @example Application not found
# throw new resin.errors.NotFound('application')
# Error: Couldn't find application
#
constructor: (name) ->
@message = "Couldn't find #{name}"
# Error exit code
exitCode: 1
exports.InvalidConfigFile = class InvalidConfigFile extends TypedError
# Construct an Invalid Config File error
#
# @param {String} file the name of the invalid configuration file
#
# @example Invalid config file error
# throw new resin.errors.InvalidConfigFile('/opt/resin.conf')
# Error: Invalid configuration file: /opt/resin.conf
#
constructor: (file) ->
@message = "Invalid configuration file: #{file}"
# Error exit code
exitCode: 1
exports.InvalidCredentials = class InvalidCredentials extends TypedError
# Construct an Invalid Credentials error
#
# @example Invalid credentials error
# throw new resin.errors.InvalidCredentials()
# Error: Invalid credentials
#
constructor: ->
@message = 'Invalid credentials'
# Error exit code
exitCode: 1
exports.InvalidKey = class InvalidKey extends TypedError
# Construct an Invalid Key error
#
# @example Invalid key error
# throw new resin.errors.InvalidKey()
# Error: Invalid key
#
constructor: ->
@message = 'Invalid key'
# Error exit code
exitCode: 1
exports.InvalidPath = class InvalidPath extends TypedError
# Construct an Invalid Path error
#
# @param {String} path the name of the invalid path
#
# @example Invalid path error
# throw new resin.errors.InvalidPath('/tmp')
# Error: Invalid path: /tmp
#
constructor: (path) ->
@message = "Invalid path: #{path}"
# Error exit code
exitCode: 1
exports.DirectoryDoesntExist = class DirectoryDoesntExist extends TypedError
# Construct a Directory Doesn't Exist error
#
# @param {String} directory the name of the directory that doesn't exist
#
# @example Directory doesn't exist error
# throw new resin.errors.DirectoryDoesntExist('/tmp')
# Error: Directory doesn't exist: /tmp
#
constructor: (directory) ->
@message = "Directory doesn't exist: #{directory}"
# Error exit code
exitCode: 1
exports.NotAny = class NotAny extends TypedError
# Construct an Not Any error
#
# @param {String} name name of the thing that the user doesn't have
#
# @example Not Any applications error
# throw new resin.errors.NotAny('applications')
# Error: You don't have any applications
#
constructor: (name) ->
@message = "You don't have any #{name}"
# Error exit code
exitCode: 0
exports.FileNotFound = class FileNotFound extends TypedError
# Construct an File Not Found error
#
# @param {String} filename name of the file that was not found
#
# @example File Not Found error
# throw new resin.errors.FileNotFound('/foo')
# Error: File not found: /foo
#
constructor: (filename) ->
@message = "File not found: #{filename}"
# Error exit code
exitCode: 1

View File

@ -1,30 +0,0 @@
_ = require('lodash')
fsPlus = require('fs-plus')
path = require('path')
# Prefix relative value paths with another path
#
# @private
#
# @param {String} prefix path prefix
# @param {Object} object object containing relative paths as values
#
# @note Absolute values will be omitted
#
# @example Prefix object with path
# object =
# dataPrefix: 'resin'
#
# object = prefixObjectValuesWithPath('/opt', object)
# console.log(object.dataPrefix) # /opt/resin
#
exports.prefixObjectValuesWithPath = (prefix, object) ->
return _.object _.map object, (value, key) ->
result = [ key ]
if fsPlus.isAbsolute(value)
result.push(value)
else
result.push(path.join(prefix, value))
return result

View File

@ -1,40 +0,0 @@
os = require('os')
chai = require('chai')
chai.use(require('chai-string'))
expect = chai.expect
path = require('path')
helpers = require('./helpers')
describe 'Helpers:', ->
describe '#prefixObjectWithPath()', ->
it 'should add the path to every value', ->
prefix = "#{path.sep}resin"
object =
first: 'first'
second: ".#{path.sep}second"
result = helpers.prefixObjectValuesWithPath(prefix, object)
for key, value of result
expect(value).to.startsWith(prefix)
it 'should not add the prefix if the paths are absolute', ->
prefix = "#{path.sep}resin"
if os.platform() is 'win32'
object =
first: 'C:\\first'
second: 'C:\\Users\\me'
third: 'C:\\'
else
object =
first: '/first'
second: '/home/second'
third: '/usr/share/resin'
fourth: '/'
result = helpers.prefixObjectValuesWithPath(prefix, object)
expect(result).to.deep.equal(object)

View File

@ -1,144 +0,0 @@
_ = require('lodash')
request = require('request')
progress = require('request-progress')
async = require('async')
connection = require('../_connection/connection')
settings = require('../settings')
auth = require('../auth/auth')
# @nodoc
urlResolve = require('url').resolve
# Send an HTTP request to resin.io
#
# @param {Object} options request options
# @option options {String} url relative url
# @option options {String} json request body
# @option options {String} method HTTP method
# @option options {Object} headers custom HTTP headers
# @option options {Function} pipe define this function if you want to stream the response
#
# @param {Function} callback callback(error, response, body)
# @param {Function} onProgress on progress callback(state) (optional)
#
# @note If the user is logged in, the token gets automatically added to Authorization header
# @note If the response is JSON, it will attempt to parse it
#
# @throw {Error} Will throw if you don't have internet connection
#
# @example GET request
# resin.server.request {
# method: 'GET'
# url: '/foobar'
# }, (error, response, body) ->
# throw error if error?
# console.log(body)
#
# @example POST request with body
# resin.server.request {
# method: 'POST'
# url: '/foobar'
# json:
# name: 'My FooBar'
# }, (error, response, body) ->
# throw error if error?
# assert(response.statusCode is 201)
#
# @example Stream download
# resin.server.request {
# method: 'GET'
# url: '/download'
# pipe: fs.createWriteStream('/tmp/download')
# }, (error) ->
# throw error if error?
# , (state) ->
# console.log("Received: #{state.received}")
# console.log("Total: #{state.total}")
# console.log("Is Complete? #{state.complete}")
#
exports.request = (options = {}, outerCallback, onProgress) ->
onProgress ?= _.noop
if not options.url?
throw new Error('Missing URL')
async.waterfall [
(callback) ->
connection.isOnline(callback)
(isOnline, callback) ->
if not isOnline
return callback(new Error('You need internet connection to perform this task'))
auth.getToken(callback)
(savedToken, callback) ->
options.url = urlResolve(settings.get('remoteUrl'), options.url)
if options.method?
options.method = options.method.toUpperCase()
_.defaults options,
method: 'GET'
gzip: true
if savedToken?
options.headers ?= {}
_.extend options.headers,
'Authorization': "Bearer #{savedToken}"
if options.pipe?
progress(request(options))
.on('progress', onProgress)
.on('error', outerCallback)
.on('end', onProgress)
.pipe(options.pipe)
.on('error', outerCallback)
.on('close', outerCallback)
else
return request(options, callback)
(response, body, callback) ->
try
response.body = JSON.parse(response.body)
if response?.statusCode >= 400
error = new Error(response.body)
return callback(error, response, response.body)
], outerCallback
# Generate shorthand functions for every method
#
# @private
#
# @todo Find a way to document all of the methods directly
#
createFacadeFunction = (method) ->
lowerCaseMethod = method.toLowerCase()
exports[lowerCaseMethod] = (url, body, callback, onProgress) ->
options = {
method
url
}
if _.isFunction(body)
onProgress = callback
callback = body
else
options.json = body
return exports.request(options, callback, onProgress)
for method in [
'GET'
'HEAD'
'POST'
'PATCH'
'PUT'
'DELETE'
]
createFacadeFunction(method)

View File

@ -1,240 +0,0 @@
expect = require('chai').expect
fs = require('fs')
nock = require('nock')
url = require('url')
sinon = require('sinon')
server = require('./server')
settings = require('../settings')
auth = require('../auth/auth')
data = require('../data/data')
mock = require('../../../tests/utils/mock')
johnDoeFixture = require('../../../tests/fixtures/johndoe.json')
METHODS = [
'GET'
'HEAD'
'POST'
'PUT'
'DELETE'
'PATCH'
]
describe 'Server:', ->
before ->
mock.connection.init()
after ->
mock.connection.restore()
beforeEach (done) ->
@uris =
ok: '/ok'
nojson: '/nojson'
error: '/error'
@responses =
nojson: 'NO JSON @responses'
@status =
ok: 'ok'
error: 'error'
testUri = settings.get('remoteUrl')
nock(testUri).get(@uris.nojson).reply(200, @responses.nojson)
nock(testUri).get(@uris.error).reply(400, status: @status.error)
for method in METHODS
lowercaseMethod = method.toLowerCase()
nock(testUri)[lowercaseMethod](@uris.ok).reply(200, status: @status.ok)
mock.fs.init()
data.prefix.set(settings.get('dataPrefix'), done)
afterEach ->
mock.fs.restore()
describe '#request()', ->
it 'should make a real HTTP request', (done) ->
server.request {
method: 'GET'
url: @uris.ok
}, (error, response) =>
return done(error) if error?
expect(response.body.status).to.equal(@status.ok)
expect(response.statusCode).to.equal(200)
done()
it 'should make a GET request if method is omitted', (done) ->
server.request {
url: @uris.ok
}, (error, response) ->
return done(error) if error?
expect(response.request.method).to.equal('GET')
done()
checkRequestType = (type) ->
return (done) ->
server.request {
method: type
url: @uris.ok
}, (error, response) ->
return done(error) if error?
expect(response.request.method).to.equal(type)
done()
for method in METHODS
it("should make a #{method} request if method is #{method}", checkRequestType(method))
it 'should get a raw response of response is not JSON', (done) ->
server.request {
method: 'GET'
url: @uris.nojson
}, (error, response) =>
return done(error) if error?
expect(response.body).to.equal(@responses.nojson)
done()
it 'should parse the body', (done) ->
server.request {
method: 'GET'
url: @uris.ok
}, (error, response, body) ->
expect(error).to.not.exist
expect(body).to.be.an.object
expect(body).not.to.be.a.string
done()
it 'should be able to send data in the body', (done) ->
body = { hello: 'world' }
server.request {
method: 'POST'
url: @uris.ok
json: body
}, (error, response) ->
return done(error) if error?
expect(response.request.body.toString()).to.equal(JSON.stringify(body))
done()
it 'should throw an error if method is unknown', (done) ->
server.request {
method: 'FOO'
url: @uris.ok
}, (error, response) ->
expect(error).to.exist
expect(error).to.be.an.instanceof(Error)
done()
it 'should throw an error if the status code is >= 400', (done) ->
server.request {
method: 'GET'
url: @uris.error
}, (error, response) ->
expect(error).to.exist
expect(error).to.be.an.instanceof(Error)
done()
it 'should accept a full url', (done) ->
server.request {
method: 'GET'
url: url.resolve(settings.get('remoteUrl'), @uris.ok)
}, (error, response) =>
expect(error).to.not.exist
expect(response.body.status).to.equal(@status.ok)
done()
it 'should allow piping files', (done) ->
onProgressSpy = sinon.spy()
outputFile = '/hello'
server.request {
method: 'GET'
url: @uris.nojson
pipe: fs.createWriteStream(outputFile)
}, (error) =>
expect(error).to.not.exist
expect(onProgressSpy).to.have.been.called
fs.readFile outputFile, { encoding: 'utf8' }, (error, contents) =>
expect(error).to.not.exist
expect(contents).to.equal(@responses.nojson)
done()
, onProgressSpy
checkRequestTypeWithoutBody = (type) ->
return (done) ->
lowercaseType = type.toLowerCase()
server[lowercaseType] @uris.ok, (error, response) ->
return done(error) if error?
expect(response.request.method).to.equal(type)
done()
describe '#get()', ->
it('should be a facade to request()', checkRequestTypeWithoutBody('GET'))
describe '#head()', ->
it('should be a facade to request()', checkRequestTypeWithoutBody('HEAD'))
describe '#delete()', ->
it('should be a facade to request()', checkRequestTypeWithoutBody('DELETE'))
checkRequestTypeWithBody = (type, body) ->
return (done) ->
lowercaseType = type.toLowerCase()
server[lowercaseType] @uris.ok, body, (error, response) ->
return done(error) if error?
expect(response.request.method).to.equal(type)
done()
describe '#post()', ->
it('should be a facade to request()', checkRequestTypeWithBody('POST', { hello: 'world' }))
describe '#put()', ->
it('should be a facade to request()', checkRequestTypeWithBody('PUT', { hello: 'world' }))
describe '#patch()', ->
it('should be a facade to request()', checkRequestTypeWithBody('PATCH', { hello: 'world' }))
describe 'given there is a token', ->
beforeEach (done) ->
nock(settings.get('remoteUrl'))
.post('/login_', johnDoeFixture.credentials)
.reply(200, johnDoeFixture.token)
auth.login(johnDoeFixture.credentials, done)
describe '#request()', ->
it 'should send the Authorization header', (done) ->
server.request {
method: 'GET'
url: @uris.ok
}, (error, response) ->
authorizationHeader = response?.request.headers.Authorization
expect(error).to.not.exist
expect(authorizationHeader).to.exist
expect(authorizationHeader).to.equal("Bearer #{johnDoeFixture.token}")
done()
describe 'given there is not a token', ->
beforeEach (done) ->
auth.logout(done)
describe '#request()', ->
it 'should not send the Authorization header', (done) ->
server.request {
method: 'GET'
url: @uris.ok
}, (error, response) ->
expect(error).to.not.exist
authorizationHeader = response?.request.headers.Authorization
expect(authorizationHeader).to.not.exist
done()

View File

@ -1,171 +0,0 @@
async = require('async')
_ = require('lodash-contrib')
token = require('./token/token')
server = require('../_server/server')
data = require('../data/data')
errors = require('../_errors/errors')
settings = require('../settings')
# Return current logged in username
#
# @param {Function} callback callback (error, username)
#
# @note This will only work if you used login() to log in.
#
# @example Who am I?
# resin.auth.whoami (error, username) ->
# throw error if error?
#
# if not username?
# console.log('I\'m not logged in!')
# else
# console.log("My username is: #{username}")
#
exports.whoami = (callback) ->
usernameKey = settings.get('keys.username')
data.getText(usernameKey, callback)
# Authenticate with the server
#
# @private
#
# @param {Object} credentials in the form of username, password
# @option credentials {String} username the username
# @option credentials {String} password user password
# @param {Function} callback callback (error, token, username)
#
# @note You should use login() when possible, as it takes care of saving the token and username as well.
#
# @example Authenticate
# resin.auth.authenticate credentials, (error, token, username) ->
# throw error if error?
# console.log("My username is: #{username}")
# console.log("My token is: #{token}")
#
exports.authenticate = (credentials, callback) ->
server.post settings.get('urls.authenticate'), credentials, (error, response) ->
return callback(error) if error?
savedToken = response?.body
return callback(null, savedToken, credentials.username)
# Login to Resin.io
#
# Is the login is successful, the token is persisted between sessions.
#
# @param {Object} credentials in the form of username, password
# @option credentials {String} username the username
# @option credentials {String} password user password
# @param {Function} callback callback (error)
#
# @note This function saves the token to the directory configured in dataPrefix
#
# @example Login to Resin.io
# resin.auth.login credentials, (error) ->
# throw error if error?
# console.log('I\'m logged in!')
#
exports.login = (credentials, callback) ->
async.waterfall([
(callback) ->
exports.authenticate(credentials, callback)
(authToken, username, callback) ->
token.saveToken(authToken, callback)
(callback) ->
usernameKey = settings.get('keys.username')
data.setText(usernameKey, credentials.username, callback)
], callback)
# Check if you're logged in
#
# @param {Function} callback callback (isLoggedIn)
#
# @example Check if logged in
# resin.auth.isLoggedIn (isLoggedIn) ->
# if isLoggedIn
# console.log('I\'m in!')
# else
# console.log('Too bad!')
#
exports.isLoggedIn = (callback) ->
token.hasToken(callback)
# Get current logged in user's token
#
# @param {Function} callback callback (error, isLoggedIn)
#
# @note This function simply delegates to resin.token.getToken() for convenience.
# @note This will only work if you used login() to log in.
#
# @example Get curren token
# resin.auth.getToken (error, token) ->
# throw error if error?
# console.log(token)
#
exports.getToken = (callback) ->
token.getToken(callback)
# Logout from Resin.io
#
# @param {Function} callback callback (error)
#
# @example Logout from Resin.io
# resin.auth.logout (error) ->
# throw error if error?
# console.log('I\'m out!')
#
# @todo Maybe we should post to /logout or something to invalidate the token on the server?
#
exports.logout = (callback = _.noop) ->
async.parallel([
(callback) ->
token.clearToken(callback)
(callback) ->
usernameKey = settings.get('keys.username')
data.remove(usernameKey, callback)
], _.unary(callback))
# Register to Resin.io
#
# @param {Object} credentials in the form of username, password and email
# @option credentials {String} username the username
# @option credentials {String} password user password
# @option credentials {String} email the user email
# @param {Function} callback callback (error, token)
#
# @example Register to Resin.io
# resin.auth.register {
# username: 'johndoe'
# password: 'secret'
# email: 'johndoe@gmail.com'
# }, (error, token) ->
# throw error if error?
# console.log(token)
#
exports.register = (credentials = {}, callback) ->
if not credentials.username?
return callback(new Error('Missing username'))
if not credentials.password?
return callback(new Error('Missing password'))
if not credentials.email?
return callback(new Error('Missing email'))
async.waterfall([
(callback) ->
url = settings.get('urls.register')
server.post(url, credentials, callback)
(response, body, callback) ->
return callback(null, body)
], callback)

View File

@ -1,293 +0,0 @@
expect = require('chai').expect
nock = require('nock')
_ = require('lodash')
async = require('async')
auth = require('./auth')
data = require('../data/data')
settings = require('../settings')
mock = require('../../../tests/utils/mock')
johnDoeFixture = require('../../../tests/fixtures/johndoe')
janeDoeFixture = require('../../../tests/fixtures/janedoe')
describe 'Auth:', ->
before ->
mock.connection.init()
after ->
mock.connection.restore()
beforeEach (done) ->
mock.fs.init()
data.prefix.set(settings.get('dataPrefix'), done)
afterEach ->
mock.fs.restore()
describe '#register()', ->
beforeEach ->
@credentials =
username: johnDoeFixture.credentials.username
password: johnDoeFixture.credentials.password
email: 'johndoe@gmail.com'
nock(settings.get('remoteUrl'))
.post(settings.get('urls.register'), @credentials)
.reply(201, johnDoeFixture.token)
describe 'given invalid credentials', ->
it 'should fail if no email', (done) ->
auth.register _.omit(@credentials, 'email'), (error, token) ->
expect(error).to.be.an.instanceof(Error)
expect(token).to.not.exist
done()
it 'should fail if no username', (done) ->
auth.register _.omit(@credentials, 'username'), (error, token) ->
expect(error).to.be.an.instanceof(Error)
expect(token).to.not.exist
done()
it 'should fail if no password', (done) ->
auth.register _.omit(@credentials, 'password'), (error, token) ->
expect(error).to.be.an.instanceof(Error)
expect(token).to.not.exist
done()
describe 'given valid credentials', ->
it 'should be able to register a username', (done) ->
auth.register @credentials, (error, token) ->
expect(error).to.not.exist
expect(token).to.equal(johnDoeFixture.token)
done()
describe 'given valid credentials', ->
beforeEach ->
nock(settings.get('remoteUrl'))
.post('/login_', johnDoeFixture.credentials)
.reply(200, johnDoeFixture.token)
describe '#authenticate()', ->
it 'should return a token string', (done) ->
auth.authenticate johnDoeFixture.credentials, (error, token, username) ->
return done(error) if error?
expect(token).to.be.a('string')
expect(token).to.equal(johnDoeFixture.token)
expect(username).to.equal(johnDoeFixture.credentials.username)
done()
describe '#login()', ->
it 'should save the token', (done) ->
async.waterfall [
(callback) ->
auth.isLoggedIn (isLoggedIn) ->
return callback(null, isLoggedIn)
(isLoggedIn, callback) ->
expect(isLoggedIn).to.be.false
auth.login(johnDoeFixture.credentials, callback)
(callback) ->
auth.isLoggedIn (isLoggedIn) ->
return callback(null, isLoggedIn)
(isLoggedIn, callback) ->
expect(isLoggedIn).to.be.true
return callback(null)
], (error) ->
expect(error).to.not.exist
done()
it 'should save the username', (done) ->
async.waterfall [
(callback) ->
auth.whoami(callback)
(username, callback) ->
expect(username).to.be.undefined
auth.login(johnDoeFixture.credentials, callback)
(callback) ->
auth.whoami(callback)
(username, callback) ->
expect(username).to.equal(johnDoeFixture.credentials.username)
return callback()
], (error) ->
expect(error).to.not.exist
done()
describe 'given invalid credentials', ->
beforeEach ->
nock(settings.get('remoteUrl'))
.post('/login_')
.reply(401)
describe '#authenticate()', ->
it 'should return an error', (done) ->
auth.authenticate johnDoeFixture.credentials, (error, token, username) ->
expect(error).to.exist
expect(error).to.be.an.instanceof(Error)
expect(token).to.be.undefined
expect(username).to.be.undefined
done()
describe '#login()', ->
it 'should return an error', (done) ->
auth.login johnDoeFixture.credentials, (error, token) ->
expect(error).to.exist
expect(error).to.be.an.instanceof(Error)
expect(token).to.be.undefined
done()
describe 'given a not logged in user', ->
describe '#whoami()', ->
it 'should return undefined', (done) ->
auth.whoami (error, username) ->
expect(error).to.not.exist
expect(username).to.be.undefined
done()
describe 'given a logged in user', ->
beforeEach (done) ->
nock(settings.get('remoteUrl'))
.post('/login_', johnDoeFixture.credentials)
.reply(200, johnDoeFixture.token)
nock(settings.get('remoteUrl'))
.post('/login_', janeDoeFixture.credentials)
.reply(200, janeDoeFixture.token)
auth.login(johnDoeFixture.credentials, done)
describe '#whoami()', ->
it 'should return the username', (done) ->
auth.whoami (error, username) ->
expect(error).to.not.exist
expect(username).to.equal(johnDoeFixture.credentials.username)
done()
describe '#login()', ->
it 'should override the old user', (done) ->
async.waterfall [
(callback) ->
auth.getToken(callback)
(token, callback) ->
expect(token).to.equal(johnDoeFixture.token)
auth.login(janeDoeFixture.credentials, callback)
(callback) ->
auth.getToken(callback)
(token, callback) ->
expect(token).to.equal(janeDoeFixture.token)
return callback(null)
], (error) ->
expect(error).to.not.exist
done()
describe '#isLoggedIn()', ->
it 'should return true', (done) ->
auth.isLoggedIn (isLoggedIn) ->
expect(isLoggedIn).to.be.true
done()
describe '#getToken()', ->
it 'should return the saved token', (done) ->
auth.getToken (error, token) ->
expect(error).to.not.exist
expect(token).to.equal(johnDoeFixture.token)
done()
describe '#logout()', ->
it 'should effectively logout the user', (done) ->
async.waterfall [
(callback) ->
auth.isLoggedIn (isLoggedIn) ->
return callback(null, isLoggedIn)
(isLoggedIn, callback) ->
expect(isLoggedIn).to.be.true
auth.logout(callback)
(callback) ->
auth.isLoggedIn (isLoggedIn) ->
return callback(null, isLoggedIn)
(isLoggedIn, callback) ->
expect(isLoggedIn).to.be.false
return callback()
], (error) ->
expect(error).to.not.exist
done()
it 'should clear the token', (done) ->
async.waterfall [
(callback) ->
auth.getToken(callback)
(savedToken, callback) ->
expect(savedToken).to.be.a.string
auth.logout(callback)
(callback) ->
auth.getToken(callback)
(savedToken, callback) ->
expect(savedToken).to.be.undefined
return callback()
], (error) ->
expect(error).to.not.exist
done()
it 'should clear the username', (done) ->
async.waterfall [
(callback) ->
auth.whoami(callback)
(username, callback) ->
expect(username).to.be.a.string
auth.logout(callback)
(callback) ->
auth.whoami(callback)
(username, callback) ->
expect(username).to.be.undefined
return callback()
], (error) ->
expect(error).to.not.exist
done()
it 'should not throw an error if callback is not passed', ->
expect(auth.logout).to.not.throw(Error)

View File

@ -1,69 +0,0 @@
data = require('../../data/data')
# @nodoc
# TODO: Move to settings
TOKEN_KEY = 'token'
# Save token
#
# The token is saved to $(dataPrefix)/token, which usually equals to $HOME/.resin/token
#
# @param {String} newToken the token
# @param {Function} callback callback(error)
#
# @note The token is saved as plain text.
#
# @todo We should make the token more secure
#
# @example Save Token
# resin.token.saveToken myToken, (error) ->
# throw error if error?
#
exports.saveToken = (newToken, callback) ->
data.setText(TOKEN_KEY, newToken, callback)
# Check if we have any token saved
#
# @param {Function} callback callback(hasToken)
#
# @example Has Token
# resin.token.hasToken (hasToken) ->
# if hasToken
# console.log('It\'s there!')
# else
# console.log('It\'s not there!')
#
exports.hasToken = (callback) ->
data.has(TOKEN_KEY, callback)
# Get saved token value
#
# @param {Function} callback callback(error, token)
#
# @note If the key doesn't exist, undefined and no error is returned
#
# @example Get token
# resin.token.getToken (error, token) ->
# throw error if error?
# if token?
# console.log("My token is: #{token}")
#
exports.getToken = (callback) ->
data.getText(TOKEN_KEY, callback)
# Remove token from the filesystem
#
# @param {Function} callback callback(error)
#
# @note If the token doesn't exist, no action is performed
#
# @example Clear Token
# resin.token.clearToken (error) ->
# throw error if error?
#
exports.clearToken = (callback) ->
data.has TOKEN_KEY, (hasToken) ->
if hasToken
return data.remove(TOKEN_KEY, callback)
else
return callback?(null)

View File

@ -1,123 +0,0 @@
expect = require('chai').expect
async = require('async')
token = require('./token')
settings = require('../../settings')
data = require('../../data/data')
mock = require('../../../../tests/utils/mock')
johnDoeFixture = require('../../../../tests/fixtures/johndoe.json')
janeDoeFixture = require('../../../../tests/fixtures/janedoe.json')
describe 'Token:', ->
beforeEach (done) ->
mock.fs.init()
data.prefix.set(settings.get('dataPrefix'), done)
afterEach ->
mock.fs.restore()
describe 'given a user that is logged in', ->
beforeEach (done) ->
token.saveToken(johnDoeFixture.token, done)
describe '#saveToken()', ->
it 'should overwrite the old token', (done) ->
async.waterfall [
(callback) ->
token.getToken(callback)
(savedToken, callback) ->
expect(savedToken).to.equal(johnDoeFixture.token)
token.saveToken(janeDoeFixture.token, callback)
(callback) ->
token.getToken(callback)
(savedToken, callback) ->
expect(savedToken).to.equal(janeDoeFixture.token)
return callback()
], (error) ->
expect(error).to.not.exist
done()
describe '#hasToken()', ->
it 'should return true', (done) ->
token.hasToken (hasToken) ->
expect(hasToken).to.be.true
done()
describe '#getToken()', ->
it 'should return the token', (done) ->
token.getToken (error, savedToken) ->
expect(error).to.not.exist
expect(savedToken).to.equal(johnDoeFixture.token)
done()
describe '#clearToken()', ->
it 'should effectively clear the token', (done) ->
async.waterfall [
(callback) ->
token.getToken(callback)
(savedToken, callback) ->
expect(savedToken).to.equal(johnDoeFixture.token)
token.clearToken(callback)
(callback) ->
token.getToken(callback)
(savedToken, callback) ->
expect(savedToken).to.be.undefined
return callback()
], (error) ->
expect(error).to.not.exist
done()
describe 'given a user that didn\'t log in', ->
beforeEach (done) ->
token.clearToken(done)
describe '#saveToken()', ->
it 'should save a token', (done) ->
async.waterfall [
(callback) ->
token.saveToken(johnDoeFixture.token, callback)
(callback) ->
token.getToken(callback)
(savedToken, callback) ->
expect(savedToken).to.equal(johnDoeFixture.token)
return callback()
], (error) ->
expect(error).to.not.exist
done()
describe '#hasToken()', ->
it 'should return false', (done) ->
token.hasToken (hasToken) ->
expect(hasToken).to.be.false
done()
describe '#getToken()', ->
it 'should return undefined', (done) ->
token.getToken (error, savedToken) ->
expect(error).to.not.exist
expect(savedToken).to.be.undefined
done()

View File

@ -1,43 +0,0 @@
_ = require('lodash')
mkdirp = require('mkdirp')
errors = require('../_errors/errors')
# @nodoc
prefix = null
# Get current prefix
#
# @return {String} prefix
#
# @example Get prefix
# prefix = resin.data.prefix.get()
#
exports.get = ->
return prefix
# Set prefix
#
# @param {String} newPrefix new prefix
# @param {Function} callback callback (error)
#
# @throw {Error} Will throw if prefix is not a valid path
#
# @example Set prefix
# resin.data.prefix.set '/opt/resin', (error) ->
# throw error if error?
#
exports.set = (newPrefix, callback) ->
if not _.isString(newPrefix)
return callback?(new errors.InvalidPath(newPrefix))
mkdirp newPrefix, (error) ->
return callback?(error) if error?
prefix = newPrefix
return callback?()
# Clear prefix
#
# @example Clear prefix
# resin.data.prefix.clear()
exports.clear = ->
prefix = null

View File

@ -1,96 +0,0 @@
expect = require('chai').expect
_ = require('lodash')
async = require('async')
fs = require('fs')
fsPlus = require('fs-plus')
rimraf = require('rimraf')
dataPrefix = require('./data-prefix')
settings = require('../settings')
mock = require('../../../tests/utils/mock')
describe 'DataPrefix:', ->
beforeEach ->
@prefix = settings.get('dataPrefix')
mock.fs.init()
afterEach ->
mock.fs.restore()
describe 'given no prefix', ->
beforeEach ->
dataPrefix.clear()
describe '#get()', ->
it 'should return nothing', ->
expect(dataPrefix.get()).to.not.exist
describe '#set()', ->
beforeEach (done) ->
rimraf(@prefix, done)
it 'should be able to set a prefix', (done) ->
expect(dataPrefix.get()).to.not.exist
dataPrefix.set @prefix, (error) =>
expect(error).to.not.exist
expect(dataPrefix.get()).to.equal(@prefix)
done()
it 'should throw an error if passing an invalid path', (done) ->
dataPrefix.set { path: '/abc' }, (error) ->
expect(error).to.be.an.instanceof(Error)
done()
it 'should create the directory if it doesn\'t exist', (done) ->
async.waterfall [
(callback) ->
fs.exists @prefix, (exists) ->
return callback(null, exists)
(exists, callback) =>
expect(exists).to.be.false
dataPrefix.set(@prefix, callback)
(callback) =>
fsPlus.isDirectory @prefix, (isDirectory) ->
return callback(null, isDirectory)
(isDirectory, callback) ->
expect(isDirectory).to.be.true
return callback()
], (error) ->
expect(error).to.not.exist
done()
describe 'given a prefix', ->
beforeEach (done) ->
dataPrefix.set(@prefix, done)
describe '#get()', ->
it 'should return the saved prefix', ->
expect(dataPrefix.get()).to.equal(@prefix)
describe '#set()', ->
it 'should be able to override the prefix', (done) ->
newPrefix = "#{settings.get('dataPrefix')}-new"
expect(dataPrefix.get()).to.equal(@prefix)
dataPrefix.set newPrefix, (error) ->
expect(error).to.not.exist
expect(dataPrefix.get()).to.equal(newPrefix)
done()
describe '#clear()', ->
it 'should clear the prefix', ->
expect(dataPrefix.get()).to.equal(@prefix)
dataPrefix.clear()
expect(dataPrefix.get()).to.not.exist

View File

@ -1,149 +0,0 @@
_ = require('lodash')
fs = require('fs')
path = require('path')
rimraf = require('rimraf')
errors = require('../_errors/errors')
exports.prefix = require('./data-prefix')
# TODO: codo doesn't recognises functions in this file
# because they have haltIfNoPrefix before the definition.
# @nodoc
haltIfNoPrefix = (callback) ->
return ->
if not exports.prefix.get()?
throw new Error('Did you forget to set a prefix?')
return callback.apply(null, arguments)
# @nodoc
constructPath = (key) ->
if not _.isString(key)
throw new errors.InvalidKey()
prefix = exports.prefix.get()
return path.join(prefix, key)
# Get data by key
#
# We call "data" to the information saved by the application in order to work properly.
# Examples of data are the token, cached downloads and much more.
#
# @param {String} key path relative to dataPrefix
# @param {Object} options node fs options for when reading the resource
# @param {Function} callback callback(error, value)
#
# @throw {Error} Will throw if data prefix was not previously set
#
# @example Get token
# resin.data.get 'token', encoding: 'utf8', (error, token) ->
# throw error if error?
# console.log(token)
#
# @example Get nested token
# # Note: You should use the appropriate path.sep for your os
# # http://nodejs.org/api/path.html#path_path_sep
# resin.data.get 'my/nested/token', encoding: 'utf8', (error, token) ->
# throw error if error?
# console.log(token)
#
exports.get = haltIfNoPrefix (key, options, callback) ->
exports.has key, (hasKey) ->
if not hasKey
# Pass undefined explicitly, otherwise
# async gets confused
return callback?(null, undefined)
keyPath = constructPath(key)
fs.readFile(keyPath, options, callback)
# Get data by key as text
#
# @param {String} key path relative to dataPrefix
# @param {Function} callback callback(error, value)
#
# @throw {Error} Will throw if data prefix was not previously set
#
# @note This is the same as get(), however it assumes utf8 encoding.
#
# @example Get text data
# resin.data.getText 'myTextFile', (error, data) ->
# throw error if error?
# console.log(data)
#
exports.getText = haltIfNoPrefix (key, callback) ->
exports.get(key, encoding: 'utf8', callback)
# Set/Update a data resource
#
# @param {String} key path relative to dataPrefix
# @param {String, Buffer} value key value
# @param {Object} options node fs options for when reading the resource
# @param {Function} callback callback(error)
#
# @throw {Error} Will throw if data prefix was not previously set
#
# @note You can save a buffer, but we strongly recommend saving plain text when possible
#
# @example Set value
# resin.data.set 'customValue', 'Hello World', encoding: 'utf8', (error) ->
# throw error if error?
# console.log("Value saved to #{resin.data.prefix.get()}/customValue")
#
exports.set = haltIfNoPrefix (key, value, options, callback) ->
keyPath = constructPath(key)
fs.writeFile(keyPath, value, options, callback)
# Set/Update a data resource as text
#
# @param {String} key path relative to dataPrefix
# @param {String, Buffer} value key value
# @param {Function} callback callback(error)
#
# @throw {Error} Will throw if data prefix was not previously set
#
# @note This is the same as set(), however it assumes utf8 encoding.
#
# @example Set text data
# resin.data.setText 'greeting/en', 'Hello World!', (error) ->
# throw error if error?
#
exports.setText = haltIfNoPrefix (key, value, callback) ->
exports.set(key, value, encoding: 'utf8', callback)
# Check if value exists
#
# @param {String} key path relative to dataPrefix
# @param {Function} callback callback(hasKey)
#
# @throw {Error} Will throw if data prefix was not previously set
#
# @example Has value
# resin.data.has 'foo/bar', (hasFooBar) ->
# if hasFooBar
# console.log('It\'s there!')
# else
# console.log('It\'s not there!')
#
exports.has = haltIfNoPrefix (key, callback) ->
keyPath = constructPath(key)
fs.exists(keyPath, callback)
# Remove a key
#
# @param {String} key path relative to dataPrefix
# @param {Function} callback callback(error)
#
# @throw {Error} Will throw if data prefix was not previously set
#
# @example Remove token
# resin.data.remove 'token', (error) ->
# throw error if error?
#
exports.remove = haltIfNoPrefix (key, callback = _.noop) ->
try
keyPath = constructPath(key)
catch error
return callback(error)
rimraf(keyPath, callback)

View File

@ -1,250 +0,0 @@
expect = require('chai').expect
_ = require('lodash')
fsPlus = require('fs-plus')
sinon = require('sinon')
mock = require('../../../tests/utils/mock')
async = require('async')
settings = require('../settings')
data = require('./data')
describe 'Data:', ->
describe 'given no prefix', ->
describe '#get()', ->
it 'should throw an error', ->
getDataKey = _.partial(data.get, 'foobar')
expect(getDataKey).to.throw(Error)
describe '#set()', ->
it 'should throw an error', ->
setDataKey = _.partial(data.set, 'foobar', 'Foo Bar!')
expect(setDataKey).to.throw(Error)
describe '#remove()', ->
it 'should throw an error', ->
removeDataKey = _.partial(data.remove, 'foobar')
expect(removeDataKey).to.throw(Error)
describe '#has()', ->
it 'should throw an error', ->
hasDataKey = _.partial(data.has, 'foobar')
expect(hasDataKey).to.throw(Error)
describe 'given a prefix', ->
FILESYSTEM =
text:
name: "#{settings.get('dataPrefix')}/text"
contents: 'Hello World'
key: 'text'
directory:
name: "#{settings.get('dataPrefix')}/directory"
contents: {}
key: 'directory'
nested:
name: "#{settings.get('dataPrefix')}/nested/text"
contents: 'Nested Hello World'
key: 'nested/text'
beforeEach (done) ->
mock.fs.init(FILESYSTEM)
data.prefix.set(settings.get('dataPrefix'), done)
afterEach ->
mock.fs.restore()
data.prefix.clear()
describe '#get()', ->
it 'should be able to read a valid key', (done) ->
data.get FILESYSTEM.text.key, encoding: 'utf8', (error, value) ->
expect(error).to.not.exist
expect(value).to.equal(FILESYSTEM.text.contents)
done()
it 'should be able to read a nested key', (done) ->
data.get FILESYSTEM.nested.key, encoding: 'utf8', (error, value) ->
expect(error).to.not.exist
expect(value).to.equal(FILESYSTEM.nested.contents)
done()
it 'should return undefined if reading an invalid key', (done) ->
data.get 'nonexistantkey', encoding: 'utf8', (error, value) ->
expect(error).to.not.exist
expect(value).to.be.undefined
done()
it 'should return an error if not reading a file', (done) ->
data.get FILESYSTEM.directory.key, encoding: 'utf8', (error, value) ->
expect(error).to.be.an.instanceof(Error)
expect(value).to.not.exist
done()
it 'should return undefined if key doesn\'t exists', (done) ->
data.get 'nontexistantkey', encoding: 'utf8', (error, value) ->
expect(error).to.not.exist
expect(value).to.be.undefined
done()
describe '#getText()', ->
it 'should be able to read a valid key', (done) ->
data.getText FILESYSTEM.text.key, (error, value) ->
expect(error).to.not.exist
expect(value).to.equal(FILESYSTEM.text.contents)
done()
it 'should call get(), assumming utf8 encoding', (done) ->
mock.fs.restore()
dataGetSpy = sinon.spy(data, 'get')
mock.fs.init(FILESYSTEM)
key = FILESYSTEM.text.key
callback = (error, value) ->
expect(dataGetSpy).to.have.been.called
expect(dataGetSpy).to.have.been.calledWith(key, encoding: 'utf8', callback)
dataGetSpy.restore()
done()
data.getText(key, callback)
describe '#has()', ->
it 'should return true if a file exists', (done) ->
data.has FILESYSTEM.text.key, (hasKey) ->
expect(hasKey).to.be.true
done()
it 'should return true if a directory exists', (done) ->
data.has FILESYSTEM.directory.key, (hasKey) ->
expect(hasKey).to.be.true
done()
it 'should return false if the file doesn\'t exists', (done) ->
data.has 'foobar', (hasKey) ->
expect(hasKey).to.be.false
done()
describe '#set()', ->
writeAndCheckFixture = (fixture) ->
return (done) ->
filename = fixture.filename
contents = fixture.contents
async.waterfall [
(callback) ->
data.get filename, encoding: 'utf8', (error, value) ->
expect(error).to.not.exist
expect(value).to.be.undefined
return callback()
(callback) ->
data.set(filename, contents, encoding: 'utf8', callback)
(callback) ->
data.get(filename, encoding: 'utf8', callback)
(value, callback) ->
expect(value).to.equal(contents)
return callback()
], (error) ->
expect(error).to.not.exist
done()
FILES_FIXTURES =
hello:
filename: 'hello_world.test'
contents: 'Hello World!'
nested:
filename: 'nested/hello_world.test'
contents: 'Nested Hello World!'
it('should be able to write a file', writeAndCheckFixture(FILES_FIXTURES.hello))
it('should be able to write a nested file', writeAndCheckFixture(FILES_FIXTURES.nested))
describe '#setText()', ->
it 'should call set(), assumming utf8 encoding', (done) ->
mock.fs.restore()
dataSetSpy = sinon.spy(data, 'set')
mock.fs.init(FILESYSTEM)
key = FILESYSTEM.text.key
contents = 'Hello World'
callback = (error, value) ->
expect(dataSetSpy).to.have.been.called
expect(dataSetSpy).to.have.been.calledWith(key, contents, encoding: 'utf8', callback)
dataSetSpy.restore()
done()
data.setText(key, contents, callback)
describe '#remove()', ->
removeAndCheckFile = (file) ->
return (done) ->
key = file.key
async.waterfall [
(callback) ->
data.get(key, encoding: 'utf8', callback)
(value, callback) ->
expect(value).to.equal(file.contents)
data.remove(key, callback)
(callback) ->
data.get key, encoding: 'utf8', (error, value) ->
expect(error).to.not.exist
expect(value).to.be.undefined
return callback()
], (error) ->
expect(error).to.not.exist
done()
it('should be able to remove a file', removeAndCheckFile(FILESYSTEM.text))
it('should be able to remove a nested file', removeAndCheckFile(FILESYSTEM.nested))
it 'should be able to remove a directory', (done) ->
directory = FILESYSTEM.directory
async.waterfall [
(callback) ->
fsPlus.isDirectory directory.name, (isDirectory) ->
return callback(null, isDirectory)
(isDirectory, callback) ->
expect(isDirectory).to.be.true
data.remove(directory.key, callback)
(callback) ->
data.has directory.key, (hasKey) ->
expect(hasKey).to.be.false
return callback()
], (error) ->
expect(error).to.not.exist
done()
it 'should return an error if key is invalid', (done) ->
data.remove [ 1, 2, 3 ], (error) ->
expect(error).to.be.an.instanceof(Error)
done()
it 'should not throw an error if no callback is passed', ->
func = _.partial(data.remove, FILESYSTEM.directory.key)
expect(func).to.not.throw(Error)

View File

@ -1,6 +0,0 @@
module.exports =
models: require('./models')
data: require('./data/data')
auth: require('./auth/auth')
vcs: require('./vcs/vcs')
settings: require('./settings')

View File

@ -1,29 +0,0 @@
_ = require('lodash')
Promise = require('bluebird')
PinejsClientCore = require('pinejs-client-js')(_, Promise)
settings = require('../settings')
server = require('../_server/server')
promisifiedServerRequest = Promise.promisify(server.request, server)
class PinejsClientRequest extends PinejsClientCore
# Trigger a request to the resin.io API
#
# Makes use of [pinejs-client-js](https://bitbucket.org/rulemotion/pinejs-client-js)
#
# @private
#
# @param {Object} params request params (same as node-request params)
#
# @note You shouldn't make use of this method directly, but through models
#
_request: (params) ->
params.json = params.data
params.gzip ?= true
promisifiedServerRequest(params).spread (response, body) ->
if 200 <= response.statusCode < 300
return body
throw new Error(body)
module.exports = new PinejsClientRequest
apiPrefix: settings.get('apiPrefix')

View File

@ -1,48 +0,0 @@
nock = require('nock')
url = require('url')
chai = require('chai')
chaiAsPromised = require('chai-as-promised')
expect = chai.expect
chai.use(chaiAsPromised)
data = require('../data/data')
mock = require('../../../tests/utils/mock')
pine = require('./_pine')
settings = require('../settings')
describe 'Pine:', ->
URI =
application: url.resolve(settings.get('apiPrefix'), 'application')
RESPONSE =
applications:
d: [
{ id: 1 }
{ id: 2 }
]
beforeEach (done) ->
mock.fs.init()
nock(settings.get('remoteUrl'))
.get(URI.application)
.reply(200, RESPONSE.applications)
data.prefix.set(settings.get('dataPrefix'), done)
afterEach ->
mock.fs.restore()
before ->
mock.connection.init()
after ->
mock.connection.restore()
it 'should construct the correct url', ->
promise = pine.get
resource: 'application'
expect(promise).to.become(RESPONSE.applications.d)

View File

@ -1,130 +0,0 @@
_ = require('lodash-contrib')
pine = require('./_pine')
deviceModel = require('./device')
errors = require('../_errors/errors')
server = require('../_server/server')
settings = require('../settings')
# Get all applications
#
# @param {Function} callback callback(error, applications)
#
# @throw {NotAny} Will throw if no applications were found
#
# @example Get all applications
# resin.models.application.getAll (error, applications) ->
# throw error if error?
# console.log(applications)
#
exports.getAll = (callback) ->
return pine.get
resource: 'application'
options:
orderby: 'app_name asc'
expand: 'device'
.then (applications) ->
if _.isEmpty(applications)
return callback(new errors.NotAny('applications'))
# TODO: It might be worth to do all these handy
# manipulations server side directly.
applications = _.map applications, (application) ->
application.device_display_name = deviceModel.getDisplayName(application.device_type)
application.online_devices = _.where(application.device, is_online: 1).length
application.devices_length = application.device?.length or 0
return application
return callback(null, applications)
.catch (error) ->
return callback(error)
# Get a single application
#
# @param {String, Number} id application id
# @param {Function} callback callback(error, application)
#
# @throw {NotFound} Will throw if application was not found
#
# @example Find application
# resin.models.application.get 51, (error, application) ->
# throw error if error?
# console.log(application)
#
exports.get = (id, callback) ->
return pine.get
resource: 'application'
id: id
.then (application) ->
if not application?
return callback(new errors.NotFound("application #{id}"))
application.device_display_name = deviceModel.getDisplayName(application.device_type)
return callback(null, application)
.catch (error) ->
return callback(error)
# Create an application
#
# @param {String} name application name
# @param {String} deviceType device type (slug form)
# @param {Function} callback callback(error, id)
#
# @throw {NotFound} Will throw if the request doesn't returns an id
#
# @example Create an application
# resin.models.application.create 'My App', 'raspberry-pi', (error, id) ->
# throw error if error?
# console.log(id)
#
exports.create = (name, deviceType, callback) ->
return pine.post
resource: 'application'
data:
app_name: name
device_type: deviceType
.then (res) ->
id = res?.id
if not id?
return callback(new errors.NotFound('created application id'))
return callback(null, id)
.catch (error) ->
return callback(error)
# Remove application
#
# @param {String, Number} id application id
# @param {Function} callback callback(error)
#
# @example Remove application
# resin.models.application.remove 51, (error) ->
# throw error if error?
#
exports.remove = (id, callback) ->
return pine.delete
resource: 'application'
id: id
.then ->
return callback()
.catch (error) ->
return callback(error)
# Restart application
#
# @param {String, Number} id application id
# @param {Function} callback callback(error)
#
# @example Restart application
# resin.models.application.restart 51, (error) ->
# throw error if error?
#
exports.restart = (id, callback) ->
url = _.template(settings.get('urls.applicationRestart'), { id })
server.post(url, _.unary(callback))

View File

@ -1,10 +0,0 @@
{
"Raspberry Pi": {
"slug": "raspberry-pi",
"names": [
"raspberry-pi",
"raspberrypi",
"rpi"
]
}
}

View File

@ -1,220 +0,0 @@
pine = require('./_pine')
_ = require('lodash-contrib')
errors = require('../_errors/errors')
server = require('../_server/server')
settings = require('../settings')
DEVICES = require('./device-data.json')
# Get all devices
#
# @param {Function} callback callback(error, devices)
#
# @throw {NotAny} Will throw if no devices were found
#
# @example Get all devices
# resin.models.devices.getAll (error, devices) ->
# throw error if error?
# console.log(devices)
#
exports.getAll = (callback) ->
return pine.get
resource: 'device'
options:
expand: 'application'
orderby: 'name asc'
.then (devices) ->
if _.isEmpty(devices)
return callback(new errors.NotAny('devices'))
return callback(null, devices)
.catch (error) ->
return callback(error)
# Get all devices by application
#
# @param {String, Number} applicationId application id
# @param {Function} callback callback(error, devices)
#
# @throw {NotAny} Will throw if no devices were found
#
# @example Get all devices by application
# resin.models.devices.getAllByApplication (error, devices) ->
# throw error if error?
# console.log(devices)
#
exports.getAllByApplication = (applicationId, callback) ->
return pine.get
resource: 'device'
options:
filter:
application: applicationId
expand: 'application'
orderby: 'name asc'
.then (devices) ->
if _.isEmpty(devices)
return callback(new errors.NotAny('devices'))
# TODO: Move to server
devices = _.map devices, (device) ->
device.application_name = device.application[0].app_name
device.device_display_name = exports.getDisplayName(device.device_type)
return device
return callback(null, devices)
.catch (error) ->
return callback(error)
# Get a single device
#
# @param {String, Number} id device id
# @param {Function} callback callback(error, device)
#
# @throw {NotFound} Will throw if device was not found
#
# @example Find device
# resin.models.device.get 51, (error, device) ->
# throw error if error?
# console.log(device)
#
exports.get = (deviceId, callback) ->
return pine.get
resource: 'device'
id: deviceId
options:
expand: 'application'
.then (device) ->
if not device?
return callback(new errors.NotFound("device #{id}"))
# TODO: Move to server
device.application_name = device.application[0].app_name
device.device_display_name = exports.getDisplayName(device.device_type)
return callback(null, device)
.catch (error) ->
return callback(error)
# Remove device
#
# @param {String, Number} id device id
# @param {Function} callback callback(error)
#
# @example Remove device
# resin.models.device.remove 51, (error) ->
# throw error if error?
#
exports.remove = (id, callback) ->
return pine.delete
resource: 'device'
id: id
.then ->
return callback()
.catch (error) ->
return callback(error)
# Identify device
#
# @param {String} uuid device uuid
# @param {Function} callback callback(error)
#
# @example Identify device
# resin.models.device.identify '23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a21369ac0f00db828', (error) ->
# throw error if error?
#
exports.identify = (uuid, callback) ->
server.post(settings.get('urls.identify'), { uuid }, _.unary(callback))
# Rename device
#
# @param {String, Number} id device id
# @param {String} name the device new name
# @param {Function} callback callback(error)
#
# @example Rename device
# resin.models.device.rename 317, 'NewName', (error) ->
# throw error if error?
# console.log("Device has been renamed!")
#
exports.rename = (id, name, callback) ->
return pine.patch
resource: 'device'
id: id
data:
name: name
.then ->
return callback()
.catch (error) ->
return callback(error)
# Note a device
#
# @param {String, Number} id device id
# @param {String} note the note
# @param {Function} callback callback(error)
#
# @example Note device
# resin.models.device.note 317, 'My useful note', (error) ->
# throw error if error?
# console.log("Device has been noted!")
#
exports.note = (id, note, callback) ->
return pine.patch
resource: 'device'
id: id
data:
note: note
.then ->
return callback()
.catch (error) ->
return callback(error)
# Get display name for a device
#
# For a list of supported devices, see getSupportedDeviceTypes()
#
# @param {String} device device name
# @return {String} device display name or 'Unknown'
#
# @example Get display name
# console.log resin.models.device.getDisplayName('raspberry-pi') # Raspberry Pi
# console.log resin.models.device.getDisplayName('rpi') # Raspberry Pi
#
exports.getDisplayName = (device) ->
if _.indexOf(exports.getSupportedDeviceTypes(), device) isnt -1
return device
for key, value of DEVICES
if _.indexOf(value.names, device) isnt -1
return key
return 'Unknown'
# Get device slug
#
# @param {String} device device name
# @return {String} device slug or 'unknown'
#
# @example Get device slug
# console.log resin.models.device.getDeviceSlug('Raspberry Pi') # raspberry-pi
#
exports.getDeviceSlug = (device) ->
displayName = exports.getDisplayName(device)
return DEVICES[displayName]?.slug or 'unknown'
# Get a list of supported device types
#
# @return {Array<String>} a list of all supported devices, by their display names
#
# @example Get all supported devices
# devices = resin.models.device.getSupportedDevicesTypes()
# console.log(devices)
#
exports.getSupportedDeviceTypes = ->
return _.keys(DEVICES)

View File

@ -1,59 +0,0 @@
_ = require('lodash')
expect = require('chai').expect
device = require('./device')
DEVICES = require('./device-data.json')
describe 'Device:', ->
describe '#getDisplayName()', ->
it 'should return Raspberry Pi for that device', ->
possibleNames = [
'raspberry-pi'
'raspberrypi'
'rpi'
]
for name in possibleNames
expect(device.getDisplayName(name)).to.equal('Raspberry Pi')
it 'should return unknown if no matches', ->
unknownNames = [
'hello'
'foobar'
{}
123
]
for name in unknownNames
expect(device.getDisplayName(name)).to.equal('Unknown')
it 'should return the name itself if passing the display name', ->
for supportedDevice in device.getSupportedDeviceTypes()
displayName = device.getDisplayName(supportedDevice)
expect(displayName).to.equal(supportedDevice)
describe '#getDeviceSlug()', ->
it 'should return valid slugs', ->
for key, value in DEVICES
expect(device.getDeviceSlug(key)).to.equal(value.slug)
it 'should return unknown if not valid device', ->
result = device.getDeviceSlug('Foo Bar')
expect(result).to.equal('unknown')
it 'should return a valid slug if using an alternative name', ->
for key, value in DEVICES
name = _.first(value.names)
expect(device.getDeviceSlug(name)).to.equal(value.slug)
describe '#getSupportedDeviceTypes()', ->
it 'should return an array', ->
expect(device.getSupportedDeviceTypes()).to.be.an.instanceof(Array)
it 'should have every supported device', ->
supportedDevices = device.getSupportedDeviceTypes()
for key, value in DEVICES
expect(supportedDevices.indexOf(key)).to.not.equal(-1)

View File

@ -1,97 +0,0 @@
pine = require('./_pine')
errors = require('../_errors/errors')
# Get all environment variables by application
#
# @param {String, Number} applicationId application id
# @param {Function} callback callback(error, environmentVariables)
#
# @throw {NotFound} Will throw if no environment variable was found
#
# @example Get all environment variables by application
# resin.models.environmentVariables.getAll (error, environmentVariables) ->
# throw error if error?
# console.log(environmentVariables)
#
exports.getAllByApplication = (applicationId, callback) ->
return pine.get
resource: 'environment_variable'
options:
filter:
application: applicationId
orderby: 'name asc'
.then (environmentVariables) ->
if not environmentVariables?
return callback(new errors.NotFound('environment variables'))
return callback(null, environmentVariables)
.catch (error) ->
return callback(error)
# Create an environment variable for an application
#
# @param {String, Number} applicationId application id
# @param {String} name environment variable name
# @param {String} value environment variable value
# @param {Function} callback callback(error)
#
# @example Create an environment variable
# resin.models.environmentVariables.create 91, 'EDITOR', 'vim', (error) ->
# throw error if error?
#
exports.create = (applicationId, name, value, callback) ->
return pine.post
resource: 'environment_variable'
data:
name: name
value: value
application: applicationId
.then ->
return callback()
.catch (error) ->
return callback(error)
# Update an environment variable value from an application
#
# @param {String, Number} applicationId application id
# @param {String} value environment variable value
# @param {Function} callback callback(error)
#
# @example Update an environment variable
# resin.models.environmentVariables.update 317, 'vim', (error) ->
# throw error if error?
#
exports.update = (id, value, callback) ->
return pine.patch
resource: 'environment_variable'
id: id
data:
value: value
.then ->
return callback()
.catch (error) ->
return callback(error)
# Remove environment variable
#
# @param {String, Number} id environment variable id
# @param {Function} callback callback(error)
#
# @example Remove environment variable
# resin.models.environmentVariables.remove 51, (error) ->
# throw error if error?
#
exports.remove = (id, callback) ->
return pine.delete
resource: 'environment_variable'
id: id
.then ->
return callback()
.catch (error) ->
return callback(error)

View File

@ -1,6 +0,0 @@
module.exports =
application: require('./application')
device: require('./device')
key: require('./key')
environmentVariables: require('./environment-variables')
os: require('./os')

View File

@ -1,82 +0,0 @@
_ = require('lodash-contrib')
server = require('../_server/server')
settings = require('../settings')
errors = require('../_errors/errors')
# TODO: Do this with pinejs once it's exposed as an OData API
# Get all ssh keys
#
# @param {Function} callback callback(error, keys)
#
# @throw {NotAny} Will throw if no keys were found
#
# @example Get all keys
# resin.models.key.getAll (error, keys) ->
# throw error if error?
# console.log(keys)
#
exports.getAll = (callback) ->
url = settings.get('urls.keys')
server.get url, (error, response, keys) ->
return callback(error) if error?
if _.isEmpty(keys)
return callback(new errors.NotAny('keys'))
return callback(null, keys)
# Get a single ssh key
#
# @param {String, Number} id key id
# @param {Function} callback callback(error, key)
#
# @throw {NotFound} Will throw if key was not found
#
# @example Find key
# resin.models.key.get 51, (error, key) ->
# throw error if error?
# console.log(key)
#
exports.get = (id, callback) ->
url = settings.get('urls.keys')
server.get url, (error, response, keys) ->
return callback(error) if error?
key = _.findWhere(keys, { id })
if not key?
return callback(new errors.NotFound("key #{id}"))
return callback(null, key)
# Remove ssh key
#
# @param {String, Number} id key id
# @param {Function} callback callback(error)
#
# @example Remove key
# resin.models.key.remove 51, (error) ->
# throw error if error?
#
exports.remove = (id, callback) ->
url = settings.get('urls.sshKey')
url = _.template(url, { id })
server.delete(url, _.unary(callback))
# Create a ssh key
#
# @param {String} title key title
# @param {String} key the public ssh key
# @param {Function} callback callback(error)
#
# @todo We should return an id for consistency with the other models
#
# @example Create a key
# resin.models.key.create 'Main', 'ssh-rsa AAAAB....', (error) ->
# throw error if error?
#
exports.create = (title, key, callback) ->
url = settings.get('urls.keys')
data = { title, key }
server.post(url, data, _.unary(callback))

View File

@ -1,15 +0,0 @@
url = require('url')
fs = require('fs')
server = require('../_server/server')
settings = require('../settings')
exports.download = (parameters, destination, callback, onProgress) ->
query = url.format(query: parameters)
downloadUrl = url.resolve(settings.get('urls.download'), query)
server.request
method: 'GET'
url: downloadUrl
pipe: fs.createWriteStream(destination)
, callback
, onProgress

View File

@ -1,54 +0,0 @@
path = require('path')
userHome = require('user-home')
helpers = require('./_helpers/helpers')
ConfJS = require('conf.js')
settings =
remoteUrl: 'https://staging.resin.io'
apiPrefix: '/ewa/'
dataPrefix: path.join(userHome, '.resin')
sshKeyWidth: 43
gitRemote: 'resin'
directories:
plugins: 'plugins'
os: 'os'
localConfig: '.resinconf'
keys:
username: 'username'
files:
config: 'config'
pubnub:
subscribe_key: 'sub-c-bbc12eba-ce4a-11e3-9782-02ee2ddab7fe'
publish_key: 'pub-c-6cbce8db-bfd1-4fdf-a8c8-53671ae2b226'
ssl: true
events:
deviceLogs: 'device-<%= uuid %>-logs'
urls:
signup: '/signup'
preferences: '/preferences'
register: '/user/register'
keys: '/user/keys'
identify: '/blink'
authenticate: '/login_'
applicationRestart: '/application/<%= id %>/restart'
sshKey: '/user/keys/<%= id %>'
download: '/download'
settings.directories = helpers.prefixObjectValuesWithPath(settings.dataPrefix, settings.directories)
settings.files = helpers.prefixObjectValuesWithPath(settings.dataPrefix, settings.files)
module.exports = new ConfJS
keys:
userConfig: 'files.config'
localConfig: 'localConfig'
default: settings

View File

@ -1,266 +0,0 @@
fs = require('fs')
fsPlus = require('fs-plus')
_ = require('lodash')
async = require('async')
path = require('path')
gitCli = require('git-cli')
errors = require('../../_errors/errors')
settings = require('../../settings')
# TODO: Refactor somewhere else and reuse trough all modules
# @nodoc
nodeify = (func) ->
return ->
return func.call(null, null, arguments...)
# Get git directory for a certain path
#
# By git directory, we mean the hidden .git folder that every git repository have
#
# @private
#
# @param {String} directory the directory path
# @throw {Error} Will throw if directory is not a string
# @return {String} the absolute path to the child .git directory
#
# @note This function doesn't check if the path is valid, it only constructs it.
#
# @example Get git directory
# result = getGitDirectory('/opt/projects/myapp')
# console.log(result)
# # /opt/projects/myapp/.git
#
exports.getGitDirectory = (directory) ->
return if not directory?
if not _.isString(directory)
throw new Error('Invalid git directory')
return path.join(directory, '.git')
# Get current git directory
#
# Get the path to the .git directory in the current directory
#
# @private
#
# @return {String} the absolute path to the current directory's .git folder
#
# @note The current directory is determined by from where you ran the app
#
# @example Get current git directory
# $ cd /Users/me/Projects/foobar && resin ...
# result = getCurrentGitDirectory()
# console.log(result)
# # /Users/me/Projects/foobar/.git
#
exports.getCurrentGitDirectory = ->
currentDirectory = process.cwd()
return exports.getGitDirectory(currentDirectory)
# Check if a directory is a git repository
#
# @private
#
# @param {String} directory the directory
# @param {Function} callback callback(error, isGitRepository)
#
# @throw {DirectoryDoesntExist} Will throw if directory doesn't exist
#
# @example Is git repository?
# isGitRepository 'my/git/repo', (error, isGitRepository) ->
# throw error if error?
# if isGitRepository
# console.log('Yes, it\'s a git repo!')
# else
# console.log('I should use git here!')
#
exports.isGitRepository = (directory, callback) ->
gitDirectory = exports.getGitDirectory(directory)
async.waterfall([
(callback) ->
fs.exists(directory, nodeify(callback))
(exists, callback) ->
return callback() if exists
error = new errors.DirectoryDoesntExist(directory)
return callback(error)
(callback) ->
fsPlus.isDirectory(gitDirectory, nodeify(callback))
], callback)
# Get repository instance
#
# An instance of a [gitCli](https://github.com/tuvistavie/node-git-cli) repository, for internal usage.
#
# @private
#
# @param {String} directory the directory
# @param {Function} callback callback(error, repository)
#
# @throw {Error} Will throw if directory is not a git repository.
#
# @example Get repository instance
# getRepositoryInstance 'my/git/repo', (error, repository) ->
# throw error if error?
# # I can now use gitCli functions on `repository`
#
exports.getRepositoryInstance = (directory, callback) ->
exports.isGitRepository directory, (error, isGitRepository) ->
return callback(error) if error?
if not isGitRepository
error = new Error("Not a git directory: #{directory}")
return callback(error)
gitDirectory = exports.getGitDirectory(directory)
repository = new gitCli.Repository(gitDirectory)
return callback(null, repository)
# Check if an application is a git app
#
# @private
#
# @param {Object} application an application from resin API
# @return {Boolean} wheter is a valid git application or not
#
# @note All it does is check if the application object contains a valid git_repository field.
# @todo We should also test that the string contained in git_repository is a valid url.
#
# @example Is valid git application?
# resin.models.application.get 91, (error, application) ->
# throw error if error?
# result = isValidGitApplication(application)
# console.log(result)
# # True
#
exports.isValidGitApplication = (application) ->
gitRepository = application.git_repository
return false if not gitRepository?
return false if not _.isString(gitRepository)
return true
# Check if a repository has a certain remote
#
# @private
#
# @param {Object} repository a repository instance from getRepositoryInstance()
# @param {String} name the name of the remote to check for
# @param {Function} callback callback(error, hasRemote)
#
# @todo We should extract the logic that lists all remotes into a separate function.
#
# @example Has origin remote?
# repository = getRepositoryInstance('my/git/repo')
# hasRemote repository, 'origin', (error, hasRemote) ->
# throw error if error?
# if hasRemote
# console.log('It has an origin remote!')
# else
# console.log('It doesn\'t has an origin remote!')
#
exports.hasRemote = (repository, name, callback) ->
repository.listRemotes null, (error, remotes) ->
return callback(error) if error?
hasRemote = _.indexOf(remotes, name) isnt -1
return callback(null, hasRemote)
# Add a remote to a git repository
#
# @private
#
# @param {Object} repository a repository instance from getRepositoryInstance()
# @param {String} name the name of the remote to add
# @param {String} url url of the new remote
# @param {Function} callback callback(error)
#
# @throw {Error} Will throw if name is not a string
#
# @todo We should check the validity of all arguments.
# @todo This function should be better tested
#
# @example Add resin remote
# repository = getRepositoryInstance('my/git/repo')
# addRemote repository, 'resin', 'git@git.resin.io:johndoe/app.git', (error) ->
# throw error if error?
#
# $ cd my/git/repo && git remote -v
# resin git@git.resin.io:johndoe/app.git (fetch)
# resin git@git.resin.io:johndoe/app.git (push)
#
exports.addRemote = (repository, name, url, callback) ->
if not _.isString(name)
error = new Error("Invalid remote name: #{name}")
return callback(error)
repository.addRemote(name, url, callback)
# Initialize an application project
#
# - Add the corresponding git remote.
#
# @param {Object} application an application from resin API
# @param {String} directory the directory to initialize
# @param {Function} callback callback(error)
#
# @throw {Error} Will throw if application is not a valid application
#
# @note The directory should already be a git repo (maybe we should take care of git init as well here if necessary?)
# @todo This function should be better tested
#
# @example Init project
# resin.models.application.get 91, (error, application) ->
# throw error if error?
#
# initProjectWithApplication application, 'my/new/project', (error) ->
# throw error if error?
#
exports.initProjectWithApplication = (application, directory, callback) ->
async.waterfall([
(callback) ->
isValid = exports.isValidGitApplication(application)
return callback() if isValid
error = new Error("Invalid application: #{application}")
return callback(error)
(callback) ->
exports.getRepositoryInstance(directory, callback)
(repository, callback) ->
gitUrl = application.git_repository
gitRemoteName = settings.get('gitRemote')
exports.addRemote(repository, gitRemoteName, gitUrl, callback)
], callback)
# Check if an application was already initialized
#
# It checks if we have a resin remote added already.
#
# @param {String} directory the directory
# @param {Function} callback callback(error, isResinProject)
#
# @todo Find a way to test this function
#
# @example Was application initialized?
# isResinProject 'my/resin/app', (error, initialized) ->
# if initialized
# console.log('It\'s already a resin app!')
# else
# console.log('It\'s just a boring project! It should be resinified!')
#
exports.isResinProject = (directory, callback) ->
async.waterfall([
(callback) ->
exports.getRepositoryInstance(directory, callback)
(repository, callback) ->
gitRemoteName = settings.get('gitRemote')
exports.hasRemote(repository, gitRemoteName, callback)
], callback)

View File

@ -1,231 +0,0 @@
_ = require('lodash')
path = require('path')
sinon = require('sinon')
gitCli = require('git-cli')
chai = require('chai')
expect = chai.expect
git = require('./git')
mock = require('../../../../tests/utils/mock')
settings = require('../../settings')
describe 'VCS Git:', ->
describe '#getGitDirectory()', ->
it 'should append .git', ->
result = git.getGitDirectory('foobar')
expect(result).to.equal("foobar#{path.sep}.git")
it 'should return undefined if no directory', ->
for input in [ undefined, null ]
result = git.getGitDirectory(input)
expect(result).to.be.undefined
it 'should throw an error if directory is not a string', ->
for input in [
123
{ hello: 'world' }
[ 1, 2, 3 ]
true
false
]
func = _.partial(git.getGitDirectory, input)
expect(func).to.throw(Error)
describe '#getCurrentGitDirectory()', ->
it 'should append .git to current working directory', ->
result = git.getCurrentGitDirectory()
expectedResult = path.join(process.cwd(), '.git')
expect(result).to.equal(expectedResult)
describe '#getRepositoryInstance()', ->
filesystem =
gitRepo:
name: '/repo'
contents:
'.git': {}
beforeEach ->
mock.fs.init(filesystem)
afterEach ->
mock.fs.restore()
it 'should throw an error if directory does not exist', (done) ->
git.getRepositoryInstance '/foobar', (error, repository) ->
expect(error).to.be.an.instanceof(Error)
expect(repository).to.not.exist
done()
it 'should return a repository', (done) ->
repo = filesystem.gitRepo
git.getRepositoryInstance repo.name, (error, repository) ->
expect(error).to.not.exist
expect(repository).to.exist
expectedPath = path.join(repo.name, '.git')
expect(repository.path).to.equal(expectedPath)
done()
describe '#isValidGitApplication()', ->
it 'should return false if no git_repository', ->
result = git.isValidGitApplication({})
expect(result).to.be.false
it 'should return false if git_repository is not a string', ->
result = git.isValidGitApplication(git_repository: [ 1, 2, 3 ])
expect(result).to.be.false
it 'should return true if git_repository is valid', ->
repositoryUrl = 'git@git.resin.io:johndoe/app.git'
result = git.isValidGitApplication(git_repository: repositoryUrl)
expect(result).to.be.true
describe '#hasRemote()', ->
mockListRemotes = (result) ->
return (options, callback) ->
return callback(null, result)
beforeEach ->
@repository =
listRemotes: mockListRemotes([ 'resin', 'origin' ])
it 'should return true if it has the remote', (done) ->
git.hasRemote @repository, 'resin', (error, hasRemote) ->
expect(error).to.not.exist
expect(hasRemote).to.be.true
done()
it 'should return false if it does not have the remote', (done) ->
git.hasRemote @repository, 'foobar', (error, hasRemote) ->
expect(error).to.not.exist
expect(hasRemote).to.be.false
done()
describe '#addRemote()', ->
beforeEach ->
@repository =
addRemote: (name, url, callback) ->
return callback()
@name = 'resin'
@url = 'git@git.resin.io:johndoe/app.git'
# TODO: It'd be nice if we could actually test that
# the remote was added to .git/config, but sadly
# mockFs and child_process.exec don't seem to play well together.
it 'should call repository.addRemote with the correct parameters', (done) ->
addRemoteSpy = sinon.spy(@repository, 'addRemote')
callback = (error) =>
expect(error).to.not.exist
expect(addRemoteSpy).to.have.been.calledWithExactly(@name, @url, callback)
addRemoteSpy.restore()
done()
git.addRemote(@repository, @name, @url, callback)
it 'should throw an error if name is not a string', (done) ->
git.addRemote @repository, undefined, @url, (error) ->
expect(error).to.be.an.instanceof(Error)
done()
describe '#isGitRepository()', ->
filesystem =
gitRepo:
name: '/repo'
contents:
'.git': {}
notGitRepo:
name: '/not-repo'
contents: {}
invalidGitRepo:
name: '/invalid-repo'
contents:
'.git': 'Plain text file'
beforeEach ->
mock.fs.init(filesystem)
afterEach ->
mock.fs.restore()
it 'should return true if it has a .git directory', (done) ->
git.isGitRepository filesystem.gitRepo.name, (error, isGitRepo) ->
expect(error).to.not.exist
expect(isGitRepo).to.be.true
done()
it 'should return false if it does not have a .git directory', (done) ->
git.isGitRepository filesystem.notGitRepo.name, (error, isGitRepo) ->
expect(error).to.not.exist
expect(isGitRepo).to.be.false
done()
it 'should throw an error if directory does not exist', (done) ->
git.isGitRepository '/nonexistentdir', (error, isGitRepo) ->
expect(error).to.be.an.instanceof(Error)
expect(isGitRepo).to.be.undefined
done()
it 'should return false it .git is a file', (done) ->
git.isGitRepository filesystem.invalidGitRepo.name, (error, isGitRepo) ->
expect(error).to.not.exist
expect(isGitRepo).to.be.false
done()
describe '#initProjectWithApplication()', ->
filesystem =
gitRepo:
name: '/repo'
contents:
'.git': {}
notGitRepo:
name: '/not-repo'
contents: {}
beforeEach ->
mock.fs.init(filesystem)
@application =
git_repository: 'git@git.resin.io:johndoe/app.git'
afterEach ->
mock.fs.restore()
it 'should return an error if directory is not a git repo', (done) ->
git.initProjectWithApplication @application, filesystem.notGitRepo.name, (error) ->
expect(error).to.be.an.instanceof(Error)
done()
it 'should return an error if application does not contain a git repo url', (done) ->
git.initProjectWithApplication {}, filesystem.gitRepo.name, (error) ->
expect(error).to.be.an.instanceof(Error)
done()
it 'should add the remote', (done) ->
mock.fs.restore()
addRemoteStub = sinon.stub(git, 'addRemote')
addRemoteStub.yields(null)
mock.fs.init(filesystem)
git.initProjectWithApplication @application, filesystem.gitRepo.name, (error) =>
expect(error).to.not.exist
expect(addRemoteStub).to.have.been.calledOnce
# TODO: There should be a better way to test this
args = addRemoteStub.firstCall.args
expect(args[1]).to.equal(settings.get('gitRemote'))
expect(args[2]).to.equal(@application.git_repository)
addRemoteStub.restore()
done()

View File

@ -1,43 +0,0 @@
git = require('./git/git')
# TODO: We will delegate to only git for now
# Initialize an application project
#
# - Add the corresponding git remote.
#
# @param {Object} application an application from resin API
# @param {String} directory the directory to initialize
# @param {Function} callback callback(error)
#
# @throw {Error} Will throw if application is not a valid application
#
# @note The directory should already be a git repo (maybe we should take care of git init as well here if necessary?)
# @todo This function should be better tested
#
# @example Init project
# resin.models.application.get 91, (error, application) ->
# throw error if error?
#
# resin.vcs.initProjectWithApplication application, 'my/new/project', (error) ->
# throw error if error?
#
exports.initProjectWithApplication = git.initProjectWithApplication
# Check if an application was already initialized
#
# It checks if we have a resin remote added already.
#
# @param {String} directory the directory
# @param {Function} callback callback(error, isResinProject)
#
# @todo Find a way to test this function
#
# @example Was application initialized?
# resin.vcs.isResinProject 'my/resin/app', (error, initialized) ->
# if initialized
# console.log('It\'s already a resin app!')
# else
# console.log('It\'s just a boring project! It should be resinified!')
#
exports.isResinProject = git.isResinProject

View File

@ -1,7 +1,6 @@
async = require('async')
fs = require('fs')
widgets = require('../widgets/widgets')
resin = require('../../resin')
ProgressBar = require('progress')
exports.remove = (name, confirmAttribute, deleteFunction, outerCallback) ->

View File

@ -1,4 +1,4 @@
.TH "RESIN" "1" "December 2014" "" ""
.TH "RESIN" "1" "January 2015" "" ""
.SH "NAME"
\fBresin\fR \- tab completion for resin
.SH DESCRIPTION

View File

@ -1,4 +1,4 @@
.TH "RESIN" "1" "December 2014" "" ""
.TH "RESIN" "1" "January 2015" "" ""
.SH "NAME"
\fBresin\fR \- command line tool to interact with resin\.io
.SH SYNOPSIS

View File

@ -17,8 +17,7 @@
},
"scripts": {
"prepublish": "gulp build",
"test": "gult test",
"doc": "codo -o ./doc/codo `find lib/resin -name \"*.coffee\" | grep -v \"spec.coffee$\"`"
"test": "gult test"
},
"keywords": [
"resin",
@ -31,8 +30,6 @@
"chai-as-promised": "~4.1.1",
"chai-string": "~1.1.0",
"chai-things": "~0.2.0",
"codo": "~2.0.9",
"coffee-script": "~1.8.0",
"gulp": "~3.8.9",
"gulp-coffee": "^2.2.0",
"gulp-coffeelint": "~0.4.0",
@ -44,37 +41,32 @@
"mocha-notifier-reporter": "~0.1.0",
"mock-fs": "~2.3.2",
"nock": "~0.48.2",
"ronn": "~0.4.0",
"run-sequence": "~1.0.2",
"sinon": "~1.12.1",
"sinon-chai": "~2.6.0"
},
"dependencies": {
"request": "~2.47.0",
"lodash": "~2.4.1",
"async": "~0.9.0",
"rimraf": "~2.2.8",
"mkdirp": "~0.5.0",
"pinejs-client-js": "git+ssh://git@bitbucket.org/rulemotion/pinejs-client-js.git",
"bluebird": "~2.3.11",
"open": "0.0.5",
"inquirer": "~0.8.0",
"capitano": "~1.0.4",
"cliff": "~0.1.9",
"underscore.string": "~2.4.0",
"typed-error": "~0.1.0",
"is-online": "~3.0.0",
"pluralize": "~1.1.0",
"indefinite-article": "0.0.2",
"pubnub": "~3.7.0",
"request-progress": "~0.3.1",
"progress-bar": "~0.1.1",
"progress": "~1.1.8",
"user-home": "~1.1.0",
"fs-plus": "~2.3.2",
"lodash-contrib": "~241.4.14",
"conf.js": "~0.1.1",
"coffee-script": "~1.8.0",
"conf.js": "^0.1.1",
"fs-plus": "~2.3.2",
"git-cli": "~0.8.2",
"capitano": "~1.0.4"
"inquirer": "~0.8.0",
"is-online": "~3.0.0",
"lodash": "~2.4.1",
"lodash-contrib": "~241.4.14",
"mkdirp": "~0.5.0",
"open": "0.0.5",
"progress": "~1.1.8",
"progress-bar": "~0.1.1",
"pubnub": "~3.7.0",
"request-progress": "^0.3.1",
"resin-sdk": "git+ssh://git@bitbucket.org/rulemotion/resin-sdk.git",
"rimraf": "^2.2.8",
"typed-error": "^0.1.0",
"underscore.string": "~2.4.0",
"user-home": "^1.1.0"
}
}

View File

@ -1,7 +1,6 @@
mockFs = require('mock-fs')
sinon = require('sinon')
resin = require('../../lib/resin')
connection = require('../../lib/resin/_connection/connection')
resin = require('resin-sdk')
exports.fs =
@ -24,7 +23,7 @@ isOnlineStub = null
exports.connection =
init: ->
isOnlineStub = sinon.stub(connection, 'isOnline')
isOnlineStub = sinon.stub(resin.connection, 'isOnline')
isOnlineStub.yields(null, true)
restore: ->