firebase-tools 11.2.0 → 11.3.0

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.
@@ -303,14 +303,14 @@ class ProfileReport {
303
303
  });
304
304
  });
305
305
  const paths = Object.keys(unindexed);
306
- paths.forEach((path) => {
306
+ for (const path of paths) {
307
307
  const indices = Object.keys(unindexed[path]);
308
- indices.forEach((index) => {
308
+ for (const index of indices) {
309
309
  const data = unindexed[path][index];
310
310
  const row = [path, extractReadableIndex(data.query), formatNumber(data.times)];
311
311
  table.push(row);
312
- });
313
- });
312
+ }
313
+ }
314
314
  return table;
315
315
  }
316
316
  renderBandwidth(pureData) {
@@ -327,8 +327,10 @@ class ProfileReport {
327
327
  times: b1.times + b2.times,
328
328
  };
329
329
  });
330
- const paths = _.orderBy(Object.keys(data), [(p) => data[p].bytes], ["desc"]);
331
- paths.forEach((path) => {
330
+ const paths = Object.keys(data).sort((a, b) => {
331
+ return data[b].bytes - data[a].bytes;
332
+ });
333
+ for (const path of paths) {
332
334
  const bandwidth = data[path];
333
335
  const row = [
334
336
  path,
@@ -337,7 +339,7 @@ class ProfileReport {
337
339
  formatBytes(bandwidth.bytes / bandwidth.times),
338
340
  ];
339
341
  table.push(row);
340
- });
342
+ }
341
343
  return table;
342
344
  }
343
345
  renderOutgoingBandwidth() {
@@ -392,12 +394,12 @@ class ProfileReport {
392
394
  rejected: s1.rejected + s2.rejected,
393
395
  };
394
396
  });
395
- let paths = Object.keys(data);
396
- paths = _.orderBy(paths, (path) => {
397
- const speed = data[path];
398
- return speed.millis / speed.times;
399
- }, ["desc"]);
400
- paths.forEach((path) => {
397
+ const paths = Object.keys(data).sort((a, b) => {
398
+ const speedA = data[a].millis / data[a].times;
399
+ const speedB = data[b].millis / data[b].times;
400
+ return speedB - speedA;
401
+ });
402
+ for (const path of paths) {
401
403
  const speed = data[path];
402
404
  const row = [
403
405
  path,
@@ -409,7 +411,7 @@ class ProfileReport {
409
411
  row.push(formatNumber(speed.rejected));
410
412
  }
411
413
  table.push(row);
412
- });
414
+ }
413
415
  return table;
414
416
  }
415
417
  renderReadSpeed() {
package/lib/rc.js CHANGED
@@ -25,7 +25,7 @@ exports.loadRC = loadRC;
25
25
  class RC {
26
26
  constructor(rcpath, data) {
27
27
  this.path = rcpath;
28
- this.data = Object.assign({ projects: {}, targets: {} }, data);
28
+ this.data = Object.assign({ projects: {}, targets: {}, etags: {} }, data);
29
29
  }
30
30
  static loadFile(rcpath) {
31
31
  let data = {};
@@ -148,6 +148,16 @@ class RC {
148
148
  }
149
149
  return target;
150
150
  }
151
+ getEtags(projectId) {
152
+ return this.data.etags[projectId] || { extensionInstances: {} };
153
+ }
154
+ setEtags(projectId, resourceType, etagData) {
155
+ if (!this.data.etags[projectId]) {
156
+ this.data.etags[projectId] = {};
157
+ }
158
+ this.data.etags[projectId][resourceType] = etagData;
159
+ this.save();
160
+ }
151
161
  save() {
152
162
  if (this.path) {
153
163
  fs.writeFileSync(this.path, JSON.stringify(this.data, null, 2), {
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.requireConfig = void 0;
4
4
  const error_1 = require("./error");
5
5
  async function requireConfig(options) {
6
- await Promise.resolve();
7
- if (!options.config) {
8
- throw options.configError
9
- ? options.configError
10
- : new error_1.FirebaseError("Not in a Firebase project directory (could not locate firebase.json)");
11
- }
6
+ return new Promise((resolve, reject) => {
7
+ var _a;
8
+ return options.config
9
+ ? resolve()
10
+ : reject((_a = options.configError) !== null && _a !== void 0 ? _a : new error_1.FirebaseError("Not in a Firebase project directory (could not locate firebase.json)"));
11
+ });
12
12
  }
13
13
  exports.requireConfig = requireConfig;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "11.2.0",
3
+ "version": "11.3.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "firebase-tools",
9
- "version": "11.2.0",
9
+ "version": "11.3.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@google-cloud/pubsub": "^3.0.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "11.2.0",
3
+ "version": "11.3.0",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {