Compare commits
No commits in common. "9401b0420c008af5ccfdca546206a1c0b6ec282e" and "3ae45da89670d5c9e5337bfbfafbc538d5b48d51" have entirely different histories.
9401b0420c
...
3ae45da896
|
@ -6,7 +6,6 @@ import type { HDKey } from "micro-ed25519-hdkey";
|
|||
import type Config from "@lumeweb/cfg";
|
||||
import type { ProtocolManager } from "./swarm.js";
|
||||
import type { Util } from "./util.js";
|
||||
import type { FastifyInstance } from "fastify";
|
||||
export type PluginFunction = (api: PluginAPI) => Promise<void>;
|
||||
export interface Plugin {
|
||||
name: string;
|
||||
|
@ -36,7 +35,6 @@ export declare class PluginAPI extends EventEmitter2 {
|
|||
get identity(): HDKey;
|
||||
get ssl(): SSLManager;
|
||||
get protocols(): ProtocolManager;
|
||||
get app(): FastifyInstance;
|
||||
loadPlugin(moduleName: string): (moduleName: string) => Promise<Plugin>;
|
||||
registerMethod(methodName: string, method: RPCMethod): void;
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC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M,EAAE,SAAS,GAAG,IAAI;CAC5D"}
|
|
@ -2,17 +2,19 @@
|
|||
/// <reference types="node" />
|
||||
import type tls from "tls";
|
||||
export type SSLManagerRenewHandler = (domain: string) => Promise<boolean>;
|
||||
export type SSLCert = string | Buffer | Array<string | Buffer>;
|
||||
declare class SSLManager {
|
||||
private _context?;
|
||||
private _key?;
|
||||
private _cert?;
|
||||
private _domain;
|
||||
private _renewHandler?;
|
||||
constructor(domain: string);
|
||||
get context(): tls.SecureContext;
|
||||
set privateKey(key: Buffer);
|
||||
set cert(cert: SSLCert);
|
||||
set cert(cert: Buffer);
|
||||
private _maybeUpdateContext;
|
||||
renew(): Promise<boolean>;
|
||||
get enabled(): boolean;
|
||||
get ready(): boolean;
|
||||
get renewHandler(): SSLManagerRenewHandler;
|
||||
set renewHandler(value: SSLManagerRenewHandler);
|
||||
get enabled(): any;
|
||||
}
|
||||
export default SSLManager;
|
||||
//# sourceMappingURL=ssl.d.ts.map
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"ssl.d.ts","sourceRoot":"","sources":["../src/ssl.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAC1E,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;AAE/D,OAAO,OAAO,UAAU;gBACV,MAAM,EAAE,MAAM;IAE1B,IAAI,OAAO,IAAI,GAAG,CAAC,aAAa,CAAC;IAEjC,IAAI,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE;IAE5B,IAAI,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE;IAExB,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IAEzB,IAAI,OAAO,IAAI,OAAO,CAAC;IAEvB,IAAI,KAAK,IAAI,OAAO,CAAC;IAErB,IAAI,YAAY,IAAI,sBAAsB,CAAC;IAC3C,IAAI,YAAY,CAAC,KAAK,EAAE,sBAAsB,EAAE;CACjD;AAED,eAAe,UAAU,CAAC"}
|
||||
{"version":3,"file":"ssl.d.ts","sourceRoot":"","sources":["../src/ssl.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAC1E,OAAO,OAAO,UAAU;IACtB,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClB,OAAO,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,CAAC,KAAK,CAAC,CAAC;IACf,OAAO,CAAC,OAAO,CAAC;IAChB,OAAO,CAAC,aAAa,CAAC,CAAC;gBACX,MAAM,EAAE,MAAM;IAC1B,IAAI,OAAO,IAAI,GAAG,CAAC,aAAa,CAAC;IACjC,IAAI,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE;IAC5B,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE;IACvB,OAAO,CAAC,mBAAmB,CAAC;IAC5B,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IACzB,IAAI,OAAO,IAAI,GAAG,CAAC;CACpB;AACD,eAAe,UAAU,CAAC"}
|
|
@ -9,7 +9,6 @@
|
|||
"@types/node": "^18.11.17",
|
||||
"c": "^1.1.1",
|
||||
"express": "^4.18.1",
|
||||
"fastify": "^4.15.0",
|
||||
"node-cache": "^5.1.2",
|
||||
"prettier": "^2.8.1",
|
||||
"typescript": "^4.9.4"
|
||||
|
|
|
@ -6,7 +6,6 @@ import type { HDKey } from "micro-ed25519-hdkey";
|
|||
import type Config from "@lumeweb/cfg";
|
||||
import type { ProtocolManager } from "./swarm.js";
|
||||
import type { Util } from "./util.js";
|
||||
import type { FastifyInstance } from "fastify";
|
||||
|
||||
export type PluginFunction = (api: PluginAPI) => Promise<void>;
|
||||
|
||||
|
@ -39,7 +38,6 @@ export declare class PluginAPI extends EventEmitter2 {
|
|||
get identity(): HDKey;
|
||||
get ssl(): SSLManager;
|
||||
get protocols(): ProtocolManager;
|
||||
get app(): FastifyInstance;
|
||||
loadPlugin(moduleName: string): (moduleName: string) => Promise<Plugin>;
|
||||
registerMethod(methodName: string, method: RPCMethod): void;
|
||||
}
|
||||
|
|
23
src/ssl.ts
23
src/ssl.ts
|
@ -1,25 +1,18 @@
|
|||
import type tls from "tls";
|
||||
|
||||
export type SSLManagerRenewHandler = (domain: string) => Promise<boolean>;
|
||||
export type SSLCert = string | Buffer | Array<string | Buffer>;
|
||||
|
||||
declare class SSLManager {
|
||||
private _context?;
|
||||
private _key?;
|
||||
private _cert?;
|
||||
private _domain;
|
||||
private _renewHandler?;
|
||||
constructor(domain: string);
|
||||
|
||||
get context(): tls.SecureContext;
|
||||
|
||||
set privateKey(key: Buffer);
|
||||
|
||||
set cert(cert: SSLCert);
|
||||
|
||||
set cert(cert: Buffer);
|
||||
private _maybeUpdateContext;
|
||||
renew(): Promise<boolean>;
|
||||
|
||||
get enabled(): boolean;
|
||||
|
||||
get ready(): boolean;
|
||||
|
||||
get renewHandler(): SSLManagerRenewHandler;
|
||||
set renewHandler(value: SSLManagerRenewHandler);
|
||||
get enabled(): any;
|
||||
}
|
||||
|
||||
export default SSLManager;
|
||||
|
|
Loading…
Reference in New Issue