@termix-ssh/plugin-sdk 1.0.7 → 1.0.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.8
4
+
5
+ ### Added
6
+
7
+ - `publicRateLimit` on `ctx.http.router()`, for a plugin whose public routes serve a proxied page
8
+
3
9
  ## 1.0.7
4
10
 
5
11
  ### Fixed
package/PLUGIN-GUIDE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Termix plugin guide
2
2
 
3
- SDK 1.0.7 | Plugin API 1.2.0
3
+ SDK 1.0.8 | Plugin API 1.2.0
4
4
 
5
5
  This guide is for anyone, person or AI coding tool, building a Termix plugin. It ships inside
6
6
  `@termix-ssh/plugin-sdk`, so the copy in your `node_modules` always matches the SDK you have installed.
@@ -283,7 +283,8 @@ router.post("/notes", async (req, res) => {
283
283
  - The `@openapi` path is the full path, starting with `/plugin-api/<id>/`. `build` turns these into
284
284
  `dist/openapi.json` and the docs site renders them.
285
285
  - `ctx.http.router({ public: ["/webhook/:token"], bodyLimit: "20mb", rawBody: false })`. Public routes
286
- have no actor: check their token yourself and rate limit them.
286
+ have no actor: check their token yourself. Core allows 120 public requests a minute per address;
287
+ `publicRateLimit` raises that for a proxied page that loads its own assets.
287
288
  - `ctx.http.baseUrl(req)` is the public address, for callback URLs.
288
289
  - `ctx.ws.route("/live", (socket, conn) => ...)`. Long lived sockets should check
289
290
  `conn.isDataUnlocked()` per message.
package/dist/backend.d.ts CHANGED
@@ -303,6 +303,13 @@ export interface PluginRouterOptions {
303
303
  * (multer, a raw body for signature checking, a proxied stream).
304
304
  */
305
305
  rawBody?: boolean;
306
+ /**
307
+ * Requests per minute one address may make to this plugin's public routes.
308
+ * Defaults to 120, which a proxied page loading its own scripts and images
309
+ * can pass on its own. Capped at 10000, and an admin's
310
+ * TERMIX_PLUGIN_PUBLIC_RATE_LIMIT wins over it.
311
+ */
312
+ publicRateLimit?: number;
306
313
  }
307
314
  /**
308
315
  * HTTP routes, served at /plugin-api/<id>/ by the main backend server.
@@ -52016,6 +52016,8 @@ var en_default = {
52016
52016
  pinAppRailDesc: "Keep the left sidebar app rail always expanded instead of expanding on hover",
52017
52017
  expandAppRailOnHover: "Expand App Rail on Hover",
52018
52018
  expandAppRailOnHoverDesc: "Allow the left sidebar app rail to expand when the pointer moves over it",
52019
+ appRailHoverPushesContent: "Push content when it expands",
52020
+ appRailHoverPushesContentDesc: "Make room for the expanded rail instead of opening it over the page. Open sessions, like remote desktop, resize each time",
52019
52021
  showPinAppRailButton: "Show Pin App Rail Button",
52020
52022
  showPinAppRailButtonDesc: "Show a button in the app rail to pin it open. Off by default.",
52021
52023
  settingsNavigation: "Navigation",
@@ -53584,7 +53586,7 @@ async function pluginWsUrl(pluginId, path2, options2 = {}) {
53584
53586
  }
53585
53587
  const token = await fetchSocketTicket() ?? localStorage.getItem("jwt");
53586
53588
  const protocols2 = websocketAuthProtocols(token);
53587
- const devProxy = !define_import_meta_env_default.VITE_API_HOST && (window.location.port === "3000" || window.location.port === "5173");
53589
+ const devProxy = !define_import_meta_env_default.VITE_API_HOST;
53588
53590
  const wsProtocol = window.location.protocol === "https:" ? "wss" : "ws";
53589
53591
  if (devProxy) {
53590
53592
  return {
@@ -40,7 +40,7 @@ import {
40
40
  setShellCallbacks,
41
41
  setShellHosts,
42
42
  setShellLayoutProvider
43
- } from "./chunk-LKN6OILD.js";
43
+ } from "./chunk-G346FUE4.js";
44
44
  import {
45
45
  setPermissionsForTesting
46
46
  } from "./chunk-DIOJ3KW2.js";
package/dist/host/ui.js CHANGED
@@ -139,7 +139,7 @@ import {
139
139
  useSurfaceKind,
140
140
  useTheme,
141
141
  verifySecondFactor
142
- } from "./chunk-LKN6OILD.js";
142
+ } from "./chunk-G346FUE4.js";
143
143
  import "./chunk-DIOJ3KW2.js";
144
144
  import {
145
145
  TabProvider,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@termix-ssh/plugin-sdk",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "The contract between Termix core and a plugin: types, the capability catalog and the manifest schema.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {