backend-manager 5.0.18 → 5.0.20

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.18",
3
+ "version": "5.0.20",
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
  });
@@ -68,7 +68,7 @@ Usage.prototype.init = function (assistant, options) {
68
68
 
69
69
  // Set local key
70
70
  self.key = (options.key || self.assistant.request.geolocation.ip || '')
71
- .replace(/[\.:]/g, '_');
71
+ // .replace(/[\.:]/g, '_');
72
72
 
73
73
  // Set paths
74
74
  self.paths.user = `users.${self.key}`;