apeman-api-recover
Recover API for apeman
Last updated 2 years ago by okunishinishi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install apeman-api-recover 
SYNC missed versions from official npm registry.

apeman-api-recover

Build Status Code Climate Code Coverage npm Version JS Standard

Recover API for apeman

Installation

$ npm install apeman-api-recover --save

Usage

Define a module in Apemanfile and run the server.

/** Example of Apemanfile.js */

'use strict'

const co = require('co')

let { NODE_ENV } = process.env
let { User, UserSign, UserRecover } = require('./example-models')

module.exports = {
  $cwd: __dirname,
  $pkg: { /* ... */ },
  $proto: [ /* ... */ ],
  $api: {
    // Define APIs
    'module01': require('apeman-api-recover')(
      User, UserSign, UserRecover,
      {
        logging: NODE_ENV === 'development'
      }
    )
  }
}

Then, call the module from client script

#!/usr/bin/env node

/**
 * Example client
 */
'use strict'

const co = require('co')
const apemanApiClient = require('apeman-api-client')

co(function * () {
  // Setup an client
  let api = yield apemanApiClient('/api')

  // Connect to a module
  let recover = yield api.connect('module01')
  let pong = yield recover.ping()
  /* ... */

  yield recover.issue('hoge@example.com')
})


Methods

The following methods are provided by the API

.ping(pong)

Test the reachability of the api.

Param Type Description
pong string Pong message to return

.issue(email)

Issue recover token to email

Param Type Description
email string

.check(token)

Confirm email

Param Type Description
token string Recover token

.update(token, newPassword)

Update password

Param Type Description
token string Recover token
newPassword string New password

.one(id)

Get an recover

Param Type Description
id string

.last(email)

Get last recover for current user

Param Type Description
email string

License

This software is released under the MIT License.

Links

Current Tags

  • 2.0.5                                ...           latest (2 years ago)

14 Versions

  • 2.0.5                                ...           2 years ago
  • 2.0.4                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 28
Dependencies (4)
Dev Dependencies (22)
Dependents (2)

Copyright 2014 - 2018 © taobao.org |