firebase-tools 11.0.1 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/accountImporter.js +92 -93
- package/lib/api.js +77 -218
- package/lib/apiv2.js +5 -4
- package/lib/auth.js +69 -47
- package/lib/bin/firebase.js +42 -47
- package/lib/checkValidTargetFilters.js +13 -12
- 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 +2 -1
- package/lib/commands/database-push.js +2 -1
- package/lib/commands/database-remove.js +2 -1
- 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 +2 -1
- 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 +23 -21
- 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 +2 -1
- package/lib/commands/ext-dev-emulators-start.js +2 -1
- 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 +2 -1
- 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 +2 -1
- 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 +2 -1
- 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 +2 -1
- 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 +2 -1
- 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 +29 -27
- 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 -52
- package/lib/config.js +3 -3
- package/lib/deploy/database/deploy.js +3 -2
- package/lib/deploy/database/index.js +8 -5
- package/lib/deploy/database/prepare.js +22 -19
- package/lib/deploy/database/release.js +12 -9
- package/lib/deploy/firestore/prepare.js +2 -2
- package/lib/deploy/functions/build.js +32 -20
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +187 -54
- package/lib/deploy/functions/runtimes/node/parseTriggers.js +14 -2
- 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 +23 -20
- package/lib/deploy/remoteconfig/prepare.js +2 -2
- package/lib/emulator/auth/apiSpec.js +14 -46
- package/lib/emulator/auth/operations.js +6 -29
- package/lib/emulator/auth/state.js +2 -25
- package/lib/emulator/controller.js +1 -1
- package/lib/emulator/databaseEmulator.js +2 -2
- package/lib/errorOut.js +2 -2
- package/lib/functions/events/v2.js +7 -1
- package/lib/functionsConfigClone.js +43 -41
- package/lib/gcp/cloudfunctionsv2.js +17 -2
- package/lib/gcp/iam.js +1 -1
- package/lib/gcp/index.js +10 -10
- package/lib/gcp/runtimeconfig.js +45 -47
- 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 +5 -4
- package/lib/loadCJSON.js +9 -6
- package/lib/logError.js +15 -12
- package/lib/parseBoltRules.js +15 -14
- package/lib/profileReport.js +503 -511
- package/lib/profiler.js +4 -4
- package/lib/requireAuth.js +0 -1
- package/lib/responseToError.js +8 -5
- package/lib/scopes.js +9 -9
- package/npm-shrinkwrap.json +537 -193
- package/package.json +8 -6
|
@@ -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,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const _ = require("lodash");
|
|
4
5
|
const clc = require("cli-color");
|
|
5
6
|
const fs = require("fs");
|
|
@@ -16,7 +17,7 @@ const url_1 = require("url");
|
|
|
16
17
|
const logger_1 = require("../logger");
|
|
17
18
|
const requireDatabaseInstance_1 = require("../requireDatabaseInstance");
|
|
18
19
|
const utils = require("../utils");
|
|
19
|
-
exports.
|
|
20
|
+
exports.command = new command_1.Command("database:set <path> [infile]")
|
|
20
21
|
.description("store JSON data at the specified path via STDIN, arg, or file")
|
|
21
22
|
.option("-d, --data <data>", "specify escaped JSON directly")
|
|
22
23
|
.option("-f, --force", "pass this option to bypass confirmation prompt")
|
|
@@ -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,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
2
4
|
const _ = require("lodash");
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
5
|
+
const requireDatabaseInstance_1 = require("../requireDatabaseInstance");
|
|
6
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
7
|
+
const checkIam_1 = require("../deploy/functions/checkIam");
|
|
8
|
+
const checkValidTargetFilters_1 = require("../checkValidTargetFilters");
|
|
9
|
+
const command_1 = require("../command");
|
|
10
|
+
const deploy_1 = require("../deploy");
|
|
11
|
+
const requireConfig_1 = require("../requireConfig");
|
|
12
|
+
const filterTargets_1 = require("../filterTargets");
|
|
13
|
+
const requireHostingSite_1 = require("../requireHostingSite");
|
|
12
14
|
const VALID_TARGETS = [
|
|
13
15
|
"database",
|
|
14
16
|
"storage",
|
|
@@ -42,7 +44,7 @@ const TARGET_PERMISSIONS = {
|
|
|
42
44
|
],
|
|
43
45
|
remoteconfig: ["cloudconfig.configs.get", "cloudconfig.configs.update"],
|
|
44
46
|
};
|
|
45
|
-
|
|
47
|
+
exports.command = new command_1.Command("deploy")
|
|
46
48
|
.description("deploy code and assets to your Firebase project")
|
|
47
49
|
.withForce("delete Cloud Functions missing from the current working directory without confirmation")
|
|
48
50
|
.option("-p, --public <path>", "override the Hosting public directory specified in firebase.json")
|
|
@@ -52,28 +54,28 @@ module.exports = new Command("deploy")
|
|
|
52
54
|
"When filtering based on export groups (the exported module object keys), use dots to specify group names " +
|
|
53
55
|
'(e.g. "--only functions:group1.subgroup1,functions:group2)"')
|
|
54
56
|
.option("--except <targets>", 'deploy to all targets except specified (e.g. "database")')
|
|
55
|
-
.before(requireConfig)
|
|
56
|
-
.before(
|
|
57
|
-
options.filteredTargets = filterTargets(options, VALID_TARGETS);
|
|
57
|
+
.before(requireConfig_1.requireConfig)
|
|
58
|
+
.before((options) => {
|
|
59
|
+
options.filteredTargets = (0, filterTargets_1.filterTargets)(options, VALID_TARGETS);
|
|
58
60
|
const permissions = options.filteredTargets.reduce((perms, target) => {
|
|
59
61
|
return perms.concat(TARGET_PERMISSIONS[target]);
|
|
60
62
|
}, []);
|
|
61
|
-
return requirePermissions(options, permissions);
|
|
63
|
+
return (0, requirePermissions_1.requirePermissions)(options, permissions);
|
|
62
64
|
})
|
|
63
65
|
.before((options) => {
|
|
64
66
|
if (options.filteredTargets.includes("functions")) {
|
|
65
|
-
return checkServiceAccountIam(options.project);
|
|
67
|
+
return (0, checkIam_1.checkServiceAccountIam)(options.project);
|
|
66
68
|
}
|
|
67
69
|
})
|
|
68
|
-
.before(async
|
|
70
|
+
.before(async (options) => {
|
|
69
71
|
if (_.includes(options.filteredTargets, "database")) {
|
|
70
|
-
await requireDatabaseInstance(options);
|
|
72
|
+
await (0, requireDatabaseInstance_1.requireDatabaseInstance)(options);
|
|
71
73
|
}
|
|
72
74
|
if (_.includes(options.filteredTargets, "hosting")) {
|
|
73
|
-
await requireHostingSite(options);
|
|
75
|
+
await (0, requireHostingSite_1.requireHostingSite)(options);
|
|
74
76
|
}
|
|
75
77
|
})
|
|
76
|
-
.before(checkValidTargetFilters)
|
|
77
|
-
.action(
|
|
78
|
-
return deploy(options.filteredTargets, options);
|
|
78
|
+
.before(checkValidTargetFilters_1.checkValidTargetFilters)
|
|
79
|
+
.action((options) => {
|
|
80
|
+
return (0, deploy_1.deploy)(options.filteredTargets, options);
|
|
79
81
|
});
|
|
@@ -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)
|
|
@@ -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)
|
|
@@ -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,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 Table = require("cli-table");
|
|
5
6
|
const _ = require("lodash");
|
|
@@ -11,7 +12,7 @@ const extensionsUtils = require("../extensions/utils");
|
|
|
11
12
|
const extensionsApi_1 = require("../extensions/extensionsApi");
|
|
12
13
|
const logger_1 = require("../logger");
|
|
13
14
|
const requireAuth_1 = require("../requireAuth");
|
|
14
|
-
exports.
|
|
15
|
+
exports.command = new command_1.Command("ext:dev:list <publisherId>")
|
|
15
16
|
.description("list all published extensions associated with this publisher ID")
|
|
16
17
|
.before(requireAuth_1.requireAuth)
|
|
17
18
|
.action(async (publisherId) => {
|
|
@@ -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)
|
package/lib/commands/ext-info.js
CHANGED
|
@@ -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 _ = require("lodash");
|
|
5
6
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
@@ -13,7 +14,7 @@ const utils = require("../utils");
|
|
|
13
14
|
const { marked } = require("marked");
|
|
14
15
|
const TerminalRenderer = require("marked-terminal");
|
|
15
16
|
const FUNCTION_TYPE_REGEX = /\..+\.function/;
|
|
16
|
-
exports.
|
|
17
|
+
exports.command = new command_1.Command("ext:info <extensionName>")
|
|
17
18
|
.description("display information about an extension by name (extensionName@x.y.z for a specific version)")
|
|
18
19
|
.option("--markdown", "output info in Markdown suitable for constructing a README file")
|
|
19
20
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extMinVersion")
|
|
@@ -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");
|
|
@@ -23,7 +24,7 @@ const manifest = require("../extensions/manifest");
|
|
|
23
24
|
marked.setOptions({
|
|
24
25
|
renderer: new TerminalRenderer(),
|
|
25
26
|
});
|
|
26
|
-
exports.
|
|
27
|
+
exports.command = new command_1.Command("ext:install [extensionName]")
|
|
27
28
|
.description("install an official extension if [extensionName] or [extensionName@version] is provided; " +
|
|
28
29
|
(previews_1.previews.extdev
|
|
29
30
|
? "install a local extension if [localPathOrUrl] or [url#root] is provided; install a published extension (not authored by Firebase) if [publisherId/extensionId] is provided "
|
package/lib/commands/ext-list.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
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 projectUtils_1 = require("../projectUtils");
|
|
6
7
|
const listExtensions_1 = require("../extensions/listExtensions");
|
|
7
8
|
const extensionsHelper_1 = require("../extensions/extensionsHelper");
|
|
8
9
|
const requirePermissions_1 = require("../requirePermissions");
|
|
9
|
-
|
|
10
|
+
exports.command = new command_1.Command("ext:list")
|
|
10
11
|
.description("list all the extensions that are installed in your Firebase project")
|
|
11
12
|
.before(requirePermissions_1.requirePermissions, ["firebaseextensions.instances.list"])
|
|
12
13
|
.before(extensionsHelper_1.ensureExtensionsApiEnabled)
|
|
@@ -1,12 +1,13 @@
|
|
|
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 projectUtils_1 = require("../projectUtils");
|
|
6
7
|
const logger_1 = require("../logger");
|
|
7
8
|
const extensionsHelper_1 = require("../extensions/extensionsHelper");
|
|
8
9
|
const requirePermissions_1 = require("../requirePermissions");
|
|
9
|
-
exports.
|
|
10
|
+
exports.command = new command_1.Command("ext:sources:create <sourceLocation>")
|
|
10
11
|
.description(`create a extension source from sourceLocation`)
|
|
11
12
|
.help("sourceLocation can be a local directory containing an extension, or URL pointing to a zipped extension. " +
|
|
12
13
|
'If using a URL, you can specify a root folder for the extension by adding "#<extensionRoot>". ' +
|
|
@@ -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");
|
|
@@ -11,7 +12,7 @@ const manifest = require("../extensions/manifest");
|
|
|
11
12
|
marked.setOptions({
|
|
12
13
|
renderer: new TerminalRenderer(),
|
|
13
14
|
});
|
|
14
|
-
exports.
|
|
15
|
+
exports.command = new command_1.Command("ext:uninstall <extensionInstanceId>")
|
|
15
16
|
.description("uninstall an extension that is installed in your Firebase project by instance ID")
|
|
16
17
|
.option("--local", "deprecated")
|
|
17
18
|
.withForce()
|
|
@@ -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");
|
|
@@ -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:update <extensionInstanceId> [updateSource]")
|
|
24
25
|
.description(previews_1.previews.extdev
|
|
25
26
|
? "update an existing extension instance to the latest version or from a local or URL source"
|
|
26
27
|
: "update an existing extension instance to the latest version")
|
package/lib/commands/ext.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const _ = require("lodash");
|
|
4
5
|
const clc = require("cli-color");
|
|
5
6
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
@@ -10,7 +11,7 @@ const listExtensions_1 = require("../extensions/listExtensions");
|
|
|
10
11
|
const requirePermissions_1 = require("../requirePermissions");
|
|
11
12
|
const logger_1 = require("../logger");
|
|
12
13
|
const utils = require("../utils");
|
|
13
|
-
|
|
14
|
+
exports.command = new command_1.Command("ext")
|
|
14
15
|
.description("display information on how to use ext commands and extensions installed to your project")
|
|
15
16
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extMinVersion")
|
|
16
17
|
.action(async (options) => {
|
|
@@ -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 command_1 = require("../command");
|
|
5
6
|
const types_1 = require("../emulator/types");
|
|
@@ -45,7 +46,7 @@ function getConfirmationMessage(deleteOp, options) {
|
|
|
45
46
|
clc.cyan(options.project) +
|
|
46
47
|
". Are you sure?");
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
+
exports.command = new command_1.Command("firestore:delete [path]")
|
|
49
50
|
.description("Delete data from Cloud Firestore.")
|
|
50
51
|
.option("-r, --recursive", "Recursive. Delete all documents and subcollections at and under the " +
|
|
51
52
|
"specified level. May not be passed along with --shallow.")
|
|
@@ -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 clc = require("cli-color");
|
|
5
6
|
const fsi = require("../firestore/indexes");
|
|
@@ -7,7 +8,7 @@ const logger_1 = require("../logger");
|
|
|
7
8
|
const requirePermissions_1 = require("../requirePermissions");
|
|
8
9
|
const types_1 = require("../emulator/types");
|
|
9
10
|
const commandUtils_1 = require("../emulator/commandUtils");
|
|
10
|
-
|
|
11
|
+
exports.command = new command_1.Command("firestore:indexes")
|
|
11
12
|
.description("List indexes in your project's Cloud Firestore database.")
|
|
12
13
|
.option("--pretty", "Pretty print. When not specified the indexes are printed in the " +
|
|
13
14
|
"JSON specification format.")
|
|
@@ -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 command_1 = require("../command");
|
|
5
6
|
const error_1 = require("../error");
|
|
@@ -7,9 +8,9 @@ const logger_1 = require("../logger");
|
|
|
7
8
|
const projectUtils_1 = require("../projectUtils");
|
|
8
9
|
const requirePermissions_1 = require("../requirePermissions");
|
|
9
10
|
const functionsConfig = require("../functionsConfig");
|
|
10
|
-
const
|
|
11
|
+
const functionsConfigClone_1 = require("../functionsConfigClone");
|
|
11
12
|
const utils = require("../utils");
|
|
12
|
-
exports.
|
|
13
|
+
exports.command = new command_1.Command("functions:config:clone")
|
|
13
14
|
.description("clone environment config from another project")
|
|
14
15
|
.option("--from <projectId>", "the project from which to clone configuration")
|
|
15
16
|
.option("--only <keys>", "a comma-separated list of keys to clone")
|
|
@@ -46,7 +47,7 @@ exports.default = new command_1.Command("functions:config:clone")
|
|
|
46
47
|
else if (options.except) {
|
|
47
48
|
except = options.except.split(",");
|
|
48
49
|
}
|
|
49
|
-
await functionsConfigClone(options.from, projectId, only, except);
|
|
50
|
+
await (0, functionsConfigClone_1.functionsConfigClone)(options.from, projectId, only, except);
|
|
50
51
|
utils.logSuccess(`Cloned functions config from ${clc.bold(options.from)} into ${clc.bold(projectId)}`);
|
|
51
52
|
logger_1.logger.info(`\nPlease deploy your functions for the change to take effect by running ${clc.bold("firebase deploy --only functions")}\n`);
|
|
52
53
|
});
|