@lovrabet/dataset-mcp-server 1.3.2-beta.0 → 1.3.2-beta.2
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/analyzer/dataset-analyzer.js +1 -1
- package/dist/api/cache.js +1 -1
- package/dist/api/dev-api-client.js +1 -1
- package/dist/auth/constants.js +1 -1
- package/dist/auth/cookie-manager.js +1 -1
- package/dist/auth/session-validator.js +1 -1
- package/dist/config/env.js +1 -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-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-datasets.js +1 -1
- package/dist/tools/list-sql-queries.js +1 -1
- package/dist/tools/login.js +1 -1
- package/dist/tools/save-custom-sql.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/sql-parser.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x55898e,_0x3e1441){const _0x1908f4=a11_0xaa39,_0xd6d41c=_0x55898e();while(!![]){try{const _0x2a620c=parseInt(_0x1908f4(0x8f))/0x1+parseInt(_0x1908f4(0x70))/0x2+parseInt(_0x1908f4(0x9b))/0x3+parseInt(_0x1908f4(0x96))/0x4+-parseInt(_0x1908f4(0x94))/0x5*(-parseInt(_0x1908f4(0x6f))/0x6)+parseInt(_0x1908f4(0x98))/0x7*(-parseInt(_0x1908f4(0x9a))/0x8)+-parseInt(_0x1908f4(0x99))/0x9;if(_0x2a620c===_0x3e1441)break;else _0xd6d41c['push'](_0xd6d41c['shift']());}catch(_0x5ea9df){_0xd6d41c['push'](_0xd6d41c['shift']());}}}(a11_0x51b4,0x50aa2));import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode,getEnvironment}from'../config/env.js';function a11_0xaa39(_0x35b48c,_0xe2b7ae){_0x35b48c=_0x35b48c-0x6f;const _0x51b407=a11_0x51b4();let _0xaa3988=_0x51b407[_0x35b48c];return _0xaa3988;}function a11_0x51b4(){const _0x251220=['sqlContent','getCustomSqlList','stringify','sql','replace','\x27,\x0a});\x0a\x0a//\x20Execute\x20SQL:\x20','name','SQL\x20code\x20\x22','length','sqlCode\x20is\x20required','match','page','value','\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27','example','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a','time','from','Failed\x20to\x20verify\x20SQL\x20code:\x20','SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[],\x20execError?:\x20string\x20}','includes','Check\x20the\x20sqlCode\x20from\x20list_sql_queries\x20result\x20and\x20use\x20the\x20exact\x20value.','map','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20exception\x20-\x20use\x20try-catch','Generated\x20code\x20for\x20executing\x20custom\x20SQL:\x20','//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27','limit','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','\x22\x20exists\x20and\x20is\x20valid.','30390CTmpaA','message','Always\x20check\x20execSuccess\x20before\x20using\x20execResult','join','tableData','5ZqPpCV','status','1230524gljoXX','entries','5782pQwFXr','3128364ZShAUx','6088hvjpmY','896007khxWCk','data','sqlName','sqlCode','find','search','size','This\x20SQL\x20requires\x20parameters:\x20','sqlId','reduce','Use\x20list_sql_queries\x20to\x20see\x20all\x20available\x20SQLs.','2124402AICoCX','631654kHuMBJ','\x22\x20does\x20not\x20exist.\x20Use\x20list_sql_queries\x20to\x20find\x20valid\x20SQL\x20codes.'];a11_0x51b4=function(){return _0x251220;};return a11_0x51b4();}export async function generateSqlCode(_0x324671){const _0x42f011=a11_0xaa39,{appCode:appCode=getEnvAppCode(),cookie:_0x2b68cd,sqlCode:_0xb1dacc,params:_0x3486e7,includeImports:includeImports=!![]}=_0x324671;if(!appCode)throw new Error(_0x42f011(0x8d));if(!_0xb1dacc||_0xb1dacc['trim']()==='')return{'success':![],'sqlCode':'','sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[]},'error':_0x42f011(0x7b)};const _0x49a535=_0xb1dacc['trim'](),_0x1ff081=new DevApiClient({'appCode':appCode,'cookie':_0x2b68cd}),_0xaaa723=getEnvironment();try{const _0x5fabea=await _0x1ff081[_0x42f011(0x73)]({'pageSize':0x3e7,'currentPage':0x1,'sqlCode':_0x49a535}),_0x3e0319=_0x5fabea[_0x42f011(0x9c)]?.[_0x42f011(0x93)]||[],_0x6fa25e=_0x3e0319[_0x42f011(0x9f)](_0x29a784=>_0x29a784['sqlCode']===_0x49a535||_0x29a784['sqlCode']?.[_0x42f011(0x86)](_0x49a535)||_0x49a535[_0x42f011(0x86)](_0x29a784['sqlCode']));if(!_0x6fa25e)return{'success':![],'sqlCode':_0x49a535,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x42f011(0x79)+_0x49a535+'\x22\x20not\x20found\x20in\x20the\x20application.',_0x42f011(0xa5),_0x42f011(0x87)]},'error':_0x42f011(0x79)+_0x49a535+_0x42f011(0x71)};const _0xab7c6c=_0x6fa25e[_0x42f011(0x9e)],_0x1cabec=_0x6fa25e[_0x42f011(0x9d)]||_0x6fa25e[_0x42f011(0x78)]||'SQL-'+(_0x6fa25e[_0x42f011(0xa3)]||_0x6fa25e['id']),_0x5f424d=_0x6fa25e[_0x42f011(0x72)]||_0x6fa25e[_0x42f011(0x75)]||'',_0x46d3ea=_0x5f424d[_0x42f011(0x7c)](/[:$]\{?(\w+)\}?/g);let _0x14d512,_0x5afc43;if(_0x46d3ea){const _0x475442=Array[_0x42f011(0x83)](new Set(_0x46d3ea[_0x42f011(0x88)](_0x566398=>_0x566398[_0x42f011(0x76)](/[:${}]/g,''))));_0x14d512=_0x475442[_0x42f011(0x88)](_0x50904c=>{const _0x821e3c=_0x3486e7?.[_0x50904c]??getDefaultExample(_0x50904c);return{'name':_0x50904c,'example':_0x821e3c};}),_0x5afc43=_0x14d512[_0x42f011(0xa4)]((_0x10b655,_0x304fbc)=>({..._0x10b655,[_0x304fbc['name']]:_0x304fbc[_0x42f011(0x80)]}),{});}else _0x3486e7&&(_0x14d512=Object[_0x42f011(0x97)](_0x3486e7)[_0x42f011(0x88)](([_0x379ec5,_0x2961d0])=>({'name':_0x379ec5,'example':_0x2961d0})),_0x5afc43=_0x3486e7);const _0x3774a9=_0x14d512&&_0x14d512[_0x42f011(0x7a)]>0x0,_0x452859=_0x3774a9?JSON[_0x42f011(0x74)](_0x5afc43,null,0x2):'',_0xadcb91=(includeImports?_0x42f011(0x81):'')+_0x42f011(0x8b)+appCode+'\x27,\x0a\x20\x20env:\x20\x27'+_0xaaa723+_0x42f011(0x77)+_0x1cabec+_0x42f011(0x7f)+_0xab7c6c+'\x27'+(_0x3774a9?',\x20'+_0x452859:'')+');\x0a\x0a//\x20IMPORTANT:\x20Check\x20execution\x20status\x20before\x20using\x20results\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(`SQL\x20execution\x20failed:\x20${data.execError\x20||\x20\x27Unknown\x20error\x27}`);\x0a}\x0a\x0a//\x20Process\x20the\x20results\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0aconsole.log(`Retrieved\x20${results.length}\x20rows`);\x0a\x0a//\x20Use\x20the\x20data\x0aresults.forEach((row:\x20any)\x20=>\x20{\x0a\x20\x20console.log(row);\x0a});';return{'success':!![],'sqlCode':_0xab7c6c,'sqlName':_0x1cabec,'sqlExists':!![],'code':_0xadcb91,'parameters':_0x14d512,'usage':{'description':_0x42f011(0x8a)+_0x1cabec,'important':[_0x42f011(0x79)+_0xab7c6c+_0x42f011(0x8e),_0x42f011(0x85),_0x42f011(0x91),_0x3774a9?_0x42f011(0xa2)+_0x14d512[_0x42f011(0x88)](_0x2e179d=>_0x2e179d[_0x42f011(0x78)])[_0x42f011(0x92)](',\x20'):'This\x20SQL\x20does\x20not\x20require\x20any\x20parameters',_0x42f011(0x89)]}};}catch(_0xe2b14d){return{'success':![],'sqlCode':_0x49a535,'sqlName':'','sqlExists':![],'code':'','usage':{'description':'','important':[_0x42f011(0x84)+_0xe2b14d[_0x42f011(0x90)],_0x42f011(0xa5)]},'error':_0x42f011(0x84)+_0xe2b14d['message']};}}function getDefaultExample(_0x223926){const _0x4020f7=a11_0xaa39,_0x27a874=_0x223926['toLowerCase']();if(_0x27a874[_0x4020f7(0x86)]('date')||_0x27a874[_0x4020f7(0x86)](_0x4020f7(0x82)))return'2024-01-01';if(_0x27a874[_0x4020f7(0x86)]('id'))return 0x7b;if(_0x27a874[_0x4020f7(0x86)](_0x4020f7(0x8c))||_0x27a874['includes']('count')||_0x27a874['includes'](_0x4020f7(0xa1)))return 0xa;if(_0x27a874[_0x4020f7(0x86)](_0x4020f7(0x7d)))return 0x1;if(_0x27a874[_0x4020f7(0x86)]('keyword')||_0x27a874[_0x4020f7(0x86)](_0x4020f7(0xa0))||_0x27a874[_0x4020f7(0x86)](_0x4020f7(0x78)))return _0x4020f7(0x80);if(_0x27a874['includes'](_0x4020f7(0x95)))return 0x1;return _0x4020f7(0x7e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a12_0x20cc(){const _0x8f29dc=['toDataset','visible','operations','primaryKey','180846YVntFb','map','fromDataset','13460328FAmJMm','length','category','archived','incomingRelations','deleted','enabledOperationCount','N:N','582871MQUKGp','fields','name','priority','getDatasetDetail','3205070UHzsze','340360Eewudh','find','Create\x20custom\x20SQL\x20for\x20this\x20dataset','Browse\x20related\x20datasets','Dataset\x20not\x20found\x20with\x20code:\x20','datasetCode\x20is\x20required','_id','database','validate_sql_content','outgoingRelations','supportsCRUD','fromField','test','generate_sdk_code','parseDatasetRelations','join','\x20=\x20','tableData','incoming','tableName','dbId','now','enabled','joinType','3gdpILe','[getDatasetDetail]\x20Failed\x20to\x20fetch\x20relations\x20for\x20','level','enumValues','replace','1194102VWYqNZ','unknown','toLowerCase','data',')\x20via\x20','toTableName','fromTableName','state','References:\x20','filter','1721992xqbGkj','basic','Referenced\x20by:\x20','Validate\x20and\x20prepare\x20custom\x20SQL\x20for\x20this\x20dataset','70nfrZSQ','medium','outgoing','required','code','toDatasetName','fromDatasetName','operationCount','toField','push','includes','endsWith','Find\x20other\x20datasets\x20that\x20might\x20be\x20related\x20for\x20JOIN\x20operations','allRelations','list_datasets','status'];a12_0x20cc=function(){return _0x8f29dc;};return a12_0x20cc();}(function(_0x3a55fd,_0x382d39){const _0x5a76c6=a12_0x407d,_0x137a7c=_0x3a55fd();while(!![]){try{const _0x489e35=-parseInt(_0x5a76c6(0xc4))/0x1+-parseInt(_0x5a76c6(0xb9))/0x2*(parseInt(_0x5a76c6(0xe2))/0x3)+-parseInt(_0x5a76c6(0xa1))/0x4+-parseInt(_0x5a76c6(0xc9))/0x5+parseInt(_0x5a76c6(0xe7))/0x6+-parseInt(_0x5a76c6(0xa5))/0x7*(-parseInt(_0x5a76c6(0xca))/0x8)+parseInt(_0x5a76c6(0xbc))/0x9;if(_0x489e35===_0x382d39)break;else _0x137a7c['push'](_0x137a7c['shift']());}catch(_0x5bc772){_0x137a7c['push'](_0x137a7c['shift']());}}}(a12_0x20cc,0x5b9d5));import{DevApiClient}from'../api/dev-api-client.js';function a12_0x407d(_0x1cb4ac,_0x488868){_0x1cb4ac=_0x1cb4ac-0x9b;const _0x20cc51=a12_0x20cc();let _0x407de6=_0x20cc51[_0x1cb4ac];return _0x407de6;}import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';import{getEnvAppCode,getEnvironment,shouldLog}from'../config/env.js';export async function getDatasetDetail(_0x441194){const _0x2ae3fc=a12_0x407d,_0x2556d9=Date[_0x2ae3fc(0xdf)](),{appCode:appCode=getEnvAppCode(),cookie:_0x43a84e,datasetCode:_0x5a4c27,forceRefresh:forceRefresh=![],includeRelations:includeRelations=!![]}=_0x441194;if(!appCode)throw new Error('appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.');if(!_0x5a4c27)throw new Error(_0x2ae3fc(0xcf));const _0x57224f=new DevApiClient({'appCode':appCode,'cookie':_0x43a84e}),_0x562f34=getEnvironment(),_0x2c3a0b=/^\d+$/[_0x2ae3fc(0xd6)](_0x5a4c27);let _0x4c9507;if(_0x2c3a0b)_0x4c9507=_0x5a4c27;else{const _0xc83e02=await _0x57224f['getDatasetList']({'forceRefresh':forceRefresh}),_0x28648d=_0xc83e02[_0x2ae3fc(0xea)]?.[_0x2ae3fc(0xdb)]||[],_0xccd1f5=_0x28648d[_0x2ae3fc(0xcb)](_0x4b95b5=>_0x4b95b5[_0x2ae3fc(0xa9)]===_0x5a4c27);if(!_0xccd1f5)throw new Error(_0x2ae3fc(0xce)+_0x5a4c27);_0x4c9507=String(_0xccd1f5['id']);}const _0x309288=await _0x57224f[_0x2ae3fc(0xc8)](_0x4c9507,forceRefresh,includeRelations),_0x385281=new DatasetAnalyzer(),_0x115447=_0x385281['analyzeDatasetDetail'](_0x309288),_0xac91fe=_0x115447[_0x2ae3fc(0xc5)][_0x2ae3fc(0xa0)](_0x406eda=>_0x406eda[_0x2ae3fc(0xb8)])['map'](_0x4499b7=>_0x4499b7[_0x2ae3fc(0xc6)]),_0xa2748c=_0x115447[_0x2ae3fc(0xc5)][_0x2ae3fc(0xa0)](_0x215a87=>_0x215a87[_0x2ae3fc(0xa8)])[_0x2ae3fc(0xba)](_0x1f5125=>_0x1f5125['name']),_0xa623dc=[_0x2ae3fc(0xb4),_0x2ae3fc(0x9e),'type',_0x2ae3fc(0xbe),_0x2ae3fc(0xe4),_0x2ae3fc(0xc7),'active',_0x2ae3fc(0xe0),_0x2ae3fc(0xb6),_0x2ae3fc(0xc1),_0x2ae3fc(0xbf)],_0x251dff=_0x115447[_0x2ae3fc(0xc5)][_0x2ae3fc(0xa0)](_0x18ded7=>{const _0x40756f=_0x2ae3fc,_0x4d05f5=_0x18ded7[_0x40756f(0xc6)][_0x40756f(0xe9)]();return _0xa623dc['some'](_0x35b183=>_0x4d05f5[_0x40756f(0xaf)](_0x35b183)||_0x4d05f5===_0x35b183);})[_0x2ae3fc(0xba)](_0x4d14e6=>_0x4d14e6['name']),_0x3cef2d=_0x115447['fields']['filter'](_0x476935=>{const _0x27652b=_0x2ae3fc,_0x509f62=_0x476935[_0x27652b(0xc6)][_0x27652b(0xe9)]();return _0x509f62[_0x27652b(0xb0)](_0x27652b(0xd0))||_0x509f62[_0x27652b(0xb0)]('id');})[_0x2ae3fc(0xa0)](_0x5ca8d0=>!_0x5ca8d0[_0x2ae3fc(0xb8)])[_0x2ae3fc(0xba)](_0x20efa7=>{const _0xe2d059=_0x2ae3fc,_0x29c61b=_0x20efa7[_0xe2d059(0xc6)]['replace'](/_id$/,'')[_0xe2d059(0xe6)](/Id$/,'');return{'field':_0x20efa7[_0xe2d059(0xc6)],'suggestsForeignKeyTo':_0x29c61b};}),_0x1da0ac=_0x115447[_0x2ae3fc(0xc5)][_0x2ae3fc(0xa0)](_0x20e9bf=>_0x20e9bf[_0x2ae3fc(0xe5)]&&_0x20e9bf[_0x2ae3fc(0xe5)][_0x2ae3fc(0xbd)]>0x0)[_0x2ae3fc(0xba)](_0x12011f=>({'field':_0x12011f['name'],'options':(_0x12011f['enumValues']||[])[_0x2ae3fc(0xba)](_0x1a2a91=>({'label':String(_0x1a2a91),'value':_0x1a2a91}))})),_0x1f21d7={'primaryKeys':_0xac91fe,'filterableFields':_0x251dff,'joinableFields':_0x3cef2d,'requiredFields':_0xa2748c,'enumFields':_0x1da0ac};let _0x344ea9,_0x354d38;const _0x51134d=_0x309288['data']?.['relations'];if(includeRelations){if(_0x51134d)_0x344ea9={'outgoing':_0x51134d[_0x2ae3fc(0xa7)][_0x2ae3fc(0xba)](_0x398943=>({'fromField':_0x398943['fromField'],'toDataset':_0x398943[_0x2ae3fc(0xb5)],'toDatasetName':_0x398943[_0x2ae3fc(0xaa)],'toField':_0x398943['toField'],'joinType':_0x398943[_0x2ae3fc(0xe1)]||_0x2ae3fc(0xc3)})),'incoming':_0x51134d[_0x2ae3fc(0xdc)]['map'](_0x24d662=>({'fromDataset':_0x24d662[_0x2ae3fc(0xbb)],'fromDatasetName':_0x24d662[_0x2ae3fc(0xab)],'fromField':_0x24d662[_0x2ae3fc(0xd5)],'toDataset':_0x5a4c27,'toDatasetName':_0x115447['basic'][_0x2ae3fc(0xc6)],'toField':_0x24d662[_0x2ae3fc(0xad)],'joinType':_0x24d662[_0x2ae3fc(0xe1)]||_0x2ae3fc(0xc3)})),'totalCount':_0x51134d[_0x2ae3fc(0xa7)][_0x2ae3fc(0xbd)]+_0x51134d[_0x2ae3fc(0xdc)]['length']};else{if(_0x115447[_0x2ae3fc(0xa2)][_0x2ae3fc(0xd1)]?.['dbId'])try{const _0x259165=await _0x57224f['getErConfig'](_0x115447[_0x2ae3fc(0xa2)]['database'][_0x2ae3fc(0xde)],forceRefresh),_0x9f9ed1=_0x385281[_0x2ae3fc(0xd8)](_0x5a4c27,new Map([[_0x115447[_0x2ae3fc(0xa2)][_0x2ae3fc(0xd1)][_0x2ae3fc(0xde)],_0x259165]]));_0x9f9ed1&&(_0x344ea9={'outgoing':_0x9f9ed1[_0x2ae3fc(0xd3)],'incoming':_0x9f9ed1[_0x2ae3fc(0xc0)],'totalCount':_0x9f9ed1[_0x2ae3fc(0xb2)][_0x2ae3fc(0xbd)]});}catch(_0x1541de){shouldLog()&&console['warn'](_0x2ae3fc(0xe3)+_0x5a4c27+':',_0x1541de);}}if(_0x344ea9&&_0x344ea9['totalCount']>0x0){const _0x580cd8=[],_0xdcd365=_0x115447[_0x2ae3fc(0xa2)][_0x2ae3fc(0xdd)];if(_0x344ea9[_0x2ae3fc(0xa7)]['length']>0x0){const _0x5f5783=_0x344ea9['outgoing'][_0x2ae3fc(0xba)](_0x42f1f8=>{const _0x5df4df=_0x2ae3fc,_0x492218=_0x42f1f8['joinType']||_0x5df4df(0xc3),_0x11e65d=_0x42f1f8[_0x5df4df(0x9c)]||_0x42f1f8['toDataset'];return _0x42f1f8[_0x5df4df(0xaa)]+'('+_0x42f1f8[_0x5df4df(0xb5)]+')('+_0x492218+_0x5df4df(0x9b)+_0xdcd365+'.'+_0x42f1f8[_0x5df4df(0xd5)]+'\x20=\x20'+_0x11e65d+'.'+_0x42f1f8[_0x5df4df(0xad)];})['join'](',\x20');_0x580cd8['push'](_0x2ae3fc(0x9f)+_0x5f5783);}if(_0x344ea9[_0x2ae3fc(0xdc)]['length']>0x0){const _0x4a780a=_0x344ea9[_0x2ae3fc(0xdc)][_0x2ae3fc(0xba)](_0x529e37=>{const _0x4a754c=_0x2ae3fc,_0x589d8e=_0x529e37[_0x4a754c(0xe1)]||'N:N',_0x38ae76=_0x529e37[_0x4a754c(0x9d)]||_0x529e37[_0x4a754c(0xbb)]||_0x4a754c(0xe8);return(_0x529e37['fromDatasetName']||_0x529e37['fromDataset'])+'('+_0x529e37[_0x4a754c(0xbb)]+')('+_0x589d8e+_0x4a754c(0x9b)+_0x38ae76+'.'+_0x529e37['fromField']+_0x4a754c(0xda)+_0xdcd365+'.'+_0x529e37[_0x4a754c(0xad)];})[_0x2ae3fc(0xd9)](',\x20');_0x580cd8[_0x2ae3fc(0xae)](_0x2ae3fc(0xa3)+_0x4a780a);}_0x580cd8[_0x2ae3fc(0xbd)]>0x0&&(_0x354d38=_0x580cd8[_0x2ae3fc(0xd9)](';\x20'));}}const _0x401ef1=[],_0x3faad6=_0x115447['operations'][_0x2ae3fc(0xcb)](_0x5aa999=>_0x5aa999['type']===_0x2ae3fc(0xa0));_0x3faad6&&_0x401ef1[_0x2ae3fc(0xae)]({'action':'Generate\x20SDK\x20code\x20for\x20querying\x20this\x20dataset','tool':_0x2ae3fc(0xd7),'params':{'datasetCode':_0x5a4c27,'operationName':_0x2ae3fc(0xa0)},'reason':'Get\x20ready-to-use\x20TypeScript\x20code\x20for\x20querying\x20this\x20dataset','priority':'high'});_0x115447[_0x2ae3fc(0xa2)]['database']?.[_0x2ae3fc(0xde)]&&_0x401ef1[_0x2ae3fc(0xae)]({'action':_0x2ae3fc(0xcc),'tool':_0x2ae3fc(0xd2),'params':{'sqlContent':'SELECT\x20*\x20FROM\x20'+_0x115447[_0x2ae3fc(0xa2)][_0x2ae3fc(0xdd)],'dbId':_0x115447['basic'][_0x2ae3fc(0xd1)][_0x2ae3fc(0xde)]},'reason':_0x2ae3fc(0xa4),'priority':_0x2ae3fc(0xa6)});_0x401ef1[_0x2ae3fc(0xae)]({'action':_0x2ae3fc(0xcd),'tool':_0x2ae3fc(0xb3),'reason':_0x2ae3fc(0xb1),'priority':'low'});const _0x4c2acf=Date['now']()-_0x2556d9;return{'appCode':appCode,'env':_0x562f34,'basic':_0x115447[_0x2ae3fc(0xa2)],'fields':_0x115447[_0x2ae3fc(0xc5)],'operations':_0x115447[_0x2ae3fc(0xb7)],'stats':{'fieldCount':_0x115447['fieldCount'],'operationCount':_0x115447[_0x2ae3fc(0xac)],'enabledOperationCount':_0x115447[_0x2ae3fc(0xc2)],'supportsCRUD':_0x115447[_0x2ae3fc(0xd4)]},'sqlValidationHints':_0x1f21d7,'relations':_0x344ea9,'relationsSummary':_0x354d38,'nextSteps':_0x401ef1};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5aab7b,_0x42160f){const _0x2931d0=a13_0x2efb,_0xb31c20=_0x5aab7b();while(!![]){try{const _0x302798=-parseInt(_0x2931d0(0x12f))/0x1+parseInt(_0x2931d0(0x116))/0x2+parseInt(_0x2931d0(0x131))/0x3*(parseInt(_0x2931d0(0x11a))/0x4)+-parseInt(_0x2931d0(0x120))/0x5*(parseInt(_0x2931d0(0x115))/0x6)+-parseInt(_0x2931d0(0x130))/0x7+-parseInt(_0x2931d0(0x123))/0x8*(parseInt(_0x2931d0(0x129))/0x9)+parseInt(_0x2931d0(0x125))/0xa*(parseInt(_0x2931d0(0x11f))/0xb);if(_0x302798===_0x42160f)break;else _0xb31c20['push'](_0xb31c20['shift']());}catch(_0x5832e4){_0xb31c20['push'](_0xb31c20['shift']());}}}(a13_0x5b7f,0x82df4));function a13_0x5b7f(){const _0x5a4f31=['tableData','406806oLjDYL','1030146byDCtx','getDatasetDetail','getOperationDetail','data','72exDdWM','code','\x27\x20not\x20found\x20in\x20dataset\x20\x27','Throws\x20LovrabetError\x20exception\x20with\x20full\x20response.\x20The\x20error\x20object\x20contains:\x20{\x20message:\x20string,\x20status?:\x20number\x20(HTTP\x20code),\x20code?:\x20string\x20(business\x20error\x20code),\x20data?:\x20any\x20(full\x20error\x20response)\x20}','CRITICAL:\x20Always\x20use\x20try-catch\x20when\x20calling\x20SDK\x20methods.\x20Success\x20case\x20returns\x20data\x20directly\x20(e.g.,\x20{\x20id:\x20123,\x20name:\x20\x22...\x22\x20}),\x20but\x20failure\x20case\x20throws\x20exception\x20instead\x20of\x20returning\x20error\x20info.','77uEAxTR','20lhywFc','datasetCode\x20is\x20required','basic','136VlqbIL','analyzeDatasetDetail','1562230ZHqfSj','Operation\x20\x27','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','Dataset\x20not\x20found\x20with\x20code:\x20','205785hFDEZY','Returns\x20ONLY\x20the\x20\x27data\x27\x20field\x20content.\x20Full\x20API\x20response\x20is\x20{\x20success:\x20true,\x20data:\x20{...},\x20msg:\x20\x22\x22,\x20errorMsg:\x20\x22\x22,\x20errorCode:\x20\x220000\x22\x20},\x20but\x20SDK\x20returns\x20just\x20the\x20{...}\x20part\x20from\x20\x27data\x27.','find','test','name','getDatasetList','76940HzKroD','5856207IlolwI','83478aeFDqz'];a13_0x5b7f=function(){return _0x5a4f31;};return a13_0x5b7f();}import{DevApiClient}from'../api/dev-api-client.js';import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';import{getEnvAppCode,getEnvironment}from'../config/env.js';function a13_0x2efb(_0x3d259a,_0x334b84){_0x3d259a=_0x3d259a-0x114;const _0x5b7fb8=a13_0x5b7f();let _0x2efb52=_0x5b7fb8[_0x3d259a];return _0x2efb52;}export async function getOperationDetail(_0x232edf){const _0x3e430b=a13_0x2efb,{appCode:appCode=getEnvAppCode(),cookie:_0x24339f,datasetCode:_0x2ca3c7,operationName:_0x629f30}=_0x232edf;if(!appCode)throw new Error(_0x3e430b(0x127));if(!_0x2ca3c7)throw new Error(_0x3e430b(0x121));if(!_0x629f30)throw new Error('operationName\x20is\x20required');const _0x55bbaf=new DevApiClient({'appCode':appCode,'cookie':_0x24339f}),_0x2d32fc=getEnvironment(),_0x1d5a48=/^\d+$/[_0x3e430b(0x12c)](_0x2ca3c7);let _0x4d2369;if(_0x1d5a48)_0x4d2369=_0x2ca3c7;else{const _0x16b43a=await _0x55bbaf[_0x3e430b(0x12e)](),_0x50286a=_0x16b43a[_0x3e430b(0x119)]?.[_0x3e430b(0x114)]||[],_0xf33da9=_0x50286a[_0x3e430b(0x12b)](_0x1f4f75=>_0x1f4f75[_0x3e430b(0x11b)]===_0x2ca3c7);if(!_0xf33da9)throw new Error(_0x3e430b(0x128)+_0x2ca3c7);_0x4d2369=String(_0xf33da9['id']);}const _0xc25816=await _0x55bbaf[_0x3e430b(0x117)](_0x4d2369),_0x16595d=new DatasetAnalyzer(),_0x55e083=_0x16595d[_0x3e430b(0x118)](_0xc25816,_0x629f30);if(!_0x55e083)throw new Error(_0x3e430b(0x126)+_0x629f30+_0x3e430b(0x11c)+_0x2ca3c7+'\x27');const _0x5f3054=_0x16595d[_0x3e430b(0x124)](_0xc25816);return{'appCode':appCode,'env':_0x2d32fc,'datasetName':_0x5f3054[_0x3e430b(0x122)][_0x3e430b(0x12d)],'operation':_0x55e083,'sdkReturnValueBehavior':{'onSuccess':_0x3e430b(0x12a),'onError':_0x3e430b(0x11d),'note':_0x3e430b(0x11e)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29ae7e,_0x4b631c){const _0x26de8f=a14_0x24f0,_0x431bae=_0x29ae7e();while(!![]){try{const _0x4d974b=parseInt(_0x26de8f(0x1c7))/0x1+-parseInt(_0x26de8f(0x1cd))/0x2+parseInt(_0x26de8f(0x1de))/0x3+parseInt(_0x26de8f(0x1d1))/0x4+parseInt(_0x26de8f(0x1df))/0x5+parseInt(_0x26de8f(0x1d5))/0x6*(-parseInt(_0x26de8f(0x1d7))/0x7)+-parseInt(_0x26de8f(0x1e0))/0x8*(parseInt(_0x26de8f(0x1e2))/0x9);if(_0x4d974b===_0x4b631c)break;else _0x431bae['push'](_0x431bae['shift']());}catch(_0x2b9b64){_0x431bae['push'](_0x431bae['shift']());}}}(a14_0x266a,0x8b7c3));function a14_0x266a(){const _0x500a16=['Dataset\x20not\x20found\x20with\x20code:\x20','3003NasmQI','enabled','type','code','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','tableData','data','3252477DFzHJW','1616665ErIyqv','88MyToLZ','find','1273581yYmSpH','314552TypSHe','getDatasetList','name','enabledOperationCount','supportsCRUD','basic','102406sHgvoC','operationCount','datasetCode\x20is\x20required','operations','4448688SbgSyy','path','requestFieldsCount','method','9162fhBVHh'];a14_0x266a=function(){return _0x500a16;};return a14_0x266a();}function a14_0x24f0(_0x4113eb,_0x2adc5f){_0x4113eb=_0x4113eb-0x1c7;const _0x266a47=a14_0x266a();let _0x24f067=_0x266a47[_0x4113eb];return _0x24f067;}import{DevApiClient}from'../api/dev-api-client.js';import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';import{getEnvAppCode,getEnvironment}from'../config/env.js';export async function getDatasetOperations(_0x23e387){const _0xbaf9b8=a14_0x24f0,{appCode:appCode=getEnvAppCode(),cookie:_0x56c51d,datasetCode:_0x4f9b4e}=_0x23e387;if(!appCode)throw new Error(_0xbaf9b8(0x1db));if(!_0x4f9b4e)throw new Error(_0xbaf9b8(0x1cf));const _0x5623e3=new DevApiClient({'appCode':appCode,'cookie':_0x56c51d}),_0x40cece=getEnvironment(),_0x242ff0=/^\d+$/['test'](_0x4f9b4e);let _0x47839a;if(_0x242ff0)_0x47839a=_0x4f9b4e;else{const _0x25f0bd=await _0x5623e3[_0xbaf9b8(0x1c8)](),_0x32ca49=_0x25f0bd[_0xbaf9b8(0x1dd)]?.[_0xbaf9b8(0x1dc)]||[],_0x35f21c=_0x32ca49[_0xbaf9b8(0x1e1)](_0xec5c60=>_0xec5c60[_0xbaf9b8(0x1da)]===_0x4f9b4e);if(!_0x35f21c)throw new Error(_0xbaf9b8(0x1d6)+_0x4f9b4e);_0x47839a=String(_0x35f21c['id']);}const _0x3e1b69=await _0x5623e3['getDatasetDetail'](_0x47839a),_0xc3d9aa=new DatasetAnalyzer(),_0x155522=_0xc3d9aa['analyzeDatasetDetail'](_0x3e1b69);return{'appCode':appCode,'env':_0x40cece,'datasetName':_0x155522[_0xbaf9b8(0x1cc)][_0xbaf9b8(0x1c9)],'tableName':_0x155522['basic']['tableName'],'operations':_0x155522[_0xbaf9b8(0x1d0)]['map'](_0x15f0e8=>({'name':_0x15f0e8[_0xbaf9b8(0x1c9)],'displayName':_0x15f0e8['displayName'],'type':_0x15f0e8[_0xbaf9b8(0x1d9)],'method':_0x15f0e8[_0xbaf9b8(0x1d4)],'path':_0x15f0e8[_0xbaf9b8(0x1d2)],'requestFieldsCount':_0x15f0e8[_0xbaf9b8(0x1d3)],'enabled':_0x15f0e8[_0xbaf9b8(0x1d8)]})),'stats':{'total':_0x155522[_0xbaf9b8(0x1ce)],'enabled':_0x155522[_0xbaf9b8(0x1ca)],'supportsCRUD':_0x155522[_0xbaf9b8(0x1cb)]}};}
|
package/dist/tools/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xdb4e20,_0x42d436){var _0x750f0b=a15_0x392b,_0xbb9e18=_0xdb4e20();while(!![]){try{var _0x4d5eee=-parseInt(_0x750f0b(0xf3))/0x1*(-parseInt(_0x750f0b(0xf1))/0x2)+-parseInt(_0x750f0b(0xeb))/0x3*(parseInt(_0x750f0b(0xea))/0x4)+parseInt(_0x750f0b(0xef))/0x5*(-parseInt(_0x750f0b(0xf2))/0x6)+-parseInt(_0x750f0b(0xe8))/0x7*(parseInt(_0x750f0b(0xec))/0x8)+-parseInt(_0x750f0b(0xe9))/0x9*(parseInt(_0x750f0b(0xf0))/0xa)+-parseInt(_0x750f0b(0xed))/0xb*(parseInt(_0x750f0b(0xe6))/0xc)+parseInt(_0x750f0b(0xe7))/0xd*(parseInt(_0x750f0b(0xee))/0xe);if(_0x4d5eee===_0x42d436)break;else _0xbb9e18['push'](_0xbb9e18['shift']());}catch(_0x9f61e6){_0xbb9e18['push'](_0xbb9e18['shift']());}}}(a15_0xdf1c,0x7613b));export{login}from'./login.js';export{listDatasets}from'./list-datasets.js';export{getDatasetDetail}from'./get-dataset-detail.js';export{getDatasetOperations}from'./get-operations.js';export{getOperationDetail}from'./get-operation-detail.js';export{generateSDKCode}from'./generate-sdk-code.js';function a15_0x392b(_0x3a6319,_0x431f78){_0x3a6319=_0x3a6319-0xe6;var _0xdf1cc=a15_0xdf1c();var _0x392bd3=_0xdf1cc[_0x3a6319];return _0x392bd3;}export{searchDatasets}from'./search-datasets.js';export{listSqlQueries}from'./list-sql-queries.js';export{saveOrUpdateCustomSql}from'./save-or-update-custom-sql.js';export{executeCustomSql}from'./execute-custom-sql.js';export{generateSqlCode}from'./generate-sql-code.js';function a15_0xdf1c(){var _0x56bc16=['2108995WpLMCL','110871BecpWn','988YPDyco','11541zrFkGO','16nTcssz','3617713zRmfNk','21115444kHWuZy','20MgepIo','510nPUdBf','562zkoZHj','114714KpgeOd','1361djXjWr','24VMLvWK','26byHktP'];a15_0xdf1c=function(){return _0x56bc16;};return a15_0xdf1c();}export{validateSqlContent}from'./validate-sql-content.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xcd5989,_0x54bcb2){const _0x29244e=a16_0x2fcb,_0x186b03=_0xcd5989();while(!![]){try{const _0x13c5e5=-parseInt(_0x29244e(0x111))/0x1*(parseInt(_0x29244e(0x10a))/0x2)+-parseInt(_0x29244e(0x128))/0x3*(parseInt(_0x29244e(0x123))/0x4)+-parseInt(_0x29244e(0x10c))/0x5+parseInt(_0x29244e(0x115))/0x6+-parseInt(_0x29244e(0x11d))/0x7*(parseInt(_0x29244e(0x129))/0x8)+parseInt(_0x29244e(0x112))/0x9*(-parseInt(_0x29244e(0x114))/0xa)+parseInt(_0x29244e(0x126))/0xb*(parseInt(_0x29244e(0x11b))/0xc);if(_0x13c5e5===_0x54bcb2)break;else _0x186b03['push'](_0x186b03['shift']());}catch(_0x2fa927){_0x186b03['push'](_0x186b03['shift']());}}}(a16_0x28a7,0xa65f7));function a16_0x2fcb(_0x8c23e9,_0x9c3532){_0x8c23e9=_0x8c23e9-0x109;const _0x28a72a=a16_0x28a7();let _0x2fcbab=_0x28a72a[_0x8c23e9];return _0x2fcbab;}import{DevApiClient}from'../api/dev-api-client.js';import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';import{getEnvAppCode,getEnvironment,shouldLog}from'../config/env.js';function a16_0x28a7(){const _0x313622=['10YNTtCg','3787854bfOJBf','from','length','has','[listDatasets]\x20Failed\x20to\x20fetch\x20relations:','dbId','46526640VEdwHA','total','21469jgcsKi','analyzeDatasetList','toDataset','filter','entries','relations','3052UqNJoI','size','outgoingRelations','11VgATZr','getAllErConfigs','2460IhVCer','1432ozksPi','code','getDatasetList','600664QJhhyc','datasets','6321925MApFFZ','set','dbName','fromDataset','map','2LxtAUs','7086276SEXhyF','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.'];a16_0x28a7=function(){return _0x313622;};return a16_0x28a7();}export async function listDatasets(_0x220a17={}){const _0x48d86e=a16_0x2fcb,{appCode:appCode=getEnvAppCode(),cookie:_0x35eeef,forceRefresh:forceRefresh=![],includeRelations:includeRelations=!![]}=_0x220a17;if(!appCode)throw new Error(_0x48d86e(0x113));const _0xa6aed6=new DevApiClient({'appCode':appCode,'cookie':_0x35eeef}),_0x277958=getEnvironment(),_0x4ccd02=await _0xa6aed6[_0x48d86e(0x109)]({'forceRefresh':forceRefresh}),_0x1b48af=new DatasetAnalyzer(),_0x2c0eb9=_0x1b48af[_0x48d86e(0x11e)](_0x4ccd02),_0x45fef1=_0x2c0eb9[_0x48d86e(0x10b)]['map'](_0x19203f=>({..._0x19203f,'database':_0x19203f[_0x48d86e(0x11a)]&&_0x19203f[_0x48d86e(0x10e)]?{'dbId':_0x19203f[_0x48d86e(0x11a)],'dbName':_0x19203f['dbName']}:null})),_0x5c0411=new Map();for(const _0x2b9d7f of _0x2c0eb9[_0x48d86e(0x10b)]){_0x2b9d7f[_0x48d86e(0x11a)]&&_0x2b9d7f[_0x48d86e(0x10e)]&&_0x5c0411[_0x48d86e(0x10d)](_0x2b9d7f[_0x48d86e(0x11a)],_0x2b9d7f[_0x48d86e(0x10e)]);}const _0x36e33d=Array[_0x48d86e(0x116)](_0x5c0411[_0x48d86e(0x121)]())['map'](([_0x35c423,_0x2fbf45])=>({'dbId':_0x35c423,'dbName':_0x2fbf45})),_0x1040ff={'appCode':appCode,'env':_0x277958,'total':_0x2c0eb9[_0x48d86e(0x11c)],'databases':_0x36e33d,'datasets':_0x45fef1};if(includeRelations)try{const _0x3b7e87=await _0xa6aed6[_0x48d86e(0x127)](forceRefresh);if(_0x3b7e87[_0x48d86e(0x124)]>0x0){const _0x2dd8d8=new Set(_0x1040ff['datasets'][_0x48d86e(0x110)](_0x517a45=>_0x517a45[_0x48d86e(0x12a)])),_0x22b57e=_0x1b48af['buildRelationsMap'](_0x3b7e87);for(const _0x40d08c of _0x1040ff[_0x48d86e(0x10b)]){const _0x313931=_0x22b57e['get'](_0x40d08c[_0x48d86e(0x12a)]);if(_0x313931){const _0x379cee=_0x313931[_0x48d86e(0x125)][_0x48d86e(0x120)](_0x4eca98=>_0x2dd8d8[_0x48d86e(0x118)](_0x4eca98[_0x48d86e(0x11f)])),_0x4e01c3=_0x313931['incomingRelations'][_0x48d86e(0x120)](_0x11f9a5=>_0x11f9a5[_0x48d86e(0x10f)]&&_0x2dd8d8[_0x48d86e(0x118)](_0x11f9a5[_0x48d86e(0x10f)]));_0x40d08c[_0x48d86e(0x122)]={'outgoing':_0x379cee,'incoming':_0x4e01c3,'totalCount':_0x379cee[_0x48d86e(0x117)]+_0x4e01c3['length']};}else _0x40d08c[_0x48d86e(0x122)]={'outgoing':[],'incoming':[],'totalCount':0x0};}}}catch(_0x1e4d49){shouldLog()&&console['warn'](_0x48d86e(0x119),_0x1e4d49);}return _0x1040ff;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e07be,_0x527ec9){const _0x25d701=a17_0x44ae,_0x1774cc=_0x4e07be();while(!![]){try{const _0x3e23e4=-parseInt(_0x25d701(0x1b4))/0x1*(-parseInt(_0x25d701(0x1b2))/0x2)+-parseInt(_0x25d701(0x1c7))/0x3+parseInt(_0x25d701(0x1b9))/0x4*(parseInt(_0x25d701(0x1c3))/0x5)+-parseInt(_0x25d701(0x1d2))/0x6+-parseInt(_0x25d701(0x19f))/0x7+parseInt(_0x25d701(0x1d1))/0x8+-parseInt(_0x25d701(0x1c1))/0x9*(-parseInt(_0x25d701(0x1cf))/0xa);if(_0x3e23e4===_0x527ec9)break;else _0x1774cc['push'](_0x1774cc['shift']());}catch(_0x430082){_0x1774cc['push'](_0x1774cc['shift']());}}}(a17_0x2d41,0x3fc7a));import{DevApiClient}from'../api/dev-api-client.js';function a17_0x44ae(_0x465756,_0x561891){_0x465756=_0x465756-0x19b;const _0x2d4187=a17_0x2d41();let _0x44aee5=_0x2d4187[_0x465756];return _0x44aee5;}import{getEnvAppCode,getEnvironment}from'../config/env.js';export async function listSqlQueries(_0x4cbba8={}){const _0x226e0f=a17_0x44ae,{appCode:appCode=getEnvAppCode(),cookie:_0x238fe4,keyword:_0x5ba126,category:_0x5b9761,sqlCode:_0x4a7f2b,sqlName:_0xf9d9ca,pageSize:pageSize=0x3e7,currentPage:currentPage=0x1}=_0x4cbba8;if(!appCode)throw new Error(_0x226e0f(0x1b3));const _0xe562cf=new DevApiClient({'appCode':appCode,'cookie':_0x238fe4}),_0xc8fd06=getEnvironment();try{const _0x1e606=await _0xe562cf[_0x226e0f(0x1ac)]({'pageSize':pageSize,'currentPage':currentPage,'sqlCode':_0x4a7f2b,'sqlName':_0xf9d9ca}),_0x1da344=_0x1e606['data']||_0x1e606,_0x41481f=_0x1da344['tableData']||[],_0x400e94=_0x1da344['total']||_0x41481f[_0x226e0f(0x1a5)];let _0x301820=_0x41481f[_0x226e0f(0x1d0)](_0x243c23=>{const _0x94a1c7=_0x226e0f,_0x2e5252=_0x243c23[_0x94a1c7(0x1bb)]||appCode+'-'+(_0x243c23[_0x94a1c7(0x1d9)]||_0x243c23['id']),_0xa9e658=_0x243c23['sqlId']||_0x243c23['id'];let _0x329b7d;if(_0x243c23[_0x94a1c7(0x1a4)]||_0x243c23[_0x94a1c7(0x1a2)]){const _0x1f2c5b=_0x243c23[_0x94a1c7(0x1a4)]||_0x243c23['sql'],_0x50c55b=_0x1f2c5b[_0x94a1c7(0x1a8)](/[:$]\{?(\w+)\}?/g);if(_0x50c55b){const _0x5430e9=Array[_0x94a1c7(0x1ce)](new Set(_0x50c55b[_0x94a1c7(0x1d0)](_0x2051d9=>_0x2051d9[_0x94a1c7(0x1cb)](/[:${}]/g,''))));_0x329b7d=_0x5430e9[_0x94a1c7(0x1d0)](_0x33d7ae=>{const _0x47e301=_0x94a1c7;let _0x28e075=_0x47e301(0x1ae);if(_0x33d7ae[_0x47e301(0x1a7)]()['includes']('date')||_0x33d7ae[_0x47e301(0x1a7)]()[_0x47e301(0x1af)](_0x47e301(0x1d3)))_0x28e075='2024-01-01';else{if(_0x33d7ae[_0x47e301(0x1a7)]()[_0x47e301(0x1af)]('id'))_0x28e075=0x7b;else(_0x33d7ae[_0x47e301(0x1a7)]()['includes'](_0x47e301(0x1aa))||_0x33d7ae['toLowerCase']()[_0x47e301(0x1af)](_0x47e301(0x1bf)))&&(_0x28e075=0xa);}return{'name':_0x33d7ae,'type':_0x47e301(0x1d5),'required':!![],'description':_0x47e301(0x1b8)+_0x33d7ae,'example':_0x28e075};});}}const _0x162de4=_0x329b7d&&_0x329b7d[_0x94a1c7(0x1a5)]>0x0,_0x12218a=_0x162de4?_0x329b7d['reduce']((_0x1bf10d,_0x50609f)=>({..._0x1bf10d,[_0x50609f[_0x94a1c7(0x19b)]]:_0x50609f[_0x94a1c7(0x1c4)]}),{}):undefined,_0x1b00f9={'typescript':_0x94a1c7(0x1cd)+appCode+_0x94a1c7(0x1a6)+(_0xc8fd06||_0x94a1c7(0x1a0))+_0x94a1c7(0x1c6)+(_0x243c23['sqlName']||_0x243c23[_0x94a1c7(0x19b)]||'SQL\x20Query')+_0x94a1c7(0x1a3)+_0x2e5252+'\x27'+(_0x162de4?',\x20'+JSON[_0x94a1c7(0x1be)](_0x12218a,null,0x2):'')+_0x94a1c7(0x1d8),'description':'Execute\x20SQL\x20query:\x20'+(_0x243c23[_0x94a1c7(0x1ab)]||_0x243c23['name']||_0x94a1c7(0x1d6)),'important':['SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[]\x20}\x20-\x20Always\x20check\x20execSuccess\x20before\x20using\x20execResult','The\x20executeSql\x20method\x20accepts\x20two\x20parameters:\x20sqlCode\x20(string)\x20and\x20optional\x20params\x20(object)',_0x162de4?'This\x20SQL\x20requires\x20parameters:\x20'+_0x329b7d[_0x94a1c7(0x1d0)](_0x3b88ea=>_0x3b88ea[_0x94a1c7(0x19b)]+'\x20('+_0x3b88ea['type']+')')[_0x94a1c7(0x1c2)](',\x20'):'This\x20SQL\x20does\x20not\x20require\x20any\x20parameters','On\x20HTTP\x20error,\x20SDK\x20throws\x20LovrabetError\x20exception\x20-\x20use\x20try-catch\x20for\x20error\x20handling',_0x94a1c7(0x1bc)]},_0x22f511={'sqlCode':_0x2e5252,'sqlId':_0xa9e658,'name':_0x243c23['sqlName']||_0x243c23[_0x94a1c7(0x19b)]||_0x94a1c7(0x1bd)+_0xa9e658,'description':_0x243c23[_0x94a1c7(0x1a9)]||_0x243c23[_0x94a1c7(0x19c)],'category':_0x243c23['category']||_0x243c23['sqlType']||'other','sqlContent':_0x243c23[_0x94a1c7(0x1a4)]||_0x243c23['sql'],'parameters':_0x329b7d,'createdTime':_0x243c23['createdTime']||_0x243c23[_0x94a1c7(0x1ba)],'updatedTime':_0x243c23[_0x94a1c7(0x1b7)]||_0x243c23[_0x94a1c7(0x1d7)],'codeExample':_0x1b00f9};return _0x22f511;});if(_0x5ba126){const _0x5bcdfb=_0x5ba126[_0x226e0f(0x1a7)]();_0x301820=_0x301820[_0x226e0f(0x1c5)](_0x587b1d=>_0x587b1d[_0x226e0f(0x19b)][_0x226e0f(0x1a7)]()[_0x226e0f(0x1af)](_0x5bcdfb)||_0x587b1d['description']&&_0x587b1d[_0x226e0f(0x19c)][_0x226e0f(0x1a7)]()[_0x226e0f(0x1af)](_0x5bcdfb)||_0x587b1d[_0x226e0f(0x1bb)][_0x226e0f(0x1a7)]()[_0x226e0f(0x1af)](_0x5bcdfb)||_0x587b1d[_0x226e0f(0x1a4)]&&_0x587b1d[_0x226e0f(0x1a4)][_0x226e0f(0x1a7)]()[_0x226e0f(0x1af)](_0x5bcdfb));}_0x5b9761&&_0x5b9761!=='all'&&(_0x301820=_0x301820[_0x226e0f(0x1c5)](_0x4400d7=>_0x4400d7['category']&&_0x4400d7[_0x226e0f(0x1c8)]['toLowerCase']()===_0x5b9761[_0x226e0f(0x1a7)]()));const _0x1bf776=Math[_0x226e0f(0x1c0)](_0x301820[_0x226e0f(0x1a5)]/pageSize),_0x465954=_0x301820[_0x226e0f(0x1d4)]((currentPage-0x1)*pageSize,currentPage*pageSize),_0x2804e7=_0x465954[_0x226e0f(0x1a5)]>0x0?_0x465954[0x0]:null,_0x14cdad=_0x2804e7?_0x226e0f(0x1cc)+_0x2804e7['name']+'\x22\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27'+_0x2804e7['sqlCode']+_0x226e0f(0x1c9):'';return{'type':'sql_list','total':_0x301820['length'],'sqls':_0x465954,'pagination':{'currentPage':currentPage,'pageSize':pageSize,'totalPages':_0x1bf776},'usage':{'description':_0x226e0f(0x1ad)+_0x301820['length']+'\x20SQL\x20queries\x20for\x20application\x20'+appCode+_0x226e0f(0x1b5),'important':['IMPORTANT:\x20All\x20SQL\x20queries\x20use\x20the\x20same\x20execution\x20pattern\x20-\x20client.api.executeSql(sqlCode,\x20params)',_0x226e0f(0x1ca),_0x226e0f(0x19e),_0x226e0f(0x19d),_0x226e0f(0x1b0),'Each\x20SQL\x20query\x20above\x20includes\x20a\x20codeExample\x20field\x20with\x20complete\x20TypeScript\x20code\x20ready\x20to\x20use','For\x20more\x20customization,\x20use\x20generate_sql_code\x20tool\x20to\x20get\x20code\x20with\x20type\x20inference'],'example':_0x14cdad||_0x226e0f(0x1b1)}};}catch(_0x22d867){throw new Error(_0x226e0f(0x1a1)+_0x22d867[_0x226e0f(0x1b6)]);}}function a17_0x2d41(){const _0xe7682b=['\x27,\x0a\x20\x20env:\x20\x27','toLowerCase','match','sqlDesc','limit','sqlName','getCustomSqlList','Found\x20','value','includes','IMPORTANT:\x20Business\x20logic\x20errors\x20(SQL\x20failures)\x20are\x20returned\x20in\x20data.execError,\x20not\x20thrown','No\x20SQL\x20queries\x20found.\x20Check\x20your\x20appCode\x20and\x20authentication.','18GbExKO','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','28393kOCWNO','.\x20Each\x20SQL\x20includes\x20a\x20complete\x20code\x20example\x20showing\x20how\x20to\x20execute\x20it\x20using\x20the\x20SDK.','message','updatedTime','Parameter:\x20','12DvWEzU','createTime','sqlCode','The\x20execResult\x20contains\x20an\x20array\x20of\x20row\x20objects\x20matching\x20your\x20SQL\x20query\x20structure','SQL-','stringify','count','ceil','153imAFpG','join','312810nPCcbq','example','filter','\x27,\x0a});\x0a\x0a//\x20Execute\x20the\x20SQL\x20query:\x20','532740wDPMXG','category','\x27);\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);\x0a}\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];','IMPORTANT:\x20Always\x20check\x20data.execSuccess\x20before\x20using\x20data.execResult','replace','\x0a//\x20Example:\x20Using\x20SQL\x20\x22','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;\x0a\x0a//\x20Initialize\x20the\x20SDK\x20client\x0aconst\x20client\x20=\x20new\x20LovrabetClient({\x0a\x20\x20appCode:\x20\x27','from','279530lJcahn','map','1355080gDlsSd','1515126WFsnHR','time','slice','string','Custom\x20SQL','updateTime',');\x0a\x0a//\x20IMPORTANT:\x20Check\x20execution\x20status\x20before\x20using\x20results\x0aif\x20(!data.execSuccess)\x20{\x0a\x20\x20throw\x20new\x20Error(`SQL\x20execution\x20failed:\x20${data.execError\x20||\x20\x27Unknown\x20error\x27}`);\x0a}\x0a\x0a//\x20Process\x20the\x20results\x0aconst\x20results\x20=\x20data.execResult\x20||\x20[];\x0aconsole.log(`Retrieved\x20${results.length}\x20rows`);\x0a\x0a//\x20Use\x20the\x20data\x0aresults.forEach(row\x20=>\x20{\x0a\x20\x20console.log(row);\x0a});','sqlId','name','description','IMPORTANT:\x20Use\x20try-catch\x20to\x20handle\x20HTTP\x20errors\x20(network\x20issues,\x20auth\x20failures)','IMPORTANT:\x20The\x20SDK\x20returns\x20{\x20execSuccess:\x20boolean,\x20execResult?:\x20any[],\x20execError?:\x20string\x20}','2775262lsncNL','online','Failed\x20to\x20list\x20SQL\x20queries:\x20','sql','\x0aconst\x20data\x20=\x20await\x20client.api.executeSql(\x27','sqlContent','length'];a17_0x2d41=function(){return _0xe7682b;};return a17_0x2d41();}
|
package/dist/tools/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x882bc9,_0x14087e){const _0x10a5f8=a18_0x421f,_0x54787e=_0x882bc9();while(!![]){try{const _0x18f5dd=parseInt(_0x10a5f8(0x1dd))/0x1*(parseInt(_0x10a5f8(0x1c8))/0x2)+-parseInt(_0x10a5f8(0x1d7))/0x3+parseInt(_0x10a5f8(0x1cd))/0x4+parseInt(_0x10a5f8(0x1ca))/0x5*(-parseInt(_0x10a5f8(0x1d5))/0x6)+parseInt(_0x10a5f8(0x1de))/0x7*(parseInt(_0x10a5f8(0x1d9))/0x8)+-parseInt(_0x10a5f8(0x1e6))/0x9*(-parseInt(_0x10a5f8(0x1db))/0xa)+-parseInt(_0x10a5f8(0x1e5))/0xb;if(_0x18f5dd===_0x14087e)break;else _0x54787e['push'](_0x54787e['shift']());}catch(_0x52fc9e){_0x54787e['push'](_0x54787e['shift']());}}}(a18_0x2975,0xc7d27));function a18_0x2975(){const _0x32a0df=['createServer','object','86avBupV','listen','5lfbleu','headers','cookie','3193928yPpodP','Login\x20timeout\x20-\x20no\x20response\x20received\x20within\x205\x20minutes','text/html;\x20charset=utf-8','writeHead','\x20environment','https://g.yuntooai.com/cert/lovrabet-dev.json','Internal\x20server\x20error','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>Login\x20Successful</title></head>\x0a<body>\x0a\x20\x20<div>Login\x20successful!\x20You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20your\x20vibe\x20editor.</div>\x0a\x20\x20<script>\x0a\x20\x20\x20\x20setTimeout(()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20},\x202000);\x0a\x20\x20</script>\x0a</body>\x0a</html>','1248138DhiTUy','Already\x20logged\x20in\x20to\x20','164403MpUbnn','json','10761832uFiDKz','/api/auth/get-session','170JnDENa','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>Login\x20Failed</title></head>\x0a<body>\x0a\x20\x20<div\x20style=\x22color:\x20red;\x22>\x0a\x20\x20\x20\x20<h2>Login\x20Successful,\x20but\x20Failed\x20to\x20Save\x20Cookie</h2>\x0a\x20\x20\x20\x20<p>Error:\x20','36435tLfreT','7rhBbOF','end','/sign-in?redirect=','127.0.0.1','</p>\x0a\x20\x20\x20\x20<p>Please\x20check\x20file\x20permissions\x20for\x20~/.lovrabet/cookie</p>\x0a\x20\x20</div>\x0a</body>\x0a</html>','Please\x20open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20login:\x20','port','44319033suibzK','741114dcozxE','message','Failed\x20to\x20fetch\x20SSL\x20certificates\x20for\x20login\x20server','close','text/plain','Login\x20server\x20error:\x20','session','Login\x20successful\x20but\x20failed\x20to\x20save\x20cookie:\x20','user','https://dev.lovrabet.com:'];a18_0x2975=function(){return _0x32a0df;};return a18_0x2975();}import*as a18_0x1757da from'node:https';function a18_0x421f(_0x335ce3,_0x541094){_0x335ce3=_0x335ce3-0x1c4;const _0x29750f=a18_0x2975();let _0x421fff=_0x29750f[_0x335ce3];return _0x421fff;}import{saveCookie}from'../auth/cookie-manager.js';import{isSessionValid}from'../auth/session-validator.js';import{getUserDomain,getEnvironment}from'../config/env.js';export async function login(_0x385d81={}){const _0x103493=a18_0x421f,_0x38ba80=getEnvironment();if(await isSessionValid())return{'success':!![],'message':_0x103493(0x1d6)+_0x38ba80+_0x103493(0x1d1),'env':_0x38ba80};let _0x4b7814;try{const _0x2a9f00=await fetch(_0x103493(0x1d2));_0x4b7814=await _0x2a9f00[_0x103493(0x1d8)]();}catch(_0x4071cb){return{'success':![],'message':_0x103493(0x1e8),'env':_0x38ba80};}return new Promise(_0x3f3ba2=>{const _0x14876d=_0x103493;let _0x4d4a72=0x0;const _0xa96c7=a18_0x1757da[_0x14876d(0x1c6)](_0x4b7814,async(_0x4906d1,_0x3a1350)=>{const _0x188baa=_0x14876d,_0x179c5c=getUserDomain(),_0x174ddd=_0x4906d1[_0x188baa(0x1cb)][_0x188baa(0x1cc)]||'';try{const _0x4f9e9e=await fetch(_0x179c5c+_0x188baa(0x1da),{'headers':{'cookie':_0x174ddd}}),_0x598cbc=await _0x4f9e9e[_0x188baa(0x1d8)](),_0x26b5ab=_0x598cbc&&_0x598cbc[_0x188baa(0x1ec)]&&_0x598cbc[_0x188baa(0x1c4)];if(_0x26b5ab){try{saveCookie(_0x174ddd);}catch(_0x579240){const _0x4576a0=_0x188baa(0x1dc)+_0x579240[_0x188baa(0x1e7)]+_0x188baa(0x1e2);_0x3a1350[_0x188baa(0x1d0)](0x1f4,{'Content-Type':_0x188baa(0x1cf)}),_0x3a1350[_0x188baa(0x1df)](_0x4576a0),_0xa96c7['close'](),_0x3f3ba2({'success':![],'message':_0x188baa(0x1ed)+_0x579240[_0x188baa(0x1e7)],'env':_0x38ba80});return;}const _0x573f77=_0x188baa(0x1d4);_0x3a1350[_0x188baa(0x1d0)](0xc8,{'Content-Type':_0x188baa(0x1cf)}),_0x3a1350[_0x188baa(0x1df)](_0x573f77),_0xa96c7[_0x188baa(0x1e9)](),_0x3f3ba2({'success':!![],'message':'Successfully\x20logged\x20in\x20to\x20'+_0x38ba80+_0x188baa(0x1d1),'env':_0x38ba80});}else{const _0x41c49b=encodeURIComponent(_0x188baa(0x1c5)+_0x4d4a72);_0x3a1350[_0x188baa(0x1d0)](0x12e,{'location':_0x179c5c+_0x188baa(0x1e0)+_0x41c49b}),_0x3a1350[_0x188baa(0x1df)]();}}catch(_0x454bef){_0x3a1350['writeHead'](0x1f4,{'Content-Type':_0x188baa(0x1ea)}),_0x3a1350['end'](_0x188baa(0x1d3)),_0xa96c7['close'](),_0x3f3ba2({'success':![],'message':'Login\x20server\x20error','env':_0x38ba80});}});_0xa96c7[_0x14876d(0x1c9)](0x0,_0x14876d(0x1e1),()=>{const _0x23d618=_0x14876d,_0x2691c0=_0xa96c7['address']();_0x4d4a72=typeof _0x2691c0===_0x23d618(0x1c7)&&_0x2691c0?_0x2691c0[_0x23d618(0x1e4)]:0x0;const _0x1acd24='https://dev.lovrabet.com:'+_0x4d4a72;_0x3f3ba2({'success':![],'message':_0x23d618(0x1e3)+_0x1acd24,'loginUrl':_0x1acd24,'env':_0x38ba80});}),_0xa96c7['on']('error',_0x4666ed=>{const _0x19350c=_0x14876d;_0x3f3ba2({'success':![],'message':_0x19350c(0x1eb)+_0x4666ed[_0x19350c(0x1e7)],'env':_0x38ba80});}),setTimeout(()=>{const _0x4c8c84=_0x14876d;_0xa96c7[_0x4c8c84(0x1e9)](),_0x3f3ba2({'success':![],'message':_0x4c8c84(0x1ce),'env':_0x38ba80});},0x5*0x3c*0x3e8);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a19_0x4e2b(){const _0x3af931=['sqlContent\x20is\x20required\x20and\x20cannot\x20be\x20empty.','sqlContent','1109090hxoMYb','name','success','SQL\x20content\x20cannot\x20be\x20empty','24hUZWVe','SQL\x20validation\x20failed:\x20','test','trim','toUpperCase','2346777GwkqcY','GRANT','sqlId','SELECT','UPDATE\x5cs+\x5cw+\x5cs+SET','4135290CIpRZT','EXEC','361RtzmRf','saveUserCustomSql','.\x20Only\x20SELECT\x20queries\x20are\x20allowed.','5084PKeZRW','startsWith','[saveCustomSql]\x20Verification\x20query\x20failed:','verified','2319kGssIu','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','2036364LNNiwi','sqlName','valid','Only\x20SELECT\x20queries\x20are\x20allowed.\x20The\x20SQL\x20must\x20start\x20with\x20SELECT\x20(after\x20any\x20comments).','createTime','Failed\x20to\x20save\x20custom\x20SQL','8674Oelhss','find','data','sql','split','warn','dbId\x20is\x20required.\x20Get\x20it\x20from\x20get_dataset_detail\x20->\x20basic.database.dbId','sqlCode','INSERT\x5cs+INTO','TRUNCATE','replace','DROP\x5cs+(TABLE|INDEX|DATABASE)','REVOKE','2078703vfqdfA','28BXMPyg','errorMsg'];a19_0x4e2b=function(){return _0x3af931;};return a19_0x4e2b();}(function(_0x4f33ab,_0x5a5588){const _0x1b617a=a19_0x470b,_0x698ca1=_0x4f33ab();while(!![]){try{const _0x5700fc=-parseInt(_0x1b617a(0xd0))/0x1*(-parseInt(_0x1b617a(0xae))/0x2)+parseInt(_0x1b617a(0xd7))/0x3*(parseInt(_0x1b617a(0xd3))/0x4)+-parseInt(_0x1b617a(0xce))/0x5+-parseInt(_0x1b617a(0xd9))/0x6*(parseInt(_0x1b617a(0xbc))/0x7)+parseInt(_0x1b617a(0xc4))/0x8*(parseInt(_0x1b617a(0xc9))/0x9)+-parseInt(_0x1b617a(0xc0))/0xa+-parseInt(_0x1b617a(0xbb))/0xb;if(_0x5700fc===_0x5a5588)break;else _0x698ca1['push'](_0x698ca1['shift']());}catch(_0x393f88){_0x698ca1['push'](_0x698ca1['shift']());}}}(a19_0x4e2b,0xce83b));import{DevApiClient}from'../api/dev-api-client.js';import{getEnvAppCode,getEnvironment,shouldLog}from'../config/env.js';function validateSelectSql(_0x25ecb7){const _0x252b73=a19_0x470b;if(!_0x25ecb7||typeof _0x25ecb7!=='string')return{'valid':![],'reason':_0x252b73(0xc3)};const _0x5623e5=_0x25ecb7[_0x252b73(0xb8)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x252b73(0xb8)](/@[^(\s]+(\([^)]*\))?/g,''),_0x39b428=_0x5623e5[_0x252b73(0xc7)](),_0x536835=_0x39b428[_0x252b73(0xb2)]('\x0a');let _0x4a63d1='';for(const _0x1f3ccd of _0x536835){const _0x22db23=_0x1f3ccd[_0x252b73(0xc7)]();if(!_0x22db23||_0x22db23['startsWith']('--')||_0x22db23[_0x252b73(0xd4)]('/*'))continue;_0x4a63d1=_0x22db23;break;}if(!_0x4a63d1[_0x252b73(0xc8)]()[_0x252b73(0xd4)](_0x252b73(0xcc)))return{'valid':![],'reason':_0x252b73(0xab)};const _0x133424=[_0x252b73(0xb6),_0x252b73(0xcd),'DELETE\x5cs+FROM',_0x252b73(0xb9),'ALTER\x5cs+(TABLE|DATABASE)','CREATE\x5cs+(TABLE|INDEX|DATABASE|VIEW)',_0x252b73(0xb7),_0x252b73(0xca),_0x252b73(0xba),_0x252b73(0xcf),'EXECUTE'],_0x1de708=_0x39b428[_0x252b73(0xc8)]();for(const _0x184ffa of _0x133424){const _0x425d51=new RegExp(_0x184ffa,'i');if(_0x425d51[_0x252b73(0xc6)](_0x1de708))return{'valid':![],'reason':'Forbidden\x20keyword\x20detected:\x20'+_0x184ffa['replace']('\x5c\x5cs+','\x20')+_0x252b73(0xd2)};}return{'valid':!![]};}function a19_0x470b(_0x166ec7,_0x686672){_0x166ec7=_0x166ec7-0xaa;const _0x4e2b20=a19_0x4e2b();let _0x470b84=_0x4e2b20[_0x166ec7];return _0x470b84;}export async function saveCustomSql(_0x203721){const _0x33e7b2=a19_0x470b,{appCode:appCode=getEnvAppCode(),cookie:_0x50c3c1,sqlName:_0xc5820d,dbId:_0x328570,sqlContent:_0x5b102c,verifyAfterSave:verifyAfterSave=!![]}=_0x203721;if(!appCode)throw new Error(_0x33e7b2(0xd8));if(!_0xc5820d||_0xc5820d['trim']()==='')throw new Error('sqlName\x20is\x20required\x20and\x20cannot\x20be\x20empty.');if(!_0x328570)throw new Error(_0x33e7b2(0xb4));if(!_0x5b102c||_0x5b102c[_0x33e7b2(0xc7)]()==='')throw new Error(_0x33e7b2(0xbe));const _0x8ec2cd=validateSelectSql(_0x5b102c);if(!_0x8ec2cd[_0x33e7b2(0xaa)])throw new Error(_0x33e7b2(0xc5)+_0x8ec2cd['reason']);const _0x25400e=new DevApiClient({'appCode':appCode,'cookie':_0x50c3c1}),_0x5d22ee=getEnvironment(),_0x1f9381=_0xc5820d['trim'](),_0x28d5cc=await _0x25400e[_0x33e7b2(0xd1)]({'sqlName':_0x1f9381,'dbId':_0x328570,'sqlContent':_0x5b102c['trim']()});if(!_0x28d5cc[_0x33e7b2(0xc2)])return{'success':![],'message':_0x28d5cc['message']||_0x28d5cc[_0x33e7b2(0xbd)]||_0x33e7b2(0xad)};const _0x4d08c2={'success':!![],'message':'Custom\x20SQL\x20saved\x20successfully','data':_0x28d5cc[_0x33e7b2(0xb0)]};if(verifyAfterSave)try{const _0x118249=await _0x25400e['getCustomSqlList']({'pageSize':0xa,'currentPage':0x1,'sqlName':_0x1f9381}),_0x5c1d74=_0x118249['data']?.['tableData']||[],_0x458fa1=_0x5c1d74[_0x33e7b2(0xaf)](_0xc17a55=>_0xc17a55[_0x33e7b2(0xda)]===_0x1f9381||_0xc17a55[_0x33e7b2(0xc1)]===_0x1f9381);_0x458fa1?_0x4d08c2[_0x33e7b2(0xd6)]={'found':!![],'sqlInfo':{'sqlCode':_0x458fa1[_0x33e7b2(0xb5)]||appCode+'-'+(_0x458fa1[_0x33e7b2(0xcb)]||_0x458fa1['id']),'sqlId':_0x458fa1[_0x33e7b2(0xcb)]||_0x458fa1['id'],'name':_0x458fa1[_0x33e7b2(0xda)]||_0x458fa1[_0x33e7b2(0xc1)],'sqlContent':_0x458fa1[_0x33e7b2(0xbf)]||_0x458fa1[_0x33e7b2(0xb1)],'createdTime':_0x458fa1['createdTime']||_0x458fa1[_0x33e7b2(0xac)]}}:_0x4d08c2[_0x33e7b2(0xd6)]={'found':![]};}catch(_0x336173){shouldLog()&&console[_0x33e7b2(0xb3)](_0x33e7b2(0xd5),_0x336173),_0x4d08c2['verified']={'found':![]};}return _0x4d08c2;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c1857,_0x3a7506){const _0x435f03=a20_0x3951,_0xba31b9=_0x2c1857();while(!![]){try{const _0x13c689=-parseInt(_0x435f03(0x1f5))/0x1+-parseInt(_0x435f03(0x1d9))/0x2+parseInt(_0x435f03(0x1cb))/0x3+parseInt(_0x435f03(0x1f0))/0x4*(parseInt(_0x435f03(0x1c6))/0x5)+parseInt(_0x435f03(0x1df))/0x6*(parseInt(_0x435f03(0x1d1))/0x7)+-parseInt(_0x435f03(0x1c1))/0x8*(parseInt(_0x435f03(0x1dc))/0x9)+parseInt(_0x435f03(0x1ec))/0xa;if(_0x13c689===_0x3a7506)break;else _0xba31b9['push'](_0xba31b9['shift']());}catch(_0x32f86b){_0xba31b9['push'](_0xba31b9['shift']());}}}(a20_0x2809,0x208ca));import{DevApiClient}from'../api/dev-api-client.js';import{validateIsSelectOnly,parseSqlStructure,generateSqlSummary}from'../utils/sql-parser.js';function a20_0x3951(_0x191fc2,_0x2737d0){_0x191fc2=_0x191fc2-0x1be;const _0x2809cf=a20_0x2809();let _0x3951f4=_0x2809cf[_0x191fc2];return _0x3951f4;}import{getEnvAppCode,getEnvironment,shouldLog}from'../config/env.js';export async function saveOrUpdateCustomSql(_0x55a880){const _0xd60e69=a20_0x3951,_0x837122=Date[_0xd60e69(0x1e1)](),{appCode:appCode=getEnvAppCode(),cookie:_0x26489e,sqlName:_0x29ff6d,dbId:_0x370ad2,sqlContent:_0x307b70,id:_0x30cbd9,sqlCode:_0x1976fa,verifyAfterSave:verifyAfterSave=!![],validateSchema:validateSchema=![]}=_0x55a880;if(!appCode)throw new Error('appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.');if(!_0x29ff6d||_0x29ff6d['trim']()==='')throw new Error('sqlName\x20is\x20required\x20and\x20cannot\x20be\x20empty.');if(!_0x370ad2)throw new Error(_0xd60e69(0x1c3));if(!_0x307b70||_0x307b70[_0xd60e69(0x1e6)]()==='')throw new Error(_0xd60e69(0x1c5));const _0x1931b6=_0x30cbd9!==undefined&&_0x30cbd9>0x0||_0x1976fa!==undefined&&_0x1976fa[_0xd60e69(0x1e6)]()!=='';if(_0x1931b6){if(!_0x30cbd9)throw new Error(_0xd60e69(0x1dd));if(!_0x1976fa)throw new Error(_0xd60e69(0x1c7));}const _0x45add9=validateIsSelectOnly(_0x307b70);if(!_0x45add9['valid'])throw new Error(_0xd60e69(0x1d0)+_0x45add9[_0xd60e69(0x1be)]);const _0x1106a1=parseSqlStructure(_0x307b70),_0x2a9c3b=generateSqlSummary(_0x307b70),_0x3db906=new DevApiClient({'appCode':appCode,'cookie':_0x26489e}),_0x201973=getEnvironment(),_0x1ad466=_0x29ff6d[_0xd60e69(0x1e6)]();let _0xb64561;_0x1931b6?_0xb64561=await _0x3db906[_0xd60e69(0x1ed)]({'id':_0x30cbd9,'sqlCode':_0x1976fa[_0xd60e69(0x1e6)](),'sqlName':_0x1ad466,'dbId':_0x370ad2,'sqlContent':_0x307b70['trim']()}):_0xb64561=await _0x3db906[_0xd60e69(0x1e4)]({'sqlName':_0x1ad466,'dbId':_0x370ad2,'sqlContent':_0x307b70[_0xd60e69(0x1e6)]()});const _0x110740=Date[_0xd60e69(0x1e1)]()-_0x837122;if(!_0xb64561['success'])return{'success':![],'action':_0x1931b6?_0xd60e69(0x1e9):'created','message':_0xb64561[_0xd60e69(0x1d2)]||_0xb64561['errorMsg']||_0xd60e69(0x1f6)+(_0x1931b6?'update':_0xd60e69(0x1ee))+'\x20custom\x20SQL','nextSteps':[{'action':_0xd60e69(0x1d8),'tool':'login','reason':_0xd60e69(0x1c0)},{'action':_0xd60e69(0x1d7),'tool':_0xd60e69(0x1c4),'params':{'datasetCode':'<dataset-code>'},'reason':_0xd60e69(0x1f7)}]};const _0x47b5aa=_0xb64561[_0xd60e69(0x1cc)]?.[_0xd60e69(0x1e7)]||_0xb64561[_0xd60e69(0x1cc)]?.[_0xd60e69(0x1d4)],_0x3055aa=_0xb64561[_0xd60e69(0x1cc)]?.['sqlId']||_0xb64561[_0xd60e69(0x1cc)]?.['id'],_0x237ddf=[{'action':_0xd60e69(0x1d3),'tool':_0xd60e69(0x1ce),'params':{'sqlCode':_0x47b5aa||''},'reason':_0xd60e69(0x1f1),'priority':_0xd60e69(0x1c9)},{'action':'Generate\x20SDK\x20code\x20for\x20this\x20SQL','tool':_0xd60e69(0x1e5),'params':{'sqlCode':_0x47b5aa||''},'reason':_0xd60e69(0x1da),'priority':_0xd60e69(0x1e3)}],_0x3cbafe={'success':!![],'action':_0x1931b6?_0xd60e69(0x1e9):_0xd60e69(0x1f4),'message':_0x1931b6?_0xd60e69(0x1ea)+_0x1ad466+'\x22\x20updated\x20successfully\x20('+_0x2a9c3b+')':_0xd60e69(0x1ea)+_0x1ad466+'\x22\x20saved\x20successfully\x20('+_0x2a9c3b+')','nextSteps':_0x237ddf,'parsedStructure':{'tables':_0x1106a1[_0xd60e69(0x1f3)],'columns':_0x1106a1[_0xd60e69(0x1ef)][_0xd60e69(0x1eb)],'parameters':_0x1106a1[_0xd60e69(0x1cd)],'summary':_0x2a9c3b},'data':_0xb64561[_0xd60e69(0x1cc)]};if(verifyAfterSave)try{const _0x443313=await _0x3db906[_0xd60e69(0x1f9)]({'pageSize':0xa,'currentPage':0x1,'sqlName':_0x1ad466}),_0x15cb2e=_0x443313['data']?.['tableData']||[],_0x49495d=_0x15cb2e[_0xd60e69(0x1ca)](_0x42e6b7=>_0x42e6b7[_0xd60e69(0x1f2)]===_0x1ad466||_0x42e6b7[_0xd60e69(0x1de)]===_0x1ad466);_0x49495d?(_0x3cbafe['verified']={'found':!![],'sqlInfo':{'sqlCode':_0x49495d[_0xd60e69(0x1e7)]||appCode+'-'+(_0x49495d[_0xd60e69(0x1cf)]||_0x49495d['id']),'sqlId':_0x49495d[_0xd60e69(0x1cf)]||_0x49495d['id'],'id':_0x49495d['id'],'name':_0x49495d[_0xd60e69(0x1f2)]||_0x49495d['name'],'sqlContent':_0x49495d[_0xd60e69(0x1c2)]||_0x49495d[_0xd60e69(0x1c8)],'createdTime':_0x49495d[_0xd60e69(0x1e0)]||_0x49495d[_0xd60e69(0x1e8)],'updatedTime':_0x49495d['updatedTime']||_0x49495d[_0xd60e69(0x1d5)]}},_0x3cbafe[_0xd60e69(0x1d6)][_0xd60e69(0x1bf)]?.[_0xd60e69(0x1e7)]&&(_0x237ddf[0x0][_0xd60e69(0x1f8)]={'sqlCode':_0x3cbafe[_0xd60e69(0x1d6)][_0xd60e69(0x1bf)]['sqlCode']},_0x237ddf[0x1][_0xd60e69(0x1f8)]={'sqlCode':_0x3cbafe['verified'][_0xd60e69(0x1bf)][_0xd60e69(0x1e7)]})):_0x3cbafe[_0xd60e69(0x1d6)]={'found':![]};}catch(_0xab581c){shouldLog()&&console[_0xd60e69(0x1db)](_0xd60e69(0x1e2),_0xab581c),_0x3cbafe[_0xd60e69(0x1d6)]={'found':![]};}return _0x3cbafe;}function a20_0x2809(){const _0x28feb6=['length','2683100iMBKGV','updateUserCustomSql','save','columns','651432CvUicL','Execute\x20the\x20SQL\x20to\x20check\x20for\x20runtime\x20errors','sqlName','tables','created','184172JNNCvr','Failed\x20to\x20','Confirm\x20the\x20dbId\x20matches\x20the\x20database\x20you\x20want\x20to\x20use','params','getCustomSqlList','reason','sqlInfo','Ensure\x20you\x20are\x20logged\x20in\x20with\x20proper\x20permissions','648nPlCPY','sqlContent','dbId\x20is\x20required.\x20Get\x20it\x20from\x20get_dataset_detail\x20->\x20basic.database.dbId','get_dataset_detail','sqlContent\x20is\x20required\x20and\x20cannot\x20be\x20empty.','5KpSfUX','sqlCode\x20is\x20required\x20for\x20updating\x20existing\x20SQL.','sql','high','find','13857TJvNNK','data','parameters','execute_custom_sql','sqlId','SQL\x20validation\x20failed:\x20','7JtDwKP','message','Test\x20the\x20SQL\x20to\x20verify\x20it\x20works\x20correctly','code','updateTime','verified','Verify\x20database\x20ID\x20is\x20correct','Check\x20database\x20connection\x20and\x20permissions','53194WrmbJq','Get\x20ready-to-use\x20TypeScript\x20code\x20for\x20your\x20application','warn','21519bVusuE','id\x20is\x20required\x20for\x20updating\x20existing\x20SQL.','name','611850ghXJOd','createdTime','now','[saveOrUpdateCustomSql]\x20Verification\x20query\x20failed:','medium','saveUserCustomSql','generate_sql_code','trim','sqlCode','createTime','updated','Custom\x20SQL\x20\x22'];a20_0x2809=function(){return _0x28feb6;};return a20_0x2809();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xfd006c,_0x2b0e17){const _0x5cf1cc=a21_0x5e0c,_0x37a6ca=_0xfd006c();while(!![]){try{const _0x390f08=parseInt(_0x5cf1cc(0xaa))/0x1*(-parseInt(_0x5cf1cc(0xae))/0x2)+parseInt(_0x5cf1cc(0x9e))/0x3*(-parseInt(_0x5cf1cc(0xa1))/0x4)+parseInt(_0x5cf1cc(0xa3))/0x5*(parseInt(_0x5cf1cc(0xa6))/0x6)+-parseInt(_0x5cf1cc(0xb0))/0x7*(-parseInt(_0x5cf1cc(0xa4))/0x8)+parseInt(_0x5cf1cc(0xa5))/0x9+parseInt(_0x5cf1cc(0xa8))/0xa*(parseInt(_0x5cf1cc(0x9c))/0xb)+-parseInt(_0x5cf1cc(0xad))/0xc;if(_0x390f08===_0x2b0e17)break;else _0x37a6ca['push'](_0x37a6ca['shift']());}catch(_0x7698dc){_0x37a6ca['push'](_0x37a6ca['shift']());}}}(a21_0x1426,0x4ef4d));import{DevApiClient}from'../api/dev-api-client.js';function a21_0x1426(){const _0x4a0112=['1215isKyli','tableName','appCode\x20is\x20required.\x20Provide\x20it\x20as\x20parameter\x20or\x20set\x20LOVRABET_APP_CODE\x20environment\x20variable.','1711296duTFkG','910GWvjAk','datasets','154HmDXPO','2750NORhaZ','code','158988cRexXq','analyzeDatasetList','keyword\x20is\x20required','8hXyJaE','name','10PDFKxc','58416hYnivc','836442pavlHy','1356744FcVqOX','total','16760WbTiGG','searchDatasets'];a21_0x1426=function(){return _0x4a0112;};return a21_0x1426();}import{DatasetAnalyzer}from'../analyzer/dataset-analyzer.js';function a21_0x5e0c(_0x56021a,_0x369e82){_0x56021a=_0x56021a-0x9c;const _0x14260d=a21_0x1426();let _0x5e0c86=_0x14260d[_0x56021a];return _0x5e0c86;}import{getEnvAppCode,getEnvironment}from'../config/env.js';export async function searchDatasets(_0x7a9bca){const _0x20107d=a21_0x5e0c,{appCode:appCode=getEnvAppCode(),cookie:_0x4ad942,keyword:_0x56103f}=_0x7a9bca;if(!appCode)throw new Error(_0x20107d(0xac));if(!_0x56103f)throw new Error(_0x20107d(0xa0));const _0xb7634e=new DevApiClient({'appCode':appCode,'cookie':_0x4ad942}),_0x9b7d31=getEnvironment(),_0x380a2c=await _0xb7634e[_0x20107d(0xa9)](_0x56103f),_0x2b7b21=new DatasetAnalyzer(),_0x57fb20=_0x2b7b21[_0x20107d(0x9f)](_0x380a2c);return{'appCode':appCode,'env':_0x9b7d31,'keyword':_0x56103f,'total':_0x57fb20[_0x20107d(0xa7)],'datasets':_0x57fb20[_0x20107d(0xaf)]['map'](_0x213e99=>({'id':_0x213e99['id'],'name':_0x213e99[_0x20107d(0xa2)],'code':_0x213e99[_0x20107d(0x9d)],'tableName':_0x213e99[_0x20107d(0xab)],'description':_0x213e99['description']}))};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a22_0x42e3(){const _0x548071=['find','<dataset-code>','Need\x20dbId\x20from\x20dataset\x20detail\x20to\x20save\x20SQL','List\x20all\x20available\x20datasets','413bmxROc','typeLabel','Review\x20SQL\x20errors\x20and\x20fix','type','get_dataset_detail','Save\x20this\x20validated\x20SQL','[validateSqlContent]\x20Failed\x20to\x20fetch\x20schema\x20for\x20','length','push','SQL\x20validation\x20failed:\x20','Modify\x20SQL\x20to\x20be\x20a\x20SELECT\x20statement\x20only','TABLE_NOT_FOUND','code','data','490740BRBZxJ','SQL\x20validation\x20failed\x20(','error','getDatasetList','SQL\x20must\x20be\x20a\x20SELECT\x20statement','high','properties','612909lYeCEo','SQL\x20content\x20cannot\x20be\x20empty','Invalid\x20SQL','531BnJIHK','SQL\x20content\x20is\x20required','valid','<sql-name>','99726lJuetd','validate_sql_content','fixSteps','Find\x20the\x20correct\x20table\x20names\x20for\x20your\x20SQL','map','errors','warn','1516158hKSgLu','58744UcUTsZ','save_or_update_custom_sql','\x20error(s))','Provide\x20SQL\x20content\x20to\x20validate','SYNTAX_ERROR','1946892UZSxQz','tableName','trim','1537630EyPPZU','medium','reason','nextSteps','Only\x20SELECT\x20queries\x20are\x20allowed\x20for\x20custom\x20SQL','fieldCode','SQL_START','Get\x20dataset\x20details\x20to\x20find\x20correct\x20table/column\x20names','15ccFDkE','Fix\x20the\x20identified\x20errors\x20before\x20saving','some','tableData','SELECT\x20id,\x20name\x20FROM\x20customer\x20WHERE\x20status\x20=\x201'];a22_0x42e3=function(){return _0x548071;};return a22_0x42e3();}(function(_0x3afd70,_0x2256e0){const _0x1d14ad=a22_0x45dd,_0x9789cf=_0x3afd70();while(!![]){try{const _0x1d99de=-parseInt(_0x1d14ad(0x12e))/0x1+parseInt(_0x1d14ad(0x134))/0x2+-parseInt(_0x1d14ad(0x120))/0x3+-parseInt(_0x1d14ad(0x119))/0x4*(-parseInt(_0x1d14ad(0x102))/0x5)+parseInt(_0x1d14ad(0x127))/0x6*(parseInt(_0x1d14ad(0x10b))/0x7)+parseInt(_0x1d14ad(0x12f))/0x8*(parseInt(_0x1d14ad(0x123))/0x9)+-parseInt(_0x1d14ad(0x137))/0xa;if(_0x1d99de===_0x2256e0)break;else _0x9789cf['push'](_0x9789cf['shift']());}catch(_0x26265b){_0x9789cf['push'](_0x9789cf['shift']());}}}(a22_0x42e3,0xd7201));import{DevApiClient}from'../api/dev-api-client.js';import{validateIsSelectOnly,parseSqlStructure,validateSqlContent as a22_0x50be68,generateSqlSummary}from'../utils/sql-parser.js';import{createStructuredSqlError}from'../types/mcp-types.js';import{getEnvAppCode,shouldLog}from'../config/env.js';function a22_0x45dd(_0x179236,_0x291365){_0x179236=_0x179236-0xfb;const _0x42e302=a22_0x42e3();let _0x45ddfe=_0x42e302[_0x179236];return _0x45ddfe;}async function fetchSchemaInfo(_0x5439ba,_0x491c66){const _0x470607=a22_0x45dd,_0x528e68=[];for(const _0x1c765b of _0x5439ba){try{const _0x5af603=/^\d+$/['test'](_0x1c765b);let _0x342f95=_0x1c765b;if(!_0x5af603){const _0x5a81ff=await _0x491c66[_0x470607(0x11c)](),_0x5b6885=_0x5a81ff[_0x470607(0x118)]?.[_0x470607(0x105)]||[],_0x394a16=_0x5b6885[_0x470607(0x107)](_0x5edd1e=>_0x5edd1e[_0x470607(0x117)]===_0x1c765b);if(!_0x394a16)continue;_0x342f95=String(_0x394a16['id']);}const _0x3efa75=await _0x491c66['getDatasetDetail'](_0x342f95),_0x51ef99=_0x3efa75[_0x470607(0x118)]?.[_0x470607(0x135)]||'',_0xa9245b=_0x3efa75[_0x470607(0x118)]?.[_0x470607(0x11f)]||[],_0x75b613=_0xa9245b[_0x470607(0x12b)](_0x6173f4=>_0x6173f4[_0x470607(0x117)]||_0x6173f4[_0x470607(0xff)]);_0x51ef99&&_0x75b613[_0x470607(0x112)]>0x0&&_0x528e68['push']({'tableName':_0x51ef99,'columns':_0x75b613});}catch(_0x4525cf){shouldLog()&&console[_0x470607(0x12d)](_0x470607(0x111)+_0x1c765b+':',_0x4525cf);}}return _0x528e68;}export async function validateSqlContentTool(_0x45cd79){const _0xdb868d=a22_0x45dd,{appCode:appCode=getEnvAppCode(),cookie:_0xc7130b,sqlContent:_0x3f72de,dbId:_0x35e37d,validateSchemas:validateSchemas=[]}=_0x45cd79;if(!_0x3f72de||_0x3f72de[_0xdb868d(0x136)]()==='')return{'success':![],'message':_0xdb868d(0x124),'validation':{'valid':![],'isSelectOnly':![]},'nextSteps':[{'action':_0xdb868d(0x132),'tool':_0xdb868d(0x128),'reason':_0xdb868d(0x121)}]};const _0xadf795=validateIsSelectOnly(_0x3f72de);if(!_0xadf795['valid'])return{'success':![],'message':_0xdb868d(0x114)+_0xadf795['reason'],'validation':{'valid':![],'isSelectOnly':![],'errors':[createStructuredSqlError({'type':_0xdb868d(0x133),'location':_0xdb868d(0x100),'message':_0xadf795[_0xdb868d(0xfc)]||_0xdb868d(0x122),'severity':_0xdb868d(0x11b),'fixSteps':[{'description':_0xdb868d(0x11d),'example':_0xdb868d(0x106)}]})]},'nextSteps':[{'action':_0xdb868d(0x115),'tool':_0xdb868d(0x130),'reason':_0xdb868d(0xfe)}]};const _0x2b3e21=parseSqlStructure(_0x3f72de),_0x52eb47=generateSqlSummary(_0x3f72de);let _0x4fc6c0;if(validateSchemas[_0xdb868d(0x112)]>0x0&&appCode){const _0x46c351=new DevApiClient({'appCode':appCode,'cookie':_0xc7130b});_0x4fc6c0=await fetchSchemaInfo(validateSchemas,_0x46c351);}const _0x1ec31d=a22_0x50be68(_0x3f72de,_0x4fc6c0?{'tables':_0x4fc6c0}:undefined),_0x522367={'success':_0x1ec31d['valid']||!![],'message':_0x1ec31d[_0xdb868d(0x125)]?'SQL\x20validation\x20passed\x20('+_0x52eb47+')':_0xdb868d(0x11a)+(_0x1ec31d[_0xdb868d(0x12c)]?.[_0xdb868d(0x112)]||0x0)+_0xdb868d(0x131),'validation':{..._0x1ec31d,'parsedStructure':_0x2b3e21}},_0x38dc93=[];if(_0x1ec31d[_0xdb868d(0x125)])_0x35e37d?_0x38dc93[_0xdb868d(0x113)]({'action':_0xdb868d(0x110),'tool':_0xdb868d(0x130),'params':{'sqlName':_0xdb868d(0x126),'dbId':_0x35e37d,'sqlContent':_0x3f72de},'reason':'SQL\x20is\x20valid\x20and\x20ready\x20to\x20be\x20saved','priority':_0xdb868d(0x11e)}):_0x38dc93[_0xdb868d(0x113)]({'action':'Get\x20database\x20ID\x20to\x20save\x20this\x20SQL','tool':'get_dataset_detail','params':{'datasetCode':_0xdb868d(0x108)},'reason':_0xdb868d(0x109),'priority':_0xdb868d(0x11e)});else{_0x38dc93[_0xdb868d(0x113)]({'action':_0xdb868d(0x10d),'tool':_0xdb868d(0x128),'reason':_0xdb868d(0x103),'priority':_0xdb868d(0x11e)});for(const _0x154d65 of _0x1ec31d[_0xdb868d(0x12c)]||[]){if(_0x154d65[_0xdb868d(0x10e)]==='COLUMN_NOT_FOUND'||_0x154d65['type']===_0xdb868d(0x116)){const _0x1f5f68=_0x154d65[_0xdb868d(0x129)][0x0]?.['description']||_0x154d65[_0xdb868d(0x10c)];_0x38dc93[_0xdb868d(0x113)]({'action':_0xdb868d(0x101),'tool':_0xdb868d(0x10f),'params':{'datasetCode':_0xdb868d(0x108)},'reason':_0x1f5f68,'priority':_0xdb868d(0xfb)});break;}}}return!_0x1ec31d[_0xdb868d(0x125)]&&_0x1ec31d[_0xdb868d(0x12c)]?.[_0xdb868d(0x104)](_0xe71833=>_0xe71833['type']==='TABLE_NOT_FOUND')&&_0x38dc93[_0xdb868d(0x113)]({'action':_0xdb868d(0x10a),'tool':'list_datasets','reason':_0xdb868d(0x12a),'priority':_0xdb868d(0xfb)}),_0x522367[_0xdb868d(0xfd)]=_0x38dc93,_0x522367;}export{validateSqlContentTool as validateSqlContent};
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a23_0x4615(_0x15f497,_0x72101a){_0x15f497=_0x15f497-0x183;var _0x259acb=a23_0x259a();var _0x461536=_0x259acb[_0x15f497];return _0x461536;}(function(_0x27b292,_0x10c6a9){var _0x188fd7=a23_0x4615,_0x5cb22b=_0x27b292();while(!![]){try{var _0x73094c=-parseInt(_0x188fd7(0x185))/0x1+parseInt(_0x188fd7(0x183))/0x2+-parseInt(_0x188fd7(0x189))/0x3+-parseInt(_0x188fd7(0x186))/0x4+-parseInt(_0x188fd7(0x184))/0x5+-parseInt(_0x188fd7(0x18a))/0x6*(parseInt(_0x188fd7(0x187))/0x7)+parseInt(_0x188fd7(0x188))/0x8;if(_0x73094c===_0x10c6a9)break;else _0x5cb22b['push'](_0x5cb22b['shift']());}catch(_0x379f10){_0x5cb22b['push'](_0x5cb22b['shift']());}}}(a23_0x259a,0xf4023));export{createError,createAuthError,createMissingParamError,createDatasetNotFoundError,createSqlNotFoundError,createSqlValidationError,createStructuredSqlError,fromLovrabetError,SQL_ERROR_TYPE_LABELS}from'./mcp-types.js';function a23_0x259a(){var _0x19594f=['143394qjbNDT','3867818THfRqZ','6808510BXtCZc','32278npXkBk','3225380dXJuAe','490tIqKLd','26407568DbVLMP','1086423rMSLBJ'];a23_0x259a=function(){return _0x19594f;};return a23_0x259a();}
|