feat(docs): Update README to reflect new modular architecture and expanded core utilities: add Project Architecture Overview, update export paths and API references, and mark plan tasks as completed
This commit is contained in:
		| @@ -3,6 +3,6 @@ | ||||
|  */ | ||||
| export const commitinfo = { | ||||
|   name: '@push.rocks/smartproxy', | ||||
|   version: '13.0.0', | ||||
|   version: '13.1.0', | ||||
|   description: 'A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, dynamic routing with authentication options, and automatic ACME certificate management.' | ||||
| } | ||||
|   | ||||
| @@ -4,7 +4,7 @@ import * as plugins from '../../plugins.js'; | ||||
|  * Certificate data structure containing all necessary information | ||||
|  * about a certificate | ||||
|  */ | ||||
| export interface CertificateData { | ||||
| export interface ICertificateData { | ||||
|   domain: string; | ||||
|   certificate: string; | ||||
|   privateKey: string; | ||||
| @@ -17,7 +17,7 @@ export interface CertificateData { | ||||
| /** | ||||
|  * Certificates pair (private and public keys) | ||||
|  */ | ||||
| export interface Certificates { | ||||
| export interface ICertificates { | ||||
|   privateKey: string; | ||||
|   publicKey: string; | ||||
| } | ||||
| @@ -25,7 +25,7 @@ export interface Certificates { | ||||
| /** | ||||
|  * Certificate failure payload type | ||||
|  */ | ||||
| export interface CertificateFailure { | ||||
| export interface ICertificateFailure { | ||||
|   domain: string; | ||||
|   error: string; | ||||
|   isRenewal: boolean; | ||||
| @@ -34,7 +34,7 @@ export interface CertificateFailure { | ||||
| /** | ||||
|  * Certificate expiry payload type | ||||
|  */ | ||||
| export interface CertificateExpiring { | ||||
| export interface ICertificateExpiring { | ||||
|   domain: string; | ||||
|   expiryDate: Date; | ||||
|   daysRemaining: number; | ||||
| @@ -43,7 +43,7 @@ export interface CertificateExpiring { | ||||
| /** | ||||
|  * Domain forwarding configuration | ||||
|  */ | ||||
| export interface ForwardConfig { | ||||
| export interface IForwardConfig { | ||||
|   ip: string; | ||||
|   port: number; | ||||
| } | ||||
| @@ -51,28 +51,28 @@ export interface ForwardConfig { | ||||
| /** | ||||
|  * Domain-specific forwarding configuration for ACME challenges | ||||
|  */ | ||||
| export interface DomainForwardConfig { | ||||
| export interface IDomainForwardConfig { | ||||
|   domain: string; | ||||
|   forwardConfig?: ForwardConfig; | ||||
|   acmeForwardConfig?: ForwardConfig; | ||||
|   forwardConfig?: IForwardConfig; | ||||
|   acmeForwardConfig?: IForwardConfig; | ||||
|   sslRedirect?: boolean; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Domain configuration options | ||||
|  */ | ||||
| export interface DomainOptions { | ||||
| export interface IDomainOptions { | ||||
|   domainName: string; | ||||
|   sslRedirect: boolean;   // if true redirects the request to port 443 | ||||
|   acmeMaintenance: boolean; // tries to always have a valid cert for this domain | ||||
|   forward?: ForwardConfig; // forwards all http requests to that target | ||||
|   acmeForward?: ForwardConfig; // forwards letsencrypt requests to this config | ||||
|   forward?: IForwardConfig; // forwards all http requests to that target | ||||
|   acmeForward?: IForwardConfig; // forwards letsencrypt requests to this config | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Unified ACME configuration options used across proxies and handlers | ||||
|  */ | ||||
| export interface AcmeOptions { | ||||
| export interface IAcmeOptions { | ||||
|   accountEmail?: string;          // Email for Let's Encrypt account | ||||
|   enabled?: boolean;              // Whether ACME is enabled | ||||
|   port?: number;                  // Port to listen on for ACME challenges (default: 80) | ||||
| @@ -83,15 +83,5 @@ export interface AcmeOptions { | ||||
|   autoRenew?: boolean;            // Whether to automatically renew certificates | ||||
|   certificateStore?: string;      // Directory to store certificates | ||||
|   skipConfiguredCerts?: boolean;  // Skip domains with existing certificates | ||||
|   domainForwards?: DomainForwardConfig[]; // Domain-specific forwarding configs | ||||
| } | ||||
|  | ||||
| // Backwards compatibility interfaces | ||||
| export interface ICertificates extends Certificates {} | ||||
| export interface ICertificateData extends CertificateData {} | ||||
| export interface ICertificateFailure extends CertificateFailure {} | ||||
| export interface ICertificateExpiring extends CertificateExpiring {} | ||||
| export interface IForwardConfig extends ForwardConfig {} | ||||
| export interface IDomainForwardConfig extends DomainForwardConfig {} | ||||
| export interface IDomainOptions extends DomainOptions {} | ||||
| export interface IAcmeOptions extends AcmeOptions {} | ||||
|   domainForwards?: IDomainForwardConfig[]; // Domain-specific forwarding configs | ||||
| } | ||||
| @@ -5,7 +5,7 @@ import type { ICertificateData, ICertificateFailure, ICertificateExpiring } from | ||||
| /** | ||||
|  * Subscribers callback definitions for Port80Handler events | ||||
|  */ | ||||
| export interface Port80HandlerSubscribers { | ||||
| export interface IPort80HandlerSubscribers { | ||||
|   onCertificateIssued?: (data: ICertificateData) => void; | ||||
|   onCertificateRenewed?: (data: ICertificateData) => void; | ||||
|   onCertificateFailed?: (data: ICertificateFailure) => void; | ||||
| @@ -17,7 +17,7 @@ export interface Port80HandlerSubscribers { | ||||
|  */ | ||||
| export function subscribeToPort80Handler( | ||||
|   handler: Port80Handler, | ||||
|   subscribers: Port80HandlerSubscribers | ||||
|   subscribers: IPort80HandlerSubscribers | ||||
| ): void { | ||||
|   if (subscribers.onCertificateIssued) { | ||||
|     handler.on(Port80HandlerEvents.CERTIFICATE_ISSUED, subscribers.onCertificateIssued); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user