firebase-tools-with-isolate 15.32.0 → 15.34.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.
Files changed (103) hide show
  1. package/lib/accountImporter.js +6 -3
  2. package/lib/api.js +3 -3
  3. package/lib/apphosting/backend.js +1 -1
  4. package/lib/apphosting/secrets/index.js +7 -2
  5. package/lib/checkValidTargetFilters.js +1 -0
  6. package/lib/command.js +31 -24
  7. package/lib/commands/apps-create.js +34 -3
  8. package/lib/commands/crashlytics-heapdumps-disable.js +26 -0
  9. package/lib/commands/crashlytics-heapdumps-enable.js +54 -0
  10. package/lib/commands/crashlytics-heapdumps-status.js +32 -0
  11. package/lib/commands/deploy.js +3 -0
  12. package/lib/commands/functions-kits-uninstall.js +43 -21
  13. package/lib/commands/functions-lifecycle-list.js +5 -6
  14. package/lib/commands/hosting-channel-deploy.js +3 -3
  15. package/lib/commands/hosting-clone.js +102 -31
  16. package/lib/commands/hosting-disable.js +5 -1
  17. package/lib/commands/index.js +9 -0
  18. package/lib/commands/init.js +7 -0
  19. package/lib/commands/run-services-update.js +16 -0
  20. package/lib/config.js +1 -0
  21. package/lib/crashlytics/alerts.js +122 -0
  22. package/lib/crashlytics/onboarding.js +71 -3
  23. package/lib/crashlytics/profilingManager.js +195 -0
  24. package/lib/crashlytics/sourcemap.js +46 -11
  25. package/lib/crashlytics/types.js +6 -1
  26. package/lib/deploy/apphosting/prepare.js +1 -0
  27. package/lib/deploy/auth/deploy.js +1 -1
  28. package/lib/deploy/auth/prepare.js +6 -7
  29. package/lib/deploy/firestore/prepare.js +5 -5
  30. package/lib/deploy/functions/build.js +3 -0
  31. package/lib/deploy/functions/cel.js +89 -58
  32. package/lib/deploy/functions/functionsDeployHelper.js +10 -0
  33. package/lib/deploy/functions/params.js +4 -2
  34. package/lib/deploy/functions/prepare.js +25 -8
  35. package/lib/deploy/functions/release/executor.js +7 -3
  36. package/lib/deploy/functions/release/fabricator.js +42 -14
  37. package/lib/deploy/functions/release/planner.js +3 -2
  38. package/lib/deploy/functions/release/sourceTokenScraper.js +1 -1
  39. package/lib/deploy/functions/validate.js +16 -0
  40. package/lib/deploy/hosting/prepare.js +1 -1
  41. package/lib/deploy/hosting/release.js +2 -2
  42. package/lib/deploy/index.js +5 -0
  43. package/lib/deploy/run/args.js +2 -0
  44. package/lib/deploy/run/buildEnv.js +72 -0
  45. package/lib/deploy/run/deploy.js +214 -0
  46. package/lib/deploy/run/index.js +23 -0
  47. package/lib/deploy/run/prepare.js +47 -0
  48. package/lib/deploy/run/prereqs.js +32 -0
  49. package/lib/deploy/run/release.js +9 -0
  50. package/lib/deploy/run/update.js +50 -0
  51. package/lib/deploy/run/util.js +73 -0
  52. package/lib/emulator/apphosting/serve.js +1 -1
  53. package/lib/emulator/auth/operations.js +8 -4
  54. package/lib/emulator/auth/utils.js +1 -1
  55. package/lib/emulator/commandUtils.js +7 -3
  56. package/lib/emulator/databaseEmulator.js +7 -3
  57. package/lib/emulator/dataconnect/pgliteServer.js +1 -1
  58. package/lib/emulator/dataconnectEmulator.js +1 -1
  59. package/lib/emulator/download.js +1 -1
  60. package/lib/emulator/downloadableEmulatorInfo.json +31 -31
  61. package/lib/emulator/downloadableEmulators.js +1 -3
  62. package/lib/emulator/emulatorLogger.js +2 -1
  63. package/lib/emulator/eventarcEmulator.js +1 -1
  64. package/lib/emulator/functionsEmulatorRuntime.js +2 -1
  65. package/lib/emulator/functionsEmulatorShared.js +1 -41
  66. package/lib/experiments.js +17 -11
  67. package/lib/extensions/warnings.js +48 -7
  68. package/lib/firestore/validator.js +1 -1
  69. package/lib/frameworks/next/constants.js +20 -12
  70. package/lib/frameworks/next/index.js +4 -23
  71. package/lib/frameworks/next/utils.js +28 -0
  72. package/lib/functions/env.js +4 -2
  73. package/lib/functions/projectConfig.js +10 -5
  74. package/lib/gcp/artifactregistry.js +20 -0
  75. package/lib/gcp/cloudmonitoring.js +80 -3
  76. package/lib/gcp/cloudsql/permissions.js +21 -32
  77. package/lib/gcp/cloudsql/permissionsSetup.js +6 -6
  78. package/lib/gcp/cloudtasks.js +15 -1
  79. package/lib/gcp/cloudtrace.js +38 -0
  80. package/lib/gcp/run.js +5 -0
  81. package/lib/gcp/runv2.js +32 -11
  82. package/lib/gcp/storage.js +9 -5
  83. package/lib/hosting/api.js +15 -15
  84. package/lib/hosting/runTags.js +1 -1
  85. package/lib/init/features/auth.js +46 -8
  86. package/lib/init/features/hosting/index.js +4 -2
  87. package/lib/init/features/index.js +4 -1
  88. package/lib/init/features/run.js +159 -0
  89. package/lib/init/index.js +6 -0
  90. package/lib/management/apps.js +4 -2
  91. package/lib/mcp/tools/firestore/converter.js +2 -2
  92. package/lib/mcp/util.js +11 -10
  93. package/lib/profileReport.js +12 -9
  94. package/lib/scopes.js +1 -3
  95. package/lib/streamJson.js +1 -0
  96. package/lib/throttler/throttler.js +1 -0
  97. package/lib/tsconfig.publish.tsbuildinfo +1 -1
  98. package/lib/utils.js +0 -15
  99. package/package.json +11 -17
  100. package/schema/firebase-config.json +41 -0
  101. package/schema/firebaserc.json +133 -0
  102. package/lib/mcp/resources/guides/init_data_connect.js +0 -30
  103. package/lib/mcp/resources/guides/init_rtdb.js +0 -30
