@hot-updater/console 0.18.4 → 0.18.5
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/assets/index-TesXXS69.css +1 -0
- package/dist/assets/index-lDBYQmsv.js +27 -0
- package/dist/index.cjs +18 -1
- package/dist/index.d.cts +34 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.html +2 -2
- package/dist/index.js +18 -1
- package/package.json +4 -4
- package/dist/assets/index-BFsYBw_S.js +0 -27
- package/dist/assets/index-Q65436jZ.css +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1911,10 +1911,12 @@ const prepareConfig = async () => {
|
|
|
1911
1911
|
try {
|
|
1912
1912
|
const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
|
|
1913
1913
|
const databasePlugin = await config?.database({ cwd: (0, __hot_updater_plugin_core.getCwd)() }) ?? null;
|
|
1914
|
+
const storagePlugin = await config?.storage({ cwd: (0, __hot_updater_plugin_core.getCwd)() }) ?? null;
|
|
1914
1915
|
if (!databasePlugin) throw new Error("Database plugin initialization failed");
|
|
1915
1916
|
return {
|
|
1916
1917
|
config,
|
|
1917
|
-
databasePlugin
|
|
1918
|
+
databasePlugin,
|
|
1919
|
+
storagePlugin
|
|
1918
1920
|
};
|
|
1919
1921
|
} catch (error) {
|
|
1920
1922
|
console.error("Error during configuration initialization:", error);
|
|
@@ -1995,6 +1997,21 @@ const rpc = new Hono().get("/config", async (c) => {
|
|
|
1995
1997
|
if (error && typeof error === "object" && "message" in error) return c.json({ error: error.message }, 500);
|
|
1996
1998
|
return c.json({ error: "Unknown error" }, 500);
|
|
1997
1999
|
}
|
|
2000
|
+
}).delete("/bundles/:bundleId", typiaValidator("param", paramBundleIdSchema), async (c) => {
|
|
2001
|
+
try {
|
|
2002
|
+
const { bundleId } = c.req.valid("param");
|
|
2003
|
+
const { databasePlugin, storagePlugin } = await prepareConfig();
|
|
2004
|
+
const deleteBundle = await databasePlugin.getBundleById(bundleId);
|
|
2005
|
+
if (!deleteBundle) return c.json({ error: "Bundle not found" }, 404);
|
|
2006
|
+
await databasePlugin.deleteBundle(deleteBundle);
|
|
2007
|
+
await databasePlugin.commitBundle();
|
|
2008
|
+
await storagePlugin.deleteBundle(bundleId);
|
|
2009
|
+
return c.json({ success: true });
|
|
2010
|
+
} catch (error) {
|
|
2011
|
+
console.error("Error during bundle deletion:", error);
|
|
2012
|
+
if (error && typeof error === "object" && "message" in error) return c.json({ error: error.message }, 500);
|
|
2013
|
+
return c.json({ error: "Unknown error" }, 500);
|
|
2014
|
+
}
|
|
1998
2015
|
});
|
|
1999
2016
|
|
|
2000
2017
|
//#endregion
|
package/dist/index.d.cts
CHANGED
|
@@ -143,6 +143,40 @@ declare const app: Hono<{}, {
|
|
|
143
143
|
outputFormat: "json";
|
|
144
144
|
status: 500;
|
|
145
145
|
};
|
|
146
|
+
$delete: {
|
|
147
|
+
input: {
|
|
148
|
+
param: {
|
|
149
|
+
bundleId: string;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
output: {
|
|
153
|
+
error: string;
|
|
154
|
+
};
|
|
155
|
+
outputFormat: "json";
|
|
156
|
+
status: 404;
|
|
157
|
+
} | {
|
|
158
|
+
input: {
|
|
159
|
+
param: {
|
|
160
|
+
bundleId: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
output: {
|
|
164
|
+
success: boolean;
|
|
165
|
+
};
|
|
166
|
+
outputFormat: "json";
|
|
167
|
+
status: hono_utils_http_status0.StatusCode;
|
|
168
|
+
} | {
|
|
169
|
+
input: {
|
|
170
|
+
param: {
|
|
171
|
+
bundleId: string;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
output: {
|
|
175
|
+
error: string;
|
|
176
|
+
};
|
|
177
|
+
outputFormat: "json";
|
|
178
|
+
status: 500;
|
|
179
|
+
};
|
|
146
180
|
};
|
|
147
181
|
} & {
|
|
148
182
|
"*": {
|
package/dist/index.d.ts
CHANGED
|
@@ -143,6 +143,40 @@ declare const app: Hono<{}, {
|
|
|
143
143
|
outputFormat: "json";
|
|
144
144
|
status: 500;
|
|
145
145
|
};
|
|
146
|
+
$delete: {
|
|
147
|
+
input: {
|
|
148
|
+
param: {
|
|
149
|
+
bundleId: string;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
output: {
|
|
153
|
+
error: string;
|
|
154
|
+
};
|
|
155
|
+
outputFormat: "json";
|
|
156
|
+
status: 404;
|
|
157
|
+
} | {
|
|
158
|
+
input: {
|
|
159
|
+
param: {
|
|
160
|
+
bundleId: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
output: {
|
|
164
|
+
success: boolean;
|
|
165
|
+
};
|
|
166
|
+
outputFormat: "json";
|
|
167
|
+
status: hono_utils_http_status0.StatusCode;
|
|
168
|
+
} | {
|
|
169
|
+
input: {
|
|
170
|
+
param: {
|
|
171
|
+
bundleId: string;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
output: {
|
|
175
|
+
error: string;
|
|
176
|
+
};
|
|
177
|
+
outputFormat: "json";
|
|
178
|
+
status: 500;
|
|
179
|
+
};
|
|
146
180
|
};
|
|
147
181
|
} & {
|
|
148
182
|
"*": {
|
package/dist/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<link rel="icon" type="image/x-icon" href="/assets/favicon-BkwcEHsj.ico" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Hot Updater Console</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-lDBYQmsv.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-TesXXS69.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|
package/dist/index.js
CHANGED
|
@@ -1911,10 +1911,12 @@ const prepareConfig = async () => {
|
|
|
1911
1911
|
try {
|
|
1912
1912
|
const config = await loadConfig(null);
|
|
1913
1913
|
const databasePlugin = await config?.database({ cwd: getCwd() }) ?? null;
|
|
1914
|
+
const storagePlugin = await config?.storage({ cwd: getCwd() }) ?? null;
|
|
1914
1915
|
if (!databasePlugin) throw new Error("Database plugin initialization failed");
|
|
1915
1916
|
return {
|
|
1916
1917
|
config,
|
|
1917
|
-
databasePlugin
|
|
1918
|
+
databasePlugin,
|
|
1919
|
+
storagePlugin
|
|
1918
1920
|
};
|
|
1919
1921
|
} catch (error) {
|
|
1920
1922
|
console.error("Error during configuration initialization:", error);
|
|
@@ -1995,6 +1997,21 @@ const rpc = new Hono().get("/config", async (c) => {
|
|
|
1995
1997
|
if (error && typeof error === "object" && "message" in error) return c.json({ error: error.message }, 500);
|
|
1996
1998
|
return c.json({ error: "Unknown error" }, 500);
|
|
1997
1999
|
}
|
|
2000
|
+
}).delete("/bundles/:bundleId", typiaValidator("param", paramBundleIdSchema), async (c) => {
|
|
2001
|
+
try {
|
|
2002
|
+
const { bundleId } = c.req.valid("param");
|
|
2003
|
+
const { databasePlugin, storagePlugin } = await prepareConfig();
|
|
2004
|
+
const deleteBundle = await databasePlugin.getBundleById(bundleId);
|
|
2005
|
+
if (!deleteBundle) return c.json({ error: "Bundle not found" }, 404);
|
|
2006
|
+
await databasePlugin.deleteBundle(deleteBundle);
|
|
2007
|
+
await databasePlugin.commitBundle();
|
|
2008
|
+
await storagePlugin.deleteBundle(bundleId);
|
|
2009
|
+
return c.json({ success: true });
|
|
2010
|
+
} catch (error) {
|
|
2011
|
+
console.error("Error during bundle deletion:", error);
|
|
2012
|
+
if (error && typeof error === "object" && "message" in error) return c.json({ error: error.message }, 500);
|
|
2013
|
+
return c.json({ error: "Unknown error" }, 500);
|
|
2014
|
+
}
|
|
1998
2015
|
});
|
|
1999
2016
|
|
|
2000
2017
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/console",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.18.
|
|
4
|
+
"version": "0.18.5",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"package.json"
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"vite": "^6.1.0",
|
|
49
49
|
"vite-plugin-solid": "^2.11.1",
|
|
50
50
|
"vite-tsconfig-paths": "^5.1.4",
|
|
51
|
-
"@hot-updater/mock": "0.18.
|
|
51
|
+
"@hot-updater/mock": "0.18.5"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"solid-icons": "^1.1.0",
|
|
55
|
-
"@hot-updater/core": "0.18.
|
|
56
|
-
"@hot-updater/plugin-core": "0.18.
|
|
55
|
+
"@hot-updater/core": "0.18.5",
|
|
56
|
+
"@hot-updater/plugin-core": "0.18.5"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "vite build --mode client && tsdown",
|