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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(_0x32bfe0,_0x16eb3a){const _0x8e1fc6=a10_0x3a45,_0x503231=_0x32bfe0();while(!![]){try{const _0x3130b4=parseInt(_0x8e1fc6(0x116))/0x1*(-parseInt(_0x8e1fc6(0x10e))/0x2)+parseInt(_0x8e1fc6(0x103))/0x3*(parseInt(_0x8e1fc6(0xef))/0x4)+parseInt(_0x8e1fc6(0x109))/0x5*(parseInt(_0x8e1fc6(0x118))/0x6)+-parseInt(_0x8e1fc6(0x108))/0x7*(parseInt(_0x8e1fc6(0x119))/0x8)+-parseInt(_0x8e1fc6(0x102))/0x9*(-parseInt(_0x8e1fc6(0xfd))/0xa)+-parseInt(_0x8e1fc6(0xe6))/0xb*(-parseInt(_0x8e1fc6(0xf3))/0xc)+-parseInt(_0x8e1fc6(0x11a))/0xd*(parseInt(_0x8e1fc6(0x10b))/0xe);if(_0x3130b4===_0x16eb3a)break;else _0x503231['push'](_0x503231['shift']());}catch(_0xc0aa24){_0x503231['push'](_0x503231['shift']());}}}(a10_0x5916,0xbc0da));import{DevApiClient}from'../api/dev-api-client.js';export async function generateSqlCode(_0x477c25){const _0x2223e9=a10_0x3a45,{appCode:appCode=process[_0x2223e9(0xf4)][_0x2223e9(0xf5)],cookie:_0x17cc26,env:env=process[_0x2223e9(0xf4)][_0x2223e9(0x113)]||'online',sqlCode:_0x1d2f4b,params:_0x2da530,includeImports:includeImports=!![]}=_0x477c25;if(!appCode)throw new Error(_0x2223e9(0xfb));if(!_0x1d2f4b||_0x1d2f4b[_0x2223e9(0x10a)]()==='')return{'success':![],'sqlCode':'','sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[]},'error':_0x2223e9(0x106)};const _0x11eead=_0x1d2f4b[_0x2223e9(0x10a)](),_0x1cef86=new DevApiClient({'appCode':appCode,'cookie':_0x17cc26,'env':env});try{const _0x2e6c41=await _0x1cef86[_0x2223e9(0xe7)]({'pageSize':0x3e7,'currentPage':0x1,'sqlCode':_0x11eead}),_0xb5280e=_0x2e6c41[_0x2223e9(0xec)]?.[_0x2223e9(0x10c)]||[],_0x28605b=_0xb5280e['find'](_0xea55fd=>_0xea55fd[_0x2223e9(0xee)]===_0x11eead||_0xea55fd[_0x2223e9(0xee)]?.[_0x2223e9(0x104)](_0x11eead)||_0x11eead[_0x2223e9(0x104)](_0xea55fd[_0x2223e9(0xee)]));if(!_0x28605b)return{'success':![],'sqlCode':_0x11eead,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x2223e9(0xf7)+_0x11eead+_0x2223e9(0x111),_0x2223e9(0xff),'Check\x20the\x20sqlCode\x20from\x20list_sql_queries\x20result\x20and\x20use\x20the\x20exact\x20value.']},'error':'SQL\x20code\x20\x22'+_0x11eead+_0x2223e9(0x117)};const _0x15a171=_0x28605b[_0x2223e9(0xee)],_0x49f105=_0x28605b[_0x2223e9(0xfc)]||_0x28605b[_0x2223e9(0xf2)]||_0x2223e9(0x115)+(_0x28605b[_0x2223e9(0x11c)]||_0x28605b['id']),_0x394d31=_0x28605b['sqlContent']||_0x28605b['sql']||'',_0x2db589=_0x394d31[_0x2223e9(0xe9)](/[:$]\{?(\w+)\}?/g);let _0x42a26d,_0x44a577;if(_0x2db589){const _0xd2052a=Array['from'](new Set(_0x2db589[_0x2223e9(0x11b)](_0x283fa4=>_0x283fa4['replace'](/[:${}]/g,''))));_0x42a26d=_0xd2052a[_0x2223e9(0x11b)](_0x4ce4b5=>{const _0x31cc58=_0x2da530?.[_0x4ce4b5]??getDefaultExample(_0x4ce4b5);return{'name':_0x4ce4b5,'example':_0x31cc58};}),_0x44a577=_0x42a26d['reduce']((_0x3d3a7c,_0x1e0669)=>({..._0x3d3a7c,[_0x1e0669[_0x2223e9(0xf2)]]:_0x1e0669[_0x2223e9(0xeb)]}),{});}else _0x2da530&&(_0x42a26d=Object[_0x2223e9(0x110)](_0x2da530)[_0x2223e9(0x11b)](([_0x58b2f4,_0xa710c0])=>({'name':_0x58b2f4,'example':_0xa710c0})),_0x44a577=_0x2da530);const _0x5153eb=_0x42a26d&&_0x42a26d[_0x2223e9(0xf6)]>0x0,_0x5310b1=_0x5153eb?JSON[_0x2223e9(0x11d)](_0x44a577,null,0x2):'',_0x384b50=(includeImports?'import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a':'')+_0x2223e9(0xf9)+appCode+'\x27,\x0a\x20\x20env:\x20\x27'+env+_0x2223e9(0xe8)+_0x49f105+'\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27'+_0x15a171+'\x27'+(_0x5153eb?',\x20'+_0x5310b1:'')+_0x2223e9(0xea);return{'success':!![],'sqlCode':_0x15a171,'sqlName':_0x49f105,'sqlExists':!![],'code':_0x384b50,'parameters':_0x42a26d,'usage':{'description':_0x2223e9(0xf8)+_0x49f105,'important':[_0x2223e9(0xf7)+_0x15a171+'\x22\x20exists\x20and\x20is\x20valid.',_0x2223e9(0xf1),'Always\x20check\x20execSuccess\x20before\x20using\x20execResult',_0x5153eb?_0x2223e9(0x10f)+_0x42a26d[_0x2223e9(0x11b)](_0x36e18a=>_0x36e18a[_0x2223e9(0xf2)])[_0x2223e9(0x114)](',\x20'):'This\x20SQL\x20does\x20not\x20require\x20any\x20parameters','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20exception\x20-\x20use\x20try-catch']}};}catch(_0x4bb5f4){return{'success':![],'sqlCode':_0x11eead,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x2223e9(0x11e)+_0x4bb5f4[_0x2223e9(0xfa)],_0x2223e9(0xff)]},'error':'Failed\x20to\x20verify\x20SQL\x20code:\x20'+_0x4bb5f4[_0x2223e9(0xfa)]};}}function getDefaultExample(_0x4b89cf){const _0x2468f1=a10_0x3a45,_0x1d4920=_0x4b89cf[_0x2468f1(0xfe)]();if(_0x1d4920[_0x2468f1(0x104)]('date')||_0x1d4920[_0x2468f1(0x104)](_0x2468f1(0x11f)))return'2024-01-01';if(_0x1d4920[_0x2468f1(0x104)]('id'))return 0x7b;if(_0x1d4920[_0x2468f1(0x104)](_0x2468f1(0xf0))||_0x1d4920['includes'](_0x2468f1(0x101))||_0x1d4920[_0x2468f1(0x104)](_0x2468f1(0xed)))return 0xa;if(_0x1d4920[_0x2468f1(0x104)](_0x2468f1(0x100)))return 0x1;if(_0x1d4920['includes'](_0x2468f1(0x105))||_0x1d4920[_0x2468f1(0x104)](_0x2468f1(0x112))||_0x1d4920['includes'](_0x2468f1(0xf2)))return _0x2468f1(0xeb);if(_0x1d4920[_0x2468f1(0x104)](_0x2468f1(0x10d)))return 0x1;return _0x2468f1(0x107);}function a10_0x3a45(_0x4dc591,_0x13466a){_0x4dc591=_0x4dc591-0xe6;const _0x5916ce=a10_0x5916();let _0x3a452f=_0x5916ce[_0x4dc591];return _0x3a452f;}function a10_0x5916(){const _0x176042=['Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.','page','count','717399hRMKZg','2913039CsLUlH','includes','keyword','sqlCode\x20is\x20required','value','49YKqVuK','1445135novsPZ','trim','146986FxQEhC','tableData','status','434nUxeDS','This\x20SQL\x20requires\x20parameters:\x20','entries','\x22\x20not\x20found\x20in\x20the\x20application.','search','LOVRABET_ENV','join','SQL-','4439jzftjZ','\x22\x20does\x20not\x20exist.\x20Use\x20list_sql_queries\x20to\x20find\x20valid\x20SQL\x20codes.','30gMyIlg','900744LgAYOL','3484fTVCFY','map','sqlId','stringify','Failed\x20to\x20verify\x20SQL\x20code:\x20','time','1023fCSrjb','getCustomSqlList','\x27,\x0a});\x0a\x0a//\x20Execute\x20SQL:\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:\x20any)\x20=>\x20{\x0a\x20\x20console.log(row);\x0a});','example','data','size','sqlCode','4EtGLGX','limit','SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[],\x20execError?:\x20string\x20}','name','191544dLJfWe','env','LOVRABET_APP_CODE','length','SQL\x20code\x20\x22','Generated\x20code\x20for\x20executing\x20custom\x20SQL:\x20','//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27','message','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','sqlName','180TZyCLy','toLowerCase'];a10_0x5916=function(){return _0x176042;};return a10_0x5916();}
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 +1 @@
1
- (function(_0x3c01d3,_0x3dc1d6){const _0x29cb69=a11_0x51b7,_0x386e0e=_0x3c01d3();while(!![]){try{const _0x3ab0e1=parseInt(_0x29cb69(0xb1))/0x1+parseInt(_0x29cb69(0xab))/0x2+parseInt(_0x29cb69(0xad))/0x3*(parseInt(_0x29cb69(0x84))/0x4)+-parseInt(_0x29cb69(0x82))/0x5*(-parseInt(_0x29cb69(0xa7))/0x6)+-parseInt(_0x29cb69(0x9a))/0x7*(parseInt(_0x29cb69(0xa5))/0x8)+-parseInt(_0x29cb69(0x8c))/0x9*(-parseInt(_0x29cb69(0x80))/0xa)+-parseInt(_0x29cb69(0x7e))/0xb*(parseInt(_0x29cb69(0xa0))/0xc);if(_0x3ab0e1===_0x3dc1d6)break;else _0x386e0e['push'](_0x386e0e['shift']());}catch(_0x4bf94f){_0x386e0e['push'](_0x386e0e['shift']());}}}(a11_0x1ade,0x31f65));import{DevApiClient}from'../api/dev-api-client.js';import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function getDatasetDetail(_0x5eb53d){const _0x197617=a11_0x51b7,_0x31b02a=Date['now'](),{appCode:appCode=process[_0x197617(0x7f)][_0x197617(0x91)],cookie:_0x4aa2fc,env:env=process[_0x197617(0x7f)][_0x197617(0x8b)]||_0x197617(0xa8),datasetCode:_0x29d558,forceRefresh:forceRefresh=![]}=_0x5eb53d;if(!appCode)throw new Error(_0x197617(0x8d));if(!_0x29d558)throw new Error('datasetCode\x20is\x20required');const _0x2f868a=new DevApiClient({'appCode':appCode,'cookie':_0x4aa2fc,'env':env}),_0x2fd5c3=/^\d+$/[_0x197617(0xb7)](_0x29d558);let _0x21d225;if(_0x2fd5c3)_0x21d225=_0x29d558;else{const _0x501eba=await _0x2f868a[_0x197617(0xb6)]({'pageSize':0x3e7,'forceRefresh':forceRefresh}),_0x1d659e=_0x501eba[_0x197617(0xaa)]?.[_0x197617(0x81)]||[],_0x5dbc73=_0x1d659e[_0x197617(0x9b)](_0x187b24=>_0x187b24[_0x197617(0x95)]===_0x29d558);if(!_0x5dbc73)throw new Error(_0x197617(0x9d)+_0x29d558);_0x21d225=String(_0x5dbc73['id']);}const _0x278024=await _0x2f868a[_0x197617(0x9f)](_0x21d225,forceRefresh),_0xc835ec=new DatasetAnalyzer(),_0x4763e1=_0xc835ec[_0x197617(0xbb)](_0x278024),_0xf174ac=_0x4763e1[_0x197617(0xb3)]['filter'](_0x10d8cb=>_0x10d8cb[_0x197617(0x85)])['map'](_0xd9dc82=>_0xd9dc82['name']),_0x22ccd4=_0x4763e1[_0x197617(0xb3)][_0x197617(0x86)](_0x325628=>_0x325628[_0x197617(0x9e)])[_0x197617(0x7d)](_0x9a6ce=>_0x9a6ce[_0x197617(0x92)]),_0x59eff9=['status',_0x197617(0x8e),_0x197617(0xba),_0x197617(0x88),'level',_0x197617(0xb4),'active','enabled','visible',_0x197617(0x90),_0x197617(0xb9)],_0x39a3a1=_0x4763e1['fields'][_0x197617(0x86)](_0x198517=>{const _0x2f7bc2=_0x197617,_0x2d3654=_0x198517[_0x2f7bc2(0x92)][_0x2f7bc2(0x83)]();return _0x59eff9[_0x2f7bc2(0xa6)](_0x4878c7=>_0x2d3654['includes'](_0x4878c7)||_0x2d3654===_0x4878c7);})[_0x197617(0x7d)](_0x4b845a=>_0x4b845a[_0x197617(0x92)]),_0x48f412=_0x4763e1[_0x197617(0xb3)]['filter'](_0x3b6c88=>{const _0xd8790d=_0x197617,_0x41d5f9=_0x3b6c88[_0xd8790d(0x92)]['toLowerCase']();return _0x41d5f9[_0xd8790d(0xa4)](_0xd8790d(0xb2))||_0x41d5f9[_0xd8790d(0xa4)]('id');})[_0x197617(0x86)](_0x1a34c7=>!_0x1a34c7[_0x197617(0x85)])[_0x197617(0x7d)](_0x951586=>{const _0x4be65=_0x197617,_0xd0edd8=_0x951586[_0x4be65(0x92)][_0x4be65(0x97)](/_id$/,'')[_0x4be65(0x97)](/Id$/,'');return{'field':_0x951586[_0x4be65(0x92)],'suggestsForeignKeyTo':_0xd0edd8};}),_0x8e1a01=_0x4763e1[_0x197617(0xb3)][_0x197617(0x86)](_0x101f0e=>_0x101f0e[_0x197617(0x96)]&&_0x101f0e[_0x197617(0x96)][_0x197617(0x87)]>0x0)['map'](_0x15f8b1=>({'field':_0x15f8b1['name'],'options':(_0x15f8b1[_0x197617(0x96)]||[])[_0x197617(0x7d)](_0x5024b8=>({'label':String(_0x5024b8),'value':_0x5024b8}))})),_0x18ae3e={'primaryKeys':_0xf174ac,'filterableFields':_0x39a3a1,'joinableFields':_0x48f412,'requiredFields':_0x22ccd4,'enumFields':_0x8e1a01},_0x22a3e0=[],_0x5366fe=_0x4763e1['operations'][_0x197617(0x9b)](_0x458d95=>_0x458d95[_0x197617(0xba)]===_0x197617(0x86));_0x5366fe&&_0x22a3e0[_0x197617(0x7c)]({'action':_0x197617(0x7b),'tool':_0x197617(0xb5),'params':{'datasetCode':_0x29d558,'operationName':_0x197617(0x86)},'reason':_0x197617(0xac),'priority':_0x197617(0x8a)});_0x4763e1[_0x197617(0x99)]['database']?.[_0x197617(0xb8)]&&_0x22a3e0[_0x197617(0x7c)]({'action':_0x197617(0xa3),'tool':_0x197617(0xa2),'params':{'sqlContent':'SELECT\x20*\x20FROM\x20'+_0x4763e1['basic'][_0x197617(0x9c)],'dbId':_0x4763e1['basic'][_0x197617(0x94)][_0x197617(0xb8)]},'reason':'Validate\x20and\x20prepare\x20custom\x20SQL\x20for\x20this\x20dataset','priority':_0x197617(0xa9)});_0x22a3e0[_0x197617(0x7c)]({'action':'Browse\x20related\x20datasets','tool':_0x197617(0x93),'reason':_0x197617(0xb0),'priority':_0x197617(0x8f)});const _0x539241=Date[_0x197617(0xa1)]()-_0x31b02a;return{'appCode':appCode,'env':env,'basic':_0x4763e1[_0x197617(0x99)],'fields':_0x4763e1[_0x197617(0xb3)],'operations':_0x4763e1['operations'],'stats':{'fieldCount':_0x4763e1[_0x197617(0xae)],'operationCount':_0x4763e1[_0x197617(0x98)],'enabledOperationCount':_0x4763e1[_0x197617(0xaf)],'supportsCRUD':_0x4763e1[_0x197617(0x89)]},'sqlValidationHints':_0x18ae3e,'nextSteps':_0x22a3e0};}function a11_0x51b7(_0x161ca8,_0x170746){_0x161ca8=_0x161ca8-0x7b;const _0x1ade5e=a11_0x1ade();let _0x51b743=_0x1ade5e[_0x161ca8];return _0x51b743;}function a11_0x1ade(){const _0x291e25=['LOVRABET_ENV','9pxFguc','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','state','low','deleted','LOVRABET_APP_CODE','name','list_datasets','database','code','enumValues','replace','operationCount','basic','7rePyHc','find','tableName','Dataset\x20not\x20found\x20with\x20code:\x20','required','getDatasetDetail','384kAkihl','now','validate_sql_content','Create\x20custom\x20SQL\x20for\x20this\x20dataset','endsWith','1982728HZyFMy','some','15168PCwGor','online','medium','data','572416iDgyDx','Get\x20ready-to-use\x20TypeScript\x20code\x20for\x20querying\x20this\x20dataset','759LtHYwH','fieldCount','enabledOperationCount','Find\x20other\x20datasets\x20that\x20might\x20be\x20related\x20for\x20JOIN\x20operations','103869iMclGI','_id','fields','priority','generate_sdk_code','getDatasetList','test','dbId','archived','type','analyzeDatasetDetail','Generate\x20SDK\x20code\x20for\x20querying\x20this\x20dataset','push','map','125422zgpfSx','env','3397510huNiVw','tableData','40iMJnxh','toLowerCase','1064eHraLT','primaryKey','filter','length','category','supportsCRUD','high'];a11_0x1ade=function(){return _0x291e25;};return a11_0x1ade();}
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 +1 @@
1
- function a12_0x175c(_0x8bcd3c,_0x3d04ca){_0x8bcd3c=_0x8bcd3c-0x1af;const _0xf5a5aa=a12_0xf5a5();let _0x175cc2=_0xf5a5aa[_0x8bcd3c];return _0x175cc2;}(function(_0x10e7d3,_0x35c257){const _0x316eb0=a12_0x175c,_0x3e0b62=_0x10e7d3();while(!![]){try{const _0x2780d3=-parseInt(_0x316eb0(0x1bb))/0x1+-parseInt(_0x316eb0(0x1b3))/0x2+-parseInt(_0x316eb0(0x1c4))/0x3+-parseInt(_0x316eb0(0x1bc))/0x4*(-parseInt(_0x316eb0(0x1b9))/0x5)+parseInt(_0x316eb0(0x1c2))/0x6+-parseInt(_0x316eb0(0x1b8))/0x7+parseInt(_0x316eb0(0x1c3))/0x8;if(_0x2780d3===_0x35c257)break;else _0x3e0b62['push'](_0x3e0b62['shift']());}catch(_0x431891){_0x3e0b62['push'](_0x3e0b62['shift']());}}}(a12_0xf5a5,0xb391c));import{DevApiClient}from'../api/dev-api-client.js';function a12_0xf5a5(){const _0x16d0ca=['code','datasetCode\x20is\x20required','Operation\x20\x27','1461696ttYvZk','12256784sRvySZ','241212jrQpmY','Dataset\x20not\x20found\x20with\x20code:\x20','analyzeDatasetDetail','operationName\x20is\x20required','find','data','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.','578054UxAtGB','\x27\x20not\x20found\x20in\x20dataset\x20\x27','basic','online','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}','3667615YifysC','5VySMVK','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.','393411kHyORn','986356yhlivQ','LOVRABET_ENV','env'];a12_0xf5a5=function(){return _0x16d0ca;};return a12_0xf5a5();}import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function getOperationDetail(_0x2ba9a0){const _0x2f0061=a12_0x175c,{appCode:appCode=process[_0x2f0061(0x1be)]['LOVRABET_APP_CODE'],cookie:_0x1ee98f,env:env=process['env'][_0x2f0061(0x1bd)]||_0x2f0061(0x1b6),datasetCode:_0x33c42f,operationName:_0x593e6d}=_0x2ba9a0;if(!appCode)throw new Error('appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.');if(!_0x33c42f)throw new Error(_0x2f0061(0x1c0));if(!_0x593e6d)throw new Error(_0x2f0061(0x1af));const _0x2c3a1d=new DevApiClient({'appCode':appCode,'cookie':_0x1ee98f,'env':env}),_0x506e13=/^\d+$/['test'](_0x33c42f);let _0x3c0295;if(_0x506e13)_0x3c0295=_0x33c42f;else{const _0x4fba43=await _0x2c3a1d['getDatasetList']({'pageSize':0x3e7}),_0x4fd447=_0x4fba43[_0x2f0061(0x1b1)]?.['tableData']||[],_0x18aee1=_0x4fd447[_0x2f0061(0x1b0)](_0x2aaa8a=>_0x2aaa8a[_0x2f0061(0x1bf)]===_0x33c42f);if(!_0x18aee1)throw new Error(_0x2f0061(0x1c5)+_0x33c42f);_0x3c0295=String(_0x18aee1['id']);}const _0x10f77c=await _0x2c3a1d['getDatasetDetail'](_0x3c0295),_0x95840d=new DatasetAnalyzer(),_0x38d6c4=_0x95840d['getOperationDetail'](_0x10f77c,_0x593e6d);if(!_0x38d6c4)throw new Error(_0x2f0061(0x1c1)+_0x593e6d+_0x2f0061(0x1b4)+_0x33c42f+'\x27');const _0x343013=_0x95840d[_0x2f0061(0x1c6)](_0x10f77c);return{'appCode':appCode,'env':env,'datasetName':_0x343013[_0x2f0061(0x1b5)]['name'],'operation':_0x38d6c4,'sdkReturnValueBehavior':{'onSuccess':_0x2f0061(0x1ba),'onError':_0x2f0061(0x1b7),'note':_0x2f0061(0x1b2)}};}
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 +1 @@
1
- function a13_0x551f(){const _0x161a0d=['525825nKcCHk','920358JcGKIh','enabledOperationCount','enabled','operations','tableData','map','593802bwARer','LOVRABET_APP_CODE','285103mNndIM','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','9DVqMKg','type','1842190JSSnxj','path','data','name','code','test','requestFieldsCount','online','5wmAXzz','supportsCRUD','LOVRABET_ENV','basic','tableName','method','4054728HlTmid','1206392uvxLHQ','env','displayName','analyzeDatasetDetail','getDatasetList','find'];a13_0x551f=function(){return _0x161a0d;};return a13_0x551f();}(function(_0x45177d,_0x5c9408){const _0x2a7852=a13_0xba9a,_0x2032fc=_0x45177d();while(!![]){try{const _0x141a06=-parseInt(_0x2a7852(0x108))/0x1+parseInt(_0x2a7852(0x106))/0x2+-parseInt(_0x2a7852(0xff))/0x3+-parseInt(_0x2a7852(0x11b))/0x4+-parseInt(_0x2a7852(0x114))/0x5*(parseInt(_0x2a7852(0x100))/0x6)+parseInt(_0x2a7852(0x10c))/0x7+-parseInt(_0x2a7852(0x11a))/0x8*(-parseInt(_0x2a7852(0x10a))/0x9);if(_0x141a06===_0x5c9408)break;else _0x2032fc['push'](_0x2032fc['shift']());}catch(_0xc32c23){_0x2032fc['push'](_0x2032fc['shift']());}}}(a13_0x551f,0x24ff7));import{DevApiClient}from'../api/dev-api-client.js';function a13_0xba9a(_0x2d13e4,_0x3c6d65){_0x2d13e4=_0x2d13e4-0xfa;const _0x551fea=a13_0x551f();let _0xba9ac1=_0x551fea[_0x2d13e4];return _0xba9ac1;}import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function getDatasetOperations(_0x40fbcc){const _0x29cf09=a13_0xba9a,{appCode:appCode=process['env'][_0x29cf09(0x107)],cookie:_0x2947e1,env:env=process[_0x29cf09(0xfa)][_0x29cf09(0x116)]||_0x29cf09(0x113),datasetCode:_0x53aa09}=_0x40fbcc;if(!appCode)throw new Error(_0x29cf09(0x109));if(!_0x53aa09)throw new Error('datasetCode\x20is\x20required');const _0x8af3d5=new DevApiClient({'appCode':appCode,'cookie':_0x2947e1,'env':env}),_0x351423=/^\d+$/[_0x29cf09(0x111)](_0x53aa09);let _0x24129b;if(_0x351423)_0x24129b=_0x53aa09;else{const _0x58424d=await _0x8af3d5[_0x29cf09(0xfd)]({'pageSize':0x3e7}),_0x5d406a=_0x58424d[_0x29cf09(0x10e)]?.[_0x29cf09(0x104)]||[],_0x19b892=_0x5d406a[_0x29cf09(0xfe)](_0x2ada0d=>_0x2ada0d[_0x29cf09(0x110)]===_0x53aa09);if(!_0x19b892)throw new Error('Dataset\x20not\x20found\x20with\x20code:\x20'+_0x53aa09);_0x24129b=String(_0x19b892['id']);}const _0xa0799f=await _0x8af3d5['getDatasetDetail'](_0x24129b),_0x1f7e09=new DatasetAnalyzer(),_0x3823b0=_0x1f7e09[_0x29cf09(0xfc)](_0xa0799f);return{'appCode':appCode,'env':env,'datasetName':_0x3823b0['basic'][_0x29cf09(0x10f)],'tableName':_0x3823b0[_0x29cf09(0x117)][_0x29cf09(0x118)],'operations':_0x3823b0[_0x29cf09(0x103)][_0x29cf09(0x105)](_0x27863a=>({'name':_0x27863a[_0x29cf09(0x10f)],'displayName':_0x27863a[_0x29cf09(0xfb)],'type':_0x27863a[_0x29cf09(0x10b)],'method':_0x27863a[_0x29cf09(0x119)],'path':_0x27863a[_0x29cf09(0x10d)],'requestFieldsCount':_0x27863a[_0x29cf09(0x112)],'enabled':_0x27863a[_0x29cf09(0x102)]})),'stats':{'total':_0x3823b0['operationCount'],'enabled':_0x3823b0[_0x29cf09(0x101)],'supportsCRUD':_0x3823b0[_0x29cf09(0x115)]}};}
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 +1 @@
1
- function a14_0x1044(){var _0x744b0f=['61428bLdUqx','8649640DttOCm','2765ymFcgM','968JiNffV','2611876TixvzP','9318544CYlrDO','1227456ECtsbp','602toiJqC','1213380GVEqvd','9KzrtQe'];a14_0x1044=function(){return _0x744b0f;};return a14_0x1044();}(function(_0x1929be,_0x513928){var _0x57627d=a14_0x53a8,_0x5808fa=_0x1929be();while(!![]){try{var _0x3a4126=parseInt(_0x57627d(0x1a4))/0x1+-parseInt(_0x57627d(0x1a2))/0x2+parseInt(_0x57627d(0x19c))/0x3+parseInt(_0x57627d(0x1a1))/0x4*(-parseInt(_0x57627d(0x1a0))/0x5)+-parseInt(_0x57627d(0x19e))/0x6*(-parseInt(_0x57627d(0x19b))/0x7)+-parseInt(_0x57627d(0x1a3))/0x8*(parseInt(_0x57627d(0x19d))/0x9)+parseInt(_0x57627d(0x19f))/0xa;if(_0x3a4126===_0x513928)break;else _0x5808fa['push'](_0x5808fa['shift']());}catch(_0xa3b7a0){_0x5808fa['push'](_0x5808fa['shift']());}}}(a14_0x1044,0xbca9e));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';export{saveOrUpdateCustomSql}from'./save-or-update-custom-sql.js';export{executeCustomSql}from'./execute-custom-sql.js';function a14_0x53a8(_0x8e821,_0x1d5ff){_0x8e821=_0x8e821-0x19b;var _0x1044f9=a14_0x1044();var _0x53a842=_0x1044f9[_0x8e821];return _0x53a842;}export{generateSqlCode}from'./generate-sql-code.js';export{validateSqlContent}from'./validate-sql-content.js';
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 +1 @@
1
- function a15_0x3699(_0x4b3c8a,_0x54af45){_0x4b3c8a=_0x4b3c8a-0x16c;const _0x17a9cd=a15_0x17a9();let _0x3699a7=_0x17a9cd[_0x4b3c8a];return _0x3699a7;}(function(_0xb11400,_0x5a4612){const _0x16f579=a15_0x3699,_0x3506b4=_0xb11400();while(!![]){try{const _0x34cbb0=parseInt(_0x16f579(0x16c))/0x1*(parseInt(_0x16f579(0x178))/0x2)+parseInt(_0x16f579(0x175))/0x3+-parseInt(_0x16f579(0x173))/0x4*(parseInt(_0x16f579(0x177))/0x5)+-parseInt(_0x16f579(0x17a))/0x6+parseInt(_0x16f579(0x16f))/0x7+-parseInt(_0x16f579(0x171))/0x8*(-parseInt(_0x16f579(0x174))/0x9)+-parseInt(_0x16f579(0x16d))/0xa;if(_0x34cbb0===_0x5a4612)break;else _0x3506b4['push'](_0x3506b4['shift']());}catch(_0xbf9137){_0x3506b4['push'](_0x3506b4['shift']());}}}(a15_0x17a9,0x8c65e));import{DevApiClient}from'../api/dev-api-client.js';function a15_0x17a9(){const _0x3f8800=['total','7826280veZHCL','LOVRABET_ENV','4200WZhHad','LOVRABET_APP_CODE','60pMSjkW','5985FLeANm','178359dwXxLU','env','8825eapnwl','10xEzSVF','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','1080222oqhvRO','185635opqHGo','16732110cblNAu'];a15_0x17a9=function(){return _0x3f8800;};return a15_0x17a9();}import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function listDatasets(_0x114b26={}){const _0x5f11a4=a15_0x3699,{appCode:appCode=process[_0x5f11a4(0x176)][_0x5f11a4(0x172)],env:env=process[_0x5f11a4(0x176)][_0x5f11a4(0x170)]||'online',cookie:_0x1fd2b4,pageSize:pageSize=0x3e7,currentPage:currentPage=0x1,forceRefresh:forceRefresh=![]}=_0x114b26;if(!appCode)throw new Error(_0x5f11a4(0x179));const _0x1d4f55=new DevApiClient({'appCode':appCode,'env':env,'cookie':_0x1fd2b4}),_0x1e6745=await _0x1d4f55['getDatasetList']({'pageSize':pageSize,'currentPage':currentPage,'forceRefresh':forceRefresh}),_0x2b58df=new DatasetAnalyzer(),_0x28664a=_0x2b58df['analyzeDatasetList'](_0x1e6745);return{'appCode':appCode,'env':env,'total':_0x28664a[_0x5f11a4(0x16e)],'datasets':_0x28664a['datasets']};}
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 +1 @@
1
- function a16_0x5751(_0x44a110,_0x30f298){_0x44a110=_0x44a110-0x15a;const _0x2de57d=a16_0x2de5();let _0x57515f=_0x2de57d[_0x44a110];return _0x57515f;}function a16_0x2de5(){const _0x2eed50=['6130Zqsdhp','name','updatedTime','sqlDesc','745ruYOJP','sql_list','IMPORTANT:\x20Use\x20try-catch\x20to\x20handle\x20HTTP\x20errors\x20(network\x20issues,\x20auth\x20failures)','description','5094VARCfU','LOVRABET_APP_CODE','630690MbdoCj','online','total','createdTime','replace','sqlCode','Custom\x20SQL','length','2024-01-01','map','category','type','Parameter:\x20','env','\x20SQL\x20queries\x20for\x20application\x20','sqlName','2241534bpCPVv','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','\x27,\x0a});\x0a\x0a//\x20Execute\x20the\x20SQL\x20query:\x20','\x27);\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);\x0a}\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];','198260TMyygZ','sqlType','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','ceil','stringify','22617dlCokb','IMPORTANT:\x20All\x20SQL\x20queries\x20use\x20the\x20same\x20execution\x20pattern\x20-\x20client.api.executeSql(sqlCode,\x20params)','\x27,\x0a\x20\x20env:\x20\x27','includes','The\x20execResult\x20contains\x20an\x20array\x20of\x20row\x20objects\x20matching\x20your\x20SQL\x20query\x20structure','sqlContent',');\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});','.\x20Each\x20SQL\x20includes\x20a\x20complete\x20code\x20example\x20showing\x20how\x20to\x20execute\x20it\x20using\x20the\x20SDK.','example','SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[]\x20}\x20-\x20Always\x20check\x20execSuccess\x20before\x20using\x20execResult','toLowerCase','469dMtVWL','IMPORTANT:\x20Always\x20check\x20data.execSuccess\x20before\x20using\x20data.execResult','join','slice','from','552JvmUyM','The\x20executeSql\x20method\x20accepts\x20two\x20parameters:\x20sqlCode\x20(string)\x20and\x20optional\x20params\x20(object)','data','sqlId','21164MhWtJu','LOVRABET_ENV','sql','match','time','Execute\x20SQL\x20query:\x20','\x0a//\x20Example:\x20Using\x20SQL\x20\x22','createTime','Failed\x20to\x20list\x20SQL\x20queries:\x20','filter','value','count','35222hvArnh','message','updateTime'];a16_0x2de5=function(){return _0x2eed50;};return a16_0x2de5();}(function(_0x394e3e,_0x53ae81){const _0x9d6ab9=a16_0x5751,_0xb59c65=_0x394e3e();while(!![]){try{const _0x1dc6a5=parseInt(_0x9d6ab9(0x176))/0x1+-parseInt(_0x9d6ab9(0x162))/0x2+-parseInt(_0x9d6ab9(0x172))/0x3+parseInt(_0x9d6ab9(0x18f))/0x4*(-parseInt(_0x9d6ab9(0x15c))/0x5)+parseInt(_0x9d6ab9(0x160))/0x6*(-parseInt(_0x9d6ab9(0x186))/0x7)+parseInt(_0x9d6ab9(0x18b))/0x8*(parseInt(_0x9d6ab9(0x17b))/0x9)+-parseInt(_0x9d6ab9(0x19e))/0xa*(-parseInt(_0x9d6ab9(0x19b))/0xb);if(_0x1dc6a5===_0x53ae81)break;else _0xb59c65['push'](_0xb59c65['shift']());}catch(_0x2cb674){_0xb59c65['push'](_0xb59c65['shift']());}}}(a16_0x2de5,0x682de));import{DevApiClient}from'../api/dev-api-client.js';export async function listSqlQueries(_0x286201={}){const _0x5e0015=a16_0x5751,{appCode:appCode=process[_0x5e0015(0x16f)][_0x5e0015(0x161)],cookie:_0x4f3311,env:env=process[_0x5e0015(0x16f)][_0x5e0015(0x190)]||_0x5e0015(0x163),keyword:_0x5efe28,category:_0x310037,sqlCode:_0x1d185d,sqlName:_0x8f3b7f,pageSize:pageSize=0x3e7,currentPage:currentPage=0x1}=_0x286201;if(!appCode)throw new Error(_0x5e0015(0x178));const _0x58e5a8=new DevApiClient({'appCode':appCode,'cookie':_0x4f3311,'env':env});try{const _0x4b07ab=await _0x58e5a8['getCustomSqlList']({'pageSize':pageSize,'currentPage':currentPage,'sqlCode':_0x1d185d,'sqlName':_0x8f3b7f}),_0xa0b6e=_0x4b07ab[_0x5e0015(0x18d)]||_0x4b07ab,_0x1f3a37=_0xa0b6e['tableData']||[],_0x280fa5=_0xa0b6e[_0x5e0015(0x164)]||_0x1f3a37[_0x5e0015(0x169)];let _0x156cf9=_0x1f3a37['map'](_0x4c3ac6=>{const _0x31392e=_0x5e0015,_0x248a42=_0x4c3ac6['sqlCode']||appCode+'-'+(_0x4c3ac6[_0x31392e(0x18e)]||_0x4c3ac6['id']),_0x12b837=_0x4c3ac6[_0x31392e(0x18e)]||_0x4c3ac6['id'];let _0x3b0404;if(_0x4c3ac6[_0x31392e(0x180)]||_0x4c3ac6[_0x31392e(0x191)]){const _0x1b1a7c=_0x4c3ac6[_0x31392e(0x180)]||_0x4c3ac6['sql'],_0x3b01e7=_0x1b1a7c[_0x31392e(0x192)](/[:$]\{?(\w+)\}?/g);if(_0x3b01e7){const _0x441bf2=Array[_0x31392e(0x18a)](new Set(_0x3b01e7[_0x31392e(0x16b)](_0x53c980=>_0x53c980[_0x31392e(0x166)](/[:${}]/g,''))));_0x3b0404=_0x441bf2['map'](_0x18aea0=>{const _0x226792=_0x31392e;let _0x5da77d=_0x226792(0x199);if(_0x18aea0['toLowerCase']()[_0x226792(0x17e)]('date')||_0x18aea0[_0x226792(0x185)]()[_0x226792(0x17e)](_0x226792(0x193)))_0x5da77d=_0x226792(0x16a);else{if(_0x18aea0['toLowerCase']()[_0x226792(0x17e)]('id'))_0x5da77d=0x7b;else(_0x18aea0[_0x226792(0x185)]()[_0x226792(0x17e)]('limit')||_0x18aea0[_0x226792(0x185)]()['includes'](_0x226792(0x19a)))&&(_0x5da77d=0xa);}return{'name':_0x18aea0,'type':'string','required':!![],'description':_0x226792(0x16e)+_0x18aea0,'example':_0x5da77d};});}}const _0x2ceb3b=_0x3b0404&&_0x3b0404[_0x31392e(0x169)]>0x0,_0xe96656=_0x2ceb3b?_0x3b0404['reduce']((_0xbe02c6,_0x5dd557)=>({..._0xbe02c6,[_0x5dd557[_0x31392e(0x19f)]]:_0x5dd557[_0x31392e(0x183)]}),{}):undefined,_0x46037d={'typescript':_0x31392e(0x173)+appCode+_0x31392e(0x17d)+(env||'online')+_0x31392e(0x174)+(_0x4c3ac6[_0x31392e(0x171)]||_0x4c3ac6['name']||'SQL\x20Query')+'\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27'+_0x248a42+'\x27'+(_0x2ceb3b?',\x20'+JSON[_0x31392e(0x17a)](_0xe96656,null,0x2):'')+_0x31392e(0x181),'description':_0x31392e(0x194)+(_0x4c3ac6[_0x31392e(0x171)]||_0x4c3ac6[_0x31392e(0x19f)]||_0x31392e(0x168)),'important':[_0x31392e(0x184),_0x31392e(0x18c),_0x2ceb3b?'This\x20SQL\x20requires\x20parameters:\x20'+_0x3b0404[_0x31392e(0x16b)](_0x22a099=>_0x22a099['name']+'\x20('+_0x22a099[_0x31392e(0x16d)]+')')[_0x31392e(0x188)](',\x20'):'This\x20SQL\x20does\x20not\x20require\x20any\x20parameters','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20exception\x20-\x20use\x20try-catch\x20for\x20error\x20handling',_0x31392e(0x17f)]},_0x1317a9={'sqlCode':_0x248a42,'sqlId':_0x12b837,'name':_0x4c3ac6[_0x31392e(0x171)]||_0x4c3ac6[_0x31392e(0x19f)]||'SQL-'+_0x12b837,'description':_0x4c3ac6[_0x31392e(0x15b)]||_0x4c3ac6[_0x31392e(0x15f)],'category':_0x4c3ac6[_0x31392e(0x16c)]||_0x4c3ac6[_0x31392e(0x177)]||'other','sqlContent':_0x4c3ac6[_0x31392e(0x180)]||_0x4c3ac6[_0x31392e(0x191)],'parameters':_0x3b0404,'createdTime':_0x4c3ac6[_0x31392e(0x165)]||_0x4c3ac6[_0x31392e(0x196)],'updatedTime':_0x4c3ac6[_0x31392e(0x15a)]||_0x4c3ac6[_0x31392e(0x19d)],'codeExample':_0x46037d};return _0x1317a9;});if(_0x5efe28){const _0x343dad=_0x5efe28[_0x5e0015(0x185)]();_0x156cf9=_0x156cf9['filter'](_0x27f23e=>_0x27f23e[_0x5e0015(0x19f)][_0x5e0015(0x185)]()[_0x5e0015(0x17e)](_0x343dad)||_0x27f23e[_0x5e0015(0x15f)]&&_0x27f23e[_0x5e0015(0x15f)][_0x5e0015(0x185)]()[_0x5e0015(0x17e)](_0x343dad)||_0x27f23e[_0x5e0015(0x167)][_0x5e0015(0x185)]()[_0x5e0015(0x17e)](_0x343dad)||_0x27f23e[_0x5e0015(0x180)]&&_0x27f23e[_0x5e0015(0x180)][_0x5e0015(0x185)]()['includes'](_0x343dad));}_0x310037&&_0x310037!=='all'&&(_0x156cf9=_0x156cf9[_0x5e0015(0x198)](_0x45c482=>_0x45c482[_0x5e0015(0x16c)]&&_0x45c482[_0x5e0015(0x16c)][_0x5e0015(0x185)]()===_0x310037['toLowerCase']()));const _0x5620b2=Math[_0x5e0015(0x179)](_0x156cf9[_0x5e0015(0x169)]/pageSize),_0xf64ea=_0x156cf9[_0x5e0015(0x189)]((currentPage-0x1)*pageSize,currentPage*pageSize),_0xe3eb61=_0xf64ea[_0x5e0015(0x169)]>0x0?_0xf64ea[0x0]:null,_0x581a7b=_0xe3eb61?_0x5e0015(0x195)+_0xe3eb61[_0x5e0015(0x19f)]+'\x22\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27'+_0xe3eb61['sqlCode']+_0x5e0015(0x175):'';return{'type':_0x5e0015(0x15d),'total':_0x156cf9[_0x5e0015(0x169)],'sqls':_0xf64ea,'pagination':{'currentPage':currentPage,'pageSize':pageSize,'totalPages':_0x5620b2},'usage':{'description':'Found\x20'+_0x156cf9[_0x5e0015(0x169)]+_0x5e0015(0x170)+appCode+_0x5e0015(0x182),'important':[_0x5e0015(0x17c),_0x5e0015(0x187),'IMPORTANT:\x20The\x20SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[],\x20execError?:\x20string\x20}',_0x5e0015(0x15e),'IMPORTANT:\x20Business\x20logic\x20errors\x20(SQL\x20failures)\x20are\x20returned\x20in\x20data.execError,\x20not\x20thrown','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'],'example':_0x581a7b||'No\x20SQL\x20queries\x20found.\x20Check\x20your\x20appCode\x20and\x20authentication.'}};}catch(_0x1253c0){throw new Error(_0x5e0015(0x197)+_0x1253c0[_0x5e0015(0x19c)]);}}
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 +1 @@
1
- function a17_0x507d(_0x35077a,_0xb9f094){_0x35077a=_0x35077a-0x1db;const _0x5c7117=a17_0x5c71();let _0x507d67=_0x5c7117[_0x35077a];return _0x507d67;}(function(_0x2fb7cf,_0x542a0c){const _0x5aabcf=a17_0x507d,_0x42d311=_0x2fb7cf();while(!![]){try{const _0x5008a5=parseInt(_0x5aabcf(0x1ec))/0x1+parseInt(_0x5aabcf(0x1db))/0x2+-parseInt(_0x5aabcf(0x1ea))/0x3*(parseInt(_0x5aabcf(0x1ee))/0x4)+parseInt(_0x5aabcf(0x1eb))/0x5+parseInt(_0x5aabcf(0x1f1))/0x6+parseInt(_0x5aabcf(0x1de))/0x7*(parseInt(_0x5aabcf(0x1f2))/0x8)+-parseInt(_0x5aabcf(0x1f5))/0x9;if(_0x5008a5===_0x542a0c)break;else _0x42d311['push'](_0x42d311['shift']());}catch(_0x3513a5){_0x42d311['push'](_0x42d311['shift']());}}}(a17_0x5c71,0x6213e));function a17_0x5c71(){const _0x366ffa=['127.0.0.1','user','1408608CRCZKQ','644584nLkTst','text/plain','Login\x20server\x20error','8077680MsGqfM','close','env','/sign-in?redirect=','error','Login\x20successful\x20but\x20failed\x20to\x20save\x20cookie:\x20','https://dev.lovrabet.com:','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>','Please\x20open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20login:\x20','cookie','listen','Internal\x20server\x20error','end','object','53788TOaLKJ','port','json','7YixBFQ','Login\x20timeout\x20-\x20no\x20response\x20received\x20within\x205\x20minutes','\x20environment','address','Already\x20logged\x20in\x20to\x20','Login\x20server\x20error:\x20','</p>\x0a\x20\x20\x20\x20<p>Please\x20check\x20file\x20permissions\x20for\x20~/.lovrabet/cookie</p>\x0a\x20\x20</div>\x0a</body>\x0a</html>','message','Failed\x20to\x20fetch\x20SSL\x20certificates\x20for\x20login\x20server','https://g.yuntooai.com/cert/lovrabet-dev.json','session','text/html;\x20charset=utf-8','3BgTjll','3914475lRCjCJ','391715xcEDva','Successfully\x20logged\x20in\x20to\x20','870396ppsosD'];a17_0x5c71=function(){return _0x366ffa;};return a17_0x5c71();}import*as a17_0x5a4354 from'node:https';import{saveCookie}from'../auth/cookie-manager.js';import{isSessionValid}from'../auth/session-validator.js';import{getUserDomain}from'../auth/constants.js';export async function login(_0x3bbdc7={}){const _0x1333b8=a17_0x507d,_0x5b788f=_0x3bbdc7[_0x1333b8(0x1f7)]||'online';if(await isSessionValid(_0x5b788f))return{'success':!![],'message':_0x1333b8(0x1e2)+_0x5b788f+_0x1333b8(0x1e0),'env':_0x5b788f};let _0x24dbac;try{const _0x48ed07=await fetch(_0x1333b8(0x1e7));_0x24dbac=await _0x48ed07[_0x1333b8(0x1dd)]();}catch(_0x24f2a2){return{'success':![],'message':_0x1333b8(0x1e6),'env':_0x5b788f};}return new Promise(_0x5bc47a=>{const _0x3cfc3a=_0x1333b8;let _0x5a6c59=0x0;const _0x31a6f1=a17_0x5a4354['createServer'](_0x24dbac,async(_0x33f183,_0x5c4eeb)=>{const _0x2a4f06=a17_0x507d,_0x39651e=getUserDomain(_0x5b788f),_0x3d1f8e=_0x33f183['headers'][_0x2a4f06(0x1ff)]||'';try{const _0x52ec09=await fetch(_0x39651e+'/api/auth/get-session',{'headers':{'cookie':_0x3d1f8e}}),_0x46f8d2=await _0x52ec09['json'](),_0x3efb27=_0x46f8d2&&_0x46f8d2[_0x2a4f06(0x1e8)]&&_0x46f8d2[_0x2a4f06(0x1f0)];if(_0x3efb27){try{saveCookie(_0x3d1f8e);}catch(_0x445401){const _0x40ced6='<!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'+_0x445401['message']+_0x2a4f06(0x1e4);_0x5c4eeb['writeHead'](0x1f4,{'Content-Type':_0x2a4f06(0x1e9)}),_0x5c4eeb[_0x2a4f06(0x202)](_0x40ced6),_0x31a6f1[_0x2a4f06(0x1f6)](),_0x5bc47a({'success':![],'message':_0x2a4f06(0x1fa)+_0x445401[_0x2a4f06(0x1e5)],'env':_0x5b788f});return;}const _0x24c394=_0x2a4f06(0x1fd);_0x5c4eeb[_0x2a4f06(0x1fc)](0xc8,{'Content-Type':_0x2a4f06(0x1e9)}),_0x5c4eeb[_0x2a4f06(0x202)](_0x24c394),_0x31a6f1['close'](),_0x5bc47a({'success':!![],'message':_0x2a4f06(0x1ed)+_0x5b788f+_0x2a4f06(0x1e0),'env':_0x5b788f});}else{const _0x86d63d=encodeURIComponent(_0x2a4f06(0x1fb)+_0x5a6c59);_0x5c4eeb[_0x2a4f06(0x1fc)](0x12e,{'location':_0x39651e+_0x2a4f06(0x1f8)+_0x86d63d}),_0x5c4eeb[_0x2a4f06(0x202)]();}}catch(_0x4d15a3){_0x5c4eeb[_0x2a4f06(0x1fc)](0x1f4,{'Content-Type':_0x2a4f06(0x1f3)}),_0x5c4eeb['end'](_0x2a4f06(0x201)),_0x31a6f1[_0x2a4f06(0x1f6)](),_0x5bc47a({'success':![],'message':_0x2a4f06(0x1f4),'env':_0x5b788f});}});_0x31a6f1[_0x3cfc3a(0x200)](0x0,_0x3cfc3a(0x1ef),()=>{const _0x558323=_0x3cfc3a,_0x3a72fe=_0x31a6f1[_0x558323(0x1e1)]();_0x5a6c59=typeof _0x3a72fe===_0x558323(0x203)&&_0x3a72fe?_0x3a72fe[_0x558323(0x1dc)]:0x0;const _0x2c5e56='https://dev.lovrabet.com:'+_0x5a6c59;_0x5bc47a({'success':![],'message':_0x558323(0x1fe)+_0x2c5e56,'loginUrl':_0x2c5e56,'env':_0x5b788f});}),_0x31a6f1['on'](_0x3cfc3a(0x1f9),_0x192d3f=>{const _0x14731e=_0x3cfc3a;_0x5bc47a({'success':![],'message':_0x14731e(0x1e3)+_0x192d3f['message'],'env':_0x5b788f});}),setTimeout(()=>{const _0x1042e2=_0x3cfc3a;_0x31a6f1['close'](),_0x5bc47a({'success':![],'message':_0x1042e2(0x1df),'env':_0x5b788f});},0x5*0x3c*0x3e8);});}
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 +1 @@
1
- function a18_0x51ce(_0x419da4,_0x4a32e9){_0x419da4=_0x419da4-0x14f;const _0x2c63e4=a18_0x2c63();let _0x51ce7f=_0x2c63e4[_0x419da4];return _0x51ce7f;}(function(_0x2ce7c3,_0x2dbd7f){const _0x21b63c=a18_0x51ce,_0x1dd6d7=_0x2ce7c3();while(!![]){try{const _0x614a4c=-parseInt(_0x21b63c(0x16d))/0x1*(-parseInt(_0x21b63c(0x157))/0x2)+parseInt(_0x21b63c(0x151))/0x3+-parseInt(_0x21b63c(0x165))/0x4*(-parseInt(_0x21b63c(0x164))/0x5)+parseInt(_0x21b63c(0x176))/0x6*(-parseInt(_0x21b63c(0x17a))/0x7)+parseInt(_0x21b63c(0x16b))/0x8+parseInt(_0x21b63c(0x170))/0x9*(-parseInt(_0x21b63c(0x152))/0xa)+-parseInt(_0x21b63c(0x153))/0xb*(-parseInt(_0x21b63c(0x177))/0xc);if(_0x614a4c===_0x2dbd7f)break;else _0x1dd6d7['push'](_0x1dd6d7['shift']());}catch(_0xb5afe3){_0x1dd6d7['push'](_0x1dd6d7['shift']());}}}(a18_0x2c63,0x9ffd8));function a18_0x2c63(){const _0x3a8953=['141346yoNrda','INSERT\x5cs+INTO','message','72LXfjyr','DROP\x5cs+(TABLE|INDEX|DATABASE)','find','sqlName\x20is\x20required\x20and\x20cannot\x20be\x20empty.','SQL\x20validation\x20failed:\x20','SQL\x20content\x20cannot\x20be\x20empty','4269666mDpQQS','476544yFdYAU','env','sqlId','7oIQhnB','TRUNCATE','UPDATE\x5cs+\x5cw+\x5cs+SET','warn','createdTime','EXEC','LOVRABET_ENV','online','errorMsg','split','name','sqlCode','NODE_ENV','Failed\x20to\x20save\x20custom\x20SQL','valid','915243JVCjJF','1024750GAYLFV','44vUyMWT','sqlContent\x20is\x20required\x20and\x20cannot\x20be\x20empty.','createTime','GRANT','8IYKjYj','verified','dbId\x20is\x20required.\x20Get\x20it\x20from\x20get_dataset_detail\x20->\x20basic.database.dbId','Custom\x20SQL\x20saved\x20successfully','DELETE\x5cs+FROM','toUpperCase','sqlContent','replace','tableData','EXECUTE','success','Forbidden\x20keyword\x20detected:\x20','test','3355xDUeRP','4040hwJNCC','trim','sql','reason','startsWith','getCustomSqlList','3837664ruHuZL','\x5c\x5cs+'];a18_0x2c63=function(){return _0x3a8953;};return a18_0x2c63();}import{DevApiClient}from'../api/dev-api-client.js';function validateSelectSql(_0x4cbeb2){const _0x503a0b=a18_0x51ce;if(!_0x4cbeb2||typeof _0x4cbeb2!=='string')return{'valid':![],'reason':_0x503a0b(0x175)};const _0x301d46=_0x4cbeb2[_0x503a0b(0x15e)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x503a0b(0x15e)](/@[^(\s]+(\([^)]*\))?/g,''),_0x2a32a6=_0x301d46['trim'](),_0x34aa83=_0x2a32a6[_0x503a0b(0x183)]('\x0a');let _0x22eba5='';for(const _0x5df3b1 of _0x34aa83){const _0x428c7e=_0x5df3b1[_0x503a0b(0x166)]();if(!_0x428c7e||_0x428c7e[_0x503a0b(0x169)]('--')||_0x428c7e['startsWith']('/*'))continue;_0x22eba5=_0x428c7e;break;}if(!_0x22eba5[_0x503a0b(0x15c)]()['startsWith']('SELECT'))return{'valid':![],'reason':'Only\x20SELECT\x20queries\x20are\x20allowed.\x20The\x20SQL\x20must\x20start\x20with\x20SELECT\x20(after\x20any\x20comments).'};const _0x397ab5=[_0x503a0b(0x16e),_0x503a0b(0x17c),_0x503a0b(0x15b),_0x503a0b(0x171),'ALTER\x5cs+(TABLE|DATABASE)','CREATE\x5cs+(TABLE|INDEX|DATABASE|VIEW)',_0x503a0b(0x17b),_0x503a0b(0x156),'REVOKE',_0x503a0b(0x17f),_0x503a0b(0x160)],_0x3ddf35=_0x2a32a6['toUpperCase']();for(const _0x115ce2 of _0x397ab5){const _0x82eed3=new RegExp(_0x115ce2,'i');if(_0x82eed3[_0x503a0b(0x163)](_0x3ddf35))return{'valid':![],'reason':_0x503a0b(0x162)+_0x115ce2[_0x503a0b(0x15e)](_0x503a0b(0x16c),'\x20')+'.\x20Only\x20SELECT\x20queries\x20are\x20allowed.'};}return{'valid':!![]};}export async function saveCustomSql(_0x2899d7){const _0x510b18=a18_0x51ce,{appCode:appCode=process[_0x510b18(0x178)]['LOVRABET_APP_CODE'],cookie:_0x582343,env:env=process[_0x510b18(0x178)][_0x510b18(0x180)]||_0x510b18(0x181),sqlName:_0x4af78e,dbId:_0x2c39b9,sqlContent:_0x33eb1a,verifyAfterSave:verifyAfterSave=!![]}=_0x2899d7;if(!appCode)throw new Error('appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.');if(!_0x4af78e||_0x4af78e[_0x510b18(0x166)]()==='')throw new Error(_0x510b18(0x173));if(!_0x2c39b9)throw new Error(_0x510b18(0x159));if(!_0x33eb1a||_0x33eb1a[_0x510b18(0x166)]()==='')throw new Error(_0x510b18(0x154));const _0x268404=validateSelectSql(_0x33eb1a);if(!_0x268404[_0x510b18(0x150)])throw new Error(_0x510b18(0x174)+_0x268404[_0x510b18(0x168)]);const _0x3e4420=new DevApiClient({'appCode':appCode,'cookie':_0x582343,'env':env}),_0x2613dc=_0x4af78e[_0x510b18(0x166)](),_0x3da562=await _0x3e4420['saveUserCustomSql']({'sqlName':_0x2613dc,'dbId':_0x2c39b9,'sqlContent':_0x33eb1a[_0x510b18(0x166)]()});if(!_0x3da562[_0x510b18(0x161)])return{'success':![],'message':_0x3da562[_0x510b18(0x16f)]||_0x3da562[_0x510b18(0x182)]||_0x510b18(0x14f)};const _0x17b4c5={'success':!![],'message':_0x510b18(0x15a),'data':_0x3da562['data']};if(verifyAfterSave)try{const _0x3ab6cb=await _0x3e4420[_0x510b18(0x16a)]({'pageSize':0xa,'currentPage':0x1,'sqlName':_0x2613dc}),_0x37db21=_0x3ab6cb['data']?.[_0x510b18(0x15f)]||[],_0x1ef87f=_0x37db21[_0x510b18(0x172)](_0x2c6ccc=>_0x2c6ccc['sqlName']===_0x2613dc||_0x2c6ccc['name']===_0x2613dc);_0x1ef87f?_0x17b4c5[_0x510b18(0x158)]={'found':!![],'sqlInfo':{'sqlCode':_0x1ef87f[_0x510b18(0x185)]||appCode+'-'+(_0x1ef87f[_0x510b18(0x179)]||_0x1ef87f['id']),'sqlId':_0x1ef87f['sqlId']||_0x1ef87f['id'],'name':_0x1ef87f['sqlName']||_0x1ef87f[_0x510b18(0x184)],'sqlContent':_0x1ef87f[_0x510b18(0x15d)]||_0x1ef87f[_0x510b18(0x167)],'createdTime':_0x1ef87f[_0x510b18(0x17e)]||_0x1ef87f[_0x510b18(0x155)]}}:_0x17b4c5[_0x510b18(0x158)]={'found':![]};}catch(_0x3a5945){process[_0x510b18(0x178)][_0x510b18(0x186)]!==_0x510b18(0x163)&&console[_0x510b18(0x17d)]('[saveCustomSql]\x20Verification\x20query\x20failed:',_0x3a5945),_0x17b4c5['verified']={'found':![]};}return _0x17b4c5;}
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 +1 @@
1
- function a19_0x41e5(){const _0x12c24f=['code','id\x20is\x20required\x20for\x20updating\x20existing\x20SQL.','4612416yvmUTc','createTime','12SSwAfU','high','sqlName\x20is\x20required\x20and\x20cannot\x20be\x20empty.','sqlCode','Execute\x20the\x20SQL\x20to\x20check\x20for\x20runtime\x20errors','SQL\x20validation\x20failed:\x20','Confirm\x20the\x20dbId\x20matches\x20the\x20database\x20you\x20want\x20to\x20use','8dXxckq','getCustomSqlList','medium','27qIhKfn','tables','Get\x20ready-to-use\x20TypeScript\x20code\x20for\x20your\x20application','errorMsg','updateUserCustomSql','now','sqlContent','updatedTime','LOVRABET_ENV','1677470rObNBH','login','env','\x22\x20updated\x20successfully\x20(','7szXYeV','\x20custom\x20SQL','saveUserCustomSql','trim','execute_custom_sql','Check\x20database\x20connection\x20and\x20permissions','valid','Custom\x20SQL\x20\x22','1313577HTcpXJ','4389854oazOoL','120426vXXhUO','Test\x20the\x20SQL\x20to\x20verify\x20it\x20works\x20correctly','generate_sql_code','params','get_dataset_detail','success','reason','26agTGPb','sqlId','data','sqlContent\x20is\x20required\x20and\x20cannot\x20be\x20empty.','sqlName','length','19756iPcbiK','online','name','LOVRABET_APP_CODE','\x22\x20saved\x20successfully\x20(','verified','31470VReesX','sqlInfo','updated','createdTime','2541KukSPE','<dataset-code>','dbId\x20is\x20required.\x20Get\x20it\x20from\x20get_dataset_detail\x20->\x20basic.database.dbId','Verify\x20database\x20ID\x20is\x20correct','sql','warn','find','created','sqlCode\x20is\x20required\x20for\x20updating\x20existing\x20SQL.','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','updateTime','update'];a19_0x41e5=function(){return _0x12c24f;};return a19_0x41e5();}(function(_0xe8f553,_0xbd54d6){const _0x3936c4=a19_0x4cc3,_0x1cf772=_0xe8f553();while(!![]){try{const _0x2df0a3=parseInt(_0x3936c4(0xf6))/0x1*(parseInt(_0x3936c4(0x100))/0x2)+-parseInt(_0x3936c4(0xe9))/0x3*(-parseInt(_0x3936c4(0x10d))/0x4)+parseInt(_0x3936c4(0xf2))/0x5*(parseInt(_0x3936c4(0xdf))/0x6)+-parseInt(_0x3936c4(0xff))/0x7*(-parseInt(_0x3936c4(0xe6))/0x8)+parseInt(_0x3936c4(0xfe))/0x9+-parseInt(_0x3936c4(0x113))/0xa*(parseInt(_0x3936c4(0x117))/0xb)+-parseInt(_0x3936c4(0x125))/0xc*(parseInt(_0x3936c4(0x107))/0xd);if(_0x2df0a3===_0xbd54d6)break;else _0x1cf772['push'](_0x1cf772['shift']());}catch(_0x2ba459){_0x1cf772['push'](_0x1cf772['shift']());}}}(a19_0x41e5,0x65268));import{DevApiClient}from'../api/dev-api-client.js';import{validateIsSelectOnly,parseSqlStructure,generateSqlSummary}from'../utils/sql-parser.js';function a19_0x4cc3(_0x28f77b,_0x51161d){_0x28f77b=_0x28f77b-0xde;const _0x41e576=a19_0x41e5();let _0x4cc3ac=_0x41e576[_0x28f77b];return _0x4cc3ac;}export async function saveOrUpdateCustomSql(_0x56e625){const _0x1e8549=a19_0x4cc3,_0x48561e=Date[_0x1e8549(0xee)](),{appCode:appCode=process[_0x1e8549(0xf4)][_0x1e8549(0x110)],cookie:_0x7c8eea,env:env=process[_0x1e8549(0xf4)][_0x1e8549(0xf1)]||_0x1e8549(0x10e),sqlName:_0x49672f,dbId:_0x50d7ad,sqlContent:_0x317f17,id:_0x1b310c,sqlCode:_0x159895,verifyAfterSave:verifyAfterSave=!![],validateSchema:validateSchema=![]}=_0x56e625;if(!appCode)throw new Error(_0x1e8549(0x120));if(!_0x49672f||_0x49672f[_0x1e8549(0xf9)]()==='')throw new Error(_0x1e8549(0xe1));if(!_0x50d7ad)throw new Error(_0x1e8549(0x119));if(!_0x317f17||_0x317f17[_0x1e8549(0xf9)]()==='')throw new Error(_0x1e8549(0x10a));const _0x5e556d=_0x1b310c!==undefined&&_0x1b310c>0x0||_0x159895!==undefined&&_0x159895[_0x1e8549(0xf9)]()!=='';if(_0x5e556d){if(!_0x1b310c)throw new Error(_0x1e8549(0x124));if(!_0x159895)throw new Error(_0x1e8549(0x11f));}const _0xf3dddc=validateIsSelectOnly(_0x317f17);if(!_0xf3dddc[_0x1e8549(0xfc)])throw new Error(_0x1e8549(0xe4)+_0xf3dddc[_0x1e8549(0x106)]);const _0xe61a7a=parseSqlStructure(_0x317f17),_0x62e494=generateSqlSummary(_0x317f17),_0x1e5bfe=new DevApiClient({'appCode':appCode,'cookie':_0x7c8eea,'env':env}),_0x552bfd=_0x49672f['trim']();let _0x54e2a6;_0x5e556d?_0x54e2a6=await _0x1e5bfe[_0x1e8549(0xed)]({'id':_0x1b310c,'sqlCode':_0x159895[_0x1e8549(0xf9)](),'sqlName':_0x552bfd,'dbId':_0x50d7ad,'sqlContent':_0x317f17[_0x1e8549(0xf9)]()}):_0x54e2a6=await _0x1e5bfe[_0x1e8549(0xf8)]({'sqlName':_0x552bfd,'dbId':_0x50d7ad,'sqlContent':_0x317f17[_0x1e8549(0xf9)]()});const _0x522336=Date[_0x1e8549(0xee)]()-_0x48561e;if(!_0x54e2a6[_0x1e8549(0x105)])return{'success':![],'action':_0x5e556d?_0x1e8549(0x115):'created','message':_0x54e2a6['message']||_0x54e2a6[_0x1e8549(0xec)]||'Failed\x20to\x20'+(_0x5e556d?_0x1e8549(0x122):'save')+_0x1e8549(0xf7),'nextSteps':[{'action':_0x1e8549(0xfb),'tool':_0x1e8549(0xf3),'reason':'Ensure\x20you\x20are\x20logged\x20in\x20with\x20proper\x20permissions'},{'action':_0x1e8549(0x11a),'tool':_0x1e8549(0x104),'params':{'datasetCode':_0x1e8549(0x118)},'reason':_0x1e8549(0xe5)}]};const _0x107b2c=_0x54e2a6[_0x1e8549(0x109)]?.['sqlCode']||_0x54e2a6[_0x1e8549(0x109)]?.[_0x1e8549(0x123)],_0x20eba2=_0x54e2a6[_0x1e8549(0x109)]?.['sqlId']||_0x54e2a6[_0x1e8549(0x109)]?.['id'],_0x2fe8a0=[{'action':_0x1e8549(0x101),'tool':_0x1e8549(0xfa),'params':{'sqlCode':_0x107b2c||''},'reason':_0x1e8549(0xe3),'priority':_0x1e8549(0xe0)},{'action':'Generate\x20SDK\x20code\x20for\x20this\x20SQL','tool':_0x1e8549(0x102),'params':{'sqlCode':_0x107b2c||''},'reason':_0x1e8549(0xeb),'priority':_0x1e8549(0xe8)}],_0x46cc1d={'success':!![],'action':_0x5e556d?_0x1e8549(0x115):_0x1e8549(0x11e),'message':_0x5e556d?'Custom\x20SQL\x20\x22'+_0x552bfd+_0x1e8549(0xf5)+_0x62e494+')':_0x1e8549(0xfd)+_0x552bfd+_0x1e8549(0x111)+_0x62e494+')','nextSteps':_0x2fe8a0,'parsedStructure':{'tables':_0xe61a7a[_0x1e8549(0xea)],'columns':_0xe61a7a['columns'][_0x1e8549(0x10c)],'parameters':_0xe61a7a['parameters'],'summary':_0x62e494},'data':_0x54e2a6[_0x1e8549(0x109)]};if(verifyAfterSave)try{const _0x42c43a=await _0x1e5bfe[_0x1e8549(0xe7)]({'pageSize':0xa,'currentPage':0x1,'sqlName':_0x552bfd}),_0x506e8b=_0x42c43a['data']?.['tableData']||[],_0x471c1b=_0x506e8b[_0x1e8549(0x11d)](_0x15b102=>_0x15b102['sqlName']===_0x552bfd||_0x15b102[_0x1e8549(0x10f)]===_0x552bfd);_0x471c1b?(_0x46cc1d[_0x1e8549(0x112)]={'found':!![],'sqlInfo':{'sqlCode':_0x471c1b[_0x1e8549(0xe2)]||appCode+'-'+(_0x471c1b[_0x1e8549(0x108)]||_0x471c1b['id']),'sqlId':_0x471c1b[_0x1e8549(0x108)]||_0x471c1b['id'],'id':_0x471c1b['id'],'name':_0x471c1b[_0x1e8549(0x10b)]||_0x471c1b[_0x1e8549(0x10f)],'sqlContent':_0x471c1b[_0x1e8549(0xef)]||_0x471c1b[_0x1e8549(0x11b)],'createdTime':_0x471c1b[_0x1e8549(0x116)]||_0x471c1b[_0x1e8549(0xde)],'updatedTime':_0x471c1b[_0x1e8549(0xf0)]||_0x471c1b[_0x1e8549(0x121)]}},_0x46cc1d['verified']['sqlInfo']?.['sqlCode']&&(_0x2fe8a0[0x0][_0x1e8549(0x103)]={'sqlCode':_0x46cc1d[_0x1e8549(0x112)][_0x1e8549(0x114)]['sqlCode']},_0x2fe8a0[0x1][_0x1e8549(0x103)]={'sqlCode':_0x46cc1d[_0x1e8549(0x112)][_0x1e8549(0x114)]['sqlCode']})):_0x46cc1d['verified']={'found':![]};}catch(_0x44637b){process[_0x1e8549(0xf4)]['NODE_ENV']!=='test'&&console[_0x1e8549(0x11c)]('[saveOrUpdateCustomSql]\x20Verification\x20query\x20failed:',_0x44637b),_0x46cc1d[_0x1e8549(0x112)]={'found':![]};}return _0x46cc1d;}
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 +1 @@
1
- function a20_0x34b6(_0x49c513,_0x3cf7d2){_0x49c513=_0x49c513-0x7b;const _0x2c9ce2=a20_0x2c9c();let _0x34b608=_0x2c9ce2[_0x49c513];return _0x34b608;}(function(_0x13183f,_0x3c3791){const _0x3da3e5=a20_0x34b6,_0x870ade=_0x13183f();while(!![]){try{const _0x25f9e1=-parseInt(_0x3da3e5(0x7f))/0x1*(-parseInt(_0x3da3e5(0x7e))/0x2)+-parseInt(_0x3da3e5(0x8e))/0x3+-parseInt(_0x3da3e5(0x91))/0x4+-parseInt(_0x3da3e5(0x80))/0x5+parseInt(_0x3da3e5(0x8b))/0x6+parseInt(_0x3da3e5(0x8a))/0x7*(-parseInt(_0x3da3e5(0x84))/0x8)+-parseInt(_0x3da3e5(0x82))/0x9*(-parseInt(_0x3da3e5(0x8c))/0xa);if(_0x25f9e1===_0x3c3791)break;else _0x870ade['push'](_0x870ade['shift']());}catch(_0x25eae4){_0x870ade['push'](_0x870ade['shift']());}}}(a20_0x2c9c,0x9459b));import{DevApiClient}from'../api/dev-api-client.js';import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function searchDatasets(_0x200a01){const _0x4e8a7d=a20_0x34b6,{appCode:appCode=process[_0x4e8a7d(0x7c)][_0x4e8a7d(0x7b)],cookie:_0x4194d4,env:env=process[_0x4e8a7d(0x7c)][_0x4e8a7d(0x89)]||_0x4e8a7d(0x7d),keyword:_0x3ae43c}=_0x200a01;if(!appCode)throw new Error(_0x4e8a7d(0x88));if(!_0x3ae43c)throw new Error(_0x4e8a7d(0x8d));const _0x5ddd08=new DevApiClient({'appCode':appCode,'cookie':_0x4194d4,'env':env}),_0x325a8c=await _0x5ddd08[_0x4e8a7d(0x8f)](_0x3ae43c),_0xbd8f9=new DatasetAnalyzer(),_0x35ef19=_0xbd8f9[_0x4e8a7d(0x92)](_0x325a8c);return{'appCode':appCode,'env':env,'keyword':_0x3ae43c,'total':_0x35ef19[_0x4e8a7d(0x90)],'datasets':_0x35ef19[_0x4e8a7d(0x86)][_0x4e8a7d(0x87)](_0x568300=>({'id':_0x568300['id'],'name':_0x568300[_0x4e8a7d(0x81)],'code':_0x568300[_0x4e8a7d(0x85)],'tableName':_0x568300[_0x4e8a7d(0x83)],'description':_0x568300['description']}))};}function a20_0x2c9c(){const _0x2b8452=['LOVRABET_APP_CODE','env','online','35524impwbb','17sPnFAX','494860VrlyIU','name','16291971hnLCWF','tableName','2351976WTDyhv','code','datasets','map','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','LOVRABET_ENV','21ZjGlGW','2244438vAoLyQ','10cTyuFO','keyword\x20is\x20required','367875phIwDG','searchDatasets','total','3100060SYqjvp','analyzeDatasetList'];a20_0x2c9c=function(){return _0x2b8452;};return a20_0x2c9c();}
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 +1 @@
1
- (function(_0x5cae91,_0x2788bf){const _0x5c0747=a21_0x5490,_0x35ddaa=_0x5cae91();while(!![]){try{const _0x5ba279=parseInt(_0x5c0747(0x1f9))/0x1+-parseInt(_0x5c0747(0x1cc))/0x2+parseInt(_0x5c0747(0x1da))/0x3*(-parseInt(_0x5c0747(0x1f2))/0x4)+parseInt(_0x5c0747(0x1c7))/0x5*(-parseInt(_0x5c0747(0x1e0))/0x6)+parseInt(_0x5c0747(0x1ec))/0x7+-parseInt(_0x5c0747(0x1c6))/0x8+parseInt(_0x5c0747(0x1d3))/0x9;if(_0x5ba279===_0x2788bf)break;else _0x35ddaa['push'](_0x35ddaa['shift']());}catch(_0x4ec1e3){_0x35ddaa['push'](_0x35ddaa['shift']());}}}(a21_0x5815,0x72d8a));import{DevApiClient}from'../api/dev-api-client.js';import{validateIsSelectOnly,parseSqlStructure,validateSqlContent as a21_0x5a6b09,generateSqlSummary}from'../utils/sql-parser.js';function a21_0x5490(_0x5a1d82,_0x792caf){_0x5a1d82=_0x5a1d82-0x1c6;const _0x581529=a21_0x5815();let _0x549037=_0x581529[_0x5a1d82];return _0x549037;}async function fetchSchemaInfo(_0x443358,_0x264874){const _0x4b5c49=a21_0x5490,_0x11c89=[];for(const _0x238fad of _0x443358){try{const _0x55c2a4=/^\d+$/[_0x4b5c49(0x1ce)](_0x238fad);let _0x4108be=_0x238fad;if(!_0x55c2a4){const _0x4b9caf=await _0x264874['getDatasetList']({'pageSize':0x3e7}),_0x347b90=_0x4b9caf[_0x4b5c49(0x1ea)]?.[_0x4b5c49(0x1f8)]||[],_0x498453=_0x347b90['find'](_0x5536ef=>_0x5536ef[_0x4b5c49(0x1ed)]===_0x238fad);if(!_0x498453)continue;_0x4108be=String(_0x498453['id']);}const _0x153d97=await _0x264874[_0x4b5c49(0x1e1)](_0x4108be),_0x49938e=_0x153d97['data']?.[_0x4b5c49(0x1f6)]||'',_0x285a4b=_0x153d97[_0x4b5c49(0x1ea)]?.[_0x4b5c49(0x1fa)]||[],_0x2546ab=_0x285a4b[_0x4b5c49(0x1d5)](_0x30edcb=>_0x30edcb['code']||_0x30edcb[_0x4b5c49(0x1dc)]);_0x49938e&&_0x2546ab[_0x4b5c49(0x1fb)]>0x0&&_0x11c89[_0x4b5c49(0x1f0)]({'tableName':_0x49938e,'columns':_0x2546ab});}catch(_0x183cf4){process[_0x4b5c49(0x1e6)][_0x4b5c49(0x1d4)]!==_0x4b5c49(0x1ce)&&console[_0x4b5c49(0x1d8)](_0x4b5c49(0x1e9)+_0x238fad+':',_0x183cf4);}}return _0x11c89;}export async function validateSqlContentTool(_0x133797){const _0x228958=a21_0x5490,{appCode:appCode=process['env'][_0x228958(0x1f7)],cookie:_0x3c64c3,env:env=process[_0x228958(0x1e6)]['LOVRABET_ENV']||'online',sqlContent:_0x591543,dbId:_0x31ff68,validateSchemas:validateSchemas=[]}=_0x133797;if(!_0x591543||_0x591543[_0x228958(0x1d2)]()==='')return{'success':![],'message':'SQL\x20content\x20is\x20required','validation':{'valid':![],'isSelectOnly':![]},'nextSteps':[{'action':'Provide\x20SQL\x20content\x20to\x20validate','tool':_0x228958(0x1c9),'reason':_0x228958(0x1cd)}]};const _0x502f46=validateIsSelectOnly(_0x591543);if(!_0x502f46['valid'])return{'success':![],'message':_0x228958(0x1f1)+_0x502f46[_0x228958(0x1ef)],'validation':{'valid':![],'isSelectOnly':![],'errors':[{'type':_0x228958(0x1d9),'location':'SQL_START','message':_0x502f46[_0x228958(0x1ef)]||'Invalid\x20SQL','suggestion':_0x228958(0x1d7)}]},'nextSteps':[{'action':_0x228958(0x1fc),'tool':'save_or_update_custom_sql','reason':'Only\x20SELECT\x20queries\x20are\x20allowed\x20for\x20custom\x20SQL'}]};const _0x29f8f8=parseSqlStructure(_0x591543),_0x1d1e54=generateSqlSummary(_0x591543);let _0x40d50d;if(validateSchemas['length']>0x0&&appCode){const _0x4076c7=new DevApiClient({'appCode':appCode,'cookie':_0x3c64c3,'env':env});_0x40d50d=await fetchSchemaInfo(validateSchemas,_0x4076c7);}const _0x27887b=a21_0x5a6b09(_0x591543,_0x40d50d?{'tables':_0x40d50d}:undefined),_0xc6251c={'success':_0x27887b['valid']||!![],'message':_0x27887b[_0x228958(0x1dd)]?_0x228958(0x1d1)+_0x1d1e54+')':_0x228958(0x1e5)+(_0x27887b[_0x228958(0x1d6)]?.['length']||0x0)+_0x228958(0x1e4),'validation':{..._0x27887b,'parsedStructure':_0x29f8f8}},_0x22c892=[];if(_0x27887b['valid'])_0x31ff68?_0x22c892[_0x228958(0x1f0)]({'action':'Save\x20this\x20validated\x20SQL','tool':_0x228958(0x1d0),'params':{'sqlName':_0x228958(0x1ee),'dbId':_0x31ff68,'sqlContent':_0x591543},'reason':_0x228958(0x1db),'priority':_0x228958(0x1de)}):_0x22c892[_0x228958(0x1f0)]({'action':'Get\x20database\x20ID\x20to\x20save\x20this\x20SQL','tool':_0x228958(0x1e2),'params':{'datasetCode':_0x228958(0x1eb)},'reason':_0x228958(0x1e8),'priority':_0x228958(0x1de)});else{_0x22c892[_0x228958(0x1f0)]({'action':_0x228958(0x1cf),'tool':'validate_sql_content','reason':'Fix\x20the\x20identified\x20errors\x20before\x20saving','priority':_0x228958(0x1de)});for(const _0x53dda7 of _0x27887b[_0x228958(0x1d6)]||[]){if(_0x53dda7['type']===_0x228958(0x1e7)||_0x53dda7[_0x228958(0x1f3)]===_0x228958(0x1f5)){_0x22c892[_0x228958(0x1f0)]({'action':'Get\x20dataset\x20details\x20to\x20find\x20correct\x20table/column\x20names','tool':_0x228958(0x1e2),'params':{'datasetCode':_0x228958(0x1eb)},'reason':_0x53dda7['suggestion'],'priority':_0x228958(0x1ca)});break;}}}return!_0x27887b['valid']&&_0x27887b[_0x228958(0x1d6)]?.[_0x228958(0x1cb)](_0x158445=>_0x158445['type']===_0x228958(0x1f5))&&_0x22c892['push']({'action':_0x228958(0x1df),'tool':_0x228958(0x1c8),'reason':_0x228958(0x1f4),'priority':_0x228958(0x1ca)}),_0xc6251c[_0x228958(0x1e3)]=_0x22c892,_0xc6251c;}function a21_0x5815(){const _0x456695=['Need\x20dbId\x20from\x20dataset\x20detail\x20to\x20save\x20SQL','[validateSqlContent]\x20Failed\x20to\x20fetch\x20schema\x20for\x20','data','<dataset-code>','2076235SggSvG','code','<sql-name>','reason','push','SQL\x20validation\x20failed:\x20','44mpNKdf','type','Find\x20the\x20correct\x20table\x20names\x20for\x20your\x20SQL','TABLE_NOT_FOUND','tableName','LOVRABET_APP_CODE','tableData','662936RTAEjc','properties','length','Modify\x20SQL\x20to\x20be\x20a\x20SELECT\x20statement\x20only','5302120uUaRKq','395lQNXeZ','list_datasets','validate_sql_content','medium','some','294966oVVayf','SQL\x20content\x20cannot\x20be\x20empty','test','Review\x20SQL\x20errors\x20and\x20fix','save_or_update_custom_sql','SQL\x20validation\x20passed\x20(','trim','11728233qLvyGp','NODE_ENV','map','errors','SQL\x20must\x20be\x20a\x20SELECT\x20statement','warn','SYNTAX_ERROR','122241MKgpWc','SQL\x20is\x20valid\x20and\x20ready\x20to\x20be\x20saved','fieldCode','valid','high','List\x20all\x20available\x20datasets','40542VNRuYD','getDatasetDetail','get_dataset_detail','nextSteps','\x20error(s))','SQL\x20validation\x20failed\x20(','env','COLUMN_NOT_FOUND'];a21_0x5815=function(){return _0x456695;};return a21_0x5815();}export{validateSqlContentTool as validateSqlContent};
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 +1 @@
1
- export{};
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 +1 @@
1
- (function(_0x448114,_0x205ea2){var _0x31f455=a23_0x1b99,_0x4cb6cb=_0x448114();while(!![]){try{var _0x7b53c0=-parseInt(_0x31f455(0xbc))/0x1*(-parseInt(_0x31f455(0xc8))/0x2)+-parseInt(_0x31f455(0xa5))/0x3*(parseInt(_0x31f455(0xbd))/0x4)+-parseInt(_0x31f455(0xc9))/0x5*(parseInt(_0x31f455(0xb4))/0x6)+-parseInt(_0x31f455(0xb2))/0x7+parseInt(_0x31f455(0xa9))/0x8+parseInt(_0x31f455(0xb9))/0x9*(-parseInt(_0x31f455(0xb1))/0xa)+parseInt(_0x31f455(0xb3))/0xb*(parseInt(_0x31f455(0xc6))/0xc);if(_0x7b53c0===_0x205ea2)break;else _0x4cb6cb['push'](_0x4cb6cb['shift']());}catch(_0x504d59){_0x4cb6cb['push'](_0x4cb6cb['shift']());}}}(a23_0x29a3,0xa86bc));export function createError(_0x111740){var _0x3d9815=a23_0x1b99;return{'error':!![],'code':_0x111740[_0x3d9815(0xa7)],'message':_0x111740[_0x3d9815(0xbb)],'technical':_0x111740[_0x3d9815(0xab)],'suggestedAction':_0x111740[_0x3d9815(0xae)],'recoverable':_0x111740[_0x3d9815(0xc4)]??!![],'timestamp':new Date()[_0x3d9815(0xc0)]()};}export function createAuthError(){var _0x1581c2=a23_0x1b99;return createError({'code':_0x1581c2(0xb8),'message':'需要登录才能访问\x20Lovrabet\x20数据。请先使用\x20login\x20工具进行登录。','suggestedAction':{'tool':'login','description':_0x1581c2(0xb0),'example':_0x1581c2(0xa6)},'recoverable':!![]});}function a23_0x29a3(){var _0x509d5d=['缺少必需参数:\x20','toISOString','list_datasets({\x20pageSize:\x20999\x20})','PARAMETER_MISSING','SQL_VALIDATION_FAILED','recoverable','list_datasets','24axCMtk','list_sql_queries({\x20pageSize:\x20999\x20})','815902ziWzni','25Cuvoeh','6ZGKpOf','login({\x20env:\x20\x22online\x22\x20})','code','<dataset-code>','516656JUztqp','获取数据集详情以确认表名和字段名','technical','location','type','suggestedAction','SQL\x20不存在:\x20','登录到\x20Lovrabet\x20平台','67170nkGafq','1061256JFWqZB','9864074AAMTFn','672726kTApRn','SQL_NOT_FOUND','数据集不存在:\x20','查看所有可用的\x20SQL\x20查询','AUTH_REQUIRED','1647bfrhIV','查看所有可用的数据集','message','2BfYHpG','85352QvAqHb','get_dataset_detail'];a23_0x29a3=function(){return _0x509d5d;};return a23_0x29a3();}export function createMissingParamError(_0x4bb75f,_0x1f8518){var _0x52522a=a23_0x1b99;return createError({'code':_0x52522a(0xc2),'message':_0x52522a(0xbf)+_0x4bb75f+(_0x1f8518?'\x20('+_0x1f8518+')':''),'recoverable':!![]});}function a23_0x1b99(_0x4d3c9d,_0x5ef90d){_0x4d3c9d=_0x4d3c9d-0xa5;var _0x29a317=a23_0x29a3();var _0x1b99a1=_0x29a317[_0x4d3c9d];return _0x1b99a1;}export function createDatasetNotFoundError(_0x24f1c0){var _0x12b6d5=a23_0x1b99;return createError({'code':'DATASET_NOT_FOUND','message':_0x12b6d5(0xb6)+_0x24f1c0,'suggestedAction':{'tool':_0x12b6d5(0xc5),'description':_0x12b6d5(0xba),'example':_0x12b6d5(0xc1)},'recoverable':!![]});}export function createSqlNotFoundError(_0x514adc){var _0x2bc5b2=a23_0x1b99;return createError({'code':_0x2bc5b2(0xb5),'message':_0x2bc5b2(0xaf)+_0x514adc,'suggestedAction':{'tool':'list_sql_queries','description':_0x2bc5b2(0xb7),'example':_0x2bc5b2(0xc7)},'recoverable':!![]});}export function createSqlValidationError(_0x1ad024){var _0x3ff3f8=a23_0x1b99;return createError({'code':_0x3ff3f8(0xc3),'message':'SQL\x20验证失败:\x20'+_0x1ad024[_0x3ff3f8(0xbb)],'technical':_0x1ad024[_0x3ff3f8(0xad)]+':\x20'+_0x1ad024[_0x3ff3f8(0xac)],'suggestedAction':{'tool':_0x3ff3f8(0xbe),'description':_0x3ff3f8(0xaa),'params':{'datasetCode':_0x3ff3f8(0xa8)}},'recoverable':!![]});}
1
+ const a23_0x16119f=a23_0x564e;(function(_0x44dbfc,_0x105768){const _0x31b16b=a23_0x564e,_0x1339a0=_0x44dbfc();while(!![]){try{const _0xa849ac=parseInt(_0x31b16b(0x86))/0x1*(parseInt(_0x31b16b(0x9b))/0x2)+-parseInt(_0x31b16b(0x97))/0x3+parseInt(_0x31b16b(0x74))/0x4+parseInt(_0x31b16b(0xa0))/0x5*(parseInt(_0x31b16b(0x7a))/0x6)+-parseInt(_0x31b16b(0x85))/0x7+parseInt(_0x31b16b(0x78))/0x8*(-parseInt(_0x31b16b(0x7b))/0x9)+parseInt(_0x31b16b(0x76))/0xa;if(_0xa849ac===_0x105768)break;else _0x1339a0['push'](_0x1339a0['shift']());}catch(_0x26ffc4){_0x1339a0['push'](_0x1339a0['shift']());}}}(a23_0x4483,0x47631));export const SQL_ERROR_TYPE_LABELS={'TABLE_NOT_FOUND':a23_0x16119f(0xb0),'COLUMN_NOT_FOUND':a23_0x16119f(0xab),'AMBIGUOUS_COLUMN':'字段名歧义','SYNTAX_ERROR':a23_0x16119f(0xa9),'TYPE_MISMATCH':'类型不匹配','MISSING_WHERE_CLAUSE':'缺少\x20WHERE\x20条件','UNSAFE_QUERY':a23_0x16119f(0x81)};function a23_0x564e(_0x3b9762,_0x17fb76){_0x3b9762=_0x3b9762-0x72;const _0x44832d=a23_0x4483();let _0x564e24=_0x44832d[_0x3b9762];return _0x564e24;}export function createError(_0xeeb8f){const _0x3d589a=a23_0x16119f;return{'error':!![],'code':_0xeeb8f[_0x3d589a(0x88)],'message':_0xeeb8f[_0x3d589a(0x98)],'status':_0xeeb8f[_0x3d589a(0x72)],'description':_0xeeb8f[_0x3d589a(0x94)],'response':_0xeeb8f[_0x3d589a(0x83)],'suggestedAction':_0xeeb8f[_0x3d589a(0x92)],'recoverable':_0xeeb8f['recoverable']??!![],'timestamp':new Date()[_0x3d589a(0x91)]()};}export function createAuthError(){const _0x4c251a=a23_0x16119f;return createError({'code':_0x4c251a(0xaa),'message':_0x4c251a(0x7f),'suggestedAction':{'tool':'login','description':_0x4c251a(0x9f),'example':_0x4c251a(0x8b)},'recoverable':!![]});}export function createMissingParamError(_0x502385,_0xc7f8cb){const _0x5490f8=a23_0x16119f;return createError({'code':_0x5490f8(0x75),'message':_0x5490f8(0xa6)+_0x502385+(_0xc7f8cb?'\x20('+_0xc7f8cb+')':''),'recoverable':!![]});}export function createDatasetNotFoundError(_0x46f043){const _0x3f604a=a23_0x16119f;return createError({'code':_0x3f604a(0x87),'message':_0x3f604a(0x7d)+_0x46f043,'suggestedAction':{'tool':_0x3f604a(0x82),'description':_0x3f604a(0xad),'example':_0x3f604a(0x8a)},'recoverable':!![]});}export function createSqlNotFoundError(_0x157195){const _0x3170f2=a23_0x16119f;return createError({'code':_0x3170f2(0x93),'message':_0x3170f2(0x99)+_0x157195,'suggestedAction':{'tool':_0x3170f2(0xa4),'description':_0x3170f2(0x9d),'example':_0x3170f2(0xa1)},'recoverable':!![]});}export function createSqlValidationError(_0x4f35f5){const _0x158876=a23_0x16119f,_0x4c72b1=_0x4f35f5[_0x158876(0x77)][_0x158876(0xaf)]>0x0,_0x5e0642=_0x4c72b1?_0x4f35f5[_0x158876(0x77)][0x0]:undefined,_0x2ad8a2={'type':_0x4f35f5[_0x158876(0x90)],'typeLabel':_0x4f35f5['typeLabel'],'location':_0x4f35f5[_0x158876(0xa2)],'severity':_0x4f35f5[_0x158876(0xae)],'fixSteps':_0x4f35f5['fixSteps'],'suggestions':_0x4f35f5[_0x158876(0xac)],'canAutoFix':_0x4f35f5['canAutoFix'],'fixedSql':_0x4f35f5[_0x158876(0x96)]};return createError({'code':'SQL_VALIDATION_FAILED','message':_0x4f35f5[_0x158876(0xa5)]+':\x20'+_0x4f35f5[_0x158876(0x98)],'status':_0x4f35f5[_0x158876(0x72)],'description':_0x2ad8a2,'response':_0x4f35f5['response'],'suggestedAction':_0x5e0642?{'tool':_0x5e0642[_0x158876(0x84)],'description':_0x5e0642[_0x158876(0x94)],'params':_0x5e0642[_0x158876(0x89)],'example':_0x5e0642[_0x158876(0x7c)]}:{'tool':_0x158876(0x80),'description':'获取数据集详情以确认表名和字段名','params':{'datasetCode':_0x158876(0x95)}},'recoverable':_0x4f35f5[_0x158876(0xae)]!=='error'});}export function createStructuredSqlError(_0x3de6a5){const _0x4e1037=a23_0x16119f,_0x167238=SQL_ERROR_TYPE_LABELS[_0x3de6a5[_0x4e1037(0x90)]],_0x5d310b=_0x3de6a5[_0x4e1037(0xae)]??_0x4e1037(0x7e),_0x2f6ae5=[];if(_0x3de6a5[_0x4e1037(0x90)]===_0x4e1037(0x8d))_0x2f6ae5[_0x4e1037(0x9c)]({'description':_0x4e1037(0x9a),'tool':'list_datasets','toolParams':{'pageSize':0x3e7},'example':_0x4e1037(0x8a)});else{if(_0x3de6a5[_0x4e1037(0x90)]==='COLUMN_NOT_FOUND')_0x2f6ae5[_0x4e1037(0x9c)]({'description':_0x4e1037(0xa3),'tool':_0x4e1037(0x80),'toolParams':{'datasetCode':_0x4e1037(0x95)},'example':'get_dataset_detail({\x20datasetCode:\x20\x22customer\x22\x20})'});else _0x3de6a5[_0x4e1037(0x90)]===_0x4e1037(0x9e)&&_0x2f6ae5[_0x4e1037(0x9c)]({'description':_0x4e1037(0x8c),'example':_0x4e1037(0xa8)});}return{'type':_0x3de6a5[_0x4e1037(0x90)],'typeLabel':_0x167238,'location':_0x3de6a5[_0x4e1037(0xa2)],'message':_0x3de6a5[_0x4e1037(0x98)],'severity':_0x5d310b,'fixSteps':_0x3de6a5['fixSteps']??_0x2f6ae5,'suggestions':_0x3de6a5['suggestions'],'canAutoFix':_0x3de6a5[_0x4e1037(0x73)],'fixedSql':_0x3de6a5[_0x4e1037(0x96)],'status':_0x3de6a5[_0x4e1037(0x72)],'response':_0x3de6a5[_0x4e1037(0x83)]};}export function fromLovrabetError(_0xc5182b,_0x55fa59){const _0x17fa5a=a23_0x16119f;return createError({'code':mapSdkCodeToMcpCode(_0xc5182b[_0x17fa5a(0x88)]),'message':_0xc5182b['message'],'status':_0xc5182b[_0x17fa5a(0x72)],'description':_0xc5182b[_0x17fa5a(0x94)],'response':_0xc5182b[_0x17fa5a(0x83)],'suggestedAction':_0x55fa59,'recoverable':_0xc5182b[_0x17fa5a(0x72)]?_0xc5182b['status']<0x1f4:!![]});}function mapSdkCodeToMcpCode(_0x1830aa){const _0x53e4e6=a23_0x16119f;if(!_0x1830aa)return'UNKNOWN_ERROR';const _0x54d91b={'AUTH_REQUIRED':'AUTH_REQUIRED','AUTH_FAILED':_0x53e4e6(0xaa),'UNAUTHORIZED':_0x53e4e6(0xaa),'DATASET_NOT_FOUND':'DATASET_NOT_FOUND','NOT_FOUND':'DATASET_NOT_FOUND','INVALID_PARAMETER':_0x53e4e6(0x8e),'MISSING_PARAMETER':_0x53e4e6(0x75),'SQL_ERROR':_0x53e4e6(0xa7),'NETWORK_ERROR':'NETWORK_ERROR','API_ERROR':_0x53e4e6(0x8f)};return _0x54d91b[_0x1830aa]||_0x53e4e6(0x79);}function a23_0x4483(){const _0x502796=['1667988bOjfYe','PARAMETER_MISSING','3332170UaElAg','fixSteps','48HycHwt','UNKNOWN_ERROR','6eQhHFE','627111rPGPYs','example','数据集不存在:\x20','error','需要登录才能访问\x20Lovrabet\x20数据。请先使用\x20login\x20工具进行登录。','get_dataset_detail','不安全的查询','list_datasets','response','tool','306145ppzQKf','542GtJvrZ','DATASET_NOT_FOUND','code','toolParams','list_datasets({\x20pageSize:\x20999\x20})','login({\x20env:\x20\x22online\x22\x20})','检查\x20SQL\x20语法,确保关键字拼写正确、括号匹配','TABLE_NOT_FOUND','PARAMETER_INVALID','API_ERROR','type','toISOString','suggestedAction','SQL_NOT_FOUND','description','<dataset-code>','fixedSql','553803FYabHQ','message','SQL\x20不存在:\x20','使用\x20list_datasets\x20工具查看所有可用的数据集表名','526lNJhly','push','查看所有可用的\x20SQL\x20查询','SYNTAX_ERROR','登录到\x20Lovrabet\x20平台','230255aPSwDw','list_sql_queries({\x20pageSize:\x20999\x20})','location','使用\x20get_dataset_detail\x20工具查看数据集的所有字段','list_sql_queries','typeLabel','缺少必需参数:\x20','SQL_EXECUTION_FAILED','确保\x20SELECT\x20语句格式正确,如:\x20SELECT\x20id,\x20name\x20FROM\x20table\x20WHERE\x20status\x20=\x201','语法错误','AUTH_REQUIRED','字段不存在','suggestions','查看所有可用的数据集','severity','length','表不存在','status','canAutoFix'];a23_0x4483=function(){return _0x502796;};return a23_0x4483();}