backend-manager 5.0.17 → 5.0.19

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.
@@ -0,0 +1,8 @@
1
+ [debug] [2025-10-20T05:12:15.296Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
2
+ [debug] [2025-10-20T05:12:15.297Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
3
+ [debug] [2025-10-20T05:12:15.299Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
4
+ [debug] [2025-10-20T05:12:15.299Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
5
+ [debug] [2025-10-20T05:12:15.299Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
6
+ [debug] [2025-10-20T05:12:15.299Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
7
+ [debug] [2025-10-20T05:12:15.299Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
8
+ [debug] [2025-10-20T05:12:15.299Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "5.0.17",
3
+ "version": "5.0.19",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -156,38 +156,14 @@ Module.prototype.clearFirestore = function() {
156
156
  })
157
157
  }
158
158
 
159
- // Clear temporary/usage in firestore by deleting the doc
160
- admin.firestore().collection('temporary').listDocuments()
161
- .then((snap) => {
162
- const chunks = [];
163
- for (let i = 0; i < snap.length; i += 500) {
164
- chunks.push(snap.slice(i, i + 500))
165
- }
166
-
167
- // Delete in chunks
168
- for (const chunk of chunks) {
169
- // Get a new write batch
170
- const batch = admin.firestore().batch()
171
-
172
- chunk.map((doc) => {
173
- assistant.log('Deleting', doc.id);
174
-
175
- batch.delete(doc);
176
- });
177
-
178
- batch.commit()
179
- .catch((e) => {
180
- assistant.error('Error committing batch', e);
181
- });
182
- }
159
+ // Clear usage in firestore by deleting the entire collection
160
+ await admin.firestore().recursiveDelete(admin.firestore().collection('usage'))
161
+ .then(() => {
162
+ assistant.log(`[firestore]: Deleted usage collection`);
163
+ })
164
+ .catch((e) => {
165
+ assistant.errorify(`Error deleting usage collection: ${e}`, {code: 500, log: true});
183
166
  })
184
- // await libraries.admin.firestore().doc(`temporary/usage`).delete()
185
- // .then(r => {
186
- // assistant.log(`[firestore]: Deleted temporary/usage`);
187
- // })
188
- // .catch(e => {
189
- // assistant.errorify(`Error deleting temporary/usage: ${e}`, {code: 500, log: true});
190
- // })
191
167
 
192
168
  return resolve();
193
169
  });
@@ -148,7 +148,7 @@ Usage.prototype.validate = function (name, options) {
148
148
  // Set options
149
149
  options = options || {};
150
150
  options.useCaptchaResponse = typeof options.useCaptchaResponse === 'undefined' ? true : options.useCaptchaResponse;
151
- options.log = typeof options.log === 'undefined' ? assistant.isDevelopment() : options.log;
151
+ options.log = typeof options.log === 'undefined' ? true : options.log;
152
152
  options.throw = typeof options.throw === 'undefined' ? false : options.throw;
153
153
 
154
154
  // Check for required options