localsbnb-mcp-server 1.0.10 → 1.0.11
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/auth/apiKeyManager.js +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/permissionChecker.js +1 -1
- package/dist/client/cacheManager.js +1 -1
- package/dist/client/httpClient.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/retryHandler.js +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/tools.js +1 -1
- package/dist/index.js +1 -1
- package/dist/package.json +2 -2
- package/dist/server.js +1 -1
- package/dist/start.mjs +1 -1
- package/dist/tools/channels/getChannelDetails.js +1 -1
- package/dist/tools/channels/index.js +1 -1
- package/dist/tools/channels/listChannels.js +1 -1
- package/dist/tools/finance/analyzeRevenue.js +1 -1
- package/dist/tools/finance/index.js +1 -1
- package/dist/tools/finance/queryFinancialData.js +1 -1
- package/dist/tools/finance/queryOperationalData.js +1 -1
- package/dist/tools/finance/queryOperationalDataV2.js +1 -1
- package/dist/tools/orders/cancelOrder.js +1 -1
- package/dist/tools/orders/getOrderDetails.js +1 -1
- package/dist/tools/orders/getOrderDetailsV2.js +1 -1
- package/dist/tools/orders/index.js +1 -1
- package/dist/tools/orders/ordersGetShared.js +1 -1
- package/dist/tools/orders/queryInHouseOrders.js +1 -1
- package/dist/tools/orders/queryOrders.js +1 -1
- package/dist/tools/orders/queryOrdersByDateRange.js +1 -1
- package/dist/tools/orders/queryPreArrivalOrders.js +1 -1
- package/dist/tools/orders/queryPreDepartureOrders.js +1 -1
- package/dist/tools/orders/queryTodayOrders.js +1 -1
- package/dist/tools/rooms/batchUpdatePrices.js +1 -1
- package/dist/tools/rooms/index.js +1 -1
- package/dist/tools/rooms/queryRoomPrices.js +1 -1
- package/dist/tools/rooms/queryRoomStatusNew.js +1 -1
- package/dist/tools/rooms/queryTodayRoomStatus.js +1 -1
- package/dist/tools/rooms/updateRoomPrice.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/desensitize.js +1 -1
- package/dist/utils/errorHandler.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/logger.js +1 -1
- package/dist/utils/price.js +1 -1
- package/dist/utils/shanghaiDate.js +1 -1
- package/dist/utils/validator.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x26d9(_0x29a545,_0x1bdfba){const _0x5e4387=_0x5e43();return _0x26d9=function(_0x26d987,_0x8bc682){_0x26d987=_0x26d987-0x95;let _0x50f5aa=_0x5e4387[_0x26d987];return _0x50f5aa;},_0x26d9(_0x29a545,_0x1bdfba);}function _0x5e43(){const _0x1a8504=['setAPIKey','getScopes','split','getCampId','info','79767VzKKGp','APP_SECRET','hudsonAccessToken','hasAPIKey','Hudson\x20credentials\x20loaded\x20from\x20config','LUKEYUN_API_SCOPES','APP_ID','API\x20key\x20loaded\x20from\x20environment','trim','includes','campId','length','API\x20key\x20set','warn','1832931JAxSRt','getHudsonAccessToken','APP_SECRET\x20or\x20APP_ID\x20not\x20found\x20in\x20environment\x20variables','Hudson\x20credentials\x20set','scopes','apiKey','loadFromEnv','APP_ID\x20not\x20configured.\x20Please\x20set\x20APP_ID\x20environment\x20variable.','isConfigured','1673960pvVQof','3242JyGaWP','6bsFmwW','getAPIKey','11BhKrvm','env','isHudsonConfigured','map','52crLjnJ','18933020iwMpCr','4271393IzNZze','132vjesYI','6444296IRGFoq','API\x20key\x20not\x20found\x20in\x20environment\x20variables'];_0x5e43=function(){return _0x1a8504;};return _0x5e43();}(function(_0x189880,_0x51a7da){const _0xd1c076=_0x189880();while(!![]){try{const _0xdf193e=parseInt(_0x26d9(0xb2))/0x1*(-parseInt(_0x26d9(0xbc))/0x2)+-parseInt(_0x26d9(0x9a))/0x3*(parseInt(_0x26d9(0xb9))/0x4)+parseInt(_0x26d9(0xb1))/0x5*(parseInt(_0x26d9(0xb3))/0x6)+-parseInt(_0x26d9(0xbb))/0x7+-parseInt(_0x26d9(0xbd))/0x8+parseInt(_0x26d9(0xa8))/0x9+parseInt(_0x26d9(0xba))/0xa*(parseInt(_0x26d9(0xb5))/0xb);if(_0xdf193e===_0x51a7da)break;else _0xd1c076['push'](_0xd1c076['shift']());}catch(_0x4afdd8){_0xd1c076['push'](_0xd1c076['shift']());}}}(_0x5e43,0x6f6c4));import{logger}from'../utils/logger.js';export class APIKeyManager{[_0x26d9(0xad)]=null;['scopes']=[];[_0x26d9(0x9c)]=null;[_0x26d9(0xa4)]=null;[_0x26d9(0xae)](){this['apiKey']=process[_0x26d9(0xb6)]['LUKEYUN_API_KEY']||null;const _0x4c1a54=process[_0x26d9(0xb6)][_0x26d9(0x9f)];this[_0x26d9(0xac)]=_0x4c1a54?_0x4c1a54[_0x26d9(0x97)](',')[_0x26d9(0xb8)](_0x5ea3d2=>_0x5ea3d2[_0x26d9(0xa2)]()):[],this[_0x26d9(0x9c)]=process[_0x26d9(0xb6)][_0x26d9(0x9b)]||null,this[_0x26d9(0xa4)]=process[_0x26d9(0xb6)][_0x26d9(0xa0)]||null,!this[_0x26d9(0xad)]?logger[_0x26d9(0xa7)](_0x26d9(0xbe)):logger[_0x26d9(0x99)](_0x26d9(0xa1),{'hasScopes':this[_0x26d9(0xac)]['length']>0x0}),!this[_0x26d9(0x9c)]||!this[_0x26d9(0xa4)]?logger[_0x26d9(0xa7)](_0x26d9(0xaa)):logger[_0x26d9(0x99)]('Hudson\x20credentials\x20loaded\x20from\x20environment');}['loadFromConfig'](_0x17a5ac){this[_0x26d9(0xad)]=_0x17a5ac['apiKey']||null,this[_0x26d9(0xac)]=_0x17a5ac[_0x26d9(0xac)]||[],this[_0x26d9(0x9c)]=_0x17a5ac['hudsonAccessToken']||null,this[_0x26d9(0xa4)]=_0x17a5ac[_0x26d9(0xa4)]||null,this[_0x26d9(0xad)]&&logger['info']('API\x20key\x20loaded\x20from\x20config',{'hasScopes':this['scopes'][_0x26d9(0xa5)]>0x0}),this[_0x26d9(0x9c)]&&this['campId']&&logger[_0x26d9(0x99)](_0x26d9(0x9e));}[_0x26d9(0x95)](_0x348ce2,_0x4938a2){this[_0x26d9(0xad)]=_0x348ce2,this[_0x26d9(0xac)]=_0x4938a2||[],logger[_0x26d9(0x99)](_0x26d9(0xa6),{'hasScopes':this['scopes'][_0x26d9(0xa5)]>0x0});}['setHudsonCredentials'](_0x15fd2d,_0x3dfa16){this['hudsonAccessToken']=_0x15fd2d,this[_0x26d9(0xa4)]=_0x3dfa16,logger[_0x26d9(0x99)](_0x26d9(0xab));}[_0x26d9(0xb4)](){return this[_0x26d9(0xad)]||'';}[_0x26d9(0x9d)](){return this[_0x26d9(0xad)]!==null&&this['apiKey']!=='';}['hasScope'](_0x28980c){if(this[_0x26d9(0xac)][_0x26d9(0xa3)]('*'))return!![];return this[_0x26d9(0xac)]['includes'](_0x28980c);}[_0x26d9(0x96)](){return[...this[_0x26d9(0xac)]];}[_0x26d9(0xb0)](){return this[_0x26d9(0xad)]!==null;}[_0x26d9(0xb7)](){return this[_0x26d9(0x9c)]!==null&&this[_0x26d9(0xa4)]!==null;}[_0x26d9(0xa9)](){if(!this[_0x26d9(0x9c)])throw new Error('APP_SECRET\x20not\x20configured.\x20Please\x20set\x20APP_SECRET\x20environment\x20variable.');return this[_0x26d9(0x9c)];}[_0x26d9(0x98)](){if(!this[_0x26d9(0xa4)])throw new Error(_0x26d9(0xaf));return this[_0x26d9(0xa4)];}}
|
package/dist/auth/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f1810,_0x36bbd9){var _0x1df192=_0x4f1810();while(!![]){try{var _0x213f1f=parseInt(_0x1bfb(0x16a))/0x1*(-parseInt(_0x1bfb(0x15e))/0x2)+-parseInt(_0x1bfb(0x163))/0x3+-parseInt(_0x1bfb(0x167))/0x4*(parseInt(_0x1bfb(0x168))/0x5)+parseInt(_0x1bfb(0x165))/0x6*(-parseInt(_0x1bfb(0x161))/0x7)+parseInt(_0x1bfb(0x15f))/0x8*(-parseInt(_0x1bfb(0x162))/0x9)+-parseInt(_0x1bfb(0x160))/0xa*(-parseInt(_0x1bfb(0x166))/0xb)+parseInt(_0x1bfb(0x164))/0xc*(parseInt(_0x1bfb(0x169))/0xd);if(_0x213f1f===_0x36bbd9)break;else _0x1df192['push'](_0x1df192['shift']());}catch(_0x31a4ac){_0x1df192['push'](_0x1df192['shift']());}}}(_0x4ed9,0x466e7));function _0x1bfb(_0xb3e2c9,_0x5e62d9){var _0x4ed93c=_0x4ed9();return _0x1bfb=function(_0x1bfb60,_0xa44310){_0x1bfb60=_0x1bfb60-0x15e;var _0x2c9966=_0x4ed93c[_0x1bfb60];return _0x2c9966;},_0x1bfb(_0xb3e2c9,_0x5e62d9);}function _0x4ed9(){var _0x2d834c=['4GvAwtV','1133695FJRcxn','11230063UPKNis','59AOgFTC','606YYmOBU','159832NMagfo','790jKlqwo','14JpDcMD','171NSQZvn','1482402jQakAG','12khzXcJ','92844bgkZmf','79915htgGwR'];_0x4ed9=function(){return _0x2d834c;};return _0x4ed9();}export{APIKeyManager}from'./apiKeyManager.js';export{PermissionChecker}from'./permissionChecker.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1151f8,_0x36f166){const _0x1dfa77=_0x1151f8();while(!![]){try{const _0x4898dd=-parseInt(_0x5bc5(0x18f))/0x1*(parseInt(_0x5bc5(0x17e))/0x2)+parseInt(_0x5bc5(0x183))/0x3*(parseInt(_0x5bc5(0x178))/0x4)+-parseInt(_0x5bc5(0x195))/0x5*(-parseInt(_0x5bc5(0x189))/0x6)+-parseInt(_0x5bc5(0x197))/0x7*(-parseInt(_0x5bc5(0x182))/0x8)+parseInt(_0x5bc5(0x180))/0x9*(parseInt(_0x5bc5(0x199))/0xa)+-parseInt(_0x5bc5(0x18b))/0xb*(parseInt(_0x5bc5(0x184))/0xc)+-parseInt(_0x5bc5(0x18e))/0xd*(parseInt(_0x5bc5(0x198))/0xe);if(_0x4898dd===_0x36f166)break;else _0x1dfa77['push'](_0x1dfa77['shift']());}catch(_0x2f5006){_0x1dfa77['push'](_0x1dfa77['shift']());}}}(_0x1a06,0xe2be9));import{MCPError,ErrorCode,getPermissionDeniedMessage}from'../utils/errorHandler.js';function _0x1a06(){const _0x2f51f6=['query_today_orders','length','hasScope','getScopes','PERMISSION_DENIED','3392405QwXHiO','generic','2116051eDdzHT','209986UTBlaM','40Tumbkd','get_order_details_v2','4TDGdeq','query_pre_arrival_orders','finance','query_room_status_new','Permission\x20check\x20passed','hasAPIKey','14KumclP','keyManager','3391425flzVwD','query_pre_departure_orders','40ZjRbte','3359514ASOWfx','7008RTFHum','room_status','get_order_details','debug','some','6emETok','checkPermission','5346EQtUtR','isHudsonConfigured','query_in_house_orders','2470GALTtA','107815cVAZno'];_0x1a06=function(){return _0x2f51f6;};return _0x1a06();}function _0x5bc5(_0x5bf110,_0x5b2c29){const _0x1a0652=_0x1a06();return _0x5bc5=function(_0x5bc52d,_0x5cbfcb){_0x5bc52d=_0x5bc52d-0x177;let _0x5180bb=_0x1a0652[_0x5bc52d];return _0x5180bb;},_0x5bc5(_0x5bf110,_0x5b2c29);}import{logger}from'../utils/logger.js';function toolToPermissionDomain(_0x3b9cbb){switch(_0x3b9cbb){case _0x5bc5(0x190):case _0x5bc5(0x179):case _0x5bc5(0x18d):case _0x5bc5(0x181):case'query_orders_by_date_range':case _0x5bc5(0x177):case'query_orders':case _0x5bc5(0x186):return'orders';case'query_operational_data_v2':return _0x5bc5(0x17a);case'query_today_room_status':case _0x5bc5(0x17b):return _0x5bc5(0x185);case'query_room_prices':return'room_price';default:return _0x5bc5(0x196);}}export class PermissionChecker{[_0x5bc5(0x17f)];constructor(_0x5655e4){this[_0x5bc5(0x17f)]=_0x5655e4;}[_0x5bc5(0x18a)](_0x56c3ac,_0x2c8db3){if(_0x2c8db3[_0x5bc5(0x191)]===0x0)return;if(!this[_0x5bc5(0x17f)][_0x5bc5(0x17d)]()&&this['keyManager'][_0x5bc5(0x18c)]()){logger[_0x5bc5(0x187)]('Permission\x20check\x20passed\x20(Hudson\x20auth\x20only)',{'tool':_0x56c3ac,'requiredScopes':_0x2c8db3});return;}const _0x1fdd37=_0x2c8db3[_0x5bc5(0x188)](_0x1891c5=>this[_0x5bc5(0x17f)][_0x5bc5(0x192)](_0x1891c5));if(!_0x1fdd37){const _0x2b4418=this['keyManager'][_0x5bc5(0x193)](),_0x1ae448=toolToPermissionDomain(_0x56c3ac);logger['warn']('Permission\x20denied',{'tool':_0x56c3ac,'required':_0x2c8db3,'current':_0x2b4418,'domain':_0x1ae448});throw new MCPError(ErrorCode[_0x5bc5(0x194)],getPermissionDeniedMessage(_0x1ae448),{'tool':_0x56c3ac,'requiredScopes':_0x2c8db3,'currentScopes':_0x2b4418,'domain':_0x1ae448,'source':'路客云AI'});}logger[_0x5bc5(0x187)](_0x5bc5(0x17c),{'tool':_0x56c3ac,'scopes':_0x2c8db3});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x389207,_0x8a9f3e){const _0x2517cc=_0x389207();while(!![]){try{const _0x685053=parseInt(_0x1a67(0xe6))/0x1+parseInt(_0x1a67(0xe1))/0x2+parseInt(_0x1a67(0xdc))/0x3*(parseInt(_0x1a67(0xf1))/0x4)+-parseInt(_0x1a67(0xe0))/0x5+-parseInt(_0x1a67(0xda))/0x6*(-parseInt(_0x1a67(0xe4))/0x7)+-parseInt(_0x1a67(0xe2))/0x8*(parseInt(_0x1a67(0xdf))/0x9)+-parseInt(_0x1a67(0xeb))/0xa;if(_0x685053===_0x8a9f3e)break;else _0x2517cc['push'](_0x2517cc['shift']());}catch(_0x4e766a){_0x2517cc['push'](_0x2517cc['shift']());}}}(_0x1f72,0xb3314));function _0x1a67(_0x26f3a1,_0x306666){const _0x1f729d=_0x1f72();return _0x1a67=function(_0x1a67a7,_0x1be450){_0x1a67a7=_0x1a67a7-0xd8;let _0x4cc11a=_0x1f729d[_0x1a67a7];return _0x4cc11a;},_0x1a67(_0x26f3a1,_0x306666);}import{config}from'../config/index.js';function _0x1f72(){const _0x56d0f5=['generateKey','525916zLiMXn','Cache\x20expired','Cache\x20cleared','clear','Cache\x20set','13000EKzEnc','expiresAt','keys','Cache\x20deleted','set','data','4JnFscN','stringify','debug','get','now','join','18PnKmVN','ttl','3273195QmwJjI','cache','delete','18ncsnuI','7321530nXFDWs','23014KDFlSy','2655464vLnejE','enabled','2881564OQKnBi'];_0x1f72=function(){return _0x56d0f5;};return _0x1f72();}import{logger}from'../utils/logger.js';export class CacheManager{[_0x1a67(0xdd)]=new Map();[_0x1a67(0xf4)](_0x4c27c7){if(!config['cache']['enabled'])return null;const _0x65b160=this[_0x1a67(0xdd)]['get'](_0x4c27c7);if(!_0x65b160)return null;if(Date[_0x1a67(0xd8)]()>_0x65b160[_0x1a67(0xec)])return this[_0x1a67(0xdd)][_0x1a67(0xde)](_0x4c27c7),logger[_0x1a67(0xf3)](_0x1a67(0xe7),{'key':_0x4c27c7}),null;return logger['debug']('Cache\x20hit',{'key':_0x4c27c7}),_0x65b160[_0x1a67(0xf0)];}['set'](_0x49f90d,_0x378d9e,_0x519f8b){if(!config['cache'][_0x1a67(0xe3)])return;const _0x427da3=_0x519f8b||config[_0x1a67(0xdd)][_0x1a67(0xdb)];this['cache'][_0x1a67(0xef)](_0x49f90d,{'data':_0x378d9e,'expiresAt':Date[_0x1a67(0xd8)]()+_0x427da3}),logger[_0x1a67(0xf3)](_0x1a67(0xea),{'key':_0x49f90d,'ttl':_0x427da3});}[_0x1a67(0xde)](_0x9cfc5d){this['cache'][_0x1a67(0xde)](_0x9cfc5d),logger[_0x1a67(0xf3)](_0x1a67(0xee),{'key':_0x9cfc5d});}[_0x1a67(0xe9)](){this[_0x1a67(0xdd)][_0x1a67(0xe9)](),logger['debug'](_0x1a67(0xe8));}static[_0x1a67(0xe5)](_0x260a67,_0x1fc45d){const _0x1044c1=Object[_0x1a67(0xed)](_0x1fc45d)['sort']()['map'](_0x457d04=>_0x457d04+'='+JSON[_0x1a67(0xf2)](_0x1fc45d[_0x457d04]))[_0x1a67(0xd9)]('&');return _0x260a67+':'+_0x1044c1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x51db1d,_0x755857){const _0x5a1ba9=_0x51db1d();while(!![]){try{const _0x554fb5=-parseInt(_0x394e(0xe1))/0x1*(parseInt(_0x394e(0x10d))/0x2)+parseInt(_0x394e(0x108))/0x3*(parseInt(_0x394e(0xfa))/0x4)+parseInt(_0x394e(0x101))/0x5+-parseInt(_0x394e(0x11a))/0x6+-parseInt(_0x394e(0xe3))/0x7*(parseInt(_0x394e(0xee))/0x8)+parseInt(_0x394e(0x10a))/0x9*(parseInt(_0x394e(0xf0))/0xa)+parseInt(_0x394e(0xfd))/0xb;if(_0x554fb5===_0x755857)break;else _0x5a1ba9['push'](_0x5a1ba9['shift']());}catch(_0x31482a){_0x5a1ba9['push'](_0x5a1ba9['shift']());}}}(_0x9a16,0x4cc69));function _0x9a16(){const _0xdc0e48=['API\x20request','env','INTERNAL_ERROR','params','Request\x20interceptor\x20error','application/json','use','execute','4bbMfwC','API_ERROR','client','3322561kiXUVl','1.0.0','API\x20request\x20timeout','API密钥无效或已过期','1870615HAcfzB','method','status','debug','create','timeout','object','385068FsjLya','资源不存在','1423323pEcFGr','API_RATE_LIMIT','hudsonAccessToken','12bkRuqc','handleError','npm_package_version','API_NOT_FOUND','Request\x20configuration\x20error','retryHandler','AUTH_INVALID','interceptors','maxRetries','API\x20error\x20response','request','API_TIMEOUT','generic','1915398MIUzEz','response','PERMISSION_DENIED','delay','请求配置错误','apiKey','Authorization','API\x20response','81672aHeMqX','url','91WxKCfm','retry','data','api','error','headers','message','hudson-access-token','网络错误,请检查网络连接','ECONNABORTED','setupInterceptors','95528BiZdfs','服务器错误,请稍后重试','30jPdcMC','config'];_0x9a16=function(){return _0xdc0e48;};return _0x9a16();}import _0x4a8010 from'axios';import{config}from'../config/index.js';import{logger}from'../utils/logger.js';function _0x394e(_0x2917e6,_0x460953){const _0x9a1691=_0x9a16();return _0x394e=function(_0x394ecf,_0x1afe1f){_0x394ecf=_0x394ecf-0xdb;let _0x29a226=_0x9a1691[_0x394ecf];return _0x29a226;},_0x394e(_0x2917e6,_0x460953);}import{MCPError,ErrorCode}from'../utils/errorHandler.js';import{RetryHandler}from'./retryHandler.js';export class HTTPClient{[_0x394e(0xfc)];[_0x394e(0xde)];['hudsonAccessToken'];[_0x394e(0x112)];constructor(_0x2bf3d2,_0x14880f){this[_0x394e(0xde)]=_0x2bf3d2,this[_0x394e(0x10c)]=_0x14880f,this[_0x394e(0x112)]=new RetryHandler(config[_0x394e(0xe4)][_0x394e(0x115)],config['retry'][_0x394e(0xdc)]),this[_0x394e(0xfc)]=_0x4a8010[_0x394e(0x105)]({'baseURL':config[_0x394e(0xe6)]['baseURL'],'timeout':config['api'][_0x394e(0x106)],'headers':{'Content-Type':_0x394e(0xf7),'X-Client-Type':'mcp','X-Client-Version':process[_0x394e(0xf3)][_0x394e(0x10f)]||_0x394e(0xfe)}}),this[_0x394e(0xed)]();}[_0x394e(0xed)](){this[_0x394e(0xfc)][_0x394e(0x114)][_0x394e(0x117)][_0x394e(0xf8)](_0x5c8530=>{return this[_0x394e(0xde)]&&(_0x5c8530[_0x394e(0xe8)][_0x394e(0xdf)]='Bearer\x20'+this[_0x394e(0xde)]),this[_0x394e(0x10c)]&&(_0x5c8530[_0x394e(0xe8)][_0x394e(0xea)]=this[_0x394e(0x10c)]),logger[_0x394e(0x104)](_0x394e(0xf2),{'method':_0x5c8530[_0x394e(0x102)],'url':_0x5c8530['url'],'params':_0x5c8530[_0x394e(0xf5)]}),_0x5c8530;},_0x3563dd=>{return logger[_0x394e(0xe7)](_0x394e(0xf6),_0x3563dd),Promise['reject'](_0x3563dd);}),this[_0x394e(0xfc)][_0x394e(0x114)][_0x394e(0x11b)][_0x394e(0xf8)](_0x3b8eb6=>{return logger['debug'](_0x394e(0xe0),{'status':_0x3b8eb6[_0x394e(0x103)],'url':_0x3b8eb6['config'][_0x394e(0xe2)]}),_0x3b8eb6;},async _0x1a215b=>{return this[_0x394e(0x10e)](_0x1a215b);});}async[_0x394e(0x10e)](_0xe788e0){if(_0xe788e0[_0x394e(0x11b)]){const _0x487c2c=_0xe788e0[_0x394e(0x11b)]['status'],_0x26907a=_0xe788e0[_0x394e(0x11b)][_0x394e(0xe5)];logger[_0x394e(0xe7)](_0x394e(0x116),{'status':_0x487c2c,'url':_0xe788e0[_0x394e(0xf1)]?.[_0x394e(0xe2)],'message':_0x26907a[_0x394e(0xe9)]});switch(_0x487c2c){case 0x191:throw new MCPError(ErrorCode[_0x394e(0x113)],_0x394e(0x100),_0x26907a);case 0x193:throw new MCPError(ErrorCode[_0x394e(0xdb)],_0x26907a?.[_0x394e(0xe9)]||'权限不足',{..._0x26907a!=null&&typeof _0x26907a===_0x394e(0x107)?_0x26907a:{},'domain':_0x394e(0x119),'source':'路客云AI'});case 0x194:throw new MCPError(ErrorCode[_0x394e(0x110)],_0x394e(0x109),_0x26907a);case 0x1ad:throw new MCPError(ErrorCode[_0x394e(0x10b)],'请求频率过高,请稍后重试',_0x26907a);case 0x1f4:case 0x1f6:case 0x1f7:case 0x1f8:throw new MCPError(ErrorCode['API_ERROR'],_0x394e(0xef),_0x26907a);default:throw new MCPError(ErrorCode[_0x394e(0xfb)],_0x26907a[_0x394e(0xe9)]||'API错误:'+_0x487c2c,_0x26907a);}}else{if(_0xe788e0[_0x394e(0x117)]){logger[_0x394e(0xe7)](_0x394e(0xff),{'url':_0xe788e0[_0x394e(0xf1)]?.['url'],'timeout':config['api'][_0x394e(0x106)]});if(_0xe788e0['code']===_0x394e(0xec))throw new MCPError(ErrorCode[_0x394e(0x118)],'请求超时,请稍后重试');throw new MCPError(ErrorCode[_0x394e(0xfb)],_0x394e(0xeb));}else{logger[_0x394e(0xe7)](_0x394e(0x111),_0xe788e0);throw new MCPError(ErrorCode[_0x394e(0xf4)],_0x394e(0xdd));}}}async[_0x394e(0x117)](_0x1c858e){const _0x3fbb69={'method':_0x1c858e[_0x394e(0x102)],'url':_0x1c858e[_0x394e(0xe2)],'params':_0x1c858e[_0x394e(0xf5)],'data':_0x1c858e[_0x394e(0xe5)],'headers':_0x1c858e[_0x394e(0xe8)]};try{const _0x2b9278=await this[_0x394e(0x112)][_0x394e(0xf9)](()=>this[_0x394e(0xfc)][_0x394e(0x117)](_0x3fbb69));return _0x2b9278[_0x394e(0xe5)];}catch(_0x4fc185){throw _0x4fc185;}}}
|
package/dist/client/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x4f2d(_0x534027,_0x4b07e8){var _0x36efe1=_0x36ef();return _0x4f2d=function(_0x4f2dcd,_0x421745){_0x4f2dcd=_0x4f2dcd-0x1b0;var _0x38053b=_0x36efe1[_0x4f2dcd];return _0x38053b;},_0x4f2d(_0x534027,_0x4b07e8);}function _0x36ef(){var _0x55b12e=['6479CbMcdu','291tjAFmZ','105ChCvrB','3012PMBKhz','3815sGYtIf','3127120geQcfq','7516Ptrrdo','50643aHzvKp','10cIvhKV','40yiVizr','217910fyFRzx','145272ObNNKZ'];_0x36ef=function(){return _0x55b12e;};return _0x36ef();}(function(_0x22e836,_0x18fabf){var _0x52b524=_0x22e836();while(!![]){try{var _0xb0ff2f=parseInt(_0x4f2d(0x1b1))/0x1*(-parseInt(_0x4f2d(0x1b5))/0x2)+-parseInt(_0x4f2d(0x1ba))/0x3*(-parseInt(_0x4f2d(0x1b3))/0x4)+parseInt(_0x4f2d(0x1b7))/0x5+-parseInt(_0x4f2d(0x1b8))/0x6*(-parseInt(_0x4f2d(0x1bb))/0x7)+-parseInt(_0x4f2d(0x1b2))/0x8+parseInt(_0x4f2d(0x1b4))/0x9*(parseInt(_0x4f2d(0x1b6))/0xa)+-parseInt(_0x4f2d(0x1b9))/0xb*(-parseInt(_0x4f2d(0x1b0))/0xc);if(_0xb0ff2f===_0x18fabf)break;else _0x52b524['push'](_0x52b524['shift']());}catch(_0x3bfee9){_0x52b524['push'](_0x52b524['shift']());}}}(_0x36ef,0x554df));export{HTTPClient}from'./httpClient.js';export{RetryHandler}from'./retryHandler.js';export{CacheManager}from'./cacheManager.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x5b51(){const _0x1569c3=['1358833EESjRi','warn','response','1777100rprQXm','sleep','5968490NJfTJp','4InyPiT','ECONNRESET','baseDelay','237RoduqW','pow','maxRetries','ECONNABORTED','code','692478VBuqSa','283688TZuhVI','2578bMxOvr','45OInSIX','8057830xXTXNw','Request\x20failed,\x20retrying...\x20(attempt\x20','isRetryableError','18MXuJWh','status','36zliMKr'];_0x5b51=function(){return _0x1569c3;};return _0x5b51();}(function(_0x123516,_0x56c85c){const _0x5d1b49=_0x123516();while(!![]){try{const _0x56b32a=-parseInt(_0x5699(0x1d1))/0x1+-parseInt(_0x5699(0x1d3))/0x2*(parseInt(_0x5699(0x1cc))/0x3)+-parseInt(_0x5699(0x1c9))/0x4*(-parseInt(_0x5699(0x1c6))/0x5)+parseInt(_0x5699(0x1c0))/0x6*(-parseInt(_0x5699(0x1c3))/0x7)+-parseInt(_0x5699(0x1d2))/0x8*(parseInt(_0x5699(0x1d4))/0x9)+-parseInt(_0x5699(0x1c8))/0xa+-parseInt(_0x5699(0x1d5))/0xb*(-parseInt(_0x5699(0x1c2))/0xc);if(_0x56b32a===_0x56c85c)break;else _0x5d1b49['push'](_0x5d1b49['shift']());}catch(_0x22de93){_0x5d1b49['push'](_0x5d1b49['shift']());}}}(_0x5b51,0x6230e));import{logger}from'../utils/logger.js';import{AxiosError}from'axios';function _0x5699(_0x55fa58,_0x18a510){const _0x5b51d7=_0x5b51();return _0x5699=function(_0x569936,_0x451e9c){_0x569936=_0x569936-0x1c0;let _0x121619=_0x5b51d7[_0x569936];return _0x121619;},_0x5699(_0x55fa58,_0x18a510);}export class RetryHandler{[_0x5699(0x1ce)];['baseDelay'];constructor(_0x10aad3=0x3,_0x12d530=0x3e8){this[_0x5699(0x1ce)]=_0x10aad3,this[_0x5699(0x1cb)]=_0x12d530;}async['execute'](_0xcad1b6){let _0x14d3ce;for(let _0x703e50=0x0;_0x703e50<=this[_0x5699(0x1ce)];_0x703e50++){try{return await _0xcad1b6();}catch(_0x27ba35){_0x14d3ce=_0x27ba35;if(_0x703e50===this['maxRetries'])break;if(!this[_0x5699(0x1d7)](_0x27ba35))throw _0x27ba35;const _0x2a135e=this[_0x5699(0x1cb)]*Math[_0x5699(0x1cd)](0x2,_0x703e50);logger[_0x5699(0x1c4)](_0x5699(0x1d6)+(_0x703e50+0x1)+'/'+this[_0x5699(0x1ce)]+')',{'error':_0x27ba35 instanceof Error?_0x27ba35['message']:String(_0x27ba35),'delay':_0x2a135e}),await this[_0x5699(0x1c7)](_0x2a135e);}}throw _0x14d3ce;}['isRetryableError'](_0x5bdb0a){if(_0x5bdb0a instanceof AxiosError){if(_0x5bdb0a['code']===_0x5699(0x1ca)||_0x5bdb0a['code']==='ETIMEDOUT'||_0x5bdb0a[_0x5699(0x1d0)]===_0x5699(0x1cf))return!![];if(_0x5bdb0a[_0x5699(0x1c5)]&&_0x5bdb0a[_0x5699(0x1c5)][_0x5699(0x1c1)]>=0x1f4)return!![];if(_0x5bdb0a[_0x5699(0x1c5)]&&_0x5bdb0a['response'][_0x5699(0x1c1)]===0x1ad)return!![];}return![];}[_0x5699(0x1c7)](_0x1f9ea4){return new Promise(_0x5df23b=>setTimeout(_0x5df23b,_0x1f9ea4));}}
|
package/dist/config/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x2427(_0x590726,_0x2d2f8a){const _0x3e4a6e=_0x3e4a();return _0x2427=function(_0x24272c,_0x5c1f63){_0x24272c=_0x24272c-0x137;let _0x493ada=_0x3e4a6e[_0x24272c];return _0x493ada;},_0x2427(_0x590726,_0x2d2f8a);}(function(_0x296972,_0x306dce){const _0x3a9ae3=_0x296972();while(!![]){try{const _0x511955=-parseInt(_0x2427(0x13b))/0x1+parseInt(_0x2427(0x13f))/0x2+parseInt(_0x2427(0x148))/0x3+parseInt(_0x2427(0x149))/0x4*(-parseInt(_0x2427(0x13c))/0x5)+parseInt(_0x2427(0x14a))/0x6*(-parseInt(_0x2427(0x153))/0x7)+-parseInt(_0x2427(0x142))/0x8+parseInt(_0x2427(0x14b))/0x9*(parseInt(_0x2427(0x13a))/0xa);if(_0x511955===_0x306dce)break;else _0x3a9ae3['push'](_0x3a9ae3['shift']());}catch(_0x5b2429){_0x3a9ae3['push'](_0x3a9ae3['shift']());}}}(_0x3e4a,0xd5b0f));function _0x3e4a(){const _0x4c8e39=['LOG_FORMAT','300000','6594GtdRYr','NODE_ENV','info','production','LOCALSBNB_LOG_TO_FILES','2090HdlJeh','48567sUhxSh','30fzvBEp','true','env','1258050MhxQeE','develop','config','12015424DCkqVG','1000','LOG_LEVEL','PORT','RETRY_DELAY','LUKEYUN_API_BASE_URL','1990191aWcXqK','1149164obkoXe','6834DLjOoI','169236qBjktb','CACHE_ENABLED','30000','development','json','API_TIMEOUT'];_0x3e4a=function(){return _0x4c8e39;};return _0x3e4a();}import _0x2413b2 from'dotenv';_0x2413b2[_0x2427(0x141)]();const resolvedEnv=process['env'][_0x2427(0x154)]||_0x2427(0x138);function resolveBaseURL(){if(process[_0x2427(0x13e)][_0x2427(0x147)])return process[_0x2427(0x13e)][_0x2427(0x147)];if(resolvedEnv===_0x2427(0x140)||resolvedEnv===_0x2427(0x14e))return'https://hudson-dev.localhome.cn';return'https://hudson-prod.localhome.cn';}export const config={'api':{'baseURL':resolveBaseURL(),'timeout':parseInt(process[_0x2427(0x13e)][_0x2427(0x150)]||_0x2427(0x14d),0xa)},'server':{'port':parseInt(process['env'][_0x2427(0x145)]||'3000',0xa),'env':resolvedEnv},'cache':{'enabled':process[_0x2427(0x13e)][_0x2427(0x14c)]==='true','ttl':parseInt(process[_0x2427(0x13e)]['CACHE_TTL']||_0x2427(0x152),0xa)},'retry':{'maxRetries':parseInt(process['env']['MAX_RETRIES']||'3',0xa),'delay':parseInt(process[_0x2427(0x13e)][_0x2427(0x146)]||_0x2427(0x143),0xa)},'log':{'level':process['env'][_0x2427(0x144)]||_0x2427(0x137),'format':process[_0x2427(0x13e)][_0x2427(0x151)]||_0x2427(0x14f),'toFiles':process[_0x2427(0x13e)][_0x2427(0x139)]==='1'||process[_0x2427(0x13e)][_0x2427(0x139)]===_0x2427(0x13d)}};
|
package/dist/config/tools.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x21f0a8,_0x5b9838){const _0x20f812=_0x21f0a8();while(!![]){try{const _0x49d940=-parseInt(_0x1a5e(0x12e))/0x1*(parseInt(_0x1a5e(0x151))/0x2)+parseInt(_0x1a5e(0x136))/0x3*(-parseInt(_0x1a5e(0x155))/0x4)+-parseInt(_0x1a5e(0x14f))/0x5*(-parseInt(_0x1a5e(0x12c))/0x6)+-parseInt(_0x1a5e(0x125))/0x7*(-parseInt(_0x1a5e(0x14c))/0x8)+parseInt(_0x1a5e(0x14b))/0x9*(-parseInt(_0x1a5e(0x122))/0xa)+parseInt(_0x1a5e(0x135))/0xb+parseInt(_0x1a5e(0x149))/0xc;if(_0x49d940===_0x5b9838)break;else _0x20f812['push'](_0x20f812['shift']());}catch(_0x44f80d){_0x20f812['push'](_0x20f812['shift']());}}}(_0x2c37,0x311cf));function _0x1a5e(_0xb0a4ae,_0x24478b){const _0x2c3739=_0x2c37();return _0x1a5e=function(_0x1a5e85,_0x176bf7){_0x1a5e85=_0x1a5e85-0x116;let _0x5cd161=_0x2c3739[_0x1a5e85];return _0x5cd161;},_0x1a5e(_0xb0a4ae,_0x24478b);}import*as _0x19d5e4 from'../tools/rooms/index.js';import*as _0x2745d4 from'../tools/orders/index.js';import*as _0x300a0a from'../tools/finance/index.js';function _0x2c37(){const _0x2a119d=['orders:read','日期,格式:YYYY-MM-DD,默认为当天','渠道ID列表(可选)','query_room_status_new','array','query_in_house_orders','last_week','queryPreDepartureOrdersHandler','在住订单(今日已入住)。固定调用\x20/orders/get\x20且\x20orderType=10。支持关键词:在住情况、在住订单、今日在住、今日已入住、已入住、今日在住订单。','this_week=本周自然周房价;last_week=上周自然周。与「滚动\x207\x20天」不同','关键字(可选)','30dybMKn','queryRoomStatusNewHandler','queryTodayRoomStatusHandler','2807ZYGYKE','预抵订单(今日待入住)。固定调用\x20/orders/get\x20且\x20orderType=11。支持关键词:预抵、预抵订单、今日待入住、今日预订订单、今天待入住、剩余待入住、今日预抵。','查询房价(渠道\x20RP、可配置天数价格)。用户说「本周房价」「上周房价」时必须传\x20timeRange=this_week\x20或\x20last_week(自然周周一至周日,上海时区),不要用「近7天」或默认\x20days=7\x20代替「本周」——否则日期区间错误。用户只说「近一周」「最近7天」且无「本周」字样时,可用\x20date+days(默认从当天起\x207\x20天)。支持关键词:查看房态日历价、房态日历价、日历价、房价、近期房价、本月房间、XXX天房价、今日房价查询、房价查询','每页数量,默认15,最大100','每页数量,默认10','今日订单(聚合事件):同时查询预抵(orderType=11)、在住(orderType=10)、预离(orderType=12)三组,并分别返回总数与明细。支持关键词:订单、今日订单情况、待办事项、待办、今日待办、待处理订单情况、订单情况。','string','2994WepinN','锚定日期\x20YYYY-MM-DD:单日统计时即业务日;与\x20timeRange\x20联用时表示「以该日所在周」为本周/上周(默认不传则为上海当天)','3056jsLptx','get_order_details_v2','this_week=锚定日所在自然周(周一至周日);last_week=上一完整自然周。与\x20startDate/endDate\x20二选一','queryOrdersByDateRangeHandler','query_room_prices','页码,默认1','订单ID','332222yPBoFE','610425tsZExD','查询今日(或指定日)房态汇总:房间状态、库存与保洁等,不含渠道房价。「查看房态日历价」指房价时请用\x20query_room_prices。支持关键词:今日房态、今日房态查询、今日房态统计、今日房态分析、今日房态报表、今日房态展示、今日房态可视化、今日房态仪表盘、今日房态报告、今日房态图表、今日房态表格、房态查询、房态','queryTodayOrdersHandler','查询开始日期\x20YYYY-MM-DD;与\x20endDate\x20配对','查询天数,默认30天;与\x20timeRange\x20互斥(传\x20timeRange\x20时固定为自然周\x207\x20天)','query_today_orders','开始日期\x20YYYY-MM-DD,默认当天;与\x20timeRange\x20联用时表示锚定日所在周','query_orders_by_date_range','与\x20timeRange\x20联用时为锚定日(默认上海当天)','预离订单(今日待退房)。固定调用\x20/orders/get\x20且\x20orderType=12。支持关键词:预离、预离订单、今日待退房、今日预离订单、今天待退房、剩余待退房、今日预离。','query_pre_departure_orders','number','this_week','自定义统计区间终点,需与\x20startDate\x20同时传','this_week=本周自然周;last_week=上周自然周。与\x20startDate/endDate\x20二选一','rooms:read','orderId','queryRoomPricesHandler','query_operational_data_v2','4009836REQatR','从\x20date\x20起连续天数;与\x20timeRange\x20互斥(传\x20timeRange\x20时固定为自然周\x207\x20天)','238851cTSFWD','472EoWTyM','object','date','995EkuYDA','queryOperationalDataV2Handler','2bhCwjk','查询结束日期\x20YYYY-MM-DD;与\x20startDate\x20配对','房源类型ID列表(可选)','按房型日历查询房态、可售与库存等(新接口)。与「房价/渠道价」无关:用户说「查看房态日历价」「房态日历价」指近期/渠道房价时,必须调用\x20query_room_prices,勿选本工具。用户说「本周」「上周」房态日历时必须传\x20timeRange=this_week\x20或\x20last_week(自然周周一至周日,上海时区),勿用「从今天起连续\x2030\x20天」代替本周。','4ydHVzi','query_today_room_status','模糊搜索:房源编码、房源简称、房源名称(可选)'];_0x2c37=function(){return _0x2a119d;};return _0x2c37();}export const toolDefinitions=[{'name':_0x1a5e(0x11a),'description':_0x1a5e(0x154),'inputSchema':{'type':_0x1a5e(0x14d),'properties':{'date':{'type':'string','format':_0x1a5e(0x14e),'description':'开始日期,格式:YYYY-MM-DD,默认为当天;与\x20timeRange\x20联用时表示锚定日所在周'},'days':{'type':_0x1a5e(0x141),'default':0x1e,'minimum':0x1,'description':_0x1a5e(0x13a)},'timeRange':{'type':_0x1a5e(0x12b),'enum':[_0x1a5e(0x142),_0x1a5e(0x11d)],'description':'this_week=本周自然周;last_week=上周自然周。与仅按天数的「近30天」不同'},'roomCategoryIds':{'type':_0x1a5e(0x11b),'items':{'type':_0x1a5e(0x141)},'description':_0x1a5e(0x153)},'roomCategoryGroupIds':{'type':_0x1a5e(0x11b),'items':{'type':_0x1a5e(0x141)},'description':'房源分组ID列表(可选)'},'channelIds':{'type':_0x1a5e(0x11b),'items':{'type':_0x1a5e(0x141)},'description':_0x1a5e(0x119)},'searchKey':{'type':_0x1a5e(0x12b),'description':_0x1a5e(0x116)},'pageNum':{'type':'number','default':0x1,'minimum':0x1,'description':_0x1a5e(0x133)},'pageSize':{'type':_0x1a5e(0x141),'default':0xf,'minimum':0x1,'maximum':0x64,'description':_0x1a5e(0x128)}},'required':[]},'handler':_0x19d5e4[_0x1a5e(0x123)],'requiredScopes':[_0x1a5e(0x145)]},{'name':_0x1a5e(0x156),'description':_0x1a5e(0x137),'inputSchema':{'type':'object','properties':{'date':{'type':_0x1a5e(0x12b),'format':_0x1a5e(0x14e),'description':_0x1a5e(0x118)}},'required':[]},'handler':_0x19d5e4[_0x1a5e(0x124)],'requiredScopes':[_0x1a5e(0x145)]},{'name':_0x1a5e(0x132),'description':_0x1a5e(0x127),'inputSchema':{'type':_0x1a5e(0x14d),'properties':{'date':{'type':'string','format':_0x1a5e(0x14e),'description':_0x1a5e(0x13c)},'days':{'type':_0x1a5e(0x141),'default':0x7,'minimum':0x1,'maximum':0x1e,'description':_0x1a5e(0x14a)},'timeRange':{'type':_0x1a5e(0x12b),'enum':[_0x1a5e(0x142),_0x1a5e(0x11d)],'description':_0x1a5e(0x120)}},'required':[]},'handler':_0x19d5e4[_0x1a5e(0x147)],'requiredScopes':['rooms:read']},{'name':_0x1a5e(0x13b),'description':_0x1a5e(0x12a),'inputSchema':{'type':_0x1a5e(0x14d),'properties':{'pageNum':{'type':'number','default':0x1,'minimum':0x1,'description':'页码,默认1'},'pageSize':{'type':_0x1a5e(0x141),'default':0xa,'minimum':0x1,'maximum':0x32,'description':_0x1a5e(0x129)},'keyword':{'type':_0x1a5e(0x12b),'description':_0x1a5e(0x121)}},'required':[]},'handler':_0x2745d4[_0x1a5e(0x138)],'requiredScopes':[_0x1a5e(0x117)]},{'name':'query_pre_arrival_orders','description':_0x1a5e(0x126),'inputSchema':{'type':'object','properties':{'pageNum':{'type':_0x1a5e(0x141),'default':0x1,'minimum':0x1,'description':'页码,默认1'},'pageSize':{'type':_0x1a5e(0x141),'default':0xa,'minimum':0x1,'maximum':0x32,'description':_0x1a5e(0x129)},'keyword':{'type':_0x1a5e(0x12b),'description':_0x1a5e(0x121)}},'required':[]},'handler':_0x2745d4['queryPreArrivalOrdersHandler'],'requiredScopes':[_0x1a5e(0x117)]},{'name':_0x1a5e(0x11c),'description':_0x1a5e(0x11f),'inputSchema':{'type':'object','properties':{'pageNum':{'type':'number','default':0x1,'minimum':0x1,'description':'页码,默认1'},'pageSize':{'type':_0x1a5e(0x141),'default':0xa,'minimum':0x1,'maximum':0x32,'description':_0x1a5e(0x129)},'keyword':{'type':_0x1a5e(0x12b),'description':'关键字(可选)'}},'required':[]},'handler':_0x2745d4['queryInHouseOrdersHandler'],'requiredScopes':[_0x1a5e(0x117)]},{'name':_0x1a5e(0x140),'description':_0x1a5e(0x13f),'inputSchema':{'type':_0x1a5e(0x14d),'properties':{'pageNum':{'type':'number','default':0x1,'minimum':0x1,'description':_0x1a5e(0x133)},'pageSize':{'type':_0x1a5e(0x141),'default':0xa,'minimum':0x1,'maximum':0x32,'description':_0x1a5e(0x129)},'keyword':{'type':'string','description':_0x1a5e(0x121)}},'required':[]},'handler':_0x2745d4[_0x1a5e(0x11e)],'requiredScopes':[_0x1a5e(0x117)]},{'name':_0x1a5e(0x13d),'description':'订单查询(日期范围事件)。支持按\x20startDate/endDate\x20或\x20timeRange(this_week/last_week)\x20查询,不与今日订单/预抵/在住/预离混用。支持关键词:订单查询、查询订单、某时间段订单。','inputSchema':{'type':'object','properties':{'startDate':{'type':_0x1a5e(0x12b),'description':_0x1a5e(0x139)},'endDate':{'type':_0x1a5e(0x12b),'description':_0x1a5e(0x152)},'timeRange':{'type':'string','enum':['this_week',_0x1a5e(0x11d)],'description':_0x1a5e(0x144)},'date':{'type':_0x1a5e(0x12b),'format':_0x1a5e(0x14e),'description':_0x1a5e(0x13e)},'pageNum':{'type':_0x1a5e(0x141),'default':0x1,'minimum':0x1,'description':'页码,默认1'},'pageSize':{'type':'number','default':0xa,'minimum':0x1,'maximum':0x32,'description':_0x1a5e(0x129)}},'required':[]},'handler':_0x2745d4[_0x1a5e(0x131)],'requiredScopes':[_0x1a5e(0x117)]},{'name':_0x1a5e(0x12f),'description':'根据订单ID查询订单详情信息。返回中含客人姓名字段,向用户回复时必须说明客人姓名(不得省略)。支持关键词:XXX订单详情、订单详情、订单详情查询、订单详情统计、订单详情分析、订单详情报表、订单详情展示、订单详情可视化、订单详情仪表盘、订单详情报告、订单详情图表、订单详情表格。用户可先通过今日订单获得订单号再查详情','inputSchema':{'type':_0x1a5e(0x14d),'properties':{'orderId':{'type':_0x1a5e(0x12b),'description':_0x1a5e(0x134)}},'required':[_0x1a5e(0x146)]},'handler':_0x2745d4['getOrderDetailsV2Handler'],'requiredScopes':[_0x1a5e(0x117)]},{'name':_0x1a5e(0x148),'description':'查询运营数据:夜审分页、首页实时、经营分析(含入住率\x20OCC、ADR、RevPAR\x20等)。「本周」「本周入住率」「本周经营」「上周收入」等必须按自然周传参:优先传\x20timeRange\x20为\x20this_week\x20或\x20last_week(周一~周日,上海时区);或显式传\x20startDate、endDate\x20为当周起止日。勿仅用单日\x20date\x20代替「本周」——否则经营分析区间错误。单日查询可只传\x20date(或\x20startDate=endDate=同一天)。支持关键词:当前运营情况、今天数据、数据、经营情况、运营数据、本周入住率、本周经营、上周数据等。若可呈现可视化表格则使用表格呈现','inputSchema':{'type':_0x1a5e(0x14d),'properties':{'date':{'type':_0x1a5e(0x12b),'format':_0x1a5e(0x14e),'description':_0x1a5e(0x12d)},'startDate':{'type':_0x1a5e(0x12b),'format':_0x1a5e(0x14e),'description':'自定义统计区间起点,需与\x20endDate\x20同时传'},'endDate':{'type':_0x1a5e(0x12b),'format':'date','description':_0x1a5e(0x143)},'timeRange':{'type':_0x1a5e(0x12b),'enum':['this_week','last_week'],'description':_0x1a5e(0x130)}},'required':[]},'handler':_0x300a0a[_0x1a5e(0x150)],'requiredScopes':['finance:read']}];
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
function
|
|
2
|
+
function _0x44c1(){const _0x4d2064=['9177CJjUjC','140dXWGkC','Unhandled\x20rejection','Failed\x20to\x20start\x20MCP\x20Server','3577232tsTewJ','start','179934CrkZpe','unhandledRejection','catch','8229969NNqetC','MCP\x20Server\x20connected\x20via\x20StdIO','4HPcord','513572qoHZHF','error','getServer','Fatal\x20error','485836UiXBNQ','5taDhkL','connect','exit','22836640rTsvrG','Uncaught\x20exception'];_0x44c1=function(){return _0x4d2064;};return _0x44c1();}(function(_0x532c45,_0x5a9391){const _0x1896e4=_0x532c45();while(!![]){try{const _0x4163c8=-parseInt(_0x385f(0x189))/0x1*(-parseInt(_0x385f(0x178))/0x2)+parseInt(_0x385f(0x17e))/0x3+parseInt(_0x385f(0x18a))/0x4*(-parseInt(_0x385f(0x179))/0x5)+parseInt(_0x385f(0x184))/0x6*(parseInt(_0x385f(0x17f))/0x7)+parseInt(_0x385f(0x182))/0x8+parseInt(_0x385f(0x187))/0x9+-parseInt(_0x385f(0x17c))/0xa;if(_0x4163c8===_0x5a9391)break;else _0x1896e4['push'](_0x1896e4['shift']());}catch(_0x4e313d){_0x1896e4['push'](_0x1896e4['shift']());}}}(_0x44c1,0x7ff11));import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{LukeyunMCPServer}from'./server.js';import{logger}from'./utils/logger.js';function _0x385f(_0x305396,_0x5eabd8){const _0x44c1b7=_0x44c1();return _0x385f=function(_0x385fd5,_0x390dde){_0x385fd5=_0x385fd5-0x176;let _0x292e73=_0x44c1b7[_0x385fd5];return _0x292e73;},_0x385f(_0x305396,_0x5eabd8);}async function main(){try{const _0x51cf72=new LukeyunMCPServer();await _0x51cf72[_0x385f(0x183)]();const _0x201d37=new StdioServerTransport();await _0x51cf72[_0x385f(0x176)]()[_0x385f(0x17a)](_0x201d37),logger['info'](_0x385f(0x188));}catch(_0x208390){logger[_0x385f(0x18b)](_0x385f(0x181),_0x208390 instanceof Error?_0x208390:new Error(String(_0x208390))),process[_0x385f(0x17b)](0x1);}}process['on']('uncaughtException',_0x37c799=>{logger[_0x385f(0x18b)](_0x385f(0x17d),_0x37c799),process[_0x385f(0x17b)](0x1);}),process['on'](_0x385f(0x185),_0x29f9c8=>{logger[_0x385f(0x18b)](_0x385f(0x180),new Error(String(_0x29f9c8))),process[_0x385f(0x17b)](0x1);}),main()[_0x385f(0x186)](_0x2e34a8=>{logger[_0x385f(0x18b)](_0x385f(0x177),_0x2e34a8 instanceof Error?_0x2e34a8:new Error(String(_0x2e34a8))),process[_0x385f(0x17b)](0x1);});
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "localsbnb-mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "LocalsBnb MCP Server",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"start": "node dist/index.js",
|
|
15
15
|
"test": "jest",
|
|
16
16
|
"test:watch": "jest --watch",
|
|
17
|
-
"test:api": "node test-api.js",
|
|
17
|
+
"test:api": "node scripts/dev/test-api.js",
|
|
18
18
|
"lint": "eslint src --ext .ts",
|
|
19
19
|
"lint:fix": "eslint src --ext .ts --fix",
|
|
20
20
|
"format": "prettier --write \"src/**/*.ts\"",
|
package/dist/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x44fe87,_0x3658fc){const _0x5acc99=_0x44fe87();while(!![]){try{const _0x8d359a=-parseInt(_0x585d(0x1c9))/0x1*(-parseInt(_0x585d(0x1e2))/0x2)+-parseInt(_0x585d(0x1e0))/0x3*(-parseInt(_0x585d(0x1b8))/0x4)+-parseInt(_0x585d(0x1da))/0x5*(parseInt(_0x585d(0x1bb))/0x6)+-parseInt(_0x585d(0x1df))/0x7*(-parseInt(_0x585d(0x1ca))/0x8)+parseInt(_0x585d(0x1b9))/0x9+parseInt(_0x585d(0x1d1))/0xa+parseInt(_0x585d(0x1d2))/0xb*(-parseInt(_0x585d(0x1d4))/0xc);if(_0x8d359a===_0x3658fc)break;else _0x5acc99['push'](_0x5acc99['shift']());}catch(_0x53f07c){_0x5acc99['push'](_0x5acc99['shift']());}}}(_0x2af5,0x6befe));import{Server}from'@modelcontextprotocol/sdk/server/index.js';import{ListToolsRequestSchema,CallToolRequestSchema}from'@modelcontextprotocol/sdk/types.js';import{toolDefinitions}from'./config/tools.js';import{APIKeyManager}from'./auth/apiKeyManager.js';function _0x2af5(){const _0x5ae75c=['764wAERox','inputSchema','info','apiKeyManager','isHudsonConfigured','length','isConfigured','handler','80iEgqtl','6549435HrmgcC','initialize','510UVfBeb','Tool\x20not\x20found:\x20','checkPermission','requiredScopes','apiClient','setRequestHandler','API\x20client\x20not\x20initialized','error','description','map','npm_package_version','name','permissionChecker','No\x20authentication\x20configured.\x20Please\x20set\x20either\x20LUKEYUN_API_KEY\x20or\x20APP_SECRET\x20and\x20APP_ID\x20environment\x20variables.','283kxVTCb','689704DgdVSN','1.0.0','getCampId','getServer','lukeyun-pms','start','getHudsonAccessToken','5288520ArYEWS','121WglieO','campId','1021668hSTDUV','loadFromEnv','env','onerror','setupHandlers','MCP\x20Server\x20started','44305BQeJYo','arguments','server','find','Tool\x20execution\x20error','49GrVQkT','24549mjhfwD','MCP\x20Server\x20error'];_0x2af5=function(){return _0x5ae75c;};return _0x2af5();}import{PermissionChecker}from'./auth/permissionChecker.js';import{HTTPClient}from'./client/httpClient.js';import{logger}from'./utils/logger.js';function _0x585d(_0xd72846,_0x2cc103){const _0x2af58b=_0x2af5();return _0x585d=function(_0x585dba,_0xa09381){_0x585dba=_0x585dba-0x1b5;let _0x254f46=_0x2af58b[_0x585dba];return _0x254f46;},_0x585d(_0xd72846,_0x2cc103);}export class LukeyunMCPServer{[_0x585d(0x1dc)];[_0x585d(0x1e5)];[_0x585d(0x1c7)];[_0x585d(0x1bf)]=null;['campId']=null;constructor(){this[_0x585d(0x1dc)]=new Server({'name':_0x585d(0x1ce),'version':process[_0x585d(0x1d6)][_0x585d(0x1c5)]||_0x585d(0x1cb)},{'capabilities':{'tools':{}}}),this[_0x585d(0x1e5)]=new APIKeyManager(),this[_0x585d(0x1c7)]=new PermissionChecker(this[_0x585d(0x1e5)]),this[_0x585d(0x1d8)]();}async[_0x585d(0x1ba)](){this[_0x585d(0x1e5)][_0x585d(0x1d5)]();if(!this[_0x585d(0x1e5)][_0x585d(0x1b6)]()&&!this[_0x585d(0x1e5)][_0x585d(0x1e6)]())throw new Error(_0x585d(0x1c8));this[_0x585d(0x1d3)]=this[_0x585d(0x1e5)][_0x585d(0x1e6)]()?this['apiKeyManager'][_0x585d(0x1cc)]():null;const _0x345f9b=this[_0x585d(0x1e5)]['getAPIKey'](),_0x2538e6=this[_0x585d(0x1e5)][_0x585d(0x1e6)]()?this[_0x585d(0x1e5)][_0x585d(0x1d0)]():undefined;if(!_0x2538e6&&!_0x345f9b)throw new Error('At\x20least\x20one\x20authentication\x20method\x20(API\x20key\x20or\x20Hudson\x20token)\x20must\x20be\x20configured.');this['apiClient']=new HTTPClient(_0x345f9b,_0x2538e6),logger[_0x585d(0x1e4)]('MCP\x20Server\x20initialized',{'hasAPIKey':this[_0x585d(0x1e5)]['hasAPIKey'](),'hasHudsonAuth':this[_0x585d(0x1e5)][_0x585d(0x1e6)](),'hasCampId':!!this['campId'],'scopes':this['apiKeyManager']['getScopes']()});}[_0x585d(0x1d8)](){this[_0x585d(0x1dc)][_0x585d(0x1c0)](ListToolsRequestSchema,async()=>{return{'tools':toolDefinitions[_0x585d(0x1c4)](_0x271016=>({'name':_0x271016[_0x585d(0x1c6)],'description':_0x271016[_0x585d(0x1c3)],'inputSchema':_0x271016[_0x585d(0x1e3)]}))};}),this['server'][_0x585d(0x1c0)](CallToolRequestSchema,async _0x3047e3=>{const _0x144b82=_0x3047e3['params']||{},_0x3379ef=_0x144b82[_0x585d(0x1c6)],_0x325129=_0x144b82[_0x585d(0x1db)]||{};logger['info']('Tool\x20called',{'tool':_0x3379ef,'args':_0x325129});const _0x4be338=toolDefinitions[_0x585d(0x1dd)](_0x391219=>_0x391219[_0x585d(0x1c6)]===_0x3379ef);if(!_0x4be338)throw new Error(_0x585d(0x1bc)+_0x3379ef);_0x4be338['requiredScopes']&&_0x4be338[_0x585d(0x1be)][_0x585d(0x1b5)]>0x0&&this[_0x585d(0x1c7)][_0x585d(0x1bd)](_0x3379ef,_0x4be338['requiredScopes']);if(!this[_0x585d(0x1bf)])throw new Error(_0x585d(0x1c1));const _0x155ea0={'apiClient':this['apiClient'],'logger':logger,'permissionChecker':this[_0x585d(0x1c7)],'campId':this[_0x585d(0x1d3)]||undefined};try{const _0x238258=await _0x4be338[_0x585d(0x1b7)](_0x325129||{},_0x155ea0);return _0x238258;}catch(_0x5ac82e){logger[_0x585d(0x1c2)](_0x585d(0x1de),_0x5ac82e instanceof Error?_0x5ac82e:new Error(String(_0x5ac82e)));throw _0x5ac82e;}}),this[_0x585d(0x1dc)][_0x585d(0x1d7)]=_0xaa53f6=>{logger[_0x585d(0x1c2)](_0x585d(0x1e1),_0xaa53f6);},logger[_0x585d(0x1e4)]('MCP\x20Server\x20handlers\x20setup\x20completed',{'toolCount':toolDefinitions[_0x585d(0x1b5)]});}async[_0x585d(0x1cf)](){await this['initialize'](),logger['info'](_0x585d(0x1d9));}[_0x585d(0x1cd)](){return this[_0x585d(0x1dc)];}}
|
package/dist/start.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
(function(
|
|
2
|
+
(function(_0x594fe6,_0x533508){const _0x571f43=_0x594fe6();while(!![]){try{const _0x491b66=-parseInt(_0x1258(0x167))/0x1*(-parseInt(_0x1258(0x157))/0x2)+-parseInt(_0x1258(0x15d))/0x3+-parseInt(_0x1258(0x162))/0x4*(-parseInt(_0x1258(0x15f))/0x5)+-parseInt(_0x1258(0x15b))/0x6+-parseInt(_0x1258(0x156))/0x7+parseInt(_0x1258(0x15c))/0x8*(-parseInt(_0x1258(0x15e))/0x9)+parseInt(_0x1258(0x163))/0xa*(parseInt(_0x1258(0x160))/0xb);if(_0x491b66===_0x533508)break;else _0x571f43['push'](_0x571f43['shift']());}catch(_0x3f26c8){_0x571f43['push'](_0x571f43['shift']());}}}(_0xb0ec,0xb85bc));import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{LukeyunMCPServer}from'./server.js';import{logger}from'./utils/logger.js';function _0x1258(_0x2f6872,_0x3fd096){const _0xb0ecaf=_0xb0ec();return _0x1258=function(_0x125871,_0x154d9f){_0x125871=_0x125871-0x156;let _0x288329=_0xb0ecaf[_0x125871];return _0x288329;},_0x1258(_0x2f6872,_0x3fd096);}async function main(){try{const _0x290e6a=new LukeyunMCPServer();await _0x290e6a[_0x1258(0x159)]();const _0x25129a=new StdioServerTransport();await _0x290e6a['getServer']()['connect'](_0x25129a),logger['info']('MCP\x20Server\x20connected\x20via\x20StdIO');}catch(_0x5db9ae){logger[_0x1258(0x165)](_0x1258(0x15a),_0x5db9ae instanceof Error?_0x5db9ae:new Error(String(_0x5db9ae))),process[_0x1258(0x168)](0x1);}}process['on'](_0x1258(0x164),_0x47c64a=>{logger['error'](_0x1258(0x166),_0x47c64a),process[_0x1258(0x168)](0x1);}),process['on'](_0x1258(0x169),_0x37aefc=>{logger[_0x1258(0x165)](_0x1258(0x161),new Error(String(_0x37aefc))),process[_0x1258(0x168)](0x1);}),main()[_0x1258(0x16a)](_0x23ed2d=>{logger[_0x1258(0x165)](_0x1258(0x158),_0x23ed2d instanceof Error?_0x23ed2d:new Error(String(_0x23ed2d))),process[_0x1258(0x168)](0x1);});function _0xb0ec(){const _0x2b633e=['8PJZRUF','4125966ZZOCpN','7966818FkxKwg','2950WtPPeB','21769kgXApj','Unhandled\x20rejection','8776MLSDBC','17930mKgBVo','uncaughtException','error','Uncaught\x20exception','3pwrLfA','exit','unhandledRejection','catch','7680379wgWUsB','134548GYUqIH','Fatal\x20error','start','Failed\x20to\x20start\x20MCP\x20Server','5590656ckaVgi'];_0xb0ec=function(){return _0x2b633e;};return _0xb0ec();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x2e3d(){const _0x15c3c4=['/api/v1/channels/','877700RfZGBV','info','Getting\x20channel\x20details','2710giFTVK','GET','34332441ngqPEo','1387757aPcjQl','220KrkfCN','1295opaBgF','80450SHBLsa','request','67288Rhcapm','channelId','Channel\x20details\x20retrieved','99VkvtmL','storeId','59016azYjWL','14730uGPXDY'];_0x2e3d=function(){return _0x15c3c4;};return _0x2e3d();}(function(_0x163b9b,_0x5cd83b){const _0x2c5085=_0x163b9b();while(!![]){try{const _0x239cc3=-parseInt(_0x594a(0x92))/0x1+parseInt(_0x594a(0x8c))/0x2+-parseInt(_0x594a(0x89))/0x3*(parseInt(_0x594a(0x93))/0x4)+-parseInt(_0x594a(0x8f))/0x5*(-parseInt(_0x594a(0x8a))/0x6)+-parseInt(_0x594a(0x94))/0x7*(parseInt(_0x594a(0x84))/0x8)+-parseInt(_0x594a(0x87))/0x9*(-parseInt(_0x594a(0x95))/0xa)+parseInt(_0x594a(0x91))/0xb;if(_0x239cc3===_0x5cd83b)break;else _0x2c5085['push'](_0x2c5085['shift']());}catch(_0x26e13c){_0x2c5085['push'](_0x2c5085['shift']());}}}(_0x2e3d,0xe8bf6));import{validateGetChannelDetailsParams}from'../../utils/validator.js';import{handleError,createSuccessResult}from'../../utils/errorHandler.js';function _0x594a(_0x5b67e4,_0x1a3cdf){const _0x2e3d3a=_0x2e3d();return _0x594a=function(_0x594a11,_0x550ed8){_0x594a11=_0x594a11-0x84;let _0x51b379=_0x2e3d3a[_0x594a11];return _0x51b379;},_0x594a(_0x5b67e4,_0x1a3cdf);}export const getChannelDetailsHandler=async(_0x5560c1,_0x58e0d4)=>{try{const {apiClient:_0x2919a1,logger:_0x36c0de,permissionChecker:_0x1cc93c}=_0x58e0d4;_0x1cc93c['checkPermission']('get_channel_details',['channels:read']);const _0x1e26ef=validateGetChannelDetailsParams(_0x5560c1);_0x36c0de['info'](_0x594a(0x8e),{'storeId':_0x1e26ef[_0x594a(0x88)],'channelId':_0x1e26ef[_0x594a(0x85)]});const _0x5330ce=await _0x2919a1[_0x594a(0x96)]({'method':_0x594a(0x90),'url':_0x594a(0x8b)+_0x1e26ef[_0x594a(0x85)],'params':{'store_id':_0x1e26ef[_0x594a(0x88)]}});return _0x36c0de[_0x594a(0x8d)](_0x594a(0x86),{'channelId':_0x1e26ef['channelId']}),createSuccessResult(_0x5330ce['data']);}catch(_0x14a778){return handleError(_0x14a778);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(
|
|
1
|
+
'use strict';(function(_0x5ec0e4,_0x4e5bcd){var _0xa69b6d=_0x5ec0e4();while(!![]){try{var _0x32f1f6=-parseInt(_0x5205(0x141))/0x1+parseInt(_0x5205(0x13a))/0x2*(parseInt(_0x5205(0x13c))/0x3)+-parseInt(_0x5205(0x13d))/0x4*(parseInt(_0x5205(0x13f))/0x5)+parseInt(_0x5205(0x142))/0x6+parseInt(_0x5205(0x13b))/0x7+parseInt(_0x5205(0x13e))/0x8+parseInt(_0x5205(0x140))/0x9*(-parseInt(_0x5205(0x139))/0xa);if(_0x32f1f6===_0x4e5bcd)break;else _0xa69b6d['push'](_0xa69b6d['shift']());}catch(_0xf4126c){_0xa69b6d['push'](_0xa69b6d['shift']());}}}(_0x5914,0x8e2b5));function _0x5205(_0x5a2eff,_0x100a7d){var _0x591414=_0x5914();return _0x5205=function(_0x520502,_0x142b08){_0x520502=_0x520502-0x139;var _0x110191=_0x591414[_0x520502];return _0x110191;},_0x5205(_0x5a2eff,_0x100a7d);}function _0x5914(){var _0x891e81=['1508596BXlNSo','6510264uBrqWp','15SILrWS','12303qhMfaR','995655BYHeVb','4544910ZaXlrM','970SOQyDB','1770OlAsWj','4397736QWRIcF','2178qDdmDi'];_0x5914=function(){return _0x891e81;};return _0x5914();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x59ad(){const _0x4db976=['9693jlfvvu','channels:read','186985fVJrsw','info','list_channels','storeId','1246300KFrbuZ','GET','462588vkWshq','data','/api/v1/channels','request','1044KJFqIT','6584Wgqwcq','1244cgRQZr','716805pcrqoB','102ggExBM','3572940jIfJDY'];_0x59ad=function(){return _0x4db976;};return _0x59ad();}(function(_0x80da38,_0x5044cb){const _0x5968c7=_0x80da38();while(!![]){try{const _0x3f03a7=parseInt(_0x3cd3(0x1a8))/0x1+-parseInt(_0x3cd3(0x1b3))/0x2+parseInt(_0x3cd3(0x1ab))/0x3*(parseInt(_0x3cd3(0x1a7))/0x4)+-parseInt(_0x3cd3(0x1ad))/0x5*(parseInt(_0x3cd3(0x1a9))/0x6)+-parseInt(_0x3cd3(0x1aa))/0x7+-parseInt(_0x3cd3(0x1a6))/0x8*(-parseInt(_0x3cd3(0x1b7))/0x9)+parseInt(_0x3cd3(0x1b1))/0xa;if(_0x3f03a7===_0x5044cb)break;else _0x5968c7['push'](_0x5968c7['shift']());}catch(_0x17db6c){_0x5968c7['push'](_0x5968c7['shift']());}}}(_0x59ad,0x89c39));import{validateListChannelsParams}from'../../utils/validator.js';function _0x3cd3(_0x78fb62,_0x4075e0){const _0x59ad8c=_0x59ad();return _0x3cd3=function(_0x3cd378,_0x4574f4){_0x3cd378=_0x3cd378-0x1a6;let _0x413970=_0x59ad8c[_0x3cd378];return _0x413970;},_0x3cd3(_0x78fb62,_0x4075e0);}import{handleError,createSuccessResult}from'../../utils/errorHandler.js';export const listChannelsHandler=async(_0x46e9f4,_0x1c422b)=>{try{const {apiClient:_0x3e3a60,logger:_0x34c9a7,permissionChecker:_0x383f63}=_0x1c422b;_0x383f63['checkPermission'](_0x3cd3(0x1af),[_0x3cd3(0x1ac)]);const _0x4ba280=validateListChannelsParams(_0x46e9f4);_0x34c9a7[_0x3cd3(0x1ae)]('Listing\x20channels',{'storeId':_0x4ba280[_0x3cd3(0x1b0)]});const _0x488665=await _0x3e3a60[_0x3cd3(0x1b6)]({'method':_0x3cd3(0x1b2),'url':_0x3cd3(0x1b5),'params':{'store_id':_0x4ba280[_0x3cd3(0x1b0)]}});return _0x34c9a7[_0x3cd3(0x1ae)]('Channels\x20listed\x20successfully',{'channelCount':_0x488665[_0x3cd3(0x1b4)]['channels']['length']}),createSuccessResult(_0x488665[_0x3cd3(0x1b4)]);}catch(_0x230bd6){return handleError(_0x230bd6);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x5c6a(_0x455868,_0x4f7851){const _0x5b79ca=_0x5b79();return _0x5c6a=function(_0x5c6a57,_0x251a93){_0x5c6a57=_0x5c6a57-0x19f;let _0x3e00d6=_0x5b79ca[_0x5c6a57];return _0x3e00d6;},_0x5c6a(_0x455868,_0x4f7851);}(function(_0x455a90,_0x593bc3){const _0x49ff82=_0x455a90();while(!![]){try{const _0x54c39=-parseInt(_0x5c6a(0x1a0))/0x1+parseInt(_0x5c6a(0x1a9))/0x2+-parseInt(_0x5c6a(0x1ac))/0x3+-parseInt(_0x5c6a(0x1b0))/0x4+-parseInt(_0x5c6a(0x1a2))/0x5+parseInt(_0x5c6a(0x1a3))/0x6*(-parseInt(_0x5c6a(0x1ab))/0x7)+-parseInt(_0x5c6a(0x1b3))/0x8*(-parseInt(_0x5c6a(0x1ad))/0x9);if(_0x54c39===_0x593bc3)break;else _0x49ff82['push'](_0x49ff82['shift']());}catch(_0xeb2aa1){_0x49ff82['push'](_0x49ff82['shift']());}}}(_0x5b79,0x7e0a8));import{validateAnalyzeRevenueParams}from'../../utils/validator.js';import{handleError,createSuccessResult}from'../../utils/errorHandler.js';function _0x5b79(){const _0x238744=['analyze_revenue','237424qOidcv','Analyzing\x20revenue','7NiYJsN','1945095qGhjIg','4428117oqMThQ','/api/v1/finance/analyze','Revenue\x20analysis\x20completed','1624356rNrhgQ','checkPermission','finance:read','40zkXOBN','info','398915PEAgkc','storeId','1992585OpqhIk','1263762sncGvc','endDate','data','startDate','GET'];_0x5b79=function(){return _0x238744;};return _0x5b79();}export const analyzeRevenueHandler=async(_0x4b613f,_0x1c3e22)=>{try{const {apiClient:_0x59fa37,logger:_0x4d11aa,permissionChecker:_0x89594d}=_0x1c3e22;_0x89594d[_0x5c6a(0x1b1)](_0x5c6a(0x1a8),[_0x5c6a(0x1b2)]);const _0x19e422=validateAnalyzeRevenueParams(_0x4b613f);_0x4d11aa[_0x5c6a(0x19f)](_0x5c6a(0x1aa),_0x19e422);const _0x439e1c=await _0x59fa37['request']({'method':_0x5c6a(0x1a7),'url':_0x5c6a(0x1ae),'params':{'store_id':_0x19e422[_0x5c6a(0x1a1)],'start_date':_0x19e422[_0x5c6a(0x1a6)],'end_date':_0x19e422[_0x5c6a(0x1a4)],'forecast_days':_0x19e422['forecastDays']}});return _0x4d11aa[_0x5c6a(0x19f)](_0x5c6a(0x1af)),createSuccessResult(_0x439e1c[_0x5c6a(0x1a5)]);}catch(_0x5252e2){return handleError(_0x5252e2);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1efa5f,_0x1f5a1a){var _0x4b8c96=_0x1efa5f();while(!![]){try{var _0x7108a6=parseInt(_0x2681(0x1da))/0x1+parseInt(_0x2681(0x1d8))/0x2*(parseInt(_0x2681(0x1d5))/0x3)+parseInt(_0x2681(0x1d6))/0x4+parseInt(_0x2681(0x1d9))/0x5+-parseInt(_0x2681(0x1d7))/0x6*(-parseInt(_0x2681(0x1d4))/0x7)+parseInt(_0x2681(0x1db))/0x8*(-parseInt(_0x2681(0x1dd))/0x9)+-parseInt(_0x2681(0x1dc))/0xa;if(_0x7108a6===_0x1f5a1a)break;else _0x4b8c96['push'](_0x4b8c96['shift']());}catch(_0x38f7c4){_0x4b8c96['push'](_0x4b8c96['shift']());}}}(_0x36c4,0x927d4));function _0x2681(_0x527a27,_0x26df95){var _0x36c479=_0x36c4();return _0x2681=function(_0x268171,_0x4f1738){_0x268171=_0x268171-0x1d4;var _0x105537=_0x36c479[_0x268171];return _0x105537;},_0x2681(_0x527a27,_0x26df95);}export{queryOperationalDataV2Handler}from'./queryOperationalDataV2.js';function _0x36c4(){var _0x33d79a=['384176tgdXtg','635272lIqOPx','13693830FdBBRD','9ninDSz','1155938OEwtfK','376284kuPdcx','275704dyFkGZ','6QCFXqU','14jjHAaJ','2762900ioyLaB'];_0x36c4=function(){return _0x33d79a;};return _0x36c4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x5832(){const _0x50c27c=['data','569948XmZdjL','129540lWXdNj','468gAeJui','760407qiqviR','3884928aaxEkX','endDate','info','Querying\x20financial\x20data','229911YPZLaO','10803090dKEcMk','6RtiWiJ','7SQOBEQ','checkPermission','query_financial_data','15069224VAeYIl','5AciLHv','GET','Financial\x20data\x20queried\x20successfully','630JyAXGM','/api/v1/finance/data'];_0x5832=function(){return _0x50c27c;};return _0x5832();}function _0x2766(_0x737724,_0x456d3d){const _0x5832b0=_0x5832();return _0x2766=function(_0x276630,_0x1b05c0){_0x276630=_0x276630-0xf5;let _0x25d61c=_0x5832b0[_0x276630];return _0x25d61c;},_0x2766(_0x737724,_0x456d3d);}(function(_0x48023b,_0x44e890){const _0x313449=_0x48023b();while(!![]){try{const _0x27067d=-parseInt(_0x2766(0xfb))/0x1+-parseInt(_0x2766(0x105))/0x2*(-parseInt(_0x2766(0xfe))/0x3)+parseInt(_0x2766(0xff))/0x4+parseInt(_0x2766(0xf5))/0x5*(parseInt(_0x2766(0x104))/0x6)+-parseInt(_0x2766(0x106))/0x7*(parseInt(_0x2766(0x109))/0x8)+-parseInt(_0x2766(0xf8))/0x9*(parseInt(_0x2766(0xfc))/0xa)+-parseInt(_0x2766(0x103))/0xb*(-parseInt(_0x2766(0xfd))/0xc);if(_0x27067d===_0x44e890)break;else _0x313449['push'](_0x313449['shift']());}catch(_0x4ce4ba){_0x313449['push'](_0x313449['shift']());}}}(_0x5832,0xf0f20));import{validateQueryFinancialDataParams}from'../../utils/validator.js';import{handleError,createSuccessResult}from'../../utils/errorHandler.js';export const queryFinancialDataHandler=async(_0x8b4321,_0x417f17)=>{try{const {apiClient:_0x55ea19,logger:_0x25812d,permissionChecker:_0x2138a9}=_0x417f17;_0x2138a9[_0x2766(0x107)](_0x2766(0x108),['finance:read']);const _0x19fc59=validateQueryFinancialDataParams(_0x8b4321);_0x25812d[_0x2766(0x101)](_0x2766(0x102),_0x19fc59);const _0x4b4328=await _0x55ea19['request']({'method':_0x2766(0xf6),'url':_0x2766(0xf9),'params':{'store_id':_0x19fc59['storeId'],'start_date':_0x19fc59['startDate'],'end_date':_0x19fc59[_0x2766(0x100)],'category':_0x19fc59['category']}});return _0x25812d[_0x2766(0x101)](_0x2766(0xf7)),createSuccessResult(_0x4b4328[_0x2766(0xfa)]);}catch(_0x27f99c){return handleError(_0x27f99c);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5ef3db,_0x53d352){const _0x2ebf8f=_0x5ef3db();while(!![]){try{const _0x1fe076=parseInt(_0x4cc9(0x129))/0x1+parseInt(_0x4cc9(0x13a))/0x2+-parseInt(_0x4cc9(0x12f))/0x3*(-parseInt(_0x4cc9(0x128))/0x4)+-parseInt(_0x4cc9(0x139))/0x5+parseInt(_0x4cc9(0x134))/0x6*(-parseInt(_0x4cc9(0x13b))/0x7)+-parseInt(_0x4cc9(0x136))/0x8*(parseInt(_0x4cc9(0x132))/0x9)+parseInt(_0x4cc9(0x131))/0xa*(parseInt(_0x4cc9(0x12b))/0xb);if(_0x1fe076===_0x53d352)break;else _0x2ebf8f['push'](_0x2ebf8f['shift']());}catch(_0x3da214){_0x2ebf8f['push'](_0x2ebf8f['shift']());}}}(_0x1370,0x7d912));function _0x4cc9(_0x4c6b2a,_0x4f565c){const _0x1370ef=_0x1370();return _0x4cc9=function(_0x4cc982,_0x2d3e06){_0x4cc982=_0x4cc982-0x126;let _0x23afd9=_0x1370ef[_0x4cc982];return _0x23afd9;},_0x4cc9(_0x4c6b2a,_0x4f565c);}import{validateQueryOperationalDataParams}from'../../utils/validator.js';function _0x1370(){const _0x1c045c=['type','4952352LTyOWw','request','query_operational_data','4366310COapns','886194QVONPm','2728138rOsMLS','endDate','startDate','finance:read','1948252vImoXx','566549ZKqdFW','/api/v1/operational/data','41063xbwhKc','Operational\x20data\x20queried\x20successfully','checkPermission','GET','3IySIMA','info','2410kQeaMo','9pIWAUb','storeId','6Stfimu'];_0x1370=function(){return _0x1c045c;};return _0x1370();}import{handleError,createSuccessResult}from'../../utils/errorHandler.js';export const queryOperationalDataHandler=async(_0x36d655,_0x300e3c)=>{try{const {apiClient:_0x4f8267,logger:_0x49a6f6,permissionChecker:_0x4c68da}=_0x300e3c;_0x4c68da[_0x4cc9(0x12d)](_0x4cc9(0x138),[_0x4cc9(0x127)]);const _0x275ef7=validateQueryOperationalDataParams(_0x36d655);_0x49a6f6[_0x4cc9(0x130)]('Querying\x20operational\x20data',_0x275ef7);const _0x230843=await _0x4f8267[_0x4cc9(0x137)]({'method':_0x4cc9(0x12e),'url':_0x4cc9(0x12a),'params':{'store_id':_0x275ef7[_0x4cc9(0x133)],'start_date':_0x275ef7[_0x4cc9(0x126)],'end_date':_0x275ef7[_0x4cc9(0x13c)],'type':_0x275ef7[_0x4cc9(0x135)]}});return _0x49a6f6['info'](_0x4cc9(0x12c)),createSuccessResult(_0x230843['data']);}catch(_0x4a3ffc){return handleError(_0x4a3ffc);}};
|