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

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_0x3d5bdb=a0_0x5745;function a0_0x4605(){const _0x4b818f=['6706myMuyW','getStats','now','size','keys','clear','9nTYxSZ','14837352UzzcpG','6FqSjUP','2uVzXFo','1878936WiIymA','242322qtznTO','120810jhUadN','from','10689096IcRKlX','2464aPqbgd','3896142lvoJCT','5uXRxxA','set','floor','get','defaultTTL','cache'];a0_0x4605=function(){return _0x4b818f;};return a0_0x4605();}function a0_0x5745(_0x2c87c7,_0x48e9a3){_0x2c87c7=_0x2c87c7-0x19e;const _0x4605ba=a0_0x4605();let _0x574521=_0x4605ba[_0x2c87c7];return _0x574521;}(function(_0x2a2b8e,_0x5cfa30){const _0x50d914=a0_0x5745,_0x526233=_0x2a2b8e();while(!![]){try{const _0x140287=parseInt(_0x50d914(0x1a7))/0x1*(-parseInt(_0x50d914(0x1a9))/0x2)+parseInt(_0x50d914(0x1a6))/0x3*(-parseInt(_0x50d914(0x1a8))/0x4)+parseInt(_0x50d914(0x1af))/0x5*(-parseInt(_0x50d914(0x1ae))/0x6)+-parseInt(_0x50d914(0x19e))/0x7*(-parseInt(_0x50d914(0x1ad))/0x8)+-parseInt(_0x50d914(0x1a4))/0x9*(parseInt(_0x50d914(0x1aa))/0xa)+parseInt(_0x50d914(0x1ac))/0xb+parseInt(_0x50d914(0x1a5))/0xc;if(_0x140287===_0x5cfa30)break;else _0x526233['push'](_0x526233['shift']());}catch(_0x2f577d){_0x526233['push'](_0x526233['shift']());}}}(a0_0x4605,0xa1232));export class SimpleCache{[a0_0x3d5bdb(0x1b4)]=new Map();['defaultTTL'];constructor(_0x488aac=0x5){const _0x4694d6=a0_0x3d5bdb;this[_0x4694d6(0x1b3)]=_0x488aac*0x3c*0x3e8;}[a0_0x3d5bdb(0x1b2)](_0x1c69bc){const _0x16ecdb=a0_0x3d5bdb,_0x1267a4=this['cache'][_0x16ecdb(0x1b2)](_0x1c69bc);if(!_0x1267a4)return null;const _0x3c1f49=Date[_0x16ecdb(0x1a0)](),_0x18b982=_0x3c1f49-_0x1267a4['timestamp'];if(_0x18b982>this[_0x16ecdb(0x1b3)])return this[_0x16ecdb(0x1b4)]['delete'](_0x1c69bc),null;const _0x50969e=Math[_0x16ecdb(0x1b1)](_0x18b982/0x3e8);return _0x1267a4['data'];}[a0_0x3d5bdb(0x1b0)](_0xe7fafb,_0x44858d){const _0x5230b5=a0_0x3d5bdb;this[_0x5230b5(0x1b4)]['set'](_0xe7fafb,{'data':_0x44858d,'timestamp':Date[_0x5230b5(0x1a0)]()});}[a0_0x3d5bdb(0x1a3)](_0x58621b){const _0x478844=a0_0x3d5bdb;_0x58621b?this[_0x478844(0x1b4)]['delete'](_0x58621b):this[_0x478844(0x1b4)][_0x478844(0x1a3)]();}[a0_0x3d5bdb(0x19f)](){const _0x55ec66=a0_0x3d5bdb;return{'size':this[_0x55ec66(0x1b4)][_0x55ec66(0x1a1)],'ttlMinutes':this[_0x55ec66(0x1b3)]/0xea60,'entries':Array[_0x55ec66(0x1ab)](this['cache'][_0x55ec66(0x1a2)]())};}}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
+ function a1_0x5a0c(){const _0x25b32a=['toolboxBaseUrlOverride','saveBffScriptViaToolbox','toolboxBaseUrl','toDataset','stringify','Unknown\x20error','API\x20request\x20failed:\x20HTTP\x20','fromField','relations','ENDPOINT','ms.\x20The\x20server\x20may\x20be\x20down\x20or\x20unreachable.\x0aURL:\x20','saveCustomSqlViaToolbox','toLowerCase','getDatasetDetail','472671KixRtY','push','runtimeDomain','json','params','getDatasetList','includes','/smartapi/question/er-config','doVersion','resolveToolboxUrl','filter','add','joinType','datasetName','description','datasets','success','1130164qHuyDT','set','request','env','POST','2703189yAOAtc','getCustomSqlList','scriptContent','/smartapi/custom/queryUserCustomSqlList','/api/management/script/cache/clear','datasetCode','No\x20authentication\x20cookie\x20found.\x20Please\x20login\x20first.','find','dbtableConfig','mcp:vibe','getBffScriptInfo','488646qryLYU','Content-Type','Failed\x20to\x20get\x20ER\x20config\x20for\x20dblinkId:\x20','tableData','scriptName','with-relations','length','name','pageSize','forceRefresh','/api/management/library/scripts/info?id=','sqlName','\x0aURL:\x20','dataset-list:','status','get','text','er-configs-all:','apiBaseUrl','/smartapi/custom/updateUserCustomSql','DEFAULT_TIMEOUT','object','API\x20request\x20timeout\x20after\x20','searchDatasets','cookie','Network\x20error:\x20Unable\x20to\x20connect\x20to\x20the\x20server.\x20Please\x20check\x20your\x20network\x20connection\x20or\x20the\x20server\x20may\x20be\x20down.\x0aURL:\x20','getDatasetRelations','/api/custom/executeSql','application/json','postRequest','modelCode','_request','runtimeBaseUrl','15536jeSKur','message','process','/smartapi/dataset/get-dataset-list','sqlCode','/smartapi/custom/saveUserCustomSql','code','meta','toField','getUniqueDbIds','save-bff','/api/management/library/scripts/save','/smartapi/dataset/get-driven-data?','dataset-detail:','updateUserCustomSql','signal','getBffScriptList','apiDomain','test','LOVRABET_ENV','sort','GET','save-sql','online','/api/node-toolbox/sql/save','4487lQdwOq','functionName','warn','7846200YFnKxK','233195IdpqIJ','data','toDatasetName','saveUserCustomSql','tableName','sqlContent','no-relations','scriptType','er-config:','AbortError','84jdawdj','errorMsg','from','dbId','appCode','executeSql','&type=','clearBffScriptCache'];a1_0x5a0c=function(){return _0x25b32a;};return a1_0x5a0c();}const a1_0x197679=a1_0x1bfb;function a1_0x1bfb(_0x4c5a76,_0x256e46){_0x4c5a76=_0x4c5a76-0x82;const _0x5a0cf5=a1_0x5a0c();let _0x1bfbc5=_0x5a0cf5[_0x4c5a76];return _0x1bfbc5;}(function(_0x2f29ce,_0x3ce59d){const _0x6f425a=a1_0x1bfb,_0x5684c4=_0x2f29ce();while(!![]){try{const _0x331def=parseInt(_0x6f425a(0xdb))/0x1+-parseInt(_0x6f425a(0xfc))/0x2+-parseInt(_0x6f425a(0xf1))/0x3+parseInt(_0x6f425a(0xec))/0x4+parseInt(_0x6f425a(0xbb))/0x5*(parseInt(_0x6f425a(0xc5))/0x6)+parseInt(_0x6f425a(0xb7))/0x7*(parseInt(_0x6f425a(0x9e))/0x8)+-parseInt(_0x6f425a(0xba))/0x9;if(_0x331def===_0x3ce59d)break;else _0x5684c4['push'](_0x5684c4['shift']());}catch(_0x577d08){_0x5684c4['push'](_0x5684c4['shift']());}}}(a1_0x5a0c,0x9b392));import{getCookie}from'../auth/cookie-manager.js';import{getEffectiveApiDomain,getEffectiveRuntimeDomain,resolveApiBaseUrl}from'../auth/constants.js';import{apiCache}from'./cache.js';export class DevApiClient{[a1_0x197679(0xc9)];['env'];[a1_0x197679(0x95)];['apiDomain'];[a1_0x197679(0xdd)];['toolboxBaseUrlOverride'];constructor(_0xb1a2d8){const _0x749cdf=a1_0x197679;this[_0x749cdf(0xc9)]=_0xb1a2d8[_0x749cdf(0xc9)],this[_0x749cdf(0xef)]=globalThis[_0x749cdf(0xa0)]?.['env']?.[_0x749cdf(0xb1)]||_0x749cdf(0xb5),this[_0x749cdf(0x95)]=_0xb1a2d8[_0x749cdf(0x95)]||getCookie(),this['apiDomain']=_0xb1a2d8[_0x749cdf(0x8f)]||getEffectiveApiDomain(),this[_0x749cdf(0xdd)]=_0xb1a2d8[_0x749cdf(0x9d)]||getEffectiveRuntimeDomain(),this[_0x749cdf(0xcd)]=_0xb1a2d8[_0x749cdf(0xcf)];if(!this[_0x749cdf(0x95)])throw new Error(_0x749cdf(0xf7));}['resolveToolboxUrl'](_0x2b7903,_0x22bbc5){const _0x2a3de1=a1_0x197679,_0x424666=resolveApiBaseUrl(_0x2b7903),_0x326f85=this['toolboxBaseUrlOverride']&&_0x424666===getEffectiveApiDomain()?this[_0x2a3de1(0xcd)]:_0x424666;try{const _0x3c2707=new URL(_0x326f85);if(_0x3c2707['pathname']!=='/')return _0x326f85;}catch{}return''+_0x326f85+_0x22bbc5;}static ['DEFAULT_TIMEOUT']=0x7530;async['_request'](_0x5e989d,_0x18fc00={},_0x2674c8=DevApiClient[a1_0x197679(0x91)]){const _0x19fb80=a1_0x197679,{method:method=_0x19fb80(0xb3),body:_0x562958,extraHeaders:_0x34641a}=_0x18fc00,_0xe0c085=new AbortController(),_0x61523d=setTimeout(()=>_0xe0c085['abort'](),_0x2674c8),_0xc40650={'Cookie':this['cookie'],'X-Invoke-Source':_0x19fb80(0xfa),..._0x34641a};method===_0x19fb80(0xf0)&&(_0xc40650[_0x19fb80(0xfd)]=_0x19fb80(0x99));try{const _0x475212=await fetch(_0x5e989d,{'method':method,'headers':_0xc40650,..._0x562958!==undefined&&{'body':JSON[_0x19fb80(0xd1)](_0x562958)},'signal':_0xe0c085[_0x19fb80(0xad)]});clearTimeout(_0x61523d);if(!_0x475212['ok']){if(_0x475212[_0x19fb80(0x8b)]===0x191)throw new Error('Authentication\x20failed.\x20Please\x20login\x20again.');let _0x4c773d='';try{_0x4c773d=await _0x475212[_0x19fb80(0x8d)]();}catch{}throw new Error(_0x19fb80(0xd3)+_0x475212[_0x19fb80(0x8b)]+_0x19fb80(0x89)+_0x5e989d+(_0x4c773d?'\x0a'+_0x4c773d:''));}const _0x24d35c=await _0x475212[_0x19fb80(0xde)]();if(_0x24d35c&&typeof _0x24d35c===_0x19fb80(0x92)&&_0x19fb80(0xeb)in _0x24d35c&&!_0x24d35c[_0x19fb80(0xeb)]){const _0x7745c7=_0x24d35c;throw new Error('API\x20error:\x20'+(_0x7745c7[_0x19fb80(0x9f)]||_0x7745c7[_0x19fb80(0xc6)]||_0x19fb80(0xd2)));}return _0x24d35c;}catch(_0x351968){if(_0x351968 instanceof Error&&_0x351968[_0x19fb80(0x84)]===_0x19fb80(0xc4))throw new Error(_0x19fb80(0x93)+_0x2674c8+_0x19fb80(0xd7)+_0x5e989d);if(_0x351968 instanceof TypeError)throw new Error(_0x19fb80(0x96)+_0x5e989d);throw _0x351968;}}async['request'](_0x436783,_0x2926f5){return this['_request'](_0x436783,{'method':'GET'},_0x2926f5);}async[a1_0x197679(0x9a)](_0x3004d3,_0x531558,_0xf99e79,_0x4178de){const _0xe1f291=a1_0x197679;return this[_0xe1f291(0x9c)](_0x3004d3,{'method':_0xe1f291(0xf0),'body':_0x531558,'extraHeaders':_0x4178de},_0xf99e79);}async['getDatasetList'](_0x5b5688){const _0x59749e=a1_0x197679,_0x663804=_0x5b5688?.[_0x59749e(0x86)]||![],_0x2a3536=_0x59749e(0x8a)+this['appCode']+':'+this[_0x59749e(0xef)];if(!_0x663804){const _0x36a354=apiCache[_0x59749e(0x8c)](_0x2a3536);if(_0x36a354)return _0x36a354;}const _0xe978fe=this[_0x59749e(0xaf)]+_0x59749e(0xa1),_0x5074c5=await this[_0x59749e(0x9a)](_0xe978fe,{'appCode':this[_0x59749e(0xc9)]});return apiCache[_0x59749e(0xed)](_0x2a3536,_0x5074c5),_0x5074c5;}async[a1_0x197679(0xda)](_0x3cc108,_0x3b8935=![],_0x57eb9f=![]){const _0x51ac21=a1_0x197679,_0x343d26=_0x51ac21(0xab)+this[_0x51ac21(0xc9)]+':'+this[_0x51ac21(0xef)]+':'+_0x3cc108+':'+(_0x57eb9f?_0x51ac21(0x82):_0x51ac21(0xc1));if(!_0x3b8935){const _0x4e477f=apiCache[_0x51ac21(0x8c)](_0x343d26);if(_0x4e477f)return _0x4e477f;}const _0x1247b2=/^\d+$/[_0x51ac21(0xb0)](_0x3cc108),_0xa6a261=_0x1247b2?'id':_0x51ac21(0xa4),_0xcb738e=this[_0x51ac21(0xaf)]+_0x51ac21(0xaa)+_0xa6a261+'='+_0x3cc108,_0x50bb99=await this['request'](_0xcb738e);if(_0x57eb9f&&_0x50bb99[_0x51ac21(0xbc)]?.[_0x51ac21(0x9b)]){const _0x498a41=_0x50bb99[_0x51ac21(0xbc)][_0x51ac21(0xe3)]==='v2',_0x3eaf44=Array['isArray'](_0x50bb99[_0x51ac21(0xbc)][_0x51ac21(0xd5)]);if(!_0x498a41||!_0x3eaf44)try{const _0x45748e=await this[_0x51ac21(0x97)](_0x50bb99['data'][_0x51ac21(0x9b)],_0x3b8935);_0x50bb99['data'][_0x51ac21(0xd5)]=_0x45748e;}catch(_0x25c613){process['env']['NODE_ENV']!=='test'&&console[_0x51ac21(0xb9)]('[getDatasetDetail]\x20Failed\x20to\x20fetch\x20relations\x20for\x20'+_0x3cc108+':',_0x25c613);}}return apiCache[_0x51ac21(0xed)](_0x343d26,_0x50bb99),_0x50bb99;}async[a1_0x197679(0x94)](_0x3d3f4f){const _0x439df4=a1_0x197679,_0x5ee43c=await this[_0x439df4(0xe0)](),_0x349aca=Array['isArray'](_0x5ee43c[_0x439df4(0xbc)])?_0x5ee43c[_0x439df4(0xbc)]:_0x5ee43c[_0x439df4(0xbc)]?.[_0x439df4(0xff)]||[];if(!_0x5ee43c[_0x439df4(0xeb)])return{'success':!![],'data':{'tableData':[]}};const _0x115b64=_0x349aca[_0x439df4(0xe5)](_0x3f5ae9=>{const _0x19eae9=_0x439df4,_0xcbd57a=_0x3d3f4f[_0x19eae9(0xd9)]();return _0x3f5ae9['name']?.[_0x19eae9(0xd9)]()[_0x19eae9(0xe1)](_0xcbd57a)||_0x3f5ae9[_0x19eae9(0xa4)]?.[_0x19eae9(0xd9)]()[_0x19eae9(0xe1)](_0xcbd57a)||_0x3f5ae9[_0x19eae9(0xf9)]?.[_0x19eae9(0xbf)]?.['toLowerCase']()['includes'](_0xcbd57a)||_0x3f5ae9[_0x19eae9(0xe9)]?.[_0x19eae9(0xd9)]()[_0x19eae9(0xe1)](_0xcbd57a);});return{'success':!![],'data':{'tableData':_0x115b64,'paging':{'totalCount':_0x115b64[_0x439df4(0x83)],'currentPage':0x1,'pageSize':_0x115b64[_0x439df4(0x83)]}}};}async[a1_0x197679(0xf2)](_0x4380cb){const _0x475466=a1_0x197679,_0x229009=_0x4380cb?.['currentPage']||0x1,_0x402c07=_0x4380cb?.[_0x475466(0x85)]||0x3e7,_0x3e59c=this[_0x475466(0xaf)]+_0x475466(0xf4),_0x1022cc={'appCode':this['appCode'],'currentPage':_0x229009,'pageSize':_0x402c07,..._0x4380cb?.[_0x475466(0xa2)]&&{'sqlCode':_0x4380cb[_0x475466(0xa2)]},..._0x4380cb?.[_0x475466(0x88)]&&{'sqlName':_0x4380cb[_0x475466(0x88)]}},_0x5d776b=await this[_0x475466(0x9a)](_0x3e59c,_0x1022cc);return _0x5d776b;}async[a1_0x197679(0xca)](_0x3779c5){const _0x499469=a1_0x197679,_0x1e5cb5=this[_0x499469(0xdd)]+_0x499469(0x98),_0x3e234c={'appCode':this[_0x499469(0xc9)],'sqlCode':_0x3779c5['sqlCode'],..._0x3779c5[_0x499469(0xdf)]&&{'params':_0x3779c5[_0x499469(0xdf)]}};return await this[_0x499469(0x9a)](_0x1e5cb5,_0x3e234c);}async[a1_0x197679(0xbe)](_0x3bf14d){const _0x1e832f=a1_0x197679,_0x513d34=this[_0x1e832f(0xaf)]+_0x1e832f(0xa3),_0x239ca7={'sqlName':_0x3bf14d[_0x1e832f(0x88)],'dbId':_0x3bf14d['dbId'],'sqlContent':_0x3bf14d[_0x1e832f(0xc0)],'appCode':this[_0x1e832f(0xc9)]};return await this['postRequest'](_0x513d34,_0x239ca7);}async[a1_0x197679(0xac)](_0x414c8d){const _0x24f09e=a1_0x197679,_0x4bbde8=this[_0x24f09e(0xaf)]+_0x24f09e(0x90),_0x36ebf5={'id':_0x414c8d['id'],'dbId':_0x414c8d[_0x24f09e(0xc8)],'sqlName':_0x414c8d[_0x24f09e(0x88)],'appCode':this['appCode'],'sqlContent':_0x414c8d[_0x24f09e(0xc0)]};return await this['postRequest'](_0x4bbde8,_0x36ebf5);}async['getErConfig'](_0x7cd587,_0x4903bf=![]){const _0x27fe9c=a1_0x197679,_0x552833=_0x27fe9c(0xc3)+this[_0x27fe9c(0xc9)]+':'+this[_0x27fe9c(0xef)]+':'+_0x7cd587;if(!_0x4903bf){const _0x499dbe=apiCache[_0x27fe9c(0x8c)](_0x552833);if(_0x499dbe)return _0x499dbe;}const _0x530768=this[_0x27fe9c(0xaf)]+_0x27fe9c(0xe2),_0x1769c2=await this[_0x27fe9c(0x9a)](_0x530768,{'dblinkId':_0x7cd587,'appCode':this[_0x27fe9c(0xc9)]});if(!_0x1769c2['success']||!_0x1769c2['data'])throw new Error(_0x27fe9c(0xfe)+_0x7cd587);const _0x5db890={'meta':_0x1769c2['data'][_0x27fe9c(0xa5)],'datasets':_0x1769c2[_0x27fe9c(0xbc)][_0x27fe9c(0xea)]};return apiCache[_0x27fe9c(0xed)](_0x552833,_0x5db890),_0x5db890;}async[a1_0x197679(0xa7)](_0x40014e=![]){const _0x17c9ef=a1_0x197679,_0x5481fe=await this['getDatasetList']({'forceRefresh':_0x40014e}),_0x54dedc=Array['isArray'](_0x5481fe['data'])?_0x5481fe[_0x17c9ef(0xbc)]:_0x5481fe['data']?.[_0x17c9ef(0xff)]||[],_0xaf2fb=new Set();for(const _0x3f7b82 of _0x54dedc){_0x3f7b82[_0x17c9ef(0xf9)]?.[_0x17c9ef(0xc8)]&&_0xaf2fb[_0x17c9ef(0xe6)](_0x3f7b82[_0x17c9ef(0xf9)]['dbId']);}return Array[_0x17c9ef(0xc7)](_0xaf2fb)[_0x17c9ef(0xb2)]((_0x7992f,_0x44f9b8)=>_0x7992f-_0x44f9b8);}async['getAllErConfigs'](_0x44b5f2=![]){const _0x5c994b=a1_0x197679,_0x52e2ac=_0x5c994b(0x8e)+this['appCode']+':'+this[_0x5c994b(0xef)];if(!_0x44b5f2){const _0x5b6618=apiCache[_0x5c994b(0x8c)](_0x52e2ac);if(_0x5b6618)return _0x5b6618;}const _0x1cb1bf=await this[_0x5c994b(0xa7)](_0x44b5f2),_0x3dc83b=new Map();for(const _0x1cefea of _0x1cb1bf){try{const _0x395745=await this['getErConfig'](_0x1cefea,_0x44b5f2);_0x3dc83b[_0x5c994b(0xed)](_0x1cefea,_0x395745);}catch(_0x46d6b3){console[_0x5c994b(0xb9)]('Failed\x20to\x20get\x20ER\x20config\x20for\x20dbId\x20'+_0x1cefea+':',_0x46d6b3);}}return apiCache['set'](_0x52e2ac,_0x3dc83b),_0x3dc83b;}async[a1_0x197679(0x97)](_0xba7d1e,_0x48eddd=![]){const _0x53f91a=a1_0x197679,_0x558c44=await this['getAllErConfigs'](_0x48eddd),_0x288d60=[],_0x2070c8=[];for(const [,_0x2022cf]of _0x558c44){const _0x2f2880=_0x2022cf[_0x53f91a(0xea)][_0x53f91a(0xf8)](_0x141c12=>_0x141c12['datasetCode']===_0xba7d1e);if(_0x2f2880)for(const _0x4a00e3 of _0x2f2880[_0x53f91a(0xd5)]||[]){_0x288d60[_0x53f91a(0xdc)]({'toDataset':_0x4a00e3['toDataset'],'toDatasetName':_0x4a00e3[_0x53f91a(0xbd)],'toField':_0x4a00e3[_0x53f91a(0xa6)],'fromField':_0x4a00e3['fromField'],'joinType':_0x4a00e3[_0x53f91a(0xe7)]});}for(const _0x5266f9 of _0x2022cf[_0x53f91a(0xea)]){if(_0x5266f9['datasetCode']===_0xba7d1e)continue;for(const _0x18d701 of _0x5266f9[_0x53f91a(0xd5)]||[]){_0x18d701[_0x53f91a(0xd0)]===_0xba7d1e&&_0x2070c8[_0x53f91a(0xdc)]({'fromDataset':_0x5266f9[_0x53f91a(0xf6)],'fromDatasetName':_0x5266f9[_0x53f91a(0xe8)],'fromField':_0x18d701[_0x53f91a(0xd4)],'toField':_0x18d701[_0x53f91a(0xa6)],'joinType':_0x18d701['joinType']});}}}return{'outgoing':_0x288d60,'incoming':_0x2070c8};}async[a1_0x197679(0xae)](_0x5d8fff=a1_0x197679(0xd6)){const _0xe81934=a1_0x197679,_0x261fe7=this[_0xe81934(0xaf)]+'/api/management/library/scripts/list?appCode='+encodeURIComponent(this[_0xe81934(0xc9)])+_0xe81934(0xcb)+_0x5d8fff;return await this[_0xe81934(0xee)](_0x261fe7);}async[a1_0x197679(0xfb)](_0x2c3285){const _0x107f71=a1_0x197679,_0x4cbd95=this[_0x107f71(0xaf)]+_0x107f71(0x87)+_0x2c3285;return await this[_0x107f71(0xee)](_0x4cbd95);}async['saveBffScript'](_0x553ae8){const _0x563c6e=a1_0x197679,_0x19b48a=this[_0x563c6e(0xaf)]+_0x563c6e(0xa9),_0x3c954c={'id':_0x553ae8['id']??null,'appCode':_0x553ae8[_0x563c6e(0xc9)],'description':_0x553ae8[_0x563c6e(0xe9)],'scriptContent':_0x553ae8['scriptContent'],'scriptType':_0x553ae8[_0x563c6e(0xc2)]};return await this['postRequest'](_0x19b48a,_0x3c954c);}async[a1_0x197679(0xcc)](){const _0x22de9a=a1_0x197679,_0x6bd537=this[_0x22de9a(0xdd)]+_0x22de9a(0xf5);return await this['postRequest'](_0x6bd537,{});}async[a1_0x197679(0xd8)](_0x3a64cc){const _0x3bf2bf=a1_0x197679,_0xec9a01=this[_0x3bf2bf(0xe4)](_0x3bf2bf(0xb4),_0x3bf2bf(0xb6)),_0x59946f=await this[_0x3bf2bf(0x9a)](_0xec9a01,_0x3a64cc);return _0x59946f[_0x3bf2bf(0xbc)];}async[a1_0x197679(0xce)](_0x45377a){const _0x2719fe=a1_0x197679,_0x2639d4=this[_0x2719fe(0xe4)](_0x2719fe(0xa8),'/api/node-toolbox/bff/save'),_0x4783bd={'appCode':_0x45377a[_0x2719fe(0xc9)],'description':_0x45377a[_0x2719fe(0xe9)],'scriptContent':_0x45377a[_0x2719fe(0xf3)],'id':_0x45377a['id'],'scriptType':_0x45377a['scriptType']};_0x45377a[_0x2719fe(0x100)]!=null&&_0x45377a['scriptName']!==''&&(_0x4783bd[_0x2719fe(0x100)]=_0x45377a[_0x2719fe(0x100)],_0x4783bd[_0x2719fe(0xb8)]=_0x45377a['scriptName']);const _0x2ca14e=await this[_0x2719fe(0x9a)](_0x2639d4,_0x4783bd);return _0x2ca14e['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(_0x34c06c,_0x21f708){var _0x374f82=a2_0x233b,_0x527228=_0x34c06c();while(!![]){try{var _0x2de167=-parseInt(_0x374f82(0xc1))/0x1*(-parseInt(_0x374f82(0xc8))/0x2)+parseInt(_0x374f82(0xbe))/0x3+-parseInt(_0x374f82(0xc0))/0x4*(parseInt(_0x374f82(0xc6))/0x5)+-parseInt(_0x374f82(0xc3))/0x6+-parseInt(_0x374f82(0xbf))/0x7*(-parseInt(_0x374f82(0xc4))/0x8)+parseInt(_0x374f82(0xc7))/0x9*(-parseInt(_0x374f82(0xc2))/0xa)+parseInt(_0x374f82(0xc5))/0xb;if(_0x2de167===_0x21f708)break;else _0x527228['push'](_0x527228['shift']());}catch(_0x15734a){_0x527228['push'](_0x527228['shift']());}}}(a2_0x4106,0x3454c));function a2_0x4106(){var _0x4324df=['113607kyOeDG','3034PcyHZT','1040766UBUBKB','22547jtcXwL','8nqBUrD','39XLmqWK','230eHCoHh','1469706zufvHR','40oceZBM','7860226WPOzoC','967820vjYnWV'];a2_0x4106=function(){return _0x4324df;};return a2_0x4106();}export{getEnvAppCode,getEnvironment,getEnvApiBaseUrl,getEnvRuntimeBaseUrl,getEnvUserBaseUrl,getEnvAuthCookie,configDir,cookieFile,defaultConfig,getEnvAppCodeWithFallback,getApiDomain,getUserDomain,getRuntimeDomain,getEffectiveApiDomain,getEffectiveRuntimeDomain,getEffectiveUserDomain,getEnvToolboxBaseUrl,getEffectiveToolboxDomain}from'../config/env.js';function a2_0x233b(_0x36ac22,_0x25b701){_0x36ac22=_0x36ac22-0xbe;var _0x4106f1=a2_0x4106();var _0x233b28=_0x4106f1[_0x36ac22];return _0x233b28;}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(_0x38524b,_0x550428){const _0x2b5e7b=a3_0x50db,_0x29043b=_0x38524b();while(!![]){try{const _0x473e3b=parseInt(_0x2b5e7b(0x67))/0x1+-parseInt(_0x2b5e7b(0x65))/0x2+parseInt(_0x2b5e7b(0x6b))/0x3+parseInt(_0x2b5e7b(0x64))/0x4+-parseInt(_0x2b5e7b(0x69))/0x5*(-parseInt(_0x2b5e7b(0x68))/0x6)+-parseInt(_0x2b5e7b(0x6c))/0x7+-parseInt(_0x2b5e7b(0x66))/0x8;if(_0x473e3b===_0x550428)break;else _0x29043b['push'](_0x29043b['shift']());}catch(_0x3ec5de){_0x29043b['push'](_0x29043b['shift']());}}}(a3_0x2313,0x9f36b));import{readFileSync,writeFileSync}from'node:fs';import{getEnvAuthCookie,cookieFile}from'../config/env.js';export function getCookie(){const _0x2504b4=getEnvAuthCookie();if(_0x2504b4)return _0x2504b4;try{return readFileSync(cookieFile,'utf-8')['trim']();}catch{return'';}}export function saveCookie(_0x2ee11a){try{writeFileSync(cookieFile,_0x2ee11a,'utf-8');}catch(_0xc597d4){throw new Error('Failed\x20to\x20save\x20cookie\x20to\x20'+cookieFile+':\x20'+_0xc597d4['message']);}}export function hasCookie(){const _0x38b93a=a3_0x50db,_0x18728e=getCookie();return _0x18728e[_0x38b93a(0x6d)]>0x0;}export function clearCookie(){const _0x1ee124=a3_0x50db;try{writeFileSync(cookieFile,'',_0x1ee124(0x6a));}catch{}}function a3_0x50db(_0x445c66,_0x53c888){_0x445c66=_0x445c66-0x64;const _0x2313a8=a3_0x2313();let _0x50db22=_0x2313a8[_0x445c66];return _0x50db22;}function a3_0x2313(){const _0x12e6d9=['1289506sIagDx','6912498oqNaDd','5fCMMhL','utf-8','2730699yTxzsJ','480599lcgCRI','length','3545312CPtgjh','1135872nLekKe','23595344ckcyVR'];a3_0x2313=function(){return _0x12e6d9;};return a3_0x2313();}
@@ -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 a4_0x157b(){const _0x77f2c2=['json','user','41536365FWPIde','67692FRMEAC','276MTcAND','165212beEWBA','490831QGNHlg','1pEcxHl','846tSKvre','2702RwkAth','/api/auth/get-session','85PNnjVR','22280HUnawH','509758YDuALF','20080IEBbzi','21BOnqws'];a4_0x157b=function(){return _0x77f2c2;};return a4_0x157b();}function a4_0x24d6(_0x1e3733,_0x16fc3e){_0x1e3733=_0x1e3733-0x19c;const _0x157b78=a4_0x157b();let _0x24d6ea=_0x157b78[_0x1e3733];return _0x24d6ea;}(function(_0x69000,_0x471c31){const _0x276196=a4_0x24d6,_0x7a2883=_0x69000();while(!![]){try{const _0x83f9e7=parseInt(_0x276196(0x1a6))/0x1*(parseInt(_0x276196(0x19c))/0x2)+parseInt(_0x276196(0x19e))/0x3*(-parseInt(_0x276196(0x1a4))/0x4)+-parseInt(_0x276196(0x1aa))/0x5*(parseInt(_0x276196(0x1a2))/0x6)+-parseInt(_0x276196(0x1a8))/0x7*(parseInt(_0x276196(0x19d))/0x8)+-parseInt(_0x276196(0x1a7))/0x9*(parseInt(_0x276196(0x1ab))/0xa)+-parseInt(_0x276196(0x1a5))/0xb*(parseInt(_0x276196(0x1a3))/0xc)+parseInt(_0x276196(0x1a1))/0xd;if(_0x83f9e7===_0x471c31)break;else _0x7a2883['push'](_0x7a2883['shift']());}catch(_0x3dbd2e){_0x7a2883['push'](_0x7a2883['shift']());}}}(a4_0x157b,0xbaa4e));import{getCookie}from'./cookie-manager.js';import{getUserDomain}from'../config/env.js';export async function isSessionValid(){const _0x443d04=a4_0x24d6,_0x22b97d=getCookie();if(!_0x22b97d)return![];try{const _0x32799c=await fetch(getUserDomain()+_0x443d04(0x1a9),{'headers':{'cookie':_0x22b97d}});if(!_0x32799c['ok'])return![];const _0x537410=await _0x32799c[_0x443d04(0x19f)]();return!!(_0x537410?.['session']&&_0x537410?.[_0x443d04(0x1a0)]);}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 a5_0x1358(){const _0x1b2863=['1728920kjBLXt','18EgXXar','399223tQcrqc','parse','warn','2508832FZvRBU','1850430GWlERZ','6150040CzyGeR','[MCP]\x20LOVRABET_API_URL_OVERRIDES\x20is\x20not\x20valid\x20JSON,\x20ignoring','28SYlEhn','104366TJSFhk','3eCahPq','env','7qphpqQ','LOVRABET_API_URL_OVERRIDES','871875PofTvZ','90MvZHMF','MCP_DEBUG','348klqGFJ'];a5_0x1358=function(){return _0x1b2863;};return a5_0x1358();}(function(_0x5c2529,_0x52c8f1){const _0x2673f9=a5_0x30bc,_0x5b2c92=_0x5c2529();while(!![]){try{const _0x1801e5=-parseInt(_0x2673f9(0x8c))/0x1*(parseInt(_0x2673f9(0x89))/0x2)+-parseInt(_0x2673f9(0x8a))/0x3*(parseInt(_0x2673f9(0x84))/0x4)+parseInt(_0x2673f9(0x85))/0x5*(parseInt(_0x2673f9(0x80))/0x6)+-parseInt(_0x2673f9(0x88))/0x7*(-parseInt(_0x2673f9(0x7f))/0x8)+-parseInt(_0x2673f9(0x7b))/0x9*(parseInt(_0x2673f9(0x7c))/0xa)+-parseInt(_0x2673f9(0x81))/0xb*(-parseInt(_0x2673f9(0x7e))/0xc)+-parseInt(_0x2673f9(0x86))/0xd;if(_0x1801e5===_0x52c8f1)break;else _0x5b2c92['push'](_0x5b2c92['shift']());}catch(_0x5615cd){_0x5b2c92['push'](_0x5b2c92['shift']());}}}(a5_0x1358,0xa866b));import{getEnvToolboxBaseUrl,getEffectiveApiDomain}from'./env.js';import{getConfigApiUrlOverrides}from'./lovrabet-config.js';function a5_0x30bc(_0x5344cd,_0x41d675){_0x5344cd=_0x5344cd-0x7a;const _0x1358a4=a5_0x1358();let _0x30bc14=_0x1358a4[_0x5344cd];return _0x30bc14;}let _envOverridesCache=null;function getEnvApiUrlOverrides(){const _0x1f9d1e=a5_0x30bc;if(_envOverridesCache!==null)return _envOverridesCache;const _0x5da2dc=process['env'][_0x1f9d1e(0x7a)];if(!_0x5da2dc)return _envOverridesCache={},_envOverridesCache;try{_envOverridesCache=JSON[_0x1f9d1e(0x82)](_0x5da2dc);}catch{process[_0x1f9d1e(0x8b)][_0x1f9d1e(0x7d)]&&console[_0x1f9d1e(0x83)](_0x1f9d1e(0x87)),_envOverridesCache={};}return _envOverridesCache;}export function resolveApiBaseUrl(_0x4068a6){const _0x833a9d=getEnvApiUrlOverrides();if(_0x833a9d[_0x4068a6])return _0x833a9d[_0x4068a6];const _0x4e006d=getConfigApiUrlOverrides();if(_0x4e006d[_0x4068a6])return _0x4e006d[_0x4068a6];return getEnvToolboxBaseUrl()??getEffectiveApiDomain();}export function clearApiUrlOverridesCache(){_envOverridesCache=null;}
@@ -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_0x2c0c70=a6_0x1c4d;(function(_0x7809e3,_0x4e9a09){const _0x44079e=a6_0x1c4d,_0x18b1db=_0x7809e3();while(!![]){try{const _0x4d7dc6=-parseInt(_0x44079e(0x10a))/0x1+-parseInt(_0x44079e(0x107))/0x2+parseInt(_0x44079e(0x120))/0x3+parseInt(_0x44079e(0x104))/0x4+parseInt(_0x44079e(0x110))/0x5*(parseInt(_0x44079e(0x10b))/0x6)+-parseInt(_0x44079e(0x102))/0x7+-parseInt(_0x44079e(0x11e))/0x8*(-parseInt(_0x44079e(0x113))/0x9);if(_0x4d7dc6===_0x4e9a09)break;else _0x18b1db['push'](_0x18b1db['shift']());}catch(_0x506404){_0x18b1db['push'](_0x18b1db['shift']());}}}(a6_0x165f,0x7eb49));import{mkdirSync}from'node:fs';function a6_0x1c4d(_0x5ad200,_0x198b34){_0x5ad200=_0x5ad200-0x101;const _0x165fc2=a6_0x165f();let _0x1c4d4a=_0x165fc2[_0x5ad200];return _0x1c4d4a;}import{homedir}from'node:os';const ENVIRONMENT_MAPPING={'online':'production','production':a6_0x2c0c70(0x11c),'daily':a6_0x2c0c70(0x11a),'dev':'development','development':a6_0x2c0c70(0x121)};function normalizeEnvironment(_0x50c913){const _0x83d8df=a6_0x2c0c70;if(!_0x50c913)return _0x83d8df(0x11c);const _0x47ece3=_0x50c913[_0x83d8df(0x114)](),_0x23e8cf=ENVIRONMENT_MAPPING[_0x47ece3];if(!_0x23e8cf)return console[_0x83d8df(0x10d)](_0x83d8df(0x115)+_0x50c913+_0x83d8df(0x109)),_0x83d8df(0x11c);return _0x23e8cf!==_0x47ece3&&_0x23e8cf!==_0x50c913&&console['log'](_0x83d8df(0x11f)+_0x50c913+'\x20→\x20'+_0x23e8cf),_0x23e8cf;}export function getEnvAppCode(){const _0x2dad4d=a6_0x2c0c70;return process[_0x2dad4d(0x10f)][_0x2dad4d(0x101)];}export function getEnvironment(){const _0x5c7dd7=a6_0x2c0c70,_0x161926=process[_0x5c7dd7(0x10f)][_0x5c7dd7(0x112)];return normalizeEnvironment(_0x161926);}export function getEnvApiBaseUrl(){const _0x14ed4e=a6_0x2c0c70;return process[_0x14ed4e(0x10f)][_0x14ed4e(0x105)];}export function getEnvRuntimeBaseUrl(){const _0x3401ef=a6_0x2c0c70;return process[_0x3401ef(0x10f)][_0x3401ef(0x11d)];}export function getEnvUserBaseUrl(){const _0x27057c=a6_0x2c0c70;return process[_0x27057c(0x10f)][_0x27057c(0x111)];}export function getEnvAuthCookie(){const _0x3067d6=a6_0x2c0c70;return process['env']['LOVRABET_AUTH_COOKIE']?.[_0x3067d6(0x119)]();}export function isTestEnv(){const _0x17d918=a6_0x2c0c70;return process['env'][_0x17d918(0x116)]==='test';}export function isProductionEnv(){const _0x27d120=a6_0x2c0c70;return process[_0x27d120(0x10f)]['NODE_ENV']===_0x27d120(0x11c);}export function isDevelopmentEnv(){const _0x505433=a6_0x2c0c70;return process[_0x505433(0x10f)][_0x505433(0x116)]===_0x505433(0x121);}export function shouldLog(){const _0x2cd5e8=a6_0x2c0c70,_0x298d0e=process[_0x2cd5e8(0x10f)]['NODE_ENV'];return _0x298d0e==='development'||_0x298d0e===_0x2cd5e8(0x11a);}export const configDir=homedir()+a6_0x2c0c70(0x117);export const cookieFile=configDir+a6_0x2c0c70(0x103);mkdirSync(configDir,{'recursive':!![]});export const defaultConfig={'appCode':getEnvAppCode(),'env':getEnvironment()};export function getEnvAppCodeWithFallback(_0x4e598f){return getEnvAppCode()||_0x4e598f;}export function getApiDomain(){const _0x1c5998=a6_0x2c0c70,_0x3a0250=getEnvironment(),_0x22aca7={'production':'https://api.lovrabet.com','online':_0x1c5998(0x106),'daily':_0x1c5998(0x118),'development':_0x1c5998(0x10e)};return _0x22aca7[_0x3a0250];}export function getUserDomain(){const _0x4ffee3=a6_0x2c0c70,_0x92bfdf=getEnvironment(),_0x2600f6={'production':_0x4ffee3(0x108),'online':_0x4ffee3(0x108),'daily':_0x4ffee3(0x10c),'development':'https://dev.lovrabet.com'};return _0x2600f6[_0x92bfdf];}export function getRuntimeDomain(){const _0x3fc0bf=a6_0x2c0c70,_0x45aa89=getEnvironment(),_0x5c0a7f={'production':'https://runtime.lovrabet.com','online':_0x3fc0bf(0x11b),'daily':'https://daily-runtime.lovrabet.com','development':_0x3fc0bf(0x10e)};return _0x5c0a7f[_0x45aa89];}export function getEffectiveApiDomain(){return getEnvApiBaseUrl()||getApiDomain();}export function getEffectiveRuntimeDomain(){return getEnvRuntimeBaseUrl()||getRuntimeDomain();}export function getEffectiveUserDomain(){return getEnvUserBaseUrl()||getUserDomain();}export function getEnvToolboxBaseUrl(){const _0xf8d477=a6_0x2c0c70;return process[_0xf8d477(0x10f)]['LOVRABET_TOOLBOX_BASEURL'];}export function getEffectiveToolboxDomain(){return getEnvToolboxBaseUrl()||getEffectiveApiDomain();}function a6_0x165f(){const _0x206099=['warn','https://dev.lovrabet.com','env','9155sJSMqT','LOVRABET_USER_BASEURL','LOVRABET_ENV','553572PBvxbm','toLowerCase','[ENV]\x20Unknown\x20environment:\x20','NODE_ENV','/.lovrabet','https://daily-api.lovrabet.com','trim','daily','https://runtime.lovrabet.com','production','LOVRABET_RUNTIME_BASEURL','152jozfif','[ENV]\x20Environment\x20mapping:\x20','2709306EkWGjs','development','LOVRABET_APP_CODE','4617592vOFSja','/cookie','1136036HoRpoT','LOVRABET_API_BASEURL','https://api.lovrabet.com','886240Zpisjt','https://user.lovrabet.com',',\x20using\x20default\x20production','933581HVeaHH','654IPaZpY','https://user-daily.lovrabet.com'];a6_0x165f=function(){return _0x206099;};return a6_0x165f();}
@@ -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(_0x4927f4,_0x2d13f9){const _0x147c20=a7_0x3818,_0x31bbd6=_0x4927f4();while(!![]){try{const _0x48f2c5=parseInt(_0x147c20(0x178))/0x1+-parseInt(_0x147c20(0x17d))/0x2+-parseInt(_0x147c20(0x186))/0x3+parseInt(_0x147c20(0x184))/0x4+-parseInt(_0x147c20(0x17e))/0x5*(parseInt(_0x147c20(0x179))/0x6)+parseInt(_0x147c20(0x17c))/0x7*(-parseInt(_0x147c20(0x180))/0x8)+parseInt(_0x147c20(0x183))/0x9;if(_0x48f2c5===_0x2d13f9)break;else _0x31bbd6['push'](_0x31bbd6['shift']());}catch(_0x2810ca){_0x31bbd6['push'](_0x31bbd6['shift']());}}}(a7_0x5113,0x95f31));import{existsSync,readFileSync}from'node:fs';import{configDir}from'./env.js';let _cache=null;function readConfigFile(){const _0x56356c=a7_0x3818;if(_cache!==null)return _cache;const _0x537ad4=configDir+_0x56356c(0x181);if(!existsSync(_0x537ad4))return _cache={},_cache;try{_cache=JSON[_0x56356c(0x182)](readFileSync(_0x537ad4,_0x56356c(0x185)));}catch{process[_0x56356c(0x187)][_0x56356c(0x17a)]&&console[_0x56356c(0x17b)]('[MCP]\x20Failed\x20to\x20parse\x20'+_0x537ad4+',\x20using\x20empty\x20config'),_cache={};}return _cache;}export function getConfigApiUrlOverrides(){const _0x2a9aa5=a7_0x3818;return readConfigFile()[_0x2a9aa5(0x17f)]??{};}function a7_0x3818(_0x40cdfd,_0x13d88b){_0x40cdfd=_0x40cdfd-0x178;const _0x51131f=a7_0x5113();let _0x3818e7=_0x51131f[_0x40cdfd];return _0x3818e7;}export function clearConfigCache(){_cache=null;}function a7_0x5113(){const _0x71b25=['4504896TpVPjb','utf-8','582411luBFdK','env','884633bwhKRC','6jbXhxB','MCP_DEBUG','warn','82677MCaPSr','1049156BOpxHY','1435345MWkAAq','apiUrlOverrides','672vbQEkO','/config.json','parse','5411196JYCgQy'];a7_0x5113=function(){return _0x71b25;};return a7_0x5113();}
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
+ const a8_0x20e815=a8_0x4dc5;(function(_0x56dccc,_0x343723){const _0x418727=a8_0x4dc5,_0x25b02a=_0x56dccc();while(!![]){try{const _0xfb03fa=-parseInt(_0x418727(0xfd))/0x1*(-parseInt(_0x418727(0xfa))/0x2)+parseInt(_0x418727(0xe5))/0x3*(parseInt(_0x418727(0xf8))/0x4)+parseInt(_0x418727(0xed))/0x5*(-parseInt(_0x418727(0xee))/0x6)+-parseInt(_0x418727(0xea))/0x7+parseInt(_0x418727(0xe2))/0x8*(-parseInt(_0x418727(0xf7))/0x9)+parseInt(_0x418727(0xeb))/0xa*(parseInt(_0x418727(0xf3))/0xb)+-parseInt(_0x418727(0xe1))/0xc*(-parseInt(_0x418727(0xf6))/0xd);if(_0xfb03fa===_0x343723)break;else _0x25b02a['push'](_0x25b02a['shift']());}catch(_0x134f30){_0x25b02a['push'](_0x25b02a['shift']());}}}(a8_0x39a5,0x7c8c5));function a8_0x4dc5(_0xaf5fa9,_0x526dc9){_0xaf5fa9=_0xaf5fa9-0xe1;const _0x39a5ed=a8_0x39a5();let _0x4dc58e=_0x39a5ed[_0xaf5fa9];return _0x4dc58e;}import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{createServer}from'./server.js';function parseArgs(){const _0x30aaa4=a8_0x4dc5,_0x546961=process[_0x30aaa4(0xe3)][_0x30aaa4(0xe8)](0x2),_0x120686=_0x546961['includes']('--enable-bff-save')||_0x546961[_0x30aaa4(0xe6)]('--dangerously-bff-save');return process[_0x30aaa4(0xf4)][_0x30aaa4(0xf1)]&&_0x546961[_0x30aaa4(0xe6)]('--dangerously-bff-save')&&!_0x546961[_0x30aaa4(0xe6)](_0x30aaa4(0xfe))&&console[_0x30aaa4(0xf9)](_0x30aaa4(0xe7)),{'bffSaveEnabled':_0x120686};}function a8_0x39a5(){const _0x2cc8bd=['SIGINT','40TDZyDI','622914GwRgXS','error','Failed\x20to\x20start\x20Lovrabet\x20Dataset\x20MCP\x20Server:','MCP_DEBUG','catch','9163bRbfkH','env','exit','91afdbSa','22365elZRFd','457076UGcgBM','warn','206azEjTi','logInfo','Shutting\x20down\x20Lovrabet\x20Dataset\x20MCP\x20Server...','5779sAyacb','--enable-bff-save','log','707364nRZMBx','1144yxGMEC','argv','connect','15kFQUPt','includes','[MCP]\x20--dangerously-bff-save\x20is\x20deprecated;\x20use\x20--enable-bff-save\x20(same\x20behavior)','slice','SIGTERM','1841021DWrxEO','4560TMakcJ'];a8_0x39a5=function(){return _0x2cc8bd;};return a8_0x39a5();}async function main(){const _0x3f1a3b=a8_0x4dc5;try{const {bffSaveEnabled:_0x2cfebb}=parseArgs(),_0x332d0=createServer({'bffSaveEnabled':_0x2cfebb}),_0x36834d=new StdioServerTransport();_0x332d0[_0x3f1a3b(0xfb)](),await _0x332d0[_0x3f1a3b(0xe4)](_0x36834d),process['on'](_0x3f1a3b(0xec),async()=>{const _0x18a1d2=_0x3f1a3b;process[_0x18a1d2(0xf4)][_0x18a1d2(0xf1)]&&console[_0x18a1d2(0xff)]('Shutting\x20down\x20Lovrabet\x20Dataset\x20MCP\x20Server...'),process['exit'](0x0);}),process['on'](_0x3f1a3b(0xe9),async()=>{const _0x5a7d7c=_0x3f1a3b;process[_0x5a7d7c(0xf4)]['MCP_DEBUG']&&console[_0x5a7d7c(0xff)](_0x5a7d7c(0xfc)),process[_0x5a7d7c(0xf5)](0x0);});}catch(_0x3ee34f){console[_0x3f1a3b(0xef)](_0x3f1a3b(0xf0),_0x3ee34f),process[_0x3f1a3b(0xf5)](0x1);}}main()[a8_0x20e815(0xf2)](_0x1222f2=>{const _0x13af92=a8_0x20e815;console[_0x13af92(0xef)]('Unhandled\x20error:',_0x1222f2),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
+ const a9_0xcec854=a9_0x5e5f;(function(_0x288fcc,_0x3ee6b3){const _0x53cd9d=a9_0x5e5f,_0xd435ea=_0x288fcc();while(!![]){try{const _0x139b4c=-parseInt(_0x53cd9d(0xbd))/0x1+parseInt(_0x53cd9d(0xf1))/0x2*(parseInt(_0x53cd9d(0xf3))/0x3)+-parseInt(_0x53cd9d(0xf6))/0x4*(parseInt(_0x53cd9d(0xfe))/0x5)+-parseInt(_0x53cd9d(0x9f))/0x6+parseInt(_0x53cd9d(0xbf))/0x7+-parseInt(_0x53cd9d(0xea))/0x8+parseInt(_0x53cd9d(0x92))/0x9*(parseInt(_0x53cd9d(0xcd))/0xa);if(_0x139b4c===_0x3ee6b3)break;else _0xd435ea['push'](_0xd435ea['shift']());}catch(_0x4450a3){_0xd435ea['push'](_0xd435ea['shift']());}}}(a9_0x3878,0x7f3f6));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';function a9_0x5e5f(_0x1fd335,_0x1e7542){_0x1fd335=_0x1fd335-0x8e;const _0x387806=a9_0x3878();let _0x5e5f3a=_0x387806[_0x1fd335];return _0x5e5f3a;}const require=createRequire(import.meta.url),packageJson=require(a9_0xcec854(0x96)),authSchema={'appCode':z['string']()['optional']()['describe'](a9_0xcec854(0xc6)),'cookie':z['string']()['optional']()['describe'](a9_0xcec854(0xc3))};function registerToolWithOptions(_0x2df1a4,_0x406dd0,_0x252a47,_0x26e7ea){const _0x153b3c=a9_0xcec854;_0x2df1a4[_0x153b3c(0xf8)](_0x406dd0,_0x252a47,_0x26e7ea);}function a9_0x3878(){const _0x37f65e=['text','Include\x20bidirectional\x20relations,\x20summary,\x20and\x20usage\x20hints\x20(default:\x20true)','ENDPOINT','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.','close','list_sql_queries','generate_sdk_code','Execute\x20Custom\x20SQL','Server-side\x20fuzzy\x20match\x20by\x20sqlName','\x0a-\x20Use\x20list_bff_scripts\x20to\x20browse\x20scripts:\x20type=ENDPOINT\x20(default)\x20for\x20business\x20endpoints,\x20type=COMMON\x20for\x20shared\x20utility\x20functions\x0a-\x20Use\x20get_bff_script_info\x20to\x20read\x20full\x20source\x20code\x20of\x20a\x20specific\x20script\x0a-\x20save_or_update_bff_script\x20saves\x20script\x20via\x20toolbox\x20(server-side\x20submitter\x20check\x20+\x20automatic\x20cache\x20clearing)\x0a-\x20After\x20a\x20successful\x20save,\x20also\x20write\x20a\x20local\x20copy:\x20ENDPOINT\x20→\x20src/backend-function/endpoint/endpoint_<name>.js,\x20HOOK\x20→\x20src/backend-function/<tableName>/<tableName>_<hookName>.js\x0a-\x20If\x20save\x20returns\x20blocked:\x20true,\x20tell\x20the\x20user\x20to\x20operate\x20manually\x20on\x20the\x20platform,\x20do\x20NOT\x20retry','options','number','Dataset\x20ID\x20(numeric)\x20or\x20code\x20(UUID)','Backend\x20Function\x20write\x20tools\x20enabled\x20(--enable-bff-save)','SQL\x20parameters','env','Generate\x20SDK\x20Code','version','Database\x20ID\x20(optional)','Search\x20Datasets','message','7346608ydQZKi','record','SQL\x20code\x20from\x20list_sql_queries\x20->\x20sqlCode','logInfo','describe','execute_custom_sql','Include\x20table\x20relations\x20(default:\x20true)','22244mkzcGT','array','129EltVFW','login','Generate\x20SQL\x20Code','4RuMWXX','get_dataset_detail','registerTool','Page\x20number\x20(default:\x201)','Include\x20import\x20statements\x20(default:\x20true)','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,\x20do\x20NOT\x20retry;\x20after\x20a\x20successful\x20save\x20also\x20write\x20a\x20local\x20copy\x20to\x20src/custom_sql/<sqlName>.sql\x0a-\x20generate_sql_code\x20supports\x20target=\x27sdk\x27\x20(default)\x20or\x20target=\x27bff\x27\x20for\x20context-appropriate\x20code','validate_sql_content','Conflict\x20detection\x20is\x20handled\x20server-side\x20by\x20toolbox','3164220mSvfek','Server\x20started\x20successfully','mcpServer','List\x20Backend\x20Functions','boolean','9810261HfgzXC','Client-side\x20filter\x20by\x20name/description/content','List\x20Datasets','server','../package.json','Dataset\x20code/ID','List\x20all\x20available\x20custom\x20SQL\x20queries\x20with\x20metadata\x20and\x20parameters.','Lovrabet\x20Dataset\x20MCP\x20Server','sdk','SQL\x20ID\x20(kept\x20for\x20backward\x20compatibility,\x20not\x20used\x20by\x20toolbox)','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode.\x20Get\x20sqlCode\x20from\x20list_sql_queries\x20first.','Get\x20detailed\x20Backend\x20Function\x20script\x20including\x20full\x20source\x20code.','Known\x20sqlCode\x20—\x20use\x20to\x20directly\x20target\x20the\x20record\x20for\x20update,\x20skipping\x20name\x20lookup','638082YCxdOw','Get\x20list\x20of\x20all\x20API\x20operations\x20for\x20a\x20dataset.\x20Prefer\x20\x22filter\x22\x20for\x20queries,\x20\x22getOne\x22\x20for\x20single\x20record\x20by\x20ID.','Full\x20JavaScript/TypeScript\x20source\x20code.\x20Any\x20length\x20is\x20supported.','Unknown\x20error\x20occurred','optional','Login\x20to\x20Lovrabet\x20to\x20authenticate\x20for\x20dataset\x20queries.','lovrabet-dataset-mcp','Login','enum','generate_sql_code','SQL\x20code\x20from\x20list_sql_queries\x20(must\x20exist)','Validate\x20SQL\x20content\x20without\x20saving.\x20Detects\x20SQL\x20type\x20(SELECT/INSERT/UPDATE/DELETE/DDL)\x20and\x20validates\x20table/column\x20existence.\x20Supports\x20MyBatis\x20syntax.','registerAllTools','min','get_operation_detail','union','Example\x20parameter\x20values','Dataset\x20codes\x20to\x20validate\x20against','Get\x20Dataset\x20Detail','Get\x20Backend\x20Function\x20Info','log','Get\x20detailed\x20operation\x20information\x20including\x20request/response\x20examples.','Script\x20type:\x20ENDPOINT\x20(business\x20API\x20endpoints,\x20default)\x20or\x20COMMON\x20(shared\x20utility\x20functions)','List\x20Backend\x20Function\x20scripts.\x20Use\x20type=ENDPOINT\x20(default)\x20for\x20business\x20API\x20endpoints,\x20type=COMMON\x20for\x20shared/public\x20utility\x20functions\x20that\x20can\x20be\x20imported\x20by\x20other\x20scripts.','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).','Items\x20per\x20page\x20(default:\x20999)','list_datasets','Validate\x20SQL\x20Content','Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update)','Save\x20or\x20Update\x20Custom\x20SQL','545510iCxgrI','Save\x20or\x20update\x20a\x20Backend\x20Function\x20script\x20via\x20toolbox\x20(server-side\x20submitter\x20check\x20+\x20automatic\x20cache\x20clearing).\x20On\x20success,\x20also\x20write\x20a\x20local\x20copy:\x20ENDPOINT\x20→\x20src/backend-function/endpoint/endpoint_<name>.js,\x20HOOK\x20→\x20src/backend-function/<tableName>/<tableName>_<hookName>.js,\x20COMMON\x20→\x20src/backend-function/common/common_<name>.js.\x20If\x20blocked=true\x20(last\x20submitter\x20conflict),\x20do\x20NOT\x20retry.\x20Pass\x20scriptContent\x20as\x20a\x20plain\x20string\x20with\x20the\x20complete\x20source\x20code\x20—\x20any\x20length\x20is\x20supported.\x20For\x20COMMON\x20scripts,\x20set\x20scriptType\x20to\x20\x22COMMON\x22.','461503blYiHI','get_bff_script_info','COMMON','Use\x20camelCase\x20alias\x20instead\x20of\x20dataset_[code]\x20pattern\x20(default:\x20false)','Authentication\x20cookie\x20(optional,\x20uses\x20stored\x20cookie\x20from\x20login\x20if\x20not\x20provided)','Search\x20keyword','stringify','Application\x20code\x20(optional\x20if\x20LOVRABET_APP_CODE\x20env\x20var\x20is\x20set)','Backend\x20Function\x20ID\x20(from\x20list_bff_scripts)','get_dataset_operations','search_datasets','Environment\x20(optional,\x20uses\x20LOVRABET_ENV\x20or\x20defaults\x20to\x20online)','string','bffSaveEnabled','20LoNNvF','Exported\x20default\x20function\x20name\x20(e.g.\x20\x22getCompanyList\x22).\x20Parse\x20from\x20scriptContent\x20by\x20matching\x20`export\x20default\x20[async]\x20function\x20<name>`.\x20Required\x20by\x20toolbox\x20—\x20if\x20omitted,\x20toolbox\x20will\x20reject\x20the\x20request.','Search\x20datasets\x20by\x20keyword\x20(searches\x20in\x20name,\x20table\x20name,\x20code,\x20and\x20description).','save_or_update_bff_script','connect','SQL\x20content\x20to\x20validate','bff','MCP_DEBUG'];a9_0x3878=function(){return _0x37f65e;};return a9_0x3878();}function wrapHandler(_0x177cbc){return async _0x5bb6a5=>{const _0x11c094=a9_0x5e5f;try{const _0x2d57b3=await _0x177cbc(_0x5bb6a5);return{'content':[{'type':_0x11c094(0xd5),'text':JSON[_0x11c094(0xc5)](_0x2d57b3,null,0x2)}]};}catch(_0x4bcd3d){return{'content':[{'type':'text','text':JSON['stringify']({'error':!![],'message':_0x4bcd3d[_0x11c094(0xe9)]||_0x11c094(0xa2)},null,0x2)}],'isError':!![]};}};}export class LovrabetDatasetMCPServer{['mcpServer'];['options'];constructor(_0x114e39={}){const _0x17939b=a9_0xcec854;this[_0x17939b(0xdf)]=_0x114e39,this['mcpServer']=new McpServer({'name':_0x17939b(0xa5),'version':packageJson[_0x17939b(0xe6)]},{'capabilities':{'tools':{}},'instructions':buildInstructions(_0x114e39)}),this[_0x17939b(0xab)]();}['registerAllTools'](){const _0x38da10=a9_0xcec854;registerToolWithOptions(this['mcpServer'],_0x38da10(0xf4),{'title':_0x38da10(0xa6),'description':_0x38da10(0xa4),'inputSchema':{'env':z['enum'](['online','daily'])['optional']()[_0x38da10(0xee)](_0x38da10(0xca))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(login)),registerToolWithOptions(this[_0x38da10(0x8f)],_0x38da10(0xb9),{'title':_0x38da10(0x94),'description':'Get\x20list\x20of\x20all\x20datasets\x20with\x20metadata\x20and\x20table\x20relations\x20(ER\x20Config).\x20Use\x20includeRelations:\x20false\x20for\x20faster\x20response.','inputSchema':{...authSchema,'forceRefresh':z[_0x38da10(0x91)]()['optional']()[_0x38da10(0xee)]('Bypass\x20cache\x20(default:\x20false)'),'includeRelations':z[_0x38da10(0x91)]()['optional']()[_0x38da10(0xee)](_0x38da10(0xf0))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listDatasets)),registerToolWithOptions(this['mcpServer'],_0x38da10(0xc9),{'title':_0x38da10(0xe8),'description':_0x38da10(0xcf),'inputSchema':{...authSchema,'keyword':z[_0x38da10(0xcb)]()[_0x38da10(0xee)](_0x38da10(0xc4))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(searchDatasets)),registerToolWithOptions(this[_0x38da10(0x8f)],_0x38da10(0xf7),{'title':_0x38da10(0xb1),'description':_0x38da10(0xb7),'inputSchema':{...authSchema,'datasetCode':z['string']()[_0x38da10(0xee)](_0x38da10(0xe1)),'forceRefresh':z[_0x38da10(0x91)]()['optional']()['describe']('Bypass\x20cache\x20(default:\x20false)'),'includeRelations':z['boolean']()[_0x38da10(0xa3)]()[_0x38da10(0xee)](_0x38da10(0xd6))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetDetail)),registerToolWithOptions(this[_0x38da10(0x8f)],_0x38da10(0xc8),{'title':'Get\x20Operations','description':_0x38da10(0xa0),'inputSchema':{...authSchema,'datasetCode':z[_0x38da10(0xcb)]()[_0x38da10(0xee)](_0x38da10(0xe1))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetOperations)),registerToolWithOptions(this[_0x38da10(0x8f)],_0x38da10(0xad),{'title':'Get\x20Operation\x20Detail','description':_0x38da10(0xb4),'inputSchema':{...authSchema,'datasetCode':z[_0x38da10(0xcb)]()[_0x38da10(0xee)](_0x38da10(0x97)),'operationName':z['string']()['describe']('Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getOperationDetail)),registerToolWithOptions(this[_0x38da10(0x8f)],_0x38da10(0xdb),{'title':_0x38da10(0xe5),'description':'Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation,\x20including\x20field\x20metadata.\x20Check\x20user\x27s\x20@lovrabet/sdk\x20version\x20in\x20package.json\x20first.','inputSchema':{...authSchema,'datasetCode':z[_0x38da10(0xcb)]()[_0x38da10(0xee)]('Dataset\x20code/ID'),'operationName':z[_0x38da10(0xcb)]()['describe'](_0x38da10(0xbb)),'includeImports':z['boolean']()[_0x38da10(0xa3)]()[_0x38da10(0xee)]('Include\x20import\x20statements\x20(default:\x20true)'),'useAlias':z[_0x38da10(0x91)]()[_0x38da10(0xa3)]()[_0x38da10(0xee)](_0x38da10(0xc2))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSDKCode)),registerToolWithOptions(this[_0x38da10(0x8f)],_0x38da10(0xda),{'title':'List\x20SQL\x20Queries','description':_0x38da10(0x98),'inputSchema':{...authSchema,'keyword':z['string']()['optional']()[_0x38da10(0xee)](_0x38da10(0x93)),'category':z['string']()[_0x38da10(0xa3)]()[_0x38da10(0xee)]('Client-side\x20filter\x20by\x20category'),'sqlCode':z['string']()[_0x38da10(0xa3)]()[_0x38da10(0xee)]('Server-side\x20fuzzy\x20match\x20by\x20sqlCode'),'sqlName':z[_0x38da10(0xcb)]()['optional']()[_0x38da10(0xee)](_0x38da10(0xdd)),'pageSize':z[_0x38da10(0xe0)]()[_0x38da10(0xa3)]()['describe'](_0x38da10(0xb8)),'currentPage':z[_0x38da10(0xe0)]()['optional']()[_0x38da10(0xee)](_0x38da10(0xf9))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listSqlQueries)),registerToolWithOptions(this[_0x38da10(0x8f)],_0x38da10(0xef),{'title':_0x38da10(0xdc),'description':_0x38da10(0x9c),'inputSchema':{...authSchema,'sqlCode':z['string']()['min'](0x1)[_0x38da10(0xee)](_0x38da10(0xec)),'params':z[_0x38da10(0xeb)](z[_0x38da10(0xae)]([z[_0x38da10(0xcb)](),z[_0x38da10(0xe0)]()]))[_0x38da10(0xa3)]()['describe'](_0x38da10(0xe3))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(executeCustomSql)),registerToolWithOptions(this[_0x38da10(0x8f)],_0x38da10(0xa8),{'title':_0x38da10(0xf5),'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[_0x38da10(0xcb)]()[_0x38da10(0xac)](0x1)[_0x38da10(0xee)](_0x38da10(0xa9)),'params':z[_0x38da10(0xeb)](z[_0x38da10(0xae)]([z['string'](),z[_0x38da10(0xe0)]()]))[_0x38da10(0xa3)]()['describe'](_0x38da10(0xaf)),'includeImports':z[_0x38da10(0x91)]()[_0x38da10(0xa3)]()['describe'](_0x38da10(0xfa)),'target':z['enum']([_0x38da10(0x9a),_0x38da10(0xd3)])[_0x38da10(0xa3)]()['describe'](_0x38da10(0xd8))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSqlCode)),registerToolWithOptions(this[_0x38da10(0x8f)],_0x38da10(0xfc),{'title':_0x38da10(0xba),'description':_0x38da10(0xaa),'inputSchema':{...authSchema,'sqlContent':z[_0x38da10(0xcb)]()[_0x38da10(0xac)](0x1)[_0x38da10(0xee)](_0x38da10(0xd2)),'dbId':z[_0x38da10(0xe0)]()[_0x38da10(0xa3)]()['describe'](_0x38da10(0xe7)),'validateSchemas':z[_0x38da10(0xf2)](z[_0x38da10(0xcb)]())[_0x38da10(0xa3)]()[_0x38da10(0xee)](_0x38da10(0xb0))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(validateSqlContent)),registerToolWithOptions(this[_0x38da10(0x8f)],'save_or_update_custom_sql',{'title':_0x38da10(0xbc),'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\x20—\x20write\x20a\x20local\x20draft\x20file\x20and\x20tell\x20the\x20user\x20to\x20operate\x20manually.\x20If\x20blocked=true\x20(last\x20submitter\x20conflict),\x20do\x20NOT\x20retry.\x20On\x20success,\x20also\x20write\x20a\x20local\x20copy\x20to\x20src/custom_sql/<sqlName>.sql.\x20Supports\x20MyBatis\x20syntax.\x20Get\x20dbId\x20from\x20get_dataset_detail.','inputSchema':{...authSchema,'sqlName':z[_0x38da10(0xcb)]()[_0x38da10(0xa3)]()['describe']('SQL\x20name/label\x20(optional;\x20MCP\x20auto-extracts\x20from\x20@lovrabet.sqlName\x20comment,\x20or\x20toolbox\x20generates\x20fallback)'),'sqlCode':z[_0x38da10(0xcb)]()[_0x38da10(0xa3)]()['describe'](_0x38da10(0x9e)),'dbId':z['number']()['optional']()[_0x38da10(0xee)]('Database\x20ID\x20from\x20get_dataset_detail\x20—\x20required\x20when\x20creating\x20new\x20SQL,\x20optional\x20when\x20updating'),'sqlContent':z['string']()[_0x38da10(0xac)](0x1)[_0x38da10(0xee)]('SQL\x20content\x20(SELECT/INSERT/UPDATE/WITH\x20auto-saved;\x20DELETE/DDL\x20blocked).\x20Supports\x20MyBatis\x20syntax.'),'id':z['number']()['optional']()[_0x38da10(0xee)](_0x38da10(0x9b))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':![]}},wrapHandler(saveOrUpdateCustomSql)),this[_0x38da10(0xdf)]['bffSaveEnabled']&&(registerToolWithOptions(this['mcpServer'],'list_bff_scripts',{'title':_0x38da10(0x90),'description':_0x38da10(0xb6),'inputSchema':{...authSchema,'type':z[_0x38da10(0xa7)]([_0x38da10(0xd7),'COMMON'])[_0x38da10(0xa3)]()[_0x38da10(0xee)](_0x38da10(0xb5))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listBffScripts)),registerToolWithOptions(this[_0x38da10(0x8f)],_0x38da10(0xc0),{'title':_0x38da10(0xb2),'description':_0x38da10(0x9d),'inputSchema':{...authSchema,'id':z[_0x38da10(0xe0)]()[_0x38da10(0xee)](_0x38da10(0xc7))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getBffScriptInfo)),registerToolWithOptions(this[_0x38da10(0x8f)],_0x38da10(0xd0),{'title':'Save\x20or\x20Update\x20Backend\x20Function','description':_0x38da10(0xbe),'inputSchema':{...authSchema,'id':z[_0x38da10(0xe0)]()[_0x38da10(0xa3)]()[_0x38da10(0xee)]('Backend\x20Function\x20ID\x20(for\x20updating).\x20Omit\x20when\x20creating\x20new.'),'description':z[_0x38da10(0xcb)]()[_0x38da10(0xac)](0x1)[_0x38da10(0xee)]('Function\x20description'),'scriptName':z[_0x38da10(0xcb)]()['optional']()[_0x38da10(0xee)](_0x38da10(0xce)),'scriptContent':z['string']()[_0x38da10(0xac)](0x1)[_0x38da10(0xee)](_0x38da10(0xa1)),'scriptType':z[_0x38da10(0xa7)]([_0x38da10(0xd7),_0x38da10(0xc1)])[_0x38da10(0xee)]('Script\x20type\x20(required):\x20ENDPOINT\x20for\x20business\x20API\x20endpoints\x20that\x20frontend\x20calls\x20via\x20client.bff.execute(),\x20COMMON\x20for\x20shared\x20utility\x20functions\x20that\x20other\x20BFF\x20scripts\x20import\x20and\x20reuse.\x20Analyze\x20the\x20script\x20purpose\x20carefully\x20before\x20choosing.')},'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':![]}},wrapHandler(saveOrUpdateBffScript)));}get[a9_0xcec854(0x95)](){const _0x2f2a6e=a9_0xcec854;return this[_0x2f2a6e(0x8f)];}async[a9_0xcec854(0xd1)](_0x303c19){await this['mcpServer']['connect'](_0x303c19);}async['close'](){const _0x4c7541=a9_0xcec854;await this[_0x4c7541(0x8f)][_0x4c7541(0xd9)]();}[a9_0xcec854(0xed)](){const _0x5bcf65=a9_0xcec854;if(!process[_0x5bcf65(0xe4)][_0x5bcf65(0xd4)])return;console[_0x5bcf65(0xb3)](_0x5bcf65(0x99)),console[_0x5bcf65(0xb3)]('Version:\x20'+packageJson[_0x5bcf65(0xe6)]),console[_0x5bcf65(0xb3)](_0x5bcf65(0x8e)),this[_0x5bcf65(0xdf)][_0x5bcf65(0xcc)]&&(console[_0x5bcf65(0xb3)](_0x5bcf65(0xe2)),console['log'](_0x5bcf65(0xfd)));}}function buildInstructions(_0x6eb5b9){const _0x10a34a=a9_0xcec854,_0x5e1a2c=_0x6eb5b9[_0x10a34a(0xcc)]===!![],_0x5078f6=_0x5e1a2c?_0x10a34a(0xde):'';return _0x10a34a(0xfb)+_0x5078f6+'\x0a';}export function createServer(_0x4a3f8c){return new LovrabetDatasetMCPServer(_0x4a3f8c);}
@@ -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_0x3397(){const _0xb68f06=['SQL\x20executed\x20successfully.\x20Returned\x20','trim','ERR','success','now','executeSql','1378143KhgXwu','10373928YlkQGo','keys','10525bmwxqq','SQL\x20execution\x20failed\x20without\x20error\x20message','errorMsg','isArray','execError','UNKNOWN','SQL\x20execution\x20failed\x20[','length','message','execSuccess','4455312CwPudu','API\x20call\x20failed:\x20','Unknown\x20error','102184fStTAT','302HpMQPD',']:\x20','SQL\x20execution\x20failed:\x20','3782NsseKx','execResult','2228gTtdaq','6325260ZmMFOU','errorCode','854heJCRY','data','33iSIWvA'];a10_0x3397=function(){return _0xb68f06;};return a10_0x3397();}(function(_0x3417ab,_0x13e25e){const _0x5c052f=a10_0x4f1d,_0x4463c8=_0x3417ab();while(!![]){try{const _0x3a7a7c=parseInt(_0x5c052f(0x10f))/0x1*(-parseInt(_0x5c052f(0x10c))/0x2)+parseInt(_0x5c052f(0x108))/0x3+-parseInt(_0x5c052f(0x111))/0x4*(parseInt(_0x5c052f(0x120))/0x5)+parseInt(_0x5c052f(0x11e))/0x6+parseInt(_0x5c052f(0x114))/0x7*(parseInt(_0x5c052f(0x10b))/0x8)+-parseInt(_0x5c052f(0x11d))/0x9+parseInt(_0x5c052f(0x112))/0xa*(-parseInt(_0x5c052f(0x116))/0xb);if(_0x3a7a7c===_0x13e25e)break;else _0x4463c8['push'](_0x4463c8['shift']());}catch(_0x20d094){_0x4463c8['push'](_0x4463c8['shift']());}}}(a10_0x3397,0xeecce));import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode}from'../config/env.js';function a10_0x4f1d(_0x50045c,_0x52cd23){_0x50045c=_0x50045c-0x105;const _0x339781=a10_0x3397();let _0x4f1dfe=_0x339781[_0x50045c];return _0x4f1dfe;}export async function executeCustomSql(_0x5cdae9){const _0x4e1bba=a10_0x4f1d,_0xfea2b7=Date[_0x4e1bba(0x11b)](),{appCode:appCode=getEnvAppCode(),cookie:_0xbcc99b,sqlCode:_0x1dcc10,params:_0x205f76}=_0x5cdae9;if(!appCode)throw new Error('appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.');if(!_0x1dcc10||_0x1dcc10[_0x4e1bba(0x118)]()==='')throw new Error('sqlCode\x20is\x20required.\x20Get\x20it\x20from\x20list_sql_queries\x20->\x20sqlCode');const _0x426c60=new DevApiClient({'appCode':appCode,'cookie':_0xbcc99b}),_0x414b6f=_0x205f76&&Object[_0x4e1bba(0x11f)](_0x205f76)[_0x4e1bba(0x105)]>0x0,_0x2aeb6d=_0x414b6f?Object[_0x4e1bba(0x11f)](_0x205f76):[],_0x2741b4={'sqlCode':_0x1dcc10,'hasParams':_0x414b6f||![],'paramNames':_0x2aeb6d||[]};try{const _0x2fd369=await _0x426c60[_0x4e1bba(0x11c)]({'sqlCode':_0x1dcc10[_0x4e1bba(0x118)](),'params':_0x205f76}),_0xe3ca90=Date[_0x4e1bba(0x11b)]()-_0xfea2b7,_0x3d8920=_0x2fd369[_0x4e1bba(0x11a)]??![],_0x38136b=_0x2fd369[_0x4e1bba(0x113)];if(!_0x3d8920){const _0x4dddd8=_0x2fd369[_0x4e1bba(0x122)]||_0x2fd369['msg']||_0x4e1bba(0x10a);return{'success':![],'execSuccess':![],'execError':_0x4dddd8,'errorCode':_0x38136b||_0x4e1bba(0x125),'message':_0x4e1bba(0x126)+(_0x38136b||_0x4e1bba(0x119))+_0x4e1bba(0x10d)+_0x4dddd8,'executionTime':_0xe3ca90,'sqlInfo':_0x2741b4};}const _0x333cf4=_0x2fd369[_0x4e1bba(0x115)]||_0x2fd369,_0x41de19=_0x333cf4[_0x4e1bba(0x107)]??_0x333cf4['success']??!![],_0x1e7845=_0x333cf4[_0x4e1bba(0x110)]||_0x333cf4[_0x4e1bba(0x115)],_0x17eed5=_0x333cf4[_0x4e1bba(0x124)]||_0x333cf4[_0x4e1bba(0x122)];if(_0x41de19){const _0x3b76ad=Array[_0x4e1bba(0x123)](_0x1e7845)?_0x1e7845[_0x4e1bba(0x105)]:0x0;return{'success':!![],'execSuccess':!![],'execResult':_0x1e7845||[],'rowCount':_0x3b76ad,'message':_0x4e1bba(0x117)+_0x3b76ad+'\x20row(s).','executionTime':_0xe3ca90,'sqlInfo':_0x2741b4};}return{'success':!![],'execSuccess':![],'execError':_0x17eed5||_0x4e1bba(0x121),'message':_0x4e1bba(0x10e)+(_0x17eed5||_0x4e1bba(0x10a)),'executionTime':_0xe3ca90,'sqlInfo':_0x2741b4};}catch(_0x5cdfdb){const _0x23b34b=Date['now']()-_0xfea2b7;return{'success':![],'execSuccess':![],'execError':_0x5cdfdb[_0x4e1bba(0x106)]||_0x4e1bba(0x10a),'message':_0x4e1bba(0x109)+(_0x5cdfdb[_0x4e1bba(0x106)]||_0x4e1bba(0x10a)),'executionTime':_0x23b34b,'sqlInfo':_0x2741b4};}}
@@ -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(_0x2c24f7,_0x487aba){const _0x1bc64e=a11_0x5265,_0x159db9=_0x2c24f7();while(!![]){try{const _0x284840=parseInt(_0x1bc64e(0x12b))/0x1+parseInt(_0x1bc64e(0x129))/0x2*(-parseInt(_0x1bc64e(0x116))/0x3)+-parseInt(_0x1bc64e(0x11f))/0x4+-parseInt(_0x1bc64e(0x121))/0x5*(parseInt(_0x1bc64e(0x120))/0x6)+-parseInt(_0x1bc64e(0x10e))/0x7+-parseInt(_0x1bc64e(0x10f))/0x8*(parseInt(_0x1bc64e(0x113))/0x9)+parseInt(_0x1bc64e(0x10d))/0xa;if(_0x284840===_0x487aba)break;else _0x159db9['push'](_0x159db9['shift']());}catch(_0x1526c3){_0x159db9['push'](_0x159db9['shift']());}}}(a11_0x4193,0xd6187));import{DevApiClient}from'../api/dev-api-client.js';import{DrivenDataDetailPlus}from'@lovrabet/dsparser';import{getEnvAppCode,getEnvironment}from'../config/env.js';import{buildFieldRelationsMap,enrichFieldsWithRelations}from'../utils/relations.js';function a11_0x5265(_0x54f94a,_0x4e29aa){_0x54f94a=_0x54f94a-0x10c;const _0x4193d3=a11_0x4193();let _0x526511=_0x4193d3[_0x54f94a];return _0x526511;}export async function generateSDKCode(_0x5ad098){const _0x535a3c=a11_0x5265,{appCode:appCode=getEnvAppCode(),cookie:_0x2f05c0,datasetCode:_0x1cf2af,operationName:_0x25b447,includeImports:includeImports=!![],useAlias:useAlias=![]}=_0x5ad098;if(!appCode)throw new Error(_0x535a3c(0x10c));if(!_0x1cf2af)throw new Error(_0x535a3c(0x125));if(!_0x25b447)throw new Error('operationName\x20is\x20required');const _0x333b8f=new DevApiClient({'appCode':appCode,'cookie':_0x2f05c0}),_0x480776=getEnvironment(),_0x50cba7=await _0x333b8f[_0x535a3c(0x110)](_0x1cf2af),_0x42a0c3=_0x50cba7[_0x535a3c(0x114)]||_0x50cba7,_0x5b8219=new DrivenDataDetailPlus(_0x42a0c3),_0x472d4d=_0x5b8219[_0x535a3c(0x117)](_0x25b447);if(!_0x472d4d)throw new Error(_0x535a3c(0x112)+_0x25b447+'\x27\x20in\x20dataset\x20\x27'+_0x1cf2af+'\x27');const _0x4975d4=_0x5b8219[_0x535a3c(0x123)](),_0x3476fc=_0x5b8219['getModelAlias'](),_0x256e90=_0x5b8219['getTableKey'](),_0x27f062=_0x5b8219[_0x535a3c(0x11a)](),_0xc07b4=_0x5b8219['name'],_0x4610b1=_0x5b8219[_0x535a3c(0x11e)](),_0x3cd6ef=_0x4610b1?.[_0x535a3c(0x128)]?.()||[],_0x5b61f3=buildFieldRelationsMap(_0x50cba7),_0x477338=enrichFieldsWithRelations(_0x3cd6ef,_0x5b61f3),_0x184d20=_0x5b8219[_0x535a3c(0x11b)](_0x25b447,appCode),_0x1b59f5=_0x5b8219['getOperationAnalysis'](_0x25b447);let _0x5bc707=_0x472d4d['sdkCall'][_0x535a3c(0x122)],_0x529773=_0x184d20||undefined;useAlias&&(_0x5bc707=_0x5bc707[_0x535a3c(0x111)](new RegExp(_0x4975d4,'g'),_0x3476fc),_0x529773&&(_0x529773=_0x529773[_0x535a3c(0x111)](new RegExp(_0x4975d4,'g'),_0x3476fc)));const _0x8ff0a4=_0x535a3c(0x11d)+_0xc07b4+'\x20|\x20数据表:\x20'+_0x27f062+'\x0a',_0x17d34d=_0x8ff0a4+_0x5bc707,_0x1dc7e7=_0x529773?_0x535a3c(0x11d)+_0xc07b4+_0x535a3c(0x119)+_0x27f062+'\x0a'+_0x529773:undefined;return{'appCode':appCode,'env':_0x480776,'datasetName':_0xc07b4,'language':_0x535a3c(0x11c),'code':_0x17d34d,'fullExample':includeImports?_0x1dc7e7:undefined,'sdkCallInfo':{'modelName':_0x3476fc,'tableName':_0x27f062,'tableKey':_0x256e90,'datasetCode':_0x5b8219[_0x535a3c(0x127)],'operationName':_0x25b447},'fields':_0x477338,'requestExample':_0x1b59f5?.[_0x535a3c(0x115)],'responseExample':_0x1b59f5?.[_0x535a3c(0x12a)],'sdkInitCode':_0x5b8219[_0x535a3c(0x118)](_0x256e90),'usageExample':_0x472d4d[_0x535a3c(0x126)],'aliasExplanation':useAlias?_0x5b8219[_0x535a3c(0x124)]():undefined,'aliasHint':{'defaultAlias':_0x3476fc,'datasetSDKKey':_0x4975d4}};}function a11_0x4193(){const _0x3b3120=['generateAliasExplanation','datasetCode\x20is\x20required','usageExample','datasetCode','toJSON','308VtKCzV','responseExample','1671896okKWGR','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','38804850dIGzrw','6673429bHAFDE','3383008UTojPh','getDatasetDetail','replace','Cannot\x20generate\x20SDK\x20code\x20for\x20operation\x20\x27','9YwRywY','data','requestExample','6915MNovzp','getOperationDocMeta','generateSDKInitCode','\x20|\x20数据表:\x20','getTableName','generateFullSDKExample','typescript','//\x20数据集:\x20','getFieldList','5720036RhlJmg','18WOeNOh','2523740sifEfA','code','getDatasetSDKKey'];a11_0x4193=function(){return _0x3b3120;};return a11_0x4193();}
@@ -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(_0x36b02e,_0x49101d){const _0x556696=a12_0x5b15,_0x61e110=_0x36b02e();while(!![]){try{const _0x3b8df0=parseInt(_0x556696(0x1b5))/0x1*(parseInt(_0x556696(0x1a0))/0x2)+-parseInt(_0x556696(0x176))/0x3+parseInt(_0x556696(0x1ac))/0x4+-parseInt(_0x556696(0x179))/0x5*(parseInt(_0x556696(0x1b7))/0x6)+parseInt(_0x556696(0x180))/0x7*(-parseInt(_0x556696(0x1ad))/0x8)+-parseInt(_0x556696(0x1a7))/0x9*(-parseInt(_0x556696(0x1b2))/0xa)+-parseInt(_0x556696(0x187))/0xb;if(_0x3b8df0===_0x49101d)break;else _0x61e110['push'](_0x61e110['shift']());}catch(_0x26bd53){_0x61e110['push'](_0x61e110['shift']());}}}(a12_0x44ba,0x735bc));import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode,getEnvironment}from'../config/env.js';function a12_0x44ba(){const _0x3e6d58=['replace','page','9rkhRrT','//\x20Backend\x20Function:\x20Execute\x20SQL\x20\x22','map','Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.','\x27,\x0a\x20\x20env:\x20\x27','2141396ZGQNaT','792OuZJFF','sql','\x22\x0aexport\x20default\x20async\x20function(params,\x20context)\x20{\x0a\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute(','length','Failed\x20to\x20verify\x20SQL\x20code:\x20','4754660NaXeAp','entries','{\x20sqlCode:\x20\x27','3ugCmfm','\x0aconst\x20data\x20=\x20await\x20client.sql.execute(','192rauGGM','date','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','from','\x22\x20exists\x20and\x20is\x20valid.','349935CMHwIx','value','\x22\x20not\x20found\x20in\x20the\x20application.','34535EcKtAd','BFF\x20context.client.sql.execute()\x20returns\x20rows\x20T[]\x20directly\x20—\x20no\x20wrapper\x20object','sdk','Generated\x20',');\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}','Check\x20the\x20sqlCode\x20from\x20list_sql_queries\x20result\x20and\x20use\x20the\x20exact\x20value.','getCustomSqlList','48454mLorAz','SQL\x20code\x20\x22','\x20code\x20for\x20SQL:\x20','includes','sqlId','Frontend\x20SDK','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a','3636116VWbshx','keyword',');\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});','size','\x22\x20does\x20not\x20exist.\x20Use\x20list_sql_queries\x20to\x20find\x20valid\x20SQL\x20codes.','toLowerCase','sqlName','SDK\x20client.sql.execute()\x20returns\x20{\x20execSuccess,\x20execResult\x20}\x20—\x20always\x20check\x20execSuccess','sqlCode\x20is\x20required','data','trim','status','bff','join','\x27,\x0a});\x0a\x0a//\x20Execute\x20SQL:\x20','match','count','name','SQL-','time','find','search','message','Errors\x20throw\x20exceptions\x20—\x20use\x20try-catch','{\x0a\x20\x20sqlCode:\x20\x27','543464SnzxEF','stringify','Note:\x20client.api.executeSql()\x20is\x20deprecated.\x20Use\x20client.sql.execute()\x20instead.','example','sqlCode'];a12_0x44ba=function(){return _0x3e6d58;};return a12_0x44ba();}function a12_0x5b15(_0xd7945a,_0x25c39f){_0xd7945a=_0xd7945a-0x175;const _0x44baf4=a12_0x44ba();let _0x5b15d2=_0x44baf4[_0xd7945a];return _0x5b15d2;}export async function generateSqlCode(_0x235197){const _0xfa0af0=a12_0x5b15,{appCode:appCode=getEnvAppCode(),cookie:_0xc8262d,sqlCode:_0x5c42a9,params:_0x369bc8,includeImports:includeImports=!![],target:target=_0xfa0af0(0x17b)}=_0x235197;if(!appCode)throw new Error(_0xfa0af0(0x1b9));if(!_0x5c42a9||_0x5c42a9[_0xfa0af0(0x191)]()==='')return{'success':![],'sqlCode':'','sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[]},'error':_0xfa0af0(0x18f)};const _0x4e0121=_0x5c42a9[_0xfa0af0(0x191)](),_0x427c80=new DevApiClient({'appCode':appCode,'cookie':_0xc8262d}),_0xaaf28f=getEnvironment();try{const _0x29c8a6=await _0x427c80[_0xfa0af0(0x17f)]({'pageSize':0x3e7,'currentPage':0x1,'sqlCode':_0x4e0121}),_0x1240dd=_0x29c8a6[_0xfa0af0(0x190)]?.['tableData']||[],_0x11deaa=_0x1240dd[_0xfa0af0(0x19b)](_0x175718=>_0x175718[_0xfa0af0(0x1a4)]===_0x4e0121||_0x175718[_0xfa0af0(0x1a4)]?.[_0xfa0af0(0x183)](_0x4e0121)||_0x4e0121[_0xfa0af0(0x183)](_0x175718['sqlCode']));if(!_0x11deaa)return{'success':![],'sqlCode':_0x4e0121,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0xfa0af0(0x181)+_0x4e0121+_0xfa0af0(0x178),_0xfa0af0(0x1aa),_0xfa0af0(0x17e)]},'error':_0xfa0af0(0x181)+_0x4e0121+_0xfa0af0(0x18b)};const _0x5e4ac5=_0x11deaa[_0xfa0af0(0x1a4)],_0x371976=_0x11deaa[_0xfa0af0(0x18d)]||_0x11deaa[_0xfa0af0(0x198)]||_0xfa0af0(0x199)+(_0x11deaa[_0xfa0af0(0x184)]||_0x11deaa['id']),_0x439e93=_0x11deaa['sqlContent']||_0x11deaa[_0xfa0af0(0x1ae)]||'',_0x1f7704=_0x439e93[_0xfa0af0(0x196)](/[:$]\{?(\w+)\}?/g);let _0x49938a,_0x12ca3c;if(_0x1f7704){const _0x4bf479=Array[_0xfa0af0(0x1ba)](new Set(_0x1f7704[_0xfa0af0(0x1a9)](_0x4b2d8e=>_0x4b2d8e[_0xfa0af0(0x1a5)](/[:${}]/g,''))));_0x49938a=_0x4bf479[_0xfa0af0(0x1a9)](_0x4e4825=>{const _0x3862e9=_0x369bc8?.[_0x4e4825]??getDefaultExample(_0x4e4825);return{'name':_0x4e4825,'example':_0x3862e9};}),_0x12ca3c=_0x49938a['reduce']((_0x28d59e,_0x27fbcb)=>({..._0x28d59e,[_0x27fbcb[_0xfa0af0(0x198)]]:_0x27fbcb[_0xfa0af0(0x1a3)]}),{});}else _0x369bc8&&(_0x49938a=Object[_0xfa0af0(0x1b3)](_0x369bc8)[_0xfa0af0(0x1a9)](([_0x291a64,_0x32c055])=>({'name':_0x291a64,'example':_0x32c055})),_0x12ca3c=_0x369bc8);const _0x2562d4=_0x49938a&&_0x49938a[_0xfa0af0(0x1b0)]>0x0,_0x3f3be4=_0x2562d4?JSON[_0xfa0af0(0x1a1)](_0x12ca3c,null,0x2):'',_0x559250=_0x2562d4?_0xfa0af0(0x19f)+_0x5e4ac5+'\x27,\x0a\x20\x20params:\x20'+_0x3f3be4+',\x0a}':_0xfa0af0(0x1b4)+_0x5e4ac5+'\x27\x20}';let _0x5ead98;target==='bff'?_0x5ead98=_0xfa0af0(0x1a8)+_0x371976+_0xfa0af0(0x1af)+_0x559250+_0xfa0af0(0x17d):_0x5ead98=(includeImports?_0xfa0af0(0x186):'')+'//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27'+appCode+_0xfa0af0(0x1ab)+_0xaaf28f+_0xfa0af0(0x195)+_0x371976+_0xfa0af0(0x1b6)+_0x559250+_0xfa0af0(0x189);const _0x10d0ec=target===_0xfa0af0(0x193);return{'success':!![],'sqlCode':_0x5e4ac5,'sqlName':_0x371976,'sqlExists':!![],'code':_0x5ead98,'parameters':_0x49938a,'usage':{'description':_0xfa0af0(0x17c)+(_0x10d0ec?'Backend\x20Function':_0xfa0af0(0x185))+_0xfa0af0(0x182)+_0x371976,'important':[_0xfa0af0(0x181)+_0x5e4ac5+_0xfa0af0(0x175),_0x10d0ec?_0xfa0af0(0x17a):_0xfa0af0(0x18e),_0x10d0ec?_0xfa0af0(0x19e):'On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20—\x20use\x20try-catch',_0x2562d4?'This\x20SQL\x20requires\x20parameters:\x20'+_0x49938a[_0xfa0af0(0x1a9)](_0x4b5c0b=>_0x4b5c0b[_0xfa0af0(0x198)])[_0xfa0af0(0x194)](',\x20'):'This\x20SQL\x20does\x20not\x20require\x20any\x20parameters',_0xfa0af0(0x1a2)]}};}catch(_0x9f6812){return{'success':![],'sqlCode':_0x4e0121,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0xfa0af0(0x1b1)+_0x9f6812[_0xfa0af0(0x19d)],'Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.']},'error':_0xfa0af0(0x1b1)+_0x9f6812['message']};}}function getDefaultExample(_0x34d469){const _0xee0af4=a12_0x5b15,_0x2c9f7b=_0x34d469[_0xee0af4(0x18c)]();if(_0x2c9f7b[_0xee0af4(0x183)](_0xee0af4(0x1b8))||_0x2c9f7b['includes'](_0xee0af4(0x19a)))return'2024-01-01';if(_0x2c9f7b[_0xee0af4(0x183)]('id'))return 0x7b;if(_0x2c9f7b['includes']('limit')||_0x2c9f7b[_0xee0af4(0x183)](_0xee0af4(0x197))||_0x2c9f7b[_0xee0af4(0x183)](_0xee0af4(0x18a)))return 0xa;if(_0x2c9f7b[_0xee0af4(0x183)](_0xee0af4(0x1a6)))return 0x1;if(_0x2c9f7b['includes'](_0xee0af4(0x188))||_0x2c9f7b[_0xee0af4(0x183)](_0xee0af4(0x19c))||_0x2c9f7b[_0xee0af4(0x183)](_0xee0af4(0x198)))return _0xee0af4(0x1a3);if(_0x2c9f7b['includes'](_0xee0af4(0x192)))return 0x1;return _0xee0af4(0x177);}
@@ -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(_0xc79fa0,_0x154204){const _0x4598ea=a13_0x1923,_0x184a7d=_0xc79fa0();while(!![]){try{const _0x4f9de5=-parseInt(_0x4598ea(0xfe))/0x1*(-parseInt(_0x4598ea(0x109))/0x2)+-parseInt(_0x4598ea(0x105))/0x3*(parseInt(_0x4598ea(0x107))/0x4)+-parseInt(_0x4598ea(0x101))/0x5*(-parseInt(_0x4598ea(0xfd))/0x6)+-parseInt(_0x4598ea(0x102))/0x7+-parseInt(_0x4598ea(0x10b))/0x8*(-parseInt(_0x4598ea(0x103))/0x9)+parseInt(_0x4598ea(0x10a))/0xa+-parseInt(_0x4598ea(0xfc))/0xb*(-parseInt(_0x4598ea(0x104))/0xc);if(_0x4f9de5===_0x154204)break;else _0x184a7d['push'](_0x184a7d['shift']());}catch(_0x2c0e07){_0x184a7d['push'](_0x184a7d['shift']());}}}(a13_0x3598,0xd036c));function a13_0x1923(_0x2538ff,_0x59e7ec){_0x2538ff=_0x2538ff-0xfc;const _0x3598fb=a13_0x3598();let _0x1923d9=_0x3598fb[_0x2538ff];return _0x1923d9;}import{DevApiClient}from'../api/dev-api-client.js';function a13_0x3598(){const _0x15e6c7=['11XGawIT','3170754rdtCsD','517plieDk','data','getBffScriptInfo','10nEGmvK','9181599EXLmdp','8124849JzBLHJ','3317304zDsTPT','248934rKUnLD','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','76OkHeSi','success','686RYuWCS','13276310BBOHRe','8BsLhQj'];a13_0x3598=function(){return _0x15e6c7;};return a13_0x3598();}import{getEnvAppCode}from'../config/env.js';export async function getBffScriptInfo(_0x3c5eb4){const _0x5ddcbc=a13_0x1923,{appCode:appCode=getEnvAppCode(),cookie:_0x429d40,id:_0x71a488}=_0x3c5eb4;if(!appCode)throw new Error(_0x5ddcbc(0x106));if(!_0x71a488||_0x71a488<=0x0)throw new Error('id\x20is\x20required\x20and\x20must\x20be\x20a\x20positive\x20number.\x20Get\x20it\x20from\x20list_bff_scripts.');const _0x510fe9=new DevApiClient({'appCode':appCode,'cookie':_0x429d40}),_0x4b04ed=await _0x510fe9[_0x5ddcbc(0x100)](_0x71a488);if(!_0x4b04ed[_0x5ddcbc(0x108)]||!_0x4b04ed[_0x5ddcbc(0xff)])return{'success':![],'message':'Failed\x20to\x20fetch\x20Backend\x20Function\x20script\x20info\x20for\x20id:\x20'+_0x71a488};return{'success':!![],'script':_0x4b04ed[_0x5ddcbc(0xff)]};}