firebase-tools 9.23.2 → 10.1.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 (222) hide show
  1. package/lib/api.js +1 -1
  2. package/lib/apiv2.js +2 -2
  3. package/lib/appdistribution/client.js +1 -1
  4. package/lib/appdistribution/options-parser-util.js +1 -1
  5. package/lib/auth.js +2 -2
  6. package/lib/command.js +26 -26
  7. package/lib/commands/appdistribution-distribute.js +4 -4
  8. package/lib/commands/appdistribution-testers-add.js +2 -2
  9. package/lib/commands/appdistribution-testers-remove.js +2 -2
  10. package/lib/commands/apps-android-sha-create.js +2 -2
  11. package/lib/commands/apps-android-sha-delete.js +2 -2
  12. package/lib/commands/apps-android-sha-list.js +2 -2
  13. package/lib/commands/apps-create.js +9 -9
  14. package/lib/commands/apps-list.js +3 -3
  15. package/lib/commands/apps-sdkconfig.js +8 -8
  16. package/lib/commands/database-get.js +1 -1
  17. package/lib/commands/database-instances-create.js +4 -4
  18. package/lib/commands/database-instances-list.js +4 -4
  19. package/lib/commands/database-profile.js +1 -1
  20. package/lib/commands/database-push.js +1 -1
  21. package/lib/commands/database-remove.js +4 -4
  22. package/lib/commands/database-set.js +4 -4
  23. package/lib/commands/database-settings-get.js +1 -1
  24. package/lib/commands/database-settings-set.js +1 -1
  25. package/lib/commands/database-update.js +4 -4
  26. package/lib/commands/ext-configure.js +2 -2
  27. package/lib/commands/ext-dev-deprecate.js +4 -4
  28. package/lib/commands/ext-dev-extension-delete.js +3 -3
  29. package/lib/commands/ext-dev-init.js +3 -3
  30. package/lib/commands/ext-dev-list.js +1 -1
  31. package/lib/commands/ext-dev-publish.js +3 -3
  32. package/lib/commands/ext-dev-register.js +5 -5
  33. package/lib/commands/ext-dev-undeprecate.js +4 -4
  34. package/lib/commands/ext-dev-unpublish.js +3 -3
  35. package/lib/commands/ext-dev-usage.js +145 -0
  36. package/lib/commands/ext-export.js +8 -8
  37. package/lib/commands/ext-info.js +4 -4
  38. package/lib/commands/ext-install.js +26 -22
  39. package/lib/commands/ext-list.js +2 -2
  40. package/lib/commands/ext-sources-create.js +2 -2
  41. package/lib/commands/ext-uninstall.js +3 -3
  42. package/lib/commands/ext-update.js +17 -17
  43. package/lib/commands/ext.js +3 -3
  44. package/lib/commands/firestore-delete.js +3 -3
  45. package/lib/commands/functions-config-export.js +11 -11
  46. package/lib/commands/functions-delete.js +3 -3
  47. package/lib/commands/functions-deletegcfartifacts.js +4 -4
  48. package/lib/commands/functions-list.js +1 -1
  49. package/lib/commands/functions-log.js +1 -1
  50. package/lib/commands/hosting-channel-create.js +12 -12
  51. package/lib/commands/hosting-channel-delete.js +9 -9
  52. package/lib/commands/hosting-channel-deploy.js +17 -17
  53. package/lib/commands/hosting-channel-list.js +5 -5
  54. package/lib/commands/hosting-channel-open.js +9 -9
  55. package/lib/commands/hosting-clone.js +15 -15
  56. package/lib/commands/hosting-disable.js +4 -4
  57. package/lib/commands/hosting-sites-create.js +7 -7
  58. package/lib/commands/hosting-sites-delete.js +7 -7
  59. package/lib/commands/hosting-sites-get.js +2 -2
  60. package/lib/commands/hosting-sites-list.js +3 -3
  61. package/lib/commands/index.js +1 -0
  62. package/lib/commands/login.js +2 -2
  63. package/lib/commands/logout.js +1 -1
  64. package/lib/commands/open.js +1 -1
  65. package/lib/commands/projects-addfirebase.js +2 -2
  66. package/lib/commands/projects-create.js +2 -2
  67. package/lib/commands/projects-list.js +1 -1
  68. package/lib/commands/remoteconfig-get.js +3 -3
  69. package/lib/commands/remoteconfig-rollback.js +3 -3
  70. package/lib/commands/remoteconfig-versions-list.js +1 -1
  71. package/lib/commands/setup-emulators-storage.js +1 -1
  72. package/lib/config.js +6 -6
  73. package/lib/database/api.js +2 -2
  74. package/lib/deploy/extensions/deploy.js +4 -4
  75. package/lib/deploy/extensions/deploymentSummary.js +5 -4
  76. package/lib/deploy/extensions/index.js +1 -0
  77. package/lib/deploy/extensions/params.js +1 -1
  78. package/lib/deploy/extensions/planner.js +3 -3
  79. package/lib/deploy/extensions/prepare.js +9 -9
  80. package/lib/deploy/extensions/release.js +1 -1
  81. package/lib/deploy/extensions/secrets.js +7 -7
  82. package/lib/deploy/extensions/validate.js +2 -2
  83. package/lib/deploy/functions/backend.js +6 -4
  84. package/lib/deploy/functions/checkIam.js +7 -7
  85. package/lib/deploy/functions/containerCleaner.js +3 -3
  86. package/lib/deploy/functions/deploy.js +10 -11
  87. package/lib/deploy/functions/ensureCloudBuildEnabled.js +3 -3
  88. package/lib/deploy/functions/index.js +1 -0
  89. package/lib/deploy/functions/prepare.js +13 -13
  90. package/lib/deploy/functions/prompts.js +5 -5
  91. package/lib/deploy/functions/release/executor.js +4 -1
  92. package/lib/deploy/functions/release/fabricator.js +5 -5
  93. package/lib/deploy/functions/release/index.js +3 -3
  94. package/lib/deploy/functions/release/planner.js +6 -6
  95. package/lib/deploy/functions/release/reporter.js +8 -4
  96. package/lib/deploy/functions/runtimes/discovery/index.js +2 -2
  97. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +14 -14
  98. package/lib/deploy/functions/runtimes/golang/index.js +6 -6
  99. package/lib/deploy/functions/runtimes/node/index.js +3 -3
  100. package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +1 -1
  101. package/lib/deploy/functions/runtimes/node/parseTriggers.js +3 -3
  102. package/lib/deploy/functions/services/storage.js +1 -1
  103. package/lib/deploy/functions/triggerRegionHelper.js +1 -1
  104. package/lib/deploy/hosting/deploy.js +7 -7
  105. package/lib/deploy/hosting/uploader.js +1 -1
  106. package/lib/deploy/hosting/validate.js +3 -3
  107. package/lib/deploy/remoteconfig/prepare.js +3 -3
  108. package/lib/deploy/remoteconfig/release.js +3 -3
  109. package/lib/deploy/storage/deploy.js +1 -1
  110. package/lib/deploy/storage/release.js +2 -2
  111. package/lib/detectProjectRoot.js +5 -5
  112. package/lib/emulator/auth/apiSpec.js +13 -7
  113. package/lib/emulator/auth/handlers.js +3 -3
  114. package/lib/emulator/auth/index.js +1 -1
  115. package/lib/emulator/auth/operations.js +256 -248
  116. package/lib/emulator/auth/server.js +11 -8
  117. package/lib/emulator/auth/state.js +12 -12
  118. package/lib/emulator/auth/widget_ui.js +1 -1
  119. package/lib/emulator/commandUtils.js +5 -5
  120. package/lib/emulator/controller.js +16 -11
  121. package/lib/emulator/downloadableEmulators.js +7 -7
  122. package/lib/emulator/emulatorLogger.js +1 -1
  123. package/lib/emulator/functionsEmulator.js +101 -74
  124. package/lib/emulator/functionsEmulatorRuntime.js +33 -18
  125. package/lib/emulator/functionsEmulatorShell.js +3 -2
  126. package/lib/emulator/functionsRuntimeWorker.js +1 -1
  127. package/lib/emulator/hubExport.js +2 -2
  128. package/lib/emulator/storage/apis/firebase.js +2 -2
  129. package/lib/emulator/storage/apis/gcloud.js +2 -2
  130. package/lib/emulator/storage/cloudFunctions.js +1 -1
  131. package/lib/emulator/storage/files.js +14 -14
  132. package/lib/emulator/storage/index.js +2 -2
  133. package/lib/emulator/storage/metadata.js +7 -6
  134. package/lib/emulator/storage/rules/runtime.js +5 -5
  135. package/lib/emulator/storage/server.js +2 -2
  136. package/lib/ensureApiEnabled.js +7 -7
  137. package/lib/error.js +3 -3
  138. package/lib/extensions/askUserForConsent.js +2 -3
  139. package/lib/extensions/askUserForParam.js +10 -10
  140. package/lib/extensions/billingMigrationHelper.js +1 -1
  141. package/lib/extensions/changelog.js +3 -3
  142. package/lib/extensions/displayExtensionInfo.js +5 -5
  143. package/lib/extensions/emulator/optionsHelper.js +1 -1
  144. package/lib/extensions/emulator/specHelper.js +1 -1
  145. package/lib/extensions/emulator/triggerHelper.js +1 -1
  146. package/lib/extensions/export.js +6 -6
  147. package/lib/extensions/extensionsApi.js +14 -1
  148. package/lib/extensions/extensionsHelper.js +38 -29
  149. package/lib/extensions/listExtensions.js +1 -1
  150. package/lib/extensions/localHelper.js +1 -1
  151. package/lib/extensions/metricsTypeDef.js +2 -0
  152. package/lib/extensions/metricsUtils.js +98 -0
  153. package/lib/extensions/paramHelper.js +6 -6
  154. package/lib/extensions/provisioningHelper.js +6 -4
  155. package/lib/extensions/resolveSource.js +1 -1
  156. package/lib/extensions/secretsUtils.js +3 -3
  157. package/lib/extensions/updateHelper.js +9 -9
  158. package/lib/extensions/utils.js +1 -1
  159. package/lib/extensions/warnings.js +10 -9
  160. package/lib/fetchWebSetup.js +2 -2
  161. package/lib/filterTargets.js +2 -2
  162. package/lib/firestore/indexes.js +2 -2
  163. package/lib/fsAsync.js +3 -3
  164. package/lib/fsutils.js +2 -2
  165. package/lib/functional.js +2 -1
  166. package/lib/functions/env.js +1 -1
  167. package/lib/functions/runtimeConfigExport.js +4 -4
  168. package/lib/functionsConfig.js +3 -3
  169. package/lib/functionsShellCommandAction.js +4 -3
  170. package/lib/gcp/cloudmonitoring.js +74 -0
  171. package/lib/gcp/cloudscheduler.js +1 -1
  172. package/lib/gcp/iam.js +2 -2
  173. package/lib/gcp/resourceManager.js +2 -2
  174. package/lib/gcp/secretManager.js +3 -2
  175. package/lib/getDefaultDatabaseInstance.js +1 -1
  176. package/lib/getDefaultHostingSite.js +1 -1
  177. package/lib/getProjectNumber.js +2 -2
  178. package/lib/handlePreviewToggles.js +5 -5
  179. package/lib/hosting/api.js +6 -6
  180. package/lib/hosting/cloudRunProxy.js +6 -6
  181. package/lib/hosting/functionsProxy.js +3 -3
  182. package/lib/hosting/implicitInit.js +2 -2
  183. package/lib/hosting/normalizedHostingConfigs.js +3 -3
  184. package/lib/hosting/proxy.js +2 -2
  185. package/lib/init/features/account.js +7 -7
  186. package/lib/init/features/database.js +9 -9
  187. package/lib/init/features/emulators.js +8 -8
  188. package/lib/init/features/firestore/index.js +3 -3
  189. package/lib/init/features/firestore/indexes.js +2 -2
  190. package/lib/init/features/firestore/rules.js +2 -2
  191. package/lib/init/features/functions/golang.js +4 -4
  192. package/lib/init/features/functions/index.js +4 -4
  193. package/lib/init/features/hosting/github.js +31 -31
  194. package/lib/init/features/project.js +8 -8
  195. package/lib/init/features/remoteconfig.js +2 -2
  196. package/lib/init/features/storage.js +2 -2
  197. package/lib/listFiles.js +1 -1
  198. package/lib/management/apps.js +3 -3
  199. package/lib/management/projects.js +6 -6
  200. package/lib/previews.js +2 -2
  201. package/lib/profiler.js +1 -1
  202. package/lib/projectPath.js +1 -1
  203. package/lib/projectUtils.js +1 -1
  204. package/lib/prompt.js +0 -1
  205. package/lib/rc.js +1 -1
  206. package/lib/requireAuth.js +2 -2
  207. package/lib/requireDatabaseInstance.js +1 -1
  208. package/lib/requireHostingSite.js +1 -1
  209. package/lib/requirePermissions.js +4 -4
  210. package/lib/rulesDeploy.js +2 -2
  211. package/lib/serve/functions.js +14 -7
  212. package/lib/serve/hosting.js +7 -7
  213. package/lib/utils.js +3 -2
  214. package/npm-shrinkwrap.json +24926 -0
  215. package/package.json +24 -24
  216. package/standalone/firepit.js +4 -4
  217. package/templates/init/functions/javascript/package.lint.json +1 -1
  218. package/templates/init/functions/javascript/package.nolint.json +1 -1
  219. package/templates/init/functions/typescript/package.lint.json +1 -1
  220. package/templates/init/functions/typescript/package.nolint.json +1 -1
  221. package/templates/init/hosting/index.html +1 -1
  222. package/CHANGELOG.md +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "9.23.2",
