change references to imported libs

This commit is contained in:
Matteo Pagliazzi
2016-03-08 17:49:18 +01:00
parent 5a2daabada
commit a351cb5f4e
9 changed files with 11 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ module.exports = function(user, req, cb) {
}
user.tags.push({
name: req.body.name,
id: req.body.id || api.uuid()
id: req.body.id || uuid()
});
return typeof cb === "function" ? cb(null, user.tags) : void 0;
};

View File

@@ -3,7 +3,7 @@ import i18n from '../i18n';
module.exports = function(user, req, cb) {
var task;
task = api.taskDefaults(req.body);
task = taskDefaults(req.body);
if (user.tasks[task.id] != null) {
return typeof cb === "function" ? cb({
code: 409,

View File

@@ -3,7 +3,7 @@ import refPush from '../libs/refPush';
module.exports = function(user, req, cb) {
var wh;
wh = user.preferences.webhooks;
api.refPush(wh, {
refPush(wh, {
url: req.body.url,
enabled: req.body.enabled || true,
id: req.body.id

View File

@@ -46,7 +46,7 @@ module.exports = function(user, req, cb, analytics) {
image: '<span class="shop_' + drop.key + ' pull-left"></span>',
dropText: drop.text(req.language)
}, req.language);
if (api.count.remainingGearInSet(user.items.gear.owned, 'armoire') === 0) {
if (count.remainingGearInSet(user.items.gear.owned, 'armoire') === 0) {
user.flags.armoireEmpty = true;
}
armoireResp = {

View File

@@ -51,7 +51,7 @@ module.exports = function(user, req, cb, analytics) {
con: 0,
per: 0,
int: 0,
points: api.capByLevel(user.stats.lvl)
points: capByLevel(user.stats.lvl)
});
user.flags.classSelected = false;
}

View File

@@ -7,7 +7,7 @@ module.exports = function(user, req, cb) {
user.flags.classSelected = true;
user.preferences.disableClasses = true;
user.preferences.autoAllocate = true;
user.stats.str = api.capByLevel(user.stats.lvl);
user.stats.str = capByLevel(user.stats.lvl);
user.stats.points = 0;
return typeof cb === "function" ? cb(null, _.pick(user, splitWhitespace('stats flags preferences'))) : void 0;
};

View File

@@ -8,7 +8,7 @@ module.exports = function(user, req, cb, analytics) {
var analyticsData, convCap, convRate, item, key, price, ref, ref1, ref2, ref3, type;
ref = req.params, type = ref.type, key = ref.key;
if (type === 'gems' && key === 'gem') {
ref1 = api.planGemLimits, convRate = ref1.convRate, convCap = ref1.convCap;
ref1 = planGemLimits, convRate = ref1.convRate, convCap = ref1.convCap;
convCap += user.purchased.plan.consecutive.gemCapExtra;
if (!((ref2 = user.purchased) != null ? (ref3 = ref2.plan) != null ? ref3.customerId : void 0 : void 0)) {
return typeof cb === "function" ? cb({

View File

@@ -6,7 +6,7 @@ import { MAX_LEVEL } from '../constants';
module.exports = function(user, req, cb, analytics) {
var analyticsData, flags, gear, lvl, stats;
if (user.balance < 2 && user.stats.lvl < api.maxLevel) {
if (user.balance < 2 && user.stats.lvl < MAX_LEVEL) {
return typeof cb === "function" ? cb({
code: 401,
message: i18n.t('notEnoughGems', req.language)
@@ -16,7 +16,7 @@ module.exports = function(user, req, cb, analytics) {
uuid: user._id,
category: 'behavior'
};
if (user.stats.lvl < api.maxLevel) {
if (user.stats.lvl < MAX_LEVEL) {
user.balance -= 2;
analyticsData.acquireMethod = 'Gems';
analyticsData.gemCost = 8;
@@ -27,7 +27,7 @@ module.exports = function(user, req, cb, analytics) {
if (analytics != null) {
analytics.track('Rebirth', analyticsData);
}
lvl = api.capByLevel(user.stats.lvl);
lvl = capByLevel(user.stats.lvl);
_.each(user.tasks, function(task) {
if (task.type !== 'reward') {
task.value = 0;

View File

@@ -17,7 +17,7 @@ module.exports = function(user, req, cb) {
}
tasks = user[task.type + "s"];
if (task.type === 'todo' && tasks[from] !== task) {
preenedTasks = api.preenTodos(tasks);
preenedTasks = preenTodos(tasks);
if (to !== -1) {
to = tasks.indexOf(preenedTasks[to]);
}