playcademy 0.14.15 → 0.14.16
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 +14 -1
- package/dist/utils.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7222,7 +7222,7 @@ import { join as join18 } from "path";
|
|
|
7222
7222
|
// package.json
|
|
7223
7223
|
var package_default2 = {
|
|
7224
7224
|
name: "playcademy",
|
|
7225
|
-
version: "0.14.
|
|
7225
|
+
version: "0.14.15",
|
|
7226
7226
|
type: "module",
|
|
7227
7227
|
exports: {
|
|
7228
7228
|
".": {
|
|
@@ -9133,6 +9133,7 @@ async function saveDeploymentState(game, backendMetadata, context2) {
|
|
|
9133
9133
|
|
|
9134
9134
|
// src/lib/deploy/secrets.ts
|
|
9135
9135
|
init_core();
|
|
9136
|
+
import { ApiError as ApiError2 } from "@playcademy/sdk";
|
|
9136
9137
|
function compareSecrets(current, previous) {
|
|
9137
9138
|
const currentKeys = Object.keys(current);
|
|
9138
9139
|
const changes = [];
|
|
@@ -9158,6 +9159,10 @@ async function fetchSecretsForDeployment(slug) {
|
|
|
9158
9159
|
const keys = Object.keys(secrets);
|
|
9159
9160
|
return { secrets, keys };
|
|
9160
9161
|
} catch (error) {
|
|
9162
|
+
if (error instanceof ApiError2 && error.status === 404) {
|
|
9163
|
+
logger.debug(`[Secrets] No secrets configured for game (404)`);
|
|
9164
|
+
return { secrets: {}, keys: [] };
|
|
9165
|
+
}
|
|
9161
9166
|
logger.warn(
|
|
9162
9167
|
`Could not fetch secrets: ${error instanceof Error ? error.message : String(error)}`
|
|
9163
9168
|
);
|
|
@@ -9210,6 +9215,14 @@ async function prepareDeploymentContext(options) {
|
|
|
9210
9215
|
if (!existingGame && finalConfig.slug) {
|
|
9211
9216
|
existingGame = existingGames.find((g) => g.slug === finalConfig.slug);
|
|
9212
9217
|
}
|
|
9218
|
+
if (existingGame) {
|
|
9219
|
+
const currentUser = await client.users.me();
|
|
9220
|
+
const isAdmin = currentUser.role === "admin";
|
|
9221
|
+
const isOwner = existingGame.developerId === currentUser.id;
|
|
9222
|
+
if (!isAdmin && !isOwner) {
|
|
9223
|
+
throw new Error(`Unable to deploy '${existingGame.slug}': You do not own this game`);
|
|
9224
|
+
}
|
|
9225
|
+
}
|
|
9213
9226
|
const gameIsDeployed = existingGame ? isGameDeployed(existingGame) : false;
|
|
9214
9227
|
if (existingGame && gameIsDeployed) {
|
|
9215
9228
|
finalConfig.slug = existingGame.slug;
|
package/dist/utils.js
CHANGED
package/dist/version.js
CHANGED