@wervt/nuxt 0.2.10 → 0.2.11
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useUpdateAvailable, useWervtUpdate } from "../useWervtUpdate.js";
|
|
2
|
-
import { defineNuxtPlugin,
|
|
2
|
+
import { defineNuxtPlugin, onNuxtReady, useRuntimeConfig } from "#app";
|
|
3
3
|
//#region src/runtime/app/plugins/update.client.ts
|
|
4
4
|
const INTERVAL_MS = 6e4;
|
|
5
5
|
/** Focus and visibility changes come in bursts; one check covers them. */
|
|
@@ -16,14 +16,13 @@ var update_client_default = defineNuxtPlugin({
|
|
|
16
16
|
if (available.value || document.hidden || Date.now() - last < MIN_GAP_MS) return;
|
|
17
17
|
last = Date.now();
|
|
18
18
|
try {
|
|
19
|
-
const current = await getAppManifest();
|
|
20
19
|
const res = await fetch(`${url}?${last}`, {
|
|
21
20
|
cache: "no-store",
|
|
22
21
|
signal: AbortSignal.timeout(1e4)
|
|
23
22
|
});
|
|
24
23
|
if (!res.ok) return;
|
|
25
24
|
const latest = await res.json();
|
|
26
|
-
if (!latest.id || latest.id ===
|
|
25
|
+
if (!latest.id || latest.id === config.app.buildId) return;
|
|
27
26
|
available.value = true;
|
|
28
27
|
await nuxtApp.callHook("app:manifest:update", latest);
|
|
29
28
|
if (mode === "banner") showBanner(useWervtUpdate().reload);
|
|
@@ -11,11 +11,10 @@ export declare const listTools: import("nuxt/server").EventHandler<Promise<{
|
|
|
11
11
|
}[]>>;
|
|
12
12
|
/** `POST /_wervt/tools/:name` with the arguments as JSON body: runs the tool's handler. */
|
|
13
13
|
export declare const runTool: import("nuxt/server").EventHandler<Promise<{
|
|
14
|
-
result?: undefined;
|
|
15
14
|
error: string;
|
|
16
15
|
issues?: undefined;
|
|
17
|
-
} | {
|
|
18
16
|
result?: undefined;
|
|
17
|
+
} | {
|
|
19
18
|
error: string;
|
|
20
19
|
issues: {
|
|
21
20
|
readonly root?: [string, ...string[]];
|
|
@@ -24,6 +23,7 @@ export declare const runTool: import("nuxt/server").EventHandler<Promise<{
|
|
|
24
23
|
} | undefined;
|
|
25
24
|
readonly other?: [string, ...string[]];
|
|
26
25
|
};
|
|
26
|
+
result?: undefined;
|
|
27
27
|
} | {
|
|
28
28
|
error?: undefined;
|
|
29
29
|
issues?: undefined;
|