mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 23:25:24 +00:00
feat: move the terminal fully into the ssh-terminal plugin (B9)
This commit is contained in:
1 parent
535126fd1b
commit
79d77678c9
309 files changed
+41789
-14958
No files matched your search
@@ -166,6 +166,25 @@ export function getRegistration(
|
||||
return services.get(service);
|
||||
}
|
||||
|
||||
/**
|
||||
* A plugin service as core itself calls it, or undefined while no plugin
|
||||
* provides a compatible version.
|
||||
*
|
||||
* Core is not a plugin and already authorized the request it is serving, so
|
||||
* this skips the per-call permission check a plugin's handle runs. It is the
|
||||
* same object plugins get. Session sharing reaching the terminal's live
|
||||
* sessions is the first caller.
|
||||
*/
|
||||
export function getServiceImplementation<T extends object>(
|
||||
service: string,
|
||||
versionRange: string,
|
||||
): T | undefined {
|
||||
const registration = services.get(service);
|
||||
if (!registration) return undefined;
|
||||
if (!semver.satisfies(registration.version, versionRange)) return undefined;
|
||||
return registration.implementation as T;
|
||||
}
|
||||
|
||||
export function listServices(): ServiceRegistration[] {
|
||||
return [...services.values()];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user