-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[api] [refactor] Email now required + New pricing
* `User.email` is now a required field * Adds registration page for account name * Adds screen for upgrading legacy accounts * Legacy accounts must upgrade * API access will remain * Website access will be locked until register * Adds new pricing plans * Improves test coverage for signups / logins * Addresses: #265, #126
- Loading branch information
Showing
32 changed files
with
1,328 additions
and
601 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function numberWithCommas (x) { | ||
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); | ||
} | ||
|
||
module.exports = numberWithCommas; |
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,18 +1,31 @@ | ||
module.exports = { | ||
"free": { | ||
"hits": 1000, | ||
"concurrency": 2 | ||
"concurrency": 2, | ||
"cost": "$0.00" | ||
}, | ||
"premium": { | ||
"hits": 10000, | ||
"concurrency": 4 | ||
"concurrency": 4, | ||
"stripe_label": 'BASIC_HOSTING_PLAN_10', | ||
"cost": "$10.00" | ||
}, | ||
"pro": { | ||
"advanced": { | ||
"hits": 50000, | ||
"concurrency": 10 | ||
"concurrency": 16, | ||
"stripe_label": 'BASIC_HOSTING_PLAN_20', | ||
"cost": "$25.00" | ||
}, | ||
"pro": { | ||
"hits": 100000, | ||
"concurrency": 8, | ||
"stripe_label": 'BASIC_HOSTING_PLAN_50', | ||
"cost": "$50.00" | ||
}, | ||
"business": { | ||
"hits": 1000000, | ||
"concurrency": 50 | ||
"concurrency": 32, | ||
"stripe_label": 'BASIC_HOSTING_PLAN_100', | ||
"cost": "$200.00" | ||
} | ||
}; |
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
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
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
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,49 @@ | ||
var config = require('../../config'); | ||
|
||
var billing = require('../../lib/resources/billing'); | ||
var user = require('../../lib/resources/user'); | ||
|
||
var colors = require('colors'); | ||
|
||
billing.persist(config.couch); | ||
user.persist(config.couch); | ||
|
||
user.findOne({ | ||
name: 'bobby' | ||
}, function(err, _u){ | ||
if(err) { | ||
throw err; | ||
} | ||
_u.servicePlan = "free"; | ||
_u.save(function(err){ | ||
if(err) { | ||
throw err; | ||
} | ||
clearBillings(); | ||
}) | ||
}); | ||
|
||
function clearBillings () { | ||
billing.find({ owner: 'bobby' }, function(err, results){ | ||
|
||
// billing.all(function(err, results){ | ||
if(err) { | ||
throw err; | ||
} | ||
console.log(results) | ||
function destroy () { | ||
if (results.length === 0) { | ||
process.exit(); | ||
} | ||
var result = results.pop(); | ||
console.log(result.owner.toLowerCase()) | ||
result.destroy(function(err, res){ | ||
if (err) { | ||
throw err; | ||
} | ||
destroy(); | ||
}); | ||
} | ||
destroy(); | ||
}); | ||
} |
Oops, something went wrong.