package/lib/mcp/util.js CHANGED
@@ -114,13 +114,13 @@ function deepClean(obj, isRootLevel = false) {
114
114
  return obj;
115
115
  }
116
116
  const cleanedObj = { ...obj };
117
- if (cleanedObj.hasOwnProperty("$schema")) {
117
+ if (Object.prototype.hasOwnProperty.call(cleanedObj, "$schema")) {
118
118
  delete cleanedObj.$schema;
119
119
  }
120
- if (cleanedObj.hasOwnProperty("additionalProperties")) {
120
+ if (Object.prototype.hasOwnProperty.call(cleanedObj, "additionalProperties")) {
121
121
  delete cleanedObj.additionalProperties;
122
122
  }
123
- if (cleanedObj.hasOwnProperty("type")) {
123
+ if (Object.prototype.hasOwnProperty.call(cleanedObj, "type")) {
124
124
  const currentType = cleanedObj.type;
125
125
  if (Array.isArray(currentType)) {
126
126
  let filteredTypes = currentType.filter((t) => t !== "null");
@@ -159,12 +159,12 @@ function deepClean(obj, isRootLevel = false) {
159
159
  }
160
160
  }
161
161
  }
162
- if (cleanedObj.hasOwnProperty("properties") &&
162
+ if (Object.prototype.hasOwnProperty.call(cleanedObj, "properties") &&
163
163
  typeof cleanedObj.properties === "object" &&
164
164
  cleanedObj.properties !== null) {
165
165
  const newProperties = {};
166
166
  for (const key in cleanedObj.properties) {
167
- if (cleanedObj.properties.hasOwnProperty(key)) {
167
+ if (Object.prototype.hasOwnProperty.call(cleanedObj.properties, key)) {
168
168
  const cleanedPropertySchema = deepClean(cleanedObj.properties[key], false);
169
169
  if (cleanedPropertySchema !== null) {
170
170
  newProperties[key] = cleanedPropertySchema;
@@ -178,7 +178,7 @@ function deepClean(obj, isRootLevel = false) {
178
178
  cleanedObj.properties = newProperties;
179
179
  }
180
180
  }
181
- if (cleanedObj.hasOwnProperty("items") &&
181
+ if (Object.prototype.hasOwnProperty.call(cleanedObj, "items") &&
182
182
  typeof cleanedObj.items === "object" &&
183
183
  cleanedObj.items !== null) {
184
184
  const cleanedItemsSchema = deepClean(cleanedObj.items, false);
@@ -191,12 +191,12 @@ function deepClean(obj, isRootLevel = false) {
191
191
  }
192
192
  const defKeywords = ["$defs", "definitions"];
193
193
  for (const keyword of defKeywords) {
194
- if (cleanedObj.hasOwnProperty(keyword) &&
194
+ if (Object.prototype.hasOwnProperty.call(cleanedObj, keyword) &&
195
195
  typeof cleanedObj[keyword] === "object" &&
196
196
  cleanedObj[keyword] !== null) {
197
197
  const newDefs = {};
198
198
  for (const defKey in cleanedObj[keyword]) {
199
- if (cleanedObj[keyword].hasOwnProperty(defKey)) {
199
+ if (Object.prototype.hasOwnProperty.call(cleanedObj[keyword], defKey)) {
200
200
  const cleanedDef = deepClean(cleanedObj[keyword][defKey], false);
201
201
  if (cleanedDef !== null) {
202
202
  newDefs[defKey] = cleanedDef;
@@ -213,7 +213,8 @@ function deepClean(obj, isRootLevel = false) {
213
213
  }
214
214
  const schemaArrayKeywords = ["anyOf", "allOf", "oneOf"];
215
215
  for (const keyword of schemaArrayKeywords) {
216
- if (cleanedObj.hasOwnProperty(keyword) && Array.isArray(cleanedObj[keyword])) {
216
+ if (Object.prototype.hasOwnProperty.call(cleanedObj, keyword) &&
217
+ Array.isArray(cleanedObj[keyword])) {
217
218
  const newSchemaArray = cleanedObj[keyword]
218
219
  .map((subSchema) => deepClean(subSchema, false))
219
220
  .filter((subSchema) => subSchema !== null);
@@ -228,7 +229,7 @@ function deepClean(obj, isRootLevel = false) {
228
229
  return cleanedObj;
229
230
  }
230
231
  function cleanSchema(schema) {
231
- if (schema && schema.hasOwnProperty("type")) {
232
+ if (schema && Object.prototype.hasOwnProperty.call(schema, "type")) {
232
233
  const topLevelType = schema.type;
233
234
  if (topLevelType === "array") {
234
235
  return {};
@@ -13,7 +13,6 @@ const _ = require("lodash");
13
13
  const readline = require("readline");
14
14
  const error_1 = require("./error");
15
15
  const logger_1 = require("./logger");
16
- const DATA_LINE_REGEX = /^data: /;
17
16
  const BANDWIDTH_NOTE = "NOTE: The numbers reported here are only estimates of the data" +
18
17
  " payloads from read operations. They are NOT a valid measure of your bandwidth bill.";
19
18
  const SPEED_NOTE = "NOTE: Speeds are reported at millisecond resolution and" +
@@ -24,11 +23,11 @@ const SPEED_NOTE = "NOTE: Speeds are reported at millisecond resolution and" +
24
23
  const COLLAPSE_THRESHOLD = 25;
25
24
  const COLLAPSE_WILDCARD = ["$wildcard"];
26
25
  function extractJSON(line, input) {
27
- if (!input && !DATA_LINE_REGEX.test(line)) {
26
+ if (!input && !line.startsWith("data: ")) {
28
27
  return null;
29
28
  }
30
29
  else if (!input) {
31
- line = line.substring(5);
30
+ line = line.substring(6);
32
31
  }
33
32
  try {
34
33
  return JSON.parse(line);
@@ -120,10 +119,10 @@ class ProfileReport {
120
119
  opStats.rejected = 0;
121
120
  }
122
121
  opStats.times += 1;
123
- if (data.hasOwnProperty("millis")) {
122
+ if (Object.prototype.hasOwnProperty.call(data, "millis")) {
124
123
  opStats.millis += data.millis;
125
124
  }
126
- if (data.hasOwnProperty("pendingTime")) {
125
+ if (Object.prototype.hasOwnProperty.call(data, "pendingTime")) {
127
126
  opStats.pendingCount++;
128
127
  opStats.pendingTime += data.pendingTime;
129
128
  }
@@ -143,10 +142,10 @@ class ProfileReport {
143
142
  }
144
143
  const node = opType[path];
145
144
  node.times += 1;
146
- if (data.hasOwnProperty("millis")) {
145
+ if (Object.prototype.hasOwnProperty.call(data, "millis")) {
147
146
  node.millis += data.millis;
148
147
  }
149
- if (data.hasOwnProperty("pendingTime")) {
148
+ if (Object.prototype.hasOwnProperty.call(data, "pendingTime")) {
150
149
  node.pendingCount++;
151
150
  node.pendingTime += data.pendingTime;
152
151
  }
@@ -466,8 +465,12 @@ class ProfileReport {
466
465
  }
467
466
  }
468
467
  });
469
- rl.on("error", () => {
470
- reject();
468
+ rl.on("error", (err) => {
469
+ reject(err instanceof Error
470
+ ? err
471
+ : new error_1.FirebaseError("There was an error creating the report.", {
472
+ original: err,
473
+ }));
471
474
  });
472
475
  outStream.on("error", () => {
473
476
  errored = true;
package/lib/scopes.js CHANGED
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CLOUD_PUBSUB = exports.CLOUD_STORAGE = exports.CLOUD_PLATFORM = exports.FIREBASE_PLATFORM = exports.CLOUD_PROJECTS_READONLY = exports.USERINFO_EMAIL = exports.EMAIL = exports.OPENID = void 0;
3
+ exports.CLOUD_PLATFORM = exports.FIREBASE_PLATFORM = exports.CLOUD_PROJECTS_READONLY = exports.USERINFO_EMAIL = exports.EMAIL = exports.OPENID = void 0;
4
4
  exports.OPENID = "openid";
5
5
  exports.EMAIL = "email";
6
6
  exports.USERINFO_EMAIL = "https://www.googleapis.com/auth/userinfo.email";
7
7
  exports.CLOUD_PROJECTS_READONLY = "https://www.googleapis.com/auth/cloudplatformprojects.readonly";
8
8
  exports.FIREBASE_PLATFORM = "https://www.googleapis.com/auth/firebase";
9
9
  exports.CLOUD_PLATFORM = "https://www.googleapis.com/auth/cloud-platform";
10
- exports.CLOUD_STORAGE = "https://www.googleapis.com/auth/devstorage.read_write";
11
- exports.CLOUD_PUBSUB = "https://www.googleapis.com/auth/pubsub";
package/lib/streamJson.js CHANGED
@@ -21,6 +21,7 @@ function loadStreamJson() {
21
21
  ]);
22
22
  return {
23
23
  chain: streamChain.chain,
24
+ many: streamChain.many,
24
25
  parser: streamJson.parser,
25
26
  pick: pick.pick,
26
27
  filter: filter.filter,
@@ -209,6 +209,7 @@ class Throttler {
209
209
  }
210
210
  this.cleanupTask(cursorIndex);
211
211
  this.finish(error);
212
+ this.process();
212
213
  }
213
214
  cleanupTask(cursorIndex) {
214
215
  const { timeoutId } = this.taskDataMap.get(cursorIndex);