firebase-tools 10.0.0 → 10.1.2
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 +2 -2
- package/lib/appdistribution/client.js +1 -1
- package/lib/appdistribution/options-parser-util.js +1 -1
- 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 +145 -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/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 +6 -4
- 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 +27 -21
- package/lib/deploy/functions/prompts.js +5 -5
- package/lib/deploy/functions/release/executor.js +4 -1
- package/lib/deploy/functions/release/fabricator.js +5 -5
- 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 +4 -3
- package/lib/deploy/hosting/deploy.js +7 -7
- 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 +10 -9
- package/lib/emulator/emulatorLogger.js +1 -1
- package/lib/emulator/functionsEmulator.js +107 -74
- 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 +69 -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/cloudmonitoring.js +74 -0
- package/lib/gcp/cloudscheduler.js +1 -1
- package/lib/gcp/iam.js +2 -2
- package/lib/gcp/resourceManager.js +2 -2
- package/lib/gcp/rules.js +18 -41
- package/lib/gcp/secretManager.js +3 -2
- 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 +24095 -0
- package/package.json +33 -30
- package/templates/init/hosting/index.html +1 -1
- package/CHANGELOG.md +0 -5
- package/lib/commands/functions-config-legacy.js +0 -45
- package/lib/prepareFirebaseRules.js +0 -58
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const csv_parse_1 = require("csv-parse");
|
|
4
|
+
const Chain = require("stream-chain");
|
|
5
|
+
const clc = require("cli-color");
|
|
6
|
+
const fs = require("fs-extra");
|
|
7
|
+
const Pick = require("stream-json/filters/Pick");
|
|
8
|
+
const StreamArray = require("stream-json/streamers/StreamArray");
|
|
9
|
+
const command_1 = require("../command");
|
|
10
|
+
const error_1 = require("../error");
|
|
11
|
+
const logger_1 = require("../logger");
|
|
12
|
+
const projectUtils_1 = require("../projectUtils");
|
|
13
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
14
|
+
const accountImporter = require("../accountImporter");
|
|
15
|
+
const MAX_BATCH_SIZE = 1000;
|
|
16
|
+
const validateOptions = accountImporter.validateOptions;
|
|
17
|
+
const validateUserJson = accountImporter.validateUserJson;
|
|
18
|
+
const transArrayToUser = accountImporter.transArrayToUser;
|
|
19
|
+
const serialImportUsers = accountImporter.serialImportUsers;
|
|
20
|
+
module.exports = new command_1.Command("auth:import [dataFile]")
|
|
19
21
|
.description("import users into your Firebase project from a data file(.csv or .json)")
|
|
20
22
|
.option("--hash-algo <hashAlgo>", "specify the hash algorithm used in password for these accounts")
|
|
21
23
|
.option("--hash-key <hashKey>", "specify the key used in hash algorithm")
|
|
@@ -27,81 +29,89 @@ module.exports = new Command("auth:import [dataFile]")
|
|
|
27
29
|
.option("--dk-len <dkLen>", "specify derived key length for standard scrypt.")
|
|
28
30
|
.option("--hash-input-order <hashInputOrder>", "specify the order of password and salt. Possible values are SALT_FIRST and PASSWORD_FIRST. " +
|
|
29
31
|
"MD5, SHA1, SHA256, SHA512, HMAC_MD5, HMAC_SHA1, HMAC_SHA256, HMAC_SHA512 support this flag.")
|
|
30
|
-
.before(requirePermissions, ["firebaseauth.users.create", "firebaseauth.users.update"])
|
|
31
|
-
.action(
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
.before(requirePermissions_1.requirePermissions, ["firebaseauth.users.create", "firebaseauth.users.update"])
|
|
33
|
+
.action(async (dataFile, options) => {
|
|
34
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
35
|
+
const checkRes = validateOptions(options);
|
|
34
36
|
if (!checkRes.valid) {
|
|
35
37
|
return checkRes;
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
if (!
|
|
39
|
-
|
|
39
|
+
const hashOptions = checkRes;
|
|
40
|
+
if (!dataFile.endsWith(".csv") && !dataFile.endsWith(".json")) {
|
|
41
|
+
throw new error_1.FirebaseError("Data file must end with .csv or .json");
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
logger.info(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
parser =
|
|
43
|
+
const stats = await fs.stat(dataFile);
|
|
44
|
+
const fileSizeInBytes = stats.size;
|
|
45
|
+
logger_1.logger.info(`Processing ${clc.bold(dataFile)} (${fileSizeInBytes} bytes)`);
|
|
46
|
+
const batches = [];
|
|
47
|
+
let currentBatch = [];
|
|
48
|
+
let counter = 0;
|
|
49
|
+
let userListArr = [];
|
|
50
|
+
const inStream = fs.createReadStream(dataFile);
|
|
51
|
+
if (dataFile.endsWith(".csv")) {
|
|
52
|
+
userListArr = await new Promise((resolve, reject) => {
|
|
53
|
+
const parser = (0, csv_parse_1.parse)();
|
|
52
54
|
parser
|
|
53
|
-
.on("
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
.on("readable", () => {
|
|
56
|
+
let record = [];
|
|
57
|
+
while ((record = parser.read()) !== null) {
|
|
58
|
+
counter++;
|
|
59
|
+
const trimmed = record.map((s) => {
|
|
60
|
+
const str = s.trim().replace(/^["|'](.*)["|']$/, "$1");
|
|
61
|
+
return str === "" ? undefined : str;
|
|
62
|
+
});
|
|
63
|
+
const user = transArrayToUser(trimmed);
|
|
64
|
+
const err = user.error;
|
|
65
|
+
if (err) {
|
|
66
|
+
return reject(new error_1.FirebaseError(`Line ${counter} (${record.join(",")}) has invalid data format: ${err}`));
|
|
67
|
+
}
|
|
68
|
+
currentBatch.push(user);
|
|
69
|
+
if (currentBatch.length === MAX_BATCH_SIZE) {
|
|
70
|
+
batches.push(currentBatch);
|
|
71
|
+
currentBatch = [];
|
|
72
|
+
}
|
|
66
73
|
}
|
|
67
74
|
})
|
|
68
|
-
.on("end",
|
|
75
|
+
.on("end", () => {
|
|
69
76
|
if (currentBatch.length) {
|
|
70
77
|
batches.push(currentBatch);
|
|
71
78
|
}
|
|
72
|
-
|
|
79
|
+
resolve(batches);
|
|
73
80
|
});
|
|
74
81
|
inStream.pipe(parser);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
userListArr = await new Promise((resolve, reject) => {
|
|
86
|
+
const pipeline = new Chain([
|
|
87
|
+
Pick.withParser({ filter: /^users$/ }),
|
|
88
|
+
StreamArray.streamArray(),
|
|
89
|
+
({ value }) => {
|
|
90
|
+
counter++;
|
|
91
|
+
const user = validateUserJson(value);
|
|
92
|
+
const err = user.error;
|
|
93
|
+
if (err) {
|
|
94
|
+
throw new error_1.FirebaseError(`Validation Error: ${err}`);
|
|
95
|
+
}
|
|
96
|
+
currentBatch.push(user);
|
|
97
|
+
if (currentBatch.length === MAX_BATCH_SIZE) {
|
|
98
|
+
batches.push(currentBatch);
|
|
99
|
+
currentBatch = [];
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
]);
|
|
103
|
+
pipeline.once("error", reject);
|
|
104
|
+
pipeline.on("finish", () => {
|
|
92
105
|
if (currentBatch.length) {
|
|
93
106
|
batches.push(currentBatch);
|
|
94
107
|
}
|
|
95
|
-
|
|
108
|
+
resolve(batches);
|
|
96
109
|
});
|
|
97
|
-
inStream.pipe(
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}, function (error) {
|
|
105
|
-
return utils.reject(error, { exit: 1 });
|
|
106
|
-
});
|
|
110
|
+
inStream.pipe(pipeline);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
logger_1.logger.debug(`Preparing to import ${counter} user records in ${userListArr.length} batches.`);
|
|
114
|
+
if (userListArr.length) {
|
|
115
|
+
return serialImportUsers(projectId, hashOptions, userListArr, 0);
|
|
116
|
+
}
|
|
107
117
|
});
|
|
@@ -56,7 +56,7 @@ exports.default = new command_1.Command("database:get <path>")
|
|
|
56
56
|
if (!path.startsWith("/")) {
|
|
57
57
|
return utils.reject("Path must begin with /", { exit: 1 });
|
|
58
58
|
}
|
|
59
|
-
const dbHost = api_1.realtimeOriginOrEmulatorOrCustomUrl(options.instanceDetails.databaseUrl);
|
|
59
|
+
const dbHost = (0, api_1.realtimeOriginOrEmulatorOrCustomUrl)(options.instanceDetails.databaseUrl);
|
|
60
60
|
const dbUrl = utils.getDatabaseUrl(dbHost, options.instance, path + ".json");
|
|
61
61
|
const query = {};
|
|
62
62
|
if (options.shallow) {
|
|
@@ -16,13 +16,13 @@ exports.default = new command_1.Command("database:instances:create <instanceName
|
|
|
16
16
|
.before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.create"])
|
|
17
17
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.DATABASE)
|
|
18
18
|
.action(async (instanceName, options) => {
|
|
19
|
-
const projectId = projectUtils_1.needProjectId(options);
|
|
20
|
-
const defaultDatabaseInstance = await getDefaultDatabaseInstance_1.getDefaultDatabaseInstance({ project: projectId });
|
|
19
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
20
|
+
const defaultDatabaseInstance = await (0, getDefaultDatabaseInstance_1.getDefaultDatabaseInstance)({ project: projectId });
|
|
21
21
|
if (defaultDatabaseInstance === "") {
|
|
22
22
|
throw new error_1.FirebaseError(requireDatabaseInstance_1.MISSING_DEFAULT_INSTANCE_ERROR_MESSAGE);
|
|
23
23
|
}
|
|
24
|
-
const location = database_1.parseDatabaseLocation(options.location, database_1.DatabaseLocation.US_CENTRAL1);
|
|
25
|
-
const instance = await database_1.createInstance(projectId, instanceName, location, database_1.DatabaseInstanceType.USER_DATABASE);
|
|
24
|
+
const location = (0, database_1.parseDatabaseLocation)(options.location, database_1.DatabaseLocation.US_CENTRAL1);
|
|
25
|
+
const instance = await (0, database_1.createInstance)(projectId, instanceName, location, database_1.DatabaseInstanceType.USER_DATABASE);
|
|
26
26
|
logger_1.logger.info(`created database instance ${instance.name}`);
|
|
27
27
|
return instance;
|
|
28
28
|
});
|
|
@@ -37,14 +37,14 @@ let cmd = new command_1.Command("database:instances:list")
|
|
|
37
37
|
.before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.list"])
|
|
38
38
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.DATABASE)
|
|
39
39
|
.action(async (options) => {
|
|
40
|
-
const location = database_1.parseDatabaseLocation(options.location, database_1.DatabaseLocation.ANY);
|
|
40
|
+
const location = (0, database_1.parseDatabaseLocation)(options.location, database_1.DatabaseLocation.ANY);
|
|
41
41
|
const spinner = ora("Preparing the list of your Firebase Realtime Database instances" +
|
|
42
42
|
`${location === database_1.DatabaseLocation.ANY ? "" : ` for location: ${location}`}`).start();
|
|
43
43
|
let instances;
|
|
44
44
|
if (previews_1.previews.rtdbmanagement) {
|
|
45
|
-
const projectId = projectUtils_2.needProjectId(options);
|
|
45
|
+
const projectId = (0, projectUtils_2.needProjectId)(options);
|
|
46
46
|
try {
|
|
47
|
-
instances = await database_1.listDatabaseInstances(projectId, location);
|
|
47
|
+
instances = await (0, database_1.listDatabaseInstances)(projectId, location);
|
|
48
48
|
}
|
|
49
49
|
catch (err) {
|
|
50
50
|
spinner.fail();
|
|
@@ -55,7 +55,7 @@ let cmd = new command_1.Command("database:instances:list")
|
|
|
55
55
|
logInstancesCount(instances.length);
|
|
56
56
|
return instances;
|
|
57
57
|
}
|
|
58
|
-
const projectNumber = await projectUtils_1.needProjectNumber(options);
|
|
58
|
+
const projectNumber = await (0, projectUtils_1.needProjectNumber)(options);
|
|
59
59
|
try {
|
|
60
60
|
instances = await firedata.listDatabaseInstances(projectNumber);
|
|
61
61
|
}
|
|
@@ -28,7 +28,7 @@ exports.default = new command_1.Command("database:push <path> [infile]")
|
|
|
28
28
|
throw new error_1.FirebaseError("Path must begin with /");
|
|
29
29
|
}
|
|
30
30
|
const inStream = utils.stringToStream(options.data) || (infile ? fs.createReadStream(infile) : process.stdin);
|
|
31
|
-
const origin = api_1.realtimeOriginOrEmulatorOrCustomUrl(options.instanceDetails.databaseUrl);
|
|
31
|
+
const origin = (0, api_1.realtimeOriginOrEmulatorOrCustomUrl)(options.instanceDetails.databaseUrl);
|
|
32
32
|
const u = new url_1.URL(utils.getDatabaseUrl(origin, options.instance, path + ".json"));
|
|
33
33
|
if (!infile && !options.data) {
|
|
34
34
|
utils.explainStdin();
|
|
@@ -24,9 +24,9 @@ module.exports = new command_1.Command("database:remove <path>")
|
|
|
24
24
|
if (!_.startsWith(path, "/")) {
|
|
25
25
|
return utils.reject("Path must begin with /", { exit: 1 });
|
|
26
26
|
}
|
|
27
|
-
const origin = api_1.realtimeOriginOrEmulatorOrCustomUrl(options.instanceDetails.databaseUrl);
|
|
27
|
+
const origin = (0, api_1.realtimeOriginOrEmulatorOrCustomUrl)(options.instanceDetails.databaseUrl);
|
|
28
28
|
const databaseUrl = utils.getDatabaseUrl(origin, options.instance, path);
|
|
29
|
-
const confirm = await prompt_1.promptOnce({
|
|
29
|
+
const confirm = await (0, prompt_1.promptOnce)({
|
|
30
30
|
type: "confirm",
|
|
31
31
|
name: "force",
|
|
32
32
|
default: false,
|
|
@@ -29,10 +29,10 @@ exports.default = new command_1.Command("database:set <path> [infile]")
|
|
|
29
29
|
if (!_.startsWith(path, "/")) {
|
|
30
30
|
throw new error_1.FirebaseError("Path must begin with /");
|
|
31
31
|
}
|
|
32
|
-
const origin = api_1.realtimeOriginOrEmulatorOrCustomUrl(options.instanceDetails.databaseUrl);
|
|
32
|
+
const origin = (0, api_1.realtimeOriginOrEmulatorOrCustomUrl)(options.instanceDetails.databaseUrl);
|
|
33
33
|
const dbPath = utils.getDatabaseUrl(origin, options.instance, path);
|
|
34
34
|
const dbJsonURL = new url_1.URL(utils.getDatabaseUrl(origin, options.instance, path + ".json"));
|
|
35
|
-
const confirm = await prompt_1.promptOnce({
|
|
35
|
+
const confirm = await (0, prompt_1.promptOnce)({
|
|
36
36
|
type: "confirm",
|
|
37
37
|
name: "force",
|
|
38
38
|
default: false,
|
|
@@ -24,7 +24,7 @@ exports.default = new command_1.Command("database:settings:get <path>")
|
|
|
24
24
|
if (!settings_1.DATABASE_SETTINGS.has(path)) {
|
|
25
25
|
throw new error_1.FirebaseError(settings_1.INVALID_PATH_ERROR, { exit: 1 });
|
|
26
26
|
}
|
|
27
|
-
const u = new url_1.URL(utils.getDatabaseUrl(api_1.realtimeOriginOrCustomUrl(options.instanceDetails.databaseUrl), options.instance, `/.settings/${path}.json`));
|
|
27
|
+
const u = new url_1.URL(utils.getDatabaseUrl((0, api_1.realtimeOriginOrCustomUrl)(options.instanceDetails.databaseUrl), options.instance, `/.settings/${path}.json`));
|
|
28
28
|
const c = new apiv2_1.Client({ urlPrefix: u.origin, auth: true });
|
|
29
29
|
let res;
|
|
30
30
|
try {
|
|
@@ -29,7 +29,7 @@ exports.default = new command_1.Command("database:settings:set <path> <value>")
|
|
|
29
29
|
if (parsedValue === undefined) {
|
|
30
30
|
return utils.reject(setting.parseInputErrorMessge, { exit: 1 });
|
|
31
31
|
}
|
|
32
|
-
const u = new url_1.URL(utils.getDatabaseUrl(api_1.realtimeOriginOrCustomUrl(options.instanceDetails.databaseUrl), options.instance, `/.settings/${path}.json`));
|
|
32
|
+
const u = new url_1.URL(utils.getDatabaseUrl((0, api_1.realtimeOriginOrCustomUrl)(options.instanceDetails.databaseUrl), options.instance, `/.settings/${path}.json`));
|
|
33
33
|
const c = new apiv2_1.Client({ urlPrefix: u.origin, auth: true });
|
|
34
34
|
try {
|
|
35
35
|
await c.put(u.pathname, JSON.stringify(parsedValue));
|
|
@@ -28,9 +28,9 @@ exports.default = new command_1.Command("database:update <path> [infile]")
|
|
|
28
28
|
if (!path.startsWith("/")) {
|
|
29
29
|
throw new error_1.FirebaseError("Path must begin with /");
|
|
30
30
|
}
|
|
31
|
-
const origin = api_1.realtimeOriginOrEmulatorOrCustomUrl(options.instanceDetails.databaseUrl);
|
|
31
|
+
const origin = (0, api_1.realtimeOriginOrEmulatorOrCustomUrl)(options.instanceDetails.databaseUrl);
|
|
32
32
|
const url = utils.getDatabaseUrl(origin, options.instance, path);
|
|
33
|
-
const confirmed = await prompt_1.promptOnce({
|
|
33
|
+
const confirmed = await (0, prompt_1.promptOnce)({
|
|
34
34
|
type: "confirm",
|
|
35
35
|
name: "force",
|
|
36
36
|
default: false,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const _ = require("lodash");
|
|
4
4
|
const clc = require("cli-color");
|
|
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");
|
|
@@ -28,9 +28,9 @@ exports.default = new command_1.Command("ext:configure <extensionInstanceId>")
|
|
|
28
28
|
])
|
|
29
29
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extMinVersion")
|
|
30
30
|
.action(async (instanceId, options) => {
|
|
31
|
-
const spinner = ora
|
|
31
|
+
const spinner = ora(`Configuring ${clc.bold(instanceId)}. This usually takes 3 to 5 minutes...`);
|
|
32
32
|
try {
|
|
33
|
-
const projectId = projectUtils_1.needProjectId(options);
|
|
33
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
34
34
|
let existingInstance;
|
|
35
35
|
try {
|
|
36
36
|
existingInstance = await extensionsApi.getInstance(projectId, instanceId);
|
|
@@ -25,9 +25,9 @@ exports.default = new command_1.Command("ext:dev:deprecate <extensionRef> <versi
|
|
|
25
25
|
if (!publisherId || !extensionId) {
|
|
26
26
|
throw new error_1.FirebaseError(`Error parsing publisher ID and extension ID from extension reference '${clc.bold(extensionRef)}'. Please use the format '${clc.bold("<publisherId>/<extensionId>")}'.`);
|
|
27
27
|
}
|
|
28
|
-
const { comparator, targetSemVer } = versionHelper_1.parseVersionPredicate(versionPredicate);
|
|
28
|
+
const { comparator, targetSemVer } = (0, versionHelper_1.parseVersionPredicate)(versionPredicate);
|
|
29
29
|
const filter = `id${comparator}"${targetSemVer}"`;
|
|
30
|
-
const extensionVersions = await extensionsApi_1.listExtensionVersions(extensionRef, filter);
|
|
30
|
+
const extensionVersions = await (0, extensionsApi_1.listExtensionVersions)(extensionRef, filter);
|
|
31
31
|
const filteredExtensionVersions = extensionVersions
|
|
32
32
|
.sort((ev1, ev2) => {
|
|
33
33
|
return -semver.compare(ev1.spec.version, ev2.spec.version);
|
|
@@ -43,7 +43,7 @@ exports.default = new command_1.Command("ext:dev:deprecate <extensionRef> <versi
|
|
|
43
43
|
if (filteredExtensionVersions.length > 0) {
|
|
44
44
|
if (!options.force) {
|
|
45
45
|
const confirmMessage = "You are about to deprecate these extension version(s). Do you wish to continue?";
|
|
46
|
-
const consent = await prompt_1.promptOnce({
|
|
46
|
+
const consent = await (0, prompt_1.promptOnce)({
|
|
47
47
|
type: "confirm",
|
|
48
48
|
message: confirmMessage,
|
|
49
49
|
default: false,
|
|
@@ -57,7 +57,7 @@ exports.default = new command_1.Command("ext:dev:deprecate <extensionRef> <versi
|
|
|
57
57
|
throw new error_1.FirebaseError("No extension versions matched the version predicate.");
|
|
58
58
|
}
|
|
59
59
|
await utils.allSettled(filteredExtensionVersions.map(async (extensionVersion) => {
|
|
60
|
-
await extensionsApi_1.deprecateExtensionVersion(extensionVersion.ref, options.deprecationMessage);
|
|
60
|
+
await (0, extensionsApi_1.deprecateExtensionVersion)(extensionVersion.ref, options.deprecationMessage);
|
|
61
61
|
}));
|
|
62
62
|
utils.logLabeledSuccess(extensionsHelper_1.logPrefix, "successfully deprecated extension version(s).");
|
|
63
63
|
});
|
|
@@ -26,17 +26,17 @@ module.exports = new command_1.Command("ext:dev:delete <extensionRef>")
|
|
|
26
26
|
"it will continue to run and will appear as unpublished when " +
|
|
27
27
|
"listed in the Firebase console or Firebase CLI.");
|
|
28
28
|
utils.logLabeledWarning("This is a permanent action", `Once deleted, you may never use the extension name '${clc.bold(extensionId)}' again.`);
|
|
29
|
-
await extensionsApi_1.getExtension(extensionRef);
|
|
29
|
+
await (0, extensionsApi_1.getExtension)(extensionRef);
|
|
30
30
|
const consent = await confirmDelete(publisherId, extensionId);
|
|
31
31
|
if (!consent) {
|
|
32
32
|
throw new error_1.FirebaseError("deletion cancelled.");
|
|
33
33
|
}
|
|
34
|
-
await extensionsApi_1.deleteExtension(extensionRef);
|
|
34
|
+
await (0, extensionsApi_1.deleteExtension)(extensionRef);
|
|
35
35
|
utils.logLabeledSuccess(extensionsHelper_1.logPrefix, "successfully deleted all versions of this extension.");
|
|
36
36
|
});
|
|
37
37
|
async function confirmDelete(publisherId, extensionId) {
|
|
38
38
|
const message = `You are about to delete ALL versions of ${clc.green(`${publisherId}/${extensionId}`)}.\nDo you wish to continue? `;
|
|
39
|
-
return prompt_1.promptOnce({
|
|
39
|
+
return (0, prompt_1.promptOnce)({
|
|
40
40
|
type: "confirm",
|
|
41
41
|
message,
|
|
42
42
|
default: false,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const path = require("path");
|
|
5
|
-
const marked = require("marked");
|
|
5
|
+
const { marked } = require("marked");
|
|
6
6
|
const TerminalRenderer = require("marked-terminal");
|
|
7
7
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
8
8
|
const command_1 = require("../command");
|
|
@@ -32,7 +32,7 @@ async function typescriptSelected(config) {
|
|
|
32
32
|
const indexTemplate = fs.readFileSync(path.join(TEMPLATE_ROOT, "typescript", "index.ts"), "utf8");
|
|
33
33
|
const gitignoreTemplate = fs.readFileSync(path.join(TEMPLATE_ROOT, "typescript", "_gitignore"), "utf8");
|
|
34
34
|
const eslintTemplate = fs.readFileSync(path.join(FUNCTIONS_ROOT, "typescript", "_eslintrc"), "utf8");
|
|
35
|
-
const lint = await prompt_1.promptOnce({
|
|
35
|
+
const lint = await (0, prompt_1.promptOnce)({
|
|
36
36
|
name: "lint",
|
|
37
37
|
type: "confirm",
|
|
38
38
|
message: "Do you want to use ESLint to catch probable bugs and enforce style?",
|
|
@@ -63,7 +63,7 @@ async function javascriptSelected(config) {
|
|
|
63
63
|
const packageNoLintingTemplate = fs.readFileSync(path.join(TEMPLATE_ROOT, "javascript", "package.nolint.json"), "utf8");
|
|
64
64
|
const gitignoreTemplate = fs.readFileSync(path.join(TEMPLATE_ROOT, "javascript", "_gitignore"), "utf8");
|
|
65
65
|
const eslintTemplate = fs.readFileSync(path.join(FUNCTIONS_ROOT, "javascript", "_eslintrc"), "utf8");
|
|
66
|
-
const lint = await prompt_1.promptOnce({
|
|
66
|
+
const lint = await (0, prompt_1.promptOnce)({
|
|
67
67
|
name: "lint",
|
|
68
68
|
type: "confirm",
|
|
69
69
|
message: "Do you want to use ESLint to catch probable bugs and enforce style?",
|
|
@@ -91,7 +91,7 @@ exports.default = new command_1.Command("ext:dev:init")
|
|
|
91
91
|
const cwd = options.cwd || process.cwd();
|
|
92
92
|
const config = new config_1.Config({}, { projectDir: cwd, cwd: cwd });
|
|
93
93
|
try {
|
|
94
|
-
const lang = await prompt_1.promptOnce({
|
|
94
|
+
const lang = await (0, prompt_1.promptOnce)({
|
|
95
95
|
type: "list",
|
|
96
96
|
name: "language",
|
|
97
97
|
message: "In which language do you want to write the Cloud Functions for your extension?",
|
|
@@ -17,7 +17,7 @@ exports.default = new command_1.Command("ext:dev:list <publisherId>")
|
|
|
17
17
|
.action(async (publisherId) => {
|
|
18
18
|
let extensions;
|
|
19
19
|
try {
|
|
20
|
-
extensions = await extensionsApi_1.listExtensions(publisherId);
|
|
20
|
+
extensions = await (0, extensionsApi_1.listExtensions)(publisherId);
|
|
21
21
|
}
|
|
22
22
|
catch (err) {
|
|
23
23
|
throw new error_1.FirebaseError(err);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const clc = require("cli-color");
|
|
4
|
-
const marked = require("marked");
|
|
4
|
+
const { marked } = require("marked");
|
|
5
5
|
const TerminalRenderer = require("marked-terminal");
|
|
6
6
|
const command_1 = require("../command");
|
|
7
7
|
const extensionsHelper_1 = require("../extensions/extensionsHelper");
|
|
@@ -29,8 +29,8 @@ exports.default = new command_1.Command("ext:dev:publish <extensionRef>")
|
|
|
29
29
|
if (!publisherId || !extensionId) {
|
|
30
30
|
throw new error_1.FirebaseError(`Error parsing publisher ID and extension ID from extension reference '${clc.bold(extensionRef)}'. Please use the format '${clc.bold("<publisherId>/<extensionId>")}'.`);
|
|
31
31
|
}
|
|
32
|
-
const extensionYamlDirectory = localHelper_1.findExtensionYaml(process.cwd());
|
|
33
|
-
const res = await extensionsHelper_1.publishExtensionVersionFromLocalSource({
|
|
32
|
+
const extensionYamlDirectory = (0, localHelper_1.findExtensionYaml)(process.cwd());
|
|
33
|
+
const res = await (0, extensionsHelper_1.publishExtensionVersionFromLocalSource)({
|
|
34
34
|
publisherId,
|
|
35
35
|
extensionId,
|
|
36
36
|
rootDirectory: extensionYamlDirectory,
|
|
@@ -38,7 +38,7 @@ exports.default = new command_1.Command("ext:dev:publish <extensionRef>")
|
|
|
38
38
|
force: options.force,
|
|
39
39
|
});
|
|
40
40
|
if (res) {
|
|
41
|
-
utils.logLabeledBullet(extensionsHelper_1.logPrefix, marked(`[Install Link](${publishHelpers_1.consoleInstallLink(res.ref)})`));
|
|
41
|
+
utils.logLabeledBullet(extensionsHelper_1.logPrefix, marked(`[Install Link](${(0, publishHelpers_1.consoleInstallLink)(res.ref)})`));
|
|
42
42
|
}
|
|
43
43
|
return res;
|
|
44
44
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const clc = require("cli-color");
|
|
4
|
-
const marked = require("marked");
|
|
4
|
+
const { marked } = require("marked");
|
|
5
5
|
const command_1 = require("../command");
|
|
6
6
|
const extensionsApi_1 = require("../extensions/extensionsApi");
|
|
7
7
|
const projectUtils_1 = require("../projectUtils");
|
|
@@ -16,20 +16,20 @@ exports.default = new command_1.Command("ext:dev:register")
|
|
|
16
16
|
.before(requirePermissions_1.requirePermissions, ["firebaseextensions.sources.create"])
|
|
17
17
|
.before(extensionsHelper_1.ensureExtensionsApiEnabled)
|
|
18
18
|
.action(async (options) => {
|
|
19
|
-
await askUserForConsent_1.promptForPublisherTOS();
|
|
20
|
-
const projectId = projectUtils_1.needProjectId(options);
|
|
19
|
+
await (0, askUserForConsent_1.promptForPublisherTOS)();
|
|
20
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
21
21
|
const msg = "What would you like to register as your publisher ID? " +
|
|
22
22
|
"This value identifies you in Firebase's registry of extensions as the author of your extensions. " +
|
|
23
23
|
"Examples: my-company-name, MyGitHubUsername.\n\n" +
|
|
24
24
|
"You can only do this once for each project.";
|
|
25
|
-
const publisherId = await prompt_1.promptOnce({
|
|
25
|
+
const publisherId = await (0, prompt_1.promptOnce)({
|
|
26
26
|
name: "publisherId",
|
|
27
27
|
type: "input",
|
|
28
28
|
message: msg,
|
|
29
29
|
default: projectId,
|
|
30
30
|
});
|
|
31
31
|
try {
|
|
32
|
-
await extensionsApi_1.registerPublisherProfile(projectId, publisherId);
|
|
32
|
+
await (0, extensionsApi_1.registerPublisherProfile)(projectId, publisherId);
|
|
33
33
|
}
|
|
34
34
|
catch (err) {
|
|
35
35
|
if (err.status === 409) {
|
|
@@ -40,7 +40,7 @@ exports.default = new command_1.Command("ext:dev:register")
|
|
|
40
40
|
` Try again with a unique publisher ID or a new project. If your business’s name has been registered to another project, contact Firebase support ${marked("(https://firebase.google.com/support/troubleshooter/contact).")}`;
|
|
41
41
|
throw new error_1.FirebaseError(error, { exit: 1 });
|
|
42
42
|
}
|
|
43
|
-
throw new error_1.FirebaseError(`Failed to register publisher ID ${clc.bold(publisherId)} for project ${clc.bold(projectId)}: ${err.message}
|
|
43
|
+
throw new error_1.FirebaseError(`Failed to register publisher ID ${clc.bold(publisherId)} for project ${clc.bold(projectId)}: ${err.message}`);
|
|
44
44
|
}
|
|
45
45
|
return utils.logLabeledSuccess(extensionsHelper_1.logPrefix, `Publisher ID '${clc.bold(publisherId)}' has been registered to project ${clc.bold(projectId)}`);
|
|
46
46
|
});
|
|
@@ -23,9 +23,9 @@ exports.default = new command_1.Command("ext:dev:undeprecate <extensionRef> <ver
|
|
|
23
23
|
if (!publisherId || !extensionId) {
|
|
24
24
|
throw new error_1.FirebaseError(`Error parsing publisher ID and extension ID from extension reference '${clc.bold(extensionRef)}'. Please use the format '${clc.bold("<publisherId>/<extensionId>")}'.`);
|
|
25
25
|
}
|
|
26
|
-
const { comparator, targetSemVer } = versionHelper_1.parseVersionPredicate(versionPredicate);
|
|
26
|
+
const { comparator, targetSemVer } = (0, versionHelper_1.parseVersionPredicate)(versionPredicate);
|
|
27
27
|
const filter = `id${comparator}"${targetSemVer}"`;
|
|
28
|
-
const extensionVersions = await extensionsApi_1.listExtensionVersions(extensionRef, filter);
|
|
28
|
+
const extensionVersions = await (0, extensionsApi_1.listExtensionVersions)(extensionRef, filter);
|
|
29
29
|
extensionVersions
|
|
30
30
|
.sort((ev1, ev2) => {
|
|
31
31
|
return -semver.compare(ev1.spec.version, ev2.spec.version);
|
|
@@ -36,7 +36,7 @@ exports.default = new command_1.Command("ext:dev:undeprecate <extensionRef> <ver
|
|
|
36
36
|
if (extensionVersions.length > 0) {
|
|
37
37
|
if (!options.force) {
|
|
38
38
|
const confirmMessage = "You are about to undeprecate these extension version(s). Do you wish to continue?";
|
|
39
|
-
const consent = await prompt_1.promptOnce({
|
|
39
|
+
const consent = await (0, prompt_1.promptOnce)({
|
|
40
40
|
type: "confirm",
|
|
41
41
|
message: confirmMessage,
|
|
42
42
|
default: false,
|
|
@@ -50,7 +50,7 @@ exports.default = new command_1.Command("ext:dev:undeprecate <extensionRef> <ver
|
|
|
50
50
|
throw new error_1.FirebaseError("No extension versions matched the version predicate.");
|
|
51
51
|
}
|
|
52
52
|
await utils.allSettled(extensionVersions.map(async (extensionVersion) => {
|
|
53
|
-
await extensionsApi_1.undeprecateExtensionVersion(extensionVersion.ref);
|
|
53
|
+
await (0, extensionsApi_1.undeprecateExtensionVersion)(extensionVersion.ref);
|
|
54
54
|
}));
|
|
55
55
|
utils.logLabeledSuccess(extensionsHelper_1.logPrefix, "successfully undeprecated extension version(s).");
|
|
56
56
|
});
|
|
@@ -24,12 +24,12 @@ module.exports = new command_1.Command("ext:dev:unpublish <extensionRef>")
|
|
|
24
24
|
if (version) {
|
|
25
25
|
throw new error_1.FirebaseError(`Unpublishing a single version is not currently supported. You can only unpublish ${clc.bold("ALL versions")} of an extension. To unpublish all versions, please remove the version from the reference.`);
|
|
26
26
|
}
|
|
27
|
-
await extensionsApi_1.getExtension(extensionRef);
|
|
27
|
+
await (0, extensionsApi_1.getExtension)(extensionRef);
|
|
28
28
|
const consent = await comfirmUnpublish(publisherId, extensionId, options);
|
|
29
29
|
if (!consent) {
|
|
30
30
|
throw new error_1.FirebaseError("unpublishing cancelled.");
|
|
31
31
|
}
|
|
32
|
-
await extensionsApi_1.unpublishExtension(extensionRef);
|
|
32
|
+
await (0, extensionsApi_1.unpublishExtension)(extensionRef);
|
|
33
33
|
utils.logLabeledSuccess(extensionsHelper_1.logPrefix, "successfully unpublished all versions of this extension.");
|
|
34
34
|
});
|
|
35
35
|
async function comfirmUnpublish(publisherId, extensionId, options) {
|
|
@@ -40,7 +40,7 @@ async function comfirmUnpublish(publisherId, extensionId, options) {
|
|
|
40
40
|
return true;
|
|
41
41
|
}
|
|
42
42
|
const message = `You are about to unpublish ALL versions of ${clc.green(`${publisherId}/${extensionId}`)}.\nDo you wish to continue? `;
|
|
43
|
-
return prompt_1.promptOnce({
|
|
43
|
+
return (0, prompt_1.promptOnce)({
|
|
44
44
|
type: "confirm",
|
|
45
45
|
message,
|
|
46
46
|
default: false,
|