@stacksjs/rpx 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/start.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import type { CleanupOptions, ProxySetupOptions, ReverseProxyConfigs, ReverseProxyOption, ReverseProxyOptions, SSLConfig, SingleReverseProxyConfig } from './types';
1
+ import type { CleanupOptions, ProxySetupOptions, ReverseProxyOption, ReverseProxyOptions, SSLConfig, SingleReverseProxyConfig } from './types';
2
2
 
3
3
  declare const activeServers: Set<http.Server | https.Server>;
4
4
  export declare function cleanup(options?: CleanupOptions): Promise<void>;
5
- declare function loadSSLConfig(options: ReverseProxyOption): Promise<SSLConfig | null>;
6
5
  declare function isPortInUse(port: number, hostname: string, verbose?: boolean): Promise<boolean>;
7
6
  declare function findAvailablePort(startPort: number, hostname: string, verbose?: boolean): Promise<number>;
8
7
  declare function testConnection(hostname: string, port: number, verbose?: boolean): Promise<void>;
@@ -11,5 +10,4 @@ declare function createProxyServer(from: string, to: string, fromPort: number, l
11
10
  export declare function setupReverseProxy(options: ProxySetupOptions): Promise<void>;
12
11
  export declare function startHttpRedirectServer(verbose?: boolean): void;
13
12
  export declare function startProxy(options: ReverseProxyOption): void;
14
- export declare function startProxies(options?: ReverseProxyOptions): Promise<void>;
15
- declare function isMultiProxyConfig(options: ReverseProxyConfigs): options is MultiReverseProxyConfig;
13
+ export declare function startProxies(options?: ReverseProxyOptions): Promise<void>;
package/dist/types.d.ts CHANGED
@@ -1,13 +1,11 @@
1
- import type { TlsConfig } from '@stacksjs/tlsx';
1
+ import type { TlsConfig, TlsOption } from '@stacksjs/tlsx';
2
2
 
3
- export type { TlsConfig }
4
- export declare type CustomTlsConfig = Partial<Omit<TlsConfig, 'caCertPath' | 'certPath' | 'keyPath'>> &
5
- Pick<TlsConfig, 'caCertPath' | 'certPath' | 'keyPath'>
6
-
7
- export interface BaseReverseProxyConfig {
3
+ export type { TlsConfig, TlsOption }
4
+ export declare interface BaseReverseProxyConfig {
8
5
  from: string
9
6
  to: string
10
7
  }
8
+ export declare type BaseReverseProxyOptions = Partial<BaseReverseProxyConfig>
11
9
 
12
10
  export interface CleanupOptions {
13
11
  domains?: string[]
@@ -15,28 +13,24 @@ export interface CleanupOptions {
15
13
  verbose?: boolean
16
14
  }
17
15
 
18
- export interface SharedProxySettings {
19
- https: boolean | CustomTlsConfig
16
+ export interface SharedProxyConfig {
17
+ https: boolean | TlsOption
20
18
  etcHostsCleanup: boolean
21
19
  verbose: boolean
22
20
  _cachedSSLConfig?: SSLConfig | null
23
21
  }
22
+ export type SharedProxyOptions = Partial<SharedProxyConfig>
24
23
 
25
- export interface SingleReverseProxyConfig extends BaseReverseProxyConfig, SharedProxySettings {}
26
-
27
- export interface MultiReverseProxyConfig extends SharedProxySettings {
24
+ export interface SingleReverseProxyConfig extends BaseReverseProxyConfig, SharedProxyConfig {}
25
+ export interface MultiReverseProxyConfig extends SharedProxyConfig {
28
26
  proxies: BaseReverseProxyConfig[]
29
27
  }
30
-
28
+ export type ReverseProxyConfig = SingleReverseProxyConfig
31
29
  export type ReverseProxyConfigs = SingleReverseProxyConfig | MultiReverseProxyConfig
32
30
 
33
31
  export type BaseReverseProxyOption = Partial<BaseReverseProxyConfig>
34
- export type PartialSharedSettings = Partial<SharedProxySettings>
35
-
36
- export type MultiReverseProxyOption = MultiReverseProxyConfig
37
-
38
- export type ReverseProxyOption = SingleReverseProxyConfig
39
- export type ReverseProxyOptions = SingleReverseProxyConfig | MultiReverseProxyOption
32
+ export type ReverseProxyOption = Partial<SingleReverseProxyConfig>
33
+ export type ReverseProxyOptions = Partial<SingleReverseProxyConfig> | Partial<MultiReverseProxyConfig>
40
34
 
41
35
  export interface SSLConfig {
42
36
  key: string
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,9 @@
1
- import type { ReverseProxyConfigs } from './types';
1
+ import type { ReverseProxyOption } from './types';
2
2
 
3
3
  export declare function debugLog(category: string, message: string, verbose?: boolean): void;
4
- export declare function extractDomains(options: ReverseProxyConfigs): string[];
4
+ export declare function extractHostname(options: ReverseProxyOption | ReverseProxyOptions): string[];
5
+ declare interface RootCA {
6
+ certificate: string
7
+ privateKey: string
8
+ }
9
+ export declare function isValidRootCA(value: unknown): value is RootCA;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/rpx",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "A modern reverse proxy.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -61,7 +61,7 @@
61
61
  "preview:docs": "vitepress preview docs"
62
62
  },
63
63
  "dependencies": {
64
- "@stacksjs/tlsx": "^0.7.6"
64
+ "@stacksjs/tlsx": "^0.8.3"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@stacksjs/cli": "^0.68.2",