@lovrabet/dataset-mcp-server 1.3.10 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/api-url-resolver.js +1 -0
- package/dist/config/env.js +1 -1
- package/dist/config/lovrabet-config.js +1 -0
- 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 -1
- package/dist/utils/sql-meta.js +1 -0
- package/dist/utils/sql-parser.js +1 -1
- package/package.json +1 -1
package/dist/api/cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a0_0x735b46=a0_0x3813;(function(_0x5753ec,_0x290fca){const _0x708665=a0_0x3813,_0x11ea47=_0x5753ec();while(!![]){try{const _0x5cad62=-parseInt(_0x708665(0x153))/0x1*(parseInt(_0x708665(0x150))/0x2)+-parseInt(_0x708665(0x151))/0x3+-parseInt(_0x708665(0x15e))/0x4*(-parseInt(_0x708665(0x161))/0x5)+-parseInt(_0x708665(0x156))/0x6*(-parseInt(_0x708665(0x157))/0x7)+-parseInt(_0x708665(0x154))/0x8+parseInt(_0x708665(0x158))/0x9*(parseInt(_0x708665(0x164))/0xa)+parseInt(_0x708665(0x152))/0xb*(-parseInt(_0x708665(0x15d))/0xc);if(_0x5cad62===_0x290fca)break;else _0x11ea47['push'](_0x11ea47['shift']());}catch(_0x210ba2){_0x11ea47['push'](_0x11ea47['shift']());}}}(a0_0x8d8e,0xa03d4));export class SimpleCache{[a0_0x735b46(0x15f)]=new Map();['defaultTTL'];constructor(_0x43b5f6=0x5){const _0x15cda6=a0_0x735b46;this[_0x15cda6(0x165)]=_0x43b5f6*0x3c*0x3e8;}[a0_0x735b46(0x15b)](_0x30e7e7){const _0x568cca=a0_0x735b46,_0x5373e1=this[_0x568cca(0x15f)][_0x568cca(0x15b)](_0x30e7e7);if(!_0x5373e1)return null;const _0x38274c=Date['now'](),_0x34d0fa=_0x38274c-_0x5373e1[_0x568cca(0x160)];if(_0x34d0fa>this[_0x568cca(0x165)])return this[_0x568cca(0x15f)][_0x568cca(0x14f)](_0x30e7e7),null;const _0x5665e3=Math[_0x568cca(0x159)](_0x34d0fa/0x3e8);return _0x5373e1['data'];}['set'](_0x3a3783,_0x395f8b){const _0x3df055=a0_0x735b46;this[_0x3df055(0x15f)][_0x3df055(0x163)](_0x3a3783,{'data':_0x395f8b,'timestamp':Date[_0x3df055(0x162)]()});}[a0_0x735b46(0x15c)](_0x33fb28){const _0x3f21b1=a0_0x735b46;_0x33fb28?this['cache'][_0x3f21b1(0x14f)](_0x33fb28):this['cache']['clear']();}[a0_0x735b46(0x155)](){const _0x5af561=a0_0x735b46;return{'size':this[_0x5af561(0x15f)]['size'],'ttlMinutes':this[_0x5af561(0x165)]/0xea60,'entries':Array[_0x5af561(0x15a)](this[_0x5af561(0x15f)]['keys']())};}}function a0_0x3813(_0x30df39,_0x12dc21){_0x30df39=_0x30df39-0x14f;const _0x8d8eaf=a0_0x8d8e();let _0x381322=_0x8d8eaf[_0x30df39];return _0x381322;}function a0_0x8d8e(){const _0x26bc04=['clear','2964JdwpGa','1364RjpUZp','cache','timestamp','16935QIfodd','now','set','1350BlvCxT','defaultTTL','delete','4706YGjhCF','1395429njugIi','23441iwVylu','57FKxCNI','9947776qkhWbM','getStats','877362SCiblP','56aslBJS','46710cnvDUX','floor','from','get'];a0_0x8d8e=function(){return _0x26bc04;};return a0_0x8d8e();}export const apiCache=new SimpleCache(0x5);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a1_0x51ca(_0x45b5e7,_0x4258e7){_0x45b5e7=_0x45b5e7-0x198;const _0xa327cf=a1_0xa327();let _0x51ca57=_0xa327cf[_0x45b5e7];return _0x51ca57;}const a1_0x3fa1cd=a1_0x51ca;(function(_0x5ef0d6,_0x49b3f4){const _0x1d5c33=a1_0x51ca,_0x4f7982=_0x5ef0d6();while(!![]){try{const _0x3ad5a5=parseInt(_0x1d5c33(0x1a0))/0x1+parseInt(_0x1d5c33(0x1d4))/0x2+parseInt(_0x1d5c33(0x199))/0x3+parseInt(_0x1d5c33(0x1c8))/0x4*(parseInt(_0x1d5c33(0x1aa))/0x5)+parseInt(_0x1d5c33(0x19c))/0x6+parseInt(_0x1d5c33(0x1d7))/0x7*(-parseInt(_0x1d5c33(0x1f5))/0x8)+-parseInt(_0x1d5c33(0x1c6))/0x9;if(_0x3ad5a5===_0x49b3f4)break;else _0x4f7982['push'](_0x4f7982['shift']());}catch(_0x381cdc){_0x4f7982['push'](_0x4f7982['shift']());}}}(a1_0xa327,0x929da));import{getCookie}from'../auth/cookie-manager.js';function a1_0xa327(){const _0x2cc141=['getDatasetRelations','sqlCode','appCode','pageSize','scriptType','getAllErConfigs','description','705LMsirN','/api/custom/executeSql','tableData','toDatasetName','currentPage','getCustomSqlList','runtimeBaseUrl','params','/api/management/script/cache/clear','success','DEFAULT_TIMEOUT','application/json','scriptContent','find','clearBffScriptCache','warn','getErConfig','set','status','API\x20error:\x20','API\x20request\x20failed:\x20HTTP\x20','dataset-detail:','online','apiDomain','relations','toDataset','getDatasetDetail','ms.\x20The\x20server\x20may\x20be\x20down\x20or\x20unreachable.\x0aURL:\x20','14290434KGeJPg','API\x20request\x20timeout\x20after\x20','11812xWMRCG','forceRefresh','searchDatasets','\x0aURL:\x20','isArray','includes','dataset-list:','sqlName','saveBffScript','getBffScriptList','modelCode','length','1490938CjArQb','datasetCode','/smartapi/dataset/get-driven-data?','3248DnBJVp','getUniqueDbIds','/smartapi/custom/updateUserCustomSql','with-relations','no-relations','GET','saveUserCustomSql','get','Network\x20error:\x20Unable\x20to\x20connect\x20to\x20the\x20server.\x20Please\x20check\x20your\x20network\x20connection\x20or\x20the\x20server\x20may\x20be\x20down.\x0aURL:\x20','updateUserCustomSql','Content-Type','process','_request','data','getDatasetList','signal','postRequest','/smartapi/dataset/get-dataset-list','dbtableConfig','apiBaseUrl','POST','/smartapi/custom/queryUserCustomSqlList','er-configs-all:','fromField','push','sqlContent','mcp:vibe','test','filter','Authentication\x20failed.\x20Please\x20login\x20again.','1864sGRqzi','name','datasetName','cookie','er-config:','dbId','message','doVersion','add','toLowerCase','/api/management/library/scripts/save','LOVRABET_ENV','/smartapi/question/er-config','object','Unknown\x20error','from','847128eFJlSo','env','datasets','357336ddZnul','meta','toField','runtimeDomain','792702yICtod','No\x20authentication\x20cookie\x20found.\x20Please\x20login\x20first.','/api/management/library/scripts/list?appCode='];a1_0xa327=function(){return _0x2cc141;};return a1_0xa327();}import{getEffectiveApiDomain,getEffectiveRuntimeDomain}from'../auth/constants.js';import{apiCache}from'./cache.js';export class DevApiClient{['appCode'];['env'];[a1_0x3fa1cd(0x1f8)];[a1_0x3fa1cd(0x1c1)];[a1_0x3fa1cd(0x19f)];constructor(_0x255f1e){const _0x481251=a1_0x3fa1cd;this[_0x481251(0x1a5)]=_0x255f1e[_0x481251(0x1a5)],this['env']=globalThis[_0x481251(0x1e2)]?.[_0x481251(0x19a)]?.[_0x481251(0x200)]||_0x481251(0x1c0),this[_0x481251(0x1f8)]=_0x255f1e['cookie']||getCookie(),this[_0x481251(0x1c1)]=_0x255f1e[_0x481251(0x1ea)]||getEffectiveApiDomain(),this[_0x481251(0x19f)]=_0x255f1e[_0x481251(0x1b0)]||getEffectiveRuntimeDomain();if(!this[_0x481251(0x1f8)])throw new Error(_0x481251(0x1a1));}static ['DEFAULT_TIMEOUT']=0x7530;async[a1_0x3fa1cd(0x1e3)](_0x6358f9,_0x53e181={},_0x150263=DevApiClient[a1_0x3fa1cd(0x1b4)]){const _0x519317=a1_0x3fa1cd,{method:method=_0x519317(0x1dc),body:_0x4a4236}=_0x53e181,_0x252960=new AbortController(),_0x520d86=setTimeout(()=>_0x252960['abort'](),_0x150263),_0x404f64={'Cookie':this[_0x519317(0x1f8)],'X-Invoke-Source':_0x519317(0x1f1)};method===_0x519317(0x1eb)&&(_0x404f64[_0x519317(0x1e1)]=_0x519317(0x1b5));try{const _0x2c2ed1=await fetch(_0x6358f9,{'method':method,'headers':_0x404f64,..._0x4a4236!==undefined&&{'body':JSON['stringify'](_0x4a4236)},'signal':_0x252960[_0x519317(0x1e6)]});clearTimeout(_0x520d86);if(!_0x2c2ed1['ok']){if(_0x2c2ed1[_0x519317(0x1bc)]===0x191)throw new Error(_0x519317(0x1f4));let _0x3fac66='';try{_0x3fac66=await _0x2c2ed1['text']();}catch{}throw new Error(_0x519317(0x1be)+_0x2c2ed1[_0x519317(0x1bc)]+_0x519317(0x1cb)+_0x6358f9+(_0x3fac66?'\x0a'+_0x3fac66:''));}const _0x237495=await _0x2c2ed1['json']();if(_0x237495&&typeof _0x237495===_0x519317(0x202)&&_0x519317(0x1b3)in _0x237495&&!_0x237495[_0x519317(0x1b3)]){const _0x5134e6=_0x237495;throw new Error(_0x519317(0x1bd)+(_0x5134e6[_0x519317(0x1fb)]||_0x5134e6['errorMsg']||_0x519317(0x203)));}return _0x237495;}catch(_0x1d79e5){if(_0x1d79e5 instanceof Error&&_0x1d79e5[_0x519317(0x1f6)]==='AbortError')throw new Error(_0x519317(0x1c7)+_0x150263+_0x519317(0x1c5)+_0x6358f9);if(_0x1d79e5 instanceof TypeError)throw new Error(_0x519317(0x1df)+_0x6358f9);throw _0x1d79e5;}}async['request'](_0x4d873f,_0x5c8b39){const _0x204bc2=a1_0x3fa1cd;return this[_0x204bc2(0x1e3)](_0x4d873f,{'method':_0x204bc2(0x1dc)},_0x5c8b39);}async[a1_0x3fa1cd(0x1e7)](_0x583f6b,_0x6c0e11,_0x15ea32){const _0x3fa6f0=a1_0x3fa1cd;return this[_0x3fa6f0(0x1e3)](_0x583f6b,{'method':_0x3fa6f0(0x1eb),'body':_0x6c0e11},_0x15ea32);}async[a1_0x3fa1cd(0x1e5)](_0x27bba2){const _0x5bf963=a1_0x3fa1cd,_0x3326b4=_0x27bba2?.[_0x5bf963(0x1c9)]||![],_0x1741b1=_0x5bf963(0x1ce)+this[_0x5bf963(0x1a5)]+':'+this['env'];if(!_0x3326b4){const _0x476af1=apiCache['get'](_0x1741b1);if(_0x476af1)return _0x476af1;}const _0x36f167=this[_0x5bf963(0x1c1)]+_0x5bf963(0x1e8),_0x38943a=await this[_0x5bf963(0x1e7)](_0x36f167,{'appCode':this['appCode']});return apiCache[_0x5bf963(0x1bb)](_0x1741b1,_0x38943a),_0x38943a;}async[a1_0x3fa1cd(0x1c4)](_0x153dc7,_0xa42c58=![],_0x2a07d1=![]){const _0x59b8a1=a1_0x3fa1cd,_0x9e295c=_0x59b8a1(0x1bf)+this[_0x59b8a1(0x1a5)]+':'+this[_0x59b8a1(0x19a)]+':'+_0x153dc7+':'+(_0x2a07d1?_0x59b8a1(0x1da):_0x59b8a1(0x1db));if(!_0xa42c58){const _0x6d4f66=apiCache[_0x59b8a1(0x1de)](_0x9e295c);if(_0x6d4f66)return _0x6d4f66;}const _0x3667ce=/^\d+$/[_0x59b8a1(0x1f2)](_0x153dc7),_0x54e68b=_0x3667ce?'id':'code',_0xe465a0=this[_0x59b8a1(0x1c1)]+_0x59b8a1(0x1d6)+_0x54e68b+'='+_0x153dc7,_0x455596=await this['request'](_0xe465a0);if(_0x2a07d1&&_0x455596[_0x59b8a1(0x1e4)]?.['modelCode']){const _0x30de24=_0x455596[_0x59b8a1(0x1e4)][_0x59b8a1(0x1fc)]==='v2',_0x5c0c79=Array[_0x59b8a1(0x1cc)](_0x455596[_0x59b8a1(0x1e4)][_0x59b8a1(0x1c2)]);if(!_0x30de24||!_0x5c0c79)try{const _0x53e231=await this[_0x59b8a1(0x1a3)](_0x455596[_0x59b8a1(0x1e4)][_0x59b8a1(0x1d2)],_0xa42c58);_0x455596[_0x59b8a1(0x1e4)]['relations']=_0x53e231;}catch(_0x385ff3){process[_0x59b8a1(0x19a)]['NODE_ENV']!==_0x59b8a1(0x1f2)&&console[_0x59b8a1(0x1b9)]('[getDatasetDetail]\x20Failed\x20to\x20fetch\x20relations\x20for\x20'+_0x153dc7+':',_0x385ff3);}}return apiCache[_0x59b8a1(0x1bb)](_0x9e295c,_0x455596),_0x455596;}async[a1_0x3fa1cd(0x1ca)](_0x2d823d){const _0x375dbb=a1_0x3fa1cd,_0x5073f4=await this[_0x375dbb(0x1e5)](),_0x18e789=Array[_0x375dbb(0x1cc)](_0x5073f4[_0x375dbb(0x1e4)])?_0x5073f4[_0x375dbb(0x1e4)]:_0x5073f4[_0x375dbb(0x1e4)]?.[_0x375dbb(0x1ac)]||[];if(!_0x5073f4['success'])return{'success':!![],'data':{'tableData':[]}};const _0x48f401=_0x18e789[_0x375dbb(0x1f3)](_0x18b054=>{const _0x17d2a4=_0x375dbb,_0x5c6975=_0x2d823d[_0x17d2a4(0x1fe)]();return _0x18b054[_0x17d2a4(0x1f6)]?.['toLowerCase']()[_0x17d2a4(0x1cd)](_0x5c6975)||_0x18b054['code']?.[_0x17d2a4(0x1fe)]()[_0x17d2a4(0x1cd)](_0x5c6975)||_0x18b054[_0x17d2a4(0x1e9)]?.['tableName']?.['toLowerCase']()[_0x17d2a4(0x1cd)](_0x5c6975)||_0x18b054[_0x17d2a4(0x1a9)]?.[_0x17d2a4(0x1fe)]()[_0x17d2a4(0x1cd)](_0x5c6975);});return{'success':!![],'data':{'tableData':_0x48f401,'paging':{'totalCount':_0x48f401['length'],'currentPage':0x1,'pageSize':_0x48f401[_0x375dbb(0x1d3)]}}};}async[a1_0x3fa1cd(0x1af)](_0xc75cc4){const _0x2bae81=a1_0x3fa1cd,_0xd2143e=_0xc75cc4?.[_0x2bae81(0x1ae)]||0x1,_0x13d57b=_0xc75cc4?.[_0x2bae81(0x1a6)]||0x3e7,_0x5ba8bc=this[_0x2bae81(0x1c1)]+_0x2bae81(0x1ec),_0x1eba42={'appCode':this[_0x2bae81(0x1a5)],'currentPage':_0xd2143e,'pageSize':_0x13d57b,..._0xc75cc4?.[_0x2bae81(0x1a4)]&&{'sqlCode':_0xc75cc4[_0x2bae81(0x1a4)]},..._0xc75cc4?.['sqlName']&&{'sqlName':_0xc75cc4[_0x2bae81(0x1cf)]}},_0x5109e6=await this[_0x2bae81(0x1e7)](_0x5ba8bc,_0x1eba42);return _0x5109e6;}async['executeSql'](_0x44e3f9){const _0x5c8f38=a1_0x3fa1cd,_0x43d8c2=this[_0x5c8f38(0x19f)]+_0x5c8f38(0x1ab),_0x55e6e2={'appCode':this[_0x5c8f38(0x1a5)],'sqlCode':_0x44e3f9[_0x5c8f38(0x1a4)],..._0x44e3f9[_0x5c8f38(0x1b1)]&&{'params':_0x44e3f9[_0x5c8f38(0x1b1)]}};return await this[_0x5c8f38(0x1e7)](_0x43d8c2,_0x55e6e2);}async[a1_0x3fa1cd(0x1dd)](_0x2195fe){const _0x1b3d19=a1_0x3fa1cd,_0x12f91b=this[_0x1b3d19(0x1c1)]+'/smartapi/custom/saveUserCustomSql',_0x5837ed={'sqlName':_0x2195fe['sqlName'],'dbId':_0x2195fe[_0x1b3d19(0x1fa)],'sqlContent':_0x2195fe[_0x1b3d19(0x1f0)],'appCode':this[_0x1b3d19(0x1a5)]};return await this[_0x1b3d19(0x1e7)](_0x12f91b,_0x5837ed);}async[a1_0x3fa1cd(0x1e0)](_0x4f5279){const _0x1692c4=a1_0x3fa1cd,_0x5520fe=this[_0x1692c4(0x1c1)]+_0x1692c4(0x1d9),_0x1d0c5a={'id':_0x4f5279['id'],'dbId':_0x4f5279[_0x1692c4(0x1fa)],'sqlName':_0x4f5279[_0x1692c4(0x1cf)],'appCode':this[_0x1692c4(0x1a5)],'sqlContent':_0x4f5279['sqlContent']};return await this[_0x1692c4(0x1e7)](_0x5520fe,_0x1d0c5a);}async[a1_0x3fa1cd(0x1ba)](_0x9eb3e9,_0x1ad934=![]){const _0x483d4d=a1_0x3fa1cd,_0x4c9672=_0x483d4d(0x1f9)+this[_0x483d4d(0x1a5)]+':'+this[_0x483d4d(0x19a)]+':'+_0x9eb3e9;if(!_0x1ad934){const _0x521a15=apiCache[_0x483d4d(0x1de)](_0x4c9672);if(_0x521a15)return _0x521a15;}const _0x6097ee=this[_0x483d4d(0x1c1)]+_0x483d4d(0x201),_0xd723b6=await this['postRequest'](_0x6097ee,{'dblinkId':_0x9eb3e9,'appCode':this['appCode']});if(!_0xd723b6[_0x483d4d(0x1b3)]||!_0xd723b6[_0x483d4d(0x1e4)])throw new Error('Failed\x20to\x20get\x20ER\x20config\x20for\x20dblinkId:\x20'+_0x9eb3e9);const _0x35ad9e={'meta':_0xd723b6[_0x483d4d(0x1e4)][_0x483d4d(0x19d)],'datasets':_0xd723b6[_0x483d4d(0x1e4)][_0x483d4d(0x19b)]};return apiCache[_0x483d4d(0x1bb)](_0x4c9672,_0x35ad9e),_0x35ad9e;}async[a1_0x3fa1cd(0x1d8)](_0x601365=![]){const _0x29e6b6=a1_0x3fa1cd,_0x569da6=await this[_0x29e6b6(0x1e5)]({'forceRefresh':_0x601365}),_0x10de56=Array[_0x29e6b6(0x1cc)](_0x569da6[_0x29e6b6(0x1e4)])?_0x569da6[_0x29e6b6(0x1e4)]:_0x569da6[_0x29e6b6(0x1e4)]?.[_0x29e6b6(0x1ac)]||[],_0x1b6fcb=new Set();for(const _0x3a8b41 of _0x10de56){_0x3a8b41[_0x29e6b6(0x1e9)]?.[_0x29e6b6(0x1fa)]&&_0x1b6fcb[_0x29e6b6(0x1fd)](_0x3a8b41['dbtableConfig'][_0x29e6b6(0x1fa)]);}return Array[_0x29e6b6(0x198)](_0x1b6fcb)['sort']((_0x1335a9,_0x1de15e)=>_0x1335a9-_0x1de15e);}async[a1_0x3fa1cd(0x1a8)](_0x5d64f3=![]){const _0xf36e16=a1_0x3fa1cd,_0x1643bb=_0xf36e16(0x1ed)+this[_0xf36e16(0x1a5)]+':'+this[_0xf36e16(0x19a)];if(!_0x5d64f3){const _0x336735=apiCache[_0xf36e16(0x1de)](_0x1643bb);if(_0x336735)return _0x336735;}const _0x315f91=await this[_0xf36e16(0x1d8)](_0x5d64f3),_0x3451a2=new Map();for(const _0xc33c6c of _0x315f91){try{const _0x2789b1=await this[_0xf36e16(0x1ba)](_0xc33c6c,_0x5d64f3);_0x3451a2[_0xf36e16(0x1bb)](_0xc33c6c,_0x2789b1);}catch(_0x610cd8){console[_0xf36e16(0x1b9)]('Failed\x20to\x20get\x20ER\x20config\x20for\x20dbId\x20'+_0xc33c6c+':',_0x610cd8);}}return apiCache[_0xf36e16(0x1bb)](_0x1643bb,_0x3451a2),_0x3451a2;}async[a1_0x3fa1cd(0x1a3)](_0x1b85ab,_0x39eb49=![]){const _0x1b05e7=a1_0x3fa1cd,_0x5eb75c=await this[_0x1b05e7(0x1a8)](_0x39eb49),_0x4b80ae=[],_0x33d673=[];for(const [,_0x2df8dd]of _0x5eb75c){const _0x4bf289=_0x2df8dd[_0x1b05e7(0x19b)][_0x1b05e7(0x1b7)](_0x57c776=>_0x57c776['datasetCode']===_0x1b85ab);if(_0x4bf289)for(const _0x172890 of _0x4bf289[_0x1b05e7(0x1c2)]||[]){_0x4b80ae['push']({'toDataset':_0x172890[_0x1b05e7(0x1c3)],'toDatasetName':_0x172890[_0x1b05e7(0x1ad)],'toField':_0x172890[_0x1b05e7(0x19e)],'fromField':_0x172890[_0x1b05e7(0x1ee)],'joinType':_0x172890['joinType']});}for(const _0x48400f of _0x2df8dd[_0x1b05e7(0x19b)]){if(_0x48400f[_0x1b05e7(0x1d5)]===_0x1b85ab)continue;for(const _0xa8517c of _0x48400f[_0x1b05e7(0x1c2)]||[]){_0xa8517c[_0x1b05e7(0x1c3)]===_0x1b85ab&&_0x33d673[_0x1b05e7(0x1ef)]({'fromDataset':_0x48400f[_0x1b05e7(0x1d5)],'fromDatasetName':_0x48400f[_0x1b05e7(0x1f7)],'fromField':_0xa8517c[_0x1b05e7(0x1ee)],'toField':_0xa8517c[_0x1b05e7(0x19e)],'joinType':_0xa8517c['joinType']});}}}return{'outgoing':_0x4b80ae,'incoming':_0x33d673};}async[a1_0x3fa1cd(0x1d1)](){const _0x5aec13=a1_0x3fa1cd,_0xdae18d=this[_0x5aec13(0x1c1)]+_0x5aec13(0x1a2)+encodeURIComponent(this[_0x5aec13(0x1a5)])+'&type=ENDPOINT';return await this['request'](_0xdae18d);}async['getBffScriptInfo'](_0x3cb809){const _0x41e81e=this['apiDomain']+'/api/management/library/scripts/info?id='+_0x3cb809;return await this['request'](_0x41e81e);}async[a1_0x3fa1cd(0x1d0)](_0x5a5f81){const _0x2514cb=a1_0x3fa1cd,_0x1a2649=this[_0x2514cb(0x1c1)]+_0x2514cb(0x1ff),_0x440641={'id':_0x5a5f81['id']??null,'appCode':_0x5a5f81['appCode'],'description':_0x5a5f81['description'],'scriptContent':_0x5a5f81[_0x2514cb(0x1b6)],'scriptType':_0x5a5f81[_0x2514cb(0x1a7)]};return await this[_0x2514cb(0x1e7)](_0x1a2649,_0x440641);}async[a1_0x3fa1cd(0x1b8)](){const _0x53e7cd=a1_0x3fa1cd,_0x2302a5=this[_0x53e7cd(0x19f)]+_0x53e7cd(0x1b2);return await this['postRequest'](_0x2302a5,{});}}
|
|
1
|
+
const a1_0x35b167=a1_0x16cb;(function(_0xce2897,_0x40b635){const _0x5d52df=a1_0x16cb,_0xa3c2fe=_0xce2897();while(!![]){try{const _0xfb6bf8=parseInt(_0x5d52df(0x110))/0x1*(parseInt(_0x5d52df(0xc3))/0x2)+parseInt(_0x5d52df(0xd0))/0x3*(-parseInt(_0x5d52df(0xd3))/0x4)+-parseInt(_0x5d52df(0x124))/0x5*(-parseInt(_0x5d52df(0xde))/0x6)+parseInt(_0x5d52df(0x121))/0x7+parseInt(_0x5d52df(0xd2))/0x8*(-parseInt(_0x5d52df(0xf3))/0x9)+-parseInt(_0x5d52df(0x122))/0xa*(parseInt(_0x5d52df(0x11f))/0xb)+parseInt(_0x5d52df(0xe4))/0xc*(parseInt(_0x5d52df(0x129))/0xd);if(_0xfb6bf8===_0x40b635)break;else _0xa3c2fe['push'](_0xa3c2fe['shift']());}catch(_0x28f254){_0xa3c2fe['push'](_0xa3c2fe['shift']());}}}(a1_0x9e2c,0x1cdbf));import{getCookie}from'../auth/cookie-manager.js';import{getEffectiveApiDomain,getEffectiveRuntimeDomain,resolveApiBaseUrl}from'../auth/constants.js';function a1_0x16cb(_0x472f78,_0x556763){_0x472f78=_0x472f78-0xc1;const _0x9e2c90=a1_0x9e2c();let _0x16cbb9=_0x9e2c90[_0x472f78];return _0x16cbb9;}import{apiCache}from'./cache.js';export class DevApiClient{[a1_0x35b167(0x116)];[a1_0x35b167(0xe9)];['cookie'];[a1_0x35b167(0x125)];[a1_0x35b167(0x105)];[a1_0x35b167(0x12c)];constructor(_0x85c9b1){const _0x2efd0b=a1_0x35b167;this[_0x2efd0b(0x116)]=_0x85c9b1[_0x2efd0b(0x116)],this[_0x2efd0b(0xe9)]=globalThis[_0x2efd0b(0xcc)]?.[_0x2efd0b(0xe9)]?.['LOVRABET_ENV']||_0x2efd0b(0x102),this[_0x2efd0b(0x10b)]=_0x85c9b1[_0x2efd0b(0x10b)]||getCookie(),this[_0x2efd0b(0x125)]=_0x85c9b1[_0x2efd0b(0xeb)]||getEffectiveApiDomain(),this[_0x2efd0b(0x105)]=_0x85c9b1[_0x2efd0b(0x135)]||getEffectiveRuntimeDomain(),this[_0x2efd0b(0x12c)]=_0x85c9b1[_0x2efd0b(0x103)];if(!this[_0x2efd0b(0x10b)])throw new Error('No\x20authentication\x20cookie\x20found.\x20Please\x20login\x20first.');}[a1_0x35b167(0x12d)](_0x5cd58b,_0x372898){const _0x3216ad=a1_0x35b167,_0x2fbd7=resolveApiBaseUrl(_0x5cd58b),_0x5ab9a1=this['toolboxBaseUrlOverride']&&_0x2fbd7===getEffectiveApiDomain()?this[_0x3216ad(0x12c)]:_0x2fbd7;try{const _0x447bad=new URL(_0x5ab9a1);if(_0x447bad['pathname']!=='/')return _0x5ab9a1;}catch{}return''+_0x5ab9a1+_0x372898;}static ['DEFAULT_TIMEOUT']=0x7530;async[a1_0x35b167(0x11a)](_0x20f7e6,_0x20a644={},_0x2c9a9f=DevApiClient[a1_0x35b167(0xe6)]){const _0x230625=a1_0x35b167,{method:method=_0x230625(0xdf),body:_0x12ff7b,extraHeaders:_0x392f91}=_0x20a644,_0x4e210c=new AbortController(),_0x12ccd0=setTimeout(()=>_0x4e210c['abort'](),_0x2c9a9f),_0x5e51c1={'Cookie':this[_0x230625(0x10b)],'X-Invoke-Source':_0x230625(0x131),..._0x392f91};method===_0x230625(0xe8)&&(_0x5e51c1['Content-Type']='application/json');try{const _0x203a11=await fetch(_0x20f7e6,{'method':method,'headers':_0x5e51c1,..._0x12ff7b!==undefined&&{'body':JSON['stringify'](_0x12ff7b)},'signal':_0x4e210c['signal']});clearTimeout(_0x12ccd0);if(!_0x203a11['ok']){if(_0x203a11[_0x230625(0xe3)]===0x191)throw new Error(_0x230625(0x120));let _0x22a9f6='';try{_0x22a9f6=await _0x203a11[_0x230625(0xf7)]();}catch{}throw new Error(_0x230625(0x119)+_0x203a11[_0x230625(0xe3)]+_0x230625(0xc4)+_0x20f7e6+(_0x22a9f6?'\x0a'+_0x22a9f6:''));}const _0x4f672f=await _0x203a11['json']();if(_0x4f672f&&typeof _0x4f672f===_0x230625(0x132)&&_0x230625(0x12e)in _0x4f672f&&!_0x4f672f[_0x230625(0x12e)]){const _0x38b91a=_0x4f672f;throw new Error(_0x230625(0x100)+(_0x38b91a[_0x230625(0x133)]||_0x38b91a[_0x230625(0x107)]||'Unknown\x20error'));}return _0x4f672f;}catch(_0x560c83){if(_0x560c83 instanceof Error&&_0x560c83['name']===_0x230625(0xd7))throw new Error(_0x230625(0xec)+_0x2c9a9f+_0x230625(0x104)+_0x20f7e6);if(_0x560c83 instanceof TypeError)throw new Error(_0x230625(0xc8)+_0x20f7e6);throw _0x560c83;}}async[a1_0x35b167(0x118)](_0x2ee8de,_0x180ee7){return this['_request'](_0x2ee8de,{'method':'GET'},_0x180ee7);}async[a1_0x35b167(0xc7)](_0x1a7481,_0x6ce5a0,_0x4630d1,_0x337d7){const _0x3a6ad1=a1_0x35b167;return this[_0x3a6ad1(0x11a)](_0x1a7481,{'method':_0x3a6ad1(0xe8),'body':_0x6ce5a0,'extraHeaders':_0x337d7},_0x4630d1);}async['getDatasetList'](_0x49197b){const _0x54e169=a1_0x35b167,_0xe0cbe6=_0x49197b?.[_0x54e169(0xfc)]||![],_0x866667=_0x54e169(0x10e)+this['appCode']+':'+this[_0x54e169(0xe9)];if(!_0xe0cbe6){const _0x9cccfb=apiCache[_0x54e169(0xd6)](_0x866667);if(_0x9cccfb)return _0x9cccfb;}const _0x376bb1=this['apiDomain']+_0x54e169(0xca),_0x3b67f4=await this['postRequest'](_0x376bb1,{'appCode':this['appCode']});return apiCache['set'](_0x866667,_0x3b67f4),_0x3b67f4;}async[a1_0x35b167(0x111)](_0x107df1,_0x298482=![],_0xec4d=![]){const _0x260deb=a1_0x35b167,_0x48ef5b=_0x260deb(0x109)+this['appCode']+':'+this[_0x260deb(0xe9)]+':'+_0x107df1+':'+(_0xec4d?_0x260deb(0x10f):_0x260deb(0x108));if(!_0x298482){const _0x3c7157=apiCache[_0x260deb(0xd6)](_0x48ef5b);if(_0x3c7157)return _0x3c7157;}const _0x50e8dc=/^\d+$/[_0x260deb(0xd9)](_0x107df1),_0x1c6050=_0x50e8dc?'id':_0x260deb(0x117),_0xc65bac=this[_0x260deb(0x125)]+_0x260deb(0x106)+_0x1c6050+'='+_0x107df1,_0x48ff28=await this[_0x260deb(0x118)](_0xc65bac);if(_0xec4d&&_0x48ff28[_0x260deb(0xc9)]?.[_0x260deb(0xfd)]){const _0x25c6e7=_0x48ff28[_0x260deb(0xc9)][_0x260deb(0x11b)]==='v2',_0x4c7715=Array[_0x260deb(0xc1)](_0x48ff28[_0x260deb(0xc9)][_0x260deb(0xf9)]);if(!_0x25c6e7||!_0x4c7715)try{const _0x256a43=await this['getDatasetRelations'](_0x48ff28['data']['modelCode'],_0x298482);_0x48ff28[_0x260deb(0xc9)][_0x260deb(0xf9)]=_0x256a43;}catch(_0x2a86b1){process['env']['NODE_ENV']!==_0x260deb(0xd9)&&console[_0x260deb(0x126)](_0x260deb(0x12f)+_0x107df1+':',_0x2a86b1);}}return apiCache['set'](_0x48ef5b,_0x48ff28),_0x48ff28;}async[a1_0x35b167(0xc6)](_0x4ebace){const _0x157d36=a1_0x35b167,_0x466a40=await this['getDatasetList'](),_0x360dda=Array['isArray'](_0x466a40[_0x157d36(0xc9)])?_0x466a40[_0x157d36(0xc9)]:_0x466a40['data']?.['tableData']||[];if(!_0x466a40['success'])return{'success':!![],'data':{'tableData':[]}};const _0x349819=_0x360dda['filter'](_0x4915cf=>{const _0x3d764d=_0x157d36,_0x5be8cd=_0x4ebace[_0x3d764d(0xe5)]();return _0x4915cf[_0x3d764d(0xdc)]?.['toLowerCase']()['includes'](_0x5be8cd)||_0x4915cf[_0x3d764d(0x117)]?.[_0x3d764d(0xe5)]()[_0x3d764d(0x130)](_0x5be8cd)||_0x4915cf[_0x3d764d(0xea)]?.[_0x3d764d(0xf5)]?.[_0x3d764d(0xe5)]()['includes'](_0x5be8cd)||_0x4915cf[_0x3d764d(0x101)]?.['toLowerCase']()['includes'](_0x5be8cd);});return{'success':!![],'data':{'tableData':_0x349819,'paging':{'totalCount':_0x349819[_0x157d36(0xce)],'currentPage':0x1,'pageSize':_0x349819[_0x157d36(0xce)]}}};}async[a1_0x35b167(0x10d)](_0x183f6b){const _0x4c76c4=a1_0x35b167,_0x3174af=_0x183f6b?.[_0x4c76c4(0xf8)]||0x1,_0x174abd=_0x183f6b?.[_0x4c76c4(0xcb)]||0x3e7,_0x3066a=this['apiDomain']+'/smartapi/custom/queryUserCustomSqlList',_0x5ea574={'appCode':this[_0x4c76c4(0x116)],'currentPage':_0x3174af,'pageSize':_0x174abd,..._0x183f6b?.[_0x4c76c4(0x11e)]&&{'sqlCode':_0x183f6b[_0x4c76c4(0x11e)]},..._0x183f6b?.[_0x4c76c4(0xf1)]&&{'sqlName':_0x183f6b[_0x4c76c4(0xf1)]}},_0x553d9a=await this[_0x4c76c4(0xc7)](_0x3066a,_0x5ea574);return _0x553d9a;}async['executeSql'](_0x128590){const _0x2988e7=a1_0x35b167,_0xe8af02=this[_0x2988e7(0x105)]+_0x2988e7(0xe0),_0x4685ed={'appCode':this[_0x2988e7(0x116)],'sqlCode':_0x128590['sqlCode'],..._0x128590['params']&&{'params':_0x128590[_0x2988e7(0xcf)]}};return await this['postRequest'](_0xe8af02,_0x4685ed);}async[a1_0x35b167(0xc2)](_0x4bc959){const _0x582e30=a1_0x35b167,_0x2cf909=this['apiDomain']+_0x582e30(0xef),_0x4ab686={'sqlName':_0x4bc959[_0x582e30(0xf1)],'dbId':_0x4bc959[_0x582e30(0xda)],'sqlContent':_0x4bc959[_0x582e30(0xff)],'appCode':this[_0x582e30(0x116)]};return await this['postRequest'](_0x2cf909,_0x4ab686);}async[a1_0x35b167(0xf0)](_0x291670){const _0x4fb88a=a1_0x35b167,_0xa6114f=this[_0x4fb88a(0x125)]+_0x4fb88a(0xed),_0x1314b6={'id':_0x291670['id'],'dbId':_0x291670[_0x4fb88a(0xda)],'sqlName':_0x291670[_0x4fb88a(0xf1)],'appCode':this['appCode'],'sqlContent':_0x291670['sqlContent']};return await this[_0x4fb88a(0xc7)](_0xa6114f,_0x1314b6);}async[a1_0x35b167(0xfb)](_0x371e08,_0x3b57b5=![]){const _0xf42d23=a1_0x35b167,_0x4f4eab='er-config:'+this[_0xf42d23(0x116)]+':'+this[_0xf42d23(0xe9)]+':'+_0x371e08;if(!_0x3b57b5){const _0x11eebf=apiCache['get'](_0x4f4eab);if(_0x11eebf)return _0x11eebf;}const _0x3d03d4=this[_0xf42d23(0x125)]+_0xf42d23(0xf2),_0xa79b2e=await this[_0xf42d23(0xc7)](_0x3d03d4,{'dblinkId':_0x371e08,'appCode':this[_0xf42d23(0x116)]});if(!_0xa79b2e[_0xf42d23(0x12e)]||!_0xa79b2e[_0xf42d23(0xc9)])throw new Error('Failed\x20to\x20get\x20ER\x20config\x20for\x20dblinkId:\x20'+_0x371e08);const _0xf9a7e9={'meta':_0xa79b2e['data']['meta'],'datasets':_0xa79b2e[_0xf42d23(0xc9)]['datasets']};return apiCache[_0xf42d23(0x10c)](_0x4f4eab,_0xf9a7e9),_0xf9a7e9;}async[a1_0x35b167(0x11d)](_0x466ba4=![]){const _0x59f19d=a1_0x35b167,_0x3f962d=await this['getDatasetList']({'forceRefresh':_0x466ba4}),_0x29b7fa=Array['isArray'](_0x3f962d[_0x59f19d(0xc9)])?_0x3f962d[_0x59f19d(0xc9)]:_0x3f962d[_0x59f19d(0xc9)]?.[_0x59f19d(0x12b)]||[],_0x8a9f07=new Set();for(const _0x3e523b of _0x29b7fa){_0x3e523b['dbtableConfig']?.[_0x59f19d(0xda)]&&_0x8a9f07[_0x59f19d(0xe7)](_0x3e523b['dbtableConfig'][_0x59f19d(0xda)]);}return Array[_0x59f19d(0xd4)](_0x8a9f07)['sort']((_0x542406,_0x34f6f6)=>_0x542406-_0x34f6f6);}async[a1_0x35b167(0xdd)](_0x3ddec6=![]){const _0x55957d=a1_0x35b167,_0x484451=_0x55957d(0x115)+this['appCode']+':'+this[_0x55957d(0xe9)];if(!_0x3ddec6){const _0x336191=apiCache[_0x55957d(0xd6)](_0x484451);if(_0x336191)return _0x336191;}const _0x277474=await this[_0x55957d(0x11d)](_0x3ddec6),_0x356147=new Map();for(const _0x2238b6 of _0x277474){try{const _0x415fb9=await this[_0x55957d(0xfb)](_0x2238b6,_0x3ddec6);_0x356147[_0x55957d(0x10c)](_0x2238b6,_0x415fb9);}catch(_0x230296){console['warn'](_0x55957d(0x134)+_0x2238b6+':',_0x230296);}}return apiCache['set'](_0x484451,_0x356147),_0x356147;}async[a1_0x35b167(0x114)](_0x520fa7,_0x120add=![]){const _0x36546f=a1_0x35b167,_0x307003=await this[_0x36546f(0xdd)](_0x120add),_0x441078=[],_0x3add57=[];for(const [,_0x57b3ad]of _0x307003){const _0x30755b=_0x57b3ad[_0x36546f(0x112)][_0x36546f(0x10a)](_0x86acb4=>_0x86acb4['datasetCode']===_0x520fa7);if(_0x30755b)for(const _0x3551ba of _0x30755b['relations']||[]){_0x441078['push']({'toDataset':_0x3551ba[_0x36546f(0xe2)],'toDatasetName':_0x3551ba[_0x36546f(0x136)],'toField':_0x3551ba[_0x36546f(0x113)],'fromField':_0x3551ba['fromField'],'joinType':_0x3551ba[_0x36546f(0xdb)]});}for(const _0x167167 of _0x57b3ad['datasets']){if(_0x167167[_0x36546f(0xd1)]===_0x520fa7)continue;for(const _0x1abcc0 of _0x167167['relations']||[]){_0x1abcc0[_0x36546f(0xe2)]===_0x520fa7&&_0x3add57[_0x36546f(0x12a)]({'fromDataset':_0x167167[_0x36546f(0xd1)],'fromDatasetName':_0x167167[_0x36546f(0xe1)],'fromField':_0x1abcc0[_0x36546f(0x11c)],'toField':_0x1abcc0['toField'],'joinType':_0x1abcc0[_0x36546f(0xdb)]});}}}return{'outgoing':_0x441078,'incoming':_0x3add57};}async[a1_0x35b167(0xc5)](){const _0xfd188b=a1_0x35b167,_0x1b613c=this[_0xfd188b(0x125)]+'/api/management/library/scripts/list?appCode='+encodeURIComponent(this[_0xfd188b(0x116)])+_0xfd188b(0xf4);return await this['request'](_0x1b613c);}async[a1_0x35b167(0xf6)](_0x31c722){const _0x51121d=a1_0x35b167,_0x28f375=this[_0x51121d(0x125)]+_0x51121d(0xd8)+_0x31c722;return await this[_0x51121d(0x118)](_0x28f375);}async[a1_0x35b167(0xfa)](_0x4b5bad){const _0x3f7d73=a1_0x35b167,_0x478c78=this[_0x3f7d73(0x125)]+_0x3f7d73(0xd5),_0x5f22d9={'id':_0x4b5bad['id']??null,'appCode':_0x4b5bad[_0x3f7d73(0x116)],'description':_0x4b5bad[_0x3f7d73(0x101)],'scriptContent':_0x4b5bad[_0x3f7d73(0x128)],'scriptType':_0x4b5bad[_0x3f7d73(0xfe)]};return await this[_0x3f7d73(0xc7)](_0x478c78,_0x5f22d9);}async[a1_0x35b167(0xcd)](){const _0x299dac=a1_0x35b167,_0x1f03cd=this[_0x299dac(0x105)]+_0x299dac(0x123);return await this[_0x299dac(0xc7)](_0x1f03cd,{});}async['saveCustomSqlViaToolbox'](_0x32b9c8){const _0x8de18f=a1_0x35b167,_0x12a2e2=this['resolveToolboxUrl'](_0x8de18f(0xee),_0x8de18f(0x127)),_0x1f4ae7=await this[_0x8de18f(0xc7)](_0x12a2e2,_0x32b9c8);return _0x1f4ae7[_0x8de18f(0xc9)];}async['saveBffScriptViaToolbox'](_0x23ab6c){const _0x44fb0d=a1_0x35b167,_0x5367b5=this[_0x44fb0d(0x12d)]('save-bff','/api/node-toolbox/bff/save'),_0x2e92ce=await this['postRequest'](_0x5367b5,_0x23ab6c);return _0x2e92ce['data'];}}function a1_0x9e2c(){const _0x277a5e=['saveBffScript','getErConfig','forceRefresh','modelCode','scriptType','sqlContent','API\x20error:\x20','description','online','toolboxBaseUrl','ms.\x20The\x20server\x20may\x20be\x20down\x20or\x20unreachable.\x0aURL:\x20','runtimeDomain','/smartapi/dataset/get-driven-data?','errorMsg','no-relations','dataset-detail:','find','cookie','set','getCustomSqlList','dataset-list:','with-relations','2966Srzlnx','getDatasetDetail','datasets','toField','getDatasetRelations','er-configs-all:','appCode','code','request','API\x20request\x20failed:\x20HTTP\x20','_request','doVersion','fromField','getUniqueDbIds','sqlCode','24849qfFXvl','Authentication\x20failed.\x20Please\x20login\x20again.','930391jpbPLH','850GmaRfk','/api/management/script/cache/clear','1019680FgkInS','apiDomain','warn','/api/node-toolbox/sql/save','scriptContent','2558348unpXZe','push','tableData','toolboxBaseUrlOverride','resolveToolboxUrl','success','[getDatasetDetail]\x20Failed\x20to\x20fetch\x20relations\x20for\x20','includes','mcp:vibe','object','message','Failed\x20to\x20get\x20ER\x20config\x20for\x20dbId\x20','runtimeBaseUrl','toDatasetName','isArray','saveUserCustomSql','50IaQkUO','\x0aURL:\x20','getBffScriptList','searchDatasets','postRequest','Network\x20error:\x20Unable\x20to\x20connect\x20to\x20the\x20server.\x20Please\x20check\x20your\x20network\x20connection\x20or\x20the\x20server\x20may\x20be\x20down.\x0aURL:\x20','data','/smartapi/dataset/get-dataset-list','pageSize','process','clearBffScriptCache','length','params','87705ednSPh','datasetCode','839472fgugLi','12ZlElRS','from','/api/management/library/scripts/save','get','AbortError','/api/management/library/scripts/info?id=','test','dbId','joinType','name','getAllErConfigs','6eaiYAJ','GET','/api/custom/executeSql','datasetName','toDataset','status','12TKdbPZ','toLowerCase','DEFAULT_TIMEOUT','add','POST','env','dbtableConfig','apiBaseUrl','API\x20request\x20timeout\x20after\x20','/smartapi/custom/updateUserCustomSql','save-sql','/smartapi/custom/saveUserCustomSql','updateUserCustomSql','sqlName','/smartapi/question/er-config','18UNpdKA','&type=ENDPOINT','tableName','getBffScriptInfo','text','currentPage','relations'];a1_0x9e2c=function(){return _0x277a5e;};return a1_0x9e2c();}
|
package/dist/auth/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1258b0,_0x43c246){var _0xb03c1a=a2_0x2548,_0x13018f=_0x1258b0();while(!![]){try{var _0x213129=-parseInt(_0xb03c1a(0x1b6))/0x1+-parseInt(_0xb03c1a(0x1b8))/0x2*(-parseInt(_0xb03c1a(0x1b5))/0x3)+parseInt(_0xb03c1a(0x1b9))/0x4*(parseInt(_0xb03c1a(0x1b4))/0x5)+-parseInt(_0xb03c1a(0x1ba))/0x6*(-parseInt(_0xb03c1a(0x1b7))/0x7)+-parseInt(_0xb03c1a(0x1b1))/0x8+-parseInt(_0xb03c1a(0x1b3))/0x9+-parseInt(_0xb03c1a(0x1b2))/0xa;if(_0x213129===_0x43c246)break;else _0x13018f['push'](_0x13018f['shift']());}catch(_0x407aab){_0x13018f['push'](_0x13018f['shift']());}}}(a2_0x4371,0xda8f7));function a2_0x2548(_0x4a55ba,_0x3f7839){_0x4a55ba=_0x4a55ba-0x1b1;var _0x4371ad=a2_0x4371();var _0x2548bc=_0x4371ad[_0x4a55ba];return _0x2548bc;}export{getEnvAppCode,getEnvironment,getEnvApiBaseUrl,getEnvRuntimeBaseUrl,getEnvUserBaseUrl,getEnvAuthCookie,configDir,cookieFile,defaultConfig,getEnvAppCodeWithFallback,getApiDomain,getUserDomain,getRuntimeDomain,getEffectiveApiDomain,getEffectiveRuntimeDomain,getEffectiveUserDomain,getEnvToolboxBaseUrl,getEffectiveToolboxDomain}from'../config/env.js';function a2_0x4371(){var _0x59d7c0=['1266645jwLMIW','4762302YQBGyd','214343wMSsLX','7YGPRQG','2ERnfyb','8FUDfwc','6645624CysdgC','979304EWFuqF','13905880NrYehn','5212161PcymbW'];a2_0x4371=function(){return _0x59d7c0;};return a2_0x4371();}export{resolveApiBaseUrl}from'../config/api-url-resolver.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a3_0x39f6(_0x16adf8,_0x10c707){_0x16adf8=_0x16adf8-0x9a;const _0x3f575b=a3_0x3f57();let _0x39f623=_0x3f575b[_0x16adf8];return _0x39f623;}(function(_0x1bf88e,_0x5c9fb6){const _0x398fad=a3_0x39f6,_0x48117c=_0x1bf88e();while(!![]){try{const _0x24f7cd=-parseInt(_0x398fad(0xa2))/0x1+-parseInt(_0x398fad(0xa0))/0x2*(parseInt(_0x398fad(0xa5))/0x3)+-parseInt(_0x398fad(0x9f))/0x4*(parseInt(_0x398fad(0x9d))/0x5)+parseInt(_0x398fad(0x9a))/0x6+parseInt(_0x398fad(0xa1))/0x7*(parseInt(_0x398fad(0xa4))/0x8)+-parseInt(_0x398fad(0x9e))/0x9+parseInt(_0x398fad(0xa3))/0xa*(parseInt(_0x398fad(0xa6))/0xb);if(_0x24f7cd===_0x5c9fb6)break;else _0x48117c['push'](_0x48117c['shift']());}catch(_0x4ed639){_0x48117c['push'](_0x48117c['shift']());}}}(a3_0x3f57,0x26912));function a3_0x3f57(){const _0x25df24=['136pLKUPm','644709TvJFrE','7666879zpRVmJ','739422OXCCnq','length','utf-8','225580Laqydf','1909377tlrqcc','4hQMqin','2yrQDwN','21497vajUXH','242291FDoSuh','10ykXdHP'];a3_0x3f57=function(){return _0x25df24;};return a3_0x3f57();}import{readFileSync,writeFileSync}from'node:fs';import{getEnvAuthCookie,cookieFile}from'../config/env.js';export function getCookie(){const _0x551b70=a3_0x39f6,_0x3ce611=getEnvAuthCookie();if(_0x3ce611)return _0x3ce611;try{return readFileSync(cookieFile,_0x551b70(0x9c))['trim']();}catch{return'';}}export function saveCookie(_0x53d1ff){const _0x3ccf1f=a3_0x39f6;try{writeFileSync(cookieFile,_0x53d1ff,_0x3ccf1f(0x9c));}catch(_0xa546e7){throw new Error('Failed\x20to\x20save\x20cookie\x20to\x20'+cookieFile+':\x20'+_0xa546e7['message']);}}export function hasCookie(){const _0xa6d552=a3_0x39f6,_0x2fe0d9=getCookie();return _0x2fe0d9[_0xa6d552(0x9b)]>0x0;}export function clearCookie(){const _0x2f111b=a3_0x39f6;try{writeFileSync(cookieFile,'',_0x2f111b(0x9c));}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x46f393,_0x10c1b5){const _0x4be0d8=a4_0x5e16,_0x286960=_0x46f393();while(!![]){try{const _0x44d43f=parseInt(_0x4be0d8(0xbf))/0x1*(parseInt(_0x4be0d8(0xc3))/0x2)+parseInt(_0x4be0d8(0xc1))/0x3+-parseInt(_0x4be0d8(0xc7))/0x4+parseInt(_0x4be0d8(0xc6))/0x5*(-parseInt(_0x4be0d8(0xc5))/0x6)+-parseInt(_0x4be0d8(0xc8))/0x7*(parseInt(_0x4be0d8(0xbc))/0x8)+parseInt(_0x4be0d8(0xbd))/0x9+parseInt(_0x4be0d8(0xc4))/0xa;if(_0x44d43f===_0x10c1b5)break;else _0x286960['push'](_0x286960['shift']());}catch(_0x52b328){_0x286960['push'](_0x286960['shift']());}}}(a4_0x2321,0xa68f5));import{getCookie}from'./cookie-manager.js';function a4_0x5e16(_0x280974,_0x5a29b2){_0x280974=_0x280974-0xbc;const _0x232101=a4_0x2321();let _0x5e16e7=_0x232101[_0x280974];return _0x5e16e7;}import{getUserDomain}from'../config/env.js';function a4_0x2321(){const _0x5ebca1=['217846ULtkfu','25015810aqWEWR','78IYQqDt','500730WpPDUK','3043476IchcCm','7EJBmqA','5927176gNHhhL','5494473wfSpWp','json','1cHeDYX','/api/auth/get-session','794676jeiEPD','user'];a4_0x2321=function(){return _0x5ebca1;};return a4_0x2321();}export async function isSessionValid(){const _0x4638e4=a4_0x5e16,_0x137c11=getCookie();if(!_0x137c11)return![];try{const _0x23a480=await fetch(getUserDomain()+_0x4638e4(0xc0),{'headers':{'cookie':_0x137c11}});if(!_0x23a480['ok'])return![];const _0x3d4245=await _0x23a480[_0x4638e4(0xbe)]();return!!(_0x3d4245?.['session']&&_0x3d4245?.[_0x4638e4(0xc2)]);}catch{return![];}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x28a440,_0x9e1fa2){const _0x5c7ef9=a5_0x2794,_0x3e8810=_0x28a440();while(!![]){try{const _0x8983cc=parseInt(_0x5c7ef9(0x98))/0x1+parseInt(_0x5c7ef9(0x93))/0x2+parseInt(_0x5c7ef9(0x94))/0x3*(-parseInt(_0x5c7ef9(0x91))/0x4)+parseInt(_0x5c7ef9(0x97))/0x5+parseInt(_0x5c7ef9(0x95))/0x6*(-parseInt(_0x5c7ef9(0x8e))/0x7)+-parseInt(_0x5c7ef9(0x8f))/0x8+parseInt(_0x5c7ef9(0x96))/0x9;if(_0x8983cc===_0x9e1fa2)break;else _0x3e8810['push'](_0x3e8810['shift']());}catch(_0x5e2817){_0x3e8810['push'](_0x3e8810['shift']());}}}(a5_0x3076,0xcb445));import{getEnvToolboxBaseUrl,getEffectiveApiDomain}from'./env.js';function a5_0x3076(){const _0x1a0640=['env','1128GQKQRC','LOVRABET_API_URL_OVERRIDES','2121064egVTwJ','6753XOvaBs','3146790ufLmFz','5667480ZjPcYV','5913120KxOfPd','299319AcWEEi','[MCP]\x20LOVRABET_API_URL_OVERRIDES\x20is\x20not\x20valid\x20JSON,\x20ignoring','21AfMuru','1051496VtxlYO'];a5_0x3076=function(){return _0x1a0640;};return a5_0x3076();}import{getConfigApiUrlOverrides}from'./lovrabet-config.js';function a5_0x2794(_0x48658c,_0x5260d0){_0x48658c=_0x48658c-0x8d;const _0x3076e4=a5_0x3076();let _0x27949b=_0x3076e4[_0x48658c];return _0x27949b;}let _envOverridesCache=null;function getEnvApiUrlOverrides(){const _0x22d848=a5_0x2794;if(_envOverridesCache!==null)return _envOverridesCache;const _0x106028=process[_0x22d848(0x90)][_0x22d848(0x92)];if(!_0x106028)return _envOverridesCache={},_envOverridesCache;try{_envOverridesCache=JSON['parse'](_0x106028);}catch{process[_0x22d848(0x90)]['MCP_DEBUG']&&console['warn'](_0x22d848(0x8d)),_envOverridesCache={};}return _envOverridesCache;}export function resolveApiBaseUrl(_0x4bff6e){const _0x2c42bd=getEnvApiUrlOverrides();if(_0x2c42bd[_0x4bff6e])return _0x2c42bd[_0x4bff6e];const _0x2eb5de=getConfigApiUrlOverrides();if(_0x2eb5de[_0x4bff6e])return _0x2eb5de[_0x4bff6e];return getEnvToolboxBaseUrl()??getEffectiveApiDomain();}export function clearApiUrlOverridesCache(){_envOverridesCache=null;}
|
package/dist/config/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x58f277=a6_0x2915;(function(_0xaaf08,_0x3f1729){const _0x51fa1d=a6_0x2915,_0x5abfce=_0xaaf08();while(!![]){try{const _0xcce8e6=parseInt(_0x51fa1d(0x150))/0x1*(parseInt(_0x51fa1d(0x142))/0x2)+parseInt(_0x51fa1d(0x138))/0x3+parseInt(_0x51fa1d(0x14d))/0x4*(parseInt(_0x51fa1d(0x13e))/0x5)+parseInt(_0x51fa1d(0x13b))/0x6+-parseInt(_0x51fa1d(0x145))/0x7*(parseInt(_0x51fa1d(0x143))/0x8)+parseInt(_0x51fa1d(0x13a))/0x9+-parseInt(_0x51fa1d(0x139))/0xa;if(_0xcce8e6===_0x3f1729)break;else _0x5abfce['push'](_0x5abfce['shift']());}catch(_0x198adf){_0x5abfce['push'](_0x5abfce['shift']());}}}(a6_0x2198,0x1babb));import{mkdirSync}from'node:fs';import{homedir}from'node:os';const ENVIRONMENT_MAPPING={'online':'production','production':a6_0x58f277(0x14e),'daily':a6_0x58f277(0x131),'dev':a6_0x58f277(0x13d),'development':a6_0x58f277(0x13d)};function normalizeEnvironment(_0x22b937){const _0x3f26fa=a6_0x58f277;if(!_0x22b937)return'production';const _0x14da20=_0x22b937[_0x3f26fa(0x151)](),_0x5827c6=ENVIRONMENT_MAPPING[_0x14da20];if(!_0x5827c6)return console[_0x3f26fa(0x136)](_0x3f26fa(0x13f)+_0x22b937+_0x3f26fa(0x149)),_0x3f26fa(0x14e);return _0x5827c6!==_0x14da20&&_0x5827c6!==_0x22b937&&console[_0x3f26fa(0x148)](_0x3f26fa(0x134)+_0x22b937+_0x3f26fa(0x14f)+_0x5827c6),_0x5827c6;}export function getEnvAppCode(){const _0x22e28f=a6_0x58f277;return process[_0x22e28f(0x13c)]['LOVRABET_APP_CODE'];}export function getEnvironment(){const _0x57ccef=a6_0x58f277,_0x8fde2d=process[_0x57ccef(0x13c)]['LOVRABET_ENV'];return normalizeEnvironment(_0x8fde2d);}export function getEnvApiBaseUrl(){const _0x51a9bf=a6_0x58f277;return process[_0x51a9bf(0x13c)]['LOVRABET_API_BASEURL'];}export function getEnvRuntimeBaseUrl(){const _0x31c4ba=a6_0x58f277;return process['env'][_0x31c4ba(0x140)];}export function getEnvUserBaseUrl(){const _0x427778=a6_0x58f277;return process[_0x427778(0x13c)]['LOVRABET_USER_BASEURL'];}export function getEnvAuthCookie(){const _0x143717=a6_0x58f277;return process['env'][_0x143717(0x14a)]?.['trim']();}export function isTestEnv(){const _0x14abab=a6_0x58f277;return process[_0x14abab(0x13c)][_0x14abab(0x141)]===_0x14abab(0x133);}export function isProductionEnv(){const _0x1e7e58=a6_0x58f277;return process[_0x1e7e58(0x13c)]['NODE_ENV']===_0x1e7e58(0x14e);}export function isDevelopmentEnv(){const _0x69cccf=a6_0x58f277;return process[_0x69cccf(0x13c)][_0x69cccf(0x141)]===_0x69cccf(0x13d);}export function shouldLog(){const _0x43b5a9=a6_0x58f277,_0x1cc324=process[_0x43b5a9(0x13c)]['NODE_ENV'];return _0x1cc324===_0x43b5a9(0x13d)||_0x1cc324===_0x43b5a9(0x131);}export const configDir=homedir()+a6_0x58f277(0x137);function a6_0x2198(){const _0x482d39=['test','[ENV]\x20Environment\x20mapping:\x20','LOVRABET_TOOLBOX_BASEURL','warn','/.lovrabet','347760SoyEci','4296820meVVrT','538254VYJwdg','1201986mIwxiI','env','development','49345gaDUcK','[ENV]\x20Unknown\x20environment:\x20','LOVRABET_RUNTIME_BASEURL','NODE_ENV','35124ZwKTDr','1270936WVVUUU','https://daily-api.lovrabet.com','7RRKXaY','https://api.lovrabet.com','https://user-daily.lovrabet.com','log',',\x20using\x20default\x20production','LOVRABET_AUTH_COOKIE','/cookie','https://runtime.lovrabet.com','68IZwWqp','production','\x20→\x20','9iTNsQS','toLowerCase','https://dev.lovrabet.com','daily','https://user.lovrabet.com'];a6_0x2198=function(){return _0x482d39;};return a6_0x2198();}export const cookieFile=configDir+a6_0x58f277(0x14b);mkdirSync(configDir,{'recursive':!![]});export const defaultConfig={'appCode':getEnvAppCode(),'env':getEnvironment()};export function getEnvAppCodeWithFallback(_0x38748b){return getEnvAppCode()||_0x38748b;}export function getApiDomain(){const _0x1e84ee=a6_0x58f277,_0x24f97a=getEnvironment(),_0xbed4b9={'production':_0x1e84ee(0x146),'online':_0x1e84ee(0x146),'daily':_0x1e84ee(0x144),'development':_0x1e84ee(0x152)};return _0xbed4b9[_0x24f97a];}function a6_0x2915(_0x38b313,_0x1d3edb){_0x38b313=_0x38b313-0x131;const _0x2198e8=a6_0x2198();let _0x2915c7=_0x2198e8[_0x38b313];return _0x2915c7;}export function getUserDomain(){const _0x2b96a3=a6_0x58f277,_0x4d0b19=getEnvironment(),_0x297f43={'production':_0x2b96a3(0x132),'online':_0x2b96a3(0x132),'daily':_0x2b96a3(0x147),'development':_0x2b96a3(0x152)};return _0x297f43[_0x4d0b19];}export function getRuntimeDomain(){const _0x3bdc2f=a6_0x58f277,_0x3c2dba=getEnvironment(),_0x4127dd={'production':_0x3bdc2f(0x14c),'online':_0x3bdc2f(0x14c),'daily':'https://daily-runtime.lovrabet.com','development':'https://dev.lovrabet.com'};return _0x4127dd[_0x3c2dba];}export function getEffectiveApiDomain(){return getEnvApiBaseUrl()||getApiDomain();}export function getEffectiveRuntimeDomain(){return getEnvRuntimeBaseUrl()||getRuntimeDomain();}export function getEffectiveUserDomain(){return getEnvUserBaseUrl()||getUserDomain();}export function getEnvToolboxBaseUrl(){const _0x15542c=a6_0x58f277;return process[_0x15542c(0x13c)][_0x15542c(0x135)];}export function getEffectiveToolboxDomain(){return getEnvToolboxBaseUrl()||getEffectiveApiDomain();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x40cfe7,_0x122ab5){const _0x1509b7=a7_0x4c0b,_0x3b1973=_0x40cfe7();while(!![]){try{const _0x4b7e8b=parseInt(_0x1509b7(0xf2))/0x1+-parseInt(_0x1509b7(0xfb))/0x2+-parseInt(_0x1509b7(0xf3))/0x3*(parseInt(_0x1509b7(0xf1))/0x4)+-parseInt(_0x1509b7(0xfe))/0x5+-parseInt(_0x1509b7(0xf4))/0x6*(parseInt(_0x1509b7(0xfd))/0x7)+-parseInt(_0x1509b7(0xf9))/0x8+parseInt(_0x1509b7(0xf8))/0x9;if(_0x4b7e8b===_0x122ab5)break;else _0x3b1973['push'](_0x3b1973['shift']());}catch(_0x11ec29){_0x3b1973['push'](_0x3b1973['shift']());}}}(a7_0x9a51,0x7a91d));import{existsSync,readFileSync}from'node:fs';import{configDir}from'./env.js';let _cache=null;function a7_0x4c0b(_0x3e208c,_0x19aa92){_0x3e208c=_0x3e208c-0xf0;const _0x9a51a9=a7_0x9a51();let _0x4c0b57=_0x9a51a9[_0x3e208c];return _0x4c0b57;}function readConfigFile(){const _0x2f43bc=a7_0x4c0b;if(_cache!==null)return _cache;const _0x4d4c2b=configDir+'/config.json';if(!existsSync(_0x4d4c2b))return _cache={},_cache;try{_cache=JSON[_0x2f43bc(0xf6)](readFileSync(_0x4d4c2b,_0x2f43bc(0xf0)));}catch{process[_0x2f43bc(0xfc)][_0x2f43bc(0xff)]&&console[_0x2f43bc(0xf5)]('[MCP]\x20Failed\x20to\x20parse\x20'+_0x4d4c2b+_0x2f43bc(0xfa)),_cache={};}return _cache;}function a7_0x9a51(){const _0x1124b8=['parse','apiUrlOverrides','22460238saDSfF','4785000DNtvgP',',\x20using\x20empty\x20config','520982QfDxlZ','env','7tSvmDv','224540YOMSic','MCP_DEBUG','utf-8','1854032dahASj','840471MJPghQ','6qhwzwL','6020808woufdF','warn'];a7_0x9a51=function(){return _0x1124b8;};return a7_0x9a51();}export function getConfigApiUrlOverrides(){const _0x5e26d4=a7_0x4c0b;return readConfigFile()[_0x5e26d4(0xf7)]??{};}export function clearConfigCache(){_cache=null;}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a8_0x34defc=a8_0x24cf;(function(_0x1cf459,_0x5daab9){const _0x39b270=a8_0x24cf,_0x464c1c=_0x1cf459();while(!![]){try{const _0x2133ce=-parseInt(_0x39b270(0x1be))/0x1*(-parseInt(_0x39b270(0x1b1))/0x2)+-parseInt(_0x39b270(0x1b4))/0x3*(-parseInt(_0x39b270(0x1b7))/0x4)+parseInt(_0x39b270(0x1c7))/0x5*(parseInt(_0x39b270(0x1bd))/0x6)+-parseInt(_0x39b270(0x1ac))/0x7*(-parseInt(_0x39b270(0x1c9))/0x8)+parseInt(_0x39b270(0x1b9))/0x9*(parseInt(_0x39b270(0x1bf))/0xa)+parseInt(_0x39b270(0x1c8))/0xb*(parseInt(_0x39b270(0x1af))/0xc)+parseInt(_0x39b270(0x1c1))/0xd*(-parseInt(_0x39b270(0x1c0))/0xe);if(_0x2133ce===_0x5daab9)break;else _0x464c1c['push'](_0x464c1c['shift']());}catch(_0x1f5f46){_0x464c1c['push'](_0x464c1c['shift']());}}}(a8_0x1967,0xb0aac));import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{createServer}from'./server.js';function parseArgs(){const _0x2a7b09=a8_0x24cf,_0x245f0d=process['argv'][_0x2a7b09(0x1ae)](0x2),_0x98a803=_0x245f0d[_0x2a7b09(0x1b2)](_0x2a7b09(0x1ad))||_0x245f0d[_0x2a7b09(0x1b2)](_0x2a7b09(0x1b5));return process[_0x2a7b09(0x1bb)][_0x2a7b09(0x1ab)]&&_0x245f0d[_0x2a7b09(0x1b2)](_0x2a7b09(0x1b5))&&!_0x245f0d[_0x2a7b09(0x1b2)](_0x2a7b09(0x1ad))&&console[_0x2a7b09(0x1c6)]('[MCP]\x20--dangerously-bff-save\x20is\x20deprecated;\x20use\x20--enable-bff-save\x20(same\x20behavior)'),{'bffSaveEnabled':_0x98a803};}async function main(){const _0xc3a5a5=a8_0x24cf;try{const {bffSaveEnabled:_0x3d4a44}=parseArgs(),_0x43a0e5=createServer({'bffSaveEnabled':_0x3d4a44}),_0x47d497=new StdioServerTransport();_0x43a0e5[_0xc3a5a5(0x1ba)](),await _0x43a0e5[_0xc3a5a5(0x1b3)](_0x47d497),process['on']('SIGINT',async()=>{const _0x37eed5=_0xc3a5a5;process[_0x37eed5(0x1bb)][_0x37eed5(0x1ab)]&&console[_0x37eed5(0x1c5)](_0x37eed5(0x1c3)),process[_0x37eed5(0x1c2)](0x0);}),process['on'](_0xc3a5a5(0x1c4),async()=>{const _0x1e9d7a=_0xc3a5a5;process[_0x1e9d7a(0x1bb)][_0x1e9d7a(0x1ab)]&&console[_0x1e9d7a(0x1c5)](_0x1e9d7a(0x1c3)),process['exit'](0x0);});}catch(_0x2b7f09){console['error'](_0xc3a5a5(0x1b8),_0x2b7f09),process[_0xc3a5a5(0x1c2)](0x1);}}function a8_0x24cf(_0x59531e,_0x222b98){_0x59531e=_0x59531e-0x1ab;const _0x1967aa=a8_0x1967();let _0x24cff6=_0x1967aa[_0x59531e];return _0x24cff6;}function a8_0x1967(){const _0x545900=['MCP_DEBUG','7lTMVcs','--enable-bff-save','slice','726960gpOihK','catch','1673886vzewSm','includes','connect','843YygMju','--dangerously-bff-save','Unhandled\x20error:','13556kcxewI','Failed\x20to\x20start\x20Lovrabet\x20Dataset\x20MCP\x20Server:','45405LufGWU','logInfo','env','error','615798ZeVNNF','1ZbeGNW','410gTRlhp','14182AxDRON','39221TPBbXS','exit','Shutting\x20down\x20Lovrabet\x20Dataset\x20MCP\x20Server...','SIGTERM','log','warn','60qtsXxp','77sHhHFP','1024768vwVzWl'];a8_0x1967=function(){return _0x545900;};return a8_0x1967();}main()[a8_0x34defc(0x1b0)](_0x4406a1=>{const _0x3d11bb=a8_0x34defc;console[_0x3d11bb(0x1bc)](_0x3d11bb(0x1b6),_0x4406a1),process[_0x3d11bb(0x1c2)](0x1);});
|
package/dist/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a7_0x1cd1(){const _0x3dfdcf=['15815034ARIAuy','673oXFXym','search_datasets','Login\x20to\x20Lovrabet\x20to\x20authenticate\x20for\x20dataset\x20queries.','save_or_update_bff_script','8FHjkPa','Target\x20context:\x20\x22sdk\x22\x20(Frontend\x20SDK,\x20default)\x20or\x20\x22bff\x22\x20(Backend\x20Function).\x20SDK\x20returns\x20{execSuccess,\x20execResult}\x20wrapper;\x20BFF\x20returns\x20rows\x20directly.','Bypass\x20cache\x20(default:\x20false)','registerAllTools','../package.json','Search\x20datasets\x20by\x20keyword\x20(searches\x20in\x20name,\x20table\x20name,\x20code,\x20and\x20description).','Client-side\x20filter\x20by\x20name/description/content','close','Include\x20bidirectional\x20relations,\x20summary,\x20and\x20usage\x20hints\x20(default:\x20true)','server','online','Include\x20table\x20relations\x20(default:\x20true)','Get\x20detailed\x20Backend\x20Function\x20script\x20including\x20full\x20source\x20code.','Function\x20description','number','list_sql_queries','optional','5090200djCKvz','3926913XjuPdX','Include\x20import\x20statements\x20(default:\x20true)','8235335bKsITy','message','Get\x20Operations','generate_sql_code','Environment\x20(optional,\x20uses\x20LOVRABET_ENV\x20or\x20defaults\x20to\x20online)','options','validate_sql_content','62euraAZ','record','6uiIigR','Generate\x20SQL\x20Code','connect','List\x20all\x20Backend\x20Function\x20(ENDPOINT\x20type)\x20scripts.','Authentication\x20cookie\x20(optional,\x20uses\x20stored\x20cookie\x20from\x20login\x20if\x20not\x20provided)','get_bff_script_info','save_or_update_custom_sql','boolean','Server-side\x20fuzzy\x20match\x20by\x20sqlCode','Page\x20number\x20(default:\x201)','Get\x20list\x20of\x20all\x20datasets\x20with\x20metadata\x20and\x20table\x20relations\x20(ER\x20Config).\x20Use\x20includeRelations:\x20false\x20for\x20faster\x20response.','min','union','Unknown\x20error\x20occurred','execute_custom_sql','bffAutosave','Validate\x20SQL\x20content\x20without\x20saving.\x20Detects\x20SQL\x20type\x20(SELECT/INSERT/UPDATE/DELETE/DDL)\x20and\x20validates\x20table/column\x20existence.\x20Supports\x20MyBatis\x20syntax.','Dataset\x20code/ID','4807411uGZUWU','Database\x20ID\x20from\x20get_dataset_detail','Get\x20Operation\x20Detail','MCP_DEBUG','generate_sdk_code','Backend\x20Function\x20ID\x20(for\x20updating)','string','describe','List\x20all\x20available\x20custom\x20SQL\x20queries\x20with\x20metadata\x20and\x20parameters.','List\x20Backend\x20Functions','mcpServer','Save\x20or\x20update\x20a\x20Backend\x20Function\x20script.\x20Provide\x20id\x20for\x20updates,\x20omit\x20for\x20new.\x20Runtime\x20cache\x20is\x20automatically\x20cleared\x20after\x20save.','list_bff_scripts','get_operation_detail','JavaScript/TypeScript\x20code\x20with\x20default\x20export','Get\x20Backend\x20Function\x20Info','stringify','SQL\x20parameters','Lovrabet\x20Dataset\x20MCP\x20Server','You\x20are\x20an\x20AI\x20assistant\x20helping\x20developers\x20work\x20with\x20the\x20Lovrabet\x20data\x20platform.\x0a\x0a##\x20Two\x20Runtime\x20Contexts:\x20Frontend\x20SDK\x20vs\x20Backend\x20Function\x20(BFF)\x0a\x0aLovrabet\x20has\x20two\x20code\x20execution\x20contexts\x20with\x20**identical\x20calling\x20methods\x20but\x20different\x20return\x20structures**:\x0a\x0a###\x20Frontend\x20TypeScript\x20SDK\x20(`@lovrabet/sdk`)\x0a-\x20Runs\x20in\x20browser/Node.js,\x20imported\x20via\x20`import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27`\x0a-\x20Model\x20operations\x20return\x20unwrapped\x20data\x20on\x20success,\x20throw\x20LovrabetError\x20on\x20error\x0a-\x20SQL\x20execution\x20returns\x20wrapper:\x20`{\x20execSuccess,\x20execResult\x20}`\x0a\x0a###\x20Backend\x20Function\x20(BFF)\x0a-\x20Runs\x20on\x20Lovrabet\x20server,\x20function\x20signature:\x20`export\x20default\x20async\x20function(params,\x20context)\x20{\x20...\x20}`\x0a-\x20Use\x20`context.client`\x20to\x20access\x20the\x20same\x20SDK\x20methods\x0a-\x20Model\x20operations\x20behave\x20the\x20same\x20as\x20SDK\x0a-\x20**SQL\x20execution\x20returns\x20direct\x20array**\x20`T[]`,\x20errors\x20throw\x20exceptions\x20(no\x20wrapper)\x0a\x0a>\x20**CRITICAL**:\x20Always\x20ask\x20or\x20determine\x20which\x20context\x20the\x20user\x20is\x20working\x20in\x20before\x20generating\x20code.\x0a\x0a##\x20SDK\x20Usage\x20Patterns\x0a\x0a###\x20Model\x20Access\x20(SDK\x20>=\x201.2.0)\x0a-\x20Default:\x20`client.models.dataset_[code].filter()`\x0a-\x20Alias:\x20`client.models.[alias].filter()`\x20(check\x20user\x27s\x20createClient/registerModels\x20config\x20for\x20actual\x20alias)\x0a-\x20For\x20SDK\x20<\x201.2.0:\x20only\x20`client.models.[key]`\x20where\x20key\x20is\x20defined\x20in\x20createClient/registerModels\x0a\x0a###\x20SDK\x20Return\x20Value\x20Behavior\x0a-\x20**On\x20Success**:\x20Returns\x20ONLY\x20the\x20\x27data\x27\x20field\x20content\x20(e.g.,\x20`{\x20id:\x20123,\x20name:\x20\x22...\x22\x20}`)\x0a-\x20**On\x20Error**:\x20Throws\x20LovrabetError\x20with\x20`{\x20message,\x20status,\x20code,\x20data\x20}`\x0a-\x20**Always\x20use\x20try-catch**\x20when\x20calling\x20SDK\x20methods\x0a\x0a###\x20Data\x20Query\x20Best\x20Practices\x0a-\x20**filter**:\x20Most\x20flexible,\x20supports\x20complex\x20WHERE\x20conditions,\x20pagination,\x20sorting\x20—\x20use\x20this\x20for\x20queries\x0a-\x20**getOne**:\x20Single\x20record\x20by\x20primary\x20key\x20ID\x20only\x0a-\x20**getList**:\x20Simple\x20unfiltered\x20listing\x20(rarely\x20needed)\x0a\x0a##\x20Custom\x20SQL\x20Execution\x0a\x0a###\x20Frontend\x20SDK\x0a```typescript\x0aconst\x20data\x20=\x20await\x20client.sql.execute({\x20sqlCode:\x20\x27xxx\x27,\x20params:\x20{\x20key:\x20\x27value\x27\x20}\x20});\x0aif\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0a```\x0a\x0a###\x20Backend\x20Function\x20(BFF)\x0a```javascript\x0a//\x20context.client.sql.execute\x20returns\x20rows\x20directly\x20—\x20NO\x20wrapper\x20object\x0aconst\x20rows\x20=\x20await\x20context.client.sql.execute({\x20sqlCode:\x20\x27xxx\x27,\x20params:\x20{\x20key:\x20\x27value\x27\x20}\x20});\x0a//\x20rows\x20is\x20T[]\x20directly,\x20errors\x20throw\x20exceptions\x0a```\x0a\x0a>\x20Note:\x20`client.api.executeSql()`\x20is\x20deprecated.\x20Use\x20`client.sql.execute()`.\x0a\x0a##\x20MyBatis\x20Dynamic\x20SQL\x0aSQL\x20content\x20supports\x20MyBatis\x20syntax:\x20`#{param}`,\x20`<if\x20test=\x22\x22>`,\x20`<where>`,\x20`<foreach>`.\x0aUse\x20`<\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-\x20generate_sql_code\x20supports\x20target=\x27sdk\x27\x20(default)\x20or\x20target=\x27bff\x27\x20for\x20context-appropriate\x20code','Client-side\x20filter\x20by\x20category','Application\x20code\x20(optional\x20if\x20LOVRABET_APP_CODE\x20env\x20var\x20is\x20set)','Execute\x20Custom\x20SQL','Get\x20detailed\x20dataset\x20information\x20including\x20fields,\x20operations,\x20and\x20bidirectional\x20relations\x20(outgoing\x20+\x20incoming).\x20Returns\x20_relations\x20(structured\x20graph\x20edges),\x20_relationsSummary\x20(natural\x20language\x20overview),\x20and\x20_usageHints\x20(actionable\x20advice\x20based\x20on\x20the\x20dataset\x27s\x20position\x20in\x20the\x20relation\x20graph).','SQL\x20name/label','SQL\x20SELECT\x20statement\x20(supports\x20MyBatis\x20syntax)','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.','Version:\x20','get_dataset_operations','Search\x20keyword','Dataset\x20ID\x20(numeric)\x20or\x20code\x20(UUID)','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation,\x20including\x20field\x20metadata.\x20Check\x20user\x27s\x20@lovrabet/sdk\x20version\x20in\x20package.json\x20first.','text','array','Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update)','login','Items\x20per\x20page\x20(default:\x20999)','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode.\x20Get\x20sqlCode\x20from\x20list_sql_queries\x20first.','Get\x20Dataset\x20Detail','Login','log','\x0a-\x20Use\x20list_bff_scripts\x20/\x20get_bff_script_info\x20to\x20browse\x20and\x20read\x20Backend\x20Function\x20scripts\x0a-\x20save_or_update_bff_script\x20saves\x20script\x20and\x20automatically\x20clears\x20runtime\x20cache','enum','version','Generate\x20code\x20for\x20a\x20custom\x20SQL\x20query.\x20Validates\x20sqlCode\x20exists\x20first.\x20Use\x20target\x20to\x20switch\x20between\x20Frontend\x20SDK\x20and\x20Backend\x20Function\x20code\x20patterns.','Server\x20started\x20successfully','get_dataset_detail','16269130wyODlD','daily','env','Backend\x20Function\x20tools\x20enabled\x20(--dangerously-bff-save)','Save\x20or\x20Update\x20Custom\x20SQL','Example\x20parameter\x20values','Get\x20list\x20of\x20all\x20API\x20operations\x20for\x20a\x20dataset.\x20Prefer\x20\x22filter\x22\x20for\x20queries,\x20\x22getOne\x22\x20for\x20single\x20record\x20by\x20ID.','SQL\x20ID\x20(for\x20updating\x20existing\x20SQL)'];a7_0x1cd1=function(){return _0x3dfdcf;};return a7_0x1cd1();}const a7_0x4d5b7d=a7_0x5560;(function(_0x31881b,_0x24b771){const _0x14ff6e=a7_0x5560,_0x491049=_0x31881b();while(!![]){try{const _0x2cd684=parseInt(_0x14ff6e(0x219))/0x1*(parseInt(_0x14ff6e(0x238))/0x2)+parseInt(_0x14ff6e(0x22f))/0x3+-parseInt(_0x14ff6e(0x22e))/0x4+-parseInt(_0x14ff6e(0x231))/0x5*(-parseInt(_0x14ff6e(0x23a))/0x6)+parseInt(_0x14ff6e(0x1e1))/0x7*(-parseInt(_0x14ff6e(0x21d))/0x8)+-parseInt(_0x14ff6e(0x218))/0x9+parseInt(_0x14ff6e(0x210))/0xa;if(_0x2cd684===_0x24b771)break;else _0x491049['push'](_0x491049['shift']());}catch(_0x441d47){_0x491049['push'](_0x491049['shift']());}}}(a7_0x1cd1,0xd89e1));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(a7_0x4d5b7d(0x221)),authSchema={'appCode':z[a7_0x4d5b7d(0x1e7)]()[a7_0x4d5b7d(0x22d)]()['describe'](a7_0x4d5b7d(0x1f6)),'cookie':z[a7_0x4d5b7d(0x1e7)]()[a7_0x4d5b7d(0x22d)]()['describe'](a7_0x4d5b7d(0x23e))};function registerToolWithOptions(_0x3332f5,_0x251a42,_0x4629d5,_0x256d9e){_0x3332f5['registerTool'](_0x251a42,_0x4629d5,_0x256d9e);}function wrapHandler(_0x2c6c39){return async _0x649b59=>{const _0x195b77=a7_0x5560;try{const _0xf8c0ef=await _0x2c6c39(_0x649b59);return{'content':[{'type':_0x195b77(0x201),'text':JSON[_0x195b77(0x1f1)](_0xf8c0ef,null,0x2)}]};}catch(_0xad6e93){return{'content':[{'type':'text','text':JSON['stringify']({'error':!![],'message':_0xad6e93[_0x195b77(0x232)]||_0x195b77(0x247)},null,0x2)}],'isError':!![]};}};}export class LovrabetDatasetMCPServer{[a7_0x4d5b7d(0x1eb)];[a7_0x4d5b7d(0x236)];constructor(_0x4c05d7={}){const _0x15a052=a7_0x4d5b7d;this['options']=_0x4c05d7,this[_0x15a052(0x1eb)]=new McpServer({'name':'lovrabet-dataset-mcp','version':packageJson[_0x15a052(0x20c)]},{'capabilities':{'tools':{}},'instructions':buildInstructions(_0x4c05d7)}),this[_0x15a052(0x220)]();}[a7_0x4d5b7d(0x220)](){const _0x9de8cf=a7_0x4d5b7d;registerToolWithOptions(this['mcpServer'],_0x9de8cf(0x204),{'title':_0x9de8cf(0x208),'description':_0x9de8cf(0x21b),'inputSchema':{'env':z[_0x9de8cf(0x20b)]([_0x9de8cf(0x227),_0x9de8cf(0x211)])[_0x9de8cf(0x22d)]()[_0x9de8cf(0x1e8)](_0x9de8cf(0x235))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(login)),registerToolWithOptions(this[_0x9de8cf(0x1eb)],'list_datasets',{'title':'List\x20Datasets','description':_0x9de8cf(0x244),'inputSchema':{...authSchema,'forceRefresh':z[_0x9de8cf(0x241)]()['optional']()[_0x9de8cf(0x1e8)](_0x9de8cf(0x21f)),'includeRelations':z['boolean']()[_0x9de8cf(0x22d)]()['describe'](_0x9de8cf(0x228))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listDatasets)),registerToolWithOptions(this['mcpServer'],_0x9de8cf(0x21a),{'title':'Search\x20Datasets','description':_0x9de8cf(0x222),'inputSchema':{...authSchema,'keyword':z[_0x9de8cf(0x1e7)]()[_0x9de8cf(0x1e8)](_0x9de8cf(0x1fe))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(searchDatasets)),registerToolWithOptions(this[_0x9de8cf(0x1eb)],_0x9de8cf(0x20f),{'title':_0x9de8cf(0x207),'description':_0x9de8cf(0x1f8),'inputSchema':{...authSchema,'datasetCode':z['string']()[_0x9de8cf(0x1e8)](_0x9de8cf(0x1ff)),'forceRefresh':z[_0x9de8cf(0x241)]()[_0x9de8cf(0x22d)]()[_0x9de8cf(0x1e8)](_0x9de8cf(0x21f)),'includeRelations':z[_0x9de8cf(0x241)]()[_0x9de8cf(0x22d)]()[_0x9de8cf(0x1e8)](_0x9de8cf(0x225))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetDetail)),registerToolWithOptions(this['mcpServer'],_0x9de8cf(0x1fd),{'title':_0x9de8cf(0x233),'description':_0x9de8cf(0x216),'inputSchema':{...authSchema,'datasetCode':z['string']()[_0x9de8cf(0x1e8)](_0x9de8cf(0x1ff))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetOperations)),registerToolWithOptions(this[_0x9de8cf(0x1eb)],_0x9de8cf(0x1ee),{'title':_0x9de8cf(0x1e3),'description':'Get\x20detailed\x20operation\x20information\x20including\x20request/response\x20examples.','inputSchema':{...authSchema,'datasetCode':z[_0x9de8cf(0x1e7)]()['describe'](_0x9de8cf(0x24b)),'operationName':z['string']()[_0x9de8cf(0x1e8)](_0x9de8cf(0x203))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getOperationDetail)),registerToolWithOptions(this['mcpServer'],_0x9de8cf(0x1e5),{'title':'Generate\x20SDK\x20Code','description':_0x9de8cf(0x200),'inputSchema':{...authSchema,'datasetCode':z[_0x9de8cf(0x1e7)]()[_0x9de8cf(0x1e8)](_0x9de8cf(0x24b)),'operationName':z[_0x9de8cf(0x1e7)]()[_0x9de8cf(0x1e8)](_0x9de8cf(0x203)),'includeImports':z[_0x9de8cf(0x241)]()['optional']()[_0x9de8cf(0x1e8)](_0x9de8cf(0x230)),'useAlias':z['boolean']()['optional']()[_0x9de8cf(0x1e8)]('Use\x20camelCase\x20alias\x20instead\x20of\x20dataset_[code]\x20pattern\x20(default:\x20false)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSDKCode)),registerToolWithOptions(this[_0x9de8cf(0x1eb)],_0x9de8cf(0x22c),{'title':'List\x20SQL\x20Queries','description':_0x9de8cf(0x1e9),'inputSchema':{...authSchema,'keyword':z[_0x9de8cf(0x1e7)]()[_0x9de8cf(0x22d)]()[_0x9de8cf(0x1e8)](_0x9de8cf(0x223)),'category':z[_0x9de8cf(0x1e7)]()[_0x9de8cf(0x22d)]()[_0x9de8cf(0x1e8)](_0x9de8cf(0x1f5)),'sqlCode':z[_0x9de8cf(0x1e7)]()[_0x9de8cf(0x22d)]()['describe'](_0x9de8cf(0x242)),'sqlName':z[_0x9de8cf(0x1e7)]()[_0x9de8cf(0x22d)]()[_0x9de8cf(0x1e8)]('Server-side\x20fuzzy\x20match\x20by\x20sqlName'),'pageSize':z[_0x9de8cf(0x22b)]()[_0x9de8cf(0x22d)]()[_0x9de8cf(0x1e8)](_0x9de8cf(0x205)),'currentPage':z[_0x9de8cf(0x22b)]()['optional']()[_0x9de8cf(0x1e8)](_0x9de8cf(0x243))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listSqlQueries)),registerToolWithOptions(this['mcpServer'],_0x9de8cf(0x248),{'title':_0x9de8cf(0x1f7),'description':_0x9de8cf(0x206),'inputSchema':{...authSchema,'sqlCode':z['string']()[_0x9de8cf(0x245)](0x1)['describe']('SQL\x20code\x20from\x20list_sql_queries\x20->\x20sqlCode'),'params':z['record'](z[_0x9de8cf(0x246)]([z[_0x9de8cf(0x1e7)](),z[_0x9de8cf(0x22b)]()]))['optional']()[_0x9de8cf(0x1e8)](_0x9de8cf(0x1f2))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(executeCustomSql)),registerToolWithOptions(this['mcpServer'],_0x9de8cf(0x234),{'title':_0x9de8cf(0x23b),'description':_0x9de8cf(0x20d),'inputSchema':{...authSchema,'sqlCode':z[_0x9de8cf(0x1e7)]()['min'](0x1)[_0x9de8cf(0x1e8)]('SQL\x20code\x20from\x20list_sql_queries\x20(must\x20exist)'),'params':z[_0x9de8cf(0x239)](z[_0x9de8cf(0x246)]([z['string'](),z[_0x9de8cf(0x22b)]()]))[_0x9de8cf(0x22d)]()['describe'](_0x9de8cf(0x215)),'includeImports':z[_0x9de8cf(0x241)]()[_0x9de8cf(0x22d)]()[_0x9de8cf(0x1e8)](_0x9de8cf(0x230)),'target':z[_0x9de8cf(0x20b)](['sdk','bff'])['optional']()['describe'](_0x9de8cf(0x21e))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSqlCode)),registerToolWithOptions(this[_0x9de8cf(0x1eb)],_0x9de8cf(0x237),{'title':'Validate\x20SQL\x20Content','description':_0x9de8cf(0x24a),'inputSchema':{...authSchema,'sqlContent':z['string']()[_0x9de8cf(0x245)](0x1)[_0x9de8cf(0x1e8)]('SQL\x20content\x20to\x20validate'),'dbId':z[_0x9de8cf(0x22b)]()['optional']()[_0x9de8cf(0x1e8)]('Database\x20ID\x20(optional)'),'validateSchemas':z[_0x9de8cf(0x202)](z[_0x9de8cf(0x1e7)]())[_0x9de8cf(0x22d)]()['describe']('Dataset\x20codes\x20to\x20validate\x20against')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(validateSqlContent)),registerToolWithOptions(this[_0x9de8cf(0x1eb)],_0x9de8cf(0x240),{'title':_0x9de8cf(0x214),'description':_0x9de8cf(0x1fb),'inputSchema':{...authSchema,'sqlName':z[_0x9de8cf(0x1e7)]()[_0x9de8cf(0x245)](0x1)['describe'](_0x9de8cf(0x1f9)),'dbId':z[_0x9de8cf(0x22b)]()[_0x9de8cf(0x1e8)](_0x9de8cf(0x1e2)),'sqlContent':z[_0x9de8cf(0x1e7)]()[_0x9de8cf(0x245)](0x1)[_0x9de8cf(0x1e8)](_0x9de8cf(0x1fa)),'id':z['number']()[_0x9de8cf(0x22d)]()[_0x9de8cf(0x1e8)](_0x9de8cf(0x217))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':![]}},wrapHandler(saveOrUpdateCustomSql)),this[_0x9de8cf(0x236)][_0x9de8cf(0x249)]&&(registerToolWithOptions(this[_0x9de8cf(0x1eb)],_0x9de8cf(0x1ed),{'title':_0x9de8cf(0x1ea),'description':_0x9de8cf(0x23d),'inputSchema':{...authSchema},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listBffScripts)),registerToolWithOptions(this[_0x9de8cf(0x1eb)],_0x9de8cf(0x23f),{'title':_0x9de8cf(0x1f0),'description':_0x9de8cf(0x229),'inputSchema':{...authSchema,'id':z[_0x9de8cf(0x22b)]()[_0x9de8cf(0x1e8)]('Backend\x20Function\x20ID\x20(from\x20list_bff_scripts)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getBffScriptInfo)),registerToolWithOptions(this[_0x9de8cf(0x1eb)],_0x9de8cf(0x21c),{'title':'Save\x20or\x20Update\x20Backend\x20Function','description':_0x9de8cf(0x1ec),'inputSchema':{...authSchema,'id':z[_0x9de8cf(0x22b)]()[_0x9de8cf(0x22d)]()[_0x9de8cf(0x1e8)](_0x9de8cf(0x1e6)),'description':z[_0x9de8cf(0x1e7)]()['min'](0x1)['describe'](_0x9de8cf(0x22a)),'scriptContent':z['string']()[_0x9de8cf(0x245)](0x1)[_0x9de8cf(0x1e8)](_0x9de8cf(0x1ef))},'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':![]}},wrapHandler(saveOrUpdateBffScript)));}get[a7_0x4d5b7d(0x226)](){const _0x5d94f6=a7_0x4d5b7d;return this[_0x5d94f6(0x1eb)];}async['connect'](_0x2c2d73){const _0x2e2a2a=a7_0x4d5b7d;await this[_0x2e2a2a(0x1eb)][_0x2e2a2a(0x23c)](_0x2c2d73);}async[a7_0x4d5b7d(0x224)](){const _0x3462d0=a7_0x4d5b7d;await this[_0x3462d0(0x1eb)][_0x3462d0(0x224)]();}['logInfo'](){const _0x11fd12=a7_0x4d5b7d;if(!process[_0x11fd12(0x212)][_0x11fd12(0x1e4)])return;console[_0x11fd12(0x209)](_0x11fd12(0x1f3)),console['log'](_0x11fd12(0x1fc)+packageJson['version']),console[_0x11fd12(0x209)](_0x11fd12(0x20e)),this[_0x11fd12(0x236)][_0x11fd12(0x249)]&&console['log'](_0x11fd12(0x213));}}function buildInstructions(_0x583168){const _0xd9de27=a7_0x4d5b7d,_0x25fdd1=_0x583168['bffAutosave']===!![],_0x39a588=_0x25fdd1?_0xd9de27(0x20a):'';return _0xd9de27(0x1f4)+_0x39a588+'\x0a';}function a7_0x5560(_0x2ed49f,_0x23ae2b){_0x2ed49f=_0x2ed49f-0x1e1;const _0x1cd1ea=a7_0x1cd1();let _0x556013=_0x1cd1ea[_0x2ed49f];return _0x556013;}export function createServer(_0xbc24a4){return new LovrabetDatasetMCPServer(_0xbc24a4);}
|
|
1
|
+
const a9_0x2abb8e=a9_0x4c60;(function(_0x3c78e6,_0x2010c1){const _0x3a1170=a9_0x4c60,_0xc082b3=_0x3c78e6();while(!![]){try{const _0x4d4dbe=parseInt(_0x3a1170(0x17a))/0x1*(parseInt(_0x3a1170(0x186))/0x2)+-parseInt(_0x3a1170(0x1bd))/0x3*(-parseInt(_0x3a1170(0x17b))/0x4)+-parseInt(_0x3a1170(0x18e))/0x5+parseInt(_0x3a1170(0x19b))/0x6*(-parseInt(_0x3a1170(0x1d3))/0x7)+-parseInt(_0x3a1170(0x170))/0x8*(-parseInt(_0x3a1170(0x17f))/0x9)+-parseInt(_0x3a1170(0x178))/0xa*(parseInt(_0x3a1170(0x177))/0xb)+-parseInt(_0x3a1170(0x1c5))/0xc*(-parseInt(_0x3a1170(0x1a4))/0xd);if(_0x4d4dbe===_0x2010c1)break;else _0xc082b3['push'](_0xc082b3['shift']());}catch(_0x2552da){_0xc082b3['push'](_0xc082b3['shift']());}}}(a9_0x5b28,0xa0fa7));function a9_0x5b28(){const _0x472748=['Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20via\x20toolbox.\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20WITH\x20are\x20auto-saved;\x20DELETE\x20and\x20DDL\x20are\x20blocked\x20for\x20safety.\x20If\x20the\x20last\x20submitter\x20was\x20someone\x20else,\x20returns\x20blocked=true\x20—\x20tell\x20the\x20user\x20to\x20operate\x20manually,\x20do\x20NOT\x20retry.\x20Supports\x20MyBatis\x20syntax.\x20Get\x20dbId\x20from\x20get_dataset_detail.','SQL\x20parameters','Client-side\x20filter\x20by\x20name/description/content','Dataset\x20codes\x20to\x20validate\x20against','bff','list_datasets','Lovrabet\x20Dataset\x20MCP\x20Server','log','Execute\x20Custom\x20SQL','Generate\x20SDK\x20Code','SQL\x20name/label\x20(optional;\x20MCP\x20auto-extracts\x20from\x20@lovrabet.sqlName\x20comment,\x20or\x20toolbox\x20generates\x20fallback)','Validate\x20SQL\x20content\x20without\x20saving.\x20Detects\x20SQL\x20type\x20(SELECT/INSERT/UPDATE/DELETE/DDL)\x20and\x20validates\x20table/column\x20existence.\x20Supports\x20MyBatis\x20syntax.','generate_sdk_code','MCP_DEBUG','3smEwJI','Server\x20started\x20successfully','SQL\x20content\x20(SELECT/INSERT/UPDATE/WITH\x20auto-saved;\x20DELETE/DDL\x20blocked).\x20Supports\x20MyBatis\x20syntax.','mcpServer','SQL\x20content\x20to\x20validate','Save\x20or\x20Update\x20Custom\x20SQL','Known\x20sqlCode\x20—\x20use\x20to\x20directly\x20target\x20the\x20record\x20for\x20update,\x20skipping\x20name\x20lookup','Login\x20to\x20Lovrabet\x20to\x20authenticate\x20for\x20dataset\x20queries.','12998712fFYGRn','get_dataset_operations','Get\x20list\x20of\x20all\x20API\x20operations\x20for\x20a\x20dataset.\x20Prefer\x20\x22filter\x22\x20for\x20queries,\x20\x22getOne\x22\x20for\x20single\x20record\x20by\x20ID.','Include\x20table\x20relations\x20(default:\x20true)','Get\x20Operation\x20Detail','generate_sql_code','daily','You\x20are\x20an\x20AI\x20assistant\x20helping\x20developers\x20work\x20with\x20the\x20Lovrabet\x20data\x20platform.\x0a\x0a##\x20Two\x20Runtime\x20Contexts:\x20Frontend\x20SDK\x20vs\x20Backend\x20Function\x20(BFF)\x0a\x0aLovrabet\x20has\x20two\x20code\x20execution\x20contexts\x20with\x20**identical\x20calling\x20methods\x20but\x20different\x20return\x20structures**:\x0a\x0a###\x20Frontend\x20TypeScript\x20SDK\x20(`@lovrabet/sdk`)\x0a-\x20Runs\x20in\x20browser/Node.js,\x20imported\x20via\x20`import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27`\x0a-\x20Model\x20operations\x20return\x20unwrapped\x20data\x20on\x20success,\x20throw\x20LovrabetError\x20on\x20error\x0a-\x20SQL\x20execution\x20returns\x20wrapper:\x20`{\x20execSuccess,\x20execResult\x20}`\x0a\x0a###\x20Backend\x20Function\x20(BFF)\x0a-\x20Runs\x20on\x20Lovrabet\x20server,\x20function\x20signature:\x20`export\x20default\x20async\x20function(params,\x20context)\x20{\x20...\x20}`\x0a-\x20Use\x20`context.client`\x20to\x20access\x20the\x20same\x20SDK\x20methods\x0a-\x20Model\x20operations\x20behave\x20the\x20same\x20as\x20SDK\x0a-\x20**SQL\x20execution\x20returns\x20direct\x20array**\x20`T[]`,\x20errors\x20throw\x20exceptions\x20(no\x20wrapper)\x0a\x0a>\x20**CRITICAL**:\x20Always\x20ask\x20or\x20determine\x20which\x20context\x20the\x20user\x20is\x20working\x20in\x20before\x20generating\x20code.\x0a\x0a##\x20SDK\x20Usage\x20Patterns\x0a\x0a###\x20Model\x20Access\x20(SDK\x20>=\x201.2.0)\x0a-\x20Default:\x20`client.models.dataset_[code].filter()`\x0a-\x20Alias:\x20`client.models.[alias].filter()`\x20(check\x20user\x27s\x20createClient/registerModels\x20config\x20for\x20actual\x20alias)\x0a-\x20For\x20SDK\x20<\x201.2.0:\x20only\x20`client.models.[key]`\x20where\x20key\x20is\x20defined\x20in\x20createClient/registerModels\x0a\x0a###\x20SDK\x20Return\x20Value\x20Behavior\x0a-\x20**On\x20Success**:\x20Returns\x20ONLY\x20the\x20\x27data\x27\x20field\x20content\x20(e.g.,\x20`{\x20id:\x20123,\x20name:\x20\x22...\x22\x20}`)\x0a-\x20**On\x20Error**:\x20Throws\x20LovrabetError\x20with\x20`{\x20message,\x20status,\x20code,\x20data\x20}`\x0a-\x20**Always\x20use\x20try-catch**\x20when\x20calling\x20SDK\x20methods\x0a\x0a###\x20Data\x20Query\x20Best\x20Practices\x0a-\x20**filter**:\x20Most\x20flexible,\x20supports\x20complex\x20WHERE\x20conditions,\x20pagination,\x20sorting\x20—\x20use\x20this\x20for\x20queries\x0a-\x20**getOne**:\x20Single\x20record\x20by\x20primary\x20key\x20ID\x20only\x0a-\x20**getList**:\x20Simple\x20unfiltered\x20listing\x20(rarely\x20needed)\x0a\x0a##\x20Custom\x20SQL\x20Execution\x0a\x0a###\x20Frontend\x20SDK\x0a```typescript\x0aconst\x20data\x20=\x20await\x20client.sql.execute({\x20sqlCode:\x20\x27xxx\x27,\x20params:\x20{\x20key:\x20\x27value\x27\x20}\x20});\x0aif\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0a```\x0a\x0a###\x20Backend\x20Function\x20(BFF)\x0a```javascript\x0a//\x20context.client.sql.execute\x20returns\x20rows\x20directly\x20—\x20NO\x20wrapper\x20object\x0aconst\x20rows\x20=\x20await\x20context.client.sql.execute({\x20sqlCode:\x20\x27xxx\x27,\x20params:\x20{\x20key:\x20\x27value\x27\x20}\x20});\x0a//\x20rows\x20is\x20T[]\x20directly,\x20errors\x20throw\x20exceptions\x0a```\x0a\x0a>\x20Note:\x20`client.api.executeSql()`\x20is\x20deprecated.\x20Use\x20`client.sql.execute()`.\x0a\x0a##\x20MyBatis\x20Dynamic\x20SQL\x0aSQL\x20content\x20supports\x20MyBatis\x20syntax:\x20`#{param}`,\x20`<if\x20test=\x22\x22>`,\x20`<where>`,\x20`<foreach>`.\x0aUse\x20`<\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-\x20save_or_update_custom_sql\x20routes\x20through\x20toolbox;\x20DELETE/DDL\x20are\x20blocked;\x20if\x20blocked=true\x20(last\x20submitter\x20conflict)\x20tell\x20the\x20user\x20to\x20operate\x20manually\x20—\x20do\x20NOT\x20retry\x0a-\x20generate_sql_code\x20supports\x20target=\x27sdk\x27\x20(default)\x20or\x20target=\x27bff\x27\x20for\x20context-appropriate\x20code','JavaScript/TypeScript\x20code\x20with\x20default\x20export','Conflict\x20detection\x20is\x20handled\x20server-side\x20by\x20toolbox','registerAllTools','Search\x20keyword','list_bff_scripts','Server-side\x20fuzzy\x20match\x20by\x20sqlName','28aAyqvO','stringify','Generate\x20SQL\x20Code','List\x20Backend\x20Functions','List\x20SQL\x20Queries','Authentication\x20cookie\x20(optional,\x20uses\x20stored\x20cookie\x20from\x20login\x20if\x20not\x20provided)','Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update)','8rkYGaY','string','List\x20all\x20available\x20custom\x20SQL\x20queries\x20with\x20metadata\x20and\x20parameters.','Target\x20context:\x20\x22sdk\x22\x20(Frontend\x20SDK,\x20default)\x20or\x20\x22bff\x22\x20(Backend\x20Function).\x20SDK\x20returns\x20{execSuccess,\x20execResult}\x20wrapper;\x20BFF\x20returns\x20rows\x20directly.','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode.\x20Get\x20sqlCode\x20from\x20list_sql_queries\x20first.','connect','Environment\x20(optional,\x20uses\x20LOVRABET_ENV\x20or\x20defaults\x20to\x20online)','4453262LTVPCR','10XDfYuX','get_dataset_detail','1ssRpoF','2902620adaFHE','Generate\x20code\x20for\x20a\x20custom\x20SQL\x20query.\x20Validates\x20sqlCode\x20exists\x20first.\x20Use\x20target\x20to\x20switch\x20between\x20Frontend\x20SDK\x20and\x20Backend\x20Function\x20code\x20patterns.','Database\x20ID\x20(optional)','get_bff_script_info','7222086NbfUyQ','Use\x20camelCase\x20alias\x20instead\x20of\x20dataset_[code]\x20pattern\x20(default:\x20false)','array','Example\x20parameter\x20values','Get\x20detailed\x20operation\x20information\x20including\x20request/response\x20examples.','record','logInfo','455458XSUFAp','optional','Include\x20import\x20statements\x20(default:\x20true)','list_sql_queries','options','Backend\x20Function\x20ID\x20(from\x20list_bff_scripts)','login','get_operation_detail','2417835DbENGi','close','Dataset\x20code/ID','enum','Unknown\x20error\x20occurred','SQL\x20code\x20from\x20list_sql_queries\x20(must\x20exist)','Application\x20code\x20(optional\x20if\x20LOVRABET_APP_CODE\x20env\x20var\x20is\x20set)','min','sdk','../package.json','Get\x20Dataset\x20Detail','Items\x20per\x20page\x20(default:\x20999)','message','1936932CedEfB','Version:\x20','Get\x20Backend\x20Function\x20Info','Get\x20Operations','bffSaveEnabled','Server-side\x20fuzzy\x20match\x20by\x20sqlCode','search_datasets','version','save_or_update_custom_sql','13jFsBqx','SQL\x20ID\x20(kept\x20for\x20backward\x20compatibility,\x20not\x20used\x20by\x20toolbox)','union','Save\x20or\x20update\x20a\x20Backend\x20Function\x20script\x20via\x20toolbox\x20(server-side\x20submitter\x20check\x20+\x20automatic\x20cache\x20clearing).\x20If\x20blocked=true\x20is\x20returned,\x20the\x20last\x20submitter\x20was\x20someone\x20else\x20—\x20tell\x20the\x20user\x20to\x20operate\x20manually,\x20do\x20NOT\x20retry.','Validate\x20SQL\x20Content','save_or_update_bff_script','Client-side\x20filter\x20by\x20category','env','boolean','number','describe'];a9_0x5b28=function(){return _0x472748;};return a9_0x5b28();}import{McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';import{z}from'zod';import{createRequire}from'module';import{login,listDatasets,getDatasetDetail,getDatasetOperations,getOperationDetail,generateSDKCode,searchDatasets,listSqlQueries,saveOrUpdateCustomSql,executeCustomSql,generateSqlCode,validateSqlContent,listBffScripts,getBffScriptInfo,saveOrUpdateBffScript}from'./tools/index.js';const require=createRequire(import.meta.url),packageJson=require(a9_0x2abb8e(0x197)),authSchema={'appCode':z[a9_0x2abb8e(0x171)]()[a9_0x2abb8e(0x187)]()[a9_0x2abb8e(0x1ae)](a9_0x2abb8e(0x194)),'cookie':z[a9_0x2abb8e(0x171)]()['optional']()[a9_0x2abb8e(0x1ae)](a9_0x2abb8e(0x16e))};function registerToolWithOptions(_0x1f2dea,_0x10e0fc,_0x1dad6a,_0xe7eb4a){_0x1f2dea['registerTool'](_0x10e0fc,_0x1dad6a,_0xe7eb4a);}function wrapHandler(_0x47ac1d){return async _0x52b8fd=>{const _0x242d73=a9_0x4c60;try{const _0x52cde4=await _0x47ac1d(_0x52b8fd);return{'content':[{'type':'text','text':JSON['stringify'](_0x52cde4,null,0x2)}]};}catch(_0x1bbcb9){return{'content':[{'type':'text','text':JSON[_0x242d73(0x16a)]({'error':!![],'message':_0x1bbcb9[_0x242d73(0x19a)]||_0x242d73(0x192)},null,0x2)}],'isError':!![]};}};}export class LovrabetDatasetMCPServer{[a9_0x2abb8e(0x1c0)];['options'];constructor(_0x2d8b85={}){const _0x58abb9=a9_0x2abb8e;this[_0x58abb9(0x18a)]=_0x2d8b85,this[_0x58abb9(0x1c0)]=new McpServer({'name':'lovrabet-dataset-mcp','version':packageJson['version']},{'capabilities':{'tools':{}},'instructions':buildInstructions(_0x2d8b85)}),this[_0x58abb9(0x1cf)]();}[a9_0x2abb8e(0x1cf)](){const _0x4ae62e=a9_0x2abb8e;registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x18c),{'title':'Login','description':_0x4ae62e(0x1c4),'inputSchema':{'env':z[_0x4ae62e(0x191)](['online',_0x4ae62e(0x1cb)])[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x176))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(login)),registerToolWithOptions(this['mcpServer'],_0x4ae62e(0x1b4),{'title':'List\x20Datasets','description':'Get\x20list\x20of\x20all\x20datasets\x20with\x20metadata\x20and\x20table\x20relations\x20(ER\x20Config).\x20Use\x20includeRelations:\x20false\x20for\x20faster\x20response.','inputSchema':{...authSchema,'forceRefresh':z[_0x4ae62e(0x1ac)]()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)]('Bypass\x20cache\x20(default:\x20false)'),'includeRelations':z[_0x4ae62e(0x1ac)]()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1c8))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listDatasets)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x1a1),{'title':'Search\x20Datasets','description':'Search\x20datasets\x20by\x20keyword\x20(searches\x20in\x20name,\x20table\x20name,\x20code,\x20and\x20description).','inputSchema':{...authSchema,'keyword':z['string']()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1d0))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(searchDatasets)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x179),{'title':_0x4ae62e(0x198),'description':'Get\x20detailed\x20dataset\x20information\x20including\x20fields,\x20operations,\x20and\x20bidirectional\x20relations\x20(outgoing\x20+\x20incoming).\x20Returns\x20_relations\x20(structured\x20graph\x20edges),\x20_relationsSummary\x20(natural\x20language\x20overview),\x20and\x20_usageHints\x20(actionable\x20advice\x20based\x20on\x20the\x20dataset\x27s\x20position\x20in\x20the\x20relation\x20graph).','inputSchema':{...authSchema,'datasetCode':z['string']()['describe']('Dataset\x20ID\x20(numeric)\x20or\x20code\x20(UUID)'),'forceRefresh':z['boolean']()[_0x4ae62e(0x187)]()['describe']('Bypass\x20cache\x20(default:\x20false)'),'includeRelations':z['boolean']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)]('Include\x20bidirectional\x20relations,\x20summary,\x20and\x20usage\x20hints\x20(default:\x20true)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetDetail)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x1c6),{'title':_0x4ae62e(0x19e),'description':_0x4ae62e(0x1c7),'inputSchema':{...authSchema,'datasetCode':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x1ae)]('Dataset\x20ID\x20(numeric)\x20or\x20code\x20(UUID)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetOperations)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x18d),{'title':_0x4ae62e(0x1c9),'description':_0x4ae62e(0x183),'inputSchema':{...authSchema,'datasetCode':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x190)),'operationName':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x16f))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getOperationDetail)),registerToolWithOptions(this['mcpServer'],_0x4ae62e(0x1bb),{'title':_0x4ae62e(0x1b8),'description':'Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation,\x20including\x20field\x20metadata.\x20Check\x20user\x27s\x20@lovrabet/sdk\x20version\x20in\x20package.json\x20first.','inputSchema':{...authSchema,'datasetCode':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x190)),'operationName':z[_0x4ae62e(0x171)]()['describe']('Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update)'),'includeImports':z[_0x4ae62e(0x1ac)]()['optional']()[_0x4ae62e(0x1ae)](_0x4ae62e(0x188)),'useAlias':z[_0x4ae62e(0x1ac)]()['optional']()[_0x4ae62e(0x1ae)](_0x4ae62e(0x180))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSDKCode)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x189),{'title':_0x4ae62e(0x16d),'description':_0x4ae62e(0x172),'inputSchema':{...authSchema,'keyword':z['string']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1b1)),'category':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1aa)),'sqlCode':z['string']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1a0)),'sqlName':z['string']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1d2)),'pageSize':z[_0x4ae62e(0x1ad)]()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x199)),'currentPage':z[_0x4ae62e(0x1ad)]()['optional']()[_0x4ae62e(0x1ae)]('Page\x20number\x20(default:\x201)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listSqlQueries)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],'execute_custom_sql',{'title':_0x4ae62e(0x1b7),'description':_0x4ae62e(0x174),'inputSchema':{...authSchema,'sqlCode':z[_0x4ae62e(0x171)]()['min'](0x1)[_0x4ae62e(0x1ae)]('SQL\x20code\x20from\x20list_sql_queries\x20->\x20sqlCode'),'params':z[_0x4ae62e(0x184)](z[_0x4ae62e(0x1a6)]([z[_0x4ae62e(0x171)](),z[_0x4ae62e(0x1ad)]()]))['optional']()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1b0))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(executeCustomSql)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x1ca),{'title':_0x4ae62e(0x16b),'description':_0x4ae62e(0x17c),'inputSchema':{...authSchema,'sqlCode':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x195)](0x1)[_0x4ae62e(0x1ae)](_0x4ae62e(0x193)),'params':z[_0x4ae62e(0x184)](z[_0x4ae62e(0x1a6)]([z['string'](),z[_0x4ae62e(0x1ad)]()]))[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x182)),'includeImports':z[_0x4ae62e(0x1ac)]()['optional']()[_0x4ae62e(0x1ae)](_0x4ae62e(0x188)),'target':z[_0x4ae62e(0x191)]([_0x4ae62e(0x196),_0x4ae62e(0x1b3)])[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x173))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSqlCode)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],'validate_sql_content',{'title':_0x4ae62e(0x1a8),'description':_0x4ae62e(0x1ba),'inputSchema':{...authSchema,'sqlContent':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x195)](0x1)[_0x4ae62e(0x1ae)](_0x4ae62e(0x1c1)),'dbId':z[_0x4ae62e(0x1ad)]()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x17d)),'validateSchemas':z[_0x4ae62e(0x181)](z[_0x4ae62e(0x171)]())[_0x4ae62e(0x187)]()['describe'](_0x4ae62e(0x1b2))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(validateSqlContent)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x1a3),{'title':_0x4ae62e(0x1c2),'description':_0x4ae62e(0x1af),'inputSchema':{...authSchema,'sqlName':z['string']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1b9)),'sqlCode':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x187)]()['describe'](_0x4ae62e(0x1c3)),'dbId':z[_0x4ae62e(0x1ad)]()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)]('Database\x20ID\x20from\x20get_dataset_detail\x20—\x20required\x20when\x20creating\x20new\x20SQL,\x20optional\x20when\x20updating'),'sqlContent':z[_0x4ae62e(0x171)]()[_0x4ae62e(0x195)](0x1)[_0x4ae62e(0x1ae)](_0x4ae62e(0x1bf)),'id':z['number']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x1a5))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':![]}},wrapHandler(saveOrUpdateCustomSql)),this['options']['bffSaveEnabled']&&(registerToolWithOptions(this['mcpServer'],_0x4ae62e(0x1d1),{'title':_0x4ae62e(0x16c),'description':'List\x20all\x20Backend\x20Function\x20(ENDPOINT\x20type)\x20scripts.','inputSchema':{...authSchema},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listBffScripts)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x17e),{'title':_0x4ae62e(0x19d),'description':'Get\x20detailed\x20Backend\x20Function\x20script\x20including\x20full\x20source\x20code.','inputSchema':{...authSchema,'id':z[_0x4ae62e(0x1ad)]()[_0x4ae62e(0x1ae)](_0x4ae62e(0x18b))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getBffScriptInfo)),registerToolWithOptions(this[_0x4ae62e(0x1c0)],_0x4ae62e(0x1a9),{'title':'Save\x20or\x20Update\x20Backend\x20Function','description':_0x4ae62e(0x1a7),'inputSchema':{...authSchema,'id':z['number']()[_0x4ae62e(0x187)]()[_0x4ae62e(0x1ae)]('Backend\x20Function\x20ID\x20(for\x20updating)'),'description':z['string']()[_0x4ae62e(0x195)](0x1)['describe']('Function\x20description'),'scriptContent':z['string']()[_0x4ae62e(0x195)](0x1)[_0x4ae62e(0x1ae)](_0x4ae62e(0x1cd))},'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':![]}},wrapHandler(saveOrUpdateBffScript)));}get['server'](){const _0x26f3bc=a9_0x2abb8e;return this[_0x26f3bc(0x1c0)];}async[a9_0x2abb8e(0x175)](_0x5119b0){await this['mcpServer']['connect'](_0x5119b0);}async[a9_0x2abb8e(0x18f)](){const _0xf11363=a9_0x2abb8e;await this[_0xf11363(0x1c0)][_0xf11363(0x18f)]();}[a9_0x2abb8e(0x185)](){const _0x458346=a9_0x2abb8e;if(!process[_0x458346(0x1ab)][_0x458346(0x1bc)])return;console[_0x458346(0x1b6)](_0x458346(0x1b5)),console[_0x458346(0x1b6)](_0x458346(0x19c)+packageJson[_0x458346(0x1a2)]),console[_0x458346(0x1b6)](_0x458346(0x1be)),this[_0x458346(0x18a)][_0x458346(0x19f)]&&(console[_0x458346(0x1b6)]('Backend\x20Function\x20write\x20tools\x20enabled\x20(--enable-bff-save)'),console['log'](_0x458346(0x1ce)));}}function a9_0x4c60(_0x391261,_0x2806e6){_0x391261=_0x391261-0x16a;const _0x5b28ad=a9_0x5b28();let _0x4c60e5=_0x5b28ad[_0x391261];return _0x4c60e5;}function buildInstructions(_0x58608d){const _0x469122=a9_0x2abb8e,_0x1f802c=_0x58608d[_0x469122(0x19f)]===!![],_0xf9a88d=_0x1f802c?'\x0a-\x20Use\x20list_bff_scripts\x20/\x20get_bff_script_info\x20to\x20browse\x20and\x20read\x20Backend\x20Function\x20scripts\x0a-\x20save_or_update_bff_script\x20saves\x20script\x20via\x20toolbox\x20(server-side\x20submitter\x20check\x20+\x20automatic\x20cache\x20clearing)\x0a-\x20If\x20save\x20returns\x20blocked:\x20true,\x20tell\x20the\x20user\x20to\x20operate\x20manually\x20on\x20the\x20platform,\x20do\x20NOT\x20retry':'';return _0x469122(0x1cc)+_0xf9a88d+'\x0a';}export function createServer(_0x289350){return new LovrabetDatasetMCPServer(_0x289350);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x13e9ad,_0x36bd50){const _0x202184=a10_0x240d,_0x20bb85=_0x13e9ad();while(!![]){try{const _0x7f18e4=parseInt(_0x202184(0x1e9))/0x1*(parseInt(_0x202184(0x1f0))/0x2)+-parseInt(_0x202184(0x1df))/0x3+parseInt(_0x202184(0x1f3))/0x4*(-parseInt(_0x202184(0x1f8))/0x5)+parseInt(_0x202184(0x1fb))/0x6*(parseInt(_0x202184(0x1ed))/0x7)+-parseInt(_0x202184(0x1e2))/0x8+-parseInt(_0x202184(0x1ea))/0x9+-parseInt(_0x202184(0x1e5))/0xa*(-parseInt(_0x202184(0x1e8))/0xb);if(_0x7f18e4===_0x36bd50)break;else _0x20bb85['push'](_0x20bb85['shift']());}catch(_0x1c2374){_0x20bb85['push'](_0x20bb85['shift']());}}}(a10_0x2cfc,0x7c66d));function a10_0x2cfc(){const _0x7a8d04=['appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','31285WkPgac','message','SQL\x20executed\x20successfully.\x20Returned\x20','14226QRoGBr','keys','now','success','UNKNOWN','1622934SiDziQ','sqlCode\x20is\x20required.\x20Get\x20it\x20from\x20list_sql_queries\x20->\x20sqlCode','Unknown\x20error','4016208YwpPLu','msg',']:\x20','15415450jCiGab','length','\x20row(s).','11QDyeBo','8ReNIfM','811998dtrBsJ','ERR','errorMsg','413xNDWNs','API\x20call\x20failed:\x20','SQL\x20execution\x20failed:\x20','20056vTAbrU','executeSql','SQL\x20execution\x20failed\x20[','76gKMtGX','execError','errorCode','isArray'];a10_0x2cfc=function(){return _0x7a8d04;};return a10_0x2cfc();}import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode}from'../config/env.js';function a10_0x240d(_0x1309df,_0x33f428){_0x1309df=_0x1309df-0x1dc;const _0x2cfc5c=a10_0x2cfc();let _0x240dac=_0x2cfc5c[_0x1309df];return _0x240dac;}export async function executeCustomSql(_0x4ac3b1){const _0x2a78f1=a10_0x240d,_0x5b08b6=Date['now'](),{appCode:appCode=getEnvAppCode(),cookie:_0x372ea0,sqlCode:_0x230752,params:_0x2d68b1}=_0x4ac3b1;if(!appCode)throw new Error(_0x2a78f1(0x1f7));if(!_0x230752||_0x230752['trim']()==='')throw new Error(_0x2a78f1(0x1e0));const _0x46caf6=new DevApiClient({'appCode':appCode,'cookie':_0x372ea0}),_0x121f06=_0x2d68b1&&Object['keys'](_0x2d68b1)['length']>0x0,_0x20105a=_0x121f06?Object[_0x2a78f1(0x1fc)](_0x2d68b1):[],_0x4ba377={'sqlCode':_0x230752,'hasParams':_0x121f06||![],'paramNames':_0x20105a||[]};try{const _0x4ba786=await _0x46caf6[_0x2a78f1(0x1f1)]({'sqlCode':_0x230752['trim'](),'params':_0x2d68b1}),_0x57ccee=Date['now']()-_0x5b08b6,_0x223b45=_0x4ba786[_0x2a78f1(0x1dd)]??![],_0x10a055=_0x4ba786[_0x2a78f1(0x1f5)];if(!_0x223b45){const _0x115c09=_0x4ba786[_0x2a78f1(0x1ec)]||_0x4ba786[_0x2a78f1(0x1e3)]||_0x2a78f1(0x1e1);return{'success':![],'execSuccess':![],'execError':_0x115c09,'errorCode':_0x10a055||_0x2a78f1(0x1de),'message':_0x2a78f1(0x1f2)+(_0x10a055||_0x2a78f1(0x1eb))+_0x2a78f1(0x1e4)+_0x115c09,'executionTime':_0x57ccee,'sqlInfo':_0x4ba377};}const _0x15b819=_0x4ba786['data']||_0x4ba786,_0x519fa1=_0x15b819['execSuccess']??_0x15b819[_0x2a78f1(0x1dd)]??!![],_0x3c38f0=_0x15b819['execResult']||_0x15b819['data'],_0x45b387=_0x15b819[_0x2a78f1(0x1f4)]||_0x15b819[_0x2a78f1(0x1ec)];if(_0x519fa1){const _0x3a764e=Array[_0x2a78f1(0x1f6)](_0x3c38f0)?_0x3c38f0[_0x2a78f1(0x1e6)]:0x0;return{'success':!![],'execSuccess':!![],'execResult':_0x3c38f0||[],'rowCount':_0x3a764e,'message':_0x2a78f1(0x1fa)+_0x3a764e+_0x2a78f1(0x1e7),'executionTime':_0x57ccee,'sqlInfo':_0x4ba377};}return{'success':!![],'execSuccess':![],'execError':_0x45b387||'SQL\x20execution\x20failed\x20without\x20error\x20message','message':_0x2a78f1(0x1ef)+(_0x45b387||_0x2a78f1(0x1e1)),'executionTime':_0x57ccee,'sqlInfo':_0x4ba377};}catch(_0x5a37da){const _0xcf78bc=Date[_0x2a78f1(0x1dc)]()-_0x5b08b6;return{'success':![],'execSuccess':![],'execError':_0x5a37da[_0x2a78f1(0x1f9)]||_0x2a78f1(0x1e1),'message':_0x2a78f1(0x1ee)+(_0x5a37da[_0x2a78f1(0x1f9)]||'Unknown\x20error'),'executionTime':_0xcf78bc,'sqlInfo':_0x4ba377};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x40edc6,_0x302dc1){const _0x36c5ae=a11_0x20f0,_0x24ce32=_0x40edc6();while(!![]){try{const _0x1376bc=parseInt(_0x36c5ae(0x1a7))/0x1*(-parseInt(_0x36c5ae(0x1a4))/0x2)+-parseInt(_0x36c5ae(0x1a3))/0x3+parseInt(_0x36c5ae(0x198))/0x4*(parseInt(_0x36c5ae(0x19b))/0x5)+-parseInt(_0x36c5ae(0x1a0))/0x6+parseInt(_0x36c5ae(0x1a6))/0x7*(-parseInt(_0x36c5ae(0x1b3))/0x8)+parseInt(_0x36c5ae(0x19e))/0x9+parseInt(_0x36c5ae(0x1aa))/0xa*(parseInt(_0x36c5ae(0x1a1))/0xb);if(_0x1376bc===_0x302dc1)break;else _0x24ce32['push'](_0x24ce32['shift']());}catch(_0x407064){_0x24ce32['push'](_0x24ce32['shift']());}}}(a11_0x3c60,0xd5dc1));function a11_0x20f0(_0x5e8942,_0x43f2da){_0x5e8942=_0x5e8942-0x196;const _0x3c609b=a11_0x3c60();let _0x20f099=_0x3c609b[_0x5e8942];return _0x20f099;}function a11_0x3c60(){const _0x1007f2=['appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','//\x20数据集:\x20','getModelAlias','replace','4274488NyHBcm','operationName\x20is\x20required','code','1435216lcSrvn','getTableName','datasetCode\x20is\x20required','5XSIAmz','typescript','getDatasetSDKKey','15186204gcnteG','Cannot\x20generate\x20SDK\x20code\x20for\x20operation\x20\x27','7122822wiSVJn','33297sswHSc','\x27\x20in\x20dataset\x20\x27','3401253yWsTip','2fPPcOx','getTableKey','7RvBPXP','67625CHjTqC','getFieldList','data','5790heEoKT','name','getOperationDocMeta','generateAliasExplanation','\x20|\x20数据表:\x20'];a11_0x3c60=function(){return _0x1007f2;};return a11_0x3c60();}import{DevApiClient}from'../api/dev-api-client.js';import{DrivenDataDetailPlus}from'@lovrabet/dsparser';import{getEnvAppCode,getEnvironment}from'../config/env.js';import{buildFieldRelationsMap,enrichFieldsWithRelations}from'../utils/relations.js';export async function generateSDKCode(_0x36220f){const _0x1bf72e=a11_0x20f0,{appCode:appCode=getEnvAppCode(),cookie:_0x9c4b11,datasetCode:_0x3f0af6,operationName:_0x2ed055,includeImports:includeImports=!![],useAlias:useAlias=![]}=_0x36220f;if(!appCode)throw new Error(_0x1bf72e(0x1af));if(!_0x3f0af6)throw new Error(_0x1bf72e(0x19a));if(!_0x2ed055)throw new Error(_0x1bf72e(0x196));const _0x5bb17d=new DevApiClient({'appCode':appCode,'cookie':_0x9c4b11}),_0x3a91ac=getEnvironment(),_0x51ae3c=await _0x5bb17d['getDatasetDetail'](_0x3f0af6),_0x5f2c39=_0x51ae3c[_0x1bf72e(0x1a9)]||_0x51ae3c,_0x3e9636=new DrivenDataDetailPlus(_0x5f2c39),_0x472d6b=_0x3e9636[_0x1bf72e(0x1ac)](_0x2ed055);if(!_0x472d6b)throw new Error(_0x1bf72e(0x19f)+_0x2ed055+_0x1bf72e(0x1a2)+_0x3f0af6+'\x27');const _0x543a9e=_0x3e9636[_0x1bf72e(0x19d)](),_0x35f440=_0x3e9636[_0x1bf72e(0x1b1)](),_0x552364=_0x3e9636[_0x1bf72e(0x1a5)](),_0x3932cd=_0x3e9636[_0x1bf72e(0x199)](),_0x34a500=_0x3e9636[_0x1bf72e(0x1ab)],_0x2e30ab=_0x3e9636[_0x1bf72e(0x1a8)](),_0x50a94f=_0x2e30ab?.['toJSON']?.()||[],_0x16d3cd=buildFieldRelationsMap(_0x51ae3c),_0x372098=enrichFieldsWithRelations(_0x50a94f,_0x16d3cd),_0x16f051=_0x3e9636['generateFullSDKExample'](_0x2ed055,appCode),_0x3340a1=_0x3e9636['getOperationAnalysis'](_0x2ed055);let _0x5c1fec=_0x472d6b['sdkCall'][_0x1bf72e(0x197)],_0x4cf6e4=_0x16f051||undefined;useAlias&&(_0x5c1fec=_0x5c1fec[_0x1bf72e(0x1b2)](new RegExp(_0x543a9e,'g'),_0x35f440),_0x4cf6e4&&(_0x4cf6e4=_0x4cf6e4[_0x1bf72e(0x1b2)](new RegExp(_0x543a9e,'g'),_0x35f440)));const _0x20de2b=_0x1bf72e(0x1b0)+_0x34a500+_0x1bf72e(0x1ae)+_0x3932cd+'\x0a',_0x31153e=_0x20de2b+_0x5c1fec,_0x246f4e=_0x4cf6e4?_0x1bf72e(0x1b0)+_0x34a500+'\x20|\x20数据表:\x20'+_0x3932cd+'\x0a'+_0x4cf6e4:undefined;return{'appCode':appCode,'env':_0x3a91ac,'datasetName':_0x34a500,'language':_0x1bf72e(0x19c),'code':_0x31153e,'fullExample':includeImports?_0x246f4e:undefined,'sdkCallInfo':{'modelName':_0x35f440,'tableName':_0x3932cd,'tableKey':_0x552364,'datasetCode':_0x3e9636['datasetCode'],'operationName':_0x2ed055},'fields':_0x372098,'requestExample':_0x3340a1?.['requestExample'],'responseExample':_0x3340a1?.['responseExample'],'sdkInitCode':_0x3e9636['generateSDKInitCode'](_0x552364),'usageExample':_0x472d6b['usageExample'],'aliasExplanation':useAlias?_0x3e9636[_0x1bf72e(0x1ad)]():undefined,'aliasHint':{'defaultAlias':_0x35f440,'datasetSDKKey':_0x543a9e}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x45ad2e,_0x274e8f){const _0xbf6cca=a12_0x2848,_0x3da52b=_0x45ad2e();while(!![]){try{const _0xab8946=-parseInt(_0xbf6cca(0x9c))/0x1*(-parseInt(_0xbf6cca(0xb0))/0x2)+parseInt(_0xbf6cca(0xbd))/0x3*(-parseInt(_0xbf6cca(0x98))/0x4)+parseInt(_0xbf6cca(0xb3))/0x5*(parseInt(_0xbf6cca(0xc8))/0x6)+-parseInt(_0xbf6cca(0xd0))/0x7*(parseInt(_0xbf6cca(0xab))/0x8)+-parseInt(_0xbf6cca(0x9d))/0x9*(-parseInt(_0xbf6cca(0xa0))/0xa)+parseInt(_0xbf6cca(0xaa))/0xb+-parseInt(_0xbf6cca(0x9b))/0xc;if(_0xab8946===_0x274e8f)break;else _0x3da52b['push'](_0x3da52b['shift']());}catch(_0x2c89b5){_0x3da52b['push'](_0x3da52b['shift']());}}}(a12_0x215b,0xd0724));import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode,getEnvironment}from'../config/env.js';function a12_0x2848(_0x42e400,_0x1882ba){_0x42e400=_0x42e400-0x8f;const _0x215b58=a12_0x215b();let _0x2848c5=_0x215b58[_0x42e400];return _0x2848c5;}function a12_0x215b(){const _0x552cef=['Check\x20the\x20sqlCode\x20from\x20list_sql_queries\x20result\x20and\x20use\x20the\x20exact\x20value.','bff','20084wRGEry','toLowerCase','sql','32137860hSmDAs','242332njixyG','909tonCHD','\x22\x20does\x20not\x20exist.\x20Use\x20list_sql_queries\x20to\x20find\x20valid\x20SQL\x20codes.','This\x20SQL\x20requires\x20parameters:\x20','43090DIOksE','sqlCode','SDK\x20client.sql.execute()\x20returns\x20{\x20execSuccess,\x20execResult\x20}\x20—\x20always\x20check\x20execSuccess','message','sqlId','sqlCode\x20is\x20required','map','Backend\x20Function','Failed\x20to\x20verify\x20SQL\x20code:\x20','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20—\x20use\x20try-catch','14141402bXHORY','5400GJOSRh','join','page','\x27\x20}','//\x20Backend\x20Function:\x20Execute\x20SQL\x20\x22','14lOCOwW','getCustomSqlList','date','10ugvooy','Errors\x20throw\x20exceptions\x20—\x20use\x20try-catch','length','name','\x22\x20not\x20found\x20in\x20the\x20application.','trim','{\x20sqlCode:\x20\x27','{\x0a\x20\x20sqlCode:\x20\x27','stringify','keyword','39SCDNZZ','match','find','BFF\x20context.client.sql.execute()\x20returns\x20rows\x20T[]\x20directly\x20—\x20no\x20wrapper\x20object','\x27,\x0a\x20\x20params:\x20','value','reduce','//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27','from','SQL-','Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.','4997352kYAwnq','SQL\x20code\x20\x22','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','count','\x20code\x20for\x20SQL:\x20','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a','example','replace','15407WWcrge','time',',\x0a}','Generated\x20','includes','\x0aconst\x20data\x20=\x20await\x20client.sql.execute(','\x27,\x0a});\x0a\x0a//\x20Execute\x20SQL:\x20','This\x20SQL\x20does\x20not\x20require\x20any\x20parameters'];a12_0x215b=function(){return _0x552cef;};return a12_0x215b();}export async function generateSqlCode(_0x155411){const _0x5395f1=a12_0x2848,{appCode:appCode=getEnvAppCode(),cookie:_0x19b944,sqlCode:_0x1a9b74,params:_0x3a87f5,includeImports:includeImports=!![],target:target='sdk'}=_0x155411;if(!appCode)throw new Error(_0x5395f1(0xca));if(!_0x1a9b74||_0x1a9b74[_0x5395f1(0xb8)]()==='')return{'success':![],'sqlCode':'','sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[]},'error':_0x5395f1(0xa5)};const _0x579fa2=_0x1a9b74[_0x5395f1(0xb8)](),_0x8d8df4=new DevApiClient({'appCode':appCode,'cookie':_0x19b944}),_0x43046c=getEnvironment();try{const _0x5e6ebe=await _0x8d8df4[_0x5395f1(0xb1)]({'pageSize':0x3e7,'currentPage':0x1,'sqlCode':_0x579fa2}),_0x18dabd=_0x5e6ebe['data']?.['tableData']||[],_0x3c948d=_0x18dabd[_0x5395f1(0xbf)](_0x15f833=>_0x15f833['sqlCode']===_0x579fa2||_0x15f833[_0x5395f1(0xa1)]?.['includes'](_0x579fa2)||_0x579fa2[_0x5395f1(0x92)](_0x15f833[_0x5395f1(0xa1)]));if(!_0x3c948d)return{'success':![],'sqlCode':_0x579fa2,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x5395f1(0xc9)+_0x579fa2+_0x5395f1(0xb7),'Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.',_0x5395f1(0x96)]},'error':_0x5395f1(0xc9)+_0x579fa2+_0x5395f1(0x9e)};const _0x5287c6=_0x3c948d[_0x5395f1(0xa1)],_0x384918=_0x3c948d['sqlName']||_0x3c948d[_0x5395f1(0xb6)]||_0x5395f1(0xc6)+(_0x3c948d[_0x5395f1(0xa4)]||_0x3c948d['id']),_0x55ec69=_0x3c948d['sqlContent']||_0x3c948d[_0x5395f1(0x9a)]||'',_0x59b6fc=_0x55ec69[_0x5395f1(0xbe)](/[:$]\{?(\w+)\}?/g);let _0x591a7a,_0x3718fd;if(_0x59b6fc){const _0x303737=Array[_0x5395f1(0xc5)](new Set(_0x59b6fc['map'](_0x5aeb5=>_0x5aeb5[_0x5395f1(0xcf)](/[:${}]/g,''))));_0x591a7a=_0x303737[_0x5395f1(0xa6)](_0x37d8b9=>{const _0x3f378f=_0x3a87f5?.[_0x37d8b9]??getDefaultExample(_0x37d8b9);return{'name':_0x37d8b9,'example':_0x3f378f};}),_0x3718fd=_0x591a7a[_0x5395f1(0xc3)]((_0xa5a7cf,_0x696af6)=>({..._0xa5a7cf,[_0x696af6['name']]:_0x696af6[_0x5395f1(0xce)]}),{});}else _0x3a87f5&&(_0x591a7a=Object['entries'](_0x3a87f5)[_0x5395f1(0xa6)](([_0x47ba61,_0x15653e])=>({'name':_0x47ba61,'example':_0x15653e})),_0x3718fd=_0x3a87f5);const _0x3886b3=_0x591a7a&&_0x591a7a[_0x5395f1(0xb5)]>0x0,_0x8e0467=_0x3886b3?JSON[_0x5395f1(0xbb)](_0x3718fd,null,0x2):'',_0x2d9528=_0x3886b3?_0x5395f1(0xba)+_0x5287c6+_0x5395f1(0xc1)+_0x8e0467+_0x5395f1(0x90):_0x5395f1(0xb9)+_0x5287c6+_0x5395f1(0xae);let _0x5f3d6f;target==='bff'?_0x5f3d6f=_0x5395f1(0xaf)+_0x384918+'\x22\x0aexport\x20default\x20async\x20function(params,\x20context)\x20{\x0a\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute('+_0x2d9528+');\x0a\x0a\x20\x20//\x20rows\x20is\x20T[]\x20directly\x20—\x20no\x20wrapper,\x20errors\x20throw\x20exceptions\x0a\x20\x20console.log(`Retrieved\x20${rows.length}\x20rows`);\x0a\x0a\x20\x20return\x20{\x20data:\x20rows\x20};\x0a}':_0x5f3d6f=(includeImports?_0x5395f1(0xcd):'')+_0x5395f1(0xc4)+appCode+'\x27,\x0a\x20\x20env:\x20\x27'+_0x43046c+_0x5395f1(0x94)+_0x384918+_0x5395f1(0x93)+_0x2d9528+');\x0a\x0a//\x20IMPORTANT:\x20SDK\x20returns\x20wrapper\x20—\x20check\x20execSuccess\x20before\x20using\x20results\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);\x0a}\x0a\x0a//\x20Process\x20the\x20results\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0aconsole.log(`Retrieved\x20${results.length}\x20rows`);\x0a\x0a//\x20Use\x20the\x20data\x0aresults.forEach((row:\x20any)\x20=>\x20{\x0a\x20\x20console.log(row);\x0a});';const _0x5c63d5=target===_0x5395f1(0x97);return{'success':!![],'sqlCode':_0x5287c6,'sqlName':_0x384918,'sqlExists':!![],'code':_0x5f3d6f,'parameters':_0x591a7a,'usage':{'description':_0x5395f1(0x91)+(_0x5c63d5?_0x5395f1(0xa7):'Frontend\x20SDK')+_0x5395f1(0xcc)+_0x384918,'important':[_0x5395f1(0xc9)+_0x5287c6+'\x22\x20exists\x20and\x20is\x20valid.',_0x5c63d5?_0x5395f1(0xc0):_0x5395f1(0xa2),_0x5c63d5?_0x5395f1(0xb4):_0x5395f1(0xa9),_0x3886b3?_0x5395f1(0x9f)+_0x591a7a[_0x5395f1(0xa6)](_0x5ec488=>_0x5ec488[_0x5395f1(0xb6)])[_0x5395f1(0xac)](',\x20'):_0x5395f1(0x95),'Note:\x20client.api.executeSql()\x20is\x20deprecated.\x20Use\x20client.sql.execute()\x20instead.']}};}catch(_0x38c772){return{'success':![],'sqlCode':_0x579fa2,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x5395f1(0xa8)+_0x38c772['message'],_0x5395f1(0xc7)]},'error':_0x5395f1(0xa8)+_0x38c772[_0x5395f1(0xa3)]};}}function getDefaultExample(_0x2b1bb8){const _0x332698=a12_0x2848,_0x268585=_0x2b1bb8[_0x332698(0x99)]();if(_0x268585['includes'](_0x332698(0xb2))||_0x268585['includes'](_0x332698(0x8f)))return'2024-01-01';if(_0x268585[_0x332698(0x92)]('id'))return 0x7b;if(_0x268585[_0x332698(0x92)]('limit')||_0x268585['includes'](_0x332698(0xcb))||_0x268585[_0x332698(0x92)]('size'))return 0xa;if(_0x268585[_0x332698(0x92)](_0x332698(0xad)))return 0x1;if(_0x268585['includes'](_0x332698(0xbc))||_0x268585[_0x332698(0x92)]('search')||_0x268585[_0x332698(0x92)](_0x332698(0xb6)))return _0x332698(0xce);if(_0x268585[_0x332698(0x92)]('status'))return 0x1;return _0x332698(0xc2);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c39c2,_0x1b9b34){const _0x2f3a6e=a13_0xebfc,_0x27d4a9=_0x2c39c2();while(!![]){try{const _0x399f3d=-parseInt(_0x2f3a6e(0x1a1))/0x1+parseInt(_0x2f3a6e(0x1a8))/0x2*(parseInt(_0x2f3a6e(0x1a6))/0x3)+parseInt(_0x2f3a6e(0x1ac))/0x4*(-parseInt(_0x2f3a6e(0x1a9))/0x5)+parseInt(_0x2f3a6e(0x1ab))/0x6*(-parseInt(_0x2f3a6e(0x1a5))/0x7)+-parseInt(_0x2f3a6e(0x1a3))/0x8+-parseInt(_0x2f3a6e(0x1ad))/0x9*(parseInt(_0x2f3a6e(0x1a4))/0xa)+parseInt(_0x2f3a6e(0x1aa))/0xb;if(_0x399f3d===_0x1b9b34)break;else _0x27d4a9['push'](_0x27d4a9['shift']());}catch(_0x3d5a5e){_0x27d4a9['push'](_0x27d4a9['shift']());}}}(a13_0x30a1,0x985b4));function a13_0x30a1(){const _0x51ce4d=['Failed\x20to\x20fetch\x20Backend\x20Function\x20script\x20info\x20for\x20id:\x20','387529dWhjGo','id\x20is\x20required\x20and\x20must\x20be\x20a\x20positive\x20number.\x20Get\x20it\x20from\x20list_bff_scripts.','116936CbPkxU','3519500xdrVdL','35413zEPgEy','3QAEoDU','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','1690546qkCmzv','5djEtiy','23706705OgWabS','894EURhDW','3473956RNpFPe','9NTBPwk','data'];a13_0x30a1=function(){return _0x51ce4d;};return a13_0x30a1();}import{DevApiClient}from'../api/dev-api-client.js';function a13_0xebfc(_0x2f1f15,_0x32c758){_0x2f1f15=_0x2f1f15-0x1a1;const _0x30a14a=a13_0x30a1();let _0xebfc60=_0x30a14a[_0x2f1f15];return _0xebfc60;}import{getEnvAppCode}from'../config/env.js';export async function getBffScriptInfo(_0x311766){const _0x12dfb3=a13_0xebfc,{appCode:appCode=getEnvAppCode(),cookie:_0x172548,id:_0x57903e}=_0x311766;if(!appCode)throw new Error(_0x12dfb3(0x1a7));if(!_0x57903e||_0x57903e<=0x0)throw new Error(_0x12dfb3(0x1a2));const _0x436afd=new DevApiClient({'appCode':appCode,'cookie':_0x172548}),_0x5ebb9e=await _0x436afd['getBffScriptInfo'](_0x57903e);if(!_0x5ebb9e['success']||!_0x5ebb9e[_0x12dfb3(0x1ae)])return{'success':![],'message':_0x12dfb3(0x1af)+_0x57903e};return{'success':!![],'script':_0x5ebb9e[_0x12dfb3(0x1ae)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a14_0x17f0(){const _0x495a4a=['596559fXwmZB','api','toTableName','name','getDatasetRelations','fromDatasetName','21477952dhGtkN','getTableName','Referenced\x20by\x20','\x20个上游数据集','5684635kUhAPU','join','getIndexes','incoming','relations','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','getDatasetDetail','push','4147983wUeSWQ','toDatasetName','Indexes\x20available,\x20prefer\x20using\x20indexed\x20fields\x20for\x20high-frequency\x20filtering','function','length','datasetCode\x20is\x20required','getOperationCount','fromField','4ViYEqq','getEnabledOperationAnalyses','toField','23437beZrxX','This\x20dataset\x20is\x20a\x20detail/slave\x20table,\x20referencing\x20other\x20master\x20tables','joinType','153750NrhEuN','outgoing','condition','data','fromTableName','\x20个下游数据集引用','8289432etlAuF','map',')\x20via\x20','toDataset','throttle','References\x20','\x20=\x20','fromDataset','MANY_TO_ONE'];a14_0x17f0=function(){return _0x495a4a;};return a14_0x17f0();}(function(_0x148bc2,_0x55c44f){const _0x4681a7=a14_0x5ada,_0x123063=_0x148bc2();while(!![]){try{const _0x24877a=parseInt(_0x4681a7(0xbf))/0x1+parseInt(_0x4681a7(0xc2))/0x2+-parseInt(_0x4681a7(0xa2))/0x3*(-parseInt(_0x4681a7(0xbc))/0x4)+parseInt(_0x4681a7(0xac))/0x5+parseInt(_0x4681a7(0xc8))/0x6+parseInt(_0x4681a7(0xb4))/0x7+-parseInt(_0x4681a7(0xa8))/0x8;if(_0x24877a===_0x55c44f)break;else _0x123063['push'](_0x123063['shift']());}catch(_0x1d61f7){_0x123063['push'](_0x123063['shift']());}}}(a14_0x17f0,0xb11f1));import{DevApiClient}from'../api/dev-api-client.js';import{DrivenDataDetailPlus}from'@lovrabet/dsparser';import{getEnvAppCode,getEnvironment}from'../config/env.js';import{rateLimiters}from'../utils/rate-limiter.js';export async function getDatasetDetail(_0x152c90){const _0x1c2ba2=a14_0x5ada,{appCode:appCode=getEnvAppCode(),cookie:_0x412600,datasetCode:_0x5aa55b,forceRefresh:forceRefresh=![],includeRelations:includeRelations=!![]}=_0x152c90;if(!appCode)throw new Error(_0x1c2ba2(0xb1));if(!_0x5aa55b)throw new Error(_0x1c2ba2(0xb9));const _0x4e98bd=new DevApiClient({'appCode':appCode,'cookie':_0x412600}),_0xe2cf7=getEnvironment(),_0x14763e=forceRefresh?await rateLimiters[_0x1c2ba2(0xa3)][_0x1c2ba2(0x9d)](()=>_0x4e98bd['getDatasetDetail'](_0x5aa55b,forceRefresh,![])):await _0x4e98bd[_0x1c2ba2(0xb2)](_0x5aa55b,forceRefresh,![]),_0x478ecf=_0x14763e[_0x1c2ba2(0xc5)]||_0x14763e,_0x4e2f47=new DrivenDataDetailPlus(_0x478ecf),_0x4076db=_0x4e2f47[_0x1c2ba2(0xa9)](),_0x4dc67e=Array['isArray'](_0x478ecf[_0x1c2ba2(0xb0)])?[..._0x478ecf[_0x1c2ba2(0xb0)]]:null,_0x40652f={'fieldCount':_0x4e2f47['getFieldCount'](),'operationCount':_0x4e2f47[_0x1c2ba2(0xba)](),'enabledOperationCount':_0x4e2f47[_0x1c2ba2(0xbd)]()?.[_0x1c2ba2(0xb8)]||0x0,'hasRelations':![]};if(!includeRelations)return{'appCode':appCode,'env':_0xe2cf7,'data':_0x478ecf,'_stats':_0x40652f};let _0x2f9518=[],_0x32f16c=[];try{const _0x193f9c=await _0x4e98bd[_0x1c2ba2(0xa6)](_0x5aa55b,forceRefresh);_0x2f9518=_0x193f9c[_0x1c2ba2(0xc3)]||[],_0x32f16c=_0x193f9c[_0x1c2ba2(0xaf)]||[];}catch{}_0x4dc67e&&_0x4dc67e[_0x1c2ba2(0xb8)]>0x0&&_0x2f9518[_0x1c2ba2(0xb8)]===0x0&&(_0x2f9518=_0x4dc67e[_0x1c2ba2(0xc9)](_0x8e74d7=>({'fromField':_0x8e74d7[_0x1c2ba2(0xbb)],'toDataset':_0x8e74d7['toDatasetCode']||_0x8e74d7['toDataset'],'toDatasetName':_0x8e74d7[_0x1c2ba2(0xb5)],'toField':_0x8e74d7[_0x1c2ba2(0xbe)],'joinType':_0x8e74d7[_0x1c2ba2(0xc1)]||_0x1c2ba2(0xa1),'toTableName':_0x8e74d7['toTableName']})));const _0x4b84fb=_0x2f9518['map'](_0x42d555=>({'fromField':_0x42d555[_0x1c2ba2(0xbb)],'toDatasetCode':_0x42d555[_0x1c2ba2(0xcb)]||_0x42d555['toDatasetCode'],'toDatasetName':_0x42d555[_0x1c2ba2(0xb5)],'toField':_0x42d555[_0x1c2ba2(0xbe)],'toTableName':_0x42d555[_0x1c2ba2(0xa4)],'joinType':_0x42d555['joinType']||_0x1c2ba2(0xa1),'condition':_0x42d555['condition']??null})),_0x160e50=_0x32f16c['map'](_0x4ef322=>({'fromField':_0x4ef322[_0x1c2ba2(0xbb)],'fromDatasetCode':_0x4ef322['fromDataset']||_0x4ef322['fromDatasetCode'],'fromDatasetName':_0x4ef322[_0x1c2ba2(0xa7)]||_0x4ef322[_0x1c2ba2(0xa0)],'fromTableName':_0x4ef322['fromTableName'],'toDatasetCode':_0x5aa55b,'toDatasetName':_0x4e2f47[_0x1c2ba2(0xa5)],'toField':_0x4ef322[_0x1c2ba2(0xbe)],'toTableName':_0x4076db,'joinType':_0x4ef322[_0x1c2ba2(0xc1)]||'ONE_TO_MANY','condition':_0x4ef322[_0x1c2ba2(0xc4)]??null})),_0x34e13f=_0x4b84fb[_0x1c2ba2(0xb8)]+_0x160e50['length'];_0x40652f['hasRelations']=_0x34e13f>0x0;const _0x37014a={'outgoing':_0x4b84fb,'incoming':_0x160e50,'totalCount':_0x34e13f};let _0x4ced40;if(_0x34e13f>0x0){const _0x38bd92=[];for(const _0x8375a8 of _0x4b84fb){_0x38bd92[_0x1c2ba2(0xb3)](_0x1c2ba2(0x9e)+_0x8375a8['toDatasetName']+'('+_0x8375a8['joinType']+_0x1c2ba2(0xca)+_0x4076db+'.'+_0x8375a8['fromField']+_0x1c2ba2(0x9f)+(_0x8375a8[_0x1c2ba2(0xa4)]||'?')+'.'+_0x8375a8['toField']);}for(const _0x475686 of _0x160e50){_0x38bd92[_0x1c2ba2(0xb3)](_0x1c2ba2(0xaa)+_0x475686[_0x1c2ba2(0xa7)]+'('+_0x475686[_0x1c2ba2(0xc1)]+')\x20via\x20'+(_0x475686[_0x1c2ba2(0xc6)]||'?')+'.'+_0x475686[_0x1c2ba2(0xbb)]+_0x1c2ba2(0x9f)+_0x4076db+'.'+_0x475686[_0x1c2ba2(0xbe)]);}const _0x5bc527=[];_0x4b84fb[_0x1c2ba2(0xb8)]>0x0&&_0x5bc527[_0x1c2ba2(0xb3)]('引用\x20'+_0x4b84fb['length']+_0x1c2ba2(0xab)),_0x160e50[_0x1c2ba2(0xb8)]>0x0&&_0x5bc527[_0x1c2ba2(0xb3)]('被\x20'+_0x160e50['length']+_0x1c2ba2(0xc7)),_0x4ced40=_0x5bc527[_0x1c2ba2(0xad)](',')+'。'+_0x38bd92[_0x1c2ba2(0xad)](';\x20');}const _0x14b63e=generateUsageHints(_0x4b84fb,_0x160e50,_0x4e2f47);return{'appCode':appCode,'env':_0xe2cf7,'data':_0x478ecf,'_stats':_0x40652f,'_relations':_0x37014a,'_relationsSummary':_0x4ced40,'_usageHints':_0x14b63e[_0x1c2ba2(0xb8)]>0x0?_0x14b63e:undefined};}function a14_0x5ada(_0x2ee459,_0x1b67c1){_0x2ee459=_0x2ee459-0x9d;const _0x17f0f9=a14_0x17f0();let _0x5ada2e=_0x17f0f9[_0x2ee459];return _0x5ada2e;}function generateUsageHints(_0x38a31a,_0x24e29d,_0x589bb2){const _0x46d179=a14_0x5ada,_0x1ae7bd=[];if(_0x24e29d[_0x46d179(0xb8)]>=0x2&&_0x38a31a['length']===0x0)_0x1ae7bd[_0x46d179(0xb3)]('This\x20dataset\x20is\x20a\x20master\x20entity/dimension\x20table,\x20referenced\x20by\x20multiple\x20downstream\x20datasets');else{if(_0x24e29d['length']>=0x1&&_0x38a31a[_0x46d179(0xb8)]>=0x1)_0x1ae7bd['push']('This\x20dataset\x20is\x20in\x20the\x20middle\x20layer\x20of\x20the\x20relationship\x20network,\x20referencing\x20upstream\x20and\x20being\x20referenced\x20by\x20downstream');else _0x38a31a['length']>=0x1&&_0x24e29d['length']===0x0&&_0x1ae7bd[_0x46d179(0xb3)](_0x46d179(0xc0));}if(_0x24e29d[_0x46d179(0xb8)]>0x0){const _0x1ec6bd=_0x24e29d[_0x46d179(0xc9)](_0x2f803e=>_0x2f803e[_0x46d179(0xa7)])['filter'](Boolean);_0x1ec6bd[_0x46d179(0xb8)]>0x0&&_0x1ae7bd['push']('Downstream\x20datasets:\x20'+_0x1ec6bd[_0x46d179(0xad)](',\x20'));}if(_0x38a31a[_0x46d179(0xb8)]>0x0){const _0x11191f=_0x38a31a[_0x46d179(0xc9)](_0x19eb25=>_0x19eb25[_0x46d179(0xbb)]+'\x20→\x20'+_0x19eb25[_0x46d179(0xb5)]+'.'+_0x19eb25['toField']);_0x1ae7bd['push']('Common\x20join\x20paths:\x20'+_0x11191f['join'](';\x20'));}if(typeof _0x589bb2[_0x46d179(0xae)]===_0x46d179(0xb7))try{const _0xc21128=_0x589bb2[_0x46d179(0xae)]();_0xc21128&&_0xc21128[_0x46d179(0xb8)]>0x0&&_0x1ae7bd['push'](_0x46d179(0xb6));}catch{}return _0x1ae7bd;}
|