@silver886/mcp-proxy 0.2.0 → 0.2.2
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/README.md +0 -8
- package/node_modules/cloudflared/LICENSE +21 -0
- package/node_modules/cloudflared/README.md +156 -0
- package/node_modules/cloudflared/bin/cloudflared +0 -0
- package/node_modules/cloudflared/lib/cloudflared.js +10 -0
- package/node_modules/cloudflared/lib/constants.js +58 -0
- package/node_modules/cloudflared/lib/error.js +32 -0
- package/node_modules/cloudflared/lib/handler.js +117 -0
- package/node_modules/cloudflared/lib/index.js +126 -0
- package/node_modules/cloudflared/lib/install.js +155 -0
- package/node_modules/cloudflared/lib/lib.d.ts +236 -0
- package/node_modules/cloudflared/lib/lib.js +45 -0
- package/node_modules/cloudflared/lib/regex.js +52 -0
- package/node_modules/cloudflared/lib/service.js +229 -0
- package/node_modules/cloudflared/lib/tunnel.js +164 -0
- package/node_modules/cloudflared/lib/types.js +16 -0
- package/node_modules/cloudflared/package.json +59 -0
- package/node_modules/cloudflared/scripts/postinstall.mjs +10 -0
- package/node_modules/eventsource-parser/LICENSE +21 -0
- package/node_modules/eventsource-parser/README.md +126 -0
- package/node_modules/eventsource-parser/dist/index.cjs +166 -0
- package/node_modules/eventsource-parser/dist/index.cjs.map +1 -0
- package/node_modules/eventsource-parser/dist/index.d.cts +146 -0
- package/node_modules/eventsource-parser/dist/index.d.ts +146 -0
- package/node_modules/eventsource-parser/dist/index.js +166 -0
- package/node_modules/eventsource-parser/dist/index.js.map +1 -0
- package/node_modules/eventsource-parser/dist/stream.cjs +28 -0
- package/node_modules/eventsource-parser/dist/stream.cjs.map +1 -0
- package/node_modules/eventsource-parser/dist/stream.d.cts +121 -0
- package/node_modules/eventsource-parser/dist/stream.d.ts +121 -0
- package/node_modules/eventsource-parser/dist/stream.js +29 -0
- package/node_modules/eventsource-parser/dist/stream.js.map +1 -0
- package/node_modules/eventsource-parser/package.json +92 -0
- package/node_modules/eventsource-parser/src/errors.ts +44 -0
- package/node_modules/eventsource-parser/src/index.ts +3 -0
- package/node_modules/eventsource-parser/src/parse.ts +395 -0
- package/node_modules/eventsource-parser/src/stream.ts +88 -0
- package/node_modules/eventsource-parser/src/types.ts +97 -0
- package/node_modules/eventsource-parser/stream.js +2 -0
- package/package.json +2 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var install_exports = {};
|
|
30
|
+
__export(install_exports, {
|
|
31
|
+
install: () => install,
|
|
32
|
+
install_linux: () => install_linux,
|
|
33
|
+
install_macos: () => install_macos,
|
|
34
|
+
install_windows: () => install_windows
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(install_exports);
|
|
37
|
+
var import_node_fs = __toESM(require("node:fs"));
|
|
38
|
+
var import_node_path = __toESM(require("node:path"));
|
|
39
|
+
var import_node_https = __toESM(require("node:https"));
|
|
40
|
+
var import_node_child_process = require("node:child_process");
|
|
41
|
+
var import_constants = require("./constants");
|
|
42
|
+
var import_error = require("./error");
|
|
43
|
+
const LINUX_URL = {
|
|
44
|
+
arm64: "cloudflared-linux-arm64",
|
|
45
|
+
arm: "cloudflared-linux-arm",
|
|
46
|
+
x64: "cloudflared-linux-amd64",
|
|
47
|
+
ia32: "cloudflared-linux-386"
|
|
48
|
+
};
|
|
49
|
+
const MACOS_URL = {
|
|
50
|
+
arm64: "cloudflared-darwin-arm64.tgz",
|
|
51
|
+
x64: "cloudflared-darwin-amd64.tgz"
|
|
52
|
+
};
|
|
53
|
+
const WINDOWS_URL = {
|
|
54
|
+
x64: "cloudflared-windows-amd64.exe",
|
|
55
|
+
ia32: "cloudflared-windows-386.exe"
|
|
56
|
+
};
|
|
57
|
+
function resolve_base(version) {
|
|
58
|
+
if (version === "latest") {
|
|
59
|
+
return `${import_constants.RELEASE_BASE}latest/download/`;
|
|
60
|
+
}
|
|
61
|
+
return `${import_constants.RELEASE_BASE}download/${version}/`;
|
|
62
|
+
}
|
|
63
|
+
async function install(to, version = import_constants.CLOUDFLARED_VERSION) {
|
|
64
|
+
if (process.platform === "linux") {
|
|
65
|
+
return install_linux(to, version);
|
|
66
|
+
} else if (process.platform === "darwin") {
|
|
67
|
+
return install_macos(to, version);
|
|
68
|
+
} else if (process.platform === "win32") {
|
|
69
|
+
return install_windows(to, version);
|
|
70
|
+
} else {
|
|
71
|
+
throw new import_error.UnsupportedError("Unsupported platform: " + process.platform);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async function install_linux(to, version = import_constants.CLOUDFLARED_VERSION) {
|
|
75
|
+
const file = LINUX_URL[process.arch];
|
|
76
|
+
if (file === void 0) {
|
|
77
|
+
throw new import_error.UnsupportedError("Unsupported architecture: " + process.arch);
|
|
78
|
+
}
|
|
79
|
+
await download(resolve_base(version) + file, to);
|
|
80
|
+
import_node_fs.default.chmodSync(to, "755");
|
|
81
|
+
return to;
|
|
82
|
+
}
|
|
83
|
+
async function install_macos(to, version = import_constants.CLOUDFLARED_VERSION) {
|
|
84
|
+
let arch = process.arch;
|
|
85
|
+
if (version !== "latest" && version_number(version) < 20240802) {
|
|
86
|
+
arch = "x64";
|
|
87
|
+
}
|
|
88
|
+
const file = MACOS_URL[arch];
|
|
89
|
+
if (file === void 0) {
|
|
90
|
+
throw new import_error.UnsupportedError("Unsupported architecture: " + arch);
|
|
91
|
+
}
|
|
92
|
+
await download(resolve_base(version) + file, `${to}.tgz`);
|
|
93
|
+
process.env.VERBOSE && console.log(`Extracting to ${to}`);
|
|
94
|
+
(0, import_node_child_process.execSync)(`tar -xzf ${import_node_path.default.basename(`${to}.tgz`)}`, { cwd: import_node_path.default.dirname(to) });
|
|
95
|
+
import_node_fs.default.unlinkSync(`${to}.tgz`);
|
|
96
|
+
import_node_fs.default.renameSync(`${import_node_path.default.dirname(to)}/cloudflared`, to);
|
|
97
|
+
return to;
|
|
98
|
+
}
|
|
99
|
+
async function install_windows(to, version = import_constants.CLOUDFLARED_VERSION) {
|
|
100
|
+
const file = WINDOWS_URL[process.arch];
|
|
101
|
+
if (file === void 0) {
|
|
102
|
+
throw new import_error.UnsupportedError("Unsupported architecture: " + process.arch);
|
|
103
|
+
}
|
|
104
|
+
await download(resolve_base(version) + file, to);
|
|
105
|
+
return to;
|
|
106
|
+
}
|
|
107
|
+
function download(url, to, redirect = 0) {
|
|
108
|
+
if (redirect === 0) {
|
|
109
|
+
process.env.VERBOSE && console.log(`Downloading ${url} to ${to}`);
|
|
110
|
+
} else {
|
|
111
|
+
process.env.VERBOSE && console.log(`Redirecting to ${url}`);
|
|
112
|
+
}
|
|
113
|
+
if (!import_node_fs.default.existsSync(import_node_path.default.dirname(to))) {
|
|
114
|
+
import_node_fs.default.mkdirSync(import_node_path.default.dirname(to), { recursive: true });
|
|
115
|
+
}
|
|
116
|
+
return new Promise((resolve, reject) => {
|
|
117
|
+
const request = import_node_https.default.get(url, (res) => {
|
|
118
|
+
const redirect_code = [301, 302, 303, 307, 308];
|
|
119
|
+
if (redirect_code.includes(res.statusCode) && res.headers.location !== void 0) {
|
|
120
|
+
request.destroy();
|
|
121
|
+
const redirection = res.headers.location;
|
|
122
|
+
resolve(download(redirection, to, redirect + 1));
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) {
|
|
126
|
+
const file = import_node_fs.default.createWriteStream(to);
|
|
127
|
+
file.on("finish", () => {
|
|
128
|
+
file.close(() => resolve(to));
|
|
129
|
+
});
|
|
130
|
+
file.on("error", (err) => {
|
|
131
|
+
import_node_fs.default.unlink(to, () => reject(err));
|
|
132
|
+
});
|
|
133
|
+
res.pipe(file);
|
|
134
|
+
} else {
|
|
135
|
+
request.destroy();
|
|
136
|
+
reject(new Error(`HTTP response with status code: ${res.statusCode}`));
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
request.on("error", (err) => {
|
|
140
|
+
reject(err);
|
|
141
|
+
});
|
|
142
|
+
request.end();
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function version_number(semver) {
|
|
146
|
+
const [major, minor, patch] = semver.split(".").map(Number);
|
|
147
|
+
return major * 1e4 + minor * 100 + patch;
|
|
148
|
+
}
|
|
149
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
150
|
+
0 && (module.exports = {
|
|
151
|
+
install,
|
|
152
|
+
install_linux,
|
|
153
|
+
install_macos,
|
|
154
|
+
install_windows
|
|
155
|
+
});
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { ChildProcess } from 'node:child_process';
|
|
2
|
+
import { EventEmitter } from 'node:events';
|
|
3
|
+
import { EventEmitter as EventEmitter$1 } from 'node:stream';
|
|
4
|
+
|
|
5
|
+
declare const DEFAULT_CLOUDFLARED_BIN: string;
|
|
6
|
+
/**
|
|
7
|
+
* The path to the cloudflared binary.
|
|
8
|
+
* If the `CLOUDFLARED_BIN` environment variable is set, it will be used; otherwise, {@link DEFAULT_CLOUDFLARED_BIN} will be used.
|
|
9
|
+
* Can be overridden with {@link use}.
|
|
10
|
+
*/
|
|
11
|
+
declare let bin: string;
|
|
12
|
+
/**
|
|
13
|
+
* Override the path to the cloudflared binary.
|
|
14
|
+
* @param executable - The path to the cloudflared executable.
|
|
15
|
+
*/
|
|
16
|
+
declare function use(executable: string): void;
|
|
17
|
+
declare const CLOUDFLARED_VERSION: string;
|
|
18
|
+
declare const RELEASE_BASE = "https://github.com/cloudflare/cloudflared/releases/";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Install cloudflared to the given path.
|
|
22
|
+
* @param to The path to the binary to install.
|
|
23
|
+
* @param version The version of cloudflared to install.
|
|
24
|
+
* @returns The path to the binary that was installed.
|
|
25
|
+
*/
|
|
26
|
+
declare function install$1(to: string, version?: string): Promise<string>;
|
|
27
|
+
declare function install_linux(to: string, version?: string): Promise<string>;
|
|
28
|
+
declare function install_macos(to: string, version?: string): Promise<string>;
|
|
29
|
+
declare function install_windows(to: string, version?: string): Promise<string>;
|
|
30
|
+
|
|
31
|
+
interface Connection {
|
|
32
|
+
id: string;
|
|
33
|
+
ip: string;
|
|
34
|
+
location: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type TunnelOptions = Record<string, string | number | boolean>;
|
|
38
|
+
interface TunnelEvents {
|
|
39
|
+
url: (url: string) => void;
|
|
40
|
+
connected: (connection: Connection) => void;
|
|
41
|
+
disconnected: (connection: Connection) => void;
|
|
42
|
+
stdout: (data: string) => void;
|
|
43
|
+
stderr: (data: string) => void;
|
|
44
|
+
error: (error: Error) => void;
|
|
45
|
+
exit: (code: number | null, signal: NodeJS.Signals | null) => void;
|
|
46
|
+
}
|
|
47
|
+
type OutputHandler = (output: string, tunnel: Tunnel) => void;
|
|
48
|
+
declare class Tunnel extends EventEmitter {
|
|
49
|
+
private _process;
|
|
50
|
+
private outputHandlers;
|
|
51
|
+
constructor(options?: TunnelOptions | string[]);
|
|
52
|
+
get process(): ChildProcess;
|
|
53
|
+
private setupDefaultHandlers;
|
|
54
|
+
/**
|
|
55
|
+
* Add a custom output handler
|
|
56
|
+
* @param handler Function to handle cloudflared output
|
|
57
|
+
*/
|
|
58
|
+
addHandler(handler: OutputHandler): void;
|
|
59
|
+
/**
|
|
60
|
+
* Remove a previously added output handler
|
|
61
|
+
* @param handler The handler to remove
|
|
62
|
+
*/
|
|
63
|
+
removeHandler(handler: OutputHandler): void;
|
|
64
|
+
private processOutput;
|
|
65
|
+
private setupEventHandlers;
|
|
66
|
+
private createProcess;
|
|
67
|
+
stop: () => boolean;
|
|
68
|
+
private _stop;
|
|
69
|
+
on<E extends keyof TunnelEvents>(event: E, listener: TunnelEvents[E]): this;
|
|
70
|
+
once<E extends keyof TunnelEvents>(event: E, listener: TunnelEvents[E]): this;
|
|
71
|
+
off<E extends keyof TunnelEvents>(event: E, listener: TunnelEvents[E]): this;
|
|
72
|
+
emit<E extends keyof TunnelEvents>(event: E, ...args: Parameters<TunnelEvents[E]>): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Create a quick tunnel without a Cloudflare account.
|
|
75
|
+
* @param url The local service URL to connect to. If not provided, the hello world mode will be used.
|
|
76
|
+
* @param options The options to pass to cloudflared.
|
|
77
|
+
*/
|
|
78
|
+
static quick(url?: string, options?: TunnelOptions): Tunnel;
|
|
79
|
+
/**
|
|
80
|
+
* Create a tunnel with a Cloudflare account.
|
|
81
|
+
* @param token The Cloudflare Tunnel token.
|
|
82
|
+
* @param options The options to pass to cloudflared.
|
|
83
|
+
*/
|
|
84
|
+
static withToken(token: string, options?: TunnelOptions): Tunnel;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Create a tunnel.
|
|
88
|
+
* @param options The options to pass to cloudflared.
|
|
89
|
+
* @returns A Tunnel instance
|
|
90
|
+
*/
|
|
91
|
+
declare function tunnel(options?: TunnelOptions): Tunnel;
|
|
92
|
+
/**
|
|
93
|
+
* Build the arguments for the cloudflared command.
|
|
94
|
+
* @param options The options to pass to cloudflared.
|
|
95
|
+
* @returns The arguments for the cloudflared command.
|
|
96
|
+
*/
|
|
97
|
+
declare function build_args(options: TunnelOptions): string[];
|
|
98
|
+
declare function build_options(options: TunnelOptions): string[];
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Cloudflared launchd identifier.
|
|
102
|
+
* @platform macOS
|
|
103
|
+
*/
|
|
104
|
+
declare const identifier = "com.cloudflare.cloudflared";
|
|
105
|
+
/**
|
|
106
|
+
* Path of service related files.
|
|
107
|
+
* @platform macOS
|
|
108
|
+
*/
|
|
109
|
+
declare const MACOS_SERVICE_PATH: {
|
|
110
|
+
readonly PLIST: string;
|
|
111
|
+
readonly OUT: string;
|
|
112
|
+
readonly ERR: string;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Cloudflared Service API.
|
|
116
|
+
*/
|
|
117
|
+
declare const service: {
|
|
118
|
+
install: typeof install;
|
|
119
|
+
uninstall: typeof uninstall;
|
|
120
|
+
exists: typeof exists;
|
|
121
|
+
log: typeof log;
|
|
122
|
+
err: typeof err;
|
|
123
|
+
current: typeof current;
|
|
124
|
+
clean: typeof clean;
|
|
125
|
+
journal: typeof journal;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Throw when service is already installed.
|
|
129
|
+
*/
|
|
130
|
+
declare class AlreadyInstalledError extends Error {
|
|
131
|
+
constructor();
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Throw when service is not installed.
|
|
135
|
+
*/
|
|
136
|
+
declare class NotInstalledError extends Error {
|
|
137
|
+
constructor();
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Install Cloudflared service.
|
|
141
|
+
* @param token Tunnel service token.
|
|
142
|
+
* @platform macOS, linux
|
|
143
|
+
*/
|
|
144
|
+
declare function install(token?: string): void;
|
|
145
|
+
/**
|
|
146
|
+
* Uninstall Cloudflared service.
|
|
147
|
+
* @platform macOS, linux
|
|
148
|
+
*/
|
|
149
|
+
declare function uninstall(): void;
|
|
150
|
+
/**
|
|
151
|
+
* Get stdout log of cloudflared service. (Usually empty)
|
|
152
|
+
* @returns stdout log of cloudflared service.
|
|
153
|
+
* @platform macOS, linux (sysv)
|
|
154
|
+
*/
|
|
155
|
+
declare function log(): string;
|
|
156
|
+
/**
|
|
157
|
+
* Get stderr log of cloudflared service. (cloudflared print all things here)
|
|
158
|
+
* @returns stderr log of cloudflared service.
|
|
159
|
+
* @platform macOS, linux (sysv)
|
|
160
|
+
*/
|
|
161
|
+
declare function err(): string;
|
|
162
|
+
/**
|
|
163
|
+
* Get cloudflared service journal from journalctl.
|
|
164
|
+
* @param n The number of entries to return.
|
|
165
|
+
* @returns cloudflared service journal.
|
|
166
|
+
* @platform linux (systemd)
|
|
167
|
+
*/
|
|
168
|
+
declare function journal(n?: number): string;
|
|
169
|
+
/**
|
|
170
|
+
* Get informations of current running cloudflared service.
|
|
171
|
+
* @returns informations of current running cloudflared service.
|
|
172
|
+
* @platform macOS, linux
|
|
173
|
+
*/
|
|
174
|
+
declare function current(): {
|
|
175
|
+
/** Tunnel ID */
|
|
176
|
+
tunnelID: string;
|
|
177
|
+
/** Connector ID */
|
|
178
|
+
connectorID: string;
|
|
179
|
+
/** The connections of the tunnel */
|
|
180
|
+
connections: Connection[];
|
|
181
|
+
/** Metrics Server Location */
|
|
182
|
+
metrics: string;
|
|
183
|
+
/** Tunnel Configuration */
|
|
184
|
+
config: {
|
|
185
|
+
ingress?: {
|
|
186
|
+
service: string;
|
|
187
|
+
hostname?: string;
|
|
188
|
+
}[];
|
|
189
|
+
[key: string]: unknown;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Clean up service log files.
|
|
194
|
+
* @platform macOS
|
|
195
|
+
*/
|
|
196
|
+
declare function clean(): void;
|
|
197
|
+
/**
|
|
198
|
+
* Check if cloudflared service is installed.
|
|
199
|
+
* @returns true if service is installed, false otherwise.
|
|
200
|
+
* @platform macOS, linux
|
|
201
|
+
*/
|
|
202
|
+
declare function exists(): boolean;
|
|
203
|
+
|
|
204
|
+
declare class ConnectionHandler {
|
|
205
|
+
private connections;
|
|
206
|
+
constructor(tunnel: Tunnel);
|
|
207
|
+
private connected_handler;
|
|
208
|
+
private disconnected_handler;
|
|
209
|
+
}
|
|
210
|
+
declare class TryCloudflareHandler {
|
|
211
|
+
constructor(tunnel: Tunnel);
|
|
212
|
+
private url_handler;
|
|
213
|
+
}
|
|
214
|
+
interface ConfigHandlerEvents<T> {
|
|
215
|
+
config: (config: {
|
|
216
|
+
config: T;
|
|
217
|
+
version: number;
|
|
218
|
+
}) => void;
|
|
219
|
+
error: (error: Error) => void;
|
|
220
|
+
}
|
|
221
|
+
interface TunnelConfig {
|
|
222
|
+
ingress: Record<string, string>[];
|
|
223
|
+
warp_routing: {
|
|
224
|
+
enabled: boolean;
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
declare class ConfigHandler<T = TunnelConfig> extends EventEmitter$1 {
|
|
228
|
+
constructor(tunnel: Tunnel);
|
|
229
|
+
private config_handler;
|
|
230
|
+
on<E extends keyof ConfigHandlerEvents<T>>(event: E, listener: ConfigHandlerEvents<T>[E]): this;
|
|
231
|
+
once<E extends keyof ConfigHandlerEvents<T>>(event: E, listener: ConfigHandlerEvents<T>[E]): this;
|
|
232
|
+
off<E extends keyof ConfigHandlerEvents<T>>(event: E, listener: ConfigHandlerEvents<T>[E]): this;
|
|
233
|
+
emit<E extends keyof ConfigHandlerEvents<T>>(event: E, ...args: Parameters<ConfigHandlerEvents<T>[E]>): boolean;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export { AlreadyInstalledError, CLOUDFLARED_VERSION, ConfigHandler, type ConfigHandlerEvents, type Connection, ConnectionHandler, DEFAULT_CLOUDFLARED_BIN, MACOS_SERVICE_PATH, NotInstalledError, type OutputHandler, RELEASE_BASE, TryCloudflareHandler, Tunnel, type TunnelConfig, type TunnelEvents, type TunnelOptions, bin, build_args, build_options, identifier, install$1 as install, install_linux, install_macos, install_windows, service, tunnel, use };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var lib_exports = {};
|
|
21
|
+
__export(lib_exports, {
|
|
22
|
+
AlreadyInstalledError: () => import_service.AlreadyInstalledError,
|
|
23
|
+
MACOS_SERVICE_PATH: () => import_service.MACOS_SERVICE_PATH,
|
|
24
|
+
NotInstalledError: () => import_service.NotInstalledError,
|
|
25
|
+
identifier: () => import_service.identifier,
|
|
26
|
+
service: () => import_service.service
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(lib_exports);
|
|
29
|
+
__reExport(lib_exports, require("./constants.js"), module.exports);
|
|
30
|
+
__reExport(lib_exports, require("./install.js"), module.exports);
|
|
31
|
+
__reExport(lib_exports, require("./tunnel.js"), module.exports);
|
|
32
|
+
var import_service = require("./service.js");
|
|
33
|
+
__reExport(lib_exports, require("./handler.js"), module.exports);
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
AlreadyInstalledError,
|
|
37
|
+
MACOS_SERVICE_PATH,
|
|
38
|
+
NotInstalledError,
|
|
39
|
+
identifier,
|
|
40
|
+
service,
|
|
41
|
+
...require("./constants.js"),
|
|
42
|
+
...require("./install.js"),
|
|
43
|
+
...require("./tunnel.js"),
|
|
44
|
+
...require("./handler.js")
|
|
45
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var regex_exports = {};
|
|
20
|
+
__export(regex_exports, {
|
|
21
|
+
config_regex: () => config_regex,
|
|
22
|
+
conn_regex: () => conn_regex,
|
|
23
|
+
connectorID_regex: () => connectorID_regex,
|
|
24
|
+
disconnect_regex: () => disconnect_regex,
|
|
25
|
+
index_regex: () => index_regex,
|
|
26
|
+
ip_regex: () => ip_regex,
|
|
27
|
+
location_regex: () => location_regex,
|
|
28
|
+
metrics_regex: () => metrics_regex,
|
|
29
|
+
tunnelID_regex: () => tunnelID_regex
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(regex_exports);
|
|
32
|
+
const conn_regex = /connection[= ]([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i;
|
|
33
|
+
const ip_regex = /ip=([0-9.]+)/;
|
|
34
|
+
const location_regex = /location=([A-Za-z0-9]+)/;
|
|
35
|
+
const index_regex = /connIndex=(\d)/;
|
|
36
|
+
const disconnect_regex = /Unregistered tunnel connection connIndex=(\d)/i;
|
|
37
|
+
const tunnelID_regex = /tunnelID=([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i;
|
|
38
|
+
const connectorID_regex = /Connector ID: ([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i;
|
|
39
|
+
const metrics_regex = /metrics server on ([0-9.:]+\/metrics)/;
|
|
40
|
+
const config_regex = /config="(.+[^\\])"/;
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
config_regex,
|
|
44
|
+
conn_regex,
|
|
45
|
+
connectorID_regex,
|
|
46
|
+
disconnect_regex,
|
|
47
|
+
index_regex,
|
|
48
|
+
ip_regex,
|
|
49
|
+
location_regex,
|
|
50
|
+
metrics_regex,
|
|
51
|
+
tunnelID_regex
|
|
52
|
+
});
|