picasa
Version:
Picasa web albums client for node
2,493 lines (787 loc) • 34.2 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Picasa - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="Picasa.html">Picasa</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Picasa.html#createAlbum">createAlbum</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Picasa.html#deletePhoto">deletePhoto</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Picasa.html#getAlbums">getAlbums</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Picasa.html#getAuthURL">getAuthURL</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Picasa.html#getPhotos">getPhotos</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Picasa.html#getTokens">getTokens</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Picasa.html#postPhoto">postPhoto</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="Picasa.html#renewAccessToken">renewAccessToken</a></span></li><li class="nav-heading"><a href="global.html">Globals</a></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#getAccessToken">getAccessToken</a></span></li>
</nav>
<div id="main">
<h1 class="page-title">Picasa</h1>
<section>
<header>
<h2>
Picasa
</h2>
<div class="class-description">Main class</div>
</header>
<article>
<div class="container-overview">
<div class="section-method">
<h2>Constructor</h2>
<h4 class="name" id="Picasa"><span class="type-signature"></span>new Picasa<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Creates an instance of Picasa.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="picasa.js.html">picasa.js</a>, <a href="picasa.js.html#line20">line 20</a>
</li></ul></dd>
</dl>
</div>
</div>
<h3 class="subsection-title">Methods</h3>
<div class="section-method">
<h4 class="name" id="createAlbum"><span class="type-signature"></span>createAlbum<span class="signature">(accessToken, albumData, callback)</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
Create an albums
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="picasa.js.html">picasa.js</a>, <a href="picasa.js.html#line91">line 91</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>accessToken</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
See <a href="Picasa.html#getTokens"><code>Picasa#getTokens</code></a>
</td>
</tr>
<tr>
<td class="name"><code>albumData</code></td>
<td class="type">
<span class="param-type"><code>object</code></span>
</td>
<td class="description last">
Can be empty object
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>title</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
</td>
</tr>
<tr>
<td class="name"><code>summary</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="description last">
(error, response). If not provided, a promise will be returned
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
</dd>
</dl>
</div>
</div>
<div class="section-method">
<h4 class="name" id="deletePhoto"><span class="type-signature"></span>deletePhoto<span class="signature">(accessToken, albumId, photoId, callback)</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
Delete Photo
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="picasa.js.html">picasa.js</a>, <a href="picasa.js.html#line66">line 66</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>accessToken</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
See <a href="Picasa.html#getTokens"><code>Picasa#getTokens</code></a>
</td>
</tr>
<tr>
<td class="name"><code>albumId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
</td>
</tr>
<tr>
<td class="name"><code>photoId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="description last">
(error, response). If not provided, a promise will be returned
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
</dd>
</dl>
</div>
</div>
<div class="section-method">
<h4 class="name" id="getAlbums"><span class="type-signature"></span>getAlbums<span class="signature">(accessToken, options, callback)</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
Get all Albums
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="picasa.js.html">picasa.js</a>, <a href="picasa.js.html#line78">line 78</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>accessToken</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
See <a href="Picasa.html#getTokens"><code>Picasa#getTokens</code></a>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code>object</code></span>
</td>
<td class="description last">
Can be empty object
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>TODO</code></td>
<td class="type">
<span class="param-type"><code>integer</code></span>
</td>
<td class="description last">
TODO
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="description last">
(error, response). If not provided, a promise will be returned
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
</dd>
</dl>
</div>
</div>
<div class="section-method">
<h4 class="name" id="getAuthURL"><span class="type-signature"></span>getAuthURL<span class="signature">(config, callback)</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
Get Auth URL. Redirect user to this URL to get code. The code will be used later for <a href="Picasa.html#getTokens"><code>Picasa#getTokens</code></a>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="picasa.js.html">picasa.js</a>, <a href="picasa.js.html#line131">line 131</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type"><code>object</code></span>
</td>
<td class="description last">
Get config here: https://console.developers.google.com/home/dashboard (API Manager > Credentials)
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>clientId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
</td>
</tr>
<tr>
<td class="name"><code>redirectURI</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
URL to user will be redirected. After google displays a consent screen to the user, user will be redirect to this URL with a `code` in the URL
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="description last">
(error, response). If not provided, a promise will be returned
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
</dd>
</dl>
</div>
</div>
<div class="section-method">
<h4 class="name" id="getPhotos"><span class="type-signature"></span>getPhotos<span class="signature">(accessToken, options, callback)</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
Get Photos
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="picasa.js.html">picasa.js</a>, <a href="picasa.js.html#line38">line 38</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>accessToken</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
See <a href="Picasa.html#getTokens"><code>Picasa#getTokens</code></a>
</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><code>object</code></span>
</td>
<td class="description last">
Can be empty object
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>maxResults</code></td>
<td class="type">
<span class="param-type"><code>integer</code></span>
</td>
<td class="description last">
By default get all photos
</td>
</tr>
<tr>
<td class="name"><code>albumId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
By default all photos are selected
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="description last">
(error, response). If not provided, a promise will be returned
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
</dd>
</dl>
</div>
</div>
<div class="section-method">
<h4 class="name" id="getTokens"><span class="type-signature"></span>getTokens<span class="signature">(config, code, callback)</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
Get access token and refresh token
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="picasa.js.html">picasa.js</a>, <a href="picasa.js.html#line105">line 105</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type"><code>object</code></span>
</td>
<td class="description last">
Get config here: <a href="https://console.developers.google.com/home/dashboard">https://console.developers.google.com/home/dashboard</a> (API Manager > Credentials)
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>clientId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
</td>
</tr>
<tr>
<td class="name"><code>redirectURI</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
URL that user was redirected. After google displays a consent screen to the user, user will be redirect to this URL with a `code` in the URL
</td>
</tr>
<tr>
<td class="name"><code>clientSecret</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>code</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
Get code from URL param, when user is redirected from authURL. See <a href="Picasa.html#getAuthURL"><code>Picasa#getAuthURL</code></a>
</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="description last">
(error, response{accessToken, refreshToken}). If not provided, a promise will be returned
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
</dd>
</dl>
<div class="param-desc">
- Object{accessToken, refreshToken}
</div>
</div>
</div>
<div class="section-method">
<h4 class="name" id="postPhoto"><span class="type-signature"></span>postPhoto<span class="signature">(accessToken, albumId, photoData, callback)</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
Create Photos
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="picasa.js.html">picasa.js</a>, <a href="picasa.js.html#line54">line 54</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>accessToken</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
See <a href="Picasa.html#getTokens"><code>Picasa#getTokens</code></a>
</td>
</tr>
<tr>
<td class="name"><code>albumId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
</td>
</tr>
<tr>
<td class="name"><code>photoData</code></td>
<td class="type">
<span class="param-type"><code>object</code></span>
</td>
<td class="description last">
Photo's propperties
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>title</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
</td>
</tr>
<tr>
<td class="name"><code>summary</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
</td>
</tr>
<tr>
<td class="name"><code>contentType</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
image/bmp, image/gif, image/png
</td>
</tr>
<tr>
<td class="name"><code>binary</code></td>
<td class="type">
<span class="param-type"><code>blob</code></span>
</td>
<td class="description last">
Blob binary
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="description last">
(error, response). If not provided, a promise will be returned
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
</dd>
</dl>
</div>
</div>
<div class="section-method">
<h4 class="name" id="renewAccessToken"><span class="type-signature"></span>renewAccessToken<span class="signature">(config, refreshToken, callback)</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
Renews access token
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="picasa.js.html">picasa.js</a>, <a href="picasa.js.html#line119">line 119</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type"><code>object</code></span>
</td>
<td class="description last">
Get config here: <a href="https://console.developers.google.com/home/dashboard">https://console.developers.google.com/home/dashboard</a> (API Manager > Credentials)
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>clientId</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
</td>
</tr>
<tr>
<td class="name"><code>redirectURI</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
URL that user was redirected. After google displays a consent screen to the user, user will be redirect to this URL with a `code` in the URL
</td>
</tr>
<tr>
<td class="name"><code>clientSecret</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>refreshToken</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
</td>
<td class="description last">
The refreshToken is retrived after getTokens is executed. See <a href="Picasa.html#getTokens"><code>Picasa#getTokens</code></a>
</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><code>function</code></span>
</td>
<td class="description last">
(error, response). If not provided, a promise will be returned
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>Promise</code></span>
</dd>
</dl>
</div>
</div>
</article>
</section>
</div>
<br class="clear">
<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Mar 04 2018 20:34:29 GMT+0100 (CET) using the Minami theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>