playcademy 0.16.13 → 0.16.14
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 +6 -4
- package/dist/db.js +6 -3
- package/dist/index.d.ts +17 -0
- package/dist/index.js +159 -226
- package/dist/utils.js +6 -4
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -583,12 +583,14 @@ function displayApiError(error, indent) {
|
|
|
583
583
|
}
|
|
584
584
|
function displayConfigError(error, indent) {
|
|
585
585
|
const spaces = " ".repeat(indent);
|
|
586
|
-
console.error(`${spaces}${redBright("\u2716")} ${bold2(
|
|
586
|
+
console.error(`${spaces}${redBright("\u2716")} ${bold2("Configuration Error")}`);
|
|
587
|
+
console.error("");
|
|
588
|
+
console.error(`${spaces} ${error.message}`);
|
|
587
589
|
if (error.field) {
|
|
588
|
-
console.error(
|
|
590
|
+
console.error(` ${spaces} ${dim2("Field:")} ${error.field}`);
|
|
589
591
|
}
|
|
590
592
|
if (error.suggestion) {
|
|
591
|
-
console.error(
|
|
593
|
+
console.error(` ${spaces} ${dim2("Fix:")} ${error.suggestion}`);
|
|
592
594
|
}
|
|
593
595
|
}
|
|
594
596
|
function displayGenericError(error, indent) {
|
|
@@ -3111,7 +3113,7 @@ import { join as join13 } from "path";
|
|
|
3111
3113
|
// package.json with { type: 'json' }
|
|
3112
3114
|
var package_default2 = {
|
|
3113
3115
|
name: "playcademy",
|
|
3114
|
-
version: "0.16.
|
|
3116
|
+
version: "0.16.13",
|
|
3115
3117
|
type: "module",
|
|
3116
3118
|
exports: {
|
|
3117
3119
|
".": {
|
package/dist/db.js
CHANGED
|
@@ -992,12 +992,14 @@ function displayApiError(error, indent) {
|
|
|
992
992
|
}
|
|
993
993
|
function displayConfigError(error, indent) {
|
|
994
994
|
const spaces = " ".repeat(indent);
|
|
995
|
-
console.error(`${spaces}${redBright("\u2716")} ${bold2(
|
|
995
|
+
console.error(`${spaces}${redBright("\u2716")} ${bold2("Configuration Error")}`);
|
|
996
|
+
console.error("");
|
|
997
|
+
console.error(`${spaces} ${error.message}`);
|
|
996
998
|
if (error.field) {
|
|
997
|
-
console.error(
|
|
999
|
+
console.error(` ${spaces} ${dim2("Field:")} ${error.field}`);
|
|
998
1000
|
}
|
|
999
1001
|
if (error.suggestion) {
|
|
1000
|
-
console.error(
|
|
1002
|
+
console.error(` ${spaces} ${dim2("Fix:")} ${error.suggestion}`);
|
|
1001
1003
|
}
|
|
1002
1004
|
}
|
|
1003
1005
|
function displayGenericError(error, indent) {
|
|
@@ -1317,6 +1319,7 @@ function getLogPrefix(level) {
|
|
|
1317
1319
|
}
|
|
1318
1320
|
}
|
|
1319
1321
|
function displaySeedLogs(logs, status = "success") {
|
|
1322
|
+
if (status === "error") logger.newLine();
|
|
1320
1323
|
const barColor = status === "error" ? red2 : green2;
|
|
1321
1324
|
const bar = barColor("\u2502");
|
|
1322
1325
|
let trimmedLogs = logs;
|
package/dist/index.d.ts
CHANGED
|
@@ -828,6 +828,23 @@ declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
828
828
|
identity: undefined;
|
|
829
829
|
generated: undefined;
|
|
830
830
|
}, {}, {}>;
|
|
831
|
+
visibility: drizzle_orm_pg_core.PgColumn<{
|
|
832
|
+
name: "visibility";
|
|
833
|
+
tableName: "games";
|
|
834
|
+
dataType: "string";
|
|
835
|
+
columnType: "PgEnumColumn";
|
|
836
|
+
data: "visible" | "unlisted" | "internal";
|
|
837
|
+
driverParam: string;
|
|
838
|
+
notNull: true;
|
|
839
|
+
hasDefault: true;
|
|
840
|
+
isPrimaryKey: false;
|
|
841
|
+
isAutoincrement: false;
|
|
842
|
+
hasRuntimeDefault: false;
|
|
843
|
+
enumValues: ["visible", "unlisted", "internal"];
|
|
844
|
+
baseColumn: never;
|
|
845
|
+
identity: undefined;
|
|
846
|
+
generated: undefined;
|
|
847
|
+
}, {}, {}>;
|
|
831
848
|
metadata: drizzle_orm_pg_core.PgColumn<{
|
|
832
849
|
name: "metadata";
|
|
833
850
|
tableName: "games";
|
package/dist/index.js
CHANGED
|
@@ -978,12 +978,14 @@ function displayApiError(error, indent2) {
|
|
|
978
978
|
}
|
|
979
979
|
function displayConfigError(error, indent2) {
|
|
980
980
|
const spaces = " ".repeat(indent2);
|
|
981
|
-
console.error(`${spaces}${redBright("\u2716")} ${bold(
|
|
981
|
+
console.error(`${spaces}${redBright("\u2716")} ${bold("Configuration Error")}`);
|
|
982
|
+
console.error("");
|
|
983
|
+
console.error(`${spaces} ${error.message}`);
|
|
982
984
|
if (error.field) {
|
|
983
|
-
console.error(
|
|
985
|
+
console.error(` ${spaces} ${dim("Field:")} ${error.field}`);
|
|
984
986
|
}
|
|
985
987
|
if (error.suggestion) {
|
|
986
|
-
console.error(
|
|
988
|
+
console.error(` ${spaces} ${dim("Fix:")} ${error.suggestion}`);
|
|
987
989
|
}
|
|
988
990
|
}
|
|
989
991
|
function displayGenericError(error, indent2) {
|
|
@@ -1657,19 +1659,25 @@ function getErrorMessage(error) {
|
|
|
1657
1659
|
}
|
|
1658
1660
|
function logAndExit(error, options = {}) {
|
|
1659
1661
|
const { code = 1, prefix } = options;
|
|
1662
|
+
if (isConfigError(error)) {
|
|
1663
|
+
process.stderr.write("\n");
|
|
1664
|
+
formatError(error);
|
|
1665
|
+
process.stderr.write("\n");
|
|
1666
|
+
process.exit(code);
|
|
1667
|
+
}
|
|
1660
1668
|
const message = getErrorMessage(error);
|
|
1661
1669
|
const fullMessage = prefix ? `${prefix}: ${message}` : message;
|
|
1662
1670
|
logger.error(fullMessage);
|
|
1663
1671
|
if (process.env.DEBUG && error instanceof ApiError2 && error.details) {
|
|
1664
|
-
|
|
1672
|
+
process.stderr.write("\n");
|
|
1665
1673
|
logger.json(error.details, 1);
|
|
1666
1674
|
}
|
|
1667
|
-
|
|
1675
|
+
process.stderr.write("\n");
|
|
1668
1676
|
process.exit(code);
|
|
1669
1677
|
}
|
|
1670
1678
|
function formatErrorAndExit(error, code = 1) {
|
|
1671
1679
|
logger.configError(error);
|
|
1672
|
-
|
|
1680
|
+
process.stderr.write("\n");
|
|
1673
1681
|
process.exit(code);
|
|
1674
1682
|
}
|
|
1675
1683
|
|
|
@@ -4292,7 +4300,7 @@ import { join as join13 } from "path";
|
|
|
4292
4300
|
// package.json with { type: 'json' }
|
|
4293
4301
|
var package_default2 = {
|
|
4294
4302
|
name: "playcademy",
|
|
4295
|
-
version: "0.16.
|
|
4303
|
+
version: "0.16.13",
|
|
4296
4304
|
type: "module",
|
|
4297
4305
|
exports: {
|
|
4298
4306
|
".": {
|
|
@@ -8503,6 +8511,7 @@ var usersRelations = relations(users, ({ many }) => ({
|
|
|
8503
8511
|
// ../data/src/domains/game/table.ts
|
|
8504
8512
|
var gamePlatformEnum = pgEnum2("game_platform", ["web", "godot", "unity"]);
|
|
8505
8513
|
var gameTypeEnum = pgEnum2("game_type", ["hosted", "external"]);
|
|
8514
|
+
var gameVisibilityEnum = pgEnum2("game_visibility", ["visible", "unlisted", "internal"]);
|
|
8506
8515
|
var games = pgTable2("games", {
|
|
8507
8516
|
id: uuid("id").primaryKey().defaultRandom(),
|
|
8508
8517
|
developerId: text2("developer_id").references(() => users.id, {
|
|
@@ -8518,6 +8527,7 @@ var games = pgTable2("games", {
|
|
|
8518
8527
|
mapElementId: uuid("map_element_id").references(() => mapElements.id, {
|
|
8519
8528
|
onDelete: "set null"
|
|
8520
8529
|
}),
|
|
8530
|
+
visibility: gameVisibilityEnum("visibility").notNull().default("visible"),
|
|
8521
8531
|
metadata: jsonb("metadata").$type().notNull().default({}),
|
|
8522
8532
|
createdAt: timestamp2("created_at", { withTimezone: true }).defaultNow(),
|
|
8523
8533
|
updatedAt: timestamp2("updated_at", { withTimezone: true }).defaultNow()
|
|
@@ -8814,10 +8824,19 @@ async function updateBuildMetadata(context2) {
|
|
|
8814
8824
|
context2.buildHash = await hashFile(config.buildPath);
|
|
8815
8825
|
}
|
|
8816
8826
|
}
|
|
8827
|
+
async function loadDeployFullConfig(configPath) {
|
|
8828
|
+
if (!configPath && !process.env.PLAYCADEMY_CONFIG_PATH) {
|
|
8829
|
+
try {
|
|
8830
|
+
await findConfigPath();
|
|
8831
|
+
} catch {
|
|
8832
|
+
return null;
|
|
8833
|
+
}
|
|
8834
|
+
}
|
|
8835
|
+
return await loadConfig(configPath);
|
|
8836
|
+
}
|
|
8817
8837
|
async function prepareDeploymentContext(options) {
|
|
8818
|
-
const client = await requireDeveloperClient();
|
|
8819
8838
|
const { config, configFileName } = await loadDeployConfig(options.config);
|
|
8820
|
-
const fullConfig = await
|
|
8839
|
+
const fullConfig = await loadDeployFullConfig(options.config);
|
|
8821
8840
|
const finalConfig = {
|
|
8822
8841
|
...config,
|
|
8823
8842
|
...options.name && { displayName: options.name },
|
|
@@ -8828,6 +8847,7 @@ async function prepareDeploymentContext(options) {
|
|
|
8828
8847
|
if (finalConfig.displayName) {
|
|
8829
8848
|
finalConfig.slug = generateSlug(finalConfig.displayName);
|
|
8830
8849
|
}
|
|
8850
|
+
const client = await requireDeveloperClient();
|
|
8831
8851
|
const projectPath = getWorkspace();
|
|
8832
8852
|
const deployedGameInfo = await getDeployedGame(projectPath);
|
|
8833
8853
|
let existingGame;
|
|
@@ -9684,6 +9704,7 @@ function getLogPrefix(level) {
|
|
|
9684
9704
|
}
|
|
9685
9705
|
}
|
|
9686
9706
|
function displaySeedLogs(logs, status = "success") {
|
|
9707
|
+
if (status === "error") logger.newLine();
|
|
9687
9708
|
const barColor = status === "error" ? red5 : green7;
|
|
9688
9709
|
const bar = barColor("\u2502");
|
|
9689
9710
|
let trimmedLogs = logs;
|
|
@@ -10831,8 +10852,7 @@ var configCommand = new Command("config").description("Create playcademy.config
|
|
|
10831
10852
|
await formatConfigWithPrettier(configPath);
|
|
10832
10853
|
displayConfigSuccess(!!timebackConfig);
|
|
10833
10854
|
} catch (error) {
|
|
10834
|
-
|
|
10835
|
-
throw error;
|
|
10855
|
+
logAndExit(error, { prefix: "Failed to create config" });
|
|
10836
10856
|
}
|
|
10837
10857
|
});
|
|
10838
10858
|
|
|
@@ -11070,7 +11090,6 @@ import { Command as Command5 } from "commander";
|
|
|
11070
11090
|
import { ApiError as ApiError3 } from "@playcademy/sdk/internal";
|
|
11071
11091
|
async function runLogs(slugArg, options) {
|
|
11072
11092
|
try {
|
|
11073
|
-
logger.newLine();
|
|
11074
11093
|
const environment = ensureEnvironment(options.env);
|
|
11075
11094
|
let slug;
|
|
11076
11095
|
if (slugArg) {
|
|
@@ -11080,12 +11099,16 @@ async function runLogs(slugArg, options) {
|
|
|
11080
11099
|
await findConfigPath();
|
|
11081
11100
|
const config = await loadConfig();
|
|
11082
11101
|
slug = getSlugFromConfig(config);
|
|
11083
|
-
} catch {
|
|
11102
|
+
} catch (error) {
|
|
11103
|
+
if (isConfigError(error)) {
|
|
11104
|
+
throw error;
|
|
11105
|
+
}
|
|
11084
11106
|
logger.error("No slug provided and no config file found");
|
|
11085
11107
|
logger.newLine();
|
|
11086
11108
|
process.exit(1);
|
|
11087
11109
|
}
|
|
11088
11110
|
}
|
|
11111
|
+
logger.newLine();
|
|
11089
11112
|
const client = await requireAuthenticatedClient();
|
|
11090
11113
|
let token;
|
|
11091
11114
|
let workerId;
|
|
@@ -11231,6 +11254,7 @@ async function runDeployment(options) {
|
|
|
11231
11254
|
if (options.env) {
|
|
11232
11255
|
ensureEnvironment(options.env);
|
|
11233
11256
|
}
|
|
11257
|
+
await loadDeployFullConfig(options.config);
|
|
11234
11258
|
await selectEnvironment({ env: options.env, dryRun: options.dryRun });
|
|
11235
11259
|
const environment = ensureEnvironment(void 0);
|
|
11236
11260
|
const context2 = await prepareDeploymentContext(options);
|
|
@@ -11302,7 +11326,9 @@ var deployCommand = new Command8("deploy").description("Deploy your project to P
|
|
|
11302
11326
|
await runDeployment(options);
|
|
11303
11327
|
} catch (error) {
|
|
11304
11328
|
logger.newLine();
|
|
11305
|
-
if (
|
|
11329
|
+
if (isConfigError(error)) {
|
|
11330
|
+
logger.configError(error);
|
|
11331
|
+
} else if (!handleNetworkError(error)) {
|
|
11306
11332
|
logger.configError(error);
|
|
11307
11333
|
}
|
|
11308
11334
|
logger.newLine();
|
|
@@ -11496,9 +11522,7 @@ var applyCommand = new Command12("apply").description("Apply for developer statu
|
|
|
11496
11522
|
]);
|
|
11497
11523
|
logger.newLine();
|
|
11498
11524
|
} catch (error) {
|
|
11499
|
-
|
|
11500
|
-
logger.newLine();
|
|
11501
|
-
process.exit(1);
|
|
11525
|
+
logAndExit(error, { prefix: "Failed to apply for developer status" });
|
|
11502
11526
|
}
|
|
11503
11527
|
});
|
|
11504
11528
|
|
|
@@ -11547,7 +11571,7 @@ var getStatusCommand = new Command13("status").description("Check your developer
|
|
|
11547
11571
|
});
|
|
11548
11572
|
|
|
11549
11573
|
// package.json
|
|
11550
|
-
var version2 = "0.16.
|
|
11574
|
+
var version2 = "0.16.13";
|
|
11551
11575
|
|
|
11552
11576
|
// src/commands/dev/server.ts
|
|
11553
11577
|
function setupCleanupHandlers(workspace, getServer) {
|
|
@@ -11644,9 +11668,9 @@ import { Command as Command15 } from "commander";
|
|
|
11644
11668
|
import { input as input6 } from "@inquirer/prompts";
|
|
11645
11669
|
async function runApiInit() {
|
|
11646
11670
|
try {
|
|
11647
|
-
logger.newLine();
|
|
11648
11671
|
const configPath = await requireConfigFile();
|
|
11649
11672
|
const config = await loadConfig(configPath);
|
|
11673
|
+
logger.newLine();
|
|
11650
11674
|
if (config.integrations?.customRoutes) {
|
|
11651
11675
|
const directory = typeof config.integrations.customRoutes === "object" ? config.integrations.customRoutes.directory : DEFAULT_API_ROUTES_DIRECTORY;
|
|
11652
11676
|
logger.success("Custom API routes are already configured");
|
|
@@ -11721,8 +11745,7 @@ async function runApiInit() {
|
|
|
11721
11745
|
]);
|
|
11722
11746
|
logger.newLine();
|
|
11723
11747
|
} catch (error) {
|
|
11724
|
-
|
|
11725
|
-
throw error;
|
|
11748
|
+
logAndExit(error, { prefix: "Failed to add API routes" });
|
|
11726
11749
|
}
|
|
11727
11750
|
}
|
|
11728
11751
|
|
|
@@ -11833,9 +11856,9 @@ import { Command as Command17 } from "commander";
|
|
|
11833
11856
|
var sampleCustomRouteTemplate2 = loadTemplateString("api/sample-custom.ts");
|
|
11834
11857
|
var initAuthCommand = new Command17("init").description("Add authentication to your project").action(async () => {
|
|
11835
11858
|
try {
|
|
11836
|
-
logger.newLine();
|
|
11837
11859
|
const configPath = await requireConfigFile();
|
|
11838
11860
|
const config = await loadConfig(configPath);
|
|
11861
|
+
logger.newLine();
|
|
11839
11862
|
if (config.integrations?.auth) {
|
|
11840
11863
|
logger.success("Authentication is already configured");
|
|
11841
11864
|
logger.newLine();
|
|
@@ -11927,8 +11950,7 @@ var initAuthCommand = new Command17("init").description("Add authentication to y
|
|
|
11927
11950
|
logger.newLine();
|
|
11928
11951
|
}
|
|
11929
11952
|
} catch (error) {
|
|
11930
|
-
|
|
11931
|
-
throw error;
|
|
11953
|
+
logAndExit(error, { prefix: "Failed to add authentication" });
|
|
11932
11954
|
}
|
|
11933
11955
|
});
|
|
11934
11956
|
|
|
@@ -11980,9 +12002,9 @@ var sampleCustomRouteTemplate3 = loadTemplateString("api/sample-custom.ts");
|
|
|
11980
12002
|
var sampleDatabaseRouteTemplate2 = loadTemplateString("api/sample-database.ts");
|
|
11981
12003
|
async function runDbInit() {
|
|
11982
12004
|
try {
|
|
11983
|
-
logger.newLine();
|
|
11984
12005
|
const configPath = await requireConfigFile();
|
|
11985
12006
|
const config = await loadConfig(configPath);
|
|
12007
|
+
logger.newLine();
|
|
11986
12008
|
if (config.integrations?.database) {
|
|
11987
12009
|
const directory = typeof config.integrations.database === "object" ? config.integrations.database.directory : "db";
|
|
11988
12010
|
logger.success(`Database is already configured in <./${directory}>`);
|
|
@@ -12053,8 +12075,7 @@ async function runDbInit() {
|
|
|
12053
12075
|
]);
|
|
12054
12076
|
logger.newLine();
|
|
12055
12077
|
} catch (error) {
|
|
12056
|
-
|
|
12057
|
-
throw error;
|
|
12078
|
+
logAndExit(error, { prefix: "Failed to add database" });
|
|
12058
12079
|
}
|
|
12059
12080
|
}
|
|
12060
12081
|
|
|
@@ -12617,16 +12638,11 @@ async function runDbSeed(options = {}) {
|
|
|
12617
12638
|
await runDbSeedLocal(seedFile, options);
|
|
12618
12639
|
}
|
|
12619
12640
|
} catch (error) {
|
|
12620
|
-
logger.newLine();
|
|
12621
12641
|
if (handleSeedError(error)) {
|
|
12622
12642
|
logger.newLine();
|
|
12623
12643
|
process.exit(1);
|
|
12624
12644
|
}
|
|
12625
|
-
|
|
12626
|
-
`Failed to seed database: ${error instanceof Error ? error.message : String(error)}`
|
|
12627
|
-
);
|
|
12628
|
-
logger.newLine();
|
|
12629
|
-
process.exit(1);
|
|
12645
|
+
logAndExit(error, { prefix: "Failed to seed database" });
|
|
12630
12646
|
}
|
|
12631
12647
|
}
|
|
12632
12648
|
|
|
@@ -12729,6 +12745,9 @@ async function runKVClearRemote(options) {
|
|
|
12729
12745
|
}
|
|
12730
12746
|
async function runKVClearLocal(options) {
|
|
12731
12747
|
const config = await loadConfig();
|
|
12748
|
+
if (!options.raw && !options.json) {
|
|
12749
|
+
logger.newLine();
|
|
12750
|
+
}
|
|
12732
12751
|
if (!hasKVSetup(config)) {
|
|
12733
12752
|
if (!options.raw && !options.json) {
|
|
12734
12753
|
logger.error("KV storage is not configured");
|
|
@@ -12804,22 +12823,16 @@ async function runKVClearLocal(options) {
|
|
|
12804
12823
|
}
|
|
12805
12824
|
async function runKVClear(options = {}) {
|
|
12806
12825
|
try {
|
|
12807
|
-
if (!options.raw && !options.json) {
|
|
12808
|
-
logger.newLine();
|
|
12809
|
-
}
|
|
12810
12826
|
if (options.remote) {
|
|
12827
|
+
if (!options.raw && !options.json) {
|
|
12828
|
+
logger.newLine();
|
|
12829
|
+
}
|
|
12811
12830
|
await runKVClearRemote(options);
|
|
12812
12831
|
} else {
|
|
12813
12832
|
await runKVClearLocal(options);
|
|
12814
12833
|
}
|
|
12815
12834
|
} catch (error) {
|
|
12816
|
-
|
|
12817
|
-
logger.error(
|
|
12818
|
-
`Failed to clear KV: ${error instanceof Error ? error.message : String(error)}`
|
|
12819
|
-
);
|
|
12820
|
-
logger.newLine();
|
|
12821
|
-
}
|
|
12822
|
-
process.exit(1);
|
|
12835
|
+
logAndExit(error, { prefix: "Failed to clear KV" });
|
|
12823
12836
|
}
|
|
12824
12837
|
}
|
|
12825
12838
|
|
|
@@ -12872,6 +12885,9 @@ async function runKVDeleteRemote(key, options) {
|
|
|
12872
12885
|
}
|
|
12873
12886
|
async function runKVDeleteLocal(key, options) {
|
|
12874
12887
|
const config = await loadConfig();
|
|
12888
|
+
if (!options.raw && !options.json) {
|
|
12889
|
+
logger.newLine();
|
|
12890
|
+
}
|
|
12875
12891
|
if (!hasKVSetup(config)) {
|
|
12876
12892
|
if (!options.raw && !options.json) {
|
|
12877
12893
|
logger.error("KV storage is not configured");
|
|
@@ -12924,9 +12940,6 @@ async function runKVDeleteLocal(key, options) {
|
|
|
12924
12940
|
}
|
|
12925
12941
|
async function runKVDelete(key, options = {}) {
|
|
12926
12942
|
try {
|
|
12927
|
-
if (!options.raw && !options.json) {
|
|
12928
|
-
logger.newLine();
|
|
12929
|
-
}
|
|
12930
12943
|
if (!key) {
|
|
12931
12944
|
if (!options.raw && !options.json) {
|
|
12932
12945
|
logger.error("Key is required");
|
|
@@ -12937,18 +12950,15 @@ async function runKVDelete(key, options = {}) {
|
|
|
12937
12950
|
process.exit(1);
|
|
12938
12951
|
}
|
|
12939
12952
|
if (options.remote) {
|
|
12953
|
+
if (!options.raw && !options.json) {
|
|
12954
|
+
logger.newLine();
|
|
12955
|
+
}
|
|
12940
12956
|
await runKVDeleteRemote(key, options);
|
|
12941
12957
|
} else {
|
|
12942
12958
|
await runKVDeleteLocal(key, options);
|
|
12943
12959
|
}
|
|
12944
12960
|
} catch (error) {
|
|
12945
|
-
|
|
12946
|
-
logger.error(
|
|
12947
|
-
`Failed to delete key: ${error instanceof Error ? error.message : String(error)}`
|
|
12948
|
-
);
|
|
12949
|
-
logger.newLine();
|
|
12950
|
-
}
|
|
12951
|
-
process.exit(1);
|
|
12961
|
+
logAndExit(error, { prefix: "Failed to delete key" });
|
|
12952
12962
|
}
|
|
12953
12963
|
}
|
|
12954
12964
|
|
|
@@ -13017,6 +13027,9 @@ async function runKVGetRemote(key, options) {
|
|
|
13017
13027
|
}
|
|
13018
13028
|
async function runKVGetLocal(key, options) {
|
|
13019
13029
|
const config = await loadConfig();
|
|
13030
|
+
if (!options.raw && !options.json) {
|
|
13031
|
+
logger.newLine();
|
|
13032
|
+
}
|
|
13020
13033
|
if (!hasKVSetup(config)) {
|
|
13021
13034
|
if (!options.raw && !options.json) {
|
|
13022
13035
|
logger.error("KV storage is not configured");
|
|
@@ -13087,9 +13100,6 @@ async function runKVGetLocal(key, options) {
|
|
|
13087
13100
|
}
|
|
13088
13101
|
async function runKVGet(key, options = {}) {
|
|
13089
13102
|
try {
|
|
13090
|
-
if (!options.raw && !options.json) {
|
|
13091
|
-
logger.newLine();
|
|
13092
|
-
}
|
|
13093
13103
|
if (!key) {
|
|
13094
13104
|
if (!options.raw && !options.json) {
|
|
13095
13105
|
logger.error("Key is required");
|
|
@@ -13100,18 +13110,15 @@ async function runKVGet(key, options = {}) {
|
|
|
13100
13110
|
process.exit(1);
|
|
13101
13111
|
}
|
|
13102
13112
|
if (options.remote) {
|
|
13113
|
+
if (!options.raw && !options.json) {
|
|
13114
|
+
logger.newLine();
|
|
13115
|
+
}
|
|
13103
13116
|
await runKVGetRemote(key, options);
|
|
13104
13117
|
} else {
|
|
13105
13118
|
await runKVGetLocal(key, options);
|
|
13106
13119
|
}
|
|
13107
13120
|
} catch (error) {
|
|
13108
|
-
|
|
13109
|
-
logger.error(
|
|
13110
|
-
`Failed to get key: ${error instanceof Error ? error.message : String(error)}`
|
|
13111
|
-
);
|
|
13112
|
-
logger.newLine();
|
|
13113
|
-
}
|
|
13114
|
-
process.exit(1);
|
|
13121
|
+
logAndExit(error, { prefix: "Failed to get key" });
|
|
13115
13122
|
}
|
|
13116
13123
|
}
|
|
13117
13124
|
|
|
@@ -13121,9 +13128,9 @@ var sampleCustomRouteTemplate4 = loadTemplateString("api/sample-custom.ts");
|
|
|
13121
13128
|
var sampleKvRouteTemplate2 = loadTemplateString("api/sample-kv.ts");
|
|
13122
13129
|
async function runKVInit() {
|
|
13123
13130
|
try {
|
|
13124
|
-
logger.newLine();
|
|
13125
13131
|
const configPath = await requireConfigFile();
|
|
13126
13132
|
const config = await loadConfig(configPath);
|
|
13133
|
+
logger.newLine();
|
|
13127
13134
|
if (hasKVSetup(config)) {
|
|
13128
13135
|
logger.success("KV storage is already configured");
|
|
13129
13136
|
logger.newLine();
|
|
@@ -13174,11 +13181,7 @@ async function runKVInit() {
|
|
|
13174
13181
|
]);
|
|
13175
13182
|
logger.newLine();
|
|
13176
13183
|
} catch (error) {
|
|
13177
|
-
|
|
13178
|
-
`Failed to add KV integration: ${error instanceof Error ? error.message : String(error)}`
|
|
13179
|
-
);
|
|
13180
|
-
logger.newLine();
|
|
13181
|
-
process.exit(1);
|
|
13184
|
+
logAndExit(error, { prefix: "Failed to add KV integration" });
|
|
13182
13185
|
}
|
|
13183
13186
|
}
|
|
13184
13187
|
|
|
@@ -13278,6 +13281,9 @@ async function runKVInspectRemote(key, options) {
|
|
|
13278
13281
|
}
|
|
13279
13282
|
async function runKVInspectLocal(key, options) {
|
|
13280
13283
|
const config = await loadConfig();
|
|
13284
|
+
if (!options.raw && !options.json) {
|
|
13285
|
+
logger.newLine();
|
|
13286
|
+
}
|
|
13281
13287
|
if (!hasKVSetup(config)) {
|
|
13282
13288
|
if (!options.raw && !options.json) {
|
|
13283
13289
|
logger.error("KV storage is not configured");
|
|
@@ -13368,9 +13374,6 @@ async function runKVInspectLocal(key, options) {
|
|
|
13368
13374
|
}
|
|
13369
13375
|
async function runKVInspect(key, options = {}) {
|
|
13370
13376
|
try {
|
|
13371
|
-
if (!options.raw && !options.json) {
|
|
13372
|
-
logger.newLine();
|
|
13373
|
-
}
|
|
13374
13377
|
if (!key) {
|
|
13375
13378
|
if (!options.raw && !options.json) {
|
|
13376
13379
|
logger.error("Key is required");
|
|
@@ -13381,18 +13384,15 @@ async function runKVInspect(key, options = {}) {
|
|
|
13381
13384
|
process.exit(1);
|
|
13382
13385
|
}
|
|
13383
13386
|
if (options.remote) {
|
|
13387
|
+
if (!options.raw && !options.json) {
|
|
13388
|
+
logger.newLine();
|
|
13389
|
+
}
|
|
13384
13390
|
await runKVInspectRemote(key, options);
|
|
13385
13391
|
} else {
|
|
13386
13392
|
await runKVInspectLocal(key, options);
|
|
13387
13393
|
}
|
|
13388
13394
|
} catch (error) {
|
|
13389
|
-
|
|
13390
|
-
logger.error(
|
|
13391
|
-
`Failed to inspect key: ${error instanceof Error ? error.message : String(error)}`
|
|
13392
|
-
);
|
|
13393
|
-
logger.newLine();
|
|
13394
|
-
}
|
|
13395
|
-
process.exit(1);
|
|
13395
|
+
logAndExit(error, { prefix: "Failed to inspect key" });
|
|
13396
13396
|
}
|
|
13397
13397
|
}
|
|
13398
13398
|
|
|
@@ -13448,6 +13448,9 @@ async function runKVListRemote(options) {
|
|
|
13448
13448
|
}
|
|
13449
13449
|
async function runKVListLocal(options) {
|
|
13450
13450
|
const config = await loadConfig();
|
|
13451
|
+
if (!options.raw && !options.json) {
|
|
13452
|
+
logger.newLine();
|
|
13453
|
+
}
|
|
13451
13454
|
if (!hasKVSetup(config)) {
|
|
13452
13455
|
if (!options.raw && !options.json) {
|
|
13453
13456
|
logger.error("KV storage is not configured");
|
|
@@ -13498,22 +13501,16 @@ async function runKVListLocal(options) {
|
|
|
13498
13501
|
}
|
|
13499
13502
|
async function runKVList(options = {}) {
|
|
13500
13503
|
try {
|
|
13501
|
-
if (!options.raw && !options.json) {
|
|
13502
|
-
logger.newLine();
|
|
13503
|
-
}
|
|
13504
13504
|
if (options.remote) {
|
|
13505
|
+
if (!options.raw && !options.json) {
|
|
13506
|
+
logger.newLine();
|
|
13507
|
+
}
|
|
13505
13508
|
await runKVListRemote(options);
|
|
13506
13509
|
} else {
|
|
13507
13510
|
await runKVListLocal(options);
|
|
13508
13511
|
}
|
|
13509
13512
|
} catch (error) {
|
|
13510
|
-
|
|
13511
|
-
logger.error(
|
|
13512
|
-
`Failed to list KV keys: ${error instanceof Error ? error.message : String(error)}`
|
|
13513
|
-
);
|
|
13514
|
-
logger.newLine();
|
|
13515
|
-
}
|
|
13516
|
-
process.exit(1);
|
|
13513
|
+
logAndExit(error, { prefix: "Failed to list KV keys" });
|
|
13517
13514
|
}
|
|
13518
13515
|
}
|
|
13519
13516
|
|
|
@@ -13606,6 +13603,9 @@ async function runKVSeedRemote(seedFile, options) {
|
|
|
13606
13603
|
}
|
|
13607
13604
|
async function runKVSeedLocal(seedFile, options) {
|
|
13608
13605
|
const config = await loadConfig();
|
|
13606
|
+
if (!options.raw && !options.json) {
|
|
13607
|
+
logger.newLine();
|
|
13608
|
+
}
|
|
13609
13609
|
if (!hasKVSetup(config)) {
|
|
13610
13610
|
if (!options.raw && !options.json) {
|
|
13611
13611
|
logger.error("KV storage is not configured");
|
|
@@ -13708,9 +13708,6 @@ async function runKVSeedLocal(seedFile, options) {
|
|
|
13708
13708
|
}
|
|
13709
13709
|
async function runKVSeed(seedFile, options = {}) {
|
|
13710
13710
|
try {
|
|
13711
|
-
if (!options.raw && !options.json) {
|
|
13712
|
-
logger.newLine();
|
|
13713
|
-
}
|
|
13714
13711
|
if (!seedFile) {
|
|
13715
13712
|
if (!options.raw && !options.json) {
|
|
13716
13713
|
logger.error("Seed file is required");
|
|
@@ -13726,18 +13723,15 @@ async function runKVSeed(seedFile, options = {}) {
|
|
|
13726
13723
|
process.exit(1);
|
|
13727
13724
|
}
|
|
13728
13725
|
if (options.remote) {
|
|
13726
|
+
if (!options.raw && !options.json) {
|
|
13727
|
+
logger.newLine();
|
|
13728
|
+
}
|
|
13729
13729
|
await runKVSeedRemote(seedFile, options);
|
|
13730
13730
|
} else {
|
|
13731
13731
|
await runKVSeedLocal(seedFile, options);
|
|
13732
13732
|
}
|
|
13733
13733
|
} catch (error) {
|
|
13734
|
-
|
|
13735
|
-
logger.error(
|
|
13736
|
-
`Failed to seed KV: ${error instanceof Error ? error.message : String(error)}`
|
|
13737
|
-
);
|
|
13738
|
-
logger.newLine();
|
|
13739
|
-
}
|
|
13740
|
-
process.exit(1);
|
|
13734
|
+
logAndExit(error, { prefix: "Failed to seed KV" });
|
|
13741
13735
|
}
|
|
13742
13736
|
}
|
|
13743
13737
|
|
|
@@ -13803,6 +13797,9 @@ async function runKVSetRemote(key, value, options) {
|
|
|
13803
13797
|
}
|
|
13804
13798
|
async function runKVSetLocal(key, value, options) {
|
|
13805
13799
|
const config = await loadConfig();
|
|
13800
|
+
if (!options.raw && !options.json) {
|
|
13801
|
+
logger.newLine();
|
|
13802
|
+
}
|
|
13806
13803
|
if (!hasKVSetup(config)) {
|
|
13807
13804
|
if (!options.raw && !options.json) {
|
|
13808
13805
|
logger.error("KV storage is not configured");
|
|
@@ -13882,18 +13879,15 @@ async function runKVSet(key, value, options = {}) {
|
|
|
13882
13879
|
process.exit(1);
|
|
13883
13880
|
}
|
|
13884
13881
|
if (options.remote) {
|
|
13882
|
+
if (!options.raw && !options.json) {
|
|
13883
|
+
logger.newLine();
|
|
13884
|
+
}
|
|
13885
13885
|
await runKVSetRemote(key, value, options);
|
|
13886
13886
|
} else {
|
|
13887
13887
|
await runKVSetLocal(key, value, options);
|
|
13888
13888
|
}
|
|
13889
13889
|
} catch (error) {
|
|
13890
|
-
|
|
13891
|
-
logger.error(
|
|
13892
|
-
`Failed to set key: ${error instanceof Error ? error.message : String(error)}`
|
|
13893
|
-
);
|
|
13894
|
-
logger.newLine();
|
|
13895
|
-
}
|
|
13896
|
-
process.exit(1);
|
|
13890
|
+
logAndExit(error, { prefix: "Failed to set key" });
|
|
13897
13891
|
}
|
|
13898
13892
|
}
|
|
13899
13893
|
|
|
@@ -13943,6 +13937,9 @@ async function runKVStatsRemote(options) {
|
|
|
13943
13937
|
}
|
|
13944
13938
|
async function runKVStatsLocal(options) {
|
|
13945
13939
|
const config = await loadConfig();
|
|
13940
|
+
if (!options.raw && !options.json) {
|
|
13941
|
+
logger.newLine();
|
|
13942
|
+
}
|
|
13946
13943
|
if (!hasKVSetup(config)) {
|
|
13947
13944
|
if (!options.raw && !options.json) {
|
|
13948
13945
|
logger.error("KV storage is not configured");
|
|
@@ -14022,22 +14019,16 @@ async function runKVStatsLocal(options) {
|
|
|
14022
14019
|
}
|
|
14023
14020
|
async function runKVStats(options = {}) {
|
|
14024
14021
|
try {
|
|
14025
|
-
if (!options.raw && !options.json) {
|
|
14026
|
-
logger.newLine();
|
|
14027
|
-
}
|
|
14028
14022
|
if (options.remote) {
|
|
14023
|
+
if (!options.raw && !options.json) {
|
|
14024
|
+
logger.newLine();
|
|
14025
|
+
}
|
|
14029
14026
|
await runKVStatsRemote(options);
|
|
14030
14027
|
} else {
|
|
14031
14028
|
await runKVStatsLocal(options);
|
|
14032
14029
|
}
|
|
14033
14030
|
} catch (error) {
|
|
14034
|
-
|
|
14035
|
-
logger.error(
|
|
14036
|
-
`Failed to get KV stats: ${error instanceof Error ? error.message : String(error)}`
|
|
14037
|
-
);
|
|
14038
|
-
logger.newLine();
|
|
14039
|
-
}
|
|
14040
|
-
process.exit(1);
|
|
14031
|
+
logAndExit(error, { prefix: "Failed to get KV stats" });
|
|
14041
14032
|
}
|
|
14042
14033
|
}
|
|
14043
14034
|
|
|
@@ -14125,6 +14116,9 @@ async function runBucketBulkRemote(directory, options) {
|
|
|
14125
14116
|
}
|
|
14126
14117
|
async function runBucketBulkLocal(directory, options) {
|
|
14127
14118
|
const config = await loadConfig();
|
|
14119
|
+
if (!options.raw && !options.json) {
|
|
14120
|
+
logger.newLine();
|
|
14121
|
+
}
|
|
14128
14122
|
if (!hasBucketSetup(config)) {
|
|
14129
14123
|
if (!options.raw && !options.json) {
|
|
14130
14124
|
logger.error("Bucket storage is not configured");
|
|
@@ -14211,18 +14205,15 @@ async function runBucketBulk(directory, options = {}) {
|
|
|
14211
14205
|
process.exit(1);
|
|
14212
14206
|
}
|
|
14213
14207
|
if (options.remote) {
|
|
14208
|
+
if (!options.raw && !options.json) {
|
|
14209
|
+
logger.newLine();
|
|
14210
|
+
}
|
|
14214
14211
|
await runBucketBulkRemote(directory, options);
|
|
14215
14212
|
} else {
|
|
14216
14213
|
await runBucketBulkLocal(directory, options);
|
|
14217
14214
|
}
|
|
14218
14215
|
} catch (error) {
|
|
14219
|
-
|
|
14220
|
-
logger.error(
|
|
14221
|
-
`Failed to bulk upload: ${error instanceof Error ? error.message : String(error)}`
|
|
14222
|
-
);
|
|
14223
|
-
logger.newLine();
|
|
14224
|
-
}
|
|
14225
|
-
process.exit(1);
|
|
14216
|
+
logAndExit(error, { prefix: "Failed to bulk upload" });
|
|
14226
14217
|
}
|
|
14227
14218
|
}
|
|
14228
14219
|
|
|
@@ -14327,22 +14318,16 @@ async function runBucketDeleteLocal(key, options) {
|
|
|
14327
14318
|
}
|
|
14328
14319
|
async function runBucketDelete(key, options = {}) {
|
|
14329
14320
|
try {
|
|
14330
|
-
if (!options.raw && !options.json) {
|
|
14331
|
-
logger.newLine();
|
|
14332
|
-
}
|
|
14333
14321
|
if (options.remote) {
|
|
14322
|
+
if (!options.raw && !options.json) {
|
|
14323
|
+
logger.newLine();
|
|
14324
|
+
}
|
|
14334
14325
|
await runBucketDeleteRemote(key, options);
|
|
14335
14326
|
} else {
|
|
14336
14327
|
await runBucketDeleteLocal(key, options);
|
|
14337
14328
|
}
|
|
14338
14329
|
} catch (error) {
|
|
14339
|
-
|
|
14340
|
-
logger.error(
|
|
14341
|
-
`Failed to delete file: ${error instanceof Error ? error.message : String(error)}`
|
|
14342
|
-
);
|
|
14343
|
-
logger.newLine();
|
|
14344
|
-
}
|
|
14345
|
-
process.exit(1);
|
|
14330
|
+
logAndExit(error, { prefix: "Failed to delete file" });
|
|
14346
14331
|
}
|
|
14347
14332
|
}
|
|
14348
14333
|
|
|
@@ -14508,22 +14493,16 @@ async function runBucketGetLocal(key, options) {
|
|
|
14508
14493
|
}
|
|
14509
14494
|
async function runBucketGet(key, options = {}) {
|
|
14510
14495
|
try {
|
|
14511
|
-
if (!options.raw && !options.json) {
|
|
14512
|
-
logger.newLine();
|
|
14513
|
-
}
|
|
14514
14496
|
if (options.remote) {
|
|
14497
|
+
if (!options.raw && !options.json) {
|
|
14498
|
+
logger.newLine();
|
|
14499
|
+
}
|
|
14515
14500
|
await runBucketGetRemote(key, options);
|
|
14516
14501
|
} else {
|
|
14517
14502
|
await runBucketGetLocal(key, options);
|
|
14518
14503
|
}
|
|
14519
14504
|
} catch (error) {
|
|
14520
|
-
|
|
14521
|
-
logger.error(
|
|
14522
|
-
`Failed to get file: ${error instanceof Error ? error.message : String(error)}`
|
|
14523
|
-
);
|
|
14524
|
-
logger.newLine();
|
|
14525
|
-
}
|
|
14526
|
-
process.exit(1);
|
|
14505
|
+
logAndExit(error, { prefix: "Failed to get file" });
|
|
14527
14506
|
}
|
|
14528
14507
|
}
|
|
14529
14508
|
|
|
@@ -14533,9 +14512,9 @@ var sampleCustomRouteTemplate5 = loadTemplateString("api/sample-custom.ts");
|
|
|
14533
14512
|
var sampleBucketRouteTemplate2 = loadTemplateString("api/sample-bucket.ts");
|
|
14534
14513
|
async function runBucketInit() {
|
|
14535
14514
|
try {
|
|
14536
|
-
logger.newLine();
|
|
14537
14515
|
const configPath = await requireConfigFile();
|
|
14538
14516
|
const config = await loadConfig(configPath);
|
|
14517
|
+
logger.newLine();
|
|
14539
14518
|
if (hasBucketSetup(config)) {
|
|
14540
14519
|
logger.success("Bucket storage is already configured");
|
|
14541
14520
|
logger.newLine();
|
|
@@ -14591,11 +14570,7 @@ async function runBucketInit() {
|
|
|
14591
14570
|
]);
|
|
14592
14571
|
logger.newLine();
|
|
14593
14572
|
} catch (error) {
|
|
14594
|
-
|
|
14595
|
-
`Failed to add bucket integration: ${error instanceof Error ? error.message : String(error)}`
|
|
14596
|
-
);
|
|
14597
|
-
logger.newLine();
|
|
14598
|
-
process.exit(1);
|
|
14573
|
+
logAndExit(error, { prefix: "Failed to add bucket integration" });
|
|
14599
14574
|
}
|
|
14600
14575
|
}
|
|
14601
14576
|
|
|
@@ -14658,6 +14633,9 @@ async function runBucketListRemote(options) {
|
|
|
14658
14633
|
}
|
|
14659
14634
|
async function runBucketListLocal(options) {
|
|
14660
14635
|
const config = await loadConfig();
|
|
14636
|
+
if (!options.raw && !options.json) {
|
|
14637
|
+
logger.newLine();
|
|
14638
|
+
}
|
|
14661
14639
|
if (!hasBucketSetup(config)) {
|
|
14662
14640
|
if (!options.raw && !options.json) {
|
|
14663
14641
|
logger.error("Bucket storage is not configured");
|
|
@@ -14731,18 +14709,15 @@ async function runBucketListLocal(options) {
|
|
|
14731
14709
|
async function runBucketList(options = {}) {
|
|
14732
14710
|
try {
|
|
14733
14711
|
if (options.remote) {
|
|
14712
|
+
if (!options.raw && !options.json) {
|
|
14713
|
+
logger.newLine();
|
|
14714
|
+
}
|
|
14734
14715
|
await runBucketListRemote(options);
|
|
14735
14716
|
} else {
|
|
14736
14717
|
await runBucketListLocal(options);
|
|
14737
14718
|
}
|
|
14738
14719
|
} catch (error) {
|
|
14739
|
-
|
|
14740
|
-
logger.error(
|
|
14741
|
-
`Failed to list files: ${error instanceof Error ? error.message : String(error)}`
|
|
14742
|
-
);
|
|
14743
|
-
logger.newLine();
|
|
14744
|
-
}
|
|
14745
|
-
process.exit(1);
|
|
14720
|
+
logAndExit(error, { prefix: "Failed to list files" });
|
|
14746
14721
|
}
|
|
14747
14722
|
}
|
|
14748
14723
|
function formatBytes2(bytes) {
|
|
@@ -14882,22 +14857,16 @@ async function runBucketPutLocal(key, filePath, options) {
|
|
|
14882
14857
|
}
|
|
14883
14858
|
async function runBucketPut(key, filePath, options = {}) {
|
|
14884
14859
|
try {
|
|
14885
|
-
if (!options.raw && !options.json) {
|
|
14886
|
-
logger.newLine();
|
|
14887
|
-
}
|
|
14888
14860
|
if (options.remote) {
|
|
14861
|
+
if (!options.raw && !options.json) {
|
|
14862
|
+
logger.newLine();
|
|
14863
|
+
}
|
|
14889
14864
|
await runBucketPutRemote(key, filePath, options);
|
|
14890
14865
|
} else {
|
|
14891
14866
|
await runBucketPutLocal(key, filePath, options);
|
|
14892
14867
|
}
|
|
14893
14868
|
} catch (error) {
|
|
14894
|
-
|
|
14895
|
-
logger.error(
|
|
14896
|
-
`Failed to upload file: ${error instanceof Error ? error.message : String(error)}`
|
|
14897
|
-
);
|
|
14898
|
-
logger.newLine();
|
|
14899
|
-
}
|
|
14900
|
-
process.exit(1);
|
|
14869
|
+
logAndExit(error, { prefix: "Failed to upload file" });
|
|
14901
14870
|
}
|
|
14902
14871
|
}
|
|
14903
14872
|
|
|
@@ -14945,9 +14914,9 @@ import { confirm as confirm16, input as input12 } from "@inquirer/prompts";
|
|
|
14945
14914
|
var sampleQueueHandlerTemplate = loadTemplateString("queue/sample-handler.ts");
|
|
14946
14915
|
async function runQueueInit() {
|
|
14947
14916
|
try {
|
|
14948
|
-
logger.newLine();
|
|
14949
14917
|
const configPath = await requireConfigFile();
|
|
14950
14918
|
const config = await loadConfig(configPath);
|
|
14919
|
+
logger.newLine();
|
|
14951
14920
|
const existingQueues = getQueueEntries(config);
|
|
14952
14921
|
if (hasQueueSetup(config)) {
|
|
14953
14922
|
logger.success(
|
|
@@ -15019,11 +14988,7 @@ async function runQueueInit() {
|
|
|
15019
14988
|
]);
|
|
15020
14989
|
logger.newLine();
|
|
15021
14990
|
} catch (error) {
|
|
15022
|
-
|
|
15023
|
-
`Failed to add queue integration: ${error instanceof Error ? error.message : String(error)}`
|
|
15024
|
-
);
|
|
15025
|
-
logger.newLine();
|
|
15026
|
-
process.exit(1);
|
|
14991
|
+
logAndExit(error, { prefix: "Failed to add queue integration" });
|
|
15027
14992
|
}
|
|
15028
14993
|
}
|
|
15029
14994
|
|
|
@@ -15040,7 +15005,6 @@ import { Command as Command23 } from "commander";
|
|
|
15040
15005
|
import { underline as underline6 } from "colorette";
|
|
15041
15006
|
async function runDomainAdd(hostname, options) {
|
|
15042
15007
|
try {
|
|
15043
|
-
logger.newLine();
|
|
15044
15008
|
const validationError = validateCustomHostname(hostname);
|
|
15045
15009
|
if (validationError) {
|
|
15046
15010
|
logger.error(`Invalid hostname: ${validationError.message}`);
|
|
@@ -15056,6 +15020,7 @@ async function runDomainAdd(hostname, options) {
|
|
|
15056
15020
|
await requireConfigFile();
|
|
15057
15021
|
const config = await loadConfig();
|
|
15058
15022
|
const slug = getSlugFromConfig(config);
|
|
15023
|
+
logger.newLine();
|
|
15059
15024
|
const client = await requireAuthenticatedClient();
|
|
15060
15025
|
const domain = await runStep(
|
|
15061
15026
|
"Adding custom domain",
|
|
@@ -15077,11 +15042,7 @@ async function runDomainAdd(hostname, options) {
|
|
|
15077
15042
|
]);
|
|
15078
15043
|
logger.newLine();
|
|
15079
15044
|
} catch (error) {
|
|
15080
|
-
|
|
15081
|
-
`Failed to add custom domain: ${error instanceof Error ? error.message : String(error)}`
|
|
15082
|
-
);
|
|
15083
|
-
logger.newLine();
|
|
15084
|
-
process.exit(1);
|
|
15045
|
+
logAndExit(error, { prefix: "Failed to add custom domain" });
|
|
15085
15046
|
}
|
|
15086
15047
|
}
|
|
15087
15048
|
|
|
@@ -15089,11 +15050,11 @@ async function runDomainAdd(hostname, options) {
|
|
|
15089
15050
|
import { confirm as confirm17 } from "@inquirer/prompts";
|
|
15090
15051
|
async function runDomainDelete(hostname, options) {
|
|
15091
15052
|
try {
|
|
15092
|
-
logger.newLine();
|
|
15093
15053
|
requireEnvironment(options.env, `domain delete ${hostname}`);
|
|
15094
15054
|
await requireConfigFile();
|
|
15095
15055
|
const config = await loadConfig();
|
|
15096
15056
|
const slug = getSlugFromConfig(config);
|
|
15057
|
+
logger.newLine();
|
|
15097
15058
|
if (!options.force) {
|
|
15098
15059
|
const shouldDelete = await confirm17({
|
|
15099
15060
|
message: `Delete custom domain ${hostname}?`,
|
|
@@ -15118,24 +15079,20 @@ async function runDomainDelete(hostname, options) {
|
|
|
15118
15079
|
logger.success(`Custom domain ${hostname} removed`);
|
|
15119
15080
|
logger.newLine();
|
|
15120
15081
|
} catch (error) {
|
|
15121
|
-
|
|
15122
|
-
`Failed to delete custom domain: ${error instanceof Error ? error.message : String(error)}`
|
|
15123
|
-
);
|
|
15124
|
-
logger.newLine();
|
|
15125
|
-
process.exit(1);
|
|
15082
|
+
logAndExit(error, { prefix: "Failed to delete custom domain" });
|
|
15126
15083
|
}
|
|
15127
15084
|
}
|
|
15128
15085
|
|
|
15129
15086
|
// src/commands/domain/list.ts
|
|
15130
15087
|
async function runDomainList(options) {
|
|
15131
15088
|
try {
|
|
15132
|
-
if (!options.raw && !options.json) {
|
|
15133
|
-
logger.newLine();
|
|
15134
|
-
}
|
|
15135
15089
|
requireEnvironment(options.env, "domain list");
|
|
15136
15090
|
await requireConfigFile();
|
|
15137
15091
|
const config = await loadConfig();
|
|
15138
15092
|
const slug = getSlugFromConfig(config);
|
|
15093
|
+
if (!options.raw && !options.json) {
|
|
15094
|
+
logger.newLine();
|
|
15095
|
+
}
|
|
15139
15096
|
const client = await requireAuthenticatedClient();
|
|
15140
15097
|
const domains = await client.dev.games.domains.list(slug);
|
|
15141
15098
|
if (options.json) {
|
|
@@ -15165,13 +15122,7 @@ async function runDomainList(options) {
|
|
|
15165
15122
|
);
|
|
15166
15123
|
logger.newLine();
|
|
15167
15124
|
} catch (error) {
|
|
15168
|
-
|
|
15169
|
-
logger.error(
|
|
15170
|
-
`Failed to list custom domains: ${error instanceof Error ? error.message : String(error)}`
|
|
15171
|
-
);
|
|
15172
|
-
logger.newLine();
|
|
15173
|
-
}
|
|
15174
|
-
process.exit(1);
|
|
15125
|
+
logAndExit(error, { prefix: "Failed to list custom domains" });
|
|
15175
15126
|
}
|
|
15176
15127
|
}
|
|
15177
15128
|
|
|
@@ -15179,13 +15130,13 @@ async function runDomainList(options) {
|
|
|
15179
15130
|
import { underline as underline7 } from "colorette";
|
|
15180
15131
|
async function runDomainVerify(hostname, options) {
|
|
15181
15132
|
try {
|
|
15182
|
-
if (!options.json) {
|
|
15183
|
-
logger.newLine();
|
|
15184
|
-
}
|
|
15185
15133
|
const environment = requireEnvironment(options.env, `domain verify ${hostname}`);
|
|
15186
15134
|
await requireConfigFile();
|
|
15187
15135
|
const config = await loadConfig();
|
|
15188
15136
|
const slug = getSlugFromConfig(config);
|
|
15137
|
+
if (!options.json) {
|
|
15138
|
+
logger.newLine();
|
|
15139
|
+
}
|
|
15189
15140
|
const client = await requireAuthenticatedClient();
|
|
15190
15141
|
const domain = await client.dev.games.domains.status(
|
|
15191
15142
|
slug,
|
|
@@ -15215,13 +15166,7 @@ async function runDomainVerify(hostname, options) {
|
|
|
15215
15166
|
logger.newLine();
|
|
15216
15167
|
}
|
|
15217
15168
|
} catch (error) {
|
|
15218
|
-
|
|
15219
|
-
logger.error(
|
|
15220
|
-
`Failed to verify custom domain: ${error instanceof Error ? error.message : String(error)}`
|
|
15221
|
-
);
|
|
15222
|
-
logger.newLine();
|
|
15223
|
-
}
|
|
15224
|
-
process.exit(1);
|
|
15169
|
+
logAndExit(error, { prefix: "Failed to verify custom domain" });
|
|
15225
15170
|
}
|
|
15226
15171
|
}
|
|
15227
15172
|
|
|
@@ -15421,8 +15366,7 @@ async function listProfilesAction() {
|
|
|
15421
15366
|
}
|
|
15422
15367
|
}
|
|
15423
15368
|
} catch (error) {
|
|
15424
|
-
|
|
15425
|
-
process.exit(1);
|
|
15369
|
+
logAndExit(error, { prefix: "Failed to list profiles" });
|
|
15426
15370
|
}
|
|
15427
15371
|
}
|
|
15428
15372
|
var listCommand3 = new Command28("list").alias("ls").description("List all stored authentication profiles").action(listProfilesAction);
|
|
@@ -15588,9 +15532,7 @@ var cleanupCommand = new Command32("cleanup").description("Remove TimeBack integ
|
|
|
15588
15532
|
]);
|
|
15589
15533
|
logger.newLine();
|
|
15590
15534
|
} catch (error) {
|
|
15591
|
-
|
|
15592
|
-
logger.newLine();
|
|
15593
|
-
process.exit(1);
|
|
15535
|
+
logAndExit(error, { prefix: "Cleanup failed" });
|
|
15594
15536
|
}
|
|
15595
15537
|
});
|
|
15596
15538
|
|
|
@@ -15598,10 +15540,10 @@ var cleanupCommand = new Command32("cleanup").description("Remove TimeBack integ
|
|
|
15598
15540
|
import { Command as Command33 } from "commander";
|
|
15599
15541
|
var initCommand2 = new Command33("init").description("Add TimeBack integration to your project").action(async () => {
|
|
15600
15542
|
try {
|
|
15601
|
-
logger.newLine();
|
|
15602
15543
|
const configPath = await requireConfigFile();
|
|
15603
15544
|
const fileName = configPath.split("/").pop();
|
|
15604
15545
|
const config = await loadConfig(configPath);
|
|
15546
|
+
logger.newLine();
|
|
15605
15547
|
if (config.integrations?.timeback) {
|
|
15606
15548
|
logger.success("TimeBack integration is already configured");
|
|
15607
15549
|
logger.newLine();
|
|
@@ -15638,8 +15580,7 @@ var initCommand2 = new Command33("init").description("Add TimeBack integration t
|
|
|
15638
15580
|
]);
|
|
15639
15581
|
logger.newLine();
|
|
15640
15582
|
} catch (error) {
|
|
15641
|
-
|
|
15642
|
-
formatErrorAndExit(error);
|
|
15583
|
+
logAndExit(error, { prefix: "Failed to add TimeBack integration" });
|
|
15643
15584
|
}
|
|
15644
15585
|
});
|
|
15645
15586
|
|
|
@@ -15723,7 +15664,7 @@ var setupCommand = new Command34("setup").description("Set up TimeBack integrati
|
|
|
15723
15664
|
]);
|
|
15724
15665
|
logger.newLine();
|
|
15725
15666
|
} catch (error) {
|
|
15726
|
-
|
|
15667
|
+
logAndExit(error, { prefix: "Failed to set up TimeBack" });
|
|
15727
15668
|
}
|
|
15728
15669
|
});
|
|
15729
15670
|
|
|
@@ -15784,7 +15725,7 @@ var updateCommand2 = new Command35("update").description("Update TimeBack integr
|
|
|
15784
15725
|
logger.newLine();
|
|
15785
15726
|
}
|
|
15786
15727
|
} catch (error) {
|
|
15787
|
-
|
|
15728
|
+
logAndExit(error, { prefix: "Failed to update TimeBack" });
|
|
15788
15729
|
}
|
|
15789
15730
|
});
|
|
15790
15731
|
|
|
@@ -15910,13 +15851,7 @@ var bundleCommand = new Command38("bundle").description("Bundle and inspect the
|
|
|
15910
15851
|
]);
|
|
15911
15852
|
logger.newLine();
|
|
15912
15853
|
} catch (error) {
|
|
15913
|
-
|
|
15914
|
-
logger.error(`Failed to bundle: ${getErrorMessage(error)}`);
|
|
15915
|
-
if (error instanceof Error && error.stack) {
|
|
15916
|
-
logger.remark(error.stack);
|
|
15917
|
-
}
|
|
15918
|
-
logger.newLine();
|
|
15919
|
-
process.exit(1);
|
|
15854
|
+
logAndExit(error, { prefix: "Failed to bundle" });
|
|
15920
15855
|
}
|
|
15921
15856
|
});
|
|
15922
15857
|
|
|
@@ -15979,11 +15914,7 @@ async function runViteConfig() {
|
|
|
15979
15914
|
]);
|
|
15980
15915
|
logger.newLine();
|
|
15981
15916
|
} catch (error) {
|
|
15982
|
-
|
|
15983
|
-
`Failed to add Vite plugin: ${error instanceof Error ? error.message : String(error)}`
|
|
15984
|
-
);
|
|
15985
|
-
logger.newLine();
|
|
15986
|
-
process.exit(1);
|
|
15917
|
+
logAndExit(error, { prefix: "Failed to add Vite plugin" });
|
|
15987
15918
|
}
|
|
15988
15919
|
}
|
|
15989
15920
|
|
|
@@ -16172,6 +16103,7 @@ export {
|
|
|
16172
16103
|
importTypescriptDefault,
|
|
16173
16104
|
importTypescriptFile,
|
|
16174
16105
|
integrationChangeDetectors,
|
|
16106
|
+
isConfigError,
|
|
16175
16107
|
isGodotProject,
|
|
16176
16108
|
isIgnoredByGitignore,
|
|
16177
16109
|
isNonInteractive,
|
|
@@ -16184,6 +16116,7 @@ export {
|
|
|
16184
16116
|
loadConfigAndSetWorkspace,
|
|
16185
16117
|
loadConfigWithPath,
|
|
16186
16118
|
loadDeployConfig,
|
|
16119
|
+
loadDeployFullConfig,
|
|
16187
16120
|
loadGameStore,
|
|
16188
16121
|
loadGitignorePatterns,
|
|
16189
16122
|
logAndExit,
|
package/dist/utils.js
CHANGED
|
@@ -818,12 +818,14 @@ function displayApiError(error, indent) {
|
|
|
818
818
|
}
|
|
819
819
|
function displayConfigError(error, indent) {
|
|
820
820
|
const spaces = " ".repeat(indent);
|
|
821
|
-
console.error(`${spaces}${redBright("\u2716")} ${bold(
|
|
821
|
+
console.error(`${spaces}${redBright("\u2716")} ${bold("Configuration Error")}`);
|
|
822
|
+
console.error("");
|
|
823
|
+
console.error(`${spaces} ${error.message}`);
|
|
822
824
|
if (error.field) {
|
|
823
|
-
console.error(
|
|
825
|
+
console.error(` ${spaces} ${dim("Field:")} ${error.field}`);
|
|
824
826
|
}
|
|
825
827
|
if (error.suggestion) {
|
|
826
|
-
console.error(
|
|
828
|
+
console.error(` ${spaces} ${dim("Fix:")} ${error.suggestion}`);
|
|
827
829
|
}
|
|
828
830
|
}
|
|
829
831
|
function displayGenericError(error, indent) {
|
|
@@ -2606,7 +2608,7 @@ import { join as join13 } from "path";
|
|
|
2606
2608
|
// package.json with { type: 'json' }
|
|
2607
2609
|
var package_default2 = {
|
|
2608
2610
|
name: "playcademy",
|
|
2609
|
-
version: "0.16.
|
|
2611
|
+
version: "0.16.13",
|
|
2610
2612
|
type: "module",
|
|
2611
2613
|
exports: {
|
|
2612
2614
|
".": {
|
package/dist/version.js
CHANGED