@termix-ssh/plugin-sdk 1.0.13 → 1.0.17

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/PLUGIN-GUIDE.md +104 -69
  3. package/dist/backend.d.ts +500 -1
  4. package/dist/backend.js +7 -0
  5. package/dist/capabilities.js +4 -0
  6. package/dist/frontend.d.ts +45 -0
  7. package/dist/host/{PluginsTab-OXQQ7M4I.js → PluginsTab-YAGYRBIE.js} +3 -3
  8. package/dist/host/{chunk-T2PZWXFJ.js → chunk-2MU6WNSX.js} +1 -1
  9. package/dist/host/{chunk-54KCK6IZ.js → chunk-446UEDSK.js} +6 -2
  10. package/dist/host/{chunk-CN5UBTBP.js → chunk-7LEJ3HYF.js} +49 -3
  11. package/dist/host/{chunk-CALNJCHN.js → chunk-J2AILBXM.js} +561 -400
  12. package/dist/host/{chunk-ERGN4YW6.js → chunk-LQKK2JJA.js} +5 -1
  13. package/dist/host/core-classes.json +1 -1
  14. package/dist/host/{linked-server-5VFO4XQB.js → linked-server-OUF3POT7.js} +5 -3
  15. package/dist/host/{rbac-api-5YMBJAO5.js → rbac-api-LZVENREG.js} +1 -1
  16. package/dist/host/testing-host.js +4 -4
  17. package/dist/host/types/src/types/index.d.ts +10 -0
  18. package/dist/host/types/src/types/onboarding.d.ts +0 -1
  19. package/dist/host/types/src/types/ui-types.d.ts +3 -1
  20. package/dist/host/types/src/ui/api/auth-methods-api.d.ts +2 -0
  21. package/dist/host/types/src/ui/api/settings-api.d.ts +6 -0
  22. package/dist/host/types/src/ui/api/ssh-host-management-api.d.ts +6 -0
  23. package/dist/host/types/src/ui/auth/Auth.d.ts +1 -0
  24. package/dist/host/types/src/ui/lib/linked-server.d.ts +2 -0
  25. package/dist/host/types/src/ui/main-axios.d.ts +2 -2
  26. package/dist/host/types/src/ui/plugin-host/NativeView.d.ts +19 -0
  27. package/dist/host/types/src/ui/plugin-host/sdk-ui.d.ts +4 -8
  28. package/dist/host/types/src/ui/shell/CompanionFrame.d.ts +11 -0
  29. package/dist/host/types/src/ui/shell/companions.d.ts +63 -0
  30. package/dist/host/types/src/ui/sidebar/AuthEnrollmentSections.d.ts +4 -1
  31. package/dist/host/ui.js +171 -820
  32. package/dist/host/{use-permissions-ISEDRY3J.js → use-permissions-BYCDS5PD.js} +1 -1
  33. package/dist/manifest.d.ts +1 -1
  34. package/dist/manifest.js +1 -1
  35. package/dist/testing.d.ts +26 -2
  36. package/dist/testing.js +89 -1
  37. package/dist/vitest-preset.js +23 -0
  38. package/package.json +1 -1
  39. package/schema/manifest.schema.json +4 -0
  40. package/dist/host/types/src/ui/api/sync-api.d.ts +0 -93
  41. package/dist/host/types/src/ui/auth/ElectronLoginForm.d.ts +0 -9
  42. package/dist/host/types/src/ui/hooks/use-sync-status.d.ts +0 -4
  43. package/dist/host/types/src/ui/lib/sync-status.d.ts +0 -6
  44. package/dist/host/types/src/ui/settings/sync/LinkServerDialog.d.ts +0 -12
  45. package/dist/host/types/src/ui/settings/sync/ProxySettingsFields.d.ts +0 -15
  46. package/dist/host/types/src/ui/settings/sync/saved-servers.d.ts +0 -3
