firebase-tools 15.19.1 → 15.20.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/appdistribution/client.js +6 -5
- package/lib/appdistribution/options-parser-util.js +21 -0
- package/lib/commands/appdistribution-distribute.js +13 -4
- package/lib/commands/apptesting.js +9 -3
- package/lib/crashlytics/sourcemap.js +1 -1
- package/lib/deploy/dataconnect/context.js +0 -2
- package/lib/deploy/dataconnect/deploy.js +0 -19
- package/lib/deploy/functions/prepare.js +8 -104
- package/lib/deploy/functions/services/ailogic.js +17 -10
- package/lib/deploy/functions/services/auth.js +3 -0
- package/lib/deploy/functions/services/database.js +18 -0
- package/lib/deploy/functions/services/dataconnect.js +20 -0
- package/lib/deploy/functions/services/firestore.js +12 -0
- package/lib/deploy/functions/services/index.js +18 -7
- package/lib/deploy/functions/services/storage.js +14 -0
- package/lib/deploy/functions/triggerRegionHelper.js +2 -4
- package/lib/gcp/location.js +16 -1
- package/lib/init/features/dataconnect/create_app.js +3 -4
- package/lib/init/features/dataconnect/sdk.js +2 -2
- package/lib/mcp/tools/apptesting/tests.js +3 -1
- package/lib/tsconfig.compile.tsbuildinfo +1 -1
- package/lib/tsconfig.publish.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ const utils = require("../../utils");
|
|
|
8
8
|
const storage_1 = require("./services/storage");
|
|
9
9
|
const firestore_1 = require("./services/firestore");
|
|
10
10
|
const database_1 = require("./services/database");
|
|
11
|
+
const location_1 = require("../../gcp/location");
|
|
11
12
|
async function ensureTriggerRegions(want) {
|
|
12
13
|
const regionLookups = [];
|
|
13
14
|
const triggerRegionMap = new Map();
|
|
@@ -78,7 +79,7 @@ async function ensureTriggerRegions(want) {
|
|
|
78
79
|
if (ep.region !== "us-central1" || !triggerRegion || triggerRegion === "global") {
|
|
79
80
|
continue;
|
|
80
81
|
}
|
|
81
|
-
if (!isUSRegion(triggerRegion)) {
|
|
82
|
+
if (!(0, location_1.isUSRegion)(triggerRegion)) {
|
|
82
83
|
offendingFunctions.push(`- ${ep.id} (us-central1, Trigger: ${triggerRegion})`);
|
|
83
84
|
}
|
|
84
85
|
}
|
|
@@ -119,6 +120,3 @@ function extractInstanceName(resource) {
|
|
|
119
120
|
return resource;
|
|
120
121
|
return null;
|
|
121
122
|
}
|
|
122
|
-
function isUSRegion(region) {
|
|
123
|
-
return region === "us" || region.startsWith("nam") || region.startsWith("us-");
|
|
124
|
-
}
|
package/lib/gcp/location.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DUAL_REGION_MAPPING = exports.MULTI_REGION_MAPPING = void 0;
|
|
3
|
+
exports.STORAGE_MULTI_REGION_TO_REGION_MAPPING = exports.FIRESTORE_DUAL_REGION_TO_REGION_MAPPING = exports.DUAL_REGION_MAPPING = exports.MULTI_REGION_MAPPING = void 0;
|
|
4
4
|
exports.regionInLocation = regionInLocation;
|
|
5
|
+
exports.isUSRegion = isUSRegion;
|
|
5
6
|
exports.MULTI_REGION_MAPPING = {
|
|
6
7
|
"us-central1": "us",
|
|
7
8
|
"us-east1": "us",
|
|
@@ -34,6 +35,16 @@ exports.DUAL_REGION_MAPPING = {
|
|
|
34
35
|
"us-central1": "nam4",
|
|
35
36
|
"us-east1": "nam4",
|
|
36
37
|
};
|
|
38
|
+
exports.FIRESTORE_DUAL_REGION_TO_REGION_MAPPING = {
|
|
39
|
+
nam5: "us-central1",
|
|
40
|
+
nam7: "us-central1",
|
|
41
|
+
eur3: "europe-west1",
|
|
42
|
+
};
|
|
43
|
+
exports.STORAGE_MULTI_REGION_TO_REGION_MAPPING = {
|
|
44
|
+
us: "us-east1",
|
|
45
|
+
eu: "europe-west1",
|
|
46
|
+
asia: "asia-east1",
|
|
47
|
+
};
|
|
37
48
|
function regionInLocation(region, location) {
|
|
38
49
|
region = region.toLowerCase();
|
|
39
50
|
location = location.toLowerCase();
|
|
@@ -42,3 +53,7 @@ function regionInLocation(region, location) {
|
|
|
42
53
|
}
|
|
43
54
|
return false;
|
|
44
55
|
}
|
|
56
|
+
function isUSRegion(region) {
|
|
57
|
+
const lower = region.toLowerCase();
|
|
58
|
+
return lower === "us" || lower.startsWith("nam") || lower.startsWith("us-");
|
|
59
|
+
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createReactApp = createReactApp;
|
|
4
4
|
exports.createNextApp = createNextApp;
|
|
5
5
|
exports.createFlutterApp = createFlutterApp;
|
|
6
|
-
const
|
|
6
|
+
const spawn = require("cross-spawn");
|
|
7
7
|
const clc = require("colorette");
|
|
8
8
|
const utils_1 = require("../../../utils");
|
|
9
9
|
async function createReactApp(webAppId) {
|
|
@@ -33,16 +33,15 @@ async function createFlutterApp(webAppId) {
|
|
|
33
33
|
async function executeCommand(command, args) {
|
|
34
34
|
(0, utils_1.logLabeledBullet)("dataconnect", `> ${clc.bold(`${command} ${args.join(" ")}`)}`);
|
|
35
35
|
return new Promise((resolve, reject) => {
|
|
36
|
-
const childProcess =
|
|
36
|
+
const childProcess = spawn(command, args, {
|
|
37
37
|
stdio: "inherit",
|
|
38
|
-
shell: true,
|
|
39
38
|
});
|
|
40
39
|
childProcess.on("close", (code) => {
|
|
41
40
|
if (code === 0) {
|
|
42
41
|
resolve();
|
|
43
42
|
}
|
|
44
43
|
else {
|
|
45
|
-
reject(new Error(`Command failed with exit code ${code}`));
|
|
44
|
+
reject(new Error(`Command failed with exit code ${code ?? "null"}`));
|
|
46
45
|
}
|
|
47
46
|
});
|
|
48
47
|
childProcess.on("error", (err) => {
|
|
@@ -65,7 +65,7 @@ async function askQuestions(setup, config, options) {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
catch (err) {
|
|
68
|
-
(0, utils_1.logLabeledError)("dataconnect", `Failed to create a ${choice} app template`);
|
|
68
|
+
(0, utils_1.logLabeledError)("dataconnect", `Failed to create a ${choice} app template: ${(0, error_1.getErrStack)(err)}`);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
setup.featureInfo = setup.featureInfo || {};
|
|
@@ -214,7 +214,7 @@ async function actuateWithInfo(setup, config, info) {
|
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
216
|
catch (e) {
|
|
217
|
-
(0, utils_1.logLabeledError)("dataconnect", `Failed to generate SQL Connect SDKs\n${e
|
|
217
|
+
(0, utils_1.logLabeledError)("dataconnect", `Failed to generate SQL Connect SDKs\n${(0, error_1.getErrMsg)(e)}`);
|
|
218
218
|
}
|
|
219
219
|
(0, utils_1.logLabeledSuccess)("dataconnect", `Installed generated SDKs for ${clc.bold(apps.map((a) => (0, appUtils_1.appDescription)(a)).join(", "))}`);
|
|
220
220
|
if (apps.some((a) => a.platform === appUtils_1.Platform.IOS)) {
|
|
@@ -59,7 +59,9 @@ exports.run_tests = (0, tool_1.tool)("apptesting", {
|
|
|
59
59
|
const devices = testDevices || defaultDevices;
|
|
60
60
|
const client = new client_1.AppDistributionClient();
|
|
61
61
|
const release = await (0, distribution_1.upload)(client, (0, options_parser_util_1.toAppName)(appId), new distribution_1.Distribution(releaseBinaryFile));
|
|
62
|
-
return (0, util_1.toContent)(await client.createReleaseTest(release.name, devices,
|
|
62
|
+
return (0, util_1.toContent)(await client.createReleaseTest(release.name, devices, {
|
|
63
|
+
aiInstructions: testCase,
|
|
64
|
+
}));
|
|
63
65
|
});
|
|
64
66
|
exports.check_status = (0, tool_1.tool)("apptesting", {
|
|
65
67
|
name: "check_status",
|