connectbase-client 0.10.10 → 0.10.11
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/dist/cli.js +23 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1117,11 +1117,30 @@ ${colors.blue}?${colors.reset} \uC571 \uC120\uD0DD (\uBC88\uD638): `);
|
|
|
1117
1117
|
async function startTunnel(port, config, tunnelOpts) {
|
|
1118
1118
|
const tunnelKey = config.secretKey || (config.apiKey?.startsWith("cb_sk_") ? config.apiKey : "");
|
|
1119
1119
|
if (!tunnelKey) {
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1120
|
+
info("Secret Key\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800 \uB85C\uADF8\uC778\uC73C\uB85C \uBC1C\uAE09\uD569\uB2C8\uB2E4...");
|
|
1121
|
+
try {
|
|
1122
|
+
const sk = await browserAuthFlow();
|
|
1123
|
+
const rcPath = path.join(process.cwd(), ".connectbaserc");
|
|
1124
|
+
let rcData = {};
|
|
1125
|
+
if (fs.existsSync(rcPath)) {
|
|
1126
|
+
try {
|
|
1127
|
+
rcData = JSON.parse(fs.readFileSync(rcPath, "utf-8"));
|
|
1128
|
+
} catch {
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
rcData.secretKey = sk;
|
|
1132
|
+
fs.writeFileSync(rcPath, JSON.stringify(rcData, null, 2) + "\n");
|
|
1133
|
+
addToGitignore(".connectbaserc");
|
|
1134
|
+
success("Secret Key \uBC1C\uAE09 \uBC0F \uC800\uC7A5 \uC644\uB8CC");
|
|
1135
|
+
config.apiKey = sk;
|
|
1136
|
+
} catch (err) {
|
|
1137
|
+
error(`\uC778\uC99D \uC2E4\uD328: ${err instanceof Error ? err.message : err}`);
|
|
1138
|
+
info("-k \uC635\uC158\uC73C\uB85C Secret Key\uB97C \uC9C1\uC811 \uC804\uB2EC\uD560 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4");
|
|
1139
|
+
process.exit(1);
|
|
1140
|
+
}
|
|
1141
|
+
} else {
|
|
1142
|
+
config.apiKey = tunnelKey;
|
|
1123
1143
|
}
|
|
1124
|
-
config.apiKey = tunnelKey;
|
|
1125
1144
|
const appId = await resolveAppForTunnel(config.apiKey, config.baseUrl, tunnelOpts?.appId);
|
|
1126
1145
|
const tunnelServerUrl = getTunnelServerUrl(config.baseUrl);
|
|
1127
1146
|
const parsedUrl = new URL(tunnelServerUrl);
|