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

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(_0x2fcb26,_0x3334f4){const _0x4cb663=a10_0x553d,_0x2eef3d=_0x2fcb26();while(!![]){try{const _0x233996=parseInt(_0x4cb663(0xd4))/0x1+parseInt(_0x4cb663(0x106))/0x2+parseInt(_0x4cb663(0xe1))/0x3+-parseInt(_0x4cb663(0xdf))/0x4*(-parseInt(_0x4cb663(0xff))/0x5)+-parseInt(_0x4cb663(0xed))/0x6*(parseInt(_0x4cb663(0xe7))/0x7)+parseInt(_0x4cb663(0xd0))/0x8*(parseInt(_0x4cb663(0xd2))/0x9)+parseInt(_0x4cb663(0xd8))/0xa*(-parseInt(_0x4cb663(0xe5))/0xb);if(_0x233996===_0x3334f4)break;else _0x2eef3d['push'](_0x2eef3d['shift']());}catch(_0x3218f5){_0x2eef3d['push'](_0x2eef3d['shift']());}}}(a10_0x621a,0xacbe3));import{DevApiClient}from'../api/dev-api-client.js';function a10_0x621a(){const _0x177324=['online','45891HmHwNn','name','sqlCode\x20is\x20required','Failed\x20to\x20verify\x20SQL\x20code:\x20','6170LvObVl','limit','getCustomSqlList','SQL\x20code\x20\x22','Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.','page','message','184748EFQdPL','\x22\x20exists\x20and\x20is\x20valid.','3540702OrTLgq','replace','stringify','reduce','37103HvBsgO','sqlContent','56651fSmODg','This\x20SQL\x20requires\x20parameters:\x20','example','SQL-','size','Check\x20the\x20sqlCode\x20from\x20list_sql_queries\x20result\x20and\x20use\x20the\x20exact\x20value.','534UUNSnM','map','includes','2024-01-01','//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27',');\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});','trim','data','sqlId','\x22\x20does\x20not\x20exist.\x20Use\x20list_sql_queries\x20to\x20find\x20valid\x20SQL\x20codes.','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','toLowerCase','\x27,\x0a\x20\x20env:\x20\x27','search','tableData','sqlName','Generated\x20code\x20for\x20executing\x20custom\x20SQL:\x20','sqlCode','40pOkJBF','This\x20SQL\x20does\x20not\x20require\x20any\x20parameters','\x27,\x0a});\x0a\x0a//\x20Execute\x20SQL:\x20','\x22\x20not\x20found\x20in\x20the\x20application.','status','from','LOVRABET_ENV','1165964DrkLwp','env','value','\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27','6920OqJBfs','find','13842JbrrOu'];a10_0x621a=function(){return _0x177324;};return a10_0x621a();}export async function generateSqlCode(_0x271a60){const _0x20f2b8=a10_0x553d,{appCode:appCode=process[_0x20f2b8(0x107)]['LOVRABET_APP_CODE'],cookie:_0x3dec68,env:env=process['env'][_0x20f2b8(0x105)]||_0x20f2b8(0xd3),sqlCode:_0x1895de,params:_0x26e9c2,includeImports:includeImports=!![]}=_0x271a60;if(!appCode)throw new Error(_0x20f2b8(0xf7));if(!_0x1895de||_0x1895de[_0x20f2b8(0xf3)]()==='')return{'success':![],'sqlCode':'','sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[]},'error':_0x20f2b8(0xd6)};const _0x4988a7=_0x1895de[_0x20f2b8(0xf3)](),_0x5ad225=new DevApiClient({'appCode':appCode,'cookie':_0x3dec68,'env':env});try{const _0x3cd9e3=await _0x5ad225[_0x20f2b8(0xda)]({'pageSize':0x3e7,'currentPage':0x1,'sqlCode':_0x4988a7}),_0x4b4d54=_0x3cd9e3[_0x20f2b8(0xf4)]?.[_0x20f2b8(0xfb)]||[],_0x3dad64=_0x4b4d54[_0x20f2b8(0xd1)](_0x4d6c38=>_0x4d6c38['sqlCode']===_0x4988a7||_0x4d6c38[_0x20f2b8(0xfe)]?.['includes'](_0x4988a7)||_0x4988a7[_0x20f2b8(0xef)](_0x4d6c38['sqlCode']));if(!_0x3dad64)return{'success':![],'sqlCode':_0x4988a7,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':['SQL\x20code\x20\x22'+_0x4988a7+_0x20f2b8(0x102),_0x20f2b8(0xdc),_0x20f2b8(0xec)]},'error':_0x20f2b8(0xdb)+_0x4988a7+_0x20f2b8(0xf6)};const _0x22e956=_0x3dad64[_0x20f2b8(0xfe)],_0x5aaf89=_0x3dad64[_0x20f2b8(0xfc)]||_0x3dad64[_0x20f2b8(0xd5)]||_0x20f2b8(0xea)+(_0x3dad64[_0x20f2b8(0xf5)]||_0x3dad64['id']),_0x710821=_0x3dad64[_0x20f2b8(0xe6)]||_0x3dad64['sql']||'',_0x1409b4=_0x710821['match'](/[:$]\{?(\w+)\}?/g);let _0x2cbb1a,_0x552dd7;if(_0x1409b4){const _0x3759ec=Array[_0x20f2b8(0x104)](new Set(_0x1409b4[_0x20f2b8(0xee)](_0x43245c=>_0x43245c[_0x20f2b8(0xe2)](/[:${}]/g,''))));_0x2cbb1a=_0x3759ec['map'](_0x307cd9=>{const _0x11611e=_0x26e9c2?.[_0x307cd9]??getDefaultExample(_0x307cd9);return{'name':_0x307cd9,'example':_0x11611e};}),_0x552dd7=_0x2cbb1a[_0x20f2b8(0xe4)]((_0x196898,_0x51e3a6)=>({..._0x196898,[_0x51e3a6['name']]:_0x51e3a6[_0x20f2b8(0xe9)]}),{});}else _0x26e9c2&&(_0x2cbb1a=Object['entries'](_0x26e9c2)[_0x20f2b8(0xee)](([_0x13eb0f,_0xb9c1db])=>({'name':_0x13eb0f,'example':_0xb9c1db})),_0x552dd7=_0x26e9c2);const _0x2a6d21=_0x2cbb1a&&_0x2cbb1a['length']>0x0,_0xe41dab=_0x2a6d21?JSON[_0x20f2b8(0xe3)](_0x552dd7,null,0x2):'',_0x2547ab=(includeImports?'import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a':'')+_0x20f2b8(0xf1)+appCode+_0x20f2b8(0xf9)+env+_0x20f2b8(0x101)+_0x5aaf89+_0x20f2b8(0xcf)+_0x22e956+'\x27'+(_0x2a6d21?',\x20'+_0xe41dab:'')+_0x20f2b8(0xf2);return{'success':!![],'sqlCode':_0x22e956,'sqlName':_0x5aaf89,'sqlExists':!![],'code':_0x2547ab,'parameters':_0x2cbb1a,'usage':{'description':_0x20f2b8(0xfd)+_0x5aaf89,'important':[_0x20f2b8(0xdb)+_0x22e956+_0x20f2b8(0xe0),'SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[],\x20execError?:\x20string\x20}','Always\x20check\x20execSuccess\x20before\x20using\x20execResult',_0x2a6d21?_0x20f2b8(0xe8)+_0x2cbb1a['map'](_0x46b5ff=>_0x46b5ff['name'])['join'](',\x20'):_0x20f2b8(0x100),'On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20exception\x20-\x20use\x20try-catch']}};}catch(_0x454b75){return{'success':![],'sqlCode':_0x4988a7,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x20f2b8(0xd7)+_0x454b75[_0x20f2b8(0xde)],_0x20f2b8(0xdc)]},'error':_0x20f2b8(0xd7)+_0x454b75[_0x20f2b8(0xde)]};}}function a10_0x553d(_0x2e2e33,_0x4ff13d){_0x2e2e33=_0x2e2e33-0xcf;const _0x621afe=a10_0x621a();let _0x553dad=_0x621afe[_0x2e2e33];return _0x553dad;}function getDefaultExample(_0x5c3615){const _0x4fd077=a10_0x553d,_0x265fad=_0x5c3615[_0x4fd077(0xf8)]();if(_0x265fad[_0x4fd077(0xef)]('date')||_0x265fad[_0x4fd077(0xef)]('time'))return _0x4fd077(0xf0);if(_0x265fad['includes']('id'))return 0x7b;if(_0x265fad[_0x4fd077(0xef)](_0x4fd077(0xd9))||_0x265fad[_0x4fd077(0xef)]('count')||_0x265fad['includes'](_0x4fd077(0xeb)))return 0xa;if(_0x265fad[_0x4fd077(0xef)](_0x4fd077(0xdd)))return 0x1;if(_0x265fad[_0x4fd077(0xef)]('keyword')||_0x265fad[_0x4fd077(0xef)](_0x4fd077(0xfa))||_0x265fad['includes'](_0x4fd077(0xd5)))return _0x4fd077(0xe9);if(_0x265fad[_0x4fd077(0xef)](_0x4fd077(0x103)))return 0x1;return _0x4fd077(0x108);}
@@ -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 a11_0x581c(_0x2dd64b,_0x107a5c){_0x2dd64b=_0x2dd64b-0x13f;const _0x37970e=a11_0x3797();let _0x581c02=_0x37970e[_0x2dd64b];return _0x581c02;}(function(_0x1d1b17,_0x295171){const _0x20b5f2=a11_0x581c,_0x50c160=_0x1d1b17();while(!![]){try{const _0x278ad0=parseInt(_0x20b5f2(0x169))/0x1+parseInt(_0x20b5f2(0x144))/0x2+parseInt(_0x20b5f2(0x141))/0x3*(parseInt(_0x20b5f2(0x158))/0x4)+parseInt(_0x20b5f2(0x165))/0x5*(-parseInt(_0x20b5f2(0x178))/0x6)+parseInt(_0x20b5f2(0x150))/0x7*(-parseInt(_0x20b5f2(0x14e))/0x8)+-parseInt(_0x20b5f2(0x156))/0x9*(parseInt(_0x20b5f2(0x15e))/0xa)+-parseInt(_0x20b5f2(0x14a))/0xb;if(_0x278ad0===_0x295171)break;else _0x50c160['push'](_0x50c160['shift']());}catch(_0x56abfd){_0x50c160['push'](_0x50c160['shift']());}}}(a11_0x3797,0x7645d));import{DevApiClient}from'../api/dev-api-client.js';import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function getDatasetDetail(_0x233524){const _0x47efcf=a11_0x581c,_0x397986=Date[_0x47efcf(0x14f)](),{appCode:appCode=process['env'][_0x47efcf(0x140)],cookie:_0x5ce88f,env:env=process[_0x47efcf(0x151)][_0x47efcf(0x16b)]||'online',datasetCode:_0x2a6262,forceRefresh:forceRefresh=![]}=_0x233524;if(!appCode)throw new Error(_0x47efcf(0x15c));if(!_0x2a6262)throw new Error(_0x47efcf(0x153));const _0x5b5d1c=new DevApiClient({'appCode':appCode,'cookie':_0x5ce88f,'env':env}),_0x219137=/^\d+$/['test'](_0x2a6262);let _0x3e93a1;if(_0x219137)_0x3e93a1=_0x2a6262;else{const _0x12e170=await _0x5b5d1c[_0x47efcf(0x16d)]({'pageSize':0x3e7,'forceRefresh':forceRefresh}),_0x40a662=_0x12e170[_0x47efcf(0x146)]?.[_0x47efcf(0x148)]||[],_0x442320=_0x40a662[_0x47efcf(0x172)](_0x2ff5a8=>_0x2ff5a8[_0x47efcf(0x157)]===_0x2a6262);if(!_0x442320)throw new Error('Dataset\x20not\x20found\x20with\x20code:\x20'+_0x2a6262);_0x3e93a1=String(_0x442320['id']);}const _0x134d81=await _0x5b5d1c[_0x47efcf(0x13f)](_0x3e93a1,forceRefresh),_0x22c1ca=new DatasetAnalyzer(),_0xef0267=_0x22c1ca[_0x47efcf(0x15d)](_0x134d81),_0x379a7a=_0xef0267['fields'][_0x47efcf(0x166)](_0x63fc5a=>_0x63fc5a['primaryKey'])[_0x47efcf(0x14d)](_0x49e512=>_0x49e512[_0x47efcf(0x162)]),_0x1d91e1=_0xef0267['fields'][_0x47efcf(0x166)](_0x16b2af=>_0x16b2af[_0x47efcf(0x142)])[_0x47efcf(0x14d)](_0x3be8e1=>_0x3be8e1['name']),_0x4e056b=[_0x47efcf(0x16c),_0x47efcf(0x154),_0x47efcf(0x160),_0x47efcf(0x175),_0x47efcf(0x174),_0x47efcf(0x143),'active',_0x47efcf(0x149),_0x47efcf(0x16e),'deleted',_0x47efcf(0x167)],_0x343fcb=_0xef0267[_0x47efcf(0x147)]['filter'](_0xbd2f2a=>{const _0xd22bd=_0x47efcf,_0x2ce970=_0xbd2f2a[_0xd22bd(0x162)][_0xd22bd(0x145)]();return _0x4e056b[_0xd22bd(0x17b)](_0x165002=>_0x2ce970[_0xd22bd(0x155)](_0x165002)||_0x2ce970===_0x165002);})[_0x47efcf(0x14d)](_0x2df150=>_0x2df150[_0x47efcf(0x162)]),_0x551abe=_0xef0267[_0x47efcf(0x147)][_0x47efcf(0x166)](_0x1aaa67=>{const _0x8cd54f=_0x47efcf,_0x205c46=_0x1aaa67['name'][_0x8cd54f(0x145)]();return _0x205c46[_0x8cd54f(0x171)](_0x8cd54f(0x159))||_0x205c46[_0x8cd54f(0x171)]('id');})[_0x47efcf(0x166)](_0x4dce4d=>!_0x4dce4d[_0x47efcf(0x176)])[_0x47efcf(0x14d)](_0x4f16ad=>{const _0x12d626=_0x47efcf,_0xb21edd=_0x4f16ad[_0x12d626(0x162)]['replace'](/_id$/,'')[_0x12d626(0x152)](/Id$/,'');return{'field':_0x4f16ad[_0x12d626(0x162)],'suggestsForeignKeyTo':_0xb21edd};}),_0x1bb173=_0xef0267[_0x47efcf(0x147)][_0x47efcf(0x166)](_0x39a965=>_0x39a965['enumValues']&&_0x39a965[_0x47efcf(0x17a)][_0x47efcf(0x14b)]>0x0)[_0x47efcf(0x14d)](_0x535126=>({'field':_0x535126[_0x47efcf(0x162)],'options':(_0x535126[_0x47efcf(0x17a)]||[])[_0x47efcf(0x14d)](_0x135200=>({'label':String(_0x135200),'value':_0x135200}))})),_0x5e95f4={'primaryKeys':_0x379a7a,'filterableFields':_0x343fcb,'joinableFields':_0x551abe,'requiredFields':_0x1d91e1,'enumFields':_0x1bb173},_0x113708=[],_0x198dd4=_0xef0267['operations']['find'](_0x19a006=>_0x19a006[_0x47efcf(0x160)]===_0x47efcf(0x166));_0x198dd4&&_0x113708['push']({'action':_0x47efcf(0x14c),'tool':_0x47efcf(0x15b),'params':{'datasetCode':_0x2a6262,'operationName':_0x47efcf(0x166)},'reason':_0x47efcf(0x161),'priority':'high'});_0xef0267[_0x47efcf(0x16f)]['database']?.[_0x47efcf(0x17c)]&&_0x113708['push']({'action':_0x47efcf(0x177),'tool':_0x47efcf(0x173),'params':{'sqlContent':_0x47efcf(0x170)+_0xef0267[_0x47efcf(0x16f)]['tableName'],'dbId':_0xef0267[_0x47efcf(0x16f)][_0x47efcf(0x164)][_0x47efcf(0x17c)]},'reason':_0x47efcf(0x168),'priority':_0x47efcf(0x17d)});_0x113708['push']({'action':'Browse\x20related\x20datasets','tool':_0x47efcf(0x16a),'reason':_0x47efcf(0x179),'priority':'low'});const _0x5a3505=Date[_0x47efcf(0x14f)]()-_0x397986;return{'appCode':appCode,'env':env,'basic':_0xef0267[_0x47efcf(0x16f)],'fields':_0xef0267[_0x47efcf(0x147)],'operations':_0xef0267[_0x47efcf(0x15f)],'stats':{'fieldCount':_0xef0267['fieldCount'],'operationCount':_0xef0267[_0x47efcf(0x163)],'enabledOperationCount':_0xef0267[_0x47efcf(0x15a)],'supportsCRUD':_0xef0267['supportsCRUD']},'sqlValidationHints':_0x5e95f4,'nextSteps':_0x113708};}function a11_0x3797(){const _0x267602=['type','Get\x20ready-to-use\x20TypeScript\x20code\x20for\x20querying\x20this\x20dataset','name','operationCount','database','10IOXVOH','filter','archived','Validate\x20and\x20prepare\x20custom\x20SQL\x20for\x20this\x20dataset','461409eVGyRB','list_datasets','LOVRABET_ENV','status','getDatasetList','visible','basic','SELECT\x20*\x20FROM\x20','endsWith','find','validate_sql_content','level','category','primaryKey','Create\x20custom\x20SQL\x20for\x20this\x20dataset','387708YAjKyo','Find\x20other\x20datasets\x20that\x20might\x20be\x20related\x20for\x20JOIN\x20operations','enumValues','some','dbId','medium','getDatasetDetail','LOVRABET_APP_CODE','3MpWMuB','required','priority','1434624tjWfXI','toLowerCase','data','fields','tableData','enabled','3159376QADyRP','length','Generate\x20SDK\x20code\x20for\x20querying\x20this\x20dataset','map','5042456NHaLUB','now','7nKFnoL','env','replace','datasetCode\x20is\x20required','state','includes','903492goszld','code','3417692TDILgK','_id','enabledOperationCount','generate_sdk_code','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','analyzeDatasetDetail','50bCskDP','operations'];a11_0x3797=function(){return _0x267602;};return a11_0x3797();}
@@ -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(_0x21a5f9,_0x3a95d4){const _0x984fd3=a12_0x5b48,_0x229ac9=_0x21a5f9();while(!![]){try{const _0x2e2233=-parseInt(_0x984fd3(0x18f))/0x1+parseInt(_0x984fd3(0x188))/0x2*(-parseInt(_0x984fd3(0x18c))/0x3)+-parseInt(_0x984fd3(0x18e))/0x4+parseInt(_0x984fd3(0x18b))/0x5*(parseInt(_0x984fd3(0x183))/0x6)+parseInt(_0x984fd3(0x184))/0x7+parseInt(_0x984fd3(0x181))/0x8+-parseInt(_0x984fd3(0x182))/0x9*(-parseInt(_0x984fd3(0x185))/0xa);if(_0x2e2233===_0x3a95d4)break;else _0x229ac9['push'](_0x229ac9['shift']());}catch(_0x9c173f){_0x229ac9['push'](_0x229ac9['shift']());}}}(a12_0x4e80,0xf31b1));function a12_0x5b48(_0x1419ff,_0x3ea956){_0x1419ff=_0x1419ff-0x180;const _0x4e807d=a12_0x4e80();let _0x5b482f=_0x4e807d[_0x1419ff];return _0x5b482f;}function a12_0x4e80(){const _0x276415=['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.','find','721592oUbiPX','tableData','Operation\x20\x27','25JQyxKF','6NWLWKV','code','4656908RdqEix','1380692qKQFnY','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.','env','data','getDatasetList','analyzeDatasetDetail','name','online','LOVRABET_APP_CODE','getDatasetDetail','datasetCode\x20is\x20required','operationName\x20is\x20required','6318728AnljSa','369gBzpzt','2025474iJCAhP','12332754XYXTCG','5540sQyRAK'];a12_0x4e80=function(){return _0x276415;};return a12_0x4e80();}import{DevApiClient}from'../api/dev-api-client.js';import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function getOperationDetail(_0x361ce9){const _0x16b877=a12_0x5b48,{appCode:appCode=process[_0x16b877(0x191)][_0x16b877(0x197)],cookie:_0xec4e4a,env:env=process[_0x16b877(0x191)]['LOVRABET_ENV']||_0x16b877(0x196),datasetCode:_0x5acfca,operationName:_0x129588}=_0x361ce9;if(!appCode)throw new Error('appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.');if(!_0x5acfca)throw new Error(_0x16b877(0x199));if(!_0x129588)throw new Error(_0x16b877(0x180));const _0x21bccc=new DevApiClient({'appCode':appCode,'cookie':_0xec4e4a,'env':env}),_0x3949d5=/^\d+$/['test'](_0x5acfca);let _0x21cb19;if(_0x3949d5)_0x21cb19=_0x5acfca;else{const _0x4716e5=await _0x21bccc[_0x16b877(0x193)]({'pageSize':0x3e7}),_0x72fb40=_0x4716e5[_0x16b877(0x192)]?.[_0x16b877(0x189)]||[],_0x584395=_0x72fb40[_0x16b877(0x187)](_0x56c003=>_0x56c003[_0x16b877(0x18d)]===_0x5acfca);if(!_0x584395)throw new Error('Dataset\x20not\x20found\x20with\x20code:\x20'+_0x5acfca);_0x21cb19=String(_0x584395['id']);}const _0x237fc5=await _0x21bccc[_0x16b877(0x198)](_0x21cb19),_0x52d121=new DatasetAnalyzer(),_0x1689fd=_0x52d121['getOperationDetail'](_0x237fc5,_0x129588);if(!_0x1689fd)throw new Error(_0x16b877(0x18a)+_0x129588+'\x27\x20not\x20found\x20in\x20dataset\x20\x27'+_0x5acfca+'\x27');const _0x284b22=_0x52d121[_0x16b877(0x194)](_0x237fc5);return{'appCode':appCode,'env':env,'datasetName':_0x284b22['basic'][_0x16b877(0x195)],'operation':_0x1689fd,'sdkReturnValueBehavior':{'onSuccess':_0x16b877(0x190),'onError':'Throws\x20LovrabetError\x20exception\x20with\x20full\x20response.\x20The\x20error\x20object\x20contains:\x20{\x20message:\x20string,\x20status?:\x20number\x20(HTTP\x20code),\x20code?:\x20string\x20(business\x20error\x20code),\x20data?:\x20any\x20(full\x20error\x20response)\x20}','note':_0x16b877(0x186)}};}
@@ -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(_0x579920,_0x42d68f){const _0x38eddd=a13_0x396f,_0x378258=_0x579920();while(!![]){try{const _0x23c051=-parseInt(_0x38eddd(0x1e4))/0x1+-parseInt(_0x38eddd(0x1d1))/0x2*(parseInt(_0x38eddd(0x1df))/0x3)+-parseInt(_0x38eddd(0x1ce))/0x4+parseInt(_0x38eddd(0x1cc))/0x5*(-parseInt(_0x38eddd(0x1e8))/0x6)+parseInt(_0x38eddd(0x1d7))/0x7+-parseInt(_0x38eddd(0x1ea))/0x8+parseInt(_0x38eddd(0x1e2))/0x9;if(_0x23c051===_0x42d68f)break;else _0x378258['push'](_0x378258['shift']());}catch(_0x621810){_0x378258['push'](_0x378258['shift']());}}}(a13_0x5866,0x41b68));import{DevApiClient}from'../api/dev-api-client.js';import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';function a13_0x396f(_0x1fd658,_0x3aac07){_0x1fd658=_0x1fd658-0x1cb;const _0x5866ea=a13_0x5866();let _0x396f3d=_0x5866ea[_0x1fd658];return _0x396f3d;}export async function getDatasetOperations(_0x167d06){const _0x5a2b30=a13_0x396f,{appCode:appCode=process[_0x5a2b30(0x1da)][_0x5a2b30(0x1cf)],cookie:_0x53637b,env:env=process[_0x5a2b30(0x1da)][_0x5a2b30(0x1e3)]||_0x5a2b30(0x1de),datasetCode:_0x5c3572}=_0x167d06;if(!appCode)throw new Error(_0x5a2b30(0x1ec));if(!_0x5c3572)throw new Error(_0x5a2b30(0x1d2));const _0x52bd39=new DevApiClient({'appCode':appCode,'cookie':_0x53637b,'env':env}),_0x4cefa5=/^\d+$/[_0x5a2b30(0x1d8)](_0x5c3572);let _0x275161;if(_0x4cefa5)_0x275161=_0x5c3572;else{const _0x26ad51=await _0x52bd39[_0x5a2b30(0x1cb)]({'pageSize':0x3e7}),_0x1cdb8e=_0x26ad51[_0x5a2b30(0x1e0)]?.[_0x5a2b30(0x1cd)]||[],_0x1709d8=_0x1cdb8e[_0x5a2b30(0x1dc)](_0x125ae3=>_0x125ae3[_0x5a2b30(0x1d9)]===_0x5c3572);if(!_0x1709d8)throw new Error(_0x5a2b30(0x1dd)+_0x5c3572);_0x275161=String(_0x1709d8['id']);}const _0xc96774=await _0x52bd39[_0x5a2b30(0x1e1)](_0x275161),_0x3db80e=new DatasetAnalyzer(),_0x3378e3=_0x3db80e[_0x5a2b30(0x1d3)](_0xc96774);return{'appCode':appCode,'env':env,'datasetName':_0x3378e3[_0x5a2b30(0x1ee)][_0x5a2b30(0x1e7)],'tableName':_0x3378e3[_0x5a2b30(0x1ee)][_0x5a2b30(0x1eb)],'operations':_0x3378e3[_0x5a2b30(0x1e5)][_0x5a2b30(0x1d0)](_0x240188=>({'name':_0x240188[_0x5a2b30(0x1e7)],'displayName':_0x240188[_0x5a2b30(0x1d6)],'type':_0x240188['type'],'method':_0x240188[_0x5a2b30(0x1ed)],'path':_0x240188[_0x5a2b30(0x1e6)],'requestFieldsCount':_0x240188['requestFieldsCount'],'enabled':_0x240188[_0x5a2b30(0x1d4)]})),'stats':{'total':_0x3378e3[_0x5a2b30(0x1d5)],'enabled':_0x3378e3[_0x5a2b30(0x1db)],'supportsCRUD':_0x3378e3[_0x5a2b30(0x1e9)]}};}function a13_0x5866(){const _0x4cf934=['getDatasetDetail','15891246vUznUg','LOVRABET_ENV','208737MleUiP','operations','path','name','564aecmbB','supportsCRUD','3687936XzPtme','tableName','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','method','basic','getDatasetList','1535yAzZWY','tableData','2140192DyaEpT','LOVRABET_APP_CODE','map','315086Tsydze','datasetCode\x20is\x20required','analyzeDatasetDetail','enabled','operationCount','displayName','1468110OzWojB','test','code','env','enabledOperationCount','find','Dataset\x20not\x20found\x20with\x20code:\x20','online','9GJuZSp','data'];a13_0x5866=function(){return _0x4cf934;};return a13_0x5866();}
@@ -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(_0x3449f7,_0x1a9b69){var _0x346dbb=a14_0x1e8f,_0x31c76a=_0x3449f7();while(!![]){try{var _0x2e3357=parseInt(_0x346dbb(0x76))/0x1+parseInt(_0x346dbb(0x7b))/0x2*(-parseInt(_0x346dbb(0x7a))/0x3)+parseInt(_0x346dbb(0x74))/0x4+parseInt(_0x346dbb(0x77))/0x5*(parseInt(_0x346dbb(0x79))/0x6)+-parseInt(_0x346dbb(0x7d))/0x7+parseInt(_0x346dbb(0x7c))/0x8+-parseInt(_0x346dbb(0x75))/0x9*(parseInt(_0x346dbb(0x78))/0xa);if(_0x2e3357===_0x1a9b69)break;else _0x31c76a['push'](_0x31c76a['shift']());}catch(_0x410431){_0x31c76a['push'](_0x31c76a['shift']());}}}(a14_0x98b0,0xc27e9));function a14_0x98b0(){var _0xba4b20=['5128848DvzBhS','9EKHrYB','1132555luBCrR','2695uBuPgF','12708620cUZRKK','756gyuuRR','3XNcPlf','390086xuaxZM','405368SDWERU','1895586pXksJz'];a14_0x98b0=function(){return _0xba4b20;};return a14_0x98b0();}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';function a14_0x1e8f(_0x3042f0,_0x4c4f6c){_0x3042f0=_0x3042f0-0x74;var _0x98b0ea=a14_0x98b0();var _0x1e8fb7=_0x98b0ea[_0x3042f0];return _0x1e8fb7;}export{executeCustomSql}from'./execute-custom-sql.js';export{generateSqlCode}from'./generate-sql-code.js';export{validateSqlContent}from'./validate-sql-content.js';
@@ -1 +1 @@
1
- function a15_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(_0xb88aca,_0x482cf4){const _0x13f835=a15_0x2f69,_0x50d4c5=_0xb88aca();while(!![]){try{const _0x5a81e3=-parseInt(_0x13f835(0x1a8))/0x1+-parseInt(_0x13f835(0x1ac))/0x2+parseInt(_0x13f835(0x1a4))/0x3*(-parseInt(_0x13f835(0x1aa))/0x4)+-parseInt(_0x13f835(0x1a5))/0x5+-parseInt(_0x13f835(0x1a7))/0x6*(-parseInt(_0x13f835(0x1b0))/0x7)+parseInt(_0x13f835(0x1ab))/0x8*(parseInt(_0x13f835(0x1a3))/0x9)+parseInt(_0x13f835(0x1b3))/0xa;if(_0x5a81e3===_0x482cf4)break;else _0x50d4c5['push'](_0x50d4c5['shift']());}catch(_0x8cf2e){_0x50d4c5['push'](_0x50d4c5['shift']());}}}(a15_0x1720,0xedb78));import{DevApiClient}from'../api/dev-api-client.js';function a15_0x2f69(_0x173f3b,_0x860a8c){_0x173f3b=_0x173f3b-0x1a2;const _0x172091=a15_0x1720();let _0x2f69d9=_0x172091[_0x173f3b];return _0x2f69d9;}function a15_0x1720(){const _0x4ffef8=['env','18PShOaz','1158052IaYehc','LOVRABET_APP_CODE','31428SXgpkC','8NtJFjQ','1132450jUKhPx','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','LOVRABET_ENV','getDatasetList','3034703JiEprG','datasets','online','26018560PMXgxo','analyzeDatasetList','8492256DeKXlq','237iKIvpb','7636795UzaLGv'];a15_0x1720=function(){return _0x4ffef8;};return a15_0x1720();}import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';export async function listDatasets(_0x9946e6={}){const _0x13d0d3=a15_0x2f69,{appCode:appCode=process[_0x13d0d3(0x1a6)][_0x13d0d3(0x1a9)],env:env=process[_0x13d0d3(0x1a6)][_0x13d0d3(0x1ae)]||_0x13d0d3(0x1b2),cookie:_0x247fdc,pageSize:pageSize=0x3e7,currentPage:currentPage=0x1,forceRefresh:forceRefresh=![]}=_0x9946e6;if(!appCode)throw new Error(_0x13d0d3(0x1ad));const _0x21980f=new DevApiClient({'appCode':appCode,'env':env,'cookie':_0x247fdc}),_0x38990c=await _0x21980f[_0x13d0d3(0x1af)]({'pageSize':pageSize,'currentPage':currentPage,'forceRefresh':forceRefresh}),_0x4e990c=new DatasetAnalyzer(),_0x270546=_0x4e990c[_0x13d0d3(0x1a2)](_0x38990c);return{'appCode':appCode,'env':env,'total':_0x270546['total'],'datasets':_0x270546[_0x13d0d3(0x1b1)]};}
@@ -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_0x2a9f(_0x34b7bf,_0x37bafa){_0x34b7bf=_0x34b7bf-0x86;const _0x4b30cd=a16_0x4b30();let _0x2a9fca=_0x4b30cd[_0x34b7bf];return _0x2a9fca;}(function(_0x3d1e67,_0x3ed216){const _0xf9342c=a16_0x2a9f,_0x285d4c=_0x3d1e67();while(!![]){try{const _0x5726d1=-parseInt(_0xf9342c(0xac))/0x1*(-parseInt(_0xf9342c(0xc0))/0x2)+parseInt(_0xf9342c(0xc3))/0x3+-parseInt(_0xf9342c(0x9d))/0x4+-parseInt(_0xf9342c(0xbc))/0x5+-parseInt(_0xf9342c(0x9b))/0x6+-parseInt(_0xf9342c(0xc4))/0x7*(parseInt(_0xf9342c(0x91))/0x8)+-parseInt(_0xf9342c(0xcb))/0x9*(-parseInt(_0xf9342c(0xb4))/0xa);if(_0x5726d1===_0x3ed216)break;else _0x285d4c['push'](_0x285d4c['shift']());}catch(_0x36f51c){_0x285d4c['push'](_0x285d4c['shift']());}}}(a16_0x4b30,0xdb593));import{DevApiClient}from'../api/dev-api-client.js';function a16_0x4b30(){const _0x14de38=['sqlName','\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27','map','name','IMPORTANT:\x20Business\x20logic\x20errors\x20(SQL\x20failures)\x20are\x20returned\x20in\x20data.execError,\x20not\x20thrown','tableData','updatedTime','sqlCode','replace','sqlType','Each\x20SQL\x20query\x20above\x20includes\x20a\x20codeExample\x20field\x20with\x20complete\x20TypeScript\x20code\x20ready\x20to\x20use','720112XjOusB','description','other','\x27,\x0a\x20\x20env:\x20\x27','online','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','limit','No\x20SQL\x20queries\x20found.\x20Check\x20your\x20appCode\x20and\x20authentication.','For\x20more\x20customization,\x20use\x20generate_sql_code\x20tool\x20to\x20get\x20code\x20with\x20type\x20inference',');\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});','4599336MyAvkv','filter','3311836XBlIUh','toLowerCase','string','env','sql_list','\x0a//\x20Example:\x20Using\x20SQL\x20\x22','LOVRABET_ENV','The\x20executeSql\x20method\x20accepts\x20two\x20parameters:\x20sqlCode\x20(string)\x20and\x20optional\x20params\x20(object)','time','createdTime','2024-01-01','\x22\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27','\x27);\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);\x0a}\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];','value','sqlDesc','749181vHwZpx','stringify','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20exception\x20-\x20use\x20try-catch\x20for\x20error\x20handling','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','total','length','LOVRABET_APP_CODE','.\x20Each\x20SQL\x20includes\x20a\x20complete\x20code\x20example\x20showing\x20how\x20to\x20execute\x20it\x20using\x20the\x20SDK.','142210zPzMaA','example','getCustomSqlList','match','Execute\x20SQL\x20query:\x20','all','date','SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[]\x20}\x20-\x20Always\x20check\x20execSuccess\x20before\x20using\x20execResult','2408200fKvlsw','sql','IMPORTANT:\x20All\x20SQL\x20queries\x20use\x20the\x20same\x20execution\x20pattern\x20-\x20client.api.executeSql(sqlCode,\x20params)','IMPORTANT:\x20Always\x20check\x20data.execSuccess\x20before\x20using\x20data.execResult','2peyYWm','The\x20execResult\x20contains\x20an\x20array\x20of\x20row\x20objects\x20matching\x20your\x20SQL\x20query\x20structure','IMPORTANT:\x20Use\x20try-catch\x20to\x20handle\x20HTTP\x20errors\x20(network\x20issues,\x20auth\x20failures)','5337774vCCSQt','77GymnER','category','includes','ceil','slice','sqlId','sqlContent','909PzyOun','message','This\x20SQL\x20requires\x20parameters:\x20','Parameter:\x20'];a16_0x4b30=function(){return _0x14de38;};return a16_0x4b30();}export async function listSqlQueries(_0x1a8b2e={}){const _0x1bde2c=a16_0x2a9f,{appCode:appCode=process[_0x1bde2c(0xa0)][_0x1bde2c(0xb2)],cookie:_0x1b6ca1,env:env=process[_0x1bde2c(0xa0)][_0x1bde2c(0xa3)]||'online',keyword:_0xb03655,category:_0x8138eb,sqlCode:_0x12654d,sqlName:_0x21054b,pageSize:pageSize=0x3e7,currentPage:currentPage=0x1}=_0x1a8b2e;if(!appCode)throw new Error(_0x1bde2c(0x96));const _0x13184a=new DevApiClient({'appCode':appCode,'cookie':_0x1b6ca1,'env':env});try{const _0x3fdfd0=await _0x13184a[_0x1bde2c(0xb6)]({'pageSize':pageSize,'currentPage':currentPage,'sqlCode':_0x12654d,'sqlName':_0x21054b}),_0x3aa6d3=_0x3fdfd0['data']||_0x3fdfd0,_0x547ee2=_0x3aa6d3[_0x1bde2c(0x8b)]||[],_0x26408b=_0x3aa6d3[_0x1bde2c(0xb0)]||_0x547ee2[_0x1bde2c(0xb1)];let _0x29a65f=_0x547ee2['map'](_0x2f320c=>{const _0x2f4410=_0x1bde2c,_0x5e3995=_0x2f320c[_0x2f4410(0x8d)]||appCode+'-'+(_0x2f320c[_0x2f4410(0xc9)]||_0x2f320c['id']),_0x248619=_0x2f320c[_0x2f4410(0xc9)]||_0x2f320c['id'];let _0x210705;if(_0x2f320c[_0x2f4410(0xca)]||_0x2f320c['sql']){const _0x220260=_0x2f320c[_0x2f4410(0xca)]||_0x2f320c[_0x2f4410(0xbd)],_0x239537=_0x220260[_0x2f4410(0xb7)](/[:$]\{?(\w+)\}?/g);if(_0x239537){const _0x43e60d=Array['from'](new Set(_0x239537['map'](_0x13d9a5=>_0x13d9a5[_0x2f4410(0x8e)](/[:${}]/g,''))));_0x210705=_0x43e60d[_0x2f4410(0x88)](_0x39b1cd=>{const _0x2623cf=_0x2f4410;let _0x31d650=_0x2623cf(0xaa);if(_0x39b1cd[_0x2623cf(0x9e)]()[_0x2623cf(0xc6)](_0x2623cf(0xba))||_0x39b1cd[_0x2623cf(0x9e)]()[_0x2623cf(0xc6)](_0x2623cf(0xa5)))_0x31d650=_0x2623cf(0xa7);else{if(_0x39b1cd[_0x2623cf(0x9e)]()[_0x2623cf(0xc6)]('id'))_0x31d650=0x7b;else(_0x39b1cd[_0x2623cf(0x9e)]()[_0x2623cf(0xc6)](_0x2623cf(0x97))||_0x39b1cd[_0x2623cf(0x9e)]()[_0x2623cf(0xc6)]('count'))&&(_0x31d650=0xa);}return{'name':_0x39b1cd,'type':_0x2623cf(0x9f),'required':!![],'description':_0x2623cf(0xce)+_0x39b1cd,'example':_0x31d650};});}}const _0x4472b5=_0x210705&&_0x210705[_0x2f4410(0xb1)]>0x0,_0x5d9669=_0x4472b5?_0x210705['reduce']((_0x4834ed,_0x359bce)=>({..._0x4834ed,[_0x359bce[_0x2f4410(0x89)]]:_0x359bce[_0x2f4410(0xb5)]}),{}):undefined,_0x563cb5={'typescript':_0x2f4410(0xaf)+appCode+_0x2f4410(0x94)+(env||_0x2f4410(0x95))+'\x27,\x0a});\x0a\x0a//\x20Execute\x20the\x20SQL\x20query:\x20'+(_0x2f320c[_0x2f4410(0x86)]||_0x2f320c['name']||'SQL\x20Query')+_0x2f4410(0x87)+_0x5e3995+'\x27'+(_0x4472b5?',\x20'+JSON[_0x2f4410(0xad)](_0x5d9669,null,0x2):'')+_0x2f4410(0x9a),'description':_0x2f4410(0xb8)+(_0x2f320c[_0x2f4410(0x86)]||_0x2f320c['name']||'Custom\x20SQL'),'important':[_0x2f4410(0xbb),_0x2f4410(0xa4),_0x4472b5?_0x2f4410(0xcd)+_0x210705[_0x2f4410(0x88)](_0x191e9c=>_0x191e9c[_0x2f4410(0x89)]+'\x20('+_0x191e9c['type']+')')['join'](',\x20'):'This\x20SQL\x20does\x20not\x20require\x20any\x20parameters',_0x2f4410(0xae),_0x2f4410(0xc1)]},_0x38d799={'sqlCode':_0x5e3995,'sqlId':_0x248619,'name':_0x2f320c[_0x2f4410(0x86)]||_0x2f320c[_0x2f4410(0x89)]||'SQL-'+_0x248619,'description':_0x2f320c[_0x2f4410(0xab)]||_0x2f320c[_0x2f4410(0x92)],'category':_0x2f320c[_0x2f4410(0xc5)]||_0x2f320c[_0x2f4410(0x8f)]||_0x2f4410(0x93),'sqlContent':_0x2f320c[_0x2f4410(0xca)]||_0x2f320c[_0x2f4410(0xbd)],'parameters':_0x210705,'createdTime':_0x2f320c[_0x2f4410(0xa6)]||_0x2f320c['createTime'],'updatedTime':_0x2f320c[_0x2f4410(0x8c)]||_0x2f320c['updateTime'],'codeExample':_0x563cb5};return _0x38d799;});if(_0xb03655){const _0x3d34d6=_0xb03655[_0x1bde2c(0x9e)]();_0x29a65f=_0x29a65f[_0x1bde2c(0x9c)](_0x34a42e=>_0x34a42e[_0x1bde2c(0x89)][_0x1bde2c(0x9e)]()['includes'](_0x3d34d6)||_0x34a42e[_0x1bde2c(0x92)]&&_0x34a42e[_0x1bde2c(0x92)][_0x1bde2c(0x9e)]()['includes'](_0x3d34d6)||_0x34a42e[_0x1bde2c(0x8d)]['toLowerCase']()[_0x1bde2c(0xc6)](_0x3d34d6)||_0x34a42e[_0x1bde2c(0xca)]&&_0x34a42e['sqlContent'][_0x1bde2c(0x9e)]()[_0x1bde2c(0xc6)](_0x3d34d6));}_0x8138eb&&_0x8138eb!==_0x1bde2c(0xb9)&&(_0x29a65f=_0x29a65f[_0x1bde2c(0x9c)](_0x52a9c1=>_0x52a9c1[_0x1bde2c(0xc5)]&&_0x52a9c1[_0x1bde2c(0xc5)]['toLowerCase']()===_0x8138eb[_0x1bde2c(0x9e)]()));const _0x1883e5=Math[_0x1bde2c(0xc7)](_0x29a65f[_0x1bde2c(0xb1)]/pageSize),_0x54edf6=_0x29a65f[_0x1bde2c(0xc8)]((currentPage-0x1)*pageSize,currentPage*pageSize),_0x45d197=_0x54edf6[_0x1bde2c(0xb1)]>0x0?_0x54edf6[0x0]:null,_0x5c6ebe=_0x45d197?_0x1bde2c(0xa2)+_0x45d197[_0x1bde2c(0x89)]+_0x1bde2c(0xa8)+_0x45d197['sqlCode']+_0x1bde2c(0xa9):'';return{'type':_0x1bde2c(0xa1),'total':_0x29a65f[_0x1bde2c(0xb1)],'sqls':_0x54edf6,'pagination':{'currentPage':currentPage,'pageSize':pageSize,'totalPages':_0x1883e5},'usage':{'description':'Found\x20'+_0x29a65f[_0x1bde2c(0xb1)]+'\x20SQL\x20queries\x20for\x20application\x20'+appCode+_0x1bde2c(0xb3),'important':[_0x1bde2c(0xbe),_0x1bde2c(0xbf),'IMPORTANT:\x20The\x20SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[],\x20execError?:\x20string\x20}',_0x1bde2c(0xc2),_0x1bde2c(0x8a),_0x1bde2c(0x90),_0x1bde2c(0x99)],'example':_0x5c6ebe||_0x1bde2c(0x98)}};}catch(_0x50df2b){throw new Error('Failed\x20to\x20list\x20SQL\x20queries:\x20'+_0x50df2b[_0x1bde2c(0xcc)]);}}
@@ -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(_0x1b0673,_0x5e375e){const _0x575b3b=a17_0x515a,_0x5fe808=_0x1b0673();while(!![]){try{const _0xb4ece8=parseInt(_0x575b3b(0xfc))/0x1*(parseInt(_0x575b3b(0xfb))/0x2)+parseInt(_0x575b3b(0x111))/0x3+-parseInt(_0x575b3b(0x104))/0x4+parseInt(_0x575b3b(0x116))/0x5+parseInt(_0x575b3b(0x107))/0x6*(parseInt(_0x575b3b(0x113))/0x7)+parseInt(_0x575b3b(0x112))/0x8+parseInt(_0x575b3b(0xff))/0x9*(-parseInt(_0x575b3b(0x10f))/0xa);if(_0xb4ece8===_0x5e375e)break;else _0x5fe808['push'](_0x5fe808['shift']());}catch(_0x2fb63f){_0x5fe808['push'](_0x5fe808['shift']());}}}(a17_0x1a14,0xa6a28));import*as a17_0x50cbf8 from'node:https';function a17_0x1a14(){const _0x5cb8b1=['message','</p>\x0a\x20\x20\x20\x20<p>Please\x20check\x20file\x20permissions\x20for\x20~/.lovrabet/cookie</p>\x0a\x20\x20</div>\x0a</body>\x0a</html>','close','object','port','\x20environment','28KyONIQ','27566MaQhgk','text/plain','https://dev.lovrabet.com:','1030194zwBWUp','text/html;\x20charset=utf-8','Login\x20successful\x20but\x20failed\x20to\x20save\x20cookie:\x20','error','address','4643532NptrFt','<!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>','json','18DsHjcz','user','Login\x20server\x20error','session','env','writeHead','<!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','online','80gNvxTi','end','1459602BlaVIQ','273928qMxefO','1820217VzJtak','createServer','Failed\x20to\x20fetch\x20SSL\x20certificates\x20for\x20login\x20server','5361775MtbOUs','listen'];a17_0x1a14=function(){return _0x5cb8b1;};return a17_0x1a14();}import{saveCookie}from'../auth/cookie-manager.js';function a17_0x515a(_0x37076b,_0x5437d4){_0x37076b=_0x37076b-0xf9;const _0x1a1471=a17_0x1a14();let _0x515a5a=_0x1a1471[_0x37076b];return _0x515a5a;}import{isSessionValid}from'../auth/session-validator.js';import{getUserDomain}from'../auth/constants.js';export async function login(_0x4a001c={}){const _0x1f3ebe=a17_0x515a,_0x4c2c02=_0x4a001c[_0x1f3ebe(0x10b)]||_0x1f3ebe(0x10e);if(await isSessionValid(_0x4c2c02))return{'success':!![],'message':'Already\x20logged\x20in\x20to\x20'+_0x4c2c02+_0x1f3ebe(0xfa),'env':_0x4c2c02};let _0x1fe855;try{const _0x1a1784=await fetch('https://g.yuntooai.com/cert/lovrabet-dev.json');_0x1fe855=await _0x1a1784[_0x1f3ebe(0x106)]();}catch(_0xe6ec38){return{'success':![],'message':_0x1f3ebe(0x115),'env':_0x4c2c02};}return new Promise(_0x32b31f=>{const _0x5c5df6=_0x1f3ebe;let _0x54cc56=0x0;const _0x21c0d8=a17_0x50cbf8[_0x5c5df6(0x114)](_0x1fe855,async(_0xf71afb,_0x363ead)=>{const _0x6837b8=_0x5c5df6,_0x46efeb=getUserDomain(_0x4c2c02),_0x4cdc8d=_0xf71afb['headers']['cookie']||'';try{const _0x383e4e=await fetch(_0x46efeb+'/api/auth/get-session',{'headers':{'cookie':_0x4cdc8d}}),_0x1be6e2=await _0x383e4e['json'](),_0x2a3f51=_0x1be6e2&&_0x1be6e2[_0x6837b8(0x10a)]&&_0x1be6e2[_0x6837b8(0x108)];if(_0x2a3f51){try{saveCookie(_0x4cdc8d);}catch(_0x5d34a4){const _0x23c010=_0x6837b8(0x10d)+_0x5d34a4['message']+_0x6837b8(0x119);_0x363ead[_0x6837b8(0x10c)](0x1f4,{'Content-Type':_0x6837b8(0x100)}),_0x363ead[_0x6837b8(0x110)](_0x23c010),_0x21c0d8[_0x6837b8(0x11a)](),_0x32b31f({'success':![],'message':_0x6837b8(0x101)+_0x5d34a4['message'],'env':_0x4c2c02});return;}const _0x342cc8=_0x6837b8(0x105);_0x363ead[_0x6837b8(0x10c)](0xc8,{'Content-Type':_0x6837b8(0x100)}),_0x363ead[_0x6837b8(0x110)](_0x342cc8),_0x21c0d8[_0x6837b8(0x11a)](),_0x32b31f({'success':!![],'message':'Successfully\x20logged\x20in\x20to\x20'+_0x4c2c02+_0x6837b8(0xfa),'env':_0x4c2c02});}else{const _0xfec377=encodeURIComponent(_0x6837b8(0xfe)+_0x54cc56);_0x363ead[_0x6837b8(0x10c)](0x12e,{'location':_0x46efeb+'/sign-in?redirect='+_0xfec377}),_0x363ead[_0x6837b8(0x110)]();}}catch(_0x5d016c){_0x363ead['writeHead'](0x1f4,{'Content-Type':_0x6837b8(0xfd)}),_0x363ead['end']('Internal\x20server\x20error'),_0x21c0d8[_0x6837b8(0x11a)](),_0x32b31f({'success':![],'message':_0x6837b8(0x109),'env':_0x4c2c02});}});_0x21c0d8[_0x5c5df6(0x117)](0x0,'127.0.0.1',()=>{const _0x5a198e=_0x5c5df6,_0x16b8fd=_0x21c0d8[_0x5a198e(0x103)]();_0x54cc56=typeof _0x16b8fd===_0x5a198e(0x11b)&&_0x16b8fd?_0x16b8fd[_0x5a198e(0xf9)]:0x0;const _0x5e939a=_0x5a198e(0xfe)+_0x54cc56;_0x32b31f({'success':![],'message':'Please\x20open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20login:\x20'+_0x5e939a,'loginUrl':_0x5e939a,'env':_0x4c2c02});}),_0x21c0d8['on'](_0x5c5df6(0x102),_0x51e27c=>{const _0x1b79c9=_0x5c5df6;_0x32b31f({'success':![],'message':'Login\x20server\x20error:\x20'+_0x51e27c[_0x1b79c9(0x118)],'env':_0x4c2c02});}),setTimeout(()=>{const _0x234245=_0x5c5df6;_0x21c0d8[_0x234245(0x11a)](),_0x32b31f({'success':![],'message':'Login\x20timeout\x20-\x20no\x20response\x20received\x20within\x205\x20minutes','env':_0x4c2c02});},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(_0x166247,_0xa0dccd){const _0x48042c=a18_0x2264,_0x5d53b1=_0x166247();while(!![]){try{const _0x5334c0=-parseInt(_0x48042c(0x19e))/0x1+parseInt(_0x48042c(0x18c))/0x2*(parseInt(_0x48042c(0x19c))/0x3)+parseInt(_0x48042c(0x197))/0x4+-parseInt(_0x48042c(0x182))/0x5+parseInt(_0x48042c(0x17f))/0x6*(-parseInt(_0x48042c(0x180))/0x7)+parseInt(_0x48042c(0x18f))/0x8+-parseInt(_0x48042c(0x176))/0x9;if(_0x5334c0===_0xa0dccd)break;else _0x5d53b1['push'](_0x5d53b1['shift']());}catch(_0x2b786d){_0x5d53b1['push'](_0x5d53b1['shift']());}}}(a18_0x40be,0x5be3b));function a18_0x2264(_0x25476f,_0xf3f8b7){_0x25476f=_0x25476f-0x171;const _0x40bea4=a18_0x40be();let _0x226401=_0x40bea4[_0x25476f];return _0x226401;}import{DevApiClient}from'../api/dev-api-client.js';function a18_0x40be(){const _0x34e34e=['startsWith','SELECT','sqlId','sqlContent','TRUNCATE','Forbidden\x20keyword\x20detected:\x20','503640QmnXnd','14AsNOvu','test','2680815CIFzSj','UPDATE\x5cs+\x5cw+\x5cs+SET','trim','replace','Failed\x20to\x20save\x20custom\x20SQL','DELETE\x5cs+FROM','EXEC','LOVRABET_ENV','NODE_ENV','createTime','3658OGikAO','REVOKE','sqlContent\x20is\x20required\x20and\x20cannot\x20be\x20empty.','5851352IaRAHq','SQL\x20content\x20cannot\x20be\x20empty','CREATE\x5cs+(TABLE|INDEX|DATABASE|VIEW)','sqlName\x20is\x20required\x20and\x20cannot\x20be\x20empty.','success','reason','getCustomSqlList','data','2026456yTjJnn','valid','GRANT','split','createdTime','1113LKtcTW','message','691369hfxxaZ','[saveCustomSql]\x20Verification\x20query\x20failed:','saveUserCustomSql','name','find','INSERT\x5cs+INTO','env','tableData','verified','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','warn','toUpperCase','.\x20Only\x20SELECT\x20queries\x20are\x20allowed.','LOVRABET_APP_CODE','errorMsg','1303209qEWDIU','Custom\x20SQL\x20saved\x20successfully','SQL\x20validation\x20failed:\x20'];a18_0x40be=function(){return _0x34e34e;};return a18_0x40be();}function validateSelectSql(_0x13a53d){const _0x1014b1=a18_0x2264;if(!_0x13a53d||typeof _0x13a53d!=='string')return{'valid':![],'reason':_0x1014b1(0x190)};const _0x90f7e4=_0x13a53d['replace'](/#\{[^}]*\}/g,'?')[_0x1014b1(0x185)](/\$\{[^}]*\}/g,'?')[_0x1014b1(0x185)](/@[^(\s]+(\([^)]*\))?/g,''),_0x5929e3=_0x90f7e4[_0x1014b1(0x184)](),_0x44d8ec=_0x5929e3[_0x1014b1(0x19a)]('\x0a');let _0x3d771b='';for(const _0x9b9279 of _0x44d8ec){const _0x53cf19=_0x9b9279[_0x1014b1(0x184)]();if(!_0x53cf19||_0x53cf19[_0x1014b1(0x179)]('--')||_0x53cf19[_0x1014b1(0x179)]('/*'))continue;_0x3d771b=_0x53cf19;break;}if(!_0x3d771b[_0x1014b1(0x172)]()['startsWith'](_0x1014b1(0x17a)))return{'valid':![],'reason':'Only\x20SELECT\x20queries\x20are\x20allowed.\x20The\x20SQL\x20must\x20start\x20with\x20SELECT\x20(after\x20any\x20comments).'};const _0x3bdc53=[_0x1014b1(0x1a3),_0x1014b1(0x183),_0x1014b1(0x187),'DROP\x5cs+(TABLE|INDEX|DATABASE)','ALTER\x5cs+(TABLE|DATABASE)',_0x1014b1(0x191),_0x1014b1(0x17d),_0x1014b1(0x199),_0x1014b1(0x18d),_0x1014b1(0x188),'EXECUTE'],_0x290d6c=_0x5929e3[_0x1014b1(0x172)]();for(const _0x3d263e of _0x3bdc53){const _0x597f85=new RegExp(_0x3d263e,'i');if(_0x597f85[_0x1014b1(0x181)](_0x290d6c))return{'valid':![],'reason':_0x1014b1(0x17e)+_0x3d263e[_0x1014b1(0x185)]('\x5c\x5cs+','\x20')+_0x1014b1(0x173)};}return{'valid':!![]};}export async function saveCustomSql(_0x468cec){const _0xb0faa6=a18_0x2264,{appCode:appCode=process[_0xb0faa6(0x1a4)][_0xb0faa6(0x174)],cookie:_0x1caba6,env:env=process[_0xb0faa6(0x1a4)][_0xb0faa6(0x189)]||'online',sqlName:_0x4c6047,dbId:_0x33512d,sqlContent:_0x14347b,verifyAfterSave:verifyAfterSave=!![]}=_0x468cec;if(!appCode)throw new Error(_0xb0faa6(0x1a7));if(!_0x4c6047||_0x4c6047[_0xb0faa6(0x184)]()==='')throw new Error(_0xb0faa6(0x192));if(!_0x33512d)throw new Error('dbId\x20is\x20required.\x20Get\x20it\x20from\x20get_dataset_detail\x20->\x20basic.database.dbId');if(!_0x14347b||_0x14347b['trim']()==='')throw new Error(_0xb0faa6(0x18e));const _0x24b612=validateSelectSql(_0x14347b);if(!_0x24b612[_0xb0faa6(0x198)])throw new Error(_0xb0faa6(0x178)+_0x24b612[_0xb0faa6(0x194)]);const _0x2a62ce=new DevApiClient({'appCode':appCode,'cookie':_0x1caba6,'env':env}),_0x3cc3b7=_0x4c6047[_0xb0faa6(0x184)](),_0x5e52b2=await _0x2a62ce[_0xb0faa6(0x1a0)]({'sqlName':_0x3cc3b7,'dbId':_0x33512d,'sqlContent':_0x14347b[_0xb0faa6(0x184)]()});if(!_0x5e52b2[_0xb0faa6(0x193)])return{'success':![],'message':_0x5e52b2[_0xb0faa6(0x19d)]||_0x5e52b2[_0xb0faa6(0x175)]||_0xb0faa6(0x186)};const _0x37832e={'success':!![],'message':_0xb0faa6(0x177),'data':_0x5e52b2[_0xb0faa6(0x196)]};if(verifyAfterSave)try{const _0x3c6d30=await _0x2a62ce[_0xb0faa6(0x195)]({'pageSize':0xa,'currentPage':0x1,'sqlName':_0x3cc3b7}),_0x163399=_0x3c6d30[_0xb0faa6(0x196)]?.[_0xb0faa6(0x1a5)]||[],_0x40215c=_0x163399[_0xb0faa6(0x1a2)](_0x3e9a00=>_0x3e9a00['sqlName']===_0x3cc3b7||_0x3e9a00[_0xb0faa6(0x1a1)]===_0x3cc3b7);_0x40215c?_0x37832e['verified']={'found':!![],'sqlInfo':{'sqlCode':_0x40215c['sqlCode']||appCode+'-'+(_0x40215c[_0xb0faa6(0x17b)]||_0x40215c['id']),'sqlId':_0x40215c[_0xb0faa6(0x17b)]||_0x40215c['id'],'name':_0x40215c['sqlName']||_0x40215c['name'],'sqlContent':_0x40215c[_0xb0faa6(0x17c)]||_0x40215c['sql'],'createdTime':_0x40215c[_0xb0faa6(0x19b)]||_0x40215c[_0xb0faa6(0x18b)]}}:_0x37832e[_0xb0faa6(0x1a6)]={'found':![]};}catch(_0x15a0de){process[_0xb0faa6(0x1a4)][_0xb0faa6(0x18a)]!==_0xb0faa6(0x181)&&console[_0xb0faa6(0x171)](_0xb0faa6(0x19f),_0x15a0de),_0x37832e[_0xb0faa6(0x1a6)]={'found':![]};}return _0x37832e;}
@@ -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(_0x33654a,_0x39e59e){const _0x2603cd=a19_0x2136,_0x54dcdb=_0x33654a();while(!![]){try{const _0xc43666=parseInt(_0x2603cd(0x1ec))/0x1*(-parseInt(_0x2603cd(0x1ef))/0x2)+parseInt(_0x2603cd(0x1f5))/0x3*(-parseInt(_0x2603cd(0x1ca))/0x4)+-parseInt(_0x2603cd(0x1e4))/0x5+-parseInt(_0x2603cd(0x1bb))/0x6*(-parseInt(_0x2603cd(0x1c9))/0x7)+parseInt(_0x2603cd(0x1bd))/0x8+-parseInt(_0x2603cd(0x1df))/0x9+parseInt(_0x2603cd(0x1e2))/0xa;if(_0xc43666===_0x39e59e)break;else _0x54dcdb['push'](_0x54dcdb['shift']());}catch(_0x1d8039){_0x54dcdb['push'](_0x54dcdb['shift']());}}}(a19_0x366a,0xea976));function a19_0x2136(_0x4c6d27,_0x54231d){_0x4c6d27=_0x4c6d27-0x1bb;const _0x366a5d=a19_0x366a();let _0x2136c8=_0x366a5d[_0x4c6d27];return _0x2136c8;}import{DevApiClient}from'../api/dev-api-client.js';function a19_0x366a(){const _0x345853=['name','SQL\x20validation\x20failed:\x20','281TFuEyH','execute_custom_sql','getCustomSqlList','1752CoCYXO','params','env','test','valid','Check\x20database\x20connection\x20and\x20permissions','4280427VnVtkH','6TuCMPd','trim','13232584yFGAgt','get_dataset_detail','generate_sql_code','Confirm\x20the\x20dbId\x20matches\x20the\x20database\x20you\x20want\x20to\x20use','errorMsg','medium','login','dbId\x20is\x20required.\x20Get\x20it\x20from\x20get_dataset_detail\x20->\x20basic.database.dbId','<dataset-code>','\x22\x20updated\x20successfully\x20(','Custom\x20SQL\x20\x22','sql','3067379swvHog','4Hrutzt','now','sqlCode\x20is\x20required\x20for\x20updating\x20existing\x20SQL.','id\x20is\x20required\x20for\x20updating\x20existing\x20SQL.','sqlName\x20is\x20required\x20and\x20cannot\x20be\x20empty.','data','Execute\x20the\x20SQL\x20to\x20check\x20for\x20runtime\x20errors','find','Generate\x20SDK\x20code\x20for\x20this\x20SQL','code','warn','\x22\x20saved\x20successfully\x20(','verified','LOVRABET_APP_CODE','sqlContent','online','sqlName','sqlCode','sqlId','columns','sqlInfo','49257QNcLol','NODE_ENV','success','6495400REwqoU','sqlContent\x20is\x20required\x20and\x20cannot\x20be\x20empty.','512430xUbDnt','tableData','updated','length','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','saveUserCustomSql'];a19_0x366a=function(){return _0x345853;};return a19_0x366a();}import{validateIsSelectOnly,parseSqlStructure,generateSqlSummary}from'../utils/sql-parser.js';export async function saveOrUpdateCustomSql(_0x3e4d98){const _0x2a96c8=a19_0x2136,_0x23c8fc=Date['now'](),{appCode:appCode=process[_0x2a96c8(0x1f1)][_0x2a96c8(0x1d7)],cookie:_0x41a941,env:env=process['env']['LOVRABET_ENV']||_0x2a96c8(0x1d9),sqlName:_0x2225f8,dbId:_0x3398ec,sqlContent:_0x1bdc99,id:_0xd03b2f,sqlCode:_0x17c785,verifyAfterSave:verifyAfterSave=!![],validateSchema:validateSchema=![]}=_0x3e4d98;if(!appCode)throw new Error(_0x2a96c8(0x1e8));if(!_0x2225f8||_0x2225f8[_0x2a96c8(0x1bc)]()==='')throw new Error(_0x2a96c8(0x1ce));if(!_0x3398ec)throw new Error(_0x2a96c8(0x1c4));if(!_0x1bdc99||_0x1bdc99[_0x2a96c8(0x1bc)]()==='')throw new Error(_0x2a96c8(0x1e3));const _0x3581cf=_0xd03b2f!==undefined&&_0xd03b2f>0x0||_0x17c785!==undefined&&_0x17c785[_0x2a96c8(0x1bc)]()!=='';if(_0x3581cf){if(!_0xd03b2f)throw new Error(_0x2a96c8(0x1cd));if(!_0x17c785)throw new Error(_0x2a96c8(0x1cc));}const _0x32dd14=validateIsSelectOnly(_0x1bdc99);if(!_0x32dd14[_0x2a96c8(0x1f3)])throw new Error(_0x2a96c8(0x1eb)+_0x32dd14['reason']);const _0x19352f=parseSqlStructure(_0x1bdc99),_0x3ce087=generateSqlSummary(_0x1bdc99),_0x54211e=new DevApiClient({'appCode':appCode,'cookie':_0x41a941,'env':env}),_0x122d17=_0x2225f8[_0x2a96c8(0x1bc)]();let _0x24072c;_0x3581cf?_0x24072c=await _0x54211e['updateUserCustomSql']({'id':_0xd03b2f,'sqlCode':_0x17c785[_0x2a96c8(0x1bc)](),'sqlName':_0x122d17,'dbId':_0x3398ec,'sqlContent':_0x1bdc99[_0x2a96c8(0x1bc)]()}):_0x24072c=await _0x54211e[_0x2a96c8(0x1e9)]({'sqlName':_0x122d17,'dbId':_0x3398ec,'sqlContent':_0x1bdc99[_0x2a96c8(0x1bc)]()});const _0x34fdac=Date[_0x2a96c8(0x1cb)]()-_0x23c8fc;if(!_0x24072c[_0x2a96c8(0x1e1)])return{'success':![],'action':_0x3581cf?_0x2a96c8(0x1e6):'created','message':_0x24072c['message']||_0x24072c[_0x2a96c8(0x1c1)]||'Failed\x20to\x20'+(_0x3581cf?'update':'save')+'\x20custom\x20SQL','nextSteps':[{'action':_0x2a96c8(0x1f4),'tool':_0x2a96c8(0x1c3),'reason':'Ensure\x20you\x20are\x20logged\x20in\x20with\x20proper\x20permissions'},{'action':'Verify\x20database\x20ID\x20is\x20correct','tool':_0x2a96c8(0x1be),'params':{'datasetCode':_0x2a96c8(0x1c5)},'reason':_0x2a96c8(0x1c0)}]};const _0x3ea2fb=_0x24072c[_0x2a96c8(0x1cf)]?.['sqlCode']||_0x24072c[_0x2a96c8(0x1cf)]?.[_0x2a96c8(0x1d3)],_0x1864ca=_0x24072c['data']?.[_0x2a96c8(0x1dc)]||_0x24072c[_0x2a96c8(0x1cf)]?.['id'],_0x266c8b=[{'action':'Test\x20the\x20SQL\x20to\x20verify\x20it\x20works\x20correctly','tool':_0x2a96c8(0x1ed),'params':{'sqlCode':_0x3ea2fb||''},'reason':_0x2a96c8(0x1d0),'priority':'high'},{'action':_0x2a96c8(0x1d2),'tool':_0x2a96c8(0x1bf),'params':{'sqlCode':_0x3ea2fb||''},'reason':'Get\x20ready-to-use\x20TypeScript\x20code\x20for\x20your\x20application','priority':_0x2a96c8(0x1c2)}],_0x24151b={'success':!![],'action':_0x3581cf?'updated':'created','message':_0x3581cf?_0x2a96c8(0x1c7)+_0x122d17+_0x2a96c8(0x1c6)+_0x3ce087+')':_0x2a96c8(0x1c7)+_0x122d17+_0x2a96c8(0x1d5)+_0x3ce087+')','nextSteps':_0x266c8b,'parsedStructure':{'tables':_0x19352f['tables'],'columns':_0x19352f[_0x2a96c8(0x1dd)][_0x2a96c8(0x1e7)],'parameters':_0x19352f['parameters'],'summary':_0x3ce087},'data':_0x24072c['data']};if(verifyAfterSave)try{const _0x4d98b7=await _0x54211e[_0x2a96c8(0x1ee)]({'pageSize':0xa,'currentPage':0x1,'sqlName':_0x122d17}),_0x5c56a0=_0x4d98b7[_0x2a96c8(0x1cf)]?.[_0x2a96c8(0x1e5)]||[],_0x548c49=_0x5c56a0[_0x2a96c8(0x1d1)](_0x2ffe40=>_0x2ffe40[_0x2a96c8(0x1da)]===_0x122d17||_0x2ffe40['name']===_0x122d17);_0x548c49?(_0x24151b[_0x2a96c8(0x1d6)]={'found':!![],'sqlInfo':{'sqlCode':_0x548c49[_0x2a96c8(0x1db)]||appCode+'-'+(_0x548c49['sqlId']||_0x548c49['id']),'sqlId':_0x548c49['sqlId']||_0x548c49['id'],'id':_0x548c49['id'],'name':_0x548c49[_0x2a96c8(0x1da)]||_0x548c49[_0x2a96c8(0x1ea)],'sqlContent':_0x548c49[_0x2a96c8(0x1d8)]||_0x548c49[_0x2a96c8(0x1c8)],'createdTime':_0x548c49['createdTime']||_0x548c49['createTime'],'updatedTime':_0x548c49['updatedTime']||_0x548c49['updateTime']}},_0x24151b[_0x2a96c8(0x1d6)][_0x2a96c8(0x1de)]?.[_0x2a96c8(0x1db)]&&(_0x266c8b[0x0]['params']={'sqlCode':_0x24151b[_0x2a96c8(0x1d6)][_0x2a96c8(0x1de)]['sqlCode']},_0x266c8b[0x1][_0x2a96c8(0x1f0)]={'sqlCode':_0x24151b[_0x2a96c8(0x1d6)][_0x2a96c8(0x1de)][_0x2a96c8(0x1db)]})):_0x24151b[_0x2a96c8(0x1d6)]={'found':![]};}catch(_0x5c72c1){process['env'][_0x2a96c8(0x1e0)]!==_0x2a96c8(0x1f2)&&console[_0x2a96c8(0x1d4)]('[saveOrUpdateCustomSql]\x20Verification\x20query\x20failed:',_0x5c72c1),_0x24151b[_0x2a96c8(0x1d6)]={'found':![]};}return _0x24151b;}
@@ -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(_0x5560c4,_0x17ed73){const _0x56c559=a20_0x1b1c,_0x3e6c7e=_0x5560c4();while(!![]){try{const _0x5d380e=parseInt(_0x56c559(0x1e1))/0x1+-parseInt(_0x56c559(0x1e4))/0x2*(parseInt(_0x56c559(0x1e2))/0x3)+-parseInt(_0x56c559(0x1dd))/0x4*(-parseInt(_0x56c559(0x1de))/0x5)+-parseInt(_0x56c559(0x1d6))/0x6*(-parseInt(_0x56c559(0x1d4))/0x7)+parseInt(_0x56c559(0x1d8))/0x8*(parseInt(_0x56c559(0x1d7))/0x9)+parseInt(_0x56c559(0x1e0))/0xa*(-parseInt(_0x56c559(0x1e8))/0xb)+parseInt(_0x56c559(0x1df))/0xc*(-parseInt(_0x56c559(0x1e6))/0xd);if(_0x5d380e===_0x17ed73)break;else _0x3e6c7e['push'](_0x3e6c7e['shift']());}catch(_0x2e4e84){_0x3e6c7e['push'](_0x3e6c7e['shift']());}}}(a20_0x39c9,0x9ec19));import{DevApiClient}from'../api/dev-api-client.js';import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';function a20_0x39c9(){const _0x314e2c=['90yhZBIo','796816XNtYcX','env','searchDatasets','total','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','5448qrWLdZ','4415ywbntd','42708DMZgab','100GHWOoO','369038RdlOBf','692217ovKTkJ','description','4ltgGuL','keyword\x20is\x20required','3016DJkByV','name','962819ovLRkF','code','19271GmaSBZ','analyzeDatasetList','534CGQVUu'];a20_0x39c9=function(){return _0x314e2c;};return a20_0x39c9();}function a20_0x1b1c(_0x998e43,_0x5048b5){_0x998e43=_0x998e43-0x1d3;const _0x39c91c=a20_0x39c9();let _0x1b1c4e=_0x39c91c[_0x998e43];return _0x1b1c4e;}export async function searchDatasets(_0x5bb9ec){const _0x5c0e56=a20_0x1b1c,{appCode:appCode=process[_0x5c0e56(0x1d9)]['LOVRABET_APP_CODE'],cookie:_0x882003,env:env=process[_0x5c0e56(0x1d9)]['LOVRABET_ENV']||'online',keyword:_0xa2ae1}=_0x5bb9ec;if(!appCode)throw new Error(_0x5c0e56(0x1dc));if(!_0xa2ae1)throw new Error(_0x5c0e56(0x1e5));const _0x1f0d2f=new DevApiClient({'appCode':appCode,'cookie':_0x882003,'env':env}),_0x14f36e=await _0x1f0d2f[_0x5c0e56(0x1da)](_0xa2ae1),_0x489463=new DatasetAnalyzer(),_0x5dfeb9=_0x489463[_0x5c0e56(0x1d5)](_0x14f36e);return{'appCode':appCode,'env':env,'keyword':_0xa2ae1,'total':_0x5dfeb9[_0x5c0e56(0x1db)],'datasets':_0x5dfeb9['datasets']['map'](_0x334a3b=>({'id':_0x334a3b['id'],'name':_0x334a3b[_0x5c0e56(0x1e7)],'code':_0x334a3b[_0x5c0e56(0x1d3)],'tableName':_0x334a3b['tableName'],'description':_0x334a3b[_0x5c0e56(0x1e3)]}))};}
@@ -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(_0x21464c,_0x2fc9cf){const _0x40cff0=a21_0x4270,_0x183e6c=_0x21464c();while(!![]){try{const _0xe6193b=parseInt(_0x40cff0(0x20f))/0x1*(parseInt(_0x40cff0(0x20d))/0x2)+-parseInt(_0x40cff0(0x216))/0x3+-parseInt(_0x40cff0(0x227))/0x4*(-parseInt(_0x40cff0(0x1fc))/0x5)+-parseInt(_0x40cff0(0x229))/0x6+parseInt(_0x40cff0(0x214))/0x7*(-parseInt(_0x40cff0(0x218))/0x8)+-parseInt(_0x40cff0(0x22b))/0x9*(-parseInt(_0x40cff0(0x225))/0xa)+-parseInt(_0x40cff0(0x203))/0xb;if(_0xe6193b===_0x2fc9cf)break;else _0x183e6c['push'](_0x183e6c['shift']());}catch(_0x304b9e){_0x183e6c['push'](_0x183e6c['shift']());}}}(a21_0x4cef,0x26f7a));import{DevApiClient}from'../api/dev-api-client.js';import{validateIsSelectOnly,parseSqlStructure,validateSqlContent as a21_0x3e024,generateSqlSummary}from'../utils/sql-parser.js';import{createStructuredSqlError}from'../types/mcp-types.js';async function fetchSchemaInfo(_0x432cbe,_0x3d7aa5){const _0xc6cf5a=a21_0x4270,_0x2e3c5b=[];for(const _0x24eaaf of _0x432cbe){try{const _0xd0054c=/^\d+$/[_0xc6cf5a(0x202)](_0x24eaaf);let _0x214b86=_0x24eaaf;if(!_0xd0054c){const _0x33d9cf=await _0x3d7aa5[_0xc6cf5a(0x20b)]({'pageSize':0x3e7}),_0x41738c=_0x33d9cf[_0xc6cf5a(0x21c)]?.[_0xc6cf5a(0x1f8)]||[],_0x50ddf6=_0x41738c[_0xc6cf5a(0x1f9)](_0x209075=>_0x209075[_0xc6cf5a(0x223)]===_0x24eaaf);if(!_0x50ddf6)continue;_0x214b86=String(_0x50ddf6['id']);}const _0x280fec=await _0x3d7aa5[_0xc6cf5a(0x1ff)](_0x214b86),_0x16fddd=_0x280fec[_0xc6cf5a(0x21c)]?.[_0xc6cf5a(0x212)]||'',_0x11f275=_0x280fec[_0xc6cf5a(0x21c)]?.[_0xc6cf5a(0x210)]||[],_0x5f40e7=_0x11f275['map'](_0x3a06fa=>_0x3a06fa[_0xc6cf5a(0x223)]||_0x3a06fa['fieldCode']);_0x16fddd&&_0x5f40e7[_0xc6cf5a(0x21d)]>0x0&&_0x2e3c5b[_0xc6cf5a(0x206)]({'tableName':_0x16fddd,'columns':_0x5f40e7});}catch(_0xe739ef){process[_0xc6cf5a(0x205)][_0xc6cf5a(0x1fd)]!=='test'&&console[_0xc6cf5a(0x201)](_0xc6cf5a(0x207)+_0x24eaaf+':',_0xe739ef);}}return _0x2e3c5b;}export async function validateSqlContentTool(_0x13c546){const _0x2841aa=a21_0x4270,{appCode:appCode=process['env'][_0x2841aa(0x20a)],cookie:_0x342972,env:env=process['env']['LOVRABET_ENV']||'online',sqlContent:_0x3b0e00,dbId:_0x3f847a,validateSchemas:validateSchemas=[]}=_0x13c546;if(!_0x3b0e00||_0x3b0e00[_0x2841aa(0x22e)]()==='')return{'success':![],'message':_0x2841aa(0x20c),'validation':{'valid':![],'isSelectOnly':![]},'nextSteps':[{'action':'Provide\x20SQL\x20content\x20to\x20validate','tool':_0x2841aa(0x209),'reason':_0x2841aa(0x213)}]};const _0x40542c=validateIsSelectOnly(_0x3b0e00);if(!_0x40542c['valid'])return{'success':![],'message':_0x2841aa(0x217)+_0x40542c['reason'],'validation':{'valid':![],'isSelectOnly':![],'errors':[createStructuredSqlError({'type':_0x2841aa(0x22d),'location':_0x2841aa(0x1f5),'message':_0x40542c['reason']||_0x2841aa(0x20e),'severity':_0x2841aa(0x221),'fixSteps':[{'description':_0x2841aa(0x21f),'example':'SELECT\x20id,\x20name\x20FROM\x20customer\x20WHERE\x20status\x20=\x201'}]})]},'nextSteps':[{'action':'Modify\x20SQL\x20to\x20be\x20a\x20SELECT\x20statement\x20only','tool':_0x2841aa(0x21a),'reason':'Only\x20SELECT\x20queries\x20are\x20allowed\x20for\x20custom\x20SQL'}]};const _0x30c364=parseSqlStructure(_0x3b0e00),_0x35fbca=generateSqlSummary(_0x3b0e00);let _0x500a3c;if(validateSchemas[_0x2841aa(0x21d)]>0x0&&appCode){const _0x4bb34e=new DevApiClient({'appCode':appCode,'cookie':_0x342972,'env':env});_0x500a3c=await fetchSchemaInfo(validateSchemas,_0x4bb34e);}const _0x15980b=a21_0x3e024(_0x3b0e00,_0x500a3c?{'tables':_0x500a3c}:undefined),_0x1d4995={'success':_0x15980b[_0x2841aa(0x1fe)]||!![],'message':_0x15980b[_0x2841aa(0x1fe)]?'SQL\x20validation\x20passed\x20('+_0x35fbca+')':_0x2841aa(0x21e)+(_0x15980b[_0x2841aa(0x219)]?.['length']||0x0)+_0x2841aa(0x208),'validation':{..._0x15980b,'parsedStructure':_0x30c364}},_0x1f16dc=[];if(_0x15980b[_0x2841aa(0x1fe)])_0x3f847a?_0x1f16dc[_0x2841aa(0x206)]({'action':_0x2841aa(0x1fb),'tool':_0x2841aa(0x21a),'params':{'sqlName':_0x2841aa(0x21b),'dbId':_0x3f847a,'sqlContent':_0x3b0e00},'reason':_0x2841aa(0x1fa),'priority':_0x2841aa(0x215)}):_0x1f16dc[_0x2841aa(0x206)]({'action':_0x2841aa(0x1f7),'tool':_0x2841aa(0x222),'params':{'datasetCode':_0x2841aa(0x22c)},'reason':_0x2841aa(0x204),'priority':_0x2841aa(0x215)});else{_0x1f16dc[_0x2841aa(0x206)]({'action':'Review\x20SQL\x20errors\x20and\x20fix','tool':_0x2841aa(0x209),'reason':_0x2841aa(0x224),'priority':'high'});for(const _0x819453 of _0x15980b[_0x2841aa(0x219)]||[]){if(_0x819453['type']===_0x2841aa(0x228)||_0x819453[_0x2841aa(0x22a)]===_0x2841aa(0x200)){const _0x4cf882=_0x819453['fixSteps'][0x0]?.[_0x2841aa(0x1f4)]||_0x819453[_0x2841aa(0x1f6)];_0x1f16dc[_0x2841aa(0x206)]({'action':_0x2841aa(0x226),'tool':_0x2841aa(0x222),'params':{'datasetCode':_0x2841aa(0x22c)},'reason':_0x4cf882,'priority':_0x2841aa(0x220)});break;}}}return!_0x15980b[_0x2841aa(0x1fe)]&&_0x15980b[_0x2841aa(0x219)]?.[_0x2841aa(0x22f)](_0x1bad74=>_0x1bad74[_0x2841aa(0x22a)]==='TABLE_NOT_FOUND')&&_0x1f16dc['push']({'action':_0x2841aa(0x211),'tool':'list_datasets','reason':_0x2841aa(0x1f3),'priority':'medium'}),_0x1d4995['nextSteps']=_0x1f16dc,_0x1d4995;}function a21_0x4cef(){const _0x1734a9=['description','SQL_START','typeLabel','Get\x20database\x20ID\x20to\x20save\x20this\x20SQL','tableData','find','SQL\x20is\x20valid\x20and\x20ready\x20to\x20be\x20saved','Save\x20this\x20validated\x20SQL','330215qVeTvX','NODE_ENV','valid','getDatasetDetail','TABLE_NOT_FOUND','warn','test','203412dldusr','Need\x20dbId\x20from\x20dataset\x20detail\x20to\x20save\x20SQL','env','push','[validateSqlContent]\x20Failed\x20to\x20fetch\x20schema\x20for\x20','\x20error(s))','validate_sql_content','LOVRABET_APP_CODE','getDatasetList','SQL\x20content\x20is\x20required','2ZOqpTi','Invalid\x20SQL','88021lPUpOW','properties','List\x20all\x20available\x20datasets','tableName','SQL\x20content\x20cannot\x20be\x20empty','841141RvciBU','high','272268RTVTeC','SQL\x20validation\x20failed:\x20','8DiUHsm','errors','save_or_update_custom_sql','<sql-name>','data','length','SQL\x20validation\x20failed\x20(','SQL\x20must\x20be\x20a\x20SELECT\x20statement','medium','error','get_dataset_detail','code','Fix\x20the\x20identified\x20errors\x20before\x20saving','569990iztKLt','Get\x20dataset\x20details\x20to\x20find\x20correct\x20table/column\x20names','16zZruwq','COLUMN_NOT_FOUND','121026GImcgs','type','9GhVQdf','<dataset-code>','SYNTAX_ERROR','trim','some','Find\x20the\x20correct\x20table\x20names\x20for\x20your\x20SQL'];a21_0x4cef=function(){return _0x1734a9;};return a21_0x4cef();}function a21_0x4270(_0x17e8a9,_0x1faaa1){_0x17e8a9=_0x17e8a9-0x1f3;const _0x4cef22=a21_0x4cef();let _0x42701c=_0x4cef22[_0x17e8a9];return _0x42701c;}export{validateSqlContentTool as validateSqlContent};
@@ -1 +1 @@
1
- export{};
1
+ function a22_0x598e(_0x41ac01,_0x2ffa38){_0x41ac01=_0x41ac01-0xbb;var _0x3b6135=a22_0x3b61();var _0x598e4c=_0x3b6135[_0x41ac01];return _0x598e4c;}function a22_0x3b61(){var _0xf092e4=['1765959rYGVLB','10360008QsSwvq','2fTqnIW','57935DVkdFb','1510676hpsiGO','7RMmCJP','26920710LwDNUX','11WMxyup','9082698lsapKz','3571767xDaYFz','140MVYhMm'];a22_0x3b61=function(){return _0xf092e4;};return a22_0x3b61();}(function(_0xa4aac2,_0x294a43){var _0x56771b=a22_0x598e,_0x2cfa94=_0xa4aac2();while(!![]){try{var _0x4816d2=-parseInt(_0x56771b(0xbc))/0x1+parseInt(_0x56771b(0xc5))/0x2*(-parseInt(_0x56771b(0xc3))/0x3)+-parseInt(_0x56771b(0xc2))/0x4*(parseInt(_0x56771b(0xbb))/0x5)+parseInt(_0x56771b(0xc0))/0x6*(parseInt(_0x56771b(0xbd))/0x7)+-parseInt(_0x56771b(0xc4))/0x8+parseInt(_0x56771b(0xc1))/0x9+-parseInt(_0x56771b(0xbe))/0xa*(-parseInt(_0x56771b(0xbf))/0xb);if(_0x4816d2===_0x294a43)break;else _0x2cfa94['push'](_0x2cfa94['shift']());}catch(_0xa9bcd){_0x2cfa94['push'](_0x2cfa94['shift']());}}}(a22_0x3b61,0xc401a));export{createError,createAuthError,createMissingParamError,createDatasetNotFoundError,createSqlNotFoundError,createSqlValidationError,createStructuredSqlError,fromLovrabetError,SQL_ERROR_TYPE_LABELS}from'./mcp-types.js';