@lovrabet/dataset-mcp-server 1.3.1-beta.2 → 1.3.2-beta.0

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.
@@ -1 +1 @@
1
- function a10_0x8020(){const _0x3e67a3=['2nAUXVx','This\x20SQL\x20requires\x20parameters:\x20','entries','SQL\x20code\x20\x22','\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27','This\x20SQL\x20does\x20not\x20require\x20any\x20parameters','4956xkNXea','sqlCode\x20is\x20required','replace','\x22\x20exists\x20and\x20is\x20valid.','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a','name','limit','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20exception\x20-\x20use\x20try-catch','sqlCode','Failed\x20to\x20verify\x20SQL\x20code:\x20','sql','online','message','reduce','55SpzEyz','size','data','from','env','join','2024-01-01','tableData','//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27','toLowerCase','keyword','9079DhCpuA','3981027SYjoha','204895wlKKXQ','SQL-','LOVRABET_APP_CODE','search','stringify','value','\x27,\x0a\x20\x20env:\x20\x27','date','1940609XwBXBD','sqlId','Check\x20the\x20sqlCode\x20from\x20list_sql_queries\x20result\x20and\x20use\x20the\x20exact\x20value.','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','length','count','23368hhUGrl','trim',');\x0a\x0a//\x20IMPORTANT:\x20Check\x20execution\x20status\x20before\x20using\x20results\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(`SQL\x20execution\x20failed:\x20${data.execError\x20||\x20\x27Unknown\x20error\x27}`);\x0a}\x0a\x0a//\x20Process\x20the\x20results\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0aconsole.log(`Retrieved\x20${results.length}\x20rows`);\x0a\x0a//\x20Use\x20the\x20data\x0aresults.forEach((row:\x20any)\x20=>\x20{\x0a\x20\x20console.log(row);\x0a});','page','sqlName','example','Always\x20check\x20execSuccess\x20before\x20using\x20execResult','455764RxHQCZ','23729484LbbswU','LOVRABET_ENV','time','\x22\x20not\x20found\x20in\x20the\x20application.','getCustomSqlList','Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.','includes','20uxWrrR','1746cQuorX'];a10_0x8020=function(){return _0x3e67a3;};return a10_0x8020();}(function(_0x108583,_0x24e1a2){const _0x3fb829=a10_0xe193,_0x1806db=_0x108583();while(!![]){try{const _0x27883c=parseInt(_0x3fb829(0x166))/0x1+-parseInt(_0x3fb829(0x185))/0x2*(parseInt(_0x3fb829(0x165))/0x3)+parseInt(_0x3fb829(0x17b))/0x4*(-parseInt(_0x3fb829(0x199))/0x5)+parseInt(_0x3fb829(0x18b))/0x6*(parseInt(_0x3fb829(0x164))/0x7)+parseInt(_0x3fb829(0x174))/0x8*(parseInt(_0x3fb829(0x184))/0x9)+-parseInt(_0x3fb829(0x183))/0xa*(parseInt(_0x3fb829(0x16e))/0xb)+parseInt(_0x3fb829(0x17c))/0xc;if(_0x27883c===_0x24e1a2)break;else _0x1806db['push'](_0x1806db['shift']());}catch(_0x3c6d06){_0x1806db['push'](_0x1806db['shift']());}}}(a10_0x8020,0xd896e));import{DevApiClient}from'../api/dev-api-client.js';export async function generateSqlCode(_0x597519){const _0x24cb80=a10_0xe193,{appCode:appCode=process[_0x24cb80(0x19d)][_0x24cb80(0x168)],cookie:_0x3050de,env:env=process[_0x24cb80(0x19d)][_0x24cb80(0x17d)]||_0x24cb80(0x196),sqlCode:_0x9c87f,params:_0x1a6796,includeImports:includeImports=!![]}=_0x597519;if(!appCode)throw new Error(_0x24cb80(0x171));if(!_0x9c87f||_0x9c87f['trim']()==='')return{'success':![],'sqlCode':'','sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[]},'error':_0x24cb80(0x18c)};const _0xff0c4a=_0x9c87f[_0x24cb80(0x175)](),_0x35639d=new DevApiClient({'appCode':appCode,'cookie':_0x3050de,'env':env});try{const _0x11d2ee=await _0x35639d[_0x24cb80(0x180)]({'pageSize':0x3e7,'currentPage':0x1,'sqlCode':_0xff0c4a}),_0x7b8023=_0x11d2ee[_0x24cb80(0x19b)]?.[_0x24cb80(0x160)]||[],_0x5c83fc=_0x7b8023['find'](_0x683c4c=>_0x683c4c['sqlCode']===_0xff0c4a||_0x683c4c[_0x24cb80(0x193)]?.['includes'](_0xff0c4a)||_0xff0c4a['includes'](_0x683c4c[_0x24cb80(0x193)]));if(!_0x5c83fc)return{'success':![],'sqlCode':_0xff0c4a,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x24cb80(0x188)+_0xff0c4a+_0x24cb80(0x17f),_0x24cb80(0x181),_0x24cb80(0x170)]},'error':'SQL\x20code\x20\x22'+_0xff0c4a+'\x22\x20does\x20not\x20exist.\x20Use\x20list_sql_queries\x20to\x20find\x20valid\x20SQL\x20codes.'};const _0x25a0c3=_0x5c83fc['sqlCode'],_0x4f2af7=_0x5c83fc[_0x24cb80(0x178)]||_0x5c83fc[_0x24cb80(0x190)]||_0x24cb80(0x167)+(_0x5c83fc[_0x24cb80(0x16f)]||_0x5c83fc['id']),_0x356ae4=_0x5c83fc['sqlContent']||_0x5c83fc[_0x24cb80(0x195)]||'',_0x30775b=_0x356ae4['match'](/[:$]\{?(\w+)\}?/g);let _0x3a6034,_0x5cfc26;if(_0x30775b){const _0x1805ad=Array[_0x24cb80(0x19c)](new Set(_0x30775b['map'](_0x252f60=>_0x252f60[_0x24cb80(0x18d)](/[:${}]/g,''))));_0x3a6034=_0x1805ad['map'](_0xe45d8f=>{const _0x51b61c=_0x1a6796?.[_0xe45d8f]??getDefaultExample(_0xe45d8f);return{'name':_0xe45d8f,'example':_0x51b61c};}),_0x5cfc26=_0x3a6034[_0x24cb80(0x198)]((_0x1424da,_0x566191)=>({..._0x1424da,[_0x566191[_0x24cb80(0x190)]]:_0x566191[_0x24cb80(0x179)]}),{});}else _0x1a6796&&(_0x3a6034=Object[_0x24cb80(0x187)](_0x1a6796)['map'](([_0x11e6f3,_0x315e72])=>({'name':_0x11e6f3,'example':_0x315e72})),_0x5cfc26=_0x1a6796);const _0x546383=_0x3a6034&&_0x3a6034[_0x24cb80(0x172)]>0x0,_0x130f4f=_0x546383?JSON[_0x24cb80(0x16a)](_0x5cfc26,null,0x2):'',_0x33100c=(includeImports?_0x24cb80(0x18f):'')+_0x24cb80(0x161)+appCode+_0x24cb80(0x16c)+env+'\x27,\x0a});\x0a\x0a//\x20Execute\x20SQL:\x20'+_0x4f2af7+_0x24cb80(0x189)+_0x25a0c3+'\x27'+(_0x546383?',\x20'+_0x130f4f:'')+_0x24cb80(0x176);return{'success':!![],'sqlCode':_0x25a0c3,'sqlName':_0x4f2af7,'sqlExists':!![],'code':_0x33100c,'parameters':_0x3a6034,'usage':{'description':'Generated\x20code\x20for\x20executing\x20custom\x20SQL:\x20'+_0x4f2af7,'important':[_0x24cb80(0x188)+_0x25a0c3+_0x24cb80(0x18e),'SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[],\x20execError?:\x20string\x20}',_0x24cb80(0x17a),_0x546383?_0x24cb80(0x186)+_0x3a6034['map'](_0x469be2=>_0x469be2[_0x24cb80(0x190)])[_0x24cb80(0x15e)](',\x20'):_0x24cb80(0x18a),_0x24cb80(0x192)]}};}catch(_0x4fcf82){return{'success':![],'sqlCode':_0xff0c4a,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x24cb80(0x194)+_0x4fcf82['message'],_0x24cb80(0x181)]},'error':_0x24cb80(0x194)+_0x4fcf82[_0x24cb80(0x197)]};}}function a10_0xe193(_0x1158fc,_0x3c054c){_0x1158fc=_0x1158fc-0x15e;const _0x8020f=a10_0x8020();let _0xe193f2=_0x8020f[_0x1158fc];return _0xe193f2;}function getDefaultExample(_0x3e8c66){const _0x1767d9=a10_0xe193,_0x3b1766=_0x3e8c66[_0x1767d9(0x162)]();if(_0x3b1766[_0x1767d9(0x182)](_0x1767d9(0x16d))||_0x3b1766['includes'](_0x1767d9(0x17e)))return _0x1767d9(0x15f);if(_0x3b1766[_0x1767d9(0x182)]('id'))return 0x7b;if(_0x3b1766[_0x1767d9(0x182)](_0x1767d9(0x191))||_0x3b1766['includes'](_0x1767d9(0x173))||_0x3b1766[_0x1767d9(0x182)](_0x1767d9(0x19a)))return 0xa;if(_0x3b1766[_0x1767d9(0x182)](_0x1767d9(0x177)))return 0x1;if(_0x3b1766[_0x1767d9(0x182)](_0x1767d9(0x163))||_0x3b1766[_0x1767d9(0x182)](_0x1767d9(0x169))||_0x3b1766[_0x1767d9(0x182)](_0x1767d9(0x190)))return _0x1767d9(0x179);if(_0x3b1766['includes']('status'))return 0x1;return _0x1767d9(0x16b);}
1
+ (function(_0x40fb3d,_0x511250){const _0x170c61=a10_0x2cec,_0x29d328=_0x40fb3d();while(!![]){try{const _0x499681=-parseInt(_0x170c61(0x140))/0x1*(parseInt(_0x170c61(0x146))/0x2)+-parseInt(_0x170c61(0x15d))/0x3+parseInt(_0x170c61(0x141))/0x4+-parseInt(_0x170c61(0x147))/0x5+-parseInt(_0x170c61(0x155))/0x6+parseInt(_0x170c61(0x15b))/0x7*(parseInt(_0x170c61(0x134))/0x8)+-parseInt(_0x170c61(0x148))/0x9*(-parseInt(_0x170c61(0x136))/0xa);if(_0x499681===_0x511250)break;else _0x29d328['push'](_0x29d328['shift']());}catch(_0x4816a9){_0x29d328['push'](_0x29d328['shift']());}}}(a10_0x5c82,0xe3c1c));function a10_0x5c82(){const _0x444700=['5629596PJkLNK','sqlCode\x20is\x20required','SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[],\x20execError?:\x20string\x20}','sqlContent','\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27','LOVRABET_APP_CODE','56grzEGC','This\x20SQL\x20does\x20not\x20require\x20any\x20parameters','5415186vyeXTb','2024-01-01','Generated\x20code\x20for\x20executing\x20custom\x20SQL:\x20','map','search','toLowerCase','time','trim',');\x0a\x0a//\x20IMPORTANT:\x20Check\x20execution\x20status\x20before\x20using\x20results\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(`SQL\x20execution\x20failed:\x20${data.execError\x20||\x20\x27Unknown\x20error\x27}`);\x0a}\x0a\x0a//\x20Process\x20the\x20results\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0aconsole.log(`Retrieved\x20${results.length}\x20rows`);\x0a\x0a//\x20Use\x20the\x20data\x0aresults.forEach((row:\x20any)\x20=>\x20{\x0a\x20\x20console.log(row);\x0a});','includes','\x22\x20not\x20found\x20in\x20the\x20application.','join','replace','stringify','name','\x27,\x0a});\x0a\x0a//\x20Execute\x20SQL:\x20','tableData','value','1672592KyCHjB','Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.','40kKpxsB','reduce','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a','\x27,\x0a\x20\x20env:\x20\x27','keyword','Always\x20check\x20execSuccess\x20before\x20using\x20execResult','\x22\x20exists\x20and\x20is\x20valid.','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20exception\x20-\x20use\x20try-catch','//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27','sqlCode','44LKmbOT','3350412PkwQDB','SQL\x20code\x20\x22','status','online','size','64812yrBMXk','7441715eTYQIB','9180522umEYto','find','length','sqlName','env','entries','Check\x20the\x20sqlCode\x20from\x20list_sql_queries\x20result\x20and\x20use\x20the\x20exact\x20value.','message','page','getCustomSqlList','example','match','date'];a10_0x5c82=function(){return _0x444700;};return a10_0x5c82();}import{DevApiClient}from'../api/dev-api-client.js';export async function generateSqlCode(_0x514603){const _0x1736bb=a10_0x2cec,{appCode:appCode=process[_0x1736bb(0x14c)][_0x1736bb(0x15a)],cookie:_0x17ec2c,env:env=process['env']['LOVRABET_ENV']||_0x1736bb(0x144),sqlCode:_0x3c1675,params:_0xbd4691,includeImports:includeImports=!![]}=_0x514603;if(!appCode)throw new Error('appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.');if(!_0x3c1675||_0x3c1675[_0x1736bb(0x164)]()==='')return{'success':![],'sqlCode':'','sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[]},'error':_0x1736bb(0x156)};const _0x9be0bf=_0x3c1675[_0x1736bb(0x164)](),_0x439c82=new DevApiClient({'appCode':appCode,'cookie':_0x17ec2c,'env':env});try{const _0x5c1299=await _0x439c82[_0x1736bb(0x151)]({'pageSize':0x3e7,'currentPage':0x1,'sqlCode':_0x9be0bf}),_0x5cd51c=_0x5c1299['data']?.[_0x1736bb(0x132)]||[],_0x214c88=_0x5cd51c[_0x1736bb(0x149)](_0x2a3ade=>_0x2a3ade['sqlCode']===_0x9be0bf||_0x2a3ade[_0x1736bb(0x13f)]?.[_0x1736bb(0x166)](_0x9be0bf)||_0x9be0bf[_0x1736bb(0x166)](_0x2a3ade['sqlCode']));if(!_0x214c88)return{'success':![],'sqlCode':_0x9be0bf,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':['SQL\x20code\x20\x22'+_0x9be0bf+_0x1736bb(0x12c),_0x1736bb(0x135),_0x1736bb(0x14e)]},'error':_0x1736bb(0x142)+_0x9be0bf+'\x22\x20does\x20not\x20exist.\x20Use\x20list_sql_queries\x20to\x20find\x20valid\x20SQL\x20codes.'};const _0x59f46e=_0x214c88[_0x1736bb(0x13f)],_0x1698f1=_0x214c88[_0x1736bb(0x14b)]||_0x214c88[_0x1736bb(0x130)]||'SQL-'+(_0x214c88['sqlId']||_0x214c88['id']),_0x251e97=_0x214c88[_0x1736bb(0x158)]||_0x214c88['sql']||'',_0x1336cd=_0x251e97[_0x1736bb(0x153)](/[:$]\{?(\w+)\}?/g);let _0x229e85,_0x356e27;if(_0x1336cd){const _0x2f3a58=Array['from'](new Set(_0x1336cd[_0x1736bb(0x160)](_0x575264=>_0x575264[_0x1736bb(0x12e)](/[:${}]/g,''))));_0x229e85=_0x2f3a58[_0x1736bb(0x160)](_0x5f1784=>{const _0x62f19f=_0xbd4691?.[_0x5f1784]??getDefaultExample(_0x5f1784);return{'name':_0x5f1784,'example':_0x62f19f};}),_0x356e27=_0x229e85[_0x1736bb(0x137)]((_0x4f6189,_0x2e0491)=>({..._0x4f6189,[_0x2e0491['name']]:_0x2e0491['example']}),{});}else _0xbd4691&&(_0x229e85=Object[_0x1736bb(0x14d)](_0xbd4691)[_0x1736bb(0x160)](([_0x39dc38,_0x553b1e])=>({'name':_0x39dc38,'example':_0x553b1e})),_0x356e27=_0xbd4691);const _0x47dd9a=_0x229e85&&_0x229e85[_0x1736bb(0x14a)]>0x0,_0x21bc34=_0x47dd9a?JSON[_0x1736bb(0x12f)](_0x356e27,null,0x2):'',_0x1ef9da=(includeImports?_0x1736bb(0x138):'')+_0x1736bb(0x13e)+appCode+_0x1736bb(0x139)+env+_0x1736bb(0x131)+_0x1698f1+_0x1736bb(0x159)+_0x59f46e+'\x27'+(_0x47dd9a?',\x20'+_0x21bc34:'')+_0x1736bb(0x165);return{'success':!![],'sqlCode':_0x59f46e,'sqlName':_0x1698f1,'sqlExists':!![],'code':_0x1ef9da,'parameters':_0x229e85,'usage':{'description':_0x1736bb(0x15f)+_0x1698f1,'important':[_0x1736bb(0x142)+_0x59f46e+_0x1736bb(0x13c),_0x1736bb(0x157),_0x1736bb(0x13b),_0x47dd9a?'This\x20SQL\x20requires\x20parameters:\x20'+_0x229e85['map'](_0x4a8ef5=>_0x4a8ef5[_0x1736bb(0x130)])[_0x1736bb(0x12d)](',\x20'):_0x1736bb(0x15c),_0x1736bb(0x13d)]}};}catch(_0x5b0110){return{'success':![],'sqlCode':_0x9be0bf,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':['Failed\x20to\x20verify\x20SQL\x20code:\x20'+_0x5b0110['message'],_0x1736bb(0x135)]},'error':'Failed\x20to\x20verify\x20SQL\x20code:\x20'+_0x5b0110[_0x1736bb(0x14f)]};}}function a10_0x2cec(_0xe4c781,_0x3b8612){_0xe4c781=_0xe4c781-0x12c;const _0x5c826b=a10_0x5c82();let _0x2cece0=_0x5c826b[_0xe4c781];return _0x2cece0;}function getDefaultExample(_0x2b6426){const _0x13a0c6=a10_0x2cec,_0x37cae3=_0x2b6426[_0x13a0c6(0x162)]();if(_0x37cae3[_0x13a0c6(0x166)](_0x13a0c6(0x154))||_0x37cae3[_0x13a0c6(0x166)](_0x13a0c6(0x163)))return _0x13a0c6(0x15e);if(_0x37cae3[_0x13a0c6(0x166)]('id'))return 0x7b;if(_0x37cae3['includes']('limit')||_0x37cae3[_0x13a0c6(0x166)]('count')||_0x37cae3['includes'](_0x13a0c6(0x145)))return 0xa;if(_0x37cae3[_0x13a0c6(0x166)](_0x13a0c6(0x150)))return 0x1;if(_0x37cae3[_0x13a0c6(0x166)](_0x13a0c6(0x13a))||_0x37cae3[_0x13a0c6(0x166)](_0x13a0c6(0x161))||_0x37cae3[_0x13a0c6(0x166)](_0x13a0c6(0x130)))return _0x13a0c6(0x152);if(_0x37cae3['includes'](_0x13a0c6(0x143)))return 0x1;return _0x13a0c6(0x133);}
@@ -1 +1 @@
1
- (function(_0x5c6324,_0x636e2d){const _0x1c45c9=a11_0x289f,_0x3c5223=_0x5c6324();while(!![]){try{const _0x2cdef5=parseInt(_0x1c45c9(0x17e))/0x1+-parseInt(_0x1c45c9(0x174))/0x2+-parseInt(_0x1c45c9(0x17a))/0x3+-parseInt(_0x1c45c9(0x169))/0x4+-parseInt(_0x1c45c9(0x15d))/0x5+-parseInt(_0x1c45c9(0x15e))/0x6*(parseInt(_0x1c45c9(0x157))/0x7)+parseInt(_0x1c45c9(0x165))/0x8;if(_0x2cdef5===_0x636e2d)break;else _0x3c5223['push'](_0x3c5223['shift']());}catch(_0x170448){_0x3c5223['push'](_0x3c5223['shift']());}}}(a11_0x2015,0x30753));function a11_0x289f(_0x3cc375,_0xbd9b0f){_0x3cc375=_0x3cc375-0x154;const _0x20153b=a11_0x2015();let _0x289fda=_0x20153b[_0x3cc375];return _0x289fda;}import{DevApiClient}from'../api/dev-api-client.js';function a11_0x2015(){const _0x3ca66e=['Generate\x20SDK\x20code\x20for\x20querying\x20this\x20dataset','find','LOVRABET_ENV','471079eVVACZ','getDatasetList','primaryKey','replace','includes','Validate\x20and\x20prepare\x20custom\x20SQL\x20for\x20this\x20dataset','164600SdQsGM','6uXHYno','some','deleted','type','operationCount','enabledOperationCount','visible','8628800pImXKb','medium','code','basic','1054868pBBeri','category','dbId','now','env','list_datasets','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','push','getDatasetDetail','fieldCount','toLowerCase','466620Woxfpk','database','fields','data','filter','name','1040343hbBjDv','tableData','endsWith','Get\x20ready-to-use\x20TypeScript\x20code\x20for\x20querying\x20this\x20dataset','63908EGhoRX','test','_id','active','status','tableName','Browse\x20related\x20datasets','operations','supportsCRUD','level','generate_sdk_code','archived','priority','Find\x20other\x20datasets\x20that\x20might\x20be\x20related\x20for\x20JOIN\x20operations','validate_sql_content','high','map','required','enumValues','state'];a11_0x2015=function(){return _0x3ca66e;};return a11_0x2015();}import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function getDatasetDetail(_0x2ada8c){const _0x12b485=a11_0x289f,_0x8ba239=Date[_0x12b485(0x16c)](),{appCode:appCode=process[_0x12b485(0x16d)]['LOVRABET_APP_CODE'],cookie:_0x4aedb6,env:env=process[_0x12b485(0x16d)][_0x12b485(0x156)]||'online',datasetCode:_0xa9dd8,forceRefresh:forceRefresh=![]}=_0x2ada8c;if(!appCode)throw new Error(_0x12b485(0x16f));if(!_0xa9dd8)throw new Error('datasetCode\x20is\x20required');const _0x369fc5=new DevApiClient({'appCode':appCode,'cookie':_0x4aedb6,'env':env}),_0x5cb1f5=/^\d+$/[_0x12b485(0x17f)](_0xa9dd8);let _0x550dab;if(_0x5cb1f5)_0x550dab=_0xa9dd8;else{const _0xb2b4f1=await _0x369fc5[_0x12b485(0x158)]({'pageSize':0x3e7,'forceRefresh':forceRefresh}),_0x532d75=_0xb2b4f1[_0x12b485(0x177)]?.[_0x12b485(0x17b)]||[],_0x430d17=_0x532d75['find'](_0x1a623e=>_0x1a623e[_0x12b485(0x167)]===_0xa9dd8);if(!_0x430d17)throw new Error('Dataset\x20not\x20found\x20with\x20code:\x20'+_0xa9dd8);_0x550dab=String(_0x430d17['id']);}const _0x13b9e1=await _0x369fc5[_0x12b485(0x171)](_0x550dab,forceRefresh),_0x251748=new DatasetAnalyzer(),_0x1a9211=_0x251748['analyzeDatasetDetail'](_0x13b9e1),_0x49491b=_0x1a9211[_0x12b485(0x176)][_0x12b485(0x178)](_0x174e66=>_0x174e66[_0x12b485(0x159)])[_0x12b485(0x18e)](_0x400e68=>_0x400e68[_0x12b485(0x179)]),_0xdef2df=_0x1a9211['fields']['filter'](_0x1545ca=>_0x1545ca[_0x12b485(0x18f)])['map'](_0x4d0f62=>_0x4d0f62[_0x12b485(0x179)]),_0x513487=[_0x12b485(0x182),_0x12b485(0x191),_0x12b485(0x161),_0x12b485(0x16a),_0x12b485(0x187),_0x12b485(0x18a),_0x12b485(0x181),'enabled',_0x12b485(0x164),_0x12b485(0x160),_0x12b485(0x189)],_0x17dc30=_0x1a9211['fields']['filter'](_0x382ec7=>{const _0x4ce99c=_0x12b485,_0x4d98c8=_0x382ec7[_0x4ce99c(0x179)][_0x4ce99c(0x173)]();return _0x513487[_0x4ce99c(0x15f)](_0x555f78=>_0x4d98c8[_0x4ce99c(0x15b)](_0x555f78)||_0x4d98c8===_0x555f78);})['map'](_0x5d6c7c=>_0x5d6c7c[_0x12b485(0x179)]),_0x18c806=_0x1a9211[_0x12b485(0x176)][_0x12b485(0x178)](_0x1b5e67=>{const _0x1671fc=_0x12b485,_0x37694d=_0x1b5e67[_0x1671fc(0x179)][_0x1671fc(0x173)]();return _0x37694d[_0x1671fc(0x17c)](_0x1671fc(0x180))||_0x37694d['endsWith']('id');})[_0x12b485(0x178)](_0x58fd8d=>!_0x58fd8d[_0x12b485(0x159)])['map'](_0x1599d7=>{const _0x5cbcaf=_0x12b485,_0x3f7aad=_0x1599d7[_0x5cbcaf(0x179)]['replace'](/_id$/,'')[_0x5cbcaf(0x15a)](/Id$/,'');return{'field':_0x1599d7[_0x5cbcaf(0x179)],'suggestsForeignKeyTo':_0x3f7aad};}),_0x2d54bd=_0x1a9211[_0x12b485(0x176)][_0x12b485(0x178)](_0x3d2f30=>_0x3d2f30[_0x12b485(0x190)]&&_0x3d2f30[_0x12b485(0x190)]['length']>0x0)['map'](_0x15750f=>({'field':_0x15750f['name'],'options':(_0x15750f['enumValues']||[])[_0x12b485(0x18e)](_0x2c40d1=>({'label':String(_0x2c40d1),'value':_0x2c40d1}))})),_0x3874f0={'primaryKeys':_0x49491b,'filterableFields':_0x17dc30,'joinableFields':_0x18c806,'requiredFields':_0xdef2df,'enumFields':_0x2d54bd},_0x5bcee4=[],_0x553329=_0x1a9211['operations'][_0x12b485(0x155)](_0x104682=>_0x104682[_0x12b485(0x161)]==='filter');_0x553329&&_0x5bcee4[_0x12b485(0x170)]({'action':_0x12b485(0x154),'tool':_0x12b485(0x188),'params':{'datasetCode':_0xa9dd8,'operationName':_0x12b485(0x178)},'reason':_0x12b485(0x17d),'priority':_0x12b485(0x18d)});_0x1a9211[_0x12b485(0x168)][_0x12b485(0x175)]?.['dbId']&&_0x5bcee4['push']({'action':'Create\x20custom\x20SQL\x20for\x20this\x20dataset','tool':_0x12b485(0x18c),'params':{'sqlContent':'SELECT\x20*\x20FROM\x20'+_0x1a9211[_0x12b485(0x168)][_0x12b485(0x183)],'dbId':_0x1a9211[_0x12b485(0x168)][_0x12b485(0x175)][_0x12b485(0x16b)]},'reason':_0x12b485(0x15c),'priority':_0x12b485(0x166)});_0x5bcee4['push']({'action':_0x12b485(0x184),'tool':_0x12b485(0x16e),'reason':_0x12b485(0x18b),'priority':'low'});const _0x37cd22=Date['now']()-_0x8ba239;return{'appCode':appCode,'env':env,'basic':_0x1a9211['basic'],'fields':_0x1a9211[_0x12b485(0x176)],'operations':_0x1a9211[_0x12b485(0x185)],'stats':{'fieldCount':_0x1a9211[_0x12b485(0x172)],'operationCount':_0x1a9211[_0x12b485(0x162)],'enabledOperationCount':_0x1a9211[_0x12b485(0x163)],'supportsCRUD':_0x1a9211[_0x12b485(0x186)]},'sqlValidationHints':_0x3874f0,'nextSteps':_0x5bcee4};}
1
+ function a11_0xc244(_0x12efb6,_0x344a30){_0x12efb6=_0x12efb6-0x16b;const _0x2d6055=a11_0x2d60();let _0xc244ad=_0x2d6055[_0x12efb6];return _0xc244ad;}(function(_0x5707e3,_0x23fe6a){const _0x404384=a11_0xc244,_0xab668c=_0x5707e3();while(!![]){try{const _0x53e09e=parseInt(_0x404384(0x193))/0x1+parseInt(_0x404384(0x192))/0x2+parseInt(_0x404384(0x1a5))/0x3*(parseInt(_0x404384(0x1a1))/0x4)+-parseInt(_0x404384(0x1ab))/0x5+-parseInt(_0x404384(0x188))/0x6*(-parseInt(_0x404384(0x189))/0x7)+parseInt(_0x404384(0x18e))/0x8*(-parseInt(_0x404384(0x176))/0x9)+parseInt(_0x404384(0x199))/0xa*(parseInt(_0x404384(0x17c))/0xb);if(_0x53e09e===_0x23fe6a)break;else _0xab668c['push'](_0xab668c['shift']());}catch(_0x49f1cf){_0xab668c['push'](_0xab668c['shift']());}}}(a11_0x2d60,0x19d7d));import{DevApiClient}from'../api/dev-api-client.js';import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function getDatasetDetail(_0x46cbbe){const _0x187fa8=a11_0xc244,_0x5b1599=Date[_0x187fa8(0x1a9)](),{appCode:appCode=process[_0x187fa8(0x174)][_0x187fa8(0x17e)],cookie:_0x3d9868,env:env=process[_0x187fa8(0x174)][_0x187fa8(0x17f)]||_0x187fa8(0x1a3),datasetCode:_0x2306b2,forceRefresh:forceRefresh=![]}=_0x46cbbe;if(!appCode)throw new Error(_0x187fa8(0x1aa));if(!_0x2306b2)throw new Error(_0x187fa8(0x187));const _0x5822d8=new DevApiClient({'appCode':appCode,'cookie':_0x3d9868,'env':env}),_0x253de2=/^\d+$/[_0x187fa8(0x1ad)](_0x2306b2);let _0x20bd70;if(_0x253de2)_0x20bd70=_0x2306b2;else{const _0x58f40f=await _0x5822d8[_0x187fa8(0x172)]({'pageSize':0x3e7,'forceRefresh':forceRefresh}),_0x11ba36=_0x58f40f[_0x187fa8(0x196)]?.[_0x187fa8(0x177)]||[],_0x134cbe=_0x11ba36[_0x187fa8(0x190)](_0x4b43dc=>_0x4b43dc[_0x187fa8(0x1a2)]===_0x2306b2);if(!_0x134cbe)throw new Error(_0x187fa8(0x19c)+_0x2306b2);_0x20bd70=String(_0x134cbe['id']);}const _0x363be1=await _0x5822d8[_0x187fa8(0x17b)](_0x20bd70,forceRefresh),_0x59ece9=new DatasetAnalyzer(),_0x133a9f=_0x59ece9['analyzeDatasetDetail'](_0x363be1),_0xbcf05e=_0x133a9f['fields'][_0x187fa8(0x17d)](_0x5258c2=>_0x5258c2[_0x187fa8(0x183)])[_0x187fa8(0x16d)](_0x172a5f=>_0x172a5f[_0x187fa8(0x19d)]),_0x30439f=_0x133a9f[_0x187fa8(0x1a8)][_0x187fa8(0x17d)](_0x5e76b2=>_0x5e76b2[_0x187fa8(0x197)])[_0x187fa8(0x16d)](_0x23e0b1=>_0x23e0b1['name']),_0x1c4b1c=['status','state',_0x187fa8(0x191),_0x187fa8(0x1a6),_0x187fa8(0x18f),_0x187fa8(0x19b),_0x187fa8(0x1a7),_0x187fa8(0x175),_0x187fa8(0x19a),_0x187fa8(0x18d),_0x187fa8(0x18b)],_0x3661de=_0x133a9f[_0x187fa8(0x1a8)][_0x187fa8(0x17d)](_0x33ca5e=>{const _0x5a50b4=_0x187fa8,_0x3969b6=_0x33ca5e[_0x5a50b4(0x19d)][_0x5a50b4(0x184)]();return _0x1c4b1c[_0x5a50b4(0x1a4)](_0x4a61e0=>_0x3969b6[_0x5a50b4(0x185)](_0x4a61e0)||_0x3969b6===_0x4a61e0);})[_0x187fa8(0x16d)](_0x1048b8=>_0x1048b8[_0x187fa8(0x19d)]),_0x29b8d0=_0x133a9f[_0x187fa8(0x1a8)][_0x187fa8(0x17d)](_0x3a4eb6=>{const _0x2b6920=_0x187fa8,_0x1fcc48=_0x3a4eb6[_0x2b6920(0x19d)]['toLowerCase']();return _0x1fcc48[_0x2b6920(0x16f)]('_id')||_0x1fcc48[_0x2b6920(0x16f)]('id');})[_0x187fa8(0x17d)](_0x4dd007=>!_0x4dd007[_0x187fa8(0x183)])[_0x187fa8(0x16d)](_0x39a83a=>{const _0x564980=_0x187fa8,_0x2681eb=_0x39a83a[_0x564980(0x19d)]['replace'](/_id$/,'')[_0x564980(0x1ae)](/Id$/,'');return{'field':_0x39a83a[_0x564980(0x19d)],'suggestsForeignKeyTo':_0x2681eb};}),_0x38d12b=_0x133a9f[_0x187fa8(0x1a8)][_0x187fa8(0x17d)](_0x56e671=>_0x56e671['enumValues']&&_0x56e671[_0x187fa8(0x178)][_0x187fa8(0x1a0)]>0x0)[_0x187fa8(0x16d)](_0x3b0f23=>({'field':_0x3b0f23[_0x187fa8(0x19d)],'options':(_0x3b0f23[_0x187fa8(0x178)]||[])[_0x187fa8(0x16d)](_0x340f6c=>({'label':String(_0x340f6c),'value':_0x340f6c}))})),_0x56568d={'primaryKeys':_0xbcf05e,'filterableFields':_0x3661de,'joinableFields':_0x29b8d0,'requiredFields':_0x30439f,'enumFields':_0x38d12b},_0x55a2=[],_0x42f60d=_0x133a9f[_0x187fa8(0x19f)][_0x187fa8(0x190)](_0x41923c=>_0x41923c['type']==='filter');_0x42f60d&&_0x55a2[_0x187fa8(0x171)]({'action':_0x187fa8(0x198),'tool':_0x187fa8(0x195),'params':{'datasetCode':_0x2306b2,'operationName':_0x187fa8(0x17d)},'reason':_0x187fa8(0x18a),'priority':_0x187fa8(0x179)});_0x133a9f['basic']['database']?.['dbId']&&_0x55a2[_0x187fa8(0x171)]({'action':_0x187fa8(0x16b),'tool':_0x187fa8(0x1ac),'params':{'sqlContent':'SELECT\x20*\x20FROM\x20'+_0x133a9f[_0x187fa8(0x180)]['tableName'],'dbId':_0x133a9f['basic'][_0x187fa8(0x16c)][_0x187fa8(0x19e)]},'reason':_0x187fa8(0x173),'priority':_0x187fa8(0x18c)});_0x55a2[_0x187fa8(0x171)]({'action':_0x187fa8(0x194),'tool':_0x187fa8(0x17a),'reason':_0x187fa8(0x186),'priority':_0x187fa8(0x182)});const _0x4b1df5=Date[_0x187fa8(0x1a9)]()-_0x5b1599;return{'appCode':appCode,'env':env,'basic':_0x133a9f[_0x187fa8(0x180)],'fields':_0x133a9f[_0x187fa8(0x1a8)],'operations':_0x133a9f[_0x187fa8(0x19f)],'stats':{'fieldCount':_0x133a9f['fieldCount'],'operationCount':_0x133a9f[_0x187fa8(0x16e)],'enabledOperationCount':_0x133a9f[_0x187fa8(0x181)],'supportsCRUD':_0x133a9f[_0x187fa8(0x170)]},'sqlValidationHints':_0x56568d,'nextSteps':_0x55a2};}function a11_0x2d60(){const _0x5b0353=['operationCount','endsWith','supportsCRUD','push','getDatasetList','Validate\x20and\x20prepare\x20custom\x20SQL\x20for\x20this\x20dataset','env','enabled','9LCGHNu','tableData','enumValues','high','list_datasets','getDatasetDetail','3473492nfqaFi','filter','LOVRABET_APP_CODE','LOVRABET_ENV','basic','enabledOperationCount','low','primaryKey','toLowerCase','includes','Find\x20other\x20datasets\x20that\x20might\x20be\x20related\x20for\x20JOIN\x20operations','datasetCode\x20is\x20required','152130sQZzto','7GDAafz','Get\x20ready-to-use\x20TypeScript\x20code\x20for\x20querying\x20this\x20dataset','archived','medium','deleted','1339048hkMSLH','level','find','type','208988NBFxYP','4773ohRgjz','Browse\x20related\x20datasets','generate_sdk_code','data','required','Generate\x20SDK\x20code\x20for\x20querying\x20this\x20dataset','10jEuJQJ','visible','priority','Dataset\x20not\x20found\x20with\x20code:\x20','name','dbId','operations','length','4odaeay','code','online','some','5001CqrhXk','category','active','fields','now','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','894135njkHlT','validate_sql_content','test','replace','Create\x20custom\x20SQL\x20for\x20this\x20dataset','database','map'];a11_0x2d60=function(){return _0x5b0353;};return a11_0x2d60();}
@@ -1 +1 @@
1
- (function(_0x12be19,_0x309956){const _0x4a5f99=a12_0x3f07,_0x417466=_0x12be19();while(!![]){try{const _0x4eeffd=parseInt(_0x4a5f99(0x159))/0x1*(parseInt(_0x4a5f99(0x16c))/0x2)+-parseInt(_0x4a5f99(0x15d))/0x3+parseInt(_0x4a5f99(0x157))/0x4*(-parseInt(_0x4a5f99(0x168))/0x5)+-parseInt(_0x4a5f99(0x166))/0x6+-parseInt(_0x4a5f99(0x16f))/0x7*(-parseInt(_0x4a5f99(0x172))/0x8)+parseInt(_0x4a5f99(0x15a))/0x9*(parseInt(_0x4a5f99(0x173))/0xa)+parseInt(_0x4a5f99(0x158))/0xb*(-parseInt(_0x4a5f99(0x167))/0xc);if(_0x4eeffd===_0x309956)break;else _0x417466['push'](_0x417466['shift']());}catch(_0x2778f6){_0x417466['push'](_0x417466['shift']());}}}(a12_0x27d9,0x508b2));import{DevApiClient}from'../api/dev-api-client.js';import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';function a12_0x3f07(_0x21151b,_0x1d2412){_0x21151b=_0x21151b-0x156;const _0x27d905=a12_0x27d9();let _0x3f073f=_0x27d905[_0x21151b];return _0x3f073f;}export async function getOperationDetail(_0x1b374f){const _0x420811=a12_0x3f07,{appCode:appCode=process[_0x420811(0x16e)][_0x420811(0x15e)],cookie:_0x2abc99,env:env=process[_0x420811(0x16e)][_0x420811(0x162)]||'online',datasetCode:_0xfdce13,operationName:_0x28b6cf}=_0x1b374f;if(!appCode)throw new Error(_0x420811(0x163));if(!_0xfdce13)throw new Error(_0x420811(0x160));if(!_0x28b6cf)throw new Error(_0x420811(0x161));const _0x476282=new DevApiClient({'appCode':appCode,'cookie':_0x2abc99,'env':env}),_0x2619df=/^\d+$/[_0x420811(0x156)](_0xfdce13);let _0x5dac50;if(_0x2619df)_0x5dac50=_0xfdce13;else{const _0x36f546=await _0x476282[_0x420811(0x171)]({'pageSize':0x3e7}),_0x3d64bc=_0x36f546['data']?.[_0x420811(0x164)]||[],_0x4cd1cb=_0x3d64bc[_0x420811(0x170)](_0x1a6eab=>_0x1a6eab['code']===_0xfdce13);if(!_0x4cd1cb)throw new Error('Dataset\x20not\x20found\x20with\x20code:\x20'+_0xfdce13);_0x5dac50=String(_0x4cd1cb['id']);}const _0x55b031=await _0x476282['getDatasetDetail'](_0x5dac50),_0x51dc99=new DatasetAnalyzer(),_0x247a47=_0x51dc99[_0x420811(0x169)](_0x55b031,_0x28b6cf);if(!_0x247a47)throw new Error(_0x420811(0x15b)+_0x28b6cf+_0x420811(0x15c)+_0xfdce13+'\x27');const _0x77f77f=_0x51dc99[_0x420811(0x16a)](_0x55b031);return{'appCode':appCode,'env':env,'datasetName':_0x77f77f[_0x420811(0x16d)][_0x420811(0x165)],'operation':_0x247a47,'sdkReturnValueBehavior':{'onSuccess':'Returns\x20ONLY\x20the\x20\x27data\x27\x20field\x20content.\x20Full\x20API\x20response\x20is\x20{\x20success:\x20true,\x20data:\x20{...},\x20msg:\x20\x22\x22,\x20errorMsg:\x20\x22\x22,\x20errorCode:\x20\x220000\x22\x20},\x20but\x20SDK\x20returns\x20just\x20the\x20{...}\x20part\x20from\x20\x27data\x27.','onError':_0x420811(0x15f),'note':_0x420811(0x16b)}};}function a12_0x27d9(){const _0x8d9cd9=['operationName\x20is\x20required','LOVRABET_ENV','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','tableData','name','650610PoqIot','207456wCMxFl','97915SIxoXP','getOperationDetail','analyzeDatasetDetail','CRITICAL:\x20Always\x20use\x20try-catch\x20when\x20calling\x20SDK\x20methods.\x20Success\x20case\x20returns\x20data\x20directly\x20(e.g.,\x20{\x20id:\x20123,\x20name:\x20\x22...\x22\x20}),\x20but\x20failure\x20case\x20throws\x20exception\x20instead\x20of\x20returning\x20error\x20info.','58UOBbgD','basic','env','110537ZsRyUN','find','getDatasetList','328McNNqi','937760rYEQOz','test','68kebwcB','297fFKbmB','10253GJwUlL','63MoDKXt','Operation\x20\x27','\x27\x20not\x20found\x20in\x20dataset\x20\x27','1089516syrVpI','LOVRABET_APP_CODE','Throws\x20LovrabetError\x20exception\x20with\x20full\x20response.\x20The\x20error\x20object\x20contains:\x20{\x20message:\x20string,\x20status?:\x20number\x20(HTTP\x20code),\x20code?:\x20string\x20(business\x20error\x20code),\x20data?:\x20any\x20(full\x20error\x20response)\x20}','datasetCode\x20is\x20required'];a12_0x27d9=function(){return _0x8d9cd9;};return a12_0x27d9();}
1
+ (function(_0x531d34,_0x5889e9){const _0x398e6a=a12_0x1753,_0x28d06a=_0x531d34();while(!![]){try{const _0x5afe9a=parseInt(_0x398e6a(0x1ad))/0x1+-parseInt(_0x398e6a(0x1a0))/0x2+parseInt(_0x398e6a(0x19d))/0x3*(parseInt(_0x398e6a(0x19e))/0x4)+parseInt(_0x398e6a(0x1a6))/0x5+-parseInt(_0x398e6a(0x1a2))/0x6+parseInt(_0x398e6a(0x1a7))/0x7+parseInt(_0x398e6a(0x198))/0x8*(-parseInt(_0x398e6a(0x1a8))/0x9);if(_0x5afe9a===_0x5889e9)break;else _0x28d06a['push'](_0x28d06a['shift']());}catch(_0x46c54d){_0x28d06a['push'](_0x28d06a['shift']());}}}(a12_0x272f,0x96ac6));import{DevApiClient}from'../api/dev-api-client.js';function a12_0x1753(_0x5bdf3a,_0x12d8ee){_0x5bdf3a=_0x5bdf3a-0x196;const _0x272f58=a12_0x272f();let _0x175383=_0x272f58[_0x5bdf3a];return _0x175383;}function a12_0x272f(){const _0x1005bf=['datasetCode\x20is\x20required','Dataset\x20not\x20found\x20with\x20code:\x20','data','457035btibbJ','4lvSITY','getOperationDetail','376304MzlCwq','code','476658JAeYmt','test','Returns\x20ONLY\x20the\x20\x27data\x27\x20field\x20content.\x20Full\x20API\x20response\x20is\x20{\x20success:\x20true,\x20data:\x20{...},\x20msg:\x20\x22\x22,\x20errorMsg:\x20\x22\x22,\x20errorCode:\x20\x220000\x22\x20},\x20but\x20SDK\x20returns\x20just\x20the\x20{...}\x20part\x20from\x20\x27data\x27.','getDatasetList','5897180UcUlDQ','1225245xinTth','343449cPFoYx','env','LOVRABET_APP_CODE','basic','LOVRABET_ENV','599089UTVoeY','analyzeDatasetDetail','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','Operation\x20\x27','name','getDatasetDetail','256UMpKzZ','online'];a12_0x272f=function(){return _0x1005bf;};return a12_0x272f();}import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function getOperationDetail(_0xc587f1){const _0x413b5a=a12_0x1753,{appCode:appCode=process['env'][_0x413b5a(0x1aa)],cookie:_0x443f8a,env:env=process[_0x413b5a(0x1a9)][_0x413b5a(0x1ac)]||_0x413b5a(0x199),datasetCode:_0x586059,operationName:_0x5bd617}=_0xc587f1;if(!appCode)throw new Error(_0x413b5a(0x1af));if(!_0x586059)throw new Error(_0x413b5a(0x19a));if(!_0x5bd617)throw new Error('operationName\x20is\x20required');const _0x2ce925=new DevApiClient({'appCode':appCode,'cookie':_0x443f8a,'env':env}),_0x1c3686=/^\d+$/[_0x413b5a(0x1a3)](_0x586059);let _0x2dda0d;if(_0x1c3686)_0x2dda0d=_0x586059;else{const _0x5624be=await _0x2ce925[_0x413b5a(0x1a5)]({'pageSize':0x3e7}),_0x5b752d=_0x5624be[_0x413b5a(0x19c)]?.['tableData']||[],_0x3ac1a8=_0x5b752d['find'](_0x56997e=>_0x56997e[_0x413b5a(0x1a1)]===_0x586059);if(!_0x3ac1a8)throw new Error(_0x413b5a(0x19b)+_0x586059);_0x2dda0d=String(_0x3ac1a8['id']);}const _0x423580=await _0x2ce925[_0x413b5a(0x197)](_0x2dda0d),_0x9c5087=new DatasetAnalyzer(),_0x46119a=_0x9c5087[_0x413b5a(0x19f)](_0x423580,_0x5bd617);if(!_0x46119a)throw new Error(_0x413b5a(0x1b0)+_0x5bd617+'\x27\x20not\x20found\x20in\x20dataset\x20\x27'+_0x586059+'\x27');const _0x256cb5=_0x9c5087[_0x413b5a(0x1ae)](_0x423580);return{'appCode':appCode,'env':env,'datasetName':_0x256cb5[_0x413b5a(0x1ab)][_0x413b5a(0x196)],'operation':_0x46119a,'sdkReturnValueBehavior':{'onSuccess':_0x413b5a(0x1a4),'onError':'Throws\x20LovrabetError\x20exception\x20with\x20full\x20response.\x20The\x20error\x20object\x20contains:\x20{\x20message:\x20string,\x20status?:\x20number\x20(HTTP\x20code),\x20code?:\x20string\x20(business\x20error\x20code),\x20data?:\x20any\x20(full\x20error\x20response)\x20}','note':'CRITICAL:\x20Always\x20use\x20try-catch\x20when\x20calling\x20SDK\x20methods.\x20Success\x20case\x20returns\x20data\x20directly\x20(e.g.,\x20{\x20id:\x20123,\x20name:\x20\x22...\x22\x20}),\x20but\x20failure\x20case\x20throws\x20exception\x20instead\x20of\x20returning\x20error\x20info.'}};}
@@ -1 +1 @@
1
- (function(_0xe713b2,_0x210a26){const _0x575119=a13_0x3d6e,_0x5610b6=_0xe713b2();while(!![]){try{const _0x17e6ec=-parseInt(_0x575119(0xd4))/0x1*(parseInt(_0x575119(0xd2))/0x2)+-parseInt(_0x575119(0xe5))/0x3*(parseInt(_0x575119(0xd1))/0x4)+-parseInt(_0x575119(0xe8))/0x5*(parseInt(_0x575119(0xe9))/0x6)+parseInt(_0x575119(0xda))/0x7+parseInt(_0x575119(0xde))/0x8*(-parseInt(_0x575119(0xe6))/0x9)+-parseInt(_0x575119(0xd3))/0xa*(-parseInt(_0x575119(0xe3))/0xb)+parseInt(_0x575119(0xed))/0xc;if(_0x17e6ec===_0x210a26)break;else _0x5610b6['push'](_0x5610b6['shift']());}catch(_0x4bfccc){_0x5610b6['push'](_0x5610b6['shift']());}}}(a13_0x3365,0x77ec0));import{DevApiClient}from'../api/dev-api-client.js';function a13_0x3d6e(_0x2aaee5,_0x59d9a3){_0x2aaee5=_0x2aaee5-0xcf;const _0x3365c6=a13_0x3365();let _0x3d6ed8=_0x3365c6[_0x2aaee5];return _0x3d6ed8;}import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';function a13_0x3365(){const _0x39c714=['supportsCRUD','13193016icaSnX','method','name','4uvDJbC','6428CTxeTR','5392370zEesaE','137ZGjNHi','type','tableData','path','basic','code','2330692MDKgPY','displayName','test','operationCount','536cMvkfY','enabled','data','Dataset\x20not\x20found\x20with\x20code:\x20','LOVRABET_ENV','11WTmsYA','map','376671MMjjEx','121203pZSjaH','operations','5JuAhOq','73482bmRUFf','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','env'];a13_0x3365=function(){return _0x39c714;};return a13_0x3365();}export async function getDatasetOperations(_0x5a9d1d){const _0x50e28d=a13_0x3d6e,{appCode:appCode=process[_0x50e28d(0xeb)]['LOVRABET_APP_CODE'],cookie:_0x27e768,env:env=process[_0x50e28d(0xeb)][_0x50e28d(0xe2)]||'online',datasetCode:_0x102065}=_0x5a9d1d;if(!appCode)throw new Error(_0x50e28d(0xea));if(!_0x102065)throw new Error('datasetCode\x20is\x20required');const _0x2b8e54=new DevApiClient({'appCode':appCode,'cookie':_0x27e768,'env':env}),_0x568026=/^\d+$/[_0x50e28d(0xdc)](_0x102065);let _0xda9d6;if(_0x568026)_0xda9d6=_0x102065;else{const _0x40afa0=await _0x2b8e54['getDatasetList']({'pageSize':0x3e7}),_0x2018e0=_0x40afa0[_0x50e28d(0xe0)]?.[_0x50e28d(0xd6)]||[],_0x44131b=_0x2018e0['find'](_0x44d495=>_0x44d495[_0x50e28d(0xd9)]===_0x102065);if(!_0x44131b)throw new Error(_0x50e28d(0xe1)+_0x102065);_0xda9d6=String(_0x44131b['id']);}const _0x24b938=await _0x2b8e54['getDatasetDetail'](_0xda9d6),_0xe5c84c=new DatasetAnalyzer(),_0x1f34bb=_0xe5c84c['analyzeDatasetDetail'](_0x24b938);return{'appCode':appCode,'env':env,'datasetName':_0x1f34bb[_0x50e28d(0xd8)][_0x50e28d(0xd0)],'tableName':_0x1f34bb[_0x50e28d(0xd8)]['tableName'],'operations':_0x1f34bb[_0x50e28d(0xe7)][_0x50e28d(0xe4)](_0x15f4f4=>({'name':_0x15f4f4['name'],'displayName':_0x15f4f4[_0x50e28d(0xdb)],'type':_0x15f4f4[_0x50e28d(0xd5)],'method':_0x15f4f4[_0x50e28d(0xcf)],'path':_0x15f4f4[_0x50e28d(0xd7)],'requestFieldsCount':_0x15f4f4['requestFieldsCount'],'enabled':_0x15f4f4[_0x50e28d(0xdf)]})),'stats':{'total':_0x1f34bb[_0x50e28d(0xdd)],'enabled':_0x1f34bb['enabledOperationCount'],'supportsCRUD':_0x1f34bb[_0x50e28d(0xec)]}};}
1
+ (function(_0x2753e7,_0x2413bc){const _0x4901bf=a13_0x595b,_0x5696ea=_0x2753e7();while(!![]){try{const _0x778cd=parseInt(_0x4901bf(0x1a3))/0x1*(-parseInt(_0x4901bf(0x196))/0x2)+parseInt(_0x4901bf(0x1a7))/0x3*(parseInt(_0x4901bf(0x1ac))/0x4)+-parseInt(_0x4901bf(0x19f))/0x5+-parseInt(_0x4901bf(0x197))/0x6*(-parseInt(_0x4901bf(0x1a5))/0x7)+-parseInt(_0x4901bf(0x195))/0x8+-parseInt(_0x4901bf(0x1a8))/0x9*(-parseInt(_0x4901bf(0x1a1))/0xa)+-parseInt(_0x4901bf(0x190))/0xb*(-parseInt(_0x4901bf(0x19e))/0xc);if(_0x778cd===_0x2413bc)break;else _0x5696ea['push'](_0x5696ea['shift']());}catch(_0x455b69){_0x5696ea['push'](_0x5696ea['shift']());}}}(a13_0x1731,0xea146));import{DevApiClient}from'../api/dev-api-client.js';function a13_0x595b(_0x27c50e,_0x2af579){_0x27c50e=_0x27c50e-0x190;const _0x173197=a13_0x1731();let _0x595bd3=_0x173197[_0x27c50e];return _0x595bd3;}import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function getDatasetOperations(_0x1bb678){const _0xe053fe=a13_0x595b,{appCode:appCode=process['env'][_0xe053fe(0x1a2)],cookie:_0x1e58b5,env:env=process[_0xe053fe(0x192)]['LOVRABET_ENV']||'online',datasetCode:_0x3bffc0}=_0x1bb678;if(!appCode)throw new Error(_0xe053fe(0x199));if(!_0x3bffc0)throw new Error(_0xe053fe(0x1a4));const _0x2c3009=new DevApiClient({'appCode':appCode,'cookie':_0x1e58b5,'env':env}),_0x292e1f=/^\d+$/[_0xe053fe(0x19c)](_0x3bffc0);let _0x3424d9;if(_0x292e1f)_0x3424d9=_0x3bffc0;else{const _0x516ad4=await _0x2c3009[_0xe053fe(0x191)]({'pageSize':0x3e7}),_0xfdcd0d=_0x516ad4[_0xe053fe(0x198)]?.[_0xe053fe(0x194)]||[],_0x3cd2e6=_0xfdcd0d['find'](_0x197f51=>_0x197f51[_0xe053fe(0x1ad)]===_0x3bffc0);if(!_0x3cd2e6)throw new Error(_0xe053fe(0x1aa)+_0x3bffc0);_0x3424d9=String(_0x3cd2e6['id']);}const _0x59245c=await _0x2c3009[_0xe053fe(0x1ae)](_0x3424d9),_0x4fd140=new DatasetAnalyzer(),_0x595b0e=_0x4fd140[_0xe053fe(0x19d)](_0x59245c);return{'appCode':appCode,'env':env,'datasetName':_0x595b0e[_0xe053fe(0x19b)]['name'],'tableName':_0x595b0e['basic']['tableName'],'operations':_0x595b0e['operations'][_0xe053fe(0x1a9)](_0x1c1ed2=>({'name':_0x1c1ed2[_0xe053fe(0x1ab)],'displayName':_0x1c1ed2[_0xe053fe(0x19a)],'type':_0x1c1ed2['type'],'method':_0x1c1ed2[_0xe053fe(0x1a6)],'path':_0x1c1ed2['path'],'requestFieldsCount':_0x1c1ed2[_0xe053fe(0x1a0)],'enabled':_0x1c1ed2[_0xe053fe(0x193)]})),'stats':{'total':_0x595b0e['operationCount'],'enabled':_0x595b0e['enabledOperationCount'],'supportsCRUD':_0x595b0e['supportsCRUD']}};}function a13_0x1731(){const _0x481b6f=['requestFieldsCount','50AeVnwG','LOVRABET_APP_CODE','18hEZqsm','datasetCode\x20is\x20required','216881EwvTSn','method','3126oOdYWE','3029445QjHNVn','map','Dataset\x20not\x20found\x20with\x20code:\x20','name','4496WozOBE','code','getDatasetDetail','11UccpjF','getDatasetList','env','enabled','tableData','11434592NzrYPy','116458OQJRbr','282OZuZhw','data','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','displayName','basic','test','analyzeDatasetDetail','8154288TMLLaz','7768610wAwEiv'];a13_0x1731=function(){return _0x481b6f;};return a13_0x1731();}
@@ -1 +1 @@
1
- (function(_0x24aeb9,_0x573c0e){var _0x285af1=a14_0x5e2f,_0x3f4d69=_0x24aeb9();while(!![]){try{var _0x2b5acd=parseInt(_0x285af1(0x1f9))/0x1+parseInt(_0x285af1(0x1f3))/0x2*(-parseInt(_0x285af1(0x1f7))/0x3)+parseInt(_0x285af1(0x1f2))/0x4+-parseInt(_0x285af1(0x1f6))/0x5*(-parseInt(_0x285af1(0x1f4))/0x6)+parseInt(_0x285af1(0x1fa))/0x7*(parseInt(_0x285af1(0x1fc))/0x8)+parseInt(_0x285af1(0x1fb))/0x9*(-parseInt(_0x285af1(0x1f5))/0xa)+parseInt(_0x285af1(0x1f8))/0xb;if(_0x2b5acd===_0x573c0e)break;else _0x3f4d69['push'](_0x3f4d69['shift']());}catch(_0xa03f31){_0x3f4d69['push'](_0x3f4d69['shift']());}}}(a14_0x5876,0x5a590));export{login}from'./login.js';function a14_0x5e2f(_0x10fb44,_0x11715e){_0x10fb44=_0x10fb44-0x1f2;var _0x5876bc=a14_0x5876();var _0x5e2f0b=_0x5876bc[_0x10fb44];return _0x5e2f0b;}export{listDatasets}from'./list-datasets.js';export{getDatasetDetail}from'./get-dataset-detail.js';export{getDatasetOperations}from'./get-operations.js';export{getOperationDetail}from'./get-operation-detail.js';export{generateSDKCode}from'./generate-sdk-code.js';export{searchDatasets}from'./search-datasets.js';export{listSqlQueries}from'./list-sql-queries.js';export{saveOrUpdateCustomSql}from'./save-or-update-custom-sql.js';export{executeCustomSql}from'./execute-custom-sql.js';export{generateSqlCode}from'./generate-sql-code.js';export{validateSqlContent}from'./validate-sql-content.js';function a14_0x5876(){var _0x53f839=['102mrlCcd','5700UtvuZX','95385ttiiqT','74043yYMQKo','1881748NEivsD','64809eSjmIn','7PMFQan','7083bFstwi','2016920KPWZTx','2592236DeLQwH','52BGangg'];a14_0x5876=function(){return _0x53f839;};return a14_0x5876();}
1
+ (function(_0x5b60b6,_0x41f2a8){var _0xade4b0=a14_0x387c,_0x54239a=_0x5b60b6();while(!![]){try{var _0x53170f=parseInt(_0xade4b0(0xc9))/0x1+parseInt(_0xade4b0(0xc7))/0x2+-parseInt(_0xade4b0(0xc5))/0x3+parseInt(_0xade4b0(0xca))/0x4+parseInt(_0xade4b0(0xc8))/0x5*(-parseInt(_0xade4b0(0xc4))/0x6)+-parseInt(_0xade4b0(0xc3))/0x7+parseInt(_0xade4b0(0xc6))/0x8;if(_0x53170f===_0x41f2a8)break;else _0x54239a['push'](_0x54239a['shift']());}catch(_0xe69894){_0x54239a['push'](_0x54239a['shift']());}}}(a14_0x2446,0xef8ea));export{login}from'./login.js';export{listDatasets}from'./list-datasets.js';export{getDatasetDetail}from'./get-dataset-detail.js';export{getDatasetOperations}from'./get-operations.js';export{getOperationDetail}from'./get-operation-detail.js';export{generateSDKCode}from'./generate-sdk-code.js';export{searchDatasets}from'./search-datasets.js';export{listSqlQueries}from'./list-sql-queries.js';function a14_0x2446(){var _0x194003=['1844696eLcpfi','9992339fMuyPP','1002oJlNMY','3864732Sktmuz','9296008vWpoaF','3680128ZZWAww','34885ETdoyQ','1398867qNjWRY'];a14_0x2446=function(){return _0x194003;};return a14_0x2446();}function a14_0x387c(_0x5c73ee,_0x212c51){_0x5c73ee=_0x5c73ee-0xc3;var _0x2446ec=a14_0x2446();var _0x387c34=_0x2446ec[_0x5c73ee];return _0x387c34;}export{saveOrUpdateCustomSql}from'./save-or-update-custom-sql.js';export{executeCustomSql}from'./execute-custom-sql.js';export{generateSqlCode}from'./generate-sql-code.js';export{validateSqlContent}from'./validate-sql-content.js';
@@ -1 +1 @@
1
- function a15_0x2602(_0x3bf31b,_0x17b38f){_0x3bf31b=_0x3bf31b-0x18b;const _0x41f7a6=a15_0x41f7();let _0x260246=_0x41f7a6[_0x3bf31b];return _0x260246;}(function(_0x105d1a,_0x26c481){const _0x4300c5=a15_0x2602,_0x45577b=_0x105d1a();while(!![]){try{const _0x313a51=-parseInt(_0x4300c5(0x190))/0x1*(-parseInt(_0x4300c5(0x19c))/0x2)+parseInt(_0x4300c5(0x199))/0x3*(parseInt(_0x4300c5(0x191))/0x4)+parseInt(_0x4300c5(0x18e))/0x5*(parseInt(_0x4300c5(0x192))/0x6)+-parseInt(_0x4300c5(0x18d))/0x7+parseInt(_0x4300c5(0x194))/0x8*(-parseInt(_0x4300c5(0x195))/0x9)+parseInt(_0x4300c5(0x198))/0xa*(parseInt(_0x4300c5(0x18c))/0xb)+-parseInt(_0x4300c5(0x18b))/0xc;if(_0x313a51===_0x26c481)break;else _0x45577b['push'](_0x45577b['shift']());}catch(_0x311ac5){_0x45577b['push'](_0x45577b['shift']());}}}(a15_0x41f7,0x99d2b));import{DevApiClient}from'../api/dev-api-client.js';import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';function a15_0x41f7(){const _0x21f3d3=['online','71TZMBNF','1700jydvOP','6pwsLvw','LOVRABET_ENV','14616DGgFtK','2691ggFPHI','env','analyzeDatasetList','10FKhVBE','6999oNIxrl','total','LOVRABET_APP_CODE','8074HgmEbt','1985964dBTauz','4213913hXbCli','6545553UGAEzB','3078365Svhmkv'];a15_0x41f7=function(){return _0x21f3d3;};return a15_0x41f7();}export async function listDatasets(_0x5e1f1b={}){const _0x2eeb70=a15_0x2602,{appCode:appCode=process['env'][_0x2eeb70(0x19b)],env:env=process[_0x2eeb70(0x196)][_0x2eeb70(0x193)]||_0x2eeb70(0x18f),cookie:_0x24859,pageSize:pageSize=0x3e7,currentPage:currentPage=0x1,forceRefresh:forceRefresh=![]}=_0x5e1f1b;if(!appCode)throw new Error('appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.');const _0x3bf54a=new DevApiClient({'appCode':appCode,'env':env,'cookie':_0x24859}),_0x5477cf=await _0x3bf54a['getDatasetList']({'pageSize':pageSize,'currentPage':currentPage,'forceRefresh':forceRefresh}),_0x519eee=new DatasetAnalyzer(),_0x5a140b=_0x519eee[_0x2eeb70(0x197)](_0x5477cf);return{'appCode':appCode,'env':env,'total':_0x5a140b[_0x2eeb70(0x19a)],'datasets':_0x5a140b['datasets']};}
1
+ function a15_0x5066(_0x5929ab,_0x188d8b){_0x5929ab=_0x5929ab-0xf8;const _0x235acf=a15_0x235a();let _0x5066d5=_0x235acf[_0x5929ab];return _0x5066d5;}(function(_0xe686f2,_0x4ae8cd){const _0xb21e9a=a15_0x5066,_0x2572b1=_0xe686f2();while(!![]){try{const _0xc4871d=-parseInt(_0xb21e9a(0x106))/0x1+parseInt(_0xb21e9a(0x107))/0x2*(-parseInt(_0xb21e9a(0x109))/0x3)+-parseInt(_0xb21e9a(0x102))/0x4+parseInt(_0xb21e9a(0xfc))/0x5+parseInt(_0xb21e9a(0x100))/0x6*(-parseInt(_0xb21e9a(0x103))/0x7)+-parseInt(_0xb21e9a(0xfa))/0x8*(-parseInt(_0xb21e9a(0xfd))/0x9)+parseInt(_0xb21e9a(0x105))/0xa;if(_0xc4871d===_0x4ae8cd)break;else _0x2572b1['push'](_0x2572b1['shift']());}catch(_0x54ccba){_0x2572b1['push'](_0x2572b1['shift']());}}}(a15_0x235a,0x1af95));import{DevApiClient}from'../api/dev-api-client.js';function a15_0x235a(){const _0x3456af=['appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','596862GEIQtl','env','329500jpupai','7sfuvcX','total','2079650yyNeyf','18942kyNpVn','14ualwNR','analyzeDatasetList','56049cIjOrt','LOVRABET_ENV','datasets','4352ygHKWJ','online','724395vtfdHt','1476zPFLFK','getDatasetList'];a15_0x235a=function(){return _0x3456af;};return a15_0x235a();}import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function listDatasets(_0x1a2d14={}){const _0x2c799c=a15_0x5066,{appCode:appCode=process[_0x2c799c(0x101)]['LOVRABET_APP_CODE'],env:env=process[_0x2c799c(0x101)][_0x2c799c(0xf8)]||_0x2c799c(0xfb),cookie:_0x277f27,pageSize:pageSize=0x3e7,currentPage:currentPage=0x1,forceRefresh:forceRefresh=![]}=_0x1a2d14;if(!appCode)throw new Error(_0x2c799c(0xff));const _0x458ebc=new DevApiClient({'appCode':appCode,'env':env,'cookie':_0x277f27}),_0x13c30f=await _0x458ebc[_0x2c799c(0xfe)]({'pageSize':pageSize,'currentPage':currentPage,'forceRefresh':forceRefresh}),_0x154437=new DatasetAnalyzer(),_0x4fad00=_0x154437[_0x2c799c(0x108)](_0x13c30f);return{'appCode':appCode,'env':env,'total':_0x4fad00[_0x2c799c(0x104)],'datasets':_0x4fad00[_0x2c799c(0xf9)]};}
@@ -1 +1 @@
1
- function a16_0x175b(_0x3de681,_0x4f5db8){_0x3de681=_0x3de681-0x16c;const _0x24db2d=a16_0x24db();let _0x175b0f=_0x24db2d[_0x3de681];return _0x175b0f;}(function(_0x386e89,_0x2bce6a){const _0x211e88=a16_0x175b,_0x4cdb48=_0x386e89();while(!![]){try{const _0x59dd20=parseInt(_0x211e88(0x188))/0x1+-parseInt(_0x211e88(0x19e))/0x2+parseInt(_0x211e88(0x1aa))/0x3*(-parseInt(_0x211e88(0x1ae))/0x4)+-parseInt(_0x211e88(0x1b1))/0x5+parseInt(_0x211e88(0x17f))/0x6+-parseInt(_0x211e88(0x18c))/0x7*(-parseInt(_0x211e88(0x19a))/0x8)+-parseInt(_0x211e88(0x16e))/0x9*(-parseInt(_0x211e88(0x1a2))/0xa);if(_0x59dd20===_0x2bce6a)break;else _0x4cdb48['push'](_0x4cdb48['shift']());}catch(_0x2c66ae){_0x4cdb48['push'](_0x4cdb48['shift']());}}}(a16_0x24db,0xa6e72));import{DevApiClient}from'../api/dev-api-client.js';export async function listSqlQueries(_0x2cc93e={}){const _0x202ef4=a16_0x175b,{appCode:appCode=process[_0x202ef4(0x16c)][_0x202ef4(0x19c)],cookie:_0x587696,env:env=process[_0x202ef4(0x16c)][_0x202ef4(0x187)]||'online',keyword:_0x2c7836,category:_0x43e027,sqlCode:_0x4538e8,sqlName:_0x14a60d,pageSize:pageSize=0x3e7,currentPage:currentPage=0x1}=_0x2cc93e;if(!appCode)throw new Error(_0x202ef4(0x19b));const _0x3de749=new DevApiClient({'appCode':appCode,'cookie':_0x587696,'env':env});try{const _0x3b3bc4=await _0x3de749['getCustomSqlList']({'pageSize':pageSize,'currentPage':currentPage,'sqlCode':_0x4538e8,'sqlName':_0x14a60d}),_0x1d1731=_0x3b3bc4[_0x202ef4(0x199)]||_0x3b3bc4,_0xef7c31=_0x1d1731['tableData']||[],_0x212896=_0x1d1731['total']||_0xef7c31['length'];let _0x2cd52a=_0xef7c31['map'](_0x11fa83=>{const _0x58d740=_0x202ef4,_0x540c12=_0x11fa83[_0x58d740(0x1a1)]||appCode+'-'+(_0x11fa83['sqlId']||_0x11fa83['id']),_0x25e9ba=_0x11fa83['sqlId']||_0x11fa83['id'];let _0x1a3a1c;if(_0x11fa83[_0x58d740(0x1b0)]||_0x11fa83['sql']){const _0x2a6576=_0x11fa83[_0x58d740(0x1b0)]||_0x11fa83[_0x58d740(0x186)],_0x280385=_0x2a6576[_0x58d740(0x19f)](/[:$]\{?(\w+)\}?/g);if(_0x280385){const _0x3d18bf=Array[_0x58d740(0x185)](new Set(_0x280385[_0x58d740(0x19d)](_0x41e503=>_0x41e503[_0x58d740(0x192)](/[:${}]/g,''))));_0x1a3a1c=_0x3d18bf[_0x58d740(0x19d)](_0x30bd7c=>{const _0xbd61f5=_0x58d740;let _0x594f6f=_0xbd61f5(0x173);if(_0x30bd7c[_0xbd61f5(0x172)]()['includes'](_0xbd61f5(0x176))||_0x30bd7c[_0xbd61f5(0x172)]()['includes']('time'))_0x594f6f=_0xbd61f5(0x1a6);else{if(_0x30bd7c[_0xbd61f5(0x172)]()[_0xbd61f5(0x196)]('id'))_0x594f6f=0x7b;else(_0x30bd7c[_0xbd61f5(0x172)]()[_0xbd61f5(0x196)]('limit')||_0x30bd7c[_0xbd61f5(0x172)]()[_0xbd61f5(0x196)]('count'))&&(_0x594f6f=0xa);}return{'name':_0x30bd7c,'type':_0xbd61f5(0x1a4),'required':!![],'description':'Parameter:\x20'+_0x30bd7c,'example':_0x594f6f};});}}const _0x217958=_0x1a3a1c&&_0x1a3a1c[_0x58d740(0x178)]>0x0,_0x278e15=_0x217958?_0x1a3a1c[_0x58d740(0x183)]((_0x465401,_0x305dcc)=>({..._0x465401,[_0x305dcc['name']]:_0x305dcc[_0x58d740(0x184)]}),{}):undefined,_0x123ed1={'typescript':_0x58d740(0x1af)+appCode+_0x58d740(0x17a)+(env||_0x58d740(0x1ac))+_0x58d740(0x17c)+(_0x11fa83[_0x58d740(0x189)]||_0x11fa83[_0x58d740(0x1a9)]||_0x58d740(0x1a5))+_0x58d740(0x18b)+_0x540c12+'\x27'+(_0x217958?',\x20'+JSON[_0x58d740(0x17d)](_0x278e15,null,0x2):'')+');\x0a\x0a//\x20IMPORTANT:\x20Check\x20execution\x20status\x20before\x20using\x20results\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(`SQL\x20execution\x20failed:\x20${data.execError\x20||\x20\x27Unknown\x20error\x27}`);\x0a}\x0a\x0a//\x20Process\x20the\x20results\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0aconsole.log(`Retrieved\x20${results.length}\x20rows`);\x0a\x0a//\x20Use\x20the\x20data\x0aresults.forEach(row\x20=>\x20{\x0a\x20\x20console.log(row);\x0a});','description':'Execute\x20SQL\x20query:\x20'+(_0x11fa83['sqlName']||_0x11fa83['name']||_0x58d740(0x177)),'important':[_0x58d740(0x194),_0x58d740(0x16f),_0x217958?'This\x20SQL\x20requires\x20parameters:\x20'+_0x1a3a1c[_0x58d740(0x19d)](_0x2fbbf5=>_0x2fbbf5['name']+'\x20('+_0x2fbbf5['type']+')')[_0x58d740(0x193)](',\x20'):_0x58d740(0x1a0),_0x58d740(0x174),_0x58d740(0x18e)]},_0x323703={'sqlCode':_0x540c12,'sqlId':_0x25e9ba,'name':_0x11fa83['sqlName']||_0x11fa83[_0x58d740(0x1a9)]||_0x58d740(0x1a8)+_0x25e9ba,'description':_0x11fa83[_0x58d740(0x175)]||_0x11fa83['description'],'category':_0x11fa83[_0x58d740(0x198)]||_0x11fa83['sqlType']||'other','sqlContent':_0x11fa83[_0x58d740(0x1b0)]||_0x11fa83['sql'],'parameters':_0x1a3a1c,'createdTime':_0x11fa83[_0x58d740(0x195)]||_0x11fa83[_0x58d740(0x197)],'updatedTime':_0x11fa83[_0x58d740(0x1ab)]||_0x11fa83[_0x58d740(0x17b)],'codeExample':_0x123ed1};return _0x323703;});if(_0x2c7836){const _0x443108=_0x2c7836['toLowerCase']();_0x2cd52a=_0x2cd52a[_0x202ef4(0x18f)](_0x42eda4=>_0x42eda4['name'][_0x202ef4(0x172)]()[_0x202ef4(0x196)](_0x443108)||_0x42eda4[_0x202ef4(0x182)]&&_0x42eda4['description']['toLowerCase']()[_0x202ef4(0x196)](_0x443108)||_0x42eda4[_0x202ef4(0x1a1)][_0x202ef4(0x172)]()[_0x202ef4(0x196)](_0x443108)||_0x42eda4[_0x202ef4(0x1b0)]&&_0x42eda4['sqlContent']['toLowerCase']()['includes'](_0x443108));}_0x43e027&&_0x43e027!==_0x202ef4(0x180)&&(_0x2cd52a=_0x2cd52a[_0x202ef4(0x18f)](_0xaa6255=>_0xaa6255[_0x202ef4(0x198)]&&_0xaa6255[_0x202ef4(0x198)][_0x202ef4(0x172)]()===_0x43e027[_0x202ef4(0x172)]()));const _0x28979d=Math['ceil'](_0x2cd52a[_0x202ef4(0x178)]/pageSize),_0x227c51=_0x2cd52a[_0x202ef4(0x16d)]((currentPage-0x1)*pageSize,currentPage*pageSize),_0x3c1cfd=_0x227c51['length']>0x0?_0x227c51[0x0]:null,_0x35b6b6=_0x3c1cfd?_0x202ef4(0x1a3)+_0x3c1cfd[_0x202ef4(0x1a9)]+_0x202ef4(0x17e)+_0x3c1cfd[_0x202ef4(0x1a1)]+'\x27);\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);\x0a}\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];':'';return{'type':'sql_list','total':_0x2cd52a[_0x202ef4(0x178)],'sqls':_0x227c51,'pagination':{'currentPage':currentPage,'pageSize':pageSize,'totalPages':_0x28979d},'usage':{'description':_0x202ef4(0x1ad)+_0x2cd52a[_0x202ef4(0x178)]+_0x202ef4(0x179)+appCode+'.\x20Each\x20SQL\x20includes\x20a\x20complete\x20code\x20example\x20showing\x20how\x20to\x20execute\x20it\x20using\x20the\x20SDK.','important':[_0x202ef4(0x171),_0x202ef4(0x191),_0x202ef4(0x1a7),'IMPORTANT:\x20Use\x20try-catch\x20to\x20handle\x20HTTP\x20errors\x20(network\x20issues,\x20auth\x20failures)',_0x202ef4(0x170),'Each\x20SQL\x20query\x20above\x20includes\x20a\x20codeExample\x20field\x20with\x20complete\x20TypeScript\x20code\x20ready\x20to\x20use',_0x202ef4(0x181)],'example':_0x35b6b6||_0x202ef4(0x190)}};}catch(_0x367825){throw new Error(_0x202ef4(0x18a)+_0x367825[_0x202ef4(0x18d)]);}}function a16_0x24db(){const _0x213dbd=['10SIIdto','\x0a//\x20Example:\x20Using\x20SQL\x20\x22','string','SQL\x20Query','2024-01-01','IMPORTANT:\x20The\x20SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[],\x20execError?:\x20string\x20}','SQL-','name','75UIoEBs','updatedTime','online','Found\x20','126268WRMfxI','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27','sqlContent','5684255QmKtMp','env','slice','6236829FfvfUE','The\x20executeSql\x20method\x20accepts\x20two\x20parameters:\x20sqlCode\x20(string)\x20and\x20optional\x20params\x20(object)','IMPORTANT:\x20Business\x20logic\x20errors\x20(SQL\x20failures)\x20are\x20returned\x20in\x20data.execError,\x20not\x20thrown','IMPORTANT:\x20All\x20SQL\x20queries\x20use\x20the\x20same\x20execution\x20pattern\x20-\x20client.api.executeSql(sqlCode,\x20params)','toLowerCase','value','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20exception\x20-\x20use\x20try-catch\x20for\x20error\x20handling','sqlDesc','date','Custom\x20SQL','length','\x20SQL\x20queries\x20for\x20application\x20','\x27,\x0a\x20\x20env:\x20\x27','updateTime','\x27,\x0a});\x0a\x0a//\x20Execute\x20the\x20SQL\x20query:\x20','stringify','\x22\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27','6784992NeMmwv','all','For\x20more\x20customization,\x20use\x20generate_sql_code\x20tool\x20to\x20get\x20code\x20with\x20type\x20inference','description','reduce','example','from','sql','LOVRABET_ENV','150707NZsJXZ','sqlName','Failed\x20to\x20list\x20SQL\x20queries:\x20','\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27','1164072WLIUlR','message','The\x20execResult\x20contains\x20an\x20array\x20of\x20row\x20objects\x20matching\x20your\x20SQL\x20query\x20structure','filter','No\x20SQL\x20queries\x20found.\x20Check\x20your\x20appCode\x20and\x20authentication.','IMPORTANT:\x20Always\x20check\x20data.execSuccess\x20before\x20using\x20data.execResult','replace','join','SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[]\x20}\x20-\x20Always\x20check\x20execSuccess\x20before\x20using\x20execResult','createdTime','includes','createTime','category','data','64KXbqdZ','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','LOVRABET_APP_CODE','map','1390456pnzKMs','match','This\x20SQL\x20does\x20not\x20require\x20any\x20parameters','sqlCode'];a16_0x24db=function(){return _0x213dbd;};return a16_0x24db();}
1
+ (function(_0x291c7f,_0x418294){const _0x2d3d04=a16_0xa4df,_0x315491=_0x291c7f();while(!![]){try{const _0x3c7cdd=parseInt(_0x2d3d04(0xef))/0x1*(parseInt(_0x2d3d04(0x114))/0x2)+-parseInt(_0x2d3d04(0x135))/0x3+-parseInt(_0x2d3d04(0x10a))/0x4+parseInt(_0x2d3d04(0x113))/0x5*(parseInt(_0x2d3d04(0x12b))/0x6)+parseInt(_0x2d3d04(0x12c))/0x7*(-parseInt(_0x2d3d04(0x119))/0x8)+-parseInt(_0x2d3d04(0xf5))/0x9*(-parseInt(_0x2d3d04(0x127))/0xa)+parseInt(_0x2d3d04(0x11b))/0xb*(-parseInt(_0x2d3d04(0xed))/0xc);if(_0x3c7cdd===_0x418294)break;else _0x315491['push'](_0x315491['shift']());}catch(_0x5dc146){_0x315491['push'](_0x315491['shift']());}}}(a16_0x1bad,0x3145d));function a16_0xa4df(_0x24a3b5,_0x151a8e){_0x24a3b5=_0x24a3b5-0xec;const _0x1badd2=a16_0x1bad();let _0xa4dfc6=_0x1badd2[_0x24a3b5];return _0xa4dfc6;}import{DevApiClient}from'../api/dev-api-client.js';export async function listSqlQueries(_0x1a416c={}){const _0xa20d6a=a16_0xa4df,{appCode:appCode=process[_0xa20d6a(0x136)][_0xa20d6a(0x11f)],cookie:_0x524976,env:env=process[_0xa20d6a(0x136)][_0xa20d6a(0x100)]||'online',keyword:_0x358caf,category:_0x3d5712,sqlCode:_0x42067a,sqlName:_0x21399b,pageSize:pageSize=0x3e7,currentPage:currentPage=0x1}=_0x1a416c;if(!appCode)throw new Error(_0xa20d6a(0xf4));const _0x349af9=new DevApiClient({'appCode':appCode,'cookie':_0x524976,'env':env});try{const _0x40ca6e=await _0x349af9['getCustomSqlList']({'pageSize':pageSize,'currentPage':currentPage,'sqlCode':_0x42067a,'sqlName':_0x21399b}),_0x180ac6=_0x40ca6e[_0xa20d6a(0x10b)]||_0x40ca6e,_0x11767f=_0x180ac6[_0xa20d6a(0x11a)]||[],_0x59bc82=_0x180ac6[_0xa20d6a(0x11c)]||_0x11767f[_0xa20d6a(0xf6)];let _0x3287f4=_0x11767f[_0xa20d6a(0x116)](_0x4d7c8b=>{const _0x27b53a=_0xa20d6a,_0x44e08a=_0x4d7c8b[_0x27b53a(0x112)]||appCode+'-'+(_0x4d7c8b[_0x27b53a(0x126)]||_0x4d7c8b['id']),_0x3c0eb6=_0x4d7c8b['sqlId']||_0x4d7c8b['id'];let _0x5039da;if(_0x4d7c8b[_0x27b53a(0xf0)]||_0x4d7c8b[_0x27b53a(0x11d)]){const _0x4c63fe=_0x4d7c8b[_0x27b53a(0xf0)]||_0x4d7c8b[_0x27b53a(0x11d)],_0x5252e9=_0x4c63fe[_0x27b53a(0x105)](/[:$]\{?(\w+)\}?/g);if(_0x5252e9){const _0x17e51d=Array[_0x27b53a(0xec)](new Set(_0x5252e9[_0x27b53a(0x116)](_0x19bff4=>_0x19bff4['replace'](/[:${}]/g,''))));_0x5039da=_0x17e51d[_0x27b53a(0x116)](_0x1a7e1b=>{const _0x48912f=_0x27b53a;let _0x1b0049=_0x48912f(0x129);if(_0x1a7e1b[_0x48912f(0x103)]()[_0x48912f(0xfa)]('date')||_0x1a7e1b['toLowerCase']()[_0x48912f(0xfa)](_0x48912f(0x134)))_0x1b0049='2024-01-01';else{if(_0x1a7e1b[_0x48912f(0x103)]()['includes']('id'))_0x1b0049=0x7b;else(_0x1a7e1b[_0x48912f(0x103)]()['includes'](_0x48912f(0x107))||_0x1a7e1b[_0x48912f(0x103)]()['includes'](_0x48912f(0x12d)))&&(_0x1b0049=0xa);}return{'name':_0x1a7e1b,'type':_0x48912f(0x133),'required':!![],'description':_0x48912f(0x109)+_0x1a7e1b,'example':_0x1b0049};});}}const _0x4bc97f=_0x5039da&&_0x5039da['length']>0x0,_0x845271=_0x4bc97f?_0x5039da[_0x27b53a(0xee)]((_0x1ad3a6,_0x427885)=>({..._0x1ad3a6,[_0x427885[_0x27b53a(0xff)]]:_0x427885[_0x27b53a(0x131)]}),{}):undefined,_0x1ba234={'typescript':_0x27b53a(0x122)+appCode+_0x27b53a(0xf3)+(env||_0x27b53a(0xf9))+_0x27b53a(0x118)+(_0x4d7c8b[_0x27b53a(0x120)]||_0x4d7c8b['name']||_0x27b53a(0xf1))+'\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27'+_0x44e08a+'\x27'+(_0x4bc97f?',\x20'+JSON[_0x27b53a(0x130)](_0x845271,null,0x2):'')+_0x27b53a(0x106),'description':'Execute\x20SQL\x20query:\x20'+(_0x4d7c8b[_0x27b53a(0x120)]||_0x4d7c8b[_0x27b53a(0xff)]||_0x27b53a(0x125)),'important':[_0x27b53a(0x10e),_0x27b53a(0xfb),_0x4bc97f?_0x27b53a(0x104)+_0x5039da['map'](_0x3ac185=>_0x3ac185[_0x27b53a(0xff)]+'\x20('+_0x3ac185[_0x27b53a(0x128)]+')')[_0x27b53a(0x10f)](',\x20'):'This\x20SQL\x20does\x20not\x20require\x20any\x20parameters','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20exception\x20-\x20use\x20try-catch\x20for\x20error\x20handling','The\x20execResult\x20contains\x20an\x20array\x20of\x20row\x20objects\x20matching\x20your\x20SQL\x20query\x20structure']},_0x2bf523={'sqlCode':_0x44e08a,'sqlId':_0x3c0eb6,'name':_0x4d7c8b[_0x27b53a(0x120)]||_0x4d7c8b[_0x27b53a(0xff)]||_0x27b53a(0xfc)+_0x3c0eb6,'description':_0x4d7c8b[_0x27b53a(0x101)]||_0x4d7c8b[_0x27b53a(0x102)],'category':_0x4d7c8b[_0x27b53a(0x117)]||_0x4d7c8b[_0x27b53a(0x115)]||_0x27b53a(0x11e),'sqlContent':_0x4d7c8b[_0x27b53a(0xf0)]||_0x4d7c8b[_0x27b53a(0x11d)],'parameters':_0x5039da,'createdTime':_0x4d7c8b[_0x27b53a(0xfd)]||_0x4d7c8b[_0x27b53a(0x108)],'updatedTime':_0x4d7c8b[_0x27b53a(0x124)]||_0x4d7c8b[_0x27b53a(0xf2)],'codeExample':_0x1ba234};return _0x2bf523;});if(_0x358caf){const _0xcaedc=_0x358caf[_0xa20d6a(0x103)]();_0x3287f4=_0x3287f4[_0xa20d6a(0x110)](_0x15bb5f=>_0x15bb5f[_0xa20d6a(0xff)][_0xa20d6a(0x103)]()['includes'](_0xcaedc)||_0x15bb5f[_0xa20d6a(0x102)]&&_0x15bb5f['description'][_0xa20d6a(0x103)]()[_0xa20d6a(0xfa)](_0xcaedc)||_0x15bb5f[_0xa20d6a(0x112)][_0xa20d6a(0x103)]()[_0xa20d6a(0xfa)](_0xcaedc)||_0x15bb5f[_0xa20d6a(0xf0)]&&_0x15bb5f[_0xa20d6a(0xf0)][_0xa20d6a(0x103)]()[_0xa20d6a(0xfa)](_0xcaedc));}_0x3d5712&&_0x3d5712!==_0xa20d6a(0x111)&&(_0x3287f4=_0x3287f4['filter'](_0x1601ff=>_0x1601ff[_0xa20d6a(0x117)]&&_0x1601ff[_0xa20d6a(0x117)][_0xa20d6a(0x103)]()===_0x3d5712[_0xa20d6a(0x103)]()));const _0xb6c152=Math[_0xa20d6a(0x132)](_0x3287f4[_0xa20d6a(0xf6)]/pageSize),_0x6b18d=_0x3287f4['slice']((currentPage-0x1)*pageSize,currentPage*pageSize),_0x2b99af=_0x6b18d[_0xa20d6a(0xf6)]>0x0?_0x6b18d[0x0]:null,_0x5bfb2f=_0x2b99af?_0xa20d6a(0x121)+_0x2b99af[_0xa20d6a(0xff)]+'\x22\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27'+_0x2b99af['sqlCode']+_0xa20d6a(0xfe):'';return{'type':'sql_list','total':_0x3287f4[_0xa20d6a(0xf6)],'sqls':_0x6b18d,'pagination':{'currentPage':currentPage,'pageSize':pageSize,'totalPages':_0xb6c152},'usage':{'description':_0xa20d6a(0x12f)+_0x3287f4[_0xa20d6a(0xf6)]+'\x20SQL\x20queries\x20for\x20application\x20'+appCode+_0xa20d6a(0x123),'important':['IMPORTANT:\x20All\x20SQL\x20queries\x20use\x20the\x20same\x20execution\x20pattern\x20-\x20client.api.executeSql(sqlCode,\x20params)',_0xa20d6a(0x12a),'IMPORTANT:\x20The\x20SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[],\x20execError?:\x20string\x20}','IMPORTANT:\x20Use\x20try-catch\x20to\x20handle\x20HTTP\x20errors\x20(network\x20issues,\x20auth\x20failures)',_0xa20d6a(0x10c),_0xa20d6a(0xf7),_0xa20d6a(0xf8)],'example':_0x5bfb2f||_0xa20d6a(0x12e)}};}catch(_0x3db28b){throw new Error('Failed\x20to\x20list\x20SQL\x20queries:\x20'+_0x3db28b[_0xa20d6a(0x10d)]);}}function a16_0x1bad(){const _0x1cd6ef=['env','from','564kieRzg','reduce','1dxuWdo','sqlContent','SQL\x20Query','updateTime','\x27,\x0a\x20\x20env:\x20\x27','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','975411WTwXdO','length','Each\x20SQL\x20query\x20above\x20includes\x20a\x20codeExample\x20field\x20with\x20complete\x20TypeScript\x20code\x20ready\x20to\x20use','For\x20more\x20customization,\x20use\x20generate_sql_code\x20tool\x20to\x20get\x20code\x20with\x20type\x20inference','online','includes','The\x20executeSql\x20method\x20accepts\x20two\x20parameters:\x20sqlCode\x20(string)\x20and\x20optional\x20params\x20(object)','SQL-','createdTime','\x27);\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);\x0a}\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];','name','LOVRABET_ENV','sqlDesc','description','toLowerCase','This\x20SQL\x20requires\x20parameters:\x20','match',');\x0a\x0a//\x20IMPORTANT:\x20Check\x20execution\x20status\x20before\x20using\x20results\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(`SQL\x20execution\x20failed:\x20${data.execError\x20||\x20\x27Unknown\x20error\x27}`);\x0a}\x0a\x0a//\x20Process\x20the\x20results\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0aconsole.log(`Retrieved\x20${results.length}\x20rows`);\x0a\x0a//\x20Use\x20the\x20data\x0aresults.forEach(row\x20=>\x20{\x0a\x20\x20console.log(row);\x0a});','limit','createTime','Parameter:\x20','73104rKmDWf','data','IMPORTANT:\x20Business\x20logic\x20errors\x20(SQL\x20failures)\x20are\x20returned\x20in\x20data.execError,\x20not\x20thrown','message','SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[]\x20}\x20-\x20Always\x20check\x20execSuccess\x20before\x20using\x20execResult','join','filter','all','sqlCode','25CQIejk','535406xumNkR','sqlType','map','category','\x27,\x0a});\x0a\x0a//\x20Execute\x20the\x20SQL\x20query:\x20','5192LdwJQu','tableData','77473OspONW','total','sql','other','LOVRABET_APP_CODE','sqlName','\x0a//\x20Example:\x20Using\x20SQL\x20\x22','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27','.\x20Each\x20SQL\x20includes\x20a\x20complete\x20code\x20example\x20showing\x20how\x20to\x20execute\x20it\x20using\x20the\x20SDK.','updatedTime','Custom\x20SQL','sqlId','30eQVYkZ','type','value','IMPORTANT:\x20Always\x20check\x20data.execSuccess\x20before\x20using\x20data.execResult','304338XSgWUN','2541LhvvAO','count','No\x20SQL\x20queries\x20found.\x20Check\x20your\x20appCode\x20and\x20authentication.','Found\x20','stringify','example','ceil','string','time','179250NaGiYj'];a16_0x1bad=function(){return _0x1cd6ef;};return a16_0x1bad();}
@@ -1 +1 @@
1
- (function(_0x387c74,_0x3d2586){const _0xb0facf=a17_0x85eb,_0x196a46=_0x387c74();while(!![]){try{const _0x4d375d=-parseInt(_0xb0facf(0x1cb))/0x1*(parseInt(_0xb0facf(0x1d1))/0x2)+parseInt(_0xb0facf(0x1d9))/0x3*(-parseInt(_0xb0facf(0x1df))/0x4)+parseInt(_0xb0facf(0x1d5))/0x5*(parseInt(_0xb0facf(0x1cf))/0x6)+-parseInt(_0xb0facf(0x1e7))/0x7+-parseInt(_0xb0facf(0x1e5))/0x8+-parseInt(_0xb0facf(0x1dd))/0x9+parseInt(_0xb0facf(0x1dc))/0xa;if(_0x4d375d===_0x3d2586)break;else _0x196a46['push'](_0x196a46['shift']());}catch(_0x42caea){_0x196a46['push'](_0x196a46['shift']());}}}(a17_0x4817,0x7c5a9));function a17_0x85eb(_0x14a8f5,_0x58a45b){_0x14a8f5=_0x14a8f5-0x1c3;const _0x48176a=a17_0x4817();let _0x85eb8a=_0x48176a[_0x14a8f5];return _0x85eb8a;}import*as a17_0x22c24b from'node:https';function a17_0x4817(){const _0x15337b=['writeHead','message','Login\x20server\x20error','Failed\x20to\x20fetch\x20SSL\x20certificates\x20for\x20login\x20server','Login\x20successful\x20but\x20failed\x20to\x20save\x20cookie:\x20','end','\x20environment','headers','error','Already\x20logged\x20in\x20to\x20','26fTPlgN','/api/auth/get-session','</p>\x0a\x20\x20\x20\x20<p>Please\x20check\x20file\x20permissions\x20for\x20~/.lovrabet/cookie</p>\x0a\x20\x20</div>\x0a</body>\x0a</html>','https://g.yuntooai.com/cert/lovrabet-dev.json','139146rmEImK','https://dev.lovrabet.com:','3042yBVHcy','json','session','127.0.0.1','120PkgoNa','text/html;\x20charset=utf-8','listen','address','819pdVqWE','online','user','9150330XDdjAq','4392009HvyLjY','createServer','2708TGtukN','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>Login\x20Failed</title></head>\x0a<body>\x0a\x20\x20<div\x20style=\x22color:\x20red;\x22>\x0a\x20\x20\x20\x20<h2>Login\x20Successful,\x20but\x20Failed\x20to\x20Save\x20Cookie</h2>\x0a\x20\x20\x20\x20<p>Error:\x20','env','object','Internal\x20server\x20error','close','21864FapVSb','Please\x20open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20login:\x20','1730141cdskKd'];a17_0x4817=function(){return _0x15337b;};return a17_0x4817();}import{saveCookie}from'../auth/cookie-manager.js';import{isSessionValid}from'../auth/session-validator.js';import{getUserDomain}from'../auth/constants.js';export async function login(_0x52e3de={}){const _0x87dc3e=a17_0x85eb,_0x5d471c=_0x52e3de[_0x87dc3e(0x1e1)]||_0x87dc3e(0x1da);if(await isSessionValid(_0x5d471c))return{'success':!![],'message':_0x87dc3e(0x1ca)+_0x5d471c+_0x87dc3e(0x1c7),'env':_0x5d471c};let _0x494216;try{const _0x1cf28a=await fetch(_0x87dc3e(0x1ce));_0x494216=await _0x1cf28a[_0x87dc3e(0x1d2)]();}catch(_0x41c287){return{'success':![],'message':_0x87dc3e(0x1c4),'env':_0x5d471c};}return new Promise(_0x515142=>{const _0x300918=_0x87dc3e;let _0x4d79b7=0x0;const _0x141c3f=a17_0x22c24b[_0x300918(0x1de)](_0x494216,async(_0x1cbca6,_0x100668)=>{const _0xedbf83=_0x300918,_0x22d407=getUserDomain(_0x5d471c),_0x4b8b0d=_0x1cbca6[_0xedbf83(0x1c8)]['cookie']||'';try{const _0x2cfa95=await fetch(_0x22d407+_0xedbf83(0x1cc),{'headers':{'cookie':_0x4b8b0d}}),_0x42cf9f=await _0x2cfa95[_0xedbf83(0x1d2)](),_0x4ef6e8=_0x42cf9f&&_0x42cf9f[_0xedbf83(0x1d3)]&&_0x42cf9f[_0xedbf83(0x1db)];if(_0x4ef6e8){try{saveCookie(_0x4b8b0d);}catch(_0xb317f9){const _0x5be9a4=_0xedbf83(0x1e0)+_0xb317f9[_0xedbf83(0x1e9)]+_0xedbf83(0x1cd);_0x100668['writeHead'](0x1f4,{'Content-Type':_0xedbf83(0x1d6)}),_0x100668['end'](_0x5be9a4),_0x141c3f[_0xedbf83(0x1e4)](),_0x515142({'success':![],'message':_0xedbf83(0x1c5)+_0xb317f9['message'],'env':_0x5d471c});return;}const _0x44d1b5='<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>Login\x20Successful</title></head>\x0a<body>\x0a\x20\x20<div>Login\x20successful!\x20You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20your\x20vibe\x20editor.</div>\x0a\x20\x20<script>\x0a\x20\x20\x20\x20setTimeout(()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20},\x202000);\x0a\x20\x20</script>\x0a</body>\x0a</html>';_0x100668[_0xedbf83(0x1e8)](0xc8,{'Content-Type':_0xedbf83(0x1d6)}),_0x100668[_0xedbf83(0x1c6)](_0x44d1b5),_0x141c3f[_0xedbf83(0x1e4)](),_0x515142({'success':!![],'message':'Successfully\x20logged\x20in\x20to\x20'+_0x5d471c+_0xedbf83(0x1c7),'env':_0x5d471c});}else{const _0x4ff2f3=encodeURIComponent(_0xedbf83(0x1d0)+_0x4d79b7);_0x100668[_0xedbf83(0x1e8)](0x12e,{'location':_0x22d407+'/sign-in?redirect='+_0x4ff2f3}),_0x100668['end']();}}catch(_0x1cfb76){_0x100668[_0xedbf83(0x1e8)](0x1f4,{'Content-Type':'text/plain'}),_0x100668[_0xedbf83(0x1c6)](_0xedbf83(0x1e3)),_0x141c3f[_0xedbf83(0x1e4)](),_0x515142({'success':![],'message':_0xedbf83(0x1c3),'env':_0x5d471c});}});_0x141c3f[_0x300918(0x1d7)](0x0,_0x300918(0x1d4),()=>{const _0x595d96=_0x300918,_0xe78a3a=_0x141c3f[_0x595d96(0x1d8)]();_0x4d79b7=typeof _0xe78a3a===_0x595d96(0x1e2)&&_0xe78a3a?_0xe78a3a['port']:0x0;const _0x396cbf=_0x595d96(0x1d0)+_0x4d79b7;_0x515142({'success':![],'message':_0x595d96(0x1e6)+_0x396cbf,'loginUrl':_0x396cbf,'env':_0x5d471c});}),_0x141c3f['on'](_0x300918(0x1c9),_0x3cada5=>{_0x515142({'success':![],'message':'Login\x20server\x20error:\x20'+_0x3cada5['message'],'env':_0x5d471c});}),setTimeout(()=>{_0x141c3f['close'](),_0x515142({'success':![],'message':'Login\x20timeout\x20-\x20no\x20response\x20received\x20within\x205\x20minutes','env':_0x5d471c});},0x5*0x3c*0x3e8);});}
1
+ (function(_0xd658b6,_0x1c4ab2){const _0x44eda0=a17_0xb4d9,_0x3956c5=_0xd658b6();while(!![]){try{const _0x4ebe03=-parseInt(_0x44eda0(0xac))/0x1+parseInt(_0x44eda0(0xc0))/0x2*(-parseInt(_0x44eda0(0xb0))/0x3)+parseInt(_0x44eda0(0xab))/0x4+-parseInt(_0x44eda0(0xad))/0x5*(parseInt(_0x44eda0(0xa6))/0x6)+-parseInt(_0x44eda0(0xa1))/0x7*(-parseInt(_0x44eda0(0xaa))/0x8)+parseInt(_0x44eda0(0xa4))/0x9*(-parseInt(_0x44eda0(0xbc))/0xa)+-parseInt(_0x44eda0(0xbb))/0xb*(-parseInt(_0x44eda0(0xaf))/0xc);if(_0x4ebe03===_0x1c4ab2)break;else _0x3956c5['push'](_0x3956c5['shift']());}catch(_0x495232){_0x3956c5['push'](_0x3956c5['shift']());}}}(a17_0x4004,0x4ceab));function a17_0xb4d9(_0x471ed7,_0x57e6c2){_0x471ed7=_0x471ed7-0x9b;const _0x400463=a17_0x4004();let _0xb4d94d=_0x400463[_0x471ed7];return _0xb4d94d;}import*as a17_0x489a03 from'node:https';import{saveCookie}from'../auth/cookie-manager.js';function a17_0x4004(){const _0x4582d1=['298392EwgkIK','169657YXlSbn','5ugSlPT','object','1409196vfLpZW','57489vPWxmp','/sign-in?redirect=','Failed\x20to\x20fetch\x20SSL\x20certificates\x20for\x20login\x20server','listen','message','json','text/plain','https://dev.lovrabet.com:','close','error','</p>\x0a\x20\x20\x20\x20<p>Please\x20check\x20file\x20permissions\x20for\x20~/.lovrabet/cookie</p>\x0a\x20\x20</div>\x0a</body>\x0a</html>','88KnGOnm','10GsOmdd','writeHead','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>Login\x20Successful</title></head>\x0a<body>\x0a\x20\x20<div>Login\x20successful!\x20You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20your\x20vibe\x20editor.</div>\x0a\x20\x20<script>\x0a\x20\x20\x20\x20setTimeout(()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20},\x202000);\x0a\x20\x20</script>\x0a</body>\x0a</html>','session','2SVVVZC','user','Successfully\x20logged\x20in\x20to\x20','\x20environment','env','Login\x20timeout\x20-\x20no\x20response\x20received\x20within\x205\x20minutes','cookie','https://g.yuntooai.com/cert/lovrabet-dev.json','5880OtZCvi','end','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>Login\x20Failed</title></head>\x0a<body>\x0a\x20\x20<div\x20style=\x22color:\x20red;\x22>\x0a\x20\x20\x20\x20<h2>Login\x20Successful,\x20but\x20Failed\x20to\x20Save\x20Cookie</h2>\x0a\x20\x20\x20\x20<p>Error:\x20','1032462uVlehH','127.0.0.1','3295158cCRASY','Login\x20successful\x20but\x20failed\x20to\x20save\x20cookie:\x20','Login\x20server\x20error','text/html;\x20charset=utf-8','1464KAnhEj'];a17_0x4004=function(){return _0x4582d1;};return a17_0x4004();}import{isSessionValid}from'../auth/session-validator.js';import{getUserDomain}from'../auth/constants.js';export async function login(_0x1bfd63={}){const _0x1373b4=a17_0xb4d9,_0x35e33b=_0x1bfd63[_0x1373b4(0x9d)]||'online';if(await isSessionValid(_0x35e33b))return{'success':!![],'message':'Already\x20logged\x20in\x20to\x20'+_0x35e33b+'\x20environment','env':_0x35e33b};let _0x56aff6;try{const _0x3f2081=await fetch(_0x1373b4(0xa0));_0x56aff6=await _0x3f2081[_0x1373b4(0xb5)]();}catch(_0x3c988c){return{'success':![],'message':_0x1373b4(0xb2),'env':_0x35e33b};}return new Promise(_0x1a5548=>{const _0x461aca=_0x1373b4;let _0x49dcea=0x0;const _0xf9199c=a17_0x489a03['createServer'](_0x56aff6,async(_0x4e4f1b,_0x304c45)=>{const _0x2a3d35=a17_0xb4d9,_0x2fad9c=getUserDomain(_0x35e33b),_0x2faa55=_0x4e4f1b['headers'][_0x2a3d35(0x9f)]||'';try{const _0x28c05a=await fetch(_0x2fad9c+'/api/auth/get-session',{'headers':{'cookie':_0x2faa55}}),_0x386150=await _0x28c05a[_0x2a3d35(0xb5)](),_0x4de7d6=_0x386150&&_0x386150[_0x2a3d35(0xbf)]&&_0x386150[_0x2a3d35(0xc1)];if(_0x4de7d6){try{saveCookie(_0x2faa55);}catch(_0x24c3ae){const _0xc6999f=_0x2a3d35(0xa3)+_0x24c3ae[_0x2a3d35(0xb4)]+_0x2a3d35(0xba);_0x304c45[_0x2a3d35(0xbd)](0x1f4,{'Content-Type':_0x2a3d35(0xa9)}),_0x304c45[_0x2a3d35(0xa2)](_0xc6999f),_0xf9199c[_0x2a3d35(0xb8)](),_0x1a5548({'success':![],'message':_0x2a3d35(0xa7)+_0x24c3ae['message'],'env':_0x35e33b});return;}const _0x4c08f2=_0x2a3d35(0xbe);_0x304c45[_0x2a3d35(0xbd)](0xc8,{'Content-Type':_0x2a3d35(0xa9)}),_0x304c45[_0x2a3d35(0xa2)](_0x4c08f2),_0xf9199c[_0x2a3d35(0xb8)](),_0x1a5548({'success':!![],'message':_0x2a3d35(0x9b)+_0x35e33b+_0x2a3d35(0x9c),'env':_0x35e33b});}else{const _0x20a9da=encodeURIComponent('https://dev.lovrabet.com:'+_0x49dcea);_0x304c45['writeHead'](0x12e,{'location':_0x2fad9c+_0x2a3d35(0xb1)+_0x20a9da}),_0x304c45[_0x2a3d35(0xa2)]();}}catch(_0x1827de){_0x304c45['writeHead'](0x1f4,{'Content-Type':_0x2a3d35(0xb6)}),_0x304c45['end']('Internal\x20server\x20error'),_0xf9199c[_0x2a3d35(0xb8)](),_0x1a5548({'success':![],'message':_0x2a3d35(0xa8),'env':_0x35e33b});}});_0xf9199c[_0x461aca(0xb3)](0x0,_0x461aca(0xa5),()=>{const _0x24e388=_0x461aca,_0x27734c=_0xf9199c['address']();_0x49dcea=typeof _0x27734c===_0x24e388(0xae)&&_0x27734c?_0x27734c['port']:0x0;const _0x1873f2=_0x24e388(0xb7)+_0x49dcea;_0x1a5548({'success':![],'message':'Please\x20open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20login:\x20'+_0x1873f2,'loginUrl':_0x1873f2,'env':_0x35e33b});}),_0xf9199c['on'](_0x461aca(0xb9),_0x115ad2=>{const _0x2a0b1c=_0x461aca;_0x1a5548({'success':![],'message':'Login\x20server\x20error:\x20'+_0x115ad2[_0x2a0b1c(0xb4)],'env':_0x35e33b});}),setTimeout(()=>{const _0x238e11=_0x461aca;_0xf9199c['close'](),_0x1a5548({'success':![],'message':_0x238e11(0x9e),'env':_0x35e33b});},0x5*0x3c*0x3e8);});}
@@ -1 +1 @@
1
- (function(_0x4d0059,_0x4d47b9){const _0x3d9b3e=a18_0x367d,_0x3e5c8b=_0x4d0059();while(!![]){try{const _0x2e765f=-parseInt(_0x3d9b3e(0x19d))/0x1*(parseInt(_0x3d9b3e(0x19b))/0x2)+-parseInt(_0x3d9b3e(0x17a))/0x3*(parseInt(_0x3d9b3e(0x1a3))/0x4)+parseInt(_0x3d9b3e(0x18a))/0x5+parseInt(_0x3d9b3e(0x19f))/0x6*(parseInt(_0x3d9b3e(0x18c))/0x7)+parseInt(_0x3d9b3e(0x199))/0x8+-parseInt(_0x3d9b3e(0x1a9))/0x9+parseInt(_0x3d9b3e(0x1a8))/0xa;if(_0x2e765f===_0x4d47b9)break;else _0x3e5c8b['push'](_0x3e5c8b['shift']());}catch(_0x347900){_0x3e5c8b['push'](_0x3e5c8b['shift']());}}}(a18_0x191b,0xc187e));function a18_0x367d(_0x4c41ce,_0x2586c5){_0x4c41ce=_0x4c41ce-0x176;const _0x191be3=a18_0x191b();let _0x367d91=_0x191be3[_0x4c41ce];return _0x367d91;}function a18_0x191b(){const _0x35cccc=['sqlCode','ALTER\x5cs+(TABLE|DATABASE)','split','.\x20Only\x20SELECT\x20queries\x20are\x20allowed.','createdTime','EXEC','tableData','CREATE\x5cs+(TABLE|INDEX|DATABASE|VIEW)','GRANT','SELECT','REVOKE','env','data','toUpperCase','\x5c\x5cs+','7175685MtETiv','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','27356bhdUXY','Only\x20SELECT\x20queries\x20are\x20allowed.\x20The\x20SQL\x20must\x20start\x20with\x20SELECT\x20(after\x20any\x20comments).','UPDATE\x5cs+\x5cw+\x5cs+SET','Forbidden\x20keyword\x20detected:\x20','Failed\x20to\x20save\x20custom\x20SQL','TRUNCATE','SQL\x20validation\x20failed:\x20','sqlName','EXECUTE','name','trim','saveUserCustomSql','sqlContent\x20is\x20required\x20and\x20cannot\x20be\x20empty.','12030312opcJAh','errorMsg','14ayfiFC','Custom\x20SQL\x20saved\x20successfully','203937hesjvB','online','1050ouxIon','startsWith','replace','valid','124TzkUcC','verified','sql','dbId\x20is\x20required.\x20Get\x20it\x20from\x20get_dataset_detail\x20->\x20basic.database.dbId','createTime','12179370JGTygQ','12940947KqxzXZ','sqlContent','sqlName\x20is\x20required\x20and\x20cannot\x20be\x20empty.','string','success','find','DROP\x5cs+(TABLE|INDEX|DATABASE)','sqlId','message','SQL\x20content\x20cannot\x20be\x20empty','LOVRABET_APP_CODE','114447NucYZN'];a18_0x191b=function(){return _0x35cccc;};return a18_0x191b();}import{DevApiClient}from'../api/dev-api-client.js';function validateSelectSql(_0x19410b){const _0x2f230e=a18_0x367d;if(!_0x19410b||typeof _0x19410b!==_0x2f230e(0x1ac))return{'valid':![],'reason':_0x2f230e(0x178)};const _0x152933=_0x19410b['replace'](/#\{[^}]*\}/g,'?')[_0x2f230e(0x1a1)](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,''),_0x3196f7=_0x152933[_0x2f230e(0x196)](),_0x25d20f=_0x3196f7[_0x2f230e(0x17d)]('\x0a');let _0x5887d3='';for(const _0x213b7e of _0x25d20f){const _0x45739f=_0x213b7e['trim']();if(!_0x45739f||_0x45739f[_0x2f230e(0x1a0)]('--')||_0x45739f[_0x2f230e(0x1a0)]('/*'))continue;_0x5887d3=_0x45739f;break;}if(!_0x5887d3[_0x2f230e(0x188)]()[_0x2f230e(0x1a0)](_0x2f230e(0x184)))return{'valid':![],'reason':_0x2f230e(0x18d)};const _0x4893e3=['INSERT\x5cs+INTO',_0x2f230e(0x18e),'DELETE\x5cs+FROM',_0x2f230e(0x1af),_0x2f230e(0x17c),_0x2f230e(0x182),_0x2f230e(0x191),_0x2f230e(0x183),_0x2f230e(0x185),_0x2f230e(0x180),_0x2f230e(0x194)],_0x3cfa30=_0x3196f7[_0x2f230e(0x188)]();for(const _0x52ab38 of _0x4893e3){const _0x55683b=new RegExp(_0x52ab38,'i');if(_0x55683b['test'](_0x3cfa30))return{'valid':![],'reason':_0x2f230e(0x18f)+_0x52ab38[_0x2f230e(0x1a1)](_0x2f230e(0x189),'\x20')+_0x2f230e(0x17e)};}return{'valid':!![]};}export async function saveCustomSql(_0x54b0c2){const _0x13440a=a18_0x367d,{appCode:appCode=process['env'][_0x13440a(0x179)],cookie:_0x3f7742,env:env=process[_0x13440a(0x186)]['LOVRABET_ENV']||_0x13440a(0x19e),sqlName:_0x4e0095,dbId:_0x37f6e4,sqlContent:_0x2f2b1e,verifyAfterSave:verifyAfterSave=!![]}=_0x54b0c2;if(!appCode)throw new Error(_0x13440a(0x18b));if(!_0x4e0095||_0x4e0095['trim']()==='')throw new Error(_0x13440a(0x1ab));if(!_0x37f6e4)throw new Error(_0x13440a(0x1a6));if(!_0x2f2b1e||_0x2f2b1e['trim']()==='')throw new Error(_0x13440a(0x198));const _0x46fe82=validateSelectSql(_0x2f2b1e);if(!_0x46fe82[_0x13440a(0x1a2)])throw new Error(_0x13440a(0x192)+_0x46fe82['reason']);const _0x135b57=new DevApiClient({'appCode':appCode,'cookie':_0x3f7742,'env':env}),_0x10ebe0=_0x4e0095[_0x13440a(0x196)](),_0x543250=await _0x135b57[_0x13440a(0x197)]({'sqlName':_0x10ebe0,'dbId':_0x37f6e4,'sqlContent':_0x2f2b1e['trim']()});if(!_0x543250[_0x13440a(0x1ad)])return{'success':![],'message':_0x543250[_0x13440a(0x177)]||_0x543250[_0x13440a(0x19a)]||_0x13440a(0x190)};const _0x15bd52={'success':!![],'message':_0x13440a(0x19c),'data':_0x543250[_0x13440a(0x187)]};if(verifyAfterSave)try{const _0x5a476b=await _0x135b57['getCustomSqlList']({'pageSize':0xa,'currentPage':0x1,'sqlName':_0x10ebe0}),_0x48f869=_0x5a476b['data']?.[_0x13440a(0x181)]||[],_0x92cb10=_0x48f869[_0x13440a(0x1ae)](_0x49d70c=>_0x49d70c[_0x13440a(0x193)]===_0x10ebe0||_0x49d70c[_0x13440a(0x195)]===_0x10ebe0);_0x92cb10?_0x15bd52[_0x13440a(0x1a4)]={'found':!![],'sqlInfo':{'sqlCode':_0x92cb10[_0x13440a(0x17b)]||appCode+'-'+(_0x92cb10[_0x13440a(0x176)]||_0x92cb10['id']),'sqlId':_0x92cb10[_0x13440a(0x176)]||_0x92cb10['id'],'name':_0x92cb10[_0x13440a(0x193)]||_0x92cb10[_0x13440a(0x195)],'sqlContent':_0x92cb10[_0x13440a(0x1aa)]||_0x92cb10[_0x13440a(0x1a5)],'createdTime':_0x92cb10[_0x13440a(0x17f)]||_0x92cb10[_0x13440a(0x1a7)]}}:_0x15bd52['verified']={'found':![]};}catch(_0x815fc8){process['env']['NODE_ENV']!=='test'&&console['warn']('[saveCustomSql]\x20Verification\x20query\x20failed:',_0x815fc8),_0x15bd52[_0x13440a(0x1a4)]={'found':![]};}return _0x15bd52;}
1
+ (function(_0x9858cf,_0x2ea9f1){const _0x5f4018=a18_0x543e,_0x4838d2=_0x9858cf();while(!![]){try{const _0x2f1ae6=-parseInt(_0x5f4018(0x189))/0x1*(parseInt(_0x5f4018(0x164))/0x2)+parseInt(_0x5f4018(0x19c))/0x3*(parseInt(_0x5f4018(0x182))/0x4)+parseInt(_0x5f4018(0x188))/0x5+parseInt(_0x5f4018(0x175))/0x6+parseInt(_0x5f4018(0x17d))/0x7+-parseInt(_0x5f4018(0x16f))/0x8*(parseInt(_0x5f4018(0x19d))/0x9)+-parseInt(_0x5f4018(0x16a))/0xa*(parseInt(_0x5f4018(0x190))/0xb);if(_0x2f1ae6===_0x2ea9f1)break;else _0x4838d2['push'](_0x4838d2['shift']());}catch(_0x2114b2){_0x4838d2['push'](_0x4838d2['shift']());}}}(a18_0x375e,0x9e923));function a18_0x375e(){const _0x2096a9=['LOVRABET_APP_CODE','Custom\x20SQL\x20saved\x20successfully','find','139790wYiGoM','GRANT','success','\x5c\x5cs+','createdTime','376FOWuMZ','valid','name','sql','split','SQL\x20content\x20cannot\x20be\x20empty','3878580rMYhBe','DELETE\x5cs+FROM','online','verified','tableData','UPDATE\x5cs+\x5cw+\x5cs+SET','INSERT\x5cs+INTO','NODE_ENV','6068027xZTRqj','CREATE\x5cs+(TABLE|INDEX|DATABASE|VIEW)','.\x20Only\x20SELECT\x20queries\x20are\x20allowed.','sqlCode','Only\x20SELECT\x20queries\x20are\x20allowed.\x20The\x20SQL\x20must\x20start\x20with\x20SELECT\x20(after\x20any\x20comments).','24JOdTcU','reason','getCustomSqlList','env','DROP\x5cs+(TABLE|INDEX|DATABASE)','SQL\x20validation\x20failed:\x20','2997695JnFhaS','796054VUzPVV','startsWith','sqlContent','ALTER\x5cs+(TABLE|DATABASE)','EXEC','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','REVOKE','176DptrnN','errorMsg','toUpperCase','replace','test','trim','EXECUTE','LOVRABET_ENV','message','dbId\x20is\x20required.\x20Get\x20it\x20from\x20get_dataset_detail\x20->\x20basic.database.dbId','saveUserCustomSql','Failed\x20to\x20save\x20custom\x20SQL','268431QhVsHq','187749CiouLp','data','2CkoHDb','TRUNCATE','sqlId'];a18_0x375e=function(){return _0x2096a9;};return a18_0x375e();}import{DevApiClient}from'../api/dev-api-client.js';function a18_0x543e(_0x442eb6,_0x13c5fa){_0x442eb6=_0x442eb6-0x163;const _0x375e32=a18_0x375e();let _0x543ee1=_0x375e32[_0x442eb6];return _0x543ee1;}function validateSelectSql(_0x17a5a2){const _0x1d3b14=a18_0x543e;if(!_0x17a5a2||typeof _0x17a5a2!=='string')return{'valid':![],'reason':_0x1d3b14(0x174)};const _0x3a9648=_0x17a5a2['replace'](/#\{[^}]*\}/g,'?')[_0x1d3b14(0x193)](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,''),_0x1aa7a2=_0x3a9648[_0x1d3b14(0x195)](),_0x22856a=_0x1aa7a2[_0x1d3b14(0x173)]('\x0a');let _0x3d461c='';for(const _0x37b014 of _0x22856a){const _0x200e25=_0x37b014[_0x1d3b14(0x195)]();if(!_0x200e25||_0x200e25[_0x1d3b14(0x18a)]('--')||_0x200e25['startsWith']('/*'))continue;_0x3d461c=_0x200e25;break;}if(!_0x3d461c[_0x1d3b14(0x192)]()['startsWith']('SELECT'))return{'valid':![],'reason':_0x1d3b14(0x181)};const _0x55f2b7=[_0x1d3b14(0x17b),_0x1d3b14(0x17a),_0x1d3b14(0x176),_0x1d3b14(0x186),_0x1d3b14(0x18c),_0x1d3b14(0x17e),_0x1d3b14(0x165),_0x1d3b14(0x16b),_0x1d3b14(0x18f),_0x1d3b14(0x18d),_0x1d3b14(0x196)],_0x4f6f3e=_0x1aa7a2[_0x1d3b14(0x192)]();for(const _0xcdb231 of _0x55f2b7){const _0x3ec5b3=new RegExp(_0xcdb231,'i');if(_0x3ec5b3[_0x1d3b14(0x194)](_0x4f6f3e))return{'valid':![],'reason':'Forbidden\x20keyword\x20detected:\x20'+_0xcdb231[_0x1d3b14(0x193)](_0x1d3b14(0x16d),'\x20')+_0x1d3b14(0x17f)};}return{'valid':!![]};}export async function saveCustomSql(_0x2f4f04){const _0x376162=a18_0x543e,{appCode:appCode=process[_0x376162(0x185)][_0x376162(0x167)],cookie:_0x1d9519,env:env=process[_0x376162(0x185)][_0x376162(0x197)]||_0x376162(0x177),sqlName:_0x34ebd8,dbId:_0x3bd11d,sqlContent:_0x51c0fc,verifyAfterSave:verifyAfterSave=!![]}=_0x2f4f04;if(!appCode)throw new Error(_0x376162(0x18e));if(!_0x34ebd8||_0x34ebd8[_0x376162(0x195)]()==='')throw new Error('sqlName\x20is\x20required\x20and\x20cannot\x20be\x20empty.');if(!_0x3bd11d)throw new Error(_0x376162(0x199));if(!_0x51c0fc||_0x51c0fc[_0x376162(0x195)]()==='')throw new Error('sqlContent\x20is\x20required\x20and\x20cannot\x20be\x20empty.');const _0x30a64d=validateSelectSql(_0x51c0fc);if(!_0x30a64d[_0x376162(0x170)])throw new Error(_0x376162(0x187)+_0x30a64d[_0x376162(0x183)]);const _0x316d50=new DevApiClient({'appCode':appCode,'cookie':_0x1d9519,'env':env}),_0x32cd48=_0x34ebd8[_0x376162(0x195)](),_0x2c9d91=await _0x316d50[_0x376162(0x19a)]({'sqlName':_0x32cd48,'dbId':_0x3bd11d,'sqlContent':_0x51c0fc['trim']()});if(!_0x2c9d91[_0x376162(0x16c)])return{'success':![],'message':_0x2c9d91[_0x376162(0x198)]||_0x2c9d91[_0x376162(0x191)]||_0x376162(0x19b)};const _0x20ae99={'success':!![],'message':_0x376162(0x168),'data':_0x2c9d91[_0x376162(0x163)]};if(verifyAfterSave)try{const _0x1de589=await _0x316d50[_0x376162(0x184)]({'pageSize':0xa,'currentPage':0x1,'sqlName':_0x32cd48}),_0x7fd78=_0x1de589[_0x376162(0x163)]?.[_0x376162(0x179)]||[],_0x9c6461=_0x7fd78[_0x376162(0x169)](_0x5d0861=>_0x5d0861['sqlName']===_0x32cd48||_0x5d0861['name']===_0x32cd48);_0x9c6461?_0x20ae99['verified']={'found':!![],'sqlInfo':{'sqlCode':_0x9c6461[_0x376162(0x180)]||appCode+'-'+(_0x9c6461[_0x376162(0x166)]||_0x9c6461['id']),'sqlId':_0x9c6461[_0x376162(0x166)]||_0x9c6461['id'],'name':_0x9c6461['sqlName']||_0x9c6461[_0x376162(0x171)],'sqlContent':_0x9c6461[_0x376162(0x18b)]||_0x9c6461[_0x376162(0x172)],'createdTime':_0x9c6461[_0x376162(0x16e)]||_0x9c6461['createTime']}}:_0x20ae99[_0x376162(0x178)]={'found':![]};}catch(_0x38df24){process[_0x376162(0x185)][_0x376162(0x17c)]!==_0x376162(0x194)&&console['warn']('[saveCustomSql]\x20Verification\x20query\x20failed:',_0x38df24),_0x20ae99[_0x376162(0x178)]={'found':![]};}return _0x20ae99;}
@@ -1 +1 @@
1
- function a19_0x5a4d(_0x5bd316,_0x5cc51a){_0x5bd316=_0x5bd316-0x118;const _0x5eec2d=a19_0x5eec();let _0x5a4da1=_0x5eec2d[_0x5bd316];return _0x5a4da1;}(function(_0x46d319,_0x138156){const _0x29e64c=a19_0x5a4d,_0x418839=_0x46d319();while(!![]){try{const _0x92cc6=parseInt(_0x29e64c(0x137))/0x1+parseInt(_0x29e64c(0x141))/0x2*(parseInt(_0x29e64c(0x12b))/0x3)+-parseInt(_0x29e64c(0x136))/0x4+parseInt(_0x29e64c(0x12d))/0x5*(parseInt(_0x29e64c(0x11e))/0x6)+parseInt(_0x29e64c(0x15b))/0x7*(-parseInt(_0x29e64c(0x14a))/0x8)+parseInt(_0x29e64c(0x138))/0x9*(parseInt(_0x29e64c(0x156))/0xa)+-parseInt(_0x29e64c(0x151))/0xb*(parseInt(_0x29e64c(0x124))/0xc);if(_0x92cc6===_0x138156)break;else _0x418839['push'](_0x418839['shift']());}catch(_0x85fd5e){_0x418839['push'](_0x418839['shift']());}}}(a19_0x5eec,0x2cfca));import{DevApiClient}from'../api/dev-api-client.js';import{validateIsSelectOnly,parseSqlStructure,generateSqlSummary}from'../utils/sql-parser.js';export async function saveOrUpdateCustomSql(_0x4f80db){const _0x2241a3=a19_0x5a4d,_0x53b2ce=Date['now'](),{appCode:appCode=process['env'][_0x2241a3(0x11b)],cookie:_0x318bb5,env:env=process['env'][_0x2241a3(0x143)]||'online',sqlName:_0x3305d5,dbId:_0x3b9c8d,sqlContent:_0x344484,id:_0x5381cc,sqlCode:_0x46a86d,verifyAfterSave:verifyAfterSave=!![],validateSchema:validateSchema=![]}=_0x4f80db;if(!appCode)throw new Error(_0x2241a3(0x130));if(!_0x3305d5||_0x3305d5[_0x2241a3(0x12a)]()==='')throw new Error(_0x2241a3(0x139));if(!_0x3b9c8d)throw new Error(_0x2241a3(0x119));if(!_0x344484||_0x344484['trim']()==='')throw new Error(_0x2241a3(0x159));const _0x2f09c6=_0x5381cc!==undefined&&_0x5381cc>0x0||_0x46a86d!==undefined&&_0x46a86d[_0x2241a3(0x12a)]()!=='';if(_0x2f09c6){if(!_0x5381cc)throw new Error(_0x2241a3(0x118));if(!_0x46a86d)throw new Error(_0x2241a3(0x157));}const _0x1331e2=validateIsSelectOnly(_0x344484);if(!_0x1331e2[_0x2241a3(0x142)])throw new Error(_0x2241a3(0x145)+_0x1331e2['reason']);const _0x278dfa=parseSqlStructure(_0x344484),_0x9e44e3=generateSqlSummary(_0x344484),_0xc7958d=new DevApiClient({'appCode':appCode,'cookie':_0x318bb5,'env':env}),_0x2d40c0=_0x3305d5[_0x2241a3(0x12a)]();let _0x2b5731;_0x2f09c6?_0x2b5731=await _0xc7958d[_0x2241a3(0x12e)]({'id':_0x5381cc,'sqlCode':_0x46a86d[_0x2241a3(0x12a)](),'sqlName':_0x2d40c0,'dbId':_0x3b9c8d,'sqlContent':_0x344484[_0x2241a3(0x12a)]()}):_0x2b5731=await _0xc7958d[_0x2241a3(0x126)]({'sqlName':_0x2d40c0,'dbId':_0x3b9c8d,'sqlContent':_0x344484[_0x2241a3(0x12a)]()});const _0x1e08ed=Date['now']()-_0x53b2ce;if(!_0x2b5731[_0x2241a3(0x132)])return{'success':![],'action':_0x2f09c6?'updated':_0x2241a3(0x12f),'message':_0x2b5731[_0x2241a3(0x14b)]||_0x2b5731[_0x2241a3(0x13b)]||_0x2241a3(0x128)+(_0x2f09c6?_0x2241a3(0x155):_0x2241a3(0x149))+_0x2241a3(0x121),'nextSteps':[{'action':_0x2241a3(0x135),'tool':'login','reason':_0x2241a3(0x13a)},{'action':_0x2241a3(0x147),'tool':_0x2241a3(0x14c),'params':{'datasetCode':'<dataset-code>'},'reason':_0x2241a3(0x133)}]};const _0x29d194=_0x2b5731[_0x2241a3(0x13f)]?.[_0x2241a3(0x14f)]||_0x2b5731[_0x2241a3(0x13f)]?.[_0x2241a3(0x129)],_0xa819b7=_0x2b5731[_0x2241a3(0x13f)]?.[_0x2241a3(0x146)]||_0x2b5731[_0x2241a3(0x13f)]?.['id'],_0xa0b8f0=[{'action':_0x2241a3(0x11d),'tool':_0x2241a3(0x152),'params':{'sqlCode':_0x29d194||''},'reason':_0x2241a3(0x11c),'priority':_0x2241a3(0x15c)},{'action':_0x2241a3(0x122),'tool':_0x2241a3(0x158),'params':{'sqlCode':_0x29d194||''},'reason':_0x2241a3(0x144),'priority':_0x2241a3(0x13c)}],_0x57c66a={'success':!![],'action':_0x2f09c6?_0x2241a3(0x120):'created','message':_0x2f09c6?_0x2241a3(0x15e)+_0x2d40c0+_0x2241a3(0x14e)+_0x9e44e3+')':_0x2241a3(0x15e)+_0x2d40c0+_0x2241a3(0x11a)+_0x9e44e3+')','nextSteps':_0xa0b8f0,'parsedStructure':{'tables':_0x278dfa['tables'],'columns':_0x278dfa[_0x2241a3(0x11f)]['length'],'parameters':_0x278dfa['parameters'],'summary':_0x9e44e3},'data':_0x2b5731[_0x2241a3(0x13f)]};if(verifyAfterSave)try{const _0x47644f=await _0xc7958d['getCustomSqlList']({'pageSize':0xa,'currentPage':0x1,'sqlName':_0x2d40c0}),_0x286b5d=_0x47644f[_0x2241a3(0x13f)]?.['tableData']||[],_0x119c48=_0x286b5d[_0x2241a3(0x12c)](_0x1cb5da=>_0x1cb5da[_0x2241a3(0x125)]===_0x2d40c0||_0x1cb5da[_0x2241a3(0x131)]===_0x2d40c0);_0x119c48?(_0x57c66a[_0x2241a3(0x127)]={'found':!![],'sqlInfo':{'sqlCode':_0x119c48['sqlCode']||appCode+'-'+(_0x119c48['sqlId']||_0x119c48['id']),'sqlId':_0x119c48['sqlId']||_0x119c48['id'],'id':_0x119c48['id'],'name':_0x119c48['sqlName']||_0x119c48[_0x2241a3(0x131)],'sqlContent':_0x119c48[_0x2241a3(0x153)]||_0x119c48['sql'],'createdTime':_0x119c48[_0x2241a3(0x15a)]||_0x119c48[_0x2241a3(0x150)],'updatedTime':_0x119c48[_0x2241a3(0x140)]||_0x119c48[_0x2241a3(0x13d)]}},_0x57c66a['verified'][_0x2241a3(0x123)]?.[_0x2241a3(0x14f)]&&(_0xa0b8f0[0x0][_0x2241a3(0x13e)]={'sqlCode':_0x57c66a[_0x2241a3(0x127)][_0x2241a3(0x123)][_0x2241a3(0x14f)]},_0xa0b8f0[0x1][_0x2241a3(0x13e)]={'sqlCode':_0x57c66a[_0x2241a3(0x127)][_0x2241a3(0x123)][_0x2241a3(0x14f)]})):_0x57c66a[_0x2241a3(0x127)]={'found':![]};}catch(_0x1e2b23){process[_0x2241a3(0x154)][_0x2241a3(0x14d)]!==_0x2241a3(0x15d)&&console[_0x2241a3(0x134)](_0x2241a3(0x148),_0x1e2b23),_0x57c66a[_0x2241a3(0x127)]={'found':![]};}return _0x57c66a;}function a19_0x5eec(){const _0x150e82=['sqlContent\x20is\x20required\x20and\x20cannot\x20be\x20empty.','createdTime','203vGMFss','high','test','Custom\x20SQL\x20\x22','id\x20is\x20required\x20for\x20updating\x20existing\x20SQL.','dbId\x20is\x20required.\x20Get\x20it\x20from\x20get_dataset_detail\x20->\x20basic.database.dbId','\x22\x20saved\x20successfully\x20(','LOVRABET_APP_CODE','Execute\x20the\x20SQL\x20to\x20check\x20for\x20runtime\x20errors','Test\x20the\x20SQL\x20to\x20verify\x20it\x20works\x20correctly','36vANkoq','columns','updated','\x20custom\x20SQL','Generate\x20SDK\x20code\x20for\x20this\x20SQL','sqlInfo','240KGJBdr','sqlName','saveUserCustomSql','verified','Failed\x20to\x20','code','trim','651lHQAwj','find','154640GKIAAI','updateUserCustomSql','created','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','name','success','Confirm\x20the\x20dbId\x20matches\x20the\x20database\x20you\x20want\x20to\x20use','warn','Check\x20database\x20connection\x20and\x20permissions','1262368bNYSGB','220368KijPso','1738611fxCdSX','sqlName\x20is\x20required\x20and\x20cannot\x20be\x20empty.','Ensure\x20you\x20are\x20logged\x20in\x20with\x20proper\x20permissions','errorMsg','medium','updateTime','params','data','updatedTime','2870cybBMD','valid','LOVRABET_ENV','Get\x20ready-to-use\x20TypeScript\x20code\x20for\x20your\x20application','SQL\x20validation\x20failed:\x20','sqlId','Verify\x20database\x20ID\x20is\x20correct','[saveOrUpdateCustomSql]\x20Verification\x20query\x20failed:','save','75904mabcri','message','get_dataset_detail','NODE_ENV','\x22\x20updated\x20successfully\x20(','sqlCode','createTime','74525iuoFiu','execute_custom_sql','sqlContent','env','update','10TUBBhw','sqlCode\x20is\x20required\x20for\x20updating\x20existing\x20SQL.','generate_sql_code'];a19_0x5eec=function(){return _0x150e82;};return a19_0x5eec();}
1
+ (function(_0xfe23e7,_0x31be6d){const _0x45f1d3=a19_0x59b4,_0xf99084=_0xfe23e7();while(!![]){try{const _0x3975d3=-parseInt(_0x45f1d3(0x103))/0x1+-parseInt(_0x45f1d3(0xff))/0x2*(parseInt(_0x45f1d3(0xf7))/0x3)+parseInt(_0x45f1d3(0xf8))/0x4*(parseInt(_0x45f1d3(0xf0))/0x5)+-parseInt(_0x45f1d3(0x11a))/0x6*(-parseInt(_0x45f1d3(0xf5))/0x7)+-parseInt(_0x45f1d3(0xf6))/0x8+-parseInt(_0x45f1d3(0xfb))/0x9+parseInt(_0x45f1d3(0xec))/0xa;if(_0x3975d3===_0x31be6d)break;else _0xf99084['push'](_0xf99084['shift']());}catch(_0x2dd733){_0xf99084['push'](_0xf99084['shift']());}}}(a19_0x4754,0x55272));import{DevApiClient}from'../api/dev-api-client.js';function a19_0x59b4(_0x19c1d9,_0x42490b){_0x19c1d9=_0x19c1d9-0xda;const _0x47540b=a19_0x4754();let _0x59b4e5=_0x47540b[_0x19c1d9];return _0x59b4e5;}function a19_0x4754(){const _0x4d225=['sql','created','Custom\x20SQL\x20\x22','tableData','update','env','updateUserCustomSql','generate_sql_code','code','12228340oVQDMh','Failed\x20to\x20','[saveOrUpdateCustomSql]\x20Verification\x20query\x20failed:','test','11945LvnzrO','params','parameters','trim','now','7StwPbK','2034152fsCLrs','3EqSLdt','904QfNKLe','Check\x20database\x20connection\x20and\x20permissions','\x20custom\x20SQL','1689696ZaxppK','NODE_ENV','Get\x20ready-to-use\x20TypeScript\x20code\x20for\x20your\x20application','online','1121012etawUR','sqlCode\x20is\x20required\x20for\x20updating\x20existing\x20SQL.','Ensure\x20you\x20are\x20logged\x20in\x20with\x20proper\x20permissions','sqlInfo','507379JefEnI','Confirm\x20the\x20dbId\x20matches\x20the\x20database\x20you\x20want\x20to\x20use','saveUserCustomSql','success','\x22\x20saved\x20successfully\x20(','sqlCode','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','sqlId','dbId\x20is\x20required.\x20Get\x20it\x20from\x20get_dataset_detail\x20->\x20basic.database.dbId','Generate\x20SDK\x20code\x20for\x20this\x20SQL','Test\x20the\x20SQL\x20to\x20verify\x20it\x20works\x20correctly','LOVRABET_APP_CODE','<dataset-code>','login','getCustomSqlList','data','save','verified','Execute\x20the\x20SQL\x20to\x20check\x20for\x20runtime\x20errors','createdTime','columns','createTime','updatedTime','575616JbXHTB','reason','id\x20is\x20required\x20for\x20updating\x20existing\x20SQL.','execute_custom_sql','sqlName','high','warn','medium','name','\x22\x20updated\x20successfully\x20(','tables','find','Verify\x20database\x20ID\x20is\x20correct','updated'];a19_0x4754=function(){return _0x4d225;};return a19_0x4754();}import{validateIsSelectOnly,parseSqlStructure,generateSqlSummary}from'../utils/sql-parser.js';export async function saveOrUpdateCustomSql(_0x2f100a){const _0x109a93=a19_0x59b4,_0x11ec87=Date[_0x109a93(0xf4)](),{appCode:appCode=process[_0x109a93(0xe8)][_0x109a93(0x10e)],cookie:_0x4a17d0,env:env=process[_0x109a93(0xe8)]['LOVRABET_ENV']||_0x109a93(0xfe),sqlName:_0x345712,dbId:_0x1f6297,sqlContent:_0xe3da24,id:_0xffd814,sqlCode:_0xed1cb7,verifyAfterSave:verifyAfterSave=!![],validateSchema:validateSchema=![]}=_0x2f100a;if(!appCode)throw new Error(_0x109a93(0x109));if(!_0x345712||_0x345712[_0x109a93(0xf3)]()==='')throw new Error('sqlName\x20is\x20required\x20and\x20cannot\x20be\x20empty.');if(!_0x1f6297)throw new Error(_0x109a93(0x10b));if(!_0xe3da24||_0xe3da24[_0x109a93(0xf3)]()==='')throw new Error('sqlContent\x20is\x20required\x20and\x20cannot\x20be\x20empty.');const _0x5c2dee=_0xffd814!==undefined&&_0xffd814>0x0||_0xed1cb7!==undefined&&_0xed1cb7['trim']()!=='';if(_0x5c2dee){if(!_0xffd814)throw new Error(_0x109a93(0x11c));if(!_0xed1cb7)throw new Error(_0x109a93(0x100));}const _0x36e49d=validateIsSelectOnly(_0xe3da24);if(!_0x36e49d['valid'])throw new Error('SQL\x20validation\x20failed:\x20'+_0x36e49d[_0x109a93(0x11b)]);const _0x37690b=parseSqlStructure(_0xe3da24),_0x23f5dc=generateSqlSummary(_0xe3da24),_0x3fa062=new DevApiClient({'appCode':appCode,'cookie':_0x4a17d0,'env':env}),_0x4cfcc8=_0x345712['trim']();let _0x5dbe96;_0x5c2dee?_0x5dbe96=await _0x3fa062[_0x109a93(0xe9)]({'id':_0xffd814,'sqlCode':_0xed1cb7[_0x109a93(0xf3)](),'sqlName':_0x4cfcc8,'dbId':_0x1f6297,'sqlContent':_0xe3da24[_0x109a93(0xf3)]()}):_0x5dbe96=await _0x3fa062[_0x109a93(0x105)]({'sqlName':_0x4cfcc8,'dbId':_0x1f6297,'sqlContent':_0xe3da24[_0x109a93(0xf3)]()});const _0x209335=Date['now']()-_0x11ec87;if(!_0x5dbe96[_0x109a93(0x106)])return{'success':![],'action':_0x5c2dee?_0x109a93(0xe2):_0x109a93(0xe4),'message':_0x5dbe96['message']||_0x5dbe96['errorMsg']||_0x109a93(0xed)+(_0x5c2dee?_0x109a93(0xe7):_0x109a93(0x113))+_0x109a93(0xfa),'nextSteps':[{'action':_0x109a93(0xf9),'tool':_0x109a93(0x110),'reason':_0x109a93(0x101)},{'action':_0x109a93(0xe1),'tool':'get_dataset_detail','params':{'datasetCode':_0x109a93(0x10f)},'reason':_0x109a93(0x104)}]};const _0x40d6ee=_0x5dbe96[_0x109a93(0x112)]?.[_0x109a93(0x108)]||_0x5dbe96[_0x109a93(0x112)]?.[_0x109a93(0xeb)],_0x1b293a=_0x5dbe96[_0x109a93(0x112)]?.[_0x109a93(0x10a)]||_0x5dbe96[_0x109a93(0x112)]?.['id'],_0xdf08a1=[{'action':_0x109a93(0x10d),'tool':_0x109a93(0x11d),'params':{'sqlCode':_0x40d6ee||''},'reason':_0x109a93(0x115),'priority':_0x109a93(0xda)},{'action':_0x109a93(0x10c),'tool':_0x109a93(0xea),'params':{'sqlCode':_0x40d6ee||''},'reason':_0x109a93(0xfd),'priority':_0x109a93(0xdc)}],_0x243956={'success':!![],'action':_0x5c2dee?'updated':_0x109a93(0xe4),'message':_0x5c2dee?_0x109a93(0xe5)+_0x4cfcc8+_0x109a93(0xde)+_0x23f5dc+')':_0x109a93(0xe5)+_0x4cfcc8+_0x109a93(0x107)+_0x23f5dc+')','nextSteps':_0xdf08a1,'parsedStructure':{'tables':_0x37690b[_0x109a93(0xdf)],'columns':_0x37690b[_0x109a93(0x117)]['length'],'parameters':_0x37690b[_0x109a93(0xf2)],'summary':_0x23f5dc},'data':_0x5dbe96[_0x109a93(0x112)]};if(verifyAfterSave)try{const _0x13bf59=await _0x3fa062[_0x109a93(0x111)]({'pageSize':0xa,'currentPage':0x1,'sqlName':_0x4cfcc8}),_0x30a7ea=_0x13bf59[_0x109a93(0x112)]?.[_0x109a93(0xe6)]||[],_0x2b8130=_0x30a7ea[_0x109a93(0xe0)](_0x27f6e3=>_0x27f6e3[_0x109a93(0x11e)]===_0x4cfcc8||_0x27f6e3['name']===_0x4cfcc8);_0x2b8130?(_0x243956[_0x109a93(0x114)]={'found':!![],'sqlInfo':{'sqlCode':_0x2b8130[_0x109a93(0x108)]||appCode+'-'+(_0x2b8130[_0x109a93(0x10a)]||_0x2b8130['id']),'sqlId':_0x2b8130[_0x109a93(0x10a)]||_0x2b8130['id'],'id':_0x2b8130['id'],'name':_0x2b8130['sqlName']||_0x2b8130[_0x109a93(0xdd)],'sqlContent':_0x2b8130['sqlContent']||_0x2b8130[_0x109a93(0xe3)],'createdTime':_0x2b8130[_0x109a93(0x116)]||_0x2b8130[_0x109a93(0x118)],'updatedTime':_0x2b8130[_0x109a93(0x119)]||_0x2b8130['updateTime']}},_0x243956['verified']['sqlInfo']?.['sqlCode']&&(_0xdf08a1[0x0][_0x109a93(0xf1)]={'sqlCode':_0x243956[_0x109a93(0x114)][_0x109a93(0x102)][_0x109a93(0x108)]},_0xdf08a1[0x1][_0x109a93(0xf1)]={'sqlCode':_0x243956[_0x109a93(0x114)][_0x109a93(0x102)][_0x109a93(0x108)]})):_0x243956['verified']={'found':![]};}catch(_0x4366b1){process[_0x109a93(0xe8)][_0x109a93(0xfc)]!==_0x109a93(0xef)&&console[_0x109a93(0xdb)](_0x109a93(0xee),_0x4366b1),_0x243956[_0x109a93(0x114)]={'found':![]};}return _0x243956;}
@@ -1 +1 @@
1
- function a20_0x2684(){const _0x594526=['378ejgKOx','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','2631948HBgqqc','name','env','code','37012UiVrvG','datasets','35YOocmu','map','570498PlTOny','364337YwLenV','tableName','description','2507046OblzDl','total','keyword\x20is\x20required','4120HLbUfu','219DERtth','321460tPKCaV','18802GBiNvm'];a20_0x2684=function(){return _0x594526;};return a20_0x2684();}(function(_0x3eff68,_0x16cc66){const _0x27515f=a20_0x1341,_0x3646aa=_0x3eff68();while(!![]){try{const _0x27c0e1=-parseInt(_0x27515f(0x18d))/0x1+parseInt(_0x27515f(0x17b))/0x2+-parseInt(_0x27515f(0x17f))/0x3*(-parseInt(_0x27515f(0x188))/0x4)+-parseInt(_0x27515f(0x18a))/0x5*(parseInt(_0x27515f(0x18c))/0x6)+-parseInt(_0x27515f(0x181))/0x7*(-parseInt(_0x27515f(0x17e))/0x8)+-parseInt(_0x27515f(0x182))/0x9*(parseInt(_0x27515f(0x180))/0xa)+-parseInt(_0x27515f(0x184))/0xb;if(_0x27c0e1===_0x16cc66)break;else _0x3646aa['push'](_0x3646aa['shift']());}catch(_0x1f92b6){_0x3646aa['push'](_0x3646aa['shift']());}}}(a20_0x2684,0xa92e4));import{DevApiClient}from'../api/dev-api-client.js';import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';function a20_0x1341(_0x387690,_0x2ad664){_0x387690=_0x387690-0x17a;const _0x26844d=a20_0x2684();let _0x1341e6=_0x26844d[_0x387690];return _0x1341e6;}export async function searchDatasets(_0x225ac8){const _0x26e4ad=a20_0x1341,{appCode:appCode=process[_0x26e4ad(0x186)]['LOVRABET_APP_CODE'],cookie:_0x39d12b,env:env=process['env']['LOVRABET_ENV']||'online',keyword:_0x7bd6ae}=_0x225ac8;if(!appCode)throw new Error(_0x26e4ad(0x183));if(!_0x7bd6ae)throw new Error(_0x26e4ad(0x17d));const _0x2ff551=new DevApiClient({'appCode':appCode,'cookie':_0x39d12b,'env':env}),_0x36765e=await _0x2ff551['searchDatasets'](_0x7bd6ae),_0x4d8206=new DatasetAnalyzer(),_0x2441e2=_0x4d8206['analyzeDatasetList'](_0x36765e);return{'appCode':appCode,'env':env,'keyword':_0x7bd6ae,'total':_0x2441e2[_0x26e4ad(0x17c)],'datasets':_0x2441e2[_0x26e4ad(0x189)][_0x26e4ad(0x18b)](_0x33e007=>({'id':_0x33e007['id'],'name':_0x33e007[_0x26e4ad(0x185)],'code':_0x33e007[_0x26e4ad(0x187)],'tableName':_0x33e007[_0x26e4ad(0x18e)],'description':_0x33e007[_0x26e4ad(0x17a)]}))};}
1
+ (function(_0x47cbae,_0x55ed7f){const _0x3c0a86=a20_0x4c4b,_0x1778d1=_0x47cbae();while(!![]){try{const _0x4b3a58=parseInt(_0x3c0a86(0x1bf))/0x1*(parseInt(_0x3c0a86(0x1be))/0x2)+-parseInt(_0x3c0a86(0x1c0))/0x3*(parseInt(_0x3c0a86(0x1c8))/0x4)+parseInt(_0x3c0a86(0x1c5))/0x5+parseInt(_0x3c0a86(0x1c2))/0x6+parseInt(_0x3c0a86(0x1ca))/0x7+parseInt(_0x3c0a86(0x1bd))/0x8*(parseInt(_0x3c0a86(0x1cb))/0x9)+-parseInt(_0x3c0a86(0x1cc))/0xa;if(_0x4b3a58===_0x55ed7f)break;else _0x1778d1['push'](_0x1778d1['shift']());}catch(_0x4e2afb){_0x1778d1['push'](_0x1778d1['shift']());}}}(a20_0x5f47,0x5f4d6));import{DevApiClient}from'../api/dev-api-client.js';function a20_0x5f47(){const _0x188e2c=['LOVRABET_ENV','106323WVwmUj','9VBSLly','7159930rYOkWT','searchDatasets','env','analyzeDatasetList','LOVRABET_APP_CODE','4247528dxKWCl','6126QVgVgH','162ypBxyH','638961DYDSHC','tableName','1345554aaeMeW','code','map','263715jNNgXL','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','total','4fyLiuQ'];a20_0x5f47=function(){return _0x188e2c;};return a20_0x5f47();}function a20_0x4c4b(_0xc9c8cb,_0x587b0b){_0xc9c8cb=_0xc9c8cb-0x1b9;const _0x5f47a3=a20_0x5f47();let _0x4c4b37=_0x5f47a3[_0xc9c8cb];return _0x4c4b37;}import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function searchDatasets(_0x98de5a){const _0x7f13a8=a20_0x4c4b,{appCode:appCode=process[_0x7f13a8(0x1ba)][_0x7f13a8(0x1bc)],cookie:_0x473b68,env:env=process[_0x7f13a8(0x1ba)][_0x7f13a8(0x1c9)]||'online',keyword:_0x3d8877}=_0x98de5a;if(!appCode)throw new Error(_0x7f13a8(0x1c6));if(!_0x3d8877)throw new Error('keyword\x20is\x20required');const _0x56b92f=new DevApiClient({'appCode':appCode,'cookie':_0x473b68,'env':env}),_0x2e14bd=await _0x56b92f[_0x7f13a8(0x1b9)](_0x3d8877),_0x1e60fd=new DatasetAnalyzer(),_0x211760=_0x1e60fd[_0x7f13a8(0x1bb)](_0x2e14bd);return{'appCode':appCode,'env':env,'keyword':_0x3d8877,'total':_0x211760[_0x7f13a8(0x1c7)],'datasets':_0x211760['datasets'][_0x7f13a8(0x1c4)](_0x7108c7=>({'id':_0x7108c7['id'],'name':_0x7108c7['name'],'code':_0x7108c7[_0x7f13a8(0x1c3)],'tableName':_0x7108c7[_0x7f13a8(0x1c1)],'description':_0x7108c7['description']}))};}
@@ -1 +1 @@
1
- (function(_0x41d4ea,_0x1c21b5){const _0x516933=a21_0xcf3b,_0x10b1eb=_0x41d4ea();while(!![]){try{const _0x5325cd=-parseInt(_0x516933(0xea))/0x1+parseInt(_0x516933(0x119))/0x2*(parseInt(_0x516933(0x118))/0x3)+-parseInt(_0x516933(0x123))/0x4*(parseInt(_0x516933(0x106))/0x5)+parseInt(_0x516933(0x121))/0x6+-parseInt(_0x516933(0x10c))/0x7+parseInt(_0x516933(0x102))/0x8*(parseInt(_0x516933(0x10e))/0x9)+parseInt(_0x516933(0xf2))/0xa*(parseInt(_0x516933(0x10a))/0xb);if(_0x5325cd===_0x1c21b5)break;else _0x10b1eb['push'](_0x10b1eb['shift']());}catch(_0x59714c){_0x10b1eb['push'](_0x10b1eb['shift']());}}}(a21_0x5449,0x2ff90));import{DevApiClient}from'../api/dev-api-client.js';import{validateIsSelectOnly,parseSqlStructure,validateSqlContent as a21_0x39e896,generateSqlSummary}from'../utils/sql-parser.js';import{createStructuredSqlError}from'../types/mcp-types.js';function a21_0x5449(){const _0x3e6765=['SQL_START','data','push','20CKxjbF','Only\x20SELECT\x20queries\x20are\x20allowed\x20for\x20custom\x20SQL','properties','TABLE_NOT_FOUND','6974dZJvOH','Get\x20database\x20ID\x20to\x20save\x20this\x20SQL','217000fblQXR','test','81wOIJvm','valid','typeLabel','find','COLUMN_NOT_FOUND','Review\x20SQL\x20errors\x20and\x20fix','<dataset-code>','type','SQL\x20validation\x20failed:\x20','fieldCode','11799gSQcEU','50WHuGYx','env','list_datasets','medium','getDatasetList','Need\x20dbId\x20from\x20dataset\x20detail\x20to\x20save\x20SQL','high','warn','993216EmwFTS','length','55012wNoOMV','95050yGjKyA','tableName','nextSteps','List\x20all\x20available\x20datasets','Modify\x20SQL\x20to\x20be\x20a\x20SELECT\x20statement\x20only','Fix\x20the\x20identified\x20errors\x20before\x20saving','SQL\x20must\x20be\x20a\x20SELECT\x20statement','Get\x20dataset\x20details\x20to\x20find\x20correct\x20table/column\x20names','1170vZibIg','\x20error(s))','LOVRABET_ENV','SQL\x20validation\x20passed\x20(','errors','save_or_update_custom_sql','NODE_ENV','Save\x20this\x20validated\x20SQL','get_dataset_detail','trim','reason','description','validate_sql_content','code','SQL\x20content\x20cannot\x20be\x20empty','SQL\x20validation\x20failed\x20(','35128cgNEeR'];a21_0x5449=function(){return _0x3e6765;};return a21_0x5449();}async function fetchSchemaInfo(_0x217d89,_0x39df2b){const _0x204249=a21_0xcf3b,_0x10d1d4=[];for(const _0x268b22 of _0x217d89){try{const _0x3ecfc9=/^\d+$/[_0x204249(0x10d)](_0x268b22);let _0x3ccc51=_0x268b22;if(!_0x3ecfc9){const _0x426f7c=await _0x39df2b[_0x204249(0x11d)]({'pageSize':0x3e7}),_0x514dac=_0x426f7c[_0x204249(0x104)]?.['tableData']||[],_0x2f5d1e=_0x514dac[_0x204249(0x111)](_0x114e80=>_0x114e80[_0x204249(0xff)]===_0x268b22);if(!_0x2f5d1e)continue;_0x3ccc51=String(_0x2f5d1e['id']);}const _0x724db8=await _0x39df2b['getDatasetDetail'](_0x3ccc51),_0x133620=_0x724db8[_0x204249(0x104)]?.[_0x204249(0xeb)]||'',_0x27a8cc=_0x724db8[_0x204249(0x104)]?.[_0x204249(0x108)]||[],_0x41a66d=_0x27a8cc['map'](_0x1b536=>_0x1b536[_0x204249(0xff)]||_0x1b536[_0x204249(0x117)]);_0x133620&&_0x41a66d['length']>0x0&&_0x10d1d4[_0x204249(0x105)]({'tableName':_0x133620,'columns':_0x41a66d});}catch(_0x36e269){process[_0x204249(0x11a)][_0x204249(0xf8)]!==_0x204249(0x10d)&&console[_0x204249(0x120)]('[validateSqlContent]\x20Failed\x20to\x20fetch\x20schema\x20for\x20'+_0x268b22+':',_0x36e269);}}return _0x10d1d4;}export async function validateSqlContentTool(_0xd96657){const _0xebdd3a=a21_0xcf3b,{appCode:appCode=process[_0xebdd3a(0x11a)]['LOVRABET_APP_CODE'],cookie:_0x14eeff,env:env=process[_0xebdd3a(0x11a)][_0xebdd3a(0xf4)]||'online',sqlContent:_0x1bc651,dbId:_0x1c840b,validateSchemas:validateSchemas=[]}=_0xd96657;if(!_0x1bc651||_0x1bc651[_0xebdd3a(0xfb)]()==='')return{'success':![],'message':'SQL\x20content\x20is\x20required','validation':{'valid':![],'isSelectOnly':![]},'nextSteps':[{'action':'Provide\x20SQL\x20content\x20to\x20validate','tool':_0xebdd3a(0xfe),'reason':_0xebdd3a(0x100)}]};const _0x596030=validateIsSelectOnly(_0x1bc651);if(!_0x596030['valid'])return{'success':![],'message':_0xebdd3a(0x116)+_0x596030[_0xebdd3a(0xfc)],'validation':{'valid':![],'isSelectOnly':![],'errors':[createStructuredSqlError({'type':'SYNTAX_ERROR','location':_0xebdd3a(0x103),'message':_0x596030[_0xebdd3a(0xfc)]||'Invalid\x20SQL','severity':'error','fixSteps':[{'description':_0xebdd3a(0xf0),'example':'SELECT\x20id,\x20name\x20FROM\x20customer\x20WHERE\x20status\x20=\x201'}]})]},'nextSteps':[{'action':_0xebdd3a(0xee),'tool':_0xebdd3a(0xf7),'reason':_0xebdd3a(0x107)}]};const _0x3a94de=parseSqlStructure(_0x1bc651),_0x1fbe04=generateSqlSummary(_0x1bc651);let _0x4fba16;if(validateSchemas[_0xebdd3a(0x122)]>0x0&&appCode){const _0x1aea9b=new DevApiClient({'appCode':appCode,'cookie':_0x14eeff,'env':env});_0x4fba16=await fetchSchemaInfo(validateSchemas,_0x1aea9b);}const _0x5c0a93=a21_0x39e896(_0x1bc651,_0x4fba16?{'tables':_0x4fba16}:undefined),_0x58ad94={'success':_0x5c0a93[_0xebdd3a(0x10f)]||!![],'message':_0x5c0a93[_0xebdd3a(0x10f)]?_0xebdd3a(0xf5)+_0x1fbe04+')':_0xebdd3a(0x101)+(_0x5c0a93[_0xebdd3a(0xf6)]?.[_0xebdd3a(0x122)]||0x0)+_0xebdd3a(0xf3),'validation':{..._0x5c0a93,'parsedStructure':_0x3a94de}},_0x5316fd=[];if(_0x5c0a93[_0xebdd3a(0x10f)])_0x1c840b?_0x5316fd[_0xebdd3a(0x105)]({'action':_0xebdd3a(0xf9),'tool':_0xebdd3a(0xf7),'params':{'sqlName':'<sql-name>','dbId':_0x1c840b,'sqlContent':_0x1bc651},'reason':'SQL\x20is\x20valid\x20and\x20ready\x20to\x20be\x20saved','priority':_0xebdd3a(0x11f)}):_0x5316fd[_0xebdd3a(0x105)]({'action':_0xebdd3a(0x10b),'tool':_0xebdd3a(0xfa),'params':{'datasetCode':'<dataset-code>'},'reason':_0xebdd3a(0x11e),'priority':_0xebdd3a(0x11f)});else{_0x5316fd[_0xebdd3a(0x105)]({'action':_0xebdd3a(0x113),'tool':'validate_sql_content','reason':_0xebdd3a(0xef),'priority':'high'});for(const _0x139182 of _0x5c0a93[_0xebdd3a(0xf6)]||[]){if(_0x139182[_0xebdd3a(0x115)]===_0xebdd3a(0x112)||_0x139182[_0xebdd3a(0x115)]===_0xebdd3a(0x109)){const _0x34888e=_0x139182['fixSteps'][0x0]?.[_0xebdd3a(0xfd)]||_0x139182[_0xebdd3a(0x110)];_0x5316fd['push']({'action':_0xebdd3a(0xf1),'tool':_0xebdd3a(0xfa),'params':{'datasetCode':_0xebdd3a(0x114)},'reason':_0x34888e,'priority':'medium'});break;}}}return!_0x5c0a93['valid']&&_0x5c0a93[_0xebdd3a(0xf6)]?.['some'](_0x3f27c0=>_0x3f27c0[_0xebdd3a(0x115)]===_0xebdd3a(0x109))&&_0x5316fd[_0xebdd3a(0x105)]({'action':_0xebdd3a(0xed),'tool':_0xebdd3a(0x11b),'reason':'Find\x20the\x20correct\x20table\x20names\x20for\x20your\x20SQL','priority':_0xebdd3a(0x11c)}),_0x58ad94[_0xebdd3a(0xec)]=_0x5316fd,_0x58ad94;}function a21_0xcf3b(_0x2c140a,_0x3f5a6){_0x2c140a=_0x2c140a-0xea;const _0x5449d4=a21_0x5449();let _0xcf3b0e=_0x5449d4[_0x2c140a];return _0xcf3b0e;}export{validateSqlContentTool as validateSqlContent};
1
+ (function(_0x1f8eca,_0x45f64a){const _0x9d1a90=a21_0x27ac,_0x5ea169=_0x1f8eca();while(!![]){try{const _0x8268ca=-parseInt(_0x9d1a90(0x203))/0x1+parseInt(_0x9d1a90(0x1fb))/0x2*(parseInt(_0x9d1a90(0x1e0))/0x3)+-parseInt(_0x9d1a90(0x20d))/0x4+parseInt(_0x9d1a90(0x1db))/0x5+-parseInt(_0x9d1a90(0x1df))/0x6*(parseInt(_0x9d1a90(0x201))/0x7)+-parseInt(_0x9d1a90(0x1e1))/0x8*(parseInt(_0x9d1a90(0x1e7))/0x9)+parseInt(_0x9d1a90(0x1f2))/0xa*(parseInt(_0x9d1a90(0x1fe))/0xb);if(_0x8268ca===_0x45f64a)break;else _0x5ea169['push'](_0x5ea169['shift']());}catch(_0x202dd8){_0x5ea169['push'](_0x5ea169['shift']());}}}(a21_0x4051,0x5c92c));import{DevApiClient}from'../api/dev-api-client.js';import{validateIsSelectOnly,parseSqlStructure,validateSqlContent as a21_0xf0443f,generateSqlSummary}from'../utils/sql-parser.js';import{createStructuredSqlError}from'../types/mcp-types.js';async function fetchSchemaInfo(_0x36958b,_0x5b8798){const _0x397d78=a21_0x27ac,_0x48bf63=[];for(const _0x4c2cab of _0x36958b){try{const _0x47f301=/^\d+$/[_0x397d78(0x1de)](_0x4c2cab);let _0x3a0469=_0x4c2cab;if(!_0x47f301){const _0x29c6f8=await _0x5b8798[_0x397d78(0x210)]({'pageSize':0x3e7}),_0x5e3a52=_0x29c6f8['data']?.['tableData']||[],_0x36bf8e=_0x5e3a52['find'](_0x42d740=>_0x42d740[_0x397d78(0x1e8)]===_0x4c2cab);if(!_0x36bf8e)continue;_0x3a0469=String(_0x36bf8e['id']);}const _0x4edaa4=await _0x5b8798[_0x397d78(0x1f8)](_0x3a0469),_0x2640e5=_0x4edaa4['data']?.[_0x397d78(0x1f3)]||'',_0x56e7c6=_0x4edaa4[_0x397d78(0x1e4)]?.[_0x397d78(0x1e2)]||[],_0x204a8f=_0x56e7c6[_0x397d78(0x1d9)](_0xb9e4c1=>_0xb9e4c1[_0x397d78(0x1e8)]||_0xb9e4c1[_0x397d78(0x205)]);_0x2640e5&&_0x204a8f['length']>0x0&&_0x48bf63[_0x397d78(0x20f)]({'tableName':_0x2640e5,'columns':_0x204a8f});}catch(_0x199d08){process[_0x397d78(0x1ee)]['NODE_ENV']!==_0x397d78(0x1de)&&console['warn']('[validateSqlContent]\x20Failed\x20to\x20fetch\x20schema\x20for\x20'+_0x4c2cab+':',_0x199d08);}}return _0x48bf63;}export async function validateSqlContentTool(_0x46d329){const _0x375866=a21_0x27ac,{appCode:appCode=process[_0x375866(0x1ee)][_0x375866(0x1f1)],cookie:_0x134929,env:env=process[_0x375866(0x1ee)][_0x375866(0x1ff)]||'online',sqlContent:_0x105c84,dbId:_0x4062bb,validateSchemas:validateSchemas=[]}=_0x46d329;if(!_0x105c84||_0x105c84[_0x375866(0x1da)]()==='')return{'success':![],'message':'SQL\x20content\x20is\x20required','validation':{'valid':![],'isSelectOnly':![]},'nextSteps':[{'action':_0x375866(0x206),'tool':_0x375866(0x1e3),'reason':_0x375866(0x20e)}]};const _0xe382b2=validateIsSelectOnly(_0x105c84);if(!_0xe382b2['valid'])return{'success':![],'message':_0x375866(0x1eb)+_0xe382b2['reason'],'validation':{'valid':![],'isSelectOnly':![],'errors':[createStructuredSqlError({'type':'SYNTAX_ERROR','location':_0x375866(0x1f6),'message':_0xe382b2['reason']||'Invalid\x20SQL','severity':_0x375866(0x1f0),'fixSteps':[{'description':_0x375866(0x1fa),'example':_0x375866(0x1f9)}]})]},'nextSteps':[{'action':_0x375866(0x1f4),'tool':_0x375866(0x1e6),'reason':_0x375866(0x208)}]};const _0x13f08f=parseSqlStructure(_0x105c84),_0x2b0436=generateSqlSummary(_0x105c84);let _0x8a7d4c;if(validateSchemas['length']>0x0&&appCode){const _0xaf0f30=new DevApiClient({'appCode':appCode,'cookie':_0x134929,'env':env});_0x8a7d4c=await fetchSchemaInfo(validateSchemas,_0xaf0f30);}const _0x3ecb37=a21_0xf0443f(_0x105c84,_0x8a7d4c?{'tables':_0x8a7d4c}:undefined),_0x54b02c={'success':_0x3ecb37[_0x375866(0x1f5)]||!![],'message':_0x3ecb37[_0x375866(0x1f5)]?_0x375866(0x1d5)+_0x2b0436+')':_0x375866(0x204)+(_0x3ecb37[_0x375866(0x1d6)]?.['length']||0x0)+'\x20error(s))','validation':{..._0x3ecb37,'parsedStructure':_0x13f08f}},_0x18e329=[];if(_0x3ecb37[_0x375866(0x1f5)])_0x4062bb?_0x18e329[_0x375866(0x20f)]({'action':_0x375866(0x20c),'tool':'save_or_update_custom_sql','params':{'sqlName':_0x375866(0x20a),'dbId':_0x4062bb,'sqlContent':_0x105c84},'reason':_0x375866(0x1d7),'priority':_0x375866(0x1e9)}):_0x18e329['push']({'action':_0x375866(0x1d8),'tool':'get_dataset_detail','params':{'datasetCode':'<dataset-code>'},'reason':_0x375866(0x1ec),'priority':_0x375866(0x1e9)});else{_0x18e329[_0x375866(0x20f)]({'action':_0x375866(0x1dc),'tool':'validate_sql_content','reason':_0x375866(0x20b),'priority':_0x375866(0x1e9)});for(const _0x551475 of _0x3ecb37['errors']||[]){if(_0x551475[_0x375866(0x1f7)]===_0x375866(0x1e5)||_0x551475['type']===_0x375866(0x207)){const _0x5a375b=_0x551475['fixSteps'][0x0]?.[_0x375866(0x1ea)]||_0x551475[_0x375866(0x209)];_0x18e329[_0x375866(0x20f)]({'action':_0x375866(0x200),'tool':_0x375866(0x202),'params':{'datasetCode':_0x375866(0x1ed)},'reason':_0x5a375b,'priority':'medium'});break;}}}return!_0x3ecb37[_0x375866(0x1f5)]&&_0x3ecb37['errors']?.['some'](_0x4d17b6=>_0x4d17b6[_0x375866(0x1f7)]==='TABLE_NOT_FOUND')&&_0x18e329[_0x375866(0x20f)]({'action':_0x375866(0x1fd),'tool':_0x375866(0x1dd),'reason':_0x375866(0x1ef),'priority':'medium'}),_0x54b02c[_0x375866(0x1fc)]=_0x18e329,_0x54b02c;}function a21_0x4051(){const _0x190142=['code','high','description','SQL\x20validation\x20failed:\x20','Need\x20dbId\x20from\x20dataset\x20detail\x20to\x20save\x20SQL','<dataset-code>','env','Find\x20the\x20correct\x20table\x20names\x20for\x20your\x20SQL','error','LOVRABET_APP_CODE','1817420dSoMxB','tableName','Modify\x20SQL\x20to\x20be\x20a\x20SELECT\x20statement\x20only','valid','SQL_START','type','getDatasetDetail','SELECT\x20id,\x20name\x20FROM\x20customer\x20WHERE\x20status\x20=\x201','SQL\x20must\x20be\x20a\x20SELECT\x20statement','1076066dnDYJU','nextSteps','List\x20all\x20available\x20datasets','99KwcfYr','LOVRABET_ENV','Get\x20dataset\x20details\x20to\x20find\x20correct\x20table/column\x20names','2969183sryKwp','get_dataset_detail','569470CMJMdO','SQL\x20validation\x20failed\x20(','fieldCode','Provide\x20SQL\x20content\x20to\x20validate','TABLE_NOT_FOUND','Only\x20SELECT\x20queries\x20are\x20allowed\x20for\x20custom\x20SQL','typeLabel','<sql-name>','Fix\x20the\x20identified\x20errors\x20before\x20saving','Save\x20this\x20validated\x20SQL','1705544ywtIoS','SQL\x20content\x20cannot\x20be\x20empty','push','getDatasetList','SQL\x20validation\x20passed\x20(','errors','SQL\x20is\x20valid\x20and\x20ready\x20to\x20be\x20saved','Get\x20database\x20ID\x20to\x20save\x20this\x20SQL','map','trim','951255owFsor','Review\x20SQL\x20errors\x20and\x20fix','list_datasets','test','6KoXnQs','3vkltBh','1112nfYdWt','properties','validate_sql_content','data','COLUMN_NOT_FOUND','save_or_update_custom_sql','36567zZXoZf'];a21_0x4051=function(){return _0x190142;};return a21_0x4051();}function a21_0x27ac(_0x4bc37c,_0xd4074a){_0x4bc37c=_0x4bc37c-0x1d5;const _0x405175=a21_0x4051();let _0x27ac9b=_0x405175[_0x4bc37c];return _0x27ac9b;}export{validateSqlContentTool as validateSqlContent};
@@ -1 +1 @@
1
- (function(_0x1740f5,_0x31363c){var _0x27d892=a22_0x3eda,_0x2ba542=_0x1740f5();while(!![]){try{var _0x5de49e=parseInt(_0x27d892(0xe7))/0x1*(-parseInt(_0x27d892(0xe3))/0x2)+-parseInt(_0x27d892(0xe2))/0x3+-parseInt(_0x27d892(0xe5))/0x4+parseInt(_0x27d892(0xe4))/0x5+-parseInt(_0x27d892(0xe0))/0x6*(parseInt(_0x27d892(0xdf))/0x7)+-parseInt(_0x27d892(0xe1))/0x8+parseInt(_0x27d892(0xe6))/0x9;if(_0x5de49e===_0x31363c)break;else _0x2ba542['push'](_0x2ba542['shift']());}catch(_0x27d74d){_0x2ba542['push'](_0x2ba542['shift']());}}}(a22_0x248d,0x313ea));export{createError,createAuthError,createMissingParamError,createDatasetNotFoundError,createSqlNotFoundError,createSqlValidationError,createStructuredSqlError,fromLovrabetError,SQL_ERROR_TYPE_LABELS}from'./mcp-types.js';function a22_0x3eda(_0x56be1b,_0x125d5b){_0x56be1b=_0x56be1b-0xdf;var _0x248d47=a22_0x248d();var _0x3edab4=_0x248d47[_0x56be1b];return _0x3edab4;}function a22_0x248d(){var _0x2350cf=['1120110SUPXsR','1570628Uqsufi','11151855iWukwa','103324zmpeAN','437353QXjjbq','30fHELtb','875400zktIVg','1030830TWuoUi','2ZVHSlh'];a22_0x248d=function(){return _0x2350cf;};return a22_0x248d();}
1
+ (function(_0x4f3036,_0x5107ba){var _0x57c134=a22_0x1d7f,_0xc5d201=_0x4f3036();while(!![]){try{var _0xe7cde0=parseInt(_0x57c134(0x126))/0x1*(-parseInt(_0x57c134(0x128))/0x2)+parseInt(_0x57c134(0x123))/0x3+parseInt(_0x57c134(0x121))/0x4*(-parseInt(_0x57c134(0x122))/0x5)+-parseInt(_0x57c134(0x125))/0x6+-parseInt(_0x57c134(0x124))/0x7+parseInt(_0x57c134(0x129))/0x8+parseInt(_0x57c134(0x127))/0x9;if(_0xe7cde0===_0x5107ba)break;else _0xc5d201['push'](_0xc5d201['shift']());}catch(_0x3952a1){_0xc5d201['push'](_0xc5d201['shift']());}}}(a22_0x11c8,0xbfc43));function a22_0x1d7f(_0x4fbcf9,_0x308ef7){_0x4fbcf9=_0x4fbcf9-0x121;var _0x11c86e=a22_0x11c8();var _0x1d7f41=_0x11c86e[_0x4fbcf9];return _0x1d7f41;}function a22_0x11c8(){var _0x110df9=['6124111fmWBGb','8589708ArZYuv','135652ocbyRM','34183197UssaVB','12AFkXso','3420408mQwqRJ','57564CEtoTk','475QFdDDd','3142017wDMfyJ'];a22_0x11c8=function(){return _0x110df9;};return a22_0x11c8();}export{createError,createAuthError,createMissingParamError,createDatasetNotFoundError,createSqlNotFoundError,createSqlValidationError,createStructuredSqlError,fromLovrabetError,SQL_ERROR_TYPE_LABELS}from'./mcp-types.js';