node-nicovideo-api
Version:
nicovideo api (video, live, etc..) wrapper package for node.js
58 lines (50 loc) • 1.27 kB
JavaScript
// Generated by CoffeeScript 1.10.0
(function() {
var NicoSession, deepFreeze;
NicoSession = require("./NicoSession");
deepFreeze = require("deep-freeze");
module.exports = {
/**
* @return {Promise}
*/
restoreSession: function(json) {
return NicoSession.fromJSON(json);
},
/**
* @method restoreFromSessionId
* @param {String} sessionId
* @return {Promise}
*/
restoreFromSessionId: function(sessionId) {
return NicoSession.fromSessionId(sessionId);
},
/**
* ニコニコ動画へログインし、セッションを取得します。
*
* @static
* @method login
* @param {String} user ログインユーザーID
* @param {String} password ログインパスワード
* @return {Promise}
*/
login: function(user, password) {
return NicoSession.login(user, password);
},
Nsen: deepFreeze({
RequestError: {
NO_LOGIN: "not_login",
CLOSED: "nsen_close",
REQUIRED_TAG: "nsen_tag",
TOO_LONG: "nsen_long",
REQUESTED: "nsen_requested"
},
Gage: {
BLUE: 0,
GREEN: 1,
YELLOW: 2,
ORANGE: 3,
RED: 4
}
})
};
}).call(this);