firebase-tools 10.0.1 → 10.1.3
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.
- package/lib/accountExporter.js +9 -8
- package/lib/accountImporter.js +10 -8
- package/lib/api.js +1 -0
- package/lib/apiv2.js +91 -48
- package/lib/appdistribution/client.js +1 -1
- package/lib/appdistribution/options-parser-util.js +1 -1
- package/lib/archiveDirectory.js +63 -73
- package/lib/auth.js +2 -2
- package/lib/bin/firebase.js +1 -1
- package/lib/command.js +26 -26
- package/lib/commands/appdistribution-distribute.js +4 -4
- package/lib/commands/appdistribution-testers-add.js +2 -2
- package/lib/commands/appdistribution-testers-remove.js +2 -2
- package/lib/commands/apps-android-sha-create.js +2 -2
- package/lib/commands/apps-android-sha-delete.js +2 -2
- package/lib/commands/apps-android-sha-list.js +2 -2
- package/lib/commands/apps-create.js +9 -9
- package/lib/commands/apps-list.js +3 -3
- package/lib/commands/apps-sdkconfig.js +8 -8
- package/lib/commands/auth-export.js +26 -25
- package/lib/commands/auth-import.js +88 -78
- package/lib/commands/database-get.js +1 -1
- package/lib/commands/database-instances-create.js +4 -4
- package/lib/commands/database-instances-list.js +4 -4
- package/lib/commands/database-profile.js +1 -1
- package/lib/commands/database-push.js +1 -1
- package/lib/commands/database-remove.js +2 -2
- package/lib/commands/database-set.js +2 -2
- package/lib/commands/database-settings-get.js +1 -1
- package/lib/commands/database-settings-set.js +1 -1
- package/lib/commands/database-update.js +2 -2
- package/lib/commands/ext-configure.js +3 -3
- package/lib/commands/ext-dev-deprecate.js +4 -4
- package/lib/commands/ext-dev-extension-delete.js +3 -3
- package/lib/commands/ext-dev-init.js +4 -4
- package/lib/commands/ext-dev-list.js +1 -1
- package/lib/commands/ext-dev-publish.js +4 -4
- package/lib/commands/ext-dev-register.js +6 -6
- package/lib/commands/ext-dev-undeprecate.js +4 -4
- package/lib/commands/ext-dev-unpublish.js +3 -3
- package/lib/commands/ext-dev-usage.js +140 -0
- package/lib/commands/ext-export.js +8 -8
- package/lib/commands/ext-info.js +5 -5
- package/lib/commands/ext-install.js +27 -23
- package/lib/commands/ext-list.js +2 -2
- package/lib/commands/ext-sources-create.js +2 -2
- package/lib/commands/ext-uninstall.js +4 -4
- package/lib/commands/ext-update.js +18 -18
- package/lib/commands/ext.js +3 -3
- package/lib/commands/firestore-delete.js +1 -1
- package/lib/commands/functions-config-clone.js +22 -23
- package/lib/commands/functions-config-export.js +11 -11
- package/lib/commands/functions-config-get.js +22 -22
- package/lib/commands/functions-config-set.js +24 -22
- package/lib/commands/functions-config-unset.js +20 -22
- package/lib/commands/functions-delete.js +3 -3
- package/lib/commands/functions-deletegcfartifacts.js +4 -4
- package/lib/commands/functions-list.js +1 -1
- package/lib/commands/functions-log.js +1 -1
- package/lib/commands/help.js +12 -12
- package/lib/commands/hosting-channel-create.js +13 -13
- package/lib/commands/hosting-channel-delete.js +10 -10
- package/lib/commands/hosting-channel-deploy.js +18 -18
- package/lib/commands/hosting-channel-list.js +5 -5
- package/lib/commands/hosting-channel-open.js +9 -9
- package/lib/commands/hosting-clone.js +16 -16
- package/lib/commands/hosting-disable.js +1 -1
- package/lib/commands/hosting-sites-create.js +7 -7
- package/lib/commands/hosting-sites-delete.js +7 -7
- package/lib/commands/hosting-sites-get.js +2 -2
- package/lib/commands/hosting-sites-list.js +3 -3
- package/lib/commands/index.js +1 -0
- package/lib/commands/login-ci.js +10 -10
- package/lib/commands/login.js +2 -2
- package/lib/commands/logout.js +1 -1
- package/lib/commands/open.js +1 -1
- package/lib/commands/projects-addfirebase.js +2 -2
- package/lib/commands/projects-create.js +2 -2
- package/lib/commands/projects-list.js +1 -1
- package/lib/commands/remoteconfig-get.js +3 -3
- package/lib/commands/remoteconfig-rollback.js +3 -3
- package/lib/commands/remoteconfig-versions-list.js +7 -2
- package/lib/commands/setup-emulators-database.js +8 -7
- package/lib/commands/setup-emulators-firestore.js +8 -7
- package/lib/commands/setup-emulators-pubsub.js +5 -4
- package/lib/commands/setup-emulators-storage.js +4 -3
- package/lib/commands/setup-emulators-ui.js +8 -7
- package/lib/commands/target-apply.js +17 -16
- package/lib/commands/target-clear.js +11 -10
- package/lib/commands/target-remove.js +10 -9
- package/lib/commands/target.js +20 -20
- package/lib/config.js +6 -6
- package/lib/database/api.js +2 -2
- package/lib/database/metadata.js +16 -24
- package/lib/defaultCredentials.js +3 -3
- package/lib/deploy/extensions/deploy.js +4 -4
- package/lib/deploy/extensions/deploymentSummary.js +5 -4
- package/lib/deploy/extensions/index.js +1 -0
- package/lib/deploy/extensions/params.js +1 -1
- package/lib/deploy/extensions/planner.js +3 -3
- package/lib/deploy/extensions/prepare.js +9 -9
- package/lib/deploy/extensions/release.js +1 -1
- package/lib/deploy/extensions/secrets.js +7 -7
- package/lib/deploy/extensions/validate.js +2 -2
- package/lib/deploy/functions/backend.js +9 -5
- package/lib/deploy/functions/checkIam.js +7 -7
- package/lib/deploy/functions/containerCleaner.js +3 -3
- package/lib/deploy/functions/deploy.js +4 -4
- package/lib/deploy/functions/ensureCloudBuildEnabled.js +3 -3
- package/lib/deploy/functions/index.js +1 -0
- package/lib/deploy/functions/prepare.js +29 -23
- package/lib/deploy/functions/prompts.js +5 -5
- package/lib/deploy/functions/release/executor.js +4 -1
- package/lib/deploy/functions/release/fabricator.js +9 -6
- package/lib/deploy/functions/release/index.js +2 -2
- package/lib/deploy/functions/release/planner.js +6 -6
- package/lib/deploy/functions/release/reporter.js +8 -4
- package/lib/deploy/functions/runtimes/discovery/index.js +2 -2
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +14 -14
- package/lib/deploy/functions/runtimes/golang/index.js +11 -14
- package/lib/deploy/functions/runtimes/index.js +6 -10
- package/lib/deploy/functions/runtimes/node/index.js +6 -10
- package/lib/deploy/functions/runtimes/node/parseTriggers.js +3 -3
- package/lib/deploy/functions/runtimes/node/validate.js +2 -1
- package/lib/deploy/functions/services/storage.js +1 -1
- package/lib/deploy/functions/triggerRegionHelper.js +1 -1
- package/lib/deploy/functions/validate.js +32 -4
- package/lib/deploy/hosting/convertConfig.js +45 -24
- package/lib/deploy/hosting/deploy.js +7 -7
- package/lib/deploy/hosting/prepare.js +1 -1
- package/lib/deploy/hosting/uploader.js +1 -1
- package/lib/deploy/hosting/validate.js +3 -3
- package/lib/deploy/remoteconfig/prepare.js +3 -3
- package/lib/deploy/remoteconfig/release.js +3 -3
- package/lib/deploy/storage/deploy.js +1 -1
- package/lib/deploy/storage/release.js +2 -2
- package/lib/detectProjectRoot.js +5 -5
- package/lib/emulator/auth/apiSpec.js +13 -7
- package/lib/emulator/auth/handlers.js +3 -3
- package/lib/emulator/auth/index.js +1 -1
- package/lib/emulator/auth/operations.js +256 -248
- package/lib/emulator/auth/server.js +11 -8
- package/lib/emulator/auth/state.js +12 -12
- package/lib/emulator/commandUtils.js +5 -5
- package/lib/emulator/controller.js +16 -11
- package/lib/emulator/downloadableEmulators.js +5 -4
- package/lib/emulator/emulatorLogger.js +1 -1
- package/lib/emulator/functionsEmulator.js +110 -75
- package/lib/emulator/functionsEmulatorRuntime.js +36 -21
- package/lib/emulator/functionsEmulatorShell.js +3 -2
- package/lib/emulator/functionsRuntimeWorker.js +1 -1
- package/lib/emulator/hubExport.js +2 -2
- package/lib/emulator/storage/apis/firebase.js +2 -2
- package/lib/emulator/storage/apis/gcloud.js +2 -2
- package/lib/emulator/storage/cloudFunctions.js +1 -1
- package/lib/emulator/storage/files.js +14 -14
- package/lib/emulator/storage/index.js +2 -2
- package/lib/emulator/storage/metadata.js +7 -6
- package/lib/emulator/storage/rules/runtime.js +10 -9
- package/lib/emulator/storage/server.js +2 -2
- package/lib/ensureApiEnabled.js +7 -7
- package/lib/error.js +3 -3
- package/lib/extensions/askUserForConsent.js +3 -4
- package/lib/extensions/askUserForParam.js +11 -11
- package/lib/extensions/billingMigrationHelper.js +2 -2
- package/lib/extensions/changelog.js +4 -4
- package/lib/extensions/displayExtensionInfo.js +6 -6
- package/lib/extensions/emulator/optionsHelper.js +1 -1
- package/lib/extensions/emulator/specHelper.js +1 -1
- package/lib/extensions/emulator/triggerHelper.js +1 -1
- package/lib/extensions/export.js +6 -6
- package/lib/extensions/extensionsApi.js +68 -110
- package/lib/extensions/extensionsHelper.js +56 -43
- package/lib/extensions/listExtensions.js +1 -1
- package/lib/extensions/localHelper.js +1 -1
- package/lib/extensions/metricsTypeDef.js +2 -0
- package/lib/extensions/metricsUtils.js +98 -0
- package/lib/extensions/paramHelper.js +6 -6
- package/lib/extensions/provisioningHelper.js +13 -14
- package/lib/extensions/resolveSource.js +6 -6
- package/lib/extensions/secretsUtils.js +3 -3
- package/lib/extensions/updateHelper.js +10 -10
- package/lib/extensions/utils.js +1 -1
- package/lib/extensions/warnings.js +11 -10
- package/lib/fetchWebSetup.js +2 -2
- package/lib/filterTargets.js +2 -2
- package/lib/firestore/indexes.js +2 -2
- package/lib/fsAsync.js +3 -3
- package/lib/fsutils.js +2 -2
- package/lib/functional.js +2 -1
- package/lib/functions/env.js +1 -1
- package/lib/functions/runtimeConfigExport.js +4 -4
- package/lib/functionsConfig.js +7 -8
- package/lib/functionsShellCommandAction.js +4 -3
- package/lib/gcp/cloudbilling.js +8 -19
- package/lib/gcp/cloudfunctions.js +22 -46
- package/lib/gcp/cloudlogging.js +8 -11
- package/lib/gcp/cloudmonitoring.js +77 -0
- package/lib/gcp/cloudscheduler.js +8 -19
- package/lib/gcp/firedata.js +5 -4
- package/lib/gcp/firestore.js +5 -5
- package/lib/gcp/iam.js +19 -34
- package/lib/gcp/resourceManager.js +10 -15
- package/lib/gcp/rules.js +18 -41
- package/lib/gcp/runtimeconfig.js +31 -53
- package/lib/gcp/secretManager.js +24 -45
- package/lib/gcp/storage.js +24 -29
- package/lib/getDefaultDatabaseInstance.js +1 -1
- package/lib/getDefaultHostingSite.js +1 -1
- package/lib/getProjectNumber.js +2 -2
- package/lib/handlePreviewToggles.js +5 -5
- package/lib/hosting/api.js +6 -6
- package/lib/hosting/cloudRunProxy.js +6 -6
- package/lib/hosting/functionsProxy.js +3 -3
- package/lib/hosting/implicitInit.js +2 -2
- package/lib/hosting/normalizedHostingConfigs.js +3 -3
- package/lib/hosting/proxy.js +2 -2
- package/lib/init/features/account.js +7 -7
- package/lib/init/features/database.js +9 -9
- package/lib/init/features/emulators.js +8 -8
- package/lib/init/features/firestore/index.js +3 -3
- package/lib/init/features/firestore/indexes.js +2 -2
- package/lib/init/features/firestore/rules.js +2 -2
- package/lib/init/features/functions/golang.js +4 -4
- package/lib/init/features/functions/index.js +4 -4
- package/lib/init/features/hosting/github.js +31 -31
- package/lib/init/features/project.js +8 -8
- package/lib/init/features/remoteconfig.js +2 -2
- package/lib/init/features/storage.js +2 -2
- package/lib/listFiles.js +1 -1
- package/lib/management/apps.js +3 -3
- package/lib/management/projects.js +6 -6
- package/lib/previews.js +2 -2
- package/lib/profiler.js +1 -1
- package/lib/projectPath.js +1 -1
- package/lib/projectUtils.js +2 -2
- package/lib/prompt.js +0 -1
- package/lib/rc.js +1 -1
- package/lib/remoteconfig/get.js +14 -8
- package/lib/remoteconfig/rollback.js +13 -6
- package/lib/remoteconfig/versionslist.js +13 -7
- package/lib/requireAuth.js +2 -2
- package/lib/requireDatabaseInstance.js +1 -1
- package/lib/requireHostingSite.js +1 -1
- package/lib/requirePermissions.js +4 -4
- package/lib/rulesDeploy.js +2 -2
- package/lib/serve/functions.js +14 -7
- package/lib/serve/hosting.js +7 -7
- package/lib/utils.js +3 -2
- package/npm-shrinkwrap.json +24090 -0
- package/package.json +36 -31
- package/schema/firebase-config.json +387 -12
- package/lib/commands/functions-config-legacy.js +0 -45
- package/lib/prepareFirebaseRules.js +0 -58
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const lodash_1 = require("lodash");
|
|
4
4
|
const rulesDeploy_1 = require("../../rulesDeploy");
|
|
5
5
|
async function default_1(context) {
|
|
6
|
-
const rulesDeploy = lodash_1.get(context, "storage.rulesDeploy");
|
|
6
|
+
const rulesDeploy = (0, lodash_1.get)(context, "storage.rulesDeploy");
|
|
7
7
|
if (!rulesDeploy) {
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const lodash_1 = require("lodash");
|
|
4
4
|
const rulesDeploy_1 = require("../../rulesDeploy");
|
|
5
5
|
async function default_1(context, options) {
|
|
6
|
-
const rules = lodash_1.get(context, "storage.rules", []);
|
|
7
|
-
const rulesDeploy = lodash_1.get(context, "storage.rulesDeploy");
|
|
6
|
+
const rules = (0, lodash_1.get)(context, "storage.rules", []);
|
|
7
|
+
const rulesDeploy = (0, lodash_1.get)(context, "storage.rulesDeploy");
|
|
8
8
|
if (!rules.length || !rulesDeploy) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
package/lib/detectProjectRoot.js
CHANGED
|
@@ -7,14 +7,14 @@ const path_1 = require("path");
|
|
|
7
7
|
function detectProjectRoot(options) {
|
|
8
8
|
let projectRootDir = options.cwd || process.cwd();
|
|
9
9
|
if (options.configPath) {
|
|
10
|
-
const fullPath = path_1.resolve(projectRootDir, options.configPath);
|
|
11
|
-
if (!fsutils_1.fileExistsSync(fullPath)) {
|
|
10
|
+
const fullPath = (0, path_1.resolve)(projectRootDir, options.configPath);
|
|
11
|
+
if (!(0, fsutils_1.fileExistsSync)(fullPath)) {
|
|
12
12
|
throw new error_1.FirebaseError(`Could not load config file ${options.configPath}.`, { exit: 1 });
|
|
13
13
|
}
|
|
14
|
-
return path_1.dirname(fullPath);
|
|
14
|
+
return (0, path_1.dirname)(fullPath);
|
|
15
15
|
}
|
|
16
|
-
while (!fsutils_1.fileExistsSync(path_1.resolve(projectRootDir, "./firebase.json"))) {
|
|
17
|
-
const parentDir = path_1.dirname(projectRootDir);
|
|
16
|
+
while (!(0, fsutils_1.fileExistsSync)((0, path_1.resolve)(projectRootDir, "./firebase.json"))) {
|
|
17
|
+
const parentDir = (0, path_1.dirname)(projectRootDir);
|
|
18
18
|
if (parentDir === projectRootDir) {
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
@@ -4191,7 +4191,7 @@ exports.default = {
|
|
|
4191
4191
|
type: "string",
|
|
4192
4192
|
},
|
|
4193
4193
|
email: {
|
|
4194
|
-
description: "The account's email address to send the OOB code to, and generally the email address of the account that needs to be updated. Required for PASSWORD_RESET, EMAIL_SIGNIN, and VERIFY_EMAIL.",
|
|
4194
|
+
description: "The account's email address to send the OOB code to, and generally the email address of the account that needs to be updated. Required for PASSWORD_RESET, EMAIL_SIGNIN, and VERIFY_EMAIL. Only required for VERIFY_AND_CHANGE_EMAIL requests when return_oob_link is set to true. In this case, it is the original email of the user.",
|
|
4195
4195
|
type: "string",
|
|
4196
4196
|
},
|
|
4197
4197
|
iOSAppStoreId: {
|
|
@@ -4202,10 +4202,16 @@ exports.default = {
|
|
|
4202
4202
|
description: "If an associated iOS app can handle the OOB code, the iOS bundle id of this app. This will allow the correct app to open if it is already installed.",
|
|
4203
4203
|
type: "string",
|
|
4204
4204
|
},
|
|
4205
|
-
idToken: {
|
|
4206
|
-
|
|
4205
|
+
idToken: {
|
|
4206
|
+
description: "An ID token for the account. It is required for VERIFY_AND_CHANGE_EMAIL and VERIFY_EMAIL requests unless return_oob_link is set to true.",
|
|
4207
|
+
type: "string",
|
|
4208
|
+
},
|
|
4209
|
+
newEmail: {
|
|
4210
|
+
description: "The email address the account is being updated to. Required only for VERIFY_AND_CHANGE_EMAIL requests.",
|
|
4211
|
+
type: "string",
|
|
4212
|
+
},
|
|
4207
4213
|
requestType: {
|
|
4208
|
-
description: "Required. The type of out-of-band (OOB) code to send. Depending on this value, other fields in this request will be required and/or have different meanings. There are
|
|
4214
|
+
description: "Required. The type of out-of-band (OOB) code to send. Depending on this value, other fields in this request will be required and/or have different meanings. There are 4 different OOB codes that can be sent: * PASSWORD_RESET * EMAIL_SIGNIN * VERIFY_EMAIL * VERIFY_AND_CHANGE_EMAIL",
|
|
4209
4215
|
enum: [
|
|
4210
4216
|
"OOB_REQ_TYPE_UNSPECIFIED",
|
|
4211
4217
|
"PASSWORD_RESET",
|
|
@@ -5198,7 +5204,7 @@ exports.default = {
|
|
|
5198
5204
|
properties: {
|
|
5199
5205
|
captchaChallenge: { type: "string" },
|
|
5200
5206
|
captchaResponse: {
|
|
5201
|
-
description: "The
|
|
5207
|
+
description: "The reCAPTCHA token provided by the reCAPTCHA client-side integration. reCAPTCHA Enterprise uses it for risk assessment. Required when reCAPTCHA Enterprise is enabled.",
|
|
5202
5208
|
type: "string",
|
|
5203
5209
|
},
|
|
5204
5210
|
delegatedProjectNumber: { format: "int64", type: "string" },
|
|
@@ -5363,7 +5369,7 @@ exports.default = {
|
|
|
5363
5369
|
properties: {
|
|
5364
5370
|
captchaChallenge: { type: "string" },
|
|
5365
5371
|
captchaResponse: {
|
|
5366
|
-
description: "The
|
|
5372
|
+
description: "The reCAPTCHA token provided by the reCAPTCHA client-side integration. reCAPTCHA Enterprise uses it for assessment. Required when reCAPTCHA enterprise is enabled.",
|
|
5367
5373
|
type: "string",
|
|
5368
5374
|
},
|
|
5369
5375
|
disabled: {
|
|
@@ -6720,7 +6726,7 @@ exports.default = {
|
|
|
6720
6726
|
description: "Encapsulates settings provided to GetIamPolicy.",
|
|
6721
6727
|
properties: {
|
|
6722
6728
|
requestedPolicyVersion: {
|
|
6723
|
-
description: "Optional. The policy
|
|
6729
|
+
description: "Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).",
|
|
6724
6730
|
format: "int32",
|
|
6725
6731
|
type: "integer",
|
|
6726
6732
|
},
|
|
@@ -38,7 +38,7 @@ function registerHandlers(app, getProjectStateByApiKey) {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
try {
|
|
41
|
-
const resp = operations_1.setAccountInfoImpl(state, {
|
|
41
|
+
const resp = (0, operations_1.setAccountInfoImpl)(state, {
|
|
42
42
|
oobCode,
|
|
43
43
|
});
|
|
44
44
|
const email = resp.email;
|
|
@@ -91,7 +91,7 @@ function registerHandlers(app, getProjectStateByApiKey) {
|
|
|
91
91
|
},
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
const { email } = operations_1.resetPassword(state, {
|
|
94
|
+
const { email } = (0, operations_1.resetPassword)(state, {
|
|
95
95
|
oobCode,
|
|
96
96
|
newPassword: req.query.newPassword,
|
|
97
97
|
});
|
|
@@ -106,7 +106,7 @@ function registerHandlers(app, getProjectStateByApiKey) {
|
|
|
106
106
|
}
|
|
107
107
|
case "verifyEmail": {
|
|
108
108
|
try {
|
|
109
|
-
const { email } = operations_1.setAccountInfoImpl(state, { oobCode });
|
|
109
|
+
const { email } = (0, operations_1.setAccountInfoImpl)(state, { oobCode });
|
|
110
110
|
if (continueUrl) {
|
|
111
111
|
return res.redirect(303, continueUrl);
|
|
112
112
|
}
|
|
@@ -16,7 +16,7 @@ class AuthEmulator {
|
|
|
16
16
|
}
|
|
17
17
|
async start() {
|
|
18
18
|
const { host, port } = this.getInfo();
|
|
19
|
-
const app = await server_1.createApp(this.args.projectId);
|
|
19
|
+
const app = await (0, server_1.createApp)(this.args.projectId);
|
|
20
20
|
const server = app.listen(port, host);
|
|
21
21
|
this.destroyServer = utils.createDestroyer(server);
|
|
22
22
|
}
|