plugins: special uris exposed

Massimo Melina committed Mar 26, 2023 at 18:08 UTC 4ac1321329d59cdab7bb5ed873734afbe1275c88
2 files changed +8 -1
dev-plugins.md
+5
@@ -222,6 +222,11 @@ HFS will scan through them in alphabetical order searching for a compatible one.
222
223 ## API version history
224
225 +- 7 (v0.42.0)
226 + - event.fileMenu
227 + - HFS.SPECIAL_URI, PLUGINS_PUB_URI, FRONTEND_URI,
228 +- 6 (v0.38.0)
229 + - config.frontend
230 - 5 (v0.33.0)
231 - event.afterEntryName
232 - 4.1 (v0.23.4)
src/serveGuiFiles.ts
+3 -1
@@ -9,7 +9,8 @@ import {
9 HTTP_NO_CONTENT,
10 HTTP_NOT_FOUND,
11 PLUGINS_PUB_URI,
12 - VERSION
12 + VERSION,
13 + SPECIAL_URI
14 } from './const'
15 import { serveFile } from './serveFile'
16 import { getPluginConfigFields, getPluginInfo, mapPlugins, pluginsConfig } from './plugins'
@@ -98,6 +99,7 @@ async function treatIndex(ctx: Koa.Context, filesUri: string, body: string) {
99 HFS = ${JSON.stringify({
100 VERSION,
101 API_VERSION,
102 + SPECIAL_URI, PLUGINS_PUB_URI, FRONTEND_URI,
103 session: session instanceof ApiError ? null : session,
104 plugins,
105 prefixUrl: ctx.state.revProxyPath,