firebase-tools 11.0.1 → 11.2.1
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 +11 -4
- package/lib/accountImporter.js +93 -95
- package/lib/api.js +77 -218
- package/lib/apiv2.js +5 -4
- package/lib/appdistribution/client.js +7 -9
- package/lib/auth.js +72 -52
- package/lib/bin/firebase.js +42 -47
- package/lib/checkValidTargetFilters.js +36 -25
- package/lib/commands/appdistribution-distribute.js +2 -1
- package/lib/commands/appdistribution-testers-add.js +2 -1
- package/lib/commands/appdistribution-testers-remove.js +2 -1
- package/lib/commands/apps-android-sha-create.js +2 -1
- package/lib/commands/apps-android-sha-delete.js +2 -1
- package/lib/commands/apps-android-sha-list.js +2 -1
- package/lib/commands/apps-create.js +2 -1
- package/lib/commands/apps-list.js +2 -1
- package/lib/commands/apps-sdkconfig.js +2 -1
- package/lib/commands/auth-export.js +2 -1
- package/lib/commands/auth-import.js +7 -10
- package/lib/commands/crashlytics-symbols-upload.js +2 -1
- package/lib/commands/database-get.js +4 -3
- package/lib/commands/database-instances-create.js +2 -1
- package/lib/commands/database-instances-list.js +3 -3
- package/lib/commands/database-profile.js +4 -4
- package/lib/commands/database-push.js +4 -4
- package/lib/commands/database-remove.js +3 -3
- package/lib/commands/database-rules-canary.js +2 -1
- package/lib/commands/database-rules-get.js +2 -1
- package/lib/commands/database-rules-list.js +2 -1
- package/lib/commands/database-rules-release.js +2 -1
- package/lib/commands/database-rules-stage.js +2 -1
- package/lib/commands/database-set.js +3 -3
- package/lib/commands/database-settings-get.js +2 -1
- package/lib/commands/database-settings-set.js +2 -1
- package/lib/commands/database-update.js +2 -1
- package/lib/commands/deploy.js +26 -25
- package/lib/commands/emulators-exec.js +2 -1
- package/lib/commands/emulators-export.js +2 -1
- package/lib/commands/emulators-start.js +2 -1
- package/lib/commands/experimental-functions-shell.js +10 -8
- package/lib/commands/ext-configure.js +2 -1
- package/lib/commands/ext-dev-deprecate.js +2 -1
- package/lib/commands/ext-dev-emulators-exec.js +3 -2
- package/lib/commands/ext-dev-emulators-start.js +3 -2
- package/lib/commands/ext-dev-extension-delete.js +2 -1
- package/lib/commands/ext-dev-init.js +2 -1
- package/lib/commands/ext-dev-list.js +8 -8
- package/lib/commands/ext-dev-publish.js +2 -1
- package/lib/commands/ext-dev-register.js +2 -1
- package/lib/commands/ext-dev-undeprecate.js +2 -1
- package/lib/commands/ext-dev-unpublish.js +2 -1
- package/lib/commands/ext-dev-usage.js +2 -1
- package/lib/commands/ext-export.js +2 -1
- package/lib/commands/ext-info.js +14 -14
- package/lib/commands/ext-install.js +2 -1
- package/lib/commands/ext-list.js +2 -1
- package/lib/commands/ext-sources-create.js +2 -1
- package/lib/commands/ext-uninstall.js +2 -1
- package/lib/commands/ext-update.js +2 -1
- package/lib/commands/ext.js +4 -4
- package/lib/commands/firestore-delete.js +2 -1
- package/lib/commands/firestore-indexes-list.js +2 -1
- package/lib/commands/functions-config-clone.js +4 -3
- package/lib/commands/functions-config-export.js +2 -1
- package/lib/commands/functions-config-get.js +2 -1
- package/lib/commands/functions-config-set.js +2 -1
- package/lib/commands/functions-config-unset.js +2 -1
- package/lib/commands/functions-delete.js +3 -8
- package/lib/commands/functions-deletegcfartifacts.js +2 -1
- package/lib/commands/functions-list.js +2 -1
- package/lib/commands/functions-log.js +2 -1
- package/lib/commands/functions-secrets-access.js +2 -1
- package/lib/commands/functions-secrets-destroy.js +2 -1
- package/lib/commands/functions-secrets-get.js +2 -1
- package/lib/commands/functions-secrets-prune.js +2 -1
- package/lib/commands/functions-secrets-set.js +2 -1
- package/lib/commands/functions-shell.js +12 -10
- package/lib/commands/help.js +2 -1
- package/lib/commands/hosting-channel-create.js +2 -1
- package/lib/commands/hosting-channel-delete.js +2 -1
- package/lib/commands/hosting-channel-deploy.js +2 -1
- package/lib/commands/hosting-channel-list.js +2 -1
- package/lib/commands/hosting-channel-open.js +2 -1
- package/lib/commands/hosting-clone.js +2 -1
- package/lib/commands/hosting-disable.js +2 -1
- package/lib/commands/hosting-sites-create.js +2 -1
- package/lib/commands/hosting-sites-delete.js +2 -1
- package/lib/commands/hosting-sites-get.js +2 -1
- package/lib/commands/hosting-sites-list.js +2 -1
- package/lib/commands/index.js +23 -13
- package/lib/commands/init.js +47 -43
- package/lib/commands/login-add.js +2 -1
- package/lib/commands/login-ci.js +2 -1
- package/lib/commands/login-list.js +2 -1
- package/lib/commands/login-use.js +2 -1
- package/lib/commands/login.js +2 -1
- package/lib/commands/logout.js +2 -1
- package/lib/commands/open.js +7 -7
- package/lib/commands/projects-addfirebase.js +2 -1
- package/lib/commands/projects-create.js +2 -1
- package/lib/commands/projects-list.js +2 -1
- package/lib/commands/remoteconfig-get.js +2 -1
- package/lib/commands/remoteconfig-rollback.js +2 -1
- package/lib/commands/remoteconfig-versions-list.js +2 -1
- package/lib/commands/serve.js +30 -30
- package/lib/commands/setup-emulators-database.js +2 -1
- package/lib/commands/setup-emulators-firestore.js +2 -1
- package/lib/commands/setup-emulators-pubsub.js +2 -1
- package/lib/commands/setup-emulators-storage.js +2 -1
- package/lib/commands/setup-emulators-ui.js +2 -1
- package/lib/commands/target-apply.js +2 -1
- package/lib/commands/target-clear.js +2 -1
- package/lib/commands/target-remove.js +2 -1
- package/lib/commands/target.js +2 -1
- package/lib/commands/use.js +54 -53
- package/lib/config.js +7 -6
- package/lib/deploy/database/deploy.js +3 -2
- package/lib/deploy/database/index.js +8 -5
- package/lib/deploy/database/prepare.js +22 -20
- package/lib/deploy/database/release.js +12 -9
- package/lib/deploy/extensions/secrets.js +3 -3
- package/lib/deploy/firestore/prepare.js +2 -2
- package/lib/deploy/functions/build.js +33 -20
- package/lib/deploy/functions/ensure.js +1 -11
- package/lib/deploy/functions/prepare.js +3 -13
- package/lib/deploy/functions/prepareFunctionsUpload.js +2 -3
- package/lib/deploy/functions/release/fabricator.js +0 -1
- package/lib/deploy/functions/release/index.js +1 -5
- package/lib/deploy/functions/runtimes/discovery/index.js +18 -3
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +188 -54
- package/lib/deploy/functions/runtimes/golang/index.js +2 -22
- package/lib/deploy/functions/runtimes/node/index.js +3 -7
- package/lib/deploy/functions/runtimes/node/parseTriggers.js +16 -4
- package/lib/deploy/functions/services/database.js +14 -0
- package/lib/deploy/functions/services/index.js +14 -0
- package/lib/deploy/index.js +3 -3
- package/lib/deploy/lifecycleHooks.js +27 -27
- package/lib/deploy/remoteconfig/prepare.js +2 -2
- package/lib/deploy/storage/prepare.js +1 -1
- package/lib/emulator/auth/apiSpec.js +14 -46
- package/lib/emulator/auth/index.js +1 -1
- package/lib/emulator/auth/operations.js +342 -93
- package/lib/emulator/auth/server.js +2 -2
- package/lib/emulator/auth/state.js +34 -32
- package/lib/emulator/commandUtils.js +1 -1
- package/lib/emulator/constants.js +1 -1
- package/lib/emulator/controller.js +7 -6
- package/lib/emulator/databaseEmulator.js +4 -4
- package/lib/emulator/download.js +1 -1
- package/lib/emulator/downloadableEmulators.js +5 -5
- package/lib/emulator/events/types.js +2 -3
- package/lib/emulator/firestoreEmulator.js +2 -2
- package/lib/emulator/functionsEmulator.js +31 -45
- package/lib/emulator/functionsEmulatorRuntime.js +12 -16
- package/lib/emulator/functionsEmulatorShared.js +7 -5
- package/lib/emulator/functionsRuntimeWorker.js +0 -6
- package/lib/emulator/hostingEmulator.js +1 -1
- package/lib/emulator/hub.js +1 -1
- package/lib/emulator/loggingEmulator.js +1 -1
- package/lib/emulator/pubsubEmulator.js +1 -1
- package/lib/emulator/storage/crc.js +4 -4
- package/lib/emulator/storage/index.js +1 -1
- package/lib/emulator/types.js +1 -1
- package/lib/errorOut.js +2 -2
- package/lib/extensions/askUserForConsent.js +1 -2
- package/lib/extensions/askUserForParam.js +15 -18
- package/lib/extensions/emulator/optionsHelper.js +4 -4
- package/lib/extensions/extensionsApi.js +1 -22
- package/lib/extensions/extensionsHelper.js +6 -6
- package/lib/extensions/listExtensions.js +9 -10
- package/lib/extensions/manifest.js +2 -2
- package/lib/extensions/resolveSource.js +11 -7
- package/lib/extensions/secretsUtils.js +3 -3
- package/lib/extensions/types.js +24 -0
- package/lib/extensions/updateHelper.js +1 -1
- package/lib/extensions/utils.js +1 -2
- package/lib/extensions/warnings.js +3 -3
- package/lib/firestore/encodeFirestoreValue.js +11 -8
- package/lib/fsAsync.js +3 -3
- package/lib/functions/events/v2.js +7 -1
- package/lib/functionsConfig.js +17 -14
- package/lib/functionsConfigClone.js +46 -46
- package/lib/gcp/cloudfunctions.js +2 -15
- package/lib/gcp/cloudfunctionsv2.js +17 -2
- package/lib/gcp/iam.js +1 -1
- package/lib/gcp/index.js +10 -10
- package/lib/gcp/rules.js +1 -1
- package/lib/gcp/runtimeconfig.js +45 -47
- package/lib/hosting/proxy.js +1 -1
- package/lib/index.js +29 -28
- package/lib/init/features/database.js +10 -2
- package/lib/init/features/functions/index.js +1 -1
- package/lib/init/features/functions/javascript.js +23 -20
- package/lib/init/features/functions/npm-dependencies.js +17 -14
- package/lib/init/features/functions/typescript.js +27 -24
- package/lib/init/features/hosting/github.js +6 -5
- package/lib/init/features/hosting/index.js +2 -2
- package/lib/loadCJSON.js +9 -6
- package/lib/localFunction.js +4 -4
- package/lib/logError.js +15 -12
- package/lib/parseBoltRules.js +15 -14
- package/lib/previews.js +1 -1
- package/lib/profileReport.js +504 -512
- package/lib/profiler.js +4 -4
- package/lib/prompt.js +1 -2
- package/lib/rc.js +1 -1
- package/lib/requireAuth.js +0 -1
- package/lib/responseToError.js +8 -5
- package/lib/rulesDeploy.js +2 -2
- package/lib/scopes.js +9 -9
- package/lib/serve/index.js +4 -5
- package/lib/utils.js +30 -6
- package/npm-shrinkwrap.json +537 -193
- package/package.json +17 -14
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const command_1 = require("../command");
|
|
4
5
|
const requirePermissions_1 = require("../requirePermissions");
|
|
5
6
|
const metadata = require("../database/metadata");
|
|
6
7
|
const types_1 = require("../emulator/types");
|
|
7
8
|
const commandUtils_1 = require("../emulator/commandUtils");
|
|
8
9
|
const requireDatabaseInstance_1 = require("../requireDatabaseInstance");
|
|
9
|
-
exports.
|
|
10
|
+
exports.command = new command_1.Command("database:rules:canary <rulesetId>")
|
|
10
11
|
.description("mark a staged ruleset as the canary ruleset")
|
|
11
12
|
.option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, uses default database instance)")
|
|
12
13
|
.before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.update"])
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const command_1 = require("../command");
|
|
4
5
|
const logger_1 = require("../logger");
|
|
5
6
|
const requireDatabaseInstance_1 = require("../requireDatabaseInstance");
|
|
@@ -7,7 +8,7 @@ const requirePermissions_1 = require("../requirePermissions");
|
|
|
7
8
|
const metadata = require("../database/metadata");
|
|
8
9
|
const types_1 = require("../emulator/types");
|
|
9
10
|
const commandUtils_1 = require("../emulator/commandUtils");
|
|
10
|
-
exports.
|
|
11
|
+
exports.command = new command_1.Command("database:rules:get <rulesetId>")
|
|
11
12
|
.description("get a realtime database ruleset by id")
|
|
12
13
|
.option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, uses default database instance)")
|
|
13
14
|
.before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.get"])
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const command_1 = require("../command");
|
|
4
5
|
const logger_1 = require("../logger");
|
|
5
6
|
const requireDatabaseInstance_1 = require("../requireDatabaseInstance");
|
|
@@ -7,7 +8,7 @@ const requirePermissions_1 = require("../requirePermissions");
|
|
|
7
8
|
const metadata = require("../database/metadata");
|
|
8
9
|
const types_1 = require("../emulator/types");
|
|
9
10
|
const commandUtils_1 = require("../emulator/commandUtils");
|
|
10
|
-
exports.
|
|
11
|
+
exports.command = new command_1.Command("database:rules:list")
|
|
11
12
|
.description("list realtime database rulesets")
|
|
12
13
|
.option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, uses default database instance)")
|
|
13
14
|
.before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.get"])
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const command_1 = require("../command");
|
|
4
5
|
const requireDatabaseInstance_1 = require("../requireDatabaseInstance");
|
|
5
6
|
const requirePermissions_1 = require("../requirePermissions");
|
|
6
7
|
const metadata = require("../database/metadata");
|
|
7
8
|
const types_1 = require("../emulator/types");
|
|
8
9
|
const commandUtils_1 = require("../emulator/commandUtils");
|
|
9
|
-
exports.
|
|
10
|
+
exports.command = new command_1.Command("database:rules:release <rulesetId>")
|
|
10
11
|
.description("mark a staged ruleset as the stable ruleset")
|
|
11
12
|
.option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, uses default database instance)")
|
|
12
13
|
.before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.update"])
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const command_1 = require("../command");
|
|
4
5
|
const logger_1 = require("../logger");
|
|
5
6
|
const requireDatabaseInstance_1 = require("../requireDatabaseInstance");
|
|
@@ -9,7 +10,7 @@ const fs = require("fs-extra");
|
|
|
9
10
|
const path = require("path");
|
|
10
11
|
const types_1 = require("../emulator/types");
|
|
11
12
|
const commandUtils_1 = require("../emulator/commandUtils");
|
|
12
|
-
exports.
|
|
13
|
+
exports.command = new command_1.Command("database:rules:stage")
|
|
13
14
|
.description("create a new realtime database ruleset")
|
|
14
15
|
.option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, uses default database instance)")
|
|
15
16
|
.before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.update"])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.command = void 0;
|
|
4
4
|
const clc = require("cli-color");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const apiv2_1 = require("../apiv2");
|
|
@@ -16,7 +16,7 @@ const url_1 = require("url");
|
|
|
16
16
|
const logger_1 = require("../logger");
|
|
17
17
|
const requireDatabaseInstance_1 = require("../requireDatabaseInstance");
|
|
18
18
|
const utils = require("../utils");
|
|
19
|
-
exports.
|
|
19
|
+
exports.command = new command_1.Command("database:set <path> [infile]")
|
|
20
20
|
.description("store JSON data at the specified path via STDIN, arg, or file")
|
|
21
21
|
.option("-d, --data <data>", "specify escaped JSON directly")
|
|
22
22
|
.option("-f, --force", "pass this option to bypass confirmation prompt")
|
|
@@ -26,7 +26,7 @@ exports.default = new command_1.Command("database:set <path> [infile]")
|
|
|
26
26
|
.before(database_1.populateInstanceDetails)
|
|
27
27
|
.before(commandUtils_1.printNoticeIfEmulated, types_1.Emulators.DATABASE)
|
|
28
28
|
.action(async (path, infile, options) => {
|
|
29
|
-
if (!
|
|
29
|
+
if (!path.startsWith("/")) {
|
|
30
30
|
throw new error_1.FirebaseError("Path must begin with /");
|
|
31
31
|
}
|
|
32
32
|
const origin = (0, api_1.realtimeOriginOrEmulatorOrCustomUrl)(options.instanceDetails.databaseUrl);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const url_1 = require("url");
|
|
4
5
|
const apiv2_1 = require("../apiv2");
|
|
5
6
|
const command_1 = require("../command");
|
|
@@ -12,7 +13,7 @@ const requirePermissions_1 = require("../requirePermissions");
|
|
|
12
13
|
const commandUtils_1 = require("../emulator/commandUtils");
|
|
13
14
|
const requireDatabaseInstance_1 = require("../requireDatabaseInstance");
|
|
14
15
|
const utils = require("../utils");
|
|
15
|
-
exports.
|
|
16
|
+
exports.command = new command_1.Command("database:settings:get <path>")
|
|
16
17
|
.description("read the realtime database setting at path")
|
|
17
18
|
.option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, uses default database instance)")
|
|
18
19
|
.help(settings_1.HELP_TEXT)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const url_1 = require("url");
|
|
4
5
|
const apiv2_1 = require("../apiv2");
|
|
5
6
|
const command_1 = require("../command");
|
|
@@ -12,7 +13,7 @@ const requirePermissions_1 = require("../requirePermissions");
|
|
|
12
13
|
const commandUtils_1 = require("../emulator/commandUtils");
|
|
13
14
|
const requireDatabaseInstance_1 = require("../requireDatabaseInstance");
|
|
14
15
|
const utils = require("../utils");
|
|
15
|
-
exports.
|
|
16
|
+
exports.command = new command_1.Command("database:settings:set <path> <value>")
|
|
16
17
|
.description("set the realtime database setting at path.")
|
|
17
18
|
.option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, use default database instance)")
|
|
18
19
|
.help(settings_1.HELP_TEXT)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const url_1 = require("url");
|
|
4
5
|
const clc = require("cli-color");
|
|
5
6
|
const fs = require("fs");
|
|
@@ -15,7 +16,7 @@ const requirePermissions_1 = require("../requirePermissions");
|
|
|
15
16
|
const logger_1 = require("../logger");
|
|
16
17
|
const requireDatabaseInstance_1 = require("../requireDatabaseInstance");
|
|
17
18
|
const utils = require("../utils");
|
|
18
|
-
exports.
|
|
19
|
+
exports.command = new command_1.Command("database:update <path> [infile]")
|
|
19
20
|
.description("update some of the keys for the defined path in your Firebase")
|
|
20
21
|
.option("-d, --data <data>", "specify escaped JSON directly")
|
|
21
22
|
.option("-f, --force", "pass this option to bypass confirmation prompt")
|
package/lib/commands/deploy.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = exports.VALID_DEPLOY_TARGETS = void 0;
|
|
4
|
+
const requireDatabaseInstance_1 = require("../requireDatabaseInstance");
|
|
5
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
6
|
+
const checkIam_1 = require("../deploy/functions/checkIam");
|
|
7
|
+
const checkValidTargetFilters_1 = require("../checkValidTargetFilters");
|
|
8
|
+
const command_1 = require("../command");
|
|
9
|
+
const deploy_1 = require("../deploy");
|
|
10
|
+
const requireConfig_1 = require("../requireConfig");
|
|
11
|
+
const filterTargets_1 = require("../filterTargets");
|
|
12
|
+
const requireHostingSite_1 = require("../requireHostingSite");
|
|
13
|
+
exports.VALID_DEPLOY_TARGETS = [
|
|
13
14
|
"database",
|
|
14
15
|
"storage",
|
|
15
16
|
"firestore",
|
|
@@ -42,7 +43,7 @@ const TARGET_PERMISSIONS = {
|
|
|
42
43
|
],
|
|
43
44
|
remoteconfig: ["cloudconfig.configs.get", "cloudconfig.configs.update"],
|
|
44
45
|
};
|
|
45
|
-
|
|
46
|
+
exports.command = new command_1.Command("deploy")
|
|
46
47
|
.description("deploy code and assets to your Firebase project")
|
|
47
48
|
.withForce("delete Cloud Functions missing from the current working directory without confirmation")
|
|
48
49
|
.option("-p, --public <path>", "override the Hosting public directory specified in firebase.json")
|
|
@@ -52,28 +53,28 @@ module.exports = new Command("deploy")
|
|
|
52
53
|
"When filtering based on export groups (the exported module object keys), use dots to specify group names " +
|
|
53
54
|
'(e.g. "--only functions:group1.subgroup1,functions:group2)"')
|
|
54
55
|
.option("--except <targets>", 'deploy to all targets except specified (e.g. "database")')
|
|
55
|
-
.before(requireConfig)
|
|
56
|
-
.before(
|
|
57
|
-
options.filteredTargets = filterTargets(options,
|
|
56
|
+
.before(requireConfig_1.requireConfig)
|
|
57
|
+
.before((options) => {
|
|
58
|
+
options.filteredTargets = (0, filterTargets_1.filterTargets)(options, exports.VALID_DEPLOY_TARGETS);
|
|
58
59
|
const permissions = options.filteredTargets.reduce((perms, target) => {
|
|
59
60
|
return perms.concat(TARGET_PERMISSIONS[target]);
|
|
60
61
|
}, []);
|
|
61
|
-
return requirePermissions(options, permissions);
|
|
62
|
+
return (0, requirePermissions_1.requirePermissions)(options, permissions);
|
|
62
63
|
})
|
|
63
64
|
.before((options) => {
|
|
64
65
|
if (options.filteredTargets.includes("functions")) {
|
|
65
|
-
return checkServiceAccountIam(options.project);
|
|
66
|
+
return (0, checkIam_1.checkServiceAccountIam)(options.project);
|
|
66
67
|
}
|
|
67
68
|
})
|
|
68
|
-
.before(async
|
|
69
|
-
if (
|
|
70
|
-
await requireDatabaseInstance(options);
|
|
69
|
+
.before(async (options) => {
|
|
70
|
+
if (options.filteredTargets.includes("database")) {
|
|
71
|
+
await (0, requireDatabaseInstance_1.requireDatabaseInstance)(options);
|
|
71
72
|
}
|
|
72
|
-
if (
|
|
73
|
-
await requireHostingSite(options);
|
|
73
|
+
if (options.filteredTargets.includes("hosting")) {
|
|
74
|
+
await (0, requireHostingSite_1.requireHostingSite)(options);
|
|
74
75
|
}
|
|
75
76
|
})
|
|
76
|
-
.before(checkValidTargetFilters)
|
|
77
|
-
.action(
|
|
78
|
-
return deploy(options.filteredTargets, options);
|
|
77
|
+
.before(checkValidTargetFilters_1.checkValidTargetFilters)
|
|
78
|
+
.action((options) => {
|
|
79
|
+
return (0, deploy_1.deploy)(options.filteredTargets, options);
|
|
79
80
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const command_1 = require("../command");
|
|
4
5
|
const commandUtils = require("../emulator/commandUtils");
|
|
5
|
-
|
|
6
|
+
exports.command = new command_1.Command("emulators:exec <script>")
|
|
6
7
|
.before(commandUtils.setExportOnExitOptions)
|
|
7
8
|
.before(commandUtils.beforeEmulatorCommand)
|
|
8
9
|
.description("start the local Firebase emulators, " + "run a test script, then shut down the emulators")
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const command_1 = require("../command");
|
|
4
5
|
const controller = require("../emulator/controller");
|
|
5
6
|
const commandUtils = require("../emulator/commandUtils");
|
|
6
|
-
|
|
7
|
+
exports.command = new command_1.Command("emulators:export <path>")
|
|
7
8
|
.description("export data from running emulators")
|
|
8
9
|
.withForce("overwrite any export data in the target directory")
|
|
9
10
|
.option(commandUtils.FLAG_ONLY, commandUtils.DESC_ONLY)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const command_1 = require("../command");
|
|
4
5
|
const controller = require("../emulator/controller");
|
|
5
6
|
const commandUtils = require("../emulator/commandUtils");
|
|
@@ -13,7 +14,7 @@ const Table = require("cli-table");
|
|
|
13
14
|
function stylizeLink(url) {
|
|
14
15
|
return clc.underline(clc.bold(url));
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
exports.command = new command_1.Command("emulators:start")
|
|
17
18
|
.before(commandUtils.setExportOnExitOptions)
|
|
18
19
|
.before(commandUtils.beforeEmulatorCommand)
|
|
19
20
|
.description("start the local Firebase emulators")
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const functionsShellCommandAction_1 = require("../functionsShellCommandAction");
|
|
5
|
+
const command_1 = require("../command");
|
|
6
|
+
const requireConfig_1 = require("../requireConfig");
|
|
7
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
8
|
+
exports.command = new command_1.Command("experimental:functions:shell")
|
|
7
9
|
.description("launch full Node shell with emulated functions. (Alias for `firebase functions:shell.)")
|
|
8
10
|
.option("-p, --port <port>", "the port on which to emulate functions (default: 5000)", 5000)
|
|
9
|
-
.before(requireConfig)
|
|
10
|
-
.before(requirePermissions)
|
|
11
|
-
.action(actionFunction);
|
|
11
|
+
.before(requireConfig_1.requireConfig)
|
|
12
|
+
.before(requirePermissions_1.requirePermissions)
|
|
13
|
+
.action(functionsShellCommandAction_1.actionFunction);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const { marked } = require("marked");
|
|
4
5
|
const TerminalRenderer = require("marked-terminal");
|
|
5
6
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
@@ -20,7 +21,7 @@ const askUserForEventsConfig = require("../extensions/askUserForEventsConfig");
|
|
|
20
21
|
marked.setOptions({
|
|
21
22
|
renderer: new TerminalRenderer(),
|
|
22
23
|
});
|
|
23
|
-
exports.
|
|
24
|
+
exports.command = new command_1.Command("ext:configure <extensionInstanceId>")
|
|
24
25
|
.description("configure an existing extension instance")
|
|
25
26
|
.withForce()
|
|
26
27
|
.option("--local", "deprecated")
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const clc = require("cli-color");
|
|
4
5
|
const semver = require("semver");
|
|
5
6
|
const refs = require("../extensions/refs");
|
|
@@ -11,7 +12,7 @@ const extensionsApi_1 = require("../extensions/extensionsApi");
|
|
|
11
12
|
const versionHelper_1 = require("../extensions/versionHelper");
|
|
12
13
|
const requireAuth_1 = require("../requireAuth");
|
|
13
14
|
const error_1 = require("../error");
|
|
14
|
-
exports.
|
|
15
|
+
exports.command = new command_1.Command("ext:dev:deprecate <extensionRef> <versionPredicate>")
|
|
15
16
|
.description("deprecate extension versions that match the version predicate")
|
|
16
17
|
.option("-m, --message <deprecationMessage>", "deprecation message")
|
|
17
18
|
.option("-f, --force", "override deprecation message for existing deprecated extension versions that match")
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const clc = require("cli-color");
|
|
4
5
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
5
6
|
const command_1 = require("../command");
|
|
6
7
|
const error_1 = require("../error");
|
|
7
8
|
const commandUtils = require("../emulator/commandUtils");
|
|
8
|
-
|
|
9
|
+
exports.command = new command_1.Command("ext:dev:emulators:exec <script>")
|
|
9
10
|
.description("deprecated: please use `firebase emulators:exec` instead")
|
|
10
11
|
.before(commandUtils.setExportOnExitOptions)
|
|
11
12
|
.option(commandUtils.FLAG_INSPECT_FUNCTIONS, commandUtils.DESC_INSPECT_FUNCTIONS)
|
|
@@ -15,7 +16,7 @@ module.exports = new command_1.Command("ext:dev:emulators:exec <script>")
|
|
|
15
16
|
.option(commandUtils.FLAG_EXPORT_ON_EXIT, commandUtils.DESC_EXPORT_ON_EXIT)
|
|
16
17
|
.option(commandUtils.FLAG_UI, commandUtils.DESC_UI)
|
|
17
18
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extDevMinVersion")
|
|
18
|
-
.action((script
|
|
19
|
+
.action((script) => {
|
|
19
20
|
const localInstallCommand = `firebase ext:install ${process.cwd()}`;
|
|
20
21
|
const emulatorsExecCommand = `firebase emulators:exec '${script}`;
|
|
21
22
|
throw new error_1.FirebaseError("ext:dev:emulators:exec is no longer supported. " +
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const clc = require("cli-color");
|
|
4
5
|
const command_1 = require("../command");
|
|
5
6
|
const commandUtils = require("../emulator/commandUtils");
|
|
6
7
|
const error_1 = require("../error");
|
|
7
|
-
|
|
8
|
+
exports.command = new command_1.Command("ext:dev:emulators:start")
|
|
8
9
|
.description("deprecated: please use `firebase emulators:start`")
|
|
9
10
|
.before(commandUtils.setExportOnExitOptions)
|
|
10
11
|
.option(commandUtils.FLAG_INSPECT_FUNCTIONS, commandUtils.DESC_INSPECT_FUNCTIONS)
|
|
@@ -12,7 +13,7 @@ module.exports = new command_1.Command("ext:dev:emulators:start")
|
|
|
12
13
|
.option(commandUtils.FLAG_TEST_PARAMS, commandUtils.DESC_TEST_PARAMS)
|
|
13
14
|
.option(commandUtils.FLAG_IMPORT, commandUtils.DESC_IMPORT)
|
|
14
15
|
.option(commandUtils.FLAG_EXPORT_ON_EXIT, commandUtils.DESC_EXPORT_ON_EXIT)
|
|
15
|
-
.action((
|
|
16
|
+
.action(() => {
|
|
16
17
|
const localInstallCommand = `firebase ext:install ${process.cwd()}`;
|
|
17
18
|
const emulatorsStartCommand = "firebase emulators:start";
|
|
18
19
|
throw new error_1.FirebaseError("ext:dev:emulators:start is no longer supported. " +
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const utils = require("../utils");
|
|
4
5
|
const clc = require("cli-color");
|
|
5
6
|
const command_1 = require("../command");
|
|
@@ -10,7 +11,7 @@ const prompt_1 = require("../prompt");
|
|
|
10
11
|
const requireAuth_1 = require("../requireAuth");
|
|
11
12
|
const error_1 = require("../error");
|
|
12
13
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
13
|
-
|
|
14
|
+
exports.command = new command_1.Command("ext:dev:delete <extensionRef>")
|
|
14
15
|
.description("delete an extension")
|
|
15
16
|
.help("use this command to delete an extension, and make it unavailable for developers to install or reconfigure. " +
|
|
16
17
|
"Specify the extension you want to delete using the format '<publisherId>/<extensionId>.")
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const fs = require("fs");
|
|
4
5
|
const path = require("path");
|
|
5
6
|
const { marked } = require("marked");
|
|
@@ -24,7 +25,7 @@ function readCommonTemplates() {
|
|
|
24
25
|
changelogTemplate: fs.readFileSync(path.join(TEMPLATE_ROOT, "CHANGELOG.md"), "utf8"),
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
exports.
|
|
28
|
+
exports.command = new command_1.Command("ext:dev:init")
|
|
28
29
|
.description("initialize files for writing an extension in the current directory")
|
|
29
30
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extDevMinVersion")
|
|
30
31
|
.action(async (options) => {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const clc = require("cli-color");
|
|
4
5
|
const Table = require("cli-table");
|
|
5
|
-
const _ = require("lodash");
|
|
6
6
|
const command_1 = require("../command");
|
|
7
|
-
const extensionsHelper_1 = require("../extensions/extensionsHelper");
|
|
8
7
|
const error_1 = require("../error");
|
|
9
|
-
const
|
|
10
|
-
const extensionsUtils = require("../extensions/utils");
|
|
8
|
+
const utils_1 = require("../utils");
|
|
11
9
|
const extensionsApi_1 = require("../extensions/extensionsApi");
|
|
12
10
|
const logger_1 = require("../logger");
|
|
11
|
+
const extensionsHelper_1 = require("../extensions/extensionsHelper");
|
|
13
12
|
const requireAuth_1 = require("../requireAuth");
|
|
14
|
-
|
|
13
|
+
const extensionsUtils = require("../extensions/utils");
|
|
14
|
+
exports.command = new command_1.Command("ext:dev:list <publisherId>")
|
|
15
15
|
.description("list all published extensions associated with this publisher ID")
|
|
16
16
|
.before(requireAuth_1.requireAuth)
|
|
17
17
|
.action(async (publisherId) => {
|
|
@@ -32,15 +32,15 @@ exports.default = new command_1.Command("ext:dev:list <publisherId>")
|
|
|
32
32
|
head: ["Extension ID", "Version", "Published"],
|
|
33
33
|
style: { head: ["yellow"] },
|
|
34
34
|
});
|
|
35
|
-
const sorted =
|
|
35
|
+
const sorted = extensions.sort((a, b) => new Date(b.createTime).valueOf() - new Date(a.createTime).valueOf());
|
|
36
36
|
sorted.forEach((extension) => {
|
|
37
37
|
table.push([
|
|
38
|
-
|
|
38
|
+
(0, utils_1.last)(extension.ref.split("/")),
|
|
39
39
|
extension.latestVersion,
|
|
40
40
|
extension.createTime ? extensionsUtils.formatTimestamp(extension.createTime) : "",
|
|
41
41
|
]);
|
|
42
42
|
});
|
|
43
|
-
|
|
43
|
+
(0, utils_1.logLabeledBullet)(extensionsHelper_1.logPrefix, `list of published extensions for publisher ${clc.bold(publisherId)}:`);
|
|
44
44
|
logger_1.logger.info(table.toString());
|
|
45
45
|
return { extensions: sorted };
|
|
46
46
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const clc = require("cli-color");
|
|
4
5
|
const { marked } = require("marked");
|
|
5
6
|
const TerminalRenderer = require("marked-terminal");
|
|
@@ -14,7 +15,7 @@ const utils = require("../utils");
|
|
|
14
15
|
marked.setOptions({
|
|
15
16
|
renderer: new TerminalRenderer(),
|
|
16
17
|
});
|
|
17
|
-
exports.
|
|
18
|
+
exports.command = new command_1.Command("ext:dev:publish <extensionRef>")
|
|
18
19
|
.description(`publish a new version of an extension`)
|
|
19
20
|
.withForce()
|
|
20
21
|
.help("if you have not previously published a version of this extension, this will " +
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const clc = require("cli-color");
|
|
4
5
|
const { marked } = require("marked");
|
|
5
6
|
const command_1 = require("../command");
|
|
@@ -11,7 +12,7 @@ const askUserForConsent_1 = require("../extensions/askUserForConsent");
|
|
|
11
12
|
const requirePermissions_1 = require("../requirePermissions");
|
|
12
13
|
const error_1 = require("../error");
|
|
13
14
|
const utils = require("../utils");
|
|
14
|
-
exports.
|
|
15
|
+
exports.command = new command_1.Command("ext:dev:register")
|
|
15
16
|
.description("register a publisher ID; run this before publishing your first extension.")
|
|
16
17
|
.before(requirePermissions_1.requirePermissions, ["firebaseextensions.sources.create"])
|
|
17
18
|
.before(extensionsHelper_1.ensureExtensionsApiEnabled)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const clc = require("cli-color");
|
|
4
5
|
const semver = require("semver");
|
|
5
6
|
const refs = require("../extensions/refs");
|
|
@@ -11,7 +12,7 @@ const extensionsApi_1 = require("../extensions/extensionsApi");
|
|
|
11
12
|
const versionHelper_1 = require("../extensions/versionHelper");
|
|
12
13
|
const requireAuth_1 = require("../requireAuth");
|
|
13
14
|
const error_1 = require("../error");
|
|
14
|
-
exports.
|
|
15
|
+
exports.command = new command_1.Command("ext:dev:undeprecate <extensionRef> <versionPredicate>")
|
|
15
16
|
.description("undeprecate extension versions that match the version predicate")
|
|
16
17
|
.before(requireAuth_1.requireAuth)
|
|
17
18
|
.before(extensionsHelper_1.ensureExtensionsApiEnabled)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const command_1 = require("../command");
|
|
4
5
|
const extensionsHelper_1 = require("../extensions/extensionsHelper");
|
|
5
6
|
const extensionsApi_1 = require("../extensions/extensionsApi");
|
|
@@ -10,7 +11,7 @@ const clc = require("cli-color");
|
|
|
10
11
|
const requireAuth_1 = require("../requireAuth");
|
|
11
12
|
const error_1 = require("../error");
|
|
12
13
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
13
|
-
|
|
14
|
+
exports.command = new command_1.Command("ext:dev:unpublish <extensionRef>")
|
|
14
15
|
.description("unpublish an extension")
|
|
15
16
|
.withForce()
|
|
16
17
|
.help("use this command to unpublish an extension, and make it unavailable for developers to install or reconfigure. " +
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const Table = require("cli-table");
|
|
4
5
|
const clc = require("cli-color");
|
|
5
6
|
const utils = require("../utils");
|
|
@@ -14,7 +15,7 @@ const error_1 = require("../error");
|
|
|
14
15
|
const logger_1 = require("../logger");
|
|
15
16
|
const prompt_1 = require("../prompt");
|
|
16
17
|
const shortenUrl_1 = require("../shortenUrl");
|
|
17
|
-
|
|
18
|
+
exports.command = new command_1.Command("ext:dev:usage <publisherId>")
|
|
18
19
|
.description("get usage for an extension")
|
|
19
20
|
.help("use this command to get the usage of extensions you published. " +
|
|
20
21
|
"Specify the publisher ID you used to publish your extensions, " +
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
4
5
|
const command_1 = require("../command");
|
|
5
6
|
const planner = require("../deploy/extensions/planner");
|
|
@@ -13,7 +14,7 @@ const logger_1 = require("../logger");
|
|
|
13
14
|
const projectUtils_1 = require("../projectUtils");
|
|
14
15
|
const prompt_1 = require("../prompt");
|
|
15
16
|
const requirePermissions_1 = require("../requirePermissions");
|
|
16
|
-
|
|
17
|
+
exports.command = new command_1.Command("ext:export")
|
|
17
18
|
.description("export all Extension instances installed on a project to a local Firebase directory")
|
|
18
19
|
.before(requirePermissions_1.requirePermissions, ["firebaseextensions.instances.list"])
|
|
19
20
|
.before(extensionsHelper_1.ensureExtensionsApiEnabled)
|