*Update API interface to add the identity and ssl manager
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Derrick Hammer 2022-12-19 12:08:33 -05:00
parent c139eb3165
commit c207452c65
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 11 additions and 1 deletions

View File

@ -7,13 +7,15 @@ import * as fs from "fs";
import path from "path"; import path from "path";
import type { Logger } from "pino"; import type { Logger } from "pino";
import { getSeed } from "../lib/seed.js"; import { getHDKey, getSeed } from "../lib/seed.js";
import pluginRpc from "./plugins/rpc"; import pluginRpc from "./plugins/rpc";
import pluginCore from "./plugins/core"; import pluginCore from "./plugins/core";
import type Config from "@lumeweb/cfg"; import type Config from "@lumeweb/cfg";
import EventEmitter2 from "eventemitter2"; import EventEmitter2 from "eventemitter2";
import log from "../log.js"; import log from "../log.js";
import { get as getSwarm } from "./swarm.js"; import { get as getSwarm } from "./swarm.js";
import { get as getSSl } from "./ssl.js";
import type { HDKey } from "micro-ed25519-hdkey";
let pluginAPIManager: PluginAPIManager; let pluginAPIManager: PluginAPIManager;
let pluginAPI: PluginAPI; let pluginAPI: PluginAPI;
@ -72,6 +74,14 @@ class PluginAPI extends EventEmitter2 {
return getSeed(); return getSeed();
} }
get identity(): HDKey {
return getHDKey();
}
get ssl() {
return getSSl();
}
public loadPlugin( public loadPlugin(
moduleName: string moduleName: string
): (moduleName: string) => Promise<Plugin> { ): (moduleName: string) => Promise<Plugin> {