web-manager 3.1.29 → 3.1.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/lib/account.js +18 -12
  2. package/package.json +2 -2
package/lib/account.js CHANGED
@@ -210,7 +210,7 @@ Account.prototype._resolveAccount2 = function (firebaseUser, account, options) {
210
210
  */
211
211
  Account.prototype._resolveAccount = function (firebaseUser, account, options) {
212
212
  var self = this;
213
-
213
+
214
214
  firebaseUser = firebaseUser || {};
215
215
  account = account || {};
216
216
  options = options || {};
@@ -229,9 +229,17 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
229
229
  // Resolve plan
230
230
  account.plan = account.plan || {};
231
231
  account.plan.id = account.plan.id || defaultPlanId;
232
+
232
233
  account.plan.expires = account.plan.expires || {};
233
234
  account.plan.expires.timestamp = new Date(account.plan.expires.timestamp || 0).toISOString();
234
235
  account.plan.expires.timestampUNIX = Math.round(new Date(account.plan.expires.timestamp || 0).getTime() / 1000);
236
+
237
+ account.plan.trial = account.plan.trial || {};
238
+ account.plan.trial.activated = account.plan.trial.activated || false;
239
+ account.plan.trial.expires = account.plan.trial.expires || {};
240
+ account.plan.trial.expires.timestamp = new Date(account.plan.trial.expires.timestamp || 0).toISOString()
241
+ account.plan.trial.expires.timestampUNIX = Math.round(new Date(account.plan.trial.expires.timestamp || 0).getTime() / 1000);
242
+
235
243
  account.plan.limits = account.plan.limits || {};
236
244
  // account.plan.devices = account.plan.devices || 1;
237
245
 
@@ -279,7 +287,7 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
279
287
  var planExpireDate = new Date(account.plan.expires.timestamp);
280
288
  var now = new Date();
281
289
  var daysTillExpire = Math.floor((planExpireDate - now) / 86400000);
282
- var difference = (planExpireDate.getTime() - now.getTime())/(24*3600*1000);
290
+ var difference = (planExpireDate.getTime() - now.getTime()) / (24 * 3600 * 1000);
283
291
  var startDate = new Date(account.plan.payment.startDate.timestamp);
284
292
  var planIsActive = difference > -1 && account.plan.id !== defaultPlanId;
285
293
 
@@ -328,14 +336,6 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
328
336
  // Personal
329
337
  account.personal = account.personal || {};
330
338
 
331
- account.personal.name = account.personal.name || {};
332
- account.personal.name.first = account.personal.name.first || '';
333
- account.personal.name.last = account.personal.name.last || '';
334
-
335
- account.personal.telephone = account.personal.telephone || {};
336
- account.personal.telephone.countryCode = account.personal.telephone.countryCode || 0;
337
- account.personal.telephone.national = account.personal.telephone.national || 0;
338
-
339
339
  account.personal.birthday = account.personal.birthday || {};
340
340
  account.personal.birthday.timestamp = account.personal.birthday.timestamp || '1970-01-01T00:00:00.000Z';
341
341
  account.personal.birthday.timestampUNIX = account.personal.birthday.timestampUNIX || 0;
@@ -343,14 +343,20 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
343
343
  account.personal.gender = account.personal.gender || '';
344
344
 
345
345
  account.personal.location = account.personal.location || {};
346
+ account.personal.location.city = account.personal.location.city || '';
346
347
  account.personal.location.country = account.personal.location.country || '';
347
348
 
349
+ account.personal.name = account.personal.name || {};
350
+ account.personal.name.first = account.personal.name.first || '';
351
+ account.personal.name.last = account.personal.name.last || '';
352
+
353
+ account.personal.telephone = account.personal.telephone || {};
354
+ account.personal.telephone.countryCode = account.personal.telephone.countryCode || 0;
355
+ account.personal.telephone.national = account.personal.telephone.national || 0;
348
356
 
349
357
  // Set UI elements
350
358
  // In a try/catch because this lib is used in node sometimes
351
359
  try {
352
- // var apiLinkURL = isDevelopment ? 'http://localhost:5000/discord-link' : 'https://api.{{ site.brand.name }}.com/discord-link';
353
- // var apiUnlinkURL = isDevelopment ? 'http://localhost:5000/discord-unlink' : 'https://api.{{ site.brand.name }}.com/discord-unlink';
354
360
  var cancelURL = isDevelopment ? 'http://localhost:4001/cancel/' : 'https://itwcreativeworks.com/portal/account/manage/';
355
361
 
356
362
  var billingSubscribeBtn = self.dom.select('.auth-billing-subscribe-btn');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.1.29",
3
+ "version": "3.1.30",
4
4
  "description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -28,4 +28,4 @@
28
28
  "firebase": "^8.10.1",
29
29
  "lazysizes": "^5.3.2"
30
30
  }
31
- }
31
+ }