@lovrabet/dataset-mcp-server 1.4.2-beta.0 → 1.4.3

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.
package/dist/api/cache.js CHANGED
@@ -1 +1 @@
1
- function a0_0x4bda(){const _0x32abf9=['5428276GWZUxH','1303231vEuvyZ','731784fRKHcP','from','105thxRPf','defaultTTL','9aeYgMh','floor','keys','1077016HYFjOo','10RTtElu','clear','get','delete','9463832EspNUe','cache','1521003vUBmix','getStats','data','now','83976AiccuB','size','3DqabqT','set'];a0_0x4bda=function(){return _0x32abf9;};return a0_0x4bda();}const a0_0x5b5677=a0_0x22d3;(function(_0x581847,_0xfc240a){const _0x43c590=a0_0x22d3,_0x435a1b=_0x581847();while(!![]){try{const _0x1cb9b9=parseInt(_0x43c590(0x141))/0x1+-parseInt(_0x43c590(0x149))/0x2*(parseInt(_0x43c590(0x13e))/0x3)+parseInt(_0x43c590(0x142))/0x4+parseInt(_0x43c590(0x144))/0x5*(parseInt(_0x43c590(0x13c))/0x6)+parseInt(_0x43c590(0x140))/0x7+parseInt(_0x43c590(0x136))/0x8*(-parseInt(_0x43c590(0x146))/0x9)+parseInt(_0x43c590(0x14a))/0xa*(-parseInt(_0x43c590(0x138))/0xb);if(_0x1cb9b9===_0xfc240a)break;else _0x435a1b['push'](_0x435a1b['shift']());}catch(_0x5a87ad){_0x435a1b['push'](_0x435a1b['shift']());}}}(a0_0x4bda,0xa9df9));export class SimpleCache{['cache']=new Map();[a0_0x5b5677(0x145)];constructor(_0x2c6c00=0x5){this['defaultTTL']=_0x2c6c00*0x3c*0x3e8;}[a0_0x5b5677(0x14c)](_0x3d11aa){const _0x27a40a=a0_0x5b5677,_0xd73db5=this[_0x27a40a(0x137)][_0x27a40a(0x14c)](_0x3d11aa);if(!_0xd73db5)return null;const _0x1e6394=Date[_0x27a40a(0x13b)](),_0x560cc6=_0x1e6394-_0xd73db5['timestamp'];if(_0x560cc6>this[_0x27a40a(0x145)])return this['cache'][_0x27a40a(0x135)](_0x3d11aa),null;const _0xacb97c=Math[_0x27a40a(0x147)](_0x560cc6/0x3e8);return _0xd73db5[_0x27a40a(0x13a)];}['set'](_0x533a6f,_0x1c42ef){const _0xf638fe=a0_0x5b5677;this[_0xf638fe(0x137)][_0xf638fe(0x13f)](_0x533a6f,{'data':_0x1c42ef,'timestamp':Date[_0xf638fe(0x13b)]()});}[a0_0x5b5677(0x14b)](_0x3f0ec9){const _0x28cb8e=a0_0x5b5677;_0x3f0ec9?this[_0x28cb8e(0x137)][_0x28cb8e(0x135)](_0x3f0ec9):this['cache'][_0x28cb8e(0x14b)]();}[a0_0x5b5677(0x139)](){const _0x2b0a3a=a0_0x5b5677;return{'size':this[_0x2b0a3a(0x137)][_0x2b0a3a(0x13d)],'ttlMinutes':this[_0x2b0a3a(0x145)]/0xea60,'entries':Array[_0x2b0a3a(0x143)](this[_0x2b0a3a(0x137)][_0x2b0a3a(0x148)]())};}}function a0_0x22d3(_0x95de43,_0x356a1f){_0x95de43=_0x95de43-0x135;const _0x4bdaa6=a0_0x4bda();let _0x22d3a3=_0x4bdaa6[_0x95de43];return _0x22d3a3;}export const apiCache=new SimpleCache(0x5);
1
+ const a0_0x299672=a0_0x3e9e;function a0_0x4bac(){const _0x4f2b66=['21WyYdKr','cache','get','20549475xUSDdJ','size','4557635JbLhOy','data','set','2553032FLxcJO','defaultTTL','getStats','clear','110jHwYof','delete','floor','10813PLGtAX','1175679ZoftyH','4203174BmkGEu','keys','from','1715196IGTywk'];a0_0x4bac=function(){return _0x4f2b66;};return a0_0x4bac();}(function(_0x572acf,_0x387642){const _0x1c0ecb=a0_0x3e9e,_0x371b17=_0x572acf();while(!![]){try{const _0x56d973=-parseInt(_0x1c0ecb(0x1d7))/0x1*(parseInt(_0x1c0ecb(0x1e9))/0x2)+parseInt(_0x1c0ecb(0x1d8))/0x3+-parseInt(_0x1c0ecb(0x1dc))/0x4+-parseInt(_0x1c0ecb(0x1e2))/0x5+parseInt(_0x1c0ecb(0x1d9))/0x6+-parseInt(_0x1c0ecb(0x1dd))/0x7*(parseInt(_0x1c0ecb(0x1e5))/0x8)+parseInt(_0x1c0ecb(0x1e0))/0x9;if(_0x56d973===_0x387642)break;else _0x371b17['push'](_0x371b17['shift']());}catch(_0x3883d5){_0x371b17['push'](_0x371b17['shift']());}}}(a0_0x4bac,0x75fc5));function a0_0x3e9e(_0x26917e,_0x241010){_0x26917e=_0x26917e-0x1d5;const _0x4bac22=a0_0x4bac();let _0x3e9e6e=_0x4bac22[_0x26917e];return _0x3e9e6e;}export class SimpleCache{['cache']=new Map();[a0_0x299672(0x1e6)];constructor(_0x195868=0x5){this['defaultTTL']=_0x195868*0x3c*0x3e8;}[a0_0x299672(0x1df)](_0x3e6d6a){const _0x8cdd3a=a0_0x299672,_0x582b53=this[_0x8cdd3a(0x1de)][_0x8cdd3a(0x1df)](_0x3e6d6a);if(!_0x582b53)return null;const _0x88f700=Date['now'](),_0x58107d=_0x88f700-_0x582b53['timestamp'];if(_0x58107d>this[_0x8cdd3a(0x1e6)])return this['cache'][_0x8cdd3a(0x1d5)](_0x3e6d6a),null;const _0xb1b687=Math[_0x8cdd3a(0x1d6)](_0x58107d/0x3e8);return _0x582b53[_0x8cdd3a(0x1e3)];}[a0_0x299672(0x1e4)](_0x413d56,_0x5005b3){this['cache']['set'](_0x413d56,{'data':_0x5005b3,'timestamp':Date['now']()});}[a0_0x299672(0x1e8)](_0x407188){const _0x898d8f=a0_0x299672;_0x407188?this[_0x898d8f(0x1de)]['delete'](_0x407188):this[_0x898d8f(0x1de)][_0x898d8f(0x1e8)]();}[a0_0x299672(0x1e7)](){const _0x3d6dc5=a0_0x299672;return{'size':this[_0x3d6dc5(0x1de)][_0x3d6dc5(0x1e1)],'ttlMinutes':this[_0x3d6dc5(0x1e6)]/0xea60,'entries':Array[_0x3d6dc5(0x1db)](this['cache'][_0x3d6dc5(0x1da)]())};}}export const apiCache=new SimpleCache(0x5);
@@ -1 +1 @@
1
- function a1_0x5100(_0x439486,_0x2ec0ca){_0x439486=_0x439486-0x1e4;const _0x48b602=a1_0x48b6();let _0x510083=_0x48b602[_0x439486];return _0x510083;}const a1_0x1cbc9e=a1_0x5100;(function(_0x1c874b,_0x42ebb9){const _0x8ffff9=a1_0x5100,_0x139d4c=_0x1c874b();while(!![]){try{const _0x2b6519=-parseInt(_0x8ffff9(0x24a))/0x1*(-parseInt(_0x8ffff9(0x25a))/0x2)+parseInt(_0x8ffff9(0x246))/0x3*(parseInt(_0x8ffff9(0x221))/0x4)+-parseInt(_0x8ffff9(0x229))/0x5+parseInt(_0x8ffff9(0x232))/0x6+parseInt(_0x8ffff9(0x20d))/0x7*(-parseInt(_0x8ffff9(0x254))/0x8)+-parseInt(_0x8ffff9(0x216))/0x9*(-parseInt(_0x8ffff9(0x1fe))/0xa)+-parseInt(_0x8ffff9(0x248))/0xb;if(_0x2b6519===_0x42ebb9)break;else _0x139d4c['push'](_0x139d4c['shift']());}catch(_0x33e7ce){_0x139d4c['push'](_0x139d4c['shift']());}}}(a1_0x48b6,0x9d5ad));function a1_0x48b6(){const _0x524509=['doVersion','process','env','apiBaseUrl','sqlName','[getDatasetDetail]\x20Failed\x20to\x20fetch\x20relations\x20for\x20','appCode','forceRefresh','dbtableConfig','length','set','find','from','getDatasetDetail','pathname','warn','API\x20error:\x20','2193KPsciC','postRequest','13855710KMmdNj','clearBffScriptCache','7ztbmwt','name','joinType','test','Failed\x20to\x20get\x20ER\x20config\x20for\x20dblinkId:\x20','updateUserCustomSql','save-bff','POST','includes','/smartapi/custom/updateUserCustomSql','4089632AHzMIC','meta','add','/smartapi/dataset/get-dataset-list','API\x20request\x20timeout\x20after\x20','getDatasetRelations','138838vNXPCJ','no-relations','runtimeDomain','/smartapi/custom/saveUserCustomSql','cookie','&type=ENDPOINT','get','toolboxBaseUrl','data','mcp:vibe','datasets','toDataset','object','getUniqueDbIds','success','toLowerCase','LOVRABET_ENV','with-relations','description','isArray','getCustomSqlList','code','tableName','er-config:','message','sort','Failed\x20to\x20get\x20ER\x20config\x20for\x20dbId\x20','70Tzmqod','/api/custom/executeSql','dataset-list:','GET','getBffScriptInfo','text','apiDomain','errorMsg','signal','\x0aURL:\x20','AbortError','request','Content-Type','NODE_ENV','Unknown\x20error','7FbmjcV','/api/management/library/scripts/info?id=','fromField','relations','Network\x20error:\x20Unable\x20to\x20connect\x20to\x20the\x20server.\x20Please\x20check\x20your\x20network\x20connection\x20or\x20the\x20server\x20may\x20be\x20down.\x0aURL:\x20','getAllErConfigs','modelCode','executeSql','application/json','893115CYVGdJ','abort','datasetCode','/smartapi/custom/queryUserCustomSqlList','currentPage','params','/smartapi/dataset/get-driven-data?','dbId','/api/management/library/scripts/list?appCode=','/api/node-toolbox/bff/save','status','1388ZiqXqz','DEFAULT_TIMEOUT','sqlContent','toField','datasetName','runtimeBaseUrl','API\x20request\x20failed:\x20HTTP\x20','scriptContent','428150AgYmQW','push','tableData','toolboxBaseUrlOverride','sqlCode','resolveToolboxUrl','saveUserCustomSql','filter','stringify','6400404AkklNu','getDatasetList','_request'];a1_0x48b6=function(){return _0x524509;};return a1_0x48b6();}import{getCookie}from'../auth/cookie-manager.js';import{getEffectiveApiDomain,getEffectiveRuntimeDomain,resolveApiBaseUrl}from'../auth/constants.js';import{apiCache}from'./cache.js';export class DevApiClient{[a1_0x1cbc9e(0x23b)];[a1_0x1cbc9e(0x237)];['cookie'];['apiDomain'];[a1_0x1cbc9e(0x1e5)];[a1_0x1cbc9e(0x22c)];constructor(_0x3fdb1c){const _0x5c8569=a1_0x1cbc9e;this[_0x5c8569(0x23b)]=_0x3fdb1c[_0x5c8569(0x23b)],this['env']=globalThis[_0x5c8569(0x236)]?.[_0x5c8569(0x237)]?.[_0x5c8569(0x1f3)]||'online',this['cookie']=_0x3fdb1c[_0x5c8569(0x1e7)]||getCookie(),this[_0x5c8569(0x204)]=_0x3fdb1c[_0x5c8569(0x238)]||getEffectiveApiDomain(),this['runtimeDomain']=_0x3fdb1c[_0x5c8569(0x226)]||getEffectiveRuntimeDomain(),this[_0x5c8569(0x22c)]=_0x3fdb1c[_0x5c8569(0x1ea)];if(!this['cookie'])throw new Error('No\x20authentication\x20cookie\x20found.\x20Please\x20login\x20first.');}['resolveToolboxUrl'](_0x1c3f47,_0x4da2d3){const _0x2c8907=a1_0x1cbc9e,_0x46ef41=resolveApiBaseUrl(_0x1c3f47),_0x353c63=this[_0x2c8907(0x22c)]&&_0x46ef41===getEffectiveApiDomain()?this[_0x2c8907(0x22c)]:_0x46ef41;try{const _0x4c2faf=new URL(_0x353c63);if(_0x4c2faf[_0x2c8907(0x243)]!=='/')return _0x353c63;}catch{}return''+_0x353c63+_0x4da2d3;}static [a1_0x1cbc9e(0x222)]=0x7530;async[a1_0x1cbc9e(0x234)](_0x46ab17,_0xcec151={},_0x579a1a=DevApiClient[a1_0x1cbc9e(0x222)]){const _0x4787c5=a1_0x1cbc9e,{method:method=_0x4787c5(0x201),body:_0x195afb,extraHeaders:_0x4443a7}=_0xcec151,_0x47b285=new AbortController(),_0x4fcb37=setTimeout(()=>_0x47b285[_0x4787c5(0x217)](),_0x579a1a),_0x184af9={'Cookie':this[_0x4787c5(0x1e7)],'X-Invoke-Source':_0x4787c5(0x1ec),..._0x4443a7};method===_0x4787c5(0x251)&&(_0x184af9[_0x4787c5(0x20a)]=_0x4787c5(0x215));try{const _0x19a731=await fetch(_0x46ab17,{'method':method,'headers':_0x184af9,..._0x195afb!==undefined&&{'body':JSON[_0x4787c5(0x231)](_0x195afb)},'signal':_0x47b285[_0x4787c5(0x206)]});clearTimeout(_0x4fcb37);if(!_0x19a731['ok']){if(_0x19a731[_0x4787c5(0x220)]===0x191)throw new Error('Authentication\x20failed.\x20Please\x20login\x20again.');let _0x1ba070='';try{_0x1ba070=await _0x19a731[_0x4787c5(0x203)]();}catch{}throw new Error(_0x4787c5(0x227)+_0x19a731[_0x4787c5(0x220)]+_0x4787c5(0x207)+_0x46ab17+(_0x1ba070?'\x0a'+_0x1ba070:''));}const _0x189d27=await _0x19a731['json']();if(_0x189d27&&typeof _0x189d27===_0x4787c5(0x1ef)&&_0x4787c5(0x1f1)in _0x189d27&&!_0x189d27[_0x4787c5(0x1f1)]){const _0x42cb00=_0x189d27;throw new Error(_0x4787c5(0x245)+(_0x42cb00[_0x4787c5(0x1fb)]||_0x42cb00[_0x4787c5(0x205)]||_0x4787c5(0x20c)));}return _0x189d27;}catch(_0x5000a1){if(_0x5000a1 instanceof Error&&_0x5000a1[_0x4787c5(0x24b)]===_0x4787c5(0x208))throw new Error(_0x4787c5(0x258)+_0x579a1a+'ms.\x20The\x20server\x20may\x20be\x20down\x20or\x20unreachable.\x0aURL:\x20'+_0x46ab17);if(_0x5000a1 instanceof TypeError)throw new Error(_0x4787c5(0x211)+_0x46ab17);throw _0x5000a1;}}async[a1_0x1cbc9e(0x209)](_0x5bb3f4,_0x2d5736){const _0x494775=a1_0x1cbc9e;return this[_0x494775(0x234)](_0x5bb3f4,{'method':_0x494775(0x201)},_0x2d5736);}async[a1_0x1cbc9e(0x247)](_0x5902cf,_0x117dca,_0x5cdca6,_0x5996d3){const _0x4d24ad=a1_0x1cbc9e;return this['_request'](_0x5902cf,{'method':_0x4d24ad(0x251),'body':_0x117dca,'extraHeaders':_0x5996d3},_0x5cdca6);}async[a1_0x1cbc9e(0x233)](_0x16aa0d){const _0x355128=a1_0x1cbc9e,_0x5f43cd=_0x16aa0d?.[_0x355128(0x23c)]||![],_0x12514f=_0x355128(0x200)+this[_0x355128(0x23b)]+':'+this[_0x355128(0x237)];if(!_0x5f43cd){const _0x535382=apiCache['get'](_0x12514f);if(_0x535382)return _0x535382;}const _0x52dc7e=this[_0x355128(0x204)]+_0x355128(0x257),_0x34fb9a=await this[_0x355128(0x247)](_0x52dc7e,{'appCode':this[_0x355128(0x23b)]});return apiCache[_0x355128(0x23f)](_0x12514f,_0x34fb9a),_0x34fb9a;}async[a1_0x1cbc9e(0x242)](_0x3c0c97,_0x560c12=![],_0x33d44c=![]){const _0x5acf3b=a1_0x1cbc9e,_0x575429='dataset-detail:'+this['appCode']+':'+this['env']+':'+_0x3c0c97+':'+(_0x33d44c?_0x5acf3b(0x1f4):_0x5acf3b(0x1e4));if(!_0x560c12){const _0x5c9dd2=apiCache[_0x5acf3b(0x1e9)](_0x575429);if(_0x5c9dd2)return _0x5c9dd2;}const _0x18532a=/^\d+$/[_0x5acf3b(0x24d)](_0x3c0c97),_0x244c73=_0x18532a?'id':_0x5acf3b(0x1f8),_0x5f204c=this[_0x5acf3b(0x204)]+_0x5acf3b(0x21c)+_0x244c73+'='+_0x3c0c97,_0x64233e=await this[_0x5acf3b(0x209)](_0x5f204c);if(_0x33d44c&&_0x64233e[_0x5acf3b(0x1eb)]?.[_0x5acf3b(0x213)]){const _0x597431=_0x64233e[_0x5acf3b(0x1eb)][_0x5acf3b(0x235)]==='v2',_0x4548c3=Array[_0x5acf3b(0x1f6)](_0x64233e[_0x5acf3b(0x1eb)][_0x5acf3b(0x210)]);if(!_0x597431||!_0x4548c3)try{const _0x3ca84c=await this[_0x5acf3b(0x259)](_0x64233e['data'][_0x5acf3b(0x213)],_0x560c12);_0x64233e[_0x5acf3b(0x1eb)]['relations']=_0x3ca84c;}catch(_0x412099){process['env'][_0x5acf3b(0x20b)]!==_0x5acf3b(0x24d)&&console['warn'](_0x5acf3b(0x23a)+_0x3c0c97+':',_0x412099);}}return apiCache[_0x5acf3b(0x23f)](_0x575429,_0x64233e),_0x64233e;}async['searchDatasets'](_0x33b4d9){const _0x1d9e54=a1_0x1cbc9e,_0x51aae0=await this[_0x1d9e54(0x233)](),_0x3c9aea=Array[_0x1d9e54(0x1f6)](_0x51aae0[_0x1d9e54(0x1eb)])?_0x51aae0[_0x1d9e54(0x1eb)]:_0x51aae0[_0x1d9e54(0x1eb)]?.['tableData']||[];if(!_0x51aae0[_0x1d9e54(0x1f1)])return{'success':!![],'data':{'tableData':[]}};const _0x256b47=_0x3c9aea[_0x1d9e54(0x230)](_0x19cbf0=>{const _0x30de4f=_0x1d9e54,_0x1f4039=_0x33b4d9[_0x30de4f(0x1f2)]();return _0x19cbf0['name']?.[_0x30de4f(0x1f2)]()[_0x30de4f(0x252)](_0x1f4039)||_0x19cbf0[_0x30de4f(0x1f8)]?.[_0x30de4f(0x1f2)]()[_0x30de4f(0x252)](_0x1f4039)||_0x19cbf0['dbtableConfig']?.[_0x30de4f(0x1f9)]?.[_0x30de4f(0x1f2)]()[_0x30de4f(0x252)](_0x1f4039)||_0x19cbf0[_0x30de4f(0x1f5)]?.[_0x30de4f(0x1f2)]()[_0x30de4f(0x252)](_0x1f4039);});return{'success':!![],'data':{'tableData':_0x256b47,'paging':{'totalCount':_0x256b47[_0x1d9e54(0x23e)],'currentPage':0x1,'pageSize':_0x256b47[_0x1d9e54(0x23e)]}}};}async[a1_0x1cbc9e(0x1f7)](_0x5627b1){const _0xd49b8a=a1_0x1cbc9e,_0x59e99c=_0x5627b1?.[_0xd49b8a(0x21a)]||0x1,_0x5c1519=_0x5627b1?.['pageSize']||0x3e7,_0x240e9d=this[_0xd49b8a(0x204)]+_0xd49b8a(0x219),_0x4e64d4={'appCode':this[_0xd49b8a(0x23b)],'currentPage':_0x59e99c,'pageSize':_0x5c1519,..._0x5627b1?.['sqlCode']&&{'sqlCode':_0x5627b1[_0xd49b8a(0x22d)]},..._0x5627b1?.[_0xd49b8a(0x239)]&&{'sqlName':_0x5627b1[_0xd49b8a(0x239)]}},_0x1522c2=await this[_0xd49b8a(0x247)](_0x240e9d,_0x4e64d4);return _0x1522c2;}async[a1_0x1cbc9e(0x214)](_0x2c8a24){const _0x15696e=a1_0x1cbc9e,_0x313326=this[_0x15696e(0x1e5)]+_0x15696e(0x1ff),_0x3013e0={'appCode':this[_0x15696e(0x23b)],'sqlCode':_0x2c8a24['sqlCode'],..._0x2c8a24[_0x15696e(0x21b)]&&{'params':_0x2c8a24[_0x15696e(0x21b)]}};return await this[_0x15696e(0x247)](_0x313326,_0x3013e0);}async[a1_0x1cbc9e(0x22f)](_0x54bc11){const _0x51c047=a1_0x1cbc9e,_0x501e47=this['apiDomain']+_0x51c047(0x1e6),_0x5eacbb={'sqlName':_0x54bc11[_0x51c047(0x239)],'dbId':_0x54bc11[_0x51c047(0x21d)],'sqlContent':_0x54bc11[_0x51c047(0x223)],'appCode':this[_0x51c047(0x23b)]};return await this['postRequest'](_0x501e47,_0x5eacbb);}async[a1_0x1cbc9e(0x24f)](_0x13bb4d){const _0x53b419=a1_0x1cbc9e,_0xdd6566=this[_0x53b419(0x204)]+_0x53b419(0x253),_0xb90732={'id':_0x13bb4d['id'],'dbId':_0x13bb4d[_0x53b419(0x21d)],'sqlName':_0x13bb4d[_0x53b419(0x239)],'appCode':this[_0x53b419(0x23b)],'sqlContent':_0x13bb4d[_0x53b419(0x223)]};return await this[_0x53b419(0x247)](_0xdd6566,_0xb90732);}async['getErConfig'](_0xfafac9,_0x24768c=![]){const _0x51cabb=a1_0x1cbc9e,_0x327115=_0x51cabb(0x1fa)+this[_0x51cabb(0x23b)]+':'+this[_0x51cabb(0x237)]+':'+_0xfafac9;if(!_0x24768c){const _0x3e619a=apiCache[_0x51cabb(0x1e9)](_0x327115);if(_0x3e619a)return _0x3e619a;}const _0x2246e8=this[_0x51cabb(0x204)]+'/smartapi/question/er-config',_0x1531f3=await this['postRequest'](_0x2246e8,{'dblinkId':_0xfafac9,'appCode':this[_0x51cabb(0x23b)]});if(!_0x1531f3['success']||!_0x1531f3['data'])throw new Error(_0x51cabb(0x24e)+_0xfafac9);const _0x1bf5a9={'meta':_0x1531f3['data'][_0x51cabb(0x255)],'datasets':_0x1531f3['data'][_0x51cabb(0x1ed)]};return apiCache[_0x51cabb(0x23f)](_0x327115,_0x1bf5a9),_0x1bf5a9;}async[a1_0x1cbc9e(0x1f0)](_0x3bee20=![]){const _0x2b0fe6=a1_0x1cbc9e,_0x545058=await this[_0x2b0fe6(0x233)]({'forceRefresh':_0x3bee20}),_0x530ef6=Array[_0x2b0fe6(0x1f6)](_0x545058[_0x2b0fe6(0x1eb)])?_0x545058[_0x2b0fe6(0x1eb)]:_0x545058['data']?.[_0x2b0fe6(0x22b)]||[],_0x168d79=new Set();for(const _0x242c90 of _0x530ef6){_0x242c90[_0x2b0fe6(0x23d)]?.['dbId']&&_0x168d79[_0x2b0fe6(0x256)](_0x242c90[_0x2b0fe6(0x23d)][_0x2b0fe6(0x21d)]);}return Array[_0x2b0fe6(0x241)](_0x168d79)[_0x2b0fe6(0x1fc)]((_0x290235,_0x135fb5)=>_0x290235-_0x135fb5);}async[a1_0x1cbc9e(0x212)](_0x2d04d2=![]){const _0x2db7c1=a1_0x1cbc9e,_0x3c3d54='er-configs-all:'+this['appCode']+':'+this[_0x2db7c1(0x237)];if(!_0x2d04d2){const _0x55631b=apiCache[_0x2db7c1(0x1e9)](_0x3c3d54);if(_0x55631b)return _0x55631b;}const _0x82fc8e=await this['getUniqueDbIds'](_0x2d04d2),_0x1e1d84=new Map();for(const _0x2a6b43 of _0x82fc8e){try{const _0x23fd3b=await this['getErConfig'](_0x2a6b43,_0x2d04d2);_0x1e1d84[_0x2db7c1(0x23f)](_0x2a6b43,_0x23fd3b);}catch(_0x446554){console[_0x2db7c1(0x244)](_0x2db7c1(0x1fd)+_0x2a6b43+':',_0x446554);}}return apiCache[_0x2db7c1(0x23f)](_0x3c3d54,_0x1e1d84),_0x1e1d84;}async[a1_0x1cbc9e(0x259)](_0x7db775,_0x1a9dae=![]){const _0x2d2df3=a1_0x1cbc9e,_0x5e6626=await this[_0x2d2df3(0x212)](_0x1a9dae),_0x2dcf90=[],_0x320832=[];for(const [,_0x534970]of _0x5e6626){const _0xea9007=_0x534970['datasets'][_0x2d2df3(0x240)](_0x35d6cd=>_0x35d6cd['datasetCode']===_0x7db775);if(_0xea9007)for(const _0x3dfc12 of _0xea9007[_0x2d2df3(0x210)]||[]){_0x2dcf90['push']({'toDataset':_0x3dfc12['toDataset'],'toDatasetName':_0x3dfc12['toDatasetName'],'toField':_0x3dfc12[_0x2d2df3(0x224)],'fromField':_0x3dfc12[_0x2d2df3(0x20f)],'joinType':_0x3dfc12['joinType']});}for(const _0x4ff223 of _0x534970['datasets']){if(_0x4ff223[_0x2d2df3(0x218)]===_0x7db775)continue;for(const _0x5ac720 of _0x4ff223[_0x2d2df3(0x210)]||[]){_0x5ac720[_0x2d2df3(0x1ee)]===_0x7db775&&_0x320832[_0x2d2df3(0x22a)]({'fromDataset':_0x4ff223['datasetCode'],'fromDatasetName':_0x4ff223[_0x2d2df3(0x225)],'fromField':_0x5ac720[_0x2d2df3(0x20f)],'toField':_0x5ac720['toField'],'joinType':_0x5ac720[_0x2d2df3(0x24c)]});}}}return{'outgoing':_0x2dcf90,'incoming':_0x320832};}async['getBffScriptList'](){const _0x473bd=a1_0x1cbc9e,_0x5eabd=this[_0x473bd(0x204)]+_0x473bd(0x21e)+encodeURIComponent(this[_0x473bd(0x23b)])+_0x473bd(0x1e8);return await this[_0x473bd(0x209)](_0x5eabd);}async[a1_0x1cbc9e(0x202)](_0x59e697){const _0x22d3c7=a1_0x1cbc9e,_0x2b2b2f=this[_0x22d3c7(0x204)]+_0x22d3c7(0x20e)+_0x59e697;return await this[_0x22d3c7(0x209)](_0x2b2b2f);}async['saveBffScript'](_0x334795){const _0x2a7392=a1_0x1cbc9e,_0x4f10dc=this[_0x2a7392(0x204)]+'/api/management/library/scripts/save',_0x2b809a={'id':_0x334795['id']??null,'appCode':_0x334795[_0x2a7392(0x23b)],'description':_0x334795['description'],'scriptContent':_0x334795[_0x2a7392(0x228)],'scriptType':_0x334795['scriptType']};return await this[_0x2a7392(0x247)](_0x4f10dc,_0x2b809a);}async[a1_0x1cbc9e(0x249)](){const _0x248132=a1_0x1cbc9e,_0x58f625=this[_0x248132(0x1e5)]+'/api/management/script/cache/clear';return await this[_0x248132(0x247)](_0x58f625,{});}async['saveCustomSqlViaToolbox'](_0x4d280a){const _0x2980f2=a1_0x1cbc9e,_0x24bc45=this[_0x2980f2(0x22e)]('save-sql','/api/node-toolbox/sql/save'),_0x6c51b4=await this[_0x2980f2(0x247)](_0x24bc45,_0x4d280a);return _0x6c51b4[_0x2980f2(0x1eb)];}async['saveBffScriptViaToolbox'](_0x470d38){const _0x5c101e=a1_0x1cbc9e,_0x575529=this[_0x5c101e(0x22e)](_0x5c101e(0x250),_0x5c101e(0x21f)),_0x2ea15f=await this['postRequest'](_0x575529,_0x470d38);return _0x2ea15f[_0x5c101e(0x1eb)];}}
1
+ const a1_0x394d39=a1_0x58f3;function a1_0x58f3(_0x17f4b8,_0x15d355){_0x17f4b8=_0x17f4b8-0xe2;const _0xaa0e25=a1_0xaa0e();let _0x58f325=_0xaa0e25[_0x17f4b8];return _0x58f325;}function a1_0xaa0e(){const _0x2bfc5f=['Failed\x20to\x20get\x20ER\x20config\x20for\x20dbId\x20','add','save-bff','warn','getDatasetDetail','clearBffScriptCache','API\x20request\x20failed:\x20HTTP\x20','save-sql','joinType','DEFAULT_TIMEOUT','Network\x20error:\x20Unable\x20to\x20connect\x20to\x20the\x20server.\x20Please\x20check\x20your\x20network\x20connection\x20or\x20the\x20server\x20may\x20be\x20down.\x0aURL:\x20','process','68755gfnFxu','with-relations','errorMsg','get','scriptContent','saveCustomSqlViaToolbox','2631555eNncqh','sqlName','toDatasetName','modelCode','forceRefresh','fromField','/smartapi/custom/saveUserCustomSql','tableData','test','abort','cookie','/api/node-toolbox/bff/save','getAllErConfigs','resolveToolboxUrl','er-config:','&type=ENDPOINT','code','No\x20authentication\x20cookie\x20found.\x20Please\x20login\x20first.','sqlCode','saveBffScriptViaToolbox','dbtableConfig','runtimeDomain','toDataset','getErConfig','tableName','/smartapi/dataset/get-dataset-list','doVersion','sqlContent','toolboxBaseUrlOverride','includes','26517aZnUQx','description','493500nacPLu','saveUserCustomSql','set','message','99876BWYYzi','/api/management/library/scripts/list?appCode=','pageSize','getDatasetRelations','find','API\x20request\x20timeout\x20after\x20','datasetCode','/smartapi/custom/queryUserCustomSqlList','API\x20error:\x20','/api/management/library/scripts/info?id=','status','relations','datasets','data','env','/api/node-toolbox/sql/save','569336swJWuT','saveBffScript','appCode','\x0aURL:\x20','POST','870384enktxW','getBffScriptList','name','stringify','datasetName','isArray','params','text','apiBaseUrl','[getDatasetDetail]\x20Failed\x20to\x20fetch\x20relations\x20for\x20','postRequest','no-relations','push','_request','getDatasetList','108TOuvqk','/api/custom/executeSql','Authentication\x20failed.\x20Please\x20login\x20again.','/smartapi/custom/updateUserCustomSql','Content-Type','object','toField','getBffScriptInfo','er-configs-all:','scriptType','dbId','dataset-list:','toolboxBaseUrl','length','/smartapi/dataset/get-driven-data?','2jsuOZH','application/json','toLowerCase','success','LOVRABET_ENV','apiDomain','request'];a1_0xaa0e=function(){return _0x2bfc5f;};return a1_0xaa0e();}(function(_0x122b66,_0x5d4ac7){const _0x106ac7=a1_0x58f3,_0x49768b=_0x122b66();while(!![]){try{const _0x49d862=parseInt(_0x106ac7(0x106))/0x1*(-parseInt(_0x106ac7(0x13f))/0x2)+parseInt(_0x106ac7(0x121))/0x3+-parseInt(_0x106ac7(0x130))/0x4*(-parseInt(_0x106ac7(0xe2))/0x5)+parseInt(_0x106ac7(0x10c))/0x6+-parseInt(_0x106ac7(0x108))/0x7+-parseInt(_0x106ac7(0x11c))/0x8+-parseInt(_0x106ac7(0xe8))/0x9;if(_0x49d862===_0x5d4ac7)break;else _0x49768b['push'](_0x49768b['shift']());}catch(_0xd94200){_0x49768b['push'](_0x49768b['shift']());}}}(a1_0xaa0e,0x35180));import{getCookie}from'../auth/cookie-manager.js';import{getEffectiveApiDomain,getEffectiveRuntimeDomain,resolveApiBaseUrl}from'../auth/constants.js';import{apiCache}from'./cache.js';export class DevApiClient{['appCode'];[a1_0x394d39(0x11a)];[a1_0x394d39(0xf2)];[a1_0x394d39(0x144)];[a1_0x394d39(0xfd)];[a1_0x394d39(0x104)];constructor(_0x5414f7){const _0x52e0fa=a1_0x394d39;this['appCode']=_0x5414f7['appCode'],this[_0x52e0fa(0x11a)]=globalThis[_0x52e0fa(0x151)]?.[_0x52e0fa(0x11a)]?.[_0x52e0fa(0x143)]||'online',this[_0x52e0fa(0xf2)]=_0x5414f7['cookie']||getCookie(),this[_0x52e0fa(0x144)]=_0x5414f7[_0x52e0fa(0x129)]||getEffectiveApiDomain(),this[_0x52e0fa(0xfd)]=_0x5414f7['runtimeBaseUrl']||getEffectiveRuntimeDomain(),this['toolboxBaseUrlOverride']=_0x5414f7[_0x52e0fa(0x13c)];if(!this['cookie'])throw new Error(_0x52e0fa(0xf9));}['resolveToolboxUrl'](_0x686c77,_0x4e1e4c){const _0x19e583=a1_0x394d39,_0x9c559e=resolveApiBaseUrl(_0x686c77),_0x353e39=this[_0x19e583(0x104)]&&_0x9c559e===getEffectiveApiDomain()?this[_0x19e583(0x104)]:_0x9c559e;try{const _0x39c669=new URL(_0x353e39);if(_0x39c669['pathname']!=='/')return _0x353e39;}catch{}return''+_0x353e39+_0x4e1e4c;}static [a1_0x394d39(0x14f)]=0x7530;async[a1_0x394d39(0x12e)](_0xa49a51,_0x1c463c={},_0x22e800=DevApiClient[a1_0x394d39(0x14f)]){const _0x197afb=a1_0x394d39,{method:method='GET',body:_0x361722,extraHeaders:_0x25d7af}=_0x1c463c,_0x23f671=new AbortController(),_0x53441e=setTimeout(()=>_0x23f671[_0x197afb(0xf1)](),_0x22e800),_0x337129={'Cookie':this[_0x197afb(0xf2)],'X-Invoke-Source':'mcp:vibe',..._0x25d7af};method==='POST'&&(_0x337129[_0x197afb(0x134)]=_0x197afb(0x140));try{const _0x2ac562=await fetch(_0xa49a51,{'method':method,'headers':_0x337129,..._0x361722!==undefined&&{'body':JSON[_0x197afb(0x124)](_0x361722)},'signal':_0x23f671['signal']});clearTimeout(_0x53441e);if(!_0x2ac562['ok']){if(_0x2ac562[_0x197afb(0x116)]===0x191)throw new Error(_0x197afb(0x132));let _0x946ea2='';try{_0x946ea2=await _0x2ac562[_0x197afb(0x128)]();}catch{}throw new Error(_0x197afb(0x14c)+_0x2ac562[_0x197afb(0x116)]+_0x197afb(0x11f)+_0xa49a51+(_0x946ea2?'\x0a'+_0x946ea2:''));}const _0x5bb900=await _0x2ac562['json']();if(_0x5bb900&&typeof _0x5bb900===_0x197afb(0x135)&&_0x197afb(0x142)in _0x5bb900&&!_0x5bb900['success']){const _0x13f706=_0x5bb900;throw new Error(_0x197afb(0x114)+(_0x13f706[_0x197afb(0x10b)]||_0x13f706[_0x197afb(0xe4)]||'Unknown\x20error'));}return _0x5bb900;}catch(_0x2fe2f2){if(_0x2fe2f2 instanceof Error&&_0x2fe2f2[_0x197afb(0x123)]==='AbortError')throw new Error(_0x197afb(0x111)+_0x22e800+'ms.\x20The\x20server\x20may\x20be\x20down\x20or\x20unreachable.\x0aURL:\x20'+_0xa49a51);if(_0x2fe2f2 instanceof TypeError)throw new Error(_0x197afb(0x150)+_0xa49a51);throw _0x2fe2f2;}}async[a1_0x394d39(0x145)](_0x3d01f2,_0xff59b1){const _0x3ab2b7=a1_0x394d39;return this[_0x3ab2b7(0x12e)](_0x3d01f2,{'method':'GET'},_0xff59b1);}async['postRequest'](_0x890527,_0x1db7f0,_0x1c9a9b,_0x910c29){const _0x372390=a1_0x394d39;return this['_request'](_0x890527,{'method':_0x372390(0x120),'body':_0x1db7f0,'extraHeaders':_0x910c29},_0x1c9a9b);}async[a1_0x394d39(0x12f)](_0x2f5fb9){const _0x1572fb=a1_0x394d39,_0x13bd25=_0x2f5fb9?.[_0x1572fb(0xec)]||![],_0x3c6185=_0x1572fb(0x13b)+this['appCode']+':'+this['env'];if(!_0x13bd25){const _0x16bb03=apiCache[_0x1572fb(0xe5)](_0x3c6185);if(_0x16bb03)return _0x16bb03;}const _0x217c43=this[_0x1572fb(0x144)]+_0x1572fb(0x101),_0x20301f=await this[_0x1572fb(0x12b)](_0x217c43,{'appCode':this[_0x1572fb(0x11e)]});return apiCache[_0x1572fb(0x10a)](_0x3c6185,_0x20301f),_0x20301f;}async[a1_0x394d39(0x14a)](_0x125572,_0x9dcd14=![],_0x453282=![]){const _0x574b55=a1_0x394d39,_0x3b3c11='dataset-detail:'+this[_0x574b55(0x11e)]+':'+this['env']+':'+_0x125572+':'+(_0x453282?_0x574b55(0xe3):_0x574b55(0x12c));if(!_0x9dcd14){const _0x1aebe8=apiCache[_0x574b55(0xe5)](_0x3b3c11);if(_0x1aebe8)return _0x1aebe8;}const _0x392907=/^\d+$/[_0x574b55(0xf0)](_0x125572),_0x146e94=_0x392907?'id':_0x574b55(0xf8),_0x3c0c59=this[_0x574b55(0x144)]+_0x574b55(0x13e)+_0x146e94+'='+_0x125572,_0x29286b=await this[_0x574b55(0x145)](_0x3c0c59);if(_0x453282&&_0x29286b['data']?.[_0x574b55(0xeb)]){const _0x1c0244=_0x29286b[_0x574b55(0x119)][_0x574b55(0x102)]==='v2',_0x4871ad=Array['isArray'](_0x29286b[_0x574b55(0x119)]['relations']);if(!_0x1c0244||!_0x4871ad)try{const _0x4c520c=await this[_0x574b55(0x10f)](_0x29286b[_0x574b55(0x119)][_0x574b55(0xeb)],_0x9dcd14);_0x29286b['data']['relations']=_0x4c520c;}catch(_0x5bf21b){process[_0x574b55(0x11a)]['NODE_ENV']!=='test'&&console[_0x574b55(0x149)](_0x574b55(0x12a)+_0x125572+':',_0x5bf21b);}}return apiCache[_0x574b55(0x10a)](_0x3b3c11,_0x29286b),_0x29286b;}async['searchDatasets'](_0x2a7b9a){const _0xeea08e=a1_0x394d39,_0x269784=await this[_0xeea08e(0x12f)](),_0x1e095a=Array[_0xeea08e(0x126)](_0x269784[_0xeea08e(0x119)])?_0x269784[_0xeea08e(0x119)]:_0x269784['data']?.[_0xeea08e(0xef)]||[];if(!_0x269784[_0xeea08e(0x142)])return{'success':!![],'data':{'tableData':[]}};const _0x145a61=_0x1e095a['filter'](_0xb9685f=>{const _0x1d606f=_0xeea08e,_0x453d2c=_0x2a7b9a[_0x1d606f(0x141)]();return _0xb9685f[_0x1d606f(0x123)]?.['toLowerCase']()['includes'](_0x453d2c)||_0xb9685f[_0x1d606f(0xf8)]?.[_0x1d606f(0x141)]()[_0x1d606f(0x105)](_0x453d2c)||_0xb9685f[_0x1d606f(0xfc)]?.[_0x1d606f(0x100)]?.[_0x1d606f(0x141)]()[_0x1d606f(0x105)](_0x453d2c)||_0xb9685f[_0x1d606f(0x107)]?.['toLowerCase']()[_0x1d606f(0x105)](_0x453d2c);});return{'success':!![],'data':{'tableData':_0x145a61,'paging':{'totalCount':_0x145a61[_0xeea08e(0x13d)],'currentPage':0x1,'pageSize':_0x145a61[_0xeea08e(0x13d)]}}};}async['getCustomSqlList'](_0x8b606e){const _0xbb0039=a1_0x394d39,_0x497e14=_0x8b606e?.['currentPage']||0x1,_0x405b9f=_0x8b606e?.[_0xbb0039(0x10e)]||0x3e7,_0x4ef189=this[_0xbb0039(0x144)]+_0xbb0039(0x113),_0x5e5f62={'appCode':this[_0xbb0039(0x11e)],'currentPage':_0x497e14,'pageSize':_0x405b9f,..._0x8b606e?.[_0xbb0039(0xfa)]&&{'sqlCode':_0x8b606e['sqlCode']},..._0x8b606e?.['sqlName']&&{'sqlName':_0x8b606e['sqlName']}},_0x539596=await this['postRequest'](_0x4ef189,_0x5e5f62);return _0x539596;}async['executeSql'](_0x6d1131){const _0x48ad7b=a1_0x394d39,_0x18c776=this[_0x48ad7b(0xfd)]+_0x48ad7b(0x131),_0x46eed4={'appCode':this['appCode'],'sqlCode':_0x6d1131[_0x48ad7b(0xfa)],..._0x6d1131['params']&&{'params':_0x6d1131[_0x48ad7b(0x127)]}};return await this[_0x48ad7b(0x12b)](_0x18c776,_0x46eed4);}async[a1_0x394d39(0x109)](_0x3aa179){const _0x427e60=a1_0x394d39,_0x46567e=this[_0x427e60(0x144)]+_0x427e60(0xee),_0x39e7fc={'sqlName':_0x3aa179['sqlName'],'dbId':_0x3aa179[_0x427e60(0x13a)],'sqlContent':_0x3aa179[_0x427e60(0x103)],'appCode':this[_0x427e60(0x11e)]};return await this[_0x427e60(0x12b)](_0x46567e,_0x39e7fc);}async['updateUserCustomSql'](_0x14514d){const _0x421e7a=a1_0x394d39,_0x9ff3e=this[_0x421e7a(0x144)]+_0x421e7a(0x133),_0x362116={'id':_0x14514d['id'],'dbId':_0x14514d[_0x421e7a(0x13a)],'sqlName':_0x14514d[_0x421e7a(0xe9)],'appCode':this[_0x421e7a(0x11e)],'sqlContent':_0x14514d[_0x421e7a(0x103)]};return await this['postRequest'](_0x9ff3e,_0x362116);}async[a1_0x394d39(0xff)](_0x55a618,_0x3b33d2=![]){const _0x23dfe6=a1_0x394d39,_0x21e0b2=_0x23dfe6(0xf6)+this[_0x23dfe6(0x11e)]+':'+this[_0x23dfe6(0x11a)]+':'+_0x55a618;if(!_0x3b33d2){const _0x5b0137=apiCache[_0x23dfe6(0xe5)](_0x21e0b2);if(_0x5b0137)return _0x5b0137;}const _0x51bd7e=this[_0x23dfe6(0x144)]+'/smartapi/question/er-config',_0x195f27=await this[_0x23dfe6(0x12b)](_0x51bd7e,{'dblinkId':_0x55a618,'appCode':this[_0x23dfe6(0x11e)]});if(!_0x195f27[_0x23dfe6(0x142)]||!_0x195f27[_0x23dfe6(0x119)])throw new Error('Failed\x20to\x20get\x20ER\x20config\x20for\x20dblinkId:\x20'+_0x55a618);const _0x31c46a={'meta':_0x195f27[_0x23dfe6(0x119)]['meta'],'datasets':_0x195f27['data'][_0x23dfe6(0x118)]};return apiCache[_0x23dfe6(0x10a)](_0x21e0b2,_0x31c46a),_0x31c46a;}async['getUniqueDbIds'](_0x3d7984=![]){const _0x322585=a1_0x394d39,_0xbf972a=await this[_0x322585(0x12f)]({'forceRefresh':_0x3d7984}),_0xadbc89=Array[_0x322585(0x126)](_0xbf972a[_0x322585(0x119)])?_0xbf972a['data']:_0xbf972a['data']?.[_0x322585(0xef)]||[],_0x19c7b2=new Set();for(const _0x32f040 of _0xadbc89){_0x32f040[_0x322585(0xfc)]?.[_0x322585(0x13a)]&&_0x19c7b2[_0x322585(0x147)](_0x32f040[_0x322585(0xfc)][_0x322585(0x13a)]);}return Array['from'](_0x19c7b2)['sort']((_0x212981,_0x5c62f8)=>_0x212981-_0x5c62f8);}async['getAllErConfigs'](_0x26ad7e=![]){const _0x24fc60=a1_0x394d39,_0xaadce3=_0x24fc60(0x138)+this[_0x24fc60(0x11e)]+':'+this[_0x24fc60(0x11a)];if(!_0x26ad7e){const _0x2bb942=apiCache[_0x24fc60(0xe5)](_0xaadce3);if(_0x2bb942)return _0x2bb942;}const _0x11c33c=await this['getUniqueDbIds'](_0x26ad7e),_0x29dc43=new Map();for(const _0x4e8489 of _0x11c33c){try{const _0x9a5060=await this[_0x24fc60(0xff)](_0x4e8489,_0x26ad7e);_0x29dc43[_0x24fc60(0x10a)](_0x4e8489,_0x9a5060);}catch(_0x220b77){console[_0x24fc60(0x149)](_0x24fc60(0x146)+_0x4e8489+':',_0x220b77);}}return apiCache[_0x24fc60(0x10a)](_0xaadce3,_0x29dc43),_0x29dc43;}async[a1_0x394d39(0x10f)](_0x5ae463,_0x10924e=![]){const _0x550084=a1_0x394d39,_0x4ee975=await this[_0x550084(0xf4)](_0x10924e),_0x25d3d0=[],_0x47ecf1=[];for(const [,_0xfbfb41]of _0x4ee975){const _0x553388=_0xfbfb41[_0x550084(0x118)][_0x550084(0x110)](_0x32a5d1=>_0x32a5d1[_0x550084(0x112)]===_0x5ae463);if(_0x553388)for(const _0x1e6a1c of _0x553388['relations']||[]){_0x25d3d0['push']({'toDataset':_0x1e6a1c[_0x550084(0xfe)],'toDatasetName':_0x1e6a1c[_0x550084(0xea)],'toField':_0x1e6a1c['toField'],'fromField':_0x1e6a1c[_0x550084(0xed)],'joinType':_0x1e6a1c[_0x550084(0x14e)]});}for(const _0x884e3c of _0xfbfb41['datasets']){if(_0x884e3c[_0x550084(0x112)]===_0x5ae463)continue;for(const _0x3270fd of _0x884e3c[_0x550084(0x117)]||[]){_0x3270fd[_0x550084(0xfe)]===_0x5ae463&&_0x47ecf1[_0x550084(0x12d)]({'fromDataset':_0x884e3c['datasetCode'],'fromDatasetName':_0x884e3c[_0x550084(0x125)],'fromField':_0x3270fd['fromField'],'toField':_0x3270fd[_0x550084(0x136)],'joinType':_0x3270fd[_0x550084(0x14e)]});}}}return{'outgoing':_0x25d3d0,'incoming':_0x47ecf1};}async[a1_0x394d39(0x122)](){const _0x57308a=a1_0x394d39,_0xb3febb=this[_0x57308a(0x144)]+_0x57308a(0x10d)+encodeURIComponent(this[_0x57308a(0x11e)])+_0x57308a(0xf7);return await this['request'](_0xb3febb);}async[a1_0x394d39(0x137)](_0xceaa9a){const _0x9fcb84=a1_0x394d39,_0x4f9c01=this[_0x9fcb84(0x144)]+_0x9fcb84(0x115)+_0xceaa9a;return await this[_0x9fcb84(0x145)](_0x4f9c01);}async[a1_0x394d39(0x11d)](_0x414a4d){const _0x2f9f4a=a1_0x394d39,_0x2c1bc2=this['apiDomain']+'/api/management/library/scripts/save',_0x34ad71={'id':_0x414a4d['id']??null,'appCode':_0x414a4d[_0x2f9f4a(0x11e)],'description':_0x414a4d[_0x2f9f4a(0x107)],'scriptContent':_0x414a4d[_0x2f9f4a(0xe6)],'scriptType':_0x414a4d[_0x2f9f4a(0x139)]};return await this[_0x2f9f4a(0x12b)](_0x2c1bc2,_0x34ad71);}async[a1_0x394d39(0x14b)](){const _0x3dd1d8=a1_0x394d39,_0x253082=this['runtimeDomain']+'/api/management/script/cache/clear';return await this[_0x3dd1d8(0x12b)](_0x253082,{});}async[a1_0x394d39(0xe7)](_0x1e4b5c){const _0x30758e=a1_0x394d39,_0x1afb96=this[_0x30758e(0xf5)](_0x30758e(0x14d),_0x30758e(0x11b)),_0x48dc28=await this['postRequest'](_0x1afb96,_0x1e4b5c);return _0x48dc28['data'];}async[a1_0x394d39(0xfb)](_0x2ceef7){const _0x3f10b5=a1_0x394d39,_0x171991=this[_0x3f10b5(0xf5)](_0x3f10b5(0x148),_0x3f10b5(0xf3)),_0xd06f6b=await this[_0x3f10b5(0x12b)](_0x171991,_0x2ceef7);return _0xd06f6b['data'];}}
@@ -1 +1 @@
1
- function a2_0x4965(){var _0x49d189=['24EIholJ','4878769shJYjI','678yxkKBq','17885120kddUga','162063YyUpjL','424392KWarMm','45424LTWRUS','805869GnemWV','14teaTrJ','46310ERlqCa'];a2_0x4965=function(){return _0x49d189;};return a2_0x4965();}function a2_0x5b7a(_0x55efcb,_0x37dd34){_0x55efcb=_0x55efcb-0x87;var _0x4965da=a2_0x4965();var _0x5b7ae6=_0x4965da[_0x55efcb];return _0x5b7ae6;}(function(_0x1fe67a,_0x557a41){var _0x5639df=a2_0x5b7a,_0x25b812=_0x1fe67a();while(!![]){try{var _0x2c6377=parseInt(_0x5639df(0x88))/0x1+parseInt(_0x5639df(0x8a))/0x2*(parseInt(_0x5639df(0x90))/0x3)+-parseInt(_0x5639df(0x87))/0x4+parseInt(_0x5639df(0x8b))/0x5*(parseInt(_0x5639df(0x8e))/0x6)+parseInt(_0x5639df(0x8d))/0x7+parseInt(_0x5639df(0x8c))/0x8*(parseInt(_0x5639df(0x89))/0x9)+-parseInt(_0x5639df(0x8f))/0xa;if(_0x2c6377===_0x557a41)break;else _0x25b812['push'](_0x25b812['shift']());}catch(_0x17bba8){_0x25b812['push'](_0x25b812['shift']());}}}(a2_0x4965,0x841e5));export{getEnvAppCode,getEnvironment,getEnvApiBaseUrl,getEnvRuntimeBaseUrl,getEnvUserBaseUrl,getEnvAuthCookie,configDir,cookieFile,defaultConfig,getEnvAppCodeWithFallback,getApiDomain,getUserDomain,getRuntimeDomain,getEffectiveApiDomain,getEffectiveRuntimeDomain,getEffectiveUserDomain,getEnvToolboxBaseUrl,getEffectiveToolboxDomain}from'../config/env.js';export{resolveApiBaseUrl}from'../config/api-url-resolver.js';
1
+ function a2_0x5d39(_0x3e82a0,_0x22e518){_0x3e82a0=_0x3e82a0-0x15c;var _0x102eec=a2_0x102e();var _0x5d39a1=_0x102eec[_0x3e82a0];return _0x5d39a1;}(function(_0x396413,_0x52cd98){var _0x1da575=a2_0x5d39,_0x1c4341=_0x396413();while(!![]){try{var _0x18e54c=parseInt(_0x1da575(0x15e))/0x1+parseInt(_0x1da575(0x160))/0x2*(parseInt(_0x1da575(0x165))/0x3)+parseInt(_0x1da575(0x15c))/0x4+parseInt(_0x1da575(0x15d))/0x5+parseInt(_0x1da575(0x161))/0x6*(-parseInt(_0x1da575(0x15f))/0x7)+-parseInt(_0x1da575(0x164))/0x8*(parseInt(_0x1da575(0x162))/0x9)+-parseInt(_0x1da575(0x163))/0xa;if(_0x18e54c===_0x52cd98)break;else _0x1c4341['push'](_0x1c4341['shift']());}catch(_0x195b8f){_0x1c4341['push'](_0x1c4341['shift']());}}}(a2_0x102e,0x39d0d));function a2_0x102e(){var _0x202302=['2169qkmhRs','3361200euNYOC','6904nXpRfS','383772CQPlNA','939708SoHMeJ','1841005qprEVJ','307971iIkXIw','7GLeCFR','2sRNCRC','1548642QnOOjK'];a2_0x102e=function(){return _0x202302;};return a2_0x102e();}export{getEnvAppCode,getEnvironment,getEnvApiBaseUrl,getEnvRuntimeBaseUrl,getEnvUserBaseUrl,getEnvAuthCookie,configDir,cookieFile,defaultConfig,getEnvAppCodeWithFallback,getApiDomain,getUserDomain,getRuntimeDomain,getEffectiveApiDomain,getEffectiveRuntimeDomain,getEffectiveUserDomain,getEnvToolboxBaseUrl,getEffectiveToolboxDomain}from'../config/env.js';export{resolveApiBaseUrl}from'../config/api-url-resolver.js';
@@ -1 +1 @@
1
- (function(_0x4fc7cd,_0x28d1e8){const _0x3ced3c=a3_0x3ef7,_0x24968a=_0x4fc7cd();while(!![]){try{const _0x31ac92=parseInt(_0x3ced3c(0x10d))/0x1+-parseInt(_0x3ced3c(0x112))/0x2*(-parseInt(_0x3ced3c(0x106))/0x3)+-parseInt(_0x3ced3c(0x109))/0x4*(parseInt(_0x3ced3c(0x108))/0x5)+parseInt(_0x3ced3c(0x110))/0x6*(-parseInt(_0x3ced3c(0x10b))/0x7)+-parseInt(_0x3ced3c(0x10c))/0x8+-parseInt(_0x3ced3c(0x107))/0x9*(parseInt(_0x3ced3c(0x111))/0xa)+parseInt(_0x3ced3c(0x103))/0xb*(parseInt(_0x3ced3c(0x10e))/0xc);if(_0x31ac92===_0x28d1e8)break;else _0x24968a['push'](_0x24968a['shift']());}catch(_0x272c4f){_0x24968a['push'](_0x24968a['shift']());}}}(a3_0x566f,0x7bce1));import{readFileSync,writeFileSync}from'node:fs';import{getEnvAuthCookie,cookieFile}from'../config/env.js';export function getCookie(){const _0x28a9ad=a3_0x3ef7,_0x2d9f82=getEnvAuthCookie();if(_0x2d9f82)return _0x2d9f82;try{return readFileSync(cookieFile,'utf-8')[_0x28a9ad(0x10f)]();}catch{return'';}}export function saveCookie(_0x2de467){const _0x430eb1=a3_0x3ef7;try{writeFileSync(cookieFile,_0x2de467,_0x430eb1(0x10a));}catch(_0x2d8c76){throw new Error('Failed\x20to\x20save\x20cookie\x20to\x20'+cookieFile+':\x20'+_0x2d8c76[_0x430eb1(0x104)]);}}function a3_0x3ef7(_0x5604f6,_0x441a28){_0x5604f6=_0x5604f6-0x103;const _0x566fbf=a3_0x566f();let _0x3ef7d1=_0x566fbf[_0x5604f6];return _0x3ef7d1;}export function hasCookie(){const _0x111078=a3_0x3ef7,_0x5a0133=getCookie();return _0x5a0133[_0x111078(0x105)]>0x0;}export function clearCookie(){const _0x359886=a3_0x3ef7;try{writeFileSync(cookieFile,'',_0x359886(0x10a));}catch{}}function a3_0x566f(){const _0x144cb1=['utf-8','25501XmstpK','3867784IkBCJb','847206WgmDUe','12fxPcTf','trim','1308aYsfAr','3029230KNYEsb','76KNiewj','13633598GKOVyC','message','length','12417iKtcCx','9rkrzyT','781155fuphJQ','4RNIiBo'];a3_0x566f=function(){return _0x144cb1;};return a3_0x566f();}
1
+ function a3_0x827e(_0x55ed4e,_0x320864){_0x55ed4e=_0x55ed4e-0x7b;const _0x2ac404=a3_0x2ac4();let _0x827e2=_0x2ac404[_0x55ed4e];return _0x827e2;}(function(_0x49b699,_0x3cd283){const _0x132006=a3_0x827e,_0x26139d=_0x49b699();while(!![]){try{const _0x19eb15=-parseInt(_0x132006(0x83))/0x1*(parseInt(_0x132006(0x7b))/0x2)+parseInt(_0x132006(0x88))/0x3+parseInt(_0x132006(0x7d))/0x4+parseInt(_0x132006(0x89))/0x5*(parseInt(_0x132006(0x87))/0x6)+parseInt(_0x132006(0x7e))/0x7*(-parseInt(_0x132006(0x80))/0x8)+parseInt(_0x132006(0x85))/0x9+-parseInt(_0x132006(0x7c))/0xa;if(_0x19eb15===_0x3cd283)break;else _0x26139d['push'](_0x26139d['shift']());}catch(_0x41760e){_0x26139d['push'](_0x26139d['shift']());}}}(a3_0x2ac4,0xe067c));import{readFileSync,writeFileSync}from'node:fs';import{getEnvAuthCookie,cookieFile}from'../config/env.js';export function getCookie(){const _0x1dd473=a3_0x827e,_0x5a8baf=getEnvAuthCookie();if(_0x5a8baf)return _0x5a8baf;try{return readFileSync(cookieFile,_0x1dd473(0x84))[_0x1dd473(0x86)]();}catch{return'';}}function a3_0x2ac4(){const _0x2b2d1b=['message','44039nPAAiv','utf-8','247212hpVuTc','trim','48612qfiNQS','4601997EpgZOX','625ZSmnHK','58bdGxdo','11946920HnGMty','6748016tvIHzR','903HeoKRL','Failed\x20to\x20save\x20cookie\x20to\x20','53968rMCxQj','length'];a3_0x2ac4=function(){return _0x2b2d1b;};return a3_0x2ac4();}export function saveCookie(_0x207f42){const _0x1c1428=a3_0x827e;try{writeFileSync(cookieFile,_0x207f42,_0x1c1428(0x84));}catch(_0x21da37){throw new Error(_0x1c1428(0x7f)+cookieFile+':\x20'+_0x21da37[_0x1c1428(0x82)]);}}export function hasCookie(){const _0x4eb8eb=a3_0x827e,_0x3d3ca1=getCookie();return _0x3d3ca1[_0x4eb8eb(0x81)]>0x0;}export function clearCookie(){const _0x1f446a=a3_0x827e;try{writeFileSync(cookieFile,'',_0x1f446a(0x84));}catch{}}
@@ -1 +1 @@
1
- function a4_0x4b0e(_0x327a98,_0x3d8f55){_0x327a98=_0x327a98-0x1ad;const _0x42aa2b=a4_0x42aa();let _0x4b0e61=_0x42aa2b[_0x327a98];return _0x4b0e61;}(function(_0x23375c,_0xaeb51a){const _0x4806f4=a4_0x4b0e,_0x5c3b9e=_0x23375c();while(!![]){try{const _0x7f86f1=parseInt(_0x4806f4(0x1b8))/0x1*(parseInt(_0x4806f4(0x1b6))/0x2)+-parseInt(_0x4806f4(0x1af))/0x3+parseInt(_0x4806f4(0x1b5))/0x4*(parseInt(_0x4806f4(0x1ad))/0x5)+parseInt(_0x4806f4(0x1ae))/0x6+-parseInt(_0x4806f4(0x1b3))/0x7*(-parseInt(_0x4806f4(0x1b4))/0x8)+-parseInt(_0x4806f4(0x1bb))/0x9*(-parseInt(_0x4806f4(0x1b1))/0xa)+parseInt(_0x4806f4(0x1b7))/0xb*(-parseInt(_0x4806f4(0x1b2))/0xc);if(_0x7f86f1===_0xaeb51a)break;else _0x5c3b9e['push'](_0x5c3b9e['shift']());}catch(_0x1297c5){_0x5c3b9e['push'](_0x5c3b9e['shift']());}}}(a4_0x42aa,0x6c969));import{getCookie}from'./cookie-manager.js';import{getUserDomain}from'../config/env.js';export async function isSessionValid(){const _0x4347f9=a4_0x4b0e,_0x1d5d9d=getCookie();if(!_0x1d5d9d)return![];try{const _0x5ab9de=await fetch(getUserDomain()+_0x4347f9(0x1b9),{'headers':{'cookie':_0x1d5d9d}});if(!_0x5ab9de['ok'])return![];const _0x24dc18=await _0x5ab9de[_0x4347f9(0x1ba)]();return!!(_0x24dc18?.['session']&&_0x24dc18?.[_0x4347f9(0x1b0)]);}catch{return![];}}function a4_0x42aa(){const _0x2f0627=['4632VGgFvc','2OwZWUy','11CZMgBs','604411xSXthE','/api/auth/get-session','json','1206mQXGji','2375xtApZG','4369638tkcoIT','1044219WbpQLw','user','16810qyFPLi','21569448VBpKUa','1125404oIVclk','24ysAsVC'];a4_0x42aa=function(){return _0x2f0627;};return a4_0x42aa();}
1
+ (function(_0x4ca4be,_0x451aaf){const _0xc4d3e1=a4_0x3caf,_0x2aa29e=_0x4ca4be();while(!![]){try{const _0x50478b=parseInt(_0xc4d3e1(0xe4))/0x1*(parseInt(_0xc4d3e1(0xea))/0x2)+parseInt(_0xc4d3e1(0xe1))/0x3*(-parseInt(_0xc4d3e1(0xe0))/0x4)+parseInt(_0xc4d3e1(0xe2))/0x5+-parseInt(_0xc4d3e1(0xe9))/0x6*(parseInt(_0xc4d3e1(0xdd))/0x7)+-parseInt(_0xc4d3e1(0xdc))/0x8+parseInt(_0xc4d3e1(0xe3))/0x9+-parseInt(_0xc4d3e1(0xe8))/0xa*(parseInt(_0xc4d3e1(0xe7))/0xb);if(_0x50478b===_0x451aaf)break;else _0x2aa29e['push'](_0x2aa29e['shift']());}catch(_0x44518b){_0x2aa29e['push'](_0x2aa29e['shift']());}}}(a4_0x54d0,0x4692a));function a4_0x3caf(_0x46fbec,_0x147133){_0x46fbec=_0x46fbec-0xdc;const _0x54d0f7=a4_0x54d0();let _0x3caf05=_0x54d0f7[_0x46fbec];return _0x3caf05;}import{getCookie}from'./cookie-manager.js';function a4_0x54d0(){const _0x3452f0=['json','user','64262UlKEor','880ICRxEJ','12EkXHyn','6TLaXtM','82528cKoRiJ','312466HlWSSY','session','/api/auth/get-session','1180776rItVcV','3eqJcjC','2778295OGFxSe','1449828yXddMZ','160399sHLSjV'];a4_0x54d0=function(){return _0x3452f0;};return a4_0x54d0();}import{getUserDomain}from'../config/env.js';export async function isSessionValid(){const _0x3e89c1=a4_0x3caf,_0x32d12f=getCookie();if(!_0x32d12f)return![];try{const _0x5f080f=await fetch(getUserDomain()+_0x3e89c1(0xdf),{'headers':{'cookie':_0x32d12f}});if(!_0x5f080f['ok'])return![];const _0x5d8d20=await _0x5f080f[_0x3e89c1(0xe5)]();return!!(_0x5d8d20?.[_0x3e89c1(0xde)]&&_0x5d8d20?.[_0x3e89c1(0xe6)]);}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x19f81e,_0x342bfe){const _0x38e4b4=a5_0x5164,_0x1aed37=_0x19f81e();while(!![]){try{const _0x588407=parseInt(_0x38e4b4(0xd1))/0x1*(-parseInt(_0x38e4b4(0xd2))/0x2)+parseInt(_0x38e4b4(0xce))/0x3+parseInt(_0x38e4b4(0xcd))/0x4*(-parseInt(_0x38e4b4(0xd3))/0x5)+parseInt(_0x38e4b4(0xd5))/0x6+parseInt(_0x38e4b4(0xd0))/0x7+-parseInt(_0x38e4b4(0xcc))/0x8*(-parseInt(_0x38e4b4(0xd6))/0x9)+-parseInt(_0x38e4b4(0xcf))/0xa;if(_0x588407===_0x342bfe)break;else _0x1aed37['push'](_0x1aed37['shift']());}catch(_0x557f9c){_0x1aed37['push'](_0x1aed37['shift']());}}}(a5_0x40c1,0x20bed));import{getEnvToolboxBaseUrl,getEffectiveApiDomain}from'./env.js';import{getConfigApiUrlOverrides}from'./lovrabet-config.js';let _envOverridesCache=null;function getEnvApiUrlOverrides(){const _0x3d3652=a5_0x5164;if(_envOverridesCache!==null)return _envOverridesCache;const _0x429671=process[_0x3d3652(0xd8)][_0x3d3652(0xcb)];if(!_0x429671)return _envOverridesCache={},_envOverridesCache;try{_envOverridesCache=JSON[_0x3d3652(0xd7)](_0x429671);}catch{process[_0x3d3652(0xd8)][_0x3d3652(0xd4)]&&console[_0x3d3652(0xd9)]('[MCP]\x20LOVRABET_API_URL_OVERRIDES\x20is\x20not\x20valid\x20JSON,\x20ignoring'),_envOverridesCache={};}return _envOverridesCache;}function a5_0x5164(_0x44d785,_0x51f657){_0x44d785=_0x44d785-0xcb;const _0x40c1c6=a5_0x40c1();let _0x51641b=_0x40c1c6[_0x44d785];return _0x51641b;}export function resolveApiBaseUrl(_0x5edada){const _0x497a77=getEnvApiUrlOverrides();if(_0x497a77[_0x5edada])return _0x497a77[_0x5edada];const _0xe3b01a=getConfigApiUrlOverrides();if(_0xe3b01a[_0x5edada])return _0xe3b01a[_0x5edada];return getEnvToolboxBaseUrl()??getEffectiveApiDomain();}export function clearApiUrlOverridesCache(){_envOverridesCache=null;}function a5_0x40c1(){const _0x3f50f1=['warn','LOVRABET_API_URL_OVERRIDES','8AvUykM','115616FvbwqP','798303QHXzip','1095570OFcQoh','1070391RJehOG','13eQOrhr','21874ODDeIS','40rkDqJS','MCP_DEBUG','1056624fBHDxm','197793jiqUCD','parse','env'];a5_0x40c1=function(){return _0x3f50f1;};return a5_0x40c1();}
1
+ (function(_0x1ba86c,_0x1d8e2b){const _0x22b16a=a5_0x40c9,_0x2e7ee3=_0x1ba86c();while(!![]){try{const _0x498956=parseInt(_0x22b16a(0x128))/0x1*(parseInt(_0x22b16a(0x126))/0x2)+parseInt(_0x22b16a(0x127))/0x3+-parseInt(_0x22b16a(0x11b))/0x4*(-parseInt(_0x22b16a(0x11e))/0x5)+-parseInt(_0x22b16a(0x120))/0x6+parseInt(_0x22b16a(0x11d))/0x7*(parseInt(_0x22b16a(0x123))/0x8)+parseInt(_0x22b16a(0x125))/0x9+-parseInt(_0x22b16a(0x124))/0xa;if(_0x498956===_0x1d8e2b)break;else _0x2e7ee3['push'](_0x2e7ee3['shift']());}catch(_0x17def0){_0x2e7ee3['push'](_0x2e7ee3['shift']());}}}(a5_0xfd88,0xd7ce0));import{getEnvToolboxBaseUrl,getEffectiveApiDomain}from'./env.js';import{getConfigApiUrlOverrides}from'./lovrabet-config.js';let _envOverridesCache=null;function getEnvApiUrlOverrides(){const _0x5c03db=a5_0x40c9;if(_envOverridesCache!==null)return _envOverridesCache;const _0x222159=process[_0x5c03db(0x122)][_0x5c03db(0x121)];if(!_0x222159)return _envOverridesCache={},_envOverridesCache;try{_envOverridesCache=JSON['parse'](_0x222159);}catch{process[_0x5c03db(0x122)]['MCP_DEBUG']&&console[_0x5c03db(0x11c)](_0x5c03db(0x11f)),_envOverridesCache={};}return _envOverridesCache;}export function resolveApiBaseUrl(_0x909cfe){const _0x585c74=getEnvApiUrlOverrides();if(_0x585c74[_0x909cfe])return _0x585c74[_0x909cfe];const _0x101abc=getConfigApiUrlOverrides();if(_0x101abc[_0x909cfe])return _0x101abc[_0x909cfe];return getEnvToolboxBaseUrl()??getEffectiveApiDomain();}export function clearApiUrlOverridesCache(){_envOverridesCache=null;}function a5_0x40c9(_0x4b33a6,_0x45137f){_0x4b33a6=_0x4b33a6-0x11b;const _0xfd8853=a5_0xfd88();let _0x40c957=_0xfd8853[_0x4b33a6];return _0x40c957;}function a5_0xfd88(){const _0x15e6a7=['21hidDOD','136555XlwIzm','[MCP]\x20LOVRABET_API_URL_OVERRIDES\x20is\x20not\x20valid\x20JSON,\x20ignoring','6834636OtqAPQ','LOVRABET_API_URL_OVERRIDES','env','2593176qltGXP','34410850JYFQwO','4774167NVKudP','2KmyeCv','3807519wgEsYU','971457TSHoSW','252IDqFWY','warn'];a5_0xfd88=function(){return _0x15e6a7;};return a5_0xfd88();}
@@ -1 +1 @@
1
- const a6_0x47f46e=a6_0x112e;(function(_0x5b0ea7,_0x4a4b95){const _0x3295de=a6_0x112e,_0x5845b8=_0x5b0ea7();while(!![]){try{const _0x3a529a=-parseInt(_0x3295de(0xcd))/0x1*(-parseInt(_0x3295de(0xdb))/0x2)+-parseInt(_0x3295de(0xce))/0x3*(-parseInt(_0x3295de(0xdc))/0x4)+parseInt(_0x3295de(0xe7))/0x5*(-parseInt(_0x3295de(0xed))/0x6)+-parseInt(_0x3295de(0xe6))/0x7+parseInt(_0x3295de(0xe0))/0x8*(-parseInt(_0x3295de(0xda))/0x9)+-parseInt(_0x3295de(0xe8))/0xa*(-parseInt(_0x3295de(0xea))/0xb)+parseInt(_0x3295de(0xd2))/0xc*(parseInt(_0x3295de(0xde))/0xd);if(_0x3a529a===_0x4a4b95)break;else _0x5845b8['push'](_0x5845b8['shift']());}catch(_0x377e49){_0x5845b8['push'](_0x5845b8['shift']());}}}(a6_0x4afa,0x1dca4));import{mkdirSync}from'node:fs';import{homedir}from'node:os';const ENVIRONMENT_MAPPING={'online':a6_0x47f46e(0xe5),'production':a6_0x47f46e(0xe5),'daily':'daily','dev':a6_0x47f46e(0xd7),'development':a6_0x47f46e(0xd7)};function normalizeEnvironment(_0x3011f7){const _0x38d841=a6_0x47f46e;if(!_0x3011f7)return _0x38d841(0xe5);const _0x36c81b=_0x3011f7[_0x38d841(0xeb)](),_0x4681e1=ENVIRONMENT_MAPPING[_0x36c81b];if(!_0x4681e1)return console[_0x38d841(0xdd)](_0x38d841(0xd4)+_0x3011f7+',\x20using\x20default\x20production'),_0x38d841(0xe5);return _0x4681e1!==_0x36c81b&&_0x4681e1!==_0x3011f7&&console[_0x38d841(0xe4)](_0x38d841(0xd5)+_0x3011f7+_0x38d841(0xe9)+_0x4681e1),_0x4681e1;}export function getEnvAppCode(){const _0x384b65=a6_0x47f46e;return process[_0x384b65(0xe2)][_0x384b65(0xd1)];}export function getEnvironment(){const _0x4e0852=a6_0x47f46e,_0x22c6d8=process[_0x4e0852(0xe2)]['LOVRABET_ENV'];return normalizeEnvironment(_0x22c6d8);}export function getEnvApiBaseUrl(){const _0xd8afc6=a6_0x47f46e;return process[_0xd8afc6(0xe2)]['LOVRABET_API_BASEURL'];}export function getEnvRuntimeBaseUrl(){const _0x1a03b9=a6_0x47f46e;return process[_0x1a03b9(0xe2)][_0x1a03b9(0xd3)];}export function getEnvUserBaseUrl(){return process['env']['LOVRABET_USER_BASEURL'];}export function getEnvAuthCookie(){const _0x1e5560=a6_0x47f46e;return process[_0x1e5560(0xe2)]['LOVRABET_AUTH_COOKIE']?.[_0x1e5560(0xcb)]();}export function isTestEnv(){const _0x2de6a0=a6_0x47f46e;return process[_0x2de6a0(0xe2)][_0x2de6a0(0xd0)]==='test';}export function isProductionEnv(){const _0x1d9911=a6_0x47f46e;return process['env'][_0x1d9911(0xd0)]===_0x1d9911(0xe5);}export function isDevelopmentEnv(){const _0x50dc25=a6_0x47f46e;return process[_0x50dc25(0xe2)]['NODE_ENV']===_0x50dc25(0xd7);}export function shouldLog(){const _0x24998e=a6_0x47f46e,_0x2a186c=process[_0x24998e(0xe2)][_0x24998e(0xd0)];return _0x2a186c===_0x24998e(0xd7)||_0x2a186c===_0x24998e(0xe3);}export const configDir=homedir()+a6_0x47f46e(0xe1);export const cookieFile=configDir+a6_0x47f46e(0xd9);function a6_0x112e(_0x20401d,_0x1f4e3d){_0x20401d=_0x20401d-0xca;const _0x4afa27=a6_0x4afa();let _0x112e01=_0x4afa27[_0x20401d];return _0x112e01;}mkdirSync(configDir,{'recursive':!![]});export const defaultConfig={'appCode':getEnvAppCode(),'env':getEnvironment()};function a6_0x4afa(){const _0x25f36e=['40fEMpMk','20aABNEh','\x20→\x20','1259203auofvp','toLowerCase','https://runtime.lovrabet.com','54732ZIlgGA','https://dev.lovrabet.com','trim','LOVRABET_TOOLBOX_BASEURL','24878XAJUnu','9wPZQTl','https://user.lovrabet.com','NODE_ENV','LOVRABET_APP_CODE','1147308fSwjtF','LOVRABET_RUNTIME_BASEURL','[ENV]\x20Unknown\x20environment:\x20','[ENV]\x20Environment\x20mapping:\x20','https://api.lovrabet.com','development','https://daily-api.lovrabet.com','/cookie','81936QpmbbZ','4oeHdGJ','52312NtgfEy','warn','39QXCEyL','https://user-daily.lovrabet.com','200BdcQul','/.lovrabet','env','daily','log','production','1275169SkDRdG'];a6_0x4afa=function(){return _0x25f36e;};return a6_0x4afa();}export function getEnvAppCodeWithFallback(_0xfc45ad){return getEnvAppCode()||_0xfc45ad;}export function getApiDomain(){const _0x2e942a=a6_0x47f46e,_0x200012=getEnvironment(),_0x4db229={'production':_0x2e942a(0xd6),'online':_0x2e942a(0xd6),'daily':_0x2e942a(0xd8),'development':'https://dev.lovrabet.com'};return _0x4db229[_0x200012];}export function getUserDomain(){const _0x13244d=a6_0x47f46e,_0x469ef9=getEnvironment(),_0x14473e={'production':_0x13244d(0xcf),'online':'https://user.lovrabet.com','daily':_0x13244d(0xdf),'development':_0x13244d(0xca)};return _0x14473e[_0x469ef9];}export function getRuntimeDomain(){const _0x1c4bd5=a6_0x47f46e,_0x4c40b8=getEnvironment(),_0x421e93={'production':_0x1c4bd5(0xec),'online':'https://runtime.lovrabet.com','daily':'https://daily-runtime.lovrabet.com','development':'https://dev.lovrabet.com'};return _0x421e93[_0x4c40b8];}export function getEffectiveApiDomain(){return getEnvApiBaseUrl()||getApiDomain();}export function getEffectiveRuntimeDomain(){return getEnvRuntimeBaseUrl()||getRuntimeDomain();}export function getEffectiveUserDomain(){return getEnvUserBaseUrl()||getUserDomain();}export function getEnvToolboxBaseUrl(){const _0x1d0ede=a6_0x47f46e;return process[_0x1d0ede(0xe2)][_0x1d0ede(0xcc)];}export function getEffectiveToolboxDomain(){return getEnvToolboxBaseUrl()||getEffectiveApiDomain();}
1
+ const a6_0x555bf6=a6_0x15a7;(function(_0x136f62,_0x1e2eee){const _0x59ba70=a6_0x15a7,_0x1c101a=_0x136f62();while(!![]){try{const _0x36489d=parseInt(_0x59ba70(0x15c))/0x1+parseInt(_0x59ba70(0x14e))/0x2*(-parseInt(_0x59ba70(0x162))/0x3)+parseInt(_0x59ba70(0x158))/0x4*(parseInt(_0x59ba70(0x155))/0x5)+-parseInt(_0x59ba70(0x14b))/0x6+parseInt(_0x59ba70(0x14f))/0x7+-parseInt(_0x59ba70(0x151))/0x8+parseInt(_0x59ba70(0x15d))/0x9;if(_0x36489d===_0x1e2eee)break;else _0x1c101a['push'](_0x1c101a['shift']());}catch(_0x4b5679){_0x1c101a['push'](_0x1c101a['shift']());}}}(a6_0x454c,0xd5679));import{mkdirSync}from'node:fs';import{homedir}from'node:os';const ENVIRONMENT_MAPPING={'online':'production','production':a6_0x555bf6(0x160),'daily':a6_0x555bf6(0x15b),'dev':a6_0x555bf6(0x164),'development':'development'};function a6_0x454c(){const _0x11103d=['2647674ICqySA','https://daily-runtime.lovrabet.com','LOVRABET_APP_CODE','46aZcBri','9004457LALWOt','/.lovrabet','2421032Tlzupi','https://api.lovrabet.com','LOVRABET_ENV','https://dev.lovrabet.com','25hvQslC','LOVRABET_RUNTIME_BASEURL','test','8092hiduJw','trim','LOVRABET_TOOLBOX_BASEURL','daily','1536774OQrYpo','4014981XZJvgt','https://user.lovrabet.com','[ENV]\x20Unknown\x20environment:\x20','production','NODE_ENV','216696yudUgV','\x20→\x20','development','LOVRABET_USER_BASEURL','https://daily-api.lovrabet.com',',\x20using\x20default\x20production','LOVRABET_AUTH_COOKIE','log','LOVRABET_API_BASEURL','https://runtime.lovrabet.com','[ENV]\x20Environment\x20mapping:\x20','env'];a6_0x454c=function(){return _0x11103d;};return a6_0x454c();}function normalizeEnvironment(_0x37c5f4){const _0x1a3177=a6_0x555bf6;if(!_0x37c5f4)return _0x1a3177(0x160);const _0x67a572=_0x37c5f4['toLowerCase'](),_0x160225=ENVIRONMENT_MAPPING[_0x67a572];if(!_0x160225)return console['warn'](_0x1a3177(0x15f)+_0x37c5f4+_0x1a3177(0x144)),_0x1a3177(0x160);return _0x160225!==_0x67a572&&_0x160225!==_0x37c5f4&&console[_0x1a3177(0x146)](_0x1a3177(0x149)+_0x37c5f4+_0x1a3177(0x163)+_0x160225),_0x160225;}export function getEnvAppCode(){const _0x4b858f=a6_0x555bf6;return process[_0x4b858f(0x14a)][_0x4b858f(0x14d)];}export function getEnvironment(){const _0x3d7e4d=a6_0x555bf6,_0x5700fa=process['env'][_0x3d7e4d(0x153)];return normalizeEnvironment(_0x5700fa);}export function getEnvApiBaseUrl(){const _0x316698=a6_0x555bf6;return process[_0x316698(0x14a)][_0x316698(0x147)];}function a6_0x15a7(_0x474d1f,_0x20591a){_0x474d1f=_0x474d1f-0x143;const _0x454cb7=a6_0x454c();let _0x15a7c4=_0x454cb7[_0x474d1f];return _0x15a7c4;}export function getEnvRuntimeBaseUrl(){const _0x56ec71=a6_0x555bf6;return process[_0x56ec71(0x14a)][_0x56ec71(0x156)];}export function getEnvUserBaseUrl(){const _0x2866a8=a6_0x555bf6;return process['env'][_0x2866a8(0x165)];}export function getEnvAuthCookie(){const _0x2e1a4e=a6_0x555bf6;return process['env'][_0x2e1a4e(0x145)]?.[_0x2e1a4e(0x159)]();}export function isTestEnv(){const _0x45a8cf=a6_0x555bf6;return process[_0x45a8cf(0x14a)]['NODE_ENV']===_0x45a8cf(0x157);}export function isProductionEnv(){const _0x1dd2a2=a6_0x555bf6;return process['env'][_0x1dd2a2(0x161)]==='production';}export function isDevelopmentEnv(){const _0x3f0fde=a6_0x555bf6;return process[_0x3f0fde(0x14a)][_0x3f0fde(0x161)]==='development';}export function shouldLog(){const _0x47abfa=a6_0x555bf6,_0xc35568=process['env']['NODE_ENV'];return _0xc35568==='development'||_0xc35568===_0x47abfa(0x15b);}export const configDir=homedir()+a6_0x555bf6(0x150);export const cookieFile=configDir+'/cookie';mkdirSync(configDir,{'recursive':!![]});export const defaultConfig={'appCode':getEnvAppCode(),'env':getEnvironment()};export function getEnvAppCodeWithFallback(_0x1f800f){return getEnvAppCode()||_0x1f800f;}export function getApiDomain(){const _0x3f4c29=a6_0x555bf6,_0x333c93=getEnvironment(),_0x18a52c={'production':_0x3f4c29(0x152),'online':_0x3f4c29(0x152),'daily':_0x3f4c29(0x143),'development':_0x3f4c29(0x154)};return _0x18a52c[_0x333c93];}export function getUserDomain(){const _0x22de8a=a6_0x555bf6,_0x10c271=getEnvironment(),_0x36a229={'production':_0x22de8a(0x15e),'online':'https://user.lovrabet.com','daily':'https://user-daily.lovrabet.com','development':_0x22de8a(0x154)};return _0x36a229[_0x10c271];}export function getRuntimeDomain(){const _0x150f3b=a6_0x555bf6,_0x17ffb0=getEnvironment(),_0x15a610={'production':'https://runtime.lovrabet.com','online':_0x150f3b(0x148),'daily':_0x150f3b(0x14c),'development':_0x150f3b(0x154)};return _0x15a610[_0x17ffb0];}export function getEffectiveApiDomain(){return getEnvApiBaseUrl()||getApiDomain();}export function getEffectiveRuntimeDomain(){return getEnvRuntimeBaseUrl()||getRuntimeDomain();}export function getEffectiveUserDomain(){return getEnvUserBaseUrl()||getUserDomain();}export function getEnvToolboxBaseUrl(){const _0x59f25e=a6_0x555bf6;return process['env'][_0x59f25e(0x15a)];}export function getEffectiveToolboxDomain(){return getEnvToolboxBaseUrl()||getEffectiveApiDomain();}
@@ -1 +1 @@
1
- (function(_0x164116,_0x2cbb16){const _0x5527d2=a7_0x20ff,_0x17496f=_0x164116();while(!![]){try{const _0x4a3b06=-parseInt(_0x5527d2(0x18a))/0x1+parseInt(_0x5527d2(0x180))/0x2+parseInt(_0x5527d2(0x184))/0x3*(-parseInt(_0x5527d2(0x18d))/0x4)+-parseInt(_0x5527d2(0x182))/0x5+parseInt(_0x5527d2(0x189))/0x6+parseInt(_0x5527d2(0x18e))/0x7+parseInt(_0x5527d2(0x187))/0x8*(parseInt(_0x5527d2(0x181))/0x9);if(_0x4a3b06===_0x2cbb16)break;else _0x17496f['push'](_0x17496f['shift']());}catch(_0x198704){_0x17496f['push'](_0x17496f['shift']());}}}(a7_0x150b,0x1a963));function a7_0x150b(){const _0x3cf487=['9beZQLq','151200ooRPuL','MCP_DEBUG','365889bXEvNo',',\x20using\x20empty\x20config','env','537256TYrUNO','apiUrlOverrides','588636ZhXnWS','37262thbhmU','/config.json','utf-8','4FeLSrG','549087OmHBnt','109320cdRKua'];a7_0x150b=function(){return _0x3cf487;};return a7_0x150b();}import{existsSync,readFileSync}from'node:fs';import{configDir}from'./env.js';let _cache=null;function readConfigFile(){const _0x32687c=a7_0x20ff;if(_cache!==null)return _cache;const _0x555d7a=configDir+_0x32687c(0x18b);if(!existsSync(_0x555d7a))return _cache={},_cache;try{_cache=JSON['parse'](readFileSync(_0x555d7a,_0x32687c(0x18c)));}catch{process[_0x32687c(0x186)][_0x32687c(0x183)]&&console['warn']('[MCP]\x20Failed\x20to\x20parse\x20'+_0x555d7a+_0x32687c(0x185)),_cache={};}return _cache;}function a7_0x20ff(_0x4cc92c,_0x399ef2){_0x4cc92c=_0x4cc92c-0x180;const _0x150be9=a7_0x150b();let _0x20ff90=_0x150be9[_0x4cc92c];return _0x20ff90;}export function getConfigApiUrlOverrides(){const _0x1ae2ad=a7_0x20ff;return readConfigFile()[_0x1ae2ad(0x188)]??{};}export function clearConfigCache(){_cache=null;}
1
+ (function(_0x2f7f26,_0x4e6cec){const _0x2591e5=a7_0x4541,_0x35a396=_0x2f7f26();while(!![]){try{const _0x35601c=parseInt(_0x2591e5(0x1cd))/0x1*(-parseInt(_0x2591e5(0x1c7))/0x2)+parseInt(_0x2591e5(0x1d1))/0x3+parseInt(_0x2591e5(0x1ce))/0x4*(-parseInt(_0x2591e5(0x1ca))/0x5)+-parseInt(_0x2591e5(0x1cf))/0x6*(parseInt(_0x2591e5(0x1c3))/0x7)+parseInt(_0x2591e5(0x1cb))/0x8*(-parseInt(_0x2591e5(0x1d2))/0x9)+-parseInt(_0x2591e5(0x1d0))/0xa+parseInt(_0x2591e5(0x1c8))/0xb*(parseInt(_0x2591e5(0x1c9))/0xc);if(_0x35601c===_0x4e6cec)break;else _0x35a396['push'](_0x35a396['shift']());}catch(_0x1befc8){_0x35a396['push'](_0x35a396['shift']());}}}(a7_0x3f39,0x65627));import{existsSync,readFileSync}from'node:fs';import{configDir}from'./env.js';let _cache=null;function readConfigFile(){const _0x27ff53=a7_0x4541;if(_cache!==null)return _cache;const _0x3ce634=configDir+_0x27ff53(0x1d3);if(!existsSync(_0x3ce634))return _cache={},_cache;try{_cache=JSON['parse'](readFileSync(_0x3ce634,_0x27ff53(0x1cc)));}catch{process['env'][_0x27ff53(0x1c4)]&&console['warn'](_0x27ff53(0x1c6)+_0x3ce634+_0x27ff53(0x1d4)),_cache={};}return _cache;}function a7_0x3f39(){const _0x190a48=[',\x20using\x20empty\x20config','328510bHNtnZ','MCP_DEBUG','apiUrlOverrides','[MCP]\x20Failed\x20to\x20parse\x20','16DMTYve','33yEvsWr','8452956eoLusT','353135hknrxQ','5377648SouBwl','utf-8','94957GThalY','4vXRZdV','6IUHwlg','7947740EJpxfY','1938675CMXDMA','9yVtlSB','/config.json'];a7_0x3f39=function(){return _0x190a48;};return a7_0x3f39();}export function getConfigApiUrlOverrides(){const _0x1ae0c7=a7_0x4541;return readConfigFile()[_0x1ae0c7(0x1c5)]??{};}function a7_0x4541(_0x18db62,_0x1bb8f5){_0x18db62=_0x18db62-0x1c3;const _0x3f39ae=a7_0x3f39();let _0x4541e3=_0x3f39ae[_0x18db62];return _0x4541e3;}export function clearConfigCache(){_cache=null;}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a8_0x172da3=a8_0x4b6f;(function(_0x33f390,_0x410fcb){const _0x2efed6=a8_0x4b6f,_0x19c91d=_0x33f390();while(!![]){try{const _0x31973e=parseInt(_0x2efed6(0xd8))/0x1*(parseInt(_0x2efed6(0xd4))/0x2)+-parseInt(_0x2efed6(0xda))/0x3*(parseInt(_0x2efed6(0xc3))/0x4)+-parseInt(_0x2efed6(0xca))/0x5*(-parseInt(_0x2efed6(0xc2))/0x6)+parseInt(_0x2efed6(0xdb))/0x7+parseInt(_0x2efed6(0xd2))/0x8*(parseInt(_0x2efed6(0xbe))/0x9)+-parseInt(_0x2efed6(0xd1))/0xa+parseInt(_0x2efed6(0xd7))/0xb*(-parseInt(_0x2efed6(0xcb))/0xc);if(_0x31973e===_0x410fcb)break;else _0x19c91d['push'](_0x19c91d['shift']());}catch(_0xcc3b5d){_0x19c91d['push'](_0x19c91d['shift']());}}}(a8_0x49e8,0xa87b9));import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{createServer}from'./server.js';function a8_0x4b6f(_0x297e7c,_0x2bf9c7){_0x297e7c=_0x297e7c-0xbe;const _0x49e8e0=a8_0x49e8();let _0x4b6fd5=_0x49e8e0[_0x297e7c];return _0x4b6fd5;}function parseArgs(){const _0x4b1970=a8_0x4b6f,_0x36809c=process[_0x4b1970(0xcf)][_0x4b1970(0xd3)](0x2),_0x33438f=_0x36809c[_0x4b1970(0xd0)]('--enable-bff-save')||_0x36809c[_0x4b1970(0xd0)]('--dangerously-bff-save');return process['env'][_0x4b1970(0xd5)]&&_0x36809c[_0x4b1970(0xd0)](_0x4b1970(0xbf))&&!_0x36809c[_0x4b1970(0xd0)](_0x4b1970(0xc6))&&console[_0x4b1970(0xc1)](_0x4b1970(0xcc)),{'bffSaveEnabled':_0x33438f};}async function main(){const _0x2571a2=a8_0x4b6f;try{const {bffSaveEnabled:_0x44548e}=parseArgs(),_0x33160d=createServer({'bffSaveEnabled':_0x44548e}),_0x28ddce=new StdioServerTransport();_0x33160d[_0x2571a2(0xc9)](),await _0x33160d[_0x2571a2(0xc5)](_0x28ddce),process['on'](_0x2571a2(0xdc),async()=>{const _0x423ea4=_0x2571a2;process['env'][_0x423ea4(0xd5)]&&console[_0x423ea4(0xc8)](_0x423ea4(0xce)),process[_0x423ea4(0xcd)](0x0);}),process['on'](_0x2571a2(0xc7),async()=>{const _0x4c2d30=_0x2571a2;process[_0x4c2d30(0xc0)][_0x4c2d30(0xd5)]&&console[_0x4c2d30(0xc8)](_0x4c2d30(0xce)),process[_0x4c2d30(0xcd)](0x0);});}catch(_0x2d3171){console[_0x2571a2(0xd6)](_0x2571a2(0xc4),_0x2d3171),process[_0x2571a2(0xcd)](0x1);}}function a8_0x49e8(){const _0x342d69=['Shutting\x20down\x20Lovrabet\x20Dataset\x20MCP\x20Server...','argv','includes','7429160WnoQmv','23208iYOjLM','slice','156664LIbkUZ','MCP_DEBUG','error','310277bvPWxr','13sFHWkx','catch','15JXaXnH','9155734oDYkIt','SIGINT','3699HUVDrq','--dangerously-bff-save','env','warn','805506kzecUv','940928WkQRZp','Failed\x20to\x20start\x20Lovrabet\x20Dataset\x20MCP\x20Server:','connect','--enable-bff-save','SIGTERM','log','logInfo','5tcSyUT','444liVHIT','[MCP]\x20--dangerously-bff-save\x20is\x20deprecated;\x20use\x20--enable-bff-save\x20(same\x20behavior)','exit'];a8_0x49e8=function(){return _0x342d69;};return a8_0x49e8();}main()[a8_0x172da3(0xd9)](_0x133c71=>{const _0x244174=a8_0x172da3;console['error']('Unhandled\x20error:',_0x133c71),process[_0x244174(0xcd)](0x1);});
2
+ (function(_0xb7e5ea,_0x46d52e){const _0x311073=a8_0x3b9d,_0x26d4a8=_0xb7e5ea();while(!![]){try{const _0x272c4d=parseInt(_0x311073(0xc4))/0x1+parseInt(_0x311073(0xbe))/0x2*(-parseInt(_0x311073(0xcc))/0x3)+parseInt(_0x311073(0xd6))/0x4+parseInt(_0x311073(0xce))/0x5*(-parseInt(_0x311073(0xbc))/0x6)+parseInt(_0x311073(0xc1))/0x7+-parseInt(_0x311073(0xc9))/0x8+-parseInt(_0x311073(0xd3))/0x9*(-parseInt(_0x311073(0xcb))/0xa);if(_0x272c4d===_0x46d52e)break;else _0x26d4a8['push'](_0x26d4a8['shift']());}catch(_0x289e56){_0x26d4a8['push'](_0x26d4a8['shift']());}}}(a8_0x31c9,0x9eb31));function a8_0x3b9d(_0x576199,_0x16d230){_0x576199=_0x576199-0xbc;const _0x31c90f=a8_0x31c9();let _0x3b9d3a=_0x31c90f[_0x576199];return _0x3b9d3a;}import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{createServer}from'./server.js';function parseArgs(){const _0x3387f6=a8_0x3b9d,_0x3a239f=process[_0x3387f6(0xc8)][_0x3387f6(0xbd)](0x2),_0x3301c9=_0x3a239f[_0x3387f6(0xc7)](_0x3387f6(0xd5))||_0x3a239f[_0x3387f6(0xc7)]('--dangerously-bff-save');return process[_0x3387f6(0xd1)][_0x3387f6(0xcd)]&&_0x3a239f[_0x3387f6(0xc7)](_0x3387f6(0xc5))&&!_0x3a239f[_0x3387f6(0xc7)]('--enable-bff-save')&&console[_0x3387f6(0xc6)](_0x3387f6(0xc0)),{'bffSaveEnabled':_0x3301c9};}async function main(){const _0x144c99=a8_0x3b9d;try{const {bffSaveEnabled:_0x37ec7c}=parseArgs(),_0x19eada=createServer({'bffSaveEnabled':_0x37ec7c}),_0x2abdd0=new StdioServerTransport();_0x19eada[_0x144c99(0xd0)](),await _0x19eada[_0x144c99(0xd7)](_0x2abdd0),process['on'](_0x144c99(0xc3),async()=>{const _0x348332=_0x144c99;process[_0x348332(0xd1)][_0x348332(0xcd)]&&console[_0x348332(0xd2)]('Shutting\x20down\x20Lovrabet\x20Dataset\x20MCP\x20Server...'),process[_0x348332(0xcf)](0x0);}),process['on'](_0x144c99(0xca),async()=>{const _0x1b071c=_0x144c99;process[_0x1b071c(0xd1)]['MCP_DEBUG']&&console[_0x1b071c(0xd2)]('Shutting\x20down\x20Lovrabet\x20Dataset\x20MCP\x20Server...'),process[_0x1b071c(0xcf)](0x0);});}catch(_0x5d19bc){console[_0x144c99(0xd4)](_0x144c99(0xc2),_0x5d19bc),process[_0x144c99(0xcf)](0x1);}}function a8_0x31c9(){const _0x27795c=['--enable-bff-save','1289228JOeYNp','connect','915738gfWvWJ','slice','8462sogoyK','Unhandled\x20error:','[MCP]\x20--dangerously-bff-save\x20is\x20deprecated;\x20use\x20--enable-bff-save\x20(same\x20behavior)','6932842NMZwqR','Failed\x20to\x20start\x20Lovrabet\x20Dataset\x20MCP\x20Server:','SIGINT','1155256RSfCMe','--dangerously-bff-save','warn','includes','argv','8413440PNYLjS','SIGTERM','39470mlnKjO','33gzxrTT','MCP_DEBUG','40csfwFS','exit','logInfo','env','log','1143DsZIFw','error'];a8_0x31c9=function(){return _0x27795c;};return a8_0x31c9();}main()['catch'](_0x203a38=>{const _0x3bd2b5=a8_0x3b9d;console[_0x3bd2b5(0xd4)](_0x3bd2b5(0xbf),_0x203a38),process['exit'](0x1);});
package/dist/server.js CHANGED
@@ -1 +1 @@
1
- const a9_0x3471f1=a9_0x3faa;function a9_0x3faa(_0x28acab,_0x36e1ab){_0x28acab=_0x28acab-0x8a;const _0x18baf4=a9_0x18ba();let _0x3faa0a=_0x18baf4[_0x28acab];return _0x3faa0a;}(function(_0x21315a,_0x2dc446){const _0x24f40f=a9_0x3faa,_0x53af70=_0x21315a();while(!![]){try{const _0x2fc251=parseInt(_0x24f40f(0xae))/0x1+-parseInt(_0x24f40f(0xe6))/0x2+-parseInt(_0x24f40f(0xa0))/0x3*(parseInt(_0x24f40f(0xc8))/0x4)+parseInt(_0x24f40f(0xb7))/0x5+-parseInt(_0x24f40f(0xab))/0x6*(-parseInt(_0x24f40f(0xed))/0x7)+parseInt(_0x24f40f(0x8f))/0x8*(-parseInt(_0x24f40f(0xbb))/0x9)+-parseInt(_0x24f40f(0xee))/0xa*(-parseInt(_0x24f40f(0xca))/0xb);if(_0x2fc251===_0x2dc446)break;else _0x53af70['push'](_0x53af70['shift']());}catch(_0x20dcf6){_0x53af70['push'](_0x53af70['shift']());}}}(a9_0x18ba,0xd976a));import{McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';import{z}from'zod';import{createRequire}from'module';import{login,listDatasets,getDatasetDetail,getDatasetOperations,getOperationDetail,generateSDKCode,searchDatasets,listSqlQueries,saveOrUpdateCustomSql,executeCustomSql,generateSqlCode,validateSqlContent,listBffScripts,getBffScriptInfo,saveOrUpdateBffScript}from'./tools/index.js';const require=createRequire(import.meta.url),packageJson=require(a9_0x3471f1(0xef)),authSchema={'appCode':z[a9_0x3471f1(0xac)]()[a9_0x3471f1(0xf0)]()[a9_0x3471f1(0xcf)](a9_0x3471f1(0xa3)),'cookie':z[a9_0x3471f1(0xac)]()[a9_0x3471f1(0xf0)]()[a9_0x3471f1(0xcf)]('Authentication\x20cookie\x20(optional,\x20uses\x20stored\x20cookie\x20from\x20login\x20if\x20not\x20provided)')};function registerToolWithOptions(_0x42a0e9,_0x2561e7,_0x1fe935,_0x316389){_0x42a0e9['registerTool'](_0x2561e7,_0x1fe935,_0x316389);}function wrapHandler(_0x9a117e){return async _0x12c713=>{const _0x527254=a9_0x3faa;try{const _0x391521=await _0x9a117e(_0x12c713);return{'content':[{'type':_0x527254(0xa7),'text':JSON[_0x527254(0xb2)](_0x391521,null,0x2)}]};}catch(_0xc6f9b){return{'content':[{'type':_0x527254(0xa7),'text':JSON['stringify']({'error':!![],'message':_0xc6f9b[_0x527254(0xbe)]||_0x527254(0xc4)},null,0x2)}],'isError':!![]};}};}export class LovrabetDatasetMCPServer{[a9_0x3471f1(0xb5)];[a9_0x3471f1(0x97)];constructor(_0x4f312c={}){const _0x38b1f3=a9_0x3471f1;this['options']=_0x4f312c,this['mcpServer']=new McpServer({'name':'lovrabet-dataset-mcp','version':packageJson[_0x38b1f3(0xbf)]},{'capabilities':{'tools':{}},'instructions':buildInstructions(_0x4f312c)}),this['registerAllTools']();}[a9_0x3471f1(0xcb)](){const _0x35836f=a9_0x3471f1;registerToolWithOptions(this['mcpServer'],_0x35836f(0x8d),{'title':_0x35836f(0xa9),'description':_0x35836f(0xcd),'inputSchema':{'env':z['enum']([_0x35836f(0xad),_0x35836f(0x8a)])[_0x35836f(0xf0)]()[_0x35836f(0xcf)](_0x35836f(0xb3))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(login)),registerToolWithOptions(this[_0x35836f(0xb5)],_0x35836f(0xa2),{'title':_0x35836f(0x9c),'description':_0x35836f(0xf1),'inputSchema':{...authSchema,'forceRefresh':z[_0x35836f(0xd9)]()[_0x35836f(0xf0)]()[_0x35836f(0xcf)](_0x35836f(0xd4)),'includeRelations':z[_0x35836f(0xd9)]()[_0x35836f(0xf0)]()[_0x35836f(0xcf)](_0x35836f(0xba))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listDatasets)),registerToolWithOptions(this[_0x35836f(0xb5)],_0x35836f(0xec),{'title':_0x35836f(0xd7),'description':_0x35836f(0xa6),'inputSchema':{...authSchema,'keyword':z[_0x35836f(0xac)]()['describe'](_0x35836f(0xc3))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(searchDatasets)),registerToolWithOptions(this[_0x35836f(0xb5)],_0x35836f(0x8b),{'title':'Get\x20Dataset\x20Detail','description':_0x35836f(0x92),'inputSchema':{...authSchema,'datasetCode':z[_0x35836f(0xac)]()['describe'](_0x35836f(0xe7)),'forceRefresh':z[_0x35836f(0xd9)]()[_0x35836f(0xf0)]()[_0x35836f(0xcf)]('Bypass\x20cache\x20(default:\x20false)'),'includeRelations':z[_0x35836f(0xd9)]()[_0x35836f(0xf0)]()[_0x35836f(0xcf)]('Include\x20bidirectional\x20relations,\x20summary,\x20and\x20usage\x20hints\x20(default:\x20true)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetDetail)),registerToolWithOptions(this[_0x35836f(0xb5)],_0x35836f(0xc2),{'title':_0x35836f(0xc7),'description':_0x35836f(0xc0),'inputSchema':{...authSchema,'datasetCode':z[_0x35836f(0xac)]()['describe'](_0x35836f(0xe7))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetOperations)),registerToolWithOptions(this['mcpServer'],_0x35836f(0xbd),{'title':_0x35836f(0xaf),'description':'Get\x20detailed\x20operation\x20information\x20including\x20request/response\x20examples.','inputSchema':{...authSchema,'datasetCode':z['string']()[_0x35836f(0xcf)](_0x35836f(0x9f)),'operationName':z[_0x35836f(0xac)]()['describe'](_0x35836f(0x8c))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getOperationDetail)),registerToolWithOptions(this[_0x35836f(0xb5)],_0x35836f(0xb1),{'title':'Generate\x20SDK\x20Code','description':_0x35836f(0xcc),'inputSchema':{...authSchema,'datasetCode':z[_0x35836f(0xac)]()['describe'](_0x35836f(0x9f)),'operationName':z[_0x35836f(0xac)]()[_0x35836f(0xcf)](_0x35836f(0x8c)),'includeImports':z[_0x35836f(0xd9)]()['optional']()[_0x35836f(0xcf)](_0x35836f(0x98)),'useAlias':z[_0x35836f(0xd9)]()[_0x35836f(0xf0)]()[_0x35836f(0xcf)](_0x35836f(0x91))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSDKCode)),registerToolWithOptions(this[_0x35836f(0xb5)],_0x35836f(0xe4),{'title':_0x35836f(0xd3),'description':_0x35836f(0xb9),'inputSchema':{...authSchema,'keyword':z[_0x35836f(0xac)]()[_0x35836f(0xf0)]()[_0x35836f(0xcf)]('Client-side\x20filter\x20by\x20name/description/content'),'category':z[_0x35836f(0xac)]()['optional']()[_0x35836f(0xcf)]('Client-side\x20filter\x20by\x20category'),'sqlCode':z['string']()[_0x35836f(0xf0)]()[_0x35836f(0xcf)](_0x35836f(0xd2)),'sqlName':z['string']()[_0x35836f(0xf0)]()[_0x35836f(0xcf)](_0x35836f(0x94)),'pageSize':z[_0x35836f(0xa5)]()[_0x35836f(0xf0)]()['describe'](_0x35836f(0x9d)),'currentPage':z[_0x35836f(0xa5)]()[_0x35836f(0xf0)]()[_0x35836f(0xcf)](_0x35836f(0xdb))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listSqlQueries)),registerToolWithOptions(this[_0x35836f(0xb5)],'execute_custom_sql',{'title':'Execute\x20Custom\x20SQL','description':_0x35836f(0xdc),'inputSchema':{...authSchema,'sqlCode':z['string']()[_0x35836f(0xc9)](0x1)['describe'](_0x35836f(0xc5)),'params':z[_0x35836f(0xde)](z[_0x35836f(0xb0)]([z[_0x35836f(0xac)](),z[_0x35836f(0xa5)]()]))[_0x35836f(0xf0)]()[_0x35836f(0xcf)](_0x35836f(0xd8))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(executeCustomSql)),registerToolWithOptions(this[_0x35836f(0xb5)],_0x35836f(0xaa),{'title':_0x35836f(0x95),'description':'Generate\x20code\x20for\x20a\x20custom\x20SQL\x20query.\x20Validates\x20sqlCode\x20exists\x20first.\x20Use\x20target\x20to\x20switch\x20between\x20Frontend\x20SDK\x20and\x20Backend\x20Function\x20code\x20patterns.','inputSchema':{...authSchema,'sqlCode':z[_0x35836f(0xac)]()[_0x35836f(0xc9)](0x1)[_0x35836f(0xcf)]('SQL\x20code\x20from\x20list_sql_queries\x20(must\x20exist)'),'params':z[_0x35836f(0xde)](z['union']([z[_0x35836f(0xac)](),z['number']()]))[_0x35836f(0xf0)]()[_0x35836f(0xcf)](_0x35836f(0xd6)),'includeImports':z[_0x35836f(0xd9)]()[_0x35836f(0xf0)]()[_0x35836f(0xcf)](_0x35836f(0x98)),'target':z[_0x35836f(0xdd)](['sdk',_0x35836f(0xe3)])[_0x35836f(0xf0)]()[_0x35836f(0xcf)](_0x35836f(0xd0))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSqlCode)),registerToolWithOptions(this[_0x35836f(0xb5)],_0x35836f(0xdf),{'title':_0x35836f(0xc6),'description':_0x35836f(0x9b),'inputSchema':{...authSchema,'sqlContent':z[_0x35836f(0xac)]()['min'](0x1)['describe'](_0x35836f(0xe5)),'dbId':z[_0x35836f(0xa5)]()[_0x35836f(0xf0)]()[_0x35836f(0xcf)]('Database\x20ID\x20(optional)'),'validateSchemas':z[_0x35836f(0xda)](z[_0x35836f(0xac)]())[_0x35836f(0xf0)]()[_0x35836f(0xcf)](_0x35836f(0x90))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(validateSqlContent)),registerToolWithOptions(this[_0x35836f(0xb5)],_0x35836f(0x8e),{'title':_0x35836f(0x99),'description':_0x35836f(0x9a),'inputSchema':{...authSchema,'sqlName':z[_0x35836f(0xac)]()['optional']()[_0x35836f(0xcf)]('SQL\x20name/label\x20(optional;\x20MCP\x20auto-extracts\x20from\x20@lovrabet.sqlName\x20comment,\x20or\x20toolbox\x20generates\x20fallback)'),'sqlCode':z[_0x35836f(0xac)]()[_0x35836f(0xf0)]()['describe'](_0x35836f(0xa4)),'dbId':z[_0x35836f(0xa5)]()['optional']()['describe'](_0x35836f(0xe0)),'sqlContent':z[_0x35836f(0xac)]()['min'](0x1)[_0x35836f(0xcf)](_0x35836f(0xea)),'id':z[_0x35836f(0xa5)]()[_0x35836f(0xf0)]()[_0x35836f(0xcf)](_0x35836f(0xf2))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':![]}},wrapHandler(saveOrUpdateCustomSql)),this[_0x35836f(0x97)]['bffSaveEnabled']&&(registerToolWithOptions(this['mcpServer'],_0x35836f(0xa1),{'title':'List\x20Backend\x20Functions','description':'List\x20all\x20Backend\x20Function\x20(ENDPOINT\x20type)\x20scripts.','inputSchema':{...authSchema},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listBffScripts)),registerToolWithOptions(this[_0x35836f(0xb5)],_0x35836f(0xa8),{'title':_0x35836f(0x96),'description':_0x35836f(0xc1),'inputSchema':{...authSchema,'id':z[_0x35836f(0xa5)]()[_0x35836f(0xcf)](_0x35836f(0xd1))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getBffScriptInfo)),registerToolWithOptions(this['mcpServer'],'save_or_update_bff_script',{'title':'Save\x20or\x20Update\x20Backend\x20Function','description':'Save\x20or\x20update\x20a\x20Backend\x20Function\x20script\x20via\x20toolbox\x20(server-side\x20submitter\x20check\x20+\x20automatic\x20cache\x20clearing).\x20If\x20blocked=true\x20is\x20returned,\x20the\x20last\x20submitter\x20was\x20someone\x20else\x20—\x20tell\x20the\x20user\x20to\x20operate\x20manually,\x20do\x20NOT\x20retry.\x20IMPORTANT:\x20Pass\x20scriptContent\x20as\x20a\x20plain\x20string\x20parameter\x20with\x20the\x20full\x20file\x20content.\x20Do\x20NOT\x20write\x20temp\x20files,\x20do\x20NOT\x20JSON-escape\x20manually,\x20do\x20NOT\x20use\x20shell\x20commands\x20to\x20invoke\x20this\x20tool.','inputSchema':{...authSchema,'id':z['number']()[_0x35836f(0xf0)]()[_0x35836f(0xcf)]('Backend\x20Function\x20ID\x20(for\x20updating)'),'description':z[_0x35836f(0xac)]()[_0x35836f(0xc9)](0x1)[_0x35836f(0xcf)]('Function\x20description'),'scriptContent':z[_0x35836f(0xac)]()[_0x35836f(0xc9)](0x1)[_0x35836f(0xcf)](_0x35836f(0xeb))},'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':![]}},wrapHandler(saveOrUpdateBffScript)));}get[a9_0x3471f1(0xe1)](){return this['mcpServer'];}async[a9_0x3471f1(0xce)](_0x58d6db){await this['mcpServer']['connect'](_0x58d6db);}async[a9_0x3471f1(0xb8)](){const _0x4155f4=a9_0x3471f1;await this[_0x4155f4(0xb5)][_0x4155f4(0xb8)]();}['logInfo'](){const _0x320d21=a9_0x3471f1;if(!process[_0x320d21(0xd5)][_0x320d21(0xe8)])return;console['log'](_0x320d21(0x93)),console[_0x320d21(0xbc)]('Version:\x20'+packageJson[_0x320d21(0xbf)]),console['log'](_0x320d21(0xb6)),this[_0x320d21(0x97)][_0x320d21(0xe9)]&&(console['log']('Backend\x20Function\x20write\x20tools\x20enabled\x20(--enable-bff-save)'),console['log'](_0x320d21(0xe2)));}}function a9_0x18ba(){const _0x52bb88=['boolean','array','Page\x20number\x20(default:\x201)','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode.\x20Get\x20sqlCode\x20from\x20list_sql_queries\x20first.','enum','record','validate_sql_content','Database\x20ID\x20from\x20get_dataset_detail\x20—\x20required\x20when\x20creating\x20new\x20SQL,\x20optional\x20when\x20updating','server','Conflict\x20detection\x20is\x20handled\x20server-side\x20by\x20toolbox','bff','list_sql_queries','SQL\x20content\x20to\x20validate','3350258LPgXgZ','Dataset\x20ID\x20(numeric)\x20or\x20code\x20(UUID)','MCP_DEBUG','bffSaveEnabled','SQL\x20content\x20(SELECT/INSERT/UPDATE/WITH\x20auto-saved;\x20DELETE/DDL\x20blocked).\x20Supports\x20MyBatis\x20syntax.','Full\x20JavaScript/TypeScript\x20source\x20code.\x20Pass\x20the\x20complete\x20file\x20content\x20directly\x20as\x20a\x20string\x20—\x20any\x20length\x20is\x20supported.','search_datasets','5433631RvRzsF','8815960gxQqAu','../package.json','optional','Get\x20list\x20of\x20all\x20datasets\x20with\x20metadata\x20and\x20table\x20relations\x20(ER\x20Config).\x20Use\x20includeRelations:\x20false\x20for\x20faster\x20response.','SQL\x20ID\x20(kept\x20for\x20backward\x20compatibility,\x20not\x20used\x20by\x20toolbox)','daily','get_dataset_detail','Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update)','login','save_or_update_custom_sql','8hbkvwV','Dataset\x20codes\x20to\x20validate\x20against','Use\x20camelCase\x20alias\x20instead\x20of\x20dataset_[code]\x20pattern\x20(default:\x20false)','Get\x20detailed\x20dataset\x20information\x20including\x20fields,\x20operations,\x20and\x20bidirectional\x20relations\x20(outgoing\x20+\x20incoming).\x20Returns\x20_relations\x20(structured\x20graph\x20edges),\x20_relationsSummary\x20(natural\x20language\x20overview),\x20and\x20_usageHints\x20(actionable\x20advice\x20based\x20on\x20the\x20dataset\x27s\x20position\x20in\x20the\x20relation\x20graph).','Lovrabet\x20Dataset\x20MCP\x20Server','Server-side\x20fuzzy\x20match\x20by\x20sqlName','Generate\x20SQL\x20Code','Get\x20Backend\x20Function\x20Info','options','Include\x20import\x20statements\x20(default:\x20true)','Save\x20or\x20Update\x20Custom\x20SQL','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20via\x20toolbox.\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20WITH\x20are\x20auto-saved;\x20DELETE\x20and\x20DDL\x20are\x20blocked\x20for\x20safety.\x20If\x20the\x20last\x20submitter\x20was\x20someone\x20else,\x20returns\x20blocked=true\x20—\x20tell\x20the\x20user\x20to\x20operate\x20manually,\x20do\x20NOT\x20retry.\x20Supports\x20MyBatis\x20syntax.\x20Get\x20dbId\x20from\x20get_dataset_detail.','Validate\x20SQL\x20content\x20without\x20saving.\x20Detects\x20SQL\x20type\x20(SELECT/INSERT/UPDATE/DELETE/DDL)\x20and\x20validates\x20table/column\x20existence.\x20Supports\x20MyBatis\x20syntax.','List\x20Datasets','Items\x20per\x20page\x20(default:\x20999)','You\x20are\x20an\x20AI\x20assistant\x20helping\x20developers\x20work\x20with\x20the\x20Lovrabet\x20data\x20platform.\x0a\x0a##\x20Two\x20Runtime\x20Contexts:\x20Frontend\x20SDK\x20vs\x20Backend\x20Function\x20(BFF)\x0a\x0aLovrabet\x20has\x20two\x20code\x20execution\x20contexts\x20with\x20**identical\x20calling\x20methods\x20but\x20different\x20return\x20structures**:\x0a\x0a###\x20Frontend\x20TypeScript\x20SDK\x20(`@lovrabet/sdk`)\x0a-\x20Runs\x20in\x20browser/Node.js,\x20imported\x20via\x20`import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27`\x0a-\x20Model\x20operations\x20return\x20unwrapped\x20data\x20on\x20success,\x20throw\x20LovrabetError\x20on\x20error\x0a-\x20SQL\x20execution\x20returns\x20wrapper:\x20`{\x20execSuccess,\x20execResult\x20}`\x0a\x0a###\x20Backend\x20Function\x20(BFF)\x0a-\x20Runs\x20on\x20Lovrabet\x20server,\x20function\x20signature:\x20`export\x20default\x20async\x20function(params,\x20context)\x20{\x20...\x20}`\x0a-\x20Use\x20`context.client`\x20to\x20access\x20the\x20same\x20SDK\x20methods\x0a-\x20Model\x20operations\x20behave\x20the\x20same\x20as\x20SDK\x0a-\x20**SQL\x20execution\x20returns\x20direct\x20array**\x20`T[]`,\x20errors\x20throw\x20exceptions\x20(no\x20wrapper)\x0a\x0a>\x20**CRITICAL**:\x20Always\x20ask\x20or\x20determine\x20which\x20context\x20the\x20user\x20is\x20working\x20in\x20before\x20generating\x20code.\x0a\x0a##\x20SDK\x20Usage\x20Patterns\x0a\x0a###\x20Model\x20Access\x20(SDK\x20>=\x201.2.0)\x0a-\x20Default:\x20`client.models.dataset_[code].filter()`\x0a-\x20Alias:\x20`client.models.[alias].filter()`\x20(check\x20user\x27s\x20createClient/registerModels\x20config\x20for\x20actual\x20alias)\x0a-\x20For\x20SDK\x20<\x201.2.0:\x20only\x20`client.models.[key]`\x20where\x20key\x20is\x20defined\x20in\x20createClient/registerModels\x0a\x0a###\x20SDK\x20Return\x20Value\x20Behavior\x0a-\x20**On\x20Success**:\x20Returns\x20ONLY\x20the\x20\x27data\x27\x20field\x20content\x20(e.g.,\x20`{\x20id:\x20123,\x20name:\x20\x22...\x22\x20}`)\x0a-\x20**On\x20Error**:\x20Throws\x20LovrabetError\x20with\x20`{\x20message,\x20status,\x20code,\x20data\x20}`\x0a-\x20**Always\x20use\x20try-catch**\x20when\x20calling\x20SDK\x20methods\x0a\x0a###\x20Data\x20Query\x20Best\x20Practices\x0a-\x20**filter**:\x20Most\x20flexible,\x20supports\x20complex\x20WHERE\x20conditions,\x20pagination,\x20sorting\x20—\x20use\x20this\x20for\x20queries\x0a-\x20**getOne**:\x20Single\x20record\x20by\x20primary\x20key\x20ID\x20only\x0a-\x20**getList**:\x20Simple\x20unfiltered\x20listing\x20(rarely\x20needed)\x0a\x0a##\x20Custom\x20SQL\x20Execution\x0a\x0a###\x20Frontend\x20SDK\x0a```typescript\x0aconst\x20data\x20=\x20await\x20client.sql.execute({\x20sqlCode:\x20\x27xxx\x27,\x20params:\x20{\x20key:\x20\x27value\x27\x20}\x20});\x0aif\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0a```\x0a\x0a###\x20Backend\x20Function\x20(BFF)\x0a```javascript\x0a//\x20context.client.sql.execute\x20returns\x20rows\x20directly\x20—\x20NO\x20wrapper\x20object\x0aconst\x20rows\x20=\x20await\x20context.client.sql.execute({\x20sqlCode:\x20\x27xxx\x27,\x20params:\x20{\x20key:\x20\x27value\x27\x20}\x20});\x0a//\x20rows\x20is\x20T[]\x20directly,\x20errors\x20throw\x20exceptions\x0a```\x0a\x0a>\x20Note:\x20`client.api.executeSql()`\x20is\x20deprecated.\x20Use\x20`client.sql.execute()`.\x0a\x0a##\x20MyBatis\x20Dynamic\x20SQL\x0aSQL\x20content\x20supports\x20MyBatis\x20syntax:\x20`#{param}`,\x20`<if\x20test=\x22\x22>`,\x20`<where>`,\x20`<foreach>`.\x0aUse\x20`&lt;\x20&gt;\x20&amp;`\x20for\x20<\x20>\x20&\x20in\x20SQL\x20content\x20(not\x20in\x20`<if\x20test=\x22\x22>`\x20attributes).\x0a\x0a##\x20Workflow\x20Tips\x0a-\x20Use\x20list_datasets\x20to\x20discover\x20available\x20datasets\x0a-\x20Use\x20get_dataset_detail\x20to\x20see\x20fields,\x20operations,\x20and\x20database\x20info\x20(dbId)\x0a-\x20Use\x20generate_sdk_code\x20to\x20get\x20ready-to-use\x20TypeScript\x20code\x0a-\x20Use\x20list_sql_queries\x20to\x20find\x20existing\x20custom\x20SQLs\x20before\x20creating\x20new\x20ones\x0a-\x20validate_sql_content\x20before\x20save_or_update_custom_sql\x0a-\x20save_or_update_custom_sql\x20routes\x20through\x20toolbox;\x20DELETE/DDL\x20are\x20blocked;\x20if\x20blocked=true\x20(last\x20submitter\x20conflict)\x20tell\x20the\x20user\x20to\x20operate\x20manually\x20—\x20do\x20NOT\x20retry\x0a-\x20generate_sql_code\x20supports\x20target=\x27sdk\x27\x20(default)\x20or\x20target=\x27bff\x27\x20for\x20context-appropriate\x20code','Dataset\x20code/ID','1179744MKRgeD','list_bff_scripts','list_datasets','Application\x20code\x20(optional\x20if\x20LOVRABET_APP_CODE\x20env\x20var\x20is\x20set)','Known\x20sqlCode\x20—\x20use\x20to\x20directly\x20target\x20the\x20record\x20for\x20update,\x20skipping\x20name\x20lookup','number','Search\x20datasets\x20by\x20keyword\x20(searches\x20in\x20name,\x20table\x20name,\x20code,\x20and\x20description).','text','get_bff_script_info','Login','generate_sql_code','12rlSktq','string','online','1018183ZAdeVQ','Get\x20Operation\x20Detail','union','generate_sdk_code','stringify','Environment\x20(optional,\x20uses\x20LOVRABET_ENV\x20or\x20defaults\x20to\x20online)','\x0a-\x20Use\x20list_bff_scripts\x20/\x20get_bff_script_info\x20to\x20browse\x20and\x20read\x20Backend\x20Function\x20scripts\x0a-\x20save_or_update_bff_script\x20saves\x20script\x20via\x20toolbox\x20(server-side\x20submitter\x20check\x20+\x20automatic\x20cache\x20clearing)\x0a-\x20If\x20save\x20returns\x20blocked:\x20true,\x20tell\x20the\x20user\x20to\x20operate\x20manually\x20on\x20the\x20platform,\x20do\x20NOT\x20retry','mcpServer','Server\x20started\x20successfully','4720715VcIafR','close','List\x20all\x20available\x20custom\x20SQL\x20queries\x20with\x20metadata\x20and\x20parameters.','Include\x20table\x20relations\x20(default:\x20true)','10252197BAHhsD','log','get_operation_detail','message','version','Get\x20list\x20of\x20all\x20API\x20operations\x20for\x20a\x20dataset.\x20Prefer\x20\x22filter\x22\x20for\x20queries,\x20\x22getOne\x22\x20for\x20single\x20record\x20by\x20ID.','Get\x20detailed\x20Backend\x20Function\x20script\x20including\x20full\x20source\x20code.','get_dataset_operations','Search\x20keyword','Unknown\x20error\x20occurred','SQL\x20code\x20from\x20list_sql_queries\x20->\x20sqlCode','Validate\x20SQL\x20Content','Get\x20Operations','16GUqhCB','min','22ZmdagM','registerAllTools','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation,\x20including\x20field\x20metadata.\x20Check\x20user\x27s\x20@lovrabet/sdk\x20version\x20in\x20package.json\x20first.','Login\x20to\x20Lovrabet\x20to\x20authenticate\x20for\x20dataset\x20queries.','connect','describe','Target\x20context:\x20\x22sdk\x22\x20(Frontend\x20SDK,\x20default)\x20or\x20\x22bff\x22\x20(Backend\x20Function).\x20SDK\x20returns\x20{execSuccess,\x20execResult}\x20wrapper;\x20BFF\x20returns\x20rows\x20directly.','Backend\x20Function\x20ID\x20(from\x20list_bff_scripts)','Server-side\x20fuzzy\x20match\x20by\x20sqlCode','List\x20SQL\x20Queries','Bypass\x20cache\x20(default:\x20false)','env','Example\x20parameter\x20values','Search\x20Datasets','SQL\x20parameters'];a9_0x18ba=function(){return _0x52bb88;};return a9_0x18ba();}function buildInstructions(_0x3d8dea){const _0x4503a2=a9_0x3471f1,_0x2a0c86=_0x3d8dea['bffSaveEnabled']===!![],_0x46cceb=_0x2a0c86?_0x4503a2(0xb4):'';return _0x4503a2(0x9e)+_0x46cceb+'\x0a';}export function createServer(_0x36078e){return new LovrabetDatasetMCPServer(_0x36078e);}
1
+ function a9_0x5074(){const _0x36546b=['../package.json','Search\x20keyword','Environment\x20(optional,\x20uses\x20LOVRABET_ENV\x20or\x20defaults\x20to\x20online)','List\x20SQL\x20Queries','Server-side\x20fuzzy\x20match\x20by\x20sqlCode','union','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode.\x20Get\x20sqlCode\x20from\x20list_sql_queries\x20first.','24755bUlvmE','List\x20all\x20Backend\x20Function\x20(ENDPOINT\x20type)\x20scripts.','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation,\x20including\x20field\x20metadata.\x20Check\x20user\x27s\x20@lovrabet/sdk\x20version\x20in\x20package.json\x20first.','close','Authentication\x20cookie\x20(optional,\x20uses\x20stored\x20cookie\x20from\x20login\x20if\x20not\x20provided)','Include\x20table\x20relations\x20(default:\x20true)','get_bff_script_info','bffSaveEnabled','Known\x20sqlCode\x20—\x20use\x20to\x20directly\x20target\x20the\x20record\x20for\x20update,\x20skipping\x20name\x20lookup','save_or_update_bff_script','Version:\x20','save_or_update_custom_sql','sdk','Generate\x20SQL\x20Code','Unknown\x20error\x20occurred','10kTCvHG','daily','Generate\x20code\x20for\x20a\x20custom\x20SQL\x20query.\x20Validates\x20sqlCode\x20exists\x20first.\x20Use\x20target\x20to\x20switch\x20between\x20Frontend\x20SDK\x20and\x20Backend\x20Function\x20code\x20patterns.','Conflict\x20detection\x20is\x20handled\x20server-side\x20by\x20toolbox','version','enum','48576693UsDRAj','Server-side\x20fuzzy\x20match\x20by\x20sqlName','Login','message','Full\x20JavaScript/TypeScript\x20source\x20code.\x20Pass\x20the\x20complete\x20file\x20content\x20directly\x20as\x20a\x20string\x20—\x20any\x20length\x20is\x20supported.','Get\x20list\x20of\x20all\x20API\x20operations\x20for\x20a\x20dataset.\x20Prefer\x20\x22filter\x22\x20for\x20queries,\x20\x22getOne\x22\x20for\x20single\x20record\x20by\x20ID.','connect','Dataset\x20code/ID','get_operation_detail','Database\x20ID\x20(optional)','list_bff_scripts','lovrabet-dataset-mcp','\x0a-\x20Use\x20list_bff_scripts\x20/\x20get_bff_script_info\x20to\x20browse\x20and\x20read\x20Backend\x20Function\x20scripts\x0a-\x20save_or_update_bff_script\x20saves\x20script\x20via\x20toolbox\x20(server-side\x20submitter\x20check\x20+\x20automatic\x20cache\x20clearing)\x0a-\x20If\x20save\x20returns\x20blocked:\x20true,\x20tell\x20the\x20user\x20to\x20operate\x20manually\x20on\x20the\x20platform,\x20do\x20NOT\x20retry','record','Search\x20datasets\x20by\x20keyword\x20(searches\x20in\x20name,\x20table\x20name,\x20code,\x20and\x20description).','SQL\x20content\x20to\x20validate','Save\x20or\x20update\x20a\x20Backend\x20Function\x20script\x20via\x20toolbox\x20(server-side\x20submitter\x20check\x20+\x20automatic\x20cache\x20clearing).\x20If\x20blocked=true\x20is\x20returned,\x20the\x20last\x20submitter\x20was\x20someone\x20else\x20—\x20tell\x20the\x20user\x20to\x20operate\x20manually,\x20do\x20NOT\x20retry.\x20IMPORTANT:\x20Pass\x20scriptContent\x20as\x20a\x20plain\x20string\x20parameter\x20with\x20the\x20full\x20file\x20content.\x20Do\x20NOT\x20write\x20temp\x20files,\x20do\x20NOT\x20JSON-escape\x20manually,\x20do\x20NOT\x20use\x20shell\x20commands\x20to\x20invoke\x20this\x20tool.','SQL\x20code\x20from\x20list_sql_queries\x20(must\x20exist)','Lovrabet\x20Dataset\x20MCP\x20Server','server','List\x20Datasets','min','registerTool','List\x20all\x20available\x20custom\x20SQL\x20queries\x20with\x20metadata\x20and\x20parameters.','text','Server\x20started\x20successfully','Function\x20description','Get\x20detailed\x20Backend\x20Function\x20script\x20including\x20full\x20source\x20code.','Save\x20or\x20Update\x20Backend\x20Function','log','Backend\x20Function\x20ID\x20(for\x20updating)','Get\x20Operations','string','You\x20are\x20an\x20AI\x20assistant\x20helping\x20developers\x20work\x20with\x20the\x20Lovrabet\x20data\x20platform.\x0a\x0a##\x20Two\x20Runtime\x20Contexts:\x20Frontend\x20SDK\x20vs\x20Backend\x20Function\x20(BFF)\x0a\x0aLovrabet\x20has\x20two\x20code\x20execution\x20contexts\x20with\x20**identical\x20calling\x20methods\x20but\x20different\x20return\x20structures**:\x0a\x0a###\x20Frontend\x20TypeScript\x20SDK\x20(`@lovrabet/sdk`)\x0a-\x20Runs\x20in\x20browser/Node.js,\x20imported\x20via\x20`import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27`\x0a-\x20Model\x20operations\x20return\x20unwrapped\x20data\x20on\x20success,\x20throw\x20LovrabetError\x20on\x20error\x0a-\x20SQL\x20execution\x20returns\x20wrapper:\x20`{\x20execSuccess,\x20execResult\x20}`\x0a\x0a###\x20Backend\x20Function\x20(BFF)\x0a-\x20Runs\x20on\x20Lovrabet\x20server,\x20function\x20signature:\x20`export\x20default\x20async\x20function(params,\x20context)\x20{\x20...\x20}`\x0a-\x20Use\x20`context.client`\x20to\x20access\x20the\x20same\x20SDK\x20methods\x0a-\x20Model\x20operations\x20behave\x20the\x20same\x20as\x20SDK\x0a-\x20**SQL\x20execution\x20returns\x20direct\x20array**\x20`T[]`,\x20errors\x20throw\x20exceptions\x20(no\x20wrapper)\x0a\x0a>\x20**CRITICAL**:\x20Always\x20ask\x20or\x20determine\x20which\x20context\x20the\x20user\x20is\x20working\x20in\x20before\x20generating\x20code.\x0a\x0a##\x20SDK\x20Usage\x20Patterns\x0a\x0a###\x20Model\x20Access\x20(SDK\x20>=\x201.2.0)\x0a-\x20Default:\x20`client.models.dataset_[code].filter()`\x0a-\x20Alias:\x20`client.models.[alias].filter()`\x20(check\x20user\x27s\x20createClient/registerModels\x20config\x20for\x20actual\x20alias)\x0a-\x20For\x20SDK\x20<\x201.2.0:\x20only\x20`client.models.[key]`\x20where\x20key\x20is\x20defined\x20in\x20createClient/registerModels\x0a\x0a###\x20SDK\x20Return\x20Value\x20Behavior\x0a-\x20**On\x20Success**:\x20Returns\x20ONLY\x20the\x20\x27data\x27\x20field\x20content\x20(e.g.,\x20`{\x20id:\x20123,\x20name:\x20\x22...\x22\x20}`)\x0a-\x20**On\x20Error**:\x20Throws\x20LovrabetError\x20with\x20`{\x20message,\x20status,\x20code,\x20data\x20}`\x0a-\x20**Always\x20use\x20try-catch**\x20when\x20calling\x20SDK\x20methods\x0a\x0a###\x20Data\x20Query\x20Best\x20Practices\x0a-\x20**filter**:\x20Most\x20flexible,\x20supports\x20complex\x20WHERE\x20conditions,\x20pagination,\x20sorting\x20—\x20use\x20this\x20for\x20queries\x0a-\x20**getOne**:\x20Single\x20record\x20by\x20primary\x20key\x20ID\x20only\x0a-\x20**getList**:\x20Simple\x20unfiltered\x20listing\x20(rarely\x20needed)\x0a\x0a##\x20Custom\x20SQL\x20Execution\x0a\x0a###\x20Frontend\x20SDK\x0a```typescript\x0aconst\x20data\x20=\x20await\x20client.sql.execute({\x20sqlCode:\x20\x27xxx\x27,\x20params:\x20{\x20key:\x20\x27value\x27\x20}\x20});\x0aif\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0a```\x0a\x0a###\x20Backend\x20Function\x20(BFF)\x0a```javascript\x0a//\x20context.client.sql.execute\x20returns\x20rows\x20directly\x20—\x20NO\x20wrapper\x20object\x0aconst\x20rows\x20=\x20await\x20context.client.sql.execute({\x20sqlCode:\x20\x27xxx\x27,\x20params:\x20{\x20key:\x20\x27value\x27\x20}\x20});\x0a//\x20rows\x20is\x20T[]\x20directly,\x20errors\x20throw\x20exceptions\x0a```\x0a\x0a>\x20Note:\x20`client.api.executeSql()`\x20is\x20deprecated.\x20Use\x20`client.sql.execute()`.\x0a\x0a##\x20MyBatis\x20Dynamic\x20SQL\x0aSQL\x20content\x20supports\x20MyBatis\x20syntax:\x20`#{param}`,\x20`<if\x20test=\x22\x22>`,\x20`<where>`,\x20`<foreach>`.\x0aUse\x20`&lt;\x20&gt;\x20&amp;`\x20for\x20<\x20>\x20&\x20in\x20SQL\x20content\x20(not\x20in\x20`<if\x20test=\x22\x22>`\x20attributes).\x0a\x0a##\x20Workflow\x20Tips\x0a-\x20Use\x20list_datasets\x20to\x20discover\x20available\x20datasets\x0a-\x20Use\x20get_dataset_detail\x20to\x20see\x20fields,\x20operations,\x20and\x20database\x20info\x20(dbId)\x0a-\x20Use\x20generate_sdk_code\x20to\x20get\x20ready-to-use\x20TypeScript\x20code\x0a-\x20Use\x20list_sql_queries\x20to\x20find\x20existing\x20custom\x20SQLs\x20before\x20creating\x20new\x20ones\x0a-\x20validate_sql_content\x20before\x20save_or_update_custom_sql\x0a-\x20save_or_update_custom_sql\x20routes\x20through\x20toolbox;\x20DELETE/DDL\x20are\x20blocked;\x20if\x20blocked=true\x20(last\x20submitter\x20conflict)\x20tell\x20the\x20user\x20to\x20operate\x20manually\x20—\x20do\x20NOT\x20retry\x0a-\x20generate_sql_code\x20supports\x20target=\x27sdk\x27\x20(default)\x20or\x20target=\x27bff\x27\x20for\x20context-appropriate\x20code','Get\x20Dataset\x20Detail','options','9229656PCMpXi','get_dataset_operations','Client-side\x20filter\x20by\x20name/description/content','boolean','SQL\x20code\x20from\x20list_sql_queries\x20->\x20sqlCode','online','1128uiEvtN','Include\x20import\x20statements\x20(default:\x20true)','Get\x20Backend\x20Function\x20Info','optional','describe','SQL\x20content\x20(SELECT/INSERT/UPDATE/WITH\x20auto-saved;\x20DELETE/DDL\x20blocked).\x20Supports\x20MyBatis\x20syntax.','Validate\x20SQL\x20content\x20without\x20saving.\x20Detects\x20SQL\x20type\x20(SELECT/INSERT/UPDATE/DELETE/DDL)\x20and\x20validates\x20table/column\x20existence.\x20Supports\x20MyBatis\x20syntax.','validate_sql_content','list_datasets','MCP_DEBUG','array','617mUMZcJ','stringify','bff','execute_custom_sql','1402sDoRZq','Get\x20list\x20of\x20all\x20datasets\x20with\x20metadata\x20and\x20table\x20relations\x20(ER\x20Config).\x20Use\x20includeRelations:\x20false\x20for\x20faster\x20response.','mcpServer','Login\x20to\x20Lovrabet\x20to\x20authenticate\x20for\x20dataset\x20queries.','1678596xvuCNQ','generate_sql_code','registerAllTools','search_datasets','4349241HaIdiW','Get\x20detailed\x20dataset\x20information\x20including\x20fields,\x20operations,\x20and\x20bidirectional\x20relations\x20(outgoing\x20+\x20incoming).\x20Returns\x20_relations\x20(structured\x20graph\x20edges),\x20_relationsSummary\x20(natural\x20language\x20overview),\x20and\x20_usageHints\x20(actionable\x20advice\x20based\x20on\x20the\x20dataset\x27s\x20position\x20in\x20the\x20relation\x20graph).','generate_sdk_code','Database\x20ID\x20from\x20get_dataset_detail\x20—\x20required\x20when\x20creating\x20new\x20SQL,\x20optional\x20when\x20updating','Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update)','Execute\x20Custom\x20SQL','98770hWOGGX','186aZensD','number','Get\x20detailed\x20operation\x20information\x20including\x20request/response\x20examples.','Bypass\x20cache\x20(default:\x20false)','Target\x20context:\x20\x22sdk\x22\x20(Frontend\x20SDK,\x20default)\x20or\x20\x22bff\x22\x20(Backend\x20Function).\x20SDK\x20returns\x20{execSuccess,\x20execResult}\x20wrapper;\x20BFF\x20returns\x20rows\x20directly.','Example\x20parameter\x20values','login'];a9_0x5074=function(){return _0x36546b;};return a9_0x5074();}const a9_0x5dcf25=a9_0x49ac;(function(_0x430421,_0x3b30d1){const _0x1919d9=a9_0x49ac,_0x23e977=_0x430421();while(!![]){try{const _0x223658=-parseInt(_0x1919d9(0xc8))/0x1*(-parseInt(_0x1919d9(0xcc))/0x2)+-parseInt(_0x1919d9(0xd0))/0x3+parseInt(_0x1919d9(0xbd))/0x4*(-parseInt(_0x1919d9(0x7e))/0x5)+parseInt(_0x1919d9(0xdb))/0x6*(-parseInt(_0x1919d9(0xda))/0x7)+-parseInt(_0x1919d9(0xb7))/0x8+-parseInt(_0x1919d9(0xd4))/0x9*(parseInt(_0x1919d9(0x8d))/0xa)+parseInt(_0x1919d9(0x93))/0xb;if(_0x223658===_0x3b30d1)break;else _0x23e977['push'](_0x23e977['shift']());}catch(_0x3d7c5a){_0x23e977['push'](_0x23e977['shift']());}}}(a9_0x5074,0xc7d44));import{McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';import{z}from'zod';import{createRequire}from'module';function a9_0x49ac(_0xbeef55,_0x348e5d){_0xbeef55=_0xbeef55-0x7d;const _0x5074e8=a9_0x5074();let _0x49ac49=_0x5074e8[_0xbeef55];return _0x49ac49;}import{login,listDatasets,getDatasetDetail,getDatasetOperations,getOperationDetail,generateSDKCode,searchDatasets,listSqlQueries,saveOrUpdateCustomSql,executeCustomSql,generateSqlCode,validateSqlContent,listBffScripts,getBffScriptInfo,saveOrUpdateBffScript}from'./tools/index.js';const require=createRequire(import.meta.url),packageJson=require(a9_0x5dcf25(0xe2)),authSchema={'appCode':z[a9_0x5dcf25(0xb3)]()[a9_0x5dcf25(0xc0)]()[a9_0x5dcf25(0xc1)]('Application\x20code\x20(optional\x20if\x20LOVRABET_APP_CODE\x20env\x20var\x20is\x20set)'),'cookie':z[a9_0x5dcf25(0xb3)]()['optional']()[a9_0x5dcf25(0xc1)](a9_0x5dcf25(0x82))};function registerToolWithOptions(_0x1915e6,_0x273da0,_0x40b4a4,_0x3d1a8d){const _0x38eb95=a9_0x5dcf25;_0x1915e6[_0x38eb95(0xa9)](_0x273da0,_0x40b4a4,_0x3d1a8d);}function wrapHandler(_0x564661){return async _0x1d0781=>{const _0x1ac81b=a9_0x49ac;try{const _0x37a9bf=await _0x564661(_0x1d0781);return{'content':[{'type':_0x1ac81b(0xab),'text':JSON[_0x1ac81b(0xc9)](_0x37a9bf,null,0x2)}]};}catch(_0x4afe94){return{'content':[{'type':_0x1ac81b(0xab),'text':JSON[_0x1ac81b(0xc9)]({'error':!![],'message':_0x4afe94[_0x1ac81b(0x96)]||_0x1ac81b(0x8c)},null,0x2)}],'isError':!![]};}};}export class LovrabetDatasetMCPServer{['mcpServer'];[a9_0x5dcf25(0xb6)];constructor(_0xdbb69d={}){const _0x290662=a9_0x5dcf25;this[_0x290662(0xb6)]=_0xdbb69d,this[_0x290662(0xce)]=new McpServer({'name':_0x290662(0x9e),'version':packageJson[_0x290662(0x91)]},{'capabilities':{'tools':{}},'instructions':buildInstructions(_0xdbb69d)}),this[_0x290662(0xd2)]();}[a9_0x5dcf25(0xd2)](){const _0x3a4ba0=a9_0x5dcf25;registerToolWithOptions(this[_0x3a4ba0(0xce)],_0x3a4ba0(0xe1),{'title':_0x3a4ba0(0x95),'description':_0x3a4ba0(0xcf),'inputSchema':{'env':z[_0x3a4ba0(0x92)]([_0x3a4ba0(0xbc),_0x3a4ba0(0x8e)])['optional']()[_0x3a4ba0(0xc1)](_0x3a4ba0(0xe4))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(login)),registerToolWithOptions(this[_0x3a4ba0(0xce)],_0x3a4ba0(0xc5),{'title':_0x3a4ba0(0xa7),'description':_0x3a4ba0(0xcd),'inputSchema':{...authSchema,'forceRefresh':z[_0x3a4ba0(0xba)]()['optional']()['describe'](_0x3a4ba0(0xde)),'includeRelations':z[_0x3a4ba0(0xba)]()[_0x3a4ba0(0xc0)]()[_0x3a4ba0(0xc1)](_0x3a4ba0(0x83))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listDatasets)),registerToolWithOptions(this[_0x3a4ba0(0xce)],_0x3a4ba0(0xd3),{'title':'Search\x20Datasets','description':_0x3a4ba0(0xa1),'inputSchema':{...authSchema,'keyword':z[_0x3a4ba0(0xb3)]()[_0x3a4ba0(0xc1)](_0x3a4ba0(0xe3))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(searchDatasets)),registerToolWithOptions(this[_0x3a4ba0(0xce)],'get_dataset_detail',{'title':_0x3a4ba0(0xb5),'description':_0x3a4ba0(0xd5),'inputSchema':{...authSchema,'datasetCode':z[_0x3a4ba0(0xb3)]()[_0x3a4ba0(0xc1)]('Dataset\x20ID\x20(numeric)\x20or\x20code\x20(UUID)'),'forceRefresh':z['boolean']()[_0x3a4ba0(0xc0)]()[_0x3a4ba0(0xc1)](_0x3a4ba0(0xde)),'includeRelations':z['boolean']()['optional']()[_0x3a4ba0(0xc1)]('Include\x20bidirectional\x20relations,\x20summary,\x20and\x20usage\x20hints\x20(default:\x20true)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetDetail)),registerToolWithOptions(this[_0x3a4ba0(0xce)],_0x3a4ba0(0xb8),{'title':_0x3a4ba0(0xb2),'description':_0x3a4ba0(0x98),'inputSchema':{...authSchema,'datasetCode':z[_0x3a4ba0(0xb3)]()[_0x3a4ba0(0xc1)]('Dataset\x20ID\x20(numeric)\x20or\x20code\x20(UUID)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetOperations)),registerToolWithOptions(this[_0x3a4ba0(0xce)],_0x3a4ba0(0x9b),{'title':'Get\x20Operation\x20Detail','description':_0x3a4ba0(0xdd),'inputSchema':{...authSchema,'datasetCode':z['string']()[_0x3a4ba0(0xc1)](_0x3a4ba0(0x9a)),'operationName':z[_0x3a4ba0(0xb3)]()[_0x3a4ba0(0xc1)](_0x3a4ba0(0xd8))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getOperationDetail)),registerToolWithOptions(this[_0x3a4ba0(0xce)],_0x3a4ba0(0xd6),{'title':'Generate\x20SDK\x20Code','description':_0x3a4ba0(0x80),'inputSchema':{...authSchema,'datasetCode':z[_0x3a4ba0(0xb3)]()[_0x3a4ba0(0xc1)](_0x3a4ba0(0x9a)),'operationName':z['string']()[_0x3a4ba0(0xc1)]('Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update)'),'includeImports':z[_0x3a4ba0(0xba)]()['optional']()[_0x3a4ba0(0xc1)](_0x3a4ba0(0xbe)),'useAlias':z['boolean']()[_0x3a4ba0(0xc0)]()[_0x3a4ba0(0xc1)]('Use\x20camelCase\x20alias\x20instead\x20of\x20dataset_[code]\x20pattern\x20(default:\x20false)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSDKCode)),registerToolWithOptions(this['mcpServer'],'list_sql_queries',{'title':_0x3a4ba0(0xe5),'description':_0x3a4ba0(0xaa),'inputSchema':{...authSchema,'keyword':z[_0x3a4ba0(0xb3)]()[_0x3a4ba0(0xc0)]()[_0x3a4ba0(0xc1)](_0x3a4ba0(0xb9)),'category':z[_0x3a4ba0(0xb3)]()[_0x3a4ba0(0xc0)]()[_0x3a4ba0(0xc1)]('Client-side\x20filter\x20by\x20category'),'sqlCode':z[_0x3a4ba0(0xb3)]()['optional']()[_0x3a4ba0(0xc1)](_0x3a4ba0(0xe6)),'sqlName':z[_0x3a4ba0(0xb3)]()['optional']()['describe'](_0x3a4ba0(0x94)),'pageSize':z[_0x3a4ba0(0xdc)]()[_0x3a4ba0(0xc0)]()[_0x3a4ba0(0xc1)]('Items\x20per\x20page\x20(default:\x20999)'),'currentPage':z[_0x3a4ba0(0xdc)]()['optional']()['describe']('Page\x20number\x20(default:\x201)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listSqlQueries)),registerToolWithOptions(this[_0x3a4ba0(0xce)],_0x3a4ba0(0xcb),{'title':_0x3a4ba0(0xd9),'description':_0x3a4ba0(0x7d),'inputSchema':{...authSchema,'sqlCode':z['string']()[_0x3a4ba0(0xa8)](0x1)['describe'](_0x3a4ba0(0xbb)),'params':z[_0x3a4ba0(0xa0)](z['union']([z['string'](),z[_0x3a4ba0(0xdc)]()]))[_0x3a4ba0(0xc0)]()['describe']('SQL\x20parameters')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(executeCustomSql)),registerToolWithOptions(this[_0x3a4ba0(0xce)],_0x3a4ba0(0xd1),{'title':_0x3a4ba0(0x8b),'description':_0x3a4ba0(0x8f),'inputSchema':{...authSchema,'sqlCode':z[_0x3a4ba0(0xb3)]()['min'](0x1)[_0x3a4ba0(0xc1)](_0x3a4ba0(0xa4)),'params':z[_0x3a4ba0(0xa0)](z[_0x3a4ba0(0xe7)]([z['string'](),z[_0x3a4ba0(0xdc)]()]))[_0x3a4ba0(0xc0)]()[_0x3a4ba0(0xc1)](_0x3a4ba0(0xe0)),'includeImports':z['boolean']()[_0x3a4ba0(0xc0)]()[_0x3a4ba0(0xc1)]('Include\x20import\x20statements\x20(default:\x20true)'),'target':z[_0x3a4ba0(0x92)]([_0x3a4ba0(0x8a),_0x3a4ba0(0xca)])['optional']()[_0x3a4ba0(0xc1)](_0x3a4ba0(0xdf))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSqlCode)),registerToolWithOptions(this[_0x3a4ba0(0xce)],_0x3a4ba0(0xc4),{'title':'Validate\x20SQL\x20Content','description':_0x3a4ba0(0xc3),'inputSchema':{...authSchema,'sqlContent':z['string']()[_0x3a4ba0(0xa8)](0x1)[_0x3a4ba0(0xc1)](_0x3a4ba0(0xa2)),'dbId':z[_0x3a4ba0(0xdc)]()['optional']()[_0x3a4ba0(0xc1)](_0x3a4ba0(0x9c)),'validateSchemas':z[_0x3a4ba0(0xc7)](z[_0x3a4ba0(0xb3)]())[_0x3a4ba0(0xc0)]()['describe']('Dataset\x20codes\x20to\x20validate\x20against')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(validateSqlContent)),registerToolWithOptions(this[_0x3a4ba0(0xce)],_0x3a4ba0(0x89),{'title':'Save\x20or\x20Update\x20Custom\x20SQL','description':'Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20via\x20toolbox.\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20WITH\x20are\x20auto-saved;\x20DELETE\x20and\x20DDL\x20are\x20blocked\x20for\x20safety.\x20If\x20the\x20last\x20submitter\x20was\x20someone\x20else,\x20returns\x20blocked=true\x20—\x20tell\x20the\x20user\x20to\x20operate\x20manually,\x20do\x20NOT\x20retry.\x20Supports\x20MyBatis\x20syntax.\x20Get\x20dbId\x20from\x20get_dataset_detail.','inputSchema':{...authSchema,'sqlName':z[_0x3a4ba0(0xb3)]()[_0x3a4ba0(0xc0)]()[_0x3a4ba0(0xc1)]('SQL\x20name/label\x20(optional;\x20MCP\x20auto-extracts\x20from\x20@lovrabet.sqlName\x20comment,\x20or\x20toolbox\x20generates\x20fallback)'),'sqlCode':z[_0x3a4ba0(0xb3)]()[_0x3a4ba0(0xc0)]()[_0x3a4ba0(0xc1)](_0x3a4ba0(0x86)),'dbId':z[_0x3a4ba0(0xdc)]()[_0x3a4ba0(0xc0)]()[_0x3a4ba0(0xc1)](_0x3a4ba0(0xd7)),'sqlContent':z[_0x3a4ba0(0xb3)]()[_0x3a4ba0(0xa8)](0x1)['describe'](_0x3a4ba0(0xc2)),'id':z[_0x3a4ba0(0xdc)]()[_0x3a4ba0(0xc0)]()[_0x3a4ba0(0xc1)]('SQL\x20ID\x20(kept\x20for\x20backward\x20compatibility,\x20not\x20used\x20by\x20toolbox)')},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':![]}},wrapHandler(saveOrUpdateCustomSql)),this[_0x3a4ba0(0xb6)]['bffSaveEnabled']&&(registerToolWithOptions(this['mcpServer'],_0x3a4ba0(0x9d),{'title':'List\x20Backend\x20Functions','description':_0x3a4ba0(0x7f),'inputSchema':{...authSchema},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listBffScripts)),registerToolWithOptions(this[_0x3a4ba0(0xce)],_0x3a4ba0(0x84),{'title':_0x3a4ba0(0xbf),'description':_0x3a4ba0(0xae),'inputSchema':{...authSchema,'id':z[_0x3a4ba0(0xdc)]()[_0x3a4ba0(0xc1)]('Backend\x20Function\x20ID\x20(from\x20list_bff_scripts)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getBffScriptInfo)),registerToolWithOptions(this['mcpServer'],_0x3a4ba0(0x87),{'title':_0x3a4ba0(0xaf),'description':_0x3a4ba0(0xa3),'inputSchema':{...authSchema,'id':z[_0x3a4ba0(0xdc)]()[_0x3a4ba0(0xc0)]()[_0x3a4ba0(0xc1)](_0x3a4ba0(0xb1)),'description':z[_0x3a4ba0(0xb3)]()[_0x3a4ba0(0xa8)](0x1)['describe'](_0x3a4ba0(0xad)),'scriptContent':z[_0x3a4ba0(0xb3)]()[_0x3a4ba0(0xa8)](0x1)['describe'](_0x3a4ba0(0x97))},'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':![]}},wrapHandler(saveOrUpdateBffScript)));}get[a9_0x5dcf25(0xa6)](){const _0x5f2686=a9_0x5dcf25;return this[_0x5f2686(0xce)];}async[a9_0x5dcf25(0x99)](_0x1a2dd3){const _0x357fcb=a9_0x5dcf25;await this[_0x357fcb(0xce)][_0x357fcb(0x99)](_0x1a2dd3);}async['close'](){const _0x3438b4=a9_0x5dcf25;await this['mcpServer'][_0x3438b4(0x81)]();}['logInfo'](){const _0xb9a1cb=a9_0x5dcf25;if(!process['env'][_0xb9a1cb(0xc6)])return;console[_0xb9a1cb(0xb0)](_0xb9a1cb(0xa5)),console[_0xb9a1cb(0xb0)](_0xb9a1cb(0x88)+packageJson[_0xb9a1cb(0x91)]),console[_0xb9a1cb(0xb0)](_0xb9a1cb(0xac)),this[_0xb9a1cb(0xb6)][_0xb9a1cb(0x85)]&&(console[_0xb9a1cb(0xb0)]('Backend\x20Function\x20write\x20tools\x20enabled\x20(--enable-bff-save)'),console[_0xb9a1cb(0xb0)](_0xb9a1cb(0x90)));}}function buildInstructions(_0x1e16c6){const _0x1cee2f=a9_0x5dcf25,_0x503e8e=_0x1e16c6[_0x1cee2f(0x85)]===!![],_0xe42fce=_0x503e8e?_0x1cee2f(0x9f):'';return _0x1cee2f(0xb4)+_0xe42fce+'\x0a';}export function createServer(_0x3cbab6){return new LovrabetDatasetMCPServer(_0x3cbab6);}
@@ -1 +1 @@
1
- (function(_0x30068b,_0x4d6fb3){const _0x2306cd=a10_0x32ca,_0x553a01=_0x30068b();while(!![]){try{const _0x2568ec=parseInt(_0x2306cd(0x8e))/0x1*(-parseInt(_0x2306cd(0x90))/0x2)+parseInt(_0x2306cd(0x8b))/0x3+-parseInt(_0x2306cd(0x9d))/0x4+-parseInt(_0x2306cd(0x98))/0x5*(parseInt(_0x2306cd(0xa0))/0x6)+parseInt(_0x2306cd(0x96))/0x7*(parseInt(_0x2306cd(0x81))/0x8)+parseInt(_0x2306cd(0x9b))/0x9*(parseInt(_0x2306cd(0x8f))/0xa)+parseInt(_0x2306cd(0x93))/0xb*(parseInt(_0x2306cd(0x85))/0xc);if(_0x2568ec===_0x4d6fb3)break;else _0x553a01['push'](_0x553a01['shift']());}catch(_0x14a3f4){_0x553a01['push'](_0x553a01['shift']());}}}(a10_0x739c,0x51831));function a10_0x32ca(_0x16ac9e,_0x6385f7){_0x16ac9e=_0x16ac9e-0x80;const _0x739c25=a10_0x739c();let _0x32caa3=_0x739c25[_0x16ac9e];return _0x32caa3;}function a10_0x739c(){const _0x5da2a1=['keys','message','1157970xNZMEi','SQL\x20execution\x20failed:\x20','success','8204AISNns','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','145lAsxRa',']:\x20','errorMsg','1077183MVbOQC','data','1053612qSGgia','isArray','SQL\x20execution\x20failed\x20without\x20error\x20message','40674QzcPfJ','errorCode','2824yuVkgC','now','execResult','UNKNOWN','48FjeOCB','SQL\x20execution\x20failed\x20[','\x20row(s).','execError','API\x20call\x20failed:\x20','msg','201480AuopPm','length','Unknown\x20error','227776wzVuRj','10DloUqB','2pzTCSu'];a10_0x739c=function(){return _0x5da2a1;};return a10_0x739c();}import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode}from'../config/env.js';export async function executeCustomSql(_0x3ff96e){const _0x445d3f=a10_0x32ca,_0x490d27=Date[_0x445d3f(0x82)](),{appCode:appCode=getEnvAppCode(),cookie:_0x19a1dc,sqlCode:_0x178441,params:_0x477cc6}=_0x3ff96e;if(!appCode)throw new Error(_0x445d3f(0x97));if(!_0x178441||_0x178441['trim']()==='')throw new Error('sqlCode\x20is\x20required.\x20Get\x20it\x20from\x20list_sql_queries\x20->\x20sqlCode');const _0x7376b0=new DevApiClient({'appCode':appCode,'cookie':_0x19a1dc}),_0x4c7f02=_0x477cc6&&Object[_0x445d3f(0x91)](_0x477cc6)[_0x445d3f(0x8c)]>0x0,_0x42d59a=_0x4c7f02?Object[_0x445d3f(0x91)](_0x477cc6):[],_0x5c0df7={'sqlCode':_0x178441,'hasParams':_0x4c7f02||![],'paramNames':_0x42d59a||[]};try{const _0x8b5bb=await _0x7376b0['executeSql']({'sqlCode':_0x178441['trim'](),'params':_0x477cc6}),_0x27b3ff=Date[_0x445d3f(0x82)]()-_0x490d27,_0x433792=_0x8b5bb[_0x445d3f(0x95)]??![],_0x3e7677=_0x8b5bb[_0x445d3f(0x80)];if(!_0x433792){const _0x2f2923=_0x8b5bb['errorMsg']||_0x8b5bb[_0x445d3f(0x8a)]||_0x445d3f(0x8d);return{'success':![],'execSuccess':![],'execError':_0x2f2923,'errorCode':_0x3e7677||_0x445d3f(0x84),'message':_0x445d3f(0x86)+(_0x3e7677||'ERR')+_0x445d3f(0x99)+_0x2f2923,'executionTime':_0x27b3ff,'sqlInfo':_0x5c0df7};}const _0x4b00ed=_0x8b5bb[_0x445d3f(0x9c)]||_0x8b5bb,_0x5e4052=_0x4b00ed['execSuccess']??_0x4b00ed[_0x445d3f(0x95)]??!![],_0x34ae3f=_0x4b00ed[_0x445d3f(0x83)]||_0x4b00ed[_0x445d3f(0x9c)],_0x5b8472=_0x4b00ed[_0x445d3f(0x88)]||_0x4b00ed[_0x445d3f(0x9a)];if(_0x5e4052){const _0x255e05=Array[_0x445d3f(0x9e)](_0x34ae3f)?_0x34ae3f[_0x445d3f(0x8c)]:0x0;return{'success':!![],'execSuccess':!![],'execResult':_0x34ae3f||[],'rowCount':_0x255e05,'message':'SQL\x20executed\x20successfully.\x20Returned\x20'+_0x255e05+_0x445d3f(0x87),'executionTime':_0x27b3ff,'sqlInfo':_0x5c0df7};}return{'success':!![],'execSuccess':![],'execError':_0x5b8472||_0x445d3f(0x9f),'message':_0x445d3f(0x94)+(_0x5b8472||_0x445d3f(0x8d)),'executionTime':_0x27b3ff,'sqlInfo':_0x5c0df7};}catch(_0x254abb){const _0x41fc5d=Date[_0x445d3f(0x82)]()-_0x490d27;return{'success':![],'execSuccess':![],'execError':_0x254abb[_0x445d3f(0x92)]||'Unknown\x20error','message':_0x445d3f(0x89)+(_0x254abb[_0x445d3f(0x92)]||_0x445d3f(0x8d)),'executionTime':_0x41fc5d,'sqlInfo':_0x5c0df7};}}
1
+ function a10_0x3001(_0x5a2c64,_0x1d3c3d){_0x5a2c64=_0x5a2c64-0x188;const _0x3895e4=a10_0x3895();let _0x30018d=_0x3895e4[_0x5a2c64];return _0x30018d;}(function(_0x4c8ada,_0x57ee92){const _0x5e0d2a=a10_0x3001,_0x431a7f=_0x4c8ada();while(!![]){try{const _0x787760=parseInt(_0x5e0d2a(0x194))/0x1+parseInt(_0x5e0d2a(0x1a0))/0x2*(-parseInt(_0x5e0d2a(0x19b))/0x3)+-parseInt(_0x5e0d2a(0x1a2))/0x4*(-parseInt(_0x5e0d2a(0x19d))/0x5)+-parseInt(_0x5e0d2a(0x195))/0x6*(parseInt(_0x5e0d2a(0x196))/0x7)+-parseInt(_0x5e0d2a(0x1a6))/0x8+parseInt(_0x5e0d2a(0x188))/0x9+parseInt(_0x5e0d2a(0x19c))/0xa;if(_0x787760===_0x57ee92)break;else _0x431a7f['push'](_0x431a7f['shift']());}catch(_0x10e8ff){_0x431a7f['push'](_0x431a7f['shift']());}}}(a10_0x3895,0xddc4b));import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode}from'../config/env.js';export async function executeCustomSql(_0x513a6d){const _0x100627=a10_0x3001,_0x4000fd=Date[_0x100627(0x18a)](),{appCode:appCode=getEnvAppCode(),cookie:_0x19d7c8,sqlCode:_0x56b12c,params:_0x5b5ad5}=_0x513a6d;if(!appCode)throw new Error(_0x100627(0x19f));if(!_0x56b12c||_0x56b12c[_0x100627(0x19e)]()==='')throw new Error(_0x100627(0x193));const _0x4b3bec=new DevApiClient({'appCode':appCode,'cookie':_0x19d7c8}),_0x267528=_0x5b5ad5&&Object[_0x100627(0x18d)](_0x5b5ad5)[_0x100627(0x191)]>0x0,_0x13481d=_0x267528?Object['keys'](_0x5b5ad5):[],_0x2165ac={'sqlCode':_0x56b12c,'hasParams':_0x267528||![],'paramNames':_0x13481d||[]};try{const _0x231e46=await _0x4b3bec[_0x100627(0x1a3)]({'sqlCode':_0x56b12c[_0x100627(0x19e)](),'params':_0x5b5ad5}),_0x441bc6=Date[_0x100627(0x18a)]()-_0x4000fd,_0x18d48c=_0x231e46[_0x100627(0x1a1)]??![],_0x14b4e4=_0x231e46[_0x100627(0x18c)];if(!_0x18d48c){const _0x1c3caa=_0x231e46[_0x100627(0x198)]||_0x231e46['msg']||_0x100627(0x18b);return{'success':![],'execSuccess':![],'execError':_0x1c3caa,'errorCode':_0x14b4e4||_0x100627(0x18f),'message':_0x100627(0x199)+(_0x14b4e4||_0x100627(0x197))+_0x100627(0x1a7)+_0x1c3caa,'executionTime':_0x441bc6,'sqlInfo':_0x2165ac};}const _0x2cf989=_0x231e46[_0x100627(0x1a5)]||_0x231e46,_0xf181e2=_0x2cf989['execSuccess']??_0x2cf989[_0x100627(0x1a1)]??!![],_0x56cf5f=_0x2cf989['execResult']||_0x2cf989[_0x100627(0x1a5)],_0x50f18a=_0x2cf989['execError']||_0x2cf989[_0x100627(0x198)];if(_0xf181e2){const _0x1a3f79=Array['isArray'](_0x56cf5f)?_0x56cf5f[_0x100627(0x191)]:0x0;return{'success':!![],'execSuccess':!![],'execResult':_0x56cf5f||[],'rowCount':_0x1a3f79,'message':_0x100627(0x1a4)+_0x1a3f79+_0x100627(0x192),'executionTime':_0x441bc6,'sqlInfo':_0x2165ac};}return{'success':!![],'execSuccess':![],'execError':_0x50f18a||_0x100627(0x19a),'message':_0x100627(0x189)+(_0x50f18a||_0x100627(0x18b)),'executionTime':_0x441bc6,'sqlInfo':_0x2165ac};}catch(_0x5b1736){const _0x315b96=Date[_0x100627(0x18a)]()-_0x4000fd;return{'success':![],'execSuccess':![],'execError':_0x5b1736[_0x100627(0x18e)]||_0x100627(0x18b),'message':_0x100627(0x190)+(_0x5b1736[_0x100627(0x18e)]||_0x100627(0x18b)),'executionTime':_0x315b96,'sqlInfo':_0x2165ac};}}function a10_0x3895(){const _0x377468=['3529322otItwM','success','1708unaqdi','executeSql','SQL\x20executed\x20successfully.\x20Returned\x20','data','1568328xqdJIh',']:\x20','8028315eLyFBB','SQL\x20execution\x20failed:\x20','now','Unknown\x20error','errorCode','keys','message','UNKNOWN','API\x20call\x20failed:\x20','length','\x20row(s).','sqlCode\x20is\x20required.\x20Get\x20it\x20from\x20list_sql_queries\x20->\x20sqlCode','183889ffVWLL','1346862FvcnJg','21hWIoNq','ERR','errorMsg','SQL\x20execution\x20failed\x20[','SQL\x20execution\x20failed\x20without\x20error\x20message','3SUNEPH','14114550hITGfC','12355jUQpJE','trim','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.'];a10_0x3895=function(){return _0x377468;};return a10_0x3895();}
@@ -1 +1 @@
1
- (function(_0x227df8,_0x2ec37e){const _0x3f3519=a11_0x9055,_0x48aa4f=_0x227df8();while(!![]){try{const _0x13b71b=-parseInt(_0x3f3519(0x1bc))/0x1+-parseInt(_0x3f3519(0x1ad))/0x2+parseInt(_0x3f3519(0x1ba))/0x3*(parseInt(_0x3f3519(0x1a6))/0x4)+-parseInt(_0x3f3519(0x1b8))/0x5+-parseInt(_0x3f3519(0x1a7))/0x6+parseInt(_0x3f3519(0x1aa))/0x7+parseInt(_0x3f3519(0x1bb))/0x8;if(_0x13b71b===_0x2ec37e)break;else _0x48aa4f['push'](_0x48aa4f['shift']());}catch(_0x4dc2f2){_0x48aa4f['push'](_0x48aa4f['shift']());}}}(a11_0x5af2,0x1f57e));import{DevApiClient}from'../api/dev-api-client.js';function a11_0x9055(_0x3f4942,_0x2b768e){_0x3f4942=_0x3f4942-0x1a6;const _0x5af2f7=a11_0x5af2();let _0x905587=_0x5af2f7[_0x3f4942];return _0x905587;}import{DrivenDataDetailPlus}from'@lovrabet/dsparser';import{getEnvAppCode,getEnvironment}from'../config/env.js';function a11_0x5af2(){const _0x2c4985=['typescript','sdkCall','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','getTableKey','requestExample','responseExample','getOperationDocMeta','toJSON','replace','369265rqRBVU','data','24VrhpXH','3132632YjqFhM','64898jASILm','\x20|\x20数据表:\x20','generateSDKInitCode','datasetCode\x20is\x20required','datasetCode','usageExample','47332YgaYHn','569538MuSuxA','Cannot\x20generate\x20SDK\x20code\x20for\x20operation\x20\x27','\x27\x20in\x20dataset\x20\x27','372421oUnGdP','operationName\x20is\x20required','getModelAlias','354780PPFWHU','generateAliasExplanation'];a11_0x5af2=function(){return _0x2c4985;};return a11_0x5af2();}import{buildFieldRelationsMap,enrichFieldsWithRelations}from'../utils/relations.js';export async function generateSDKCode(_0xa1281d){const _0x4fedd0=a11_0x9055,{appCode:appCode=getEnvAppCode(),cookie:_0x8fb5bc,datasetCode:_0x4ad6b1,operationName:_0x3030c7,includeImports:includeImports=!![],useAlias:useAlias=![]}=_0xa1281d;if(!appCode)throw new Error(_0x4fedd0(0x1b1));if(!_0x4ad6b1)throw new Error(_0x4fedd0(0x1bf));if(!_0x3030c7)throw new Error(_0x4fedd0(0x1ab));const _0x1ac8ec=new DevApiClient({'appCode':appCode,'cookie':_0x8fb5bc}),_0x4ee64a=getEnvironment(),_0x22c625=await _0x1ac8ec['getDatasetDetail'](_0x4ad6b1),_0x4829e4=_0x22c625[_0x4fedd0(0x1b9)]||_0x22c625,_0x320f2d=new DrivenDataDetailPlus(_0x4829e4),_0x22f352=_0x320f2d[_0x4fedd0(0x1b5)](_0x3030c7);if(!_0x22f352)throw new Error(_0x4fedd0(0x1a8)+_0x3030c7+_0x4fedd0(0x1a9)+_0x4ad6b1+'\x27');const _0x91ebe7=_0x320f2d['getDatasetSDKKey'](),_0x3f1e85=_0x320f2d[_0x4fedd0(0x1ac)](),_0x3351dc=_0x320f2d[_0x4fedd0(0x1b2)](),_0x493fe6=_0x320f2d['getTableName'](),_0x3af40b=_0x320f2d['name'],_0x55aaa5=_0x320f2d['getFieldList'](),_0x58a8c6=_0x55aaa5?.[_0x4fedd0(0x1b6)]?.()||[],_0x1e5d4b=buildFieldRelationsMap(_0x22c625),_0x204d3f=enrichFieldsWithRelations(_0x58a8c6,_0x1e5d4b),_0x383662=_0x320f2d['generateFullSDKExample'](_0x3030c7,appCode),_0x186f91=_0x320f2d['getOperationAnalysis'](_0x3030c7);let _0x2fabf7=_0x22f352[_0x4fedd0(0x1b0)]['code'],_0x1b98be=_0x383662||undefined;useAlias&&(_0x2fabf7=_0x2fabf7[_0x4fedd0(0x1b7)](new RegExp(_0x91ebe7,'g'),_0x3f1e85),_0x1b98be&&(_0x1b98be=_0x1b98be['replace'](new RegExp(_0x91ebe7,'g'),_0x3f1e85)));const _0x4f171c='//\x20数据集:\x20'+_0x3af40b+'\x20|\x20数据表:\x20'+_0x493fe6+'\x0a',_0x4ee0d9=_0x4f171c+_0x2fabf7,_0x4273a8=_0x1b98be?'//\x20数据集:\x20'+_0x3af40b+_0x4fedd0(0x1bd)+_0x493fe6+'\x0a'+_0x1b98be:undefined;return{'appCode':appCode,'env':_0x4ee64a,'datasetName':_0x3af40b,'language':_0x4fedd0(0x1af),'code':_0x4ee0d9,'fullExample':includeImports?_0x4273a8:undefined,'sdkCallInfo':{'modelName':_0x3f1e85,'tableName':_0x493fe6,'tableKey':_0x3351dc,'datasetCode':_0x320f2d[_0x4fedd0(0x1c0)],'operationName':_0x3030c7},'fields':_0x204d3f,'requestExample':_0x186f91?.[_0x4fedd0(0x1b3)],'responseExample':_0x186f91?.[_0x4fedd0(0x1b4)],'sdkInitCode':_0x320f2d[_0x4fedd0(0x1be)](_0x3351dc),'usageExample':_0x22f352[_0x4fedd0(0x1c1)],'aliasExplanation':useAlias?_0x320f2d[_0x4fedd0(0x1ae)]():undefined,'aliasHint':{'defaultAlias':_0x3f1e85,'datasetSDKKey':_0x91ebe7}};}
1
+ (function(_0x1a6ef4,_0x42df83){const _0xfb1180=a11_0x3aa5,_0x59e6f3=_0x1a6ef4();while(!![]){try{const _0x587398=parseInt(_0xfb1180(0x15f))/0x1*(parseInt(_0xfb1180(0x155))/0x2)+parseInt(_0xfb1180(0x15c))/0x3+-parseInt(_0xfb1180(0x142))/0x4+-parseInt(_0xfb1180(0x154))/0x5+parseInt(_0xfb1180(0x163))/0x6*(parseInt(_0xfb1180(0x14c))/0x7)+-parseInt(_0xfb1180(0x153))/0x8+parseInt(_0xfb1180(0x14e))/0x9;if(_0x587398===_0x42df83)break;else _0x59e6f3['push'](_0x59e6f3['shift']());}catch(_0x1d5818){_0x59e6f3['push'](_0x59e6f3['shift']());}}}(a11_0xe5fb,0xbca39));function a11_0xe5fb(){const _0x2f6f8b=['getOperationDocMeta','getTableKey','3019332RteByT','generateFullSDKExample','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','datasetCode\x20is\x20required','\x20|\x20数据表:\x20','getDatasetDetail','Cannot\x20generate\x20SDK\x20code\x20for\x20operation\x20\x27','generateSDKInitCode','toJSON','typescript','7mBLMFS','//\x20数据集:\x20','3980457UniRzG','name','responseExample','requestExample','generateAliasExplanation','6779824HtWvkw','6539965brVkZg','1782954QNUWJq','code','replace','data','getOperationAnalysis','datasetCode','operationName\x20is\x20required','3740040sgSXrD','getDatasetSDKKey','usageExample','1hMEsWV','getModelAlias','\x27\x20in\x20dataset\x20\x27','getFieldList','6615234wwfJcp'];a11_0xe5fb=function(){return _0x2f6f8b;};return a11_0xe5fb();}import{DevApiClient}from'../api/dev-api-client.js';import{DrivenDataDetailPlus}from'@lovrabet/dsparser';import{getEnvAppCode,getEnvironment}from'../config/env.js';function a11_0x3aa5(_0x29d617,_0xfd01d4){_0x29d617=_0x29d617-0x141;const _0xe5fb7e=a11_0xe5fb();let _0x3aa507=_0xe5fb7e[_0x29d617];return _0x3aa507;}import{buildFieldRelationsMap,enrichFieldsWithRelations}from'../utils/relations.js';export async function generateSDKCode(_0x411536){const _0x47373d=a11_0x3aa5,{appCode:appCode=getEnvAppCode(),cookie:_0xa7cfc,datasetCode:_0x248cb0,operationName:_0x429394,includeImports:includeImports=!![],useAlias:useAlias=![]}=_0x411536;if(!appCode)throw new Error(_0x47373d(0x144));if(!_0x248cb0)throw new Error(_0x47373d(0x145));if(!_0x429394)throw new Error(_0x47373d(0x15b));const _0x303374=new DevApiClient({'appCode':appCode,'cookie':_0xa7cfc}),_0x2c5ebb=getEnvironment(),_0x36106b=await _0x303374[_0x47373d(0x147)](_0x248cb0),_0x123338=_0x36106b[_0x47373d(0x158)]||_0x36106b,_0x54b035=new DrivenDataDetailPlus(_0x123338),_0x64b7e1=_0x54b035[_0x47373d(0x164)](_0x429394);if(!_0x64b7e1)throw new Error(_0x47373d(0x148)+_0x429394+_0x47373d(0x161)+_0x248cb0+'\x27');const _0x2e896d=_0x54b035[_0x47373d(0x15d)](),_0x2b5a5f=_0x54b035[_0x47373d(0x160)](),_0x270486=_0x54b035[_0x47373d(0x141)](),_0xfdf482=_0x54b035['getTableName'](),_0x83a08a=_0x54b035[_0x47373d(0x14f)],_0xa2a608=_0x54b035[_0x47373d(0x162)](),_0x4fc573=_0xa2a608?.[_0x47373d(0x14a)]?.()||[],_0x2cbc6c=buildFieldRelationsMap(_0x36106b),_0x36aab0=enrichFieldsWithRelations(_0x4fc573,_0x2cbc6c),_0x17754c=_0x54b035[_0x47373d(0x143)](_0x429394,appCode),_0x28e4ea=_0x54b035[_0x47373d(0x159)](_0x429394);let _0x4f575b=_0x64b7e1['sdkCall'][_0x47373d(0x156)],_0x4f9234=_0x17754c||undefined;useAlias&&(_0x4f575b=_0x4f575b[_0x47373d(0x157)](new RegExp(_0x2e896d,'g'),_0x2b5a5f),_0x4f9234&&(_0x4f9234=_0x4f9234[_0x47373d(0x157)](new RegExp(_0x2e896d,'g'),_0x2b5a5f)));const _0x4348ba=_0x47373d(0x14d)+_0x83a08a+'\x20|\x20数据表:\x20'+_0xfdf482+'\x0a',_0x238e83=_0x4348ba+_0x4f575b,_0x1b01b7=_0x4f9234?_0x47373d(0x14d)+_0x83a08a+_0x47373d(0x146)+_0xfdf482+'\x0a'+_0x4f9234:undefined;return{'appCode':appCode,'env':_0x2c5ebb,'datasetName':_0x83a08a,'language':_0x47373d(0x14b),'code':_0x238e83,'fullExample':includeImports?_0x1b01b7:undefined,'sdkCallInfo':{'modelName':_0x2b5a5f,'tableName':_0xfdf482,'tableKey':_0x270486,'datasetCode':_0x54b035[_0x47373d(0x15a)],'operationName':_0x429394},'fields':_0x36aab0,'requestExample':_0x28e4ea?.[_0x47373d(0x151)],'responseExample':_0x28e4ea?.[_0x47373d(0x150)],'sdkInitCode':_0x54b035[_0x47373d(0x149)](_0x270486),'usageExample':_0x64b7e1[_0x47373d(0x15e)],'aliasExplanation':useAlias?_0x54b035[_0x47373d(0x152)]():undefined,'aliasHint':{'defaultAlias':_0x2b5a5f,'datasetSDKKey':_0x2e896d}};}
@@ -1 +1 @@
1
- function a12_0x3998(){const _0x47ce6b=['This\x20SQL\x20requires\x20parameters:\x20','66504QZHGWn','2024-01-01','Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.','4022832LxQQlo','SDK\x20client.sql.execute()\x20returns\x20{\x20execSuccess,\x20execResult\x20}\x20—\x20always\x20check\x20execSuccess','from','replace','toLowerCase','search','32705YydYNr','bff','trim','sqlContent','sqlCode','example',');\x0a\x0a//\x20IMPORTANT:\x20SDK\x20returns\x20wrapper\x20—\x20check\x20execSuccess\x20before\x20using\x20results\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\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});',');\x0a\x0a\x20\x20//\x20rows\x20is\x20T[]\x20directly\x20—\x20no\x20wrapper,\x20errors\x20throw\x20exceptions\x0a\x20\x20console.log(`Retrieved\x20${rows.length}\x20rows`);\x0a\x0a\x20\x20return\x20{\x20data:\x20rows\x20};\x0a}','This\x20SQL\x20does\x20not\x20require\x20any\x20parameters','length','//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27','name','Backend\x20Function','991200FUwVbh','Check\x20the\x20sqlCode\x20from\x20list_sql_queries\x20result\x20and\x20use\x20the\x20exact\x20value.','SQL\x20code\x20\x22','6fqmdTY',',\x0a}','\x27,\x0a\x20\x20params:\x20','map','time','sqlId','//\x20Backend\x20Function:\x20Execute\x20SQL\x20\x22','entries','sqlName','includes','size','page','\x27,\x0a\x20\x20env:\x20\x27','2046320XQZSuc','find','\x20code\x20for\x20SQL:\x20','join','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a','\x22\x20does\x20not\x20exist.\x20Use\x20list_sql_queries\x20to\x20find\x20valid\x20SQL\x20codes.','sdk','value','count','Note:\x20client.api.executeSql()\x20is\x20deprecated.\x20Use\x20client.sql.execute()\x20instead.','\x0aconst\x20data\x20=\x20await\x20client.sql.execute(','sql','reduce','1568912wfvQWC','sqlCode\x20is\x20required','message','{\x20sqlCode:\x20\x27','data','\x27,\x0a});\x0a\x0a//\x20Execute\x20SQL:\x20','getCustomSqlList','Failed\x20to\x20verify\x20SQL\x20code:\x20','status','Frontend\x20SDK','5737767aDyWSa','{\x0a\x20\x20sqlCode:\x20\x27','Errors\x20throw\x20exceptions\x20—\x20use\x20try-catch','\x22\x0aexport\x20default\x20async\x20function(params,\x20context)\x20{\x0a\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute('];a12_0x3998=function(){return _0x47ce6b;};return a12_0x3998();}(function(_0x3b689b,_0x34f55b){const _0x4f1c29=a12_0x2edf,_0x3297e5=_0x3b689b();while(!![]){try{const _0x3afdd5=-parseInt(_0x4f1c29(0xf5))/0x1+-parseInt(_0x4f1c29(0x102))/0x2+parseInt(_0x4f1c29(0x105))/0x3*(parseInt(_0x4f1c29(0xdd))/0x4)+parseInt(_0x4f1c29(0x112))/0x5+parseInt(_0x4f1c29(0xef))/0x6+-parseInt(_0x4f1c29(0xe7))/0x7+-parseInt(_0x4f1c29(0xec))/0x8;if(_0x3afdd5===_0x34f55b)break;else _0x3297e5['push'](_0x3297e5['shift']());}catch(_0x4ea8ff){_0x3297e5['push'](_0x3297e5['shift']());}}}(a12_0x3998,0x7bff5));import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode,getEnvironment}from'../config/env.js';function a12_0x2edf(_0x45a791,_0x57e9fe){_0x45a791=_0x45a791-0xd6;const _0x399888=a12_0x3998();let _0x2edf19=_0x399888[_0x45a791];return _0x2edf19;}export async function generateSqlCode(_0x4fc715){const _0x4c294e=a12_0x2edf,{appCode:appCode=getEnvAppCode(),cookie:_0x2c8167,sqlCode:_0x7878f0,params:_0x26efe1,includeImports:includeImports=!![],target:target=_0x4c294e(0xd6)}=_0x4fc715;if(!appCode)throw new Error('appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.');if(!_0x7878f0||_0x7878f0[_0x4c294e(0xf7)]()==='')return{'success':![],'sqlCode':'','sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[]},'error':_0x4c294e(0xde)};const _0x474a4c=_0x7878f0[_0x4c294e(0xf7)](),_0x2c69e4=new DevApiClient({'appCode':appCode,'cookie':_0x2c8167}),_0x7898b5=getEnvironment();try{const _0x220deb=await _0x2c69e4[_0x4c294e(0xe3)]({'pageSize':0x3e7,'currentPage':0x1,'sqlCode':_0x474a4c}),_0x2f190b=_0x220deb[_0x4c294e(0xe1)]?.['tableData']||[],_0x42560b=_0x2f190b[_0x4c294e(0x113)](_0x321539=>_0x321539[_0x4c294e(0xf9)]===_0x474a4c||_0x321539[_0x4c294e(0xf9)]?.[_0x4c294e(0x10e)](_0x474a4c)||_0x474a4c[_0x4c294e(0x10e)](_0x321539['sqlCode']));if(!_0x42560b)return{'success':![],'sqlCode':_0x474a4c,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x4c294e(0x104)+_0x474a4c+'\x22\x20not\x20found\x20in\x20the\x20application.',_0x4c294e(0xee),_0x4c294e(0x103)]},'error':_0x4c294e(0x104)+_0x474a4c+_0x4c294e(0x117)};const _0x18be1b=_0x42560b[_0x4c294e(0xf9)],_0x21fee7=_0x42560b[_0x4c294e(0x10d)]||_0x42560b[_0x4c294e(0x100)]||'SQL-'+(_0x42560b[_0x4c294e(0x10a)]||_0x42560b['id']),_0x469a6f=_0x42560b[_0x4c294e(0xf8)]||_0x42560b[_0x4c294e(0xdb)]||'',_0x4ecb86=_0x469a6f['match'](/[:$]\{?(\w+)\}?/g);let _0x24439b,_0x4c552f;if(_0x4ecb86){const _0x50fba4=Array[_0x4c294e(0xf1)](new Set(_0x4ecb86['map'](_0x2ec0c3=>_0x2ec0c3[_0x4c294e(0xf2)](/[:${}]/g,''))));_0x24439b=_0x50fba4[_0x4c294e(0x108)](_0x44022d=>{const _0x5969f2=_0x26efe1?.[_0x44022d]??getDefaultExample(_0x44022d);return{'name':_0x44022d,'example':_0x5969f2};}),_0x4c552f=_0x24439b[_0x4c294e(0xdc)]((_0x5a6171,_0x3d6734)=>({..._0x5a6171,[_0x3d6734[_0x4c294e(0x100)]]:_0x3d6734[_0x4c294e(0xfa)]}),{});}else _0x26efe1&&(_0x24439b=Object[_0x4c294e(0x10c)](_0x26efe1)[_0x4c294e(0x108)](([_0x3a37f2,_0x551b7c])=>({'name':_0x3a37f2,'example':_0x551b7c})),_0x4c552f=_0x26efe1);const _0x595408=_0x24439b&&_0x24439b[_0x4c294e(0xfe)]>0x0,_0x327fd8=_0x595408?JSON['stringify'](_0x4c552f,null,0x2):'',_0x181e37=_0x595408?_0x4c294e(0xe8)+_0x18be1b+_0x4c294e(0x107)+_0x327fd8+_0x4c294e(0x106):_0x4c294e(0xe0)+_0x18be1b+'\x27\x20}';let _0x495e11;target===_0x4c294e(0xf6)?_0x495e11=_0x4c294e(0x10b)+_0x21fee7+_0x4c294e(0xea)+_0x181e37+_0x4c294e(0xfc):_0x495e11=(includeImports?_0x4c294e(0x116):'')+_0x4c294e(0xff)+appCode+_0x4c294e(0x111)+_0x7898b5+_0x4c294e(0xe2)+_0x21fee7+_0x4c294e(0xda)+_0x181e37+_0x4c294e(0xfb);const _0x199896=target==='bff';return{'success':!![],'sqlCode':_0x18be1b,'sqlName':_0x21fee7,'sqlExists':!![],'code':_0x495e11,'parameters':_0x24439b,'usage':{'description':'Generated\x20'+(_0x199896?_0x4c294e(0x101):_0x4c294e(0xe6))+_0x4c294e(0x114)+_0x21fee7,'important':[_0x4c294e(0x104)+_0x18be1b+'\x22\x20exists\x20and\x20is\x20valid.',_0x199896?'BFF\x20context.client.sql.execute()\x20returns\x20rows\x20T[]\x20directly\x20—\x20no\x20wrapper\x20object':_0x4c294e(0xf0),_0x199896?_0x4c294e(0xe9):'On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20—\x20use\x20try-catch',_0x595408?_0x4c294e(0xeb)+_0x24439b[_0x4c294e(0x108)](_0x4aa648=>_0x4aa648[_0x4c294e(0x100)])[_0x4c294e(0x115)](',\x20'):_0x4c294e(0xfd),_0x4c294e(0xd9)]}};}catch(_0x2c1b16){return{'success':![],'sqlCode':_0x474a4c,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x4c294e(0xe4)+_0x2c1b16[_0x4c294e(0xdf)],_0x4c294e(0xee)]},'error':_0x4c294e(0xe4)+_0x2c1b16['message']};}}function getDefaultExample(_0x3849de){const _0x24a17e=a12_0x2edf,_0x168e27=_0x3849de[_0x24a17e(0xf3)]();if(_0x168e27[_0x24a17e(0x10e)]('date')||_0x168e27[_0x24a17e(0x10e)](_0x24a17e(0x109)))return _0x24a17e(0xed);if(_0x168e27[_0x24a17e(0x10e)]('id'))return 0x7b;if(_0x168e27[_0x24a17e(0x10e)]('limit')||_0x168e27['includes'](_0x24a17e(0xd8))||_0x168e27[_0x24a17e(0x10e)](_0x24a17e(0x10f)))return 0xa;if(_0x168e27['includes'](_0x24a17e(0x110)))return 0x1;if(_0x168e27[_0x24a17e(0x10e)]('keyword')||_0x168e27[_0x24a17e(0x10e)](_0x24a17e(0xf4))||_0x168e27[_0x24a17e(0x10e)](_0x24a17e(0x100)))return _0x24a17e(0xfa);if(_0x168e27[_0x24a17e(0x10e)](_0x24a17e(0xe5)))return 0x1;return _0x24a17e(0xd7);}
1
+ (function(_0x1f88ad,_0x4ea4bc){const _0xb42c02=a12_0x554e,_0x1e40ba=_0x1f88ad();while(!![]){try{const _0x4f1fba=parseInt(_0xb42c02(0x103))/0x1*(-parseInt(_0xb42c02(0xd8))/0x2)+parseInt(_0xb42c02(0xe2))/0x3*(parseInt(_0xb42c02(0xcc))/0x4)+parseInt(_0xb42c02(0xfc))/0x5+-parseInt(_0xb42c02(0xcb))/0x6*(parseInt(_0xb42c02(0xda))/0x7)+-parseInt(_0xb42c02(0xdc))/0x8+parseInt(_0xb42c02(0xbf))/0x9*(parseInt(_0xb42c02(0xe7))/0xa)+parseInt(_0xb42c02(0xed))/0xb*(parseInt(_0xb42c02(0xc0))/0xc);if(_0x4f1fba===_0x4ea4bc)break;else _0x1e40ba['push'](_0x1e40ba['shift']());}catch(_0x57a039){_0x1e40ba['push'](_0x1e40ba['shift']());}}}(a12_0x20a7,0x56e59));function a12_0x20a7(){const _0x1a786d=['from','length','35348nkoDjE','Errors\x20throw\x20exceptions\x20—\x20use\x20try-catch','page','limit','reduce','9IJLsrf','9934992AYjfXk','\x20code\x20for\x20SQL:\x20','Check\x20the\x20sqlCode\x20from\x20list_sql_queries\x20result\x20and\x20use\x20the\x20exact\x20value.','Note:\x20client.api.executeSql()\x20is\x20deprecated.\x20Use\x20client.sql.execute()\x20instead.','sqlCode\x20is\x20required','sqlName','Failed\x20to\x20verify\x20SQL\x20code:\x20','2024-01-01','getCustomSqlList','Backend\x20Function','bff','834oTdTRB','90996xVUksB','\x22\x20exists\x20and\x20is\x20valid.','search','BFF\x20context.client.sql.execute()\x20returns\x20rows\x20T[]\x20directly\x20—\x20no\x20wrapper\x20object','SQL\x20code\x20\x22','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20—\x20use\x20try-catch','sqlContent','\x27\x20}','stringify','sqlCode','toLowerCase','data','36oKgKJo','find','210hoclLm','example','4701808NftYWF',');\x0a\x0a//\x20IMPORTANT:\x20SDK\x20returns\x20wrapper\x20—\x20check\x20execSuccess\x20before\x20using\x20results\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\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});',',\x0a}','Generated\x20','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','join','9RLOXPJ','value','trim','\x0aconst\x20data\x20=\x20await\x20client.sql.execute(','map','744170WJuiqD','date','keyword','\x22\x20does\x20not\x20exist.\x20Use\x20list_sql_queries\x20to\x20find\x20valid\x20SQL\x20codes.','name','{\x20sqlCode:\x20\x27','11bWqpBi','\x27,\x0a\x20\x20env:\x20\x27','sqlId','This\x20SQL\x20does\x20not\x20require\x20any\x20parameters',');\x0a\x0a\x20\x20//\x20rows\x20is\x20T[]\x20directly\x20—\x20no\x20wrapper,\x20errors\x20throw\x20exceptions\x0a\x20\x20console.log(`Retrieved\x20${rows.length}\x20rows`);\x0a\x0a\x20\x20return\x20{\x20data:\x20rows\x20};\x0a}','Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.','This\x20SQL\x20requires\x20parameters:\x20','message','\x22\x0aexport\x20default\x20async\x20function(params,\x20context)\x20{\x0a\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute(','status','SDK\x20client.sql.execute()\x20returns\x20{\x20execSuccess,\x20execResult\x20}\x20—\x20always\x20check\x20execSuccess','includes','size','Frontend\x20SDK','entries','3067545EiNagc','//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27','match','count','{\x0a\x20\x20sqlCode:\x20\x27'];a12_0x20a7=function(){return _0x1a786d;};return a12_0x20a7();}import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode,getEnvironment}from'../config/env.js';export async function generateSqlCode(_0x267c24){const _0x53576f=a12_0x554e,{appCode:appCode=getEnvAppCode(),cookie:_0x3a27a5,sqlCode:_0x2a6c56,params:_0x344cca,includeImports:includeImports=!![],target:target='sdk'}=_0x267c24;if(!appCode)throw new Error(_0x53576f(0xe0));if(!_0x2a6c56||_0x2a6c56[_0x53576f(0xe4)]()==='')return{'success':![],'sqlCode':'','sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[]},'error':_0x53576f(0xc4)};const _0x4c8a86=_0x2a6c56[_0x53576f(0xe4)](),_0x1f0af1=new DevApiClient({'appCode':appCode,'cookie':_0x3a27a5}),_0x37d566=getEnvironment();try{const _0x2e336f=await _0x1f0af1[_0x53576f(0xc8)]({'pageSize':0x3e7,'currentPage':0x1,'sqlCode':_0x4c8a86}),_0x1474a3=_0x2e336f[_0x53576f(0xd7)]?.['tableData']||[],_0x3a37ab=_0x1474a3[_0x53576f(0xd9)](_0x26c548=>_0x26c548['sqlCode']===_0x4c8a86||_0x26c548[_0x53576f(0xd5)]?.[_0x53576f(0xf8)](_0x4c8a86)||_0x4c8a86[_0x53576f(0xf8)](_0x26c548[_0x53576f(0xd5)]));if(!_0x3a37ab)return{'success':![],'sqlCode':_0x4c8a86,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':['SQL\x20code\x20\x22'+_0x4c8a86+'\x22\x20not\x20found\x20in\x20the\x20application.',_0x53576f(0xf2),_0x53576f(0xc2)]},'error':_0x53576f(0xd0)+_0x4c8a86+_0x53576f(0xea)};const _0x303fe1=_0x3a37ab[_0x53576f(0xd5)],_0x4c65db=_0x3a37ab[_0x53576f(0xc5)]||_0x3a37ab[_0x53576f(0xeb)]||'SQL-'+(_0x3a37ab[_0x53576f(0xef)]||_0x3a37ab['id']),_0x57c9e2=_0x3a37ab[_0x53576f(0xd2)]||_0x3a37ab['sql']||'',_0x52014b=_0x57c9e2[_0x53576f(0xfe)](/[:$]\{?(\w+)\}?/g);let _0x2b2dae,_0x49d24b;if(_0x52014b){const _0x30f682=Array[_0x53576f(0x101)](new Set(_0x52014b[_0x53576f(0xe6)](_0x36e2ae=>_0x36e2ae['replace'](/[:${}]/g,''))));_0x2b2dae=_0x30f682[_0x53576f(0xe6)](_0x52a1f0=>{const _0x5e660d=_0x344cca?.[_0x52a1f0]??getDefaultExample(_0x52a1f0);return{'name':_0x52a1f0,'example':_0x5e660d};}),_0x49d24b=_0x2b2dae[_0x53576f(0xbe)]((_0x2e5d3c,_0x416881)=>({..._0x2e5d3c,[_0x416881['name']]:_0x416881[_0x53576f(0xdb)]}),{});}else _0x344cca&&(_0x2b2dae=Object[_0x53576f(0xfb)](_0x344cca)['map'](([_0x346ba4,_0x5e1ace])=>({'name':_0x346ba4,'example':_0x5e1ace})),_0x49d24b=_0x344cca);const _0x2cecd0=_0x2b2dae&&_0x2b2dae[_0x53576f(0x102)]>0x0,_0x618c71=_0x2cecd0?JSON[_0x53576f(0xd4)](_0x49d24b,null,0x2):'',_0x481d66=_0x2cecd0?_0x53576f(0x100)+_0x303fe1+'\x27,\x0a\x20\x20params:\x20'+_0x618c71+_0x53576f(0xde):_0x53576f(0xec)+_0x303fe1+_0x53576f(0xd3);let _0x2bd9a8;target===_0x53576f(0xca)?_0x2bd9a8='//\x20Backend\x20Function:\x20Execute\x20SQL\x20\x22'+_0x4c65db+_0x53576f(0xf5)+_0x481d66+_0x53576f(0xf1):_0x2bd9a8=(includeImports?'import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a':'')+_0x53576f(0xfd)+appCode+_0x53576f(0xee)+_0x37d566+'\x27,\x0a});\x0a\x0a//\x20Execute\x20SQL:\x20'+_0x4c65db+_0x53576f(0xe5)+_0x481d66+_0x53576f(0xdd);const _0x17f3ad=target===_0x53576f(0xca);return{'success':!![],'sqlCode':_0x303fe1,'sqlName':_0x4c65db,'sqlExists':!![],'code':_0x2bd9a8,'parameters':_0x2b2dae,'usage':{'description':_0x53576f(0xdf)+(_0x17f3ad?_0x53576f(0xc9):_0x53576f(0xfa))+_0x53576f(0xc1)+_0x4c65db,'important':[_0x53576f(0xd0)+_0x303fe1+_0x53576f(0xcd),_0x17f3ad?_0x53576f(0xcf):_0x53576f(0xf7),_0x17f3ad?_0x53576f(0xbb):_0x53576f(0xd1),_0x2cecd0?_0x53576f(0xf3)+_0x2b2dae[_0x53576f(0xe6)](_0x1c7cbe=>_0x1c7cbe[_0x53576f(0xeb)])[_0x53576f(0xe1)](',\x20'):_0x53576f(0xf0),_0x53576f(0xc3)]}};}catch(_0x25b41a){return{'success':![],'sqlCode':_0x4c8a86,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':['Failed\x20to\x20verify\x20SQL\x20code:\x20'+_0x25b41a[_0x53576f(0xf4)],_0x53576f(0xf2)]},'error':_0x53576f(0xc6)+_0x25b41a['message']};}}function a12_0x554e(_0x37babe,_0x11c26f){_0x37babe=_0x37babe-0xbb;const _0x20a7b5=a12_0x20a7();let _0x554e72=_0x20a7b5[_0x37babe];return _0x554e72;}function getDefaultExample(_0x5ea515){const _0x403179=a12_0x554e,_0x5cdf5d=_0x5ea515[_0x403179(0xd6)]();if(_0x5cdf5d['includes'](_0x403179(0xe8))||_0x5cdf5d[_0x403179(0xf8)]('time'))return _0x403179(0xc7);if(_0x5cdf5d[_0x403179(0xf8)]('id'))return 0x7b;if(_0x5cdf5d[_0x403179(0xf8)](_0x403179(0xbd))||_0x5cdf5d['includes'](_0x403179(0xff))||_0x5cdf5d[_0x403179(0xf8)](_0x403179(0xf9)))return 0xa;if(_0x5cdf5d[_0x403179(0xf8)](_0x403179(0xbc)))return 0x1;if(_0x5cdf5d['includes'](_0x403179(0xe9))||_0x5cdf5d[_0x403179(0xf8)](_0x403179(0xce))||_0x5cdf5d[_0x403179(0xf8)]('name'))return'example';if(_0x5cdf5d[_0x403179(0xf8)](_0x403179(0xf6)))return 0x1;return _0x403179(0xe3);}
@@ -1 +1 @@
1
- function a13_0x55b4(){const _0x5f37af=['16971138hWcbbf','4VyuCMn','1929795fboJoS','Failed\x20to\x20fetch\x20Backend\x20Function\x20script\x20info\x20for\x20id:\x20','1745024mtzEar','490299SxMajj','2611842onGpIm','getBffScriptInfo','success','7KxlvDt','336459OidSDL','1425852nMlTkM','10Qyzpag','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','data'];a13_0x55b4=function(){return _0x5f37af;};return a13_0x55b4();}(function(_0x58cb75,_0x41fcd0){const _0x62fc8b=a13_0x327b,_0x2fd6f1=_0x58cb75();while(!![]){try{const _0x428c4e=-parseInt(_0x62fc8b(0xaf))/0x1+-parseInt(_0x62fc8b(0xa6))/0x2*(parseInt(_0x62fc8b(0xaa))/0x3)+-parseInt(_0x62fc8b(0xb0))/0x4+-parseInt(_0x62fc8b(0xa7))/0x5+-parseInt(_0x62fc8b(0xab))/0x6*(parseInt(_0x62fc8b(0xae))/0x7)+parseInt(_0x62fc8b(0xa9))/0x8+parseInt(_0x62fc8b(0xb4))/0x9*(parseInt(_0x62fc8b(0xb1))/0xa);if(_0x428c4e===_0x41fcd0)break;else _0x2fd6f1['push'](_0x2fd6f1['shift']());}catch(_0x12a2f4){_0x2fd6f1['push'](_0x2fd6f1['shift']());}}}(a13_0x55b4,0x40264));import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode}from'../config/env.js';function a13_0x327b(_0x27ba90,_0x16af8b){_0x27ba90=_0x27ba90-0xa6;const _0x55b423=a13_0x55b4();let _0x327b2a=_0x55b423[_0x27ba90];return _0x327b2a;}export async function getBffScriptInfo(_0x4488a2){const _0x4232b4=a13_0x327b,{appCode:appCode=getEnvAppCode(),cookie:_0x5eff13,id:_0x32ae36}=_0x4488a2;if(!appCode)throw new Error(_0x4232b4(0xb2));if(!_0x32ae36||_0x32ae36<=0x0)throw new Error('id\x20is\x20required\x20and\x20must\x20be\x20a\x20positive\x20number.\x20Get\x20it\x20from\x20list_bff_scripts.');const _0x3da38a=new DevApiClient({'appCode':appCode,'cookie':_0x5eff13}),_0x53c33d=await _0x3da38a[_0x4232b4(0xac)](_0x32ae36);if(!_0x53c33d[_0x4232b4(0xad)]||!_0x53c33d[_0x4232b4(0xb3)])return{'success':![],'message':_0x4232b4(0xa8)+_0x32ae36};return{'success':!![],'script':_0x53c33d[_0x4232b4(0xb3)]};}
1
+ function a13_0x1157(){const _0x2eb226=['34zNuMLS','34041aigygx','3401226xkufnP','92440WOLRrP','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','4985748lQidKI','3310870lwzXBL','Failed\x20to\x20fetch\x20Backend\x20Function\x20script\x20info\x20for\x20id:\x20','4AihYKH','2043713AwPkUL','getBffScriptInfo','2068233ZGYbEN','16mcxhgL','data','473sJzcDR'];a13_0x1157=function(){return _0x2eb226;};return a13_0x1157();}(function(_0x2ed883,_0xcbdbcf){const _0x208d42=a13_0x300d,_0x20801b=_0x2ed883();while(!![]){try{const _0x34dc60=-parseInt(_0x208d42(0x163))/0x1*(-parseInt(_0x208d42(0x162))/0x2)+-parseInt(_0x208d42(0x15e))/0x3+-parseInt(_0x208d42(0x15b))/0x4*(-parseInt(_0x208d42(0x159))/0x5)+parseInt(_0x208d42(0x164))/0x6+-parseInt(_0x208d42(0x15c))/0x7*(parseInt(_0x208d42(0x15f))/0x8)+-parseInt(_0x208d42(0x158))/0x9+parseInt(_0x208d42(0x165))/0xa*(parseInt(_0x208d42(0x161))/0xb);if(_0x34dc60===_0xcbdbcf)break;else _0x20801b['push'](_0x20801b['shift']());}catch(_0x44c814){_0x20801b['push'](_0x20801b['shift']());}}}(a13_0x1157,0x5c44d));import{DevApiClient}from'../api/dev-api-client.js';function a13_0x300d(_0xadbc77,_0x3ebb7d){_0xadbc77=_0xadbc77-0x157;const _0x115745=a13_0x1157();let _0x300de0=_0x115745[_0xadbc77];return _0x300de0;}import{getEnvAppCode}from'../config/env.js';export async function getBffScriptInfo(_0x5beaf9){const _0x28e6e5=a13_0x300d,{appCode:appCode=getEnvAppCode(),cookie:_0x57c476,id:_0xcbf649}=_0x5beaf9;if(!appCode)throw new Error(_0x28e6e5(0x157));if(!_0xcbf649||_0xcbf649<=0x0)throw new Error('id\x20is\x20required\x20and\x20must\x20be\x20a\x20positive\x20number.\x20Get\x20it\x20from\x20list_bff_scripts.');const _0x5b75ef=new DevApiClient({'appCode':appCode,'cookie':_0x57c476}),_0x26b4d9=await _0x5b75ef[_0x28e6e5(0x15d)](_0xcbf649);if(!_0x26b4d9['success']||!_0x26b4d9[_0x28e6e5(0x160)])return{'success':![],'message':_0x28e6e5(0x15a)+_0xcbf649};return{'success':!![],'script':_0x26b4d9[_0x28e6e5(0x160)]};}