-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a1aaf6
commit 2a8f2fc
Showing
11 changed files
with
237 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"presets": ["es2015", "stage-0"], | ||
"presets": ["es2015"], | ||
"plugins": ["add-module-exports", "lodash"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,7 @@ | ||
# Logs | ||
logs | ||
.DS_Store | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
node_modules | ||
bower_components | ||
tmp | ||
docs | ||
|
||
# Users Environment Variables | ||
.lock-wscript | ||
|
||
.DS_Store | ||
**/.DS_Store | ||
wiki | ||
wiki/** | ||
|
||
examples/**/node_modules | ||
es | ||
coverage | ||
_book | ||
uploads/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"gitbook": "2.4.3", | ||
"structure": { | ||
"summary": "docs/README.md" | ||
}, | ||
"plugins": ["edit-link", "prism", "-highlight", "github"], | ||
"pluginsConfig": { | ||
"edit-link": { | ||
"base": "https://github.com/kypertech/matter/tree/master", | ||
"label": "Edit This Page" | ||
}, | ||
"github": { | ||
"url": "https://github.com/kypertech/matter/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
## Table of Contents | ||
|
||
* [Read Me](/README.md) | ||
* [API Reference](/docs/api/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## Table of Contents | ||
|
||
* [Read Me](/README.md) | ||
* [API Reference](/docs/api/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
|
||
## signup | ||
|
||
```javascript | ||
//Signup a new user | ||
var signupData = {username: 'testuser1', email:'test@email.com', password: 'testpassword'} | ||
matter.signup(signupData).then(function(signupRes){ | ||
console.log('New user signed up successfully. New account: ', signupRes.account) | ||
}, function(err){ | ||
console.error('Error signing up:', err) | ||
}) | ||
``` | ||
|
||
## login | ||
|
||
Log into application | ||
|
||
```javascript | ||
//Login as 'testuser1' | ||
var loginData = {username: 'testuser1', password: 'testpassword'} | ||
matter.login(loginData).then(function(loginRes){ | ||
console.log('New user logged in succesfully. Account: ', loginRes.user) | ||
}, function(err){ | ||
console.error('Error logging in:', err) | ||
}) | ||
``` | ||
|
||
## logout | ||
|
||
Logout of currently logged in account | ||
|
||
```javascript | ||
//Logout of currently logged in account | ||
matter.logout().then(function(loginRes){ | ||
console.log('Logged out successfully') | ||
}, function(err){ | ||
console.error('Error logging out:', err) | ||
}) | ||
``` | ||
|
||
## updateAccount | ||
|
||
Update currently logged in user's account | ||
|
||
```javascript | ||
//Update current account's profile | ||
matter.updateAccount().then(function(updatedAccount){ | ||
console.log('Currently logged in account:', updatedAccount) | ||
}, function(err){ | ||
console.error('Error updating profile:', err) | ||
}) | ||
``` | ||
|
||
## getCurrentUser | ||
|
||
Get the account for the currently logged in user | ||
|
||
```javascript | ||
matter.getCurrentUser().then(function(currentAccount){ | ||
console.log('Currently logged in account:', currentAccount) | ||
}, function(err){ | ||
console.error('Error logging out:', err) | ||
}) | ||
``` | ||
|
||
## recover | ||
|
||
Recover account by providing username | ||
|
||
```javascript | ||
matter.recover('testUser').then(function(updatedAccount){ | ||
console.log('Currently logged in account:', updatedAccount) | ||
}, function(err){ | ||
console.error('Error updating profile:', err) | ||
}) | ||
``` | ||
|
||
## isLoggedIn | ||
|
||
Get current logged in status | ||
|
||
```javascript | ||
if(matter.isLoggedIn){ | ||
console.log('There is currently an account logged in.') | ||
} else { | ||
console.warn('There is no account currently logged in.') | ||
} | ||
``` | ||
|
||
## currentUser | ||
|
||
Get currently logged in user | ||
|
||
```javascript | ||
//Save account response to current user | ||
matter.currentUser = {username: 'testuser1', email: 'test@email.com'} | ||
console.log('New current user set:', matter.currentUser) | ||
``` | ||
|
||
## uploadAvatar | ||
|
||
Upload an image file as an avatar | ||
|
||
```javascript | ||
matter.uploadAvatar(file).then(function(imgUrl){ | ||
console.log('Currently logged in account:', imgUrl) | ||
}, function(err){ | ||
console.error('Error uploading image:', err) | ||
}) | ||
``` | ||
|
||
## Utilities | ||
|
||
```javascript | ||
/* Utility to handle safley writing to localStorage, sessionStorage, and cookies | ||
* @return {Object} | ||
*/ | ||
get storage () { | ||
return envStorage | ||
} | ||
|
||
/** Utility to handle token writing/deleting/decoding | ||
* @return {Object} | ||
*/ | ||
get token () { | ||
return token | ||
} | ||
|
||
/** Utils placed in base library | ||
* @return {Object} | ||
*/ | ||
get utils () { | ||
return { logger, request, storage: envStorage, dom } | ||
} | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Projects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters