firebase-tools 10.2.0 → 10.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.
Files changed (139) hide show
  1. package/lib/apiv2.js +3 -0
  2. package/lib/appdistribution/options-parser-util.js +1 -1
  3. package/lib/auth.js +3 -3
  4. package/lib/command.js +1 -1
  5. package/lib/commands/apps-android-sha-create.js +2 -2
  6. package/lib/commands/apps-sdkconfig.js +1 -1
  7. package/lib/commands/auth-import.js +1 -1
  8. package/lib/commands/database-rules-list.js +2 -2
  9. package/lib/commands/emulators-start.js +1 -1
  10. package/lib/commands/ext-configure.js +58 -4
  11. package/lib/commands/ext-dev-init.js +49 -49
  12. package/lib/commands/ext-export.js +7 -2
  13. package/lib/commands/ext-install.js +163 -104
  14. package/lib/commands/ext-uninstall.js +17 -8
  15. package/lib/commands/ext-update.js +64 -11
  16. package/lib/commands/functions-config-clone.js +1 -1
  17. package/lib/commands/functions-config-export.js +1 -1
  18. package/lib/commands/hosting-clone.js +3 -3
  19. package/lib/commands/remoteconfig-get.js +1 -1
  20. package/lib/config.js +6 -3
  21. package/lib/deploy/extensions/deploymentSummary.js +3 -3
  22. package/lib/deploy/extensions/planner.js +7 -6
  23. package/lib/deploy/extensions/tasks.js +1 -1
  24. package/lib/deploy/functions/backend.js +21 -5
  25. package/lib/deploy/functions/checkIam.js +5 -5
  26. package/lib/deploy/functions/containerCleaner.js +3 -3
  27. package/lib/deploy/functions/ensure.js +3 -3
  28. package/lib/deploy/functions/functionsDeployHelper.js +2 -2
  29. package/lib/deploy/functions/prepare.js +5 -3
  30. package/lib/deploy/functions/pricing.js +1 -1
  31. package/lib/deploy/functions/prompts.js +2 -2
  32. package/lib/deploy/functions/release/fabricator.js +7 -7
  33. package/lib/deploy/functions/release/index.js +1 -1
  34. package/lib/deploy/functions/release/planner.js +43 -26
  35. package/lib/deploy/functions/release/reporter.js +3 -0
  36. package/lib/deploy/functions/runtimes/discovery/index.js +6 -6
  37. package/lib/deploy/functions/runtimes/discovery/parsing.js +1 -1
  38. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +22 -12
  39. package/lib/deploy/functions/runtimes/golang/index.js +2 -2
  40. package/lib/deploy/functions/runtimes/node/index.js +53 -0
  41. package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +2 -2
  42. package/lib/deploy/functions/runtimes/node/parseTriggers.js +52 -15
  43. package/lib/deploy/functions/runtimes/node/versioning.js +2 -2
  44. package/lib/deploy/functions/services/firebaseAlerts.js +30 -0
  45. package/lib/deploy/functions/services/index.js +9 -1
  46. package/lib/deploy/functions/services/storage.js +10 -4
  47. package/lib/deploy/functions/triggerRegionHelper.js +1 -1
  48. package/lib/deploy/functions/validate.js +3 -3
  49. package/lib/deploy/hosting/client.js +9 -0
  50. package/lib/deploy/hosting/convertConfig.js +6 -0
  51. package/lib/deploy/hosting/deploy.js +2 -2
  52. package/lib/deploy/hosting/hashcache.js +21 -19
  53. package/lib/deploy/hosting/index.js +5 -5
  54. package/lib/deploy/hosting/prepare.js +25 -25
  55. package/lib/deploy/hosting/release.js +21 -24
  56. package/lib/deploy/hosting/uploader.js +5 -5
  57. package/lib/deploy/remoteconfig/functions.js +2 -2
  58. package/lib/emulator/auth/cloudFunctions.js +1 -1
  59. package/lib/emulator/auth/operations.js +1 -1
  60. package/lib/emulator/commandUtils.js +5 -1
  61. package/lib/emulator/constants.js +4 -0
  62. package/lib/emulator/controller.js +54 -24
  63. package/lib/emulator/download.js +18 -1
  64. package/lib/emulator/downloadableEmulators.js +30 -13
  65. package/lib/emulator/emulatorLogger.js +12 -1
  66. package/lib/emulator/extensions/validation.js +70 -0
  67. package/lib/emulator/extensionsEmulator.js +175 -0
  68. package/lib/emulator/functionsEmulator.js +106 -44
  69. package/lib/emulator/functionsEmulatorRuntime.js +44 -36
  70. package/lib/emulator/functionsEmulatorShared.js +17 -10
  71. package/lib/emulator/functionsEmulatorShell.js +1 -1
  72. package/lib/emulator/functionsEmulatorUtils.js +4 -4
  73. package/lib/emulator/functionsRuntimeWorker.js +2 -2
  74. package/lib/emulator/hub.js +4 -3
  75. package/lib/emulator/loggingEmulator.js +1 -1
  76. package/lib/emulator/pubsubEmulator.js +1 -1
  77. package/lib/emulator/registry.js +10 -2
  78. package/lib/emulator/storage/apis/firebase.js +314 -332
  79. package/lib/emulator/storage/apis/gcloud.js +241 -121
  80. package/lib/emulator/storage/crc.js +5 -1
  81. package/lib/emulator/storage/errors.js +9 -0
  82. package/lib/emulator/storage/files.js +159 -300
  83. package/lib/emulator/storage/index.js +27 -73
  84. package/lib/emulator/storage/metadata.js +65 -51
  85. package/lib/emulator/storage/multipart.js +62 -0
  86. package/lib/emulator/storage/persistence.js +78 -0
  87. package/lib/emulator/storage/rules/config.js +33 -0
  88. package/lib/emulator/storage/rules/manager.js +81 -0
  89. package/lib/emulator/storage/rules/runtime.js +8 -7
  90. package/lib/emulator/storage/rules/utils.js +48 -0
  91. package/lib/emulator/storage/server.js +2 -2
  92. package/lib/emulator/storage/upload.js +106 -0
  93. package/lib/emulator/types.js +3 -0
  94. package/lib/ensureApiEnabled.js +5 -1
  95. package/lib/error.js +1 -1
  96. package/lib/extensions/askUserForParam.js +1 -1
  97. package/lib/extensions/changelog.js +3 -1
  98. package/lib/extensions/checkProjectBilling.js +1 -1
  99. package/lib/extensions/displayExtensionInfo.js +1 -1
  100. package/lib/extensions/emulator/optionsHelper.js +56 -8
  101. package/lib/extensions/emulator/specHelper.js +10 -23
  102. package/lib/extensions/export.js +1 -51
  103. package/lib/extensions/extensionsApi.js +1 -1
  104. package/lib/extensions/extensionsHelper.js +32 -19
  105. package/lib/extensions/listExtensions.js +2 -0
  106. package/lib/extensions/manifest.js +144 -0
  107. package/lib/extensions/metricsUtils.js +4 -4
  108. package/lib/extensions/paramHelper.js +9 -8
  109. package/lib/extensions/refs.js +1 -1
  110. package/lib/extensions/secretsUtils.js +3 -3
  111. package/lib/functional.js +1 -1
  112. package/lib/functions/env.js +6 -7
  113. package/lib/functions/events/v2.js +11 -0
  114. package/lib/gcp/cloudfunctions.js +42 -11
  115. package/lib/gcp/cloudfunctionsv2.js +48 -17
  116. package/lib/gcp/cloudtasks.js +1 -1
  117. package/lib/gcp/docker.js +2 -2
  118. package/lib/gcp/resourceManager.js +4 -4
  119. package/lib/gcp/run.js +2 -2
  120. package/lib/gcp/storage.js +1 -0
  121. package/lib/hosting/api.js +1 -1
  122. package/lib/hosting/functionsProxy.js +15 -5
  123. package/lib/hosting/proxy.js +2 -2
  124. package/lib/init/features/account.js +1 -1
  125. package/lib/management/database.js +1 -1
  126. package/lib/previews.js +1 -1
  127. package/lib/responseToError.js +16 -7
  128. package/lib/serve/functions.js +2 -1
  129. package/lib/serve/hosting.js +1 -1
  130. package/lib/utils.js +15 -2
  131. package/npm-shrinkwrap.json +904 -412
  132. package/package.json +3 -3
  133. package/schema/firebase-config.json +32 -0
  134. package/templates/init/functions/javascript/package.lint.json +3 -3
  135. package/templates/init/functions/javascript/package.nolint.json +2 -2
  136. package/templates/init/functions/typescript/package.lint.json +7 -7
  137. package/templates/init/functions/typescript/package.nolint.json +3 -3
  138. package/lib/deploy/extensions/params.js +0 -39
  139. package/lib/deploy/functions/eventTypes.js +0 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "10.2.0",
