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 _ = require("lodash");
|
|
4
4
|
const clc = require("cli-color");
|
|
5
5
|
const ora = require("ora");
|
|
6
|
-
const marked = require("marked");
|
|
6
|
+
const { marked } = require("marked");
|
|
7
7
|
const TerminalRenderer = require("marked-terminal");
|
|
8
8
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
9
9
|
const command_1 = require("../command");
|
|
@@ -34,7 +34,7 @@ exports.default = new command_1.Command("ext:uninstall <extensionInstanceId>")
|
|
|
34
34
|
.before(extensionsHelper_1.ensureExtensionsApiEnabled)
|
|
35
35
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extMinVersion")
|
|
36
36
|
.action(async (instanceId, options) => {
|
|
37
|
-
const projectId = projectUtils_1.needProjectId(options);
|
|
37
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
38
38
|
let instance;
|
|
39
39
|
try {
|
|
40
40
|
instance = await extensionsApi.getInstance(projectId, instanceId);
|
|
@@ -72,7 +72,7 @@ exports.default = new command_1.Command("ext:uninstall <extensionInstanceId>")
|
|
|
72
72
|
`${resourcesMessage}` +
|
|
73
73
|
`${artifactsMessage}`;
|
|
74
74
|
logger_1.logger.info(extensionDeletionMessage);
|
|
75
|
-
const confirmedExtensionDeletion = await prompt_1.promptOnce({
|
|
75
|
+
const confirmedExtensionDeletion = await (0, prompt_1.promptOnce)({
|
|
76
76
|
type: "confirm",
|
|
77
77
|
default: true,
|
|
78
78
|
message: "Are you sure that you wish to uninstall this extension?",
|
|
@@ -81,7 +81,7 @@ exports.default = new command_1.Command("ext:uninstall <extensionInstanceId>")
|
|
|
81
81
|
return utils.reject("Command aborted.", { exit: 1 });
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
const spinner = ora
|
|
84
|
+
const spinner = ora(` ${clc.green.bold(extensionsHelper_1.logPrefix)}: uninstalling ${clc.bold(instanceId)}. This usually takes 1 to 2 minutes...`);
|
|
85
85
|
spinner.start();
|
|
86
86
|
try {
|
|
87
87
|
spinner.info();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const clc = require("cli-color");
|
|
4
4
|
const _ = require("lodash");
|
|
5
|
-
const marked = require("marked");
|
|
5
|
+
const { marked } = require("marked");
|
|
6
6
|
const ora = require("ora");
|
|
7
7
|
const TerminalRenderer = require("marked-terminal");
|
|
8
8
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
@@ -47,9 +47,9 @@ exports.default = new command_1.Command("ext:update <extensionInstanceId> [updat
|
|
|
47
47
|
.withForce()
|
|
48
48
|
.option("--params <paramsFile>", "name of params variables file with .env format.")
|
|
49
49
|
.action(async (instanceId, updateSource, options) => {
|
|
50
|
-
const spinner = ora
|
|
50
|
+
const spinner = ora(`Updating ${clc.bold(instanceId)}. This usually takes 3 to 5 minutes...`);
|
|
51
51
|
try {
|
|
52
|
-
const projectId = projectUtils_1.needProjectId(options);
|
|
52
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
53
53
|
let existingInstance;
|
|
54
54
|
try {
|
|
55
55
|
existingInstance = await extensionsApi.getInstance(projectId, instanceId);
|
|
@@ -67,11 +67,11 @@ exports.default = new command_1.Command("ext:update <extensionInstanceId> [updat
|
|
|
67
67
|
const existingParams = existingInstance.config.params;
|
|
68
68
|
const existingSource = existingInstance.config.source.name;
|
|
69
69
|
if (existingInstance.config.extensionRef) {
|
|
70
|
-
updateSource = updateHelper_1.inferUpdateSource(updateSource, existingInstance.config.extensionRef);
|
|
70
|
+
updateSource = (0, updateHelper_1.inferUpdateSource)(updateSource, existingInstance.config.extensionRef);
|
|
71
71
|
}
|
|
72
72
|
let newSourceName;
|
|
73
|
-
const existingSourceOrigin = await updateHelper_1.getExistingSourceOrigin(projectId, instanceId, existingSpec.name, existingSource);
|
|
74
|
-
const newSourceOrigin = extensionsHelper_1.getSourceOrigin(updateSource);
|
|
73
|
+
const existingSourceOrigin = await (0, updateHelper_1.getExistingSourceOrigin)(projectId, instanceId, existingSpec.name, existingSource);
|
|
74
|
+
const newSourceOrigin = (0, extensionsHelper_1.getSourceOrigin)(updateSource);
|
|
75
75
|
const validUpdate = isValidUpdate(existingSourceOrigin, newSourceOrigin);
|
|
76
76
|
if (!validUpdate) {
|
|
77
77
|
throw new error_1.FirebaseError(`Cannot update from a(n) ${existingSourceOrigin} to a(n) ${newSourceOrigin}. Please provide a new source that is a(n) ${existingSourceOrigin} and try again.`);
|
|
@@ -79,24 +79,24 @@ exports.default = new command_1.Command("ext:update <extensionInstanceId> [updat
|
|
|
79
79
|
switch (newSourceOrigin) {
|
|
80
80
|
case extensionsHelper_1.SourceOrigin.LOCAL:
|
|
81
81
|
if (previews_1.previews.extdev) {
|
|
82
|
-
newSourceName = await updateHelper_1.updateFromLocalSource(projectId, instanceId, updateSource, existingSpec);
|
|
82
|
+
newSourceName = await (0, updateHelper_1.updateFromLocalSource)(projectId, instanceId, updateSource, existingSpec);
|
|
83
83
|
break;
|
|
84
84
|
}
|
|
85
85
|
case extensionsHelper_1.SourceOrigin.URL:
|
|
86
86
|
if (previews_1.previews.extdev) {
|
|
87
|
-
newSourceName = await updateHelper_1.updateFromUrlSource(projectId, instanceId, updateSource, existingSpec);
|
|
87
|
+
newSourceName = await (0, updateHelper_1.updateFromUrlSource)(projectId, instanceId, updateSource, existingSpec);
|
|
88
88
|
break;
|
|
89
89
|
}
|
|
90
90
|
case extensionsHelper_1.SourceOrigin.PUBLISHED_EXTENSION_VERSION:
|
|
91
|
-
newSourceName = await updateHelper_1.updateToVersionFromPublisherSource(projectId, instanceId, updateSource, existingSpec);
|
|
91
|
+
newSourceName = await (0, updateHelper_1.updateToVersionFromPublisherSource)(projectId, instanceId, updateSource, existingSpec);
|
|
92
92
|
break;
|
|
93
93
|
case extensionsHelper_1.SourceOrigin.PUBLISHED_EXTENSION:
|
|
94
|
-
newSourceName = await updateHelper_1.updateFromPublisherSource(projectId, instanceId, updateSource, existingSpec);
|
|
94
|
+
newSourceName = await (0, updateHelper_1.updateFromPublisherSource)(projectId, instanceId, updateSource, existingSpec);
|
|
95
95
|
break;
|
|
96
96
|
default:
|
|
97
97
|
throw new error_1.FirebaseError(`Unknown source '${clc.bold(updateSource)}.'`);
|
|
98
98
|
}
|
|
99
|
-
if (!(await extensionsHelper_1.confirm({
|
|
99
|
+
if (!(await (0, extensionsHelper_1.confirm)({
|
|
100
100
|
nonInteractive: options.nonInteractive,
|
|
101
101
|
force: options.force,
|
|
102
102
|
default: true,
|
|
@@ -108,7 +108,7 @@ exports.default = new command_1.Command("ext:update <extensionInstanceId> [updat
|
|
|
108
108
|
if (![extensionsHelper_1.SourceOrigin.LOCAL, extensionsHelper_1.SourceOrigin.URL].includes(newSourceOrigin) &&
|
|
109
109
|
existingSpec.version === newSpec.version) {
|
|
110
110
|
utils.logLabeledBullet(extensionsHelper_1.logPrefix, `${clc.bold(instanceId)} is already up to date. Its version is ${clc.bold(existingSpec.version)}.`);
|
|
111
|
-
const retry = await extensionsHelper_1.confirm({
|
|
111
|
+
const retry = await (0, extensionsHelper_1.confirm)({
|
|
112
112
|
nonInteractive: options.nonInteractive,
|
|
113
113
|
force: options.force,
|
|
114
114
|
default: false,
|
|
@@ -118,7 +118,7 @@ exports.default = new command_1.Command("ext:update <extensionInstanceId> [updat
|
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
await updateHelper_1.displayChanges({
|
|
121
|
+
await (0, updateHelper_1.displayChanges)({
|
|
122
122
|
spec: existingSpec,
|
|
123
123
|
newSpec: newSpec,
|
|
124
124
|
nonInteractive: options.nonInteractive,
|
|
@@ -127,9 +127,9 @@ exports.default = new command_1.Command("ext:update <extensionInstanceId> [updat
|
|
|
127
127
|
await provisioningHelper.checkProductsProvisioned(projectId, newSpec);
|
|
128
128
|
const usesSecrets = secretsUtils.usesSecrets(newSpec);
|
|
129
129
|
if (newSpec.billingRequired || usesSecrets) {
|
|
130
|
-
const enabled = await cloudbilling_1.checkBillingEnabled(projectId);
|
|
131
|
-
billingMigrationHelper_1.displayNode10UpdateBillingNotice(existingSpec, newSpec);
|
|
132
|
-
if (!(await extensionsHelper_1.confirm({
|
|
130
|
+
const enabled = await (0, cloudbilling_1.checkBillingEnabled)(projectId);
|
|
131
|
+
(0, billingMigrationHelper_1.displayNode10UpdateBillingNotice)(existingSpec, newSpec);
|
|
132
|
+
if (!(await (0, extensionsHelper_1.confirm)({
|
|
133
133
|
nonInteractive: options.nonInteractive,
|
|
134
134
|
force: options.force,
|
|
135
135
|
default: true,
|
|
@@ -138,7 +138,7 @@ exports.default = new command_1.Command("ext:update <extensionInstanceId> [updat
|
|
|
138
138
|
}
|
|
139
139
|
if (!enabled) {
|
|
140
140
|
if (!options.nonInteractive) {
|
|
141
|
-
await checkProjectBilling_1.enableBilling(projectId);
|
|
141
|
+
await (0, checkProjectBilling_1.enableBilling)(projectId);
|
|
142
142
|
}
|
|
143
143
|
else {
|
|
144
144
|
throw new error_1.FirebaseError("The extension requires your project to be upgraded to the Blaze plan. " +
|
|
@@ -174,7 +174,7 @@ exports.default = new command_1.Command("ext:update <extensionInstanceId> [updat
|
|
|
174
174
|
if (!_.isEqual(newParams, oldParamValues)) {
|
|
175
175
|
updateOptions.params = newParams;
|
|
176
176
|
}
|
|
177
|
-
await updateHelper_1.update(updateOptions);
|
|
177
|
+
await (0, updateHelper_1.update)(updateOptions);
|
|
178
178
|
spinner.stop();
|
|
179
179
|
utils.logLabeledSuccess(extensionsHelper_1.logPrefix, `successfully updated ${clc.bold(instanceId)}.`);
|
|
180
180
|
utils.logLabeledBullet(extensionsHelper_1.logPrefix, marked(`You can view your updated instance in the Firebase console: ${utils.consoleUrl(projectId, `/extensions/instances/${instanceId}?tab=usage`)}`));
|
package/lib/commands/ext.js
CHANGED
|
@@ -31,9 +31,9 @@ module.exports = new command_1.Command("ext")
|
|
|
31
31
|
});
|
|
32
32
|
logger_1.logger.info();
|
|
33
33
|
try {
|
|
34
|
-
await requirePermissions_1.requirePermissions(options, ["firebaseextensions.instances.list"]);
|
|
35
|
-
const projectId = projectUtils_1.needProjectId(options);
|
|
36
|
-
return listExtensions_1.listExtensions(projectId);
|
|
34
|
+
await (0, requirePermissions_1.requirePermissions)(options, ["firebaseextensions.instances.list"]);
|
|
35
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
36
|
+
return (0, listExtensions_1.listExtensions)(projectId);
|
|
37
37
|
}
|
|
38
38
|
catch (err) {
|
|
39
39
|
return;
|
|
@@ -66,7 +66,7 @@ module.exports = new command_1.Command("firestore:delete [path]")
|
|
|
66
66
|
shallow: options.shallow,
|
|
67
67
|
allCollections: options.allCollections,
|
|
68
68
|
});
|
|
69
|
-
const confirm = await prompt_1.promptOnce({
|
|
69
|
+
const confirm = await (0, prompt_1.promptOnce)({
|
|
70
70
|
type: "confirm",
|
|
71
71
|
name: "force",
|
|
72
72
|
default: false,
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const clc = require("cli-color");
|
|
4
|
+
const command_1 = require("../command");
|
|
5
|
+
const error_1 = require("../error");
|
|
6
|
+
const logger_1 = require("../logger");
|
|
7
|
+
const projectUtils_1 = require("../projectUtils");
|
|
8
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
9
|
+
const functionsConfig = require("../functionsConfig");
|
|
10
|
+
const functionsConfigClone = require("../functionsConfigClone");
|
|
11
|
+
const utils = require("../utils");
|
|
12
|
+
exports.default = new command_1.Command("functions:config:clone")
|
|
11
13
|
.description("clone environment config from another project")
|
|
12
14
|
.option("--from <projectId>", "the project from which to clone configuration")
|
|
13
15
|
.option("--only <keys>", "a comma-separated list of keys to clone")
|
|
14
16
|
.option("--except <keys>", "a comma-separated list of keys to not clone")
|
|
15
|
-
.before(requirePermissions, [
|
|
17
|
+
.before(requirePermissions_1.requirePermissions, [
|
|
16
18
|
"runtimeconfig.configs.list",
|
|
17
19
|
"runtimeconfig.configs.create",
|
|
18
20
|
"runtimeconfig.configs.get",
|
|
@@ -25,29 +27,26 @@ module.exports = new Command("functions:config:clone")
|
|
|
25
27
|
"runtimeconfig.variables.delete",
|
|
26
28
|
])
|
|
27
29
|
.before(functionsConfig.ensureApi)
|
|
28
|
-
.action(
|
|
29
|
-
|
|
30
|
+
.action(async (options) => {
|
|
31
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
30
32
|
if (!options.from) {
|
|
31
|
-
|
|
33
|
+
throw new error_1.FirebaseError(`Must specify a source project in ${clc.bold("--from <projectId>")} option.`);
|
|
32
34
|
}
|
|
33
35
|
else if (options.from === projectId) {
|
|
34
|
-
|
|
36
|
+
throw new error_1.FirebaseError("From project and destination can't be the same project.");
|
|
35
37
|
}
|
|
36
38
|
else if (options.only && options.except) {
|
|
37
|
-
|
|
39
|
+
throw new error_1.FirebaseError("Cannot use both --only and --except at the same time.");
|
|
38
40
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
let only = [];
|
|
42
|
+
let except = [];
|
|
41
43
|
if (options.only) {
|
|
42
44
|
only = options.only.split(",");
|
|
43
45
|
}
|
|
44
46
|
else if (options.except) {
|
|
45
47
|
except = options.except.split(",");
|
|
46
48
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
clc.bold("firebase deploy --only functions") +
|
|
51
|
-
"\n");
|
|
52
|
-
});
|
|
49
|
+
await functionsConfigClone(options.from, projectId, only, except);
|
|
50
|
+
utils.logSuccess(`Cloned functions config from ${clc.bold(options.from)} into ${clc.bold(projectId)}`);
|
|
51
|
+
logger_1.logger.info(`\nPlease deploy your functions for the change to take effect by running ${clc.bold("firebase deploy --only functions")}\n`);
|
|
53
52
|
});
|
|
@@ -24,7 +24,7 @@ const MAX_ATTEMPTS = 3;
|
|
|
24
24
|
function checkReservedAliases(pInfos) {
|
|
25
25
|
for (const pInfo of pInfos) {
|
|
26
26
|
if (pInfo.alias && RESERVED_PROJECT_ALIAS.includes(pInfo.alias)) {
|
|
27
|
-
utils_1.logWarning(`Project alias (${clc.bold(pInfo.alias)}) is reserved for internal use. ` +
|
|
27
|
+
(0, utils_1.logWarning)(`Project alias (${clc.bold(pInfo.alias)}) is reserved for internal use. ` +
|
|
28
28
|
`Saving exported config in .env.${pInfo.projectId} instead.`);
|
|
29
29
|
delete pInfo.alias;
|
|
30
30
|
}
|
|
@@ -32,15 +32,15 @@ function checkReservedAliases(pInfos) {
|
|
|
32
32
|
}
|
|
33
33
|
async function checkRequiredPermission(pInfos) {
|
|
34
34
|
pInfos = pInfos.filter((pInfo) => !pInfo.config);
|
|
35
|
-
const testPermissions = pInfos.map((pInfo) => iam_1.testIamPermissions(pInfo.projectId, REQUIRED_PERMISSIONS));
|
|
35
|
+
const testPermissions = pInfos.map((pInfo) => (0, iam_1.testIamPermissions)(pInfo.projectId, REQUIRED_PERMISSIONS));
|
|
36
36
|
const results = await Promise.all(testPermissions);
|
|
37
|
-
for (const [pInfo, result] of functional_1.zip(pInfos, results)) {
|
|
37
|
+
for (const [pInfo, result] of (0, functional_1.zip)(pInfos, results)) {
|
|
38
38
|
if (result.passed) {
|
|
39
39
|
throw new error_1.FirebaseError(`Unexpectedly failed to fetch runtime config for project ${pInfo.projectId}`);
|
|
40
40
|
}
|
|
41
|
-
utils_1.logWarning("You are missing the following permissions to read functions config on project " +
|
|
41
|
+
(0, utils_1.logWarning)("You are missing the following permissions to read functions config on project " +
|
|
42
42
|
`${clc.bold(pInfo.projectId)}:\n\t${result.missing.join("\n\t")}`);
|
|
43
|
-
const confirm = await prompt_1.promptOnce({
|
|
43
|
+
const confirm = await (0, prompt_1.promptOnce)({
|
|
44
44
|
type: "confirm",
|
|
45
45
|
name: "skip",
|
|
46
46
|
default: true,
|
|
@@ -52,9 +52,9 @@ async function checkRequiredPermission(pInfos) {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
async function promptForPrefix(errMsg) {
|
|
55
|
-
utils_1.logWarning("The following configs keys could not be exported as environment variables:\n");
|
|
56
|
-
utils_1.logWarning(errMsg);
|
|
57
|
-
return await prompt_1.promptOnce({
|
|
55
|
+
(0, utils_1.logWarning)("The following configs keys could not be exported as environment variables:\n");
|
|
56
|
+
(0, utils_1.logWarning)(errMsg);
|
|
57
|
+
return await (0, prompt_1.promptOnce)({
|
|
58
58
|
type: "input",
|
|
59
59
|
name: "prefix",
|
|
60
60
|
default: "CONFIG_",
|
|
@@ -81,14 +81,14 @@ exports.default = new command_1.Command("functions:config:export")
|
|
|
81
81
|
.action(async (options) => {
|
|
82
82
|
let pInfos = configExport.getProjectInfos(options);
|
|
83
83
|
checkReservedAliases(pInfos);
|
|
84
|
-
utils_1.logBullet("Importing functions configs from projects [" +
|
|
84
|
+
(0, utils_1.logBullet)("Importing functions configs from projects [" +
|
|
85
85
|
pInfos.map(({ projectId }) => `${clc.bold(projectId)}`).join(", ") +
|
|
86
86
|
"]");
|
|
87
87
|
await configExport.hydrateConfigs(pInfos);
|
|
88
88
|
await checkRequiredPermission(pInfos);
|
|
89
89
|
pInfos = pInfos.filter((pInfo) => pInfo.config);
|
|
90
90
|
logger_1.logger.debug(`Loaded function configs: ${JSON.stringify(pInfos)}`);
|
|
91
|
-
utils_1.logBullet(`Importing configs from projects: [${pInfos.map((p) => p.projectId).join(", ")}]`);
|
|
91
|
+
(0, utils_1.logBullet)(`Importing configs from projects: [${pInfos.map((p) => p.projectId).join(", ")}]`);
|
|
92
92
|
let attempts = 0;
|
|
93
93
|
let prefix = "";
|
|
94
94
|
while (true) {
|
|
@@ -105,7 +105,7 @@ exports.default = new command_1.Command("functions:config:export")
|
|
|
105
105
|
const header = `# Exported firebase functions:config:export command on ${new Date().toLocaleDateString()}`;
|
|
106
106
|
const dotEnvs = pInfos.map((pInfo) => configExport.toDotenvFormat(pInfo.envs, header));
|
|
107
107
|
const filenames = pInfos.map(configExport.generateDotenvFilename);
|
|
108
|
-
const filesToWrite = fromEntries(functional_1.zip(filenames, dotEnvs));
|
|
108
|
+
const filesToWrite = fromEntries((0, functional_1.zip)(filenames, dotEnvs));
|
|
109
109
|
filesToWrite[".env.local"] = `${header}\n# .env.local file contains environment variables for the Functions Emulator.\n`;
|
|
110
110
|
filesToWrite[".env"] = `${header}# .env file contains environment variables that applies to all projects.\n`;
|
|
111
111
|
const functionsDir = options.config.get("functions.source", ".");
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lodash_1 = require("lodash");
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const command_1 = require("../command");
|
|
6
|
+
const logger_1 = require("../logger");
|
|
7
|
+
const projectUtils_1 = require("../projectUtils");
|
|
8
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
9
|
+
const functionsConfig = require("../functionsConfig");
|
|
10
|
+
async function materialize(projectId, path) {
|
|
11
|
+
if (path === undefined) {
|
|
10
12
|
return functionsConfig.materializeAll(projectId);
|
|
11
13
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
14
|
+
const parts = path.split(".");
|
|
15
|
+
const configId = parts[0];
|
|
16
|
+
const configName = (0, path_1.join)("projects", projectId, "configs", configId);
|
|
17
|
+
const result = await functionsConfig.materializeConfig(configName, {});
|
|
18
|
+
const query = parts.join(".");
|
|
19
|
+
return query ? (0, lodash_1.get)(result, query) : result;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
exports.default = new command_1.Command("functions:config:get [path]")
|
|
21
22
|
.description("fetch environment config stored at the given path")
|
|
22
|
-
.before(requirePermissions, [
|
|
23
|
+
.before(requirePermissions_1.requirePermissions, [
|
|
23
24
|
"runtimeconfig.configs.list",
|
|
24
25
|
"runtimeconfig.configs.get",
|
|
25
26
|
"runtimeconfig.variables.list",
|
|
26
27
|
"runtimeconfig.variables.get",
|
|
27
28
|
])
|
|
28
29
|
.before(functionsConfig.ensureApi)
|
|
29
|
-
.action(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
30
|
+
.action(async (path, options) => {
|
|
31
|
+
const result = await materialize((0, projectUtils_1.needProjectId)(options), path);
|
|
32
|
+
logger_1.logger.info(JSON.stringify(result, null, 2));
|
|
33
|
+
return result;
|
|
34
34
|
});
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const clc = require("cli-color");
|
|
4
|
+
const command_1 = require("../command");
|
|
5
|
+
const error_1 = require("../error");
|
|
6
|
+
const logger_1 = require("../logger");
|
|
7
|
+
const projectUtils_1 = require("../projectUtils");
|
|
8
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
9
|
+
const functionsConfig = require("../functionsConfig");
|
|
10
|
+
const utils = require("../utils");
|
|
11
|
+
exports.default = new command_1.Command("functions:config:set [values...]")
|
|
10
12
|
.description("set environment config with key=value syntax")
|
|
11
|
-
.before(requirePermissions, [
|
|
13
|
+
.before(requirePermissions_1.requirePermissions, [
|
|
12
14
|
"runtimeconfig.configs.list",
|
|
13
15
|
"runtimeconfig.configs.create",
|
|
14
16
|
"runtimeconfig.configs.get",
|
|
@@ -21,20 +23,20 @@ module.exports = new Command("functions:config:set [values...]")
|
|
|
21
23
|
"runtimeconfig.variables.delete",
|
|
22
24
|
])
|
|
23
25
|
.before(functionsConfig.ensureApi)
|
|
24
|
-
.action(
|
|
26
|
+
.action(async (args, options) => {
|
|
25
27
|
if (!args.length) {
|
|
26
|
-
|
|
28
|
+
throw new error_1.FirebaseError(`Must supply at least one key/value pair, e.g. ${clc.bold('app.name="My App"')}`);
|
|
27
29
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
31
|
+
const parsed = functionsConfig.parseSetArgs(args);
|
|
32
|
+
const promises = [];
|
|
33
|
+
for (const item of parsed) {
|
|
34
|
+
if (item.val === undefined) {
|
|
35
|
+
throw new error_1.FirebaseError(`Unexpected undefined value for varId "${item.varId}`, { exit: 2 });
|
|
36
|
+
}
|
|
32
37
|
promises.push(functionsConfig.setVariablesRecursive(projectId, item.configId, item.varId, item.val));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
clc.bold("firebase deploy --only functions") +
|
|
38
|
-
"\n");
|
|
39
|
-
});
|
|
38
|
+
}
|
|
39
|
+
await Promise.all(promises);
|
|
40
|
+
utils.logSuccess("Functions config updated.");
|
|
41
|
+
logger_1.logger.info(`\nPlease deploy your functions for the change to take effect by running ${clc.bold("firebase deploy --only functions")}\n`);
|
|
40
42
|
});
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const clc = require("cli-color");
|
|
4
|
+
const command_1 = require("../command");
|
|
5
|
+
const logger_1 = require("../logger");
|
|
6
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
7
|
+
const projectUtils_1 = require("../projectUtils");
|
|
8
|
+
const functionsConfig = require("../functionsConfig");
|
|
9
|
+
const runtimeconfig = require("../gcp/runtimeconfig");
|
|
10
|
+
const utils = require("../utils");
|
|
11
|
+
const error_1 = require("../error");
|
|
12
|
+
exports.default = new command_1.Command("functions:config:unset [keys...]")
|
|
12
13
|
.description("unset environment config at the specified path(s)")
|
|
13
|
-
.before(requirePermissions, [
|
|
14
|
+
.before(requirePermissions_1.requirePermissions, [
|
|
14
15
|
"runtimeconfig.configs.list",
|
|
15
16
|
"runtimeconfig.configs.create",
|
|
16
17
|
"runtimeconfig.configs.get",
|
|
@@ -23,21 +24,18 @@ module.exports = new Command("functions:config:unset [keys...]")
|
|
|
23
24
|
"runtimeconfig.variables.delete",
|
|
24
25
|
])
|
|
25
26
|
.before(functionsConfig.ensureApi)
|
|
26
|
-
.action(
|
|
27
|
+
.action(async (args, options) => {
|
|
27
28
|
if (!args.length) {
|
|
28
|
-
|
|
29
|
+
throw new error_1.FirebaseError("Must supply at least one key");
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
32
|
+
const parsed = functionsConfig.parseUnsetArgs(args);
|
|
33
|
+
await Promise.all(parsed.map((item) => {
|
|
33
34
|
if (item.varId === "") {
|
|
34
35
|
return runtimeconfig.configs.delete(projectId, item.configId);
|
|
35
36
|
}
|
|
36
37
|
return runtimeconfig.variables.delete(projectId, item.configId, item.varId);
|
|
37
|
-
}))
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
clc.bold("firebase deploy --only functions") +
|
|
41
|
-
"\n");
|
|
42
|
-
});
|
|
38
|
+
}));
|
|
39
|
+
utils.logSuccess("Environment updated.");
|
|
40
|
+
logger_1.logger.info(`\nPlease deploy your functions for the change to take effect by running ${clc.bold("firebase deploy --only functions")}\n`);
|
|
43
41
|
});
|
|
@@ -28,7 +28,7 @@ exports.default = new command_1.Command("functions:delete [filters...]")
|
|
|
28
28
|
return utils.reject("Must supply at least function or group name.");
|
|
29
29
|
}
|
|
30
30
|
const context = {
|
|
31
|
-
projectId: projectUtils_1.needProjectId(options),
|
|
31
|
+
projectId: (0, projectUtils_1.needProjectId)(options),
|
|
32
32
|
filters: filters.map((f) => f.split(".")),
|
|
33
33
|
};
|
|
34
34
|
const [config, existingBackend] = await Promise.all([
|
|
@@ -52,7 +52,7 @@ exports.default = new command_1.Command("functions:delete [filters...]")
|
|
|
52
52
|
throw new error_1.FirebaseError(`The specified filters do not match any existing functions in project ${clc.bold(context.projectId)}.`);
|
|
53
53
|
}
|
|
54
54
|
const deleteList = allEpToDelete.map((func) => `\t${helper.getFunctionLabel(func)}`).join("\n");
|
|
55
|
-
const confirmDeletion = await prompt_1.promptOnce({
|
|
55
|
+
const confirmDeletion = await (0, prompt_1.promptOnce)({
|
|
56
56
|
type: "confirm",
|
|
57
57
|
name: "force",
|
|
58
58
|
default: false,
|
|
@@ -86,7 +86,7 @@ exports.default = new command_1.Command("functions:delete [filters...]")
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
const opts = {};
|
|
89
|
-
const arEnabled = await ensure.check(projectUtils_1.needProjectId(options), "artifactregistry.googleapis.com", "functions", true);
|
|
89
|
+
const arEnabled = await ensure.check((0, projectUtils_1.needProjectId)(options), "artifactregistry.googleapis.com", "functions", true);
|
|
90
90
|
if (!arEnabled) {
|
|
91
91
|
opts.ar = new containerCleaner.NoopArtifactRegistryCleaner();
|
|
92
92
|
}
|
|
@@ -21,12 +21,12 @@ exports.default = new command_1.Command("functions:deletegcfartifacts")
|
|
|
21
21
|
"<regions> is a Google defined region list, e.g. us-central1,us-east1,europe-west2.")
|
|
22
22
|
.before(requirePermissions_1.requirePermissions, ["storage.objects.delete"])
|
|
23
23
|
.action(async (options) => {
|
|
24
|
-
const projectId = projectUtils_1.needProjectId(options);
|
|
24
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
25
25
|
const regions = options.regions ? options.regions.split(",") : undefined;
|
|
26
26
|
const dockerHelper = {};
|
|
27
27
|
try {
|
|
28
|
-
const gcfPaths = await containerCleaner_1.listGcfPaths(projectId, regions, dockerHelper);
|
|
29
|
-
const confirmDeletion = await prompt_1.promptOnce({
|
|
28
|
+
const gcfPaths = await (0, containerCleaner_1.listGcfPaths)(projectId, regions, dockerHelper);
|
|
29
|
+
const confirmDeletion = await (0, prompt_1.promptOnce)({
|
|
30
30
|
type: "confirm",
|
|
31
31
|
name: "force",
|
|
32
32
|
default: false,
|
|
@@ -35,7 +35,7 @@ exports.default = new command_1.Command("functions:deletegcfartifacts")
|
|
|
35
35
|
if (!confirmDeletion) {
|
|
36
36
|
throw new error_1.FirebaseError("Command aborted.", { exit: 1 });
|
|
37
37
|
}
|
|
38
|
-
await containerCleaner_1.deleteGcfArtifacts(projectId, regions, dockerHelper);
|
|
38
|
+
await (0, containerCleaner_1.deleteGcfArtifacts)(projectId, regions, dockerHelper);
|
|
39
39
|
}
|
|
40
40
|
catch (err) {
|
|
41
41
|
throw new error_1.FirebaseError("Command failed.", { original: err });
|
|
@@ -14,7 +14,7 @@ exports.default = new command_1.Command("functions:list")
|
|
|
14
14
|
.action(async (options) => {
|
|
15
15
|
try {
|
|
16
16
|
const context = {
|
|
17
|
-
projectId: projectUtils_1.needProjectId(options),
|
|
17
|
+
projectId: (0, projectUtils_1.needProjectId)(options),
|
|
18
18
|
};
|
|
19
19
|
const existing = await backend.existingBackend(context);
|
|
20
20
|
const endpointsList = backend.allEndpoints(existing).sort(backend.compareFunctions);
|
|
@@ -16,7 +16,7 @@ module.exports = new command_1.Command("functions:log")
|
|
|
16
16
|
.before(requirePermissions_1.requirePermissions, ["logging.logEntries.list", "logging.logs.list"])
|
|
17
17
|
.action(async (options) => {
|
|
18
18
|
try {
|
|
19
|
-
const projectId = projectUtils_1.needProjectId(options);
|
|
19
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
20
20
|
const apiFilter = functionsLog.getApiFilter(options.only);
|
|
21
21
|
if (options.open) {
|
|
22
22
|
const url = `https://console.developers.google.com/logs/viewer?advancedFilter=${qs.escape(apiFilter)}&project=${projectId}`;
|
package/lib/commands/help.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const clc = require("cli-color");
|
|
4
|
+
const command_1 = require("../command");
|
|
5
|
+
const logger_1 = require("../logger");
|
|
6
|
+
const utils = require("../utils");
|
|
7
|
+
exports.default = new command_1.Command("help [command]")
|
|
7
8
|
.description("display help information")
|
|
8
9
|
.action(function (commandName) {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
const client = this.client;
|
|
11
|
+
const cmd = client.getCommand(commandName);
|
|
11
12
|
if (cmd) {
|
|
12
13
|
cmd.outputHelp();
|
|
13
14
|
}
|
|
14
15
|
else if (commandName) {
|
|
15
|
-
logger.warn();
|
|
16
|
+
logger_1.logger.warn();
|
|
16
17
|
utils.logWarning(clc.bold(commandName) + " is not a valid command. See below for valid commands");
|
|
17
18
|
client.cli.outputHelp();
|
|
18
19
|
}
|
|
19
20
|
else {
|
|
20
21
|
client.cli.outputHelp();
|
|
21
|
-
logger.info();
|
|
22
|
-
logger.info(" To get help with a specific command, type", clc.bold("firebase help [command_name]"));
|
|
23
|
-
logger.info();
|
|
22
|
+
logger_1.logger.info();
|
|
23
|
+
logger_1.logger.info(" To get help with a specific command, type", clc.bold("firebase help [command_name]"));
|
|
24
|
+
logger_1.logger.info();
|
|
24
25
|
}
|
|
25
|
-
return Promise.resolve();
|
|
26
26
|
});
|