web-manager 3.2.30 → 3.2.31

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 +17 -12
  2. package/package.json +1 -1
package/lib/account.js CHANGED
@@ -233,6 +233,8 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
233
233
 
234
234
  var currentURL;
235
235
  var isDevelopment;
236
+ var timestampOld = '1970-01-01T00:00:00.000Z';
237
+ var timestampUNIXOld = 0;
236
238
 
237
239
  // Resolve auth
238
240
  account.auth = account.auth || {};
@@ -267,16 +269,16 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
267
269
  account.plan.payment.active = account.plan.payment.active || false;
268
270
 
269
271
  account.plan.payment.startDate = account.plan.payment.startDate || {};
270
- account.plan.payment.startDate.timestamp = account.plan.payment.startDate.timestamp || '1970-01-01T00:00:00.000Z';
271
- account.plan.payment.startDate.timestampUNIX = account.plan.payment.startDate.timestampUNIX || 0;
272
+ account.plan.payment.startDate.timestamp = account.plan.payment.startDate.timestamp || timestampOld;
273
+ account.plan.payment.startDate.timestampUNIX = account.plan.payment.startDate.timestampUNIX || timestampUNIXOld;
272
274
 
273
275
  account.plan.payment.updatedBy = account.plan.payment.updatedBy || {};
274
276
  account.plan.payment.updatedBy.event = account.plan.payment.updatedBy.event || {};
275
277
  account.plan.payment.updatedBy.event.id = account.plan.payment.updatedBy.event.id || 'unknown';
276
278
  account.plan.payment.updatedBy.event.name = account.plan.payment.updatedBy.event.name || 'unknown';
277
279
  account.plan.payment.updatedBy.date = account.plan.payment.updatedBy.date || {};
278
- account.plan.payment.updatedBy.date.timestamp = account.plan.payment.updatedBy.date.timestamp || '1970-01-01T00:00:00.000Z';
279
- account.plan.payment.updatedBy.date.timestampUNIX = account.plan.payment.updatedBy.date.timestampUNIX || 0;
280
+ account.plan.payment.updatedBy.date.timestamp = account.plan.payment.updatedBy.date.timestamp || timestampOld;
281
+ account.plan.payment.updatedBy.date.timestampUNIX = account.plan.payment.updatedBy.date.timestampUNIX || timestampUNIXOld;
280
282
 
281
283
  // Set some variables
282
284
  // In a try/catch because this lib is used in node sometimes
@@ -320,6 +322,9 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
320
322
 
321
323
  // Resolve oAuth2
322
324
  account.oauth2 = account.oauth2 || {};
325
+ account.oauth2.updated = account.oauth2.updated || {};
326
+ account.oauth2.updated.timestamp = account.oauth2.updated.timestamp || timestampOld;
327
+ account.oauth2.updated.timestampUNIX = account.oauth2.updated.timestampUNIX || timestampUNIXOld;
323
328
  // account.oauth2.discord = account.oauth2.discord || {};
324
329
  // account.oauth2.discord.user = account.oauth2.discord.user || {};
325
330
 
@@ -342,12 +347,12 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
342
347
  // Resolve activity
343
348
  account.activity = account.activity || {};
344
349
  account.activity.lastActivity = account.activity.lastActivity || {};
345
- account.activity.lastActivity.timestamp = account.activity.lastActivity.timestamp || '1970-01-01T00:00:00.000Z';
346
- account.activity.lastActivity.timestampUNIX = account.activity.lastActivity.timestampUNIX || 0;
350
+ account.activity.lastActivity.timestamp = account.activity.lastActivity.timestamp || timestampOld;
351
+ account.activity.lastActivity.timestampUNIX = account.activity.lastActivity.timestampUNIX || timestampUNIXOld;
347
352
 
348
353
  account.activity.created = account.activity.created || {};
349
- account.activity.created.timestamp = account.activity.created.timestamp || '1970-01-01T00:00:00.000Z';
350
- account.activity.created.timestampUNIX = account.activity.created.timestampUNIX || 0;
354
+ account.activity.created.timestamp = account.activity.created.timestamp || timestampOld;
355
+ account.activity.created.timestampUNIX = account.activity.created.timestampUNIX || timestampUNIXOld;
351
356
 
352
357
  account.activity.geolocation = account.activity.geolocation || {};
353
358
  account.activity.geolocation.ip = account.activity.geolocation.ip || 'unknown';
@@ -378,15 +383,15 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
378
383
 
379
384
  account.usage.requests.last = account.usage.requests.last || {};
380
385
  account.usage.requests.last.id = account.usage.requests.last.id || '';
381
- account.usage.requests.last.timestamp = account.usage.requests.last.timestamp || '1970-01-01T00:00:00.000Z';
382
- account.usage.requests.last.timestampUNIX = account.usage.requests.last.timestampUNIX || 0;
386
+ account.usage.requests.last.timestamp = account.usage.requests.last.timestamp || timestampOld;
387
+ account.usage.requests.last.timestampUNIX = account.usage.requests.last.timestampUNIX || timestampUNIXOld;
383
388
 
384
389
  // Personal
385
390
  account.personal = account.personal || {};
386
391
 
387
392
  account.personal.birthday = account.personal.birthday || {};
388
- account.personal.birthday.timestamp = account.personal.birthday.timestamp || '1970-01-01T00:00:00.000Z';
389
- account.personal.birthday.timestampUNIX = account.personal.birthday.timestampUNIX || 0;
393
+ account.personal.birthday.timestamp = account.personal.birthday.timestamp || timestampOld;
394
+ account.personal.birthday.timestampUNIX = account.personal.birthday.timestampUNIX || timestampUNIXOld;
390
395
 
391
396
  account.personal.gender = account.personal.gender || '';
392
397
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.30",
3
+ "version": "3.2.31",
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": {