3
+ "version": "10.3.0",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -119,7 +119,7 @@
119
119
  "mime": "^2.5.2",
120
120
  "minimatch": "^3.0.4",
121
121
  "morgan": "^1.10.0",
122
- "node-fetch": "^2.6.1",
122
+ "node-fetch": "^2.6.7",
123
123
  "open": "^6.3.0",
124
124
  "ora": "^5.4.1",
125
125
  "portfinder": "^1.0.23",
@@ -172,7 +172,7 @@
172
172
  "@types/mocha": "^9.0.0",
173
173
  "@types/multer": "^1.4.3",
174
174
  "@types/node": "^12.20.39",
175
- "@types/node-fetch": "^2.5.7",
175
+ "@types/node-fetch": "^2.5.12",
176
176
  "@types/progress": "^2.0.3",
177
177
  "@types/puppeteer": "^5.4.2",
178
178
  "@types/request": "^2.48.1",
@@ -174,6 +174,11 @@
174
174
  },
175
175
  "type": "object"
176
176
  },
177
+ "extensions": {
178
+ "properties": {
179
+ },
180
+ "type": "object"
181
+ },
177
182
  "firestore": {
178
183
  "additionalProperties": false,
179
184
  "properties": {
@@ -622,6 +627,9 @@
622
627
  },
623
628
  "glob": {
624
629
  "type": "string"
630
+ },
631
+ "region": {
632
+ "type": "string"
625
633
  }
626
634
  },