3
+ "version": "10.1.0",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -55,7 +55,7 @@
55
55
  ],
56
56
  "preferGlobal": true,
57
57
  "engines": {
58
- "node": ">= 10.13"
58
+ "node": ">= 12"
59
59
  },
60
60
  "author": "Firebase (https://firebase.google.com/)",
61
61
  "license": "MIT",
@@ -85,8 +85,6 @@
85
85
  },
86
86
  "dependencies": {
87
87
  "@google-cloud/pubsub": "^2.7.0",
88
- "@types/archiver": "^5.1.0",
89
- "JSONStream": "^1.2.1",
90
88
  "abort-controller": "^3.0.0",
91
89
  "ajv": "^6.12.6",
92
90
  "archiver": "^5.0.0",
@@ -102,16 +100,17 @@
102
100
  "cross-spawn": "^7.0.1",
103
101
  "csv-streamify": "^3.0.4",
104
102
  "dotenv": "^6.1.0",
105
- "exegesis": "^2.5.7",
106
- "exegesis-express": "^2.0.0",
103
+ "exegesis": "^4.1.0",
104
+ "exegesis-express": "^4.0.0",
107
105
  "exit-code": "^1.0.2",
108
106
  "express": "^4.16.4",
109
107
  "filesize": "^6.1.0",
110
108
  "fs-extra": "^5.0.0",
111
109
  "glob": "^7.1.2",
112
- "google-auth-library": "^6.1.3",
113
- "inquirer": "~6.3.1",
110
+ "google-auth-library": "^7.11.0",
111
+ "inquirer": "^8.2.0",
114
112
  "js-yaml": "^3.13.1",
113
+ "JSONStream": "^1.2.1",
115
114
  "jsonwebtoken": "^8.5.1",
116
115
  "leven": "^3.1.0",
117
116
  "lodash": "^4.17.21",
@@ -122,7 +121,7 @@
122
121
  "morgan": "^1.10.0",
123
122
  "node-fetch": "^2.6.1",
124
123
  "open": "^6.3.0",
125
- "ora": "^3.4.0",
124
+ "ora": "^5.4.1",
126
125
  "portfinder": "^1.0.23",
127
126
  "progress": "^2.0.3",
128
127
  "proxy-agent": "^5.0.0",
@@ -146,9 +145,10 @@
146
145
  "devDependencies": {
147
146
  "@google/events": "^5.1.1",
148
147
  "@manifoldco/swagger-to-ts": "^2.0.0",
148
+ "@types/archiver": "^5.1.0",
149
149
  "@types/body-parser": "^1.17.0",
150
- "@types/chai": "^4.2.12",
151
- "@types/chai-as-promised": "^7.1.3",
150
+ "@types/chai": "^4.3.0",
151
+ "@types/chai-as-promised": "^7.1.4",
152
152
  "@types/cjson": "^0.5.0",
153
153
  "@types/cli-color": "^0.3.29",
154
154
  "@types/cli-table": "^0.3.0",
@@ -160,12 +160,12 @@
160
160
  "@types/express-serve-static-core": "^4.17.8",
161
161
  "@types/fs-extra": "^5.0.5",
162
162
  "@types/glob": "^7.1.1",
163
- "@types/inquirer": "^6.0.3",
163
+ "@types/inquirer": "^8.1.3",
164
164
  "@types/js-yaml": "^3.12.2",
165
165
  "@types/jsonwebtoken": "^8.3.8",
166
166
  "@types/lodash": "^4.14.149",
167
167
  "@types/marked": "^0.6.5",
168
- "@types/mocha": "^8.2.0",
168
+ "@types/mocha": "^9.0.0",
169
169
  "@types/multer": "^1.4.3",
170
170
  "@types/node": "^10.17.50",
171
171
  "@types/node-fetch": "^2.5.7",
@@ -185,24 +185,24 @@
185
185
  "@types/uuid": "^8.3.1",
186
186
  "@types/winston": "^2.4.4",
187
187
  "@types/ws": "^7.2.3",
188
- "@typescript-eslint/eslint-plugin": "^4.12.0",
189
- "@typescript-eslint/parser": "^4.12.0",
190
- "chai": "^4.2.0",
188
+ "@typescript-eslint/eslint-plugin": "^5.9.0",
189
+ "@typescript-eslint/parser": "^5.9.0",
190
+ "chai": "^4.3.4",
191
191
  "chai-as-promised": "^7.1.1",
192
- "eslint": "^7.17.0",
192
+ "eslint": "^8.6.0",
193
193
  "eslint-config-google": "^0.14.0",
194
- "eslint-config-prettier": "^7.1.0",
195
- "eslint-plugin-jsdoc": "^30.7.13",
196
- "eslint-plugin-prettier": "^3.3.1",
194
+ "eslint-config-prettier": "^8.3.0",
195
+ "eslint-plugin-jsdoc": "^37.5.1",
196
+ "eslint-plugin-prettier": "^4.0.0",
197
197
  "firebase": "^7.24.0",
198
198
  "firebase-admin": "^9.4.2",
199
199
  "firebase-functions": "^3.15.0",
200
200
  "google-discovery-to-swagger": "^2.1.0",
201
- "mocha": "^8.2.1",
201
+ "mocha": "^9.1.3",
202
202
  "nock": "^13.0.5",
203
203
  "nyc": "^15.1.0",
204
204
  "openapi-merge": "^1.0.23",
205
- "prettier": "^2.2.1",
205
+ "prettier": "^2.5.1",
206
206
  "proxy": "^1.0.2",
207
207
  "puppeteer": "^9.0.0",
208
208
  "sinon": "^9.2.3",
@@ -210,8 +210,8 @@
210
210
  "source-map-support": "^0.5.9",
211
211
  "supertest": "^3.3.0",
212
212
  "swagger2openapi": "^6.0.3",
213
- "ts-node": "^9.1.1",
214
- "typescript": "^3.9.5",
213
+ "ts-node": "^10.4.0",
214
+ "typescript": "^4.5.4",
215
215
  "typescript-json-schema": "^0.50.1"
216
216
  }
217
217
  }
