@rodyssey/cli 0.1.6 → 0.1.7
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 +8 -18
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2071,7 +2071,7 @@ var {
|
|
|
2071
2071
|
// package.json
|
|
2072
2072
|
var package_default = {
|
|
2073
2073
|
name: "@rodyssey/cli",
|
|
2074
|
-
version: "0.1.
|
|
2074
|
+
version: "0.1.7",
|
|
2075
2075
|
description: "Scaffold new projects from airconcepts templates",
|
|
2076
2076
|
repository: {
|
|
2077
2077
|
type: "git",
|
|
@@ -4019,26 +4019,13 @@ async function getWebappConfig(options) {
|
|
|
4019
4019
|
const CONFIG_URL = getConfigUrl(options);
|
|
4020
4020
|
if (!CONFIG_URL)
|
|
4021
4021
|
return;
|
|
4022
|
-
ensureDeployToken(options.env);
|
|
4023
4022
|
const url = new URL(CONFIG_URL);
|
|
4024
4023
|
url.searchParams.set("webappId", webappId);
|
|
4025
4024
|
console.log(`⚙️ Pulling webapp config for [${options.env}] environment...`);
|
|
4026
4025
|
console.log(`\uD83D\uDCCD Config URL: ${url.toString()}`);
|
|
4027
4026
|
console.log(`\uD83D\uDCCD Webapp ID: ${webappId}
|
|
4028
4027
|
`);
|
|
4029
|
-
const
|
|
4030
|
-
method: "GET",
|
|
4031
|
-
headers: {
|
|
4032
|
-
Authorization: `Bearer ${process.env.DEPLOY_TOKEN}`,
|
|
4033
|
-
Accept: "application/json"
|
|
4034
|
-
}
|
|
4035
|
-
});
|
|
4036
|
-
if (!response.ok) {
|
|
4037
|
-
const errorText = await response.text();
|
|
4038
|
-
throw new Error(`Config fetch failed: ${response.status} ${response.statusText}
|
|
4039
|
-
${errorText}`);
|
|
4040
|
-
}
|
|
4041
|
-
const config = await response.json();
|
|
4028
|
+
const config = await fetchWebappConfig(options);
|
|
4042
4029
|
const output = JSON.stringify(config, null, 2);
|
|
4043
4030
|
if (options.out) {
|
|
4044
4031
|
writeFileSync3(options.out, `${output}
|
|
@@ -4207,11 +4194,14 @@ async function promote(options) {
|
|
|
4207
4194
|
console.log(`✅ Logged in to ${session.cmsUrl}`);
|
|
4208
4195
|
const cmsUrl = resolveCmsUrl(PROD_ENV, options.cmsUrl);
|
|
4209
4196
|
const promoteUrl = options.promoteUrl || `${cmsUrl}/api/cli/webapps/promote`;
|
|
4197
|
+
const promoteBody = { webappId, details };
|
|
4210
4198
|
console.log(`
|
|
4211
4199
|
\uD83D\uDE80 Promoting webapp to ${PROD_ENV}...`);
|
|
4212
4200
|
console.log(`\uD83D\uDCCD Promote URL: ${promoteUrl}`);
|
|
4213
|
-
console.log(`\uD83D\uDCCD Webapp ID: ${webappId}
|
|
4214
|
-
|
|
4201
|
+
console.log(`\uD83D\uDCCD Webapp ID: ${webappId}`);
|
|
4202
|
+
console.log("\uD83D\uDCE6 Promote body:");
|
|
4203
|
+
console.log(JSON.stringify(promoteBody, null, 2));
|
|
4204
|
+
console.log();
|
|
4215
4205
|
const response = await fetch(promoteUrl, {
|
|
4216
4206
|
method: "POST",
|
|
4217
4207
|
headers: {
|
|
@@ -4219,7 +4209,7 @@ async function promote(options) {
|
|
|
4219
4209
|
Authorization: `Bearer ${session.token}`,
|
|
4220
4210
|
"Content-Type": "application/json"
|
|
4221
4211
|
},
|
|
4222
|
-
body: JSON.stringify(
|
|
4212
|
+
body: JSON.stringify(promoteBody)
|
|
4223
4213
|
});
|
|
4224
4214
|
const payload = await readResponsePayload(response);
|
|
4225
4215
|
if (response.status === 409) {
|