627
635
  "required": [
@@ -696,6 +704,9 @@
696
704
  "function": {
697
705
  "type": "string"
698
706
  },
707
+ "region": {
708
+ "type": "string"
709
+ },
699
710
  "source": {
700
711
  "type": "string"
701
712
  }
@@ -774,6 +785,9 @@
774
785
  },
775
786
  "regex": {
776
787
  "type": "string"
788
+ },
789
+ "region": {
790
+ "type": "string"
777
791
  }
778
792
  },
779
793
  "required": [
@@ -1095,6 +1109,9 @@
1095
1109
  },
1096
1110
  "glob": {
1097
1111
  "type": "string"
1112
+ },
1113
+ "region": {
1114
+ "type": "string"
1098
1115
  }
1099
1116
  },
1100
1117
  "required": [
@@ -1169,6 +1186,9 @@
1169
1186
  "function": {
1170
1187
  "type": "string"
1171
1188
  },
1189
+ "region": {
1190
+ "type": "string"
1191
+ },
1172
1192
  "source": {
1173
1193
  "type": "string"
1174
1194
  }
@@ -1247,6 +1267,9 @@
1247
1267
  },
1248
1268
  "regex": {
1249
1269
  "type": "string"
1270
+ },
1271
+ "region": {
1272
+ "type": "string"
1250
1273
  }
1251
1274
  },
1252
1275
  "required": [
@@ -1568,6 +1591,9 @@
1568
1591
  },
1569
1592
  "glob": {
1570
1593
  "type": "string"
1594
+ },
1595
+ "region": {
1596
+ "type": "string"
1571
1597
  }
1572
1598
  },
1573
1599
  "required": [
@@ -1642,6 +1668,9 @@
1642
1668
  "function": {
1643
1669
  "type": "string"
1644
1670
  },
1671
+ "region": {
1672
+ "type": "string"
1673
+ },
1645
1674
  "source": {
1646
1675
  "type": "string"
1647
1676
  }
@@ -1720,6 +1749,9 @@
1720
1749
  },
1721
1750
  "regex": {
1722
1751
  "type": "string"
1752
+ },
1753
+ "region": {
1754
+ "type": "string"
1723
1755
  }
1724
1756
  },
1725
1757
  "required": [
@@ -14,11 +14,11 @@
14
14
  },
15
15
  "main": "index.js",
16
16
  "dependencies": {
17
- "firebase-admin": "^9.8.0",
18
- "firebase-functions": "^3.14.1"
17
+ "firebase-admin": "^10.0.2",
18
+ "firebase-functions": "^3.18.0"
19
19
  },
