web-manager 2.1.34 → 2.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -0
- package/lib/account.js +26 -0
- package/package.json +2 -2
package/index.js
CHANGED
@@ -1062,6 +1062,9 @@ function Manager() {
|
|
1062
1062
|
// This.log('subscribe()');
|
1063
1063
|
return new Promise(function(resolve, reject) {
|
1064
1064
|
// var subscribed = !This.notifications().isSubscribed();
|
1065
|
+
if (!supported) {
|
1066
|
+
return resolve(false)
|
1067
|
+
}
|
1065
1068
|
firebase.messaging().getToken({
|
1066
1069
|
serviceWorkerRegistration: This.properties.references.serviceWorker,
|
1067
1070
|
})
|
package/lib/account.js
CHANGED
@@ -202,6 +202,12 @@ Account.prototype._resolveAccount = function (currentUser, account, options) {
|
|
202
202
|
|
203
203
|
var defaultPlanId = options.defaultPlanId || 'basic';
|
204
204
|
|
205
|
+
// Resolve auth
|
206
|
+
account.auth = account.auth || {};
|
207
|
+
account.auth.email = account.auth.email || currentUser.email || null;
|
208
|
+
account.auth.uid = account.auth.uid || currentUser.uid || null;
|
209
|
+
account.auth.temporary = account.auth.temporary || false;
|
210
|
+
|
205
211
|
// Resolve plan
|
206
212
|
account.plan = account.plan || {};
|
207
213
|
account.plan.id = account.plan.id || defaultPlanId;
|
@@ -254,6 +260,26 @@ Account.prototype._resolveAccount = function (currentUser, account, options) {
|
|
254
260
|
account.roles.vip = account.roles.vip === true || account.roles.vip === 'true';
|
255
261
|
account.roles.promoExempt = account.roles.promoExempt === true || account.roles.promoExempt === 'true';
|
256
262
|
|
263
|
+
// Resolve affiliate
|
264
|
+
account.affiliate = account.affiliate || {};
|
265
|
+
account.affiliate.code = account.affiliate.code || 'unknown';
|
266
|
+
account.affiliate.referrals = account.affiliate.referrals || [];
|
267
|
+
account.affiliate.referrer = account.affiliate.referrer || 'unknown';
|
268
|
+
|
269
|
+
// Resolve activity
|
270
|
+
account.activity = account.activity || {};
|
271
|
+
account.activity.lastActivity = account.activity.lastActivity || {};
|
272
|
+
account.activity.lastActivity.timestamp = account.activity.lastActivity.timestamp || '1999-01-01T00:00:00Z';
|
273
|
+
account.activity.lastActivity.timestampUNIX = account.activity.lastActivity.timestampUNIX || 0;
|
274
|
+
|
275
|
+
account.activity.created = account.activity.created || {};
|
276
|
+
account.activity.created.timestamp = account.activity.created.timestamp || '1999-01-01T00:00:00Z';
|
277
|
+
account.activity.created.timestampUNIX = account.activity.created.timestampUNIX || 0;
|
278
|
+
|
279
|
+
// Api
|
280
|
+
account.clientId = account.clientId || 'unknown';
|
281
|
+
account.privateKey = account.privateKey || 'unknown';
|
282
|
+
|
257
283
|
// Set UI elements
|
258
284
|
try {
|
259
285
|
var isDevelopment = utilities.get(self.Manager, 'properties.meta.environment', '') === 'development';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "web-manager",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.35",
|
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
|
+
}
|