backend-manager 3.0.39 → 3.0.40

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.39",
3
+ "version": "3.0.40",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -194,7 +194,22 @@ Usage.prototype.increment = function (path, value, options) {
194
194
  });
195
195
 
196
196
  // Log the updated user
197
- self.log(`Usage.init(): Incremented user`, self.user);
197
+ self.log(`Usage.init(): Incremented ${path} for user`, self.user);
198
+
199
+ return self;
200
+ };
201
+
202
+ Usage.prototype.set = function (path, value) {
203
+ const self = this;
204
+ const Manager = self.Manager;
205
+ const assistant = self.assistant;
206
+
207
+ // Update total and period
208
+ const resolved = `usage.${path}.${key}`;
209
+ _.set(self.user, resolved, value);
210
+
211
+ // Log the updated user
212
+ self.log(`Usage.init(): Set ${path} for user`, self.user);
198
213
 
199
214
  return self;
200
215
  };