mirror of
https://github.com/jlengrand/picasa.git
synced 2026-03-10 08:31:19 +00:00
Moving documentation by jsdocs
This commit is contained in:
62
README.md
62
README.md
@@ -1,11 +1,11 @@
|
||||
<img src="https://www.google.com/photos/about/static/images/ui/logo-photos.png" style="display: block; margin-left: auto; margin-right: auto;">
|
||||
|
||||
[](https://travis-ci.org/esteban-uo/picasa)
|
||||
|
||||
A simple Picasa Web Albums client (2.0) for nodejs (>= 4.8.7). Includes Auth helpers.
|
||||
|
||||
### Install
|
||||
<img src="https://www.google.com/photos/about/static/images/ui/logo-photos.png" style="display: block; margin-left: auto; margin-right: auto;">
|
||||
|
||||
|
||||
### Install
|
||||
```
|
||||
$ yarn add picasa
|
||||
```
|
||||
@@ -14,55 +14,15 @@ or
|
||||
$ npm install --save picasa
|
||||
```
|
||||
|
||||
### Usage
|
||||
```js
|
||||
const Picasa = require('picasa')
|
||||
|
||||
const picasa = new Picasa()
|
||||
```
|
||||
|
||||
### Docs
|
||||
Documentation is found [here](./docs) and for examples, check out the examples dir too, rename config.example.json > config.json and add your credentials.
|
||||
|
||||
#### Post
|
||||
|
||||
Where binary is the binary's file and the albumId the album id to be stored.
|
||||
|
||||
```js
|
||||
const photoData = {
|
||||
title : 'A title',
|
||||
summary : 'Summary or description',
|
||||
contentType : 'image/jpeg', // image/bmp, image/gif, image/png
|
||||
binary : binary
|
||||
}
|
||||
|
||||
picasa.postPhoto(accessToken, albumId, photoData, (error, photo) => {
|
||||
console.log(error, photo)
|
||||
})
|
||||
```
|
||||
|
||||
#### Delete
|
||||
|
||||
```js
|
||||
picasa.deletePhoto(accessToken, albumId, photoId, (error) => {
|
||||
console.log(error)
|
||||
})
|
||||
```
|
||||
|
||||
### Albums
|
||||
#### Get
|
||||
```js
|
||||
const options = {}
|
||||
|
||||
picasa.getAlbums(accessToken, options, (error, albums) => {
|
||||
console.log(error, albums)
|
||||
})
|
||||
```
|
||||
|
||||
#### Create
|
||||
```js
|
||||
const albumData = {
|
||||
title: 'My first album',
|
||||
summary: 'First album with Picasa API'
|
||||
}
|
||||
|
||||
picasa.createAlbum(accessToken, albumData, (error, albums) => {
|
||||
console.log(error, albums)
|
||||
})
|
||||
```
|
||||
API for Photos, Albums and Auth can be found [here](./docs). Please check out also the examples dir for more detailed examples. Rename `config.example.json` to `config.json` and add your own config data.
|
||||
|
||||
### Auth
|
||||
|
||||
|
||||
130
docs/Albums.html
Normal file
130
docs/Albums.html
Normal file
@@ -0,0 +1,130 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Namespace: Albums</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="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Namespace: Albums</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<header>
|
||||
|
||||
<h2>Albums</h2>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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#line67">line 67</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Picasa.html">Picasa</a></li></ul><h3>Namespaces</h3><ul><li><a href="Albums.html">Albums</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Mar 04 2018 15:28:24 GMT+0100 (CET)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
||||
696
docs/Photos.html
Normal file
696
docs/Photos.html
Normal file
@@ -0,0 +1,696 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Namespace: Photos</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="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Namespace: Photos</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<header>
|
||||
|
||||
<h2>Photos</h2>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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#line28">line 28</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="subsection-title">Methods</h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="deletePhoto"><span class="type-signature">(static) </span>Picasa#deletePhoto<span class="signature">(accessToken, albumId, photoId, callback)</span><span class="type-signature"> → {Promise}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
Delete Photo
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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">string</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">See <a href="Picasa.html#getAccessToken">Picasa#getAccessToken</a></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>albumId</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>photoId</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>callback</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">function</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">(error, response). If not provided, a promise will be returned</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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#line68">line 68</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Promise</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="postPhoto"><span class="type-signature">(static) </span>Picasa#postPhoto<span class="signature">(accessToken, albumId, photoData, callback)</span><span class="type-signature"> → {Promise}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
Create Photos
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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">string</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">See <a href="Picasa.html#getAccessToken">Picasa#getAccessToken</a></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>albumId</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>photoData</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">object</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">Photo's propperties
|
||||
<h6>Properties</h6>
|
||||
|
||||
|
||||
<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">string</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>summary</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>contentType</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</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">blob</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">function</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">(error, response). If not provided, a promise will be returned</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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#line56">line 56</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Promise</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Picasa.html">Picasa</a></li></ul><h3>Namespaces</h3><ul><li><a href="Albums.html">Albums</a></li><li><a href="Photos.html">Photos</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Mar 04 2018 15:26:50 GMT+0100 (CET)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
||||
129
docs/Photos.module_Photos.html
Normal file
129
docs/Photos.module_Photos.html
Normal file
@@ -0,0 +1,129 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Module: Photos</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="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Module: Photos</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<header>
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
<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#line28">line 28</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="Photos.module_Photos.html">Photos</a></li></ul><h3>Classes</h3><ul><li><a href="Picasa.html">Picasa</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Mar 03 2018 19:09:12 GMT+0100 (CET)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
||||
1841
docs/Picasa.html
1841
docs/Picasa.html
File diff suppressed because it is too large
Load Diff
129
docs/Picasa.module_Photos.html
Normal file
129
docs/Picasa.module_Photos.html
Normal file
@@ -0,0 +1,129 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Module: Photos</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="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Module: Photos</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<header>
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
<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#line29">line 29</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="Picasa.module_Photos.html">Photos</a></li></ul><h3>Classes</h3><ul><li><a href="Picasa.html">Picasa</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Mar 03 2018 19:07:21 GMT+0100 (CET)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -43,35 +43,14 @@
|
||||
|
||||
|
||||
<section>
|
||||
<article><p><img src="https://www.google.com/photos/about/static/images/ui/logo-photos.png" style="display: block; margin-left: auto; margin-right: auto;"></p>
|
||||
<p><a href="https://travis-ci.org/esteban-uo/picasa"><img src="https://travis-ci.org/esteban-uo/picasa.svg" alt="Build Status"></a></p>
|
||||
<article><p><a href="https://travis-ci.org/esteban-uo/picasa"><img src="https://travis-ci.org/esteban-uo/picasa.svg" alt="Build Status"></a></p>
|
||||
<p>A simple Picasa Web Albums client (2.0) for nodejs (>= 4.8.7). Includes Auth helpers.</p>
|
||||
<p><img src="https://www.google.com/photos/about/static/images/ui/logo-photos.png" style="display: block; margin-left: auto; margin-right: auto;"></p>
|
||||
<h3>Install</h3><pre class="prettyprint source"><code>$ yarn add picasa</code></pre><p>or</p>
|
||||
<pre class="prettyprint source"><code>$ npm install --save picasa</code></pre><h3>Docs</h3><p>Documentation is found <a href="./docs">here</a> and for examples, check out the examples dir too, rename config.example.json > config.json and add your credentials.</p>
|
||||
<h4>Post</h4><p>Where binary is the binary's file and the albumId the album id to be stored.</p>
|
||||
<pre class="prettyprint source lang-js"><code>const photoData = {
|
||||
title : 'A title',
|
||||
summary : 'Summary or description',
|
||||
contentType : 'image/jpeg', // image/bmp, image/gif, image/png
|
||||
binary : binary
|
||||
}
|
||||
<pre class="prettyprint source"><code>$ npm install --save picasa</code></pre><h3>Usage</h3><pre class="prettyprint source lang-js"><code>const Picasa = require('picasa')
|
||||
|
||||
picasa.postPhoto(accessToken, albumId, photoData, (error, photo) => {
|
||||
console.log(error, photo)
|
||||
})</code></pre><h4>Delete</h4><pre class="prettyprint source lang-js"><code>picasa.deletePhoto(accessToken, albumId, photoId, (error) => {
|
||||
console.log(error)
|
||||
})</code></pre><h3>Albums</h3><h4>Get</h4><pre class="prettyprint source lang-js"><code>const options = {}
|
||||
|
||||
picasa.getAlbums(accessToken, options, (error, albums) => {
|
||||
console.log(error, albums)
|
||||
})</code></pre><h4>Create</h4><pre class="prettyprint source lang-js"><code>const albumData = {
|
||||
title: 'My first album',
|
||||
summary: 'First album with Picasa API'
|
||||
}
|
||||
|
||||
picasa.createAlbum(accessToken, albumData, (error, albums) => {
|
||||
console.log(error, albums)
|
||||
})</code></pre><h3>Auth</h3><p>To get an access token follow the next flow:</p>
|
||||
const picasa = new Picasa()</code></pre><h3>Docs</h3><p>API for Photos, Albums and Auth can be found <a href="./docs">here</a>. Please check out also the examples dir for more detailed examples. Rename <code>config.example.json</code> to <code>config.json</code> and add your own config data.</p>
|
||||
<h3>Auth</h3><p>To get an access token follow the next flow:</p>
|
||||
<p>1.Get the Auth URL and redirect the user to it.</p>
|
||||
<pre class="prettyprint source lang-js"><code>// Get config here API Manager > Credentials https://console.developers.google.com/home/dashboard
|
||||
const config = {
|
||||
@@ -123,7 +102,7 @@ picasa.renewAccessToken(config, refreshToken, (error, accessToken) => {
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Feb 28 2018 06:31:55 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Mar 04 2018 15:36:02 GMT+0100 (CET)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
85
docs/module-Photos.html
Normal file
85
docs/module-Photos.html
Normal file
@@ -0,0 +1,85 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Module: Photos</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="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Module: Photos</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<header>
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Photos.html">Photos</a></li></ul><h3>Classes</h3><ul><li><a href="Picasa.html">Picasa</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Mar 03 2018 19:06:15 GMT+0100 (CET)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -48,16 +48,11 @@ const FETCH_AS_JSON = 'json'
|
||||
class Picasa {
|
||||
/**
|
||||
* Creates an instance of Picasa.
|
||||
* @example
|
||||
* const Picasa = require('picasa')
|
||||
* const picasa = new Picasa()
|
||||
* // **NOTE**: Every Picasa API request requires an access token.
|
||||
* @memberof Picasa
|
||||
*/
|
||||
constructor() {
|
||||
this.executeRequest = executeRequest;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Photos
|
||||
* @param {string} accessToken - See {@link Picasa#getAccessToken}
|
||||
@@ -70,39 +65,100 @@ class Picasa {
|
||||
getPhotos() {
|
||||
return promisify.bind(this)(getPhotos, arguments);
|
||||
}
|
||||
/**
|
||||
* Create Photos
|
||||
* @param {string} accessToken - See {@link Picasa#getAccessToken}
|
||||
* @param {string} albumId
|
||||
* @param {object} photoData - Photo's propperties
|
||||
* @param {string} photoData.title
|
||||
* @param {string} photoData.summary
|
||||
* @param {string} photoData.contentType - image/bmp, image/gif, image/png
|
||||
* @param {blob} photoData.binary - Blob binary
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
postPhoto() {
|
||||
return promisify.bind(this)(postPhoto, arguments);
|
||||
}
|
||||
/**
|
||||
* Delete Photo
|
||||
* @param {string} accessToken - See {@link Picasa#getAccessToken}
|
||||
* @param {string} albumId
|
||||
* @param {string} photoId
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
deletePhoto() {
|
||||
return promisify.bind(this)(deletePhoto, arguments);
|
||||
}
|
||||
/**
|
||||
* Get all Albums
|
||||
* @param {string} accessToken - See {@link Picasa#getAccessToken}
|
||||
* @param {object} options - Can be empty object
|
||||
* @param {integer} options.TODO - TODO
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
getAlbums() {
|
||||
return promisify.bind(this)(getAlbums, arguments);
|
||||
}
|
||||
/**
|
||||
* Create an albums
|
||||
* @param {string} accessToken - See {@link Picasa#getAccessToken}
|
||||
* @param {object} albumData - Can be empty object
|
||||
* @param {string} albumData.title
|
||||
* @param {string} albumData.summary
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
createAlbum() {
|
||||
return promisify.bind(this)(createAlbum, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Access Token
|
||||
* Get access token
|
||||
* @param {object} config - Get config here: {@link https://console.developers.google.com/home/dashboard} (API Manager > Credentials)
|
||||
* @param {string} config.clientId
|
||||
* @param {string} config.redirectURI - 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
|
||||
* @param {string} config.clientSecret
|
||||
* @param {string} code - Get code from URL param, when user is redirected from authURL. See {@link Picasa#getAuthURL}
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
getAccessToken() {
|
||||
return promisify.bind(this)(getAccessToken, arguments);
|
||||
}
|
||||
/**
|
||||
* Renews access token
|
||||
* @param {object} config - Get config here: {@link https://console.developers.google.com/home/dashboard} (API Manager > Credentials)
|
||||
* @param {string} config.clientId
|
||||
* @param {string} config.redirectURI - 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
|
||||
* @param {string} config.clientSecret
|
||||
* @param {string} refreshToken - The refreshToken is retrived after getAccessToken is executed. See {@link Picasa#getAccessToken}
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
renewAccessToken() {
|
||||
return promisify.bind(this)(renewAccessToken, arguments);
|
||||
}
|
||||
/**
|
||||
* Get Auth URL
|
||||
* @param {object} config - Get config here: https://console.developers.google.com/home/dashboard (API Manager > Credentials)
|
||||
* @param {string} config.clientId
|
||||
* @param {string} config.redirectURI - 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
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
getAuthURL(config) {
|
||||
const authenticationParams = {
|
||||
access_type : 'offline',
|
||||
scope : `${PICASA_SCOPE}`,
|
||||
response_type : 'code',
|
||||
client_id : config.clientId,
|
||||
redirect_uri : config.redirectURI
|
||||
access_type: 'offline',
|
||||
scope: `${PICASA_SCOPE}`,
|
||||
response_type: 'code',
|
||||
client_id: config.clientId,
|
||||
redirect_uri: config.redirectURI
|
||||
}
|
||||
|
||||
|
||||
const authenticationQuery = querystring.stringify(authenticationParams)
|
||||
|
||||
|
||||
return `${GOOGLE_AUTH_ENDPOINT}?${authenticationQuery}`
|
||||
}
|
||||
}
|
||||
@@ -130,7 +186,6 @@ function getAlbums (accessToken, options, callback) {
|
||||
const albums = body.feed.entry.map(
|
||||
entry => parseEntry(entry, albumSchema)
|
||||
)
|
||||
|
||||
callback(null, albums)
|
||||
})
|
||||
}
|
||||
@@ -300,6 +355,20 @@ function extractValue(entry, schemaKey){
|
||||
return checkParam(entry[schemaKey]);
|
||||
}
|
||||
|
||||
function getAuthURL (config) {
|
||||
const authenticationParams = {
|
||||
access_type : 'offline',
|
||||
scope : `${PICASA_SCOPE}`,
|
||||
response_type : 'code',
|
||||
client_id : config.clientId,
|
||||
redirect_uri : config.redirectURI
|
||||
}
|
||||
|
||||
const authenticationQuery = querystring.stringify(authenticationParams)
|
||||
|
||||
return `${GOOGLE_AUTH_ENDPOINT}?${authenticationQuery}`
|
||||
}
|
||||
|
||||
function getAccessToken (config, code, callback) {
|
||||
const accessTokenParams = {
|
||||
grant_type : 'authorization_code',
|
||||
@@ -369,7 +438,7 @@ module.exports = Picasa
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Feb 28 2018 06:31:55 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Mar 04 2018 15:36:02 GMT+0100 (CET)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -20,11 +20,6 @@ const FETCH_AS_JSON = 'json'
|
||||
class Picasa {
|
||||
/**
|
||||
* Creates an instance of Picasa.
|
||||
* @example
|
||||
* const Picasa = require('picasa')
|
||||
* const picasa = new Picasa()
|
||||
* // **NOTE**: Every Picasa API request requires an access token.
|
||||
* @memberof Picasa
|
||||
*/
|
||||
constructor() {
|
||||
this.executeRequest = executeRequest;
|
||||
@@ -42,27 +37,89 @@ class Picasa {
|
||||
getPhotos() {
|
||||
return promisify.bind(this)(getPhotos, arguments);
|
||||
}
|
||||
/**
|
||||
* Create Photos
|
||||
* @param {string} accessToken - See {@link Picasa#getAccessToken}
|
||||
* @param {string} albumId
|
||||
* @param {object} photoData - Photo's propperties
|
||||
* @param {string} photoData.title
|
||||
* @param {string} photoData.summary
|
||||
* @param {string} photoData.contentType - image/bmp, image/gif, image/png
|
||||
* @param {blob} photoData.binary - Blob binary
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
postPhoto() {
|
||||
return promisify.bind(this)(postPhoto, arguments);
|
||||
}
|
||||
/**
|
||||
* Delete Photo
|
||||
* @param {string} accessToken - See {@link Picasa#getAccessToken}
|
||||
* @param {string} albumId
|
||||
* @param {string} photoId
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
deletePhoto() {
|
||||
return promisify.bind(this)(deletePhoto, arguments);
|
||||
}
|
||||
/**
|
||||
* Get all Albums
|
||||
* @param {string} accessToken - See {@link Picasa#getAccessToken}
|
||||
* @param {object} options - Can be empty object
|
||||
* @param {integer} options.TODO - TODO
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
getAlbums() {
|
||||
return promisify.bind(this)(getAlbums, arguments);
|
||||
}
|
||||
/**
|
||||
* Create an albums
|
||||
* @param {string} accessToken - See {@link Picasa#getAccessToken}
|
||||
* @param {object} albumData - Can be empty object
|
||||
* @param {string} albumData.title
|
||||
* @param {string} albumData.summary
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
createAlbum() {
|
||||
return promisify.bind(this)(createAlbum, arguments);
|
||||
}
|
||||
/**
|
||||
* Get Access Token
|
||||
* Get access token
|
||||
* @param {object} config - Get config here: {@link https://console.developers.google.com/home/dashboard} (API Manager > Credentials)
|
||||
* @param {string} config.clientId
|
||||
* @param {string} config.redirectURI - 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
|
||||
* @param {string} config.clientSecret
|
||||
* @param {string} code - Get code from URL param, when user is redirected from authURL. See {@link Picasa#getAuthURL}
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
getAccessToken() {
|
||||
return promisify.bind(this)(getAccessToken, arguments);
|
||||
}
|
||||
/**
|
||||
* Renews access token
|
||||
* @param {object} config - Get config here: {@link https://console.developers.google.com/home/dashboard} (API Manager > Credentials)
|
||||
* @param {string} config.clientId
|
||||
* @param {string} config.redirectURI - 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
|
||||
* @param {string} config.clientSecret
|
||||
* @param {string} refreshToken - The refreshToken is retrived after getAccessToken is executed. See {@link Picasa#getAccessToken}
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
renewAccessToken() {
|
||||
return promisify.bind(this)(renewAccessToken, arguments);
|
||||
}
|
||||
/**
|
||||
* Get Auth URL
|
||||
* @param {object} config - Get config here: https://console.developers.google.com/home/dashboard (API Manager > Credentials)
|
||||
* @param {string} config.clientId
|
||||
* @param {string} config.redirectURI - 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
|
||||
* @param {function} callback - (error, response). If not provided, a promise will be returned
|
||||
* @returns {Promise}
|
||||
*/
|
||||
getAuthURL(config) {
|
||||
const authenticationParams = {
|
||||
access_type: 'offline',
|
||||
|
||||
Reference in New Issue
Block a user