@hypersoniclabs/helix-cli 0.1.27-helix3.696 → 0.1.27-helix3.697
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/index.js +59 -0
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +67 -0
- package/dist/lib.js +178 -2
- package/dist/lib.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7200,6 +7200,65 @@ thumbnail
|
|
|
7200
7200
|
fail(err instanceof lib_1.ApiError ? err.render() : `✖ ${err instanceof Error ? err.message : String(err)}`);
|
|
7201
7201
|
}
|
|
7202
7202
|
});
|
|
7203
|
+
const loadingScreen = program
|
|
7204
|
+
.command('loading-screen')
|
|
7205
|
+
.description("Get, set or clear a world's branded loading screen (declarative; shown on /play before the World boots)");
|
|
7206
|
+
loadingScreen
|
|
7207
|
+
.command('get')
|
|
7208
|
+
.description("Print a world's loading screen as the API resolves it (null = default loader)")
|
|
7209
|
+
.argument('<slug>', 'world slug')
|
|
7210
|
+
.option('--json', 'print raw JSON only')
|
|
7211
|
+
.action(async (slug, opts) => {
|
|
7212
|
+
requireAuth();
|
|
7213
|
+
try {
|
|
7214
|
+
const view = await (0, lib_1.getWorldLoadingScreen)(slug);
|
|
7215
|
+
if (opts.json)
|
|
7216
|
+
console.log(JSON.stringify(view, null, 2));
|
|
7217
|
+
else if (view === null)
|
|
7218
|
+
console.log(`"${slug}" uses the default loading screen`);
|
|
7219
|
+
else
|
|
7220
|
+
console.log(JSON.stringify(view, null, 2));
|
|
7221
|
+
}
|
|
7222
|
+
catch (err) {
|
|
7223
|
+
fail(err instanceof lib_1.ApiError ? err.render() : `✖ ${err instanceof Error ? err.message : String(err)}`);
|
|
7224
|
+
}
|
|
7225
|
+
});
|
|
7226
|
+
loadingScreen
|
|
7227
|
+
.command('set')
|
|
7228
|
+
.description('Upload the images in a config file and set the world loading screen (owner only; see docs/loading-screen.md)')
|
|
7229
|
+
.argument('<slug>', 'world slug')
|
|
7230
|
+
.requiredOption('--config <file.json>', 'config: title, body, images[{image,alt,focus}], optional slogan/logo/stepSeconds; image paths are relative to the file')
|
|
7231
|
+
.action(async (slug, opts) => {
|
|
7232
|
+
const creds = requireAuth();
|
|
7233
|
+
const mismatch = (0, config_1.credsEnvMismatchWarning)(creds.apiUrl);
|
|
7234
|
+
if (mismatch)
|
|
7235
|
+
fail(`✖ Refusing to set the loading screen:\n${mismatch}`);
|
|
7236
|
+
try {
|
|
7237
|
+
const view = await (0, lib_1.setWorldLoadingScreen)(slug, (0, node_path_1.resolve)(opts.config));
|
|
7238
|
+
console.log(`✔ loading screen set for "${slug}"`);
|
|
7239
|
+
console.log(JSON.stringify(view, null, 2));
|
|
7240
|
+
}
|
|
7241
|
+
catch (err) {
|
|
7242
|
+
fail(err instanceof lib_1.ApiError ? err.render() : `✖ ${err instanceof Error ? err.message : String(err)}`);
|
|
7243
|
+
}
|
|
7244
|
+
});
|
|
7245
|
+
loadingScreen
|
|
7246
|
+
.command('clear')
|
|
7247
|
+
.description('Remove the custom loading screen (reverts to the default loader)')
|
|
7248
|
+
.argument('<slug>', 'world slug')
|
|
7249
|
+
.action(async (slug) => {
|
|
7250
|
+
const creds = requireAuth();
|
|
7251
|
+
const mismatch = (0, config_1.credsEnvMismatchWarning)(creds.apiUrl);
|
|
7252
|
+
if (mismatch)
|
|
7253
|
+
fail(`✖ Refusing to clear the loading screen:\n${mismatch}`);
|
|
7254
|
+
try {
|
|
7255
|
+
await (0, lib_1.clearWorldLoadingScreen)(slug);
|
|
7256
|
+
console.log(`✔ loading screen cleared for "${slug}"`);
|
|
7257
|
+
}
|
|
7258
|
+
catch (err) {
|
|
7259
|
+
fail(err instanceof lib_1.ApiError ? err.render() : `✖ ${err instanceof Error ? err.message : String(err)}`);
|
|
7260
|
+
}
|
|
7261
|
+
});
|
|
7203
7262
|
function formatWeaponPinRow(row) {
|
|
7204
7263
|
const label = row.title ? `${row.title} (${row.assetId.slice(0, 8)}…)` : row.pin;
|
|
7205
7264
|
switch (row.finding) {
|