firebase-tools 10.1.1 → 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/bin/firebase.js +1 -1
- package/lib/commands/auth-export.js +26 -25
- package/lib/commands/auth-import.js +88 -78
- package/lib/commands/ext-configure.js +1 -1
- package/lib/commands/ext-dev-init.js +1 -1
- package/lib/commands/ext-dev-publish.js +1 -1
- package/lib/commands/ext-dev-register.js +1 -1
- package/lib/commands/ext-info.js +1 -1
- package/lib/commands/ext-install.js +1 -1
- package/lib/commands/ext-uninstall.js +1 -1
- package/lib/commands/ext-update.js +1 -1
- package/lib/commands/functions-config-clone.js +22 -23
- 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/help.js +12 -12
- package/lib/commands/hosting-channel-create.js +1 -1
- package/lib/commands/hosting-channel-delete.js +2 -2
- package/lib/commands/hosting-channel-deploy.js +1 -1
- package/lib/commands/hosting-clone.js +1 -1
- package/lib/commands/login-ci.js +10 -10
- package/lib/commands/remoteconfig-versions-list.js +6 -1
- 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 +3 -2
- 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/defaultCredentials.js +3 -3
- package/lib/deploy/functions/runtimes/golang/index.js +2 -1
- package/lib/emulator/downloadableEmulators.js +3 -2
- package/lib/emulator/functionsEmulator.js +6 -0
- package/lib/emulator/functionsEmulatorRuntime.js +4 -4
- package/lib/emulator/storage/rules/runtime.js +5 -4
- package/lib/extensions/askUserForConsent.js +1 -1
- package/lib/extensions/askUserForParam.js +1 -1
- package/lib/extensions/billingMigrationHelper.js +1 -1
- package/lib/extensions/changelog.js +1 -1
- package/lib/extensions/displayExtensionInfo.js +1 -1
- package/lib/extensions/extensionsApi.js +58 -112
- package/lib/extensions/extensionsHelper.js +19 -15
- package/lib/extensions/provisioningHelper.js +7 -10
- package/lib/extensions/resolveSource.js +5 -5
- package/lib/extensions/updateHelper.js +1 -1
- package/lib/extensions/warnings.js +1 -1
- package/lib/functionsConfig.js +4 -5
- package/lib/gcp/rules.js +18 -41
- package/lib/projectUtils.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/npm-shrinkwrap.json +1225 -2019
- package/package.json +12 -9
- package/lib/commands/functions-config-legacy.js +0 -45
- package/lib/prepareFirebaseRules.js +0 -58
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.2",
|
|
4
4
|
"description": "Command-Line Interface for Firebase",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@google-cloud/pubsub": "^2.
|
|
87
|
+
"@google-cloud/pubsub": "^2.18.4",
|
|
88
88
|
"abort-controller": "^3.0.0",
|
|
89
89
|
"ajv": "^6.12.6",
|
|
90
90
|
"archiver": "^5.0.0",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"cors": "^2.8.5",
|
|
99
99
|
"cross-env": "^5.1.3",
|
|
100
100
|
"cross-spawn": "^7.0.1",
|
|
101
|
-
"csv-
|
|
101
|
+
"csv-parse": "^5.0.4",
|
|
102
102
|
"dotenv": "^6.1.0",
|
|
103
103
|
"exegesis": "^4.1.0",
|
|
104
104
|
"exegesis-express": "^4.0.0",
|
|
@@ -110,11 +110,10 @@
|
|
|
110
110
|
"google-auth-library": "^7.11.0",
|
|
111
111
|
"inquirer": "^8.2.0",
|
|
112
112
|
"js-yaml": "^3.13.1",
|
|
113
|
-
"JSONStream": "^1.2.1",
|
|
114
113
|
"jsonwebtoken": "^8.5.1",
|
|
115
114
|
"leven": "^3.1.0",
|
|
116
115
|
"lodash": "^4.17.21",
|
|
117
|
-
"marked": "^0.
|
|
116
|
+
"marked": "^4.0.10",
|
|
118
117
|
"marked-terminal": "^3.3.0",
|
|
119
118
|
"mime": "^2.5.2",
|
|
120
119
|
"minimatch": "^3.0.4",
|
|
@@ -128,8 +127,10 @@
|
|
|
128
127
|
"request": "^2.87.0",
|
|
129
128
|
"rimraf": "^3.0.0",
|
|
130
129
|
"semver": "^5.7.1",
|
|
130
|
+
"stream-chain": "^2.2.4",
|
|
131
|
+
"stream-json": "^1.7.3",
|
|
131
132
|
"superstatic": "^7.1.0",
|
|
132
|
-
"tar": "^
|
|
133
|
+
"tar": "^6.1.11",
|
|
133
134
|
"tcp-port-used": "^1.0.1",
|
|
134
135
|
"tmp": "0.0.33",
|
|
135
136
|
"triple-beam": "^1.3.0",
|
|
@@ -164,10 +165,11 @@
|
|
|
164
165
|
"@types/js-yaml": "^3.12.2",
|
|
165
166
|
"@types/jsonwebtoken": "^8.3.8",
|
|
166
167
|
"@types/lodash": "^4.14.149",
|
|
167
|
-
"@types/marked": "^0.
|
|
168
|
+
"@types/marked": "^4.0.1",
|
|
169
|
+
"@types/marked-terminal": "^3.1.3",
|
|
168
170
|
"@types/mocha": "^9.0.0",
|
|
169
171
|
"@types/multer": "^1.4.3",
|
|
170
|
-
"@types/node": "^
|
|
172
|
+
"@types/node": "^12.20.39",
|
|
171
173
|
"@types/node-fetch": "^2.5.7",
|
|
172
174
|
"@types/progress": "^2.0.3",
|
|
173
175
|
"@types/puppeteer": "^5.4.2",
|
|
@@ -176,8 +178,9 @@
|
|
|
176
178
|
"@types/semver": "^6.0.0",
|
|
177
179
|
"@types/sinon": "^9.0.10",
|
|
178
180
|
"@types/sinon-chai": "^3.2.2",
|
|
181
|
+
"@types/stream-json": "^1.7.2",
|
|
179
182
|
"@types/supertest": "^2.0.6",
|
|
180
|
-
"@types/tar": "^
|
|
183
|
+
"@types/tar": "^6.1.1",
|
|
181
184
|
"@types/tcp-port-used": "^1.0.0",
|
|
182
185
|
"@types/tmp": "^0.1.0",
|
|
183
186
|
"@types/triple-beam": "^1.3.0",
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _ = require("lodash");
|
|
3
|
-
var { Command } = require("../command");
|
|
4
|
-
var needProjectId = require("../projectUtils").needProjectId;
|
|
5
|
-
var { requirePermissions } = require("../requirePermissions");
|
|
6
|
-
var runtimeconfig = require("../gcp/runtimeconfig");
|
|
7
|
-
var functionsConfig = require("../functionsConfig");
|
|
8
|
-
const { logger } = require("../logger");
|
|
9
|
-
module.exports = new Command("functions:config:legacy")
|
|
10
|
-
.description("get legacy functions config variables")
|
|
11
|
-
.before(requirePermissions, [
|
|
12
|
-
"runtimeconfig.configs.list",
|
|
13
|
-
"runtimeconfig.configs.get",
|
|
14
|
-
"runtimeconfig.variables.list",
|
|
15
|
-
"runtimeconfig.variables.get",
|
|
16
|
-
])
|
|
17
|
-
.action(function (options) {
|
|
18
|
-
var projectId = needProjectId(options);
|
|
19
|
-
var metaPath = "projects/" + projectId + "/configs/firebase/variables/meta";
|
|
20
|
-
return runtimeconfig.variables
|
|
21
|
-
.get(metaPath)
|
|
22
|
-
.then(function (result) {
|
|
23
|
-
var metaVal = JSON.parse(result.text);
|
|
24
|
-
if (!_.has(metaVal, "version")) {
|
|
25
|
-
logger.info("You do not have any legacy config variables.");
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
var latestVarPath = functionsConfig.idsToVarName(projectId, "firebase", metaVal.version);
|
|
29
|
-
return runtimeconfig.variables.get(latestVarPath);
|
|
30
|
-
})
|
|
31
|
-
.then(function (latest) {
|
|
32
|
-
if (latest !== null) {
|
|
33
|
-
var latestVal = JSON.parse(latest.text);
|
|
34
|
-
logger.info(JSON.stringify(latestVal, null, 2));
|
|
35
|
-
return latestVal;
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
.catch(function (err) {
|
|
39
|
-
if (_.get(err, "context.response.statusCode") === 404) {
|
|
40
|
-
logger.info("You do not have any legacy config variables.");
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
return Promise.reject(err);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var clc = require("cli-color");
|
|
3
|
-
var fs = require("fs");
|
|
4
|
-
var api = require("./api");
|
|
5
|
-
var utils = require("./utils");
|
|
6
|
-
var prepareFirebaseRules = function (component, options, payload) {
|
|
7
|
-
var rulesFileName = component + ".rules";
|
|
8
|
-
var rulesPath = options.config.get(rulesFileName);
|
|
9
|
-
if (rulesPath) {
|
|
10
|
-
rulesPath = options.config.path(rulesPath);
|
|
11
|
-
var src = fs.readFileSync(rulesPath, "utf8");
|
|
12
|
-
utils.logBullet(clc.bold.cyan(component + ":") + " checking rules for compilation errors...");
|
|
13
|
-
return api
|
|
14
|
-
.request("POST", "/v1/projects/" + encodeURIComponent(options.project) + ":test", {
|
|
15
|
-
origin: api.rulesOrigin,
|
|
16
|
-
data: {
|
|
17
|
-
source: {
|
|
18
|
-
files: [
|
|
19
|
-
{
|
|
20
|
-
content: src,
|
|
21
|
-
name: rulesFileName,
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
auth: true,
|
|
27
|
-
})
|
|
28
|
-
.then(function (response) {
|
|
29
|
-
if (response.body && response.body.issues && response.body.issues.length > 0) {
|
|
30
|
-
var add = response.body.issues.length === 1 ? "" : "s";
|
|
31
|
-
var message = "Compilation error" +
|
|
32
|
-
add +
|
|
33
|
-
" in " +
|
|
34
|
-
clc.bold(options.config.get(rulesFileName)) +
|
|
35
|
-
":\n";
|
|
36
|
-
response.body.issues.forEach(function (issue) {
|
|
37
|
-
message +=
|
|
38
|
-
"\n[" +
|
|
39
|
-
issue.severity.substring(0, 1) +
|
|
40
|
-
"] " +
|
|
41
|
-
issue.sourcePosition.line +
|
|
42
|
-
":" +
|
|
43
|
-
issue.sourcePosition.column +
|
|
44
|
-
" - " +
|
|
45
|
-
issue.description;
|
|
46
|
-
});
|
|
47
|
-
return utils.reject(message, { exit: 1 });
|
|
48
|
-
}
|
|
49
|
-
utils.logSuccess(clc.bold.green(component + ":") + " rules file compiled successfully");
|
|
50
|
-
payload[component] = {
|
|
51
|
-
rules: [{ name: options.config.get(rulesFileName), content: src }],
|
|
52
|
-
};
|
|
53
|
-
return Promise.resolve();
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
return Promise.resolve();
|
|
57
|
-
};
|
|
58
|
-
module.exports = prepareFirebaseRules;
|