"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.__tsfTypeAliases = exports.DefaultDevConsoleController = exports.DevConsoleRuntime = exports.collectProperties = exports.DevConsoleSrpcServer = exports.isLocalhostIncomingMessage = exports.isLocalhostHttpRequest = exports.DevConsoleLocalhostMiddleware = exports.DevConsoleController = void 0;
exports.shouldEnableDevConsole = shouldEnableDevConsole;
const tslib_1 = require("tslib");
const _a = tslib_1.__importStar(require("@zyno-io/ts-server-foundation/type-metadata-runtime"));
const controller_1 = require("./controller");
var controller_2 = require("./controller");
Object.defineProperty(exports, "DevConsoleController", { enumerable: true, get: function () { return controller_2.DevConsoleController; } });
var security_1 = require("./security");
Object.defineProperty(exports, "DevConsoleLocalhostMiddleware", { enumerable: true, get: function () { return security_1.DevConsoleLocalhostMiddleware; } });
Object.defineProperty(exports, "isLocalhostHttpRequest", { enumerable: true, get: function () { return security_1.isLocalhostHttpRequest; } });
Object.defineProperty(exports, "isLocalhostIncomingMessage", { enumerable: true, get: function () { return security_1.isLocalhostIncomingMessage; } });
var server_1 = require("./server");
Object.defineProperty(exports, "DevConsoleSrpcServer", { enumerable: true, get: function () { return server_1.DevConsoleSrpcServer; } });
Object.defineProperty(exports, "collectProperties", { enumerable: true, get: function () { return server_1.collectProperties; } });
var runtime_1 = require("./runtime");
Object.defineProperty(exports, "DevConsoleRuntime", { enumerable: true, get: function () { return runtime_1.DevConsoleRuntime; } });
tslib_1.__exportStar(require("./store"), exports);
function shouldEnableDevConsole(config) {
    if (config.DEVCONSOLE_ENABLED !== undefined)
        return config.DEVCONSOLE_ENABLED === true;
    return config.APP_ENV === 'development';
}
exports.DefaultDevConsoleController = controller_1.DevConsoleController;
exports.__tsfTypeAliases = _a.decodeCompactMetadataV1("[1,{\"DevConsoleDatabaseQueryEntry\":{\"kind\":18,\"typeName\":\"DevConsoleDatabaseQueryEntry\",\"types\":[{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"timestamp\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"sql\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"params\",\"type\":{\"kind\":14,\"type\":{\"kind\":2}},\"optional\":false},{\"kind\":20,\"name\":\"status\",\"type\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"running\"},{\"kind\":10,\"literal\":\"ok\"},{\"kind\":10,\"literal\":\"error\"}]},\"optional\":false},{\"kind\":20,\"name\":\"durationMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"error\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true}]},\"DevConsoleErrorInfo\":{\"kind\":18,\"typeName\":\"DevConsoleErrorInfo\",\"types\":[{\"kind\":20,\"name\":\"name\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"message\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"stack\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"cause\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"DevConsoleErrorInfo\",\"types\":[{\"kind\":20,\"name\":\"name\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"message\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"stack\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"cause\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"DevConsoleErrorInfo\"},{\"kind\":4}]},\"optional\":true}],\"index\":{\"kind\":2}},{\"kind\":4}]},\"optional\":true}],\"index\":{\"kind\":2}},\"DevConsoleHttpEntry\":{\"kind\":18,\"typeName\":\"DevConsoleHttpEntry\",\"types\":[{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"timestamp\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"method\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"url\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"remoteAddress\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"requestHeaders\",\"type\":{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":14,\"type\":{\"kind\":6}},{\"kind\":4}]}],\"index\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":14,\"type\":{\"kind\":6}},{\"kind\":4}]},\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"requestBody\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":5}]},\"optional\":false},{\"kind\":20,\"name\":\"statusCode\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"responseHeaders\",\"type\":{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":7},{\"kind\":14,\"type\":{\"kind\":6}},{\"kind\":4}]}],\"index\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":7},{\"kind\":14,\"type\":{\"kind\":6}},{\"kind\":4}]},\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"responseBody\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":5}]},\"optional\":false},{\"kind\":20,\"name\":\"durationMs\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"error\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"DevConsoleErrorInfo\",\"types\":[{\"kind\":20,\"name\":\"name\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"message\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"stack\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"cause\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"DevConsoleErrorInfo\"},{\"kind\":4}]},\"optional\":true}],\"index\":{\"kind\":2}},{\"kind\":4}]},\"optional\":true}]},\"DevConsoleMutexEntry\":{\"kind\":18,\"typeName\":\"DevConsoleMutexEntry\",\"types\":[{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"key\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"status\",\"type\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"pending\"},{\"kind\":10,\"literal\":\"acquired\"},{\"kind\":10,\"literal\":\"released\"},{\"kind\":10,\"literal\":\"error\"},{\"kind\":10,\"literal\":\"failed\"}]},\"optional\":false},{\"kind\":20,\"name\":\"startedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"acquiredAt\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"releasedAt\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"durationMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"waitDurationMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"waited\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"error\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true}]},\"DevConsoleSrpcConnection\":{\"kind\":18,\"typeName\":\"DevConsoleSrpcConnection\",\"types\":[{\"kind\":20,\"name\":\"streamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"appVersion\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"lastPingAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"kind\":2}],\"index\":{\"kind\":2},\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"messageCount\",\"type\":{\"kind\":7},\"optional\":false}]},\"DevConsoleSrpcDisconnection\":{\"kind\":18,\"typeName\":\"DevConsoleSrpcDisconnection\",\"types\":[{\"kind\":20,\"name\":\"streamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"disconnectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"cause\",\"type\":{\"kind\":6},\"optional\":false}]},\"DevConsoleSrpcMessage\":{\"kind\":18,\"typeName\":\"DevConsoleSrpcMessage\",\"types\":[{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"timestamp\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"streamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"direction\",\"type\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"inbound\"},{\"kind\":10,\"literal\":\"outbound\"}]},\"optional\":false},{\"kind\":20,\"name\":\"messageType\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"isReply\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"data\",\"type\":{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"kind\":2}],\"index\":{\"kind\":2},\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"error\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"isUserError\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]}}]", []);
//# sourceMappingURL=index.js.map