backend-manager 3.0.41 → 3.0.43

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.41",
3
+ "version": "3.0.43",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -0,0 +1,32 @@
1
+ const _ = require('lodash')
2
+
3
+ function Module() {
4
+
5
+ }
6
+
7
+ Module.prototype.main = function () {
8
+ const self = this;
9
+ const Manager = self.Manager;
10
+ const Api = self.Api;
11
+ const assistant = self.assistant;
12
+ const payload = self.payload;
13
+
14
+ return new Promise(async function(resolve, reject) {
15
+ self.Api.resolveUser({adminRequired: true})
16
+ .then(async (user) => {
17
+ // TODO: resolve the account and send back
18
+ // - Limits for the account
19
+ // - Usage for the account
20
+ // - Plan for the account
21
+
22
+ // used in EM, WM when signing in or running account().resolve()
23
+ // on WM, it should hide and show the auth-xxx-xxx things in WM
24
+ })
25
+ .catch(e => {
26
+ return reject(e);
27
+ })
28
+ });
29
+
30
+ };
31
+
32
+ module.exports = Module;
@@ -125,7 +125,7 @@ Usage.prototype.validate = function (path, options) {
125
125
 
126
126
  // Check for required options
127
127
  const period = self.getUsage(path)
128
- const allowed = self.getLimits(path);
128
+ const allowed = self.getLimit(path);
129
129
 
130
130
  // Log
131
131
  self.log(`Usage.validate(): Checking ${period}/${allowed} for ${path}...`);
@@ -22,6 +22,7 @@ Utilities.prototype.iterateCollection = function (callback, options) {
22
22
  options.where = options.where || [];
23
23
  options.orderBy = options.orderBy || null;
24
24
  options.startAt = options.startAt || null;
25
+ options.startAfter = options.startAfter || null;
25
26
  options.log = options.log;
26
27
 
27
28
  function listAllDocuments(nextPageToken) {
@@ -40,6 +41,10 @@ Utilities.prototype.iterateCollection = function (callback, options) {
40
41
  query = query.startAt(options.startAt);
41
42
  }
42
43
 
44
+ if (batch === -1 && options.startAfter) {
45
+ query = query.startAfter(options.startAfter);
46
+ }
47
+
43
48
  // Start at next page
44
49
  if (nextPageToken) {
45
50
  query = query.startAfter(nextPageToken);