20
20
  "devDependencies": {
21
- "eslint": "^7.6.0",
21
+ "eslint": "^8.9.0",
22
22
  "eslint-config-google": "^0.14.0",
23
23
  "firebase-functions-test": "^0.2.0"
24
24
  },
@@ -13,8 +13,8 @@
13
13
  },
14
14
  "main": "index.js",
15
15
  "dependencies": {
16
- "firebase-admin": "^9.8.0",
17
- "firebase-functions": "^3.14.1"
16
+ "firebase-admin": "^10.0.2",
17
+ "firebase-functions": "^3.18.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "firebase-functions-test": "^0.2.0"
@@ -14,17 +14,17 @@
14
14
  },
15
15
  "main": "lib/index.js",
16
16
  "dependencies": {
17
- "firebase-admin": "^9.8.0",
18
- "firebase-functions": "^3.14.1"
17
+ "firebase-admin": "^10.0.2",
18
+ "firebase-functions": "^3.18.0"
19
19
  },
20
20
  "devDependencies": {
21
- "@typescript-eslint/eslint-plugin": "^3.9.1",
22
- "@typescript-eslint/parser": "^3.8.0",
23
- "eslint": "^7.6.0",
21
+ "@typescript-eslint/eslint-plugin": "^5.12.0",
22
+ "@typescript-eslint/parser": "^5.12.0",
23
+ "eslint": "^8.9.0",
24
24
  "eslint-config-google": "^0.14.0",
25
- "eslint-plugin-import": "^2.22.0",
25
+ "eslint-plugin-import": "^2.25.4",
26
26
  "firebase-functions-test": "^0.2.0",
27
- "typescript": "^3.8.0"
27
+ "typescript": "^4.5.4"
28
28
  },
29
29
  "private": true
30
30
  }
@@ -13,11 +13,11 @@
13
13
  },
14
14
  "main": "lib/index.js",
15
15
  "dependencies": {
16
- "firebase-admin": "^9.8.0",
17
- "firebase-functions": "^3.14.1"
16
+ "firebase-admin": "^10.0.2",
17
+ "firebase-functions": "^3.18.0"
18
18
  },
19
19
  "devDependencies": {
20
- "typescript": "^3.8.0",
20
+ "typescript": "^4.5.4",
21
21
  "firebase-functions-test": "^0.2.0"
22
22
  },
23
23
  "private": true
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readParams = void 0;
4
- const path = require("path");
5
- const logger_1 = require("../../logger");
6
- const paramHelper_1 = require("../../extensions/paramHelper");
7
- const error_1 = require("../../error");
8
- const ENV_DIRECTORY = "extensions";
9
- function readParams(args) {
10
- const filesToCheck = [
11
- `${args.instanceId}.env`,
12
- ...args.aliases.map((alias) => `${args.instanceId}.env.${alias}`),
13
- `${args.instanceId}.env.${args.projectNumber}`,
14
- `${args.instanceId}.env.${args.projectId}`,
15
- ];
16
- let noFilesFound = true;
17
- const combinedParams = {};
18
- for (const fileToCheck of filesToCheck) {
19
- try {
20
- const params = readParamsFile(args.projectDir, fileToCheck);
21
- logger_1.logger.debug(`Successfully read params from ${fileToCheck}`);
22
- noFilesFound = false;
23
- Object.assign(combinedParams, params);
24
- }
25
- catch (err) {
26
- logger_1.logger.debug(`${err}`);
27
- }
28
- }
29
- if (noFilesFound) {
30
- throw new error_1.FirebaseError(`No params file found for ${args.instanceId}`);
31
- }
32
- return combinedParams;
33
- }
34
- exports.readParams = readParams;
35
- function readParamsFile(projectDir, fileName) {
36
- const paramPath = path.join(projectDir, ENV_DIRECTORY, fileName);
37
- const params = (0, paramHelper_1.readEnvFile)(paramPath);
38
- return params;
39
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PUBSUB_V2_EVENT = exports.STORAGE_V2_EVENTS = void 0;
4
- exports.STORAGE_V2_EVENTS = [
5
- "google.cloud.storage.object.v1.finalized",
6
- "google.cloud.storage.object.v1.archived",
7
- "google.cloud.storage.object.v1.deleted",
8
- "google.cloud.storage.object.v1.metadataUpdated",
9
- ];
10
- exports.PUBSUB_V2_EVENT = "google.cloud.pubsub.topic.v1.messagePublished";