backend-manager 2.5.55 → 2.5.57

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": "2.5.55",
3
+ "version": "2.5.57",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -1,6 +1,7 @@
1
1
  const pushid = require('pushid');
2
2
  const fetch = require('wonderful-fetch');
3
3
  const powertools = require('node-powertools');
4
+ const { get } = require('lodash');
4
5
 
5
6
  function Module() {
6
7
 
@@ -63,7 +64,7 @@ Module.prototype.main = function () {
63
64
  feedback: request,
64
65
  decision: decision,
65
66
  owner: {
66
- uid: user.uid || null,
67
+ uid: get(user, 'auth.uid', null),
67
68
  }
68
69
  }, {merge: true})
69
70
  .then(r => {
@@ -595,6 +595,7 @@ Manager.prototype.storage = function (options) {
595
595
 
596
596
  if (!self._internal.storage[options.name]) {
597
597
  options.temporary = typeof options.temporary === 'undefined' ? false : options.temporary;
598
+ options.clear = typeof options.clear === 'undefined' ? true : options.clear;
598
599
 
599
600
  const low = require('lowdb');
600
601
  const FileSync = require('lowdb/adapters/FileSync');
@@ -603,7 +604,11 @@ Manager.prototype.storage = function (options) {
603
604
  : `./.data/${options.name}.json`;
604
605
  const adapter = new FileSync(dbPath);
605
606
 
606
- if (options.temporary && self.assistant.meta.environment === 'development') {
607
+ if (
608
+ options.temporary
609
+ && self.assistant.meta.environment === 'development'
610
+ && options.clear
611
+ ) {
607
612
  self.assistant.log('Removed temporary file @', dbPath);
608
613
  jetpack.remove(dbPath);
609
614
  }