backend-manager 3.0.45 → 3.0.46

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "3.0.45",
3
+ "version": "3.0.46",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -40,7 +40,8 @@ Usage.prototype.init = function (assistant, options) {
40
40
  options.app = options.app || Manager.config.app.id;
41
41
  options.refetch = typeof options.refetch === 'undefined' ? false : options.refetch;
42
42
  options.clear = typeof options.clear === 'undefined' ? false : options.clear;
43
- options.today = options.today || undefined;
43
+ options.today = typeof options.today === 'undefined' ? undefined : options.today;
44
+ options.localKey = typeof options.localKey === 'undefined' ? undefined : options.localKey;
44
45
  options.log = typeof options.log === 'undefined' ? false : options.log;
45
46
 
46
47
  // Check for required options
@@ -48,6 +49,9 @@ Usage.prototype.init = function (assistant, options) {
48
49
  return reject(new Error('Missing required {assistant} parameter'));
49
50
  }
50
51
 
52
+ const localKey = (options.localKey || self.assistant.request.geolocation.ip || '')
53
+ .replace(/[\.:]/g, '_');
54
+
51
55
  // Set options
52
56
  self.options = options;
53
57
 
@@ -57,7 +61,7 @@ Usage.prototype.init = function (assistant, options) {
57
61
  // Setup storage
58
62
  self.storage = Manager.storage({name: 'usage', temporary: true, clear: options.clear, log: options.log});
59
63
 
60
- self.paths.user = `users.${self.assistant.request.geolocation.ip.replace(/[\.:]/g, '_')}`;
64
+ self.paths.user = `users.${localKey}`;
61
65
  self.paths.app = `apps.${options.app}`;
62
66
 
63
67
  // Get storage data