resolve-account
Advanced tools
Comparing version 1.0.19 to 1.0.20
@@ -20,3 +20,3 @@ (function (root, factory) { | ||
var SOURCE = 'library'; | ||
var VERSION = '1.0.19'; | ||
var VERSION = '1.0.20'; | ||
@@ -38,3 +38,3 @@ function ResolveAccount(options) { | ||
// @@@GO | ||
ResolveAccount.prototype.resolve = function (firebaseUser, account, options) { | ||
Account.prototype.resolve = function (firebaseUser, account, options) { | ||
var self = this; | ||
@@ -54,4 +54,4 @@ | ||
// TODO: ADD THESE THINGS: USAGE RESOVLER ETC | ||
// console.log('++++++account 1', JSON.stringify(account, null, 2)); | ||
// console.log('++++++options 1', JSON.stringify(options, null, 2)); | ||
console.log('++++++account 1', JSON.stringify(account, null, 2)); | ||
console.log('++++++options 1', JSON.stringify(options, null, 2)); | ||
@@ -85,4 +85,5 @@ // @@@DEVELOPER | ||
// var date = '2024-04-23T00:07:29.183Z'; | ||
// var date = `2024-03-23T00:07:29.183Z`; | ||
// account.plan.id = 'basic'; | ||
// // var date = `2024-03-23T00:07:29.183Z`; | ||
// // account.plan.id = 'basic'; | ||
// account.plan.id = 'premium'; | ||
// account.plan.trial = { | ||
@@ -100,2 +101,39 @@ // activated: false, | ||
// account.plan.status = 'cancelled'; | ||
// account.plan = { | ||
// "id": "premium", | ||
// "payment": { | ||
// "frequency": "monthly", | ||
// "startDate": { | ||
// "timestampUNIX": 1711373195, | ||
// "timestamp": "2024-03-25T13:26:35.000Z" | ||
// }, | ||
// "updatedBy": { | ||
// "date": { | ||
// "timestamp": "2024-04-02T13:46:47.441Z", | ||
// "timestampUNIX": 1712065607 | ||
// }, | ||
// "event": { | ||
// "name": "subscription-profile-fixer", | ||
// "id": "subscription-profile-fixer" | ||
// } | ||
// }, | ||
// "resourceId": "AzyrfuU82V0cZ87qp", | ||
// "orderId": "0908-176942-1223", | ||
// "active": false, | ||
// "processor": "chargebee" | ||
// }, | ||
// "trial": { | ||
// "expires": { | ||
// "timestamp": "1970-01-01T00:00:00.000Z", | ||
// "timestampUNIX": 0 | ||
// }, | ||
// "activated": true | ||
// }, | ||
// "expires": { | ||
// "timestampUNIX": 1714656799, | ||
// "timestamp": "2024-05-02T13:33:19.000Z" | ||
// }, | ||
// "limits": {}, | ||
// "status": "cancelled" | ||
// }, | ||
@@ -336,3 +374,3 @@ account.plan.limits = account.plan.limits || {}; | ||
// If user is on trial, start date is trial exp date | ||
var visibleStartDate = account.plan.trial.activated ? account.plan.trial.expires.timestamp : account.plan.payment.startDate.timestamp; | ||
var visibleStartDate = null; | ||
// If basic, just show account creation date | ||
@@ -342,2 +380,12 @@ if (unresolvedPlanId === defaultPlanId) { | ||
billingStatusEl.setAttribute('hidden', true); | ||
} else { | ||
if (account.plan.status === 'cancelled') { | ||
visibleStartDate = account.plan.payment.startDate.timestamp; | ||
} else { | ||
if (account.plan.trial.activated) { | ||
visibleStartDate = account.plan.trial.expires.timestamp; | ||
} | ||
} | ||
visibleStartDate = visibleStartDate || accountCreationDate; | ||
} | ||
@@ -410,4 +458,4 @@ var visibleFrequency = account.plan.payment.frequency === 'unknown' ? 'monthly' : account.plan.payment.frequency; | ||
// TODO: ADD THESE THINGS: USAGE RESOVLER ETC | ||
// console.log('++++++account 2', JSON.stringify(account, null, 2)); | ||
// console.log('++++++options 2', JSON.stringify(options, null, 2)); | ||
console.log('++++++account 2', JSON.stringify(account, null, 2)); | ||
console.log('++++++options 2', JSON.stringify(options, null, 2)); | ||
@@ -425,3 +473,2 @@ } catch (e) { | ||
// Register | ||
@@ -428,0 +475,0 @@ if (environment === 'browser') { |
{ | ||
"name": "resolve-account", | ||
"version": "1.0.19", | ||
"version": "1.0.20", | ||
"description": "Standardize account JSON structure for projects built under ITW Creative Works", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27873
402