@ganglion/xacpx-relay 0.2.2 → 0.4.0
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 +17 -0
- package/dist/relay-web/assets/{BrandLogo.vue_vue_type_script_setup_true_lang-CSPZDDtK.js → BrandLogo.vue_vue_type_script_setup_true_lang-XzbW2yS0.js} +1 -1
- package/dist/relay-web/assets/DashboardView-DRJKYEs5.js +271 -0
- package/dist/relay-web/assets/{DashboardView-AMivJ-D8.css → DashboardView-Di-qpvLF.css} +1 -1
- package/dist/relay-web/assets/LoginView-DNZBIoE-.js +1 -0
- package/dist/relay-web/assets/SettingsView-BUnfSfl7.js +6 -0
- package/dist/relay-web/assets/{index-DC1zO5jV.css → index-BD4N8wJc.css} +1 -1
- package/dist/relay-web/assets/index-CyMgv7-t.js +98 -0
- package/dist/relay-web/assets/{theme-CaepIjgl.js → theme-BYwU4uAb.js} +1 -1
- package/dist/relay-web/index.html +2 -2
- package/dist/stores/instances.d.ts +1 -0
- package/package.json +1 -1
- package/dist/relay-web/assets/DashboardView-Bhx2FJSv.js +0 -256
- package/dist/relay-web/assets/LoginView-CYhQnBi-.js +0 -1
- package/dist/relay-web/assets/SettingsView-hmSvIsKD.js +0 -6
- package/dist/relay-web/assets/index-DE2bTqBl.js +0 -80
package/dist/cli.js
CHANGED
|
@@ -331,6 +331,12 @@ class InstanceStore {
|
|
|
331
331
|
this.db.run("DELETE FROM instances WHERE id = ?", [instanceId]);
|
|
332
332
|
return true;
|
|
333
333
|
}
|
|
334
|
+
rename(instanceId, accountId, name) {
|
|
335
|
+
if (!this.getOwned(instanceId, accountId))
|
|
336
|
+
return false;
|
|
337
|
+
this.db.run("UPDATE instances SET name = ? WHERE id = ?", [name, instanceId]);
|
|
338
|
+
return true;
|
|
339
|
+
}
|
|
334
340
|
prunePairingTokens(now) {
|
|
335
341
|
const iso = now.toISOString();
|
|
336
342
|
const row = this.db.get("SELECT COUNT(*) AS n FROM pairing_tokens WHERE expires_at <= ? OR used_at IS NOT NULL", [iso]);
|
|
@@ -732,6 +738,17 @@ function createApp(deps) {
|
|
|
732
738
|
const issued = deps.instances.issuePairingToken(account.id, body.name, pairingTtlMs);
|
|
733
739
|
return c.json({ token: issued.token, expiresAt: issued.expiresAt });
|
|
734
740
|
});
|
|
741
|
+
app.patch("/api/instances/:id", async (c) => {
|
|
742
|
+
if (!requireJson(c.req.header("content-type")))
|
|
743
|
+
return c.json({ error: "unsupported-media-type" }, 415);
|
|
744
|
+
const account = c.get("account");
|
|
745
|
+
const body = await c.req.json().catch(() => ({}));
|
|
746
|
+
const name = (body.name ?? "").trim();
|
|
747
|
+
if (!name)
|
|
748
|
+
return c.json({ error: "invalid-name" }, 400);
|
|
749
|
+
const ok = deps.instances.rename(c.req.param("id"), account.id, name);
|
|
750
|
+
return ok ? c.json({ ok: true }) : c.json({ error: "not-found" }, 404);
|
|
751
|
+
});
|
|
735
752
|
app.delete("/api/instances/:id", (c) => {
|
|
736
753
|
const account = c.get("account");
|
|
737
754
|
const removed = deps.instances.remove(c.req.param("id"), account.id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e,
|
|
1
|
+
import{d as e,c as s,Q as a,o as n}from"./index-CyMgv7-t.js";const o={class:"flex items-center gap-2 select-none"},d=e({__name:"BrandLogo",setup(r){return(p,t)=>(n(),s("div",o,[...t[0]||(t[0]=[a('<svg data-test="brand-x" width="22" height="22" viewBox="0 0 24 24" fill="none" aria-hidden="true"><defs><linearGradient id="xacpxBrand" x1="3" y1="3" x2="21" y2="21" gradientUnits="userSpaceOnUse"><stop stop-color="#4F9BF5"></stop><stop offset="1" stop-color="#69D689"></stop></linearGradient></defs><path d="M5 5 L19 19 M19 5 L5 19" stroke="url(#xacpxBrand)" stroke-width="3.2" stroke-linecap="round"></path></svg><span class="text-[15px] font-semibold tracking-tight text-fg">xacpx</span><span class="text-fg-muted text-xs">· relay</span>',3)])]))}});export{d as _};
|