@lovrabet/dataset-mcp-server 1.3.10 → 1.4.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/cache.js +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_0x139a28=a0_0x232a;function a0_0x232a(_0x48e7c7,_0x1853ac){_0x48e7c7=_0x48e7c7-0x1b1;const _0x1757f6=a0_0x1757();let _0x232a6b=_0x1757f6[_0x48e7c7];return _0x232a6b;}(function(_0x4b353c,_0x612839){const _0x50ada9=a0_0x232a,_0x2a6888=_0x4b353c();while(!![]){try{const _0x44967c=parseInt(_0x50ada9(0x1b2))/0x1*(parseInt(_0x50ada9(0x1b5))/0x2)+parseInt(_0x50ada9(0x1c1))/0x3+parseInt(_0x50ada9(0x1b4))/0x4*(-parseInt(_0x50ada9(0x1be))/0x5)+-parseInt(_0x50ada9(0x1bd))/0x6+parseInt(_0x50ada9(0x1b7))/0x7*(-parseInt(_0x50ada9(0x1b6))/0x8)+-parseInt(_0x50ada9(0x1bb))/0x9+-parseInt(_0x50ada9(0x1c2))/0xa*(-parseInt(_0x50ada9(0x1c6))/0xb);if(_0x44967c===_0x612839)break;else _0x2a6888['push'](_0x2a6888['shift']());}catch(_0x445bac){_0x2a6888['push'](_0x2a6888['shift']());}}}(a0_0x1757,0x29def));export class SimpleCache{[a0_0x139a28(0x1bf)]=new Map();[a0_0x139a28(0x1b1)];constructor(_0x31cc61=0x5){const _0x2ce86d=a0_0x139a28;this[_0x2ce86d(0x1b1)]=_0x31cc61*0x3c*0x3e8;}[a0_0x139a28(0x1ba)](_0x26377d){const _0x5c2a8c=a0_0x139a28,_0xc1b702=this['cache'][_0x5c2a8c(0x1ba)](_0x26377d);if(!_0xc1b702)return null;const _0x5c2bed=Date[_0x5c2a8c(0x1b8)](),_0x567c3a=_0x5c2bed-_0xc1b702[_0x5c2a8c(0x1c3)];if(_0x567c3a>this[_0x5c2a8c(0x1b1)])return this[_0x5c2a8c(0x1bf)][_0x5c2a8c(0x1c8)](_0x26377d),null;const _0x362aa2=Math[_0x5c2a8c(0x1b9)](_0x567c3a/0x3e8);return _0xc1b702[_0x5c2a8c(0x1bc)];}['set'](_0x2735ce,_0x247942){const _0x17b162=a0_0x139a28;this['cache'][_0x17b162(0x1b3)](_0x2735ce,{'data':_0x247942,'timestamp':Date[_0x17b162(0x1b8)]()});}[a0_0x139a28(0x1c5)](_0x959042){const _0x4d5c33=a0_0x139a28;_0x959042?this[_0x4d5c33(0x1bf)]['delete'](_0x959042):this[_0x4d5c33(0x1bf)]['clear']();}[a0_0x139a28(0x1c7)](){const _0x4031de=a0_0x139a28;return{'size':this[_0x4031de(0x1bf)]['size'],'ttlMinutes':this[_0x4031de(0x1b1)]/0xea60,'entries':Array[_0x4031de(0x1c0)](this[_0x4031de(0x1bf)][_0x4031de(0x1c4)]())};}}function a0_0x1757(){const _0x327721=['916392VPsBNz','31070PNhvaP','8aHzKxz','1353142MZICYf','now','floor','get','2322315aJNdoF','data','254514AHMKrU','5qZQFel','cache','from','122112GlZkKe','10mqLbWl','timestamp','keys','clear','7168722FzXUyb','getStats','delete','defaultTTL','13lPyZJV','set'];a0_0x1757=function(){return _0x327721;};return a0_0x1757();}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
|
+
function a1_0x2b1c(_0x3dc167,_0x44095c){_0x3dc167=_0x3dc167-0x1a2;const _0x588f8d=a1_0x588f();let _0x2b1cb6=_0x588f8d[_0x3dc167];return _0x2b1cb6;}const a1_0x170ea4=a1_0x2b1c;function a1_0x588f(){const _0x99b707=['/api/custom/executeSql','datasetCode','getBffScriptInfo','No\x20authentication\x20cookie\x20found.\x20Please\x20login\x20first.','LOVRABET_ENV','status','er-config:','no-relations','with-relations','stringify','filter','currentPage','save-sql','application/json','datasets','Content-Type','/api/node-toolbox/bff/save','API\x20request\x20timeout\x20after\x20','/api/management/library/scripts/save','getCustomSqlList','[getDatasetDetail]\x20Failed\x20to\x20fetch\x20relations\x20for\x20','object','fromField','doVersion','postRequest','length','online','&type=ENDPOINT','Authentication\x20failed.\x20Please\x20login\x20again.','getDatasetRelations','tableData','relations','params','getUniqueDbIds','\x0aURL:\x20','set','add','request','pathname','getAllErConfigs','/smartapi/dataset/get-dataset-list','Failed\x20to\x20get\x20ER\x20config\x20for\x20dblinkId:\x20','runtimeDomain','scriptContent','message','/smartapi/custom/updateUserCustomSql','clearBffScriptCache','find','text','/smartapi/dataset/get-driven-data?','API\x20error:\x20','AbortError','321066oChHcj','toDatasetName','meta','sort','getDatasetList','appCode','sqlCode','toolboxBaseUrl','updateUserCustomSql','searchDatasets','saveCustomSqlViaToolbox','datasetName','saveBffScript','/api/management/library/scripts/list?appCode=','warn','38339wyeiWe','data','runtimeBaseUrl','POST','isArray','env','apiBaseUrl','forceRefresh','dataset-detail:','1607268XblrwS','getErConfig','_request','121fWwSCX','toDataset','Failed\x20to\x20get\x20ER\x20config\x20for\x20dbId\x20','DEFAULT_TIMEOUT','json','/api/management/script/cache/clear','toLowerCase','mcp:vibe','description','executeSql','dbId','errorMsg','apiDomain','code','joinType','1wqhjiO','956571UbqzXF','toolboxBaseUrlOverride','name','push','success','saveUserCustomSql','GET','/smartapi/custom/queryUserCustomSqlList','1081786WTPtEY','dbtableConfig','8tHPXpN','test','sqlContent','toField','includes','tableName','get','/smartapi/custom/saveUserCustomSql','12kHvTNi','495725rfxeSi','scriptType','sqlName','resolveToolboxUrl','process','from','signal','22450IceGqZ','cookie'];a1_0x588f=function(){return _0x99b707;};return a1_0x588f();}(function(_0x4672b0,_0xed27de){const _0x52e8da=a1_0x2b1c,_0x534b47=_0x4672b0();while(!![]){try{const _0x4e046a=parseInt(_0x52e8da(0x216))/0x1*(-parseInt(_0x52e8da(0x1a4))/0x2)+parseInt(_0x52e8da(0x217))/0x3+parseInt(_0x52e8da(0x204))/0x4+parseInt(_0x52e8da(0x1af))/0x5+parseInt(_0x52e8da(0x1ae))/0x6*(-parseInt(_0x52e8da(0x1fb))/0x7)+-parseInt(_0x52e8da(0x1a6))/0x8*(-parseInt(_0x52e8da(0x1ec))/0x9)+parseInt(_0x52e8da(0x1b6))/0xa*(parseInt(_0x52e8da(0x207))/0xb);if(_0x4e046a===_0xed27de)break;else _0x534b47['push'](_0x534b47['shift']());}catch(_0x497dfa){_0x534b47['push'](_0x534b47['shift']());}}}(a1_0x588f,0x50295));import{getCookie}from'../auth/cookie-manager.js';import{getEffectiveApiDomain,getEffectiveRuntimeDomain,resolveApiBaseUrl}from'../auth/constants.js';import{apiCache}from'./cache.js';export class DevApiClient{[a1_0x170ea4(0x1f1)];[a1_0x170ea4(0x200)];[a1_0x170ea4(0x1b7)];[a1_0x170ea4(0x213)];[a1_0x170ea4(0x1e2)];[a1_0x170ea4(0x218)];constructor(_0x3051cc){const _0x4c574c=a1_0x170ea4;this[_0x4c574c(0x1f1)]=_0x3051cc[_0x4c574c(0x1f1)],this[_0x4c574c(0x200)]=globalThis[_0x4c574c(0x1b3)]?.[_0x4c574c(0x200)]?.[_0x4c574c(0x1bc)]||_0x4c574c(0x1d2),this['cookie']=_0x3051cc[_0x4c574c(0x1b7)]||getCookie(),this[_0x4c574c(0x213)]=_0x3051cc[_0x4c574c(0x201)]||getEffectiveApiDomain(),this[_0x4c574c(0x1e2)]=_0x3051cc[_0x4c574c(0x1fd)]||getEffectiveRuntimeDomain(),this[_0x4c574c(0x218)]=_0x3051cc[_0x4c574c(0x1f3)];if(!this[_0x4c574c(0x1b7)])throw new Error(_0x4c574c(0x1bb));}[a1_0x170ea4(0x1b2)](_0x15e574,_0x324133){const _0x21f671=a1_0x170ea4,_0x316c07=resolveApiBaseUrl(_0x15e574),_0x45b149=this['toolboxBaseUrlOverride']&&_0x316c07===getEffectiveApiDomain()?this['toolboxBaseUrlOverride']:_0x316c07;try{const _0x4b6469=new URL(_0x45b149);if(_0x4b6469[_0x21f671(0x1de)]!=='/')return _0x45b149;}catch{}return''+_0x45b149+_0x324133;}static [a1_0x170ea4(0x20a)]=0x7530;async[a1_0x170ea4(0x206)](_0x54983a,_0x1df586={},_0x5c8c5a=DevApiClient[a1_0x170ea4(0x20a)]){const _0x3d23ca=a1_0x170ea4,{method:method=_0x3d23ca(0x1a2),body:_0x51d20e,extraHeaders:_0x33de59}=_0x1df586,_0x4cab36=new AbortController(),_0xa764cf=setTimeout(()=>_0x4cab36['abort'](),_0x5c8c5a),_0x191dde={'Cookie':this[_0x3d23ca(0x1b7)],'X-Invoke-Source':_0x3d23ca(0x20e),..._0x33de59};method===_0x3d23ca(0x1fe)&&(_0x191dde[_0x3d23ca(0x1c7)]=_0x3d23ca(0x1c5));try{const _0x219f06=await fetch(_0x54983a,{'method':method,'headers':_0x191dde,..._0x51d20e!==undefined&&{'body':JSON[_0x3d23ca(0x1c1)](_0x51d20e)},'signal':_0x4cab36[_0x3d23ca(0x1b5)]});clearTimeout(_0xa764cf);if(!_0x219f06['ok']){if(_0x219f06['status']===0x191)throw new Error(_0x3d23ca(0x1d4));let _0x5d4e91='';try{_0x5d4e91=await _0x219f06[_0x3d23ca(0x1e8)]();}catch{}throw new Error('API\x20request\x20failed:\x20HTTP\x20'+_0x219f06[_0x3d23ca(0x1bd)]+_0x3d23ca(0x1da)+_0x54983a+(_0x5d4e91?'\x0a'+_0x5d4e91:''));}const _0x382ca2=await _0x219f06[_0x3d23ca(0x20b)]();if(_0x382ca2&&typeof _0x382ca2===_0x3d23ca(0x1cd)&&_0x3d23ca(0x21b)in _0x382ca2&&!_0x382ca2[_0x3d23ca(0x21b)]){const _0x1214f1=_0x382ca2;throw new Error(_0x3d23ca(0x1ea)+(_0x1214f1[_0x3d23ca(0x1e4)]||_0x1214f1[_0x3d23ca(0x212)]||'Unknown\x20error'));}return _0x382ca2;}catch(_0x22cb02){if(_0x22cb02 instanceof Error&&_0x22cb02[_0x3d23ca(0x219)]===_0x3d23ca(0x1eb))throw new Error(_0x3d23ca(0x1c9)+_0x5c8c5a+'ms.\x20The\x20server\x20may\x20be\x20down\x20or\x20unreachable.\x0aURL:\x20'+_0x54983a);if(_0x22cb02 instanceof TypeError)throw new Error('Network\x20error:\x20Unable\x20to\x20connect\x20to\x20the\x20server.\x20Please\x20check\x20your\x20network\x20connection\x20or\x20the\x20server\x20may\x20be\x20down.\x0aURL:\x20'+_0x54983a);throw _0x22cb02;}}async[a1_0x170ea4(0x1dd)](_0x4bd668,_0x892a7a){const _0x324fc7=a1_0x170ea4;return this[_0x324fc7(0x206)](_0x4bd668,{'method':_0x324fc7(0x1a2)},_0x892a7a);}async[a1_0x170ea4(0x1d0)](_0x3444f7,_0x39d5da,_0x576e5f,_0x389fe8){const _0x5621e7=a1_0x170ea4;return this[_0x5621e7(0x206)](_0x3444f7,{'method':_0x5621e7(0x1fe),'body':_0x39d5da,'extraHeaders':_0x389fe8},_0x576e5f);}async['getDatasetList'](_0x5130e6){const _0x2f4f53=a1_0x170ea4,_0x53d3c0=_0x5130e6?.[_0x2f4f53(0x202)]||![],_0x8913d3='dataset-list:'+this[_0x2f4f53(0x1f1)]+':'+this[_0x2f4f53(0x200)];if(!_0x53d3c0){const _0x1ee50f=apiCache[_0x2f4f53(0x1ac)](_0x8913d3);if(_0x1ee50f)return _0x1ee50f;}const _0x5de378=this[_0x2f4f53(0x213)]+_0x2f4f53(0x1e0),_0x1ff20e=await this[_0x2f4f53(0x1d0)](_0x5de378,{'appCode':this['appCode']});return apiCache[_0x2f4f53(0x1db)](_0x8913d3,_0x1ff20e),_0x1ff20e;}async['getDatasetDetail'](_0x38732d,_0x401fde=![],_0x13f8a6=![]){const _0x387cf0=a1_0x170ea4,_0x1a1ace=_0x387cf0(0x203)+this['appCode']+':'+this[_0x387cf0(0x200)]+':'+_0x38732d+':'+(_0x13f8a6?_0x387cf0(0x1c0):_0x387cf0(0x1bf));if(!_0x401fde){const _0x75ea7a=apiCache[_0x387cf0(0x1ac)](_0x1a1ace);if(_0x75ea7a)return _0x75ea7a;}const _0x50b771=/^\d+$/[_0x387cf0(0x1a7)](_0x38732d),_0x398dd7=_0x50b771?'id':'code',_0x21f937=this[_0x387cf0(0x213)]+_0x387cf0(0x1e9)+_0x398dd7+'='+_0x38732d,_0x396712=await this[_0x387cf0(0x1dd)](_0x21f937);if(_0x13f8a6&&_0x396712['data']?.['modelCode']){const _0xc3c06e=_0x396712[_0x387cf0(0x1fc)][_0x387cf0(0x1cf)]==='v2',_0x345bac=Array['isArray'](_0x396712[_0x387cf0(0x1fc)][_0x387cf0(0x1d7)]);if(!_0xc3c06e||!_0x345bac)try{const _0x55dbf4=await this[_0x387cf0(0x1d5)](_0x396712[_0x387cf0(0x1fc)]['modelCode'],_0x401fde);_0x396712['data'][_0x387cf0(0x1d7)]=_0x55dbf4;}catch(_0x297c5f){process[_0x387cf0(0x200)]['NODE_ENV']!==_0x387cf0(0x1a7)&&console[_0x387cf0(0x1fa)](_0x387cf0(0x1cc)+_0x38732d+':',_0x297c5f);}}return apiCache[_0x387cf0(0x1db)](_0x1a1ace,_0x396712),_0x396712;}async[a1_0x170ea4(0x1f5)](_0x2c14bc){const _0x2b4dd2=a1_0x170ea4,_0x4d4f9f=await this[_0x2b4dd2(0x1f0)](),_0x5c0bda=Array[_0x2b4dd2(0x1ff)](_0x4d4f9f[_0x2b4dd2(0x1fc)])?_0x4d4f9f[_0x2b4dd2(0x1fc)]:_0x4d4f9f[_0x2b4dd2(0x1fc)]?.[_0x2b4dd2(0x1d6)]||[];if(!_0x4d4f9f[_0x2b4dd2(0x21b)])return{'success':!![],'data':{'tableData':[]}};const _0x52e2ec=_0x5c0bda[_0x2b4dd2(0x1c2)](_0x2dba20=>{const _0x303cf8=_0x2b4dd2,_0x24b04b=_0x2c14bc[_0x303cf8(0x20d)]();return _0x2dba20[_0x303cf8(0x219)]?.[_0x303cf8(0x20d)]()[_0x303cf8(0x1aa)](_0x24b04b)||_0x2dba20[_0x303cf8(0x214)]?.[_0x303cf8(0x20d)]()[_0x303cf8(0x1aa)](_0x24b04b)||_0x2dba20[_0x303cf8(0x1a5)]?.[_0x303cf8(0x1ab)]?.['toLowerCase']()[_0x303cf8(0x1aa)](_0x24b04b)||_0x2dba20[_0x303cf8(0x20f)]?.[_0x303cf8(0x20d)]()['includes'](_0x24b04b);});return{'success':!![],'data':{'tableData':_0x52e2ec,'paging':{'totalCount':_0x52e2ec['length'],'currentPage':0x1,'pageSize':_0x52e2ec[_0x2b4dd2(0x1d1)]}}};}async[a1_0x170ea4(0x1cb)](_0xcafd2e){const _0x4b100c=a1_0x170ea4,_0x43eafc=_0xcafd2e?.[_0x4b100c(0x1c3)]||0x1,_0x289a4d=_0xcafd2e?.['pageSize']||0x3e7,_0x53fb0a=this[_0x4b100c(0x213)]+_0x4b100c(0x1a3),_0x2d32cd={'appCode':this['appCode'],'currentPage':_0x43eafc,'pageSize':_0x289a4d,..._0xcafd2e?.['sqlCode']&&{'sqlCode':_0xcafd2e[_0x4b100c(0x1f2)]},..._0xcafd2e?.[_0x4b100c(0x1b1)]&&{'sqlName':_0xcafd2e[_0x4b100c(0x1b1)]}},_0x2fdc72=await this['postRequest'](_0x53fb0a,_0x2d32cd);return _0x2fdc72;}async[a1_0x170ea4(0x210)](_0x53001f){const _0x4360e4=a1_0x170ea4,_0x43b057=this[_0x4360e4(0x1e2)]+_0x4360e4(0x1b8),_0x3ee77c={'appCode':this[_0x4360e4(0x1f1)],'sqlCode':_0x53001f[_0x4360e4(0x1f2)],..._0x53001f[_0x4360e4(0x1d8)]&&{'params':_0x53001f[_0x4360e4(0x1d8)]}};return await this[_0x4360e4(0x1d0)](_0x43b057,_0x3ee77c);}async[a1_0x170ea4(0x21c)](_0x194258){const _0xd6ad06=a1_0x170ea4,_0x1aabfa=this['apiDomain']+_0xd6ad06(0x1ad),_0x451026={'sqlName':_0x194258[_0xd6ad06(0x1b1)],'dbId':_0x194258[_0xd6ad06(0x211)],'sqlContent':_0x194258[_0xd6ad06(0x1a8)],'appCode':this[_0xd6ad06(0x1f1)]};return await this[_0xd6ad06(0x1d0)](_0x1aabfa,_0x451026);}async[a1_0x170ea4(0x1f4)](_0x29d047){const _0x2d8847=a1_0x170ea4,_0x5e92d1=this[_0x2d8847(0x213)]+_0x2d8847(0x1e5),_0x549477={'id':_0x29d047['id'],'dbId':_0x29d047[_0x2d8847(0x211)],'sqlName':_0x29d047[_0x2d8847(0x1b1)],'appCode':this[_0x2d8847(0x1f1)],'sqlContent':_0x29d047[_0x2d8847(0x1a8)]};return await this['postRequest'](_0x5e92d1,_0x549477);}async[a1_0x170ea4(0x205)](_0x4f06b7,_0xb926c0=![]){const _0x2284ea=a1_0x170ea4,_0x3329bc=_0x2284ea(0x1be)+this[_0x2284ea(0x1f1)]+':'+this[_0x2284ea(0x200)]+':'+_0x4f06b7;if(!_0xb926c0){const _0x30c302=apiCache[_0x2284ea(0x1ac)](_0x3329bc);if(_0x30c302)return _0x30c302;}const _0x2ed618=this[_0x2284ea(0x213)]+'/smartapi/question/er-config',_0x290749=await this[_0x2284ea(0x1d0)](_0x2ed618,{'dblinkId':_0x4f06b7,'appCode':this[_0x2284ea(0x1f1)]});if(!_0x290749[_0x2284ea(0x21b)]||!_0x290749[_0x2284ea(0x1fc)])throw new Error(_0x2284ea(0x1e1)+_0x4f06b7);const _0x355a93={'meta':_0x290749[_0x2284ea(0x1fc)][_0x2284ea(0x1ee)],'datasets':_0x290749['data'][_0x2284ea(0x1c6)]};return apiCache[_0x2284ea(0x1db)](_0x3329bc,_0x355a93),_0x355a93;}async['getUniqueDbIds'](_0x4852fa=![]){const _0x4dd0c8=a1_0x170ea4,_0x46fb51=await this[_0x4dd0c8(0x1f0)]({'forceRefresh':_0x4852fa}),_0x182d3e=Array[_0x4dd0c8(0x1ff)](_0x46fb51[_0x4dd0c8(0x1fc)])?_0x46fb51[_0x4dd0c8(0x1fc)]:_0x46fb51['data']?.[_0x4dd0c8(0x1d6)]||[],_0x50e47b=new Set();for(const _0x5cd114 of _0x182d3e){_0x5cd114[_0x4dd0c8(0x1a5)]?.[_0x4dd0c8(0x211)]&&_0x50e47b[_0x4dd0c8(0x1dc)](_0x5cd114[_0x4dd0c8(0x1a5)]['dbId']);}return Array[_0x4dd0c8(0x1b4)](_0x50e47b)[_0x4dd0c8(0x1ef)]((_0x228028,_0x2399b2)=>_0x228028-_0x2399b2);}async[a1_0x170ea4(0x1df)](_0x4ce9bb=![]){const _0x115936=a1_0x170ea4,_0x51aeec='er-configs-all:'+this[_0x115936(0x1f1)]+':'+this[_0x115936(0x200)];if(!_0x4ce9bb){const _0x398c98=apiCache[_0x115936(0x1ac)](_0x51aeec);if(_0x398c98)return _0x398c98;}const _0x2e1fbe=await this[_0x115936(0x1d9)](_0x4ce9bb),_0x4951e1=new Map();for(const _0x313d11 of _0x2e1fbe){try{const _0x2705cd=await this[_0x115936(0x205)](_0x313d11,_0x4ce9bb);_0x4951e1[_0x115936(0x1db)](_0x313d11,_0x2705cd);}catch(_0x43f05a){console[_0x115936(0x1fa)](_0x115936(0x209)+_0x313d11+':',_0x43f05a);}}return apiCache[_0x115936(0x1db)](_0x51aeec,_0x4951e1),_0x4951e1;}async[a1_0x170ea4(0x1d5)](_0x2eb470,_0x19e476=![]){const _0x178502=a1_0x170ea4,_0x4c9566=await this[_0x178502(0x1df)](_0x19e476),_0xea0871=[],_0x1922b5=[];for(const [,_0xab302]of _0x4c9566){const _0x39e7cf=_0xab302[_0x178502(0x1c6)][_0x178502(0x1e7)](_0xa57d21=>_0xa57d21[_0x178502(0x1b9)]===_0x2eb470);if(_0x39e7cf)for(const _0x39b020 of _0x39e7cf[_0x178502(0x1d7)]||[]){_0xea0871[_0x178502(0x21a)]({'toDataset':_0x39b020[_0x178502(0x208)],'toDatasetName':_0x39b020[_0x178502(0x1ed)],'toField':_0x39b020[_0x178502(0x1a9)],'fromField':_0x39b020[_0x178502(0x1ce)],'joinType':_0x39b020[_0x178502(0x215)]});}for(const _0x44bb84 of _0xab302[_0x178502(0x1c6)]){if(_0x44bb84[_0x178502(0x1b9)]===_0x2eb470)continue;for(const _0x1f7688 of _0x44bb84[_0x178502(0x1d7)]||[]){_0x1f7688[_0x178502(0x208)]===_0x2eb470&&_0x1922b5[_0x178502(0x21a)]({'fromDataset':_0x44bb84[_0x178502(0x1b9)],'fromDatasetName':_0x44bb84[_0x178502(0x1f7)],'fromField':_0x1f7688[_0x178502(0x1ce)],'toField':_0x1f7688[_0x178502(0x1a9)],'joinType':_0x1f7688['joinType']});}}}return{'outgoing':_0xea0871,'incoming':_0x1922b5};}async['getBffScriptList'](){const _0x355a08=a1_0x170ea4,_0x4f0919=this[_0x355a08(0x213)]+_0x355a08(0x1f9)+encodeURIComponent(this[_0x355a08(0x1f1)])+_0x355a08(0x1d3);return await this[_0x355a08(0x1dd)](_0x4f0919);}async[a1_0x170ea4(0x1ba)](_0x3a89b9){const _0x4dc475=a1_0x170ea4,_0x398422=this[_0x4dc475(0x213)]+'/api/management/library/scripts/info?id='+_0x3a89b9;return await this[_0x4dc475(0x1dd)](_0x398422);}async[a1_0x170ea4(0x1f8)](_0x4d09ca){const _0x53e93d=a1_0x170ea4,_0x44bac3=this[_0x53e93d(0x213)]+_0x53e93d(0x1ca),_0x2048c5={'id':_0x4d09ca['id']??null,'appCode':_0x4d09ca['appCode'],'description':_0x4d09ca[_0x53e93d(0x20f)],'scriptContent':_0x4d09ca[_0x53e93d(0x1e3)],'scriptType':_0x4d09ca[_0x53e93d(0x1b0)]};return await this[_0x53e93d(0x1d0)](_0x44bac3,_0x2048c5);}async[a1_0x170ea4(0x1e6)](){const _0x2f1ef8=a1_0x170ea4,_0xbcaa31=this[_0x2f1ef8(0x1e2)]+_0x2f1ef8(0x20c);return await this[_0x2f1ef8(0x1d0)](_0xbcaa31,{});}async[a1_0x170ea4(0x1f6)](_0x53ec5a){const _0x1922ec=a1_0x170ea4,_0x18ed2e=this[_0x1922ec(0x1b2)](_0x1922ec(0x1c4),'/api/node-toolbox/sql/save'),_0x2d47bc=await this['postRequest'](_0x18ed2e,_0x53ec5a);return _0x2d47bc['data'];}async['saveBffScriptViaToolbox'](_0x286230){const _0x4c9c93=a1_0x170ea4,_0x5e80aa=this[_0x4c9c93(0x1b2)]('save-bff',_0x4c9c93(0x1c8)),_0x350012=await this[_0x4c9c93(0x1d0)](_0x5e80aa,_0x286230);return _0x350012[_0x4c9c93(0x1fc)];}}
|
package/dist/auth/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a2_0xb4d9(_0x15ec53,_0x1169c5){_0x15ec53=_0x15ec53-0xde;var _0x244f34=a2_0x244f();var _0xb4d9b=_0x244f34[_0x15ec53];return _0xb4d9b;}(function(_0x5531fd,_0x461248){var _0x1ab50b=a2_0xb4d9,_0x2ff54a=_0x5531fd();while(!![]){try{var _0x177872=parseInt(_0x1ab50b(0xe0))/0x1+parseInt(_0x1ab50b(0xe4))/0x2+parseInt(_0x1ab50b(0xdf))/0x3+parseInt(_0x1ab50b(0xe5))/0x4*(-parseInt(_0x1ab50b(0xe6))/0x5)+-parseInt(_0x1ab50b(0xde))/0x6*(-parseInt(_0x1ab50b(0xe3))/0x7)+parseInt(_0x1ab50b(0xe8))/0x8*(parseInt(_0x1ab50b(0xe7))/0x9)+-parseInt(_0x1ab50b(0xe1))/0xa*(parseInt(_0x1ab50b(0xe2))/0xb);if(_0x177872===_0x461248)break;else _0x2ff54a['push'](_0x2ff54a['shift']());}catch(_0x33abd4){_0x2ff54a['push'](_0x2ff54a['shift']());}}}(a2_0x244f,0xaeb7c));export{getEnvAppCode,getEnvironment,getEnvApiBaseUrl,getEnvRuntimeBaseUrl,getEnvUserBaseUrl,getEnvAuthCookie,configDir,cookieFile,defaultConfig,getEnvAppCodeWithFallback,getApiDomain,getUserDomain,getRuntimeDomain,getEffectiveApiDomain,getEffectiveRuntimeDomain,getEffectiveUserDomain,getEnvToolboxBaseUrl,getEffectiveToolboxDomain}from'../config/env.js';export{resolveApiBaseUrl}from'../config/api-url-resolver.js';function a2_0x244f(){var _0x4dc6fd=['5258090hUGpkf','33ibbLoL','14vkqnLR','1471362hJzYlU','904nNbyfA','20YfbQnl','18WkHfmC','2916592UFUcuH','940722PorEME','61026gtLxoL','495230jhDAPw'];a2_0x244f=function(){return _0x4dc6fd;};return a2_0x244f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a3_0x1dd1(){const _0x299f0a=['5470752TsVeHl','3778285DoiEtp','136GqFZpM','2ozWDUj','message','1893882YlcsFK','length','utf-8','410680yFiHwM','119670zemStE','11544rTcIbL','Failed\x20to\x20save\x20cookie\x20to\x20','639SHDCiu','1271098tqtOEo'];a3_0x1dd1=function(){return _0x299f0a;};return a3_0x1dd1();}function a3_0x42ce(_0x5e129a,_0x56891a){_0x5e129a=_0x5e129a-0x127;const _0x1dd174=a3_0x1dd1();let _0x42cede=_0x1dd174[_0x5e129a];return _0x42cede;}(function(_0x21b02d,_0x1d77e3){const _0x473ca3=a3_0x42ce,_0x4c195d=_0x21b02d();while(!![]){try{const _0x36928c=parseInt(_0x473ca3(0x12a))/0x1*(-parseInt(_0x473ca3(0x134))/0x2)+parseInt(_0x473ca3(0x131))/0x3+parseInt(_0x473ca3(0x129))/0x4*(-parseInt(_0x473ca3(0x130))/0x5)+-parseInt(_0x473ca3(0x12c))/0x6+-parseInt(_0x473ca3(0x128))/0x7+parseInt(_0x473ca3(0x127))/0x8+-parseInt(_0x473ca3(0x133))/0x9*(-parseInt(_0x473ca3(0x12f))/0xa);if(_0x36928c===_0x1d77e3)break;else _0x4c195d['push'](_0x4c195d['shift']());}catch(_0x40ae74){_0x4c195d['push'](_0x4c195d['shift']());}}}(a3_0x1dd1,0xa1ee0));import{readFileSync,writeFileSync}from'node:fs';import{getEnvAuthCookie,cookieFile}from'../config/env.js';export function getCookie(){const _0x470b13=a3_0x42ce,_0x29fd64=getEnvAuthCookie();if(_0x29fd64)return _0x29fd64;try{return readFileSync(cookieFile,_0x470b13(0x12e))['trim']();}catch{return'';}}export function saveCookie(_0x32a147){const _0x10fba0=a3_0x42ce;try{writeFileSync(cookieFile,_0x32a147,_0x10fba0(0x12e));}catch(_0x40f8f3){throw new Error(_0x10fba0(0x132)+cookieFile+':\x20'+_0x40f8f3[_0x10fba0(0x12b)]);}}export function hasCookie(){const _0x4dc095=a3_0x42ce,_0x25dc49=getCookie();return _0x25dc49[_0x4dc095(0x12d)]>0x0;}export function clearCookie(){const _0xa11604=a3_0x42ce;try{writeFileSync(cookieFile,'',_0xa11604(0x12e));}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a4_0x1dd6(){const _0x5dfe2e=['118096TuGVuk','1760BikquI','90638iREvAz','290yZxmAw','891pTbNAq','json','13458NPJPcZ','91198qmkPTQ','/api/auth/get-session','396347ZrmSTT','user','192177YTjSgK'];a4_0x1dd6=function(){return _0x5dfe2e;};return a4_0x1dd6();}(function(_0x44cac5,_0x19e3ef){const _0x5adf44=a4_0x3160,_0x2bc914=_0x44cac5();while(!![]){try{const _0x1efdeb=-parseInt(_0x5adf44(0x9d))/0x1+parseInt(_0x5adf44(0xa4))/0x2+parseInt(_0x5adf44(0xa6))/0x3*(parseInt(_0x5adf44(0xa3))/0x4)+parseInt(_0x5adf44(0xa5))/0x5*(parseInt(_0x5adf44(0xa8))/0x6)+-parseInt(_0x5adf44(0x9f))/0x7+-parseInt(_0x5adf44(0xa2))/0x8+-parseInt(_0x5adf44(0xa1))/0x9;if(_0x1efdeb===_0x19e3ef)break;else _0x2bc914['push'](_0x2bc914['shift']());}catch(_0x4e3620){_0x2bc914['push'](_0x2bc914['shift']());}}}(a4_0x1dd6,0x1dd2f));import{getCookie}from'./cookie-manager.js';import{getUserDomain}from'../config/env.js';function a4_0x3160(_0x569943,_0x2021e6){_0x569943=_0x569943-0x9d;const _0x1dd6d0=a4_0x1dd6();let _0x316050=_0x1dd6d0[_0x569943];return _0x316050;}export async function isSessionValid(){const _0x270a89=a4_0x3160,_0xc57c79=getCookie();if(!_0xc57c79)return![];try{const _0x12acd4=await fetch(getUserDomain()+_0x270a89(0x9e),{'headers':{'cookie':_0xc57c79}});if(!_0x12acd4['ok'])return![];const _0x1b8b31=await _0x12acd4[_0x270a89(0xa7)]();return!!(_0x1b8b31?.['session']&&_0x1b8b31?.[_0x270a89(0xa0)]);}catch{return![];}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x23ecc5,_0x17d54b){const _0x164705=a5_0x327f,_0xbc5a9=_0x23ecc5();while(!![]){try{const _0x38fe1e=parseInt(_0x164705(0x8a))/0x1+parseInt(_0x164705(0x92))/0x2*(-parseInt(_0x164705(0x91))/0x3)+parseInt(_0x164705(0x8f))/0x4+parseInt(_0x164705(0x87))/0x5*(-parseInt(_0x164705(0x89))/0x6)+-parseInt(_0x164705(0x85))/0x7+parseInt(_0x164705(0x8e))/0x8*(-parseInt(_0x164705(0x95))/0x9)+-parseInt(_0x164705(0x94))/0xa*(-parseInt(_0x164705(0x93))/0xb);if(_0x38fe1e===_0x17d54b)break;else _0xbc5a9['push'](_0xbc5a9['shift']());}catch(_0x5446be){_0xbc5a9['push'](_0xbc5a9['shift']());}}}(a5_0x377a,0x1e595));import{getEnvToolboxBaseUrl,getEffectiveApiDomain}from'./env.js';function a5_0x327f(_0x1e4b1b,_0x1416a8){_0x1e4b1b=_0x1e4b1b-0x85;const _0x377a3f=a5_0x377a();let _0x327f44=_0x377a3f[_0x1e4b1b];return _0x327f44;}import{getConfigApiUrlOverrides}from'./lovrabet-config.js';let _envOverridesCache=null;function getEnvApiUrlOverrides(){const _0x1b6875=a5_0x327f;if(_envOverridesCache!==null)return _envOverridesCache;const _0x4f22e4=process[_0x1b6875(0x8b)][_0x1b6875(0x88)];if(!_0x4f22e4)return _envOverridesCache={},_envOverridesCache;try{_envOverridesCache=JSON[_0x1b6875(0x8c)](_0x4f22e4);}catch{process['env'][_0x1b6875(0x8d)]&&console[_0x1b6875(0x90)](_0x1b6875(0x86)),_envOverridesCache={};}return _envOverridesCache;}function a5_0x377a(){const _0x46cb2c=['117YcuBQf','428351KqddAd','[MCP]\x20LOVRABET_API_URL_OVERRIDES\x20is\x20not\x20valid\x20JSON,\x20ignoring','91045QIqRAV','LOVRABET_API_URL_OVERRIDES','6TlgfLy','179904HHuUHf','env','parse','MCP_DEBUG','121120uxIgzE','269944WMRQVD','warn','143658CoXipt','8vtffkK','252769jSRDsN','150nAXAzw'];a5_0x377a=function(){return _0x46cb2c;};return a5_0x377a();}export function resolveApiBaseUrl(_0x329041){const _0x22abf2=getEnvApiUrlOverrides();if(_0x22abf2[_0x329041])return _0x22abf2[_0x329041];const _0x159b25=getConfigApiUrlOverrides();if(_0x159b25[_0x329041])return _0x159b25[_0x329041];return getEnvToolboxBaseUrl()??getEffectiveApiDomain();}export function clearApiUrlOverridesCache(){_envOverridesCache=null;}
|
package/dist/config/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x4716d2=a6_0x2dd5;(function(_0x3ab7ed,_0x497716){const _0x2dc776=a6_0x2dd5,_0x5aecb1=_0x3ab7ed();while(!![]){try{const _0x13ba3b=-parseInt(_0x2dc776(0x119))/0x1*(parseInt(_0x2dc776(0x12e))/0x2)+-parseInt(_0x2dc776(0x11c))/0x3*(-parseInt(_0x2dc776(0x123))/0x4)+-parseInt(_0x2dc776(0x120))/0x5*(parseInt(_0x2dc776(0x121))/0x6)+-parseInt(_0x2dc776(0x122))/0x7+-parseInt(_0x2dc776(0x12d))/0x8*(-parseInt(_0x2dc776(0x12a))/0x9)+-parseInt(_0x2dc776(0x133))/0xa*(-parseInt(_0x2dc776(0x138))/0xb)+parseInt(_0x2dc776(0x139))/0xc*(parseInt(_0x2dc776(0x12c))/0xd);if(_0x13ba3b===_0x497716)break;else _0x5aecb1['push'](_0x5aecb1['shift']());}catch(_0x12a7bd){_0x5aecb1['push'](_0x5aecb1['shift']());}}}(a6_0x13ac,0xdc5e8));import{mkdirSync}from'node:fs';import{homedir}from'node:os';const ENVIRONMENT_MAPPING={'online':a6_0x4716d2(0x135),'production':a6_0x4716d2(0x135),'daily':a6_0x4716d2(0x134),'dev':a6_0x4716d2(0x116),'development':a6_0x4716d2(0x116)};function normalizeEnvironment(_0x290ed8){const _0x54e88d=a6_0x4716d2;if(!_0x290ed8)return'production';const _0x134d03=_0x290ed8[_0x54e88d(0x118)](),_0x84e30a=ENVIRONMENT_MAPPING[_0x134d03];if(!_0x84e30a)return console[_0x54e88d(0x117)](_0x54e88d(0x126)+_0x290ed8+_0x54e88d(0x11a)),'production';return _0x84e30a!==_0x134d03&&_0x84e30a!==_0x290ed8&&console[_0x54e88d(0x132)](_0x54e88d(0x11b)+_0x290ed8+_0x54e88d(0x136)+_0x84e30a),_0x84e30a;}export function getEnvAppCode(){const _0x313ce1=a6_0x4716d2;return process[_0x313ce1(0x12f)][_0x313ce1(0x13b)];}export function getEnvironment(){const _0x35798e=a6_0x4716d2,_0x13d51c=process[_0x35798e(0x12f)]['LOVRABET_ENV'];return normalizeEnvironment(_0x13d51c);}export function getEnvApiBaseUrl(){const _0x4dcb0b=a6_0x4716d2;return process[_0x4dcb0b(0x12f)][_0x4dcb0b(0x129)];}export function getEnvRuntimeBaseUrl(){const _0x3cf2ee=a6_0x4716d2;return process[_0x3cf2ee(0x12f)][_0x3cf2ee(0x125)];}export function getEnvUserBaseUrl(){const _0x4ee5c4=a6_0x4716d2;return process[_0x4ee5c4(0x12f)][_0x4ee5c4(0x137)];}export function getEnvAuthCookie(){const _0xbc9d9d=a6_0x4716d2;return process[_0xbc9d9d(0x12f)][_0xbc9d9d(0x128)]?.[_0xbc9d9d(0x131)]();}function a6_0x2dd5(_0x48fed1,_0x344d32){_0x48fed1=_0x48fed1-0x115;const _0x13ac0f=a6_0x13ac();let _0x2dd586=_0x13ac0f[_0x48fed1];return _0x2dd586;}export function isTestEnv(){const _0x3ad515=a6_0x4716d2;return process['env'][_0x3ad515(0x11d)]===_0x3ad515(0x115);}export function isProductionEnv(){const _0x4f12f6=a6_0x4716d2;return process['env'][_0x4f12f6(0x11d)]===_0x4f12f6(0x135);}export function isDevelopmentEnv(){const _0x2f3031=a6_0x4716d2;return process[_0x2f3031(0x12f)][_0x2f3031(0x11d)]===_0x2f3031(0x116);}export function shouldLog(){const _0x4cc9c7=a6_0x4716d2,_0x35b033=process[_0x4cc9c7(0x12f)][_0x4cc9c7(0x11d)];return _0x35b033===_0x4cc9c7(0x116)||_0x35b033===_0x4cc9c7(0x134);}export const configDir=homedir()+a6_0x4716d2(0x127);export const cookieFile=configDir+'/cookie';mkdirSync(configDir,{'recursive':!![]});export const defaultConfig={'appCode':getEnvAppCode(),'env':getEnvironment()};export function getEnvAppCodeWithFallback(_0xd61e31){return getEnvAppCode()||_0xd61e31;}export function getApiDomain(){const _0x2a666e=a6_0x4716d2,_0x2bae6a=getEnvironment(),_0x1a94dc={'production':_0x2a666e(0x130),'online':_0x2a666e(0x130),'daily':'https://daily-api.lovrabet.com','development':_0x2a666e(0x11e)};return _0x1a94dc[_0x2bae6a];}export function getUserDomain(){const _0x26cf43=a6_0x4716d2,_0x1431d5=getEnvironment(),_0x25c416={'production':_0x26cf43(0x13a),'online':'https://user.lovrabet.com','daily':_0x26cf43(0x124),'development':_0x26cf43(0x11e)};return _0x25c416[_0x1431d5];}export function getRuntimeDomain(){const _0x9bd059=a6_0x4716d2,_0x18ea01=getEnvironment(),_0x3ef892={'production':_0x9bd059(0x11f),'online':_0x9bd059(0x11f),'daily':'https://daily-runtime.lovrabet.com','development':'https://dev.lovrabet.com'};return _0x3ef892[_0x18ea01];}export function getEffectiveApiDomain(){return getEnvApiBaseUrl()||getApiDomain();}export function getEffectiveRuntimeDomain(){return getEnvRuntimeBaseUrl()||getRuntimeDomain();}export function getEffectiveUserDomain(){return getEnvUserBaseUrl()||getUserDomain();}export function getEnvToolboxBaseUrl(){const _0x2d95d3=a6_0x4716d2;return process[_0x2d95d3(0x12f)][_0x2d95d3(0x12b)];}export function getEffectiveToolboxDomain(){return getEnvToolboxBaseUrl()||getEffectiveApiDomain();}function a6_0x13ac(){const _0x52e2f7=['2252936KSEWmD','178252CBPOcq','https://user-daily.lovrabet.com','LOVRABET_RUNTIME_BASEURL','[ENV]\x20Unknown\x20environment:\x20','/.lovrabet','LOVRABET_AUTH_COOKIE','LOVRABET_API_BASEURL','35316RftIAO','LOVRABET_TOOLBOX_BASEURL','2850081EIlsLH','16khIcPA','1370132gQTyar','env','https://api.lovrabet.com','trim','log','8670wbWDjC','daily','production','\x20→\x20','LOVRABET_USER_BASEURL','3806mPxARm','180vjlYNi','https://user.lovrabet.com','LOVRABET_APP_CODE','test','development','warn','toLowerCase','2gixZNi',',\x20using\x20default\x20production','[ENV]\x20Environment\x20mapping:\x20','21QQrhXD','NODE_ENV','https://dev.lovrabet.com','https://runtime.lovrabet.com','10hNjRhL','3941142bbVcbq'];a6_0x13ac=function(){return _0x52e2f7;};return a6_0x13ac();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x57e4e0,_0x4cb818){const _0x5632a6=a7_0x2a4b,_0x592a66=_0x57e4e0();while(!![]){try{const _0x1351be=parseInt(_0x5632a6(0x11f))/0x1*(parseInt(_0x5632a6(0x11c))/0x2)+parseInt(_0x5632a6(0x11e))/0x3*(-parseInt(_0x5632a6(0x11a))/0x4)+parseInt(_0x5632a6(0x121))/0x5+parseInt(_0x5632a6(0x120))/0x6*(parseInt(_0x5632a6(0x11d))/0x7)+parseInt(_0x5632a6(0x124))/0x8+-parseInt(_0x5632a6(0x123))/0x9*(-parseInt(_0x5632a6(0x119))/0xa)+-parseInt(_0x5632a6(0x122))/0xb;if(_0x1351be===_0x4cb818)break;else _0x592a66['push'](_0x592a66['shift']());}catch(_0x354824){_0x592a66['push'](_0x592a66['shift']());}}}(a7_0x4222,0xef8d6));import{existsSync,readFileSync}from'node:fs';function a7_0x2a4b(_0x1de379,_0x45731d){_0x1de379=_0x1de379-0x114;const _0x4222ae=a7_0x4222();let _0x2a4b44=_0x4222ae[_0x1de379];return _0x2a4b44;}import{configDir}from'./env.js';let _cache=null;function a7_0x4222(){const _0xa6ff95=['2259tlICpJ','1598605uhMhyy','78JrburQ','1188255Hievfb','30754493SyGNys','99bqfWET','5120968jmzrsQ',',\x20using\x20empty\x20config','[MCP]\x20Failed\x20to\x20parse\x20','env','apiUrlOverrides','parse','/config.json','575170ANFlra','4056yZwghA','MCP_DEBUG','2XzYdZh','770833oLOTOu'];a7_0x4222=function(){return _0xa6ff95;};return a7_0x4222();}function readConfigFile(){const _0x14fb98=a7_0x2a4b;if(_cache!==null)return _cache;const _0x182512=configDir+_0x14fb98(0x118);if(!existsSync(_0x182512))return _cache={},_cache;try{_cache=JSON[_0x14fb98(0x117)](readFileSync(_0x182512,'utf-8'));}catch{process[_0x14fb98(0x115)][_0x14fb98(0x11b)]&&console['warn'](_0x14fb98(0x114)+_0x182512+_0x14fb98(0x125)),_cache={};}return _cache;}export function getConfigApiUrlOverrides(){const _0x31a10d=a7_0x2a4b;return readConfigFile()[_0x31a10d(0x116)]??{};}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_0x2d8dfc=a8_0x4689;function a8_0x25bf(){const _0x1d0205=['6hKqpTK','817696NfEUTr','Failed\x20to\x20start\x20Lovrabet\x20Dataset\x20MCP\x20Server:','SIGINT','19283530ngndYQ','Unhandled\x20error:','37784YKbaoA','Shutting\x20down\x20Lovrabet\x20Dataset\x20MCP\x20Server...','env','--enable-bff-save','585dNTTRg','argv','log','3119921jbQlIT','catch','connect','4ARLjQX','[MCP]\x20--dangerously-bff-save\x20is\x20deprecated;\x20use\x20--enable-bff-save\x20(same\x20behavior)','389918CjTjXW','--dangerously-bff-save','includes','2677870qsBBeR','403518cgnLjM','exit','logInfo','MCP_DEBUG','error'];a8_0x25bf=function(){return _0x1d0205;};return a8_0x25bf();}(function(_0x3b7a1b,_0x1cc428){const _0x218a26=a8_0x4689,_0x38695a=_0x3b7a1b();while(!![]){try{const _0x13da09=-parseInt(_0x218a26(0x1ff))/0x1+-parseInt(_0x218a26(0x1fd))/0x2*(-parseInt(_0x218a26(0x203))/0x3)+-parseInt(_0x218a26(0x209))/0x4+-parseInt(_0x218a26(0x202))/0x5+parseInt(_0x218a26(0x208))/0x6*(-parseInt(_0x218a26(0x1fa))/0x7)+-parseInt(_0x218a26(0x1f3))/0x8*(parseInt(_0x218a26(0x1f7))/0x9)+parseInt(_0x218a26(0x20c))/0xa;if(_0x13da09===_0x1cc428)break;else _0x38695a['push'](_0x38695a['shift']());}catch(_0x54e3d1){_0x38695a['push'](_0x38695a['shift']());}}}(a8_0x25bf,0x4cd7f));import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{createServer}from'./server.js';function a8_0x4689(_0x5cd563,_0x30005a){_0x5cd563=_0x5cd563-0x1f2;const _0x25bff1=a8_0x25bf();let _0x46892d=_0x25bff1[_0x5cd563];return _0x46892d;}function parseArgs(){const _0x2d03c7=a8_0x4689,_0x3ac74b=process[_0x2d03c7(0x1f8)]['slice'](0x2),_0x3257df=_0x3ac74b[_0x2d03c7(0x201)](_0x2d03c7(0x1f6))||_0x3ac74b['includes']('--dangerously-bff-save');return process[_0x2d03c7(0x1f5)][_0x2d03c7(0x206)]&&_0x3ac74b['includes'](_0x2d03c7(0x200))&&!_0x3ac74b[_0x2d03c7(0x201)]('--enable-bff-save')&&console['warn'](_0x2d03c7(0x1fe)),{'bffSaveEnabled':_0x3257df};}async function main(){const _0x24e915=a8_0x4689;try{const {bffSaveEnabled:_0x22cf63}=parseArgs(),_0x4ac283=createServer({'bffSaveEnabled':_0x22cf63}),_0x94797b=new StdioServerTransport();_0x4ac283[_0x24e915(0x205)](),await _0x4ac283[_0x24e915(0x1fc)](_0x94797b),process['on'](_0x24e915(0x20b),async()=>{const _0x5c2959=_0x24e915;process['env'][_0x5c2959(0x206)]&&console[_0x5c2959(0x1f9)](_0x5c2959(0x1f4)),process[_0x5c2959(0x204)](0x0);}),process['on']('SIGTERM',async()=>{const _0x1e311c=_0x24e915;process['env'][_0x1e311c(0x206)]&&console[_0x1e311c(0x1f9)](_0x1e311c(0x1f4)),process[_0x1e311c(0x204)](0x0);});}catch(_0x1a59f5){console[_0x24e915(0x207)](_0x24e915(0x20a),_0x1a59f5),process[_0x24e915(0x204)](0x1);}}main()[a8_0x2d8dfc(0x1fb)](_0x356cc1=>{const _0x553efb=a8_0x2d8dfc;console[_0x553efb(0x207)](_0x553efb(0x1f2),_0x356cc1),process[_0x553efb(0x204)](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_0x8cb998=a9_0x1a5c;(function(_0x3a2fc1,_0x4dc7dd){const _0x2db19c=a9_0x1a5c,_0x4ad5e2=_0x3a2fc1();while(!![]){try{const _0x3a5cc8=parseInt(_0x2db19c(0xc9))/0x1*(parseInt(_0x2db19c(0xeb))/0x2)+-parseInt(_0x2db19c(0xe5))/0x3*(-parseInt(_0x2db19c(0x109))/0x4)+parseInt(_0x2db19c(0x11a))/0x5*(parseInt(_0x2db19c(0xfb))/0x6)+parseInt(_0x2db19c(0xe9))/0x7*(-parseInt(_0x2db19c(0xed))/0x8)+parseInt(_0x2db19c(0xb3))/0x9+parseInt(_0x2db19c(0xf0))/0xa+-parseInt(_0x2db19c(0xce))/0xb;if(_0x3a5cc8===_0x4dc7dd)break;else _0x4ad5e2['push'](_0x4ad5e2['shift']());}catch(_0x46f0eb){_0x4ad5e2['push'](_0x4ad5e2['shift']());}}}(a9_0x5510,0x64745));function a9_0x1a5c(_0x8137e3,_0x5d79b0){_0x8137e3=_0x8137e3-0xb2;const _0x55103c=a9_0x5510();let _0x1a5cbd=_0x55103c[_0x8137e3];return _0x1a5cbd;}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('../package.json'),authSchema={'appCode':z['string']()['optional']()[a9_0x8cb998(0xd7)](a9_0x8cb998(0xc1)),'cookie':z['string']()[a9_0x8cb998(0xfe)]()['describe'](a9_0x8cb998(0xcc))};function registerToolWithOptions(_0x3a2126,_0x1288a0,_0x137da0,_0x14aa87){const _0x53a469=a9_0x8cb998;_0x3a2126[_0x53a469(0xd6)](_0x1288a0,_0x137da0,_0x14aa87);}function wrapHandler(_0x583322){return async _0x3eca15=>{const _0x2e7b3b=a9_0x1a5c;try{const _0x20e7c0=await _0x583322(_0x3eca15);return{'content':[{'type':'text','text':JSON['stringify'](_0x20e7c0,null,0x2)}]};}catch(_0x5aed49){return{'content':[{'type':_0x2e7b3b(0x119),'text':JSON[_0x2e7b3b(0xea)]({'error':!![],'message':_0x5aed49['message']||'Unknown\x20error\x20occurred'},null,0x2)}],'isError':!![]};}};}function a9_0x5510(){const _0x566a76=['log','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation,\x20including\x20field\x20metadata.\x20Check\x20user\x27s\x20@lovrabet/sdk\x20version\x20in\x20package.json\x20first.','Include\x20bidirectional\x20relations,\x20summary,\x20and\x20usage\x20hints\x20(default:\x20true)','58953qWZhEv','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).','MCP_DEBUG','mcpServer','4772579MDHQpN','stringify','10646HLNumq','get_operation_detail','8eCusWS','Execute\x20Custom\x20SQL','login','6090060jJJMEZ','save_or_update_bff_script','Generate\x20SDK\x20Code','number','Search\x20keyword','Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update)','boolean','env','Get\x20Dataset\x20Detail','bff','search_datasets','12dxUFPY','array','JavaScript/TypeScript\x20code\x20with\x20default\x20export','optional','registerAllTools','generate_sdk_code','SQL\x20content\x20(SELECT/INSERT/UPDATE/WITH\x20auto-saved;\x20DELETE/DDL\x20blocked).\x20Supports\x20MyBatis\x20syntax.','Items\x20per\x20page\x20(default:\x20999)','union','Get\x20list\x20of\x20all\x20API\x20operations\x20for\x20a\x20dataset.\x20Prefer\x20\x22filter\x22\x20for\x20queries,\x20\x22getOne\x22\x20for\x20single\x20record\x20by\x20ID.','get_dataset_detail','execute_custom_sql','Generate\x20SQL\x20Code','list_sql_queries','164uxptXw','connect','Login','Get\x20Backend\x20Function\x20Info','bffSaveEnabled','Environment\x20(optional,\x20uses\x20LOVRABET_ENV\x20or\x20defaults\x20to\x20online)','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode.\x20Get\x20sqlCode\x20from\x20list_sql_queries\x20first.','Database\x20ID\x20(optional)','Backend\x20Function\x20write\x20tools\x20enabled\x20(--enable-bff-save)','Get\x20Operation\x20Detail','min','SQL\x20parameters','Get\x20detailed\x20operation\x20information\x20including\x20request/response\x20examples.','options','Dataset\x20code/ID','sdk','text','285020cVPZfz','Search\x20Datasets','save_or_update_custom_sql','daily','Dataset\x20ID\x20(numeric)\x20or\x20code\x20(UUID)','1128222pSaQeM','get_bff_script_info','string','version','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20via\x20toolbox.\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20WITH\x20are\x20auto-saved;\x20DELETE\x20and\x20DDL\x20are\x20blocked\x20for\x20safety.\x20If\x20the\x20last\x20submitter\x20was\x20someone\x20else,\x20returns\x20blocked=true\x20—\x20tell\x20the\x20user\x20to\x20operate\x20manually,\x20do\x20NOT\x20retry.\x20Supports\x20MyBatis\x20syntax.\x20Get\x20dbId\x20from\x20get_dataset_detail.','validate_sql_content','SQL\x20code\x20from\x20list_sql_queries\x20->\x20sqlCode','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','Save\x20or\x20Update\x20Backend\x20Function','Backend\x20Function\x20ID\x20(for\x20updating)','Example\x20parameter\x20values','List\x20all\x20available\x20custom\x20SQL\x20queries\x20with\x20metadata\x20and\x20parameters.','List\x20Backend\x20Functions','Get\x20Operations','Application\x20code\x20(optional\x20if\x20LOVRABET_APP_CODE\x20env\x20var\x20is\x20set)','Client-side\x20filter\x20by\x20category','Target\x20context:\x20\x22sdk\x22\x20(Frontend\x20SDK,\x20default)\x20or\x20\x22bff\x22\x20(Backend\x20Function).\x20SDK\x20returns\x20{execSuccess,\x20execResult}\x20wrapper;\x20BFF\x20returns\x20rows\x20directly.','close','enum','Lovrabet\x20Dataset\x20MCP\x20Server','record','Backend\x20Function\x20ID\x20(from\x20list_bff_scripts)','149Fzirth','SQL\x20code\x20from\x20list_sql_queries\x20(must\x20exist)','server','Authentication\x20cookie\x20(optional,\x20uses\x20stored\x20cookie\x20from\x20login\x20if\x20not\x20provided)','Include\x20table\x20relations\x20(default:\x20true)','14893252MeEAuC','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.','Database\x20ID\x20from\x20get_dataset_detail\x20—\x20required\x20when\x20creating\x20new\x20SQL,\x20optional\x20when\x20updating','SQL\x20ID\x20(kept\x20for\x20backward\x20compatibility,\x20not\x20used\x20by\x20toolbox)','list_datasets','List\x20Datasets','List\x20all\x20Backend\x20Function\x20(ENDPOINT\x20type)\x20scripts.','Function\x20description','registerTool','describe','Save\x20or\x20Update\x20Custom\x20SQL','Get\x20detailed\x20Backend\x20Function\x20script\x20including\x20full\x20source\x20code.','Conflict\x20detection\x20is\x20handled\x20server-side\x20by\x20toolbox','Server\x20started\x20successfully','list_bff_scripts','Client-side\x20filter\x20by\x20name/description/content','Search\x20datasets\x20by\x20keyword\x20(searches\x20in\x20name,\x20table\x20name,\x20code,\x20and\x20description).','Include\x20import\x20statements\x20(default:\x20true)','Bypass\x20cache\x20(default:\x20false)','logInfo'];a9_0x5510=function(){return _0x566a76;};return a9_0x5510();}export class LovrabetDatasetMCPServer{[a9_0x8cb998(0xe8)];[a9_0x8cb998(0x116)];constructor(_0x14863f={}){const _0x2ef10d=a9_0x8cb998;this[_0x2ef10d(0x116)]=_0x14863f,this['mcpServer']=new McpServer({'name':'lovrabet-dataset-mcp','version':packageJson[_0x2ef10d(0xb6)]},{'capabilities':{'tools':{}},'instructions':buildInstructions(_0x14863f)}),this[_0x2ef10d(0xff)]();}[a9_0x8cb998(0xff)](){const _0x22b954=a9_0x8cb998;registerToolWithOptions(this[_0x22b954(0xe8)],_0x22b954(0xef),{'title':_0x22b954(0x10b),'description':'Login\x20to\x20Lovrabet\x20to\x20authenticate\x20for\x20dataset\x20queries.','inputSchema':{'env':z[_0x22b954(0xc5)](['online',_0x22b954(0x11d)])[_0x22b954(0xfe)]()[_0x22b954(0xd7)](_0x22b954(0x10e))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(login)),registerToolWithOptions(this[_0x22b954(0xe8)],_0x22b954(0xd2),{'title':_0x22b954(0xd3),'description':'Get\x20list\x20of\x20all\x20datasets\x20with\x20metadata\x20and\x20table\x20relations\x20(ER\x20Config).\x20Use\x20includeRelations:\x20false\x20for\x20faster\x20response.','inputSchema':{...authSchema,'forceRefresh':z[_0x22b954(0xf6)]()[_0x22b954(0xfe)]()['describe'](_0x22b954(0xe0)),'includeRelations':z[_0x22b954(0xf6)]()[_0x22b954(0xfe)]()[_0x22b954(0xd7)](_0x22b954(0xcd))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listDatasets)),registerToolWithOptions(this[_0x22b954(0xe8)],_0x22b954(0xfa),{'title':_0x22b954(0x11b),'description':_0x22b954(0xde),'inputSchema':{...authSchema,'keyword':z[_0x22b954(0xb5)]()['describe'](_0x22b954(0xf4))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(searchDatasets)),registerToolWithOptions(this['mcpServer'],_0x22b954(0x105),{'title':_0x22b954(0xf8),'description':_0x22b954(0xe6),'inputSchema':{...authSchema,'datasetCode':z[_0x22b954(0xb5)]()[_0x22b954(0xd7)](_0x22b954(0xb2)),'forceRefresh':z[_0x22b954(0xf6)]()[_0x22b954(0xfe)]()[_0x22b954(0xd7)](_0x22b954(0xe0)),'includeRelations':z[_0x22b954(0xf6)]()[_0x22b954(0xfe)]()['describe'](_0x22b954(0xe4))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetDetail)),registerToolWithOptions(this[_0x22b954(0xe8)],'get_dataset_operations',{'title':_0x22b954(0xc0),'description':_0x22b954(0x104),'inputSchema':{...authSchema,'datasetCode':z[_0x22b954(0xb5)]()[_0x22b954(0xd7)](_0x22b954(0xb2))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getDatasetOperations)),registerToolWithOptions(this[_0x22b954(0xe8)],_0x22b954(0xec),{'title':_0x22b954(0x112),'description':_0x22b954(0x115),'inputSchema':{...authSchema,'datasetCode':z[_0x22b954(0xb5)]()[_0x22b954(0xd7)](_0x22b954(0x117)),'operationName':z[_0x22b954(0xb5)]()[_0x22b954(0xd7)](_0x22b954(0xf5))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getOperationDetail)),registerToolWithOptions(this[_0x22b954(0xe8)],_0x22b954(0x100),{'title':_0x22b954(0xf2),'description':_0x22b954(0xe3),'inputSchema':{...authSchema,'datasetCode':z['string']()[_0x22b954(0xd7)](_0x22b954(0x117)),'operationName':z[_0x22b954(0xb5)]()['describe']('Operation\x20name\x20(e.g.,\x20filter,\x20getOne,\x20create,\x20update)'),'includeImports':z['boolean']()[_0x22b954(0xfe)]()[_0x22b954(0xd7)](_0x22b954(0xdf)),'useAlias':z[_0x22b954(0xf6)]()[_0x22b954(0xfe)]()[_0x22b954(0xd7)]('Use\x20camelCase\x20alias\x20instead\x20of\x20dataset_[code]\x20pattern\x20(default:\x20false)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSDKCode)),registerToolWithOptions(this[_0x22b954(0xe8)],_0x22b954(0x108),{'title':'List\x20SQL\x20Queries','description':_0x22b954(0xbe),'inputSchema':{...authSchema,'keyword':z['string']()['optional']()['describe'](_0x22b954(0xdd)),'category':z['string']()[_0x22b954(0xfe)]()[_0x22b954(0xd7)](_0x22b954(0xc2)),'sqlCode':z[_0x22b954(0xb5)]()[_0x22b954(0xfe)]()[_0x22b954(0xd7)]('Server-side\x20fuzzy\x20match\x20by\x20sqlCode'),'sqlName':z[_0x22b954(0xb5)]()['optional']()['describe']('Server-side\x20fuzzy\x20match\x20by\x20sqlName'),'pageSize':z[_0x22b954(0xf3)]()['optional']()[_0x22b954(0xd7)](_0x22b954(0x102)),'currentPage':z[_0x22b954(0xf3)]()['optional']()[_0x22b954(0xd7)]('Page\x20number\x20(default:\x201)')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listSqlQueries)),registerToolWithOptions(this['mcpServer'],_0x22b954(0x106),{'title':_0x22b954(0xee),'description':_0x22b954(0x10f),'inputSchema':{...authSchema,'sqlCode':z[_0x22b954(0xb5)]()['min'](0x1)[_0x22b954(0xd7)](_0x22b954(0xb9)),'params':z['record'](z[_0x22b954(0x103)]([z[_0x22b954(0xb5)](),z[_0x22b954(0xf3)]()]))[_0x22b954(0xfe)]()['describe'](_0x22b954(0x114))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(executeCustomSql)),registerToolWithOptions(this[_0x22b954(0xe8)],'generate_sql_code',{'title':_0x22b954(0x107),'description':'Generate\x20code\x20for\x20a\x20custom\x20SQL\x20query.\x20Validates\x20sqlCode\x20exists\x20first.\x20Use\x20target\x20to\x20switch\x20between\x20Frontend\x20SDK\x20and\x20Backend\x20Function\x20code\x20patterns.','inputSchema':{...authSchema,'sqlCode':z[_0x22b954(0xb5)]()[_0x22b954(0x113)](0x1)[_0x22b954(0xd7)](_0x22b954(0xca)),'params':z[_0x22b954(0xc7)](z[_0x22b954(0x103)]([z[_0x22b954(0xb5)](),z[_0x22b954(0xf3)]()]))[_0x22b954(0xfe)]()['describe'](_0x22b954(0xbd)),'includeImports':z[_0x22b954(0xf6)]()[_0x22b954(0xfe)]()[_0x22b954(0xd7)](_0x22b954(0xdf)),'target':z[_0x22b954(0xc5)]([_0x22b954(0x118),_0x22b954(0xf9)])[_0x22b954(0xfe)]()[_0x22b954(0xd7)](_0x22b954(0xc3))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(generateSqlCode)),registerToolWithOptions(this[_0x22b954(0xe8)],_0x22b954(0xb8),{'title':'Validate\x20SQL\x20Content','description':'Validate\x20SQL\x20content\x20without\x20saving.\x20Detects\x20SQL\x20type\x20(SELECT/INSERT/UPDATE/DELETE/DDL)\x20and\x20validates\x20table/column\x20existence.\x20Supports\x20MyBatis\x20syntax.','inputSchema':{...authSchema,'sqlContent':z[_0x22b954(0xb5)]()['min'](0x1)[_0x22b954(0xd7)]('SQL\x20content\x20to\x20validate'),'dbId':z[_0x22b954(0xf3)]()[_0x22b954(0xfe)]()[_0x22b954(0xd7)](_0x22b954(0x110)),'validateSchemas':z[_0x22b954(0xfc)](z['string']())[_0x22b954(0xfe)]()[_0x22b954(0xd7)]('Dataset\x20codes\x20to\x20validate\x20against')},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(validateSqlContent)),registerToolWithOptions(this['mcpServer'],_0x22b954(0x11c),{'title':_0x22b954(0xd8),'description':_0x22b954(0xb7),'inputSchema':{...authSchema,'sqlName':z['string']()[_0x22b954(0xfe)]()['describe']('SQL\x20name/label\x20(optional;\x20MCP\x20auto-extracts\x20from\x20@lovrabet.sqlName\x20comment,\x20or\x20toolbox\x20generates\x20fallback)'),'sqlCode':z[_0x22b954(0xb5)]()['optional']()[_0x22b954(0xd7)]('Known\x20sqlCode\x20—\x20use\x20to\x20directly\x20target\x20the\x20record\x20for\x20update,\x20skipping\x20name\x20lookup'),'dbId':z['number']()['optional']()[_0x22b954(0xd7)](_0x22b954(0xd0)),'sqlContent':z[_0x22b954(0xb5)]()[_0x22b954(0x113)](0x1)[_0x22b954(0xd7)](_0x22b954(0x101)),'id':z['number']()[_0x22b954(0xfe)]()[_0x22b954(0xd7)](_0x22b954(0xd1))},'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':![]}},wrapHandler(saveOrUpdateCustomSql)),this['options']['bffSaveEnabled']&&(registerToolWithOptions(this['mcpServer'],_0x22b954(0xdc),{'title':_0x22b954(0xbf),'description':_0x22b954(0xd4),'inputSchema':{...authSchema},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(listBffScripts)),registerToolWithOptions(this[_0x22b954(0xe8)],_0x22b954(0xb4),{'title':_0x22b954(0x10c),'description':_0x22b954(0xd9),'inputSchema':{...authSchema,'id':z[_0x22b954(0xf3)]()[_0x22b954(0xd7)](_0x22b954(0xc8))},'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![]}},wrapHandler(getBffScriptInfo)),registerToolWithOptions(this['mcpServer'],_0x22b954(0xf1),{'title':_0x22b954(0xbb),'description':_0x22b954(0xcf),'inputSchema':{...authSchema,'id':z['number']()['optional']()[_0x22b954(0xd7)](_0x22b954(0xbc)),'description':z[_0x22b954(0xb5)]()[_0x22b954(0x113)](0x1)['describe'](_0x22b954(0xd5)),'scriptContent':z[_0x22b954(0xb5)]()[_0x22b954(0x113)](0x1)[_0x22b954(0xd7)](_0x22b954(0xfd))},'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':![]}},wrapHandler(saveOrUpdateBffScript)));}get[a9_0x8cb998(0xcb)](){const _0x4a4898=a9_0x8cb998;return this[_0x4a4898(0xe8)];}async['connect'](_0x5a564f){const _0x2d1a03=a9_0x8cb998;await this[_0x2d1a03(0xe8)][_0x2d1a03(0x10a)](_0x5a564f);}async[a9_0x8cb998(0xc4)](){const _0x27ab35=a9_0x8cb998;await this['mcpServer'][_0x27ab35(0xc4)]();}[a9_0x8cb998(0xe1)](){const _0x53b200=a9_0x8cb998;if(!process[_0x53b200(0xf7)][_0x53b200(0xe7)])return;console[_0x53b200(0xe2)](_0x53b200(0xc6)),console[_0x53b200(0xe2)]('Version:\x20'+packageJson[_0x53b200(0xb6)]),console[_0x53b200(0xe2)](_0x53b200(0xdb)),this[_0x53b200(0x116)]['bffSaveEnabled']&&(console['log'](_0x53b200(0x111)),console[_0x53b200(0xe2)](_0x53b200(0xda)));}}function buildInstructions(_0x79c47b){const _0x2f0335=a9_0x8cb998,_0x1694dc=_0x79c47b[_0x2f0335(0x10d)]===!![],_0x394bfd=_0x1694dc?'\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 _0x2f0335(0xba)+_0x394bfd+'\x0a';}export function createServer(_0x5e31db){return new LovrabetDatasetMCPServer(_0x5e31db);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1a5a75,_0x348b77){const _0x66f32c=a10_0x104b,_0x4e7b53=_0x1a5a75();while(!![]){try{const _0x25c7e3=-parseInt(_0x66f32c(0x112))/0x1+parseInt(_0x66f32c(0x111))/0x2+parseInt(_0x66f32c(0x10b))/0x3+parseInt(_0x66f32c(0x122))/0x4*(-parseInt(_0x66f32c(0x124))/0x5)+-parseInt(_0x66f32c(0x118))/0x6+-parseInt(_0x66f32c(0x117))/0x7+-parseInt(_0x66f32c(0x11d))/0x8*(-parseInt(_0x66f32c(0x120))/0x9);if(_0x25c7e3===_0x348b77)break;else _0x4e7b53['push'](_0x4e7b53['shift']());}catch(_0x6cdfcb){_0x4e7b53['push'](_0x4e7b53['shift']());}}}(a10_0x344c,0x8c29c));import{DevApiClient}from'../api/dev-api-client.js';function a10_0x104b(_0xf2a1a6,_0x2631b3){_0xf2a1a6=_0xf2a1a6-0x106;const _0x344c88=a10_0x344c();let _0x104b05=_0x344c88[_0xf2a1a6];return _0x104b05;}function a10_0x344c(){const _0x5c7391=['SQL\x20executed\x20successfully.\x20Returned\x20','errorCode','success','8WlGyFU','errorMsg','data','15040881VpIVry','\x20row(s).','1677268DgmUfX','UNKNOWN','10GZUIld','message','SQL\x20execution\x20failed\x20without\x20error\x20message','API\x20call\x20failed:\x20','trim','ERR','1479558dzlPvr','sqlCode\x20is\x20required.\x20Get\x20it\x20from\x20list_sql_queries\x20->\x20sqlCode','now','keys','executeSql','SQL\x20execution\x20failed:\x20','1624984mwXZHo','764544UavBRs','isArray','Unknown\x20error','SQL\x20execution\x20failed\x20[','length','984438wUElto','3953802FwHvUk','execSuccess'];a10_0x344c=function(){return _0x5c7391;};return a10_0x344c();}import{getEnvAppCode}from'../config/env.js';export async function executeCustomSql(_0x12cd20){const _0x3bb196=a10_0x104b,_0x49f192=Date[_0x3bb196(0x10d)](),{appCode:appCode=getEnvAppCode(),cookie:_0x447671,sqlCode:_0x2c53fa,params:_0x3b890f}=_0x12cd20;if(!appCode)throw new Error('appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.');if(!_0x2c53fa||_0x2c53fa[_0x3bb196(0x109)]()==='')throw new Error(_0x3bb196(0x10c));const _0x1ed13c=new DevApiClient({'appCode':appCode,'cookie':_0x447671}),_0x3f6a38=_0x3b890f&&Object[_0x3bb196(0x10e)](_0x3b890f)['length']>0x0,_0x5ef147=_0x3f6a38?Object[_0x3bb196(0x10e)](_0x3b890f):[],_0x2e93e3={'sqlCode':_0x2c53fa,'hasParams':_0x3f6a38||![],'paramNames':_0x5ef147||[]};try{const _0x216bfd=await _0x1ed13c[_0x3bb196(0x10f)]({'sqlCode':_0x2c53fa[_0x3bb196(0x109)](),'params':_0x3b890f}),_0x26d109=Date['now']()-_0x49f192,_0x10d2a4=_0x216bfd[_0x3bb196(0x11c)]??![],_0x11f364=_0x216bfd[_0x3bb196(0x11b)];if(!_0x10d2a4){const _0xc03e9c=_0x216bfd[_0x3bb196(0x11e)]||_0x216bfd['msg']||_0x3bb196(0x114);return{'success':![],'execSuccess':![],'execError':_0xc03e9c,'errorCode':_0x11f364||_0x3bb196(0x123),'message':_0x3bb196(0x115)+(_0x11f364||_0x3bb196(0x10a))+']:\x20'+_0xc03e9c,'executionTime':_0x26d109,'sqlInfo':_0x2e93e3};}const _0x169987=_0x216bfd[_0x3bb196(0x11f)]||_0x216bfd,_0x4a0bae=_0x169987[_0x3bb196(0x119)]??_0x169987[_0x3bb196(0x11c)]??!![],_0x3c6bc9=_0x169987['execResult']||_0x169987['data'],_0x25dbaa=_0x169987['execError']||_0x169987[_0x3bb196(0x11e)];if(_0x4a0bae){const _0x3bf101=Array[_0x3bb196(0x113)](_0x3c6bc9)?_0x3c6bc9[_0x3bb196(0x116)]:0x0;return{'success':!![],'execSuccess':!![],'execResult':_0x3c6bc9||[],'rowCount':_0x3bf101,'message':_0x3bb196(0x11a)+_0x3bf101+_0x3bb196(0x121),'executionTime':_0x26d109,'sqlInfo':_0x2e93e3};}return{'success':!![],'execSuccess':![],'execError':_0x25dbaa||_0x3bb196(0x107),'message':_0x3bb196(0x110)+(_0x25dbaa||_0x3bb196(0x114)),'executionTime':_0x26d109,'sqlInfo':_0x2e93e3};}catch(_0x46d938){const _0x93744e=Date[_0x3bb196(0x10d)]()-_0x49f192;return{'success':![],'execSuccess':![],'execError':_0x46d938[_0x3bb196(0x106)]||'Unknown\x20error','message':_0x3bb196(0x108)+(_0x46d938['message']||_0x3bb196(0x114)),'executionTime':_0x93744e,'sqlInfo':_0x2e93e3};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a11_0x4f29(_0x473800,_0x15be2f){_0x473800=_0x473800-0x182;const _0x1618cf=a11_0x1618();let _0x4f293f=_0x1618cf[_0x473800];return _0x4f293f;}function a11_0x1618(){const _0x34f6fa=['replace','usageExample','2664485QULCFh','getOperationAnalysis','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','getOperationDocMeta','code','144pjAIGJ','getDatasetSDKKey','971687OLonco','datasetCode\x20is\x20required','15036HQgtQV','611217PTUhOo','29411630ALFAKg','operationName\x20is\x20required','generateSDKInitCode','1494592eLKCXo','getModelAlias','186vTycIG','responseExample','\x27\x20in\x20dataset\x20\x27','getFieldList','datasetCode','163786JwTfUW','//\x20数据集:\x20','getTableName','typescript','generateFullSDKExample','Cannot\x20generate\x20SDK\x20code\x20for\x20operation\x20\x27','toJSON','366RIkbuI','data'];a11_0x1618=function(){return _0x34f6fa;};return a11_0x1618();}(function(_0x24ac8d,_0xc65be2){const _0x1900b8=a11_0x4f29,_0x284f7a=_0x24ac8d();while(!![]){try{const _0x531e55=parseInt(_0x1900b8(0x189))/0x1+parseInt(_0x1900b8(0x190))/0x2+-parseInt(_0x1900b8(0x19e))/0x3*(parseInt(_0x1900b8(0x18b))/0x4)+parseInt(_0x1900b8(0x182))/0x5+parseInt(_0x1900b8(0x192))/0x6*(parseInt(_0x1900b8(0x197))/0x7)+parseInt(_0x1900b8(0x187))/0x8*(parseInt(_0x1900b8(0x18c))/0x9)+-parseInt(_0x1900b8(0x18d))/0xa;if(_0x531e55===_0xc65be2)break;else _0x284f7a['push'](_0x284f7a['shift']());}catch(_0x23e0d1){_0x284f7a['push'](_0x284f7a['shift']());}}}(a11_0x1618,0xc3493));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(_0x5a5c41){const _0x440d0d=a11_0x4f29,{appCode:appCode=getEnvAppCode(),cookie:_0x440e0c,datasetCode:_0x1f42d2,operationName:_0x4f87ee,includeImports:includeImports=!![],useAlias:useAlias=![]}=_0x5a5c41;if(!appCode)throw new Error(_0x440d0d(0x184));if(!_0x1f42d2)throw new Error(_0x440d0d(0x18a));if(!_0x4f87ee)throw new Error(_0x440d0d(0x18e));const _0x5394b8=new DevApiClient({'appCode':appCode,'cookie':_0x440e0c}),_0x5d44e7=getEnvironment(),_0x379515=await _0x5394b8['getDatasetDetail'](_0x1f42d2),_0x8fcc3f=_0x379515[_0x440d0d(0x19f)]||_0x379515,_0x338dc3=new DrivenDataDetailPlus(_0x8fcc3f),_0x2d4c5e=_0x338dc3[_0x440d0d(0x185)](_0x4f87ee);if(!_0x2d4c5e)throw new Error(_0x440d0d(0x19c)+_0x4f87ee+_0x440d0d(0x194)+_0x1f42d2+'\x27');const _0x57168a=_0x338dc3[_0x440d0d(0x188)](),_0x595029=_0x338dc3[_0x440d0d(0x191)](),_0x15a0e4=_0x338dc3['getTableKey'](),_0xd1e952=_0x338dc3[_0x440d0d(0x199)](),_0xe22956=_0x338dc3['name'],_0x27459d=_0x338dc3[_0x440d0d(0x195)](),_0x5a3b61=_0x27459d?.[_0x440d0d(0x19d)]?.()||[],_0xcb8c0d=buildFieldRelationsMap(_0x379515),_0x222c0b=enrichFieldsWithRelations(_0x5a3b61,_0xcb8c0d),_0x4edc29=_0x338dc3[_0x440d0d(0x19b)](_0x4f87ee,appCode),_0x1cc138=_0x338dc3[_0x440d0d(0x183)](_0x4f87ee);let _0x193998=_0x2d4c5e['sdkCall'][_0x440d0d(0x186)],_0x47e4cf=_0x4edc29||undefined;useAlias&&(_0x193998=_0x193998[_0x440d0d(0x1a0)](new RegExp(_0x57168a,'g'),_0x595029),_0x47e4cf&&(_0x47e4cf=_0x47e4cf[_0x440d0d(0x1a0)](new RegExp(_0x57168a,'g'),_0x595029)));const _0x533b77=_0x440d0d(0x198)+_0xe22956+'\x20|\x20数据表:\x20'+_0xd1e952+'\x0a',_0x5bfed6=_0x533b77+_0x193998,_0x5f28c3=_0x47e4cf?_0x440d0d(0x198)+_0xe22956+'\x20|\x20数据表:\x20'+_0xd1e952+'\x0a'+_0x47e4cf:undefined;return{'appCode':appCode,'env':_0x5d44e7,'datasetName':_0xe22956,'language':_0x440d0d(0x19a),'code':_0x5bfed6,'fullExample':includeImports?_0x5f28c3:undefined,'sdkCallInfo':{'modelName':_0x595029,'tableName':_0xd1e952,'tableKey':_0x15a0e4,'datasetCode':_0x338dc3[_0x440d0d(0x196)],'operationName':_0x4f87ee},'fields':_0x222c0b,'requestExample':_0x1cc138?.['requestExample'],'responseExample':_0x1cc138?.[_0x440d0d(0x193)],'sdkInitCode':_0x338dc3[_0x440d0d(0x18f)](_0x15a0e4),'usageExample':_0x2d4c5e[_0x440d0d(0x1a1)],'aliasExplanation':useAlias?_0x338dc3['generateAliasExplanation']():undefined,'aliasHint':{'defaultAlias':_0x595029,'datasetSDKKey':_0x57168a}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29e437,_0xf3b9db){const _0xd90667=a12_0x1845,_0x5be77d=_0x29e437();while(!![]){try{const _0x79dc9d=-parseInt(_0xd90667(0x20a))/0x1*(-parseInt(_0xd90667(0x1e0))/0x2)+-parseInt(_0xd90667(0x209))/0x3*(parseInt(_0xd90667(0x1e9))/0x4)+-parseInt(_0xd90667(0x1c9))/0x5+parseInt(_0xd90667(0x1f2))/0x6*(-parseInt(_0xd90667(0x1d3))/0x7)+-parseInt(_0xd90667(0x205))/0x8*(-parseInt(_0xd90667(0x1ff))/0x9)+-parseInt(_0xd90667(0x1f6))/0xa*(-parseInt(_0xd90667(0x206))/0xb)+parseInt(_0xd90667(0x1dd))/0xc*(parseInt(_0xd90667(0x1de))/0xd);if(_0x79dc9d===_0xf3b9db)break;else _0x5be77d['push'](_0x5be77d['shift']());}catch(_0x1b4283){_0x5be77d['push'](_0x5be77d['shift']());}}}(a12_0x1d23,0x297e9));import{DevApiClient}from'../api/dev-api-client.js';function a12_0x1845(_0x30dccd,_0x319a20){_0x30dccd=_0x30dccd-0x1c5;const _0x1d239d=a12_0x1d23();let _0x1845c4=_0x1d239d[_0x30dccd];return _0x1845c4;}import{getEnvAppCode,getEnvironment}from'../config/env.js';function a12_0x1d23(){const _0x4c8ad5=['sdk','sqlContent','BFF\x20context.client.sql.execute()\x20returns\x20rows\x20T[]\x20directly\x20—\x20no\x20wrapper\x20object','size','data','1560138MIGNuE','match','//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27','page','10TOPTUh','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20—\x20use\x20try-catch','sqlCode','SQL\x20code\x20\x22','join','date',');\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}',',\x0a}','sql','18VNbQIM','\x27,\x0a\x20\x20env:\x20\x27','time','sqlId','sqlName','count','1112816gVTUwX','484297gkFbtc','name','from','922926EVTEnK','950ACUijI','Frontend\x20SDK','Check\x20the\x20sqlCode\x20from\x20list_sql_queries\x20result\x20and\x20use\x20the\x20exact\x20value.','entries','tableData','1515375rlKxvI','This\x20SQL\x20does\x20not\x20require\x20any\x20parameters','toLowerCase','\x27,\x0a});\x0a\x0a//\x20Execute\x20SQL:\x20','map','Errors\x20throw\x20exceptions\x20—\x20use\x20try-catch','\x27\x20}','Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.','//\x20Backend\x20Function:\x20Execute\x20SQL\x20\x22','status','7OKVamY','Backend\x20Function','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a','This\x20SQL\x20requires\x20parameters:\x20','\x22\x20does\x20not\x20exist.\x20Use\x20list_sql_queries\x20to\x20find\x20valid\x20SQL\x20codes.','example','Failed\x20to\x20verify\x20SQL\x20code:\x20','\x22\x20not\x20found\x20in\x20the\x20application.','stringify','getCustomSqlList','60lGnFaG','1381432CxtxeH','trim','394lRGtwZ','2024-01-01','reduce','message','includes','\x22\x20exists\x20and\x20is\x20valid.','bff',');\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});','\x27,\x0a\x20\x20params:\x20','4oJXYGu','length','Generated\x20','limit'];a12_0x1d23=function(){return _0x4c8ad5;};return a12_0x1d23();}export async function generateSqlCode(_0x3509d3){const _0x215a2b=a12_0x1845,{appCode:appCode=getEnvAppCode(),cookie:_0x5d44fa,sqlCode:_0x12ac28,params:_0x4788a5,includeImports:includeImports=!![],target:target=_0x215a2b(0x1ed)}=_0x3509d3;if(!appCode)throw new Error('appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.');if(!_0x12ac28||_0x12ac28[_0x215a2b(0x1df)]()==='')return{'success':![],'sqlCode':'','sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[]},'error':'sqlCode\x20is\x20required'};const _0xbbac33=_0x12ac28[_0x215a2b(0x1df)](),_0x3db059=new DevApiClient({'appCode':appCode,'cookie':_0x5d44fa}),_0x494009=getEnvironment();try{const _0xc9d2f=await _0x3db059[_0x215a2b(0x1dc)]({'pageSize':0x3e7,'currentPage':0x1,'sqlCode':_0xbbac33}),_0x31570e=_0xc9d2f[_0x215a2b(0x1f1)]?.[_0x215a2b(0x1c8)]||[],_0x4fb090=_0x31570e['find'](_0x80b95d=>_0x80b95d['sqlCode']===_0xbbac33||_0x80b95d[_0x215a2b(0x1f8)]?.[_0x215a2b(0x1e4)](_0xbbac33)||_0xbbac33[_0x215a2b(0x1e4)](_0x80b95d[_0x215a2b(0x1f8)]));if(!_0x4fb090)return{'success':![],'sqlCode':_0xbbac33,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':['SQL\x20code\x20\x22'+_0xbbac33+_0x215a2b(0x1da),_0x215a2b(0x1d0),_0x215a2b(0x1c6)]},'error':'SQL\x20code\x20\x22'+_0xbbac33+_0x215a2b(0x1d7)};const _0x369e0a=_0x4fb090[_0x215a2b(0x1f8)],_0x592ba4=_0x4fb090[_0x215a2b(0x203)]||_0x4fb090[_0x215a2b(0x207)]||'SQL-'+(_0x4fb090[_0x215a2b(0x202)]||_0x4fb090['id']),_0x445402=_0x4fb090[_0x215a2b(0x1ee)]||_0x4fb090[_0x215a2b(0x1fe)]||'',_0x5a9d3f=_0x445402[_0x215a2b(0x1f3)](/[:$]\{?(\w+)\}?/g);let _0x1ee46d,_0x4dbfa6;if(_0x5a9d3f){const _0x15837e=Array[_0x215a2b(0x208)](new Set(_0x5a9d3f['map'](_0x9b1bca=>_0x9b1bca['replace'](/[:${}]/g,''))));_0x1ee46d=_0x15837e['map'](_0x52312e=>{const _0x3f7c87=_0x4788a5?.[_0x52312e]??getDefaultExample(_0x52312e);return{'name':_0x52312e,'example':_0x3f7c87};}),_0x4dbfa6=_0x1ee46d[_0x215a2b(0x1e2)]((_0x3b9a46,_0x5763fb)=>({..._0x3b9a46,[_0x5763fb[_0x215a2b(0x207)]]:_0x5763fb['example']}),{});}else _0x4788a5&&(_0x1ee46d=Object[_0x215a2b(0x1c7)](_0x4788a5)[_0x215a2b(0x1cd)](([_0x146201,_0xabc70])=>({'name':_0x146201,'example':_0xabc70})),_0x4dbfa6=_0x4788a5);const _0x50c097=_0x1ee46d&&_0x1ee46d[_0x215a2b(0x1ea)]>0x0,_0x5dde61=_0x50c097?JSON[_0x215a2b(0x1db)](_0x4dbfa6,null,0x2):'',_0x3754ff=_0x50c097?'{\x0a\x20\x20sqlCode:\x20\x27'+_0x369e0a+_0x215a2b(0x1e8)+_0x5dde61+_0x215a2b(0x1fd):'{\x20sqlCode:\x20\x27'+_0x369e0a+_0x215a2b(0x1cf);let _0x9e35bb;target===_0x215a2b(0x1e6)?_0x9e35bb=_0x215a2b(0x1d1)+_0x592ba4+'\x22\x0aexport\x20default\x20async\x20function(params,\x20context)\x20{\x0a\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute('+_0x3754ff+_0x215a2b(0x1fc):_0x9e35bb=(includeImports?_0x215a2b(0x1d5):'')+_0x215a2b(0x1f4)+appCode+_0x215a2b(0x200)+_0x494009+_0x215a2b(0x1cc)+_0x592ba4+'\x0aconst\x20data\x20=\x20await\x20client.sql.execute('+_0x3754ff+_0x215a2b(0x1e7);const _0xe4c58f=target===_0x215a2b(0x1e6);return{'success':!![],'sqlCode':_0x369e0a,'sqlName':_0x592ba4,'sqlExists':!![],'code':_0x9e35bb,'parameters':_0x1ee46d,'usage':{'description':_0x215a2b(0x1eb)+(_0xe4c58f?_0x215a2b(0x1d4):_0x215a2b(0x1c5))+'\x20code\x20for\x20SQL:\x20'+_0x592ba4,'important':[_0x215a2b(0x1f9)+_0x369e0a+_0x215a2b(0x1e5),_0xe4c58f?_0x215a2b(0x1ef):'SDK\x20client.sql.execute()\x20returns\x20{\x20execSuccess,\x20execResult\x20}\x20—\x20always\x20check\x20execSuccess',_0xe4c58f?_0x215a2b(0x1ce):_0x215a2b(0x1f7),_0x50c097?_0x215a2b(0x1d6)+_0x1ee46d[_0x215a2b(0x1cd)](_0x20f3dc=>_0x20f3dc['name'])[_0x215a2b(0x1fa)](',\x20'):_0x215a2b(0x1ca),'Note:\x20client.api.executeSql()\x20is\x20deprecated.\x20Use\x20client.sql.execute()\x20instead.']}};}catch(_0x4865a0){return{'success':![],'sqlCode':_0xbbac33,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x215a2b(0x1d9)+_0x4865a0[_0x215a2b(0x1e3)],_0x215a2b(0x1d0)]},'error':'Failed\x20to\x20verify\x20SQL\x20code:\x20'+_0x4865a0[_0x215a2b(0x1e3)]};}}function getDefaultExample(_0x3ff3d1){const _0x56676e=a12_0x1845,_0x2aafc2=_0x3ff3d1[_0x56676e(0x1cb)]();if(_0x2aafc2[_0x56676e(0x1e4)](_0x56676e(0x1fb))||_0x2aafc2[_0x56676e(0x1e4)](_0x56676e(0x201)))return _0x56676e(0x1e1);if(_0x2aafc2[_0x56676e(0x1e4)]('id'))return 0x7b;if(_0x2aafc2[_0x56676e(0x1e4)](_0x56676e(0x1ec))||_0x2aafc2['includes'](_0x56676e(0x204))||_0x2aafc2[_0x56676e(0x1e4)](_0x56676e(0x1f0)))return 0xa;if(_0x2aafc2['includes'](_0x56676e(0x1f5)))return 0x1;if(_0x2aafc2['includes']('keyword')||_0x2aafc2[_0x56676e(0x1e4)]('search')||_0x2aafc2[_0x56676e(0x1e4)](_0x56676e(0x207)))return _0x56676e(0x1d8);if(_0x2aafc2['includes'](_0x56676e(0x1d2)))return 0x1;return'value';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a13_0x398a(){const _0x21691c=['Failed\x20to\x20fetch\x20Backend\x20Function\x20script\x20info\x20for\x20id:\x20','getBffScriptInfo','4lcuxLx','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','data','10BSmbtH','1180300QHSSMD','success','6539544ArBKai','77ThCedb','117156ZucyzV','8643294HpkhjX','2238670cMERQd','4540113pwYbmt','9325428PjFUZz','id\x20is\x20required\x20and\x20must\x20be\x20a\x20positive\x20number.\x20Get\x20it\x20from\x20list_bff_scripts.','16OOZVBD'];a13_0x398a=function(){return _0x21691c;};return a13_0x398a();}function a13_0x50c4(_0x544a88,_0x19e2af){_0x544a88=_0x544a88-0x85;const _0x398a29=a13_0x398a();let _0x50c407=_0x398a29[_0x544a88];return _0x50c407;}(function(_0x1fba59,_0x3664a2){const _0x4e6edf=a13_0x50c4,_0x5c4527=_0x1fba59();while(!![]){try{const _0x5e2ddd=parseInt(_0x4e6edf(0x8b))/0x1*(-parseInt(_0x4e6edf(0x90))/0x2)+parseInt(_0x4e6edf(0x93))/0x3*(-parseInt(_0x4e6edf(0x88))/0x4)+parseInt(_0x4e6edf(0x8c))/0x5+parseInt(_0x4e6edf(0x91))/0x6+parseInt(_0x4e6edf(0x94))/0x7+-parseInt(_0x4e6edf(0x85))/0x8*(-parseInt(_0x4e6edf(0x8e))/0x9)+-parseInt(_0x4e6edf(0x92))/0xa*(parseInt(_0x4e6edf(0x8f))/0xb);if(_0x5e2ddd===_0x3664a2)break;else _0x5c4527['push'](_0x5c4527['shift']());}catch(_0x2b510c){_0x5c4527['push'](_0x5c4527['shift']());}}}(a13_0x398a,0xc24b1));import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode}from'../config/env.js';export async function getBffScriptInfo(_0x34a5a2){const _0x3bb84f=a13_0x50c4,{appCode:appCode=getEnvAppCode(),cookie:_0xea0627,id:_0x4c3c29}=_0x34a5a2;if(!appCode)throw new Error(_0x3bb84f(0x89));if(!_0x4c3c29||_0x4c3c29<=0x0)throw new Error(_0x3bb84f(0x95));const _0x568c5e=new DevApiClient({'appCode':appCode,'cookie':_0xea0627}),_0x4a3142=await _0x568c5e[_0x3bb84f(0x87)](_0x4c3c29);if(!_0x4a3142[_0x3bb84f(0x8d)]||!_0x4a3142['data'])return{'success':![],'message':_0x3bb84f(0x86)+_0x4c3c29};return{'success':!![],'script':_0x4a3142[_0x3bb84f(0x8a)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3bb99b,_0x29a0ec){const _0x189969=a14_0x3f98,_0x3fa375=_0x3bb99b();while(!![]){try{const _0x4b5c2a=-parseInt(_0x189969(0x1a8))/0x1+parseInt(_0x189969(0x1c9))/0x2*(parseInt(_0x189969(0x1a2))/0x3)+-parseInt(_0x189969(0x1c6))/0x4+parseInt(_0x189969(0x19a))/0x5*(-parseInt(_0x189969(0x1b4))/0x6)+-parseInt(_0x189969(0x19f))/0x7+parseInt(_0x189969(0x1c3))/0x8+parseInt(_0x189969(0x1c5))/0x9;if(_0x4b5c2a===_0x29a0ec)break;else _0x3fa375['push'](_0x3fa375['shift']());}catch(_0x4fb916){_0x3fa375['push'](_0x3fa375['shift']());}}}(a14_0x2f42,0xeecee));function a14_0x2f42(){const _0x49ca4c=['fromDataset','datasetCode\x20is\x20required','joinType','relations','\x20=\x20','toDataset','4733320qrgdwE','filter','42995799FIueKs','6819224PqqcFj','fromDatasetCode','push','1386172cWoFHt','toTableName','Referenced\x20by\x20','996010tJQCsI','Downstream\x20datasets:\x20','MANY_TO_ONE','This\x20dataset\x20is\x20a\x20detail/slave\x20table,\x20referencing\x20other\x20master\x20tables','map','10796184jRQtbZ','fromTableName','function','3TyjsKu','fromDatasetName','toDatasetName','getFieldCount','isArray','getDatasetRelations','243170cJHLSH','getEnabledOperationAnalyses','data','toDatasetCode','api','\x20→\x20','引用\x20','condition','\x20个下游数据集引用','length','getIndexes','References\x20','48KEzbOy','join','ONE_TO_MANY','hasRelations','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','name','throttle','toField','getDatasetDetail'];a14_0x2f42=function(){return _0x49ca4c;};return a14_0x2f42();}import{DevApiClient}from'../api/dev-api-client.js';import{DrivenDataDetailPlus}from'@lovrabet/dsparser';function a14_0x3f98(_0x9621bc,_0x4f596d){_0x9621bc=_0x9621bc-0x19a;const _0x2f4212=a14_0x2f42();let _0x3f9842=_0x2f4212[_0x9621bc];return _0x3f9842;}import{getEnvAppCode,getEnvironment}from'../config/env.js';import{rateLimiters}from'../utils/rate-limiter.js';export async function getDatasetDetail(_0x4bf4d3){const _0xd4ab30=a14_0x3f98,{appCode:appCode=getEnvAppCode(),cookie:_0x4c8cbd,datasetCode:_0x1469f3,forceRefresh:forceRefresh=![],includeRelations:includeRelations=!![]}=_0x4bf4d3;if(!appCode)throw new Error(_0xd4ab30(0x1b8));if(!_0x1469f3)throw new Error(_0xd4ab30(0x1be));const _0x27fa35=new DevApiClient({'appCode':appCode,'cookie':_0x4c8cbd}),_0x2b4c80=getEnvironment(),_0x20ba23=forceRefresh?await rateLimiters[_0xd4ab30(0x1ac)][_0xd4ab30(0x1ba)](()=>_0x27fa35[_0xd4ab30(0x1bc)](_0x1469f3,forceRefresh,![])):await _0x27fa35['getDatasetDetail'](_0x1469f3,forceRefresh,![]),_0x3b144b=_0x20ba23[_0xd4ab30(0x1aa)]||_0x20ba23,_0x1c3b94=new DrivenDataDetailPlus(_0x3b144b),_0x28a660=_0x1c3b94['getTableName'](),_0x1867ab=Array[_0xd4ab30(0x1a6)](_0x3b144b[_0xd4ab30(0x1c0)])?[..._0x3b144b['relations']]:null,_0x17f389={'fieldCount':_0x1c3b94[_0xd4ab30(0x1a5)](),'operationCount':_0x1c3b94['getOperationCount'](),'enabledOperationCount':_0x1c3b94[_0xd4ab30(0x1a9)]()?.['length']||0x0,'hasRelations':![]};if(!includeRelations)return{'appCode':appCode,'env':_0x2b4c80,'data':_0x3b144b,'_stats':_0x17f389};let _0x386e2d=[],_0x107d61=[];try{const _0x396647=await _0x27fa35[_0xd4ab30(0x1a7)](_0x1469f3,forceRefresh);_0x386e2d=_0x396647['outgoing']||[],_0x107d61=_0x396647['incoming']||[];}catch{}_0x1867ab&&_0x1867ab['length']>0x0&&_0x386e2d[_0xd4ab30(0x1b1)]===0x0&&(_0x386e2d=_0x1867ab[_0xd4ab30(0x19e)](_0x3998b5=>({'fromField':_0x3998b5['fromField'],'toDataset':_0x3998b5[_0xd4ab30(0x1ab)]||_0x3998b5['toDataset'],'toDatasetName':_0x3998b5[_0xd4ab30(0x1a4)],'toField':_0x3998b5[_0xd4ab30(0x1bb)],'joinType':_0x3998b5['joinType']||_0xd4ab30(0x19c),'toTableName':_0x3998b5[_0xd4ab30(0x1ca)]})));const _0x2dc5da=_0x386e2d['map'](_0x336267=>({'fromField':_0x336267['fromField'],'toDatasetCode':_0x336267[_0xd4ab30(0x1c2)]||_0x336267[_0xd4ab30(0x1ab)],'toDatasetName':_0x336267['toDatasetName'],'toField':_0x336267[_0xd4ab30(0x1bb)],'toTableName':_0x336267[_0xd4ab30(0x1ca)],'joinType':_0x336267['joinType']||_0xd4ab30(0x19c),'condition':_0x336267[_0xd4ab30(0x1af)]??null})),_0x218ac6=_0x107d61['map'](_0x2c4826=>({'fromField':_0x2c4826['fromField'],'fromDatasetCode':_0x2c4826[_0xd4ab30(0x1bd)]||_0x2c4826[_0xd4ab30(0x1c7)],'fromDatasetName':_0x2c4826['fromDatasetName']||_0x2c4826[_0xd4ab30(0x1bd)],'fromTableName':_0x2c4826[_0xd4ab30(0x1a0)],'toDatasetCode':_0x1469f3,'toDatasetName':_0x1c3b94[_0xd4ab30(0x1b9)],'toField':_0x2c4826[_0xd4ab30(0x1bb)],'toTableName':_0x28a660,'joinType':_0x2c4826[_0xd4ab30(0x1bf)]||_0xd4ab30(0x1b6),'condition':_0x2c4826[_0xd4ab30(0x1af)]??null})),_0x54bf93=_0x2dc5da[_0xd4ab30(0x1b1)]+_0x218ac6['length'];_0x17f389[_0xd4ab30(0x1b7)]=_0x54bf93>0x0;const _0x2e2e7e={'outgoing':_0x2dc5da,'incoming':_0x218ac6,'totalCount':_0x54bf93};let _0x193904;if(_0x54bf93>0x0){const _0xefbc27=[];for(const _0x50ca74 of _0x2dc5da){_0xefbc27[_0xd4ab30(0x1c8)](_0xd4ab30(0x1b3)+_0x50ca74[_0xd4ab30(0x1a4)]+'('+_0x50ca74[_0xd4ab30(0x1bf)]+')\x20via\x20'+_0x28a660+'.'+_0x50ca74['fromField']+_0xd4ab30(0x1c1)+(_0x50ca74['toTableName']||'?')+'.'+_0x50ca74[_0xd4ab30(0x1bb)]);}for(const _0x521711 of _0x218ac6){_0xefbc27['push'](_0xd4ab30(0x1cb)+_0x521711[_0xd4ab30(0x1a3)]+'('+_0x521711[_0xd4ab30(0x1bf)]+')\x20via\x20'+(_0x521711['fromTableName']||'?')+'.'+_0x521711['fromField']+_0xd4ab30(0x1c1)+_0x28a660+'.'+_0x521711['toField']);}const _0x511c3e=[];_0x2dc5da[_0xd4ab30(0x1b1)]>0x0&&_0x511c3e[_0xd4ab30(0x1c8)](_0xd4ab30(0x1ae)+_0x2dc5da['length']+'\x20个上游数据集'),_0x218ac6[_0xd4ab30(0x1b1)]>0x0&&_0x511c3e[_0xd4ab30(0x1c8)]('被\x20'+_0x218ac6[_0xd4ab30(0x1b1)]+_0xd4ab30(0x1b0)),_0x193904=_0x511c3e[_0xd4ab30(0x1b5)](',')+'。'+_0xefbc27[_0xd4ab30(0x1b5)](';\x20');}const _0x336460=generateUsageHints(_0x2dc5da,_0x218ac6,_0x1c3b94);return{'appCode':appCode,'env':_0x2b4c80,'data':_0x3b144b,'_stats':_0x17f389,'_relations':_0x2e2e7e,'_relationsSummary':_0x193904,'_usageHints':_0x336460[_0xd4ab30(0x1b1)]>0x0?_0x336460:undefined};}function generateUsageHints(_0x105cc1,_0x1454fc,_0xe90c3c){const _0x525761=a14_0x3f98,_0x4b111c=[];if(_0x1454fc[_0x525761(0x1b1)]>=0x2&&_0x105cc1['length']===0x0)_0x4b111c['push']('This\x20dataset\x20is\x20a\x20master\x20entity/dimension\x20table,\x20referenced\x20by\x20multiple\x20downstream\x20datasets');else{if(_0x1454fc['length']>=0x1&&_0x105cc1[_0x525761(0x1b1)]>=0x1)_0x4b111c[_0x525761(0x1c8)]('This\x20dataset\x20is\x20in\x20the\x20middle\x20layer\x20of\x20the\x20relationship\x20network,\x20referencing\x20upstream\x20and\x20being\x20referenced\x20by\x20downstream');else _0x105cc1[_0x525761(0x1b1)]>=0x1&&_0x1454fc[_0x525761(0x1b1)]===0x0&&_0x4b111c[_0x525761(0x1c8)](_0x525761(0x19d));}if(_0x1454fc[_0x525761(0x1b1)]>0x0){const _0x485fe6=_0x1454fc[_0x525761(0x19e)](_0x2b2357=>_0x2b2357[_0x525761(0x1a3)])[_0x525761(0x1c4)](Boolean);_0x485fe6[_0x525761(0x1b1)]>0x0&&_0x4b111c['push'](_0x525761(0x19b)+_0x485fe6[_0x525761(0x1b5)](',\x20'));}if(_0x105cc1[_0x525761(0x1b1)]>0x0){const _0x4beae2=_0x105cc1[_0x525761(0x19e)](_0x40fedc=>_0x40fedc['fromField']+_0x525761(0x1ad)+_0x40fedc[_0x525761(0x1a4)]+'.'+_0x40fedc[_0x525761(0x1bb)]);_0x4b111c['push']('Common\x20join\x20paths:\x20'+_0x4beae2[_0x525761(0x1b5)](';\x20'));}if(typeof _0xe90c3c['getIndexes']===_0x525761(0x1a1))try{const _0x54908b=_0xe90c3c[_0x525761(0x1b2)]();_0x54908b&&_0x54908b[_0x525761(0x1b1)]>0x0&&_0x4b111c[_0x525761(0x1c8)]('Indexes\x20available,\x20prefer\x20using\x20indexed\x20fields\x20for\x20high-frequency\x20filtering');}catch{}return _0x4b111c;}
|