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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api/cache.js CHANGED
@@ -1 +1 @@
1
- const a0_0x735b46=a0_0x3813;(function(_0x5753ec,_0x290fca){const _0x708665=a0_0x3813,_0x11ea47=_0x5753ec();while(!![]){try{const _0x5cad62=-parseInt(_0x708665(0x153))/0x1*(parseInt(_0x708665(0x150))/0x2)+-parseInt(_0x708665(0x151))/0x3+-parseInt(_0x708665(0x15e))/0x4*(-parseInt(_0x708665(0x161))/0x5)+-parseInt(_0x708665(0x156))/0x6*(-parseInt(_0x708665(0x157))/0x7)+-parseInt(_0x708665(0x154))/0x8+parseInt(_0x708665(0x158))/0x9*(parseInt(_0x708665(0x164))/0xa)+parseInt(_0x708665(0x152))/0xb*(-parseInt(_0x708665(0x15d))/0xc);if(_0x5cad62===_0x290fca)break;else _0x11ea47['push'](_0x11ea47['shift']());}catch(_0x210ba2){_0x11ea47['push'](_0x11ea47['shift']());}}}(a0_0x8d8e,0xa03d4));export class SimpleCache{[a0_0x735b46(0x15f)]=new Map();['defaultTTL'];constructor(_0x43b5f6=0x5){const _0x15cda6=a0_0x735b46;this[_0x15cda6(0x165)]=_0x43b5f6*0x3c*0x3e8;}[a0_0x735b46(0x15b)](_0x30e7e7){const _0x568cca=a0_0x735b46,_0x5373e1=this[_0x568cca(0x15f)][_0x568cca(0x15b)](_0x30e7e7);if(!_0x5373e1)return null;const _0x38274c=Date['now'](),_0x34d0fa=_0x38274c-_0x5373e1[_0x568cca(0x160)];if(_0x34d0fa>this[_0x568cca(0x165)])return this[_0x568cca(0x15f)][_0x568cca(0x14f)](_0x30e7e7),null;const _0x5665e3=Math[_0x568cca(0x159)](_0x34d0fa/0x3e8);return _0x5373e1['data'];}['set'](_0x3a3783,_0x395f8b){const _0x3df055=a0_0x735b46;this[_0x3df055(0x15f)][_0x3df055(0x163)](_0x3a3783,{'data':_0x395f8b,'timestamp':Date[_0x3df055(0x162)]()});}[a0_0x735b46(0x15c)](_0x33fb28){const _0x3f21b1=a0_0x735b46;_0x33fb28?this['cache'][_0x3f21b1(0x14f)](_0x33fb28):this['cache']['clear']();}[a0_0x735b46(0x155)](){const _0x5af561=a0_0x735b46;return{'size':this[_0x5af561(0x15f)]['size'],'ttlMinutes':this[_0x5af561(0x165)]/0xea60,'entries':Array[_0x5af561(0x15a)](this[_0x5af561(0x15f)]['keys']())};}}function a0_0x3813(_0x30df39,_0x12dc21){_0x30df39=_0x30df39-0x14f;const _0x8d8eaf=a0_0x8d8e();let _0x381322=_0x8d8eaf[_0x30df39];return _0x381322;}function a0_0x8d8e(){const _0x26bc04=['clear','2964JdwpGa','1364RjpUZp','cache','timestamp','16935QIfodd','now','set','1350BlvCxT','defaultTTL','delete','4706YGjhCF','1395429njugIi','23441iwVylu','57FKxCNI','9947776qkhWbM','getStats','877362SCiblP','56aslBJS','46710cnvDUX','floor','from','get'];a0_0x8d8e=function(){return _0x26bc04;};return a0_0x8d8e();}export const apiCache=new SimpleCache(0x5);
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 +1 @@
1
- const a1_0x35b167=a1_0x16cb;(function(_0xce2897,_0x40b635){const _0x5d52df=a1_0x16cb,_0xa3c2fe=_0xce2897();while(!![]){try{const _0xfb6bf8=parseInt(_0x5d52df(0x110))/0x1*(parseInt(_0x5d52df(0xc3))/0x2)+parseInt(_0x5d52df(0xd0))/0x3*(-parseInt(_0x5d52df(0xd3))/0x4)+-parseInt(_0x5d52df(0x124))/0x5*(-parseInt(_0x5d52df(0xde))/0x6)+parseInt(_0x5d52df(0x121))/0x7+parseInt(_0x5d52df(0xd2))/0x8*(-parseInt(_0x5d52df(0xf3))/0x9)+-parseInt(_0x5d52df(0x122))/0xa*(parseInt(_0x5d52df(0x11f))/0xb)+parseInt(_0x5d52df(0xe4))/0xc*(parseInt(_0x5d52df(0x129))/0xd);if(_0xfb6bf8===_0x40b635)break;else _0xa3c2fe['push'](_0xa3c2fe['shift']());}catch(_0x28f254){_0xa3c2fe['push'](_0xa3c2fe['shift']());}}}(a1_0x9e2c,0x1cdbf));import{getCookie}from'../auth/cookie-manager.js';import{getEffectiveApiDomain,getEffectiveRuntimeDomain,resolveApiBaseUrl}from'../auth/constants.js';function a1_0x16cb(_0x472f78,_0x556763){_0x472f78=_0x472f78-0xc1;const _0x9e2c90=a1_0x9e2c();let _0x16cbb9=_0x9e2c90[_0x472f78];return _0x16cbb9;}import{apiCache}from'./cache.js';export class DevApiClient{[a1_0x35b167(0x116)];[a1_0x35b167(0xe9)];['cookie'];[a1_0x35b167(0x125)];[a1_0x35b167(0x105)];[a1_0x35b167(0x12c)];constructor(_0x85c9b1){const _0x2efd0b=a1_0x35b167;this[_0x2efd0b(0x116)]=_0x85c9b1[_0x2efd0b(0x116)],this[_0x2efd0b(0xe9)]=globalThis[_0x2efd0b(0xcc)]?.[_0x2efd0b(0xe9)]?.['LOVRABET_ENV']||_0x2efd0b(0x102),this[_0x2efd0b(0x10b)]=_0x85c9b1[_0x2efd0b(0x10b)]||getCookie(),this[_0x2efd0b(0x125)]=_0x85c9b1[_0x2efd0b(0xeb)]||getEffectiveApiDomain(),this[_0x2efd0b(0x105)]=_0x85c9b1[_0x2efd0b(0x135)]||getEffectiveRuntimeDomain(),this[_0x2efd0b(0x12c)]=_0x85c9b1[_0x2efd0b(0x103)];if(!this[_0x2efd0b(0x10b)])throw new Error('No\x20authentication\x20cookie\x20found.\x20Please\x20login\x20first.');}[a1_0x35b167(0x12d)](_0x5cd58b,_0x372898){const _0x3216ad=a1_0x35b167,_0x2fbd7=resolveApiBaseUrl(_0x5cd58b),_0x5ab9a1=this['toolboxBaseUrlOverride']&&_0x2fbd7===getEffectiveApiDomain()?this[_0x3216ad(0x12c)]:_0x2fbd7;try{const _0x447bad=new URL(_0x5ab9a1);if(_0x447bad['pathname']!=='/')return _0x5ab9a1;}catch{}return''+_0x5ab9a1+_0x372898;}static ['DEFAULT_TIMEOUT']=0x7530;async[a1_0x35b167(0x11a)](_0x20f7e6,_0x20a644={},_0x2c9a9f=DevApiClient[a1_0x35b167(0xe6)]){const _0x230625=a1_0x35b167,{method:method=_0x230625(0xdf),body:_0x12ff7b,extraHeaders:_0x392f91}=_0x20a644,_0x4e210c=new AbortController(),_0x12ccd0=setTimeout(()=>_0x4e210c['abort'](),_0x2c9a9f),_0x5e51c1={'Cookie':this[_0x230625(0x10b)],'X-Invoke-Source':_0x230625(0x131),..._0x392f91};method===_0x230625(0xe8)&&(_0x5e51c1['Content-Type']='application/json');try{const _0x203a11=await fetch(_0x20f7e6,{'method':method,'headers':_0x5e51c1,..._0x12ff7b!==undefined&&{'body':JSON['stringify'](_0x12ff7b)},'signal':_0x4e210c['signal']});clearTimeout(_0x12ccd0);if(!_0x203a11['ok']){if(_0x203a11[_0x230625(0xe3)]===0x191)throw new Error(_0x230625(0x120));let _0x22a9f6='';try{_0x22a9f6=await _0x203a11[_0x230625(0xf7)]();}catch{}throw new Error(_0x230625(0x119)+_0x203a11[_0x230625(0xe3)]+_0x230625(0xc4)+_0x20f7e6+(_0x22a9f6?'\x0a'+_0x22a9f6:''));}const _0x4f672f=await _0x203a11['json']();if(_0x4f672f&&typeof _0x4f672f===_0x230625(0x132)&&_0x230625(0x12e)in _0x4f672f&&!_0x4f672f[_0x230625(0x12e)]){const _0x38b91a=_0x4f672f;throw new Error(_0x230625(0x100)+(_0x38b91a[_0x230625(0x133)]||_0x38b91a[_0x230625(0x107)]||'Unknown\x20error'));}return _0x4f672f;}catch(_0x560c83){if(_0x560c83 instanceof Error&&_0x560c83['name']===_0x230625(0xd7))throw new Error(_0x230625(0xec)+_0x2c9a9f+_0x230625(0x104)+_0x20f7e6);if(_0x560c83 instanceof TypeError)throw new Error(_0x230625(0xc8)+_0x20f7e6);throw _0x560c83;}}async[a1_0x35b167(0x118)](_0x2ee8de,_0x180ee7){return this['_request'](_0x2ee8de,{'method':'GET'},_0x180ee7);}async[a1_0x35b167(0xc7)](_0x1a7481,_0x6ce5a0,_0x4630d1,_0x337d7){const _0x3a6ad1=a1_0x35b167;return this[_0x3a6ad1(0x11a)](_0x1a7481,{'method':_0x3a6ad1(0xe8),'body':_0x6ce5a0,'extraHeaders':_0x337d7},_0x4630d1);}async['getDatasetList'](_0x49197b){const _0x54e169=a1_0x35b167,_0xe0cbe6=_0x49197b?.[_0x54e169(0xfc)]||![],_0x866667=_0x54e169(0x10e)+this['appCode']+':'+this[_0x54e169(0xe9)];if(!_0xe0cbe6){const _0x9cccfb=apiCache[_0x54e169(0xd6)](_0x866667);if(_0x9cccfb)return _0x9cccfb;}const _0x376bb1=this['apiDomain']+_0x54e169(0xca),_0x3b67f4=await this['postRequest'](_0x376bb1,{'appCode':this['appCode']});return apiCache['set'](_0x866667,_0x3b67f4),_0x3b67f4;}async[a1_0x35b167(0x111)](_0x107df1,_0x298482=![],_0xec4d=![]){const _0x260deb=a1_0x35b167,_0x48ef5b=_0x260deb(0x109)+this['appCode']+':'+this[_0x260deb(0xe9)]+':'+_0x107df1+':'+(_0xec4d?_0x260deb(0x10f):_0x260deb(0x108));if(!_0x298482){const _0x3c7157=apiCache[_0x260deb(0xd6)](_0x48ef5b);if(_0x3c7157)return _0x3c7157;}const _0x50e8dc=/^\d+$/[_0x260deb(0xd9)](_0x107df1),_0x1c6050=_0x50e8dc?'id':_0x260deb(0x117),_0xc65bac=this[_0x260deb(0x125)]+_0x260deb(0x106)+_0x1c6050+'='+_0x107df1,_0x48ff28=await this[_0x260deb(0x118)](_0xc65bac);if(_0xec4d&&_0x48ff28[_0x260deb(0xc9)]?.[_0x260deb(0xfd)]){const _0x25c6e7=_0x48ff28[_0x260deb(0xc9)][_0x260deb(0x11b)]==='v2',_0x4c7715=Array[_0x260deb(0xc1)](_0x48ff28[_0x260deb(0xc9)][_0x260deb(0xf9)]);if(!_0x25c6e7||!_0x4c7715)try{const _0x256a43=await this['getDatasetRelations'](_0x48ff28['data']['modelCode'],_0x298482);_0x48ff28[_0x260deb(0xc9)][_0x260deb(0xf9)]=_0x256a43;}catch(_0x2a86b1){process['env']['NODE_ENV']!==_0x260deb(0xd9)&&console[_0x260deb(0x126)](_0x260deb(0x12f)+_0x107df1+':',_0x2a86b1);}}return apiCache['set'](_0x48ef5b,_0x48ff28),_0x48ff28;}async[a1_0x35b167(0xc6)](_0x4ebace){const _0x157d36=a1_0x35b167,_0x466a40=await this['getDatasetList'](),_0x360dda=Array['isArray'](_0x466a40[_0x157d36(0xc9)])?_0x466a40[_0x157d36(0xc9)]:_0x466a40['data']?.['tableData']||[];if(!_0x466a40['success'])return{'success':!![],'data':{'tableData':[]}};const _0x349819=_0x360dda['filter'](_0x4915cf=>{const _0x3d764d=_0x157d36,_0x5be8cd=_0x4ebace[_0x3d764d(0xe5)]();return _0x4915cf[_0x3d764d(0xdc)]?.['toLowerCase']()['includes'](_0x5be8cd)||_0x4915cf[_0x3d764d(0x117)]?.[_0x3d764d(0xe5)]()[_0x3d764d(0x130)](_0x5be8cd)||_0x4915cf[_0x3d764d(0xea)]?.[_0x3d764d(0xf5)]?.[_0x3d764d(0xe5)]()['includes'](_0x5be8cd)||_0x4915cf[_0x3d764d(0x101)]?.['toLowerCase']()['includes'](_0x5be8cd);});return{'success':!![],'data':{'tableData':_0x349819,'paging':{'totalCount':_0x349819[_0x157d36(0xce)],'currentPage':0x1,'pageSize':_0x349819[_0x157d36(0xce)]}}};}async[a1_0x35b167(0x10d)](_0x183f6b){const _0x4c76c4=a1_0x35b167,_0x3174af=_0x183f6b?.[_0x4c76c4(0xf8)]||0x1,_0x174abd=_0x183f6b?.[_0x4c76c4(0xcb)]||0x3e7,_0x3066a=this['apiDomain']+'/smartapi/custom/queryUserCustomSqlList',_0x5ea574={'appCode':this[_0x4c76c4(0x116)],'currentPage':_0x3174af,'pageSize':_0x174abd,..._0x183f6b?.[_0x4c76c4(0x11e)]&&{'sqlCode':_0x183f6b[_0x4c76c4(0x11e)]},..._0x183f6b?.[_0x4c76c4(0xf1)]&&{'sqlName':_0x183f6b[_0x4c76c4(0xf1)]}},_0x553d9a=await this[_0x4c76c4(0xc7)](_0x3066a,_0x5ea574);return _0x553d9a;}async['executeSql'](_0x128590){const _0x2988e7=a1_0x35b167,_0xe8af02=this[_0x2988e7(0x105)]+_0x2988e7(0xe0),_0x4685ed={'appCode':this[_0x2988e7(0x116)],'sqlCode':_0x128590['sqlCode'],..._0x128590['params']&&{'params':_0x128590[_0x2988e7(0xcf)]}};return await this['postRequest'](_0xe8af02,_0x4685ed);}async[a1_0x35b167(0xc2)](_0x4bc959){const _0x582e30=a1_0x35b167,_0x2cf909=this['apiDomain']+_0x582e30(0xef),_0x4ab686={'sqlName':_0x4bc959[_0x582e30(0xf1)],'dbId':_0x4bc959[_0x582e30(0xda)],'sqlContent':_0x4bc959[_0x582e30(0xff)],'appCode':this[_0x582e30(0x116)]};return await this['postRequest'](_0x2cf909,_0x4ab686);}async[a1_0x35b167(0xf0)](_0x291670){const _0x4fb88a=a1_0x35b167,_0xa6114f=this[_0x4fb88a(0x125)]+_0x4fb88a(0xed),_0x1314b6={'id':_0x291670['id'],'dbId':_0x291670[_0x4fb88a(0xda)],'sqlName':_0x291670[_0x4fb88a(0xf1)],'appCode':this['appCode'],'sqlContent':_0x291670['sqlContent']};return await this[_0x4fb88a(0xc7)](_0xa6114f,_0x1314b6);}async[a1_0x35b167(0xfb)](_0x371e08,_0x3b57b5=![]){const _0xf42d23=a1_0x35b167,_0x4f4eab='er-config:'+this[_0xf42d23(0x116)]+':'+this[_0xf42d23(0xe9)]+':'+_0x371e08;if(!_0x3b57b5){const _0x11eebf=apiCache['get'](_0x4f4eab);if(_0x11eebf)return _0x11eebf;}const _0x3d03d4=this[_0xf42d23(0x125)]+_0xf42d23(0xf2),_0xa79b2e=await this[_0xf42d23(0xc7)](_0x3d03d4,{'dblinkId':_0x371e08,'appCode':this[_0xf42d23(0x116)]});if(!_0xa79b2e[_0xf42d23(0x12e)]||!_0xa79b2e[_0xf42d23(0xc9)])throw new Error('Failed\x20to\x20get\x20ER\x20config\x20for\x20dblinkId:\x20'+_0x371e08);const _0xf9a7e9={'meta':_0xa79b2e['data']['meta'],'datasets':_0xa79b2e[_0xf42d23(0xc9)]['datasets']};return apiCache[_0xf42d23(0x10c)](_0x4f4eab,_0xf9a7e9),_0xf9a7e9;}async[a1_0x35b167(0x11d)](_0x466ba4=![]){const _0x59f19d=a1_0x35b167,_0x3f962d=await this['getDatasetList']({'forceRefresh':_0x466ba4}),_0x29b7fa=Array['isArray'](_0x3f962d[_0x59f19d(0xc9)])?_0x3f962d[_0x59f19d(0xc9)]:_0x3f962d[_0x59f19d(0xc9)]?.[_0x59f19d(0x12b)]||[],_0x8a9f07=new Set();for(const _0x3e523b of _0x29b7fa){_0x3e523b['dbtableConfig']?.[_0x59f19d(0xda)]&&_0x8a9f07[_0x59f19d(0xe7)](_0x3e523b['dbtableConfig'][_0x59f19d(0xda)]);}return Array[_0x59f19d(0xd4)](_0x8a9f07)['sort']((_0x542406,_0x34f6f6)=>_0x542406-_0x34f6f6);}async[a1_0x35b167(0xdd)](_0x3ddec6=![]){const _0x55957d=a1_0x35b167,_0x484451=_0x55957d(0x115)+this['appCode']+':'+this[_0x55957d(0xe9)];if(!_0x3ddec6){const _0x336191=apiCache[_0x55957d(0xd6)](_0x484451);if(_0x336191)return _0x336191;}const _0x277474=await this[_0x55957d(0x11d)](_0x3ddec6),_0x356147=new Map();for(const _0x2238b6 of _0x277474){try{const _0x415fb9=await this[_0x55957d(0xfb)](_0x2238b6,_0x3ddec6);_0x356147[_0x55957d(0x10c)](_0x2238b6,_0x415fb9);}catch(_0x230296){console['warn'](_0x55957d(0x134)+_0x2238b6+':',_0x230296);}}return apiCache['set'](_0x484451,_0x356147),_0x356147;}async[a1_0x35b167(0x114)](_0x520fa7,_0x120add=![]){const _0x36546f=a1_0x35b167,_0x307003=await this[_0x36546f(0xdd)](_0x120add),_0x441078=[],_0x3add57=[];for(const [,_0x57b3ad]of _0x307003){const _0x30755b=_0x57b3ad[_0x36546f(0x112)][_0x36546f(0x10a)](_0x86acb4=>_0x86acb4['datasetCode']===_0x520fa7);if(_0x30755b)for(const _0x3551ba of _0x30755b['relations']||[]){_0x441078['push']({'toDataset':_0x3551ba[_0x36546f(0xe2)],'toDatasetName':_0x3551ba[_0x36546f(0x136)],'toField':_0x3551ba[_0x36546f(0x113)],'fromField':_0x3551ba['fromField'],'joinType':_0x3551ba[_0x36546f(0xdb)]});}for(const _0x167167 of _0x57b3ad['datasets']){if(_0x167167[_0x36546f(0xd1)]===_0x520fa7)continue;for(const _0x1abcc0 of _0x167167['relations']||[]){_0x1abcc0[_0x36546f(0xe2)]===_0x520fa7&&_0x3add57[_0x36546f(0x12a)]({'fromDataset':_0x167167[_0x36546f(0xd1)],'fromDatasetName':_0x167167[_0x36546f(0xe1)],'fromField':_0x1abcc0[_0x36546f(0x11c)],'toField':_0x1abcc0['toField'],'joinType':_0x1abcc0[_0x36546f(0xdb)]});}}}return{'outgoing':_0x441078,'incoming':_0x3add57};}async[a1_0x35b167(0xc5)](){const _0xfd188b=a1_0x35b167,_0x1b613c=this[_0xfd188b(0x125)]+'/api/management/library/scripts/list?appCode='+encodeURIComponent(this[_0xfd188b(0x116)])+_0xfd188b(0xf4);return await this['request'](_0x1b613c);}async[a1_0x35b167(0xf6)](_0x31c722){const _0x51121d=a1_0x35b167,_0x28f375=this[_0x51121d(0x125)]+_0x51121d(0xd8)+_0x31c722;return await this[_0x51121d(0x118)](_0x28f375);}async[a1_0x35b167(0xfa)](_0x4b5bad){const _0x3f7d73=a1_0x35b167,_0x478c78=this[_0x3f7d73(0x125)]+_0x3f7d73(0xd5),_0x5f22d9={'id':_0x4b5bad['id']??null,'appCode':_0x4b5bad[_0x3f7d73(0x116)],'description':_0x4b5bad[_0x3f7d73(0x101)],'scriptContent':_0x4b5bad[_0x3f7d73(0x128)],'scriptType':_0x4b5bad[_0x3f7d73(0xfe)]};return await this[_0x3f7d73(0xc7)](_0x478c78,_0x5f22d9);}async[a1_0x35b167(0xcd)](){const _0x299dac=a1_0x35b167,_0x1f03cd=this[_0x299dac(0x105)]+_0x299dac(0x123);return await this[_0x299dac(0xc7)](_0x1f03cd,{});}async['saveCustomSqlViaToolbox'](_0x32b9c8){const _0x8de18f=a1_0x35b167,_0x12a2e2=this['resolveToolboxUrl'](_0x8de18f(0xee),_0x8de18f(0x127)),_0x1f4ae7=await this[_0x8de18f(0xc7)](_0x12a2e2,_0x32b9c8);return _0x1f4ae7[_0x8de18f(0xc9)];}async['saveBffScriptViaToolbox'](_0x23ab6c){const _0x44fb0d=a1_0x35b167,_0x5367b5=this[_0x44fb0d(0x12d)]('save-bff','/api/node-toolbox/bff/save'),_0x2e92ce=await this['postRequest'](_0x5367b5,_0x23ab6c);return _0x2e92ce['data'];}}function a1_0x9e2c(){const _0x277a5e=['saveBffScript','getErConfig','forceRefresh','modelCode','scriptType','sqlContent','API\x20error:\x20','description','online','toolboxBaseUrl','ms.\x20The\x20server\x20may\x20be\x20down\x20or\x20unreachable.\x0aURL:\x20','runtimeDomain','/smartapi/dataset/get-driven-data?','errorMsg','no-relations','dataset-detail:','find','cookie','set','getCustomSqlList','dataset-list:','with-relations','2966Srzlnx','getDatasetDetail','datasets','toField','getDatasetRelations','er-configs-all:','appCode','code','request','API\x20request\x20failed:\x20HTTP\x20','_request','doVersion','fromField','getUniqueDbIds','sqlCode','24849qfFXvl','Authentication\x20failed.\x20Please\x20login\x20again.','930391jpbPLH','850GmaRfk','/api/management/script/cache/clear','1019680FgkInS','apiDomain','warn','/api/node-toolbox/sql/save','scriptContent','2558348unpXZe','push','tableData','toolboxBaseUrlOverride','resolveToolboxUrl','success','[getDatasetDetail]\x20Failed\x20to\x20fetch\x20relations\x20for\x20','includes','mcp:vibe','object','message','Failed\x20to\x20get\x20ER\x20config\x20for\x20dbId\x20','runtimeBaseUrl','toDatasetName','isArray','saveUserCustomSql','50IaQkUO','\x0aURL:\x20','getBffScriptList','searchDatasets','postRequest','Network\x20error:\x20Unable\x20to\x20connect\x20to\x20the\x20server.\x20Please\x20check\x20your\x20network\x20connection\x20or\x20the\x20server\x20may\x20be\x20down.\x0aURL:\x20','data','/smartapi/dataset/get-dataset-list','pageSize','process','clearBffScriptCache','length','params','87705ednSPh','datasetCode','839472fgugLi','12ZlElRS','from','/api/management/library/scripts/save','get','AbortError','/api/management/library/scripts/info?id=','test','dbId','joinType','name','getAllErConfigs','6eaiYAJ','GET','/api/custom/executeSql','datasetName','toDataset','status','12TKdbPZ','toLowerCase','DEFAULT_TIMEOUT','add','POST','env','dbtableConfig','apiBaseUrl','API\x20request\x20timeout\x20after\x20','/smartapi/custom/updateUserCustomSql','save-sql','/smartapi/custom/saveUserCustomSql','updateUserCustomSql','sqlName','/smartapi/question/er-config','18UNpdKA','&type=ENDPOINT','tableName','getBffScriptInfo','text','currentPage','relations'];a1_0x9e2c=function(){return _0x277a5e;};return a1_0x9e2c();}
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 +1 @@
1
- (function(_0x1258b0,_0x43c246){var _0xb03c1a=a2_0x2548,_0x13018f=_0x1258b0();while(!![]){try{var _0x213129=-parseInt(_0xb03c1a(0x1b6))/0x1+-parseInt(_0xb03c1a(0x1b8))/0x2*(-parseInt(_0xb03c1a(0x1b5))/0x3)+parseInt(_0xb03c1a(0x1b9))/0x4*(parseInt(_0xb03c1a(0x1b4))/0x5)+-parseInt(_0xb03c1a(0x1ba))/0x6*(-parseInt(_0xb03c1a(0x1b7))/0x7)+-parseInt(_0xb03c1a(0x1b1))/0x8+-parseInt(_0xb03c1a(0x1b3))/0x9+-parseInt(_0xb03c1a(0x1b2))/0xa;if(_0x213129===_0x43c246)break;else _0x13018f['push'](_0x13018f['shift']());}catch(_0x407aab){_0x13018f['push'](_0x13018f['shift']());}}}(a2_0x4371,0xda8f7));function a2_0x2548(_0x4a55ba,_0x3f7839){_0x4a55ba=_0x4a55ba-0x1b1;var _0x4371ad=a2_0x4371();var _0x2548bc=_0x4371ad[_0x4a55ba];return _0x2548bc;}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_0x4371(){var _0x59d7c0=['1266645jwLMIW','4762302YQBGyd','214343wMSsLX','7YGPRQG','2ERnfyb','8FUDfwc','6645624CysdgC','979304EWFuqF','13905880NrYehn','5212161PcymbW'];a2_0x4371=function(){return _0x59d7c0;};return a2_0x4371();}export{resolveApiBaseUrl}from'../config/api-url-resolver.js';
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 +1 @@
1
- function a3_0x39f6(_0x16adf8,_0x10c707){_0x16adf8=_0x16adf8-0x9a;const _0x3f575b=a3_0x3f57();let _0x39f623=_0x3f575b[_0x16adf8];return _0x39f623;}(function(_0x1bf88e,_0x5c9fb6){const _0x398fad=a3_0x39f6,_0x48117c=_0x1bf88e();while(!![]){try{const _0x24f7cd=-parseInt(_0x398fad(0xa2))/0x1+-parseInt(_0x398fad(0xa0))/0x2*(parseInt(_0x398fad(0xa5))/0x3)+-parseInt(_0x398fad(0x9f))/0x4*(parseInt(_0x398fad(0x9d))/0x5)+parseInt(_0x398fad(0x9a))/0x6+parseInt(_0x398fad(0xa1))/0x7*(parseInt(_0x398fad(0xa4))/0x8)+-parseInt(_0x398fad(0x9e))/0x9+parseInt(_0x398fad(0xa3))/0xa*(parseInt(_0x398fad(0xa6))/0xb);if(_0x24f7cd===_0x5c9fb6)break;else _0x48117c['push'](_0x48117c['shift']());}catch(_0x4ed639){_0x48117c['push'](_0x48117c['shift']());}}}(a3_0x3f57,0x26912));function a3_0x3f57(){const _0x25df24=['136pLKUPm','644709TvJFrE','7666879zpRVmJ','739422OXCCnq','length','utf-8','225580Laqydf','1909377tlrqcc','4hQMqin','2yrQDwN','21497vajUXH','242291FDoSuh','10ykXdHP'];a3_0x3f57=function(){return _0x25df24;};return a3_0x3f57();}import{readFileSync,writeFileSync}from'node:fs';import{getEnvAuthCookie,cookieFile}from'../config/env.js';export function getCookie(){const _0x551b70=a3_0x39f6,_0x3ce611=getEnvAuthCookie();if(_0x3ce611)return _0x3ce611;try{return readFileSync(cookieFile,_0x551b70(0x9c))['trim']();}catch{return'';}}export function saveCookie(_0x53d1ff){const _0x3ccf1f=a3_0x39f6;try{writeFileSync(cookieFile,_0x53d1ff,_0x3ccf1f(0x9c));}catch(_0xa546e7){throw new Error('Failed\x20to\x20save\x20cookie\x20to\x20'+cookieFile+':\x20'+_0xa546e7['message']);}}export function hasCookie(){const _0xa6d552=a3_0x39f6,_0x2fe0d9=getCookie();return _0x2fe0d9[_0xa6d552(0x9b)]>0x0;}export function clearCookie(){const _0x2f111b=a3_0x39f6;try{writeFileSync(cookieFile,'',_0x2f111b(0x9c));}catch{}}
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 +1 @@
1
- (function(_0x46f393,_0x10c1b5){const _0x4be0d8=a4_0x5e16,_0x286960=_0x46f393();while(!![]){try{const _0x44d43f=parseInt(_0x4be0d8(0xbf))/0x1*(parseInt(_0x4be0d8(0xc3))/0x2)+parseInt(_0x4be0d8(0xc1))/0x3+-parseInt(_0x4be0d8(0xc7))/0x4+parseInt(_0x4be0d8(0xc6))/0x5*(-parseInt(_0x4be0d8(0xc5))/0x6)+-parseInt(_0x4be0d8(0xc8))/0x7*(parseInt(_0x4be0d8(0xbc))/0x8)+parseInt(_0x4be0d8(0xbd))/0x9+parseInt(_0x4be0d8(0xc4))/0xa;if(_0x44d43f===_0x10c1b5)break;else _0x286960['push'](_0x286960['shift']());}catch(_0x52b328){_0x286960['push'](_0x286960['shift']());}}}(a4_0x2321,0xa68f5));import{getCookie}from'./cookie-manager.js';function a4_0x5e16(_0x280974,_0x5a29b2){_0x280974=_0x280974-0xbc;const _0x232101=a4_0x2321();let _0x5e16e7=_0x232101[_0x280974];return _0x5e16e7;}import{getUserDomain}from'../config/env.js';function a4_0x2321(){const _0x5ebca1=['217846ULtkfu','25015810aqWEWR','78IYQqDt','500730WpPDUK','3043476IchcCm','7EJBmqA','5927176gNHhhL','5494473wfSpWp','json','1cHeDYX','/api/auth/get-session','794676jeiEPD','user'];a4_0x2321=function(){return _0x5ebca1;};return a4_0x2321();}export async function isSessionValid(){const _0x4638e4=a4_0x5e16,_0x137c11=getCookie();if(!_0x137c11)return![];try{const _0x23a480=await fetch(getUserDomain()+_0x4638e4(0xc0),{'headers':{'cookie':_0x137c11}});if(!_0x23a480['ok'])return![];const _0x3d4245=await _0x23a480[_0x4638e4(0xbe)]();return!!(_0x3d4245?.['session']&&_0x3d4245?.[_0x4638e4(0xc2)]);}catch{return![];}}
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 +1 @@
1
- (function(_0x28a440,_0x9e1fa2){const _0x5c7ef9=a5_0x2794,_0x3e8810=_0x28a440();while(!![]){try{const _0x8983cc=parseInt(_0x5c7ef9(0x98))/0x1+parseInt(_0x5c7ef9(0x93))/0x2+parseInt(_0x5c7ef9(0x94))/0x3*(-parseInt(_0x5c7ef9(0x91))/0x4)+parseInt(_0x5c7ef9(0x97))/0x5+parseInt(_0x5c7ef9(0x95))/0x6*(-parseInt(_0x5c7ef9(0x8e))/0x7)+-parseInt(_0x5c7ef9(0x8f))/0x8+parseInt(_0x5c7ef9(0x96))/0x9;if(_0x8983cc===_0x9e1fa2)break;else _0x3e8810['push'](_0x3e8810['shift']());}catch(_0x5e2817){_0x3e8810['push'](_0x3e8810['shift']());}}}(a5_0x3076,0xcb445));import{getEnvToolboxBaseUrl,getEffectiveApiDomain}from'./env.js';function a5_0x3076(){const _0x1a0640=['env','1128GQKQRC','LOVRABET_API_URL_OVERRIDES','2121064egVTwJ','6753XOvaBs','3146790ufLmFz','5667480ZjPcYV','5913120KxOfPd','299319AcWEEi','[MCP]\x20LOVRABET_API_URL_OVERRIDES\x20is\x20not\x20valid\x20JSON,\x20ignoring','21AfMuru','1051496VtxlYO'];a5_0x3076=function(){return _0x1a0640;};return a5_0x3076();}import{getConfigApiUrlOverrides}from'./lovrabet-config.js';function a5_0x2794(_0x48658c,_0x5260d0){_0x48658c=_0x48658c-0x8d;const _0x3076e4=a5_0x3076();let _0x27949b=_0x3076e4[_0x48658c];return _0x27949b;}let _envOverridesCache=null;function getEnvApiUrlOverrides(){const _0x22d848=a5_0x2794;if(_envOverridesCache!==null)return _envOverridesCache;const _0x106028=process[_0x22d848(0x90)][_0x22d848(0x92)];if(!_0x106028)return _envOverridesCache={},_envOverridesCache;try{_envOverridesCache=JSON['parse'](_0x106028);}catch{process[_0x22d848(0x90)]['MCP_DEBUG']&&console['warn'](_0x22d848(0x8d)),_envOverridesCache={};}return _envOverridesCache;}export function resolveApiBaseUrl(_0x4bff6e){const _0x2c42bd=getEnvApiUrlOverrides();if(_0x2c42bd[_0x4bff6e])return _0x2c42bd[_0x4bff6e];const _0x2eb5de=getConfigApiUrlOverrides();if(_0x2eb5de[_0x4bff6e])return _0x2eb5de[_0x4bff6e];return getEnvToolboxBaseUrl()??getEffectiveApiDomain();}export function clearApiUrlOverridesCache(){_envOverridesCache=null;}
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 +1 @@
1
- const a6_0x58f277=a6_0x2915;(function(_0xaaf08,_0x3f1729){const _0x51fa1d=a6_0x2915,_0x5abfce=_0xaaf08();while(!![]){try{const _0xcce8e6=parseInt(_0x51fa1d(0x150))/0x1*(parseInt(_0x51fa1d(0x142))/0x2)+parseInt(_0x51fa1d(0x138))/0x3+parseInt(_0x51fa1d(0x14d))/0x4*(parseInt(_0x51fa1d(0x13e))/0x5)+parseInt(_0x51fa1d(0x13b))/0x6+-parseInt(_0x51fa1d(0x145))/0x7*(parseInt(_0x51fa1d(0x143))/0x8)+parseInt(_0x51fa1d(0x13a))/0x9+-parseInt(_0x51fa1d(0x139))/0xa;if(_0xcce8e6===_0x3f1729)break;else _0x5abfce['push'](_0x5abfce['shift']());}catch(_0x198adf){_0x5abfce['push'](_0x5abfce['shift']());}}}(a6_0x2198,0x1babb));import{mkdirSync}from'node:fs';import{homedir}from'node:os';const ENVIRONMENT_MAPPING={'online':'production','production':a6_0x58f277(0x14e),'daily':a6_0x58f277(0x131),'dev':a6_0x58f277(0x13d),'development':a6_0x58f277(0x13d)};function normalizeEnvironment(_0x22b937){const _0x3f26fa=a6_0x58f277;if(!_0x22b937)return'production';const _0x14da20=_0x22b937[_0x3f26fa(0x151)](),_0x5827c6=ENVIRONMENT_MAPPING[_0x14da20];if(!_0x5827c6)return console[_0x3f26fa(0x136)](_0x3f26fa(0x13f)+_0x22b937+_0x3f26fa(0x149)),_0x3f26fa(0x14e);return _0x5827c6!==_0x14da20&&_0x5827c6!==_0x22b937&&console[_0x3f26fa(0x148)](_0x3f26fa(0x134)+_0x22b937+_0x3f26fa(0x14f)+_0x5827c6),_0x5827c6;}export function getEnvAppCode(){const _0x22e28f=a6_0x58f277;return process[_0x22e28f(0x13c)]['LOVRABET_APP_CODE'];}export function getEnvironment(){const _0x57ccef=a6_0x58f277,_0x8fde2d=process[_0x57ccef(0x13c)]['LOVRABET_ENV'];return normalizeEnvironment(_0x8fde2d);}export function getEnvApiBaseUrl(){const _0x51a9bf=a6_0x58f277;return process[_0x51a9bf(0x13c)]['LOVRABET_API_BASEURL'];}export function getEnvRuntimeBaseUrl(){const _0x31c4ba=a6_0x58f277;return process['env'][_0x31c4ba(0x140)];}export function getEnvUserBaseUrl(){const _0x427778=a6_0x58f277;return process[_0x427778(0x13c)]['LOVRABET_USER_BASEURL'];}export function getEnvAuthCookie(){const _0x143717=a6_0x58f277;return process['env'][_0x143717(0x14a)]?.['trim']();}export function isTestEnv(){const _0x14abab=a6_0x58f277;return process[_0x14abab(0x13c)][_0x14abab(0x141)]===_0x14abab(0x133);}export function isProductionEnv(){const _0x1e7e58=a6_0x58f277;return process[_0x1e7e58(0x13c)]['NODE_ENV']===_0x1e7e58(0x14e);}export function isDevelopmentEnv(){const _0x69cccf=a6_0x58f277;return process[_0x69cccf(0x13c)][_0x69cccf(0x141)]===_0x69cccf(0x13d);}export function shouldLog(){const _0x43b5a9=a6_0x58f277,_0x1cc324=process[_0x43b5a9(0x13c)]['NODE_ENV'];return _0x1cc324===_0x43b5a9(0x13d)||_0x1cc324===_0x43b5a9(0x131);}export const configDir=homedir()+a6_0x58f277(0x137);function a6_0x2198(){const _0x482d39=['test','[ENV]\x20Environment\x20mapping:\x20','LOVRABET_TOOLBOX_BASEURL','warn','/.lovrabet','347760SoyEci','4296820meVVrT','538254VYJwdg','1201986mIwxiI','env','development','49345gaDUcK','[ENV]\x20Unknown\x20environment:\x20','LOVRABET_RUNTIME_BASEURL','NODE_ENV','35124ZwKTDr','1270936WVVUUU','https://daily-api.lovrabet.com','7RRKXaY','https://api.lovrabet.com','https://user-daily.lovrabet.com','log',',\x20using\x20default\x20production','LOVRABET_AUTH_COOKIE','/cookie','https://runtime.lovrabet.com','68IZwWqp','production','\x20→\x20','9iTNsQS','toLowerCase','https://dev.lovrabet.com','daily','https://user.lovrabet.com'];a6_0x2198=function(){return _0x482d39;};return a6_0x2198();}export const cookieFile=configDir+a6_0x58f277(0x14b);mkdirSync(configDir,{'recursive':!![]});export const defaultConfig={'appCode':getEnvAppCode(),'env':getEnvironment()};export function getEnvAppCodeWithFallback(_0x38748b){return getEnvAppCode()||_0x38748b;}export function getApiDomain(){const _0x1e84ee=a6_0x58f277,_0x24f97a=getEnvironment(),_0xbed4b9={'production':_0x1e84ee(0x146),'online':_0x1e84ee(0x146),'daily':_0x1e84ee(0x144),'development':_0x1e84ee(0x152)};return _0xbed4b9[_0x24f97a];}function a6_0x2915(_0x38b313,_0x1d3edb){_0x38b313=_0x38b313-0x131;const _0x2198e8=a6_0x2198();let _0x2915c7=_0x2198e8[_0x38b313];return _0x2915c7;}export function getUserDomain(){const _0x2b96a3=a6_0x58f277,_0x4d0b19=getEnvironment(),_0x297f43={'production':_0x2b96a3(0x132),'online':_0x2b96a3(0x132),'daily':_0x2b96a3(0x147),'development':_0x2b96a3(0x152)};return _0x297f43[_0x4d0b19];}export function getRuntimeDomain(){const _0x3bdc2f=a6_0x58f277,_0x3c2dba=getEnvironment(),_0x4127dd={'production':_0x3bdc2f(0x14c),'online':_0x3bdc2f(0x14c),'daily':'https://daily-runtime.lovrabet.com','development':'https://dev.lovrabet.com'};return _0x4127dd[_0x3c2dba];}export function getEffectiveApiDomain(){return getEnvApiBaseUrl()||getApiDomain();}export function getEffectiveRuntimeDomain(){return getEnvRuntimeBaseUrl()||getRuntimeDomain();}export function getEffectiveUserDomain(){return getEnvUserBaseUrl()||getUserDomain();}export function getEnvToolboxBaseUrl(){const _0x15542c=a6_0x58f277;return process[_0x15542c(0x13c)][_0x15542c(0x135)];}export function getEffectiveToolboxDomain(){return getEnvToolboxBaseUrl()||getEffectiveApiDomain();}
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 +1 @@
1
- (function(_0x40cfe7,_0x122ab5){const _0x1509b7=a7_0x4c0b,_0x3b1973=_0x40cfe7();while(!![]){try{const _0x4b7e8b=parseInt(_0x1509b7(0xf2))/0x1+-parseInt(_0x1509b7(0xfb))/0x2+-parseInt(_0x1509b7(0xf3))/0x3*(parseInt(_0x1509b7(0xf1))/0x4)+-parseInt(_0x1509b7(0xfe))/0x5+-parseInt(_0x1509b7(0xf4))/0x6*(parseInt(_0x1509b7(0xfd))/0x7)+-parseInt(_0x1509b7(0xf9))/0x8+parseInt(_0x1509b7(0xf8))/0x9;if(_0x4b7e8b===_0x122ab5)break;else _0x3b1973['push'](_0x3b1973['shift']());}catch(_0x11ec29){_0x3b1973['push'](_0x3b1973['shift']());}}}(a7_0x9a51,0x7a91d));import{existsSync,readFileSync}from'node:fs';import{configDir}from'./env.js';let _cache=null;function a7_0x4c0b(_0x3e208c,_0x19aa92){_0x3e208c=_0x3e208c-0xf0;const _0x9a51a9=a7_0x9a51();let _0x4c0b57=_0x9a51a9[_0x3e208c];return _0x4c0b57;}function readConfigFile(){const _0x2f43bc=a7_0x4c0b;if(_cache!==null)return _cache;const _0x4d4c2b=configDir+'/config.json';if(!existsSync(_0x4d4c2b))return _cache={},_cache;try{_cache=JSON[_0x2f43bc(0xf6)](readFileSync(_0x4d4c2b,_0x2f43bc(0xf0)));}catch{process[_0x2f43bc(0xfc)][_0x2f43bc(0xff)]&&console[_0x2f43bc(0xf5)]('[MCP]\x20Failed\x20to\x20parse\x20'+_0x4d4c2b+_0x2f43bc(0xfa)),_cache={};}return _cache;}function a7_0x9a51(){const _0x1124b8=['parse','apiUrlOverrides','22460238saDSfF','4785000DNtvgP',',\x20using\x20empty\x20config','520982QfDxlZ','env','7tSvmDv','224540YOMSic','MCP_DEBUG','utf-8','1854032dahASj','840471MJPghQ','6qhwzwL','6020808woufdF','warn'];a7_0x9a51=function(){return _0x1124b8;};return a7_0x9a51();}export function getConfigApiUrlOverrides(){const _0x5e26d4=a7_0x4c0b;return readConfigFile()[_0x5e26d4(0xf7)]??{};}export function clearConfigCache(){_cache=null;}
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;}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a8_0x34defc=a8_0x24cf;(function(_0x1cf459,_0x5daab9){const _0x39b270=a8_0x24cf,_0x464c1c=_0x1cf459();while(!![]){try{const _0x2133ce=-parseInt(_0x39b270(0x1be))/0x1*(-parseInt(_0x39b270(0x1b1))/0x2)+-parseInt(_0x39b270(0x1b4))/0x3*(-parseInt(_0x39b270(0x1b7))/0x4)+parseInt(_0x39b270(0x1c7))/0x5*(parseInt(_0x39b270(0x1bd))/0x6)+-parseInt(_0x39b270(0x1ac))/0x7*(-parseInt(_0x39b270(0x1c9))/0x8)+parseInt(_0x39b270(0x1b9))/0x9*(parseInt(_0x39b270(0x1bf))/0xa)+parseInt(_0x39b270(0x1c8))/0xb*(parseInt(_0x39b270(0x1af))/0xc)+parseInt(_0x39b270(0x1c1))/0xd*(-parseInt(_0x39b270(0x1c0))/0xe);if(_0x2133ce===_0x5daab9)break;else _0x464c1c['push'](_0x464c1c['shift']());}catch(_0x1f5f46){_0x464c1c['push'](_0x464c1c['shift']());}}}(a8_0x1967,0xb0aac));import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{createServer}from'./server.js';function parseArgs(){const _0x2a7b09=a8_0x24cf,_0x245f0d=process['argv'][_0x2a7b09(0x1ae)](0x2),_0x98a803=_0x245f0d[_0x2a7b09(0x1b2)](_0x2a7b09(0x1ad))||_0x245f0d[_0x2a7b09(0x1b2)](_0x2a7b09(0x1b5));return process[_0x2a7b09(0x1bb)][_0x2a7b09(0x1ab)]&&_0x245f0d[_0x2a7b09(0x1b2)](_0x2a7b09(0x1b5))&&!_0x245f0d[_0x2a7b09(0x1b2)](_0x2a7b09(0x1ad))&&console[_0x2a7b09(0x1c6)]('[MCP]\x20--dangerously-bff-save\x20is\x20deprecated;\x20use\x20--enable-bff-save\x20(same\x20behavior)'),{'bffSaveEnabled':_0x98a803};}async function main(){const _0xc3a5a5=a8_0x24cf;try{const {bffSaveEnabled:_0x3d4a44}=parseArgs(),_0x43a0e5=createServer({'bffSaveEnabled':_0x3d4a44}),_0x47d497=new StdioServerTransport();_0x43a0e5[_0xc3a5a5(0x1ba)](),await _0x43a0e5[_0xc3a5a5(0x1b3)](_0x47d497),process['on']('SIGINT',async()=>{const _0x37eed5=_0xc3a5a5;process[_0x37eed5(0x1bb)][_0x37eed5(0x1ab)]&&console[_0x37eed5(0x1c5)](_0x37eed5(0x1c3)),process[_0x37eed5(0x1c2)](0x0);}),process['on'](_0xc3a5a5(0x1c4),async()=>{const _0x1e9d7a=_0xc3a5a5;process[_0x1e9d7a(0x1bb)][_0x1e9d7a(0x1ab)]&&console[_0x1e9d7a(0x1c5)](_0x1e9d7a(0x1c3)),process['exit'](0x0);});}catch(_0x2b7f09){console['error'](_0xc3a5a5(0x1b8),_0x2b7f09),process[_0xc3a5a5(0x1c2)](0x1);}}function a8_0x24cf(_0x59531e,_0x222b98){_0x59531e=_0x59531e-0x1ab;const _0x1967aa=a8_0x1967();let _0x24cff6=_0x1967aa[_0x59531e];return _0x24cff6;}function a8_0x1967(){const _0x545900=['MCP_DEBUG','7lTMVcs','--enable-bff-save','slice','726960gpOihK','catch','1673886vzewSm','includes','connect','843YygMju','--dangerously-bff-save','Unhandled\x20error:','13556kcxewI','Failed\x20to\x20start\x20Lovrabet\x20Dataset\x20MCP\x20Server:','45405LufGWU','logInfo','env','error','615798ZeVNNF','1ZbeGNW','410gTRlhp','14182AxDRON','39221TPBbXS','exit','Shutting\x20down\x20Lovrabet\x20Dataset\x20MCP\x20Server...','SIGTERM','log','warn','60qtsXxp','77sHhHFP','1024768vwVzWl'];a8_0x1967=function(){return _0x545900;};return a8_0x1967();}main()[a8_0x34defc(0x1b0)](_0x4406a1=>{const _0x3d11bb=a8_0x34defc;console[_0x3d11bb(0x1bc)](_0x3d11bb(0x1b6),_0x4406a1),process[_0x3d11bb(0x1c2)](0x1);});
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);});
package/dist/server.js CHANGED
@@ -1 +1 @@
1
- const a9_0x2abb8e=a9_0x4c60;(function(_0x3c78e6,_0x2010c1){const _0x3a1170=a9_0x4c60,_0xc082b3=_0x3c78e6();while(!![]){try{const _0x4d4dbe=parseInt(_0x3a1170(0x17a))/0x1*(parseInt(_0x3a1170(0x186))/0x2)+-parseInt(_0x3a1170(0x1bd))/0x3*(-parseInt(_0x3a1170(0x17b))/0x4)+-parseInt(_0x3a1170(0x18e))/0x5+parseInt(_0x3a1170(0x19b))/0x6*(-parseInt(_0x3a1170(0x1d3))/0x7)+-parseInt(_0x3a1170(0x170))/0x8*(-parseInt(_0x3a1170(0x17f))/0x9)+-parseInt(_0x3a1170(0x178))/0xa*(parseInt(_0x3a1170(0x177))/0xb)+-parseInt(_0x3a1170(0x1c5))/0xc*(-parseInt(_0x3a1170(0x1a4))/0xd);if(_0x4d4dbe===_0x2010c1)break;else _0xc082b3['push'](_0xc082b3['shift']());}catch(_0x2552da){_0xc082b3['push'](_0xc082b3['shift']());}}}(a9_0x5b28,0xa0fa7));function a9_0x5b28(){const _0x472748=['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.','SQL\x20parameters','Client-side\x20filter\x20by\x20name/description/content','Dataset\x20codes\x20to\x20validate\x20against','bff','list_datasets','Lovrabet\x20Dataset\x20MCP\x20Server','log','Execute\x20Custom\x20SQL','Generate\x20SDK\x20Code','SQL\x20name/label\x20(optional;\x20MCP\x20auto-extracts\x20from\x20@lovrabet.sqlName\x20comment,\x20or\x20toolbox\x20generates\x20fallback)','Validate\x20SQL\x20content\x20without\x20saving.\x20Detects\x20SQL\x20type\x20(SELECT/INSERT/UPDATE/DELETE/DDL)\x20and\x20validates\x20table/column\x20existence.\x20Supports\x20MyBatis\x20syntax.','generate_sdk_code','MCP_DEBUG','3smEwJI','Server\x20started\x20successfully','SQL\x20content\x20(SELECT/INSERT/UPDATE/WITH\x20auto-saved;\x20DELETE/DDL\x20blocked).\x20Supports\x20MyBatis\x20syntax.','mcpServer','SQL\x20content\x20to\x20validate','Save\x20or\x20Update\x20Custom\x20SQL','Known\x20sqlCode\x20—\x20use\x20to\x20directly\x20target\x20the\x20record\x20for\x20update,\x20skipping\x20name\x20lookup','Login\x20to\x20Lovrabet\x20to\x20authenticate\x20for\x20dataset\x20queries.','12998712fFYGRn','get_dataset_operations','Get\x20list\x20of\x20all\x20API\x20operations\x20for\x20a\x20dataset.\x20Prefer\x20\x22filter\x22\x20for\x20queries,\x20\x22getOne\x22\x20for\x20single\x20record\x20by\x20ID.','Include\x20table\x20relations\x20(default:\x20true)','Get\x20Operation\x20Detail','generate_sql_code','daily','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','JavaScript/TypeScript\x20code\x20with\x20default\x20export','Conflict\x20detection\x20is\x20handled\x20server-side\x20by\x20toolbox','registerAllTools','Search\x20keyword','list_bff_scripts','Server-side\x20fuzzy\x20match\x20by\x20sqlName','28aAyqvO','stringify','Generate\x20SQL\x20Code','List\x20Backend\x20Functions','List\x20SQL\x20Queries','Authentication\x20cookie\x20(optional,\x20uses\x20stored\x20cookie\x20from\x20login\x20if\x20not\x20provided)','Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update)','8rkYGaY','string','List\x20all\x20available\x20custom\x20SQL\x20queries\x20with\x20metadata\x20and\x20parameters.','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.','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode.\x20Get\x20sqlCode\x20from\x20list_sql_queries\x20first.','connect','Environment\x20(optional,\x20uses\x20LOVRABET_ENV\x20or\x20defaults\x20to\x20online)','4453262LTVPCR','10XDfYuX','get_dataset_detail','1ssRpoF','2902620adaFHE','Generate\x20code\x20for\x20a\x20custom\x20SQL\x20query.\x20Validates\x20sqlCode\x20exists\x20first.\x20Use\x20target\x20to\x20switch\x20between\x20Frontend\x20SDK\x20and\x20Backend\x20Function\x20code\x20patterns.','Database\x20ID\x20(optional)','get_bff_script_info','7222086NbfUyQ','Use\x20camelCase\x20alias\x20instead\x20of\x20dataset_[code]\x20pattern\x20(default:\x20false)','array','Example\x20parameter\x20values','Get\x20detailed\x20operation\x20information\x20including\x20request/response\x20examples.','record','logInfo','455458XSUFAp','optional','Include\x20import\x20statements\x20(default:\x20true)','list_sql_queries','options','Backend\x20Function\x20ID\x20(from\x20list_bff_scripts)','login','get_operation_detail','2417835DbENGi','close','Dataset\x20code/ID','enum','Unknown\x20error\x20occurred','SQL\x20code\x20from\x20list_sql_queries\x20(must\x20exist)','Application\x20code\x20(optional\x20if\x20LOVRABET_APP_CODE\x20env\x20var\x20is\x20set)','min','sdk','../package.json','Get\x20Dataset\x20Detail','Items\x20per\x20page\x20(default:\x20999)','message','1936932CedEfB','Version:\x20','Get\x20Backend\x20Function\x20Info','Get\x20Operations','bffSaveEnabled','Server-side\x20fuzzy\x20match\x20by\x20sqlCode','search_datasets','version','save_or_update_custom_sql','13jFsBqx','SQL\x20ID\x20(kept\x20for\x20backward\x20compatibility,\x20not\x20used\x20by\x20toolbox)','union','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.','Validate\x20SQL\x20Content','save_or_update_bff_script','Client-side\x20filter\x20by\x20category','env','boolean','number','describe'];a9_0x5b28=function(){return _0x472748;};return a9_0x5b28();}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_0x2abb8e(0x197)),authSchema={'appCode':z[a9_0x2abb8e(0x171)]()[a9_0x2abb8e(0x187)]()[a9_0x2abb8e(0x1ae)](a9_0x2abb8e(0x194)),'cookie':z[a9_0x2abb8e(0x171)]()['optional']()[a9_0x2abb8e(0x1ae)](a9_0x2abb8e(0x16e))};function registerToolWithOptions(_0x1f2dea,_0x10e0fc,_0x1dad6a,_0xe7eb4a){_0x1f2dea['registerTool'](_0x10e0fc,_0x1dad6a,_0xe7eb4a);}function wrapHandler(_0x47ac1d){return async _0x52b8fd=>{const _0x242d73=a9_0x4c60;try{const _0x52cde4=await _0x47ac1d(_0x52b8fd);return{'content':[{'type':'text','text':JSON['stringify'](_0x52cde4,null,0x2)}]};}catch(_0x1bbcb9){return{'content':[{'type':'text','text':JSON[_0x242d73(0x16a)]({'error':!![],'message':_0x1bbcb9[_0x242d73(0x19a)]||_0x242d73(0x192)},null,0x2)}],'isError':!![]};}};}export class LovrabetDatasetMCPServer{[a9_0x2abb8e(0x1c0)];['options'];constructor(_0x2d8b85={}){const _0x58abb9=a9_0x2abb8e;this[_0x58abb9(0x18a)]=_0x2d8b85,this[_0x58abb9(0x1c0)]=new McpServer({'name':'lovrabet-dataset-mcp','version':packageJson['version']},{'capabilities':{'tools':{}},'instructions':buildInstructions(_0x2d8b85)}),this[_0x58abb9(0x1cf)]();}[a9_0x2abb8e(0x1cf)](){const _0x4ae62e=a9_0x2abb8e;registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x18c),{'title':'Login','description':_0x4ae62e(0x1c4),'inputSchema':{'env':z[_0x4ae62e(0x191)](['online',_0x4ae62e(0x1cb)])[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x176))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(login)),registerToolWithOptions(this['mcpServer'],_0x4ae62e(0x1b4),{'title':'List\x20Datasets','description':'Get\x20list\x20of\x20all\x20datasets\x20with\x20metadata\x20and\x20table\x20relations\x20(ER\x20Config).\x20Use\x20includeRelations:\x20false\x20for\x20faster\x20response.','inputSchema':{...authSchema,'forceRefresh':z[_0x4ae62e(0x1ac)]()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)]('Bypass\x20cache\x20(default:\x20false)'),'includeRelations':z[_0x4ae62e(0x1ac)]()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1c8))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listDatasets)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x1a1),{'title':'Search\x20Datasets','description':'Search\x20datasets\x20by\x20keyword\x20(searches\x20in\x20name,\x20table\x20name,\x20code,\x20and\x20description).','inputSchema':{...authSchema,'keyword':z['string']()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1d0))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(searchDatasets)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x179),{'title':_0x4ae62e(0x198),'description':'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).','inputSchema':{...authSchema,'datasetCode':z['string']()['describe']('Dataset\x20ID\x20(numeric)\x20or\x20code\x20(UUID)'),'forceRefresh':z['boolean']()[_0x4ae62e(0x187)]()['describe']('Bypass\x20cache\x20(default:\x20false)'),'includeRelations':z['boolean']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)]('Include\x20bidirectional\x20relations,\x20summary,\x20and\x20usage\x20hints\x20(default:\x20true)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetDetail)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x1c6),{'title':_0x4ae62e(0x19e),'description':_0x4ae62e(0x1c7),'inputSchema':{...authSchema,'datasetCode':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x1ae)]('Dataset\x20ID\x20(numeric)\x20or\x20code\x20(UUID)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetOperations)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x18d),{'title':_0x4ae62e(0x1c9),'description':_0x4ae62e(0x183),'inputSchema':{...authSchema,'datasetCode':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x190)),'operationName':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x16f))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getOperationDetail)),registerToolWithOptions(this['mcpServer'],_0x4ae62e(0x1bb),{'title':_0x4ae62e(0x1b8),'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[_0x4ae62e(0x171)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x190)),'operationName':z[_0x4ae62e(0x171)]()['describe']('Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update)'),'includeImports':z[_0x4ae62e(0x1ac)]()['optional']()[_0x4ae62e(0x1ae)](_0x4ae62e(0x188)),'useAlias':z[_0x4ae62e(0x1ac)]()['optional']()[_0x4ae62e(0x1ae)](_0x4ae62e(0x180))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSDKCode)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x189),{'title':_0x4ae62e(0x16d),'description':_0x4ae62e(0x172),'inputSchema':{...authSchema,'keyword':z['string']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1b1)),'category':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1aa)),'sqlCode':z['string']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1a0)),'sqlName':z['string']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1d2)),'pageSize':z[_0x4ae62e(0x1ad)]()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x199)),'currentPage':z[_0x4ae62e(0x1ad)]()['optional']()[_0x4ae62e(0x1ae)]('Page\x20number\x20(default:\x201)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listSqlQueries)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],'execute_custom_sql',{'title':_0x4ae62e(0x1b7),'description':_0x4ae62e(0x174),'inputSchema':{...authSchema,'sqlCode':z[_0x4ae62e(0x171)]()['min'](0x1)[_0x4ae62e(0x1ae)]('SQL\x20code\x20from\x20list_sql_queries\x20->\x20sqlCode'),'params':z[_0x4ae62e(0x184)](z[_0x4ae62e(0x1a6)]([z[_0x4ae62e(0x171)](),z[_0x4ae62e(0x1ad)]()]))['optional']()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1b0))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(executeCustomSql)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x1ca),{'title':_0x4ae62e(0x16b),'description':_0x4ae62e(0x17c),'inputSchema':{...authSchema,'sqlCode':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x195)](0x1)[_0x4ae62e(0x1ae)](_0x4ae62e(0x193)),'params':z[_0x4ae62e(0x184)](z[_0x4ae62e(0x1a6)]([z['string'](),z[_0x4ae62e(0x1ad)]()]))[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x182)),'includeImports':z[_0x4ae62e(0x1ac)]()['optional']()[_0x4ae62e(0x1ae)](_0x4ae62e(0x188)),'target':z[_0x4ae62e(0x191)]([_0x4ae62e(0x196),_0x4ae62e(0x1b3)])[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x173))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSqlCode)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],'validate_sql_content',{'title':_0x4ae62e(0x1a8),'description':_0x4ae62e(0x1ba),'inputSchema':{...authSchema,'sqlContent':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x195)](0x1)[_0x4ae62e(0x1ae)](_0x4ae62e(0x1c1)),'dbId':z[_0x4ae62e(0x1ad)]()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x17d)),'validateSchemas':z[_0x4ae62e(0x181)](z[_0x4ae62e(0x171)]())[_0x4ae62e(0x187)]()['describe'](_0x4ae62e(0x1b2))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(validateSqlContent)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x1a3),{'title':_0x4ae62e(0x1c2),'description':_0x4ae62e(0x1af),'inputSchema':{...authSchema,'sqlName':z['string']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1b9)),'sqlCode':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x187)]()['describe'](_0x4ae62e(0x1c3)),'dbId':z[_0x4ae62e(0x1ad)]()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)]('Database\x20ID\x20from\x20get_dataset_detail\x20—\x20required\x20when\x20creating\x20new\x20SQL,\x20optional\x20when\x20updating'),'sqlContent':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x195)](0x1)[_0x4ae62e(0x1ae)](_0x4ae62e(0x1bf)),'id':z['number']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1a5))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':![]}},wrapHandler(saveOrUpdateCustomSql)),this['options']['bffSaveEnabled']&&(registerToolWithOptions(this['mcpServer'],_0x4ae62e(0x1d1),{'title':_0x4ae62e(0x16c),'description':'List\x20all\x20Backend\x20Function\x20(ENDPOINT\x20type)\x20scripts.','inputSchema':{...authSchema},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listBffScripts)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x17e),{'title':_0x4ae62e(0x19d),'description':'Get\x20detailed\x20Backend\x20Function\x20script\x20including\x20full\x20source\x20code.','inputSchema':{...authSchema,'id':z[_0x4ae62e(0x1ad)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x18b))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getBffScriptInfo)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x1a9),{'title':'Save\x20or\x20Update\x20Backend\x20Function','description':_0x4ae62e(0x1a7),'inputSchema':{...authSchema,'id':z['number']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)]('Backend\x20Function\x20ID\x20(for\x20updating)'),'description':z['string']()[_0x4ae62e(0x195)](0x1)['describe']('Function\x20description'),'scriptContent':z['string']()[_0x4ae62e(0x195)](0x1)[_0x4ae62e(0x1ae)](_0x4ae62e(0x1cd))},'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':![]}},wrapHandler(saveOrUpdateBffScript)));}get['server'](){const _0x26f3bc=a9_0x2abb8e;return this[_0x26f3bc(0x1c0)];}async[a9_0x2abb8e(0x175)](_0x5119b0){await this['mcpServer']['connect'](_0x5119b0);}async[a9_0x2abb8e(0x18f)](){const _0xf11363=a9_0x2abb8e;await this[_0xf11363(0x1c0)][_0xf11363(0x18f)]();}[a9_0x2abb8e(0x185)](){const _0x458346=a9_0x2abb8e;if(!process[_0x458346(0x1ab)][_0x458346(0x1bc)])return;console[_0x458346(0x1b6)](_0x458346(0x1b5)),console[_0x458346(0x1b6)](_0x458346(0x19c)+packageJson[_0x458346(0x1a2)]),console[_0x458346(0x1b6)](_0x458346(0x1be)),this[_0x458346(0x18a)][_0x458346(0x19f)]&&(console[_0x458346(0x1b6)]('Backend\x20Function\x20write\x20tools\x20enabled\x20(--enable-bff-save)'),console['log'](_0x458346(0x1ce)));}}function a9_0x4c60(_0x391261,_0x2806e6){_0x391261=_0x391261-0x16a;const _0x5b28ad=a9_0x5b28();let _0x4c60e5=_0x5b28ad[_0x391261];return _0x4c60e5;}function buildInstructions(_0x58608d){const _0x469122=a9_0x2abb8e,_0x1f802c=_0x58608d[_0x469122(0x19f)]===!![],_0xf9a88d=_0x1f802c?'\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':'';return _0x469122(0x1cc)+_0xf9a88d+'\x0a';}export function createServer(_0x289350){return new LovrabetDatasetMCPServer(_0x289350);}
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 +1 @@
1
- (function(_0x13e9ad,_0x36bd50){const _0x202184=a10_0x240d,_0x20bb85=_0x13e9ad();while(!![]){try{const _0x7f18e4=parseInt(_0x202184(0x1e9))/0x1*(parseInt(_0x202184(0x1f0))/0x2)+-parseInt(_0x202184(0x1df))/0x3+parseInt(_0x202184(0x1f3))/0x4*(-parseInt(_0x202184(0x1f8))/0x5)+parseInt(_0x202184(0x1fb))/0x6*(parseInt(_0x202184(0x1ed))/0x7)+-parseInt(_0x202184(0x1e2))/0x8+-parseInt(_0x202184(0x1ea))/0x9+-parseInt(_0x202184(0x1e5))/0xa*(-parseInt(_0x202184(0x1e8))/0xb);if(_0x7f18e4===_0x36bd50)break;else _0x20bb85['push'](_0x20bb85['shift']());}catch(_0x1c2374){_0x20bb85['push'](_0x20bb85['shift']());}}}(a10_0x2cfc,0x7c66d));function a10_0x2cfc(){const _0x7a8d04=['appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','31285WkPgac','message','SQL\x20executed\x20successfully.\x20Returned\x20','14226QRoGBr','keys','now','success','UNKNOWN','1622934SiDziQ','sqlCode\x20is\x20required.\x20Get\x20it\x20from\x20list_sql_queries\x20->\x20sqlCode','Unknown\x20error','4016208YwpPLu','msg',']:\x20','15415450jCiGab','length','\x20row(s).','11QDyeBo','8ReNIfM','811998dtrBsJ','ERR','errorMsg','413xNDWNs','API\x20call\x20failed:\x20','SQL\x20execution\x20failed:\x20','20056vTAbrU','executeSql','SQL\x20execution\x20failed\x20[','76gKMtGX','execError','errorCode','isArray'];a10_0x2cfc=function(){return _0x7a8d04;};return a10_0x2cfc();}import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode}from'../config/env.js';function a10_0x240d(_0x1309df,_0x33f428){_0x1309df=_0x1309df-0x1dc;const _0x2cfc5c=a10_0x2cfc();let _0x240dac=_0x2cfc5c[_0x1309df];return _0x240dac;}export async function executeCustomSql(_0x4ac3b1){const _0x2a78f1=a10_0x240d,_0x5b08b6=Date['now'](),{appCode:appCode=getEnvAppCode(),cookie:_0x372ea0,sqlCode:_0x230752,params:_0x2d68b1}=_0x4ac3b1;if(!appCode)throw new Error(_0x2a78f1(0x1f7));if(!_0x230752||_0x230752['trim']()==='')throw new Error(_0x2a78f1(0x1e0));const _0x46caf6=new DevApiClient({'appCode':appCode,'cookie':_0x372ea0}),_0x121f06=_0x2d68b1&&Object['keys'](_0x2d68b1)['length']>0x0,_0x20105a=_0x121f06?Object[_0x2a78f1(0x1fc)](_0x2d68b1):[],_0x4ba377={'sqlCode':_0x230752,'hasParams':_0x121f06||![],'paramNames':_0x20105a||[]};try{const _0x4ba786=await _0x46caf6[_0x2a78f1(0x1f1)]({'sqlCode':_0x230752['trim'](),'params':_0x2d68b1}),_0x57ccee=Date['now']()-_0x5b08b6,_0x223b45=_0x4ba786[_0x2a78f1(0x1dd)]??![],_0x10a055=_0x4ba786[_0x2a78f1(0x1f5)];if(!_0x223b45){const _0x115c09=_0x4ba786[_0x2a78f1(0x1ec)]||_0x4ba786[_0x2a78f1(0x1e3)]||_0x2a78f1(0x1e1);return{'success':![],'execSuccess':![],'execError':_0x115c09,'errorCode':_0x10a055||_0x2a78f1(0x1de),'message':_0x2a78f1(0x1f2)+(_0x10a055||_0x2a78f1(0x1eb))+_0x2a78f1(0x1e4)+_0x115c09,'executionTime':_0x57ccee,'sqlInfo':_0x4ba377};}const _0x15b819=_0x4ba786['data']||_0x4ba786,_0x519fa1=_0x15b819['execSuccess']??_0x15b819[_0x2a78f1(0x1dd)]??!![],_0x3c38f0=_0x15b819['execResult']||_0x15b819['data'],_0x45b387=_0x15b819[_0x2a78f1(0x1f4)]||_0x15b819[_0x2a78f1(0x1ec)];if(_0x519fa1){const _0x3a764e=Array[_0x2a78f1(0x1f6)](_0x3c38f0)?_0x3c38f0[_0x2a78f1(0x1e6)]:0x0;return{'success':!![],'execSuccess':!![],'execResult':_0x3c38f0||[],'rowCount':_0x3a764e,'message':_0x2a78f1(0x1fa)+_0x3a764e+_0x2a78f1(0x1e7),'executionTime':_0x57ccee,'sqlInfo':_0x4ba377};}return{'success':!![],'execSuccess':![],'execError':_0x45b387||'SQL\x20execution\x20failed\x20without\x20error\x20message','message':_0x2a78f1(0x1ef)+(_0x45b387||_0x2a78f1(0x1e1)),'executionTime':_0x57ccee,'sqlInfo':_0x4ba377};}catch(_0x5a37da){const _0xcf78bc=Date[_0x2a78f1(0x1dc)]()-_0x5b08b6;return{'success':![],'execSuccess':![],'execError':_0x5a37da[_0x2a78f1(0x1f9)]||_0x2a78f1(0x1e1),'message':_0x2a78f1(0x1ee)+(_0x5a37da[_0x2a78f1(0x1f9)]||'Unknown\x20error'),'executionTime':_0xcf78bc,'sqlInfo':_0x4ba377};}}
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 +1 @@
1
- (function(_0x40edc6,_0x302dc1){const _0x36c5ae=a11_0x20f0,_0x24ce32=_0x40edc6();while(!![]){try{const _0x1376bc=parseInt(_0x36c5ae(0x1a7))/0x1*(-parseInt(_0x36c5ae(0x1a4))/0x2)+-parseInt(_0x36c5ae(0x1a3))/0x3+parseInt(_0x36c5ae(0x198))/0x4*(parseInt(_0x36c5ae(0x19b))/0x5)+-parseInt(_0x36c5ae(0x1a0))/0x6+parseInt(_0x36c5ae(0x1a6))/0x7*(-parseInt(_0x36c5ae(0x1b3))/0x8)+parseInt(_0x36c5ae(0x19e))/0x9+parseInt(_0x36c5ae(0x1aa))/0xa*(parseInt(_0x36c5ae(0x1a1))/0xb);if(_0x1376bc===_0x302dc1)break;else _0x24ce32['push'](_0x24ce32['shift']());}catch(_0x407064){_0x24ce32['push'](_0x24ce32['shift']());}}}(a11_0x3c60,0xd5dc1));function a11_0x20f0(_0x5e8942,_0x43f2da){_0x5e8942=_0x5e8942-0x196;const _0x3c609b=a11_0x3c60();let _0x20f099=_0x3c609b[_0x5e8942];return _0x20f099;}function a11_0x3c60(){const _0x1007f2=['appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','//\x20数据集:\x20','getModelAlias','replace','4274488NyHBcm','operationName\x20is\x20required','code','1435216lcSrvn','getTableName','datasetCode\x20is\x20required','5XSIAmz','typescript','getDatasetSDKKey','15186204gcnteG','Cannot\x20generate\x20SDK\x20code\x20for\x20operation\x20\x27','7122822wiSVJn','33297sswHSc','\x27\x20in\x20dataset\x20\x27','3401253yWsTip','2fPPcOx','getTableKey','7RvBPXP','67625CHjTqC','getFieldList','data','5790heEoKT','name','getOperationDocMeta','generateAliasExplanation','\x20|\x20数据表:\x20'];a11_0x3c60=function(){return _0x1007f2;};return a11_0x3c60();}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';export async function generateSDKCode(_0x36220f){const _0x1bf72e=a11_0x20f0,{appCode:appCode=getEnvAppCode(),cookie:_0x9c4b11,datasetCode:_0x3f0af6,operationName:_0x2ed055,includeImports:includeImports=!![],useAlias:useAlias=![]}=_0x36220f;if(!appCode)throw new Error(_0x1bf72e(0x1af));if(!_0x3f0af6)throw new Error(_0x1bf72e(0x19a));if(!_0x2ed055)throw new Error(_0x1bf72e(0x196));const _0x5bb17d=new DevApiClient({'appCode':appCode,'cookie':_0x9c4b11}),_0x3a91ac=getEnvironment(),_0x51ae3c=await _0x5bb17d['getDatasetDetail'](_0x3f0af6),_0x5f2c39=_0x51ae3c[_0x1bf72e(0x1a9)]||_0x51ae3c,_0x3e9636=new DrivenDataDetailPlus(_0x5f2c39),_0x472d6b=_0x3e9636[_0x1bf72e(0x1ac)](_0x2ed055);if(!_0x472d6b)throw new Error(_0x1bf72e(0x19f)+_0x2ed055+_0x1bf72e(0x1a2)+_0x3f0af6+'\x27');const _0x543a9e=_0x3e9636[_0x1bf72e(0x19d)](),_0x35f440=_0x3e9636[_0x1bf72e(0x1b1)](),_0x552364=_0x3e9636[_0x1bf72e(0x1a5)](),_0x3932cd=_0x3e9636[_0x1bf72e(0x199)](),_0x34a500=_0x3e9636[_0x1bf72e(0x1ab)],_0x2e30ab=_0x3e9636[_0x1bf72e(0x1a8)](),_0x50a94f=_0x2e30ab?.['toJSON']?.()||[],_0x16d3cd=buildFieldRelationsMap(_0x51ae3c),_0x372098=enrichFieldsWithRelations(_0x50a94f,_0x16d3cd),_0x16f051=_0x3e9636['generateFullSDKExample'](_0x2ed055,appCode),_0x3340a1=_0x3e9636['getOperationAnalysis'](_0x2ed055);let _0x5c1fec=_0x472d6b['sdkCall'][_0x1bf72e(0x197)],_0x4cf6e4=_0x16f051||undefined;useAlias&&(_0x5c1fec=_0x5c1fec[_0x1bf72e(0x1b2)](new RegExp(_0x543a9e,'g'),_0x35f440),_0x4cf6e4&&(_0x4cf6e4=_0x4cf6e4[_0x1bf72e(0x1b2)](new RegExp(_0x543a9e,'g'),_0x35f440)));const _0x20de2b=_0x1bf72e(0x1b0)+_0x34a500+_0x1bf72e(0x1ae)+_0x3932cd+'\x0a',_0x31153e=_0x20de2b+_0x5c1fec,_0x246f4e=_0x4cf6e4?_0x1bf72e(0x1b0)+_0x34a500+'\x20|\x20数据表:\x20'+_0x3932cd+'\x0a'+_0x4cf6e4:undefined;return{'appCode':appCode,'env':_0x3a91ac,'datasetName':_0x34a500,'language':_0x1bf72e(0x19c),'code':_0x31153e,'fullExample':includeImports?_0x246f4e:undefined,'sdkCallInfo':{'modelName':_0x35f440,'tableName':_0x3932cd,'tableKey':_0x552364,'datasetCode':_0x3e9636['datasetCode'],'operationName':_0x2ed055},'fields':_0x372098,'requestExample':_0x3340a1?.['requestExample'],'responseExample':_0x3340a1?.['responseExample'],'sdkInitCode':_0x3e9636['generateSDKInitCode'](_0x552364),'usageExample':_0x472d6b['usageExample'],'aliasExplanation':useAlias?_0x3e9636[_0x1bf72e(0x1ad)]():undefined,'aliasHint':{'defaultAlias':_0x35f440,'datasetSDKKey':_0x543a9e}};}
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 +1 @@
1
- (function(_0x45ad2e,_0x274e8f){const _0xbf6cca=a12_0x2848,_0x3da52b=_0x45ad2e();while(!![]){try{const _0xab8946=-parseInt(_0xbf6cca(0x9c))/0x1*(-parseInt(_0xbf6cca(0xb0))/0x2)+parseInt(_0xbf6cca(0xbd))/0x3*(-parseInt(_0xbf6cca(0x98))/0x4)+parseInt(_0xbf6cca(0xb3))/0x5*(parseInt(_0xbf6cca(0xc8))/0x6)+-parseInt(_0xbf6cca(0xd0))/0x7*(parseInt(_0xbf6cca(0xab))/0x8)+-parseInt(_0xbf6cca(0x9d))/0x9*(-parseInt(_0xbf6cca(0xa0))/0xa)+parseInt(_0xbf6cca(0xaa))/0xb+-parseInt(_0xbf6cca(0x9b))/0xc;if(_0xab8946===_0x274e8f)break;else _0x3da52b['push'](_0x3da52b['shift']());}catch(_0x2c89b5){_0x3da52b['push'](_0x3da52b['shift']());}}}(a12_0x215b,0xd0724));import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode,getEnvironment}from'../config/env.js';function a12_0x2848(_0x42e400,_0x1882ba){_0x42e400=_0x42e400-0x8f;const _0x215b58=a12_0x215b();let _0x2848c5=_0x215b58[_0x42e400];return _0x2848c5;}function a12_0x215b(){const _0x552cef=['Check\x20the\x20sqlCode\x20from\x20list_sql_queries\x20result\x20and\x20use\x20the\x20exact\x20value.','bff','20084wRGEry','toLowerCase','sql','32137860hSmDAs','242332njixyG','909tonCHD','\x22\x20does\x20not\x20exist.\x20Use\x20list_sql_queries\x20to\x20find\x20valid\x20SQL\x20codes.','This\x20SQL\x20requires\x20parameters:\x20','43090DIOksE','sqlCode','SDK\x20client.sql.execute()\x20returns\x20{\x20execSuccess,\x20execResult\x20}\x20—\x20always\x20check\x20execSuccess','message','sqlId','sqlCode\x20is\x20required','map','Backend\x20Function','Failed\x20to\x20verify\x20SQL\x20code:\x20','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20—\x20use\x20try-catch','14141402bXHORY','5400GJOSRh','join','page','\x27\x20}','//\x20Backend\x20Function:\x20Execute\x20SQL\x20\x22','14lOCOwW','getCustomSqlList','date','10ugvooy','Errors\x20throw\x20exceptions\x20—\x20use\x20try-catch','length','name','\x22\x20not\x20found\x20in\x20the\x20application.','trim','{\x20sqlCode:\x20\x27','{\x0a\x20\x20sqlCode:\x20\x27','stringify','keyword','39SCDNZZ','match','find','BFF\x20context.client.sql.execute()\x20returns\x20rows\x20T[]\x20directly\x20—\x20no\x20wrapper\x20object','\x27,\x0a\x20\x20params:\x20','value','reduce','//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27','from','SQL-','Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.','4997352kYAwnq','SQL\x20code\x20\x22','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','count','\x20code\x20for\x20SQL:\x20','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a','example','replace','15407WWcrge','time',',\x0a}','Generated\x20','includes','\x0aconst\x20data\x20=\x20await\x20client.sql.execute(','\x27,\x0a});\x0a\x0a//\x20Execute\x20SQL:\x20','This\x20SQL\x20does\x20not\x20require\x20any\x20parameters'];a12_0x215b=function(){return _0x552cef;};return a12_0x215b();}export async function generateSqlCode(_0x155411){const _0x5395f1=a12_0x2848,{appCode:appCode=getEnvAppCode(),cookie:_0x19b944,sqlCode:_0x1a9b74,params:_0x3a87f5,includeImports:includeImports=!![],target:target='sdk'}=_0x155411;if(!appCode)throw new Error(_0x5395f1(0xca));if(!_0x1a9b74||_0x1a9b74[_0x5395f1(0xb8)]()==='')return{'success':![],'sqlCode':'','sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[]},'error':_0x5395f1(0xa5)};const _0x579fa2=_0x1a9b74[_0x5395f1(0xb8)](),_0x8d8df4=new DevApiClient({'appCode':appCode,'cookie':_0x19b944}),_0x43046c=getEnvironment();try{const _0x5e6ebe=await _0x8d8df4[_0x5395f1(0xb1)]({'pageSize':0x3e7,'currentPage':0x1,'sqlCode':_0x579fa2}),_0x18dabd=_0x5e6ebe['data']?.['tableData']||[],_0x3c948d=_0x18dabd[_0x5395f1(0xbf)](_0x15f833=>_0x15f833['sqlCode']===_0x579fa2||_0x15f833[_0x5395f1(0xa1)]?.['includes'](_0x579fa2)||_0x579fa2[_0x5395f1(0x92)](_0x15f833[_0x5395f1(0xa1)]));if(!_0x3c948d)return{'success':![],'sqlCode':_0x579fa2,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x5395f1(0xc9)+_0x579fa2+_0x5395f1(0xb7),'Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.',_0x5395f1(0x96)]},'error':_0x5395f1(0xc9)+_0x579fa2+_0x5395f1(0x9e)};const _0x5287c6=_0x3c948d[_0x5395f1(0xa1)],_0x384918=_0x3c948d['sqlName']||_0x3c948d[_0x5395f1(0xb6)]||_0x5395f1(0xc6)+(_0x3c948d[_0x5395f1(0xa4)]||_0x3c948d['id']),_0x55ec69=_0x3c948d['sqlContent']||_0x3c948d[_0x5395f1(0x9a)]||'',_0x59b6fc=_0x55ec69[_0x5395f1(0xbe)](/[:$]\{?(\w+)\}?/g);let _0x591a7a,_0x3718fd;if(_0x59b6fc){const _0x303737=Array[_0x5395f1(0xc5)](new Set(_0x59b6fc['map'](_0x5aeb5=>_0x5aeb5[_0x5395f1(0xcf)](/[:${}]/g,''))));_0x591a7a=_0x303737[_0x5395f1(0xa6)](_0x37d8b9=>{const _0x3f378f=_0x3a87f5?.[_0x37d8b9]??getDefaultExample(_0x37d8b9);return{'name':_0x37d8b9,'example':_0x3f378f};}),_0x3718fd=_0x591a7a[_0x5395f1(0xc3)]((_0xa5a7cf,_0x696af6)=>({..._0xa5a7cf,[_0x696af6['name']]:_0x696af6[_0x5395f1(0xce)]}),{});}else _0x3a87f5&&(_0x591a7a=Object['entries'](_0x3a87f5)[_0x5395f1(0xa6)](([_0x47ba61,_0x15653e])=>({'name':_0x47ba61,'example':_0x15653e})),_0x3718fd=_0x3a87f5);const _0x3886b3=_0x591a7a&&_0x591a7a[_0x5395f1(0xb5)]>0x0,_0x8e0467=_0x3886b3?JSON[_0x5395f1(0xbb)](_0x3718fd,null,0x2):'',_0x2d9528=_0x3886b3?_0x5395f1(0xba)+_0x5287c6+_0x5395f1(0xc1)+_0x8e0467+_0x5395f1(0x90):_0x5395f1(0xb9)+_0x5287c6+_0x5395f1(0xae);let _0x5f3d6f;target==='bff'?_0x5f3d6f=_0x5395f1(0xaf)+_0x384918+'\x22\x0aexport\x20default\x20async\x20function(params,\x20context)\x20{\x0a\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute('+_0x2d9528+');\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}':_0x5f3d6f=(includeImports?_0x5395f1(0xcd):'')+_0x5395f1(0xc4)+appCode+'\x27,\x0a\x20\x20env:\x20\x27'+_0x43046c+_0x5395f1(0x94)+_0x384918+_0x5395f1(0x93)+_0x2d9528+');\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});';const _0x5c63d5=target===_0x5395f1(0x97);return{'success':!![],'sqlCode':_0x5287c6,'sqlName':_0x384918,'sqlExists':!![],'code':_0x5f3d6f,'parameters':_0x591a7a,'usage':{'description':_0x5395f1(0x91)+(_0x5c63d5?_0x5395f1(0xa7):'Frontend\x20SDK')+_0x5395f1(0xcc)+_0x384918,'important':[_0x5395f1(0xc9)+_0x5287c6+'\x22\x20exists\x20and\x20is\x20valid.',_0x5c63d5?_0x5395f1(0xc0):_0x5395f1(0xa2),_0x5c63d5?_0x5395f1(0xb4):_0x5395f1(0xa9),_0x3886b3?_0x5395f1(0x9f)+_0x591a7a[_0x5395f1(0xa6)](_0x5ec488=>_0x5ec488[_0x5395f1(0xb6)])[_0x5395f1(0xac)](',\x20'):_0x5395f1(0x95),'Note:\x20client.api.executeSql()\x20is\x20deprecated.\x20Use\x20client.sql.execute()\x20instead.']}};}catch(_0x38c772){return{'success':![],'sqlCode':_0x579fa2,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x5395f1(0xa8)+_0x38c772['message'],_0x5395f1(0xc7)]},'error':_0x5395f1(0xa8)+_0x38c772[_0x5395f1(0xa3)]};}}function getDefaultExample(_0x2b1bb8){const _0x332698=a12_0x2848,_0x268585=_0x2b1bb8[_0x332698(0x99)]();if(_0x268585['includes'](_0x332698(0xb2))||_0x268585['includes'](_0x332698(0x8f)))return'2024-01-01';if(_0x268585[_0x332698(0x92)]('id'))return 0x7b;if(_0x268585[_0x332698(0x92)]('limit')||_0x268585['includes'](_0x332698(0xcb))||_0x268585[_0x332698(0x92)]('size'))return 0xa;if(_0x268585[_0x332698(0x92)](_0x332698(0xad)))return 0x1;if(_0x268585['includes'](_0x332698(0xbc))||_0x268585[_0x332698(0x92)]('search')||_0x268585[_0x332698(0x92)](_0x332698(0xb6)))return _0x332698(0xce);if(_0x268585[_0x332698(0x92)]('status'))return 0x1;return _0x332698(0xc2);}
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 +1 @@
1
- (function(_0x2c39c2,_0x1b9b34){const _0x2f3a6e=a13_0xebfc,_0x27d4a9=_0x2c39c2();while(!![]){try{const _0x399f3d=-parseInt(_0x2f3a6e(0x1a1))/0x1+parseInt(_0x2f3a6e(0x1a8))/0x2*(parseInt(_0x2f3a6e(0x1a6))/0x3)+parseInt(_0x2f3a6e(0x1ac))/0x4*(-parseInt(_0x2f3a6e(0x1a9))/0x5)+parseInt(_0x2f3a6e(0x1ab))/0x6*(-parseInt(_0x2f3a6e(0x1a5))/0x7)+-parseInt(_0x2f3a6e(0x1a3))/0x8+-parseInt(_0x2f3a6e(0x1ad))/0x9*(parseInt(_0x2f3a6e(0x1a4))/0xa)+parseInt(_0x2f3a6e(0x1aa))/0xb;if(_0x399f3d===_0x1b9b34)break;else _0x27d4a9['push'](_0x27d4a9['shift']());}catch(_0x3d5a5e){_0x27d4a9['push'](_0x27d4a9['shift']());}}}(a13_0x30a1,0x985b4));function a13_0x30a1(){const _0x51ce4d=['Failed\x20to\x20fetch\x20Backend\x20Function\x20script\x20info\x20for\x20id:\x20','387529dWhjGo','id\x20is\x20required\x20and\x20must\x20be\x20a\x20positive\x20number.\x20Get\x20it\x20from\x20list_bff_scripts.','116936CbPkxU','3519500xdrVdL','35413zEPgEy','3QAEoDU','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','1690546qkCmzv','5djEtiy','23706705OgWabS','894EURhDW','3473956RNpFPe','9NTBPwk','data'];a13_0x30a1=function(){return _0x51ce4d;};return a13_0x30a1();}import{DevApiClient}from'../api/dev-api-client.js';function a13_0xebfc(_0x2f1f15,_0x32c758){_0x2f1f15=_0x2f1f15-0x1a1;const _0x30a14a=a13_0x30a1();let _0xebfc60=_0x30a14a[_0x2f1f15];return _0xebfc60;}import{getEnvAppCode}from'../config/env.js';export async function getBffScriptInfo(_0x311766){const _0x12dfb3=a13_0xebfc,{appCode:appCode=getEnvAppCode(),cookie:_0x172548,id:_0x57903e}=_0x311766;if(!appCode)throw new Error(_0x12dfb3(0x1a7));if(!_0x57903e||_0x57903e<=0x0)throw new Error(_0x12dfb3(0x1a2));const _0x436afd=new DevApiClient({'appCode':appCode,'cookie':_0x172548}),_0x5ebb9e=await _0x436afd['getBffScriptInfo'](_0x57903e);if(!_0x5ebb9e['success']||!_0x5ebb9e[_0x12dfb3(0x1ae)])return{'success':![],'message':_0x12dfb3(0x1af)+_0x57903e};return{'success':!![],'script':_0x5ebb9e[_0x12dfb3(0x1ae)]};}
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)]};}