@@ -26,7 +26,7 @@ var inFlight = null;
26
26
  function load() {
27
27
  if (cache) return Promise.resolve(cache);
28
28
  if (inFlight) return inFlight;
29
- inFlight = import("./rbac-api-5YMBJAO5.js").then(({ getMyPermissions }) => getMyPermissions()).then((result) => {
29
+ inFlight = import("./rbac-api-LZVENREG.js").then(({ getMyPermissions }) => getMyPermissions()).then((result) => {
30
30
  cache = {
31
31
  permissions: result.permissions ?? [],
32
32
  isAdmin: !!result.isAdmin
@@ -7,10 +7,10 @@ import {
7
7
  Trash,
8
8
  cn,
9
9
  useAreaPreferences
10
- } from "./chunk-ERGN4YW6.js";
10
+ } from "./chunk-LQKK2JJA.js";
11
11
  import {
12
12
  isElectron
13
- } from "./chunk-CN5UBTBP.js";
13
+ } from "./chunk-7LEJ3HYF.js";
14
14
  import {
15
15
  __commonJS,
16
16
  __toESM,
@@ -2382,6 +2382,9 @@ var CAPABILITY_CATALOG = [
2382
2382
  entry("users:impersonate", "high"),
2383
2383
  entry("db:core-refs", "high"),
2384
2384
  entry("auth:provide", "high"),
2385
+ entry("auth:policy", "high"),
2386
+ entry("sync:provide", "high"),
2387
+ entry("ssh:transport", "high"),
2385
2388
  entry("device:serial", "high"),
2386
2389
  entry("notify:hub", "high"),
2387
2390
  entry("ui:layout", "high"),
@@ -2395,6 +2398,7 @@ var CAPABILITY_CATALOG = [
2395
2398
  entry("network:probe", "medium"),
2396
2399
  entry("hosts:status-provide", "medium"),
2397
2400
  entry("hosts:activity-provide", "medium"),
2401
+ entry("hosts:lock", "medium"),
2398
2402
  entry("users:read", "medium"),
2399
2403
  entry("events:core", "medium"),
2400
2404
  entry("notify:send", "medium"),
@@ -7,6 +7,7 @@ import {
7
7
 
8
8
  // src/ui/lib/linked-server.ts
9
9
  init_define_import_meta_env();
10
+ import { useEffect as useEffect2, useState as useState2 } from "react";
10
11
 
11
12
  // src/ui/lib/electron.ts
12
13
  init_define_import_meta_env();
@@ -4932,6 +4933,14 @@ async function bulkUpdateSSHHosts(hostIds, updates) {
4932
4933
  handleApiError(error, "bulk update SSH hosts");
4933
4934
  }
4934
4935
  }
4936
+ async function getHostPolicy() {
4937
+ try {
4938
+ const response = await sshHostApi.get("/policy");
4939
+ return response.data;
4940
+ } catch (error) {
4941
+ handleApiError(error, "load host policy");
4942
+ }
4943
+ }
4935
4944
  async function reorderSSHHosts(positions) {
4936
4945
  try {
4937
4946
  const response = await sshHostApi.put("/reorder", { positions });
@@ -5424,7 +5433,6 @@ init_define_import_meta_env();
5424
5433
  init_define_import_meta_env();
5425
5434
  var LEGACY_SEEN = Object.freeze({
5426
5435
  plugins: 1,
5427
- "desktop-sync": 1,
5428
5436
  preset: 1,
5429
5437
  appearance: 1,
5430
5438
  security: 1
@@ -5588,6 +5596,24 @@ async function updateSessionTimeout(timeoutHours) {
5588
5596
  handleApiError(error, "update session timeout");
5589
5597
  }
5590
5598
  }
5599
+ async function getHttpsSettings() {
5600
+ try {
5601
+ const response = await authApi.get("/users/https-settings");
5602
+ return response.data;
5603
+ } catch (error) {
5604
+ handleApiError(error, "fetch HTTPS settings");
5605
+ }
5606
+ }
5607
+ async function updateHttpsSettings(forceHttps) {
5608
+ try {
5609
+ const response = await authApi.patch("/users/https-settings", {
5610
+ forceHttps
5611
+ });
5612
+ return response.data;
5613
+ } catch (error) {
5614
+ handleApiError(error, "update HTTPS settings");
5615
+ }
5616
+ }
5591
5617
  async function getBranding() {
5592
5618
  try {
5593
5619
  const response = await authApi.get("/users/branding");
@@ -6290,7 +6316,7 @@ async function updateRole(roleId, roleData) {
6290
6316
  try {
6291
6317
  const response = await rbacApi.put(`/rbac/roles/${roleId}`, roleData);
6292
6318
  if (roleData.permissions) {
6293
- const { notifyPermissionsChanged } = await import("./use-permissions-ISEDRY3J.js");
6319
+ const { notifyPermissionsChanged } = await import("./use-permissions-BYCDS5PD.js");
6294
6320
  notifyPermissionsChanged();
6295
6321
  }
6296
6322
  return response.data;
@@ -6872,7 +6898,7 @@ function createRemoteOriginApiInstance(path) {
6872
6898
  });
6873
6899
  instance.interceptors.request.use(
6874
6900
  async (config) => {
6875
- const { getLinkedSession: getLinkedSession2 } = await import("./linked-server-5VFO4XQB.js");
6901
+ const { getLinkedSession: getLinkedSession2 } = await import("./linked-server-OUF3POT7.js");
6876
6902
  const linked = await getLinkedSession2();
6877
6903
  config.baseURL = linked ? `${linked.serverUrl}${path}` : "http://no-server-configured";
6878
6904
  if (config.headers.set) {
@@ -7261,6 +7287,22 @@ function notifySyncChanged() {
7261
7287
  cached = null;
7262
7288
  window.dispatchEvent(new CustomEvent(SYNC_CHANGED_EVENT));
7263
7289
  }
7290
+ function useDesktopLinked() {
7291
+ const [linked, setLinked] = useState2(false);
7292
+ useEffect2(() => {
7293
+ let live = true;
7294
+ const read = () => void getLinkedSession().then((session) => {
7295
+ if (live) setLinked(!!session);
7296
+ });
7297
+ read();
7298
+ window.addEventListener(SYNC_CHANGED_EVENT, read);
7299
+ return () => {
7300
+ live = false;
7301
+ window.removeEventListener(SYNC_CHANGED_EVENT, read);
7302
+ };
7303
+ }, []);
7304
+ return linked;
7305
+ }
7264
7306
 
7265
7307
  export {
7266
7308
  getPluginStoreState,
@@ -7300,11 +7342,13 @@ export {
7300
7342
  createSSHHost,
7301
7343
  updateSSHHost,
7302
7344
  bulkUpdateSSHHosts,
7345
+ getHostPolicy,
7303
7346
  reorderSSHHosts,
7304
7347
  deleteSSHHost,
7305
7348
  websocketAuthProtocols,
7306
7349
  getLinkedSession,
7307
7350
  notifySyncChanged,
7351
+ useDesktopLinked,
7308
7352
  resolveConnectionOrigin,
7309
7353
  buildOriginWsUrl,
7310
7354
  getAllServerStatuses,
@@ -7328,6 +7372,8 @@ export {
7328
7372
  updateLogLevel,
7329
7373
  getSessionTimeout,
7330
7374
  updateSessionTimeout,
7375
+ getHttpsSettings,
7376
+ updateHttpsSettings,
7331
7377
  getBranding,
7332
7378
  hydrateLocalSharedHostAuth,
7333
7379
  getConnectedRemoteApi,