@@ -145,7 +145,7 @@ const runtime = require("./runtime");
145
145
  let config;
146
146
  try {
147
147
  config = require("./config");
148
- } catch (err) {
148
+ } catch (err: any) {
149
149
  console.warn("Invalid Firepit configuration, this may be a broken build.");
150
150
  process.exit(2);
151
151
  }
@@ -684,7 +684,7 @@ node "${FindTool("npm/bin/npm-cli")[0]}" ${npmArgs.join(" ")} %*`,
684
684
 
685
685
  try {
686
686
  shell.mkdir("-p", runtimeBinsPath);
687
- } catch (err) {
687
+ } catch (err: any) {
688
688
  debug(err);
689
689
  }
690
690
 
@@ -693,7 +693,7 @@ node "${FindTool("npm/bin/npm-cli")[0]}" ${npmArgs.join(" ")} %*`,
693
693
  const runtimeBinPath = path.join(runtimeBinsPath, filename);
694
694
  try {
695
695
  shell.rm("-rf", runtimeBinPath);
696
- } catch (err) {
696
+ } catch (err: any) {
697
697
  debug(err);
698
698
  }
699
699
  fs.writeFileSync(runtimeBinPath, runtimeBins[filename]);
@@ -840,7 +840,7 @@ function uninstallLegacyFirepit() {
840
840
  installedFirebaseToolsPackage = JSON.parse(
841
841
  shell.cat(installedFirebaseToolsPackagePath)
842
842
  );
843
- } catch (err) {
843
+ } catch (err: any) {
844
844
  debug("No existing firebase-tools install found.");
845
845
  }
