"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.__tsfTypeAliases = exports.MeshLinkRuntime = exports.getMeshLinkProcessId = exports.acquireMeshLinkRuntime = exports.MeshLinkProtocolVersion = exports.encodeMeshLinkFrame = exports.decodeMeshLinkFrame = exports.MeshLinkPeer = exports.verifyMeshLinkEndpointProof = exports.signMeshLinkEndpointProof = exports.MeshLinkAuthenticator = exports.createMeshLinkEndpointKeyPair = exports.resolveMeshLinkAdvertiseUrl = exports.detectMeshIpAddress = void 0;
const tslib_1 = require("tslib");
const _a = tslib_1.__importStar(require("@zyno-io/ts-reflection/type-metadata-runtime"));
var address_1 = require("./address");
Object.defineProperty(exports, "detectMeshIpAddress", { enumerable: true, get: function () { return address_1.detectMeshIpAddress; } });
Object.defineProperty(exports, "resolveMeshLinkAdvertiseUrl", { enumerable: true, get: function () { return address_1.resolveMeshLinkAdvertiseUrl; } });
var auth_1 = require("./auth");
Object.defineProperty(exports, "createMeshLinkEndpointKeyPair", { enumerable: true, get: function () { return auth_1.createMeshLinkEndpointKeyPair; } });
Object.defineProperty(exports, "MeshLinkAuthenticator", { enumerable: true, get: function () { return auth_1.MeshLinkAuthenticator; } });
Object.defineProperty(exports, "signMeshLinkEndpointProof", { enumerable: true, get: function () { return auth_1.signMeshLinkEndpointProof; } });
Object.defineProperty(exports, "verifyMeshLinkEndpointProof", { enumerable: true, get: function () { return auth_1.verifyMeshLinkEndpointProof; } });
var peer_1 = require("./peer");
Object.defineProperty(exports, "MeshLinkPeer", { enumerable: true, get: function () { return peer_1.MeshLinkPeer; } });
var protocol_1 = require("./protocol");
Object.defineProperty(exports, "decodeMeshLinkFrame", { enumerable: true, get: function () { return protocol_1.decodeMeshLinkFrame; } });
Object.defineProperty(exports, "encodeMeshLinkFrame", { enumerable: true, get: function () { return protocol_1.encodeMeshLinkFrame; } });
Object.defineProperty(exports, "MeshLinkProtocolVersion", { enumerable: true, get: function () { return protocol_1.MeshLinkProtocolVersion; } });
var runtime_1 = require("./runtime");
Object.defineProperty(exports, "acquireMeshLinkRuntime", { enumerable: true, get: function () { return runtime_1.acquireMeshLinkRuntime; } });
Object.defineProperty(exports, "getMeshLinkProcessId", { enumerable: true, get: function () { return runtime_1.getMeshLinkProcessId; } });
Object.defineProperty(exports, "MeshLinkRuntime", { enumerable: true, get: function () { return runtime_1.MeshLinkRuntime; } });
exports.__tsfTypeAliases = _a.decodeCompactMetadataV1("[1,{\"MeshLinkAddressOptions\":{\"kind\":18,\"typeName\":\"MeshLinkAddressOptions\",\"types\":[{\"kind\":20,\"name\":\"advertiseUrl\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"path\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"httpServer\",\"type\":{\"kind\":12,\"types\":[{\"$tsfAlias\":[0,\"node:http\",\"Server\",\"Server\"]},{\"kind\":4}]},\"optional\":true}]},\"MeshLinkAuthIdentity\":{\"kind\":18,\"typeName\":\"MeshLinkAuthIdentity\",\"types\":[{\"kind\":20,\"name\":\"processId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"endpointId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"requesterEndpointId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"requestNonce\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"audienceEndpointId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"endpointPublicKey\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"endpointSignature\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"timestamp\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"nonce\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"signature\",\"type\":{\"kind\":6},\"optional\":false}]},\"MeshLinkAuthPurpose\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"request\"},{\"kind\":10,\"literal\":\"response\"}],\"typeName\":\"MeshLinkAuthPurpose\"},\"MeshLinkEndpointKeyPair\":{\"kind\":18,\"typeName\":\"MeshLinkEndpointKeyPair\",\"types\":[{\"kind\":20,\"name\":\"privateKey\",\"type\":{\"$tsfAlias\":[0,\"node:crypto\",\"KeyObject\",\"KeyObject\"]},\"optional\":false},{\"kind\":20,\"name\":\"publicKey\",\"type\":{\"kind\":6},\"optional\":false}]},\"MeshLinkEndpointPinResolver\":{\"kind\":2,\"typeName\":\"(processId: string, endpointId: string) =\\u003e Promise\\u003cstring | MeshLinkResolvedEndpointPin | undefined\\u003e\",\"typeName\":\"MeshLinkEndpointPinResolver\"},\"MeshLinkFrame\":{\"kind\":18,\"typeName\":\"MeshLinkFrame\",\"types\":[{\"kind\":20,\"name\":\"header\",\"type\":{\"kind\":18,\"typeName\":\"MeshLinkFrameHeader\",\"types\":[{\"kind\":20,\"name\":\"version\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"type\",\"type\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"invoke\"},{\"kind\":10,\"literal\":\"reserveStreamIds\"},{\"kind\":10,\"literal\":\"confirmStreamIds\"},{\"kind\":10,\"literal\":\"releaseStreamIds\"},{\"kind\":10,\"literal\":\"streamWrite\"},{\"kind\":10,\"literal\":\"streamFinish\"},{\"kind\":10,\"literal\":\"streamDestroy\"},{\"kind\":10,\"literal\":\"streamActivate\"},{\"kind\":10,\"literal\":\"streamAttach\"},{\"kind\":10,\"literal\":\"revokeCapability\"},{\"kind\":10,\"literal\":\"clientInvoke\"},{\"kind\":10,\"literal\":\"fenceClient\"},{\"kind\":10,\"literal\":\"clientUpdateMetadata\"},{\"kind\":10,\"literal\":\"disconnect\"},{\"kind\":10,\"literal\":\"updateMetadata\"},{\"kind\":10,\"literal\":\"accepted\"},{\"kind\":10,\"literal\":\"result\"},{\"kind\":10,\"literal\":\"ping\"},{\"kind\":10,\"literal\":\"pong\"},{\"kind\":10,\"literal\":\"goAway\"}],\"typeName\":\"MeshLinkFrameType\"},\"optional\":false},{\"kind\":20,\"name\":\"meshKey\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"replyTo\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"clientId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"connectionId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"prefix\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"timeoutMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"deadlineAt\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"streamId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"count\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"ids\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":7}},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"capability\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"reservationId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"ok\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"error\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"errorName\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"userError\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"reason\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"closeCapability\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]},\"optional\":false},{\"kind\":20,\"name\":\"body\",\"type\":{\"kind\":16,\"typeName\":\"Buffer\",\"classType\":{\"$tsf\":1}},\"optional\":false}]},\"MeshLinkFrameHeader\":{\"kind\":18,\"typeName\":\"MeshLinkFrameHeader\",\"types\":[{\"kind\":20,\"name\":\"version\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"type\",\"type\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"invoke\"},{\"kind\":10,\"literal\":\"reserveStreamIds\"},{\"kind\":10,\"literal\":\"confirmStreamIds\"},{\"kind\":10,\"literal\":\"releaseStreamIds\"},{\"kind\":10,\"literal\":\"streamWrite\"},{\"kind\":10,\"literal\":\"streamFinish\"},{\"kind\":10,\"literal\":\"streamDestroy\"},{\"kind\":10,\"literal\":\"streamActivate\"},{\"kind\":10,\"literal\":\"streamAttach\"},{\"kind\":10,\"literal\":\"revokeCapability\"},{\"kind\":10,\"literal\":\"clientInvoke\"},{\"kind\":10,\"literal\":\"fenceClient\"},{\"kind\":10,\"literal\":\"clientUpdateMetadata\"},{\"kind\":10,\"literal\":\"disconnect\"},{\"kind\":10,\"literal\":\"updateMetadata\"},{\"kind\":10,\"literal\":\"accepted\"},{\"kind\":10,\"literal\":\"result\"},{\"kind\":10,\"literal\":\"ping\"},{\"kind\":10,\"literal\":\"pong\"},{\"kind\":10,\"literal\":\"goAway\"}],\"typeName\":\"MeshLinkFrameType\"},\"optional\":false},{\"kind\":20,\"name\":\"meshKey\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"replyTo\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"clientId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"connectionId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"prefix\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"timeoutMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"deadlineAt\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"streamId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"count\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"ids\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":7}},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"capability\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"reservationId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"ok\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"error\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"errorName\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"userError\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"reason\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"closeCapability\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]},\"MeshLinkFrameType\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"invoke\"},{\"kind\":10,\"literal\":\"reserveStreamIds\"},{\"kind\":10,\"literal\":\"confirmStreamIds\"},{\"kind\":10,\"literal\":\"releaseStreamIds\"},{\"kind\":10,\"literal\":\"streamWrite\"},{\"kind\":10,\"literal\":\"streamFinish\"},{\"kind\":10,\"literal\":\"streamDestroy\"},{\"kind\":10,\"literal\":\"streamActivate\"},{\"kind\":10,\"literal\":\"streamAttach\"},{\"kind\":10,\"literal\":\"revokeCapability\"},{\"kind\":10,\"literal\":\"clientInvoke\"},{\"kind\":10,\"literal\":\"fenceClient\"},{\"kind\":10,\"literal\":\"clientUpdateMetadata\"},{\"kind\":10,\"literal\":\"disconnect\"},{\"kind\":10,\"literal\":\"updateMetadata\"},{\"kind\":10,\"literal\":\"accepted\"},{\"kind\":10,\"literal\":\"result\"},{\"kind\":10,\"literal\":\"ping\"},{\"kind\":10,\"literal\":\"pong\"},{\"kind\":10,\"literal\":\"goAway\"}],\"typeName\":\"MeshLinkFrameType\"},\"MeshLinkRequestHandler\":{\"kind\":2,\"typeName\":\"(peer: MeshLinkPeer, frame: MeshLinkFrame) =\\u003e Promise\\u003cMeshLinkFrame\\u003e\",\"typeName\":\"MeshLinkRequestHandler\"},\"MeshLinkResolvedEndpointPin\":{\"kind\":18,\"typeName\":\"MeshLinkResolvedEndpointPin\",\"types\":[{\"kind\":20,\"name\":\"publicKey\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"expiresAt\",\"type\":{\"kind\":7},\"optional\":false}]},\"MeshLinkRuntimeOptions\":{\"kind\":18,\"typeName\":\"MeshLinkRuntimeOptions\",\"types\":[{\"kind\":20,\"name\":\"path\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"secret\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"httpServer\",\"type\":{\"kind\":12,\"types\":[{\"$tsfAlias\":[0,\"node:http\",\"Server\",\"Server\"]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"connectTimeoutMs\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"idleTimeoutMs\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"maxFrameBytes\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"maxBufferedBytes\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"maxPeers\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInboundPeers\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxOutboundPeers\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxCachedUrls\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxEndpointPins\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"endpointPins\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"Readonly\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"kind\":6}],\"index\":{\"kind\":6},\"types\":[]}]},{\"kind\":4}]},\"optional\":true}]}}]", [require, () => (typeof Buffer !== "undefined" ? Buffer : (typeof exports !== "undefined" ? exports.Buffer : undefined)), () => (typeof Readonly !== "undefined" ? Readonly : (typeof exports !== "undefined" ? exports.Readonly : undefined))]);
//# sourceMappingURL=index.js.map