@camstack/addon-cloudflare-tunnel 0.1.7 → 0.1.9
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.
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { INetworkAccessProvider, IScopedLogger, IEventBus, IProcessManager, INetworkEndpoint, NetworkAccessStatus, ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
|
|
2
|
+
|
|
3
|
+
interface CloudflareTunnelConfig {
|
|
4
|
+
readonly mode: 'quick' | 'named';
|
|
5
|
+
readonly namedTunnelToken?: string;
|
|
6
|
+
readonly localPort: number;
|
|
7
|
+
}
|
|
8
|
+
declare class CloudflareTunnelService implements INetworkAccessProvider {
|
|
9
|
+
private readonly config;
|
|
10
|
+
private readonly logger;
|
|
11
|
+
private readonly eventBus;
|
|
12
|
+
private readonly processManager;
|
|
13
|
+
readonly id = "cloudflare-tunnel";
|
|
14
|
+
readonly type = "cloudflare";
|
|
15
|
+
private endpoint;
|
|
16
|
+
private processId;
|
|
17
|
+
constructor(config: CloudflareTunnelConfig, logger: IScopedLogger, eventBus: IEventBus, processManager: IProcessManager);
|
|
18
|
+
start(): Promise<INetworkEndpoint>;
|
|
19
|
+
stop(): Promise<void>;
|
|
20
|
+
getEndpoint(): INetworkEndpoint | null;
|
|
21
|
+
getStatus(): NetworkAccessStatus;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare class CloudflareTunnelAddon implements ICamstackAddon, IConfigurable {
|
|
25
|
+
readonly manifest: AddonManifest;
|
|
26
|
+
private service;
|
|
27
|
+
private currentConfig;
|
|
28
|
+
initialize(context: AddonContext): Promise<void>;
|
|
29
|
+
shutdown(): Promise<void>;
|
|
30
|
+
/** Provide the ProcessManagerService to enable tunnel management */
|
|
31
|
+
setProcessManager(processManager: IProcessManager, config: CloudflareTunnelConfig, context: AddonContext): void;
|
|
32
|
+
getService(): CloudflareTunnelService;
|
|
33
|
+
getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
|
|
34
|
+
getConfigSchema(): ConfigUISchema;
|
|
35
|
+
getConfig(): Record<string, unknown>;
|
|
36
|
+
onConfigChange(config: Record<string, unknown>): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { type CloudflareTunnelConfig as C, CloudflareTunnelAddon, CloudflareTunnelService as a };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { INetworkAccessProvider, IScopedLogger, IEventBus, IProcessManager, INetworkEndpoint, NetworkAccessStatus, ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
|
|
2
|
+
|
|
3
|
+
interface CloudflareTunnelConfig {
|
|
4
|
+
readonly mode: 'quick' | 'named';
|
|
5
|
+
readonly namedTunnelToken?: string;
|
|
6
|
+
readonly localPort: number;
|
|
7
|
+
}
|
|
8
|
+
declare class CloudflareTunnelService implements INetworkAccessProvider {
|
|
9
|
+
private readonly config;
|
|
10
|
+
private readonly logger;
|
|
11
|
+
private readonly eventBus;
|
|
12
|
+
private readonly processManager;
|
|
13
|
+
readonly id = "cloudflare-tunnel";
|
|
14
|
+
readonly type = "cloudflare";
|
|
15
|
+
private endpoint;
|
|
16
|
+
private processId;
|
|
17
|
+
constructor(config: CloudflareTunnelConfig, logger: IScopedLogger, eventBus: IEventBus, processManager: IProcessManager);
|
|
18
|
+
start(): Promise<INetworkEndpoint>;
|
|
19
|
+
stop(): Promise<void>;
|
|
20
|
+
getEndpoint(): INetworkEndpoint | null;
|
|
21
|
+
getStatus(): NetworkAccessStatus;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare class CloudflareTunnelAddon implements ICamstackAddon, IConfigurable {
|
|
25
|
+
readonly manifest: AddonManifest;
|
|
26
|
+
private service;
|
|
27
|
+
private currentConfig;
|
|
28
|
+
initialize(context: AddonContext): Promise<void>;
|
|
29
|
+
shutdown(): Promise<void>;
|
|
30
|
+
/** Provide the ProcessManagerService to enable tunnel management */
|
|
31
|
+
setProcessManager(processManager: IProcessManager, config: CloudflareTunnelConfig, context: AddonContext): void;
|
|
32
|
+
getService(): CloudflareTunnelService;
|
|
33
|
+
getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
|
|
34
|
+
getConfigSchema(): ConfigUISchema;
|
|
35
|
+
getConfig(): Record<string, unknown>;
|
|
36
|
+
onConfigChange(config: Record<string, unknown>): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { type CloudflareTunnelConfig as C, CloudflareTunnelAddon, CloudflareTunnelService as a };
|
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-cloudflare-tunnel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Cloudflare Tunnel addon for CamStack",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
24
25
|
"import": "./dist/index.mjs",
|
|
25
|
-
"require": "./dist/index.js"
|
|
26
|
-
"types": "./dist/index.d.ts"
|
|
26
|
+
"require": "./dist/index.js"
|
|
27
27
|
},
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|