846
846
 
@@ -10,7 +10,7 @@
10
10
  "logs": "firebase functions:log"
11
11
  },
12
12
  "engines": {
13
- "node": "14"
13
+ "node": "16"
14
14
  },
15
15
  "main": "index.js",
16
16
  "dependencies": {
@@ -9,7 +9,7 @@
9
9
  "logs": "firebase functions:log"
10
10
  },
11
11
  "engines": {
12
- "node": "14"
12
+ "node": "16"
13
13
  },
14
14
  "main": "index.js",
15
15
  "dependencies": {
@@ -10,7 +10,7 @@
10
10
  "logs": "firebase functions:log"
11
11
  },
12
12
  "engines": {
13
- "node": "14"
13
+ "node": "16"
14
14
  },
15
15
  "main": "lib/index.js",
16
16
  "dependencies": {
@@ -9,7 +9,7 @@
9
9
  "logs": "firebase functions:log"
10
10
  },
11
11
  "engines": {
12
- "node": "14"
12
+ "node": "16"
13
13
  },
14
14
  "main": "lib/index.js",
15
15
  "dependencies": {
@@ -79,7 +79,7 @@
79
79
  'performance',
80
80
  ].filter(feature => typeof app[feature] === 'function');
81
81
  loadEl.textContent = `Firebase SDK loaded with ${features.join(', ')}`;
82
- } catch (e) {
82
+ } catch (e: any) {
83
83
  console.error(e);
84
84
  loadEl.textContent = 'Error loading the Firebase SDK, check the console.';
85
85
  }
package/CHANGELOG.md DELETED
@@ -1,7 +0,0 @@
1
- - Fixes issue when installing a Firebase Extension where secrets would be created before validation.
2
- - Fixes issue with filtering on a specific storage bucket using functions in the emulator. (#3893)
3
- - Fixes check in Cloud Functions for Firebase initialization to check for API enablement before trying to enable them. (#2574)
4
- - No longer tries to clean up function build images from Artifact Registry when Artifact Registry is not enabled. (#3943)
5
- - Show error message when running `firebase init hosting:github` with no Hosting config in `firebase.json`. (#3113)
6
- - Fixes issue where `remoteconfig:get` was not fetching the latest version by default. (#3559)
7
- - Fixes issue where empty variables in .env files would instead read as multi-line values. (#3934)