backend-manager 2.5.5 → 2.5.7

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.5",
3
+ "version": "2.5.7",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -31,7 +31,7 @@
31
31
  "@google-cloud/storage": "^5.20.5",
32
32
  "@sendgrid/mail": "^7.7.0",
33
33
  "@sentry/node": "^6.19.7",
34
- "backend-assistant": "^0.0.72",
34
+ "backend-assistant": "^0.0.73",
35
35
  "busboy": "^1.6.0",
36
36
  "chalk": "^4.1.2",
37
37
  "cors": "^2.8.5",
@@ -65,5 +65,75 @@
65
65
  "bin/",
66
66
  "src/",
67
67
  "templates/"
68
+ ],
69
+ "allDependencies": {
70
+ "@firebase/rules-unit-testing": "^2.0.4",
71
+ "@google-cloud/storage": "^5.20.5",
72
+ "@sendgrid/mail": "^7.7.0",
73
+ "@sentry/node": "^6.19.7",
74
+ "backend-assistant": "^0.0.72",
75
+ "busboy": "^1.6.0",
76
+ "chalk": "^4.1.2",
77
+ "cors": "^2.8.5",
78
+ "dotenv": "^16.0.2",
79
+ "firebase-admin": "^9.12.0",
80
+ "firebase-functions": "^3.23.0",
81
+ "fs-jetpack": "^4.3.1",
82
+ "hcaptcha": "^0.1.1",
83
+ "inquirer": "^8.2.4",
84
+ "json5": "^2.2.1",
85
+ "jwt-decode": "^3.1.2",
86
+ "lodash": "^4.17.21",
87
+ "lowdb": "^1.0.0",
88
+ "mailchimp-api-v3": "^1.15.0",
89
+ "moment": "^2.29.4",
90
+ "node-fetch": "^2.6.7",
91
+ "node-powertools": "^0.0.21",
92
+ "npm-api": "^1.0.1",
93
+ "paypal-server-api": "^0.0.8",
94
+ "pushid": "^1.0.0",
95
+ "semver": "^7.3.7",
96
+ "shortid": "^2.2.16",
97
+ "uid-generator": "^2.0.0",
98
+ "ultimate-jekyll-poster": "^0.0.15",
99
+ "universal-analytics": "^0.5.3",
100
+ "uuid": "^8.3.2",
101
+ "wonderful-fetch": "^0.0.14",
102
+ "yargs": "^17.5.1"
103
+ },
104
+ "allDependenciesKeys": [
105
+ "@firebase/rules-unit-testing",
106
+ "@google-cloud/storage",
107
+ "@sendgrid/mail",
108
+ "@sentry/node",
109
+ "backend-assistant",
110
+ "busboy",
111
+ "chalk",
112
+ "cors",
113
+ "dotenv",
114
+ "firebase-admin",
115
+ "firebase-functions",
116
+ "fs-jetpack",
117
+ "hcaptcha",
118
+ "inquirer",
119
+ "json5",
120
+ "jwt-decode",
121
+ "lodash",
122
+ "lowdb",
123
+ "mailchimp-api-v3",
124
+ "moment",
125
+ "node-fetch",
126
+ "node-powertools",
127
+ "npm-api",
128
+ "paypal-server-api",
129
+ "pushid",
130
+ "semver",
131
+ "shortid",
132
+ "uid-generator",
133
+ "ultimate-jekyll-poster",
134
+ "universal-analytics",
135
+ "uuid",
136
+ "wonderful-fetch",
137
+ "yargs"
68
138
  ]
69
139
  }
@@ -15,11 +15,21 @@ Utilities.prototype.iterateCollection = function (callback, options) {
15
15
  options = options || {};
16
16
  options.collection = options.collection || '';
17
17
  options.batchSize = options.batchSize || 1000;
18
+ options.orderBy = options.orderBy || null;
19
+ options.startAt = options.startAt || null;
18
20
  options.log = options.log;
19
21
 
20
22
  function listAllDocuments(nextPageToken) {
21
23
  let query = admin.firestore().collection(options.collection)
22
24
 
25
+ if (options.orderBy) {
26
+ query = query.orderBy(options.orderBy);
27
+ }
28
+
29
+ if (batch === -1 && options.startAt) {
30
+ query = query.startAt(options.startAt);
31
+ }
32
+
23
33
  // Start at next page
24
34
  if (nextPageToken) {
25
35
  query = query.startAfter(nextPageToken);
@@ -47,6 +47,7 @@ Manager.prototype.init = function (exporter, options) {
47
47
  options.useFirebaseLogger = typeof options.useFirebaseLogger === 'undefined' ? true : options.useFirebaseLogger;
48
48
  options.serviceAccountPath = typeof options.serviceAccountPath === 'undefined' ? 'service-account.json' : options.serviceAccountPath;
49
49
  options.backendManagerConfigPath = typeof options.backendManagerConfigPath === 'undefined' ? 'backend-manager-config.json' : options.backendManagerConfigPath;
50
+ options.fetchStats = typeof options.fetchStats === 'undefined' ? true : options.fetchStats;
50
51
  options.uniqueAppName = options.uniqueAppName || undefined;
51
52
  options.assistant = options.assistant || {};
52
53
  // options.assistant.optionsLogString = options.assistant.optionsLogString || undefined;
@@ -404,7 +405,7 @@ Manager.prototype.init = function (exporter, options) {
404
405
  self.storage();
405
406
  }
406
407
 
407
- if (self.assistant.meta.environment === 'development') {
408
+ if (self.assistant.meta.environment === 'development' && options.fetchStats) {
408
409
  setTimeout(function () {
409
410
  console.log('Fetching meta/stats...');
410
411
  self.libraries.admin