firebase-tools 10.1.1 → 10.1.5
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/apiv2.js +92 -48
- package/lib/archiveDirectory.js +63 -73
- 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-dev-usage.js +3 -8
- 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/database/metadata.js +16 -24
- package/lib/defaultCredentials.js +3 -3
- package/lib/deploy/functions/backend.js +3 -1
- package/lib/deploy/functions/prepare.js +2 -2
- package/lib/deploy/functions/release/fabricator.js +4 -1
- package/lib/deploy/functions/runtimes/golang/index.js +2 -1
- package/lib/deploy/functions/validate.js +28 -1
- package/lib/deploy/hosting/convertConfig.js +45 -24
- package/lib/deploy/hosting/prepare.js +1 -1
- package/lib/emulator/downloadableEmulators.js +3 -2
- package/lib/emulator/functionsEmulator.js +9 -1
- package/lib/emulator/functionsEmulatorRuntime.js +4 -4
- package/lib/emulator/storage/apis/gcloud.js +2 -2
- package/lib/emulator/storage/files.js +8 -3
- 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 +57 -112
- package/lib/extensions/extensionsHelper.js +20 -32
- package/lib/extensions/provisioningHelper.js +7 -10
- package/lib/extensions/resolveSource.js +5 -57
- package/lib/extensions/updateHelper.js +1 -15
- package/lib/extensions/utils.js +4 -2
- package/lib/extensions/warnings.js +1 -1
- package/lib/functionsConfig.js +4 -5
- package/lib/gcp/cloudbilling.js +8 -19
- package/lib/gcp/cloudfunctions.js +22 -46
- package/lib/gcp/cloudlogging.js +8 -11
- package/lib/gcp/cloudmonitoring.js +8 -5
- package/lib/gcp/cloudscheduler.js +7 -18
- package/lib/gcp/firedata.js +5 -4
- package/lib/gcp/firestore.js +5 -5
- package/lib/gcp/iam.js +18 -33
- package/lib/gcp/resourceManager.js +8 -13
- package/lib/gcp/rules.js +18 -41
- package/lib/gcp/runtimeconfig.js +31 -53
- package/lib/gcp/secretManager.js +21 -43
- package/lib/gcp/storage.js +25 -29
- 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 +1706 -2525
- package/package.json +16 -11
- package/schema/firebase-config.json +387 -12
- package/templates/init/hosting/index.html +1 -1
- package/lib/commands/functions-config-legacy.js +0 -45
- package/lib/prepareFirebaseRules.js +0 -58
|
@@ -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;
|