@lovrabet/dataset-mcp-server 1.3.5 → 1.3.6
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 +1 -1
- package/dist/api/dev-api-client.js +1 -1
- package/dist/auth/constants.js +1 -1
- package/dist/auth/cookie-manager.js +1 -1
- package/dist/auth/session-validator.js +1 -1
- package/dist/config/env.js +1 -1
- package/dist/index.js +1 -1
- package/dist/server.js +1 -1
- package/dist/tools/execute-custom-sql.js +1 -1
- package/dist/tools/generate-sdk-code.js +1 -1
- package/dist/tools/generate-sql-code.js +1 -1
- package/dist/tools/get-bff-script-info.js +1 -1
- package/dist/tools/get-dataset-detail.js +1 -1
- package/dist/tools/get-operation-detail.js +1 -1
- package/dist/tools/get-operations.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/list-bff-scripts.js +1 -1
- package/dist/tools/list-datasets.js +1 -1
- package/dist/tools/list-sql-queries.js +1 -1
- package/dist/tools/login.js +1 -1
- package/dist/tools/save-or-update-bff-script.js +1 -1
- package/dist/tools/save-or-update-custom-sql.js +1 -1
- package/dist/tools/search-datasets.js +1 -1
- package/dist/tools/validate-sql-content.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/mcp-types.js +1 -1
- package/dist/utils/rate-limiter.js +1 -1
- package/dist/utils/relations.js +1 -0
- package/dist/utils/sql-parser.js +1 -1
- package/package.json +2 -2
- package/dist/analyzer/dataset-analyzer.js +0 -1
package/dist/api/cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a0_0x4c5120=a0_0x43ca;(function(_0x381c99,_0x1d450f){const _0x22972f=a0_0x43ca,_0x15f023=_0x381c99();while(!![]){try{const _0x5eb40f=-parseInt(_0x22972f(0x197))/0x1+-parseInt(_0x22972f(0x192))/0x2*(-parseInt(_0x22972f(0x19d))/0x3)+-parseInt(_0x22972f(0x195))/0x4*(-parseInt(_0x22972f(0x19f))/0x5)+-parseInt(_0x22972f(0x191))/0x6+parseInt(_0x22972f(0x19b))/0x7+parseInt(_0x22972f(0x190))/0x8*(-parseInt(_0x22972f(0x19a))/0x9)+parseInt(_0x22972f(0x198))/0xa;if(_0x5eb40f===_0x1d450f)break;else _0x15f023['push'](_0x15f023['shift']());}catch(_0x3c44a8){_0x15f023['push'](_0x15f023['shift']());}}}(a0_0x5652,0xd433c));export class SimpleCache{[a0_0x4c5120(0x18d)]=new Map();[a0_0x4c5120(0x193)];constructor(_0xf362c4=0x5){const _0x21f435=a0_0x4c5120;this[_0x21f435(0x193)]=_0xf362c4*0x3c*0x3e8;}[a0_0x4c5120(0x19c)](_0x376198){const _0x4e1b79=a0_0x4c5120,_0x52c905=this[_0x4e1b79(0x18d)][_0x4e1b79(0x19c)](_0x376198);if(!_0x52c905)return null;const _0xadb305=Date[_0x4e1b79(0x19e)](),_0x338342=_0xadb305-_0x52c905['timestamp'];if(_0x338342>this[_0x4e1b79(0x193)])return this[_0x4e1b79(0x18d)][_0x4e1b79(0x18f)](_0x376198),null;const _0x49e09e=Math[_0x4e1b79(0x18a)](_0x338342/0x3e8);return _0x52c905[_0x4e1b79(0x18e)];}[a0_0x4c5120(0x196)](_0x29e93a,_0x2dafe6){const _0x4e0836=a0_0x4c5120;this[_0x4e0836(0x18d)][_0x4e0836(0x196)](_0x29e93a,{'data':_0x2dafe6,'timestamp':Date[_0x4e0836(0x19e)]()});}[a0_0x4c5120(0x18c)](_0x59421e){const _0x475d32=a0_0x4c5120;_0x59421e?this[_0x475d32(0x18d)]['delete'](_0x59421e):this[_0x475d32(0x18d)][_0x475d32(0x18c)]();}[a0_0x4c5120(0x199)](){const _0x776bcf=a0_0x4c5120;return{'size':this['cache'][_0x776bcf(0x18b)],'ttlMinutes':this[_0x776bcf(0x193)]/0xea60,'entries':Array['from'](this[_0x776bcf(0x18d)][_0x776bcf(0x194)]())};}}function a0_0x5652(){const _0x57b180=['1713176dUgGbZ','8994426fNRajb','56TUxnbS','defaultTTL','keys','4gmdDXa','set','1562717gvAIgm','36778240Knosne','getStats','27IClxvo','1332240TmULah','get','2337jamzkI','now','3417265MEIboK','floor','size','clear','cache','data','delete'];a0_0x5652=function(){return _0x57b180;};return a0_0x5652();}function a0_0x43ca(_0x480865,_0x546a78){_0x480865=_0x480865-0x18a;const _0x565279=a0_0x5652();let _0x43ca3f=_0x565279[_0x480865];return _0x43ca3f;}export const apiCache=new SimpleCache(0x5);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a2_0x16b015=a2_0x4f2b;(function(_0x1eba89,_0x3d0562){const _0x2d9d01=a2_0x4f2b,_0x5ac706=_0x1eba89();while(!![]){try{const _0x130221=parseInt(_0x2d9d01(0x1e4))/0x1*(parseInt(_0x2d9d01(0x1a0))/0x2)+-parseInt(_0x2d9d01(0x1a8))/0x3*(-parseInt(_0x2d9d01(0x1e5))/0x4)+-parseInt(_0x2d9d01(0x19c))/0x5+-parseInt(_0x2d9d01(0x1dd))/0x6*(parseInt(_0x2d9d01(0x1a3))/0x7)+-parseInt(_0x2d9d01(0x198))/0x8*(-parseInt(_0x2d9d01(0x184))/0x9)+-parseInt(_0x2d9d01(0x1e2))/0xa*(parseInt(_0x2d9d01(0x190))/0xb)+parseInt(_0x2d9d01(0x19b))/0xc*(-parseInt(_0x2d9d01(0x1b0))/0xd);if(_0x130221===_0x3d0562)break;else _0x5ac706['push'](_0x5ac706['shift']());}catch(_0x3f0f89){_0x5ac706['push'](_0x5ac706['shift']());}}}(a2_0x219a,0x1a545));function a2_0x4f2b(_0x185941,_0x256286){_0x185941=_0x185941-0x17b;const _0x219a84=a2_0x219a();let _0x4f2bc7=_0x219a84[_0x185941];return _0x4f2bc7;}function a2_0x219a(){const _0x397fde=['dbtableConfig','text','data','sqlCode','LOVRABET_ENV','er-config:','runtimeBaseUrl','DEFAULT_TIMEOUT','cookie','POST','getDatasetRelations','modelCode','runtimeDomain','online','relations','Failed\x20to\x20get\x20ER\x20config\x20for\x20dbId\x20','postRequest','6vxUEPV','appCode','API\x20request\x20timeout\x20after\x20','API\x20request\x20failed:\x20HTTP\x20','er-configs-all:','240370DkvDIg','apiDomain','3NuTdMq','200ogEvrV','/smartapi/dataset/get-dataset-list','length','fromField','AbortError','stringify','\x0aURL:\x20','ms.\x20The\x20server\x20may\x20be\x20down\x20or\x20unreachable.\x0aURL:\x20','getErConfig','getAllErConfigs','getBffScriptInfo','getUniqueDbIds','forceRefresh','383490ABLtnQ','saveBffScript','/smartapi/dataset/get-driven-data?','set','getBffScriptList','request','scriptContent','joinType','object','/smartapi/custom/queryUserCustomSqlList','apiBaseUrl','dataset-list:','66YQiodW','test','currentPage','No\x20authentication\x20cookie\x20found.\x20Please\x20login\x20first.','Authentication\x20failed.\x20Please\x20login\x20again.','abort','push','json','40mqSuUK','get','/smartapi/question/er-config','1872FgAVIP','665055kzWHsd','NODE_ENV','updateUserCustomSql','toLowerCase','71766yzgCAM','sqlContent','find','231161qXUqBt','/api/management/library/scripts/info?id=','tableName','process','/api/custom/executeSql','8025TjqJuf','toField','status','datasets','getDatasetDetail','includes','scriptType','/api/management/library/scripts/save','3029DRAAsU','success','Failed\x20to\x20get\x20ER\x20config\x20for\x20dblinkId:\x20','meta','Network\x20error:\x20Unable\x20to\x20connect\x20to\x20the\x20server.\x20Please\x20check\x20your\x20network\x20connection\x20or\x20the\x20server\x20may\x20be\x20down.\x0aURL:\x20','isArray','datasetName','sqlName','Unknown\x20error','dbId','API\x20error:\x20','toDataset','getDatasetList','datasetCode','with-relations','errorMsg','toDatasetName','message','name','/api/management/library/scripts/list?appCode=','&type=ENDPOINT','description','params','env','[getDatasetDetail]\x20Failed\x20to\x20fetch\x20relations\x20for\x20','getCustomSqlList','no-relations','warn'];a2_0x219a=function(){return _0x397fde;};return a2_0x219a();}import{getCookie}from'../auth/cookie-manager.js';import{getEffectiveApiDomain,getEffectiveRuntimeDomain}from'../auth/constants.js';import{apiCache}from'./cache.js';export class DevApiClient{[a2_0x16b015(0x1de)];[a2_0x16b015(0x1c7)];['cookie'];[a2_0x16b015(0x1e3)];[a2_0x16b015(0x1d8)];constructor(_0x2bead1){const _0x1a28d0=a2_0x16b015;this[_0x1a28d0(0x1de)]=_0x2bead1[_0x1a28d0(0x1de)],this[_0x1a28d0(0x1c7)]=globalThis[_0x1a28d0(0x1a6)]?.[_0x1a28d0(0x1c7)]?.[_0x1a28d0(0x1d0)]||_0x1a28d0(0x1d9),this['cookie']=_0x2bead1[_0x1a28d0(0x1d4)]||getCookie(),this[_0x1a28d0(0x1e3)]=_0x2bead1[_0x1a28d0(0x18e)]||getEffectiveApiDomain(),this[_0x1a28d0(0x1d8)]=_0x2bead1[_0x1a28d0(0x1d2)]||getEffectiveRuntimeDomain();if(!this['cookie'])throw new Error(_0x1a28d0(0x193));}static [a2_0x16b015(0x1d3)]=0x7530;async[a2_0x16b015(0x189)](_0xd250f8,_0x582592=DevApiClient[a2_0x16b015(0x1d3)]){const _0x48f42c=a2_0x16b015,_0xa840b5=new AbortController(),_0x438bad=setTimeout(()=>_0xa840b5[_0x48f42c(0x195)](),_0x582592);try{const _0x2864ae=await fetch(_0xd250f8,{'headers':{'Cookie':this[_0x48f42c(0x1d4)]},'signal':_0xa840b5['signal']});clearTimeout(_0x438bad);if(!_0x2864ae['ok']){if(_0x2864ae[_0x48f42c(0x1aa)]===0x191)throw new Error(_0x48f42c(0x194));let _0x1068b3='';try{_0x1068b3=await _0x2864ae[_0x48f42c(0x1cd)]();}catch{}throw new Error(_0x48f42c(0x1e0)+_0x2864ae[_0x48f42c(0x1aa)]+_0x48f42c(0x17d)+_0xd250f8+(_0x1068b3?'\x0a'+_0x1068b3:''));}const _0x1bdaef=await _0x2864ae['json']();if(_0x1bdaef&&typeof _0x1bdaef===_0x48f42c(0x18c)&&'success'in _0x1bdaef&&!_0x1bdaef[_0x48f42c(0x1b1)]){const _0x1fd504=_0x1bdaef;throw new Error(_0x48f42c(0x1ba)+(_0x1fd504['message']||_0x1fd504[_0x48f42c(0x1bf)]||_0x48f42c(0x1b8)));}return _0x1bdaef;}catch(_0x2e93cf){if(_0x2e93cf instanceof Error&&_0x2e93cf[_0x48f42c(0x1c2)]==='AbortError')throw new Error(_0x48f42c(0x1df)+_0x582592+_0x48f42c(0x17e)+_0xd250f8);if(_0x2e93cf instanceof TypeError)throw new Error(_0x48f42c(0x1b4)+_0xd250f8);throw _0x2e93cf;}}async[a2_0x16b015(0x1dc)](_0x28b955,_0x3994b2,_0x3b0f95=DevApiClient[a2_0x16b015(0x1d3)]){const _0x160268=a2_0x16b015,_0x4491d7=new AbortController(),_0x3c6ef7=setTimeout(()=>_0x4491d7[_0x160268(0x195)](),_0x3b0f95);try{const _0x129514=await fetch(_0x28b955,{'method':_0x160268(0x1d5),'headers':{'Content-Type':'application/json','Cookie':this['cookie']},'body':JSON[_0x160268(0x17c)](_0x3994b2),'signal':_0x4491d7['signal']});clearTimeout(_0x3c6ef7);if(!_0x129514['ok']){if(_0x129514[_0x160268(0x1aa)]===0x191)throw new Error(_0x160268(0x194));let _0x3d8e07='';try{_0x3d8e07=await _0x129514[_0x160268(0x1cd)]();}catch{}throw new Error('API\x20request\x20failed:\x20HTTP\x20'+_0x129514[_0x160268(0x1aa)]+_0x160268(0x17d)+_0x28b955+(_0x3d8e07?'\x0a'+_0x3d8e07:''));}const _0x3048d6=await _0x129514[_0x160268(0x197)]();if(_0x3048d6&&typeof _0x3048d6===_0x160268(0x18c)&&_0x160268(0x1b1)in _0x3048d6&&!_0x3048d6[_0x160268(0x1b1)]){const _0x4cd218=_0x3048d6;throw new Error(_0x160268(0x1ba)+(_0x4cd218[_0x160268(0x1c1)]||_0x4cd218[_0x160268(0x1bf)]||'Unknown\x20error'));}return _0x3048d6;}catch(_0x1a2c15){if(_0x1a2c15 instanceof Error&&_0x1a2c15[_0x160268(0x1c2)]===_0x160268(0x17b))throw new Error(_0x160268(0x1df)+_0x3b0f95+_0x160268(0x17e)+_0x28b955);if(_0x1a2c15 instanceof TypeError)throw new Error(_0x160268(0x1b4)+_0x28b955);throw _0x1a2c15;}}async[a2_0x16b015(0x1bc)](_0x281391){const _0x15fcc9=a2_0x16b015,_0x371c19=_0x281391?.[_0x15fcc9(0x183)]||![],_0x3a0c48=_0x15fcc9(0x18f)+this[_0x15fcc9(0x1de)]+':'+this['env'];if(!_0x371c19){const _0xadd398=apiCache[_0x15fcc9(0x199)](_0x3a0c48);if(_0xadd398)return _0xadd398;}const _0x358acc=this[_0x15fcc9(0x1e3)]+_0x15fcc9(0x1e6),_0x3f5242=await this[_0x15fcc9(0x1dc)](_0x358acc,{'appCode':this[_0x15fcc9(0x1de)]});return apiCache['set'](_0x3a0c48,_0x3f5242),_0x3f5242;}async[a2_0x16b015(0x1ac)](_0x333538,_0x651168=![],_0x5c6df5=![]){const _0x43437f=a2_0x16b015,_0x10528c='dataset-detail:'+this[_0x43437f(0x1de)]+':'+this[_0x43437f(0x1c7)]+':'+_0x333538+':'+(_0x5c6df5?_0x43437f(0x1be):_0x43437f(0x1ca));if(!_0x651168){const _0x5349e4=apiCache[_0x43437f(0x199)](_0x10528c);if(_0x5349e4)return _0x5349e4;}const _0x5e2135=/^\d+$/[_0x43437f(0x191)](_0x333538),_0x30a146=_0x5e2135?'id':'code',_0x5633fc=this['apiDomain']+_0x43437f(0x186)+_0x30a146+'='+_0x333538,_0x239b3a=await this[_0x43437f(0x189)](_0x5633fc);if(_0x5c6df5&&_0x239b3a[_0x43437f(0x1ce)]?.[_0x43437f(0x1d7)]){const _0x238e3a=_0x239b3a['data']['doVersion']==='v2',_0x3a6b3b=Array['isArray'](_0x239b3a['data'][_0x43437f(0x1da)]);if(!_0x238e3a||!_0x3a6b3b)try{const _0x1769d0=await this['getDatasetRelations'](_0x239b3a[_0x43437f(0x1ce)]['modelCode'],_0x651168);_0x239b3a['data'][_0x43437f(0x1da)]=_0x1769d0;}catch(_0x1fbac9){process['env'][_0x43437f(0x19d)]!==_0x43437f(0x191)&&console['warn'](_0x43437f(0x1c8)+_0x333538+':',_0x1fbac9);}}return apiCache[_0x43437f(0x187)](_0x10528c,_0x239b3a),_0x239b3a;}async['searchDatasets'](_0x18f4a7){const _0x58f705=a2_0x16b015,_0x37790f=await this[_0x58f705(0x1bc)](),_0x31aeec=Array[_0x58f705(0x1b5)](_0x37790f[_0x58f705(0x1ce)])?_0x37790f[_0x58f705(0x1ce)]:_0x37790f[_0x58f705(0x1ce)]?.['tableData']||[];if(!_0x37790f[_0x58f705(0x1b1)])return{'success':!![],'data':{'tableData':[]}};const _0x131647=_0x31aeec['filter'](_0x2cc143=>{const _0x5cd7e3=_0x58f705,_0x455ebd=_0x18f4a7[_0x5cd7e3(0x19f)]();return _0x2cc143[_0x5cd7e3(0x1c2)]?.[_0x5cd7e3(0x19f)]()[_0x5cd7e3(0x1ad)](_0x455ebd)||_0x2cc143['code']?.['toLowerCase']()[_0x5cd7e3(0x1ad)](_0x455ebd)||_0x2cc143[_0x5cd7e3(0x1cc)]?.[_0x5cd7e3(0x1a5)]?.[_0x5cd7e3(0x19f)]()[_0x5cd7e3(0x1ad)](_0x455ebd)||_0x2cc143[_0x5cd7e3(0x1c5)]?.['toLowerCase']()[_0x5cd7e3(0x1ad)](_0x455ebd);});return{'success':!![],'data':{'tableData':_0x131647,'paging':{'totalCount':_0x131647[_0x58f705(0x1e7)],'currentPage':0x1,'pageSize':_0x131647[_0x58f705(0x1e7)]}}};}async[a2_0x16b015(0x1c9)](_0x4e1c62){const _0x309f30=a2_0x16b015,_0xa31bb0=_0x4e1c62?.[_0x309f30(0x192)]||0x1,_0x27bbc0=_0x4e1c62?.['pageSize']||0x3e7,_0x1a5e39=this[_0x309f30(0x1e3)]+_0x309f30(0x18d),_0x4aa56b={'appCode':this[_0x309f30(0x1de)],'currentPage':_0xa31bb0,'pageSize':_0x27bbc0,..._0x4e1c62?.[_0x309f30(0x1cf)]&&{'sqlCode':_0x4e1c62[_0x309f30(0x1cf)]},..._0x4e1c62?.[_0x309f30(0x1b7)]&&{'sqlName':_0x4e1c62['sqlName']}},_0x50694e=await this[_0x309f30(0x1dc)](_0x1a5e39,_0x4aa56b);return _0x50694e;}async['executeSql'](_0x2358b1){const _0x2c32fb=a2_0x16b015,_0x174f5f=this[_0x2c32fb(0x1d8)]+_0x2c32fb(0x1a7),_0x1662b6={'appCode':this['appCode'],'sqlCode':_0x2358b1['sqlCode'],..._0x2358b1['params']&&{'params':_0x2358b1[_0x2c32fb(0x1c6)]}};return await this[_0x2c32fb(0x1dc)](_0x174f5f,_0x1662b6);}async['saveUserCustomSql'](_0x48f6d4){const _0xae8c8b=a2_0x16b015,_0x300b8a=this[_0xae8c8b(0x1e3)]+'/smartapi/custom/saveUserCustomSql',_0x3767e2={'sqlName':_0x48f6d4['sqlName'],'dbId':_0x48f6d4[_0xae8c8b(0x1b9)],'sqlContent':_0x48f6d4[_0xae8c8b(0x1a1)],'appCode':this[_0xae8c8b(0x1de)]};return await this['postRequest'](_0x300b8a,_0x3767e2);}async[a2_0x16b015(0x19e)](_0x2775c1){const _0x1e094a=a2_0x16b015,_0x5dd994=this[_0x1e094a(0x1e3)]+'/smartapi/custom/updateUserCustomSql',_0x324ab2={'id':_0x2775c1['id'],'dbId':_0x2775c1[_0x1e094a(0x1b9)],'sqlName':_0x2775c1[_0x1e094a(0x1b7)],'appCode':this['appCode'],'sqlContent':_0x2775c1['sqlContent']};return await this[_0x1e094a(0x1dc)](_0x5dd994,_0x324ab2);}async[a2_0x16b015(0x17f)](_0x5cc1c5,_0x525606=![]){const _0x111953=a2_0x16b015,_0x385099=_0x111953(0x1d1)+this[_0x111953(0x1de)]+':'+this[_0x111953(0x1c7)]+':'+_0x5cc1c5;if(!_0x525606){const _0x4f3c16=apiCache['get'](_0x385099);if(_0x4f3c16)return _0x4f3c16;}const _0x402d00=this['apiDomain']+_0x111953(0x19a),_0x1be6c0=await this[_0x111953(0x1dc)](_0x402d00,{'dblinkId':_0x5cc1c5,'appCode':this['appCode']});if(!_0x1be6c0['success']||!_0x1be6c0[_0x111953(0x1ce)])throw new Error(_0x111953(0x1b2)+_0x5cc1c5);const _0x50c8bc={'meta':_0x1be6c0[_0x111953(0x1ce)][_0x111953(0x1b3)],'datasets':_0x1be6c0[_0x111953(0x1ce)]['datasets']};return apiCache[_0x111953(0x187)](_0x385099,_0x50c8bc),_0x50c8bc;}async[a2_0x16b015(0x182)](_0x3d4791=![]){const _0x442f4a=a2_0x16b015,_0x5bb1f7=await this['getDatasetList']({'forceRefresh':_0x3d4791}),_0x2d46d5=Array[_0x442f4a(0x1b5)](_0x5bb1f7[_0x442f4a(0x1ce)])?_0x5bb1f7[_0x442f4a(0x1ce)]:_0x5bb1f7[_0x442f4a(0x1ce)]?.['tableData']||[],_0x46e9e1=new Set();for(const _0x5145f2 of _0x2d46d5){_0x5145f2[_0x442f4a(0x1cc)]?.[_0x442f4a(0x1b9)]&&_0x46e9e1['add'](_0x5145f2[_0x442f4a(0x1cc)][_0x442f4a(0x1b9)]);}return Array['from'](_0x46e9e1)['sort']((_0xb23cde,_0x38f8c7)=>_0xb23cde-_0x38f8c7);}async[a2_0x16b015(0x180)](_0x50d4fd=![]){const _0x1b83fc=a2_0x16b015,_0x4f826d=_0x1b83fc(0x1e1)+this[_0x1b83fc(0x1de)]+':'+this[_0x1b83fc(0x1c7)];if(!_0x50d4fd){const _0x21c323=apiCache['get'](_0x4f826d);if(_0x21c323)return _0x21c323;}const _0x358565=await this[_0x1b83fc(0x182)](_0x50d4fd),_0x1d8bfb=new Map();for(const _0x143115 of _0x358565){try{const _0x2edc01=await this['getErConfig'](_0x143115,_0x50d4fd);_0x1d8bfb[_0x1b83fc(0x187)](_0x143115,_0x2edc01);}catch(_0x2de0f5){console[_0x1b83fc(0x1cb)](_0x1b83fc(0x1db)+_0x143115+':',_0x2de0f5);}}return apiCache[_0x1b83fc(0x187)](_0x4f826d,_0x1d8bfb),_0x1d8bfb;}async[a2_0x16b015(0x1d6)](_0x31cbf6,_0xfb7369=![]){const _0x485f20=a2_0x16b015,_0x31e0c0=await this[_0x485f20(0x180)](_0xfb7369),_0x3db68b=[],_0xb750ff=[];for(const [,_0x29fd02]of _0x31e0c0){const _0x25c5d7=_0x29fd02[_0x485f20(0x1ab)][_0x485f20(0x1a2)](_0x4022be=>_0x4022be[_0x485f20(0x1bd)]===_0x31cbf6);if(_0x25c5d7)for(const _0xfe8f37 of _0x25c5d7[_0x485f20(0x1da)]||[]){_0x3db68b[_0x485f20(0x196)]({'toDataset':_0xfe8f37[_0x485f20(0x1bb)],'toDatasetName':_0xfe8f37[_0x485f20(0x1c0)],'toField':_0xfe8f37[_0x485f20(0x1a9)],'fromField':_0xfe8f37[_0x485f20(0x1e8)],'joinType':_0xfe8f37['joinType']});}for(const _0x50d842 of _0x29fd02[_0x485f20(0x1ab)]){if(_0x50d842[_0x485f20(0x1bd)]===_0x31cbf6)continue;for(const _0x409edc of _0x50d842[_0x485f20(0x1da)]||[]){_0x409edc['toDataset']===_0x31cbf6&&_0xb750ff[_0x485f20(0x196)]({'fromDataset':_0x50d842[_0x485f20(0x1bd)],'fromDatasetName':_0x50d842[_0x485f20(0x1b6)],'fromField':_0x409edc[_0x485f20(0x1e8)],'toField':_0x409edc[_0x485f20(0x1a9)],'joinType':_0x409edc[_0x485f20(0x18b)]});}}}return{'outgoing':_0x3db68b,'incoming':_0xb750ff};}async[a2_0x16b015(0x188)](){const _0x4edf77=a2_0x16b015,_0x45112a=this[_0x4edf77(0x1e3)]+_0x4edf77(0x1c3)+encodeURIComponent(this[_0x4edf77(0x1de)])+_0x4edf77(0x1c4);return await this[_0x4edf77(0x189)](_0x45112a);}async[a2_0x16b015(0x181)](_0x2f7d5d){const _0x3fad8e=a2_0x16b015,_0x48e3ac=this['apiDomain']+_0x3fad8e(0x1a4)+_0x2f7d5d;return await this[_0x3fad8e(0x189)](_0x48e3ac);}async[a2_0x16b015(0x185)](_0x451ed2){const _0xc5ee19=a2_0x16b015,_0x2fe799=this[_0xc5ee19(0x1e3)]+_0xc5ee19(0x1af),_0x290876={'id':_0x451ed2['id']??null,'appCode':_0x451ed2['appCode'],'description':_0x451ed2[_0xc5ee19(0x1c5)],'scriptContent':_0x451ed2[_0xc5ee19(0x18a)],'scriptType':_0x451ed2[_0xc5ee19(0x1ae)]};return await this['postRequest'](_0x2fe799,_0x290876);}}
|
|
1
|
+
const a1_0x366531=a1_0x311a;(function(_0x47320a,_0x34a240){const _0x2be314=a1_0x311a,_0x58309c=_0x47320a();while(!![]){try{const _0x57a508=-parseInt(_0x2be314(0x162))/0x1+-parseInt(_0x2be314(0x1a1))/0x2*(-parseInt(_0x2be314(0x171))/0x3)+parseInt(_0x2be314(0x1b9))/0x4*(-parseInt(_0x2be314(0x1b5))/0x5)+-parseInt(_0x2be314(0x1b1))/0x6+parseInt(_0x2be314(0x17f))/0x7*(-parseInt(_0x2be314(0x1a5))/0x8)+parseInt(_0x2be314(0x1ad))/0x9+parseInt(_0x2be314(0x197))/0xa;if(_0x57a508===_0x34a240)break;else _0x58309c['push'](_0x58309c['shift']());}catch(_0x35bd50){_0x58309c['push'](_0x58309c['shift']());}}}(a1_0x16a3,0x71e9b));import{getCookie}from'../auth/cookie-manager.js';import{getEffectiveApiDomain,getEffectiveRuntimeDomain}from'../auth/constants.js';import{apiCache}from'./cache.js';export class DevApiClient{[a1_0x366531(0x174)];[a1_0x366531(0x18d)];[a1_0x366531(0x1b4)];[a1_0x366531(0x191)];['runtimeDomain'];constructor(_0x7164f8){const _0x2184e8=a1_0x366531;this['appCode']=_0x7164f8[_0x2184e8(0x174)],this[_0x2184e8(0x18d)]=globalThis[_0x2184e8(0x18b)]?.[_0x2184e8(0x18d)]?.[_0x2184e8(0x15e)]||_0x2184e8(0x176),this[_0x2184e8(0x1b4)]=_0x7164f8[_0x2184e8(0x1b4)]||getCookie(),this[_0x2184e8(0x191)]=_0x7164f8['apiBaseUrl']||getEffectiveApiDomain(),this[_0x2184e8(0x16f)]=_0x7164f8[_0x2184e8(0x16c)]||getEffectiveRuntimeDomain();if(!this[_0x2184e8(0x1b4)])throw new Error(_0x2184e8(0x1bf));}static ['DEFAULT_TIMEOUT']=0x7530;async['request'](_0x3665e8,_0x42dfa9=DevApiClient[a1_0x366531(0x181)]){const _0x464de2=a1_0x366531,_0x5120c4=new AbortController(),_0x47d616=setTimeout(()=>_0x5120c4[_0x464de2(0x1bd)](),_0x42dfa9);try{const _0x422bf7=await fetch(_0x3665e8,{'headers':{'Cookie':this[_0x464de2(0x1b4)]},'signal':_0x5120c4['signal']});clearTimeout(_0x47d616);if(!_0x422bf7['ok']){if(_0x422bf7[_0x464de2(0x167)]===0x191)throw new Error(_0x464de2(0x1c6));let _0xaed992='';try{_0xaed992=await _0x422bf7[_0x464de2(0x1a8)]();}catch{}throw new Error(_0x464de2(0x188)+_0x422bf7[_0x464de2(0x167)]+'\x0aURL:\x20'+_0x3665e8+(_0xaed992?'\x0a'+_0xaed992:''));}const _0x4d864a=await _0x422bf7[_0x464de2(0x19f)]();if(_0x4d864a&&typeof _0x4d864a===_0x464de2(0x1ac)&&_0x464de2(0x185)in _0x4d864a&&!_0x4d864a[_0x464de2(0x185)]){const _0xabf337=_0x4d864a;throw new Error(_0x464de2(0x1c8)+(_0xabf337['message']||_0xabf337[_0x464de2(0x192)]||'Unknown\x20error'));}return _0x4d864a;}catch(_0x5d518b){if(_0x5d518b instanceof Error&&_0x5d518b['name']===_0x464de2(0x178))throw new Error('API\x20request\x20timeout\x20after\x20'+_0x42dfa9+'ms.\x20The\x20server\x20may\x20be\x20down\x20or\x20unreachable.\x0aURL:\x20'+_0x3665e8);if(_0x5d518b instanceof TypeError)throw new Error(_0x464de2(0x16a)+_0x3665e8);throw _0x5d518b;}}async[a1_0x366531(0x15f)](_0x2d0a4a,_0x17c041,_0x5afc1d=DevApiClient['DEFAULT_TIMEOUT']){const _0x46cc36=a1_0x366531,_0x82b0ae=new AbortController(),_0x2f57f1=setTimeout(()=>_0x82b0ae[_0x46cc36(0x1bd)](),_0x5afc1d);try{const _0x39c5f=await fetch(_0x2d0a4a,{'method':_0x46cc36(0x187),'headers':{'Content-Type':_0x46cc36(0x16d),'Cookie':this[_0x46cc36(0x1b4)]},'body':JSON[_0x46cc36(0x16e)](_0x17c041),'signal':_0x82b0ae['signal']});clearTimeout(_0x2f57f1);if(!_0x39c5f['ok']){if(_0x39c5f[_0x46cc36(0x167)]===0x191)throw new Error('Authentication\x20failed.\x20Please\x20login\x20again.');let _0x3cfca5='';try{_0x3cfca5=await _0x39c5f[_0x46cc36(0x1a8)]();}catch{}throw new Error(_0x46cc36(0x188)+_0x39c5f['status']+'\x0aURL:\x20'+_0x2d0a4a+(_0x3cfca5?'\x0a'+_0x3cfca5:''));}const _0x2cc8b6=await _0x39c5f[_0x46cc36(0x19f)]();if(_0x2cc8b6&&typeof _0x2cc8b6===_0x46cc36(0x1ac)&&_0x46cc36(0x185)in _0x2cc8b6&&!_0x2cc8b6[_0x46cc36(0x185)]){const _0x217774=_0x2cc8b6;throw new Error('API\x20error:\x20'+(_0x217774[_0x46cc36(0x1aa)]||_0x217774[_0x46cc36(0x192)]||'Unknown\x20error'));}return _0x2cc8b6;}catch(_0x31f2cf){if(_0x31f2cf instanceof Error&&_0x31f2cf[_0x46cc36(0x19a)]===_0x46cc36(0x178))throw new Error(_0x46cc36(0x168)+_0x5afc1d+_0x46cc36(0x160)+_0x2d0a4a);if(_0x31f2cf instanceof TypeError)throw new Error(_0x46cc36(0x16a)+_0x2d0a4a);throw _0x31f2cf;}}async['getDatasetList'](_0x38058d){const _0x1f03d7=a1_0x366531,_0x3705e6=_0x38058d?.['forceRefresh']||![],_0x524b58=_0x1f03d7(0x1b2)+this['appCode']+':'+this[_0x1f03d7(0x18d)];if(!_0x3705e6){const _0x169ac5=apiCache[_0x1f03d7(0x1bb)](_0x524b58);if(_0x169ac5)return _0x169ac5;}const _0x3fe66f=this[_0x1f03d7(0x191)]+_0x1f03d7(0x1a2),_0x48cf89=await this[_0x1f03d7(0x15f)](_0x3fe66f,{'appCode':this[_0x1f03d7(0x174)]});return apiCache[_0x1f03d7(0x18c)](_0x524b58,_0x48cf89),_0x48cf89;}async[a1_0x366531(0x17c)](_0x331bee,_0x2e6347=![],_0x9d24ab=![]){const _0x501089=a1_0x366531,_0x14198b=_0x501089(0x1ae)+this[_0x501089(0x174)]+':'+this[_0x501089(0x18d)]+':'+_0x331bee+':'+(_0x9d24ab?_0x501089(0x195):'no-relations');if(!_0x2e6347){const _0xa862d3=apiCache[_0x501089(0x1bb)](_0x14198b);if(_0xa862d3)return _0xa862d3;}const _0x195899=/^\d+$/[_0x501089(0x16b)](_0x331bee),_0xac0891=_0x195899?'id':_0x501089(0x172),_0xe3000c=this['apiDomain']+_0x501089(0x184)+_0xac0891+'='+_0x331bee,_0x3f3a9b=await this[_0x501089(0x193)](_0xe3000c);if(_0x9d24ab&&_0x3f3a9b[_0x501089(0x1a6)]?.[_0x501089(0x19b)]){const _0x10e675=_0x3f3a9b[_0x501089(0x1a6)][_0x501089(0x179)]==='v2',_0x148dc6=Array[_0x501089(0x18a)](_0x3f3a9b[_0x501089(0x1a6)][_0x501089(0x1c7)]);if(!_0x10e675||!_0x148dc6)try{const _0x4e507a=await this['getDatasetRelations'](_0x3f3a9b[_0x501089(0x1a6)][_0x501089(0x19b)],_0x2e6347);_0x3f3a9b[_0x501089(0x1a6)]['relations']=_0x4e507a;}catch(_0x341e1d){process[_0x501089(0x18d)][_0x501089(0x1c0)]!=='test'&&console[_0x501089(0x17e)](_0x501089(0x196)+_0x331bee+':',_0x341e1d);}}return apiCache[_0x501089(0x18c)](_0x14198b,_0x3f3a9b),_0x3f3a9b;}async[a1_0x366531(0x18f)](_0x49fa17){const _0x15a7b9=a1_0x366531,_0xddfbfd=await this[_0x15a7b9(0x189)](),_0x354961=Array[_0x15a7b9(0x18a)](_0xddfbfd[_0x15a7b9(0x1a6)])?_0xddfbfd[_0x15a7b9(0x1a6)]:_0xddfbfd['data']?.[_0x15a7b9(0x1c3)]||[];if(!_0xddfbfd[_0x15a7b9(0x185)])return{'success':!![],'data':{'tableData':[]}};const _0x1b47bf=_0x354961[_0x15a7b9(0x1af)](_0x94e08f=>{const _0x97189f=_0x15a7b9,_0x3bb3cb=_0x49fa17[_0x97189f(0x19c)]();return _0x94e08f[_0x97189f(0x19a)]?.[_0x97189f(0x19c)]()[_0x97189f(0x186)](_0x3bb3cb)||_0x94e08f[_0x97189f(0x172)]?.[_0x97189f(0x19c)]()[_0x97189f(0x186)](_0x3bb3cb)||_0x94e08f['dbtableConfig']?.[_0x97189f(0x177)]?.[_0x97189f(0x19c)]()[_0x97189f(0x186)](_0x3bb3cb)||_0x94e08f[_0x97189f(0x1c1)]?.[_0x97189f(0x19c)]()[_0x97189f(0x186)](_0x3bb3cb);});return{'success':!![],'data':{'tableData':_0x1b47bf,'paging':{'totalCount':_0x1b47bf['length'],'currentPage':0x1,'pageSize':_0x1b47bf[_0x15a7b9(0x18e)]}}};}async[a1_0x366531(0x161)](_0x4c6af6){const _0x1afca8=a1_0x366531,_0x3b7801=_0x4c6af6?.[_0x1afca8(0x1b3)]||0x1,_0x56d0e6=_0x4c6af6?.[_0x1afca8(0x163)]||0x3e7,_0x3655ae=this[_0x1afca8(0x191)]+_0x1afca8(0x194),_0x13df41={'appCode':this[_0x1afca8(0x174)],'currentPage':_0x3b7801,'pageSize':_0x56d0e6,..._0x4c6af6?.[_0x1afca8(0x1a3)]&&{'sqlCode':_0x4c6af6[_0x1afca8(0x1a3)]},..._0x4c6af6?.[_0x1afca8(0x17d)]&&{'sqlName':_0x4c6af6[_0x1afca8(0x17d)]}},_0x343816=await this[_0x1afca8(0x15f)](_0x3655ae,_0x13df41);return _0x343816;}async[a1_0x366531(0x165)](_0x12e953){const _0x359de7=a1_0x366531,_0x5198d6=this[_0x359de7(0x16f)]+_0x359de7(0x1b6),_0x1b23d3={'appCode':this[_0x359de7(0x174)],'sqlCode':_0x12e953[_0x359de7(0x1a3)],..._0x12e953[_0x359de7(0x175)]&&{'params':_0x12e953[_0x359de7(0x175)]}};return await this[_0x359de7(0x15f)](_0x5198d6,_0x1b23d3);}async['saveUserCustomSql'](_0x137e04){const _0x478f0c=a1_0x366531,_0x3b8a05=this[_0x478f0c(0x191)]+_0x478f0c(0x198),_0x38300a={'sqlName':_0x137e04[_0x478f0c(0x17d)],'dbId':_0x137e04[_0x478f0c(0x166)],'sqlContent':_0x137e04[_0x478f0c(0x1c2)],'appCode':this[_0x478f0c(0x174)]};return await this['postRequest'](_0x3b8a05,_0x38300a);}async[a1_0x366531(0x173)](_0xfc5875){const _0x46e1de=a1_0x366531,_0x522308=this[_0x46e1de(0x191)]+_0x46e1de(0x19e),_0x30fe5c={'id':_0xfc5875['id'],'dbId':_0xfc5875[_0x46e1de(0x166)],'sqlName':_0xfc5875[_0x46e1de(0x17d)],'appCode':this['appCode'],'sqlContent':_0xfc5875[_0x46e1de(0x1c2)]};return await this[_0x46e1de(0x15f)](_0x522308,_0x30fe5c);}async[a1_0x366531(0x1c9)](_0x43cf09,_0x405294=![]){const _0x2fd695=a1_0x366531,_0xa4f213=_0x2fd695(0x182)+this[_0x2fd695(0x174)]+':'+this[_0x2fd695(0x18d)]+':'+_0x43cf09;if(!_0x405294){const _0x308813=apiCache[_0x2fd695(0x1bb)](_0xa4f213);if(_0x308813)return _0x308813;}const _0x4ce08a=this[_0x2fd695(0x191)]+'/smartapi/question/er-config',_0x3921dd=await this[_0x2fd695(0x15f)](_0x4ce08a,{'dblinkId':_0x43cf09,'appCode':this['appCode']});if(!_0x3921dd['success']||!_0x3921dd[_0x2fd695(0x1a6)])throw new Error(_0x2fd695(0x1b0)+_0x43cf09);const _0x3c0bdd={'meta':_0x3921dd[_0x2fd695(0x1a6)][_0x2fd695(0x183)],'datasets':_0x3921dd[_0x2fd695(0x1a6)][_0x2fd695(0x1c5)]};return apiCache[_0x2fd695(0x18c)](_0xa4f213,_0x3c0bdd),_0x3c0bdd;}async[a1_0x366531(0x17b)](_0x2c890e=![]){const _0x26f6cd=a1_0x366531,_0x592b5a=await this[_0x26f6cd(0x189)]({'forceRefresh':_0x2c890e}),_0xdb2485=Array[_0x26f6cd(0x18a)](_0x592b5a[_0x26f6cd(0x1a6)])?_0x592b5a[_0x26f6cd(0x1a6)]:_0x592b5a[_0x26f6cd(0x1a6)]?.[_0x26f6cd(0x1c3)]||[],_0x56e61d=new Set();for(const _0x19cc57 of _0xdb2485){_0x19cc57[_0x26f6cd(0x199)]?.['dbId']&&_0x56e61d[_0x26f6cd(0x1ab)](_0x19cc57[_0x26f6cd(0x199)][_0x26f6cd(0x166)]);}return Array[_0x26f6cd(0x1a9)](_0x56e61d)[_0x26f6cd(0x190)]((_0x402008,_0x4e689f)=>_0x402008-_0x4e689f);}async['getAllErConfigs'](_0x31564a=![]){const _0x1e7fee=a1_0x366531,_0x5b0c15='er-configs-all:'+this['appCode']+':'+this['env'];if(!_0x31564a){const _0x1bf6e5=apiCache[_0x1e7fee(0x1bb)](_0x5b0c15);if(_0x1bf6e5)return _0x1bf6e5;}const _0x1cacb7=await this[_0x1e7fee(0x17b)](_0x31564a),_0x2487f3=new Map();for(const _0x12eb9b of _0x1cacb7){try{const _0x1bb11c=await this[_0x1e7fee(0x1c9)](_0x12eb9b,_0x31564a);_0x2487f3[_0x1e7fee(0x18c)](_0x12eb9b,_0x1bb11c);}catch(_0x1514a6){console[_0x1e7fee(0x17e)]('Failed\x20to\x20get\x20ER\x20config\x20for\x20dbId\x20'+_0x12eb9b+':',_0x1514a6);}}return apiCache['set'](_0x5b0c15,_0x2487f3),_0x2487f3;}async['getDatasetRelations'](_0x1fb019,_0x3055a0=![]){const _0x314969=a1_0x366531,_0x458b5f=await this[_0x314969(0x1ba)](_0x3055a0),_0x24b08a=[],_0x5111e4=[];for(const [,_0x1cf803]of _0x458b5f){const _0x4429af=_0x1cf803[_0x314969(0x1c5)][_0x314969(0x1be)](_0x5461a8=>_0x5461a8[_0x314969(0x1a0)]===_0x1fb019);if(_0x4429af)for(const _0x753bc9 of _0x4429af[_0x314969(0x1c7)]||[]){_0x24b08a['push']({'toDataset':_0x753bc9['toDataset'],'toDatasetName':_0x753bc9[_0x314969(0x19d)],'toField':_0x753bc9[_0x314969(0x1a7)],'fromField':_0x753bc9['fromField'],'joinType':_0x753bc9['joinType']});}for(const _0x207793 of _0x1cf803[_0x314969(0x1c5)]){if(_0x207793[_0x314969(0x1a0)]===_0x1fb019)continue;for(const _0x190800 of _0x207793['relations']||[]){_0x190800[_0x314969(0x180)]===_0x1fb019&&_0x5111e4['push']({'fromDataset':_0x207793['datasetCode'],'fromDatasetName':_0x207793[_0x314969(0x164)],'fromField':_0x190800[_0x314969(0x169)],'toField':_0x190800[_0x314969(0x1a7)],'joinType':_0x190800['joinType']});}}}return{'outgoing':_0x24b08a,'incoming':_0x5111e4};}async['getBffScriptList'](){const _0x283789=a1_0x366531,_0x39fffe=this[_0x283789(0x191)]+_0x283789(0x1b7)+encodeURIComponent(this[_0x283789(0x174)])+_0x283789(0x17a);return await this[_0x283789(0x193)](_0x39fffe);}async[a1_0x366531(0x1a4)](_0x5c1223){const _0x2bb448=a1_0x366531,_0x528acd=this['apiDomain']+_0x2bb448(0x170)+_0x5c1223;return await this['request'](_0x528acd);}async[a1_0x366531(0x1c4)](_0x5b858a){const _0x5aa565=a1_0x366531,_0x45199c=this[_0x5aa565(0x191)]+_0x5aa565(0x1bc),_0x5cb5d9={'id':_0x5b858a['id']??null,'appCode':_0x5b858a[_0x5aa565(0x174)],'description':_0x5b858a['description'],'scriptContent':_0x5b858a['scriptContent'],'scriptType':_0x5b858a[_0x5aa565(0x1b8)]};return await this['postRequest'](_0x45199c,_0x5cb5d9);}}function a1_0x311a(_0x5cef9f,_0x465389){_0x5cef9f=_0x5cef9f-0x15e;const _0x16a3ff=a1_0x16a3();let _0x311a20=_0x16a3ff[_0x5cef9f];return _0x311a20;}function a1_0x16a3(){const _0x5eecb9=['object','5276970OyyLci','dataset-detail:','filter','Failed\x20to\x20get\x20ER\x20config\x20for\x20dblinkId:\x20','3350634MnUdVi','dataset-list:','currentPage','cookie','3499085WShlQI','/api/custom/executeSql','/api/management/library/scripts/list?appCode=','scriptType','4bGGWhp','getAllErConfigs','get','/api/management/library/scripts/save','abort','find','No\x20authentication\x20cookie\x20found.\x20Please\x20login\x20first.','NODE_ENV','description','sqlContent','tableData','saveBffScript','datasets','Authentication\x20failed.\x20Please\x20login\x20again.','relations','API\x20error:\x20','getErConfig','LOVRABET_ENV','postRequest','ms.\x20The\x20server\x20may\x20be\x20down\x20or\x20unreachable.\x0aURL:\x20','getCustomSqlList','414623gBFVXC','pageSize','datasetName','executeSql','dbId','status','API\x20request\x20timeout\x20after\x20','fromField','Network\x20error:\x20Unable\x20to\x20connect\x20to\x20the\x20server.\x20Please\x20check\x20your\x20network\x20connection\x20or\x20the\x20server\x20may\x20be\x20down.\x0aURL:\x20','test','runtimeBaseUrl','application/json','stringify','runtimeDomain','/api/management/library/scripts/info?id=','1653EWmnKT','code','updateUserCustomSql','appCode','params','online','tableName','AbortError','doVersion','&type=ENDPOINT','getUniqueDbIds','getDatasetDetail','sqlName','warn','4010594tnVXXA','toDataset','DEFAULT_TIMEOUT','er-config:','meta','/smartapi/dataset/get-driven-data?','success','includes','POST','API\x20request\x20failed:\x20HTTP\x20','getDatasetList','isArray','process','set','env','length','searchDatasets','sort','apiDomain','errorMsg','request','/smartapi/custom/queryUserCustomSqlList','with-relations','[getDatasetDetail]\x20Failed\x20to\x20fetch\x20relations\x20for\x20','18941070nENVUx','/smartapi/custom/saveUserCustomSql','dbtableConfig','name','modelCode','toLowerCase','toDatasetName','/smartapi/custom/updateUserCustomSql','json','datasetCode','842khuzgd','/smartapi/dataset/get-dataset-list','sqlCode','getBffScriptInfo','8RrcoYj','data','toField','text','from','message','add'];a1_0x16a3=function(){return _0x5eecb9;};return a1_0x16a3();}
|
package/dist/auth/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a2_0x483a(){var _0x3f163d=['1394965CSaxjd','1418342UnnGwK','72PcNXxo','277792vKnbGl','15ysiBJw','276AzuTJH','455766nbbukI','10OIrHkT','3785bDZhNT','42tUKKjj','12825261JDfeDv','738928tgsJuc'];a2_0x483a=function(){return _0x3f163d;};return a2_0x483a();}(function(_0x3dda4a,_0x232ba0){var _0x3d9b59=a2_0x1432,_0x5cb8af=_0x3dda4a();while(!![]){try{var _0x1d5bad=-parseInt(_0x3d9b59(0x1f1))/0x1+parseInt(_0x3d9b59(0x1ec))/0x2+parseInt(_0x3d9b59(0x1ef))/0x3*(-parseInt(_0x3d9b59(0x1ee))/0x4)+parseInt(_0x3d9b59(0x1f3))/0x5*(-parseInt(_0x3d9b59(0x1ed))/0x6)+-parseInt(_0x3d9b59(0x1f4))/0x7*(parseInt(_0x3d9b59(0x1f6))/0x8)+-parseInt(_0x3d9b59(0x1f5))/0x9*(parseInt(_0x3d9b59(0x1f2))/0xa)+parseInt(_0x3d9b59(0x1f7))/0xb*(parseInt(_0x3d9b59(0x1f0))/0xc);if(_0x1d5bad===_0x232ba0)break;else _0x5cb8af['push'](_0x5cb8af['shift']());}catch(_0x108114){_0x5cb8af['push'](_0x5cb8af['shift']());}}}(a2_0x483a,0xcbc29));function a2_0x1432(_0x4401bb,_0x307715){_0x4401bb=_0x4401bb-0x1ec;var _0x483aee=a2_0x483a();var _0x1432ef=_0x483aee[_0x4401bb];return _0x1432ef;}export{getEnvAppCode,getEnvironment,getEnvApiBaseUrl,getEnvRuntimeBaseUrl,getEnvUserBaseUrl,getEnvAuthCookie,configDir,cookieFile,defaultConfig,getEnvAppCodeWithFallback,getApiDomain,getUserDomain,getRuntimeDomain,getEffectiveApiDomain,getEffectiveRuntimeDomain,getEffectiveUserDomain}from'../config/env.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f37e5,_0x146cf3){const _0x2c21d0=a3_0xa467,_0x21975a=_0x4f37e5();while(!![]){try{const _0x3d483f=parseInt(_0x2c21d0(0x12a))/0x1+parseInt(_0x2c21d0(0x12b))/0x2*(-parseInt(_0x2c21d0(0x12c))/0x3)+-parseInt(_0x2c21d0(0x128))/0x4*(-parseInt(_0x2c21d0(0x129))/0x5)+-parseInt(_0x2c21d0(0x12e))/0x6*(parseInt(_0x2c21d0(0x125))/0x7)+parseInt(_0x2c21d0(0x130))/0x8*(parseInt(_0x2c21d0(0x127))/0x9)+-parseInt(_0x2c21d0(0x12f))/0xa+parseInt(_0x2c21d0(0x126))/0xb;if(_0x3d483f===_0x146cf3)break;else _0x21975a['push'](_0x21975a['shift']());}catch(_0x5d1de2){_0x21975a['push'](_0x21975a['shift']());}}}(a3_0x342f,0xbc8b4));function a3_0x342f(){const _0x5da2ba=['3583517jpjMNf','16958546kHKBsp','111744BtbmRY','124ubVBeS','186605kRgjrZ','700780qXQbcS','278394eCMYoJ','15CoIGCt','length','18vKwSvf','7430110iNEWpB','224cpFshF','utf-8','message','trim'];a3_0x342f=function(){return _0x5da2ba;};return a3_0x342f();}import{readFileSync,writeFileSync}from'node:fs';import{getEnvAuthCookie,cookieFile}from'../config/env.js';export function getCookie(){const _0x62f122=a3_0xa467,_0x5906ff=getEnvAuthCookie();if(_0x5906ff)return _0x5906ff;try{return readFileSync(cookieFile,'utf-8')[_0x62f122(0x124)]();}catch{return'';}}export function saveCookie(_0x4c5ab7){const _0x176e6b=a3_0xa467;try{writeFileSync(cookieFile,_0x4c5ab7,_0x176e6b(0x131));}catch(_0x2c5979){throw new Error('Failed\x20to\x20save\x20cookie\x20to\x20'+cookieFile+':\x20'+_0x2c5979[_0x176e6b(0x123)]);}}export function hasCookie(){const _0x3e1762=a3_0xa467,_0x1b68d5=getCookie();return _0x1b68d5[_0x3e1762(0x12d)]>0x0;}function a3_0xa467(_0xd223c9,_0x9bd015){_0xd223c9=_0xd223c9-0x123;const _0x342f4f=a3_0x342f();let _0xa46751=_0x342f4f[_0xd223c9];return _0xa46751;}export function clearCookie(){const _0x519972=a3_0xa467;try{writeFileSync(cookieFile,'',_0x519972(0x131));}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x252fc0,_0x530356){const _0x5d2813=a4_0x3a86,_0x4b2c8d=_0x252fc0();while(!![]){try{const _0x49dc86=parseInt(_0x5d2813(0x77))/0x1*(parseInt(_0x5d2813(0x6b))/0x2)+parseInt(_0x5d2813(0x6d))/0x3+-parseInt(_0x5d2813(0x6c))/0x4+parseInt(_0x5d2813(0x72))/0x5+-parseInt(_0x5d2813(0x6e))/0x6*(parseInt(_0x5d2813(0x71))/0x7)+parseInt(_0x5d2813(0x73))/0x8+-parseInt(_0x5d2813(0x6f))/0x9*(parseInt(_0x5d2813(0x70))/0xa);if(_0x49dc86===_0x530356)break;else _0x4b2c8d['push'](_0x4b2c8d['shift']());}catch(_0x51cc44){_0x4b2c8d['push'](_0x4b2c8d['shift']());}}}(a4_0x8235,0x810d7));function a4_0x8235(){const _0x156d0b=['1501052PIlIzV','2737125gNOapp','6vQPYOt','207FnpoFg','476590rHPYYT','6780662EKfTOS','3004110uwTaSE','3619032gheGsf','user','json','/api/auth/get-session','1003109RqZXeE','2gAbeBc'];a4_0x8235=function(){return _0x156d0b;};return a4_0x8235();}import{getCookie}from'./cookie-manager.js';import{getUserDomain}from'../config/env.js';function a4_0x3a86(_0xb4f8b,_0x12d689){_0xb4f8b=_0xb4f8b-0x6b;const _0x82352f=a4_0x8235();let _0x3a8620=_0x82352f[_0xb4f8b];return _0x3a8620;}export async function isSessionValid(){const _0xc3c9aa=a4_0x3a86,_0x2244d1=getCookie();if(!_0x2244d1)return![];try{const _0x330ac1=await fetch(getUserDomain()+_0xc3c9aa(0x76),{'headers':{'cookie':_0x2244d1}});if(!_0x330ac1['ok'])return![];const _0x1cd28f=await _0x330ac1[_0xc3c9aa(0x75)]();return!!(_0x1cd28f?.['session']&&_0x1cd28f?.[_0xc3c9aa(0x74)]);}catch{return![];}}
|
package/dist/config/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a5_0x350b39=a5_0x3444;(function(_0x373b89,_0x21ca9a){const _0x3b7baf=a5_0x3444,_0x476dfe=_0x373b89();while(!![]){try{const _0x52aa8b=parseInt(_0x3b7baf(0x16e))/0x1+-parseInt(_0x3b7baf(0x157))/0x2+parseInt(_0x3b7baf(0x16a))/0x3*(parseInt(_0x3b7baf(0x163))/0x4)+-parseInt(_0x3b7baf(0x160))/0x5+-parseInt(_0x3b7baf(0x164))/0x6+parseInt(_0x3b7baf(0x16c))/0x7*(-parseInt(_0x3b7baf(0x165))/0x8)+parseInt(_0x3b7baf(0x167))/0x9;if(_0x52aa8b===_0x21ca9a)break;else _0x476dfe['push'](_0x476dfe['shift']());}catch(_0x11a5d){_0x476dfe['push'](_0x476dfe['shift']());}}}(a5_0x4c0c,0xdc128));import{mkdirSync}from'node:fs';import{homedir}from'node:os';export function getEnvAppCode(){const _0x3e798b=a5_0x3444;return process[_0x3e798b(0x15e)][_0x3e798b(0x15d)];}export function getEnvironment(){const _0x473483=a5_0x3444;return process[_0x473483(0x15e)][_0x473483(0x16d)]||_0x473483(0x169);}export function getEnvApiBaseUrl(){const _0xa00959=a5_0x3444;return process[_0xa00959(0x15e)][_0xa00959(0x15a)];}export function getEnvRuntimeBaseUrl(){const _0x3c252c=a5_0x3444;return process['env'][_0x3c252c(0x162)];}function a5_0x4c0c(){const _0x2e879a=['8XdWHRR','development','31630158imDdiC','https://user-daily.lovrabet.com','online','3183099rFvjEJ','LOVRABET_USER_BASEURL','10481765dawrgn','LOVRABET_ENV','1388243ojicgx','2806726GrJdRi','https://user.lovrabet.com','NODE_ENV','LOVRABET_API_BASEURL','trim','/.lovrabet','LOVRABET_APP_CODE','env','https://api.lovrabet.com','8075535JyiPtz','test','LOVRABET_RUNTIME_BASEURL','4BhJHfY','3278742IkrnoW'];a5_0x4c0c=function(){return _0x2e879a;};return a5_0x4c0c();}export function getEnvUserBaseUrl(){const _0x46d97c=a5_0x3444;return process[_0x46d97c(0x15e)][_0x46d97c(0x16b)];}export function getEnvAuthCookie(){const _0xd93eff=a5_0x3444;return process[_0xd93eff(0x15e)]['LOVRABET_AUTH_COOKIE']?.[_0xd93eff(0x15b)]();}export function isTestEnv(){const _0x5b2ff6=a5_0x3444;return process[_0x5b2ff6(0x15e)][_0x5b2ff6(0x159)]===_0x5b2ff6(0x161);}export function isProductionEnv(){const _0x35680b=a5_0x3444;return process['env'][_0x35680b(0x159)]==='production';}export function isDevelopmentEnv(){const _0x27b2dc=a5_0x3444;return process[_0x27b2dc(0x15e)][_0x27b2dc(0x159)]===_0x27b2dc(0x166);}export function shouldLog(){const _0x3336c5=a5_0x3444,_0x493557=process[_0x3336c5(0x15e)][_0x3336c5(0x159)];return _0x493557===_0x3336c5(0x166)||_0x493557==='daily';}export const configDir=homedir()+a5_0x350b39(0x15c);export const cookieFile=configDir+'/cookie';function a5_0x3444(_0x1483c9,_0x16c000){_0x1483c9=_0x1483c9-0x157;const _0x4c0c73=a5_0x4c0c();let _0x3444bd=_0x4c0c73[_0x1483c9];return _0x3444bd;}mkdirSync(configDir,{'recursive':!![]});export const defaultConfig={'appCode':getEnvAppCode(),'env':getEnvironment()};export function getEnvAppCodeWithFallback(_0x397853){return getEnvAppCode()||_0x397853;}export function getApiDomain(){const _0x2b18a5=a5_0x350b39,_0x3c417d=getEnvironment();return _0x3c417d===_0x2b18a5(0x169)?_0x2b18a5(0x15f):'https://daily-api.lovrabet.com';}export function getUserDomain(){const _0x23d850=a5_0x350b39,_0x2332fb=getEnvironment();return _0x2332fb===_0x23d850(0x169)?_0x23d850(0x158):_0x23d850(0x168);}export function getRuntimeDomain(){const _0x50eac5=a5_0x350b39,_0x254665=getEnvironment();return _0x254665===_0x50eac5(0x169)?'https://runtime.lovrabet.com':'https://daily-runtime.lovrabet.com';}export function getEffectiveApiDomain(){return getEnvApiBaseUrl()||getApiDomain();}export function getEffectiveRuntimeDomain(){return getEnvRuntimeBaseUrl()||getRuntimeDomain();}export function getEffectiveUserDomain(){return getEnvUserBaseUrl()||getUserDomain();}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
const a6_0x412516=a6_0x1c65;(function(_0x26b403,_0x307141){const _0x1338f7=a6_0x1c65,_0x15117d=_0x26b403();while(!![]){try{const _0x265042=-parseInt(_0x1338f7(0x1eb))/0x1*(parseInt(_0x1338f7(0x1f4))/0x2)+-parseInt(_0x1338f7(0x1dc))/0x3+-parseInt(_0x1338f7(0x1e2))/0x4*(parseInt(_0x1338f7(0x1ef))/0x5)+parseInt(_0x1338f7(0x1e9))/0x6+-parseInt(_0x1338f7(0x1da))/0x7*(parseInt(_0x1338f7(0x1ea))/0x8)+parseInt(_0x1338f7(0x1ed))/0x9*(parseInt(_0x1338f7(0x1f1))/0xa)+parseInt(_0x1338f7(0x1de))/0xb*(parseInt(_0x1338f7(0x1df))/0xc);if(_0x265042===_0x307141)break;else _0x15117d['push'](_0x15117d['shift']());}catch(_0x295881){_0x15117d['push'](_0x15117d['shift']());}}}(a6_0x5559,0xc5da6));import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';function a6_0x1c65(_0x58d6e8,_0x55081e){_0x58d6e8=_0x58d6e8-0x1da;const _0x555990=a6_0x5559();let _0x1c657e=_0x555990[_0x58d6e8];return _0x1c657e;}import{createServer}from'./server.js';function parseArgs(){const _0x2edc91=a6_0x1c65,_0x1d2447=process[_0x2edc91(0x1ee)]['slice'](0x2),_0x2664d3=_0x1d2447[_0x2edc91(0x1db)]('--dangerously-bff-save');return{'bffAutosave':_0x2664d3};}async function main(){const _0x364525=a6_0x1c65;try{const {bffAutosave:_0x594252}=parseArgs(),_0x5dc4bd=createServer({'bffAutosave':_0x594252}),_0x1b55e9=new StdioServerTransport();_0x5dc4bd[_0x364525(0x1e7)](),await _0x5dc4bd[_0x364525(0x1e1)](_0x1b55e9),process['on'](_0x364525(0x1e4),async()=>{const _0x59f063=_0x364525;process[_0x59f063(0x1e8)]['MCP_DEBUG']&&console[_0x59f063(0x1e0)](_0x59f063(0x1dd)),process['exit'](0x0);}),process['on'](_0x364525(0x1e3),async()=>{const _0x5bb5a3=_0x364525;process[_0x5bb5a3(0x1e8)][_0x5bb5a3(0x1ec)]&&console[_0x5bb5a3(0x1e0)](_0x5bb5a3(0x1dd)),process['exit'](0x0);});}catch(_0x5e226d){console['error'](_0x364525(0x1f3),_0x5e226d),process[_0x364525(0x1e5)](0x1);}}main()[a6_0x412516(0x1f0)](_0x481f46=>{const _0x424a6b=a6_0x412516;console[_0x424a6b(0x1e6)](_0x424a6b(0x1f2),_0x481f46),process['exit'](0x1);});function a6_0x5559(){const _0x4c9839=['37104CyQDgY','log','connect','9332FlDrYW','SIGTERM','SIGINT','exit','error','logInfo','env','9402924JQkFbh','26736DnWozT','119585lnIZDB','MCP_DEBUG','11701161mhADOK','argv','465ekUonH','catch','10MzeiTp','Unhandled\x20error:','Failed\x20to\x20start\x20Lovrabet\x20Dataset\x20MCP\x20Server:','4mTRxaa','1673gFcUSl','includes','3676812CvwQzp','Shutting\x20down\x20Lovrabet\x20Dataset\x20MCP\x20Server...','1507lVPYBk'];a6_0x5559=function(){return _0x4c9839;};return a6_0x5559();}
|
package/dist/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x5ffa61=a8_0x34a9;(function(_0x5eda5c,_0x57d67d){const _0x3d66dd=a8_0x34a9,_0x3df6a5=_0x5eda5c();while(!![]){try{const _0x378674=-parseInt(_0x3d66dd(0x8e))/0x1*(parseInt(_0x3d66dd(0xcc))/0x2)+parseInt(_0x3d66dd(0x109))/0x3*(parseInt(_0x3d66dd(0xe1))/0x4)+-parseInt(_0x3d66dd(0xaa))/0x5+-parseInt(_0x3d66dd(0x102))/0x6+parseInt(_0x3d66dd(0x9c))/0x7*(parseInt(_0x3d66dd(0xaf))/0x8)+parseInt(_0x3d66dd(0xb3))/0x9+parseInt(_0x3d66dd(0xe8))/0xa;if(_0x378674===_0x57d67d)break;else _0x3df6a5['push'](_0x3df6a5['shift']());}catch(_0x53e0d5){_0x3df6a5['push'](_0x3df6a5['shift']());}}}(a8_0x3a65,0x21e38));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(a8_0x5ffa61(0xd8)),authSchema={'appCode':z[a8_0x5ffa61(0x98)]()[a8_0x5ffa61(0xf0)]()['describe'](a8_0x5ffa61(0xeb)),'cookie':z[a8_0x5ffa61(0x98)]()['optional']()[a8_0x5ffa61(0xf3)](a8_0x5ffa61(0x107))};function registerToolWithOptions(_0x4d7a1b,_0x569240,_0x5b0a59,_0x422d8a){const _0x3672ce=a8_0x5ffa61;_0x4d7a1b[_0x3672ce(0xf5)](_0x569240,_0x5b0a59,_0x422d8a);}function a8_0x3a65(){const _0x572bb5=['Bypass\x20cache\x20and\x20fetch\x20fresh\x20data\x20from\x20API\x20(default:\x20false).\x20Set\x20to\x20true\x20when\x20you\x20need\x20the\x20latest\x20data.','Generate\x20SDK\x20Code','128rwTyoU','message','Optional:\x20server-side\x20fuzzy\x20match\x20by\x20sqlCode\x20(e.g.,\x20\x22a495-977\x22)','Backend\x20Function\x20ID\x20(get\x20from\x20list_bff_scripts)','1411821VqChpp','\x20\x20This\x20server\x20uses\x20cookie-based\x20authentication.','text','connect','\x20\x20-\x20save_or_update_custom_sql:\x20Save\x20or\x20update\x20a\x20custom\x20SELECT\x20SQL\x20query','Generate\x20SDK\x20code\x20example\x20for\x20calling\x20a\x20specific\x20operation,\x20including\x20complete\x20field\x20metadata\x20(required,\x20enum\x20values,\x20etc.).\x0a\x0aCRITICAL\x20-\x20SDK\x20Version\x20Requirement:\x0a•\x20dataset_[code]\x20pattern\x20and\x20alias\x20mode\x20require\x20@lovrabet/sdk\x20>=\x201.2.0\x0a•\x20For\x20SDK\x20<\x201.2.0,\x20only\x20client.models.[key]\x20pattern\x20is\x20supported\x20(key\x20defined\x20in\x20createClient/registerModels)\x0a•\x20FIRST\x20check\x20user\x27s\x20package.json\x20for\x20@lovrabet/sdk\x20version\x20before\x20generating\x20code\x0a\x0aCRITICAL\x20-\x20Model\x20Access\x20Patterns:\x0a•\x20SDK\x20>=\x201.2.0:\x20Use\x20dataset_[code]\x20pattern\x20by\x20default\x20(stable,\x20no\x20config\x20needed)\x0a•\x20SDK\x20<\x201.2.0:\x20Must\x20use\x20the\x20key\x20configured\x20in\x20createClient/registerModels\x0a•\x20If\x20user\x20wants\x20alias\x20mode\x20(SDK\x20>=\x201.2.0),\x20MUST\x20first\x20search\x20for\x20createClient()\x20or\x20registerModels()\x20in\x20user\x27s\x20codebase\x0a•\x20DO\x20NOT\x20assume\x20the\x20alias\x20is\x20the\x20default\x20camelCase\x20table\x20name\x20-\x20user\x20may\x20have\x20customized\x20it\x0a\x0aCRITICAL\x20-\x20Data\x20Query\x20Best\x20Practices:\x0a•\x20ALWAYS\x20use\x20filter\x20operation\x20for\x20querying\x20data\x20(most\x20flexible,\x20supports\x20complex\x20conditions)\x0a•\x20ONLY\x20use\x20getOne\x20when\x20you\x20have\x20a\x20specific\x20primary\x20key\x20ID\x0a•\x20filter\x20supports:\x20complex\x20where\x20conditions,\x20pagination,\x20sorting,\x20field\x20selection\x0a•\x20getOne\x20is\x20for:\x20single\x20record\x20retrieval\x20by\x20ID\x20only\x0a\x0aIMPORTANT\x20-\x20SDK\x20Return\x20Value\x20Behavior:\x0a•\x20On\x20Success:\x20Returns\x20ONLY\x20the\x20\x27data\x27\x20field\x20from\x20the\x20API\x20response\x20(not\x20the\x20full\x20JSON)\x0a\x20\x20Example:\x20create()\x20returns\x20{\x20id:\x20123,\x20name:\x20\x22...\x22\x20}\x20directly\x0a•\x20On\x20Error:\x20Throws\x20a\x20LovrabetError\x20exception\x20containing\x20the\x20full\x20response\x20JSON\x0a\x20\x20Error\x20has\x20properties:\x20message,\x20status\x20(HTTP\x20code),\x20code\x20(business\x20error\x20code),\x20data\x20(full\x20error\x20response)\x0a\x0aAlways\x20use\x20try-catch\x20when\x20calling\x20SDK\x20methods\x20like\x20create(),\x20update(),\x20filter(),\x20etc.','\x20\x20-\x20list_datasets:\x20Get\x20list\x20of\x20all\x20datasets','\x20\x20-\x20get_bff_script_info:\x20Get\x20detailed\x20Backend\x20Function\x20information','Save\x20or\x20Update\x20Custom\x20SQL','\x20\x20-\x20search_datasets:\x20Search\x20datasets\x20by\x20keyword','Include\x20table\x20relations\x20(default:\x20true).','🚀\x20Lovrabet\x20Dataset\x20MCP\x20Server\x20(Development\x20API)','search_datasets','SQL\x20SELECT\x20statement\x20content\x20(supports\x20MyBatis\x20syntax)','Save\x20or\x20Update\x20Backend\x20Function','List\x20all\x20Backend\x20Function\x20(ENDPOINT\x20type)\x20scripts\x20for\x20an\x20application.\x0a\x0aReturns\x20a\x20list\x20of\x20all\x20backend\x20functions\x20with\x20their\x20metadata\x20(id,\x20name,\x20description,\x20scriptType,\x20etc.).\x0a\x0aThis\x20is\x20the\x20PRIMARY\x20tool\x20for\x20understanding:\x0a1.\x20What\x20backend\x20functions\x20exist\x20in\x20the\x20application\x0a2.\x20Their\x20IDs\x20for\x20use\x20with\x20get_bff_script_info\x20and\x20save_or_update_bff_script\x0a3.\x20Descriptions\x20and\x20metadata\x0a\x0aUse\x20this\x20tool\x20to:\x0a•\x20Get\x20a\x20complete\x20list\x20of\x20all\x20backend\x20functions\x0a•\x20Find\x20the\x20ID\x20of\x20a\x20specific\x20backend\x20function\x20for\x20updates\x0a•\x20Check\x20existing\x20functions\x20before\x20creating\x20new\x20ones','Dataset\x20code/ID','registerGetDatasetDetailTool','union','Get\x20Dataset\x20Detail','boolean','List\x20SQL\x20Queries','registerGetBffScriptInfoTool','Optional:\x20example\x20parameter\x20values','\x20\x20-\x20validate_sql_content:\x20Validate\x20SQL\x20content\x20without\x20saving\x20(checks\x20syntax,\x20structure,\x20parameters)','508894vLUgHr','version','get_operation_detail','registerGenerateSDKCodeTool','registerSearchDatasetsTool','Generate\x20SQL\x20Code','list_sql_queries','Save\x20a\x20new\x20Backend\x20Function\x20script\x20or\x20update\x20an\x20existing\x20one.\x0a\x0aCREATE\x20NEW\x20FUNCTION:\x20Provide\x20description,\x20scriptContent\x20(omit\x20id)\x0aUPDATE\x20EXISTING\x20FUNCTION:\x20Provide\x20id,\x20description,\x20scriptContent\x0a\x0aBACKEND\x20FUNCTION\x20FORMAT:\x0aThe\x20scriptContent\x20should\x20be\x20a\x20valid\x20JavaScript/TypeScript\x20module\x20with\x20a\x20default\x20export:\x0a\x0a```javascript\x0a/**\x0a\x20*\x20标准入口函数\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20业务数据对象(如请求参数、查询结果),可原地修改。\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20执行上下文,包含用户信息、应用信息和数据库操作能力。\x0a\x20*\x20@returns\x20{Promise<Object>}\x20-\x20返回修改后的\x20params\x20对象(对于\x20HOOK\x20脚本)或业务结果(对于\x20ENDPOINT\x20脚本)。\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20useYourBackendfunctionName(params,\x20context)\x20{\x0a\x20\x20//\x20业务逻辑...\x0a\x20\x20return\x20params;\x0a}\x0a```\x0a\x0aTYPICAL\x20WORKFLOW:\x0a1.\x20list_bff_scripts\x20-\x20Check\x20existing\x20functions\x0a2.\x20get_bff_script_info(id)\x20-\x20View\x20function\x20details\x20(for\x20updates)\x0a3.\x20save_or_update_bff_script\x20-\x20Create\x20or\x20update\x20the\x20function\x0a\x0aNOTES:\x0a•\x20scriptType\x20is\x20automatically\x20set\x20to\x20\x22ENDPOINT\x22\x0a•\x20For\x20new\x20functions,\x20omit\x20the\x20id\x20parameter\x0a•\x20For\x20updates,\x20provide\x20the\x20id\x20from\x20list_bff_scripts','save_or_update_bff_script','Get\x20list\x20of\x20all\x20API\x20operations\x20available\x20for\x20a\x20dataset.\x0a\x0aCRITICAL\x20-\x20Data\x20Query\x20Best\x20Practices:\x0a•\x20ALWAYS\x20use\x20filter\x20operation\x20for\x20querying\x20data\x20(most\x20flexible,\x20supports\x20complex\x20conditions)\x0a•\x20ONLY\x20use\x20getOne\x20when\x20you\x20have\x20a\x20specific\x20primary\x20key\x20ID\x0a•\x20AVOID\x20using\x20getList\x20unless\x20the\x20requirement\x20explicitly\x20needs\x20simple\x20listing\x20without\x20conditions\x0a•\x20filter\x20supports:\x20complex\x20where\x20conditions,\x20pagination,\x20sorting,\x20field\x20selection\x0a•\x20getOne\x20is\x20for:\x20single\x20record\x20retrieval\x20by\x20ID\x20only\x0a•\x20getList\x20is\x20for:\x20simple\x20unfiltered\x20listing\x20(rarely\x20needed\x20in\x20practice)','List\x20all\x20available\x20SQL\x20queries\x20with\x20complete,\x20ready-to-use\x20code\x20examples.\x0a\x0aThis\x20is\x20the\x20ONLY\x20tool\x20needed\x20for\x20SQL\x20queries.\x20It\x20provides\x20EVERYTHING:\x0a•\x20Complete\x20list\x20of\x20available\x20SQL\x20queries\x20for\x20the\x20application\x0a•\x20Each\x20SQL\x20includes\x20full\x20executable\x20TypeScript\x20code\x20in\x20codeExample\x20field\x0a•\x20Parameters\x20with\x20example\x20values\x0a•\x20Important\x20usage\x20notes\x20and\x20error\x20handling\x20patterns\x0a\x0aIMPORTANT:\x20The\x20execution\x20pattern\x20is\x20ALWAYS\x20the\x20same\x20for\x20ALL\x20SQLs:\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(sqlCode,\x20params);\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(data.execError\x20||\x20\x27SQL\x20execution\x20failed\x27);\x0a}\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0a\x0aKey\x20points\x20emphasized\x20in\x20each\x20SQL\x27s\x20code\x20example:\x0a•\x20SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[],\x20execError?:\x20string\x20}\x0a•\x20Always\x20check\x20execSuccess\x20before\x20using\x20execResult\x0a•\x20Use\x20try-catch\x20for\x20HTTP\x20errors\x20(network,\x20auth)\x0a•\x20Business\x20errors\x20are\x20in\x20data.execError\x20(not\x20thrown)\x0a\x0aYou\x20do\x20NOT\x20need\x20to\x20execute\x20SQLs\x20-\x20just\x20show\x20users\x20the\x20provided\x20code\x20examples.','Login','../package.json','options','Get\x20list\x20of\x20all\x20datasets\x20for\x20an\x20application.\x0a\x0aENHANCED:\x20Now\x20includes\x20table\x20relations\x20from\x20ER\x20Config\x20by\x20default!\x0a\x0aRETURNED\x20INFORMATION:\x0a•\x20List\x20of\x20all\x20datasets\x20with\x20metadata\x20(id,\x20name,\x20code,\x20tableName,\x20description)\x0a•\x20Database\x20information\x20for\x20each\x20dataset\x0a•\x20Table\x20relations\x20(foreign\x20key\x20relationships)\x20-\x20included\x20by\x20default\x0a•\x20Relations\x20graph\x20for\x20visualizing\x20connections\x20between\x20datasets\x0a\x0aRELATION\x20INFORMATION:\x0aEach\x20dataset\x20includes:\x0a•\x20outgoing:\x20Relations\x20where\x20this\x20dataset\x27s\x20fields\x20point\x20to\x20other\x20datasets\x0a•\x20incoming:\x20Relations\x20where\x20other\x20datasets\x27\x20fields\x20point\x20to\x20this\x20dataset\x0a•\x20totalCount:\x20Total\x20number\x20of\x20relations\x0a\x0aRELATIONS\x20GRAPH:\x0a•\x20nodes:\x20All\x20datasets\x20with\x20their\x20names\x20and\x20table\x20names\x0a•\x20edges:\x20Relations\x20between\x20datasets\x20with\x20field\x20mapping\x0a\x0aThis\x20is\x20the\x20PRIMARY\x20tool\x20for\x20understanding:\x0a1.\x20What\x20datasets\x20exist\x20in\x20the\x20application\x0a2.\x20How\x20datasets\x20are\x20related\x20to\x20each\x20other\x0a3.\x20Which\x20fields\x20can\x20be\x20used\x20for\x20JOIN\x20operations\x0a4.\x20The\x20overall\x20data\x20model\x20structure\x0a\x0aUse\x20includeRelations:\x20false\x20to\x20skip\x20relation\x20fetching\x20(faster,\x20if\x20you\x20only\x20need\x20the\x20dataset\x20list).','Get\x20Backend\x20Function\x20Info','Database\x20ID\x20from\x20get_dataset_detail\x20->\x20basic.database.dbId','Function\x20description','array','\x20\x20-\x20login:\x20Login\x20to\x20Lovrabet\x20to\x20authenticate','Get\x20detailed\x20information\x20about\x20a\x20specific\x20Backend\x20Function\x20script.\x0a\x0aReturns\x20the\x20complete\x20script\x20content\x20and\x20metadata\x20including:\x0a•\x20id:\x20Script\x20ID\x0a•\x20appCode:\x20Application\x20code\x0a•\x20description:\x20Function\x20description\x0a•\x20scriptContent:\x20Full\x20JavaScript/TypeScript\x20code\x0a•\x20scriptType:\x20Script\x20type\x20(ENDPOINT,\x20HOOK,\x20etc.)\x0a\x0aUse\x20this\x20tool\x20to:\x0a•\x20View\x20the\x20complete\x20source\x20code\x20of\x20a\x20backend\x20function\x0a•\x20Get\x20function\x20details\x20before\x20updating\x0a•\x20Understand\x20the\x20function\x27s\x20implementation\x0a\x0aTypical\x20Workflow:\x0a1.\x20list_bff_scripts\x20-\x20Find\x20the\x20function\x20by\x20name/description\x0a2.\x20get_bff_script_info(id)\x20-\x20Get\x20the\x20full\x20details\x0a3.\x20save_or_update_bff_script\x20-\x20Update\x20the\x20function\x20if\x20needed','51960xmDVXj','SQL\x20name/label\x20for\x20identification','Include\x20import\x20statements\x20(default:\x20true)','registerGetOperationDetailTool','registerGetOperationsTool','Search\x20datasets\x20by\x20keyword\x20(searches\x20in\x20name,\x20table\x20name,\x20code,\x20and\x20description)','stringify','1363090PvuDFf','\x20\x20-\x20save_or_update_bff_script:\x20Save\x20or\x20update\x20a\x20Backend\x20Function\x20script','registerListBffScriptsTool','Application\x20code\x20(optional\x20if\x20LOVRABET_APP_CODE\x20env\x20var\x20is\x20set)','save_or_update_custom_sql','MCP_DEBUG','Use\x20camelCase\x20alias\x20instead\x20of\x20dataset_[code]\x20pattern\x20(default:\x20false).\x20Only\x20set\x20to\x20true\x20if\x20user\x20explicitly\x20requests\x20human-friendly\x20alias\x20mode.','Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update).\x20Prefer\x20\x22filter\x22\x20for\x20queries.','optional','\x20\x20-\x20get_dataset_operations:\x20Get\x20list\x20of\x20operations\x20for\x20a\x20dataset','min','describe','registerValidateSqlContentTool','registerTool','Get\x20Operations','registerLoginTool','get_dataset_operations','Include\x20import\x20statements\x20and\x20full\x20example\x20(default:\x20true)','mcpServer','\x20\x20-\x20generate_sql_code:\x20Generate\x20SDK\x20code\x20for\x20custom\x20SQL\x20(validates\x20sqlCode)','logInfo','\x20\x20-\x20list_sql_queries:\x20List\x20all\x20available\x20SQL\x20queries','enum','Get\x20Operation\x20Detail','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode\x20and\x20return\x20the\x20results.\x0a\x0aUse\x20this\x20tool\x20to:\x0a•\x20Test\x20a\x20newly\x20saved\x20SQL\x20to\x20see\x20if\x20it\x20works\x20correctly\x0a•\x20Debug\x20SQL\x20issues\x20by\x20seeing\x20actual\x20error\x20messages\x0a•\x20Get\x20sample\x20data\x20from\x20a\x20saved\x20SQL\x20query\x0a\x0aERROR\x20HANDLING\x20-\x20When\x20SQL\x20Fails:\x0aThe\x20tool\x20returns\x20fixSuggestions\x20with\x20actionable\x20advice:\x0a•\x20COLUMN_NOT_FOUND:\x20Column\x20doesn\x27t\x20exist\x20→\x20check\x20spelling,\x20use\x20get_dataset_detail\x0a•\x20TABLE_NOT_FOUND:\x20Table\x20doesn\x27t\x20exist\x20→\x20use\x20list_datasets\x20to\x20find\x20correct\x20table\x0a•\x20SYNTAX_ERROR:\x20SQL\x20syntax\x20issue\x20→\x20check\x20keywords,\x20brackets,\x20quotes\x0a•\x20AMBIGUOUS_COLUMN:\x20Column\x20in\x20multiple\x20tables\x20→\x20add\x20table\x20prefix\x0a•\x20GROUP_BY_ERROR:\x20GROUP\x20BY\x20issue\x20→\x20add\x20columns\x20to\x20GROUP\x20BY\x20or\x20use\x20aggregate\x20functions\x0a\x0aResponse\x20Fields:\x0a•\x20execSuccess:\x20false\x20if\x20SQL\x20failed\x0a•\x20execError:\x20The\x20error\x20message\x0a•\x20errorCode:\x20API\x20error\x20code\x20(e.g.,\x20\x22500\x22)\x0a•\x20fixSuggestions:\x20Array\x20of\x20fix\x20suggestions\x20with\x20manualSteps\x0a\x0aTypical\x20Workflow\x20for\x20Creating\x20SQL:\x0a1.\x20save_or_update_custom_sql\x20-\x20Save\x20the\x20SQL\x0a2.\x20list_sql_queries(sqlName:\x20\x22xxx\x22)\x20-\x20Find\x20the\x20saved\x20SQL\x20to\x20get\x20its\x20sqlCode\x0a3.\x20execute_custom_sql(sqlCode:\x20\x22xxx\x22)\x20-\x20Test\x20execution\x0a4.\x20If\x20error\x20with\x20fixSuggestions\x20→\x20save_or_update_custom_sql(id,\x20sqlCode,\x20...)\x20-\x20Fix\x20it\x0a\x0aTypical\x20Workflow\x20for\x20Updating\x20SQL:\x0a1.\x20list_sql_queries(sqlName:\x20\x22xxx\x22)\x20-\x20Find\x20existing\x20SQL,\x20get\x20id\x20and\x20sqlCode\x0a2.\x20execute_custom_sql(sqlCode:\x20\x22xxx\x22)\x20-\x20Test\x20current\x20version\x0a3.\x20If\x20error\x20→\x20follow\x20fixSuggestions\x20→\x20save_or_update_custom_sql(id,\x20sqlCode,\x20...)','Validate\x20SQL\x20Content','929688YoSNls','Search\x20Datasets','Optional:\x20server-side\x20fuzzy\x20match\x20by\x20sqlName\x20(e.g.,\x20\x22用户\x22)','registerExecuteCustomSqlTool','get_dataset_detail','Authentication\x20cookie\x20(optional,\x20uses\x20stored\x20cookie\x20from\x20login\x20if\x20not\x20provided)','Optional:\x20SQL\x20parameters','63SLPdbp','registerListDatasetsTool','log','\x20\x20-\x20get_dataset_detail:\x20Get\x20detailed\x20dataset\x20information','lovrabet-dataset-mcp','record','registerAllTools','Unknown\x20error\x20occurred','close','bffAutosave','1NxNCIl','Dataset\x20ID\x20(numeric)\x20or\x20code\x20(UUID).\x20Both\x20have\x20equal\x20performance.','generate_sql_code','SQL\x20code\x20from\x20list_sql_queries\x20->\x20sqlCode','Number\x20of\x20items\x20per\x20page\x20(default:\x20999)','Optional:\x20client-side\x20filter\x20by\x20category\x20(report,\x20analysis,\x20export,\x20etc.)','env','✅\x20Server\x20started\x20successfully\x20(using\x20McpServer\x20API)','🔐\x20Authentication:','List\x20Backend\x20Functions','string','Include\x20table\x20relations\x20from\x20ER\x20Config\x20(default:\x20true).\x20Set\x20to\x20false\x20for\x20faster\x20response\x20if\x20you\x20only\x20need\x20the\x20dataset\x20list.','Environment\x20to\x20login\x20to\x20(optional,\x20uses\x20LOVRABET_ENV\x20env\x20var\x20or\x20defaults\x20to\x20online)','validate_sql_content','104132xgLQUp','registerSaveOrUpdateCustomSqlTool','server','registerListSqlQueriesTool','login','SQL\x20content\x20to\x20validate','daily','Optional:\x20client-side\x20filter\x20by\x20name,\x20description,\x20or\x20SQL\x20content','Validate\x20SQL\x20content\x20WITHOUT\x20saving\x20it.\x20Detects\x20SQL\x20type\x20and\x20validates\x20table/column\x20existence.\x0a\x0aMYBATIS\x20SYNTAX\x20SUPPORTED:\x0a•\x20Parameters:\x20#{param}\x20or\x20#{param,\x20jdbcType=TYPE}\x0a•\x20Dynamic\x20SQL\x20tags:\x20<if\x20test=\x22\x22>,\x20<where>,\x20<choose>/<when>/<otherwise>\x0a•\x20Loop\x20tags:\x20<foreach\x20collection=\x22\x22\x20item=\x22\x22>\x0a•\x20NOTE:\x20In\x20SQL\x20content\x20use\x20<\x20>\x20&\x20for\x20<\x20>\x20&\x20characters\x20(but\x20NOT\x20inside\x20<if\x20test=\x22\x22>\x20attributes)\x0a\x0aDUAL\x20VERIFICATION\x20MECHANISM\x20(双重保险):\x0a•\x20工程检测:sqlType\x20字段提供正则匹配结果(支持\x20SELECT\x20和\x20CTE/WITH)\x0a•\x20LLM\x20确认:请分析\x20sqlContent\x20原始内容,交叉验证\x20sqlType\x20是否正确\x0a•\x20如果工程检测和\x20LLM\x20分析不一致,请告知用户并采取保守策略\x0a\x0aBEST\x20PRACTICE\x20-\x20SQL\x20Validation\x20Workflow:\x0a1.\x20Use\x20this\x20tool\x20FIRST\x20to\x20validate\x20your\x20SQL\x20before\x20saving\x0a2.\x20Check\x20sqlType.isSelectOnly:\x20true\x20=\x20SELECT\x20(safe),\x20false\x20=\x20needs\x20manual\x20confirmation\x0a3.\x20Cross-check:\x20Read\x20sqlContent\x20yourself\x20to\x20verify\x20the\x20detected\x20type\x0a4.\x20For\x20CTE:\x20WITH\x20...\x20SELECT\x20...\x20is\x20also\x20a\x20SELECT\x20query\x0a\x0aWHEN\x20TO\x20USE:\x0a•\x20Before\x20saving\x20a\x20new\x20SQL\x20(save_or_update_custom_sql)\x0a•\x20To\x20debug\x20SQL\x20syntax\x20issues\x0a•\x20To\x20check\x20what\x20parameters\x20your\x20SQL\x20needs\x0a•\x20To\x20validate\x20table/column\x20names\x20exist\x0a\x0aRESPONSE\x20INCLUDES:\x0a•\x20sqlContent:\x20string\x20-\x20original\x20SQL\x20(YOU\x20should\x20also\x20analyze\x20this)\x0a•\x20sqlType:\x20{\x20type,\x20isSelectOnly,\x20isDangerous\x20}\x20-\x20engineering\x20detection\x20result\x0a•\x20parsedStructure:\x20tables,\x20columns,\x20parameters\x0a•\x20schemaValidation:\x20{\x20valid,\x20errors\x20}\x20-\x20table/column\x20existence\x0a•\x20nextSteps:\x20suggested\x20actions\x20based\x20on\x20validation\x20result\x0a\x0aSAFETY\x20RULES:\x0a•\x20Only\x20call\x20save_or_update_custom_sql\x20for\x20SELECT\x20queries\x20(sqlType.isSelectOnly\x20===\x20true)\x0a•\x20For\x20INSERT/UPDATE/DELETE/DDL:\x20advise\x20user\x20to\x20save\x20manually\x20(save_or_update_custom_sql\x20will\x20block\x20them)\x0a\x0aEXAMPLES:\x0a--\x20Simple\x20parameter\x0aSELECT\x20*\x20FROM\x20users\x20WHERE\x20status\x20=\x20#{status,\x20jdbcType=TINYINT}\x0a\x0a--\x20CTE\x20(WITH\x20is\x20also\x20SELECT)\x0aWITH\x20cte\x20AS\x20(SELECT\x20*\x20FROM\x20orders)\x20SELECT\x20*\x20FROM\x20cte\x0a\x0a--\x20MyBatis\x20dynamic\x20SQL\x20(use\x20<\x20>\x20for\x20<\x20>\x20in\x20SQL\x20content)\x0aSELECT\x20*\x20FROM\x20employee\x0a<where>\x0a\x20\x20\x20\x20<if\x20test=\x22storeId\x20!=\x20null\x22>\x0a\x20\x20\x20\x20AND\x20store_id\x20=\x20#{storeId,\x20jdbcType=INTEGER}\x0a\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20<if\x20test=\x22employeeName\x20!=\x20null\x20and\x20employeeName\x20!=\x20\x27\x27\x22>\x0a\x20\x20\x20\x20AND\x20employee_name\x20LIKE\x20CONCAT(\x27%\x27,\x20#{employeeName,\x20jdbcType=VARCHAR},\x20\x27%\x27)\x0a\x20\x20\x20\x20</if>\x0a</where>\x0aORDER\x20BY\x20gmt_create\x20DESC','generate_sdk_code','number','online','\x20\x20-\x20generate_sdk_code:\x20Generate\x20SDK\x20code\x20for\x20dataset\x20operations','registerSaveOrUpdateBffScriptTool','1278905rKlNSJ','Get\x20detailed\x20information\x20about\x20a\x20specific\x20dataset.\x0a\x0aRETURNED\x20INFORMATION:\x0a•\x20data:\x20Original\x20API\x20response\x20(V1\x20or\x20V2\x20format)\x20-\x20complete\x20with\x20all\x20fields\x0a•\x20_stats:\x20Simple\x20statistics\x20(fieldCount,\x20operationCount,\x20etc.)\x0a•\x20_relations:\x20Table\x20relations\x20from\x20ER\x20Config\x20(foreign\x20key\x20relationships)\x0a•\x20_sqlHints:\x20SQL\x20query\x20assistance\x20(primaryKeys,\x20joinableFields,\x20enumFields,\x20etc.)\x0a•\x20nextSteps:\x20Suggested\x20follow-up\x20actions\x0a\x0aDATA\x20FORMAT:\x0a•\x20V1:\x20fields\x20in\x20\x22properties\x22\x20array,\x20display\x20name\x20in\x20\x22name\x22\x20property\x0a•\x20V2:\x20fields\x20in\x20\x22fields\x22\x20array,\x20display\x20name\x20in\x20\x22displayName\x22\x20property\x0a•\x20Use\x20dsparser\x20methods\x20for\x20consistent\x20field\x20access\x20across\x20versions\x0a\x0aRELATIONSHIPS\x20(from\x20ER\x20Config):\x0a•\x20_relations.outgoing:\x20This\x20dataset\x20references\x20other\x20datasets\x0a•\x20_relations.incoming:\x20Other\x20datasets\x20reference\x20this\x20dataset\x0a•\x20Use\x20these\x20for\x20JOIN\x20queries\x0a\x0aPARAMETER\x20USAGE:\x0a•\x20Supports\x20BOTH\x20dataset\x20ID\x20(numeric)\x20and\x20code\x20(UUID)\x0a•\x20Both\x20have\x20equal\x20performance\x20(single\x20API\x20call)','get_bff_script_info'];a8_0x3a65=function(){return _0x572bb5;};return a8_0x3a65();}function a8_0x34a9(_0x1e53d3,_0x339d6e){_0x1e53d3=_0x1e53d3-0x8c;const _0x3a650c=a8_0x3a65();let _0x34a968=_0x3a650c[_0x1e53d3];return _0x34a968;}export class LovrabetDatasetMCPServer{[a8_0x5ffa61(0xfa)];[a8_0x5ffa61(0xd9)];constructor(_0x9c4228={}){const _0x570deb=a8_0x5ffa61;this[_0x570deb(0xd9)]=_0x9c4228,this[_0x570deb(0xfa)]=new McpServer({'name':_0x570deb(0x10d),'version':packageJson[_0x570deb(0xcd)]},{'capabilities':{'tools':{}}}),this[_0x570deb(0x10f)]();}[a8_0x5ffa61(0x10f)](){const _0x4774a9=a8_0x5ffa61;this[_0x4774a9(0xf7)](),this[_0x4774a9(0x10a)](),this[_0x4774a9(0xc4)](),this[_0x4774a9(0xe5)](),this[_0x4774a9(0xe4)](),this[_0x4774a9(0xcf)](),this[_0x4774a9(0xd0)](),this[_0x4774a9(0x9f)](),this[_0x4774a9(0x9d)](),this[_0x4774a9(0x105)](),this['registerGenerateSqlCodeTool'](),this[_0x4774a9(0xf4)](),this[_0x4774a9(0xd9)]['bffAutosave']&&(this[_0x4774a9(0xea)](),this[_0x4774a9(0xc9)](),this[_0x4774a9(0xa9)]());}[a8_0x5ffa61(0xf7)](){const _0x5bface=a8_0x5ffa61;registerToolWithOptions(this['mcpServer'],_0x5bface(0xa0),{'title':_0x5bface(0xd7),'description':'Login\x20to\x20Lovrabet\x20to\x20authenticate\x20for\x20dataset\x20queries','inputSchema':{'env':z[_0x5bface(0xfe)]([_0x5bface(0xa7),_0x5bface(0xa2)])[_0x5bface(0xf0)]()[_0x5bface(0xf3)](_0x5bface(0x9a))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':!![]}},async _0x3a2427=>{const _0xe5a75f=_0x5bface;try{const _0x46e279=await login(_0x3a2427||{});return{'content':[{'type':_0xe5a75f(0xb5),'text':JSON[_0xe5a75f(0xe7)](_0x46e279,null,0x2)}]};}catch(_0x4e5c6a){return{'content':[{'type':'text','text':JSON[_0xe5a75f(0xe7)]({'error':!![],'message':_0x4e5c6a[_0xe5a75f(0xb0)]||'Unknown\x20error\x20occurred'},null,0x2)}],'isError':!![]};}});}[a8_0x5ffa61(0x10a)](){const _0x63611c=a8_0x5ffa61;registerToolWithOptions(this['mcpServer'],'list_datasets',{'title':'List\x20Datasets','description':_0x63611c(0xda),'inputSchema':{...authSchema,'pageSize':z[_0x63611c(0xa6)]()['optional']()[_0x63611c(0xf3)]('Number\x20of\x20datasets\x20per\x20page\x20(default:\x20999)'),'currentPage':z[_0x63611c(0xa6)]()['optional']()[_0x63611c(0xf3)]('Page\x20number\x20to\x20fetch\x20(default:\x201)'),'forceRefresh':z[_0x63611c(0xc7)]()[_0x63611c(0xf0)]()['describe'](_0x63611c(0xad)),'includeRelations':z[_0x63611c(0xc7)]()[_0x63611c(0xf0)]()[_0x63611c(0xf3)](_0x63611c(0x99))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},async _0x1cf906=>{const _0x1b6136=_0x63611c;try{const _0x83ec81=await listDatasets(_0x1cf906);return{'content':[{'type':_0x1b6136(0xb5),'text':JSON[_0x1b6136(0xe7)](_0x83ec81,null,0x2)}]};}catch(_0x40be28){return{'content':[{'type':_0x1b6136(0xb5),'text':JSON['stringify']({'error':!![],'message':_0x40be28[_0x1b6136(0xb0)]||_0x1b6136(0x110)},null,0x2)}],'isError':!![]};}});}['registerGetDatasetDetailTool'](){const _0x5e8731=a8_0x5ffa61;registerToolWithOptions(this[_0x5e8731(0xfa)],_0x5e8731(0x106),{'title':_0x5e8731(0xc6),'description':_0x5e8731(0xab),'inputSchema':{...authSchema,'datasetCode':z[_0x5e8731(0x98)]()[_0x5e8731(0xf3)]('Dataset\x20ID\x20(numeric)\x20or\x20code\x20(UUID).'),'forceRefresh':z[_0x5e8731(0xc7)]()['optional']()['describe']('Bypass\x20cache\x20and\x20fetch\x20fresh\x20data\x20(default:\x20false).'),'includeRelations':z['boolean']()[_0x5e8731(0xf0)]()[_0x5e8731(0xf3)](_0x5e8731(0xbd))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},async _0x407fac=>{const _0x52d8f1=_0x5e8731;try{const _0x1c0039=await getDatasetDetail(_0x407fac);return{'content':[{'type':'text','text':JSON['stringify'](_0x1c0039,null,0x2)}]};}catch(_0x54f615){return{'content':[{'type':_0x52d8f1(0xb5),'text':JSON[_0x52d8f1(0xe7)]({'error':!![],'message':_0x54f615[_0x52d8f1(0xb0)]||_0x52d8f1(0x110)},null,0x2)}],'isError':!![]};}});}[a8_0x5ffa61(0xe5)](){const _0x4c7976=a8_0x5ffa61;registerToolWithOptions(this[_0x4c7976(0xfa)],_0x4c7976(0xf8),{'title':_0x4c7976(0xf6),'description':_0x4c7976(0xd5),'inputSchema':{...authSchema,'datasetCode':z[_0x4c7976(0x98)]()[_0x4c7976(0xf3)](_0x4c7976(0x8f))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},async _0x1e7900=>{const _0x53b1ee=_0x4c7976;try{const _0xfe783b=await getDatasetOperations(_0x1e7900);return{'content':[{'type':_0x53b1ee(0xb5),'text':JSON[_0x53b1ee(0xe7)](_0xfe783b,null,0x2)}]};}catch(_0x55d784){return{'content':[{'type':_0x53b1ee(0xb5),'text':JSON[_0x53b1ee(0xe7)]({'error':!![],'message':_0x55d784[_0x53b1ee(0xb0)]||'Unknown\x20error\x20occurred'},null,0x2)}],'isError':!![]};}});}[a8_0x5ffa61(0xe4)](){const _0x4e4acf=a8_0x5ffa61;registerToolWithOptions(this[_0x4e4acf(0xfa)],_0x4e4acf(0xce),{'title':_0x4e4acf(0xff),'description':'Get\x20detailed\x20information\x20about\x20a\x20specific\x20operation\x20including\x20request/response\x20examples.\x0a\x0aCRITICAL\x20-\x20Data\x20Query\x20Best\x20Practices:\x0a•\x20ALWAYS\x20use\x20filter\x20operation\x20for\x20querying\x20data\x20(most\x20flexible,\x20supports\x20complex\x20conditions)\x0a•\x20ONLY\x20use\x20getOne\x20when\x20you\x20have\x20a\x20specific\x20primary\x20key\x20ID\x0a•\x20AVOID\x20using\x20getList\x20unless\x20the\x20requirement\x20explicitly\x20needs\x20simple\x20listing\x20without\x20conditions\x0a•\x20filter\x20supports:\x20complex\x20where\x20conditions,\x20pagination,\x20sorting,\x20field\x20selection\x0a•\x20getOne\x20is\x20for:\x20single\x20record\x20retrieval\x20by\x20ID\x20only\x0a•\x20getList\x20is\x20for:\x20simple\x20unfiltered\x20listing\x20(rarely\x20needed\x20in\x20practice)\x0a\x0aNote:\x20SDK\x20methods\x20(create,\x20update,\x20getList,\x20filter,\x20etc.)\x20return\x20ONLY\x20the\x20\x27data\x27\x20field\x20on\x20success,\x20and\x20throw\x20LovrabetError\x20on\x20failure.\x20Always\x20use\x20try-catch.','inputSchema':{...authSchema,'datasetCode':z['string']()[_0x4e4acf(0xf3)]('Dataset\x20code/ID'),'operationName':z[_0x4e4acf(0x98)]()['describe'](_0x4e4acf(0xef))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},async _0x5eee27=>{const _0x7ad61c=_0x4e4acf;try{const _0xa24522=await getOperationDetail(_0x5eee27);return{'content':[{'type':_0x7ad61c(0xb5),'text':JSON[_0x7ad61c(0xe7)](_0xa24522,null,0x2)}]};}catch(_0x4fa75a){return{'content':[{'type':_0x7ad61c(0xb5),'text':JSON[_0x7ad61c(0xe7)]({'error':!![],'message':_0x4fa75a[_0x7ad61c(0xb0)]||'Unknown\x20error\x20occurred'},null,0x2)}],'isError':!![]};}});}['registerGenerateSDKCodeTool'](){const _0x1f8cd3=a8_0x5ffa61;registerToolWithOptions(this['mcpServer'],_0x1f8cd3(0xa5),{'title':_0x1f8cd3(0xae),'description':_0x1f8cd3(0xb8),'inputSchema':{...authSchema,'datasetCode':z[_0x1f8cd3(0x98)]()[_0x1f8cd3(0xf3)](_0x1f8cd3(0xc3)),'operationName':z[_0x1f8cd3(0x98)]()[_0x1f8cd3(0xf3)](_0x1f8cd3(0xef)),'includeImports':z[_0x1f8cd3(0xc7)]()[_0x1f8cd3(0xf0)]()['describe'](_0x1f8cd3(0xf9)),'useAlias':z[_0x1f8cd3(0xc7)]()[_0x1f8cd3(0xf0)]()[_0x1f8cd3(0xf3)](_0x1f8cd3(0xee))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},async _0x399234=>{const _0x5ee1ae=_0x1f8cd3;try{const _0x5df2d8=await generateSDKCode(_0x399234);return{'content':[{'type':_0x5ee1ae(0xb5),'text':JSON[_0x5ee1ae(0xe7)](_0x5df2d8,null,0x2)}]};}catch(_0x4a41b7){return{'content':[{'type':_0x5ee1ae(0xb5),'text':JSON[_0x5ee1ae(0xe7)]({'error':!![],'message':_0x4a41b7[_0x5ee1ae(0xb0)]||_0x5ee1ae(0x110)},null,0x2)}],'isError':!![]};}});}[a8_0x5ffa61(0xd0)](){const _0x3c816c=a8_0x5ffa61;registerToolWithOptions(this['mcpServer'],_0x3c816c(0xbf),{'title':_0x3c816c(0x103),'description':_0x3c816c(0xe6),'inputSchema':{...authSchema,'keyword':z[_0x3c816c(0x98)]()[_0x3c816c(0xf3)]('Search\x20keyword')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},async _0x1c811f=>{const _0x3ba8f0=_0x3c816c;try{const _0x1c059c=await searchDatasets(_0x1c811f);return{'content':[{'type':'text','text':JSON[_0x3ba8f0(0xe7)](_0x1c059c,null,0x2)}]};}catch(_0x3a1472){return{'content':[{'type':_0x3ba8f0(0xb5),'text':JSON['stringify']({'error':!![],'message':_0x3a1472[_0x3ba8f0(0xb0)]||'Unknown\x20error\x20occurred'},null,0x2)}],'isError':!![]};}});}[a8_0x5ffa61(0x9f)](){const _0x2b791b=a8_0x5ffa61;registerToolWithOptions(this[_0x2b791b(0xfa)],_0x2b791b(0xd2),{'title':_0x2b791b(0xc8),'description':_0x2b791b(0xd6),'inputSchema':{...authSchema,'keyword':z[_0x2b791b(0x98)]()[_0x2b791b(0xf0)]()['describe'](_0x2b791b(0xa3)),'category':z[_0x2b791b(0x98)]()['optional']()['describe'](_0x2b791b(0x93)),'sqlCode':z[_0x2b791b(0x98)]()[_0x2b791b(0xf0)]()[_0x2b791b(0xf3)](_0x2b791b(0xb1)),'sqlName':z['string']()[_0x2b791b(0xf0)]()[_0x2b791b(0xf3)](_0x2b791b(0x104)),'pageSize':z['number']()[_0x2b791b(0xf0)]()['describe'](_0x2b791b(0x92)),'currentPage':z[_0x2b791b(0xa6)]()[_0x2b791b(0xf0)]()[_0x2b791b(0xf3)]('Page\x20number\x20to\x20fetch\x20(default:\x201)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},async _0x2a14a1=>{const _0x5d266d=_0x2b791b;try{const _0x5ab6f7=await listSqlQueries(_0x2a14a1);return{'content':[{'type':_0x5d266d(0xb5),'text':JSON[_0x5d266d(0xe7)](_0x5ab6f7,null,0x2)}]};}catch(_0x12b8d2){return{'content':[{'type':_0x5d266d(0xb5),'text':JSON[_0x5d266d(0xe7)]({'error':!![],'message':_0x12b8d2['message']||'Unknown\x20error\x20occurred'},null,0x2)}],'isError':!![]};}});}['registerSaveOrUpdateCustomSqlTool'](){const _0x12d582=a8_0x5ffa61;registerToolWithOptions(this[_0x12d582(0xfa)],_0x12d582(0xec),{'title':_0x12d582(0xbb),'description':'Save\x20a\x20new\x20custom\x20SQL\x20query\x20or\x20update\x20an\x20existing\x20one.\x0a\x0aNOTE\x20-\x20User\x20Intent:\x0a•\x20When\x20user\x20explicitly\x20says\x20\x22save\x22,\x20\x22save\x20this\x20SQL\x22,\x20\x22write\x20to\x20platform\x22,\x20etc.,\x20you\x20may\x20call\x20this\x20tool\x20directly\x0a•\x20For\x20UPDATE\x20operations\x20(overwriting\x20existing\x20SQL),\x20it\x27s\x20recommended\x20to\x20show\x20what\x20will\x20change\x0a•\x20This\x20tool\x20only\x20accepts\x20SELECT\x20queries\x20-\x20non-SELECT\x20queries\x20are\x20automatically\x20blocked\x0a\x0aSQL\x20Validation\x20Rules:\x0a•\x20ONLY\x20SELECT\x20queries\x20are\x20allowed\x20(INSERT,\x20UPDATE,\x20DELETE,\x20DROP,\x20etc.\x20are\x20blocked)\x0a•\x20Supports\x20MyBatis\x20dynamic\x20SQL\x20syntax:\x0a\x20\x20-\x20Parameters:\x20#{param}\x20or\x20#{param,\x20jdbcType=TYPE}\x0a\x20\x20-\x20Conditional\x20tags:\x20<if\x20test=\x22\x22>,\x20<where>,\x20<choose>/<when>/<otherwise>\x0a\x20\x20-\x20Loop\x20tags:\x20<foreach\x20collection=\x22\x22\x20item=\x22\x22>\x0a\x20\x20-\x20NOTE:\x20In\x20SQL\x20content\x20use\x20<\x20>\x20&\x20for\x20<\x20>\x20&\x20characters\x20(but\x20NOT\x20inside\x20<if\x20test=\x22\x22>\x20attributes)\x0a•\x20SQL\x20comments\x20are\x20allowed\x20(--\x20or\x20/*\x20*/)\x0a•\x20Get\x20dbId\x20from\x20get_dataset_detail\x20->\x20basic.database.dbId\x0a\x0aMYBATIS\x20EXAMPLE:\x0a<select\x20id=\x22selectByCondition\x22\x20parameterType=\x22map\x22\x20resultType=\x22map\x22>\x0a\x20\x20\x20\x20SELECT\x20*\x20FROM\x20employee\x0a\x20\x20\x20\x20<where>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<if\x20test=\x22storeId\x20!=\x20null\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20store_id\x20=\x20#{storeId,\x20jdbcType=INTEGER}\x0a\x20\x20\x20\x20\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<if\x20test=\x22employeeName\x20!=\x20null\x20and\x20employeeName\x20!=\x20\x27\x27\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20employee_name\x20LIKE\x20CONCAT(\x27%\x27,\x20#{employeeName,\x20jdbcType=VARCHAR},\x20\x27%\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<if\x20test=\x22startHireDate\x20!=\x20null\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20hire_date\x20>=\x20#{startHireDate,\x20jdbcType=DATE}\x0a\x20\x20\x20\x20\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<if\x20test=\x22endHireDate\x20!=\x20null\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20hire_date\x20<=\x20#{endHireDate,\x20jdbcType=DATE}\x0a\x20\x20\x20\x20\x20\x20\x20\x20</if>\x0a\x20\x20\x20\x20</where>\x0a\x20\x20\x20\x20ORDER\x20BY\x20gmt_create\x20DESC\x0a</select>\x0a\x0aUsage:\x0aCREATE\x20NEW\x20SQL:\x20Provide\x20sqlName,\x20dbId,\x20sqlContent\x20(omit\x20id\x20and\x20sqlCode)\x0aUPDATE\x20EXISTING\x20SQL:\x20Provide\x20id,\x20sqlCode,\x20sqlName,\x20dbId,\x20sqlContent\x0a\x0a1.\x20First\x20call\x20get_dataset_detail\x20to\x20get\x20the\x20database\x20ID\x20(basic.database.dbId)\x0a2.\x20For\x20update:\x20call\x20list_sql_queries\x20to\x20find\x20the\x20SQL\x27s\x20id\x20and\x20sqlCode\x0a3.\x20Call\x20this\x20tool\x20to\x20save/update\x20the\x20SQL\x0a4.\x20After\x20saving,\x20you\x20can\x20execute\x20it\x20via\x20execute_custom_sql','inputSchema':{...authSchema,'sqlName':z[_0x12d582(0x98)]()[_0x12d582(0xf2)](0x1)['describe'](_0x12d582(0xe2)),'dbId':z[_0x12d582(0xa6)]()['describe'](_0x12d582(0xdc)),'sqlContent':z[_0x12d582(0x98)]()['min'](0x1)[_0x12d582(0xf3)](_0x12d582(0xc0)),'id':z[_0x12d582(0xa6)]()[_0x12d582(0xf0)]()['describe']('SQL\x20ID\x20(required\x20for\x20updating\x20existing\x20SQL)'),'sqlCode':z[_0x12d582(0x98)]()['optional']()[_0x12d582(0xf3)]('SQL\x20code\x20(required\x20for\x20updating\x20existing\x20SQL,\x20get\x20from\x20list_sql_queries)')},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':![]}},async _0x57c426=>{const _0x561c0d=_0x12d582;try{const _0x1e6d1b=await saveOrUpdateCustomSql(_0x57c426);return{'content':[{'type':_0x561c0d(0xb5),'text':JSON[_0x561c0d(0xe7)](_0x1e6d1b,null,0x2)}]};}catch(_0x13b366){return{'content':[{'type':_0x561c0d(0xb5),'text':JSON['stringify']({'error':!![],'message':_0x13b366['message']||_0x561c0d(0x110)},null,0x2)}],'isError':!![]};}});}['registerExecuteCustomSqlTool'](){const _0x14d833=a8_0x5ffa61;registerToolWithOptions(this[_0x14d833(0xfa)],'execute_custom_sql',{'title':'Execute\x20Custom\x20SQL','description':_0x14d833(0x100),'inputSchema':{...authSchema,'sqlCode':z[_0x14d833(0x98)]()[_0x14d833(0xf2)](0x1)[_0x14d833(0xf3)](_0x14d833(0x91)),'params':z['record'](z[_0x14d833(0xc5)]([z[_0x14d833(0x98)](),z['number']()]))['optional']()[_0x14d833(0xf3)](_0x14d833(0x108))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},async _0x3908aa=>{const _0x296a00=_0x14d833;try{const _0x22bf6d=await executeCustomSql(_0x3908aa);return{'content':[{'type':_0x296a00(0xb5),'text':JSON[_0x296a00(0xe7)](_0x22bf6d,null,0x2)}]};}catch(_0x23015f){return{'content':[{'type':_0x296a00(0xb5),'text':JSON[_0x296a00(0xe7)]({'error':!![],'message':_0x23015f['message']||_0x296a00(0x110)},null,0x2)}],'isError':!![]};}});}['registerGenerateSqlCodeTool'](){const _0x5efe69=a8_0x5ffa61;registerToolWithOptions(this[_0x5efe69(0xfa)],_0x5efe69(0x90),{'title':_0x5efe69(0xd1),'description':'Generate\x20SDK\x20code\x20for\x20calling\x20a\x20custom\x20SQL\x20query.\x0a\x0aCRITICAL\x20-\x20SQL\x20CODE\x20VALIDATION:\x0a•\x20This\x20tool\x20VALIDATES\x20that\x20the\x20sqlCode\x20exists\x20before\x20generating\x20code\x0a•\x20DO\x20NOT\x20fabricate\x20or\x20guess\x20sqlCode\x20values\x0a•\x20ALWAYS\x20use\x20list_sql_queries\x20first\x20to\x20find\x20the\x20actual\x20sqlCode\x0a•\x20If\x20sqlCode\x20doesn\x27t\x20exist,\x20this\x20tool\x20will\x20return\x20an\x20error\x20with\x20sqlExists:\x20false\x0a•\x20Use\x20the\x20exact\x20sqlCode\x20from\x20list_sql_queries\x20result\x0a\x0aUsage:\x0a1.\x20list_sql_queries(sqlName:\x20\x22xxx\x22)\x20-\x20Find\x20the\x20SQL\x20and\x20get\x20its\x20sqlCode\x0a2.\x20generate_sql_code(sqlCode:\x20\x22xxx\x22)\x20-\x20Generate\x20code\x20using\x20the\x20exact\x20sqlCode\x0a3.\x20execute_custom_sql(sqlCode:\x20\x22xxx\x22)\x20-\x20Execute\x20to\x20verify\x0a\x0aThe\x20generated\x20code\x20includes:\x0a•\x20SDK\x20client\x20initialization\x0a•\x20executeSql\x20method\x20call\x20with\x20proper\x20parameters\x0a•\x20Error\x20handling\x20(check\x20execSuccess)\x0a•\x20Result\x20processing\x20example','inputSchema':{...authSchema,'sqlCode':z[_0x5efe69(0x98)]()[_0x5efe69(0xf2)](0x1)[_0x5efe69(0xf3)]('SQL\x20code\x20from\x20list_sql_queries\x20->\x20sqlCode\x20(must\x20exist,\x20cannot\x20be\x20fabricated)'),'params':z[_0x5efe69(0x10e)](z['union']([z[_0x5efe69(0x98)](),z[_0x5efe69(0xa6)]()]))['optional']()[_0x5efe69(0xf3)](_0x5efe69(0xca)),'includeImports':z[_0x5efe69(0xc7)]()[_0x5efe69(0xf0)]()['describe'](_0x5efe69(0xe3))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},async _0xfcdb7a=>{const _0x262087=_0x5efe69;try{const _0xc0f3bd=await generateSqlCode(_0xfcdb7a);return{'content':[{'type':_0x262087(0xb5),'text':JSON[_0x262087(0xe7)](_0xc0f3bd,null,0x2)}]};}catch(_0x43a515){return{'content':[{'type':_0x262087(0xb5),'text':JSON[_0x262087(0xe7)]({'error':!![],'message':_0x43a515['message']||_0x262087(0x110)},null,0x2)}],'isError':!![]};}});}[a8_0x5ffa61(0xf4)](){const _0x14c41b=a8_0x5ffa61;registerToolWithOptions(this['mcpServer'],_0x14c41b(0x9b),{'title':_0x14c41b(0x101),'description':_0x14c41b(0xa4),'inputSchema':{...authSchema,'sqlContent':z['string']()['min'](0x1)['describe'](_0x14c41b(0xa1)),'dbId':z[_0x14c41b(0xa6)]()['optional']()[_0x14c41b(0xf3)]('Database\x20ID\x20(optional,\x20for\x20context)'),'validateSchemas':z[_0x14c41b(0xde)](z[_0x14c41b(0x98)]())['optional']()[_0x14c41b(0xf3)]('Optional:\x20list\x20of\x20dataset\x20codes\x20to\x20validate\x20table/column\x20names\x20against')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},async _0x3871a1=>{const _0x688ef6=_0x14c41b;try{const _0x2d36d4=await validateSqlContent(_0x3871a1);return{'content':[{'type':'text','text':JSON['stringify'](_0x2d36d4,null,0x2)}]};}catch(_0x53213d){return{'content':[{'type':'text','text':JSON[_0x688ef6(0xe7)]({'error':!![],'message':_0x53213d[_0x688ef6(0xb0)]||_0x688ef6(0x110)},null,0x2)}],'isError':!![]};}});}[a8_0x5ffa61(0xea)](){const _0x59a8a8=a8_0x5ffa61;registerToolWithOptions(this[_0x59a8a8(0xfa)],'list_bff_scripts',{'title':_0x59a8a8(0x97),'description':_0x59a8a8(0xc2),'inputSchema':{...authSchema},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},async _0x432299=>{const _0x19c111=_0x59a8a8;try{const _0x2ac95a=await listBffScripts(_0x432299);return{'content':[{'type':_0x19c111(0xb5),'text':JSON[_0x19c111(0xe7)](_0x2ac95a,null,0x2)}]};}catch(_0x5e26d3){return{'content':[{'type':_0x19c111(0xb5),'text':JSON['stringify']({'error':!![],'message':_0x5e26d3[_0x19c111(0xb0)]||'Unknown\x20error\x20occurred'},null,0x2)}],'isError':!![]};}});}[a8_0x5ffa61(0xc9)](){const _0x23498d=a8_0x5ffa61;registerToolWithOptions(this[_0x23498d(0xfa)],_0x23498d(0xac),{'title':_0x23498d(0xdb),'description':_0x23498d(0xe0),'inputSchema':{...authSchema,'id':z['number']()[_0x23498d(0xf3)](_0x23498d(0xb2))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},async _0x63a249=>{const _0x36931b=_0x23498d;try{const _0x351a72=await getBffScriptInfo(_0x63a249);return{'content':[{'type':_0x36931b(0xb5),'text':JSON[_0x36931b(0xe7)](_0x351a72,null,0x2)}]};}catch(_0x3eb8bc){return{'content':[{'type':'text','text':JSON['stringify']({'error':!![],'message':_0x3eb8bc[_0x36931b(0xb0)]||_0x36931b(0x110)},null,0x2)}],'isError':!![]};}});}[a8_0x5ffa61(0xa9)](){const _0x6ebbd6=a8_0x5ffa61;registerToolWithOptions(this['mcpServer'],_0x6ebbd6(0xd4),{'title':_0x6ebbd6(0xc1),'description':_0x6ebbd6(0xd3),'inputSchema':{...authSchema,'id':z[_0x6ebbd6(0xa6)]()[_0x6ebbd6(0xf0)]()[_0x6ebbd6(0xf3)]('Backend\x20Function\x20ID\x20(required\x20for\x20updating\x20existing\x20script)'),'description':z[_0x6ebbd6(0x98)]()[_0x6ebbd6(0xf2)](0x1)[_0x6ebbd6(0xf3)](_0x6ebbd6(0xdd)),'scriptContent':z[_0x6ebbd6(0x98)]()[_0x6ebbd6(0xf2)](0x1)[_0x6ebbd6(0xf3)]('JavaScript/TypeScript\x20code\x20with\x20default\x20export')},'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':![]}},async _0x15081d=>{const _0x11cd70=_0x6ebbd6;try{const _0x32126e=await saveOrUpdateBffScript(_0x15081d);return{'content':[{'type':_0x11cd70(0xb5),'text':JSON[_0x11cd70(0xe7)](_0x32126e,null,0x2)}]};}catch(_0x25e8b1){return{'content':[{'type':_0x11cd70(0xb5),'text':JSON[_0x11cd70(0xe7)]({'error':!![],'message':_0x25e8b1[_0x11cd70(0xb0)]||_0x11cd70(0x110)},null,0x2)}],'isError':!![]};}});}get[a8_0x5ffa61(0x9e)](){return this['mcpServer'];}async[a8_0x5ffa61(0xb6)](_0x5b33e0){const _0x244294=a8_0x5ffa61;await this[_0x244294(0xfa)][_0x244294(0xb6)](_0x5b33e0);}async[a8_0x5ffa61(0x8c)](){const _0x47643a=a8_0x5ffa61;await this[_0x47643a(0xfa)][_0x47643a(0x8c)]();}[a8_0x5ffa61(0xfc)](){const _0x3bbd1a=a8_0x5ffa61;if(!process[_0x3bbd1a(0x94)][_0x3bbd1a(0xed)])return;console[_0x3bbd1a(0x10b)](_0x3bbd1a(0xbe)),console[_0x3bbd1a(0x10b)]('📌\x20Version:\x20'+packageJson[_0x3bbd1a(0xcd)]),console['log'](_0x3bbd1a(0x95)),console[_0x3bbd1a(0x10b)](''),console['log'](_0x3bbd1a(0x96)),console[_0x3bbd1a(0x10b)](_0x3bbd1a(0xb4)),console[_0x3bbd1a(0x10b)]('\x20\x20Use\x20the\x20\x22login\x22\x20tool\x20first\x20to\x20authenticate.'),console['log'](''),console[_0x3bbd1a(0x10b)]('Available\x20tools:'),console[_0x3bbd1a(0x10b)](_0x3bbd1a(0xdf)),console[_0x3bbd1a(0x10b)](_0x3bbd1a(0xb9)),console['log'](_0x3bbd1a(0x10c)),console[_0x3bbd1a(0x10b)](_0x3bbd1a(0xf1)),console[_0x3bbd1a(0x10b)]('\x20\x20-\x20get_operation_detail:\x20Get\x20detailed\x20operation\x20information'),console[_0x3bbd1a(0x10b)](_0x3bbd1a(0xa8)),console[_0x3bbd1a(0x10b)](_0x3bbd1a(0xbc)),console['log'](_0x3bbd1a(0xfd)),console[_0x3bbd1a(0x10b)](_0x3bbd1a(0xb7)),console[_0x3bbd1a(0x10b)]('\x20\x20-\x20execute_custom_sql:\x20Execute\x20a\x20custom\x20SQL\x20query'),console[_0x3bbd1a(0x10b)](_0x3bbd1a(0xfb)),console['log'](_0x3bbd1a(0xcb)),this[_0x3bbd1a(0xd9)][_0x3bbd1a(0x8d)]&&(console['log'](''),console[_0x3bbd1a(0x10b)]('Backend\x20Function\x20tools\x20(enabled\x20via\x20--dangerously-bff-save):'),console[_0x3bbd1a(0x10b)]('\x20\x20-\x20list_bff_scripts:\x20List\x20all\x20Backend\x20Function\x20scripts'),console[_0x3bbd1a(0x10b)](_0x3bbd1a(0xba)),console[_0x3bbd1a(0x10b)](_0x3bbd1a(0xe9)));}}export function createServer(_0x1128d6){return new LovrabetDatasetMCPServer(_0x1128d6);}
|
|
1
|
+
const a7_0x79ed0=a7_0x1e91;(function(_0x155ce6,_0x37249e){const _0x27ca8c=a7_0x1e91,_0x1f5b1c=_0x155ce6();while(!![]){try{const _0x3df5a9=parseInt(_0x27ca8c(0xca))/0x1*(parseInt(_0x27ca8c(0xb0))/0x2)+parseInt(_0x27ca8c(0x80))/0x3+parseInt(_0x27ca8c(0x8e))/0x4+parseInt(_0x27ca8c(0xc8))/0x5+parseInt(_0x27ca8c(0xaf))/0x6+parseInt(_0x27ca8c(0x8d))/0x7+parseInt(_0x27ca8c(0xb8))/0x8*(-parseInt(_0x27ca8c(0x6a))/0x9);if(_0x3df5a9===_0x37249e)break;else _0x1f5b1c['push'](_0x1f5b1c['shift']());}catch(_0x308d03){_0x1f5b1c['push'](_0x1f5b1c['shift']());}}}(a7_0x52dd,0x6d3c1));import{McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';function a7_0x1e91(_0x401e33,_0x3a2dee){_0x401e33=_0x401e33-0x66;const _0x52dd10=a7_0x52dd();let _0x1e9100=_0x52dd10[_0x401e33];return _0x1e9100;}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(a7_0x79ed0(0xc7)),authSchema={'appCode':z[a7_0x79ed0(0xc2)]()[a7_0x79ed0(0x81)]()[a7_0x79ed0(0x7b)](a7_0x79ed0(0xb9)),'cookie':z[a7_0x79ed0(0xc2)]()['optional']()['describe'](a7_0x79ed0(0x6d))};function registerToolWithOptions(_0x390178,_0x208fde,_0x28f62f,_0x30b5e7){const _0x55023e=a7_0x79ed0;_0x390178[_0x55023e(0x68)](_0x208fde,_0x28f62f,_0x30b5e7);}function a7_0x52dd(){const _0x2f27d8=['describe','Validate\x20SQL\x20Content','Get\x20Dataset\x20Detail','list_sql_queries','Get\x20list\x20of\x20all\x20datasets\x20with\x20metadata\x20and\x20table\x20relations\x20(ER\x20Config).\x20Use\x20includeRelations:\x20false\x20for\x20faster\x20response.','2416245ihmvRE','optional','Dataset\x20code/ID','Lovrabet\x20Dataset\x20MCP\x20Server','Get\x20list\x20of\x20all\x20API\x20operations\x20for\x20a\x20dataset.\x20Prefer\x20\x22filter\x22\x20for\x20queries,\x20\x22getOne\x22\x20for\x20single\x20record\x20by\x20ID.','close','Unknown\x20error\x20occurred','Get\x20Backend\x20Function\x20Info','Client-side\x20filter\x20by\x20category','get_dataset_detail','list_bff_scripts','Backend\x20Function\x20ID\x20(for\x20updating)','Dataset\x20ID\x20(numeric)\x20or\x20code\x20(UUID)','1649347CsUiVe','2530460znVQEm','SQL\x20parameters','Bypass\x20cache\x20(default:\x20false)','Login','execute_custom_sql','union','Get\x20detailed\x20dataset\x20information\x20including\x20fields,\x20operations,\x20and\x20relations.\x20Supports\x20both\x20dataset\x20ID\x20(numeric)\x20and\x20code\x20(UUID).','Save\x20or\x20Update\x20Backend\x20Function','Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update)','search_datasets','Search\x20datasets\x20by\x20keyword\x20(searches\x20in\x20name,\x20table\x20name,\x20code,\x20and\x20description).','stringify','generate_sdk_code','Dataset\x20codes\x20to\x20validate\x20against','array','boolean','Search\x20keyword','get_bff_script_info','generate_sql_code','version','validate_sql_content','List\x20SQL\x20Queries','Function\x20description','log','MCP_DEBUG','save_or_update_bff_script','list_datasets','Generate\x20SQL\x20Code','mcpServer','Database\x20ID\x20from\x20get_dataset_detail','logInfo','Get\x20Operations','record','708CdqrOC','4sthRhW','List\x20all\x20Backend\x20Function\x20(ENDPOINT\x20type)\x20scripts.','Execute\x20Custom\x20SQL','Save\x20or\x20update\x20a\x20Backend\x20Function\x20script.\x20Provide\x20id\x20for\x20updates,\x20omit\x20for\x20new.','Server\x20started\x20successfully','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query.\x20Only\x20SELECT\x20queries\x20are\x20auto-saved;\x20non-SELECT\x20are\x20blocked\x20for\x20safety.\x20Supports\x20MyBatis\x20syntax.\x20Get\x20dbId\x20from\x20get_dataset_detail.','Client-side\x20filter\x20by\x20name/description/content','Login\x20to\x20Lovrabet\x20to\x20authenticate\x20for\x20dataset\x20queries.','24vZIPVh','Application\x20code\x20(optional\x20if\x20LOVRABET_APP_CODE\x20env\x20var\x20is\x20set)','server','options','Example\x20parameter\x20values','registerAllTools','text','Backend\x20Function\x20ID\x20(from\x20list_bff_scripts)','SQL\x20code\x20from\x20list_sql_queries\x20(must\x20exist)','Server-side\x20fuzzy\x20match\x20by\x20sqlName','string','online','Generate\x20SDK\x20Code','enum','connect','../package.json','2664035wcCtAc','bffAutosave','282482lzEgcM','Backend\x20Function\x20tools\x20enabled\x20(--dangerously-bff-save)','min','Environment\x20(optional,\x20uses\x20LOVRABET_ENV\x20or\x20defaults\x20to\x20online)','login','registerTool','Include\x20import\x20statements\x20(default:\x20true)','6972345FeARVA','You\x20are\x20an\x20AI\x20assistant\x20helping\x20developers\x20work\x20with\x20the\x20Lovrabet\x20data\x20platform.\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\x20Pattern\x0aAll\x20custom\x20SQLs\x20use\x20the\x20same\x20pattern:\x0a```typescript\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(sqlCode,\x20params);\x0aif\x20(!data.execSuccess)\x20throw\x20new\x20Error(data.execError);\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0a```\x0a\x0a##\x20MyBatis\x20Dynamic\x20SQL\x0aSQL\x20content\x20supports\x20MyBatis\x20syntax:\x20`#{param}`,\x20`<if\x20test=\x22\x22>`,\x20`<where>`,\x20`<foreach>`.\x0aUse\x20`<\x20>\x20&`\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','List\x20Backend\x20Functions','Authentication\x20cookie\x20(optional,\x20uses\x20stored\x20cookie\x20from\x20login\x20if\x20not\x20provided)','Server-side\x20fuzzy\x20match\x20by\x20sqlCode','List\x20Datasets','JavaScript/TypeScript\x20code\x20with\x20default\x20export','SQL\x20ID\x20(for\x20updating\x20existing\x20SQL)','number','Use\x20camelCase\x20alias\x20instead\x20of\x20dataset_[code]\x20pattern\x20(default:\x20false)','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation,\x20including\x20field\x20metadata.\x20Check\x20user\x27s\x20@lovrabet/sdk\x20version\x20in\x20package.json\x20first.','env','Get\x20detailed\x20operation\x20information\x20including\x20request/response\x20examples.','Get\x20detailed\x20Backend\x20Function\x20script\x20including\x20full\x20source\x20code.','Get\x20Operation\x20Detail','SQL\x20name/label','List\x20all\x20available\x20custom\x20SQL\x20queries\x20with\x20metadata\x20and\x20parameters.'];a7_0x52dd=function(){return _0x2f27d8;};return a7_0x52dd();}function wrapHandler(_0x3aab63){return async _0x347ae0=>{const _0x32f9ee=a7_0x1e91;try{const _0x103142=await _0x3aab63(_0x347ae0);return{'content':[{'type':_0x32f9ee(0xbe),'text':JSON[_0x32f9ee(0x99)](_0x103142,null,0x2)}]};}catch(_0x152af5){return{'content':[{'type':'text','text':JSON[_0x32f9ee(0x99)]({'error':!![],'message':_0x152af5['message']||_0x32f9ee(0x86)},null,0x2)}],'isError':!![]};}};}export class LovrabetDatasetMCPServer{['mcpServer'];[a7_0x79ed0(0xbb)];constructor(_0x387be4={}){const _0xa56991=a7_0x79ed0;this[_0xa56991(0xbb)]=_0x387be4,this['mcpServer']=new McpServer({'name':'lovrabet-dataset-mcp','version':packageJson[_0xa56991(0xa1)]},{'capabilities':{'tools':{}},'instructions':INSTRUCTIONS}),this[_0xa56991(0xbd)]();}[a7_0x79ed0(0xbd)](){const _0x504f68=a7_0x79ed0;registerToolWithOptions(this[_0x504f68(0xaa)],_0x504f68(0x67),{'title':_0x504f68(0x91),'description':_0x504f68(0xb7),'inputSchema':{'env':z[_0x504f68(0xc5)]([_0x504f68(0xc3),'daily'])[_0x504f68(0x81)]()[_0x504f68(0x7b)](_0x504f68(0x66))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(login)),registerToolWithOptions(this[_0x504f68(0xaa)],_0x504f68(0xa8),{'title':_0x504f68(0x6f),'description':_0x504f68(0x7f),'inputSchema':{...authSchema,'forceRefresh':z[_0x504f68(0x9d)]()['optional']()['describe'](_0x504f68(0x90)),'includeRelations':z['boolean']()[_0x504f68(0x81)]()[_0x504f68(0x7b)]('Include\x20table\x20relations\x20(default:\x20true)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listDatasets)),registerToolWithOptions(this[_0x504f68(0xaa)],_0x504f68(0x97),{'title':'Search\x20Datasets','description':_0x504f68(0x98),'inputSchema':{...authSchema,'keyword':z['string']()[_0x504f68(0x7b)](_0x504f68(0x9e))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(searchDatasets)),registerToolWithOptions(this[_0x504f68(0xaa)],_0x504f68(0x89),{'title':_0x504f68(0x7d),'description':_0x504f68(0x94),'inputSchema':{...authSchema,'datasetCode':z['string']()['describe'](_0x504f68(0x8c)),'forceRefresh':z['boolean']()['optional']()[_0x504f68(0x7b)](_0x504f68(0x90)),'includeRelations':z[_0x504f68(0x9d)]()[_0x504f68(0x81)]()['describe']('Include\x20table\x20relations\x20(default:\x20true)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetDetail)),registerToolWithOptions(this[_0x504f68(0xaa)],'get_dataset_operations',{'title':_0x504f68(0xad),'description':_0x504f68(0x84),'inputSchema':{...authSchema,'datasetCode':z[_0x504f68(0xc2)]()[_0x504f68(0x7b)](_0x504f68(0x8c))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetOperations)),registerToolWithOptions(this[_0x504f68(0xaa)],'get_operation_detail',{'title':_0x504f68(0x78),'description':_0x504f68(0x76),'inputSchema':{...authSchema,'datasetCode':z[_0x504f68(0xc2)]()[_0x504f68(0x7b)](_0x504f68(0x82)),'operationName':z[_0x504f68(0xc2)]()['describe'](_0x504f68(0x96))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getOperationDetail)),registerToolWithOptions(this['mcpServer'],_0x504f68(0x9a),{'title':_0x504f68(0xc4),'description':_0x504f68(0x74),'inputSchema':{...authSchema,'datasetCode':z[_0x504f68(0xc2)]()[_0x504f68(0x7b)](_0x504f68(0x82)),'operationName':z['string']()['describe'](_0x504f68(0x96)),'includeImports':z[_0x504f68(0x9d)]()['optional']()['describe'](_0x504f68(0x69)),'useAlias':z['boolean']()[_0x504f68(0x81)]()['describe'](_0x504f68(0x73))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSDKCode)),registerToolWithOptions(this[_0x504f68(0xaa)],_0x504f68(0x7e),{'title':_0x504f68(0xa3),'description':_0x504f68(0x7a),'inputSchema':{...authSchema,'keyword':z[_0x504f68(0xc2)]()[_0x504f68(0x81)]()[_0x504f68(0x7b)](_0x504f68(0xb6)),'category':z['string']()['optional']()[_0x504f68(0x7b)](_0x504f68(0x88)),'sqlCode':z[_0x504f68(0xc2)]()[_0x504f68(0x81)]()[_0x504f68(0x7b)](_0x504f68(0x6e)),'sqlName':z['string']()[_0x504f68(0x81)]()[_0x504f68(0x7b)](_0x504f68(0xc1)),'pageSize':z[_0x504f68(0x72)]()[_0x504f68(0x81)]()[_0x504f68(0x7b)]('Items\x20per\x20page\x20(default:\x20999)'),'currentPage':z[_0x504f68(0x72)]()['optional']()[_0x504f68(0x7b)]('Page\x20number\x20(default:\x201)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listSqlQueries)),registerToolWithOptions(this['mcpServer'],_0x504f68(0x92),{'title':_0x504f68(0xb2),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode.\x20Get\x20sqlCode\x20from\x20list_sql_queries\x20first.','inputSchema':{...authSchema,'sqlCode':z[_0x504f68(0xc2)]()[_0x504f68(0xcc)](0x1)[_0x504f68(0x7b)]('SQL\x20code\x20from\x20list_sql_queries\x20->\x20sqlCode'),'params':z[_0x504f68(0xae)](z['union']([z['string'](),z['number']()]))[_0x504f68(0x81)]()[_0x504f68(0x7b)](_0x504f68(0x8f))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(executeCustomSql)),registerToolWithOptions(this['mcpServer'],_0x504f68(0xa0),{'title':_0x504f68(0xa9),'description':'Generate\x20SDK\x20code\x20for\x20a\x20custom\x20SQL\x20query.\x20Validates\x20sqlCode\x20exists\x20first.\x20Use\x20list_sql_queries\x20to\x20find\x20valid\x20sqlCodes.','inputSchema':{...authSchema,'sqlCode':z[_0x504f68(0xc2)]()['min'](0x1)[_0x504f68(0x7b)](_0x504f68(0xc0)),'params':z[_0x504f68(0xae)](z[_0x504f68(0x93)]([z['string'](),z['number']()]))[_0x504f68(0x81)]()[_0x504f68(0x7b)](_0x504f68(0xbc)),'includeImports':z['boolean']()[_0x504f68(0x81)]()['describe'](_0x504f68(0x69))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSqlCode)),registerToolWithOptions(this[_0x504f68(0xaa)],_0x504f68(0xa2),{'title':_0x504f68(0x7c),'description':'Validate\x20SQL\x20content\x20without\x20saving.\x20Detects\x20SQL\x20type\x20(SELECT/INSERT/UPDATE/DELETE/DDL)\x20and\x20validates\x20table/column\x20existence.\x20Supports\x20MyBatis\x20syntax.','inputSchema':{...authSchema,'sqlContent':z[_0x504f68(0xc2)]()[_0x504f68(0xcc)](0x1)[_0x504f68(0x7b)]('SQL\x20content\x20to\x20validate'),'dbId':z[_0x504f68(0x72)]()[_0x504f68(0x81)]()['describe']('Database\x20ID\x20(optional)'),'validateSchemas':z[_0x504f68(0x9c)](z[_0x504f68(0xc2)]())[_0x504f68(0x81)]()[_0x504f68(0x7b)](_0x504f68(0x9b))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(validateSqlContent)),registerToolWithOptions(this[_0x504f68(0xaa)],'save_or_update_custom_sql',{'title':'Save\x20or\x20Update\x20Custom\x20SQL','description':_0x504f68(0xb5),'inputSchema':{...authSchema,'sqlName':z[_0x504f68(0xc2)]()['min'](0x1)[_0x504f68(0x7b)](_0x504f68(0x79)),'dbId':z[_0x504f68(0x72)]()[_0x504f68(0x7b)](_0x504f68(0xab)),'sqlContent':z[_0x504f68(0xc2)]()['min'](0x1)[_0x504f68(0x7b)]('SQL\x20SELECT\x20statement\x20(supports\x20MyBatis\x20syntax)'),'id':z[_0x504f68(0x72)]()[_0x504f68(0x81)]()['describe'](_0x504f68(0x71))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':![]}},wrapHandler(saveOrUpdateCustomSql)),this[_0x504f68(0xbb)]['bffAutosave']&&(registerToolWithOptions(this[_0x504f68(0xaa)],_0x504f68(0x8a),{'title':_0x504f68(0x6c),'description':_0x504f68(0xb1),'inputSchema':{...authSchema},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listBffScripts)),registerToolWithOptions(this[_0x504f68(0xaa)],_0x504f68(0x9f),{'title':_0x504f68(0x87),'description':_0x504f68(0x77),'inputSchema':{...authSchema,'id':z['number']()[_0x504f68(0x7b)](_0x504f68(0xbf))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getBffScriptInfo)),registerToolWithOptions(this[_0x504f68(0xaa)],_0x504f68(0xa7),{'title':_0x504f68(0x95),'description':_0x504f68(0xb3),'inputSchema':{...authSchema,'id':z[_0x504f68(0x72)]()[_0x504f68(0x81)]()[_0x504f68(0x7b)](_0x504f68(0x8b)),'description':z[_0x504f68(0xc2)]()[_0x504f68(0xcc)](0x1)[_0x504f68(0x7b)](_0x504f68(0xa4)),'scriptContent':z[_0x504f68(0xc2)]()[_0x504f68(0xcc)](0x1)[_0x504f68(0x7b)](_0x504f68(0x70))},'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':![]}},wrapHandler(saveOrUpdateBffScript)));}get[a7_0x79ed0(0xba)](){const _0x158ef9=a7_0x79ed0;return this[_0x158ef9(0xaa)];}async['connect'](_0x5b872b){const _0x4f802b=a7_0x79ed0;await this[_0x4f802b(0xaa)][_0x4f802b(0xc6)](_0x5b872b);}async[a7_0x79ed0(0x85)](){const _0x3b716b=a7_0x79ed0;await this[_0x3b716b(0xaa)][_0x3b716b(0x85)]();}[a7_0x79ed0(0xac)](){const _0x2d2064=a7_0x79ed0;if(!process[_0x2d2064(0x75)][_0x2d2064(0xa6)])return;console['log'](_0x2d2064(0x83)),console['log']('Version:\x20'+packageJson[_0x2d2064(0xa1)]),console[_0x2d2064(0xa5)](_0x2d2064(0xb4)),this[_0x2d2064(0xbb)][_0x2d2064(0xc9)]&&console[_0x2d2064(0xa5)](_0x2d2064(0xcb));}}const INSTRUCTIONS=a7_0x79ed0(0x6b);export function createServer(_0x1e8121){return new LovrabetDatasetMCPServer(_0x1e8121);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x17daa7,_0x304342){const _0x545c86=a9_0x4cd3,_0xb0481f=_0x17daa7();while(!![]){try{const _0x4b7fa8=parseInt(_0x545c86(0x111))/0x1*(-parseInt(_0x545c86(0x145))/0x2)+-parseInt(_0x545c86(0x149))/0x3*(-parseInt(_0x545c86(0x100))/0x4)+-parseInt(_0x545c86(0xe9))/0x5*(-parseInt(_0x545c86(0x13e))/0x6)+-parseInt(_0x545c86(0x13a))/0x7+-parseInt(_0x545c86(0x13b))/0x8*(-parseInt(_0x545c86(0x133))/0x9)+-parseInt(_0x545c86(0xe8))/0xa+-parseInt(_0x545c86(0x113))/0xb*(-parseInt(_0x545c86(0x127))/0xc);if(_0x4b7fa8===_0x304342)break;else _0xb0481f['push'](_0xb0481f['shift']());}catch(_0x1a78f2){_0xb0481f['push'](_0xb0481f['shift']());}}}(a9_0xb7ad,0x3b4ac));function a9_0xb7ad(){const _0x414c78=['execSuccess','execResult','login','sql\x20syntax','1174150OcmPzd','955MahMLN','trim','使用\x20get_dataset_detail\x20查看表的字段列表','suggestedAction','列\x20\x22','SQL\x20execution\x20failed\x20[','data','required','当前提供的参数:\x20','toLowerCase','检查列名\x20\x22','ERR','检查引号是否配对','match','message','column','\x22\x20是否正确','execError','查看完整的错误信息以获取更多线索','将非聚合列添加到\x20GROUP\x20BY\x20子句中','list_sql_queries','column\x20doesn\x27t\x20exist','MISSING_PARAMETER','13948mZFAlp','save_or_update_custom_sql','Get\x20ready-to-use\x20TypeScript\x20code\x20with\x20type\x20inference','ambiguous','invalid','列出所有可用的数据集以找到正确的表名','length','Generate\x20SDK\x20code\x20for\x20this\x20SQL','检查\x20SQL\x20语法','AMBIGUOUS_COLUMN','high','UNKNOWN_ERROR','表\x20\x22','SQL\x20execution\x20failed\x20without\x20error\x20message','\x20row(s).','SQL\x20语法错误。请检查\x20SQL\x20语句的语法,如:1)\x20关键字拼写\x202)\x20括号匹配\x203)\x20引号配对\x204)\x20逗号位置','includes','236LXPTbi','Check\x20the\x20SQL\x20definition\x20to\x20confirm\x20expected\x20behavior','3699058vXDFty','executeSql','medium','Review\x20the\x20SQL\x20content\x20and\x20parameters','column\x20not\x20found','SQL\x20execution\x20failed:\x20','COLUMN_NOT_FOUND','params','SQL\x20需要参数但未提供。请检查\x20SQL\x20中的占位符(如\x20#{param},\x20${param},\x20:param)并提供相应的参数值','SYNTAX_ERROR','tool','检查\x20SELECT\x20子句中的列','description','API\x20call\x20failed:\x20','table_name','column_name','TABLE_NOT_FOUND','isArray','确认表和列是否存在','或者使用聚合函数(COUNT,\x20SUM,\x20AVG,\x20MAX,\x20MIN)','12zUiJEk','获取数据集详情以确认可用字段','修改\x20SQL:\x20移除不存在的列或更正列名','now','get_dataset_detail','msg','GROUP\x20BY\x20语句错误。SELECT\x20中的非聚合列必须出现在\x20GROUP\x20BY\x20子句中','GROUP_BY_ERROR','Fix\x20the\x20SQL\x20based\x20on\x20error\x20message','检查表名\x20\x22','success','keys','3656439KtPNRY','syntax\x20error','调用\x20execute_custom_sql\x20时在\x20params\x20中提供参数','errorMsg','unknown\x20column','push','Verify\x20SQL\x20code\x20exists','1738478jSuJsd','8pmJWme','list_datasets','errorCode','3324XTihhS','Review\x20and\x20fix\x20the\x20SQL',']:\x20','UNKNOWN','\x22\x20不存在。请检查表名或使用\x20list_datasets\x20查看可用的数据集','low','使用\x20get_dataset_detail\x20确认正确的表名','3982pGDnYZ','group\x20by','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','expression','198EPYnKX','parameter','join','Get\x20SQL\x20details\x20to\x20review\x20the\x20query','generate_sql_code'];a9_0xb7ad=function(){return _0x414c78;};return a9_0xb7ad();}function a9_0x4cd3(_0x4b7f11,_0x4bb040){_0x4b7f11=_0x4b7f11-0xe0;const _0xb7ada6=a9_0xb7ad();let _0x4cd3c1=_0xb7ada6[_0x4b7f11];return _0x4cd3c1;}import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode,getEnvironment}from'../config/env.js';function analyzeError(_0x16fd90,_0x54b05d,_0x3f624d){const _0x1a3109=a9_0x4cd3,_0x16d27d=[],_0x133b84=_0x16fd90[_0x1a3109(0xf2)]();if(_0x133b84[_0x1a3109(0x110)](_0x1a3109(0x137))||_0x133b84[_0x1a3109(0x110)](_0x1a3109(0xfe))||_0x133b84[_0x1a3109(0x110)](_0x1a3109(0x117))){const _0x1aa78e=_0x16fd90[_0x1a3109(0xf6)](/Unknown column '([^']+)'/i)||_0x16fd90[_0x1a3109(0xf6)](/column '([^']+)' does not exist/i),_0x31a5f0=_0x1aa78e?_0x1aa78e[0x1]:_0x1a3109(0x122);_0x16d27d[_0x1a3109(0x138)]({'errorType':_0x1a3109(0x119),'canAutoFix':![],'suggestion':_0x1a3109(0xed)+_0x31a5f0+'\x22\x20不存在。请检查:1)\x20列名拼写是否正确\x202)\x20是否在正确的表中查询\x203)\x20使用\x20get_dataset_detail\x20查看该\x20SQL\x20的原始内容','manualSteps':[_0x1a3109(0xf3)+_0x31a5f0+_0x1a3109(0xf9),_0x1a3109(0xeb),_0x1a3109(0x129)],'suggestedAction':{'tool':_0x1a3109(0x12b),'description':_0x1a3109(0x128)}});}if(_0x133b84[_0x1a3109(0x110)]('table')&&_0x133b84['includes']('doesn\x27t\x20exist')){const _0x45103f=_0x16fd90[_0x1a3109(0xf6)](/table '([^']+)'/i)||_0x16fd90[_0x1a3109(0xf6)](/from `?(\w+)`?/i),_0x41987d=_0x45103f?_0x45103f[0x1]:_0x1a3109(0x121);_0x16d27d[_0x1a3109(0x138)]({'errorType':_0x1a3109(0x123),'canAutoFix':![],'suggestion':_0x1a3109(0x10c)+_0x41987d+_0x1a3109(0x142),'manualSteps':[_0x1a3109(0x130)+_0x41987d+_0x1a3109(0xf9),'使用\x20list_datasets\x20查看所有可用的数据集',_0x1a3109(0x144)],'suggestedAction':{'tool':_0x1a3109(0x13c),'description':_0x1a3109(0x105)}});}(_0x133b84[_0x1a3109(0x110)](_0x1a3109(0x134))||_0x133b84[_0x1a3109(0x110)](_0x1a3109(0xe7)))&&_0x16d27d['push']({'errorType':_0x1a3109(0x11c),'canAutoFix':![],'suggestion':_0x1a3109(0x10f),'manualSteps':['检查\x20SQL\x20关键字拼写(SELECT,\x20FROM,\x20WHERE\x20等)','检查括号是否配对',_0x1a3109(0xf5),'检查逗号是否在正确的位置']});if(_0x133b84[_0x1a3109(0x110)](_0x1a3109(0xe0))&&_0x133b84[_0x1a3109(0x110)](_0x1a3109(0xf0))){const _0x103717=_0x3f624d?Object[_0x1a3109(0x132)](_0x3f624d):[];_0x16d27d[_0x1a3109(0x138)]({'errorType':_0x1a3109(0xff),'canAutoFix':![],'suggestion':_0x1a3109(0x11b),'manualSteps':['检查\x20SQL\x20内容,找出需要的参数',_0x1a3109(0x135),_0x103717[_0x1a3109(0x106)]>0x0?_0x1a3109(0xf1)+_0x103717[_0x1a3109(0xe1)](',\x20'):'当前没有提供任何参数']});}if(_0x133b84['includes'](_0x1a3109(0x103))&&_0x133b84[_0x1a3109(0x110)](_0x1a3109(0xf8))){const _0x5d5358=_0x16fd90[_0x1a3109(0xf6)](/column '([^']+)'/i),_0x2a847f=_0x5d5358?_0x5d5358[0x1]:_0x1a3109(0x122);_0x16d27d['push']({'errorType':_0x1a3109(0x109),'canAutoFix':!![],'suggestion':_0x1a3109(0xed)+_0x2a847f+'\x22\x20在多个表中存在。需要在列名前添加表名前缀,如:\x20table_name.'+_0x2a847f,'manualSteps':['在有歧义的列前添加表名前缀:\x20tableName.'+_0x2a847f]});}return _0x133b84[_0x1a3109(0x110)](_0x1a3109(0x146))&&(_0x133b84[_0x1a3109(0x110)](_0x1a3109(0x104))||_0x133b84[_0x1a3109(0x110)](_0x1a3109(0x148)))&&_0x16d27d[_0x1a3109(0x138)]({'errorType':_0x1a3109(0x12e),'canAutoFix':![],'suggestion':_0x1a3109(0x12d),'manualSteps':[_0x1a3109(0x11e),_0x1a3109(0xfc),_0x1a3109(0x126)]}),_0x16d27d[_0x1a3109(0x106)]===0x0&&_0x16d27d['push']({'errorType':_0x1a3109(0x10b),'canAutoFix':![],'suggestion':'SQL\x20执行失败:\x20'+_0x16fd90,'manualSteps':[_0x1a3109(0x108),_0x1a3109(0x125),_0x1a3109(0xfb)]}),_0x16d27d;}export async function executeCustomSql(_0x13c692){const _0x3b9073=a9_0x4cd3,_0x1b2267=Date[_0x3b9073(0x12a)](),{appCode:appCode=getEnvAppCode(),cookie:_0x507472,sqlCode:_0x4d7f14,params:_0x44e296}=_0x13c692;if(!appCode)throw new Error(_0x3b9073(0x147));if(!_0x4d7f14||_0x4d7f14[_0x3b9073(0xea)]()==='')throw new Error('sqlCode\x20is\x20required.\x20Get\x20it\x20from\x20list_sql_queries\x20->\x20sqlCode');const _0x3acd03=new DevApiClient({'appCode':appCode,'cookie':_0x507472}),_0x32703f=getEnvironment(),_0x89d479=_0x44e296&&Object[_0x3b9073(0x132)](_0x44e296)[_0x3b9073(0x106)]>0x0,_0xb0307=_0x89d479?Object[_0x3b9073(0x132)](_0x44e296):[];try{const _0x41d77b=await _0x3acd03[_0x3b9073(0x114)]({'sqlCode':_0x4d7f14['trim'](),'params':_0x44e296}),_0xb3f8d8=Date[_0x3b9073(0x12a)]()-_0x1b2267,_0x10584d=_0x41d77b[_0x3b9073(0x131)]??![],_0x566426=_0x41d77b[_0x3b9073(0x13d)];if(!_0x10584d){const _0x308f1c=_0x41d77b[_0x3b9073(0x136)]||_0x41d77b[_0x3b9073(0x12c)]||_0x41d77b[_0x3b9073(0x136)]||'Unknown\x20error',_0x244972=analyzeError(_0x308f1c,_0x4d7f14,_0x44e296),_0x19d185=[];for(const _0x186c05 of _0x244972){_0x186c05['suggestedAction']&&_0x19d185[_0x3b9073(0x138)]({'action':_0x186c05['suggestion'],'tool':_0x186c05[_0x3b9073(0xec)][_0x3b9073(0x11d)],'params':_0x186c05[_0x3b9073(0xec)][_0x3b9073(0x11a)],'reason':_0x186c05[_0x3b9073(0xec)][_0x3b9073(0x11f)],'priority':'high'});}return{'success':![],'execSuccess':![],'execError':_0x308f1c,'errorCode':_0x566426||_0x3b9073(0x141),'message':_0x3b9073(0xee)+(_0x566426||_0x3b9073(0xf4))+_0x3b9073(0x140)+_0x308f1c,'executionTime':_0xb3f8d8,'fixSuggestions':_0x244972,'nextSteps':_0x19d185,'sqlInfo':{'sqlCode':_0x4d7f14,'hasParams':_0x89d479||![],'paramNames':_0xb0307||[]}};}const _0x67da61=_0x41d77b[_0x3b9073(0xef)]||_0x41d77b,_0x51e14b=_0x67da61[_0x3b9073(0xe4)]??_0x67da61[_0x3b9073(0x131)]??!![],_0x5cee56=_0x67da61[_0x3b9073(0xe5)]||_0x67da61[_0x3b9073(0xef)],_0x5429ed=_0x67da61[_0x3b9073(0xfa)]||_0x67da61['errorMsg'];if(_0x51e14b){const _0xf034c6=Array[_0x3b9073(0x124)](_0x5cee56)?_0x5cee56[_0x3b9073(0x106)]:0x0,_0x6c9159=_0xf034c6>0x0;return{'success':!![],'execSuccess':!![],'execResult':_0x5cee56||[],'rowCount':_0xf034c6,'message':'SQL\x20executed\x20successfully.\x20Returned\x20'+_0xf034c6+_0x3b9073(0x10e),'executionTime':_0xb3f8d8,'sqlInfo':{'sqlCode':_0x4d7f14,'hasParams':_0x89d479||![],'paramNames':_0xb0307||[]},'nextSteps':_0x6c9159?[{'action':_0x3b9073(0x107),'tool':_0x3b9073(0xe3),'params':{'sqlCode':_0x4d7f14,'params':_0x44e296},'reason':_0x3b9073(0x102),'priority':_0x3b9073(0x115)}]:[{'action':'SQL\x20returned\x20no\x20results\x20-\x20verify\x20query\x20parameters','tool':_0x3b9073(0xfd),'params':{'sqlCode':_0x4d7f14},'reason':_0x3b9073(0x112),'priority':_0x3b9073(0x143)}]};}const _0x190553=_0x5429ed||_0x3b9073(0x10d),_0x1a0235=analyzeError(_0x190553,_0x4d7f14,_0x44e296),_0x53a1b6=[{'action':_0x3b9073(0x13f),'tool':_0x3b9073(0x101),'reason':_0x1a0235[0x0]?.['suggestion']||_0x3b9073(0x12f),'priority':_0x3b9073(0x10a)},{'action':_0x3b9073(0xe2),'tool':'list_sql_queries','params':{'sqlCode':_0x4d7f14},'reason':_0x3b9073(0x116),'priority':_0x3b9073(0x10a)}];return{'success':!![],'execSuccess':![],'execError':_0x190553,'message':_0x3b9073(0x118)+_0x190553,'executionTime':_0xb3f8d8,'fixSuggestions':_0x1a0235,'nextSteps':_0x53a1b6,'sqlInfo':{'sqlCode':_0x4d7f14,'hasParams':_0x89d479||![],'paramNames':_0xb0307||[]}};}catch(_0x186589){const _0x2e06ef=Date[_0x3b9073(0x12a)]()-_0x1b2267,_0x345cf3=_0x186589[_0x3b9073(0xf7)]||'Unknown\x20error',_0x2be303=analyzeError(_0x345cf3,_0x4d7f14,_0x44e296),_0x5cbc61=[{'action':'Check\x20authentication','tool':_0x3b9073(0xe6),'reason':'Ensure\x20you\x20are\x20logged\x20in\x20with\x20proper\x20permissions','priority':_0x3b9073(0x10a)},{'action':_0x3b9073(0x139),'tool':_0x3b9073(0xfd),'reason':'Confirm\x20the\x20SQL\x20code\x20is\x20valid\x20and\x20exists','priority':_0x3b9073(0x10a)}],_0x52b299=Boolean(_0x44e296&&Object[_0x3b9073(0x132)](_0x44e296)[_0x3b9073(0x106)]>0x0),_0x12f0de=Object[_0x3b9073(0x132)](_0x44e296||{});return{'success':![],'execSuccess':![],'execError':_0x345cf3,'message':_0x3b9073(0x120)+_0x345cf3,'executionTime':_0x2e06ef,'fixSuggestions':_0x2be303,'nextSteps':_0x5cbc61,'sqlInfo':{'sqlCode':_0x4d7f14,'hasParams':_0x52b299,'paramNames':_0x12f0de}};}}
|
|
1
|
+
(function(_0x49dd63,_0x437cff){const _0x2f3b4e=a8_0x421e,_0x44102f=_0x49dd63();while(!![]){try{const _0x373ffa=parseInt(_0x2f3b4e(0x16d))/0x1+parseInt(_0x2f3b4e(0x17b))/0x2*(-parseInt(_0x2f3b4e(0x171))/0x3)+parseInt(_0x2f3b4e(0x174))/0x4+parseInt(_0x2f3b4e(0x178))/0x5+-parseInt(_0x2f3b4e(0x172))/0x6*(parseInt(_0x2f3b4e(0x176))/0x7)+-parseInt(_0x2f3b4e(0x169))/0x8+-parseInt(_0x2f3b4e(0x170))/0x9*(parseInt(_0x2f3b4e(0x15f))/0xa);if(_0x373ffa===_0x437cff)break;else _0x44102f['push'](_0x44102f['shift']());}catch(_0x34b67d){_0x44102f['push'](_0x44102f['shift']());}}}(a8_0x2bb1,0xd1ec6));import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode}from'../config/env.js';export async function executeCustomSql(_0xf027d9){const _0x5891ae=a8_0x421e,_0x3cf5f8=Date[_0x5891ae(0x166)](),{appCode:appCode=getEnvAppCode(),cookie:_0x543a31,sqlCode:_0xdb330c,params:_0x57ddc2}=_0xf027d9;if(!appCode)throw new Error(_0x5891ae(0x17d));if(!_0xdb330c||_0xdb330c[_0x5891ae(0x173)]()==='')throw new Error(_0x5891ae(0x16f));const _0x2f3db2=new DevApiClient({'appCode':appCode,'cookie':_0x543a31}),_0x3bb727=_0x57ddc2&&Object[_0x5891ae(0x160)](_0x57ddc2)[_0x5891ae(0x163)]>0x0,_0x19c565=_0x3bb727?Object[_0x5891ae(0x160)](_0x57ddc2):[],_0x13fd22={'sqlCode':_0xdb330c,'hasParams':_0x3bb727||![],'paramNames':_0x19c565||[]};try{const _0x1e8cb1=await _0x2f3db2[_0x5891ae(0x165)]({'sqlCode':_0xdb330c[_0x5891ae(0x173)](),'params':_0x57ddc2}),_0x1ccf95=Date[_0x5891ae(0x166)]()-_0x3cf5f8,_0x4f6718=_0x1e8cb1[_0x5891ae(0x161)]??![],_0x10db87=_0x1e8cb1[_0x5891ae(0x177)];if(!_0x4f6718){const _0x1c4eed=_0x1e8cb1['errorMsg']||_0x1e8cb1[_0x5891ae(0x17c)]||'Unknown\x20error';return{'success':![],'execSuccess':![],'execError':_0x1c4eed,'errorCode':_0x10db87||_0x5891ae(0x167),'message':'SQL\x20execution\x20failed\x20['+(_0x10db87||_0x5891ae(0x175))+_0x5891ae(0x17f)+_0x1c4eed,'executionTime':_0x1ccf95,'sqlInfo':_0x13fd22};}const _0xc57e8a=_0x1e8cb1[_0x5891ae(0x16c)]||_0x1e8cb1,_0x39be1e=_0xc57e8a[_0x5891ae(0x17a)]??_0xc57e8a['success']??!![],_0xf0204=_0xc57e8a[_0x5891ae(0x164)]||_0xc57e8a[_0x5891ae(0x16c)],_0x1852fe=_0xc57e8a['execError']||_0xc57e8a['errorMsg'];if(_0x39be1e){const _0x1aa598=Array['isArray'](_0xf0204)?_0xf0204['length']:0x0;return{'success':!![],'execSuccess':!![],'execResult':_0xf0204||[],'rowCount':_0x1aa598,'message':_0x5891ae(0x162)+_0x1aa598+_0x5891ae(0x16a),'executionTime':_0x1ccf95,'sqlInfo':_0x13fd22};}return{'success':!![],'execSuccess':![],'execError':_0x1852fe||_0x5891ae(0x17e),'message':_0x5891ae(0x179)+(_0x1852fe||'Unknown\x20error'),'executionTime':_0x1ccf95,'sqlInfo':_0x13fd22};}catch(_0xa19522){const _0x82b660=Date['now']()-_0x3cf5f8;return{'success':![],'execSuccess':![],'execError':_0xa19522[_0x5891ae(0x16b)]||_0x5891ae(0x168),'message':_0x5891ae(0x16e)+(_0xa19522[_0x5891ae(0x16b)]||_0x5891ae(0x168)),'executionTime':_0x82b660,'sqlInfo':_0x13fd22};}}function a8_0x421e(_0x4e2a48,_0x4b5e58){_0x4e2a48=_0x4e2a48-0x15f;const _0x2bb1a2=a8_0x2bb1();let _0x421e2=_0x2bb1a2[_0x4e2a48];return _0x421e2;}function a8_0x2bb1(){const _0x414ab0=['SQL\x20execution\x20failed\x20without\x20error\x20message',']:\x20','243780FNkuMt','keys','success','SQL\x20executed\x20successfully.\x20Returned\x20','length','execResult','executeSql','now','UNKNOWN','Unknown\x20error','2901016MjajqR','\x20row(s).','message','data','1437945uBaUNL','API\x20call\x20failed:\x20','sqlCode\x20is\x20required.\x20Get\x20it\x20from\x20list_sql_queries\x20->\x20sqlCode','306QDLxoE','509529MniToy','370974QIgOAP','trim','3828984ZOMOix','ERR','7XNqokS','errorCode','4534320ZCeoAk','SQL\x20execution\x20failed:\x20','execSuccess','14ojbXhZ','msg','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.'];a8_0x2bb1=function(){return _0x414ab0;};return a8_0x2bb1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x88f3af,_0x919d7a){const _0x11846d=a9_0x42ff,_0x44fe75=_0x88f3af();while(!![]){try{const _0x1ddd21=parseInt(_0x11846d(0x186))/0x1+-parseInt(_0x11846d(0x17d))/0x2+-parseInt(_0x11846d(0x194))/0x3+parseInt(_0x11846d(0x18d))/0x4+parseInt(_0x11846d(0x190))/0x5*(-parseInt(_0x11846d(0x188))/0x6)+-parseInt(_0x11846d(0x182))/0x7+-parseInt(_0x11846d(0x17e))/0x8*(-parseInt(_0x11846d(0x18e))/0x9);if(_0x1ddd21===_0x919d7a)break;else _0x44fe75['push'](_0x44fe75['shift']());}catch(_0x272b57){_0x44fe75['push'](_0x44fe75['shift']());}}}(a9_0xb7d4,0x68928));import{DevApiClient}from'../api/dev-api-client.js';import{DrivenDataDetailPlus}from'@lovrabet/dsparser';function a9_0x42ff(_0x88cc9f,_0x5e59dc){_0x88cc9f=_0x88cc9f-0x179;const _0xb7d4=a9_0xb7d4();let _0x42ff4a=_0xb7d4[_0x88cc9f];return _0x42ff4a;}function a9_0xb7d4(){const _0x1e1fe1=['38493nlNklp','code','75agwiBh','\x20|\x20数据表:\x20','getOperationDocMeta','Cannot\x20generate\x20SDK\x20code\x20for\x20operation\x20\x27','1834338jMpjXo','generateFullSDKExample','responseExample','getDatasetSDKKey','getTableName','datasetCode','requestExample','//\x20数据集:\x20','toJSON','datasetCode\x20is\x20required','sdkCall','generateAliasExplanation','545894DeRyPI','2768IscpSJ','replace','getTableKey','\x27\x20in\x20dataset\x20\x27','5018363dBaSxX','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','data','name','432072FmwavZ','getModelAlias','71898VRCXPg','getDatasetDetail','getOperationAnalysis','getFieldList','generateSDKInitCode','1189844sXNpXV'];a9_0xb7d4=function(){return _0x1e1fe1;};return a9_0xb7d4();}import{getEnvAppCode,getEnvironment}from'../config/env.js';import{buildFieldRelationsMap,enrichFieldsWithRelations}from'../utils/relations.js';export async function generateSDKCode(_0x3784f8){const _0x374453=a9_0x42ff,{appCode:appCode=getEnvAppCode(),cookie:_0x498e4f,datasetCode:_0x3babe1,operationName:_0x177906,includeImports:includeImports=!![],useAlias:useAlias=![]}=_0x3784f8;if(!appCode)throw new Error(_0x374453(0x183));if(!_0x3babe1)throw new Error(_0x374453(0x17a));if(!_0x177906)throw new Error('operationName\x20is\x20required');const _0x170fe2=new DevApiClient({'appCode':appCode,'cookie':_0x498e4f}),_0x2bc754=getEnvironment(),_0x5ed117=await _0x170fe2[_0x374453(0x189)](_0x3babe1),_0x33ee7f=_0x5ed117[_0x374453(0x184)]||_0x5ed117,_0x533056=new DrivenDataDetailPlus(_0x33ee7f),_0x54ed78=_0x533056[_0x374453(0x192)](_0x177906);if(!_0x54ed78)throw new Error(_0x374453(0x193)+_0x177906+_0x374453(0x181)+_0x3babe1+'\x27');const _0x5036f4=_0x533056[_0x374453(0x197)](),_0x184890=_0x533056[_0x374453(0x187)](),_0x16c572=_0x533056[_0x374453(0x180)](),_0x4fed8e=_0x533056[_0x374453(0x198)](),_0x57dbc3=_0x533056[_0x374453(0x185)],_0x1096f1=_0x533056[_0x374453(0x18b)](),_0x576afe=_0x1096f1?.[_0x374453(0x179)]?.()||[],_0x266fdc=buildFieldRelationsMap(_0x5ed117),_0x1bd0bc=enrichFieldsWithRelations(_0x576afe,_0x266fdc),_0x17bc04=_0x533056[_0x374453(0x195)](_0x177906,appCode),_0x3b5082=_0x533056[_0x374453(0x18a)](_0x177906);let _0xc21c2b=_0x54ed78[_0x374453(0x17b)][_0x374453(0x18f)],_0x1cc2e3=_0x17bc04||undefined;useAlias&&(_0xc21c2b=_0xc21c2b[_0x374453(0x17f)](new RegExp(_0x5036f4,'g'),_0x184890),_0x1cc2e3&&(_0x1cc2e3=_0x1cc2e3[_0x374453(0x17f)](new RegExp(_0x5036f4,'g'),_0x184890)));const _0x4c2698=_0x374453(0x19b)+_0x57dbc3+_0x374453(0x191)+_0x4fed8e+'\x0a',_0x25216f=_0x4c2698+_0xc21c2b,_0x32f852=_0x1cc2e3?'//\x20数据集:\x20'+_0x57dbc3+_0x374453(0x191)+_0x4fed8e+'\x0a'+_0x1cc2e3:undefined;return{'appCode':appCode,'env':_0x2bc754,'datasetName':_0x57dbc3,'language':'typescript','code':_0x25216f,'fullExample':includeImports?_0x32f852:undefined,'sdkCallInfo':{'modelName':_0x184890,'tableName':_0x4fed8e,'tableKey':_0x16c572,'datasetCode':_0x533056[_0x374453(0x199)],'operationName':_0x177906},'fields':_0x1bd0bc,'requestExample':_0x3b5082?.[_0x374453(0x19a)],'responseExample':_0x3b5082?.[_0x374453(0x196)],'sdkInitCode':_0x533056[_0x374453(0x18c)](_0x16c572),'usageExample':_0x54ed78['usageExample'],'aliasExplanation':useAlias?_0x533056[_0x374453(0x17c)]():undefined,'aliasHint':{'defaultAlias':_0x184890,'datasetSDKKey':_0x5036f4}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a10_0x3977(_0x59cde1,_0x42a1d8){_0x59cde1=_0x59cde1-0x85;const _0x234565=a10_0x2345();let _0x3977e1=_0x234565[_0x59cde1];return _0x3977e1;}(function(_0x5700cc,_0x32fb71){const _0x36d00e=a10_0x3977,_0x53e2f2=_0x5700cc();while(!![]){try{const _0x4d6f19=parseInt(_0x36d00e(0x85))/0x1*(parseInt(_0x36d00e(0xad))/0x2)+parseInt(_0x36d00e(0x9c))/0x3+-parseInt(_0x36d00e(0xa6))/0x4+parseInt(_0x36d00e(0x92))/0x5+-parseInt(_0x36d00e(0xa9))/0x6+parseInt(_0x36d00e(0xa5))/0x7+parseInt(_0x36d00e(0xb5))/0x8*(-parseInt(_0x36d00e(0x94))/0x9);if(_0x4d6f19===_0x32fb71)break;else _0x53e2f2['push'](_0x53e2f2['shift']());}catch(_0x43e19d){_0x53e2f2['push'](_0x53e2f2['shift']());}}}(a10_0x2345,0xf3dd6));import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode,getEnvironment}from'../config/env.js';export async function generateSqlCode(_0x563066){const _0x20ca78=a10_0x3977,{appCode:appCode=getEnvAppCode(),cookie:_0x2f0b45,sqlCode:_0x301fea,params:_0x466bcb,includeImports:includeImports=!![]}=_0x563066;if(!appCode)throw new Error(_0x20ca78(0x8e));if(!_0x301fea||_0x301fea[_0x20ca78(0x97)]()==='')return{'success':![],'sqlCode':'','sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[]},'error':_0x20ca78(0x9d)};const _0x8554c9=_0x301fea[_0x20ca78(0x97)](),_0x415dec=new DevApiClient({'appCode':appCode,'cookie':_0x2f0b45}),_0x38a572=getEnvironment();try{const _0x264214=await _0x415dec[_0x20ca78(0xa0)]({'pageSize':0x3e7,'currentPage':0x1,'sqlCode':_0x8554c9}),_0x190ea8=_0x264214[_0x20ca78(0xac)]?.[_0x20ca78(0x91)]||[],_0x112a27=_0x190ea8['find'](_0x1b934b=>_0x1b934b[_0x20ca78(0xa8)]===_0x8554c9||_0x1b934b['sqlCode']?.['includes'](_0x8554c9)||_0x8554c9[_0x20ca78(0x86)](_0x1b934b[_0x20ca78(0xa8)]));if(!_0x112a27)return{'success':![],'sqlCode':_0x8554c9,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x20ca78(0x8a)+_0x8554c9+_0x20ca78(0xa1),_0x20ca78(0x8d),_0x20ca78(0x9a)]},'error':_0x20ca78(0x8a)+_0x8554c9+_0x20ca78(0xa7)};const _0x5251bf=_0x112a27[_0x20ca78(0xa8)],_0x135d00=_0x112a27['sqlName']||_0x112a27[_0x20ca78(0x98)]||'SQL-'+(_0x112a27[_0x20ca78(0xb0)]||_0x112a27['id']),_0x1c9471=_0x112a27['sqlContent']||_0x112a27[_0x20ca78(0x88)]||'',_0x2b6c44=_0x1c9471[_0x20ca78(0x8f)](/[:$]\{?(\w+)\}?/g);let _0x167a4a,_0x28a9b6;if(_0x2b6c44){const _0x32876e=Array[_0x20ca78(0x93)](new Set(_0x2b6c44[_0x20ca78(0x8c)](_0x5c9fab=>_0x5c9fab[_0x20ca78(0xb4)](/[:${}]/g,''))));_0x167a4a=_0x32876e['map'](_0x43f6d4=>{const _0x3ef8eb=_0x466bcb?.[_0x43f6d4]??getDefaultExample(_0x43f6d4);return{'name':_0x43f6d4,'example':_0x3ef8eb};}),_0x28a9b6=_0x167a4a['reduce']((_0x582934,_0x32cff3)=>({..._0x582934,[_0x32cff3[_0x20ca78(0x98)]]:_0x32cff3[_0x20ca78(0x89)]}),{});}else _0x466bcb&&(_0x167a4a=Object[_0x20ca78(0x9e)](_0x466bcb)[_0x20ca78(0x8c)](([_0x57dd73,_0x34fd9c])=>({'name':_0x57dd73,'example':_0x34fd9c})),_0x28a9b6=_0x466bcb);const _0x17e553=_0x167a4a&&_0x167a4a[_0x20ca78(0xa3)]>0x0,_0x7d9456=_0x17e553?JSON[_0x20ca78(0xb9)](_0x28a9b6,null,0x2):'',_0x27cb46=(includeImports?_0x20ca78(0x90):'')+_0x20ca78(0x96)+appCode+_0x20ca78(0x87)+_0x38a572+_0x20ca78(0xaa)+_0x135d00+_0x20ca78(0xb3)+_0x5251bf+'\x27'+(_0x17e553?',\x20'+_0x7d9456:'')+_0x20ca78(0xaf);return{'success':!![],'sqlCode':_0x5251bf,'sqlName':_0x135d00,'sqlExists':!![],'code':_0x27cb46,'parameters':_0x167a4a,'usage':{'description':_0x20ca78(0x9f)+_0x135d00,'important':[_0x20ca78(0x8a)+_0x5251bf+_0x20ca78(0xab),_0x20ca78(0xba),'Always\x20check\x20execSuccess\x20before\x20using\x20execResult',_0x17e553?'This\x20SQL\x20requires\x20parameters:\x20'+_0x167a4a['map'](_0x32ddad=>_0x32ddad[_0x20ca78(0x98)])[_0x20ca78(0x8b)](',\x20'):_0x20ca78(0xb6),_0x20ca78(0x9b)]}};}catch(_0x10ba13){return{'success':![],'sqlCode':_0x8554c9,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x20ca78(0xae)+_0x10ba13[_0x20ca78(0xb8)],_0x20ca78(0x8d)]},'error':_0x20ca78(0xae)+_0x10ba13['message']};}}function getDefaultExample(_0x4be614){const _0x557ff8=a10_0x3977,_0x19817c=_0x4be614[_0x557ff8(0xa2)]();if(_0x19817c[_0x557ff8(0x86)]('date')||_0x19817c[_0x557ff8(0x86)](_0x557ff8(0xb7)))return _0x557ff8(0x99);if(_0x19817c['includes']('id'))return 0x7b;if(_0x19817c[_0x557ff8(0x86)](_0x557ff8(0xb2))||_0x19817c['includes'](_0x557ff8(0xa4))||_0x19817c[_0x557ff8(0x86)]('size'))return 0xa;if(_0x19817c[_0x557ff8(0x86)]('page'))return 0x1;if(_0x19817c[_0x557ff8(0x86)]('keyword')||_0x19817c[_0x557ff8(0x86)](_0x557ff8(0x95))||_0x19817c['includes'](_0x557ff8(0x98)))return _0x557ff8(0x89);if(_0x19817c[_0x557ff8(0x86)](_0x557ff8(0xb1)))return 0x1;return'value';}function a10_0x2345(){const _0x439af8=['7307232jMKEFT','\x27,\x0a});\x0a\x0a//\x20Execute\x20SQL:\x20','\x22\x20exists\x20and\x20is\x20valid.','data','704698SKVZnW','Failed\x20to\x20verify\x20SQL\x20code:\x20',');\x0a\x0a//\x20IMPORTANT:\x20Check\x20execution\x20status\x20before\x20using\x20results\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(`SQL\x20execution\x20failed:\x20${data.execError\x20||\x20\x27Unknown\x20error\x27}`);\x0a}\x0a\x0a//\x20Process\x20the\x20results\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0aconsole.log(`Retrieved\x20${results.length}\x20rows`);\x0a\x0a//\x20Use\x20the\x20data\x0aresults.forEach((row:\x20any)\x20=>\x20{\x0a\x20\x20console.log(row);\x0a});','sqlId','status','limit','\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27','replace','1864audhnP','This\x20SQL\x20does\x20not\x20require\x20any\x20parameters','time','message','stringify','SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[],\x20execError?:\x20string\x20}','4KsuaGk','includes','\x27,\x0a\x20\x20env:\x20\x27','sql','example','SQL\x20code\x20\x22','join','map','Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','match','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a','tableData','6566525ReOKAi','from','58419qTxmLm','search','//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27','trim','name','2024-01-01','Check\x20the\x20sqlCode\x20from\x20list_sql_queries\x20result\x20and\x20use\x20the\x20exact\x20value.','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20exception\x20-\x20use\x20try-catch','2935557wZCrwX','sqlCode\x20is\x20required','entries','Generated\x20code\x20for\x20executing\x20custom\x20SQL:\x20','getCustomSqlList','\x22\x20not\x20found\x20in\x20the\x20application.','toLowerCase','length','count','13558734DvFMwG','7636148IGmmGn','\x22\x20does\x20not\x20exist.\x20Use\x20list_sql_queries\x20to\x20find\x20valid\x20SQL\x20codes.','sqlCode'];a10_0x2345=function(){return _0x439af8;};return a10_0x2345();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1a8414,_0x17735c){const _0x522979=a11_0x3217,_0x2dd995=_0x1a8414();while(!![]){try{const _0x972102=parseInt(_0x522979(0x1e0))/0x1+parseInt(_0x522979(0x1e1))/0x2*(parseInt(_0x522979(0x1db))/0x3)+parseInt(_0x522979(0x1e8))/0x4+parseInt(_0x522979(0x1de))/0x5+-parseInt(_0x522979(0x1e2))/0x6+-parseInt(_0x522979(0x1df))/0x7*(parseInt(_0x522979(0x1dd))/0x8)+parseInt(_0x522979(0x1e9))/0x9*(parseInt(_0x522979(0x1e7))/0xa);if(_0x972102===_0x17735c)break;else _0x2dd995['push'](_0x2dd995['shift']());}catch(_0xe36a5b){_0x2dd995['push'](_0x2dd995['shift']());}}}(a11_0x407b,0x88896));function a11_0x3217(_0x372d06,_0x1e5dfb){_0x372d06=_0x372d06-0x1db;const _0x407bed=a11_0x407b();let _0x321797=_0x407bed[_0x372d06];return _0x321797;}import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode}from'../config/env.js';export async function getBffScriptInfo(_0xa6d67e){const _0x3976c0=a11_0x3217,{appCode:appCode=getEnvAppCode(),cookie:_0xd78695,id:_0x332b3c}=_0xa6d67e;if(!appCode)throw new Error('appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.');if(!_0x332b3c||_0x332b3c<=0x0)throw new Error(_0x3976c0(0x1dc));const _0x212f68=new DevApiClient({'appCode':appCode,'cookie':_0xd78695}),_0x169106=await _0x212f68[_0x3976c0(0x1e4)](_0x332b3c);if(!_0x169106[_0x3976c0(0x1e6)]||!_0x169106[_0x3976c0(0x1e3)])return{'success':![],'message':_0x3976c0(0x1e5)+_0x332b3c};return{'success':!![],'script':_0x169106[_0x3976c0(0x1e3)]};}function a11_0x407b(){const _0x250763=['success','9291800EMoLGJ','963924lIkDzL','9uMMyFo','253698DtAHLC','id\x20is\x20required\x20and\x20must\x20be\x20a\x20positive\x20number.\x20Get\x20it\x20from\x20list_bff_scripts.','147368BwVdub','3108805hsLMlX','364OUTLGd','292818jhgThq','2EBUldT','3912960zhKMrf','data','getBffScriptInfo','Failed\x20to\x20fetch\x20Backend\x20Function\x20script\x20info\x20for\x20id:\x20'];a11_0x407b=function(){return _0x250763;};return a11_0x407b();}
|