mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 23:25:24 +00:00
chore: rename the plugin sdk to @termix-ssh/plugin-sdk
This commit is contained in:
1 parent
0c4f673318
commit
e608505b39
132 files changed
+250
-1336
No files matched your search
+1
-1
@@ -115,7 +115,7 @@ COPY --chown=node:node --from=backend-builder /app/dist/backend ./dist/backend
|
|||||||
# Plugins pinned in docker/bundled-plugins.json, resolved as dist/plugins by
|
# Plugins pinned in docker/bundled-plugins.json, resolved as dist/plugins by
|
||||||
# getBundledPluginsDir().
|
# getBundledPluginsDir().
|
||||||
COPY --chown=node:node --from=backend-builder /app/dist/plugins ./dist/plugins
|
COPY --chown=node:node --from=backend-builder /app/dist/plugins ./dist/plugins
|
||||||
# Target of node_modules/@termix/plugin-sdk, which core and the plugins import.
|
# Target of node_modules/@termix-ssh/plugin-sdk, which core and the plugins import.
|
||||||
COPY --chown=node:node --from=backend-builder /app/packages/plugin-sdk/package.json ./packages/plugin-sdk/package.json
|
COPY --chown=node:node --from=backend-builder /app/packages/plugin-sdk/package.json ./packages/plugin-sdk/package.json
|
||||||
COPY --chown=node:node --from=backend-builder /app/packages/plugin-sdk/dist ./packages/plugin-sdk/dist
|
COPY --chown=node:node --from=backend-builder /app/packages/plugin-sdk/dist ./packages/plugin-sdk/dist
|
||||||
# Pre-baked OPKSSH binary. The opkssh plugin uses it when its checksum
|
# Pre-baked OPKSSH binary. The opkssh plugin uses it when its checksum
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ http {
|
|||||||
root /app/html;
|
root /app/html;
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
expires off;
|
expires off;
|
||||||
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'wasm-unsafe-eval' 'sha256-gQLhWUEDVfLtBiv83VAckuSAVmhxOpOHbNpFbODgPN0='; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; connect-src 'self' http: https: ws: wss:; media-src 'self' data: blob: http: https:; worker-src 'self' blob:; frame-src http: https:; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'wasm-unsafe-eval' 'sha256-0FPou4vGHwupDie6Xais6VntpJ4yaK9E6TyhXLwZe8o='; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; connect-src 'self' http: https: ws: wss:; media-src 'self' data: blob: http: https:; worker-src 'self' blob:; frame-src http: https:; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
|
||||||
add_header X-Frame-Options "DENY" always;
|
add_header X-Frame-Options "DENY" always;
|
||||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||||
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
||||||
|
|||||||
+1
-1
@@ -144,7 +144,7 @@ http {
|
|||||||
root /app/html;
|
root /app/html;
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
expires off;
|
expires off;
|
||||||
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'wasm-unsafe-eval' 'sha256-gQLhWUEDVfLtBiv83VAckuSAVmhxOpOHbNpFbODgPN0='; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; connect-src 'self' http: https: ws: wss:; media-src 'self' data: blob: http: https:; worker-src 'self' blob:; frame-src http: https:; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'wasm-unsafe-eval' 'sha256-0FPou4vGHwupDie6Xais6VntpJ4yaK9E6TyhXLwZe8o='; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; connect-src 'self' http: https: ws: wss:; media-src 'self' data: blob: http: https:; worker-src 'self' blob:; frame-src http: https:; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
|
||||||
add_header X-Frame-Options "DENY" always;
|
add_header X-Frame-Options "DENY" always;
|
||||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||||
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
||||||
|
|||||||
Generated
+2
-1115
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -47,7 +47,7 @@
|
|||||||
"schema:generate": "node scripts/generate-dialect-schema.cjs",
|
"schema:generate": "node scripts/generate-dialect-schema.cjs",
|
||||||
"schema:check": "node scripts/generate-dialect-schema.cjs --check",
|
"schema:check": "node scripts/generate-dialect-schema.cjs --check",
|
||||||
"schema:migrations": "drizzle-kit generate --config=drizzle.config.sqlite.ts && drizzle-kit generate --config=drizzle.config.pg.ts && drizzle-kit generate --config=drizzle.config.mysql.ts",
|
"schema:migrations": "drizzle-kit generate --config=drizzle.config.sqlite.ts && drizzle-kit generate --config=drizzle.config.pg.ts && drizzle-kit generate --config=drizzle.config.mysql.ts",
|
||||||
"build:sdk": "npm run build --workspace @termix/plugin-sdk && node scripts/build-sdk-host.mjs",
|
"build:sdk": "npm run build --workspace @termix-ssh/plugin-sdk && node scripts/build-sdk-host.mjs",
|
||||||
"build:plugins": "node scripts/build-plugins.cjs"
|
"build:plugins": "node scripts/build-plugins.cjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -12,14 +12,14 @@
|
|||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
`@termix/plugin-sdk` is what every [Termix](https://github.com/Termix-SSH/Termix) plugin builds against, including the ones that ship with Termix. It has the types for a plugin's backend and frontend, table definitions, the manifest schema, test helpers, and the `termix-plugin` CLI. The easiest way to start is the [Termix Plugin Template](https://github.com/Termix-SSH/Termix-Plugin-Template).
|
`@termix-ssh/plugin-sdk` is what every [Termix](https://github.com/Termix-SSH/Termix) plugin builds against, including the ones that ship with Termix. It has the types for a plugin's backend and frontend, table definitions, the manifest schema, test helpers, and the `termix-plugin` CLI. The easiest way to start is the [Termix Plugin Template](https://github.com/Termix-SSH/Termix-Plugin-Template).
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
## What's Inside
|
## What's Inside
|
||||||
|
|
||||||
- **Backend:** the types for `activate(ctx)`, database and table helpers, host commands and SSH certificates
|
- **Backend:** the types for `activate(ctx)`, database and table helpers, host commands and SSH certificates
|
||||||
- **Frontend:** the types for `activate(app)`, plus `@termix/plugin-sdk/ui`, the components and theme Termix serves to plugins
|
- **Frontend:** the types for `activate(app)`, plus `@termix-ssh/plugin-sdk/ui`, the components and theme Termix serves to plugins
|
||||||
- **Manifest:** the manifest schema, the capability catalog and settings types
|
- **Manifest:** the manifest schema, the capability catalog and settings types
|
||||||
- **Testing:** `createMockCtx()`, `createTestDb()`, `renderWithApp()` and a Vitest preset
|
- **Testing:** `createMockCtx()`, `createTestDb()`, `renderWithApp()` and a Vitest preset
|
||||||
- **CLI:** `termix-plugin`, which builds, tests, validates, packs and signs a plugin and writes its migrations
|
- **CLI:** `termix-plugin`, which builds, tests, validates, packs and signs a plugin and writes its migrations
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install --save-dev @termix/plugin-sdk
|
npm install --save-dev @termix-ssh/plugin-sdk
|
||||||
```
|
```
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ async function loadDefinitions(cwd) {
|
|||||||
|
|
||||||
// Emitted inside the plugin rather than in the system temp dir: the SDK
|
// Emitted inside the plugin rather than in the system temp dir: the SDK
|
||||||
// stays external to the bundle, so the output has to sit somewhere node can
|
// stays external to the bundle, so the output has to sit somewhere node can
|
||||||
// resolve @termix/plugin-sdk from.
|
// resolve @termix-ssh/plugin-sdk from.
|
||||||
const outdir = fs.mkdtempSync(path.join(cwd, ".termix-tables-"));
|
const outdir = fs.mkdtempSync(path.join(cwd, ".termix-tables-"));
|
||||||
const outfile = path.join(outdir, "tables.mjs");
|
const outfile = path.join(outdir, "tables.mjs");
|
||||||
|
|
||||||
|
|||||||
@@ -68,14 +68,14 @@ function validatePackage(cwd, raw) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const sdkRange =
|
const sdkRange =
|
||||||
pkg.peerDependencies?.["@termix/plugin-sdk"] ??
|
pkg.peerDependencies?.["@termix-ssh/plugin-sdk"] ??
|
||||||
pkg.dependencies?.["@termix/plugin-sdk"] ??
|
pkg.dependencies?.["@termix-ssh/plugin-sdk"] ??
|
||||||
pkg.devDependencies?.["@termix/plugin-sdk"];
|
pkg.devDependencies?.["@termix-ssh/plugin-sdk"];
|
||||||
if (!sdkRange) {
|
if (!sdkRange) {
|
||||||
problems.push("package.json does not depend on @termix/plugin-sdk");
|
problems.push("package.json does not depend on @termix-ssh/plugin-sdk");
|
||||||
} else if (sdkRange === "*" || sdkRange === "latest") {
|
} else if (sdkRange === "*" || sdkRange === "latest") {
|
||||||
problems.push(
|
problems.push(
|
||||||
`@termix/plugin-sdk is "${sdkRange}"; pin a range such as "^1.0.0"`,
|
`@termix-ssh/plugin-sdk is "${sdkRange}"; pin a range such as "^1.0.0"`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return problems;
|
return problems;
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export const BACKEND_EXTERNALS = [
|
export const BACKEND_EXTERNALS = [
|
||||||
"@termix/plugin-sdk",
|
"@termix-ssh/plugin-sdk",
|
||||||
"@termix/plugin-sdk/*",
|
"@termix-ssh/plugin-sdk/*",
|
||||||
"express",
|
"express",
|
||||||
"ssh2",
|
"ssh2",
|
||||||
"ws",
|
"ws",
|
||||||
@@ -41,6 +41,6 @@ export const FRONTEND_EXTERNALS = [
|
|||||||
"i18next",
|
"i18next",
|
||||||
"react-i18next",
|
"react-i18next",
|
||||||
"sonner",
|
"sonner",
|
||||||
"@termix/plugin-sdk/frontend",
|
"@termix-ssh/plugin-sdk/frontend",
|
||||||
"@termix/plugin-sdk/ui",
|
"@termix-ssh/plugin-sdk/ui",
|
||||||
];
|
];
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@termix/plugin-sdk",
|
"name": "@termix-ssh/plugin-sdk",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "The contract between Termix core and a plugin: types, the capability catalog and the manifest schema.",
|
"description": "The contract between Termix core and a plugin: types, the capability catalog and the manifest schema.",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ export interface ShellApi {
|
|||||||
/**
|
/**
|
||||||
* Asks a yes or no question over the main area, for code that runs outside
|
* Asks a yes or no question over the main area, for code that runs outside
|
||||||
* a panel or tab (a keybinding, a toolbar action). Inside one, prefer
|
* a panel or tab (a keybinding, a toolbar action). Inside one, prefer
|
||||||
* useConfirm from @termix/plugin-sdk/ui, which asks over that surface.
|
* useConfirm from @termix-ssh/plugin-sdk/ui, which asks over that surface.
|
||||||
*/
|
*/
|
||||||
confirm?: (options: ConfirmRequest) => Promise<boolean>;
|
confirm?: (options: ConfirmRequest) => Promise<boolean>;
|
||||||
}
|
}
|
||||||
@@ -897,7 +897,7 @@ export interface TermixApp extends TermixAppInfo {
|
|||||||
invokeAction: (id: string, ...args: unknown[]) => Promise<unknown>;
|
invokeAction: (id: string, ...args: unknown[]) => Promise<unknown>;
|
||||||
/**
|
/**
|
||||||
* Offers a component to other plugins and to core by id, rendered where
|
* Offers a component to other plugins and to core by id, rendered where
|
||||||
* they choose with `PluginComponent` from @termix/plugin-sdk/ui or
|
* they choose with `PluginComponent` from @termix-ssh/plugin-sdk/ui or
|
||||||
* `usePluginComponent`. The id should start with a name the plugin owns
|
* `usePluginComponent`. The id should start with a name the plugin owns
|
||||||
* ("terminal.view"). The props are the owner's contract; document them.
|
* ("terminal.view"). The props are the owner's contract; document them.
|
||||||
*/
|
*/
|
||||||
@@ -941,7 +941,7 @@ export interface TermixApp extends TermixAppInfo {
|
|||||||
tabs: TabsApi;
|
tabs: TabsApi;
|
||||||
/**
|
/**
|
||||||
* Asks a yes or no question over the main area. For code that runs outside
|
* Asks a yes or no question over the main area. For code that runs outside
|
||||||
* a panel or tab; inside one, useConfirm from @termix/plugin-sdk/ui asks
|
* a panel or tab; inside one, useConfirm from @termix-ssh/plugin-sdk/ui asks
|
||||||
* over that surface instead.
|
* over that surface instead.
|
||||||
*/
|
*/
|
||||||
confirm: (options: ConfirmRequest) => Promise<boolean>;
|
confirm: (options: ConfirmRequest) => Promise<boolean>;
|
||||||
@@ -1190,7 +1190,7 @@ let host: PluginHostBridge | null = null;
|
|||||||
export function __setPluginHost(bridge: PluginHostBridge | null): void {
|
export function __setPluginHost(bridge: PluginHostBridge | null): void {
|
||||||
if (host && bridge !== host) {
|
if (host && bridge !== host) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"@termix/plugin-sdk/frontend: the plugin host is already set",
|
"@termix-ssh/plugin-sdk/frontend: the plugin host is already set",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
host = bridge;
|
host = bridge;
|
||||||
@@ -1209,7 +1209,7 @@ function requireHost(): PluginHostBridge {
|
|||||||
if (!host && fallback) return fallback;
|
if (!host && fallback) return fallback;
|
||||||
if (!host) {
|
if (!host) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"@termix/plugin-sdk/frontend: no plugin host. Hooks only work inside Termix or renderWithApp().",
|
"@termix-ssh/plugin-sdk/frontend: no plugin host. Hooks only work inside Termix or renderWithApp().",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return host;
|
return host;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* real runtime does. createFakeContext stays for tests that only need a
|
* real runtime does. createFakeContext stays for tests that only need a
|
||||||
* context-shaped object and do not care about the gates.
|
* context-shaped object and do not care about the gates.
|
||||||
*
|
*
|
||||||
* The vitest config these run under comes from @termix/plugin-sdk/vitest-preset.
|
* The vitest config these run under comes from @termix-ssh/plugin-sdk/vitest-preset.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -2080,7 +2080,7 @@ export async function createTestDb(
|
|||||||
* so a test sees exactly what the shell would: which rail items, tabs, host
|
* so a test sees exactly what the shell would: which rail items, tabs, host
|
||||||
* actions and cards it registered, and each of those rendered with the SDK
|
* actions and cards it registered, and each of those rendered with the SDK
|
||||||
* hooks working. It is implemented by the Termix host, which is where the
|
* hooks working. It is implemented by the Termix host, which is where the
|
||||||
* registries live; the vitest preset points "@termix/plugin-host/testing" at
|
* registries live; the vitest preset points "@termix-ssh/plugin-host/testing" at
|
||||||
* core's implementation.
|
* core's implementation.
|
||||||
*/
|
*/
|
||||||
export interface RenderWithAppOptions {
|
export interface RenderWithAppOptions {
|
||||||
@@ -2205,7 +2205,7 @@ interface PluginTestHost {
|
|||||||
) => Promise<RenderedPluginApp>;
|
) => Promise<RenderedPluginApp>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TEST_HOST = "@termix/plugin-host/testing";
|
const TEST_HOST = "@termix-ssh/plugin-host/testing";
|
||||||
|
|
||||||
export async function renderWithApp(
|
export async function renderWithApp(
|
||||||
plugin: FrontendPluginModule,
|
plugin: FrontendPluginModule,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* A plugin's vitest.config.ts is one line:
|
* A plugin's vitest.config.ts is one line:
|
||||||
*
|
*
|
||||||
* import { pluginVitestConfig } from "@termix/plugin-sdk/vitest-preset";
|
* import { pluginVitestConfig } from "@termix-ssh/plugin-sdk/vitest-preset";
|
||||||
* export default pluginVitestConfig(import.meta.url);
|
* export default pluginVitestConfig(import.meta.url);
|
||||||
*
|
*
|
||||||
* Two projects: tests/backend runs in node, tests/frontend in jsdom.
|
* Two projects: tests/backend runs in node, tests/frontend in jsdom.
|
||||||
@@ -56,21 +56,21 @@ export function pluginVitestConfig(
|
|||||||
const alias: Record<string, string> = {
|
const alias: Record<string, string> = {
|
||||||
...(repoRoot
|
...(repoRoot
|
||||||
? {
|
? {
|
||||||
"@termix/plugin-sdk/frontend": path.join(
|
"@termix-ssh/plugin-sdk/frontend": path.join(
|
||||||
repoRoot,
|
repoRoot,
|
||||||
"packages",
|
"packages",
|
||||||
"plugin-sdk",
|
"plugin-sdk",
|
||||||
"src",
|
"src",
|
||||||
"frontend.ts",
|
"frontend.ts",
|
||||||
),
|
),
|
||||||
"@termix/plugin-sdk/ui": path.join(
|
"@termix-ssh/plugin-sdk/ui": path.join(
|
||||||
repoRoot,
|
repoRoot,
|
||||||
"src",
|
"src",
|
||||||
"ui",
|
"ui",
|
||||||
"plugin-host",
|
"plugin-host",
|
||||||
"sdk-ui.ts",
|
"sdk-ui.ts",
|
||||||
),
|
),
|
||||||
"@termix/plugin-host/testing": path.join(
|
"@termix-ssh/plugin-host/testing": path.join(
|
||||||
repoRoot,
|
repoRoot,
|
||||||
"src",
|
"src",
|
||||||
"ui",
|
"ui",
|
||||||
@@ -85,7 +85,7 @@ export function pluginVitestConfig(
|
|||||||
: {
|
: {
|
||||||
// Outside a Termix checkout: the UI kit resolves through the
|
// Outside a Termix checkout: the UI kit resolves through the
|
||||||
// package, and the test host is the copy the SDK ships.
|
// package, and the test host is the copy the SDK ships.
|
||||||
"@termix/plugin-host/testing": fileURLToPath(
|
"@termix-ssh/plugin-host/testing": fileURLToPath(
|
||||||
new URL("./host/testing-host.js", import.meta.url),
|
new URL("./host/testing-host.js", import.meta.url),
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
@@ -119,8 +119,8 @@ export function pluginVitestConfig(
|
|||||||
setupFiles: [setupFile],
|
setupFiles: [setupFile],
|
||||||
// Run the SDK through Vite rather than plain Node, so its import
|
// Run the SDK through Vite rather than plain Node, so its import
|
||||||
// of the test host sees the alias above and the plugin and the
|
// of the test host sees the alias above and the plugin and the
|
||||||
// host share one copy of @termix/plugin-sdk/frontend.
|
// host share one copy of @termix-ssh/plugin-sdk/frontend.
|
||||||
server: { deps: { inline: [/@termix\/plugin-sdk/] } },
|
server: { deps: { inline: [/@termix-ssh\/plugin-sdk/] } },
|
||||||
include: ["tests/frontend/**/*.test.{ts,tsx}"],
|
include: ["tests/frontend/**/*.test.{ts,tsx}"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ function copyPluginSdk(resourcesDir, sdkDir = path.join(repoRoot, "packages", "p
|
|||||||
resourcesDir,
|
resourcesDir,
|
||||||
"app.asar.unpacked",
|
"app.asar.unpacked",
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"@termix",
|
"@termix-ssh",
|
||||||
"plugin-sdk",
|
"plugin-sdk",
|
||||||
);
|
);
|
||||||
const dist = path.join(sdkDir, "dist");
|
const dist = path.join(sdkDir, "dist");
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* Builds the two pieces of the plugin SDK that come from core:
|
* Builds the two pieces of the plugin SDK that come from core:
|
||||||
*
|
*
|
||||||
* dist/host/ui.js @termix/plugin-sdk/ui, the shell's UI kit
|
* dist/host/ui.js @termix-ssh/plugin-sdk/ui, the shell's UI kit
|
||||||
* dist/host/testing-host.js what renderWithApp() renders plugins into
|
* dist/host/testing-host.js what renderWithApp() renders plugins into
|
||||||
*
|
*
|
||||||
* Inside Termix the page's import map points @termix/plugin-sdk/ui at the
|
* Inside Termix the page's import map points @termix-ssh/plugin-sdk/ui at the
|
||||||
* shell's own copy, so ui.js is never loaded there. It exists so a plugin in
|
* shell's own copy, so ui.js is never loaded there. It exists so a plugin in
|
||||||
* its own repo can typecheck and run its tests without a Termix checkout.
|
* its own repo can typecheck and run its tests without a Termix checkout.
|
||||||
*
|
*
|
||||||
@@ -32,7 +32,7 @@ const EXTERNALS = [
|
|||||||
"i18next",
|
"i18next",
|
||||||
"react-i18next",
|
"react-i18next",
|
||||||
"sonner",
|
"sonner",
|
||||||
"@termix/plugin-sdk/frontend",
|
"@termix-ssh/plugin-sdk/frontend",
|
||||||
"@testing-library/react",
|
"@testing-library/react",
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ await esbuild.build({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Types for @termix/plugin-sdk/ui: the declarations tsc emits for sdk-ui.ts
|
// Types for @termix-ssh/plugin-sdk/ui: the declarations tsc emits for sdk-ui.ts
|
||||||
// and everything it reaches, with core's "@/" paths made relative.
|
// and everything it reaches, with core's "@/" paths made relative.
|
||||||
const typesDir = path.join(outDir, "types");
|
const typesDir = path.join(outDir, "types");
|
||||||
const tsc = spawnSync(
|
const tsc = spawnSync(
|
||||||
@@ -93,7 +93,7 @@ const tsc = spawnSync(
|
|||||||
{ cwd: root, stdio: "inherit" },
|
{ cwd: root, stdio: "inherit" },
|
||||||
);
|
);
|
||||||
if (tsc.status !== 0) process.exit(tsc.status ?? 1);
|
if (tsc.status !== 0) process.exit(tsc.status ?? 1);
|
||||||
// tsc follows @termix/plugin-sdk/frontend into the SDK's source; plugins get
|
// tsc follows @termix-ssh/plugin-sdk/frontend into the SDK's source; plugins get
|
||||||
// those types from the package itself.
|
// those types from the package itself.
|
||||||
fs.rmSync(path.join(typesDir, "packages"), { recursive: true, force: true });
|
fs.rmSync(path.join(typesDir, "packages"), { recursive: true, force: true });
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
/**
|
/**
|
||||||
* @termix/plugin-sdk/ui is public API, implemented by
|
* @termix-ssh/plugin-sdk/ui is public API, implemented by
|
||||||
* src/ui/plugin-host/sdk-ui.ts. Adding to it is a contract change and
|
* src/ui/plugin-host/sdk-ui.ts. Adding to it is a contract change and
|
||||||
* removing from it is a breaking one, so neither should happen by accident.
|
* removing from it is a breaking one, so neither should happen by accident.
|
||||||
*
|
*
|
||||||
@@ -354,7 +354,7 @@ function main() {
|
|||||||
const before = new Set(saved.split("\n"));
|
const before = new Set(saved.split("\n"));
|
||||||
const after = new Set(current.split("\n"));
|
const after = new Set(current.split("\n"));
|
||||||
console.error(
|
console.error(
|
||||||
"@termix/plugin-sdk/ui changed shape. If that is deliberate, run: node scripts/check-sdk-ui-exports.cjs --update-snapshot",
|
"@termix-ssh/plugin-sdk/ui changed shape. If that is deliberate, run: node scripts/check-sdk-ui-exports.cjs --update-snapshot",
|
||||||
);
|
);
|
||||||
for (const line of saved.split("\n")) {
|
for (const line of saved.split("\n")) {
|
||||||
if (line && !after.has(line)) console.error(` - ${line.slice(0, 200)}`);
|
if (line && !after.has(line)) console.error(` - ${line.slice(0, 200)}`);
|
||||||
@@ -373,13 +373,13 @@ function main() {
|
|||||||
if (added.length === 0 && removed.length === 0) return;
|
if (added.length === 0 && removed.length === 0) return;
|
||||||
if (added.length > 0) {
|
if (added.length > 0) {
|
||||||
console.error(
|
console.error(
|
||||||
"@termix/plugin-sdk/ui exports names that are not on the allowlist in scripts/check-sdk-ui-exports.cjs:",
|
"@termix-ssh/plugin-sdk/ui exports names that are not on the allowlist in scripts/check-sdk-ui-exports.cjs:",
|
||||||
);
|
);
|
||||||
for (const name of added) console.error(` + ${name}`);
|
for (const name of added) console.error(` + ${name}`);
|
||||||
}
|
}
|
||||||
if (removed.length > 0) {
|
if (removed.length > 0) {
|
||||||
console.error(
|
console.error(
|
||||||
"@termix/plugin-sdk/ui no longer exports these allowlisted names (a breaking change for plugins):",
|
"@termix-ssh/plugin-sdk/ui no longer exports these allowlisted names (a breaking change for plugins):",
|
||||||
);
|
);
|
||||||
for (const name of removed) console.error(` - ${name}`);
|
for (const name of removed) console.error(` - ${name}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ export const SHARED_VENDOR_MODULES = SHARED_VENDORS.map(
|
|||||||
|
|
||||||
/** SDK entries that are implemented by, or hold state shared with, core. */
|
/** SDK entries that are implemented by, or hold state shared with, core. */
|
||||||
export const SHARED_SDK_MODULES = [
|
export const SHARED_SDK_MODULES = [
|
||||||
"@termix/plugin-sdk/frontend",
|
"@termix-ssh/plugin-sdk/frontend",
|
||||||
"@termix/plugin-sdk/ui",
|
"@termix-ssh/plugin-sdk/ui",
|
||||||
];
|
];
|
||||||
|
|
||||||
export function sharedModules() {
|
export function sharedModules() {
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ export function termixPluginHost({ repoRoot, sdkUiEntry, sdkFrontendEntry }) {
|
|||||||
if (SHARED_VENDOR_MODULES.includes(specifier)) {
|
if (SHARED_VENDOR_MODULES.includes(specifier)) {
|
||||||
return vendorFacade(repoRoot, specifier);
|
return vendorFacade(repoRoot, specifier);
|
||||||
}
|
}
|
||||||
if (specifier === "@termix/plugin-sdk/ui") return sourceFacade(sdkUiEntry);
|
if (specifier === "@termix-ssh/plugin-sdk/ui") return sourceFacade(sdkUiEntry);
|
||||||
if (specifier === "@termix/plugin-sdk/frontend") {
|
if (specifier === "@termix-ssh/plugin-sdk/frontend") {
|
||||||
return sourceFacade(sdkFrontendEntry);
|
return sourceFacade(sdkFrontendEntry);
|
||||||
}
|
}
|
||||||
throw new Error(`termix-plugin-host: ${specifier} is not a shared module`);
|
throw new Error(`termix-plugin-host: ${specifier} is not a shared module`);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
import type {
|
import type {
|
||||||
PluginLoginMethod,
|
PluginLoginMethod,
|
||||||
PluginSecondFactor,
|
PluginSecondFactor,
|
||||||
} from "@termix/plugin-sdk/backend";
|
} from "@termix-ssh/plugin-sdk/backend";
|
||||||
|
|
||||||
export type LoginMethod = PluginLoginMethod & { pluginId: string };
|
export type LoginMethod = PluginLoginMethod & { pluginId: string };
|
||||||
export type SecondFactor = PluginSecondFactor & { pluginId: string };
|
export type SecondFactor = PluginSecondFactor & { pluginId: string };
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { PluginVerifiedIdentity } from "@termix/plugin-sdk/backend";
|
import type { PluginVerifiedIdentity } from "@termix-ssh/plugin-sdk/backend";
|
||||||
|
|
||||||
export { LoginMethodError } from "@termix/plugin-sdk/backend";
|
export { LoginMethodError } from "@termix-ssh/plugin-sdk/backend";
|
||||||
|
|
||||||
/** The logout claims a login carried, stored as sessions.external_session_ref. */
|
/** The logout claims a login carried, stored as sessions.external_session_ref. */
|
||||||
export interface ExternalSessionRef {
|
export interface ExternalSessionRef {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* on this path has to decrypt and the async work stays in one place.
|
* on this path has to decrypt and the async work stays in one place.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { createCurrentPluginSettingsRepository } from "../repositories/factory.js";
|
import { createCurrentPluginSettingsRepository } from "../repositories/factory.js";
|
||||||
import type { PluginSettingsRecord } from "../repositories/plugin-settings-repository.js";
|
import type { PluginSettingsRecord } from "../repositories/plugin-settings-repository.js";
|
||||||
import {
|
import {
|
||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
coerceSettingValue,
|
coerceSettingValue,
|
||||||
validateSettingValue,
|
validateSettingValue,
|
||||||
} from "@termix/plugin-sdk/settings";
|
} from "@termix-ssh/plugin-sdk/settings";
|
||||||
import { getPluginRuntime } from "../../plugins/index.js";
|
import { getPluginRuntime } from "../../plugins/index.js";
|
||||||
import { consume } from "../../plugins/registry.js";
|
import { consume } from "../../plugins/registry.js";
|
||||||
import { sshLogger } from "../../utils/logger.js";
|
import { sshLogger } from "../../utils/logger.js";
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
CORE_KEYBINDING_ACTIONS,
|
CORE_KEYBINDING_ACTIONS,
|
||||||
validateKeybindingActionParams,
|
validateKeybindingActionParams,
|
||||||
type PluginKeybindingActionContribution,
|
type PluginKeybindingActionContribution,
|
||||||
} from "@termix/plugin-sdk/manifest";
|
} from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
export interface DeclaredKeybindingAction extends PluginKeybindingActionContribution {
|
export interface DeclaredKeybindingAction extends PluginKeybindingActionContribution {
|
||||||
pluginId: string;
|
pluginId: string;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import express, { type Request, type Response } from "express";
|
|||||||
import { databaseLogger } from "../../utils/logger.js";
|
import { databaseLogger } from "../../utils/logger.js";
|
||||||
import { getPluginRouter, isPluginInstalled } from "../../plugins/http.js";
|
import { getPluginRouter, isPluginInstalled } from "../../plugins/http.js";
|
||||||
import { getRequestBasePath } from "../../utils/request-origin.js";
|
import { getRequestBasePath } from "../../utils/request-origin.js";
|
||||||
import type { PluginLegacyRedirect } from "@termix/plugin-sdk/manifest";
|
import type { PluginLegacyRedirect } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import {
|
|||||||
import type {
|
import type {
|
||||||
PluginManifest,
|
PluginManifest,
|
||||||
PluginSettingsField,
|
PluginSettingsField,
|
||||||
} from "@termix/plugin-sdk/manifest";
|
} from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ async function prepareKey(
|
|||||||
if (certPublicKey && certPublicKey.trim()) {
|
if (certPublicKey && certPublicKey.trim()) {
|
||||||
try {
|
try {
|
||||||
const { applyCertificateAuth } =
|
const { applyCertificateAuth } =
|
||||||
await import("@termix/plugin-sdk/ssh-certs");
|
await import("@termix-ssh/plugin-sdk/ssh-certs");
|
||||||
await applyCertificateAuth(
|
await applyCertificateAuth(
|
||||||
config,
|
config,
|
||||||
env.client,
|
env.client,
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
import type {
|
import type {
|
||||||
PluginManifest,
|
PluginManifest,
|
||||||
PluginSettingsField,
|
PluginSettingsField,
|
||||||
} from "@termix/plugin-sdk/manifest";
|
} from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { coerceSettingValue } from "@termix/plugin-sdk/settings";
|
import { coerceSettingValue } from "@termix-ssh/plugin-sdk/settings";
|
||||||
import {
|
import {
|
||||||
CORE_HOST_DEFAULTS,
|
CORE_HOST_DEFAULTS,
|
||||||
CORE_NAMESPACE,
|
CORE_NAMESPACE,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* host's own.
|
* host's own.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import {
|
import {
|
||||||
createCurrentHostDefaultsRepository,
|
createCurrentHostDefaultsRepository,
|
||||||
createCurrentPluginSettingsRepository,
|
createCurrentPluginSettingsRepository,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* the owner's; this swaps it for the viewer's at read time.
|
* the owner's; this swaps it for the viewer's at read time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { createCurrentHostDefaultsRepository } from "../../database/repositories/factory.js";
|
import { createCurrentHostDefaultsRepository } from "../../database/repositories/factory.js";
|
||||||
import type { HostRow } from "../../database/repositories/host-defaults-repository.js";
|
import type { HostRow } from "../../database/repositories/host-defaults-repository.js";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
import {
|
import {
|
||||||
coerceSettingValue,
|
coerceSettingValue,
|
||||||
validateSettingValue,
|
validateSettingValue,
|
||||||
} from "@termix/plugin-sdk/settings";
|
} from "@termix-ssh/plugin-sdk/settings";
|
||||||
import { createCurrentHostDefaultsRepository } from "../../database/repositories/factory.js";
|
import { createCurrentHostDefaultsRepository } from "../../database/repositories/factory.js";
|
||||||
import type { HostDefaultsScope } from "../../database/repositories/host-defaults-repository.js";
|
import type { HostDefaultsScope } from "../../database/repositories/host-defaults-repository.js";
|
||||||
import { validateSettingsSave } from "../../plugins/settings.js";
|
import { validateSettingsSave } from "../../plugins/settings.js";
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* share and sync a protocol's login without the plugin's code running.
|
* share and sync a protocol's login without the plugin's code running.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PluginProtocolContribution } from "@termix/plugin-sdk/manifest";
|
import type { PluginProtocolContribution } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { SSH_AUTH_PROTOCOL } from "../../../types/auth-protocols.js";
|
import { SSH_AUTH_PROTOCOL } from "../../../types/auth-protocols.js";
|
||||||
|
|
||||||
export interface DeclaredHostProtocol extends PluginProtocolContribution {
|
export interface DeclaredHostProtocol extends PluginProtocolContribution {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* terminal's, so they are core's and have a column of their own.
|
* terminal's, so they are core's and have a column of their own.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { HostSshOptions } from "@termix/plugin-sdk/backend";
|
import type { HostSshOptions } from "@termix-ssh/plugin-sdk/backend";
|
||||||
|
|
||||||
export type { HostSshOptions };
|
export type { HostSshOptions };
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* reach nobody, same as a plugin's.
|
* reach nobody, same as a plugin's.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PluginNotification } from "@termix/plugin-sdk/backend";
|
import type { PluginNotification } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import { activeNotifyHub } from "../plugins/notify-hub.js";
|
import { activeNotifyHub } from "../plugins/notify-hub.js";
|
||||||
import { resolveAudience } from "../plugins/ctx-notify.js";
|
import { resolveAudience } from "../plugins/ctx-notify.js";
|
||||||
import { systemLogger } from "../utils/logger.js";
|
import { systemLogger } from "../utils/logger.js";
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
DEFAULT_FRONTEND_ENTRY,
|
DEFAULT_FRONTEND_ENTRY,
|
||||||
DEFAULT_LOCALES_DIR,
|
DEFAULT_LOCALES_DIR,
|
||||||
type PluginManifest,
|
type PluginManifest,
|
||||||
} from "@termix/plugin-sdk/manifest";
|
} from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import type { LoadedPlugin } from "./loader.js";
|
import type { LoadedPlugin } from "./loader.js";
|
||||||
|
|
||||||
type AssetPlugin = Pick<LoadedPlugin, "id" | "dir" | "manifest"> &
|
type AssetPlugin = Pick<LoadedPlugin, "id" | "dir" | "manifest"> &
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
import type {
|
import type {
|
||||||
PluginCredentials,
|
PluginCredentials,
|
||||||
PluginSshKeyCredential,
|
PluginSshKeyCredential,
|
||||||
} from "@termix/plugin-sdk/backend";
|
} from "@termix-ssh/plugin-sdk/backend";
|
||||||
import ssh2 from "ssh2";
|
import ssh2 from "ssh2";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { assertCapability, capabilityRefused } from "./permissions.js";
|
import { assertCapability, capabilityRefused } from "./permissions.js";
|
||||||
import { getActor } from "./actor.js";
|
import { getActor } from "./actor.js";
|
||||||
import type { DisposableBag } from "./disposables.js";
|
import type { DisposableBag } from "./disposables.js";
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ import type {
|
|||||||
PluginShareableUser,
|
PluginShareableUser,
|
||||||
PluginShareableRole,
|
PluginShareableRole,
|
||||||
PluginHostJumpHost,
|
PluginHostJumpHost,
|
||||||
} from "@termix/plugin-sdk/backend";
|
} from "@termix-ssh/plugin-sdk/backend";
|
||||||
import { PLUGIN_HOST_INPUT_KEYS } from "@termix/plugin-sdk/backend";
|
import { PLUGIN_HOST_INPUT_KEYS } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { assertCapability, capabilityRefused } from "./permissions.js";
|
import { assertCapability, capabilityRefused } from "./permissions.js";
|
||||||
import { hostSessionStatus } from "../hosts/host-session-status.js";
|
import { hostSessionStatus } from "../hosts/host-session-status.js";
|
||||||
import { getActor } from "./actor.js";
|
import { getActor } from "./actor.js";
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import type {
|
|||||||
PluginNotificationAudience,
|
PluginNotificationAudience,
|
||||||
PluginNotify,
|
PluginNotify,
|
||||||
PluginNotifyResult,
|
PluginNotifyResult,
|
||||||
} from "@termix/plugin-sdk/backend";
|
} from "@termix-ssh/plugin-sdk/backend";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { assertCapability, capabilityRefused } from "./permissions.js";
|
import { assertCapability, capabilityRefused } from "./permissions.js";
|
||||||
import { getActor } from "./actor.js";
|
import { getActor } from "./actor.js";
|
||||||
import { activeNotifyHub, registerNotifyHub } from "./notify-hub.js";
|
import { activeNotifyHub, registerNotifyHub } from "./notify-hub.js";
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
* plugins:read. Ids and versions only, nothing operational.
|
* plugins:read. Ids and versions only, nothing operational.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PluginPlugins } from "@termix/plugin-sdk/backend";
|
import type { PluginPlugins } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { assertCapability } from "./permissions.js";
|
import { assertCapability } from "./permissions.js";
|
||||||
|
|
||||||
export function createPluginPlugins(manifest: PluginManifest): PluginPlugins {
|
export function createPluginPlugins(manifest: PluginManifest): PluginPlugins {
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import type {
|
|||||||
PluginBinarySpec,
|
PluginBinarySpec,
|
||||||
PluginProcess,
|
PluginProcess,
|
||||||
PluginProcessHandle,
|
PluginProcessHandle,
|
||||||
} from "@termix/plugin-sdk/backend";
|
} from "@termix-ssh/plugin-sdk/backend";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { assertCapability } from "./permissions.js";
|
import { assertCapability } from "./permissions.js";
|
||||||
import { getPluginDataDir } from "./paths.js";
|
import { getPluginDataDir } from "./paths.js";
|
||||||
import type { DisposableBag } from "./disposables.js";
|
import type { DisposableBag } from "./disposables.js";
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ import type {
|
|||||||
PluginSsh,
|
PluginSsh,
|
||||||
PluginSshConnectOptions,
|
PluginSshConnectOptions,
|
||||||
PluginSshHost,
|
PluginSshHost,
|
||||||
} from "@termix/plugin-sdk/backend";
|
} from "@termix-ssh/plugin-sdk/backend";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { PluginSshInteractionError } from "@termix/plugin-sdk/backend";
|
import { PluginSshInteractionError } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import {
|
import {
|
||||||
assertCapability,
|
assertCapability,
|
||||||
capabilityRefused,
|
capabilityRefused,
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
* say that it renews it. Every call is audited.
|
* say that it renews it. Every call is audited.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PluginSystem } from "@termix/plugin-sdk/backend";
|
import type { PluginSystem } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { assertCapability } from "./permissions.js";
|
import { assertCapability } from "./permissions.js";
|
||||||
import type { DisposableBag } from "./disposables.js";
|
import type { DisposableBag } from "./disposables.js";
|
||||||
|
|
||||||
|
|||||||
@@ -42,14 +42,14 @@ import {
|
|||||||
import { registerPluginWsRoute, registerPluginWsUpgrade } from "./ws.js";
|
import { registerPluginWsRoute, registerPluginWsUpgrade } from "./ws.js";
|
||||||
import { resolvePermission } from "./rbac.js";
|
import { resolvePermission } from "./rbac.js";
|
||||||
import * as pluginSettings from "./settings.js";
|
import * as pluginSettings from "./settings.js";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import {
|
import {
|
||||||
type PluginContext,
|
type PluginContext,
|
||||||
type PluginModule,
|
type PluginModule,
|
||||||
type PluginOpenIsolatedWindowRequest,
|
type PluginOpenIsolatedWindowRequest,
|
||||||
type PluginExternalClientRequest,
|
type PluginExternalClientRequest,
|
||||||
} from "@termix/plugin-sdk/backend";
|
} from "@termix-ssh/plugin-sdk/backend";
|
||||||
import type { PluginTableDefinition } from "@termix/plugin-sdk/db";
|
import type { PluginTableDefinition } from "@termix-ssh/plugin-sdk/db";
|
||||||
import * as syncRegistry from "./sync-registry.js";
|
import * as syncRegistry from "./sync-registry.js";
|
||||||
import {
|
import {
|
||||||
needsExplicitPersist,
|
needsExplicitPersist,
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import { sql } from "drizzle-orm";
|
|||||||
import { pluginLogger } from "../utils/logger.js";
|
import { pluginLogger } from "../utils/logger.js";
|
||||||
import { resolveDatabaseDialect } from "../database/db/dialect.js";
|
import { resolveDatabaseDialect } from "../database/db/dialect.js";
|
||||||
import type { DatabaseDialect } from "../database/db/dialect.js";
|
import type { DatabaseDialect } from "../database/db/dialect.js";
|
||||||
import type { PluginTableDefinition } from "@termix/plugin-sdk/db";
|
import type { PluginTableDefinition } from "@termix-ssh/plugin-sdk/db";
|
||||||
import { prefixedTableName, tablePrefix } from "@termix/plugin-sdk/db";
|
import { prefixedTableName, tablePrefix } from "@termix-ssh/plugin-sdk/db";
|
||||||
import { buildTable } from "./table-builder.js";
|
import { buildTable } from "./table-builder.js";
|
||||||
import {
|
import {
|
||||||
applyPluginMigrations,
|
applyPluginMigrations,
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ import express, {
|
|||||||
import type {
|
import type {
|
||||||
PluginMiddleware,
|
PluginMiddleware,
|
||||||
PluginRouterOptions,
|
PluginRouterOptions,
|
||||||
} from "@termix/plugin-sdk/backend";
|
} from "@termix-ssh/plugin-sdk/backend";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { pluginLogger } from "../utils/logger.js";
|
import { pluginLogger } from "../utils/logger.js";
|
||||||
import { AuthManager } from "../utils/auth-manager.js";
|
import { AuthManager } from "../utils/auth-manager.js";
|
||||||
import { runAsActor } from "./actor.js";
|
import { runAsActor } from "./actor.js";
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import * as tar from "tar";
|
|||||||
import { pluginLogger } from "../utils/logger.js";
|
import { pluginLogger } from "../utils/logger.js";
|
||||||
import { isTermixCompatible, parseManifest } from "./manifest.js";
|
import { isTermixCompatible, parseManifest } from "./manifest.js";
|
||||||
import { getLocalVersion } from "../utils/app-version.js";
|
import { getLocalVersion } from "../utils/app-version.js";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import {
|
import {
|
||||||
getBundledPluginsDir,
|
getBundledPluginsDir,
|
||||||
getPluginBackendEntry,
|
getPluginBackendEntry,
|
||||||
@@ -39,7 +39,7 @@ import {
|
|||||||
import { resolveRequirements } from "./service-registry.js";
|
import { resolveRequirements } from "./service-registry.js";
|
||||||
import { resolveSecretRequirements } from "./secret-registry.js";
|
import { resolveSecretRequirements } from "./secret-registry.js";
|
||||||
import { recordConflict } from "./conflicts.js";
|
import { recordConflict } from "./conflicts.js";
|
||||||
import { tablePrefix } from "@termix/plugin-sdk/db";
|
import { tablePrefix } from "@termix-ssh/plugin-sdk/db";
|
||||||
|
|
||||||
export type PluginState =
|
export type PluginState =
|
||||||
| "loaded"
|
| "loaded"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Manifest validation, re-exported from the SDK.
|
* Manifest validation, re-exported from the SDK.
|
||||||
*
|
*
|
||||||
* The contract lives in @termix/plugin-sdk/manifest so the server, the
|
* The contract lives in @termix-ssh/plugin-sdk/manifest so the server, the
|
||||||
* authoring script and plugin authors all read the same rules. This file used
|
* authoring script and plugin authors all read the same rules. This file used
|
||||||
* to carry its own copy of the enums and validators, which meant three places
|
* to carry its own copy of the enums and validators, which meant three places
|
||||||
* had to be edited together and quietly drifted when they were not.
|
* had to be edited together and quietly drifted when they were not.
|
||||||
@@ -17,7 +17,7 @@ export {
|
|||||||
SYSTEM_ROLE_NAMES,
|
SYSTEM_ROLE_NAMES,
|
||||||
RESERVED_PERMISSION_PREFIXES,
|
RESERVED_PERMISSION_PREFIXES,
|
||||||
qualifyPermission,
|
qualifyPermission,
|
||||||
} from "@termix/plugin-sdk/manifest";
|
} from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
PluginManifest,
|
PluginManifest,
|
||||||
@@ -36,10 +36,10 @@ export type {
|
|||||||
HostCapabilityContribution,
|
HostCapabilityContribution,
|
||||||
ActionContributionKind,
|
ActionContributionKind,
|
||||||
ParsedManifest,
|
ParsedManifest,
|
||||||
} from "@termix/plugin-sdk/manifest";
|
} from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
Capability,
|
Capability,
|
||||||
CapabilityInfo,
|
CapabilityInfo,
|
||||||
CapabilityRisk,
|
CapabilityRisk,
|
||||||
} from "@termix/plugin-sdk/capabilities";
|
} from "@termix-ssh/plugin-sdk/capabilities";
|
||||||
@@ -18,12 +18,12 @@ import path from "node:path";
|
|||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { pluginLogger } from "../utils/logger.js";
|
import { pluginLogger } from "../utils/logger.js";
|
||||||
import type { DatabaseDialect } from "../database/db/dialect.js";
|
import type { DatabaseDialect } from "../database/db/dialect.js";
|
||||||
import { LEGACY_TABLE_OWNERS } from "@termix/plugin-sdk/db";
|
import { LEGACY_TABLE_OWNERS } from "@termix-ssh/plugin-sdk/db";
|
||||||
import {
|
import {
|
||||||
collectOwnedIndexes,
|
collectOwnedIndexes,
|
||||||
findUnownedTableWrites,
|
findUnownedTableWrites,
|
||||||
splitStatements,
|
splitStatements,
|
||||||
} from "@termix/plugin-sdk/ddl";
|
} from "@termix-ssh/plugin-sdk/ddl";
|
||||||
|
|
||||||
// The splitter is shared with createTestDb in the SDK, so tests apply a
|
// The splitter is shared with createTestDb in the SDK, so tests apply a
|
||||||
// migration exactly the way this runner does.
|
// migration exactly the way this runner does.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* alert reaches nobody.
|
* alert reaches nobody.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PluginNotifyHub } from "@termix/plugin-sdk/backend";
|
import type { PluginNotifyHub } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import { hasCapability } from "./permissions.js";
|
import { hasCapability } from "./permissions.js";
|
||||||
|
|
||||||
interface HubRegistration {
|
interface HubRegistration {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
|
|||||||
import {
|
import {
|
||||||
DEFAULT_BACKEND_ENTRY,
|
DEFAULT_BACKEND_ENTRY,
|
||||||
type PluginManifest,
|
type PluginManifest,
|
||||||
} from "@termix/plugin-sdk/manifest";
|
} from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Where user-installed plugins live. Resolved per call rather than captured at
|
* Where user-installed plugins live. Resolved per call rather than captured at
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { createCurrentPluginPermissionGrantRepository } from "../database/repositories/factory.js";
|
import { createCurrentPluginPermissionGrantRepository } from "../database/repositories/factory.js";
|
||||||
import { PluginCapabilityError } from "@termix/plugin-sdk/backend";
|
import { PluginCapabilityError } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import { getActor } from "./actor.js";
|
import { getActor } from "./actor.js";
|
||||||
|
|
||||||
const cache = new Map<string, Set<string>>();
|
const cache = new Map<string, Set<string>>();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* bag, so deactivate clears every one of them.
|
* bag, so deactivate clears every one of them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { PluginSchedule } from "@termix/plugin-sdk/backend";
|
import type { PluginSchedule } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import type { DisposableBag } from "./disposables.js";
|
import type { DisposableBag } from "./disposables.js";
|
||||||
|
|
||||||
type Log = (message: string, error: unknown) => void;
|
type Log = (message: string, error: unknown) => void;
|
||||||
|
|||||||
@@ -14,12 +14,12 @@
|
|||||||
import type {
|
import type {
|
||||||
PluginManifest,
|
PluginManifest,
|
||||||
PluginSettingsField,
|
PluginSettingsField,
|
||||||
} from "@termix/plugin-sdk/manifest";
|
} from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import {
|
import {
|
||||||
coerceSettingValue,
|
coerceSettingValue,
|
||||||
isRedactedSecret,
|
isRedactedSecret,
|
||||||
validateSettingValue,
|
validateSettingValue,
|
||||||
} from "@termix/plugin-sdk/settings";
|
} from "@termix-ssh/plugin-sdk/settings";
|
||||||
import {
|
import {
|
||||||
createCurrentHostRepository,
|
createCurrentHostRepository,
|
||||||
createCurrentPluginSettingsRepository,
|
createCurrentPluginSettingsRepository,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
import type {
|
import type {
|
||||||
SyncEntityRegistration,
|
SyncEntityRegistration,
|
||||||
SyncRow,
|
SyncRow,
|
||||||
} from "@termix/plugin-sdk/backend";
|
} from "@termix-ssh/plugin-sdk/backend";
|
||||||
|
|
||||||
/** Core-only extras a plugin registration cannot set. */
|
/** Core-only extras a plugin registration cannot set. */
|
||||||
export interface CoreSyncEntityOptions {
|
export interface CoreSyncEntityOptions {
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
* core keeps one import site.
|
* core keeps one import site.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export { buildTable } from "@termix/plugin-sdk/table-builder";
|
export { buildTable } from "@termix-ssh/plugin-sdk/table-builder";
|
||||||
export {
|
export {
|
||||||
createTableSql,
|
createTableSql,
|
||||||
adoptTableSql,
|
adoptTableSql,
|
||||||
dropTableSql,
|
dropTableSql,
|
||||||
addColumnSql,
|
addColumnSql,
|
||||||
keyedColumns,
|
keyedColumns,
|
||||||
} from "@termix/plugin-sdk/ddl";
|
} from "@termix-ssh/plugin-sdk/ddl";
|
||||||
@@ -7,9 +7,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { columnName, createTableSql } from "@termix/plugin-sdk/ddl";
|
import { columnName, createTableSql } from "@termix-ssh/plugin-sdk/ddl";
|
||||||
import { prefixedTableName } from "@termix/plugin-sdk/db";
|
import { prefixedTableName } from "@termix-ssh/plugin-sdk/db";
|
||||||
import type { PluginTableDefinition } from "@termix/plugin-sdk/db";
|
import type { PluginTableDefinition } from "@termix-ssh/plugin-sdk/db";
|
||||||
import {
|
import {
|
||||||
runStatement,
|
runStatement,
|
||||||
selectRows,
|
selectRows,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import { WebSocketServer, type WebSocket } from "ws";
|
|||||||
import type {
|
import type {
|
||||||
PluginWebSocketHandler,
|
PluginWebSocketHandler,
|
||||||
PluginWebSocketOptions,
|
PluginWebSocketOptions,
|
||||||
} from "@termix/plugin-sdk/backend";
|
} from "@termix-ssh/plugin-sdk/backend";
|
||||||
import { pluginLogger } from "../utils/logger.js";
|
import { pluginLogger } from "../utils/logger.js";
|
||||||
import { recordConflict } from "./conflicts.js";
|
import { recordConflict } from "./conflicts.js";
|
||||||
import { extractWebSocketToken } from "../utils/ws-auth.js";
|
import { extractWebSocketToken } from "../utils/ws-auth.js";
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import os from "os";
|
import os from "os";
|
||||||
import type { SyncRow } from "@termix/plugin-sdk/backend";
|
import type { SyncRow } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import {
|
import {
|
||||||
getEntity,
|
getEntity,
|
||||||
listEntities,
|
listEntities,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import semver from "semver";
|
import semver from "semver";
|
||||||
import type { PluginDesktopMode } from "@termix/plugin-sdk/manifest";
|
import type { PluginDesktopMode } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { syncLogger } from "../../utils/logger.js";
|
import { syncLogger } from "../../utils/logger.js";
|
||||||
import { sendCoreAlert } from "../../notify/core-notify.js";
|
import { sendCoreAlert } from "../../notify/core-notify.js";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import express, {
|
|||||||
type Response,
|
type Response,
|
||||||
} from "express";
|
} from "express";
|
||||||
import { and, eq, isNotNull } from "drizzle-orm";
|
import { and, eq, isNotNull } from "drizzle-orm";
|
||||||
import type { SyncRow } from "@termix/plugin-sdk/backend";
|
import type { SyncRow } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import type { AuthenticatedRequest } from "../../../types/index.js";
|
import type { AuthenticatedRequest } from "../../../types/index.js";
|
||||||
import { AuthManager } from "../../utils/auth-manager.js";
|
import { AuthManager } from "../../utils/auth-manager.js";
|
||||||
import { syncLogger } from "../../utils/logger.js";
|
import { syncLogger } from "../../utils/logger.js";
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { and, eq } from "drizzle-orm";
|
import { and, eq } from "drizzle-orm";
|
||||||
import type { SyncRow } from "@termix/plugin-sdk/backend";
|
import type { SyncRow } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import {
|
import {
|
||||||
hosts,
|
hosts,
|
||||||
sshCredentials,
|
sshCredentials,
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { and, eq } from "drizzle-orm";
|
import { and, eq } from "drizzle-orm";
|
||||||
import type { SyncRow } from "@termix/plugin-sdk/backend";
|
import type { SyncRow } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { hosts, sshCredentials, sshFolders } from "../database/db/schema.js";
|
import { hosts, sshCredentials, sshFolders } from "../database/db/schema.js";
|
||||||
import {
|
import {
|
||||||
createCurrentHostDefaultsRepository,
|
createCurrentHostDefaultsRepository,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* for the wire like the host's own and a credential named by its syncId.
|
* for the wire like the host's own and a credential named by its syncId.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { SyncRow } from "@termix/plugin-sdk/backend";
|
import type { SyncRow } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import type { HostProtocolLogin } from "../database/repositories/host-protocol-auth-repository.js";
|
import type { HostProtocolLogin } from "../database/repositories/host-protocol-auth-repository.js";
|
||||||
import { createCurrentHostProtocolAuthRepository } from "../database/repositories/factory.js";
|
import { createCurrentHostProtocolAuthRepository } from "../database/repositories/factory.js";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Response } from "express";
|
import type { Response } from "express";
|
||||||
import type { SyncRow } from "@termix/plugin-sdk/backend";
|
import type { SyncRow } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import { listEntities } from "../../plugins/sync-registry.js";
|
import { listEntities } from "../../plugins/sync-registry.js";
|
||||||
import { syncLogger } from "../../utils/logger.js";
|
import { syncLogger } from "../../utils/logger.js";
|
||||||
import { registerCoreSyncEntities } from "../entities.js";
|
import { registerCoreSyncEntities } from "../entities.js";
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
* holds up the rest of the batch.
|
* holds up the rest of the batch.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { SyncRow } from "@termix/plugin-sdk/backend";
|
import type { SyncRow } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import { getEntity } from "../../plugins/sync-registry.js";
|
import { getEntity } from "../../plugins/sync-registry.js";
|
||||||
import { PermissionManager } from "../../utils/permission-manager.js";
|
import { PermissionManager } from "../../utils/permission-manager.js";
|
||||||
import { syncLogger } from "../../utils/logger.js";
|
import { syncLogger } from "../../utils/logger.js";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
import { and, eq, getTableColumns, type SQL } from "drizzle-orm";
|
import { and, eq, getTableColumns, type SQL } from "drizzle-orm";
|
||||||
import type { SyncRow } from "@termix/plugin-sdk/backend";
|
import type { SyncRow } from "@termix-ssh/plugin-sdk/backend";
|
||||||
import { createCurrentRepositoryContext } from "../database/repositories/factory.js";
|
import { createCurrentRepositoryContext } from "../database/repositories/factory.js";
|
||||||
import { DataCrypto } from "../utils/data-crypto.js";
|
import { DataCrypto } from "../utils/data-crypto.js";
|
||||||
import { SystemCrypto } from "../utils/system-crypto.js";
|
import { SystemCrypto } from "../utils/system-crypto.js";
|
||||||
|
|||||||
@@ -7,7 +7,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
import type { SyncEntityReference, SyncRow } from "@termix/plugin-sdk/backend";
|
import type {
|
||||||
|
SyncEntityReference,
|
||||||
|
SyncRow,
|
||||||
|
} from "@termix-ssh/plugin-sdk/backend";
|
||||||
import { FieldCrypto } from "../utils/field-crypto.js";
|
import { FieldCrypto } from "../utils/field-crypto.js";
|
||||||
import type { RegisteredSyncEntity } from "../plugins/sync-registry.js";
|
import type { RegisteredSyncEntity } from "../plugins/sync-registry.js";
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
interface Row {
|
interface Row {
|
||||||
pluginId: string;
|
pluginId: string;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ describe("afterPack plugin SDK copy", () => {
|
|||||||
fs.mkdirSync(path.join(sdk, "src"));
|
fs.mkdirSync(path.join(sdk, "src"));
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
path.join(sdk, "package.json"),
|
path.join(sdk, "package.json"),
|
||||||
'{"name":"@termix/plugin-sdk"}',
|
'{"name":"@termix-ssh/plugin-sdk"}',
|
||||||
);
|
);
|
||||||
fs.writeFileSync(path.join(sdk, "dist", "settings.js"), "export {};");
|
fs.writeFileSync(path.join(sdk, "dist", "settings.js"), "export {};");
|
||||||
fs.writeFileSync(path.join(sdk, "src", "settings.ts"), "");
|
fs.writeFileSync(path.join(sdk, "src", "settings.ts"), "");
|
||||||
@@ -41,7 +41,7 @@ describe("afterPack plugin SDK copy", () => {
|
|||||||
resources,
|
resources,
|
||||||
"app.asar.unpacked",
|
"app.asar.unpacked",
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"@termix",
|
"@termix-ssh",
|
||||||
"plugin-sdk",
|
"plugin-sdk",
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ vi.mock("../../../hosts/host-key-verifier.js", () => ({
|
|||||||
createHostVerifier: mocks.createHostVerifier,
|
createHostVerifier: mocks.createHostVerifier,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
vi.mock("@termix/plugin-sdk/ssh-certs", () => ({
|
vi.mock("@termix-ssh/plugin-sdk/ssh-certs", () => ({
|
||||||
applyCertificateAuth: mocks.applyCertificateAuth,
|
applyCertificateAuth: mocks.applyCertificateAuth,
|
||||||
}));
|
}));
|
||||||
vi.mock("../../../hosts/terminal-auth-helpers.js", () => ({
|
vi.mock("../../../hosts/terminal-auth-helpers.js", () => ({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
vi.mock("../../../database/repositories/factory.js", () => ({}));
|
vi.mock("../../../database/repositories/factory.js", () => ({}));
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import {
|
import {
|
||||||
buildCatalog,
|
buildCatalog,
|
||||||
catalogNamespaces,
|
catalogNamespaces,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
const rows = vi.hoisted(() => ({
|
const rows = vi.hoisted(() => ({
|
||||||
owned: [] as Array<Record<string, unknown>>,
|
owned: [] as Array<Record<string, unknown>>,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ vi.mock("../../utils/audit-logger.js", () => ({
|
|||||||
|
|
||||||
import { createPluginContext, createPluginHandle } from "../../plugins/ctx.js";
|
import { createPluginContext, createPluginHandle } from "../../plugins/ctx.js";
|
||||||
import { runAsActor } from "../../plugins/actor.js";
|
import { runAsActor } from "../../plugins/actor.js";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
function contextFor(pluginId: string) {
|
function contextFor(pluginId: string) {
|
||||||
const manifest = {
|
const manifest = {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import {
|
import {
|
||||||
createAuthState,
|
createAuthState,
|
||||||
fakeAuthManager,
|
fakeAuthManager,
|
||||||
@@ -53,7 +53,8 @@ vi.mock("../../utils/trusted-proxy-auth.js", () => ({
|
|||||||
isTrustedProxyAuthEnabled: () => h.trustedProxy,
|
isTrustedProxyAuthEnabled: () => h.trustedProxy,
|
||||||
}));
|
}));
|
||||||
vi.mock("../../plugins/permissions.js", async () => {
|
vi.mock("../../plugins/permissions.js", async () => {
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
return {
|
return {
|
||||||
assertCapability: async (
|
assertCapability: async (
|
||||||
pluginId: string,
|
pluginId: string,
|
||||||
@@ -170,10 +171,9 @@ function setup() {
|
|||||||
request.ip ?? "unknown",
|
request.ip ?? "unknown",
|
||||||
"4:bob",
|
"4:bob",
|
||||||
);
|
);
|
||||||
throw new (await import("@termix/plugin-sdk/backend")).LoginMethodError(
|
throw new (
|
||||||
"Invalid username or password",
|
await import("@termix-ssh/plugin-sdk/backend")
|
||||||
401,
|
).LoginMethodError("Invalid username or password", 401);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
kind: "external",
|
kind: "external",
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ vi.mock("../../utils/audit-logger.js", () => ({
|
|||||||
|
|
||||||
import { createPluginContext, createPluginHandle } from "../../plugins/ctx.js";
|
import { createPluginContext, createPluginHandle } from "../../plugins/ctx.js";
|
||||||
import { invalidatePluginPermissionCache } from "../../plugins/permissions.js";
|
import { invalidatePluginPermissionCache } from "../../plugins/permissions.js";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
function manifestFor(pluginId: string, capabilities: string[]): PluginManifest {
|
function manifestFor(pluginId: string, capabilities: string[]): PluginManifest {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ import {
|
|||||||
requireSecretResolver,
|
requireSecretResolver,
|
||||||
resetSecretResolverRegistryForTests,
|
resetSecretResolverRegistryForTests,
|
||||||
} from "../../hosts/connect/secret-resolver-registry.js";
|
} from "../../hosts/connect/secret-resolver-registry.js";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import ssh2 from "ssh2";
|
import ssh2 from "ssh2";
|
||||||
import { setHostProtocolSource } from "../../hosts/protocol-auth/registry.js";
|
import { setHostProtocolSource } from "../../hosts/protocol-auth/registry.js";
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ import {
|
|||||||
resetSyncRegistry,
|
resetSyncRegistry,
|
||||||
listEntityTypes,
|
listEntityTypes,
|
||||||
} from "../../plugins/sync-registry.js";
|
} from "../../plugins/sync-registry.js";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
function manifestFor(pluginId: string, capabilities: string[]): PluginManifest {
|
function manifestFor(pluginId: string, capabilities: string[]): PluginManifest {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ vi.mock("../../utils/electron-ipc-bridge.js", () => ({
|
|||||||
|
|
||||||
import { createPluginContext, createPluginHandle } from "../../plugins/ctx.js";
|
import { createPluginContext, createPluginHandle } from "../../plugins/ctx.js";
|
||||||
import { invalidatePluginPermissionCache } from "../../plugins/permissions.js";
|
import { invalidatePluginPermissionCache } from "../../plugins/permissions.js";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
function manifestFor(pluginId: string, capabilities: string[]): PluginManifest {
|
function manifestFor(pluginId: string, capabilities: string[]): PluginManifest {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ const h = vi.hoisted(() => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock("../../plugins/permissions.js", async () => {
|
vi.mock("../../plugins/permissions.js", async () => {
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
return {
|
return {
|
||||||
assertCapability: async (
|
assertCapability: async (
|
||||||
pluginId: string,
|
pluginId: string,
|
||||||
@@ -204,7 +205,8 @@ vi.mock("../../hosts/delete-host.js", () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
const { createPluginHosts } = await import("../../plugins/ctx-hosts.js");
|
const { createPluginHosts } = await import("../../plugins/ctx-hosts.js");
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
|
|
||||||
function manifest(capabilities: string[]) {
|
function manifest(capabilities: string[]) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
|
|||||||
import type {
|
import type {
|
||||||
PluginNotification,
|
PluginNotification,
|
||||||
PluginNotifyHub,
|
PluginNotifyHub,
|
||||||
} from "@termix/plugin-sdk/backend";
|
} from "@termix-ssh/plugin-sdk/backend";
|
||||||
|
|
||||||
const grants = new Map<string, string[]>();
|
const grants = new Map<string, string[]>();
|
||||||
const auditEntries: Array<Record<string, unknown>> = [];
|
const auditEntries: Array<Record<string, unknown>> = [];
|
||||||
@@ -81,7 +81,7 @@ import { createPluginContext, createPluginHandle } from "../../plugins/ctx.js";
|
|||||||
import { invalidatePluginPermissionCache } from "../../plugins/permissions.js";
|
import { invalidatePluginPermissionCache } from "../../plugins/permissions.js";
|
||||||
import { runAsActor } from "../../plugins/actor.js";
|
import { runAsActor } from "../../plugins/actor.js";
|
||||||
import { clearNotifyHub } from "../../plugins/notify-hub.js";
|
import { clearNotifyHub } from "../../plugins/notify-hub.js";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
function contextFor(
|
function contextFor(
|
||||||
capabilities: string[],
|
capabilities: string[],
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
vi.mock("../../plugins/permissions.js", async () => {
|
vi.mock("../../plugins/permissions.js", async () => {
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
return {
|
return {
|
||||||
assertCapability: async (
|
assertCapability: async (
|
||||||
pluginId: string,
|
pluginId: string,
|
||||||
@@ -40,7 +41,8 @@ vi.mock("../../plugins/index.js", () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
const { createPluginPlugins } = await import("../../plugins/ctx-plugins.js");
|
const { createPluginPlugins } = await import("../../plugins/ctx-plugins.js");
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
|
|
||||||
const manifest = (capabilities: string[]) =>
|
const manifest = (capabilities: string[]) =>
|
||||||
({ id: "reader", capabilities }) as unknown as PluginManifest;
|
({ id: "reader", capabilities }) as unknown as PluginManifest;
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|||||||
const h = vi.hoisted(() => ({ granted: new Set<string>() }));
|
const h = vi.hoisted(() => ({ granted: new Set<string>() }));
|
||||||
|
|
||||||
vi.mock("../../plugins/permissions.js", async () => {
|
vi.mock("../../plugins/permissions.js", async () => {
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
return {
|
return {
|
||||||
assertCapability: async (
|
assertCapability: async (
|
||||||
pluginId: string,
|
pluginId: string,
|
||||||
@@ -23,7 +24,8 @@ vi.mock("../../plugins/permissions.js", async () => {
|
|||||||
|
|
||||||
const { createPluginProcess } = await import("../../plugins/ctx-process.js");
|
const { createPluginProcess } = await import("../../plugins/ctx-process.js");
|
||||||
const { DisposableBag } = await import("../../plugins/disposables.js");
|
const { DisposableBag } = await import("../../plugins/disposables.js");
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
|
|
||||||
const DECLARED = ["process:spawn", "network:outbound"];
|
const DECLARED = ["process:spawn", "network:outbound"];
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ vi.mock("../../utils/audit-logger.js", () => ({
|
|||||||
import { createPluginContext, createPluginHandle } from "../../plugins/ctx.js";
|
import { createPluginContext, createPluginHandle } from "../../plugins/ctx.js";
|
||||||
import { invalidatePluginPermissionCache } from "../../plugins/permissions.js";
|
import { invalidatePluginPermissionCache } from "../../plugins/permissions.js";
|
||||||
import { runAsActor } from "../../plugins/actor.js";
|
import { runAsActor } from "../../plugins/actor.js";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
function contextFor(capabilities: string[]) {
|
function contextFor(capabilities: string[]) {
|
||||||
grants.set("demo", capabilities);
|
grants.set("demo", capabilities);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
clearServiceRegistry,
|
clearServiceRegistry,
|
||||||
getRegistration,
|
getRegistration,
|
||||||
} from "../../plugins/service-registry.js";
|
} from "../../plugins/service-registry.js";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
function contextFor(pluginId: string, names?: string[]) {
|
function contextFor(pluginId: string, names?: string[]) {
|
||||||
const manifest = {
|
const manifest = {
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ vi.mock("../../utils/logger.js", () => {
|
|||||||
return { pluginLogger: log, sshLogger: log, logger: log, authLogger: log };
|
return { pluginLogger: log, sshLogger: log, logger: log, authLogger: log };
|
||||||
});
|
});
|
||||||
vi.mock("../../plugins/permissions.js", async () => {
|
vi.mock("../../plugins/permissions.js", async () => {
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
return {
|
return {
|
||||||
assertCapability: async (
|
assertCapability: async (
|
||||||
pluginId: string,
|
pluginId: string,
|
||||||
@@ -142,7 +143,8 @@ const { classifyKeyboardInteractive } =
|
|||||||
await import("../../hosts/connect/keyboard-interactive.js");
|
await import("../../hosts/connect/keyboard-interactive.js");
|
||||||
const { getLoginMethod, getSecondFactor } =
|
const { getLoginMethod, getSecondFactor } =
|
||||||
await import("../../auth/registry.js");
|
await import("../../auth/registry.js");
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
|
|
||||||
function manifest(capabilities: string[], auth: Record<string, string[]> = {}) {
|
function manifest(capabilities: string[], auth: Record<string, string[]> = {}) {
|
||||||
return {
|
return {
|
||||||
@@ -647,7 +649,7 @@ describe("ctx.auth", () => {
|
|||||||
it("refuses enrolment when core policy forbids second factors", async () => {
|
it("refuses enrolment when core policy forbids second factors", async () => {
|
||||||
h.granted = new Set(["auth:provide"]);
|
h.granted = new Set(["auth:provide"]);
|
||||||
h.factors = [];
|
h.factors = [];
|
||||||
const { LoginMethodError } = await import("@termix/plugin-sdk/backend");
|
const { LoginMethodError } = await import("@termix-ssh/plugin-sdk/backend");
|
||||||
h.policyError = new LoginMethodError("password login is off", 409);
|
h.policyError = new LoginMethodError("password login is off", 409);
|
||||||
const auth = createPluginAuth({
|
const auth = createPluginAuth({
|
||||||
manifest: manifest(["auth:provide"], { secondFactors: ["pin"] }),
|
manifest: manifest(["auth:provide"], { secondFactors: ["pin"] }),
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ vi.mock("../../utils/logger.js", () => {
|
|||||||
return { pluginLogger: log, sshLogger: log, logger: log, authLogger: log };
|
return { pluginLogger: log, sshLogger: log, logger: log, authLogger: log };
|
||||||
});
|
});
|
||||||
vi.mock("../../plugins/permissions.js", async () => {
|
vi.mock("../../plugins/permissions.js", async () => {
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
return {
|
return {
|
||||||
assertCapability: async (
|
assertCapability: async (
|
||||||
pluginId: string,
|
pluginId: string,
|
||||||
@@ -110,7 +111,7 @@ const { DisposableBag } = await import("../../plugins/disposables.js");
|
|||||||
const { registerSshAuthProvider, resetSshAuthRegistryForTests } =
|
const { registerSshAuthProvider, resetSshAuthRegistryForTests } =
|
||||||
await import("../../hosts/connect/auth-provider-registry.js");
|
await import("../../hosts/connect/auth-provider-registry.js");
|
||||||
const { PluginCapabilityError, PluginSshInteractionError } =
|
const { PluginCapabilityError, PluginSshInteractionError } =
|
||||||
await import("@termix/plugin-sdk/backend");
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
|
|
||||||
const ALL = ["ssh:connect", "credentials:use", "credentials:read"];
|
const ALL = ["ssh:connect", "credentials:use", "credentials:read"];
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ const h = vi.hoisted(() => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock("../../plugins/permissions.js", async () => {
|
vi.mock("../../plugins/permissions.js", async () => {
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
return {
|
return {
|
||||||
assertCapability: async (
|
assertCapability: async (
|
||||||
pluginId: string,
|
pluginId: string,
|
||||||
@@ -56,7 +57,8 @@ vi.mock("../../tls/acme-challenges.js", () => ({
|
|||||||
|
|
||||||
const { createPluginSystem } = await import("../../plugins/ctx-system.js");
|
const { createPluginSystem } = await import("../../plugins/ctx-system.js");
|
||||||
const { DisposableBag } = await import("../../plugins/disposables.js");
|
const { DisposableBag } = await import("../../plugins/disposables.js");
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
|
|
||||||
let audits: Array<{ action: string; success: boolean }>;
|
let audits: Array<{ action: string; success: boolean }>;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
isValidPackageName,
|
isValidPackageName,
|
||||||
buildSudoCommand,
|
buildSudoCommand,
|
||||||
parseUpgradable,
|
parseUpgradable,
|
||||||
} from "@termix/plugin-sdk/host-commands";
|
} from "@termix-ssh/plugin-sdk/host-commands";
|
||||||
|
|
||||||
describe("parsePlatformProbe", () => {
|
describe("parsePlatformProbe", () => {
|
||||||
it("prefers dnf over yum when both are present", () => {
|
it("prefers dnf over yum when both are present", () => {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {
|
|||||||
text,
|
text,
|
||||||
timestamp,
|
timestamp,
|
||||||
varchar,
|
varchar,
|
||||||
} from "@termix/plugin-sdk/db";
|
} from "@termix-ssh/plugin-sdk/db";
|
||||||
import { createTableSql, dropTableSql } from "../../plugins/table-builder.js";
|
import { createTableSql, dropTableSql } from "../../plugins/table-builder.js";
|
||||||
import {
|
import {
|
||||||
adoptLegacyTableSql,
|
adoptLegacyTableSql,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
import crypto from "node:crypto";
|
import crypto from "node:crypto";
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { TestSqliteDatabase } from "../database/repositories/test-support.js";
|
import { TestSqliteDatabase } from "../database/repositories/test-support.js";
|
||||||
import type { DatabaseContext } from "../../database/repositories/database-context.js";
|
import type { DatabaseContext } from "../../database/repositories/database-context.js";
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ import {
|
|||||||
id,
|
id,
|
||||||
refUser,
|
refUser,
|
||||||
text,
|
text,
|
||||||
} from "@termix/plugin-sdk/db";
|
} from "@termix-ssh/plugin-sdk/db";
|
||||||
import { adoptTableSql } from "@termix/plugin-sdk/ddl";
|
import { adoptTableSql } from "@termix-ssh/plugin-sdk/ddl";
|
||||||
import { createMockCtx, createTestDb } from "@termix/plugin-sdk/testing";
|
import { createMockCtx, createTestDb } from "@termix-ssh/plugin-sdk/testing";
|
||||||
|
|
||||||
let root: string;
|
let root: string;
|
||||||
let pluginDir: string;
|
let pluginDir: string;
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ function secretHost(id: number): Record<string, unknown> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
vi.mock("../../../plugins/permissions.js", async () => {
|
vi.mock("../../../plugins/permissions.js", async () => {
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
const granted = (capability: string, declared: readonly string[]) =>
|
const granted = (capability: string, declared: readonly string[]) =>
|
||||||
declared.includes(capability) && h.granted.has(capability);
|
declared.includes(capability) && h.granted.has(capability);
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ const { createPluginContext, createPluginHandle } =
|
|||||||
const { invalidatePluginPermissionCache } =
|
const { invalidatePluginPermissionCache } =
|
||||||
await import("../../../plugins/permissions.js");
|
await import("../../../plugins/permissions.js");
|
||||||
const { runAsActor } = await import("../../../plugins/actor.js");
|
const { runAsActor } = await import("../../../plugins/actor.js");
|
||||||
const { PluginCapabilityError } = await import("@termix/plugin-sdk/backend");
|
const { PluginCapabilityError } =
|
||||||
|
await import("@termix-ssh/plugin-sdk/backend");
|
||||||
|
|
||||||
const PLUGIN_ID = "walker";
|
const PLUGIN_ID = "walker";
|
||||||
const ACTOR = "user-walker";
|
const ACTOR = "user-walker";
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|||||||
import {
|
import {
|
||||||
collectOwnedIndexes,
|
collectOwnedIndexes,
|
||||||
findUnownedTableWrites,
|
findUnownedTableWrites,
|
||||||
} from "@termix/plugin-sdk/ddl";
|
} from "@termix-ssh/plugin-sdk/ddl";
|
||||||
|
|
||||||
const state = vi.hoisted(() => ({
|
const state = vi.hoisted(() => ({
|
||||||
db: null as unknown,
|
db: null as unknown,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import os from "node:os";
|
|||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { PluginLoader, prefixesOverlap } from "../../../plugins/loader.js";
|
import { PluginLoader, prefixesOverlap } from "../../../plugins/loader.js";
|
||||||
import { parseManifest } from "../../../plugins/manifest.js";
|
import { parseManifest } from "../../../plugins/manifest.js";
|
||||||
import { RESERVED_PLUGIN_IDS } from "@termix/plugin-sdk/manifest";
|
import { RESERVED_PLUGIN_IDS } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
import { createFixturePlugin } from "../fixture-plugin.js";
|
import { createFixturePlugin } from "../fixture-plugin.js";
|
||||||
|
|
||||||
vi.mock("../../../database/repositories/factory.js", () => ({
|
vi.mock("../../../database/repositories/factory.js", () => ({
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|||||||
import express from "express";
|
import express from "express";
|
||||||
import type { AddressInfo } from "node:net";
|
import type { AddressInfo } from "node:net";
|
||||||
import type { Server } from "node:http";
|
import type { Server } from "node:http";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
const state = vi.hoisted(() => ({
|
const state = vi.hoisted(() => ({
|
||||||
userId: "user-1",
|
userId: "user-1",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
interface Row {
|
interface Row {
|
||||||
pluginId: string;
|
pluginId: string;
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ import {
|
|||||||
prefixedTableName,
|
prefixedTableName,
|
||||||
tablePrefix,
|
tablePrefix,
|
||||||
adoptLegacyTable,
|
adoptLegacyTable,
|
||||||
} from "@termix/plugin-sdk/db";
|
} from "@termix-ssh/plugin-sdk/db";
|
||||||
import { splitStatements } from "@termix/plugin-sdk/ddl";
|
import { splitStatements } from "@termix-ssh/plugin-sdk/ddl";
|
||||||
import {
|
import {
|
||||||
adoptTableSql,
|
adoptTableSql,
|
||||||
createTableSql,
|
createTableSql,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
refUser,
|
refUser,
|
||||||
text,
|
text,
|
||||||
varchar,
|
varchar,
|
||||||
} from "@termix/plugin-sdk/db";
|
} from "@termix-ssh/plugin-sdk/db";
|
||||||
|
|
||||||
let sqlite: Database.Database;
|
let sqlite: Database.Database;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import type { PluginManifest } from "@termix/plugin-sdk/manifest";
|
import type { PluginManifest } from "@termix-ssh/plugin-sdk/manifest";
|
||||||
|
|
||||||
const h = vi.hoisted(() => ({
|
const h = vi.hoisted(() => ({
|
||||||
stored: new Map<string, unknown>(),
|
stored: new Map<string, unknown>(),
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
export type * from "@termix/plugin-sdk/desktop";
|
export type * from "@termix-ssh/plugin-sdk/desktop";
|
||||||
+2
-2
@@ -2,7 +2,7 @@ import type {
|
|||||||
HostProtocolAuthSummary,
|
HostProtocolAuthSummary,
|
||||||
HostProtocolAuthType,
|
HostProtocolAuthType,
|
||||||
HostSshOptions,
|
HostSshOptions,
|
||||||
} from "@termix/plugin-sdk/frontend";
|
} from "@termix-ssh/plugin-sdk/frontend";
|
||||||
import type { Request } from "express";
|
import type { Request } from "express";
|
||||||
import type { RefObject } from "react";
|
import type { RefObject } from "react";
|
||||||
import type { HostAuthOverrides } from "./auth-protocols.js";
|
import type { HostAuthOverrides } from "./auth-protocols.js";
|
||||||
@@ -280,7 +280,7 @@ export interface CredentialBackend {
|
|||||||
*/
|
*/
|
||||||
export type HostTerminalConfig = Record<string, unknown>;
|
export type HostTerminalConfig = Record<string, unknown>;
|
||||||
|
|
||||||
export type { HostSshOptions } from "@termix/plugin-sdk/frontend";
|
export type { HostSshOptions } from "@termix-ssh/plugin-sdk/frontend";
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// TAB TYPES
|
// TAB TYPES
|
||||||
|
|||||||
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user