#include "yql_functions_servlet.h" #include #include #include #include namespace { void OutputKnownFunctions(TStringStream& out) { using namespace NYql; out << "window.yql = {};\n" "window.yql.builtinFunctions = ["; const auto& builtinFuncs = GetBuiltinFunctions(); for (const auto& func: builtinFuncs) { out << '"' << func << "\","; } out << "];\n"; out << "window.yql.supportedFunctions = ["; const THashSet* functionsSet[] = { &YtDataSourceFunctions(), &YtDataSinkFunctions(), &ResultProviderFunctions(), &ConfigProviderFunctions() }; for (const auto& funcs: functionsSet) { for (const auto& func: *funcs) { out << '"' << func << "\","; } } out << "];"; } } // namspace namespace NYql { namespace NHttp { void TYqlFunctoinsServlet::DoGet(const TRequest& req, TResponse& resp) const { Y_UNUSED(req); TStringStream out; OutputKnownFunctions(out); resp.Body = TBlob::FromString(out.Str()); resp.Headers.AddHeader(THttpInputHeader("Content-Type: text/javascript")); } } // namspace NNttp } // namspace NYql