firebase-tools 13.30.0 → 13.31.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/apphosting/secrets/dialogs.js +2 -2
- package/lib/commands/appdistribution-groups-list.js +1 -1
- package/lib/commands/appdistribution-testers-list.js +4 -4
- package/lib/commands/apphosting-backends-list.js +1 -1
- package/lib/commands/apphosting-secrets-describe.js +1 -1
- package/lib/commands/apps-android-sha-list.js +1 -1
- package/lib/commands/apps-create.js +1 -104
- package/lib/commands/apps-init.js +94 -0
- package/lib/commands/apps-list.js +1 -1
- package/lib/commands/apps-sdkconfig.js +3 -3
- package/lib/commands/database-instances-list.js +1 -1
- package/lib/commands/dataconnect-services-list.js +1 -1
- package/lib/commands/emulators-start.js +1 -1
- package/lib/commands/experiments-list.js +1 -1
- package/lib/commands/ext-dev-list.js +1 -1
- package/lib/commands/ext-dev-usage.js +1 -1
- package/lib/commands/functions-list.js +1 -1
- package/lib/commands/hosting-channel-list.js +1 -1
- package/lib/commands/hosting-sites-get.js +1 -1
- package/lib/commands/hosting-sites-list.js +1 -1
- package/lib/commands/index.js +1 -0
- package/lib/commands/projects-list.js +1 -1
- package/lib/commands/remoteconfig-get.js +1 -1
- package/lib/commands/remoteconfig-versions-list.js +1 -1
- package/lib/crashlytics/buildToolsJarHelper.js +1 -1
- package/lib/dataconnect/build.js +6 -0
- package/lib/dataconnect/client.js +1 -1
- package/lib/dataconnect/dataplaneClient.js +1 -1
- package/lib/dataconnect/fileUtils.js +25 -2
- package/lib/dataconnect/graphqlError.js +5 -3
- package/lib/emulator/commandUtils.js +1 -1
- package/lib/emulator/dataconnectEmulator.js +4 -1
- package/lib/emulator/dataconnectToolkitController.js +5 -0
- package/lib/emulator/downloadableEmulators.js +9 -9
- package/lib/emulator/extensionsEmulator.js +2 -2
- package/lib/experiments.js +6 -0
- package/lib/extensions/change-log.js +1 -25
- package/lib/extensions/listExtensions.js +1 -1
- package/lib/firestore/pretty-print.js +1 -1
- package/lib/frameworks/angular/index.js +11 -6
- package/lib/functions/secrets.js +1 -1
- package/lib/gcp/cloudsql/interactive.js +1 -1
- package/lib/init/features/dataconnect/sdk.js +28 -3
- package/lib/init/features/genkit/index.js +9 -7
- package/lib/management/apps.js +314 -7
- package/lib/profileReport.js +1 -1
- package/lib/prompt.js +10 -2
- package/package.json +14 -5
- package/templates/genkit/firebase.0.9.0.template +1 -1
- package/templates/genkit/firebase.1.0.0.template +1 -1
- package/templates/setup/web.js +0 -5
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.envVarForSecret = exports.selectBackendServiceAccounts = exports.GRANT_ACCESS_IN_FUTURE = exports.WARN_NO_BACKENDS = exports.selectFromMetadata = exports.tableForBackends = exports.serviceAccountDisplay = exports.toMetadata = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
|
-
const Table = require("cli-
|
|
5
|
+
const Table = require("cli-table3");
|
|
6
6
|
const _1 = require(".");
|
|
7
7
|
const apphosting = require("../../gcp/apphosting");
|
|
8
8
|
const prompt = require("../../prompt");
|
|
@@ -117,8 +117,8 @@ async function selectBackendServiceAccounts(projectNumber, projectId, options) {
|
|
|
117
117
|
const table = new Table({
|
|
118
118
|
head: tableData[0],
|
|
119
119
|
style: { head: ["green"] },
|
|
120
|
-
rows: tableData[1],
|
|
121
120
|
});
|
|
121
|
+
table.push(...tableData[1]);
|
|
122
122
|
logger_1.logger.info(table.toString());
|
|
123
123
|
const allAccounts = metadata.reduce((accum, row) => {
|
|
124
124
|
accum.add(row.buildServiceAccount);
|
|
@@ -9,7 +9,7 @@ const error_1 = require("../error");
|
|
|
9
9
|
const logger_1 = require("../logger");
|
|
10
10
|
const requireAuth_1 = require("../requireAuth");
|
|
11
11
|
const utils = require("../utils");
|
|
12
|
-
const Table = require("cli-
|
|
12
|
+
const Table = require("cli-table3");
|
|
13
13
|
exports.command = new command_1.Command("appdistribution:groups:list")
|
|
14
14
|
.description("list groups in project")
|
|
15
15
|
.alias("appdistribution:group:list")
|
|
@@ -9,7 +9,7 @@ const error_1 = require("../error");
|
|
|
9
9
|
const logger_1 = require("../logger");
|
|
10
10
|
const requireAuth_1 = require("../requireAuth");
|
|
11
11
|
const utils = require("../utils");
|
|
12
|
-
const Table = require("cli-
|
|
12
|
+
const Table = require("cli-table3");
|
|
13
13
|
exports.command = new command_1.Command("appdistribution:testers:list [group]")
|
|
14
14
|
.description("list testers in project")
|
|
15
15
|
.before(requireAuth_1.requireAuth)
|
|
@@ -36,7 +36,7 @@ exports.command = new command_1.Command("appdistribution:testers:list [group]")
|
|
|
36
36
|
return testersResponse;
|
|
37
37
|
});
|
|
38
38
|
function printTestersTable(testers) {
|
|
39
|
-
var _a;
|
|
39
|
+
var _a, _b;
|
|
40
40
|
const tableHead = ["Name", "Display Name", "Last Activity Time", "Groups"];
|
|
41
41
|
const table = new Table({
|
|
42
42
|
head: tableHead,
|
|
@@ -44,11 +44,11 @@ function printTestersTable(testers) {
|
|
|
44
44
|
});
|
|
45
45
|
for (const tester of testers) {
|
|
46
46
|
const name = tester.name.split("/").pop();
|
|
47
|
-
const groups = tester.groups
|
|
47
|
+
const groups = ((_a = tester.groups) !== null && _a !== void 0 ? _a : [])
|
|
48
48
|
.map((grp) => grp.split("/").pop())
|
|
49
49
|
.sort()
|
|
50
50
|
.join(";");
|
|
51
|
-
table.push([name, (
|
|
51
|
+
table.push([name, (_b = tester.displayName) !== null && _b !== void 0 ? _b : "", tester.lastActivityTime.toString(), groups]);
|
|
52
52
|
}
|
|
53
53
|
logger_1.logger.info(table.toString());
|
|
54
54
|
}
|
|
@@ -7,7 +7,7 @@ const error_1 = require("../error");
|
|
|
7
7
|
const logger_1 = require("../logger");
|
|
8
8
|
const projectUtils_1 = require("../projectUtils");
|
|
9
9
|
const apphosting = require("../gcp/apphosting");
|
|
10
|
-
const Table = require("cli-
|
|
10
|
+
const Table = require("cli-table3");
|
|
11
11
|
const TABLE_HEAD = ["Backend", "Repository", "URL", "Location", "Updated Date"];
|
|
12
12
|
exports.command = new command_1.Command("apphosting:backends:list")
|
|
13
13
|
.description("list Firebase App Hosting backends")
|
|
@@ -8,7 +8,7 @@ const requireAuth_1 = require("../requireAuth");
|
|
|
8
8
|
const secretManager_1 = require("../gcp/secretManager");
|
|
9
9
|
const secretManager = require("../gcp/secretManager");
|
|
10
10
|
const requirePermissions_1 = require("../requirePermissions");
|
|
11
|
-
const Table = require("cli-
|
|
11
|
+
const Table = require("cli-table3");
|
|
12
12
|
exports.command = new command_1.Command("apphosting:secrets:describe <secretName>")
|
|
13
13
|
.description("Get metadata for secret and its versions.")
|
|
14
14
|
.before(requireAuth_1.requireAuth)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
|
-
const Table = require("cli-
|
|
4
|
+
const Table = require("cli-table3");
|
|
5
5
|
const command_1 = require("../command");
|
|
6
6
|
const projectUtils_1 = require("../projectUtils");
|
|
7
7
|
const apps_1 = require("../management/apps");
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
|
-
const ora = require("ora");
|
|
6
5
|
const command_1 = require("../command");
|
|
7
6
|
const projectUtils_1 = require("../projectUtils");
|
|
8
7
|
const error_1 = require("../error");
|
|
@@ -10,12 +9,6 @@ const apps_1 = require("../management/apps");
|
|
|
10
9
|
const prompt_1 = require("../prompt");
|
|
11
10
|
const requireAuth_1 = require("../requireAuth");
|
|
12
11
|
const logger_1 = require("../logger");
|
|
13
|
-
const DISPLAY_NAME_QUESTION = {
|
|
14
|
-
type: "input",
|
|
15
|
-
name: "displayName",
|
|
16
|
-
default: "",
|
|
17
|
-
message: "What would you like to call your app?",
|
|
18
|
-
};
|
|
19
12
|
function logPostAppCreationInformation(appMetadata, appPlatform) {
|
|
20
13
|
logger_1.logger.info("");
|
|
21
14
|
logger_1.logger.info(`🎉🎉🎉 Your Firebase ${appPlatform} App is ready! 🎉🎉🎉`);
|
|
@@ -39,89 +32,6 @@ function logPostAppCreationInformation(appMetadata, appPlatform) {
|
|
|
39
32
|
logger_1.logger.info("You can run this command to print out your new app's Google Services config:");
|
|
40
33
|
logger_1.logger.info(` firebase apps:sdkconfig ${appPlatform} ${appMetadata.appId}`);
|
|
41
34
|
}
|
|
42
|
-
async function initiateIosAppCreation(options) {
|
|
43
|
-
if (!options.nonInteractive) {
|
|
44
|
-
await (0, prompt_1.prompt)(options, [
|
|
45
|
-
DISPLAY_NAME_QUESTION,
|
|
46
|
-
{
|
|
47
|
-
type: "input",
|
|
48
|
-
default: "",
|
|
49
|
-
name: "bundleId",
|
|
50
|
-
message: "Please specify your iOS app bundle ID:",
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: "input",
|
|
54
|
-
default: "",
|
|
55
|
-
name: "appStoreId",
|
|
56
|
-
message: "Please specify your iOS app App Store ID:",
|
|
57
|
-
},
|
|
58
|
-
]);
|
|
59
|
-
}
|
|
60
|
-
if (!options.bundleId) {
|
|
61
|
-
throw new error_1.FirebaseError("Bundle ID for iOS app cannot be empty");
|
|
62
|
-
}
|
|
63
|
-
const spinner = ora("Creating your iOS app").start();
|
|
64
|
-
try {
|
|
65
|
-
const appData = await (0, apps_1.createIosApp)(options.project, {
|
|
66
|
-
displayName: options.displayName,
|
|
67
|
-
bundleId: options.bundleId,
|
|
68
|
-
appStoreId: options.appStoreId,
|
|
69
|
-
});
|
|
70
|
-
spinner.succeed();
|
|
71
|
-
return appData;
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
spinner.fail();
|
|
75
|
-
throw err;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
async function initiateAndroidAppCreation(options) {
|
|
79
|
-
if (!options.nonInteractive) {
|
|
80
|
-
await (0, prompt_1.prompt)(options, [
|
|
81
|
-
DISPLAY_NAME_QUESTION,
|
|
82
|
-
{
|
|
83
|
-
type: "input",
|
|
84
|
-
default: "",
|
|
85
|
-
name: "packageName",
|
|
86
|
-
message: "Please specify your Android app package name:",
|
|
87
|
-
},
|
|
88
|
-
]);
|
|
89
|
-
}
|
|
90
|
-
if (!options.packageName) {
|
|
91
|
-
throw new error_1.FirebaseError("Package name for Android app cannot be empty");
|
|
92
|
-
}
|
|
93
|
-
const spinner = ora("Creating your Android app").start();
|
|
94
|
-
try {
|
|
95
|
-
const appData = await (0, apps_1.createAndroidApp)(options.project, {
|
|
96
|
-
displayName: options.displayName,
|
|
97
|
-
packageName: options.packageName,
|
|
98
|
-
});
|
|
99
|
-
spinner.succeed();
|
|
100
|
-
return appData;
|
|
101
|
-
}
|
|
102
|
-
catch (err) {
|
|
103
|
-
spinner.fail();
|
|
104
|
-
throw err;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
async function initiateWebAppCreation(options) {
|
|
108
|
-
if (!options.nonInteractive) {
|
|
109
|
-
await (0, prompt_1.prompt)(options, [DISPLAY_NAME_QUESTION]);
|
|
110
|
-
}
|
|
111
|
-
if (!options.displayName) {
|
|
112
|
-
throw new error_1.FirebaseError("Display name for Web app cannot be empty");
|
|
113
|
-
}
|
|
114
|
-
const spinner = ora("Creating your Web app").start();
|
|
115
|
-
try {
|
|
116
|
-
const appData = await (0, apps_1.createWebApp)(options.project, { displayName: options.displayName });
|
|
117
|
-
spinner.succeed();
|
|
118
|
-
return appData;
|
|
119
|
-
}
|
|
120
|
-
catch (err) {
|
|
121
|
-
spinner.fail();
|
|
122
|
-
throw err;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
35
|
exports.command = new command_1.Command("apps:create [platform] [displayName]")
|
|
126
36
|
.description("create a new Firebase app. [platform] can be IOS, ANDROID or WEB (case insensitive).")
|
|
127
37
|
.option("-a, --package-name <packageName>", "required package name for the Android app")
|
|
@@ -147,20 +57,7 @@ exports.command = new command_1.Command("apps:create [platform] [displayName]")
|
|
|
147
57
|
}
|
|
148
58
|
logger_1.logger.info(`Create your ${appPlatform} app in project ${clc.bold(projectId)}:`);
|
|
149
59
|
options.displayName = displayName;
|
|
150
|
-
|
|
151
|
-
switch (appPlatform) {
|
|
152
|
-
case apps_1.AppPlatform.IOS:
|
|
153
|
-
appData = await initiateIosAppCreation(options);
|
|
154
|
-
break;
|
|
155
|
-
case apps_1.AppPlatform.ANDROID:
|
|
156
|
-
appData = await initiateAndroidAppCreation(options);
|
|
157
|
-
break;
|
|
158
|
-
case apps_1.AppPlatform.WEB:
|
|
159
|
-
appData = await initiateWebAppCreation(options);
|
|
160
|
-
break;
|
|
161
|
-
default:
|
|
162
|
-
throw new error_1.FirebaseError("Unexpected error. This should not happen");
|
|
163
|
-
}
|
|
60
|
+
const appData = await (0, apps_1.sdkInit)(appPlatform, options);
|
|
164
61
|
logPostAppCreationInformation(appData, appPlatform);
|
|
165
62
|
return appData;
|
|
166
63
|
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const fs = require("fs-extra");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const command_1 = require("../command");
|
|
7
|
+
const apps_1 = require("../management/apps");
|
|
8
|
+
const requireAuth_1 = require("../requireAuth");
|
|
9
|
+
const logger_1 = require("../logger");
|
|
10
|
+
const projectUtils_1 = require("../projectUtils");
|
|
11
|
+
const types_1 = require("../dataconnect/types");
|
|
12
|
+
const experiments_1 = require("../experiments");
|
|
13
|
+
function logUse(platform, filePath) {
|
|
14
|
+
switch (platform) {
|
|
15
|
+
case apps_1.AppPlatform.WEB:
|
|
16
|
+
logger_1.logger.info(`
|
|
17
|
+
How to use your JS SDK Config:
|
|
18
|
+
ES Module:
|
|
19
|
+
import { initializeApp } from 'firebase/app';
|
|
20
|
+
import json from './${filePath || "firebase-sdk-config.json"}';
|
|
21
|
+
initializeApp(json); // or copy and paste the config directly from the json file here
|
|
22
|
+
// CommonJS Module:
|
|
23
|
+
const { initializeApp } = require('firebase/app');
|
|
24
|
+
const json = require('./firebase-js-config.json');
|
|
25
|
+
initializeApp(json); // or copy and paste the config directly from the json file here`);
|
|
26
|
+
break;
|
|
27
|
+
case apps_1.AppPlatform.ANDROID:
|
|
28
|
+
logger_1.logger.info(`Visit https://firebase.google.com/docs/android/setup#add-config-file
|
|
29
|
+
for information on editing your gradle file and adding Firebase SDKs to your app.
|
|
30
|
+
|
|
31
|
+
If you're using Unity or C++, visit https://firebase.google.com/docs/cpp/setup?platform=android#add-config-file
|
|
32
|
+
for information about adding your config file to your project.`);
|
|
33
|
+
break;
|
|
34
|
+
case apps_1.AppPlatform.IOS:
|
|
35
|
+
logger_1.logger.info(`Visit https://firebase.google.com/docs/ios/setup#add-config-file
|
|
36
|
+
for information on adding the config file to your targets and adding Firebase SDKs to your app.
|
|
37
|
+
|
|
38
|
+
If you're using Unity or C++, visit https://firebase.google.com/docs/cpp/setup?platform=ios#add-config-file
|
|
39
|
+
for information about adding your config file to your project.`);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function toAppPlatform(str) {
|
|
44
|
+
switch (str.toUpperCase()) {
|
|
45
|
+
case types_1.Platform.ANDROID:
|
|
46
|
+
return types_1.Platform.ANDROID;
|
|
47
|
+
case types_1.Platform.IOS:
|
|
48
|
+
return types_1.Platform.IOS;
|
|
49
|
+
case types_1.Platform.WEB:
|
|
50
|
+
return types_1.Platform.WEB;
|
|
51
|
+
}
|
|
52
|
+
throw new Error(`Platform ${str} is not compatible with apps:configure`);
|
|
53
|
+
}
|
|
54
|
+
exports.command = new command_1.Command("apps:init [platform] [appId]")
|
|
55
|
+
.description("Automatically download and create config of a Firebase app. ")
|
|
56
|
+
.before(requireAuth_1.requireAuth)
|
|
57
|
+
.option("-o, --out [file]", "(optional) write config output to a file")
|
|
58
|
+
.action(async (platform = "", appId = "", options) => {
|
|
59
|
+
(0, experiments_1.assertEnabled)("appsinit", "autoconfigure an app");
|
|
60
|
+
if (typeof options.out === "boolean") {
|
|
61
|
+
throw new Error("Please specify a file path to output to.");
|
|
62
|
+
}
|
|
63
|
+
const config = options.config;
|
|
64
|
+
const appDir = process.cwd();
|
|
65
|
+
const detectedPlatform = platform ? toAppPlatform(platform) : await (0, apps_1.getPlatform)(appDir, config);
|
|
66
|
+
let sdkConfig;
|
|
67
|
+
while (sdkConfig === undefined) {
|
|
68
|
+
try {
|
|
69
|
+
sdkConfig = await (0, apps_1.getSdkConfig)(options, (0, apps_1.getAppPlatform)(detectedPlatform), appId);
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
if (e.message.includes("associated with this Firebase project")) {
|
|
73
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
74
|
+
await (0, apps_1.sdkInit)(platform, Object.assign(Object.assign({}, options), { project: projectId }));
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
throw e;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
let outputPath = options.out;
|
|
82
|
+
const fileInfo = (0, apps_1.getAppConfigFile)(sdkConfig, detectedPlatform);
|
|
83
|
+
let relativePath = "";
|
|
84
|
+
outputPath = outputPath || (await (0, apps_1.getSdkOutputPath)(appDir, detectedPlatform, options));
|
|
85
|
+
const outputDir = path.dirname(outputPath);
|
|
86
|
+
fs.mkdirpSync(outputDir);
|
|
87
|
+
relativePath = path.relative(appDir, outputPath);
|
|
88
|
+
const written = await (0, apps_1.writeConfigToFile)(outputPath, options.nonInteractive, fileInfo.fileContents);
|
|
89
|
+
if (written) {
|
|
90
|
+
logger_1.logger.info(`App configuration is written in ${relativePath}`);
|
|
91
|
+
}
|
|
92
|
+
logUse(detectedPlatform, relativePath);
|
|
93
|
+
return sdkConfig;
|
|
94
|
+
});
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
5
|
const ora = require("ora");
|
|
6
|
-
const Table = require("cli-
|
|
6
|
+
const Table = require("cli-table3");
|
|
7
7
|
const command_1 = require("../command");
|
|
8
8
|
const projectUtils_1 = require("../projectUtils");
|
|
9
9
|
const apps_1 = require("../management/apps");
|
|
@@ -83,7 +83,7 @@ exports.command = new command_1.Command("apps:sdkconfig [platform] [appId]")
|
|
|
83
83
|
return fileInfo;
|
|
84
84
|
}
|
|
85
85
|
const shouldUseDefaultFilename = options.out === true || options.out === "";
|
|
86
|
-
const filename = shouldUseDefaultFilename ?
|
|
86
|
+
const filename = shouldUseDefaultFilename ? fileInfo.fileName : options.out;
|
|
87
87
|
if (fs.existsSync(filename)) {
|
|
88
88
|
if (options.nonInteractive) {
|
|
89
89
|
throw new error_1.FirebaseError(`${filename} already exists`);
|
|
@@ -94,10 +94,10 @@ exports.command = new command_1.Command("apps:sdkconfig [platform] [appId]")
|
|
|
94
94
|
message: `${filename} already exists. Do you want to overwrite?`,
|
|
95
95
|
});
|
|
96
96
|
if (!overwrite) {
|
|
97
|
-
return
|
|
97
|
+
return fileInfo;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
fs.writeFileSync(filename, fileInfo.fileContents);
|
|
101
101
|
logger_1.logger.info(`App configuration is written in ${filename}`);
|
|
102
|
-
return
|
|
102
|
+
return fileInfo;
|
|
103
103
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
|
-
const Table = require("cli-
|
|
4
|
+
const Table = require("cli-table3");
|
|
5
5
|
const command_1 = require("../command");
|
|
6
6
|
const clc = require("colorette");
|
|
7
7
|
const ora = require("ora");
|
|
@@ -8,7 +8,7 @@ const client = require("../dataconnect/client");
|
|
|
8
8
|
const logger_1 = require("../logger");
|
|
9
9
|
const requirePermissions_1 = require("../requirePermissions");
|
|
10
10
|
const ensureApis_1 = require("../dataconnect/ensureApis");
|
|
11
|
-
const Table = require("cli-
|
|
11
|
+
const Table = require("cli-table3");
|
|
12
12
|
exports.command = new command_1.Command("dataconnect:services:list")
|
|
13
13
|
.description("list all deployed services in your Firebase project")
|
|
14
14
|
.before(requirePermissions_1.requirePermissions, [
|
|
@@ -11,7 +11,7 @@ const clc = require("colorette");
|
|
|
11
11
|
const constants_1 = require("../emulator/constants");
|
|
12
12
|
const utils_1 = require("../utils");
|
|
13
13
|
const webhook_1 = require("../dataconnect/webhook");
|
|
14
|
-
const Table = require("cli-
|
|
14
|
+
const Table = require("cli-table3");
|
|
15
15
|
function stylizeLink(url) {
|
|
16
16
|
return clc.underline(clc.bold(url));
|
|
17
17
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const command_1 = require("../command");
|
|
5
|
-
const Table = require("cli-
|
|
5
|
+
const Table = require("cli-table3");
|
|
6
6
|
const experiments = require("../experiments");
|
|
7
7
|
const functional_1 = require("../functional");
|
|
8
8
|
const logger_1 = require("../logger");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
|
-
const Table = require("cli-
|
|
5
|
+
const Table = require("cli-table3");
|
|
6
6
|
const command_1 = require("../command");
|
|
7
7
|
const error_1 = require("../error");
|
|
8
8
|
const utils_1 = require("../utils");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
|
-
const Table = require("cli-
|
|
4
|
+
const Table = require("cli-table3");
|
|
5
5
|
const clc = require("colorette");
|
|
6
6
|
const utils = require("../utils");
|
|
7
7
|
const command_1 = require("../command");
|
|
@@ -7,7 +7,7 @@ const projectUtils_1 = require("../projectUtils");
|
|
|
7
7
|
const requirePermissions_1 = require("../requirePermissions");
|
|
8
8
|
const backend = require("../deploy/functions/backend");
|
|
9
9
|
const logger_1 = require("../logger");
|
|
10
|
-
const Table = require("cli-
|
|
10
|
+
const Table = require("cli-table3");
|
|
11
11
|
exports.command = new command_1.Command("functions:list")
|
|
12
12
|
.description("list all deployed functions in your Firebase project")
|
|
13
13
|
.before(requirePermissions_1.requirePermissions, ["cloudfunctions.functions.list"])
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const colorette_1 = require("colorette");
|
|
5
|
-
const Table = require("cli-
|
|
5
|
+
const Table = require("cli-table3");
|
|
6
6
|
const api_1 = require("../hosting/api");
|
|
7
7
|
const command_1 = require("../command");
|
|
8
8
|
const requirePermissions_1 = require("../requirePermissions");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
|
-
const Table = require("cli-
|
|
4
|
+
const Table = require("cli-table3");
|
|
5
5
|
const command_1 = require("../command");
|
|
6
6
|
const api_1 = require("../hosting/api");
|
|
7
7
|
const requirePermissions_1 = require("../requirePermissions");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const colorette_1 = require("colorette");
|
|
5
|
-
const Table = require("cli-
|
|
5
|
+
const Table = require("cli-table3");
|
|
6
6
|
const command_1 = require("../command");
|
|
7
7
|
const api_1 = require("../hosting/api");
|
|
8
8
|
const requirePermissions_1 = require("../requirePermissions");
|
package/lib/commands/index.js
CHANGED
|
@@ -28,6 +28,7 @@ function load(client) {
|
|
|
28
28
|
client.apps = {};
|
|
29
29
|
client.apps.create = loadCommand("apps-create");
|
|
30
30
|
client.apps.list = loadCommand("apps-list");
|
|
31
|
+
client.apps.init = loadCommand("apps-init");
|
|
31
32
|
client.apps.sdkconfig = loadCommand("apps-sdkconfig");
|
|
32
33
|
client.apps.android = {};
|
|
33
34
|
client.apps.android.sha = {};
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
5
|
const ora = require("ora");
|
|
6
|
-
const Table = require("cli-
|
|
6
|
+
const Table = require("cli-table3");
|
|
7
7
|
const command_1 = require("../command");
|
|
8
8
|
const projects_1 = require("../management/projects");
|
|
9
9
|
const requireAuth_1 = require("../requireAuth");
|
|
@@ -9,7 +9,7 @@ const projectUtils_1 = require("../projectUtils");
|
|
|
9
9
|
const requirePermissions_1 = require("../requirePermissions");
|
|
10
10
|
const get_1 = require("../remoteconfig/get");
|
|
11
11
|
const utils = require("../utils");
|
|
12
|
-
const Table = require("cli-
|
|
12
|
+
const Table = require("cli-table3");
|
|
13
13
|
const fs = require("fs");
|
|
14
14
|
const util = require("util");
|
|
15
15
|
const error_1 = require("../error");
|
|
@@ -8,7 +8,7 @@ const projectUtils_1 = require("../projectUtils");
|
|
|
8
8
|
const requireAuth_1 = require("../requireAuth");
|
|
9
9
|
const requirePermissions_1 = require("../requirePermissions");
|
|
10
10
|
const utils_1 = require("../utils");
|
|
11
|
-
const Table = require("cli-
|
|
11
|
+
const Table = require("cli-table3");
|
|
12
12
|
const tableHead = ["Update User", "Version Number", "Update Time"];
|
|
13
13
|
function pushTableContents(table, version) {
|
|
14
14
|
var _a;
|
|
@@ -12,7 +12,7 @@ const node_fs_1 = require("node:fs");
|
|
|
12
12
|
const utils = require("../utils");
|
|
13
13
|
const JAR_CACHE_DIR = process.env.FIREBASE_CRASHLYTICS_BUILDTOOLS_PATH ||
|
|
14
14
|
path.join(os.homedir(), ".cache", "firebase", "crashlytics", "buildtools");
|
|
15
|
-
const JAR_VERSION = "3.0.
|
|
15
|
+
const JAR_VERSION = "3.0.3";
|
|
16
16
|
const JAR_URL = `https://dl.google.com/android/maven2/com/google/firebase/firebase-crashlytics-buildtools/${JAR_VERSION}/firebase-crashlytics-buildtools-${JAR_VERSION}.jar`;
|
|
17
17
|
async function fetchBuildtoolsJar() {
|
|
18
18
|
if (process.env.CRASHLYTICS_LOCAL_JAR) {
|
package/lib/dataconnect/build.js
CHANGED
|
@@ -31,6 +31,12 @@ async function handleBuildErrors(errors, nonInteractive, force, dryRun) {
|
|
|
31
31
|
if (errors.filter((w) => { var _a; return !((_a = w.extensions) === null || _a === void 0 ? void 0 : _a.warningLevel); }).length) {
|
|
32
32
|
throw new error_1.FirebaseError(`There are errors in your schema and connector files:\n${errors.map(graphqlError_1.prettify).join("\n")}`);
|
|
33
33
|
}
|
|
34
|
+
const requiredForces = errors.filter((w) => { var _a; return ((_a = w.extensions) === null || _a === void 0 ? void 0 : _a.warningLevel) === "REQUIRE_FORCE"; });
|
|
35
|
+
if (requiredForces.length && !force) {
|
|
36
|
+
utils.logLabeledError("dataconnect", `There are changes in your schema or connectors that will result in broken behavior:\n` +
|
|
37
|
+
(0, graphqlError_1.prettifyWithWorkaround)(requiredForces));
|
|
38
|
+
throw new error_1.FirebaseError("Rerun this command with --force to deploy these changes.");
|
|
39
|
+
}
|
|
34
40
|
const interactiveAcks = errors.filter((w) => { var _a; return ((_a = w.extensions) === null || _a === void 0 ? void 0 : _a.warningLevel) === "INTERACTIVE_ACK"; });
|
|
35
41
|
const requiredAcks = errors.filter((w) => { var _a; return ((_a = w.extensions) === null || _a === void 0 ? void 0 : _a.warningLevel) === "REQUIRE_ACK"; });
|
|
36
42
|
const choices = [
|
|
@@ -5,7 +5,7 @@ const api_1 = require("../api");
|
|
|
5
5
|
const apiv2_1 = require("../apiv2");
|
|
6
6
|
const operationPoller = require("../operation-poller");
|
|
7
7
|
const types = require("./types");
|
|
8
|
-
const DATACONNECT_API_VERSION = "
|
|
8
|
+
const DATACONNECT_API_VERSION = "v1";
|
|
9
9
|
const PAGE_SIZE_MAX = 100;
|
|
10
10
|
const dataconnectClient = () => new apiv2_1.Client({
|
|
11
11
|
urlPrefix: (0, api_1.dataconnectOrigin)(),
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.executeGraphQL = exports.dataconnectDataplaneClient = exports.DATACONNECT_API_VERSION = void 0;
|
|
4
4
|
const api_1 = require("../api");
|
|
5
5
|
const apiv2_1 = require("../apiv2");
|
|
6
|
-
exports.DATACONNECT_API_VERSION = "
|
|
6
|
+
exports.DATACONNECT_API_VERSION = "v1";
|
|
7
7
|
function dataconnectDataplaneClient() {
|
|
8
8
|
return new apiv2_1.Client({
|
|
9
9
|
urlPrefix: (0, api_1.dataconnectOrigin)(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPlatformFromFolder = exports.pickService = exports.readGQLFiles = exports.readConnectorYaml = exports.readDataConnectYaml = exports.readFirebaseJson = void 0;
|
|
3
|
+
exports.getFrameworksFromPackageJson = exports.SUPPORTED_FRAMEWORKS = exports.resolvePackageJson = exports.getPlatformFromFolder = exports.pickService = exports.readGQLFiles = exports.readConnectorYaml = exports.readDataConnectYaml = exports.readFirebaseJson = void 0;
|
|
4
4
|
const fs = require("fs-extra");
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const error_1 = require("../error");
|
|
@@ -97,7 +97,7 @@ async function pickService(projectId, config, serviceId) {
|
|
|
97
97
|
}
|
|
98
98
|
exports.pickService = pickService;
|
|
99
99
|
const WEB_INDICATORS = ["package.json", "package-lock.json", "node_modules"];
|
|
100
|
-
const IOS_INDICATORS = ["info.plist", "podfile", "package.swift"];
|
|
100
|
+
const IOS_INDICATORS = ["info.plist", "podfile", "package.swift", ".xcodeproj"];
|
|
101
101
|
const ANDROID_INDICATORS = ["androidmanifest.xml", "build.gradle", "build.gradle.kts"];
|
|
102
102
|
const DART_INDICATORS = ["pubspec.yaml", "pubspec.lock"];
|
|
103
103
|
const IOS_POSTFIX_INDICATORS = [".xcworkspace", ".xcodeproj"];
|
|
@@ -133,3 +133,26 @@ async function getPlatformFromFolder(dirPath) {
|
|
|
133
133
|
return types_1.Platform.MULTIPLE;
|
|
134
134
|
}
|
|
135
135
|
exports.getPlatformFromFolder = getPlatformFromFolder;
|
|
136
|
+
async function resolvePackageJson(packageJsonPath) {
|
|
137
|
+
let validPackageJsonPath = packageJsonPath;
|
|
138
|
+
if (!packageJsonPath.endsWith("package.json")) {
|
|
139
|
+
validPackageJsonPath = path.join(packageJsonPath, "package.json");
|
|
140
|
+
}
|
|
141
|
+
validPackageJsonPath = path.resolve(validPackageJsonPath);
|
|
142
|
+
try {
|
|
143
|
+
return JSON.parse((await fs.readFile(validPackageJsonPath)).toString());
|
|
144
|
+
}
|
|
145
|
+
catch (_a) {
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
exports.resolvePackageJson = resolvePackageJson;
|
|
150
|
+
exports.SUPPORTED_FRAMEWORKS = ["react"];
|
|
151
|
+
function getFrameworksFromPackageJson(packageJson) {
|
|
152
|
+
var _a, _b;
|
|
153
|
+
const devDependencies = Object.keys((_a = packageJson.devDependencies) !== null && _a !== void 0 ? _a : {});
|
|
154
|
+
const dependencies = Object.keys((_b = packageJson.dependencies) !== null && _b !== void 0 ? _b : {});
|
|
155
|
+
const matched = new Set([...devDependencies, ...dependencies].filter((dep) => exports.SUPPORTED_FRAMEWORKS.includes(dep)));
|
|
156
|
+
return Array.from(matched);
|
|
157
|
+
}
|
|
158
|
+
exports.getFrameworksFromPackageJson = getFrameworksFromPackageJson;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prettifyWithWorkaround = exports.prettify = void 0;
|
|
4
|
-
const Table = require("cli-
|
|
4
|
+
const Table = require("cli-table3");
|
|
5
5
|
function prettify(err) {
|
|
6
6
|
var _a, _b, _c, _d;
|
|
7
7
|
const message = err.message;
|
|
@@ -20,6 +20,8 @@ function prettifyWithWorkaround(errs) {
|
|
|
20
20
|
const table = new Table({
|
|
21
21
|
head: ["Issue", "Workaround", "Reason"],
|
|
22
22
|
style: { head: ["yellow"] },
|
|
23
|
+
colWidths: [50, 50, 50],
|
|
24
|
+
wordWrap: true,
|
|
23
25
|
});
|
|
24
26
|
for (const e of errs) {
|
|
25
27
|
if (!((_b = (_a = e.extensions) === null || _a === void 0 ? void 0 : _a.workarounds) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
@@ -29,10 +31,10 @@ function prettifyWithWorkaround(errs) {
|
|
|
29
31
|
const workarounds = e.extensions.workarounds;
|
|
30
32
|
for (let i = 0; i < workarounds.length; i++) {
|
|
31
33
|
if (i === 0) {
|
|
32
|
-
table.push([prettify(e), workarounds[i].
|
|
34
|
+
table.push([prettify(e), workarounds[i].description, workarounds[i].reason]);
|
|
33
35
|
}
|
|
34
36
|
else {
|
|
35
|
-
table.push(["", workarounds[i].
|
|
37
|
+
table.push(["", workarounds[i].description, workarounds[i].reason]);
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
}
|
|
@@ -17,7 +17,7 @@ const registry_1 = require("./registry");
|
|
|
17
17
|
const projectUtils_1 = require("../projectUtils");
|
|
18
18
|
const prompt_1 = require("../prompt");
|
|
19
19
|
const fsutils = require("../fsutils");
|
|
20
|
-
const Table = require("cli-
|
|
20
|
+
const Table = require("cli-table3");
|
|
21
21
|
const track_1 = require("../track");
|
|
22
22
|
const env_1 = require("./env");
|
|
23
23
|
const webhook_1 = require("../dataconnect/webhook");
|
|
@@ -52,7 +52,7 @@ class DataConnectEmulator {
|
|
|
52
52
|
config_dir: resolvedConfigDir,
|
|
53
53
|
enable_output_schema_extensions: this.args.enable_output_schema_extensions,
|
|
54
54
|
enable_output_generated_sdk: this.args.enable_output_generated_sdk,
|
|
55
|
-
});
|
|
55
|
+
}, this.args.extraEnv);
|
|
56
56
|
this.usingExistingEmulator = false;
|
|
57
57
|
if (this.args.autoconnectToPostgres) {
|
|
58
58
|
const info = await (0, load_1.load)(this.args.projectId, this.args.config, this.args.configDir);
|
|
@@ -126,6 +126,9 @@ class DataConnectEmulator {
|
|
|
126
126
|
getName() {
|
|
127
127
|
return types_1.Emulators.DATACONNECT;
|
|
128
128
|
}
|
|
129
|
+
getVersion() {
|
|
130
|
+
return (0, downloadableEmulators_1.getDownloadDetails)(types_1.Emulators.DATACONNECT).version;
|
|
131
|
+
}
|
|
129
132
|
async clearData() {
|
|
130
133
|
if (this.postgresServer) {
|
|
131
134
|
await this.postgresServer.clearDb();
|